From af51c51708763dc0a8df0b7703ad896e001208eb Mon Sep 17 00:00:00 2001 From: "Matt Johnson (via Claude)" Date: Wed, 10 Jun 2026 06:53:48 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20dashboard=20layout=20=E2=80=94=20tabbed?= =?UTF-8?q?=20alerts/feed,=20tropo=20in=20middle=20row,=20fix=20emoji?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Active Alerts panel now has pill-style tab switcher (Active Alerts | Event Feed) - LiveEventFeed supports embedded mode (no card wrapper) for tab use - HepburnTropoCard moved from bottom row to middle row (replaces LiveEventFeed) - Bottom row removed (empty after tropo card move) - Fixed broken unicode escapes in BandConditionsCard (satellite, circle, moon emoji) Co-Authored-By: Claude Opus 4.6 --- dashboard-frontend/src/pages/Dashboard.tsx | 170 +++++++++++------- .../{index-DVlb83LX.js => index-BUzOKXu1.js} | 92 +++++----- ...{index-kJaaQ570.css => index-LGjCLdSa.css} | 2 +- meshai/dashboard/static/index.html | 4 +- 4 files changed, 150 insertions(+), 118 deletions(-) rename meshai/dashboard/static/assets/{index-DVlb83LX.js => index-BUzOKXu1.js} (89%) rename meshai/dashboard/static/assets/{index-kJaaQ570.css => index-LGjCLdSa.css} (69%) diff --git a/dashboard-frontend/src/pages/Dashboard.tsx b/dashboard-frontend/src/pages/Dashboard.tsx index 6ed1d8b..f7c4c59 100644 --- a/dashboard-frontend/src/pages/Dashboard.tsx +++ b/dashboard-frontend/src/pages/Dashboard.tsx @@ -159,16 +159,16 @@ function StatCard({ icon: Icon, label, value, subvalue }: { icon: typeof Radio; function BandConditionsCard({ bandConditions }: { bandConditions: BandConditionsStatus | null }) { const getRatingEmoji = (rating?: string) => { switch (rating) { - case 'Good': return '\ud83d\udfe2' // green circle - case 'Fair': return '\ud83d\udfe1' // yellow circle - case 'Poor': return '\ud83d\udd34' // red circle - default: return '\u2014' + case 'Good': return '๐ŸŸข' // green circle + case 'Fair': return '๐ŸŸก' // yellow circle + case 'Poor': return '๐Ÿ”ด' // red circle + default: return 'โ€”' } } const getSlotEmoji = (label?: string) => { if (!label) return '' - return label.includes('Night') ? '\ud83c\udf19' : '\u2600\ufe0f' + return label.includes('Night') ? '๐ŸŒ™' : 'โ˜€๏ธ' } if (!bandConditions?.enabled || !bandConditions?.ratings) { @@ -204,7 +204,7 @@ function BandConditionsCard({ bandConditions }: { bandConditions: BandConditions {/* Band conditions header */}
- \ud83d\udce1 Band Conditions: + ๐Ÿ“ก Band Conditions:
{/* Band rows */} @@ -215,7 +215,7 @@ function BandConditionsCard({ bandConditions }: { bandConditions: BandConditions
{band} - {getRatingEmoji(rating)} {rating || '\u2014'} + {getRatingEmoji(rating)} {rating || 'โ€”'}
) @@ -433,7 +433,7 @@ function EventFeedItem({ event, isLocal }: { event: EnvEvent; isLocal?: boolean } // Live Event Feed Card -function LiveEventFeed({ events, envStatus }: { events: EnvEvent[]; envStatus: EnvStatus | null }) { +function LiveEventFeed({ events, envStatus, embedded }: { events: EnvEvent[]; envStatus: EnvStatus | null; embedded?: boolean }) { // Severity order for sorting const severityOrder: Record = { immediate: 0, priority: 1, routine: 2 } @@ -473,13 +473,8 @@ function LiveEventFeed({ events, envStatus }: { events: EnvEvent[]; envStatus: E return { total, active, errors, secAgo } }, [envStatus]) - return ( -
-

- - Live Event Feed -

- + const content = ( + <> {sortedEvents.length > 0 ? (
{sortedEvents.map((event, i) => ( @@ -510,6 +505,18 @@ function LiveEventFeed({ events, envStatus }: { events: EnvEvent[]; envStatus: E )}
)} + + ) + + if (embedded) return
{content}
+ + return ( +
+

+ + Live Event Feed +

+ {content}
) } @@ -521,6 +528,7 @@ export default function Dashboard() { const [envStatus, setEnvStatus] = useState(null) const [envEvents, setEnvEvents] = useState([]) const [bandConditions, setBandConditions] = useState(null) + const [alertTab, setAlertTab] = useState<'alerts' | 'feed'>('alerts') const [loading, setLoading] = useState(true) const [error, setError] = useState(null) @@ -610,57 +618,85 @@ export default function Dashboard() { {/* Alerts + Stats */}
- {/* Active Alerts */} + {/* Active Alerts / Event Feed โ€” tabbed */}
-

Active Alerts

- {alerts.length > 0 ? ( -
- {alerts.map((alert, i) => ( - - ))} -
- ) : (() => { - const highSeverityEnv = envEvents - .filter(e => e.severity === 'immediate' || e.severity === 'priority') - .sort((a, b) => { - const ord: Record = { immediate: 0, priority: 1 } - const diff = (ord[a.severity] ?? 2) - (ord[b.severity] ?? 2) - if (diff !== 0) return diff - return (b.fetched_at || 0) - (a.fetched_at || 0) - }) - .slice(0, 5) - if (highSeverityEnv.length > 0) { - return ( +
+ + +
+ + {alertTab === 'alerts' ? ( + <> + {alerts.length > 0 ? (
- {highSeverityEnv.map((ev, i) => { - const sevStyle = ev.severity === 'immediate' - ? { bg: 'bg-red-500/10', border: 'border-red-500', icon: AlertCircle, iconColor: 'text-red-500' } - : { bg: 'bg-amber-500/10', border: 'border-amber-500', icon: AlertTriangle, iconColor: 'text-amber-500' } - const Icon = sevStyle.icon - return ( -
- -
-
- ENV - {ev.severity} -
-
{ev.headline}
-
{ev.source} ยท {new Date(ev.fetched_at * 1000).toLocaleTimeString()}
-
-
- ) - })} + {alerts.map((alert, i) => ( + + ))}
- ) - } - return ( -
- - No active alerts -
- ) - })()} + ) : (() => { + const highSeverityEnv = envEvents + .filter(e => e.severity === 'immediate' || e.severity === 'priority') + .sort((a, b) => { + const ord: Record = { immediate: 0, priority: 1 } + const diff = (ord[a.severity] ?? 2) - (ord[b.severity] ?? 2) + if (diff !== 0) return diff + return (b.fetched_at || 0) - (a.fetched_at || 0) + }) + .slice(0, 5) + if (highSeverityEnv.length > 0) { + return ( +
+ {highSeverityEnv.map((ev, i) => { + const sevStyle = ev.severity === 'immediate' + ? { bg: 'bg-red-500/10', border: 'border-red-500', icon: AlertCircle, iconColor: 'text-red-500' } + : { bg: 'bg-amber-500/10', border: 'border-amber-500', icon: AlertTriangle, iconColor: 'text-amber-500' } + const Icon = sevStyle.icon + return ( +
+ +
+
+ ENV + {ev.severity} +
+
{ev.headline}
+
{ev.source} ยท {new Date(ev.fetched_at * 1000).toLocaleTimeString()}
+
+
+ ) + })} +
+ ) + } + return ( +
+ + No active alerts +
+ ) + })()} + + ) : ( + + )}
{/* Quick Stats */} @@ -692,14 +728,10 @@ export default function Dashboard() { {/* RF Propagation */} - {/* Live Event Feed */} - -
- - {/* Bottom row: Tropo Forecast */} -
+ {/* Tropo Forecast */}
+
) } diff --git a/meshai/dashboard/static/assets/index-DVlb83LX.js b/meshai/dashboard/static/assets/index-BUzOKXu1.js similarity index 89% rename from meshai/dashboard/static/assets/index-DVlb83LX.js rename to meshai/dashboard/static/assets/index-BUzOKXu1.js index 211b7f3..152a7a7 100644 --- a/meshai/dashboard/static/assets/index-DVlb83LX.js +++ b/meshai/dashboard/static/assets/index-BUzOKXu1.js @@ -1,4 +1,4 @@ -function r7(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 n7=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function R2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var E3={exports:{}},L_={},j3={exports:{}},vt={};/** +function r7(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 n7=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function R2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var E3={exports:{}},Nx={},j3={exports:{}},vt={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ function r7(e,t){for(var r=0;r>>1,Y=z[$];if(0>>1;$i(se,U))lei(Ee,se)?(z[$]=Ee,z[le]=U,$=le):(z[$]=se,z[ie]=U,$=ie);else if(lei(Ee,U))z[$]=Ee,z[le]=U,$=le;else break e}}return Z}function i(z,Z){var U=z.sortIndex-Z.sortIndex;return U!==0?U:z.id-Z.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,h=null,f=3,d=!1,g=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,_=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 w(z){for(var Z=r(u);Z!==null;){if(Z.callback===null)n(u);else if(Z.startTime<=z)n(u),Z.sortIndex=Z.expirationTime,t(l,Z);else break;Z=r(u)}}function S(z){if(m=!1,w(z),!g)if(r(l)!==null)g=!0,W(T);else{var Z=r(u);Z!==null&&V(S,Z.startTime-z)}}function T(z,Z){g=!1,m&&(m=!1,_(P),P=-1),d=!0;var U=f;try{for(w(Z),h=r(l);h!==null&&(!(h.expirationTime>Z)||z&&!D());){var $=h.callback;if(typeof $=="function"){h.callback=null,f=h.priorityLevel;var Y=$(h.expirationTime<=Z);Z=e.unstable_now(),typeof Y=="function"?h.callback=Y:h===r(l)&&n(l),w(Z)}else n(l);h=r(l)}if(h!==null)var te=!0;else{var ie=r(u);ie!==null&&V(S,ie.startTime-Z),te=!1}return te}finally{h=null,f=U,d=!1}}var M=!1,A=null,P=-1,I=5,N=-1;function D(){return!(e.unstable_now()-Nz||125$?(z.sortIndex=U,t(u,z),r(l)===null&&z===r(u)&&(m?(_(P),P=-1):m=!0,V(S,U-$))):(z.sortIndex=Y,t(l,z),g||d||(g=!0,W(T))),z},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(z){var Z=f;return function(){var U=f;f=Z;try{return z.apply(this,arguments)}finally{f=U}}}})($3);Z3.exports=$3;var M7=Z3.exports;/** + */(function(e){function t(z,Z){var U=z.length;z.push(Z);e:for(;0>>1,Y=z[$];if(0>>1;$i(se,U))lei(Ee,se)?(z[$]=Ee,z[le]=U,$=le):(z[$]=se,z[ie]=U,$=ie);else if(lei(Ee,U))z[$]=Ee,z[le]=U,$=le;else break e}}return Z}function i(z,Z){var U=z.sortIndex-Z.sortIndex;return U!==0?U:z.id-Z.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,h=null,f=3,d=!1,g=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(z){for(var Z=r(u);Z!==null;){if(Z.callback===null)n(u);else if(Z.startTime<=z)n(u),Z.sortIndex=Z.expirationTime,t(l,Z);else break;Z=r(u)}}function S(z){if(m=!1,w(z),!g)if(r(l)!==null)g=!0,W(T);else{var Z=r(u);Z!==null&&V(S,Z.startTime-z)}}function T(z,Z){g=!1,m&&(m=!1,x(P),P=-1),d=!0;var U=f;try{for(w(Z),h=r(l);h!==null&&(!(h.expirationTime>Z)||z&&!D());){var $=h.callback;if(typeof $=="function"){h.callback=null,f=h.priorityLevel;var Y=$(h.expirationTime<=Z);Z=e.unstable_now(),typeof Y=="function"?h.callback=Y:h===r(l)&&n(l),w(Z)}else n(l);h=r(l)}if(h!==null)var te=!0;else{var ie=r(u);ie!==null&&V(S,ie.startTime-Z),te=!1}return te}finally{h=null,f=U,d=!1}}var M=!1,A=null,P=-1,I=5,N=-1;function D(){return!(e.unstable_now()-Nz||125$?(z.sortIndex=U,t(u,z),r(l)===null&&z===r(u)&&(m?(x(P),P=-1):m=!0,V(S,U-$))):(z.sortIndex=Y,t(l,z),g||d||(g=!0,W(T))),z},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(z){var Z=f;return function(){var U=f;f=Z;try{return z.apply(this,arguments)}finally{f=U}}}})($3);Z3.exports=$3;var M7=Z3.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ function r7(e,t){for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),TS=Object.prototype.hasOwnProperty,k7=/^[: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]*$/,bN={},wN={};function L7(e){return TS.call(wN,e)?!0:TS.call(bN,e)?!1:k7.test(e)?wN[e]=!0:(bN[e]=!0,!1)}function N7(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 P7(e,t,r,n){if(t===null||typeof t>"u"||N7(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 Mn(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 qr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){qr[e]=new Mn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];qr[t]=new Mn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){qr[e]=new Mn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){qr[e]=new Mn(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){qr[e]=new Mn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){qr[e]=new Mn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){qr[e]=new Mn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){qr[e]=new Mn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){qr[e]=new Mn(e,5,!1,e.toLowerCase(),null,!1,!1)});var V2=/[\-:]([a-z])/g;function G2(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(V2,G2);qr[t]=new Mn(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(V2,G2);qr[t]=new Mn(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(V2,G2);qr[t]=new Mn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){qr[e]=new Mn(e,1,!1,e.toLowerCase(),null,!1,!1)});qr.xlinkHref=new Mn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){qr[e]=new Mn(e,1,!1,e.toLowerCase(),null,!0,!0)});function W2(e,t,r,n){var i=qr.hasOwnProperty(t)?qr[t]:null;(i!==null?i.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),TS=Object.prototype.hasOwnProperty,k7=/^[: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]*$/,bN={},wN={};function L7(e){return TS.call(wN,e)?!0:TS.call(bN,e)?!1:k7.test(e)?wN[e]=!0:(bN[e]=!0,!1)}function N7(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 P7(e,t,r,n){if(t===null||typeof t>"u"||N7(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 Mn(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 qr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){qr[e]=new Mn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];qr[t]=new Mn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){qr[e]=new Mn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){qr[e]=new Mn(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){qr[e]=new Mn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){qr[e]=new Mn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){qr[e]=new Mn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){qr[e]=new Mn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){qr[e]=new Mn(e,5,!1,e.toLowerCase(),null,!1,!1)});var V2=/[\-:]([a-z])/g;function G2(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(V2,G2);qr[t]=new Mn(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(V2,G2);qr[t]=new Mn(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(V2,G2);qr[t]=new Mn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){qr[e]=new Mn(e,1,!1,e.toLowerCase(),null,!1,!1)});qr.xlinkHref=new Mn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){qr[e]=new Mn(e,1,!1,e.toLowerCase(),null,!0,!0)});function W2(e,t,r,n){var i=qr.hasOwnProperty(t)?qr[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{b1=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Od(e):""}function I7(e){switch(e.tag){case 5:return Od(e.type);case 16:return Od("Lazy");case 13:return Od("Suspense");case 19:return Od("SuspenseList");case 0:case 2:case 15:return e=w1(e.type,!1),e;case 11:return e=w1(e.type.render,!1),e;case 1:return e=w1(e.type,!0),e;default:return""}}function LS(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 Yc:return"Fragment";case $c:return"Portal";case MS:return"Profiler";case H2:return"StrictMode";case AS:return"Suspense";case kS:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case q3:return(e.displayName||"Context")+".Consumer";case X3:return(e._context.displayName||"Context")+".Provider";case U2:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z2:return t=e.displayName||null,t!==null?t:LS(e.type)||"Memo";case ps:t=e._payload,e=e._init;try{return LS(e(t))}catch{}}return null}function D7(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 LS(t);case 8:return t===H2?"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 qs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function J3(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function E7(e){var t=J3(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 Dg(e){e._valueTracker||(e._valueTracker=E7(e))}function Q3(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=J3(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function $y(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 NS(e,t){var r=t.checked;return Jt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function CN(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=qs(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 ez(e,t){t=t.checked,t!=null&&W2(e,"checked",t,!1)}function PS(e,t){ez(e,t);var r=qs(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")?IS(e,t.type,r):t.hasOwnProperty("defaultValue")&&IS(e,t.type,qs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function TN(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 IS(e,t,r){(t!=="number"||$y(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var zd=Array.isArray;function fh(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Eg.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function kv(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var ev={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},j7=["Webkit","ms","Moz","O"];Object.keys(ev).forEach(function(e){j7.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ev[t]=ev[e]})});function iz(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||ev.hasOwnProperty(e)&&ev[e]?(""+t).trim():t+"px"}function az(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=iz(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var R7=Jt({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 jS(e,t){if(t){if(R7[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ve(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ve(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ve(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ve(62))}}function RS(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 OS=null;function $2(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var zS=null,dh=null,vh=null;function kN(e){if(e=Np(e)){if(typeof zS!="function")throw Error(ve(280));var t=e.stateNode;t&&(t=E_(t),zS(e.stateNode,e.type,t))}}function oz(e){dh?vh?vh.push(e):vh=[e]:dh=e}function sz(){if(dh){var e=dh,t=vh;if(vh=dh=null,kN(e),t)for(e=0;e>>=0,e===0?32:31-($7(e)/Y7|0)|0}var jg=64,Rg=4194304;function Bd(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 Ky(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=Bd(s):(a&=o,a!==0&&(n=Bd(a)))}else o=r&~i,o!==0?n=Bd(o):a!==0&&(n=Bd(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 kp(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-na(t),e[t]=r}function J7(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=rv),ON=" ",zN=!1;function Az(e,t){switch(e){case"keyup":return M9.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kz(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xc=!1;function k9(e,t){switch(e){case"compositionend":return kz(t);case"keypress":return t.which!==32?null:(zN=!0,ON);case"textInput":return e=t.data,e===ON&&zN?null:e;default:return null}}function L9(e,t){if(Xc)return e==="compositionend"||!tM&&Az(e,t)?(e=Tz(),vy=J2=ws=null,Xc=!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=GN(r)}}function Iz(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Iz(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dz(){for(var e=window,t=$y();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=$y(e.document)}return t}function rM(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 z9(e){var t=Dz(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Iz(r.ownerDocument.documentElement,r)){if(n!==null&&rM(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=WN(r,a);var o=WN(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,qc=null,HS=null,iv=null,US=!1;function HN(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;US||qc==null||qc!==$y(n)||(n=qc,"selectionStart"in n&&rM(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}),iv&&Ev(iv,n)||(iv=n,n=e0(HS,"onSelect"),0Qc||(e.current=KS[Qc],KS[Qc]=null,Qc--)}function zt(e,t){Qc++,KS[Qc]=e.current,e.current=t}var Ks={},vn=ol(Ks),jn=ol(!1),Au=Ks;function Mh(e,t){var r=e.type.contextTypes;if(!r)return Ks;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 Rn(e){return e=e.childContextTypes,e!=null}function r0(){Gt(jn),Gt(vn)}function KN(e,t,r){if(vn.current!==Ks)throw Error(ve(168));zt(vn,t),zt(jn,r)}function Gz(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(ve(108,D7(e)||"Unknown",i));return Jt({},r,n)}function n0(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ks,Au=vn.current,zt(vn,e),zt(jn,jn.current),!0}function JN(e,t,r){var n=e.stateNode;if(!n)throw Error(ve(169));r?(e=Gz(e,t,Au),n.__reactInternalMemoizedMergedChildContext=e,Gt(jn),Gt(vn),zt(vn,e)):Gt(jn),zt(jn,r)}var bo=null,j_=!1,R1=!1;function Wz(e){bo===null?bo=[e]:bo.push(e)}function q9(e){j_=!0,Wz(e)}function sl(){if(!R1&&bo!==null){R1=!0;var e=0,t=Lt;try{var r=bo;for(Lt=1;e>=o,i-=o,So=1<<32-na(t)+i|r<P?(I=A,A=null):I=A.sibling;var N=f(_,A,w[P],S);if(N===null){A===null&&(A=I);break}e&&A&&N.alternate===null&&t(_,A),x=a(N,x,P),M===null?T=N:M.sibling=N,M=N,A=I}if(P===w.length)return r(_,A),Wt&&Yl(_,P),T;if(A===null){for(;PP?(I=A,A=null):I=A.sibling;var D=f(_,A,N.value,S);if(D===null){A===null&&(A=I);break}e&&A&&D.alternate===null&&t(_,A),x=a(D,x,P),M===null?T=D:M.sibling=D,M=D,A=I}if(N.done)return r(_,A),Wt&&Yl(_,P),T;if(A===null){for(;!N.done;P++,N=w.next())N=h(_,N.value,S),N!==null&&(x=a(N,x,P),M===null?T=N:M.sibling=N,M=N);return Wt&&Yl(_,P),T}for(A=n(_,A);!N.done;P++,N=w.next())N=d(A,_,P,N.value,S),N!==null&&(e&&N.alternate!==null&&A.delete(N.key===null?P:N.key),x=a(N,x,P),M===null?T=N:M.sibling=N,M=N);return e&&A.forEach(function(O){return t(_,O)}),Wt&&Yl(_,P),T}function y(_,x,w,S){if(typeof w=="object"&&w!==null&&w.type===Yc&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Ig:e:{for(var T=w.key,M=x;M!==null;){if(M.key===T){if(T=w.type,T===Yc){if(M.tag===7){r(_,M.sibling),x=i(M,w.props.children),x.return=_,_=x;break e}}else if(M.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===ps&&tP(T)===M.type){r(_,M.sibling),x=i(M,w.props),x.ref=td(_,M,w),x.return=_,_=x;break e}r(_,M);break}else t(_,M);M=M.sibling}w.type===Yc?(x=yu(w.props.children,_.mode,S,w.key),x.return=_,_=x):(S=wy(w.type,w.key,w.props,null,_.mode,S),S.ref=td(_,x,w),S.return=_,_=S)}return o(_);case $c:e:{for(M=w.key;x!==null;){if(x.key===M)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){r(_,x.sibling),x=i(x,w.children||[]),x.return=_,_=x;break e}else{r(_,x);break}else t(_,x);x=x.sibling}x=H1(w,_.mode,S),x.return=_,_=x}return o(_);case ps:return M=w._init,y(_,x,M(w._payload),S)}if(zd(w))return g(_,x,w,S);if(qf(w))return m(_,x,w,S);Wg(_,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(r(_,x.sibling),x=i(x,w),x.return=_,_=x):(r(_,x),x=W1(w,_.mode,S),x.return=_,_=x),o(_)):r(_,x)}return y}var kh=$z(!0),Yz=$z(!1),o0=ol(null),s0=null,rh=null,oM=null;function sM(){oM=rh=s0=null}function lM(e){var t=o0.current;Gt(o0),e._currentValue=t}function eC(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 gh(e,t){s0=e,oM=rh=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(En=!0),e.firstContext=null)}function Pi(e){var t=e._currentValue;if(oM!==e)if(e={context:e,memoizedValue:t,next:null},rh===null){if(s0===null)throw Error(ve(308));rh=e,s0.dependencies={lanes:0,firstContext:e}}else rh=rh.next=e;return t}var lu=null;function uM(e){lu===null?lu=[e]:lu.push(e)}function Xz(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,uM(t)):(r.next=i.next,i.next=r),t.interleaved=r,Bo(e,n)}function Bo(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 gs=!1;function cM(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qz(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 No(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Rs(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,xt&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,Bo(e,r)}return i=n.interleaved,i===null?(t.next=t,uM(n)):(t.next=i.next,i.next=t),n.interleaved=t,Bo(e,r)}function gy(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,X2(e,r)}}function rP(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 l0(e,t,r,n){var i=e.updateQueue;gs=!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 h=i.baseState;o=0,c=u=l=null,s=a;do{var f=s.lane,d=s.eventTime;if((n&f)===f){c!==null&&(c=c.next={eventTime:d,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var g=e,m=s;switch(f=t,d=r,m.tag){case 1:if(g=m.payload,typeof g=="function"){h=g.call(d,h,f);break e}h=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,f=typeof g=="function"?g.call(d,h,f):g,f==null)break e;h=Jt({},h,f);break e;case 2:gs=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else d={eventTime:d,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=d,l=h):c=c.next=d,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(c===null&&(l=h),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);Nu|=o,e.lanes=o,e.memoizedState=h}}function nP(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=z1.transition;z1.transition={};try{e(!1),t()}finally{Lt=r,z1.transition=n}}function d4(){return Ii().memoizedState}function eZ(e,t,r){var n=zs(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},v4(e))p4(t,r);else if(r=Xz(e,t,r,n),r!==null){var i=bn();ia(r,e,n,i),g4(r,t,n)}}function tZ(e,t,r){var n=zs(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(v4(e))p4(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,r);if(i.hasEagerState=!0,i.eagerState=s,ua(s,o)){var l=t.interleaved;l===null?(i.next=i,uM(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=Xz(e,t,i,n),r!==null&&(i=bn(),ia(r,e,n,i),g4(r,t,n))}}function v4(e){var t=e.alternate;return e===Xt||t!==null&&t===Xt}function p4(e,t){av=c0=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function g4(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,X2(e,r)}}var h0={readContext:Pi,useCallback:nn,useContext:nn,useEffect:nn,useImperativeHandle:nn,useInsertionEffect:nn,useLayoutEffect:nn,useMemo:nn,useReducer:nn,useRef:nn,useState:nn,useDebugValue:nn,useDeferredValue:nn,useTransition:nn,useMutableSource:nn,useSyncExternalStore:nn,useId:nn,unstable_isNewReconciler:!1},rZ={readContext:Pi,useCallback:function(e,t){return La().memoizedState=[e,t===void 0?null:t],e},useContext:Pi,useEffect:aP,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,yy(4194308,4,l4.bind(null,t,e),r)},useLayoutEffect:function(e,t){return yy(4194308,4,e,t)},useInsertionEffect:function(e,t){return yy(4,2,e,t)},useMemo:function(e,t){var r=La();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=La();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=eZ.bind(null,Xt,e),[n.memoizedState,e]},useRef:function(e){var t=La();return e={current:e},t.memoizedState=e},useState:iP,useDebugValue:yM,useDeferredValue:function(e){return La().memoizedState=e},useTransition:function(){var e=iP(!1),t=e[0];return e=Q9.bind(null,e[1]),La().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Xt,i=La();if(Wt){if(r===void 0)throw Error(ve(407));r=r()}else{if(r=t(),Vr===null)throw Error(ve(349));Lu&30||e4(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,aP(r4.bind(null,n,a,e),[e]),n.flags|=2048,Gv(9,t4.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=La(),t=Vr.identifierPrefix;if(Wt){var r=Co,n=So;r=(n&~(1<<32-na(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Fv++,0")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{b1=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Od(e):""}function I7(e){switch(e.tag){case 5:return Od(e.type);case 16:return Od("Lazy");case 13:return Od("Suspense");case 19:return Od("SuspenseList");case 0:case 2:case 15:return e=w1(e.type,!1),e;case 11:return e=w1(e.type.render,!1),e;case 1:return e=w1(e.type,!0),e;default:return""}}function LS(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 Yc:return"Fragment";case $c:return"Portal";case MS:return"Profiler";case H2:return"StrictMode";case AS:return"Suspense";case kS:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case q3:return(e.displayName||"Context")+".Consumer";case X3:return(e._context.displayName||"Context")+".Provider";case U2:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z2:return t=e.displayName||null,t!==null?t:LS(e.type)||"Memo";case ps:t=e._payload,e=e._init;try{return LS(e(t))}catch{}}return null}function D7(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 LS(t);case 8:return t===H2?"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 qs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function J3(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function E7(e){var t=J3(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 Dg(e){e._valueTracker||(e._valueTracker=E7(e))}function Q3(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=J3(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function $y(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 NS(e,t){var r=t.checked;return Jt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function CN(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=qs(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 ez(e,t){t=t.checked,t!=null&&W2(e,"checked",t,!1)}function PS(e,t){ez(e,t);var r=qs(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")?IS(e,t.type,r):t.hasOwnProperty("defaultValue")&&IS(e,t.type,qs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function TN(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 IS(e,t,r){(t!=="number"||$y(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var zd=Array.isArray;function fh(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Eg.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function kv(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var ev={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},j7=["Webkit","ms","Moz","O"];Object.keys(ev).forEach(function(e){j7.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ev[t]=ev[e]})});function iz(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||ev.hasOwnProperty(e)&&ev[e]?(""+t).trim():t+"px"}function az(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=iz(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var R7=Jt({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 jS(e,t){if(t){if(R7[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ve(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ve(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ve(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ve(62))}}function RS(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 OS=null;function $2(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var zS=null,dh=null,vh=null;function kN(e){if(e=Np(e)){if(typeof zS!="function")throw Error(ve(280));var t=e.stateNode;t&&(t=jx(t),zS(e.stateNode,e.type,t))}}function oz(e){dh?vh?vh.push(e):vh=[e]:dh=e}function sz(){if(dh){var e=dh,t=vh;if(vh=dh=null,kN(e),t)for(e=0;e>>=0,e===0?32:31-($7(e)/Y7|0)|0}var jg=64,Rg=4194304;function Bd(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 Ky(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=Bd(s):(a&=o,a!==0&&(n=Bd(a)))}else o=r&~i,o!==0?n=Bd(o):a!==0&&(n=Bd(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 kp(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-na(t),e[t]=r}function J7(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=rv),ON=" ",zN=!1;function Az(e,t){switch(e){case"keyup":return M9.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kz(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xc=!1;function k9(e,t){switch(e){case"compositionend":return kz(t);case"keypress":return t.which!==32?null:(zN=!0,ON);case"textInput":return e=t.data,e===ON&&zN?null:e;default:return null}}function L9(e,t){if(Xc)return e==="compositionend"||!tM&&Az(e,t)?(e=Tz(),vy=J2=ws=null,Xc=!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=GN(r)}}function Iz(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Iz(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dz(){for(var e=window,t=$y();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=$y(e.document)}return t}function rM(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 z9(e){var t=Dz(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Iz(r.ownerDocument.documentElement,r)){if(n!==null&&rM(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=WN(r,a);var o=WN(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,qc=null,HS=null,iv=null,US=!1;function HN(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;US||qc==null||qc!==$y(n)||(n=qc,"selectionStart"in n&&rM(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}),iv&&Ev(iv,n)||(iv=n,n=e0(HS,"onSelect"),0Qc||(e.current=KS[Qc],KS[Qc]=null,Qc--)}function zt(e,t){Qc++,KS[Qc]=e.current,e.current=t}var Ks={},vn=ol(Ks),jn=ol(!1),Au=Ks;function Mh(e,t){var r=e.type.contextTypes;if(!r)return Ks;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 Rn(e){return e=e.childContextTypes,e!=null}function r0(){Gt(jn),Gt(vn)}function KN(e,t,r){if(vn.current!==Ks)throw Error(ve(168));zt(vn,t),zt(jn,r)}function Gz(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(ve(108,D7(e)||"Unknown",i));return Jt({},r,n)}function n0(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ks,Au=vn.current,zt(vn,e),zt(jn,jn.current),!0}function JN(e,t,r){var n=e.stateNode;if(!n)throw Error(ve(169));r?(e=Gz(e,t,Au),n.__reactInternalMemoizedMergedChildContext=e,Gt(jn),Gt(vn),zt(vn,e)):Gt(jn),zt(jn,r)}var bo=null,Rx=!1,R1=!1;function Wz(e){bo===null?bo=[e]:bo.push(e)}function q9(e){Rx=!0,Wz(e)}function sl(){if(!R1&&bo!==null){R1=!0;var e=0,t=Lt;try{var r=bo;for(Lt=1;e>=o,i-=o,So=1<<32-na(t)+i|r<P?(I=A,A=null):I=A.sibling;var N=f(x,A,w[P],S);if(N===null){A===null&&(A=I);break}e&&A&&N.alternate===null&&t(x,A),_=a(N,_,P),M===null?T=N:M.sibling=N,M=N,A=I}if(P===w.length)return r(x,A),Wt&&Yl(x,P),T;if(A===null){for(;PP?(I=A,A=null):I=A.sibling;var D=f(x,A,N.value,S);if(D===null){A===null&&(A=I);break}e&&A&&D.alternate===null&&t(x,A),_=a(D,_,P),M===null?T=D:M.sibling=D,M=D,A=I}if(N.done)return r(x,A),Wt&&Yl(x,P),T;if(A===null){for(;!N.done;P++,N=w.next())N=h(x,N.value,S),N!==null&&(_=a(N,_,P),M===null?T=N:M.sibling=N,M=N);return Wt&&Yl(x,P),T}for(A=n(x,A);!N.done;P++,N=w.next())N=d(A,x,P,N.value,S),N!==null&&(e&&N.alternate!==null&&A.delete(N.key===null?P:N.key),_=a(N,_,P),M===null?T=N:M.sibling=N,M=N);return e&&A.forEach(function(O){return t(x,O)}),Wt&&Yl(x,P),T}function y(x,_,w,S){if(typeof w=="object"&&w!==null&&w.type===Yc&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Ig:e:{for(var T=w.key,M=_;M!==null;){if(M.key===T){if(T=w.type,T===Yc){if(M.tag===7){r(x,M.sibling),_=i(M,w.props.children),_.return=x,x=_;break e}}else if(M.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===ps&&tP(T)===M.type){r(x,M.sibling),_=i(M,w.props),_.ref=td(x,M,w),_.return=x,x=_;break e}r(x,M);break}else t(x,M);M=M.sibling}w.type===Yc?(_=yu(w.props.children,x.mode,S,w.key),_.return=x,x=_):(S=wy(w.type,w.key,w.props,null,x.mode,S),S.ref=td(x,_,w),S.return=x,x=S)}return o(x);case $c:e:{for(M=w.key;_!==null;){if(_.key===M)if(_.tag===4&&_.stateNode.containerInfo===w.containerInfo&&_.stateNode.implementation===w.implementation){r(x,_.sibling),_=i(_,w.children||[]),_.return=x,x=_;break e}else{r(x,_);break}else t(x,_);_=_.sibling}_=H1(w,x.mode,S),_.return=x,x=_}return o(x);case ps:return M=w._init,y(x,_,M(w._payload),S)}if(zd(w))return g(x,_,w,S);if(qf(w))return m(x,_,w,S);Wg(x,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,_!==null&&_.tag===6?(r(x,_.sibling),_=i(_,w),_.return=x,x=_):(r(x,_),_=W1(w,x.mode,S),_.return=x,x=_),o(x)):r(x,_)}return y}var kh=$z(!0),Yz=$z(!1),o0=ol(null),s0=null,rh=null,oM=null;function sM(){oM=rh=s0=null}function lM(e){var t=o0.current;Gt(o0),e._currentValue=t}function eC(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 gh(e,t){s0=e,oM=rh=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(En=!0),e.firstContext=null)}function Pi(e){var t=e._currentValue;if(oM!==e)if(e={context:e,memoizedValue:t,next:null},rh===null){if(s0===null)throw Error(ve(308));rh=e,s0.dependencies={lanes:0,firstContext:e}}else rh=rh.next=e;return t}var lu=null;function uM(e){lu===null?lu=[e]:lu.push(e)}function Xz(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,uM(t)):(r.next=i.next,i.next=r),t.interleaved=r,Bo(e,n)}function Bo(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 gs=!1;function cM(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qz(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 No(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Rs(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,_t&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,Bo(e,r)}return i=n.interleaved,i===null?(t.next=t,uM(n)):(t.next=i.next,i.next=t),n.interleaved=t,Bo(e,r)}function gy(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,X2(e,r)}}function rP(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 l0(e,t,r,n){var i=e.updateQueue;gs=!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 h=i.baseState;o=0,c=u=l=null,s=a;do{var f=s.lane,d=s.eventTime;if((n&f)===f){c!==null&&(c=c.next={eventTime:d,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var g=e,m=s;switch(f=t,d=r,m.tag){case 1:if(g=m.payload,typeof g=="function"){h=g.call(d,h,f);break e}h=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,f=typeof g=="function"?g.call(d,h,f):g,f==null)break e;h=Jt({},h,f);break e;case 2:gs=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else d={eventTime:d,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=d,l=h):c=c.next=d,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(c===null&&(l=h),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);Nu|=o,e.lanes=o,e.memoizedState=h}}function nP(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=z1.transition;z1.transition={};try{e(!1),t()}finally{Lt=r,z1.transition=n}}function d4(){return Ii().memoizedState}function eZ(e,t,r){var n=zs(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},v4(e))p4(t,r);else if(r=Xz(e,t,r,n),r!==null){var i=bn();ia(r,e,n,i),g4(r,t,n)}}function tZ(e,t,r){var n=zs(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(v4(e))p4(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,r);if(i.hasEagerState=!0,i.eagerState=s,ua(s,o)){var l=t.interleaved;l===null?(i.next=i,uM(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=Xz(e,t,i,n),r!==null&&(i=bn(),ia(r,e,n,i),g4(r,t,n))}}function v4(e){var t=e.alternate;return e===Xt||t!==null&&t===Xt}function p4(e,t){av=c0=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function g4(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,X2(e,r)}}var h0={readContext:Pi,useCallback:nn,useContext:nn,useEffect:nn,useImperativeHandle:nn,useInsertionEffect:nn,useLayoutEffect:nn,useMemo:nn,useReducer:nn,useRef:nn,useState:nn,useDebugValue:nn,useDeferredValue:nn,useTransition:nn,useMutableSource:nn,useSyncExternalStore:nn,useId:nn,unstable_isNewReconciler:!1},rZ={readContext:Pi,useCallback:function(e,t){return La().memoizedState=[e,t===void 0?null:t],e},useContext:Pi,useEffect:aP,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,yy(4194308,4,l4.bind(null,t,e),r)},useLayoutEffect:function(e,t){return yy(4194308,4,e,t)},useInsertionEffect:function(e,t){return yy(4,2,e,t)},useMemo:function(e,t){var r=La();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=La();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=eZ.bind(null,Xt,e),[n.memoizedState,e]},useRef:function(e){var t=La();return e={current:e},t.memoizedState=e},useState:iP,useDebugValue:yM,useDeferredValue:function(e){return La().memoizedState=e},useTransition:function(){var e=iP(!1),t=e[0];return e=Q9.bind(null,e[1]),La().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Xt,i=La();if(Wt){if(r===void 0)throw Error(ve(407));r=r()}else{if(r=t(),Vr===null)throw Error(ve(349));Lu&30||e4(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,aP(r4.bind(null,n,a,e),[e]),n.flags|=2048,Gv(9,t4.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=La(),t=Vr.identifierPrefix;if(Wt){var r=Co,n=So;r=(n&~(1<<32-na(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Fv++,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[Pa]=t,e[Ov]=n,M4(e,t,!1,!1),t.stateNode=e;e:{switch(o=RS(r,n),r){case"dialog":Vt("cancel",e),Vt("close",e),i=n;break;case"iframe":case"object":case"embed":Vt("load",e),i=n;break;case"video":case"audio":for(i=0;iPh&&(t.flags|=128,n=!0,rd(a,!1),t.lanes=4194304)}else{if(!n)if(e=u0(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),rd(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Wt)return an(t),null}else 2*dr()-a.renderingStartTime>Ph&&r!==1073741824&&(t.flags|=128,n=!0,rd(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=dr(),t.sibling=null,r=Yt.current,zt(Yt,n?r&1|2:r&1),t):(an(t),null);case 22:case 23:return CM(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Zn&1073741824&&(an(t),t.subtreeFlags&6&&(t.flags|=8192)):an(t),null;case 24:return null;case 25:return null}throw Error(ve(156,t.tag))}function cZ(e,t){switch(iM(t),t.tag){case 1:return Rn(t.type)&&r0(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Lh(),Gt(jn),Gt(vn),dM(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return fM(t),null;case 13:if(Gt(Yt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ve(340));Ah()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Gt(Yt),null;case 4:return Lh(),null;case 10:return lM(t.type._context),null;case 22:case 23:return CM(),null;case 24:return null;default:return null}}var Ug=!1,cn=!1,hZ=typeof WeakSet=="function"?WeakSet:Set,je=null;function nh(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){tr(e,t,n)}else r.current=null}function uC(e,t,r){try{r()}catch(n){tr(e,t,n)}}var gP=!1;function fZ(e,t){if(ZS=Jy,e=Dz(),rM(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,h=e,f=null;t:for(;;){for(var d;h!==r||i!==0&&h.nodeType!==3||(s=o+i),h!==a||n!==0&&h.nodeType!==3||(l=o+n),h.nodeType===3&&(o+=h.nodeValue.length),(d=h.firstChild)!==null;)f=h,h=d;for(;;){if(h===e)break t;if(f===r&&++u===i&&(s=o),f===a&&++c===n&&(l=o),(d=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=d}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for($S={focusedElem:e,selectionRange:r},Jy=!1,je=t;je!==null;)if(t=je,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,je=e;else for(;je!==null;){t=je;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,y=g.memoizedState,_=t.stateNode,x=_.getSnapshotBeforeUpdate(t.elementType===t.type?m:Ki(t.type,m),y);_.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ve(163))}}catch(S){tr(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,je=e;break}je=t.return}return g=gP,gP=!1,g}function ov(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&&uC(t,r,a)}i=i.next}while(i!==n)}}function z_(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 cC(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 L4(e){var t=e.alternate;t!==null&&(e.alternate=null,L4(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Pa],delete t[Ov],delete t[qS],delete t[Y9],delete t[X9])),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 N4(e){return e.tag===5||e.tag===3||e.tag===4}function mP(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||N4(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 hC(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=t0));else if(n!==4&&(e=e.child,e!==null))for(hC(e,t,r),e=e.sibling;e!==null;)hC(e,t,r),e=e.sibling}function fC(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(fC(e,t,r),e=e.sibling;e!==null;)fC(e,t,r),e=e.sibling}var Ur=null,Qi=!1;function rs(e,t,r){for(r=r.child;r!==null;)P4(e,t,r),r=r.sibling}function P4(e,t,r){if(Fa&&typeof Fa.onCommitFiberUnmount=="function")try{Fa.onCommitFiberUnmount(N_,r)}catch{}switch(r.tag){case 5:cn||nh(r,t);case 6:var n=Ur,i=Qi;Ur=null,rs(e,t,r),Ur=n,Qi=i,Ur!==null&&(Qi?(e=Ur,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ur.removeChild(r.stateNode));break;case 18:Ur!==null&&(Qi?(e=Ur,r=r.stateNode,e.nodeType===8?j1(e.parentNode,r):e.nodeType===1&&j1(e,r),Iv(e)):j1(Ur,r.stateNode));break;case 4:n=Ur,i=Qi,Ur=r.stateNode.containerInfo,Qi=!0,rs(e,t,r),Ur=n,Qi=i;break;case 0:case 11:case 14:case 15:if(!cn&&(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)&&uC(r,t,o),i=i.next}while(i!==n)}rs(e,t,r);break;case 1:if(!cn&&(nh(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){tr(r,t,s)}rs(e,t,r);break;case 21:rs(e,t,r);break;case 22:r.mode&1?(cn=(n=cn)||r.memoizedState!==null,rs(e,t,r),cn=n):rs(e,t,r);break;default:rs(e,t,r)}}function yP(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new hZ),t.forEach(function(n){var i=bZ.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Ui(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~a}if(n=i,n=dr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*vZ(n/1960))-n,10e?16:e,Ss===null)var n=!1;else{if(e=Ss,Ss=null,v0=0,xt&6)throw Error(ve(331));var i=xt;for(xt|=4,je=e.current;je!==null;){var a=je,o=a.child;if(je.flags&16){var s=a.deletions;if(s!==null){for(var l=0;ldr()-wM?mu(e,0):bM|=r),On(e,t)}function B4(e,t){t===0&&(e.mode&1?(t=Rg,Rg<<=1,!(Rg&130023424)&&(Rg=4194304)):t=1);var r=bn();e=Bo(e,t),e!==null&&(kp(e,t,r),On(e,r))}function xZ(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),B4(e,r)}function bZ(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(ve(314))}n!==null&&n.delete(t),B4(e,r)}var F4;F4=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||jn.current)En=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return En=!1,lZ(e,t,r);En=!!(e.flags&131072)}else En=!1,Wt&&t.flags&1048576&&Hz(t,a0,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;_y(e,t),e=t.pendingProps;var i=Mh(t,vn.current);gh(t,r),i=pM(null,t,n,e,i,r);var a=gM();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,Rn(n)?(a=!0,n0(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,cM(t),i.updater=O_,t.stateNode=i,i._reactInternals=t,rC(t,n,e,r),t=aC(null,t,n,!0,a,r)):(t.tag=0,Wt&&a&&nM(t),mn(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(_y(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=SZ(n),e=Ki(n,e),i){case 0:t=iC(null,t,n,e,r);break e;case 1:t=dP(null,t,n,e,r);break e;case 11:t=hP(null,t,n,e,r);break e;case 14:t=fP(null,t,n,Ki(n.type,e),r);break e}throw Error(ve(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ki(n,i),iC(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ki(n,i),dP(e,t,n,i,r);case 3:e:{if(S4(t),e===null)throw Error(ve(387));n=t.pendingProps,a=t.memoizedState,i=a.element,qz(e,t),l0(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=Nh(Error(ve(423)),t),t=vP(e,t,n,r,i);break e}else if(n!==i){i=Nh(Error(ve(424)),t),t=vP(e,t,n,r,i);break e}else for(Kn=js(t.stateNode.containerInfo.firstChild),ri=t,Wt=!0,ea=null,r=Yz(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ah(),n===i){t=Fo(e,t,r);break e}mn(e,t,n,r)}t=t.child}return t;case 5:return Kz(t),e===null&&QS(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,YS(n,i)?o=null:a!==null&&YS(n,a)&&(t.flags|=32),w4(e,t),mn(e,t,o,r),t.child;case 6:return e===null&&QS(t),null;case 13:return C4(e,t,r);case 4:return hM(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=kh(t,null,n,r):mn(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ki(n,i),hP(e,t,n,i,r);case 7:return mn(e,t,t.pendingProps,r),t.child;case 8:return mn(e,t,t.pendingProps.children,r),t.child;case 12:return mn(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(o0,n._currentValue),n._currentValue=o,a!==null)if(ua(a.value,o)){if(a.children===i.children&&!jn.current){t=Fo(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=No(-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),eC(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(ve(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),eC(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}mn(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,gh(t,r),i=Pi(i),n=n(i),t.flags|=1,mn(e,t,n,r),t.child;case 14:return n=t.type,i=Ki(n,t.pendingProps),i=Ki(n.type,i),fP(e,t,n,i,r);case 15:return x4(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ki(n,i),_y(e,t),t.tag=1,Rn(n)?(e=!0,n0(t)):e=!1,gh(t,r),m4(t,n,i),rC(t,n,i,r),aC(null,t,n,!0,e,r);case 19:return T4(e,t,r);case 22:return b4(e,t,r)}throw Error(ve(156,t.tag))};function V4(e,t){return vz(e,t)}function wZ(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 Mi(e,t,r,n){return new wZ(e,t,r,n)}function MM(e){return e=e.prototype,!(!e||!e.isReactComponent)}function SZ(e){if(typeof e=="function")return MM(e)?1:0;if(e!=null){if(e=e.$$typeof,e===U2)return 11;if(e===Z2)return 14}return 2}function Bs(e,t){var r=e.alternate;return r===null?(r=Mi(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 wy(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")MM(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Yc:return yu(r.children,i,a,t);case H2:o=8,i|=8;break;case MS:return e=Mi(12,r,t,i|2),e.elementType=MS,e.lanes=a,e;case AS:return e=Mi(13,r,t,i),e.elementType=AS,e.lanes=a,e;case kS:return e=Mi(19,r,t,i),e.elementType=kS,e.lanes=a,e;case K3:return F_(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case X3:o=10;break e;case q3:o=9;break e;case U2:o=11;break e;case Z2:o=14;break e;case ps:o=16,n=null;break e}throw Error(ve(130,e==null?e:typeof e,""))}return t=Mi(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function yu(e,t,r,n){return e=Mi(7,e,n,t),e.lanes=r,e}function F_(e,t,r,n){return e=Mi(22,e,n,t),e.elementType=K3,e.lanes=r,e.stateNode={isHidden:!1},e}function W1(e,t,r){return e=Mi(6,e,null,t),e.lanes=r,e}function H1(e,t,r){return t=Mi(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function CZ(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=C1(0),this.expirationTimes=C1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=C1(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function AM(e,t,r,n,i,a,o,s,l){return e=new CZ(e,t,r,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Mi(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},cM(a),e}function TZ(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(U4)}catch(e){console.error(e)}}U4(),U3.exports=ai;var Z4=U3.exports,MP=Z4;CS.createRoot=MP.createRoot,CS.hydrateRoot=MP.hydrateRoot;/** +`+a.stack}return{value:e,source:t,stack:i,digest:null}}function V1(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function nC(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var aZ=typeof WeakMap=="function"?WeakMap:Map;function y4(e,t,r){r=No(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){d0||(d0=!0,dC=n),nC(e,t)},r}function x4(e,t,r){r=No(-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(){nC(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){nC(e,t),typeof n!="function"&&(Os===null?Os=new Set([this]):Os.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function lP(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new aZ;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=xZ.bind(null,e,t,r),t.then(e,e))}function uP(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 cP(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=No(-1,1),t.tag=2,Rs(r,t,1))),r.lanes|=1),e)}var oZ=qo.ReactCurrentOwner,En=!1;function mn(e,t,r,n){t.child=e===null?Yz(t,null,r,n):kh(t,e.child,r,n)}function hP(e,t,r,n,i){r=r.render;var a=t.ref;return gh(t,i),n=pM(e,t,r,n,a,i),r=gM(),e!==null&&!En?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Fo(e,t,i)):(Wt&&r&&nM(t),t.flags|=1,mn(e,t,n,i),t.child)}function fP(e,t,r,n,i){if(e===null){var a=r.type;return typeof a=="function"&&!MM(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,_4(e,t,a,n,i)):(e=wy(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:Ev,r(o,n)&&e.ref===t.ref)return Fo(e,t,i)}return t.flags|=1,e=Bs(a,n),e.ref=t.ref,e.return=t,t.child=e}function _4(e,t,r,n,i){if(e!==null){var a=e.memoizedProps;if(Ev(a,n)&&e.ref===t.ref)if(En=!1,t.pendingProps=n=a,(e.lanes&i)!==0)e.flags&131072&&(En=!0);else return t.lanes=e.lanes,Fo(e,t,i)}return iC(e,t,r,n,i)}function b4(e,t,r){var n=t.pendingProps,i=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},zt(ih,Zn),Zn|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,zt(ih,Zn),Zn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,zt(ih,Zn),Zn|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,zt(ih,Zn),Zn|=n;return mn(e,t,i,r),t.child}function w4(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function iC(e,t,r,n,i){var a=Rn(r)?Au:vn.current;return a=Mh(t,a),gh(t,i),r=pM(e,t,r,n,a,i),n=gM(),e!==null&&!En?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Fo(e,t,i)):(Wt&&n&&nM(t),t.flags|=1,mn(e,t,r,i),t.child)}function dP(e,t,r,n,i){if(Rn(r)){var a=!0;n0(t)}else a=!1;if(gh(t,i),t.stateNode===null)xy(e,t),m4(t,r,n),rC(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=Pi(u):(u=Rn(r)?Au:vn.current,u=Mh(t,u));var c=r.getDerivedStateFromProps,h=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==n||l!==u)&&sP(t,o,n,u),gs=!1;var f=t.memoizedState;o.state=f,l0(t,n,o,i),l=t.memoizedState,s!==n||f!==l||jn.current||gs?(typeof c=="function"&&(tC(t,r,c,n),l=t.memoizedState),(s=gs||oP(t,r,s,n,f,l,u))?(h||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,qz(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:Ki(t.type,s),o.props=u,h=t.pendingProps,f=o.context,l=r.contextType,typeof l=="object"&&l!==null?l=Pi(l):(l=Rn(r)?Au:vn.current,l=Mh(t,l));var d=r.getDerivedStateFromProps;(c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==h||f!==l)&&sP(t,o,n,l),gs=!1,f=t.memoizedState,o.state=f,l0(t,n,o,i);var g=t.memoizedState;s!==h||f!==g||jn.current||gs?(typeof d=="function"&&(tC(t,r,d,n),g=t.memoizedState),(u=gs||oP(t,r,u,n,f,g,l)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,g,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,g,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=g),o.props=n,o.state=g,o.context=l,n=u):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),n=!1)}return aC(e,t,r,n,a,i)}function aC(e,t,r,n,i,a){w4(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return i&&JN(t,r,!1),Fo(e,t,a);n=t.stateNode,oZ.current=t;var s=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=kh(t,e.child,null,a),t.child=kh(t,null,s,a)):mn(e,t,s,a),t.memoizedState=n.state,i&&JN(t,r,!0),t.child}function S4(e){var t=e.stateNode;t.pendingContext?KN(e,t.pendingContext,t.pendingContext!==t.context):t.context&&KN(e,t.context,!1),hM(e,t.containerInfo)}function vP(e,t,r,n,i){return Ah(),aM(i),t.flags|=256,mn(e,t,r,n),t.child}var oC={dehydrated:null,treeContext:null,retryLane:0};function sC(e){return{baseLanes:e,cachePool:null,transitions:null}}function C4(e,t,r){var n=t.pendingProps,i=Yt.current,a=!1,o=(t.flags&128)!==0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),zt(Yt,i&1),e===null)return QS(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=Vx(o,n,0,null),e=yu(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=sC(r),t.memoizedState=oC,e):xM(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return sZ(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=Bs(i,l),n.subtreeFlags=i.subtreeFlags&14680064),s!==null?a=Bs(s,a):(a=yu(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?sC(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~r,t.memoizedState=oC,n}return a=e.child,e=a.sibling,n=Bs(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 xM(e,t){return t=Vx({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Hg(e,t,r,n){return n!==null&&aM(n),kh(t,e.child,null,r),e=xM(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function sZ(e,t,r,n,i,a,o){if(r)return t.flags&256?(t.flags&=-257,n=V1(Error(ve(422))),Hg(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=Vx({mode:"visible",children:n.children},i,0,null),a=yu(a,i,o,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&kh(t,e.child,null,o),t.child.memoizedState=sC(o),t.memoizedState=oC,a);if(!(t.mode&1))return Hg(e,t,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var s=n.dgst;return n=s,a=Error(ve(419)),n=V1(a,n,void 0),Hg(e,t,o,n)}if(s=(o&e.childLanes)!==0,En||s){if(n=Vr,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,Bo(e,i),ia(n,e,i,-1))}return TM(),n=V1(Error(ve(421))),Hg(e,t,o,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=_Z.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,Kn=js(i.nextSibling),ri=t,Wt=!0,ea=null,e!==null&&(bi[wi++]=So,bi[wi++]=Co,bi[wi++]=ku,So=e.id,Co=e.overflow,ku=t),t=xM(t,n.children),t.flags|=4096,t)}function pP(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),eC(e.return,t,r)}function G1(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 T4(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(mn(e,t,n.children,r),n=Yt.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&&pP(e,r,t);else if(e.tag===19)pP(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(zt(Yt,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&&u0(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),G1(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&&u0(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}G1(t,!0,r,null,a);break;case"together":G1(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function xy(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Fo(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Nu|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ve(153));if(t.child!==null){for(e=t.child,r=Bs(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Bs(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function lZ(e,t,r){switch(t.tag){case 3:S4(t),Ah();break;case 5:Kz(t);break;case 1:Rn(t.type)&&n0(t);break;case 4:hM(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;zt(o0,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(zt(Yt,Yt.current&1),t.flags|=128,null):r&t.child.childLanes?C4(e,t,r):(zt(Yt,Yt.current&1),e=Fo(e,t,r),e!==null?e.sibling:null);zt(Yt,Yt.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return T4(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),zt(Yt,Yt.current),n)break;return null;case 22:case 23:return t.lanes=0,b4(e,t,r)}return Fo(e,t,r)}var M4,lC,A4,k4;M4=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}};lC=function(){};A4=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,uu(Va.current);var a=null;switch(r){case"input":i=NS(e,i),n=NS(e,n),a=[];break;case"select":i=Jt({},i,{value:void 0}),n=Jt({},n,{value:void 0}),a=[];break;case"textarea":i=DS(e,i),n=DS(e,n),a=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=t0)}jS(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"&&(Av.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"&&(Av.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Vt("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)}};k4=function(e,t,r,n){r!==n&&(t.flags|=4)};function rd(e,t){if(!Wt)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 an(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 uZ(e,t,r){var n=t.pendingProps;switch(iM(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return an(t),null;case 1:return Rn(t.type)&&r0(),an(t),null;case 3:return n=t.stateNode,Lh(),Gt(jn),Gt(vn),dM(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Gg(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ea!==null&&(gC(ea),ea=null))),lC(e,t),an(t),null;case 5:fM(t);var i=uu(Bv.current);if(r=t.type,e!==null&&t.stateNode!=null)A4(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(ve(166));return an(t),null}if(e=uu(Va.current),Gg(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[Pa]=t,n[Ov]=a,e=(t.mode&1)!==0,r){case"dialog":Vt("cancel",n),Vt("close",n);break;case"iframe":case"object":case"embed":Vt("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[Pa]=t,e[Ov]=n,M4(e,t,!1,!1),t.stateNode=e;e:{switch(o=RS(r,n),r){case"dialog":Vt("cancel",e),Vt("close",e),i=n;break;case"iframe":case"object":case"embed":Vt("load",e),i=n;break;case"video":case"audio":for(i=0;iPh&&(t.flags|=128,n=!0,rd(a,!1),t.lanes=4194304)}else{if(!n)if(e=u0(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),rd(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Wt)return an(t),null}else 2*dr()-a.renderingStartTime>Ph&&r!==1073741824&&(t.flags|=128,n=!0,rd(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=dr(),t.sibling=null,r=Yt.current,zt(Yt,n?r&1|2:r&1),t):(an(t),null);case 22:case 23:return CM(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Zn&1073741824&&(an(t),t.subtreeFlags&6&&(t.flags|=8192)):an(t),null;case 24:return null;case 25:return null}throw Error(ve(156,t.tag))}function cZ(e,t){switch(iM(t),t.tag){case 1:return Rn(t.type)&&r0(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Lh(),Gt(jn),Gt(vn),dM(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return fM(t),null;case 13:if(Gt(Yt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ve(340));Ah()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Gt(Yt),null;case 4:return Lh(),null;case 10:return lM(t.type._context),null;case 22:case 23:return CM(),null;case 24:return null;default:return null}}var Ug=!1,cn=!1,hZ=typeof WeakSet=="function"?WeakSet:Set,je=null;function nh(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){tr(e,t,n)}else r.current=null}function uC(e,t,r){try{r()}catch(n){tr(e,t,n)}}var gP=!1;function fZ(e,t){if(ZS=Jy,e=Dz(),rM(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,h=e,f=null;t:for(;;){for(var d;h!==r||i!==0&&h.nodeType!==3||(s=o+i),h!==a||n!==0&&h.nodeType!==3||(l=o+n),h.nodeType===3&&(o+=h.nodeValue.length),(d=h.firstChild)!==null;)f=h,h=d;for(;;){if(h===e)break t;if(f===r&&++u===i&&(s=o),f===a&&++c===n&&(l=o),(d=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=d}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for($S={focusedElem:e,selectionRange:r},Jy=!1,je=t;je!==null;)if(t=je,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,je=e;else for(;je!==null;){t=je;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,y=g.memoizedState,x=t.stateNode,_=x.getSnapshotBeforeUpdate(t.elementType===t.type?m:Ki(t.type,m),y);x.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ve(163))}}catch(S){tr(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,je=e;break}je=t.return}return g=gP,gP=!1,g}function ov(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&&uC(t,r,a)}i=i.next}while(i!==n)}}function Bx(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 cC(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 L4(e){var t=e.alternate;t!==null&&(e.alternate=null,L4(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Pa],delete t[Ov],delete t[qS],delete t[Y9],delete t[X9])),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 N4(e){return e.tag===5||e.tag===3||e.tag===4}function mP(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||N4(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 hC(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=t0));else if(n!==4&&(e=e.child,e!==null))for(hC(e,t,r),e=e.sibling;e!==null;)hC(e,t,r),e=e.sibling}function fC(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(fC(e,t,r),e=e.sibling;e!==null;)fC(e,t,r),e=e.sibling}var Ur=null,Qi=!1;function rs(e,t,r){for(r=r.child;r!==null;)P4(e,t,r),r=r.sibling}function P4(e,t,r){if(Fa&&typeof Fa.onCommitFiberUnmount=="function")try{Fa.onCommitFiberUnmount(Px,r)}catch{}switch(r.tag){case 5:cn||nh(r,t);case 6:var n=Ur,i=Qi;Ur=null,rs(e,t,r),Ur=n,Qi=i,Ur!==null&&(Qi?(e=Ur,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ur.removeChild(r.stateNode));break;case 18:Ur!==null&&(Qi?(e=Ur,r=r.stateNode,e.nodeType===8?j1(e.parentNode,r):e.nodeType===1&&j1(e,r),Iv(e)):j1(Ur,r.stateNode));break;case 4:n=Ur,i=Qi,Ur=r.stateNode.containerInfo,Qi=!0,rs(e,t,r),Ur=n,Qi=i;break;case 0:case 11:case 14:case 15:if(!cn&&(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)&&uC(r,t,o),i=i.next}while(i!==n)}rs(e,t,r);break;case 1:if(!cn&&(nh(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){tr(r,t,s)}rs(e,t,r);break;case 21:rs(e,t,r);break;case 22:r.mode&1?(cn=(n=cn)||r.memoizedState!==null,rs(e,t,r),cn=n):rs(e,t,r);break;default:rs(e,t,r)}}function yP(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new hZ),t.forEach(function(n){var i=bZ.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Ui(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~a}if(n=i,n=dr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*vZ(n/1960))-n,10e?16:e,Ss===null)var n=!1;else{if(e=Ss,Ss=null,v0=0,_t&6)throw Error(ve(331));var i=_t;for(_t|=4,je=e.current;je!==null;){var a=je,o=a.child;if(je.flags&16){var s=a.deletions;if(s!==null){for(var l=0;ldr()-wM?mu(e,0):bM|=r),On(e,t)}function B4(e,t){t===0&&(e.mode&1?(t=Rg,Rg<<=1,!(Rg&130023424)&&(Rg=4194304)):t=1);var r=bn();e=Bo(e,t),e!==null&&(kp(e,t,r),On(e,r))}function _Z(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),B4(e,r)}function bZ(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(ve(314))}n!==null&&n.delete(t),B4(e,r)}var F4;F4=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||jn.current)En=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return En=!1,lZ(e,t,r);En=!!(e.flags&131072)}else En=!1,Wt&&t.flags&1048576&&Hz(t,a0,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;xy(e,t),e=t.pendingProps;var i=Mh(t,vn.current);gh(t,r),i=pM(null,t,n,e,i,r);var a=gM();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,Rn(n)?(a=!0,n0(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,cM(t),i.updater=zx,t.stateNode=i,i._reactInternals=t,rC(t,n,e,r),t=aC(null,t,n,!0,a,r)):(t.tag=0,Wt&&a&&nM(t),mn(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(xy(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=SZ(n),e=Ki(n,e),i){case 0:t=iC(null,t,n,e,r);break e;case 1:t=dP(null,t,n,e,r);break e;case 11:t=hP(null,t,n,e,r);break e;case 14:t=fP(null,t,n,Ki(n.type,e),r);break e}throw Error(ve(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ki(n,i),iC(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ki(n,i),dP(e,t,n,i,r);case 3:e:{if(S4(t),e===null)throw Error(ve(387));n=t.pendingProps,a=t.memoizedState,i=a.element,qz(e,t),l0(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=Nh(Error(ve(423)),t),t=vP(e,t,n,r,i);break e}else if(n!==i){i=Nh(Error(ve(424)),t),t=vP(e,t,n,r,i);break e}else for(Kn=js(t.stateNode.containerInfo.firstChild),ri=t,Wt=!0,ea=null,r=Yz(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ah(),n===i){t=Fo(e,t,r);break e}mn(e,t,n,r)}t=t.child}return t;case 5:return Kz(t),e===null&&QS(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,YS(n,i)?o=null:a!==null&&YS(n,a)&&(t.flags|=32),w4(e,t),mn(e,t,o,r),t.child;case 6:return e===null&&QS(t),null;case 13:return C4(e,t,r);case 4:return hM(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=kh(t,null,n,r):mn(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ki(n,i),hP(e,t,n,i,r);case 7:return mn(e,t,t.pendingProps,r),t.child;case 8:return mn(e,t,t.pendingProps.children,r),t.child;case 12:return mn(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(o0,n._currentValue),n._currentValue=o,a!==null)if(ua(a.value,o)){if(a.children===i.children&&!jn.current){t=Fo(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=No(-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),eC(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(ve(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),eC(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}mn(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,gh(t,r),i=Pi(i),n=n(i),t.flags|=1,mn(e,t,n,r),t.child;case 14:return n=t.type,i=Ki(n,t.pendingProps),i=Ki(n.type,i),fP(e,t,n,i,r);case 15:return _4(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ki(n,i),xy(e,t),t.tag=1,Rn(n)?(e=!0,n0(t)):e=!1,gh(t,r),m4(t,n,i),rC(t,n,i,r),aC(null,t,n,!0,e,r);case 19:return T4(e,t,r);case 22:return b4(e,t,r)}throw Error(ve(156,t.tag))};function V4(e,t){return vz(e,t)}function wZ(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 Mi(e,t,r,n){return new wZ(e,t,r,n)}function MM(e){return e=e.prototype,!(!e||!e.isReactComponent)}function SZ(e){if(typeof e=="function")return MM(e)?1:0;if(e!=null){if(e=e.$$typeof,e===U2)return 11;if(e===Z2)return 14}return 2}function Bs(e,t){var r=e.alternate;return r===null?(r=Mi(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 wy(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")MM(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Yc:return yu(r.children,i,a,t);case H2:o=8,i|=8;break;case MS:return e=Mi(12,r,t,i|2),e.elementType=MS,e.lanes=a,e;case AS:return e=Mi(13,r,t,i),e.elementType=AS,e.lanes=a,e;case kS:return e=Mi(19,r,t,i),e.elementType=kS,e.lanes=a,e;case K3:return Vx(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case X3:o=10;break e;case q3:o=9;break e;case U2:o=11;break e;case Z2:o=14;break e;case ps:o=16,n=null;break e}throw Error(ve(130,e==null?e:typeof e,""))}return t=Mi(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function yu(e,t,r,n){return e=Mi(7,e,n,t),e.lanes=r,e}function Vx(e,t,r,n){return e=Mi(22,e,n,t),e.elementType=K3,e.lanes=r,e.stateNode={isHidden:!1},e}function W1(e,t,r){return e=Mi(6,e,null,t),e.lanes=r,e}function H1(e,t,r){return t=Mi(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function CZ(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=C1(0),this.expirationTimes=C1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=C1(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function AM(e,t,r,n,i,a,o,s,l){return e=new CZ(e,t,r,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Mi(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},cM(a),e}function TZ(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(U4)}catch(e){console.error(e)}}U4(),U3.exports=ai;var Z4=U3.exports,MP=Z4;CS.createRoot=MP.createRoot,CS.hydrateRoot=MP.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 Hv(){return Hv=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function PM(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function PZ(){return Math.random().toString(36).substr(2,8)}function kP(e,t){return{usr:e.state,key:e.key,idx:t}}function mC(e,t,r,n){return r===void 0&&(r=null),Hv({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ef(t):t,{state:r,key:t&&t.key||n||PZ()})}function m0(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 ef(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 IZ(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,s=Cs.Pop,l=null,u=c();u==null&&(u=0,o.replaceState(Hv({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function h(){s=Cs.Pop;let y=c(),_=y==null?null:y-u;u=y,l&&l({action:s,location:m.location,delta:_})}function f(y,_){s=Cs.Push;let x=mC(m.location,y,_);u=c()+1;let w=kP(x,u),S=m.createHref(x);try{o.pushState(w,"",S)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;i.location.assign(S)}a&&l&&l({action:s,location:m.location,delta:1})}function d(y,_){s=Cs.Replace;let x=mC(m.location,y,_);u=c();let w=kP(x,u),S=m.createHref(x);o.replaceState(w,"",S),a&&l&&l({action:s,location:m.location,delta:0})}function g(y){let _=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof y=="string"?y:m0(y);return x=x.replace(/ $/,"%20"),wr(_,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,_)}let m={get action(){return s},get location(){return e(i,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(AP,h),l=y,()=>{i.removeEventListener(AP,h),l=null}},createHref(y){return t(i,y)},createURL:g,encodeLocation(y){let _=g(y);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:f,replace:d,go(y){return o.go(y)}};return m}var LP;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(LP||(LP={}));function DZ(e,t,r){return r===void 0&&(r="/"),EZ(e,t,r)}function EZ(e,t,r,n){let i=typeof t=="string"?ef(t):t,a=IM(i.pathname||"/",r);if(a==null)return null;let o=$4(e);jZ(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("/")&&(wr(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=Fs([n,l.relativePath]),c=r.concat(l);a.children&&a.children.length>0&&(wr(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),$4(a.children,t,c,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:GZ(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 Y4(a.path))i(a,o,l)}),t}function Y4(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=Y4(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 jZ(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:WZ(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const RZ=/^:[\w-]+$/,OZ=3,zZ=2,BZ=1,FZ=10,VZ=-2,NP=e=>e==="*";function GZ(e,t){let r=e.split("/"),n=r.length;return r.some(NP)&&(n+=VZ),t&&(n+=zZ),r.filter(i=>!NP(i)).reduce((i,a)=>i+(RZ.test(a)?OZ:a===""?BZ:FZ),n)}function WZ(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 HZ(e,t,r){let{routesMeta:n}=e,i={},a="/",o=[];for(let s=0;s{let{paramName:f,isOptional:d}=c;if(f==="*"){let m=s[h]||"";o=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}const g=s[h];return d&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function ZZ(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),PM(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 $Z(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return PM(!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 IM(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 YZ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,XZ=e=>YZ.test(e);function qZ(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?ef(e):e,a;if(r)if(XZ(r))a=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),PM(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?a=PP(r.substring(1),"/"):a=PP(r,t)}else a=t;return{pathname:a,search:QZ(n),hash:e$(i)}}function PP(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 U1(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 KZ(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function X4(e,t){let r=KZ(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function q4(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=ef(e):(i=Hv({},e),wr(!i.pathname||!i.pathname.includes("?"),U1("?","pathname","search",i)),wr(!i.pathname||!i.pathname.includes("#"),U1("#","pathname","hash",i)),wr(!i.search||!i.search.includes("#"),U1("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=r;else{let h=t.length-1;if(!n&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),h-=1;i.pathname=f.join("/")}s=h>=0?t[h]:"/"}let l=qZ(i,s),u=o&&o!=="/"&&o.endsWith("/"),c=(a||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Fs=e=>e.join("/").replace(/\/\/+/g,"/"),JZ=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),QZ=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,e$=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function t$(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const K4=["post","put","patch","delete"];new Set(K4);const r$=["get",...K4];new Set(r$);/** + */function Hv(){return Hv=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function PM(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function PZ(){return Math.random().toString(36).substr(2,8)}function kP(e,t){return{usr:e.state,key:e.key,idx:t}}function mC(e,t,r,n){return r===void 0&&(r=null),Hv({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ef(t):t,{state:r,key:t&&t.key||n||PZ()})}function m0(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 ef(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 IZ(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,s=Cs.Pop,l=null,u=c();u==null&&(u=0,o.replaceState(Hv({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function h(){s=Cs.Pop;let y=c(),x=y==null?null:y-u;u=y,l&&l({action:s,location:m.location,delta:x})}function f(y,x){s=Cs.Push;let _=mC(m.location,y,x);u=c()+1;let w=kP(_,u),S=m.createHref(_);try{o.pushState(w,"",S)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;i.location.assign(S)}a&&l&&l({action:s,location:m.location,delta:1})}function d(y,x){s=Cs.Replace;let _=mC(m.location,y,x);u=c();let w=kP(_,u),S=m.createHref(_);o.replaceState(w,"",S),a&&l&&l({action:s,location:m.location,delta:0})}function g(y){let x=i.location.origin!=="null"?i.location.origin:i.location.href,_=typeof y=="string"?y:m0(y);return _=_.replace(/ $/,"%20"),wr(x,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,x)}let m={get action(){return s},get location(){return e(i,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(AP,h),l=y,()=>{i.removeEventListener(AP,h),l=null}},createHref(y){return t(i,y)},createURL:g,encodeLocation(y){let x=g(y);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:f,replace:d,go(y){return o.go(y)}};return m}var LP;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(LP||(LP={}));function DZ(e,t,r){return r===void 0&&(r="/"),EZ(e,t,r)}function EZ(e,t,r,n){let i=typeof t=="string"?ef(t):t,a=IM(i.pathname||"/",r);if(a==null)return null;let o=$4(e);jZ(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("/")&&(wr(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=Fs([n,l.relativePath]),c=r.concat(l);a.children&&a.children.length>0&&(wr(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),$4(a.children,t,c,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:GZ(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 Y4(a.path))i(a,o,l)}),t}function Y4(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=Y4(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 jZ(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:WZ(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const RZ=/^:[\w-]+$/,OZ=3,zZ=2,BZ=1,FZ=10,VZ=-2,NP=e=>e==="*";function GZ(e,t){let r=e.split("/"),n=r.length;return r.some(NP)&&(n+=VZ),t&&(n+=zZ),r.filter(i=>!NP(i)).reduce((i,a)=>i+(RZ.test(a)?OZ:a===""?BZ:FZ),n)}function WZ(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 HZ(e,t,r){let{routesMeta:n}=e,i={},a="/",o=[];for(let s=0;s{let{paramName:f,isOptional:d}=c;if(f==="*"){let m=s[h]||"";o=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}const g=s[h];return d&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function ZZ(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),PM(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 $Z(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return PM(!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 IM(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 YZ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,XZ=e=>YZ.test(e);function qZ(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?ef(e):e,a;if(r)if(XZ(r))a=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),PM(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?a=PP(r.substring(1),"/"):a=PP(r,t)}else a=t;return{pathname:a,search:QZ(n),hash:e$(i)}}function PP(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 U1(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 KZ(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function X4(e,t){let r=KZ(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function q4(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=ef(e):(i=Hv({},e),wr(!i.pathname||!i.pathname.includes("?"),U1("?","pathname","search",i)),wr(!i.pathname||!i.pathname.includes("#"),U1("#","pathname","hash",i)),wr(!i.search||!i.search.includes("#"),U1("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=r;else{let h=t.length-1;if(!n&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),h-=1;i.pathname=f.join("/")}s=h>=0?t[h]:"/"}let l=qZ(i,s),u=o&&o!=="/"&&o.endsWith("/"),c=(a||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Fs=e=>e.join("/").replace(/\/\/+/g,"/"),JZ=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),QZ=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,e$=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function t$(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const K4=["post","put","patch","delete"];new Set(K4);const r$=["get",...K4];new Set(r$);/** * 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 Uv(){return Uv=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),G.useCallback(function(u,c){if(c===void 0&&(c={}),!s.current)return;if(typeof u=="number"){n.go(u);return}let h=q4(u,JSON.parse(o),a,c.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Fs([t,h.pathname])),(c.replace?n.replace:n.push)(h,c.state,c)},[t,n,o,a,e])}function tB(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=G.useContext($u),{matches:i}=G.useContext(Yu),{pathname:a}=tf(),o=JSON.stringify(X4(i,n.v7_relativeSplatPath));return G.useMemo(()=>q4(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function o$(e,t){return s$(e,t)}function s$(e,t,r,n){Ip()||wr(!1);let{navigator:i}=G.useContext($u),{matches:a}=G.useContext(Yu),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=tf(),c;if(t){var h;let y=typeof t=="string"?ef(t):t;l==="/"||(h=y.pathname)!=null&&h.startsWith(l)||wr(!1),c=y}else c=u;let f=c.pathname||"/",d=f;if(l!=="/"){let y=l.replace(/^\//,"").split("/");d="/"+f.replace(/^\//,"").split("/").slice(y.length).join("/")}let g=DZ(e,{pathname:d}),m=f$(g&&g.map(y=>Object.assign({},y,{params:Object.assign({},s,y.params),pathname:Fs([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Fs([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,r,n);return t&&m?G.createElement(U_.Provider,{value:{location:Uv({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Cs.Pop}},m):m}function l$(){let e=g$(),t=t$(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 G.createElement(G.Fragment,null,G.createElement("h2",null,"Unexpected Application Error!"),G.createElement("h3",{style:{fontStyle:"italic"}},t),r?G.createElement("pre",{style:i},r):null,null)}const u$=G.createElement(l$,null);class c$ extends G.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?G.createElement(Yu.Provider,{value:this.props.routeContext},G.createElement(J4.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function h$(e){let{routeContext:t,match:r,children:n}=e,i=G.useContext(DM);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),G.createElement(Yu.Provider,{value:t},n)}function f$(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(h=>h.route.id&&(s==null?void 0:s[h.route.id])!==void 0);c>=0||wr(!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,h,f)=>{let d,g=!1,m=null,y=null;r&&(d=s&&h.route.id?s[h.route.id]:void 0,m=h.route.errorElement||u$,l&&(u<0&&f===0?(y$("route-fallback"),g=!0,y=null):u===f&&(g=!0,y=h.route.hydrateFallbackElement||null)));let _=t.concat(o.slice(0,f+1)),x=()=>{let w;return d?w=m:g?w=y:h.route.Component?w=G.createElement(h.route.Component,null):h.route.element?w=h.route.element:w=c,G.createElement(h$,{match:h,routeContext:{outlet:c,matches:_,isDataRoute:r!=null},children:w})};return r&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?G.createElement(c$,{location:r.location,revalidation:r.revalidation,component:m,error:d,children:x(),routeContext:{outlet:null,matches:_,isDataRoute:!0}}):x()},null)}var rB=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(rB||{}),nB=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}(nB||{});function d$(e){let t=G.useContext(DM);return t||wr(!1),t}function v$(e){let t=G.useContext(n$);return t||wr(!1),t}function p$(e){let t=G.useContext(Yu);return t||wr(!1),t}function iB(e){let t=p$(),r=t.matches[t.matches.length-1];return r.route.id||wr(!1),r.route.id}function g$(){var e;let t=G.useContext(J4),r=v$(),n=iB();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function m$(){let{router:e}=d$(rB.UseNavigateStable),t=iB(nB.UseNavigateStable),r=G.useRef(!1);return Q4(()=>{r.current=!0}),G.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Uv({fromRouteId:t},a)))},[e,t])}const IP={};function y$(e,t,r){IP[e]||(IP[e]=!0)}function _$(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function $i(e){wr(!1)}function x$(e){let{basename:t="/",children:r=null,location:n,navigationType:i=Cs.Pop,navigator:a,static:o=!1,future:s}=e;Ip()&&wr(!1);let l=t.replace(/^\/*/,"/"),u=G.useMemo(()=>({basename:l,navigator:a,static:o,future:Uv({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof n=="string"&&(n=ef(n));let{pathname:c="/",search:h="",hash:f="",state:d=null,key:g="default"}=n,m=G.useMemo(()=>{let y=IM(c,l);return y==null?null:{location:{pathname:y,search:h,hash:f,state:d,key:g},navigationType:i}},[l,c,h,f,d,g,i]);return m==null?null:G.createElement($u.Provider,{value:u},G.createElement(U_.Provider,{children:r,value:m}))}function b$(e){let{children:t,location:r}=e;return o$(yC(t),r)}new Promise(()=>{});function yC(e,t){t===void 0&&(t=[]);let r=[];return G.Children.forEach(e,(n,i)=>{if(!G.isValidElement(n))return;let a=[...t,i];if(n.type===G.Fragment){r.push.apply(r,yC(n.props.children,a));return}n.type!==$i&&wr(!1),!n.props.index||!n.props.children||wr(!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=yC(n.props.children,a)),r.push(o)}),r}/** + */function Uv(){return Uv=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),G.useCallback(function(u,c){if(c===void 0&&(c={}),!s.current)return;if(typeof u=="number"){n.go(u);return}let h=q4(u,JSON.parse(o),a,c.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Fs([t,h.pathname])),(c.replace?n.replace:n.push)(h,c.state,c)},[t,n,o,a,e])}function tB(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=G.useContext($u),{matches:i}=G.useContext(Yu),{pathname:a}=tf(),o=JSON.stringify(X4(i,n.v7_relativeSplatPath));return G.useMemo(()=>q4(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function o$(e,t){return s$(e,t)}function s$(e,t,r,n){Ip()||wr(!1);let{navigator:i}=G.useContext($u),{matches:a}=G.useContext(Yu),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=tf(),c;if(t){var h;let y=typeof t=="string"?ef(t):t;l==="/"||(h=y.pathname)!=null&&h.startsWith(l)||wr(!1),c=y}else c=u;let f=c.pathname||"/",d=f;if(l!=="/"){let y=l.replace(/^\//,"").split("/");d="/"+f.replace(/^\//,"").split("/").slice(y.length).join("/")}let g=DZ(e,{pathname:d}),m=f$(g&&g.map(y=>Object.assign({},y,{params:Object.assign({},s,y.params),pathname:Fs([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Fs([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,r,n);return t&&m?G.createElement(Zx.Provider,{value:{location:Uv({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Cs.Pop}},m):m}function l$(){let e=g$(),t=t$(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 G.createElement(G.Fragment,null,G.createElement("h2",null,"Unexpected Application Error!"),G.createElement("h3",{style:{fontStyle:"italic"}},t),r?G.createElement("pre",{style:i},r):null,null)}const u$=G.createElement(l$,null);class c$ extends G.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?G.createElement(Yu.Provider,{value:this.props.routeContext},G.createElement(J4.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function h$(e){let{routeContext:t,match:r,children:n}=e,i=G.useContext(DM);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),G.createElement(Yu.Provider,{value:t},n)}function f$(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(h=>h.route.id&&(s==null?void 0:s[h.route.id])!==void 0);c>=0||wr(!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,h,f)=>{let d,g=!1,m=null,y=null;r&&(d=s&&h.route.id?s[h.route.id]:void 0,m=h.route.errorElement||u$,l&&(u<0&&f===0?(y$("route-fallback"),g=!0,y=null):u===f&&(g=!0,y=h.route.hydrateFallbackElement||null)));let x=t.concat(o.slice(0,f+1)),_=()=>{let w;return d?w=m:g?w=y:h.route.Component?w=G.createElement(h.route.Component,null):h.route.element?w=h.route.element:w=c,G.createElement(h$,{match:h,routeContext:{outlet:c,matches:x,isDataRoute:r!=null},children:w})};return r&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?G.createElement(c$,{location:r.location,revalidation:r.revalidation,component:m,error:d,children:_(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):_()},null)}var rB=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(rB||{}),nB=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}(nB||{});function d$(e){let t=G.useContext(DM);return t||wr(!1),t}function v$(e){let t=G.useContext(n$);return t||wr(!1),t}function p$(e){let t=G.useContext(Yu);return t||wr(!1),t}function iB(e){let t=p$(),r=t.matches[t.matches.length-1];return r.route.id||wr(!1),r.route.id}function g$(){var e;let t=G.useContext(J4),r=v$(),n=iB();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function m$(){let{router:e}=d$(rB.UseNavigateStable),t=iB(nB.UseNavigateStable),r=G.useRef(!1);return Q4(()=>{r.current=!0}),G.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Uv({fromRouteId:t},a)))},[e,t])}const IP={};function y$(e,t,r){IP[e]||(IP[e]=!0)}function x$(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function $i(e){wr(!1)}function _$(e){let{basename:t="/",children:r=null,location:n,navigationType:i=Cs.Pop,navigator:a,static:o=!1,future:s}=e;Ip()&&wr(!1);let l=t.replace(/^\/*/,"/"),u=G.useMemo(()=>({basename:l,navigator:a,static:o,future:Uv({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof n=="string"&&(n=ef(n));let{pathname:c="/",search:h="",hash:f="",state:d=null,key:g="default"}=n,m=G.useMemo(()=>{let y=IM(c,l);return y==null?null:{location:{pathname:y,search:h,hash:f,state:d,key:g},navigationType:i}},[l,c,h,f,d,g,i]);return m==null?null:G.createElement($u.Provider,{value:u},G.createElement(Zx.Provider,{children:r,value:m}))}function b$(e){let{children:t,location:r}=e;return o$(yC(t),r)}new Promise(()=>{});function yC(e,t){t===void 0&&(t=[]);let r=[];return G.Children.forEach(e,(n,i)=>{if(!G.isValidElement(n))return;let a=[...t,i];if(n.type===G.Fragment){r.push.apply(r,yC(n.props.children,a));return}n.type!==$i&&wr(!1),!n.props.index||!n.props.children||wr(!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=yC(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 _C(){return _C=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function S$(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function C$(e,t){return e.button===0&&(!t||t==="_self")&&!S$(e)}const T$=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],M$="6";try{window.__reactRouterVersion=M$}catch{}const A$="startTransition",DP=_7[A$];function k$(e){let{basename:t,children:r,future:n,window:i}=e,a=G.useRef();a.current==null&&(a.current=NZ({window:i,v5Compat:!0}));let o=a.current,[s,l]=G.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},c=G.useCallback(h=>{u&&DP?DP(()=>l(h)):l(h)},[l,u]);return G.useLayoutEffect(()=>o.listen(c),[o,c]),G.useEffect(()=>_$(n),[n]),G.createElement(x$,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const L$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",N$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,P$=G.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:a,replace:o,state:s,target:l,to:u,preventScrollReset:c,viewTransition:h}=t,f=w$(t,T$),{basename:d}=G.useContext($u),g,m=!1;if(typeof u=="string"&&N$.test(u)&&(g=u,L$))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),T=IM(S.pathname,d);S.origin===w.origin&&T!=null?u=T+S.search+S.hash:m=!0}catch{}let y=i$(u,{relative:i}),_=I$(u,{replace:o,state:s,target:l,preventScrollReset:c,relative:i,viewTransition:h});function x(w){n&&n(w),w.defaultPrevented||_(w)}return G.createElement("a",_C({},f,{href:g||y,onClick:m||a?n:x,ref:r,target:l}))});var EP;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(EP||(EP={}));var jP;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(jP||(jP={}));function I$(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,l=eB(),u=tf(),c=tB(e,{relative:o});return G.useCallback(h=>{if(C$(h,r)){h.preventDefault();let f=n!==void 0?n:m0(u)===m0(c);l(e,{replace:f,state:i,preventScrollReset:a,relative:o,viewTransition:s})}},[u,l,c,n,i,r,e,a,o,s])}/** + */function xC(){return xC=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function S$(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function C$(e,t){return e.button===0&&(!t||t==="_self")&&!S$(e)}const T$=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],M$="6";try{window.__reactRouterVersion=M$}catch{}const A$="startTransition",DP=x7[A$];function k$(e){let{basename:t,children:r,future:n,window:i}=e,a=G.useRef();a.current==null&&(a.current=NZ({window:i,v5Compat:!0}));let o=a.current,[s,l]=G.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},c=G.useCallback(h=>{u&&DP?DP(()=>l(h)):l(h)},[l,u]);return G.useLayoutEffect(()=>o.listen(c),[o,c]),G.useEffect(()=>x$(n),[n]),G.createElement(_$,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const L$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",N$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,P$=G.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:a,replace:o,state:s,target:l,to:u,preventScrollReset:c,viewTransition:h}=t,f=w$(t,T$),{basename:d}=G.useContext($u),g,m=!1;if(typeof u=="string"&&N$.test(u)&&(g=u,L$))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),T=IM(S.pathname,d);S.origin===w.origin&&T!=null?u=T+S.search+S.hash:m=!0}catch{}let y=i$(u,{relative:i}),x=I$(u,{replace:o,state:s,target:l,preventScrollReset:c,relative:i,viewTransition:h});function _(w){n&&n(w),w.defaultPrevented||x(w)}return G.createElement("a",xC({},f,{href:g||y,onClick:m||a?n:_,ref:r,target:l}))});var EP;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(EP||(EP={}));var jP;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(jP||(jP={}));function I$(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,l=eB(),u=tf(),c=tB(e,{relative:o});return G.useCallback(h=>{if(C$(h,r)){h.preventDefault();let f=n!==void 0?n:m0(u)===m0(c);l(e,{replace:f,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. @@ -129,7 +129,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 Z_=Re("Car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);/** + */const $x=Re("Car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. @@ -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 $_=Re("Droplets",[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]]);/** + */const Yx=Re("Droplets",[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. @@ -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 Y_=Re("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/** + */const Xx=Re("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. @@ -254,7 +254,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 X_=Re("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 qx=Re("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. @@ -294,7 +294,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 q_=Re("Mountain",[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}]]);/** + */const Kx=Re("Mountain",[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. @@ -319,7 +319,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 K_=Re("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** + */const Jx=Re("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. @@ -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 J_=Re("Satellite",[["path",{d:"M13 7 9 3 5 7l4 4",key:"vyckw6"}],["path",{d:"m17 11 4 4-4 4-4-4",key:"rchckc"}],["path",{d:"m8 12 4 4 6-6-4-4Z",key:"1sshf7"}],["path",{d:"m16 8 3-3",key:"x428zp"}],["path",{d:"M9 21a6 6 0 0 0-6-6",key:"1iajcf"}]]);/** + */const Qx=Re("Satellite",[["path",{d:"M13 7 9 3 5 7l4 4",key:"vyckw6"}],["path",{d:"m17 11 4 4-4 4-4-4",key:"rchckc"}],["path",{d:"m8 12 4 4 6-6-4-4Z",key:"1sshf7"}],["path",{d:"m16 8 3-3",key:"x428zp"}],["path",{d:"M9 21a6 6 0 0 0-6-6",key:"1iajcf"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. @@ -339,12 +339,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 Q_=Re("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + */const e_=Re("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xC=Re("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/** + */const _C=Re("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. @@ -399,7 +399,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 ex=Re("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/** + */const t_=Re("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/** * @license lucide-react v0.383.0 - ISC * * This source code is licensed under the ISC license. @@ -409,7 +409,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 Dh=Re("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 zi(e){const t=await fetch(e);if(!t.ok)throw new Error(`API error: ${t.status} ${t.statusText}`);return t.json()}async function RP(){return zi("/api/status")}async function eY(){return zi("/api/health")}async function tY(){return zi("/api/nodes")}async function rY(){return zi("/api/edges")}async function nY(){return zi("/api/sources")}async function yB(){return zi("/api/alerts/active")}async function OP(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),zi(`/api/alerts/history?${i.toString()}`)}async function iY(){return zi("/api/subscriptions")}async function _B(){return zi("/api/env/status")}async function xB(){return zi("/api/env/active")}async function aY(){return zi("/api/env/swpc")}async function oY(){return zi("/api/regions")}function FM(){const[e,t]=G.useState(!1),[r,n]=G.useState(null),[i,a]=G.useState(null),[o,s]=G.useState(null),l=G.useRef(null),u=G.useRef(null),c=G.useRef(1e3),h=G.useCallback(()=>{var g;if(((g=l.current)==null?void 0:g.readyState)===WebSocket.OPEN)return;const d=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/live`;try{const m=new WebSocket(d);l.current=m,m.onopen=()=>{t(!0),c.current=1e3},m.onmessage=_=>{try{const x=JSON.parse(_.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)}},m.onclose=()=>{t(!1),l.current=null;const _=Math.min(c.current,3e4);u.current=window.setTimeout(()=>{c.current=Math.min(_*2,3e4),h()},_)},m.onerror=()=>{m.close()};const y=setInterval(()=>{m.readyState===WebSocket.OPEN&&m.send("ping")},3e4);m.addEventListener("close",()=>{clearInterval(y)})}catch(m){console.error("Failed to create WebSocket:",m)}},[]);return G.useEffect(()=>(h(),()=>{u.current&&clearTimeout(u.current),l.current&&l.current.close()}),[h]),{connected:e,lastHealth:r,lastAlert:i,lastMessage:o}}const bB=G.createContext(null);function sY(){const e=G.useContext(bB);if(!e)throw new Error("useToast must be used within a ToastProvider");return e}function lY(e){switch(e==null?void 0:e.toLowerCase()){case"critical":case"emergency":return{bg:"bg-red-500/10",border:"border-red-500",icon:Vo,iconColor:"text-red-500"};case"warning":return{bg:"bg-amber-500/10",border:"border-amber-500",icon:$a,iconColor:"text-amber-500"};default:return{bg:"bg-blue-500/10",border:"border-blue-500",icon:X_,iconColor:"text-blue-500"}}}function uY({toast:e,onDismiss:t,onNavigate:r}){const n=lY(e.alert.severity),i=n.icon;return G.useEffect(()=>{const a=setTimeout(t,8e3);return()=>clearTimeout(a)},[t]),v.jsx("div",{className:`${n.bg} border ${n.border} rounded-lg shadow-lg overflow-hidden animate-slide-in cursor-pointer`,onClick:r,role:"alert",children:v.jsxs("div",{className:"flex items-start gap-3 p-4",children:[v.jsx("div",{className:`w-1 self-stretch -ml-4 -my-4 ${n.border.replace("border","bg")}`}),v.jsx(i,{size:18,className:n.iconColor}),v.jsxs("div",{className:"flex-1 min-w-0 pr-2",children:[v.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())}),v.jsx("div",{className:"text-sm text-slate-300 line-clamp-2",children:e.alert.message})]}),v.jsx("button",{onClick:a=>{a.stopPropagation(),t()},className:"text-slate-400 hover:text-slate-200 transition-colors",children:v.jsx(ca,{size:16})})]})})}function cY({children:e}){const[t,r]=G.useState([]),n=eB(),i=G.useCallback(s=>{const l=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(u=>[...u,{id:l,alert:s}])},[]),a=G.useCallback(s=>{r(l=>l.filter(u=>u.id!==s))},[]),o=G.useCallback(()=>{n("/alerts")},[n]);return v.jsxs(bB.Provider,{value:{addToast:i},children:[e,v.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=>v.jsx("div",{className:"pointer-events-auto",children:v.jsx(uY,{toast:s,onDismiss:()=>a(s.id),onNavigate:o})},s.id))})]})}const tx="meshai.restartRequired.v1";function zP(){try{const e=localStorage.getItem(tx);if(!e)return{required:!1,changedKeys:[],ts:0};const t=JSON.parse(e);return{required:!!t.required,changedKeys:Array.isArray(t.changedKeys)?t.changedKeys:[],ts:Number(t.ts)||0}}catch{return{required:!1,changedKeys:[],ts:0}}}function hY(e){const t={required:!0,changedKeys:[...new Set(e)],ts:Date.now()};localStorage.setItem(tx,JSON.stringify(t)),window.dispatchEvent(new CustomEvent("meshai:restart-required",{detail:t}))}function BP(){localStorage.removeItem(tx),window.dispatchEvent(new CustomEvent("meshai:restart-required",{detail:{required:!1,changedKeys:[],ts:0}}))}function fY(){const[e,t]=G.useState(()=>zP()),[r,n]=G.useState(!1),[i,a]=G.useState(null);G.useEffect(()=>{const l=c=>{const h=c.detail;t(h)},u=c=>{c.key===tx&&t(zP())};return window.addEventListener("meshai:restart-required",l),window.addEventListener("storage",u),()=>{window.removeEventListener("meshai:restart-required",l),window.removeEventListener("storage",u)}},[]);const o=G.useCallback(async()=>{n(!0),a(null);try{const l=await fetch("/api/system/restart",{method:"POST"});if(!l.ok&&l.status!==202){const u=await l.json().catch(()=>({}));throw new Error(u.detail||`HTTP ${l.status}`)}BP()}catch(l){a(String(l)),n(!1)}},[]),s=G.useCallback(()=>{BP()},[]);return e.required?v.jsxs("div",{className:"bg-yellow-900/40 border-b border-yellow-700 text-yellow-100 px-4 py-2 text-sm flex items-center gap-3",children:[v.jsx($a,{className:"w-4 h-4 flex-shrink-0 text-yellow-300"}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("strong",{children:"Container restart required"}),e.changedKeys.length>0&&v.jsxs("span",{className:"text-yellow-300 ml-2",children:["(",e.changedKeys.length," key",e.changedKeys.length===1?"":"s",":"," ",v.jsxs("span",{className:"font-mono text-xs",children:[e.changedKeys.slice(0,3).join(", "),e.changedKeys.length>3?", โ€ฆ":""]}),")"]}),v.jsx("span",{className:"ml-2 text-yellow-300/80",children:"for these changes to take effect. Until then the runtime keeps its boot-time configuration. Restart-required keys include anything under Config โ†’ environmental (feed_source, central URL), the LLM backend swap, and the dispatcher cold-start grace window. Other keys take effect on the next handler call."}),i&&v.jsx("div",{className:"text-red-400 text-xs mt-1",children:i})]}),v.jsxs("button",{onClick:o,disabled:r,className:"flex items-center gap-1 px-3 py-1 bg-yellow-700 hover:bg-yellow-600 disabled:opacity-50 rounded text-white text-xs",children:[v.jsx(q$,{className:`w-3 h-3 ${r?"animate-spin":""}`}),r?"Restartingโ€ฆ":"Restart now"]}),v.jsx("button",{onClick:s,className:"text-yellow-300 hover:text-white px-1",title:"Dismiss (you can still restart later)",children:v.jsx(ca,{className:"w-4 h-4"})})]}):null}const wB=[{path:"/",label:"Dashboard",icon:fB},{path:"/mesh",label:"Mesh",icon:Di},{path:"/environment",label:"Environment",icon:Du},{path:"/config",label:"Config",icon:vB},{path:"/alerts",label:"Alerts",icon:Zv},{path:"/notifications",label:"Notifications",icon:R$},{path:"/reference",label:"Reference",icon:oB},{path:"/adapter-config",label:"Adapter Config",icon:BM},{path:"/gauge-sites",label:"Gauge Sites",icon:$_},{path:"/town-anchors",label:"Town Anchors",icon:nf}];function dY(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 vY(e){const t=wB.find(r=>r.path===e);return(t==null?void 0:t.label)||"Dashboard"}function pY({children:e}){var f;const t=tf(),{connected:r,lastAlert:n}=FM(),{addToast:i}=sY(),[a,o]=G.useState(null),[s,l]=G.useState(null);G.useEffect(()=>{if(n){const d=`${n.type}-${n.message}-${n.timestamp}`;d!==s&&(l(d),i(n))}},[n,s,i]);const[u,c]=G.useState(new Date);G.useEffect(()=>{RP().then(o).catch(console.error);const d=setInterval(()=>{RP().then(o).catch(console.error)},3e4);return()=>clearInterval(d)},[]),G.useEffect(()=>{const d=setInterval(()=>c(new Date),1e3);return()=>clearInterval(d)},[]);const h=u.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});return v.jsxs("div",{className:"flex h-screen overflow-hidden bg-bg text-slate-200",children:[v.jsxs("aside",{className:"w-[220px] flex-shrink-0 bg-bg-card border-r border-border flex flex-col overflow-y-auto",children:[v.jsx("div",{className:"p-5 border-b border-border",children:v.jsxs("div",{className:"flex items-center gap-3",children:[v.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"}),v.jsxs("div",{children:[v.jsx("div",{className:"font-semibold text-lg",children:"MeshAI"}),v.jsxs("div",{className:"text-xs text-slate-500 font-mono",children:["v",(a==null?void 0:a.version)||"..."]})]})]})}),v.jsx("nav",{className:"flex-1 py-4",children:wB.map(d=>{const g=t.pathname===d.path,m=d.icon;return v.jsxs(P$,{to:d.path,className:`flex items-center gap-3 px-5 py-3 text-sm transition-colors relative ${g?"text-blue-400 bg-blue-500/10":"text-slate-400 hover:text-slate-200 hover:bg-bg-hover"}`,children:[g&&v.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-blue-500"}),v.jsx(m,{size:18}),d.label]},d.path)})}),v.jsxs("div",{className:"p-5 border-t border-border",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${a!=null&&a.connected?"bg-green-500":"bg-red-500"}`}),v.jsx("span",{className:"text-xs text-slate-400",children:a!=null&&a.connected?"Connected":"Disconnected"})]}),v.jsxs("div",{className:"text-xs text-slate-500 font-mono truncate",children:[(f=a==null?void 0:a.connection_type)==null?void 0:f.toUpperCase(),": ",a==null?void 0:a.connection_target]}),v.jsxs("div",{className:"text-xs text-slate-500 mt-1",children:["Uptime: ",a?dY(a.uptime_seconds):"..."]})]})]}),v.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[v.jsxs("header",{className:"h-14 flex-shrink-0 border-b border-border bg-bg-card flex items-center justify-between px-6",children:[v.jsx("h1",{className:"text-lg font-semibold",children:vY(t.pathname)}),v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${r?"bg-green-500 animate-pulse-slow":"bg-slate-500"}`}),v.jsx("span",{className:"text-xs text-slate-400",children:r?"Live":"Offline"})]}),v.jsxs("div",{className:"text-sm font-mono text-slate-400",children:[h," MT"]})]})]}),v.jsxs("main",{className:"flex-1 overflow-y-auto p-6",children:[v.jsx(fY,{}),e]})]})]})}function gY({health:e}){const t=e.score,r=e.tier,i=(s=>s>=80?"#22c55e":s>=60?"#f59e0b":"#ef4444")(t),a=2*Math.PI*45,o=t/100*a;return v.jsx("div",{className:"flex flex-col items-center",children:v.jsxs("svg",{width:"140",height:"140",viewBox:"0 0 100 100",children:[v.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:"#1e2a3a",strokeWidth:"8"}),v.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"}),v.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)}),v.jsx("text",{x:"50",y:"62",textAnchor:"middle",className:"fill-slate-400 text-xs",style:{fontSize:"10px"},children:r})]})})}function id({label:e,value:t}){const r=n=>n>=80?"bg-green-500":n>=60?"bg-amber-500":"bg-red-500";return v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:"w-24 text-xs text-slate-400 truncate",children:e}),v.jsx("div",{className:"flex-1 h-2 bg-border rounded-full overflow-hidden",children:v.jsx("div",{className:`h-full ${r(t)} transition-all duration-300`,style:{width:`${t}%`}})}),v.jsx("div",{className:"w-12 text-right text-xs font-mono text-slate-300",children:t.toFixed(1)})]})}function mY({alert:e}){const r=(i=>{switch(i.toLowerCase()){case"critical":case"emergency":case"immediate":return{bg:"bg-red-500/10",border:"border-red-500",icon:Vo,iconColor:"text-red-500"};case"warning":case"priority":return{bg:"bg-amber-500/10",border:"border-amber-500",icon:$a,iconColor:"text-amber-500"};case"routine":default:return{bg:"bg-blue-500/10",border:"border-blue-500",icon:X_,iconColor:"text-blue-500"}}})(e.severity),n=r.icon;return v.jsxs("div",{className:`p-3 rounded-lg ${r.bg} border-l-2 ${r.border} flex items-start gap-3`,children:[v.jsx(n,{size:16,className:r.iconColor}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("div",{className:"text-sm text-slate-200",children:e.message}),v.jsx("div",{className:"text-xs text-slate-500 mt-1",children:e.timestamp||"Just now"})]})]})}function yY({source:e}){const t=()=>e.is_loaded?e.last_error?"bg-amber-500":"bg-green-500":"bg-red-500";return v.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-bg-hover",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${t()}`}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("div",{className:"text-sm text-slate-200 truncate",children:e.name}),v.jsxs("div",{className:"text-xs text-slate-500",children:[e.node_count," nodes ยท ",e.type]})]})]})}function Yg({icon:e,label:t,value:r,subvalue:n}){return v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4",children:[v.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[v.jsx(e,{size:14}),v.jsx("span",{className:"text-xs",children:t})]}),v.jsx("div",{className:"font-mono text-xl text-slate-100",children:r}),n&&v.jsx("div",{className:"text-xs text-slate-500 mt-1",children:n})]})}function _Y({bandConditions:e}){const t=i=>{switch(i){case"Good":return"๐ŸŸข";case"Fair":return"๐ŸŸก";case"Poor":return"๐Ÿ”ด";default:return"โ€”"}},r=i=>i?i.includes("Night")?"๐ŸŒ™":"โ˜€๏ธ":"";if(!(e!=null&&e.enabled)||!(e!=null&&e.ratings))return v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4 flex flex-col h-full",children:[v.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[v.jsx(Dh,{size:14}),"RF Propagation"]}),v.jsx("div",{className:"flex-1 flex items-center justify-center",children:v.jsx("div",{className:"text-center py-8",children:v.jsx("div",{className:"text-slate-400",children:"No band conditions data"})})})]});const n=["80-40m","30-20m","17-15m","12-10m"];return v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4 flex flex-col h-full",children:[v.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[v.jsx(Dh,{size:14}),"RF Propagation"]}),v.jsxs("div",{className:"text-center mb-4",children:[v.jsx("span",{className:"text-lg",children:r(e.slot_label)}),v.jsx("span",{className:"text-sm text-slate-300 ml-2",children:e.slot_label})]}),v.jsxs("div",{className:"text-xs text-slate-500 mb-3 flex items-center gap-1",children:[v.jsx("span",{children:"\\ud83d\\udce1"})," Band Conditions:"]}),v.jsx("div",{className:"space-y-2",children:n.map(i=>{var o;const a=(o=e.ratings)==null?void 0:o[i];return v.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 rounded bg-bg-hover",children:[v.jsx("span",{className:"text-sm font-mono text-slate-300",children:i}),v.jsxs("span",{className:"text-sm",children:[t(a)," ",v.jsx("span",{className:"text-slate-300 ml-1",children:a||"โ€”"})]})]},i)})}),v.jsxs("div",{className:"mt-auto pt-3 border-t border-border text-xs text-slate-500",children:[e.source&&v.jsx("span",{children:e.source==="swpc_local"?"SWPC":"HamQSL"}),e.sent_at&&v.jsx("span",{className:"ml-2",children:new Date(e.sent_at*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}const FP=[{code:"wam",label:"Western North America"},{code:"eam",label:"Eastern North America"},{code:"enp",label:"Eastern North Pacific"},{code:"esp",label:"Eastern South Pacific"},{code:"gca",label:"Gulf-Caribbean"},{code:"nsa",label:"Northern South America"},{code:"csa",label:"Central South America"},{code:"sat",label:"South Atlantic"},{code:"nat",label:"North Atlantic"},{code:"ena",label:"Eastern North Atlantic"},{code:"nwe",label:"Northwestern Europe"},{code:"eur",label:"Europe"},{code:"eeu",label:"Eastern Europe"},{code:"saf",label:"South Africa"},{code:"mde",label:"Middle East"},{code:"nca",label:"North Central Asia"},{code:"ind",label:"Indian Ocean"},{code:"sea",label:"Southeast Asia"},{code:"fea",label:"Far East"},{code:"esi",label:"Eastern Siberia"},{code:"anz",label:"Australia & New Zealand"},{code:"oce",label:"Oceania"},{code:"wnp",label:"Western North Pacific"}];function xY(){var c;const[e,t]=G.useState("wam"),[r,n]=G.useState(!1),[i,a]=G.useState(!1);G.useEffect(()=>{fetch("/api/adapter-config/dashboard/tropo_region").then(h=>h.ok?h.json():null).then(h=>{h!=null&&h.value&&typeof h.value=="string"&&t(h.value)}).catch(()=>{})},[]);const o=h=>{t(h),n(!1),a(!0),fetch("/api/adapter-config/dashboard/tropo_region",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:h})}).catch(()=>{}).finally(()=>a(!1))},s=new Date().toISOString().slice(0,10).replace(/-/g,""),l=`https://www.dxinfocentre.com/tr_map/fcst/${e}006.png?v${s}`,u=((c=FP.find(h=>h.code===e))==null?void 0:c.label)||e;return v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4 flex flex-col",children:[v.jsxs("div",{className:"flex items-center justify-between mb-3",children:[v.jsxs("h2",{className:"text-sm font-medium text-slate-400 flex items-center gap-2",children:[v.jsx(Di,{size:14}),"Tropo Forecast (Hepburn)"]}),v.jsxs("div",{className:"flex items-center gap-2",children:[i&&v.jsx("span",{className:"text-xs text-slate-500",children:"saving..."}),v.jsx("select",{value:e,onChange:h=>o(h.target.value),className:"text-xs bg-bg-hover border border-border rounded px-2 py-1 text-slate-300 focus:outline-none focus:border-slate-500",children:FP.map(h=>v.jsx("option",{value:h.code,children:h.label},h.code))})]})]}),v.jsxs("div",{className:"text-xs text-slate-500 mb-2",children:[u," โ€” 6-day forecast"]}),r?v.jsx("div",{className:"flex items-center justify-center h-48 text-slate-500 text-sm",children:"Failed to load forecast image"}):v.jsx("img",{src:l,alt:`Hepburn tropo forecast โ€” ${u}`,className:"w-full rounded border border-border",onError:()=>n(!0)}),v.jsxs("div",{className:"text-xs text-slate-600 mt-2",children:["Source: ",v.jsx("a",{href:"https://www.dxinfocentre.com/tropo.html",target:"_blank",rel:"noopener noreferrer",className:"text-slate-500 hover:text-slate-300",children:"dxinfocentre.com"})]})]})}const bY={nws:{icon:Du,color:"text-blue-400",label:"NWS"},swpc:{icon:pB,color:"text-yellow-400",label:"SWPC"},ducting:{icon:Di,color:"text-cyan-400",label:"Tropo"},nifc:{icon:Y_,color:"text-orange-400",label:"NIFC"},firms:{icon:J_,color:"text-red-400",label:"FIRMS"},avalanche:{icon:q_,color:"text-slate-300",label:"Avy"},usgs:{icon:$_,color:"text-blue-300",label:"USGS"},traffic:{icon:Z_,color:"text-purple-400",label:"Traffic"},roads:{icon:sB,color:"text-amber-400",label:"511"}},VP={routine:"bg-blue-500/20 text-blue-400 border-blue-500/30",priority:"bg-amber-500/20 text-amber-400 border-amber-500/30",immediate:"bg-red-600/20 text-red-300 border-red-600/30",info:"bg-blue-500/20 text-blue-400 border-blue-500/30",advisory:"bg-blue-500/20 text-blue-400 border-blue-500/30",moderate:"bg-amber-500/20 text-amber-400 border-amber-500/30",watch:"bg-amber-500/20 text-amber-400 border-amber-500/30",warning:"bg-amber-500/20 text-amber-400 border-amber-500/30",severe:"bg-red-500/20 text-red-400 border-red-500/30",extreme:"bg-red-600/20 text-red-300 border-red-600/30",critical:"bg-red-600/20 text-red-300 border-red-600/30",emergency:"bg-red-700/20 text-red-200 border-red-700/30"};function wY({event:e,isLocal:t}){var h;const r=bY[e.source]||{icon:X_,color:"text-slate-400",label:e.source},n=r.icon,i=VP[(h=e.severity)==null?void 0:h.toLowerCase()]||VP.info,a=f=>{const d=new Date(f*1e3),m=new Date().getTime()-d.getTime(),y=Math.floor(m/6e4);return y<1?"just now":y<60?`${y}m ago`:y<1440?`${Math.floor(y/60)}h ago`:d.toLocaleDateString(void 0,{month:"short",day:"numeric"})},o=e.event_type,s=e.area_desc,l=e.description;let u=e.headline;if(o&&s){const f=s.replace(/ County/g,"").split(";")[0];u=`${o} โ€” ${f}`}else o&&(u=o);const c=l?l.split(". ")[0]:null;return v.jsxs("div",{className:`flex items-start gap-2 py-2 border-b border-border/50 last:border-0 ${t?"border-l-2 border-l-blue-500 pl-2 -ml-2":""}`,children:[v.jsx(n,{size:14,className:`mt-0.5 flex-shrink-0 ${r.color}`}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[v.jsx("span",{className:`px-1.5 py-0.5 rounded text-xs border ${i}`,children:e.severity||"info"}),t&&v.jsx("span",{className:"px-1.5 py-0.5 rounded text-xs bg-blue-500/20 text-blue-400 border border-blue-500/30",title:"LOCAL: event coordinates fall inside the mesh's monitoring area (per the adapter's bbox config on Environment) โ€” operators in this region are directly affected.",children:"LOCAL"}),v.jsx("span",{className:"text-xs text-slate-500",children:r.label}),v.jsx("span",{className:"text-xs text-slate-600 ml-auto",children:a(e.fetched_at)})]}),v.jsx("div",{className:`text-sm truncate ${t?"text-slate-100":"text-slate-300"}`,children:u}),c&&v.jsx("div",{className:"text-xs text-slate-500 truncate mt-0.5",children:c})]})]})}function SY({events:e,envStatus:t}){const r={immediate:0,priority:1,routine:2},n=G.useMemo(()=>{const a=new Set;return e.filter(s=>s.event_id?a.has(s.event_id)?!1:(a.add(s.event_id),!0):!0).sort((s,l)=>{var d,g;const u=s.is_local?1:0,c=l.is_local?1:0;if(u!==c)return c-u;const h=r[((d=s.severity)==null?void 0:d.toLowerCase())||"routine"]??2,f=r[((g=l.severity)==null?void 0:g.toLowerCase())||"routine"]??2;return h!==f?h-f:(l.fetched_at||0)-(s.fetched_at||0)})},[e]),i=G.useMemo(()=>{if(!(t!=null&&t.feeds))return null;const a=t.feeds.length,o=t.feeds.filter(c=>c.is_loaded&&!c.last_error).length,s=t.feeds.filter(c=>c.last_error).map(c=>c.source),l=Math.max(...t.feeds.map(c=>c.last_fetch||0)),u=l?Math.floor(Date.now()/1e3-l):null;return{total:a,active:o,errors:s,secAgo:u}},[t]);return v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4 flex flex-col h-full",children:[v.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-3 flex items-center gap-2",children:[v.jsx(rf,{size:14}),"Live Event Feed"]}),n.length>0?v.jsx("div",{className:"flex-1 overflow-y-auto max-h-80 pr-1 -mr-1",children:n.map((a,o)=>v.jsx(wY,{event:a,isLocal:a.is_local},a.event_id||o))}):v.jsx("div",{className:"flex-1 flex items-center justify-center",children:v.jsxs("div",{className:"text-center py-8",children:[v.jsx(EM,{size:24,className:"text-green-500 mx-auto mb-2"}),v.jsx("div",{className:"text-slate-400",children:"No active events"}),v.jsx("div",{className:"text-xs text-slate-500",children:"All clear"})]})}),i&&v.jsxs("div",{className:`text-xs mt-3 pt-3 border-t border-border ${i.errors.length>0?"text-amber-400":"text-slate-500"}`,children:[i.active," of ",i.total," feeds active",i.secAgo!==null&&` ยท Last update ${i.secAgo}s ago`,i.errors.length>0&&v.jsxs("span",{className:"text-amber-400",children:[" ยท ",i.errors.join(", "),": error"]})]})]})}function CY(){var x,w,S,T,M,A;const[e,t]=G.useState(null),[r,n]=G.useState([]),[i,a]=G.useState([]),[o,s]=G.useState(null),[l,u]=G.useState([]),[c,h]=G.useState(null),[f,d]=G.useState(!0),[g,m]=G.useState(null),{lastHealth:y,lastMessage:_}=FM();return G.useEffect(()=>{Promise.all([eY(),nY(),yB(),_B(),xB().catch(()=>[]),aY().catch(()=>null)]).then(([P,I,N,D,O,R])=>{t(P),n(I),a(N),s(D),u(O),h(R),d(!1),document.title="Dashboard โ€” MeshAI"}).catch(P=>{m(P.message),d(!1),document.title="Dashboard โ€” MeshAI"})},[]),G.useEffect(()=>{y&&t(y)},[y]),G.useEffect(()=>{(_==null?void 0:_.type)==="env_update"&&_.event&&u(P=>{const I=_.event,N=P.filter(D=>D.event_id!==I.event_id);return[I,...N].slice(0,100)})},[_]),f?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-slate-400",children:"Loading..."})}):g?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsxs("div",{className:"text-red-400",children:["Error: ",g]})}):v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[v.jsx("h2",{className:"text-sm font-medium text-slate-400 mb-4",children:"Mesh Health"}),e&&v.jsxs(v.Fragment,{children:[v.jsx(gY,{health:e}),v.jsxs("div",{className:"mt-6 space-y-3",children:[v.jsx(id,{label:"Infrastructure",value:((x=e.pillars)==null?void 0:x.infrastructure)??0}),v.jsx(id,{label:"Utilization",value:((w=e.pillars)==null?void 0:w.utilization)??0}),v.jsx(id,{label:"Coverage",value:((S=e.pillars)==null?void 0:S.coverage)??0}),v.jsx(id,{label:"Behavior",value:((T=e.pillars)==null?void 0:T.behavior)??0}),v.jsx(id,{label:"Power",value:((M=e.pillars)==null?void 0:M.power)??0})]})]})]}),v.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[v.jsx("h2",{className:"text-sm font-medium text-slate-400 mb-4",children:"Active Alerts"}),i.length>0?v.jsx("div",{className:"space-y-3 max-h-48 overflow-y-auto",children:i.map((P,I)=>v.jsx(mY,{alert:P},I))}):(()=>{const P=l.filter(I=>I.severity==="immediate"||I.severity==="priority").sort((I,N)=>{const D={immediate:0,priority:1},O=(D[I.severity]??2)-(D[N.severity]??2);return O!==0?O:(N.fetched_at||0)-(I.fetched_at||0)}).slice(0,5);return P.length>0?v.jsx("div",{className:"space-y-3 max-h-48 overflow-y-auto",children:P.map((I,N)=>{const D=I.severity==="immediate"?{bg:"bg-red-500/10",border:"border-red-500",icon:Vo,iconColor:"text-red-500"}:{bg:"bg-amber-500/10",border:"border-amber-500",icon:$a,iconColor:"text-amber-500"},O=D.icon;return v.jsxs("div",{className:`p-3 rounded-lg ${D.bg} border-l-2 ${D.border} flex items-start gap-3`,children:[v.jsx(O,{size:16,className:D.iconColor}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"px-1.5 py-0.5 rounded text-xs bg-slate-500/20 text-slate-400 border border-slate-500/30 font-mono",children:"ENV"}),v.jsx("span",{className:"text-xs text-slate-500",children:I.severity})]}),v.jsx("div",{className:"text-sm text-slate-200 mt-1",children:I.headline}),v.jsxs("div",{className:"text-xs text-slate-500 mt-1",children:[I.source," ยท ",new Date(I.fetched_at*1e3).toLocaleTimeString()]})]})]},I.event_id||N)})}):v.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-4",children:[v.jsx(EM,{size:16,className:"text-green-500"}),v.jsx("span",{children:"No active alerts"})]})})()]}),v.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[v.jsx(Yg,{icon:Di,label:"Nodes Online",value:(e==null?void 0:e.total_nodes)||0,subvalue:`${(e==null?void 0:e.unlocated_count)||0} unlocated`}),v.jsx(Yg,{icon:lB,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"}),v.jsx(Yg,{icon:rf,label:"Utilization",value:`${((A=e==null?void 0:e.util_percent)==null?void 0:A.toFixed(1))||0}%`,subvalue:`${(e==null?void 0:e.flagged_nodes)||0} flagged`}),v.jsx(Yg,{icon:nf,label:"Regions",value:(e==null?void 0:e.total_regions)||0,subvalue:`${(e==null?void 0:e.battery_warnings)||0} battery warnings`})]})]})]}),v.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[v.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4",children:["Mesh Sources (",r.length,")"]}),r.length>0?v.jsx("div",{className:"space-y-2",children:r.map((P,I)=>v.jsx(yY,{source:P},I))}):v.jsx("div",{className:"text-slate-500 py-4",children:"No sources configured"})]}),v.jsx(_Y,{bandConditions:c}),v.jsx(SY,{events:l,envStatus:o})]}),v.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:v.jsx(xY,{})})]})}/*! ***************************************************************************** + */const Dh=Re("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 zi(e){const t=await fetch(e);if(!t.ok)throw new Error(`API error: ${t.status} ${t.statusText}`);return t.json()}async function RP(){return zi("/api/status")}async function eY(){return zi("/api/health")}async function tY(){return zi("/api/nodes")}async function rY(){return zi("/api/edges")}async function nY(){return zi("/api/sources")}async function yB(){return zi("/api/alerts/active")}async function OP(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),zi(`/api/alerts/history?${i.toString()}`)}async function iY(){return zi("/api/subscriptions")}async function xB(){return zi("/api/env/status")}async function _B(){return zi("/api/env/active")}async function aY(){return zi("/api/env/swpc")}async function oY(){return zi("/api/regions")}function FM(){const[e,t]=G.useState(!1),[r,n]=G.useState(null),[i,a]=G.useState(null),[o,s]=G.useState(null),l=G.useRef(null),u=G.useRef(null),c=G.useRef(1e3),h=G.useCallback(()=>{var g;if(((g=l.current)==null?void 0:g.readyState)===WebSocket.OPEN)return;const d=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/live`;try{const m=new WebSocket(d);l.current=m,m.onopen=()=>{t(!0),c.current=1e3},m.onmessage=x=>{try{const _=JSON.parse(x.data);switch(s(_),_.type){case"health_update":n(_.data);break;case"alert_fired":a(_.data);break}}catch(_){console.error("Failed to parse WebSocket message:",_)}},m.onclose=()=>{t(!1),l.current=null;const x=Math.min(c.current,3e4);u.current=window.setTimeout(()=>{c.current=Math.min(x*2,3e4),h()},x)},m.onerror=()=>{m.close()};const y=setInterval(()=>{m.readyState===WebSocket.OPEN&&m.send("ping")},3e4);m.addEventListener("close",()=>{clearInterval(y)})}catch(m){console.error("Failed to create WebSocket:",m)}},[]);return G.useEffect(()=>(h(),()=>{u.current&&clearTimeout(u.current),l.current&&l.current.close()}),[h]),{connected:e,lastHealth:r,lastAlert:i,lastMessage:o}}const bB=G.createContext(null);function sY(){const e=G.useContext(bB);if(!e)throw new Error("useToast must be used within a ToastProvider");return e}function lY(e){switch(e==null?void 0:e.toLowerCase()){case"critical":case"emergency":return{bg:"bg-red-500/10",border:"border-red-500",icon:Vo,iconColor:"text-red-500"};case"warning":return{bg:"bg-amber-500/10",border:"border-amber-500",icon:$a,iconColor:"text-amber-500"};default:return{bg:"bg-blue-500/10",border:"border-blue-500",icon:qx,iconColor:"text-blue-500"}}}function uY({toast:e,onDismiss:t,onNavigate:r}){const n=lY(e.alert.severity),i=n.icon;return G.useEffect(()=>{const a=setTimeout(t,8e3);return()=>clearTimeout(a)},[t]),v.jsx("div",{className:`${n.bg} border ${n.border} rounded-lg shadow-lg overflow-hidden animate-slide-in cursor-pointer`,onClick:r,role:"alert",children:v.jsxs("div",{className:"flex items-start gap-3 p-4",children:[v.jsx("div",{className:`w-1 self-stretch -ml-4 -my-4 ${n.border.replace("border","bg")}`}),v.jsx(i,{size:18,className:n.iconColor}),v.jsxs("div",{className:"flex-1 min-w-0 pr-2",children:[v.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())}),v.jsx("div",{className:"text-sm text-slate-300 line-clamp-2",children:e.alert.message})]}),v.jsx("button",{onClick:a=>{a.stopPropagation(),t()},className:"text-slate-400 hover:text-slate-200 transition-colors",children:v.jsx(ca,{size:16})})]})})}function cY({children:e}){const[t,r]=G.useState([]),n=eB(),i=G.useCallback(s=>{const l=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(u=>[...u,{id:l,alert:s}])},[]),a=G.useCallback(s=>{r(l=>l.filter(u=>u.id!==s))},[]),o=G.useCallback(()=>{n("/alerts")},[n]);return v.jsxs(bB.Provider,{value:{addToast:i},children:[e,v.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=>v.jsx("div",{className:"pointer-events-auto",children:v.jsx(uY,{toast:s,onDismiss:()=>a(s.id),onNavigate:o})},s.id))})]})}const r_="meshai.restartRequired.v1";function zP(){try{const e=localStorage.getItem(r_);if(!e)return{required:!1,changedKeys:[],ts:0};const t=JSON.parse(e);return{required:!!t.required,changedKeys:Array.isArray(t.changedKeys)?t.changedKeys:[],ts:Number(t.ts)||0}}catch{return{required:!1,changedKeys:[],ts:0}}}function hY(e){const t={required:!0,changedKeys:[...new Set(e)],ts:Date.now()};localStorage.setItem(r_,JSON.stringify(t)),window.dispatchEvent(new CustomEvent("meshai:restart-required",{detail:t}))}function BP(){localStorage.removeItem(r_),window.dispatchEvent(new CustomEvent("meshai:restart-required",{detail:{required:!1,changedKeys:[],ts:0}}))}function fY(){const[e,t]=G.useState(()=>zP()),[r,n]=G.useState(!1),[i,a]=G.useState(null);G.useEffect(()=>{const l=c=>{const h=c.detail;t(h)},u=c=>{c.key===r_&&t(zP())};return window.addEventListener("meshai:restart-required",l),window.addEventListener("storage",u),()=>{window.removeEventListener("meshai:restart-required",l),window.removeEventListener("storage",u)}},[]);const o=G.useCallback(async()=>{n(!0),a(null);try{const l=await fetch("/api/system/restart",{method:"POST"});if(!l.ok&&l.status!==202){const u=await l.json().catch(()=>({}));throw new Error(u.detail||`HTTP ${l.status}`)}BP()}catch(l){a(String(l)),n(!1)}},[]),s=G.useCallback(()=>{BP()},[]);return e.required?v.jsxs("div",{className:"bg-yellow-900/40 border-b border-yellow-700 text-yellow-100 px-4 py-2 text-sm flex items-center gap-3",children:[v.jsx($a,{className:"w-4 h-4 flex-shrink-0 text-yellow-300"}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("strong",{children:"Container restart required"}),e.changedKeys.length>0&&v.jsxs("span",{className:"text-yellow-300 ml-2",children:["(",e.changedKeys.length," key",e.changedKeys.length===1?"":"s",":"," ",v.jsxs("span",{className:"font-mono text-xs",children:[e.changedKeys.slice(0,3).join(", "),e.changedKeys.length>3?", โ€ฆ":""]}),")"]}),v.jsx("span",{className:"ml-2 text-yellow-300/80",children:"for these changes to take effect. Until then the runtime keeps its boot-time configuration. Restart-required keys include anything under Config โ†’ environmental (feed_source, central URL), the LLM backend swap, and the dispatcher cold-start grace window. Other keys take effect on the next handler call."}),i&&v.jsx("div",{className:"text-red-400 text-xs mt-1",children:i})]}),v.jsxs("button",{onClick:o,disabled:r,className:"flex items-center gap-1 px-3 py-1 bg-yellow-700 hover:bg-yellow-600 disabled:opacity-50 rounded text-white text-xs",children:[v.jsx(q$,{className:`w-3 h-3 ${r?"animate-spin":""}`}),r?"Restartingโ€ฆ":"Restart now"]}),v.jsx("button",{onClick:s,className:"text-yellow-300 hover:text-white px-1",title:"Dismiss (you can still restart later)",children:v.jsx(ca,{className:"w-4 h-4"})})]}):null}const wB=[{path:"/",label:"Dashboard",icon:fB},{path:"/mesh",label:"Mesh",icon:Di},{path:"/environment",label:"Environment",icon:Du},{path:"/config",label:"Config",icon:vB},{path:"/alerts",label:"Alerts",icon:Zv},{path:"/notifications",label:"Notifications",icon:R$},{path:"/reference",label:"Reference",icon:oB},{path:"/adapter-config",label:"Adapter Config",icon:BM},{path:"/gauge-sites",label:"Gauge Sites",icon:Yx},{path:"/town-anchors",label:"Town Anchors",icon:nf}];function dY(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 vY(e){const t=wB.find(r=>r.path===e);return(t==null?void 0:t.label)||"Dashboard"}function pY({children:e}){var f;const t=tf(),{connected:r,lastAlert:n}=FM(),{addToast:i}=sY(),[a,o]=G.useState(null),[s,l]=G.useState(null);G.useEffect(()=>{if(n){const d=`${n.type}-${n.message}-${n.timestamp}`;d!==s&&(l(d),i(n))}},[n,s,i]);const[u,c]=G.useState(new Date);G.useEffect(()=>{RP().then(o).catch(console.error);const d=setInterval(()=>{RP().then(o).catch(console.error)},3e4);return()=>clearInterval(d)},[]),G.useEffect(()=>{const d=setInterval(()=>c(new Date),1e3);return()=>clearInterval(d)},[]);const h=u.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});return v.jsxs("div",{className:"flex h-screen overflow-hidden bg-bg text-slate-200",children:[v.jsxs("aside",{className:"w-[220px] flex-shrink-0 bg-bg-card border-r border-border flex flex-col overflow-y-auto",children:[v.jsx("div",{className:"p-5 border-b border-border",children:v.jsxs("div",{className:"flex items-center gap-3",children:[v.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"}),v.jsxs("div",{children:[v.jsx("div",{className:"font-semibold text-lg",children:"MeshAI"}),v.jsxs("div",{className:"text-xs text-slate-500 font-mono",children:["v",(a==null?void 0:a.version)||"..."]})]})]})}),v.jsx("nav",{className:"flex-1 py-4",children:wB.map(d=>{const g=t.pathname===d.path,m=d.icon;return v.jsxs(P$,{to:d.path,className:`flex items-center gap-3 px-5 py-3 text-sm transition-colors relative ${g?"text-blue-400 bg-blue-500/10":"text-slate-400 hover:text-slate-200 hover:bg-bg-hover"}`,children:[g&&v.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-blue-500"}),v.jsx(m,{size:18}),d.label]},d.path)})}),v.jsxs("div",{className:"p-5 border-t border-border",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${a!=null&&a.connected?"bg-green-500":"bg-red-500"}`}),v.jsx("span",{className:"text-xs text-slate-400",children:a!=null&&a.connected?"Connected":"Disconnected"})]}),v.jsxs("div",{className:"text-xs text-slate-500 font-mono truncate",children:[(f=a==null?void 0:a.connection_type)==null?void 0:f.toUpperCase(),": ",a==null?void 0:a.connection_target]}),v.jsxs("div",{className:"text-xs text-slate-500 mt-1",children:["Uptime: ",a?dY(a.uptime_seconds):"..."]})]})]}),v.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[v.jsxs("header",{className:"h-14 flex-shrink-0 border-b border-border bg-bg-card flex items-center justify-between px-6",children:[v.jsx("h1",{className:"text-lg font-semibold",children:vY(t.pathname)}),v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${r?"bg-green-500 animate-pulse-slow":"bg-slate-500"}`}),v.jsx("span",{className:"text-xs text-slate-400",children:r?"Live":"Offline"})]}),v.jsxs("div",{className:"text-sm font-mono text-slate-400",children:[h," MT"]})]})]}),v.jsxs("main",{className:"flex-1 overflow-y-auto p-6",children:[v.jsx(fY,{}),e]})]})]})}function gY({health:e}){const t=e.score,r=e.tier,i=(s=>s>=80?"#22c55e":s>=60?"#f59e0b":"#ef4444")(t),a=2*Math.PI*45,o=t/100*a;return v.jsx("div",{className:"flex flex-col items-center",children:v.jsxs("svg",{width:"140",height:"140",viewBox:"0 0 100 100",children:[v.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:"#1e2a3a",strokeWidth:"8"}),v.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"}),v.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)}),v.jsx("text",{x:"50",y:"62",textAnchor:"middle",className:"fill-slate-400 text-xs",style:{fontSize:"10px"},children:r})]})})}function id({label:e,value:t}){const r=n=>n>=80?"bg-green-500":n>=60?"bg-amber-500":"bg-red-500";return v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:"w-24 text-xs text-slate-400 truncate",children:e}),v.jsx("div",{className:"flex-1 h-2 bg-border rounded-full overflow-hidden",children:v.jsx("div",{className:`h-full ${r(t)} transition-all duration-300`,style:{width:`${t}%`}})}),v.jsx("div",{className:"w-12 text-right text-xs font-mono text-slate-300",children:t.toFixed(1)})]})}function mY({alert:e}){const r=(i=>{switch(i.toLowerCase()){case"critical":case"emergency":case"immediate":return{bg:"bg-red-500/10",border:"border-red-500",icon:Vo,iconColor:"text-red-500"};case"warning":case"priority":return{bg:"bg-amber-500/10",border:"border-amber-500",icon:$a,iconColor:"text-amber-500"};case"routine":default:return{bg:"bg-blue-500/10",border:"border-blue-500",icon:qx,iconColor:"text-blue-500"}}})(e.severity),n=r.icon;return v.jsxs("div",{className:`p-3 rounded-lg ${r.bg} border-l-2 ${r.border} flex items-start gap-3`,children:[v.jsx(n,{size:16,className:r.iconColor}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("div",{className:"text-sm text-slate-200",children:e.message}),v.jsx("div",{className:"text-xs text-slate-500 mt-1",children:e.timestamp||"Just now"})]})]})}function yY({source:e}){const t=()=>e.is_loaded?e.last_error?"bg-amber-500":"bg-green-500":"bg-red-500";return v.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-bg-hover",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${t()}`}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("div",{className:"text-sm text-slate-200 truncate",children:e.name}),v.jsxs("div",{className:"text-xs text-slate-500",children:[e.node_count," nodes ยท ",e.type]})]})]})}function Yg({icon:e,label:t,value:r,subvalue:n}){return v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4",children:[v.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[v.jsx(e,{size:14}),v.jsx("span",{className:"text-xs",children:t})]}),v.jsx("div",{className:"font-mono text-xl text-slate-100",children:r}),n&&v.jsx("div",{className:"text-xs text-slate-500 mt-1",children:n})]})}function xY({bandConditions:e}){const t=i=>{switch(i){case"Good":return"๐ŸŸข";case"Fair":return"๐ŸŸก";case"Poor":return"๐Ÿ”ด";default:return"โ€”"}},r=i=>i?i.includes("Night")?"๐ŸŒ™":"โ˜€๏ธ":"";if(!(e!=null&&e.enabled)||!(e!=null&&e.ratings))return v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4 flex flex-col h-full",children:[v.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[v.jsx(Dh,{size:14}),"RF Propagation"]}),v.jsx("div",{className:"flex-1 flex items-center justify-center",children:v.jsx("div",{className:"text-center py-8",children:v.jsx("div",{className:"text-slate-400",children:"No band conditions data"})})})]});const n=["80-40m","30-20m","17-15m","12-10m"];return v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4 flex flex-col h-full",children:[v.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[v.jsx(Dh,{size:14}),"RF Propagation"]}),v.jsxs("div",{className:"text-center mb-4",children:[v.jsx("span",{className:"text-lg",children:r(e.slot_label)}),v.jsx("span",{className:"text-sm text-slate-300 ml-2",children:e.slot_label})]}),v.jsx("div",{className:"text-xs text-slate-500 mb-3 flex items-center gap-1",children:"๐Ÿ“ก Band Conditions:"}),v.jsx("div",{className:"space-y-2",children:n.map(i=>{var o;const a=(o=e.ratings)==null?void 0:o[i];return v.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 rounded bg-bg-hover",children:[v.jsx("span",{className:"text-sm font-mono text-slate-300",children:i}),v.jsxs("span",{className:"text-sm",children:[t(a)," ",v.jsx("span",{className:"text-slate-300 ml-1",children:a||"โ€”"})]})]},i)})}),v.jsxs("div",{className:"mt-auto pt-3 border-t border-border text-xs text-slate-500",children:[e.source&&v.jsx("span",{children:e.source==="swpc_local"?"SWPC":"HamQSL"}),e.sent_at&&v.jsx("span",{className:"ml-2",children:new Date(e.sent_at*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}const FP=[{code:"wam",label:"Western North America"},{code:"eam",label:"Eastern North America"},{code:"enp",label:"Eastern North Pacific"},{code:"esp",label:"Eastern South Pacific"},{code:"gca",label:"Gulf-Caribbean"},{code:"nsa",label:"Northern South America"},{code:"csa",label:"Central South America"},{code:"sat",label:"South Atlantic"},{code:"nat",label:"North Atlantic"},{code:"ena",label:"Eastern North Atlantic"},{code:"nwe",label:"Northwestern Europe"},{code:"eur",label:"Europe"},{code:"eeu",label:"Eastern Europe"},{code:"saf",label:"South Africa"},{code:"mde",label:"Middle East"},{code:"nca",label:"North Central Asia"},{code:"ind",label:"Indian Ocean"},{code:"sea",label:"Southeast Asia"},{code:"fea",label:"Far East"},{code:"esi",label:"Eastern Siberia"},{code:"anz",label:"Australia & New Zealand"},{code:"oce",label:"Oceania"},{code:"wnp",label:"Western North Pacific"}];function _Y(){var c;const[e,t]=G.useState("wam"),[r,n]=G.useState(!1),[i,a]=G.useState(!1);G.useEffect(()=>{fetch("/api/adapter-config/dashboard/tropo_region").then(h=>h.ok?h.json():null).then(h=>{h!=null&&h.value&&typeof h.value=="string"&&t(h.value)}).catch(()=>{})},[]);const o=h=>{t(h),n(!1),a(!0),fetch("/api/adapter-config/dashboard/tropo_region",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:h})}).catch(()=>{}).finally(()=>a(!1))},s=new Date().toISOString().slice(0,10).replace(/-/g,""),l=`https://www.dxinfocentre.com/tr_map/fcst/${e}006.png?v${s}`,u=((c=FP.find(h=>h.code===e))==null?void 0:c.label)||e;return v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4 flex flex-col",children:[v.jsxs("div",{className:"flex items-center justify-between mb-3",children:[v.jsxs("h2",{className:"text-sm font-medium text-slate-400 flex items-center gap-2",children:[v.jsx(Di,{size:14}),"Tropo Forecast (Hepburn)"]}),v.jsxs("div",{className:"flex items-center gap-2",children:[i&&v.jsx("span",{className:"text-xs text-slate-500",children:"saving..."}),v.jsx("select",{value:e,onChange:h=>o(h.target.value),className:"text-xs bg-bg-hover border border-border rounded px-2 py-1 text-slate-300 focus:outline-none focus:border-slate-500",children:FP.map(h=>v.jsx("option",{value:h.code,children:h.label},h.code))})]})]}),v.jsxs("div",{className:"text-xs text-slate-500 mb-2",children:[u," โ€” 6-day forecast"]}),r?v.jsx("div",{className:"flex items-center justify-center h-48 text-slate-500 text-sm",children:"Failed to load forecast image"}):v.jsx("img",{src:l,alt:`Hepburn tropo forecast โ€” ${u}`,className:"w-full rounded border border-border",onError:()=>n(!0)}),v.jsxs("div",{className:"text-xs text-slate-600 mt-2",children:["Source: ",v.jsx("a",{href:"https://www.dxinfocentre.com/tropo.html",target:"_blank",rel:"noopener noreferrer",className:"text-slate-500 hover:text-slate-300",children:"dxinfocentre.com"})]})]})}const bY={nws:{icon:Du,color:"text-blue-400",label:"NWS"},swpc:{icon:pB,color:"text-yellow-400",label:"SWPC"},ducting:{icon:Di,color:"text-cyan-400",label:"Tropo"},nifc:{icon:Xx,color:"text-orange-400",label:"NIFC"},firms:{icon:Qx,color:"text-red-400",label:"FIRMS"},avalanche:{icon:Kx,color:"text-slate-300",label:"Avy"},usgs:{icon:Yx,color:"text-blue-300",label:"USGS"},traffic:{icon:$x,color:"text-purple-400",label:"Traffic"},roads:{icon:sB,color:"text-amber-400",label:"511"}},VP={routine:"bg-blue-500/20 text-blue-400 border-blue-500/30",priority:"bg-amber-500/20 text-amber-400 border-amber-500/30",immediate:"bg-red-600/20 text-red-300 border-red-600/30",info:"bg-blue-500/20 text-blue-400 border-blue-500/30",advisory:"bg-blue-500/20 text-blue-400 border-blue-500/30",moderate:"bg-amber-500/20 text-amber-400 border-amber-500/30",watch:"bg-amber-500/20 text-amber-400 border-amber-500/30",warning:"bg-amber-500/20 text-amber-400 border-amber-500/30",severe:"bg-red-500/20 text-red-400 border-red-500/30",extreme:"bg-red-600/20 text-red-300 border-red-600/30",critical:"bg-red-600/20 text-red-300 border-red-600/30",emergency:"bg-red-700/20 text-red-200 border-red-700/30"};function wY({event:e,isLocal:t}){var h;const r=bY[e.source]||{icon:qx,color:"text-slate-400",label:e.source},n=r.icon,i=VP[(h=e.severity)==null?void 0:h.toLowerCase()]||VP.info,a=f=>{const d=new Date(f*1e3),m=new Date().getTime()-d.getTime(),y=Math.floor(m/6e4);return y<1?"just now":y<60?`${y}m ago`:y<1440?`${Math.floor(y/60)}h ago`:d.toLocaleDateString(void 0,{month:"short",day:"numeric"})},o=e.event_type,s=e.area_desc,l=e.description;let u=e.headline;if(o&&s){const f=s.replace(/ County/g,"").split(";")[0];u=`${o} โ€” ${f}`}else o&&(u=o);const c=l?l.split(". ")[0]:null;return v.jsxs("div",{className:`flex items-start gap-2 py-2 border-b border-border/50 last:border-0 ${t?"border-l-2 border-l-blue-500 pl-2 -ml-2":""}`,children:[v.jsx(n,{size:14,className:`mt-0.5 flex-shrink-0 ${r.color}`}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[v.jsx("span",{className:`px-1.5 py-0.5 rounded text-xs border ${i}`,children:e.severity||"info"}),t&&v.jsx("span",{className:"px-1.5 py-0.5 rounded text-xs bg-blue-500/20 text-blue-400 border border-blue-500/30",title:"LOCAL: event coordinates fall inside the mesh's monitoring area (per the adapter's bbox config on Environment) โ€” operators in this region are directly affected.",children:"LOCAL"}),v.jsx("span",{className:"text-xs text-slate-500",children:r.label}),v.jsx("span",{className:"text-xs text-slate-600 ml-auto",children:a(e.fetched_at)})]}),v.jsx("div",{className:`text-sm truncate ${t?"text-slate-100":"text-slate-300"}`,children:u}),c&&v.jsx("div",{className:"text-xs text-slate-500 truncate mt-0.5",children:c})]})]})}function SY({events:e,envStatus:t,embedded:r}){const n={immediate:0,priority:1,routine:2},i=G.useMemo(()=>{const s=new Set;return e.filter(u=>u.event_id?s.has(u.event_id)?!1:(s.add(u.event_id),!0):!0).sort((u,c)=>{var m,y;const h=u.is_local?1:0,f=c.is_local?1:0;if(h!==f)return f-h;const d=n[((m=u.severity)==null?void 0:m.toLowerCase())||"routine"]??2,g=n[((y=c.severity)==null?void 0:y.toLowerCase())||"routine"]??2;return d!==g?d-g:(c.fetched_at||0)-(u.fetched_at||0)})},[e]),a=G.useMemo(()=>{if(!(t!=null&&t.feeds))return null;const s=t.feeds.length,l=t.feeds.filter(f=>f.is_loaded&&!f.last_error).length,u=t.feeds.filter(f=>f.last_error).map(f=>f.source),c=Math.max(...t.feeds.map(f=>f.last_fetch||0)),h=c?Math.floor(Date.now()/1e3-c):null;return{total:s,active:l,errors:u,secAgo:h}},[t]),o=v.jsxs(v.Fragment,{children:[i.length>0?v.jsx("div",{className:"flex-1 overflow-y-auto max-h-80 pr-1 -mr-1",children:i.map((s,l)=>v.jsx(wY,{event:s,isLocal:s.is_local},s.event_id||l))}):v.jsx("div",{className:"flex-1 flex items-center justify-center",children:v.jsxs("div",{className:"text-center py-8",children:[v.jsx(EM,{size:24,className:"text-green-500 mx-auto mb-2"}),v.jsx("div",{className:"text-slate-400",children:"No active events"}),v.jsx("div",{className:"text-xs text-slate-500",children:"All clear"})]})}),a&&v.jsxs("div",{className:`text-xs mt-3 pt-3 border-t border-border ${a.errors.length>0?"text-amber-400":"text-slate-500"}`,children:[a.active," of ",a.total," feeds active",a.secAgo!==null&&` ยท Last update ${a.secAgo}s ago`,a.errors.length>0&&v.jsxs("span",{className:"text-amber-400",children:[" ยท ",a.errors.join(", "),": error"]})]})]});return r?v.jsx("div",{className:"flex flex-col h-full",children:o}):v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4 flex flex-col h-full",children:[v.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-3 flex items-center gap-2",children:[v.jsx(rf,{size:14}),"Live Event Feed"]}),o]})}function CY(){var S,T,M,A,P,I;const[e,t]=G.useState(null),[r,n]=G.useState([]),[i,a]=G.useState([]),[o,s]=G.useState(null),[l,u]=G.useState([]),[c,h]=G.useState(null),[f,d]=G.useState("alerts"),[g,m]=G.useState(!0),[y,x]=G.useState(null),{lastHealth:_,lastMessage:w}=FM();return G.useEffect(()=>{Promise.all([eY(),nY(),yB(),xB(),_B().catch(()=>[]),aY().catch(()=>null)]).then(([N,D,O,R,F,H])=>{t(N),n(D),a(O),s(R),u(F),h(H),m(!1),document.title="Dashboard โ€” MeshAI"}).catch(N=>{x(N.message),m(!1),document.title="Dashboard โ€” MeshAI"})},[]),G.useEffect(()=>{_&&t(_)},[_]),G.useEffect(()=>{(w==null?void 0:w.type)==="env_update"&&w.event&&u(N=>{const D=w.event,O=N.filter(R=>R.event_id!==D.event_id);return[D,...O].slice(0,100)})},[w]),g?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-slate-400",children:"Loading..."})}):y?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsxs("div",{className:"text-red-400",children:["Error: ",y]})}):v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[v.jsx("h2",{className:"text-sm font-medium text-slate-400 mb-4",children:"Mesh Health"}),e&&v.jsxs(v.Fragment,{children:[v.jsx(gY,{health:e}),v.jsxs("div",{className:"mt-6 space-y-3",children:[v.jsx(id,{label:"Infrastructure",value:((S=e.pillars)==null?void 0:S.infrastructure)??0}),v.jsx(id,{label:"Utilization",value:((T=e.pillars)==null?void 0:T.utilization)??0}),v.jsx(id,{label:"Coverage",value:((M=e.pillars)==null?void 0:M.coverage)??0}),v.jsx(id,{label:"Behavior",value:((A=e.pillars)==null?void 0:A.behavior)??0}),v.jsx(id,{label:"Power",value:((P=e.pillars)==null?void 0:P.power)??0})]})]})]}),v.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[v.jsxs("div",{className:"flex items-center gap-1 mb-4",children:[v.jsx("button",{onClick:()=>d("alerts"),className:`px-3 py-1 rounded-full text-xs font-medium transition-colors ${f==="alerts"?"bg-slate-600 text-slate-100":"text-slate-400 hover:text-slate-300 hover:bg-bg-hover"}`,children:"Active Alerts"}),v.jsx("button",{onClick:()=>d("feed"),className:`px-3 py-1 rounded-full text-xs font-medium transition-colors ${f==="feed"?"bg-slate-600 text-slate-100":"text-slate-400 hover:text-slate-300 hover:bg-bg-hover"}`,children:"Event Feed"})]}),f==="alerts"?v.jsx(v.Fragment,{children:i.length>0?v.jsx("div",{className:"space-y-3 max-h-48 overflow-y-auto",children:i.map((N,D)=>v.jsx(mY,{alert:N},D))}):(()=>{const N=l.filter(D=>D.severity==="immediate"||D.severity==="priority").sort((D,O)=>{const R={immediate:0,priority:1},F=(R[D.severity]??2)-(R[O.severity]??2);return F!==0?F:(O.fetched_at||0)-(D.fetched_at||0)}).slice(0,5);return N.length>0?v.jsx("div",{className:"space-y-3 max-h-48 overflow-y-auto",children:N.map((D,O)=>{const R=D.severity==="immediate"?{bg:"bg-red-500/10",border:"border-red-500",icon:Vo,iconColor:"text-red-500"}:{bg:"bg-amber-500/10",border:"border-amber-500",icon:$a,iconColor:"text-amber-500"},F=R.icon;return v.jsxs("div",{className:`p-3 rounded-lg ${R.bg} border-l-2 ${R.border} flex items-start gap-3`,children:[v.jsx(F,{size:16,className:R.iconColor}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"px-1.5 py-0.5 rounded text-xs bg-slate-500/20 text-slate-400 border border-slate-500/30 font-mono",children:"ENV"}),v.jsx("span",{className:"text-xs text-slate-500",children:D.severity})]}),v.jsx("div",{className:"text-sm text-slate-200 mt-1",children:D.headline}),v.jsxs("div",{className:"text-xs text-slate-500 mt-1",children:[D.source," ยท ",new Date(D.fetched_at*1e3).toLocaleTimeString()]})]})]},D.event_id||O)})}):v.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-4",children:[v.jsx(EM,{size:16,className:"text-green-500"}),v.jsx("span",{children:"No active alerts"})]})})()}):v.jsx(SY,{events:l,envStatus:o,embedded:!0})]}),v.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[v.jsx(Yg,{icon:Di,label:"Nodes Online",value:(e==null?void 0:e.total_nodes)||0,subvalue:`${(e==null?void 0:e.unlocated_count)||0} unlocated`}),v.jsx(Yg,{icon:lB,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"}),v.jsx(Yg,{icon:rf,label:"Utilization",value:`${((I=e==null?void 0:e.util_percent)==null?void 0:I.toFixed(1))||0}%`,subvalue:`${(e==null?void 0:e.flagged_nodes)||0} flagged`}),v.jsx(Yg,{icon:nf,label:"Regions",value:(e==null?void 0:e.total_regions)||0,subvalue:`${(e==null?void 0:e.battery_warnings)||0} battery warnings`})]})]})]}),v.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[v.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4",children:["Mesh Sources (",r.length,")"]}),r.length>0?v.jsx("div",{className:"space-y-2",children:r.map((N,D)=>v.jsx(yY,{source:N},D))}):v.jsx("div",{className:"text-slate-500 py-4",children:"No sources configured"})]}),v.jsx(xY,{bandConditions:c}),v.jsx(_Y,{})]})]})}/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -422,8 +422,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 bC=function(e,t){return bC=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])},bC(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");bC(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var uv=function(){return uv=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"?Je.worker=!0:!Je.hasGlobalWindow||"Deno"in window||typeof navigator<"u"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(Je.node=!0,Je.svgSupported=!0):kY(navigator.userAgent,Je);function kY(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 VM=12,SB="sans-serif",Go=VM+"px "+SB,LY=20,NY=100,PY="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function IY(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(){j(r,function(c){c.parentNode&&c.parentNode.removeChild(c)})},r}function rX(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(),h=2*u,f=c.left,d=c.top;o.push(f,d),l=l&&a&&f===a[h]&&d===a[h+1],s.push(e[u].offsetLeft,e[u].offsetTop)}return l&&i?i:(t.srcCoords=o,t[n]=r?UP(s,o):UP(o,s))}function DB(e){return e.nodeName.toUpperCase()==="CANVAS"}var nX=/([&<>"'])/g,iX={"&":"&","<":"<",">":">",'"':""","'":"'"};function hn(e){return e==null?"":(e+"").replace(nX,function(t,r){return iX[r]})}var aX=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Y1=[],oX=Je.browser.firefox&&+Je.browser.version.split(".")[0]<39;function MC(e,t,r,n){return r=r||{},n?ZP(e,t,r):oX&&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):ZP(e,t,r),r}function ZP(e,t,r){if(Je.domSupported&&e.getBoundingClientRect){var n=t.clientX,i=t.clientY;if(DB(e)){var a=e.getBoundingClientRect();r.zrX=n-a.left,r.zrY=i-a.top;return}else if(TC(Y1,e,n,i)){r.zrX=Y1[0],r.zrY=Y1[1];return}}r.zrX=r.zrY=0}function YM(e){return e||window.event}function mi(e,t,r){if(t=YM(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&&MC(e,o,t,r)}else{MC(e,t,t,r);var a=sX(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var s=t.button;return t.which==null&&s!==void 0&&aX.test(t.type)&&(t.which=s&1?1:s&2?3:s&4?2:0),t}function sX(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 AC(e,t,r,n){e.addEventListener(t,r,n)}function lX(e,t,r,n){e.removeEventListener(t,r,n)}var Wo=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function $P(e){return e.which===2||e.which===3}var uX=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=YP(n)/YP(i);!isFinite(a)&&(a=1),t.pinchScale=a;var o=cX(n);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:e[0].target,event:t}}}}};function Pr(){return[1,0,0,1,0,0]}function zp(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function Bp(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 aa(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 ha(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 Ko(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),h=Math.cos(r);return e[0]=i*h+s*c,e[1]=-i*c+s*h,e[2]=a*h+l*c,e[3]=-a*c+h*l,e[4]=h*(o-n[0])+c*(u-n[1])+n[0],e[5]=h*(u-n[1])-c*(o-n[0])+n[1],e}function sx(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 ji(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 EB(e){var t=Pr();return Bp(t,e),t}const hX=Object.freeze(Object.defineProperty({__proto__:null,clone:EB,copy:Bp,create:Pr,identity:zp,invert:ji,mul:aa,rotate:Ko,scale:sx,translate:ha},Symbol.toStringTag,{value:"Module"}));var Ne=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}(),cu=Math.min,ah=Math.max,kC=Math.abs,XP=["x","y"],fX=["width","height"],wl=new Ne,Sl=new Ne,Cl=new Ne,Tl=new Ne,Yn=jB(),Vd=Yn.minTv,LC=Yn.maxTv,dv=[0,0],Pe=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=cu(t.x,this.x),n=cu(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=ah(t.x+t.width,this.x+this.width)-r:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=ah(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=Pr();return ha(a,a,[-r.x,-r.y]),sx(a,a,[n,i]),ha(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&&Ne.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(dX,t.x,t.y,t.width,t.height)),r instanceof e||(r=e.set(vX,r.x,r.y,r.width,r.height));var s=!!n;Yn.reset(i,s);var l=Yn.touchThreshold,u=t.x+l,c=t.x+t.width-l,h=t.y+l,f=t.y+t.height-l,d=r.x+l,g=r.x+r.width-l,m=r.y+l,y=r.y+r.height-l;if(u>c||h>f||d>g||m>y)return!1;var _=!(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}wl.x=Cl.x=r.x,wl.y=Tl.y=r.y,Sl.x=Tl.x=r.x+r.width,Sl.y=Cl.y=r.y+r.height,wl.transform(n),Tl.transform(n),Sl.transform(n),Cl.transform(n),t.x=cu(wl.x,Sl.x,Cl.x,Tl.x),t.y=cu(wl.y,Sl.y,Cl.y,Tl.y);var l=ah(wl.x,Sl.x,Cl.x,Tl.x),u=ah(wl.y,Sl.y,Cl.y,Tl.y);t.width=l-t.x,t.height=u-t.y},e}(),dX=new Pe(0,0,0,0),vX=new Pe(0,0,0,0);function qP(e,t,r,n,i,a,o,s){var l=kC(t-r),u=kC(n-e),c=cu(l,u),h=XP[i],f=XP[1-i],d=fX[i];t=u||!Yn.bidirectional)&&(Vd[h]=-u,Vd[f]=0,Yn.useDir&&Yn.calcDirMTV())))}function jB(){var e=0,t=new Ne,r=new Ne,n={minTv:new Ne,maxTv:new Ne,useDir:!1,dirMinTv:new Ne,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(a,o){n.touchThreshold=0,a&&a.touchThreshold!=null&&(n.touchThreshold=ah(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;h--){var f=a[h];f!==i&&!f.ignore&&!f.ignoreCoarsePointer&&(!f.parent||!f.parent.ignoreCoarsePointer)&&(q1.copy(f.getBoundingRect()),f.transform&&q1.applyTransform(f.transform),q1.intersect(c)&&s.push(f))}if(s.length)for(var d=4,g=Math.PI/12,m=Math.PI*2,y=0;y4)return;this._downPoint=null}this.dispatchToElement(a,e,t)}});function _X(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?RB:!0}return!1}function KP(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=_X(o,r,n))&&(!t.topTarget&&(t.topTarget=o),s!==RB)){t.target=o;break}}}function zB(e,t,r){var n=e.painter;return t<0||t>n.getWidth()||r<0||r>n.getHeight()}var BB=32,od=7;function xX(e){for(var t=0;e>=BB;)t|=e&1,e>>=1;return e+t}function JP(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 bX(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 K1(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 J1(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 wX(e,t){var r=od,n,i,a=0,o=[];n=[],i=[];function s(d,g){n[a]=d,i[a]=g,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]=od||A>=od);if(P)break;T<0&&(T=0),T+=2}if(r=T,r<1&&(r=1),g===1){for(_=0;_=0;_--)e[M+_]=e[T+_];e[S]=o[w];return}for(var A=r;;){var P=0,I=0,N=!1;do if(t(o[w],e[x])<0){if(e[S--]=e[x--],P++,I=0,--g===0){N=!0;break}}else if(e[S--]=o[w--],I++,P=0,--y===1){N=!0;break}while((P|I)=0;_--)e[M+_]=e[T+_];if(g===0){N=!0;break}}if(e[S--]=o[w--],--y===1){N=!0;break}if(I=y-K1(e[x],o,0,y,y-1,t),I!==0){for(S-=I,w-=I,y-=I,M=S+1,T=w+1,_=0;_=od||I>=od);if(N)break;A<0&&(A=0),A+=2}if(r=A,r<1&&(r=1),y===1){for(S-=g,x-=g,M=S+1,T=x+1,_=g-1;_>=0;_--)e[M+_]=e[T+_];e[S]=o[w]}else{if(y===0)throw new Error;for(T=S-(y-1),_=0;_s&&(l=s),QP(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 Xn=1,Gd=2,Wc=4,eI=!1;function Q1(){eI||(eI=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function tI(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var SX=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=tI}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}(),w0;w0=Je.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};var vv={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-vv.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?vv.bounceIn(e*2)*.5:vv.bounceOut(e*2-1)*.5+.5}},qg=Math.pow,Gs=Math.sqrt,S0=1e-8,FB=1e-4,rI=Gs(3),Kg=1/3,Ia=cl(),Si=cl(),_h=cl();function Ms(e){return e>-S0&&eS0||e<-S0}function kr(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 nI(e,t,r,n,i){var a=1-i;return 3*(((t-e)*a+2*(r-t)*i)*a+(n-r)*i*i)}function C0(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,h=s*l-9*o*u,f=l*l-3*s*u,d=0;if(Ms(c)&&Ms(h))if(Ms(s))a[0]=0;else{var g=-l/s;g>=0&&g<=1&&(a[d++]=g)}else{var m=h*h-4*c*f;if(Ms(m)){var y=h/c,g=-s/o+y,_=-y/2;g>=0&&g<=1&&(a[d++]=g),_>=0&&_<=1&&(a[d++]=_)}else if(m>0){var x=Gs(m),w=c*s+1.5*o*(-h+x),S=c*s+1.5*o*(-h-x);w<0?w=-qg(-w,Kg):w=qg(w,Kg),S<0?S=-qg(-S,Kg):S=qg(S,Kg);var g=(-s-(w+S))/(3*o);g>=0&&g<=1&&(a[d++]=g)}else{var T=(2*c*s-3*o*h)/(2*Gs(c*c*c)),M=Math.acos(T)/3,A=Gs(c),P=Math.cos(M),g=(-s-2*A*P)/(3*o),_=(-s+A*(P+rI*Math.sin(M)))/(3*o),I=(-s+A*(P-rI*Math.sin(M)))/(3*o);g>=0&&g<=1&&(a[d++]=g),_>=0&&_<=1&&(a[d++]=_),I>=0&&I<=1&&(a[d++]=I)}}return d}function GB(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(Ms(o)){if(VB(a)){var u=-s/a;u>=0&&u<=1&&(i[l++]=u)}}else{var c=a*a-4*o*s;if(Ms(c))i[0]=-a/(2*o);else if(c>0){var h=Gs(c),u=(-a+h)/(2*o),f=(-a-h)/(2*o);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function Qs(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,h=(c-u)*i+u;a[0]=e,a[1]=o,a[2]=u,a[3]=h,a[4]=h,a[5]=c,a[6]=l,a[7]=n}function WB(e,t,r,n,i,a,o,s,l,u,c){var h,f=.005,d=1/0,g,m,y,_;Ia[0]=l,Ia[1]=u;for(var x=0;x<1;x+=.05)Si[0]=kr(e,r,i,o,x),Si[1]=kr(t,n,a,s,x),y=Vs(Ia,Si),y=0&&y=0&&u<=1&&(i[l++]=u)}}else{var c=o*o-4*a*s;if(Ms(c)){var u=-o/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(c>0){var h=Gs(c),u=(-o+h)/(2*a),f=(-o-h)/(2*a);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function HB(e,t,r){var n=e+r-2*t;return n===0?.5:(e-t)/n}function qv(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 UB(e,t,r,n,i,a,o,s,l){var u,c=.005,h=1/0;Ia[0]=o,Ia[1]=s;for(var f=0;f<1;f+=.05){Si[0]=Br(e,r,i,f),Si[1]=Br(t,n,a,f);var d=Vs(Ia,Si);d=0&&d=1?1:C0(0,n,a,1,l,s)&&kr(0,i,o,1,s[0])}}}var kX=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||qt,this.ondestroy=t.ondestroy||qt,this.onrestart=t.onrestart||qt,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=we(t)?t:vv[t]||XM(t)},e}(),ZB=function(){function e(t){this.value=t}return e}(),LX=function(){function e(){this._len=0}return e.prototype.insert=function(t){var r=new ZB(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}(),jh=function(){function e(t){this._list=new LX,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 ZB(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}(),iI={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 oa(e){return e=Math.round(e),e<0?0:e>255?255:e}function NX(e){return e=Math.round(e),e<0?0:e>360?360:e}function Kv(e){return e<0?0:e>1?1:e}function Cy(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?oa(parseFloat(t)/100*255):oa(parseInt(t,10))}function Po(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?Kv(parseFloat(t)/100):Kv(parseFloat(t))}function eb(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 As(e,t,r){return e+(t-e)*r}function gi(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}function PC(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var $B=new jh(20),Jg=null;function mc(e,t){Jg&&PC(Jg,t),Jg=$B.put(e,Jg||t.slice())}function fn(e,t){if(e){t=t||[];var r=$B.get(e);if(r)return PC(t,r);e=e+"";var n=e.replace(/ /g,"").toLowerCase();if(n in iI)return PC(t,iI[n]),mc(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)){gi(t,0,0,0,1);return}return gi(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),mc(e,t),t}else if(i===7||i===9){var a=parseInt(n.slice(1,7),16);if(!(a>=0&&a<=16777215)){gi(t,0,0,0,1);return}return gi(t,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(n.slice(7),16)/255:1),mc(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?gi(t,+u[0],+u[1],+u[2],1):gi(t,0,0,0,1);c=Po(u.pop());case"rgb":if(u.length>=3)return gi(t,Cy(u[0]),Cy(u[1]),Cy(u[2]),u.length===3?c:Po(u[3])),mc(e,t),t;gi(t,0,0,0,1);return;case"hsla":if(u.length!==4){gi(t,0,0,0,1);return}return u[3]=Po(u[3]),IC(u,t),mc(e,t),t;case"hsl":if(u.length!==3){gi(t,0,0,0,1);return}return IC(u,t),mc(e,t),t;default:return}}gi(t,0,0,0,1)}}function IC(e,t){var r=(parseFloat(e[0])%360+360)%360/360,n=Po(e[1]),i=Po(e[2]),a=i<=.5?i*(n+1):i+n-i*n,o=i*2-a;return t=t||[],gi(t,oa(eb(o,a,r+1/3)*255),oa(eb(o,a,r)*255),oa(eb(o,a,r-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function PX(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,h=((a-r)/6+o/2)/o,f=((a-n)/6+o/2)/o;t===a?l=f-h:r===a?l=1/3+c-f:n===a&&(l=2/3+h-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 T0(e,t){var r=fn(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 Li(r,r.length===4?"rgba":"rgb")}}function IX(e){var t=fn(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)}function pv(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]=oa(As(o[0],s[0],l)),r[1]=oa(As(o[1],s[1],l)),r[2]=oa(As(o[2],s[2],l)),r[3]=Kv(As(o[3],s[3],l)),r}}var DX=pv;function qM(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=fn(t[i]),s=fn(t[a]),l=n-i,u=Li([oa(As(o[0],s[0],l)),oa(As(o[1],s[1],l)),oa(As(o[2],s[2],l)),Kv(As(o[3],s[3],l))],"rgba");return r?{color:u,leftIndex:i,rightIndex:a,value:n}:u}}var EX=qM;function Io(e,t,r,n){var i=fn(e);if(e)return i=PX(i),t!=null&&(i[0]=NX(we(t)?t(i[0]):t)),r!=null&&(i[1]=Po(we(r)?r(i[1]):r)),n!=null&&(i[2]=Po(we(n)?n(i[2]):n)),Li(IC(i),"rgba")}function Jv(e,t){var r=fn(e);if(r&&t!=null)return r[3]=Kv(t),Li(r,"rgba")}function Li(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 Qv(e,t){var r=fn(e);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*t:0}function jX(){return Li([Math.round(Math.random()*255),Math.round(Math.random()*255),Math.round(Math.random()*255)],"rgb")}var aI=new jh(100);function M0(e){if(he(e)){var t=aI.get(e);return t||(t=T0(e,-.1),aI.put(e,t)),t}else if(jp(e)){var r=Q({},e);return r.colorStops=ae(e.colorStops,function(n){return{offset:n.offset,color:T0(n.color,-.1)}}),r}return e}const RX=Object.freeze(Object.defineProperty({__proto__:null,fastLerp:pv,fastMapToColor:DX,lerp:qM,lift:T0,liftColor:M0,lum:Qv,mapToColor:EX,modifyAlpha:Jv,modifyHSL:Io,parse:fn,parseCssFloat:Po,parseCssInt:Cy,random:jX,stringify:Li,toHex:IX},Symbol.toStringTag,{value:"Module"}));var A0=Math.round;function ep(e){var t;if(!e||e==="transparent")e="none";else if(typeof e=="string"&&e.indexOf("rgba")>-1){var r=fn(e);r&&(e="rgb("+r[0]+","+r[1]+","+r[2]+")",t=r[3])}return{color:e,opacity:t??1}}var oI=1e-4;function ks(e){return e-oI}function Qg(e){return A0(e*1e3)/1e3}function DC(e){return A0(e*1e4)/1e4}function OX(e){return"matrix("+Qg(e[0])+","+Qg(e[1])+","+Qg(e[2])+","+Qg(e[3])+","+DC(e[4])+","+DC(e[5])+")"}var zX={left:"start",right:"end",center:"middle",middle:"middle"};function BX(e,t,r){return r==="top"?e+=t/2:r==="bottom"&&(e-=t/2),e}function FX(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}function VX(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 YB(e){return e&&!!e.image}function GX(e){return e&&!!e.svgElement}function KM(e){return YB(e)||GX(e)}function XB(e){return e.type==="linear"}function qB(e){return e.type==="radial"}function KB(e){return e&&(e.type==="linear"||e.type==="radial")}function lx(e){return"url(#"+e+")"}function JB(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 QB(e){var t=e.x||0,r=e.y||0,n=(e.rotation||0)*cv,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("+A0(o*cv)+"deg, "+A0(s*cv)+"deg)"),l.join(" ")}var WX=function(){return Je.hasGlobalWindow&&we(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}}(),EC=Array.prototype.slice;function _o(e,t,r){return(t-e)*r+e}function tb(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=lI,l=r;if(Kr(r)){var u=$X(r);s=u,(u===1&&!rt(r[0])||u===2&&!rt(r[0][0]))&&(o=!0)}else if(rt(r)&&!Xr(r))s=tm;else if(he(r))if(!isNaN(+r))s=tm;else{var c=fn(r);c&&(l=c,s=Wd)}else if(jp(r)){var h=Q({},l);h.colorStops=ae(r.colorStops,function(d){return{offset:d.offset,color:fn(d.color)}}),XB(r)?s=jC:qB(r)&&(s=RC),l=h}a===0?this.valType=s:(s!==this.valType||s===lI)&&(o=!0),this.discrete=this.discrete||o;var f={time:t,value:l,rawValue:r,percent:0};return n&&(f.easing=n,f.easingFunc=we(n)?n:vv[n]||XM(n)),i.push(f),f},e.prototype.prepare=function(t,r){var n=this.keyframes;this._needsSort&&n.sort(function(m,y){return m.time-y.time});for(var i=this.valType,a=n.length,o=n[a-1],s=this.discrete,l=rm(i),u=uI(i),c=0;c=0&&!(o[c].percent<=r);c--);c=f(c,s-2)}else{for(c=h;cr);c++);c=f(c-1,s-2)}g=o[c+1],d=o[c]}if(d&&g){this._lastFr=c,this._lastFrP=r;var y=g.percent-d.percent,_=y===0?1:f((r-d.percent)/y,1);g.easingFunc&&(_=g.easingFunc(_));var x=n?this._additiveValue:u?sd:t[l];if((rm(a)||u)&&!x&&(x=this._additiveValue=[]),this.discrete)t[l]=_<1?d.rawValue:g.rawValue;else if(rm(a))a===My?tb(x,d[i],g[i],_):HX(x,d[i],g[i],_);else if(uI(a)){var w=d[i],S=g[i],T=a===jC;t[l]={type:T?"linear":"radial",x:_o(w.x,S.x,_),y:_o(w.y,S.y,_),colorStops:ae(w.colorStops,function(A,P){var I=S.colorStops[P];return{offset:_o(A.offset,I.offset,_),color:Ty(tb([],A.color,I.color,_))}}),global:S.global},T?(t[l].x2=_o(w.x2,S.x2,_),t[l].y2=_o(w.y2,S.y2,_)):t[l].r=_o(w.r,S.r,_)}else if(u)tb(x,d[i],g[i],_),n||(t[l]=Ty(x));else{var M=_o(d[i],g[i],_);n?this._additiveValue=M:t[l]=M}n&&this._addToTarget(t)}}},e.prototype._addToTarget=function(t){var r=this.valType,n=this.propName,i=this._additiveValue;r===tm?t[n]=t[n]+i:r===Wd?(fn(t[n],sd),em(sd,sd,i,1),t[n]=Ty(sd)):r===My?em(t[n],t[n],i,1):r===eF&&sI(t[n],t[n],i,1)},e}(),JM=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){nx("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,Qe(r),n)},e.prototype.whenWithKeys=function(t,r,n,i){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,gv(u),i),this._trackKeys.push(s)}l.addKeyframe(t,gv(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 oh(){return new Date().getTime()}var XX=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=oh()-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&&(w0(n),!r._paused&&r.update())}w0(n)},t.prototype.start=function(){this._running||(this._time=oh(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=oh(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=oh()-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 JM(r,n.loop);return this.addAnimator(i),i},t}(Bi),qX=300,rb=Je.domSupported,nb=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=ae(e,function(i){var a=i.replace("mouse","pointer");return r.hasOwnProperty(a)?a:i});return{mouse:e,touch:t,pointer:n}}(),cI={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},hI=!1;function OC(e){var t=e.pointerType;return t==="pen"||t==="touch"}function KX(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 ib(e){e&&(e.zrByTouch=!0)}function JX(e,t){return mi(e.dom,new QX(e,t),!0)}function tF(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 QX=function(){function e(t,r){this.stopPropagation=qt,this.stopImmediatePropagation=qt,this.preventDefault=qt,this.type=r.type,this.target=this.currentTarget=t.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return e}(),Xi={mousedown:function(e){e=mi(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=mi(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=mi(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){e=mi(this.dom,e);var t=e.toElement||e.relatedTarget;tF(this,t)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){hI=!0,e=mi(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){hI||(e=mi(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){e=mi(this.dom,e),ib(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),Xi.mousemove.call(this,e),Xi.mousedown.call(this,e)},touchmove:function(e){e=mi(this.dom,e),ib(e),this.handler.processGesture(e,"change"),Xi.mousemove.call(this,e)},touchend:function(e){e=mi(this.dom,e),ib(e),this.handler.processGesture(e,"end"),Xi.mouseup.call(this,e),+new Date-+this.__lastTouchMomentvI||e<-vI}var Al=[],yc=[],ob=Pr(),sb=Math.abs,ko=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 Ml(this.rotation)||Ml(this.x)||Ml(this.y)||Ml(this.scaleX-1)||Ml(this.scaleY-1)||Ml(this.skewX)||Ml(this.skewY)},e.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,r=this.needLocalTransform(),n=this.transform;if(!(r||t)){n&&(dI(n),this.invTransform=null);return}n=n||Pr(),r?this.getLocalTransform(n):dI(n),t&&(r?aa(n,t,n):Bp(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)},e.prototype._resolveGlobalScaleRatio=function(t){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(Al);var n=Al[0]<0?-1:1,i=Al[1]<0?-1:1,a=((Al[0]-n)*r+n)/Al[0]||0,o=((Al[1]-i)*r+i)/Al[1]||0;t[0]*=a,t[1]*=a,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||Pr(),ji(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||Pr(),aa(yc,t.invTransform,r),r=yc);var n=this.originX,i=this.originY;(n||i)&&(ob[4]=n,ob[5]=i,aa(yc,r,ob),yc[4]-=n,yc[5]-=i,r=yc),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&&Kt(n,n,i),n},e.prototype.transformCoordToGlobal=function(t,r){var n=[t,r],i=this.transform;return i&&Kt(n,n,i),n},e.prototype.getLineScale=function(){var t=this.transform;return t&&sb(t[0]-1)>1e-10&&sb(t[3]-1)>1e-10?Math.sqrt(sb(t[0]*t[3]-t[2]*t[1])):1},e.prototype.copyTransform=function(t){L0(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,h=t.y,f=t.skewX?Math.tan(t.skewX):0,d=t.skewY?Math.tan(-t.skewY):0;if(n||i||s||l){var g=n+s,m=i+l;r[4]=-g*a-f*m*o,r[5]=-m*o-d*g*a}else r[4]=r[5]=0;return r[0]=a,r[3]=o,r[1]=d*a,r[2]=f*o,u&&Ko(r,r,u),r[4]+=n+c,r[5]+=i+h,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}(),Ya=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function L0(e,t){for(var r=0;r=pI)){e=e||Go;for(var t=[],r=+new Date,n=0;n<=127;n++)t[n]=Bn.measureText(String.fromCharCode(n),e).width;var i=+new Date-r;return i>16?lb=pI:i>2&&lb++,t}}var lb=0,pI=5;function nF(e,t){return e.asciiWidthMapTried||(e.asciiWidthMap=iq(e.font),e.asciiWidthMapTried=!0),0<=t&&t<=127?e.asciiWidthMap!=null?e.asciiWidthMap[t]:e.asciiCharWidth:e.stWideCharWidth}function Ha(e,t){var r=e.strWidthCache,n=r.get(t);return n==null&&(n=Bn.measureText(t,e.font).width,r.put(t,n)),n}function gI(e,t,r,n){var i=Ha(Wa(t),e),a=Fp(t),o=Rh(0,i,r),s=_u(0,a,n),l=new Pe(o,s,i,a);return l}function ux(e,t,r,n){var i=((e||"")+"").split(` -`),a=i.length;if(a===1)return gI(i[0],t,r,n);for(var o=new Pe(0,0,0,0),s=0;s=0?parseFloat(e)/100*t:parseFloat(e):e}function N0(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",h="top";if(n instanceof Array)l+=fa(n[0],r.width),u+=fa(n[1],r.height),c=null,h=null;else switch(n){case"left":l-=i,u+=s,c="right",h="middle";break;case"right":l+=i+o,u+=s,h="middle";break;case"top":l+=o/2,u-=i,c="center",h="bottom";break;case"bottom":l+=o/2,u+=a+i,c="center";break;case"inside":l+=o/2,u+=s,c="center",h="middle";break;case"insideLeft":l+=i,u+=s,h="middle";break;case"insideRight":l+=o-i,u+=s,c="right",h="middle";break;case"insideTop":l+=o/2,u+=i,c="center";break;case"insideBottom":l+=o/2,u+=a-i,c="center",h="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,h="bottom";break;case"insideBottomRight":l+=o-i,u+=a-i,c="right",h="bottom";break}return e=e||{},e.x=l,e.y=u,e.align=c,e.verticalAlign=h,e}var ub="__zr_normal__",cb=Ya.concat(["ignore"]),aq=Ei(Ya,function(e,t){return e[t]=!0,e},{ignore:!1}),_c={},oq=new Pe(0,0,0,0),im=[],cx=function(){function e(t){this.id=HM(),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,h=n.autoOverflowArea,f=void 0;if((h||c)&&(f=oq,n.layoutRect?f.copy(n.layoutRect):f.copy(this.getBoundingRect()),i||f.applyTransform(this.transform)),c){this.calculateTextPosition?this.calculateTextPosition(_c,n,f):N0(_c,n,f),a.x=_c.x,a.y=_c.y,o=_c.align,s=_c.verticalAlign;var d=n.origin;if(d&&n.rotation!=null){var g=void 0,m=void 0;d==="center"?(g=f.width*.5,m=f.height*.5):(g=fa(d[0],f.width),m=fa(d[1],f.height)),u=!0,a.originX=-a.x+g+(i?0:f.x),a.originY=-a.y+m+(i?0:f.y)}}n.rotation!=null&&(a.rotation=n.rotation);var y=n.offset;y&&(a.x+=y[0],a.y+=y[1],u||(a.originX=-y[0],a.originY=-y[1]));var _=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(h){var x=_.overflowRect=_.overflowRect||new Pe(0,0,0,0);a.getLocalTransform(im),ji(im,im),Pe.copy(x,f),x.applyTransform(im)}else _.overflowRect=null;var w=n.inside==null?typeof n.position=="string"&&n.position.indexOf("inside")>=0:n.inside,S=void 0,T=void 0,M=void 0;w&&this.canBeInsideText()?(S=n.insideFill,T=n.insideStroke,(S==null||S==="auto")&&(S=this.getInsideTextFill()),(T==null||T==="auto")&&(T=this.getInsideTextStroke(S),M=!0)):(S=n.outsideFill,T=n.outsideStroke,(S==null||S==="auto")&&(S=this.getOutsideFill()),(T==null||T==="auto")&&(T=this.getOutsideStroke(S),M=!0)),S=S||"#000",(S!==_.fill||T!==_.stroke||M!==_.autoStroke||o!==_.align||s!==_.verticalAlign)&&(l=!0,_.fill=S,_.stroke=T,_.autoStroke=M,_.align=o,_.verticalAlign=s,r.setDefaultTextStyle(_)),r.__dirty|=Xn,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()?VC:FC},e.prototype.getOutsideStroke=function(t){var r=this.__zr&&this.__zr.getBackgroundColor(),n=typeof r=="string"&&fn(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,Li(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||{},Q(this.extra,r)):this[t]=r},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(t,r){if(typeof t=="string")this.attrKV(t,r);else if(ke(t))for(var n=t,i=Qe(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(ub,!1,t)},e.prototype.useState=function(t,r,n,i){var a=t===ub,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){nx("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 h=this._textContent,f=this._textGuide;return h&&h.useState(t,r,n,c),f&&f.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&=~Xn),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,g);var m=this._textContent,y=this._textGuide;m&&m.useStates(t,r,f),y&&y.useStates(t,r,f),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!f&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~Xn)}},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(g,m){r.during(m)});for(var f=0;f0||i.force&&!o.length){var P=void 0,I=void 0,N=void 0;if(s){I={},f&&(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"?Je.worker=!0:!Je.hasGlobalWindow||"Deno"in window||typeof navigator<"u"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(Je.node=!0,Je.svgSupported=!0):kY(navigator.userAgent,Je);function kY(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 VM=12,SB="sans-serif",Go=VM+"px "+SB,LY=20,NY=100,PY="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function IY(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(){j(r,function(c){c.parentNode&&c.parentNode.removeChild(c)})},r}function rX(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(),h=2*u,f=c.left,d=c.top;o.push(f,d),l=l&&a&&f===a[h]&&d===a[h+1],s.push(e[u].offsetLeft,e[u].offsetTop)}return l&&i?i:(t.srcCoords=o,t[n]=r?UP(s,o):UP(o,s))}function DB(e){return e.nodeName.toUpperCase()==="CANVAS"}var nX=/([&<>"'])/g,iX={"&":"&","<":"<",">":">",'"':""","'":"'"};function hn(e){return e==null?"":(e+"").replace(nX,function(t,r){return iX[r]})}var aX=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Y1=[],oX=Je.browser.firefox&&+Je.browser.version.split(".")[0]<39;function MC(e,t,r,n){return r=r||{},n?ZP(e,t,r):oX&&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):ZP(e,t,r),r}function ZP(e,t,r){if(Je.domSupported&&e.getBoundingClientRect){var n=t.clientX,i=t.clientY;if(DB(e)){var a=e.getBoundingClientRect();r.zrX=n-a.left,r.zrY=i-a.top;return}else if(TC(Y1,e,n,i)){r.zrX=Y1[0],r.zrY=Y1[1];return}}r.zrX=r.zrY=0}function YM(e){return e||window.event}function mi(e,t,r){if(t=YM(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&&MC(e,o,t,r)}else{MC(e,t,t,r);var a=sX(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var s=t.button;return t.which==null&&s!==void 0&&aX.test(t.type)&&(t.which=s&1?1:s&2?3:s&4?2:0),t}function sX(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 AC(e,t,r,n){e.addEventListener(t,r,n)}function lX(e,t,r,n){e.removeEventListener(t,r,n)}var Wo=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function $P(e){return e.which===2||e.which===3}var uX=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=YP(n)/YP(i);!isFinite(a)&&(a=1),t.pinchScale=a;var o=cX(n);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:e[0].target,event:t}}}}};function Pr(){return[1,0,0,1,0,0]}function zp(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function Bp(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 aa(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 ha(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 Ko(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),h=Math.cos(r);return e[0]=i*h+s*c,e[1]=-i*c+s*h,e[2]=a*h+l*c,e[3]=-a*c+h*l,e[4]=h*(o-n[0])+c*(u-n[1])+n[0],e[5]=h*(u-n[1])-c*(o-n[0])+n[1],e}function l_(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 ji(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 EB(e){var t=Pr();return Bp(t,e),t}const hX=Object.freeze(Object.defineProperty({__proto__:null,clone:EB,copy:Bp,create:Pr,identity:zp,invert:ji,mul:aa,rotate:Ko,scale:l_,translate:ha},Symbol.toStringTag,{value:"Module"}));var Ne=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}(),cu=Math.min,ah=Math.max,kC=Math.abs,XP=["x","y"],fX=["width","height"],wl=new Ne,Sl=new Ne,Cl=new Ne,Tl=new Ne,Yn=jB(),Vd=Yn.minTv,LC=Yn.maxTv,dv=[0,0],Pe=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=cu(t.x,this.x),n=cu(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=ah(t.x+t.width,this.x+this.width)-r:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=ah(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=Pr();return ha(a,a,[-r.x,-r.y]),l_(a,a,[n,i]),ha(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&&Ne.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(dX,t.x,t.y,t.width,t.height)),r instanceof e||(r=e.set(vX,r.x,r.y,r.width,r.height));var s=!!n;Yn.reset(i,s);var l=Yn.touchThreshold,u=t.x+l,c=t.x+t.width-l,h=t.y+l,f=t.y+t.height-l,d=r.x+l,g=r.x+r.width-l,m=r.y+l,y=r.y+r.height-l;if(u>c||h>f||d>g||m>y)return!1;var x=!(c=t.x&&r<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},e.prototype.contain=function(t,r){return e.contain(this,t,r)},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(t){e.copy(this,t)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return this.width===0||this.height===0},e.create=function(t){return new e(t.x,t.y,t.width,t.height)},e.copy=function(t,r){return t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height,t},e.applyTransform=function(t,r,n){if(!n){t!==r&&e.copy(t,r);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var i=n[0],a=n[3],o=n[4],s=n[5];t.x=r.x*i+o,t.y=r.y*a+s,t.width=r.width*i,t.height=r.height*a,t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height);return}wl.x=Cl.x=r.x,wl.y=Tl.y=r.y,Sl.x=Tl.x=r.x+r.width,Sl.y=Cl.y=r.y+r.height,wl.transform(n),Tl.transform(n),Sl.transform(n),Cl.transform(n),t.x=cu(wl.x,Sl.x,Cl.x,Tl.x),t.y=cu(wl.y,Sl.y,Cl.y,Tl.y);var l=ah(wl.x,Sl.x,Cl.x,Tl.x),u=ah(wl.y,Sl.y,Cl.y,Tl.y);t.width=l-t.x,t.height=u-t.y},e}(),dX=new Pe(0,0,0,0),vX=new Pe(0,0,0,0);function qP(e,t,r,n,i,a,o,s){var l=kC(t-r),u=kC(n-e),c=cu(l,u),h=XP[i],f=XP[1-i],d=fX[i];t=u||!Yn.bidirectional)&&(Vd[h]=-u,Vd[f]=0,Yn.useDir&&Yn.calcDirMTV())))}function jB(){var e=0,t=new Ne,r=new Ne,n={minTv:new Ne,maxTv:new Ne,useDir:!1,dirMinTv:new Ne,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(a,o){n.touchThreshold=0,a&&a.touchThreshold!=null&&(n.touchThreshold=ah(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;h--){var f=a[h];f!==i&&!f.ignore&&!f.ignoreCoarsePointer&&(!f.parent||!f.parent.ignoreCoarsePointer)&&(q1.copy(f.getBoundingRect()),f.transform&&q1.applyTransform(f.transform),q1.intersect(c)&&s.push(f))}if(s.length)for(var d=4,g=Math.PI/12,m=Math.PI*2,y=0;y4)return;this._downPoint=null}this.dispatchToElement(a,e,t)}});function xX(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?RB:!0}return!1}function KP(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=xX(o,r,n))&&(!t.topTarget&&(t.topTarget=o),s!==RB)){t.target=o;break}}}function zB(e,t,r){var n=e.painter;return t<0||t>n.getWidth()||r<0||r>n.getHeight()}var BB=32,od=7;function _X(e){for(var t=0;e>=BB;)t|=e&1,e>>=1;return e+t}function JP(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 bX(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 K1(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 J1(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 wX(e,t){var r=od,n,i,a=0,o=[];n=[],i=[];function s(d,g){n[a]=d,i[a]=g,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]=od||A>=od);if(P)break;T<0&&(T=0),T+=2}if(r=T,r<1&&(r=1),g===1){for(x=0;x=0;x--)e[M+x]=e[T+x];e[S]=o[w];return}for(var A=r;;){var P=0,I=0,N=!1;do if(t(o[w],e[_])<0){if(e[S--]=e[_--],P++,I=0,--g===0){N=!0;break}}else if(e[S--]=o[w--],I++,P=0,--y===1){N=!0;break}while((P|I)=0;x--)e[M+x]=e[T+x];if(g===0){N=!0;break}}if(e[S--]=o[w--],--y===1){N=!0;break}if(I=y-K1(e[_],o,0,y,y-1,t),I!==0){for(S-=I,w-=I,y-=I,M=S+1,T=w+1,x=0;x=od||I>=od);if(N)break;A<0&&(A=0),A+=2}if(r=A,r<1&&(r=1),y===1){for(S-=g,_-=g,M=S+1,T=_+1,x=g-1;x>=0;x--)e[M+x]=e[T+x];e[S]=o[w]}else{if(y===0)throw new Error;for(T=S-(y-1),x=0;xs&&(l=s),QP(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 Xn=1,Gd=2,Wc=4,eI=!1;function Q1(){eI||(eI=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function tI(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var SX=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=tI}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}(),w0;w0=Je.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};var vv={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-vv.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?vv.bounceIn(e*2)*.5:vv.bounceOut(e*2-1)*.5+.5}},qg=Math.pow,Gs=Math.sqrt,S0=1e-8,FB=1e-4,rI=Gs(3),Kg=1/3,Ia=cl(),Si=cl(),xh=cl();function Ms(e){return e>-S0&&eS0||e<-S0}function kr(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 nI(e,t,r,n,i){var a=1-i;return 3*(((t-e)*a+2*(r-t)*i)*a+(n-r)*i*i)}function C0(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,h=s*l-9*o*u,f=l*l-3*s*u,d=0;if(Ms(c)&&Ms(h))if(Ms(s))a[0]=0;else{var g=-l/s;g>=0&&g<=1&&(a[d++]=g)}else{var m=h*h-4*c*f;if(Ms(m)){var y=h/c,g=-s/o+y,x=-y/2;g>=0&&g<=1&&(a[d++]=g),x>=0&&x<=1&&(a[d++]=x)}else if(m>0){var _=Gs(m),w=c*s+1.5*o*(-h+_),S=c*s+1.5*o*(-h-_);w<0?w=-qg(-w,Kg):w=qg(w,Kg),S<0?S=-qg(-S,Kg):S=qg(S,Kg);var g=(-s-(w+S))/(3*o);g>=0&&g<=1&&(a[d++]=g)}else{var T=(2*c*s-3*o*h)/(2*Gs(c*c*c)),M=Math.acos(T)/3,A=Gs(c),P=Math.cos(M),g=(-s-2*A*P)/(3*o),x=(-s+A*(P+rI*Math.sin(M)))/(3*o),I=(-s+A*(P-rI*Math.sin(M)))/(3*o);g>=0&&g<=1&&(a[d++]=g),x>=0&&x<=1&&(a[d++]=x),I>=0&&I<=1&&(a[d++]=I)}}return d}function GB(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(Ms(o)){if(VB(a)){var u=-s/a;u>=0&&u<=1&&(i[l++]=u)}}else{var c=a*a-4*o*s;if(Ms(c))i[0]=-a/(2*o);else if(c>0){var h=Gs(c),u=(-a+h)/(2*o),f=(-a-h)/(2*o);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function Qs(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,h=(c-u)*i+u;a[0]=e,a[1]=o,a[2]=u,a[3]=h,a[4]=h,a[5]=c,a[6]=l,a[7]=n}function WB(e,t,r,n,i,a,o,s,l,u,c){var h,f=.005,d=1/0,g,m,y,x;Ia[0]=l,Ia[1]=u;for(var _=0;_<1;_+=.05)Si[0]=kr(e,r,i,o,_),Si[1]=kr(t,n,a,s,_),y=Vs(Ia,Si),y=0&&y=0&&u<=1&&(i[l++]=u)}}else{var c=o*o-4*a*s;if(Ms(c)){var u=-o/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(c>0){var h=Gs(c),u=(-o+h)/(2*a),f=(-o-h)/(2*a);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function HB(e,t,r){var n=e+r-2*t;return n===0?.5:(e-t)/n}function qv(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 UB(e,t,r,n,i,a,o,s,l){var u,c=.005,h=1/0;Ia[0]=o,Ia[1]=s;for(var f=0;f<1;f+=.05){Si[0]=Br(e,r,i,f),Si[1]=Br(t,n,a,f);var d=Vs(Ia,Si);d=0&&d=1?1:C0(0,n,a,1,l,s)&&kr(0,i,o,1,s[0])}}}var kX=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||qt,this.ondestroy=t.ondestroy||qt,this.onrestart=t.onrestart||qt,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=we(t)?t:vv[t]||XM(t)},e}(),ZB=function(){function e(t){this.value=t}return e}(),LX=function(){function e(){this._len=0}return e.prototype.insert=function(t){var r=new ZB(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}(),jh=function(){function e(t){this._list=new LX,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 ZB(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}(),iI={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 oa(e){return e=Math.round(e),e<0?0:e>255?255:e}function NX(e){return e=Math.round(e),e<0?0:e>360?360:e}function Kv(e){return e<0?0:e>1?1:e}function Cy(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?oa(parseFloat(t)/100*255):oa(parseInt(t,10))}function Po(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?Kv(parseFloat(t)/100):Kv(parseFloat(t))}function eb(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 As(e,t,r){return e+(t-e)*r}function gi(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}function PC(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var $B=new jh(20),Jg=null;function mc(e,t){Jg&&PC(Jg,t),Jg=$B.put(e,Jg||t.slice())}function fn(e,t){if(e){t=t||[];var r=$B.get(e);if(r)return PC(t,r);e=e+"";var n=e.replace(/ /g,"").toLowerCase();if(n in iI)return PC(t,iI[n]),mc(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)){gi(t,0,0,0,1);return}return gi(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),mc(e,t),t}else if(i===7||i===9){var a=parseInt(n.slice(1,7),16);if(!(a>=0&&a<=16777215)){gi(t,0,0,0,1);return}return gi(t,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(n.slice(7),16)/255:1),mc(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?gi(t,+u[0],+u[1],+u[2],1):gi(t,0,0,0,1);c=Po(u.pop());case"rgb":if(u.length>=3)return gi(t,Cy(u[0]),Cy(u[1]),Cy(u[2]),u.length===3?c:Po(u[3])),mc(e,t),t;gi(t,0,0,0,1);return;case"hsla":if(u.length!==4){gi(t,0,0,0,1);return}return u[3]=Po(u[3]),IC(u,t),mc(e,t),t;case"hsl":if(u.length!==3){gi(t,0,0,0,1);return}return IC(u,t),mc(e,t),t;default:return}}gi(t,0,0,0,1)}}function IC(e,t){var r=(parseFloat(e[0])%360+360)%360/360,n=Po(e[1]),i=Po(e[2]),a=i<=.5?i*(n+1):i+n-i*n,o=i*2-a;return t=t||[],gi(t,oa(eb(o,a,r+1/3)*255),oa(eb(o,a,r)*255),oa(eb(o,a,r-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function PX(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,h=((a-r)/6+o/2)/o,f=((a-n)/6+o/2)/o;t===a?l=f-h:r===a?l=1/3+c-f:n===a&&(l=2/3+h-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 T0(e,t){var r=fn(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 Li(r,r.length===4?"rgba":"rgb")}}function IX(e){var t=fn(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)}function pv(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]=oa(As(o[0],s[0],l)),r[1]=oa(As(o[1],s[1],l)),r[2]=oa(As(o[2],s[2],l)),r[3]=Kv(As(o[3],s[3],l)),r}}var DX=pv;function qM(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=fn(t[i]),s=fn(t[a]),l=n-i,u=Li([oa(As(o[0],s[0],l)),oa(As(o[1],s[1],l)),oa(As(o[2],s[2],l)),Kv(As(o[3],s[3],l))],"rgba");return r?{color:u,leftIndex:i,rightIndex:a,value:n}:u}}var EX=qM;function Io(e,t,r,n){var i=fn(e);if(e)return i=PX(i),t!=null&&(i[0]=NX(we(t)?t(i[0]):t)),r!=null&&(i[1]=Po(we(r)?r(i[1]):r)),n!=null&&(i[2]=Po(we(n)?n(i[2]):n)),Li(IC(i),"rgba")}function Jv(e,t){var r=fn(e);if(r&&t!=null)return r[3]=Kv(t),Li(r,"rgba")}function Li(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 Qv(e,t){var r=fn(e);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*t:0}function jX(){return Li([Math.round(Math.random()*255),Math.round(Math.random()*255),Math.round(Math.random()*255)],"rgb")}var aI=new jh(100);function M0(e){if(he(e)){var t=aI.get(e);return t||(t=T0(e,-.1),aI.put(e,t)),t}else if(jp(e)){var r=Q({},e);return r.colorStops=ae(e.colorStops,function(n){return{offset:n.offset,color:T0(n.color,-.1)}}),r}return e}const RX=Object.freeze(Object.defineProperty({__proto__:null,fastLerp:pv,fastMapToColor:DX,lerp:qM,lift:T0,liftColor:M0,lum:Qv,mapToColor:EX,modifyAlpha:Jv,modifyHSL:Io,parse:fn,parseCssFloat:Po,parseCssInt:Cy,random:jX,stringify:Li,toHex:IX},Symbol.toStringTag,{value:"Module"}));var A0=Math.round;function ep(e){var t;if(!e||e==="transparent")e="none";else if(typeof e=="string"&&e.indexOf("rgba")>-1){var r=fn(e);r&&(e="rgb("+r[0]+","+r[1]+","+r[2]+")",t=r[3])}return{color:e,opacity:t??1}}var oI=1e-4;function ks(e){return e-oI}function Qg(e){return A0(e*1e3)/1e3}function DC(e){return A0(e*1e4)/1e4}function OX(e){return"matrix("+Qg(e[0])+","+Qg(e[1])+","+Qg(e[2])+","+Qg(e[3])+","+DC(e[4])+","+DC(e[5])+")"}var zX={left:"start",right:"end",center:"middle",middle:"middle"};function BX(e,t,r){return r==="top"?e+=t/2:r==="bottom"&&(e-=t/2),e}function FX(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}function VX(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 YB(e){return e&&!!e.image}function GX(e){return e&&!!e.svgElement}function KM(e){return YB(e)||GX(e)}function XB(e){return e.type==="linear"}function qB(e){return e.type==="radial"}function KB(e){return e&&(e.type==="linear"||e.type==="radial")}function u_(e){return"url(#"+e+")"}function JB(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 QB(e){var t=e.x||0,r=e.y||0,n=(e.rotation||0)*cv,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("+A0(o*cv)+"deg, "+A0(s*cv)+"deg)"),l.join(" ")}var WX=function(){return Je.hasGlobalWindow&&we(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}}(),EC=Array.prototype.slice;function xo(e,t,r){return(t-e)*r+e}function tb(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=lI,l=r;if(Kr(r)){var u=$X(r);s=u,(u===1&&!rt(r[0])||u===2&&!rt(r[0][0]))&&(o=!0)}else if(rt(r)&&!Xr(r))s=tm;else if(he(r))if(!isNaN(+r))s=tm;else{var c=fn(r);c&&(l=c,s=Wd)}else if(jp(r)){var h=Q({},l);h.colorStops=ae(r.colorStops,function(d){return{offset:d.offset,color:fn(d.color)}}),XB(r)?s=jC:qB(r)&&(s=RC),l=h}a===0?this.valType=s:(s!==this.valType||s===lI)&&(o=!0),this.discrete=this.discrete||o;var f={time:t,value:l,rawValue:r,percent:0};return n&&(f.easing=n,f.easingFunc=we(n)?n:vv[n]||XM(n)),i.push(f),f},e.prototype.prepare=function(t,r){var n=this.keyframes;this._needsSort&&n.sort(function(m,y){return m.time-y.time});for(var i=this.valType,a=n.length,o=n[a-1],s=this.discrete,l=rm(i),u=uI(i),c=0;c=0&&!(o[c].percent<=r);c--);c=f(c,s-2)}else{for(c=h;cr);c++);c=f(c-1,s-2)}g=o[c+1],d=o[c]}if(d&&g){this._lastFr=c,this._lastFrP=r;var y=g.percent-d.percent,x=y===0?1:f((r-d.percent)/y,1);g.easingFunc&&(x=g.easingFunc(x));var _=n?this._additiveValue:u?sd:t[l];if((rm(a)||u)&&!_&&(_=this._additiveValue=[]),this.discrete)t[l]=x<1?d.rawValue:g.rawValue;else if(rm(a))a===My?tb(_,d[i],g[i],x):HX(_,d[i],g[i],x);else if(uI(a)){var w=d[i],S=g[i],T=a===jC;t[l]={type:T?"linear":"radial",x:xo(w.x,S.x,x),y:xo(w.y,S.y,x),colorStops:ae(w.colorStops,function(A,P){var I=S.colorStops[P];return{offset:xo(A.offset,I.offset,x),color:Ty(tb([],A.color,I.color,x))}}),global:S.global},T?(t[l].x2=xo(w.x2,S.x2,x),t[l].y2=xo(w.y2,S.y2,x)):t[l].r=xo(w.r,S.r,x)}else if(u)tb(_,d[i],g[i],x),n||(t[l]=Ty(_));else{var M=xo(d[i],g[i],x);n?this._additiveValue=M:t[l]=M}n&&this._addToTarget(t)}}},e.prototype._addToTarget=function(t){var r=this.valType,n=this.propName,i=this._additiveValue;r===tm?t[n]=t[n]+i:r===Wd?(fn(t[n],sd),em(sd,sd,i,1),t[n]=Ty(sd)):r===My?em(t[n],t[n],i,1):r===eF&&sI(t[n],t[n],i,1)},e}(),JM=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){i_("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,Qe(r),n)},e.prototype.whenWithKeys=function(t,r,n,i){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,gv(u),i),this._trackKeys.push(s)}l.addKeyframe(t,gv(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 oh(){return new Date().getTime()}var XX=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=oh()-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&&(w0(n),!r._paused&&r.update())}w0(n)},t.prototype.start=function(){this._running||(this._time=oh(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=oh(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=oh()-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 JM(r,n.loop);return this.addAnimator(i),i},t}(Bi),qX=300,rb=Je.domSupported,nb=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=ae(e,function(i){var a=i.replace("mouse","pointer");return r.hasOwnProperty(a)?a:i});return{mouse:e,touch:t,pointer:n}}(),cI={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},hI=!1;function OC(e){var t=e.pointerType;return t==="pen"||t==="touch"}function KX(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 ib(e){e&&(e.zrByTouch=!0)}function JX(e,t){return mi(e.dom,new QX(e,t),!0)}function tF(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 QX=function(){function e(t,r){this.stopPropagation=qt,this.stopImmediatePropagation=qt,this.preventDefault=qt,this.type=r.type,this.target=this.currentTarget=t.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return e}(),Xi={mousedown:function(e){e=mi(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=mi(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=mi(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){e=mi(this.dom,e);var t=e.toElement||e.relatedTarget;tF(this,t)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){hI=!0,e=mi(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){hI||(e=mi(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){e=mi(this.dom,e),ib(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),Xi.mousemove.call(this,e),Xi.mousedown.call(this,e)},touchmove:function(e){e=mi(this.dom,e),ib(e),this.handler.processGesture(e,"change"),Xi.mousemove.call(this,e)},touchend:function(e){e=mi(this.dom,e),ib(e),this.handler.processGesture(e,"end"),Xi.mouseup.call(this,e),+new Date-+this.__lastTouchMomentvI||e<-vI}var Al=[],yc=[],ob=Pr(),sb=Math.abs,ko=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 Ml(this.rotation)||Ml(this.x)||Ml(this.y)||Ml(this.scaleX-1)||Ml(this.scaleY-1)||Ml(this.skewX)||Ml(this.skewY)},e.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,r=this.needLocalTransform(),n=this.transform;if(!(r||t)){n&&(dI(n),this.invTransform=null);return}n=n||Pr(),r?this.getLocalTransform(n):dI(n),t&&(r?aa(n,t,n):Bp(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)},e.prototype._resolveGlobalScaleRatio=function(t){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(Al);var n=Al[0]<0?-1:1,i=Al[1]<0?-1:1,a=((Al[0]-n)*r+n)/Al[0]||0,o=((Al[1]-i)*r+i)/Al[1]||0;t[0]*=a,t[1]*=a,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||Pr(),ji(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||Pr(),aa(yc,t.invTransform,r),r=yc);var n=this.originX,i=this.originY;(n||i)&&(ob[4]=n,ob[5]=i,aa(yc,r,ob),yc[4]-=n,yc[5]-=i,r=yc),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&&Kt(n,n,i),n},e.prototype.transformCoordToGlobal=function(t,r){var n=[t,r],i=this.transform;return i&&Kt(n,n,i),n},e.prototype.getLineScale=function(){var t=this.transform;return t&&sb(t[0]-1)>1e-10&&sb(t[3]-1)>1e-10?Math.sqrt(sb(t[0]*t[3]-t[2]*t[1])):1},e.prototype.copyTransform=function(t){L0(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,h=t.y,f=t.skewX?Math.tan(t.skewX):0,d=t.skewY?Math.tan(-t.skewY):0;if(n||i||s||l){var g=n+s,m=i+l;r[4]=-g*a-f*m*o,r[5]=-m*o-d*g*a}else r[4]=r[5]=0;return r[0]=a,r[3]=o,r[1]=d*a,r[2]=f*o,u&&Ko(r,r,u),r[4]+=n+c,r[5]+=i+h,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}(),Ya=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function L0(e,t){for(var r=0;r=pI)){e=e||Go;for(var t=[],r=+new Date,n=0;n<=127;n++)t[n]=Bn.measureText(String.fromCharCode(n),e).width;var i=+new Date-r;return i>16?lb=pI:i>2&&lb++,t}}var lb=0,pI=5;function nF(e,t){return e.asciiWidthMapTried||(e.asciiWidthMap=iq(e.font),e.asciiWidthMapTried=!0),0<=t&&t<=127?e.asciiWidthMap!=null?e.asciiWidthMap[t]:e.asciiCharWidth:e.stWideCharWidth}function Ha(e,t){var r=e.strWidthCache,n=r.get(t);return n==null&&(n=Bn.measureText(t,e.font).width,r.put(t,n)),n}function gI(e,t,r,n){var i=Ha(Wa(t),e),a=Fp(t),o=Rh(0,i,r),s=xu(0,a,n),l=new Pe(o,s,i,a);return l}function c_(e,t,r,n){var i=((e||"")+"").split(` +`),a=i.length;if(a===1)return gI(i[0],t,r,n);for(var o=new Pe(0,0,0,0),s=0;s=0?parseFloat(e)/100*t:parseFloat(e):e}function N0(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",h="top";if(n instanceof Array)l+=fa(n[0],r.width),u+=fa(n[1],r.height),c=null,h=null;else switch(n){case"left":l-=i,u+=s,c="right",h="middle";break;case"right":l+=i+o,u+=s,h="middle";break;case"top":l+=o/2,u-=i,c="center",h="bottom";break;case"bottom":l+=o/2,u+=a+i,c="center";break;case"inside":l+=o/2,u+=s,c="center",h="middle";break;case"insideLeft":l+=i,u+=s,h="middle";break;case"insideRight":l+=o-i,u+=s,c="right",h="middle";break;case"insideTop":l+=o/2,u+=i,c="center";break;case"insideBottom":l+=o/2,u+=a-i,c="center",h="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,h="bottom";break;case"insideBottomRight":l+=o-i,u+=a-i,c="right",h="bottom";break}return e=e||{},e.x=l,e.y=u,e.align=c,e.verticalAlign=h,e}var ub="__zr_normal__",cb=Ya.concat(["ignore"]),aq=Ei(Ya,function(e,t){return e[t]=!0,e},{ignore:!1}),xc={},oq=new Pe(0,0,0,0),im=[],h_=function(){function e(t){this.id=HM(),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,h=n.autoOverflowArea,f=void 0;if((h||c)&&(f=oq,n.layoutRect?f.copy(n.layoutRect):f.copy(this.getBoundingRect()),i||f.applyTransform(this.transform)),c){this.calculateTextPosition?this.calculateTextPosition(xc,n,f):N0(xc,n,f),a.x=xc.x,a.y=xc.y,o=xc.align,s=xc.verticalAlign;var d=n.origin;if(d&&n.rotation!=null){var g=void 0,m=void 0;d==="center"?(g=f.width*.5,m=f.height*.5):(g=fa(d[0],f.width),m=fa(d[1],f.height)),u=!0,a.originX=-a.x+g+(i?0:f.x),a.originY=-a.y+m+(i?0:f.y)}}n.rotation!=null&&(a.rotation=n.rotation);var y=n.offset;y&&(a.x+=y[0],a.y+=y[1],u||(a.originX=-y[0],a.originY=-y[1]));var x=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(h){var _=x.overflowRect=x.overflowRect||new Pe(0,0,0,0);a.getLocalTransform(im),ji(im,im),Pe.copy(_,f),_.applyTransform(im)}else x.overflowRect=null;var w=n.inside==null?typeof n.position=="string"&&n.position.indexOf("inside")>=0:n.inside,S=void 0,T=void 0,M=void 0;w&&this.canBeInsideText()?(S=n.insideFill,T=n.insideStroke,(S==null||S==="auto")&&(S=this.getInsideTextFill()),(T==null||T==="auto")&&(T=this.getInsideTextStroke(S),M=!0)):(S=n.outsideFill,T=n.outsideStroke,(S==null||S==="auto")&&(S=this.getOutsideFill()),(T==null||T==="auto")&&(T=this.getOutsideStroke(S),M=!0)),S=S||"#000",(S!==x.fill||T!==x.stroke||M!==x.autoStroke||o!==x.align||s!==x.verticalAlign)&&(l=!0,x.fill=S,x.stroke=T,x.autoStroke=M,x.align=o,x.verticalAlign=s,r.setDefaultTextStyle(x)),r.__dirty|=Xn,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()?VC:FC},e.prototype.getOutsideStroke=function(t){var r=this.__zr&&this.__zr.getBackgroundColor(),n=typeof r=="string"&&fn(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,Li(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||{},Q(this.extra,r)):this[t]=r},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(t,r){if(typeof t=="string")this.attrKV(t,r);else if(ke(t))for(var n=t,i=Qe(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(ub,!1,t)},e.prototype.useState=function(t,r,n,i){var a=t===ub,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){i_("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 h=this._textContent,f=this._textGuide;return h&&h.useState(t,r,n,c),f&&f.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&=~Xn),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,g);var m=this._textContent,y=this._textGuide;m&&m.useStates(t,r,f),y&&y.useStates(t,r,f),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!f&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~Xn)}},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(g,m){r.during(m)});for(var f=0;f0||i.force&&!o.length){var P=void 0,I=void 0,N=void 0;if(s){I={},f&&(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&&(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 ce=xq;function xq(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 P0(e,t,r)}function P0(e,t,r){return he(e)?_q(e).match(/%$/)?parseFloat(e)/100*t+(r||0):parseFloat(e):e==null?NaN:+e}function ir(e,t,r){return t==null&&(t=10),t=Math.min(Math.max(0,t),lF),e=(+e).toFixed(t),r?e:+e}function Qn(e){return e.sort(function(t,r){return t-r}),e}function ta(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 uF(e)}function uF(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 QM(e,t){var r=Math.log,n=Math.LN10,i=Math.floor(r(e[1]-e[0])/n),a=Math.round(r(ja(t[1]-t[0]))/n),o=Math.min(Math.max(-i+a,0),20);return isFinite(o)?o:20}function bq(e,t,r){if(!e[t])return 0;var n=cF(e,r);return n[t]||0}function cF(e,t){var r=Ei(e,function(d,g){return d+(isNaN(g)?0:g)},0);if(r===0)return[];for(var n=Math.pow(10,t),i=ae(e,function(d){return(isNaN(d)?0:d)/r*n*100}),a=n*100,o=ae(i,function(d){return Math.floor(d)}),s=Ei(o,function(d,g){return d+g},0),l=ae(i,function(d,g){return d-o[g]});su&&(u=l[h],c=h);++o[c],l[c]=0,++s}return ae(o,function(d){return d/n})}function wq(e,t){var r=Math.max(ta(e),ta(t)),n=e+t;return r>lF?n:ir(n,r)}var HC=9007199254740991;function eA(e){var t=Math.PI*2;return(e%t+t)%t}function Oh(e){return e>-mI&&e=10&&t++,t}function tA(e,t){var r=hx(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 Ly(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 UC(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 db(e){e.option=e.parentModel=e.ecModel=null}var Gq=".",kl="___EC__COMPONENT__CONTAINER___",bF="___EC__EXTENDED_CLASS___";function Ra(e){var t={main:"",sub:""};if(e){var r=e.split(Gq);t.main=r[0]||"",t.sub=r[1]||""}return t}function Wq(e){Jr(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}function Hq(e){return!!(e&&e[bF])}function aA(e,t){e.$constructor=e,e.extend=function(r){var n=this,i;return Uq(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)},UM(i,this)),Q(i.prototype,r),i[bF]=!0,i.extend=this.extend,i.superCall=Yq,i.superApply=Xq,i.superClass=n,i}}function Uq(e){return we(e)&&/^class\s/.test(Function.prototype.toString.call(e))}function wF(e,t){e.extend=t.extend}var Zq=Math.round(Math.random()*10);function $q(e){var t=["__\0is_clz",Zq++].join("_");e.prototype[t]=!0,e.isInstance=function(r){return!!(r&&r[t])}}function Yq(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 qq=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],Kq=Ou(qq),Jq=function(){function e(){}return e.prototype.getAreaStyle=function(t,r){return Kq(this,t,r)},e}(),$C=new jh(50);function Qq(e){if(typeof e=="string"){var t=$C.get(e);return t&&t.image}else return e}function oA(e,t,r,n,i){if(e)if(typeof e=="string"){if(t&&t.__zrImageSrc===e||!r)return t;var a=$C.get(e),o={hostEl:r,cb:n,cbPayload:i};return a?(t=a.image,!dx(t)&&a.pending.push(o)):(t=Bn.loadImage(e,bI,bI),t.__zrImageSrc=e,$C.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}else return e;else return t}function bI(){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 ce=_q;function _q(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 P0(e,t,r)}function P0(e,t,r){return he(e)?xq(e).match(/%$/)?parseFloat(e)/100*t+(r||0):parseFloat(e):e==null?NaN:+e}function ir(e,t,r){return t==null&&(t=10),t=Math.min(Math.max(0,t),lF),e=(+e).toFixed(t),r?e:+e}function Qn(e){return e.sort(function(t,r){return t-r}),e}function ta(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 uF(e)}function uF(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 QM(e,t){var r=Math.log,n=Math.LN10,i=Math.floor(r(e[1]-e[0])/n),a=Math.round(r(ja(t[1]-t[0]))/n),o=Math.min(Math.max(-i+a,0),20);return isFinite(o)?o:20}function bq(e,t,r){if(!e[t])return 0;var n=cF(e,r);return n[t]||0}function cF(e,t){var r=Ei(e,function(d,g){return d+(isNaN(g)?0:g)},0);if(r===0)return[];for(var n=Math.pow(10,t),i=ae(e,function(d){return(isNaN(d)?0:d)/r*n*100}),a=n*100,o=ae(i,function(d){return Math.floor(d)}),s=Ei(o,function(d,g){return d+g},0),l=ae(i,function(d,g){return d-o[g]});su&&(u=l[h],c=h);++o[c],l[c]=0,++s}return ae(o,function(d){return d/n})}function wq(e,t){var r=Math.max(ta(e),ta(t)),n=e+t;return r>lF?n:ir(n,r)}var HC=9007199254740991;function eA(e){var t=Math.PI*2;return(e%t+t)%t}function Oh(e){return e>-mI&&e=10&&t++,t}function tA(e,t){var r=f_(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 Ly(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 UC(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 db(e){e.option=e.parentModel=e.ecModel=null}var Gq=".",kl="___EC__COMPONENT__CONTAINER___",bF="___EC__EXTENDED_CLASS___";function Ra(e){var t={main:"",sub:""};if(e){var r=e.split(Gq);t.main=r[0]||"",t.sub=r[1]||""}return t}function Wq(e){Jr(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}function Hq(e){return!!(e&&e[bF])}function aA(e,t){e.$constructor=e,e.extend=function(r){var n=this,i;return Uq(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)},UM(i,this)),Q(i.prototype,r),i[bF]=!0,i.extend=this.extend,i.superCall=Yq,i.superApply=Xq,i.superClass=n,i}}function Uq(e){return we(e)&&/^class\s/.test(Function.prototype.toString.call(e))}function wF(e,t){e.extend=t.extend}var Zq=Math.round(Math.random()*10);function $q(e){var t=["__\0is_clz",Zq++].join("_");e.prototype[t]=!0,e.isInstance=function(r){return!!(r&&r[t])}}function Yq(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 qq=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],Kq=Ou(qq),Jq=function(){function e(){}return e.prototype.getAreaStyle=function(t,r){return Kq(this,t,r)},e}(),$C=new jh(50);function Qq(e){if(typeof e=="string"){var t=$C.get(e);return t&&t.image}else return e}function oA(e,t,r,n,i){if(e)if(typeof e=="string"){if(t&&t.__zrImageSrc===e||!r)return t;var a=$C.get(e),o={hostEl:r,cb:n,cbPayload:i};return a?(t=a.image,!v_(t)&&a.pending.push(o)):(t=Bn.loadImage(e,bI,bI),t.__zrImageSrc=e,$C.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}else return e;else return t}function bI(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t=s;u++)l-=s;var c=Ha(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 TF(e,t,r){var n=r.containerWidth,i=r.contentWidth,a=r.fontMeasureInfo;if(!n){e.textLine="",e.isTruncated=!1;return}var o=Ha(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?tK(t,i,a):o>0?Math.floor(t.length*i/o):0;t=t.substr(0,l),o=Ha(a,t)}t===""&&(t=r.placeholder),e.textLine=t,e.isTruncated=!0}function tK(e,t,r){for(var n=0,i=0,a=e.length;iy&&d){var w=Math.floor(y/f);g=g||_.length>w,_=_.slice(0,w),x=_.length*f}if(i&&c&&m!=null)for(var S=CF(m,u,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),T={},M=0;M<_.length;M++)TF(T,_[M],S),_[M]=T.textLine,g=g||T.isTruncated;for(var A=y,P=0,I=Wa(u),M=0;M<_.length;M++)P=Math.max(Ha(I,_[M]),P);m==null&&(m=P);var N=m;return A+=l,N+=s,{lines:_,height:y,outerWidth:N,outerHeight:A,lineHeight:f,calculatedLineHeight:h,contentWidth:P,contentHeight:x,width:m,isTruncated:g}}var nK=function(){function e(){}return e}(),wI=function(){function e(t){this.tokens=[],t&&(this.tokens=t)}return e}(),iK=function(){function e(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1}return e}();function aK(e,t,r,n,i){var a=new iK,o=sA(e);if(!o)return a;var s=t.padding,l=s?s[1]+s[3]:0,u=s?s[0]+s[2]:0,c=t.width;c==null&&r!=null&&(c=r-l);var h=t.height;h==null&&n!=null&&(h=n-u);for(var f=t.overflow,d=(f==="break"||f==="breakAll")&&c!=null?{width:c,accumWidth:0,breakAll:f==="breakAll"}:null,g=vb.lastIndex=0,m;(m=vb.exec(o))!=null;){var y=m.index;y>g&&pb(a,o.substring(g,y),t,d),pb(a,m[2],t,d,m[1]),g=vb.lastIndex}gh){var Z=a.lines.length;O>0?(I.tokens=I.tokens.slice(0,O),A(I,D,N),a.lines=a.lines.slice(0,P+1)):a.lines=a.lines.slice(0,P),a.isTruncated=a.isTruncated||a.lines.length0&&g+n.accumWidth>n.width&&(c=t.split(` +`),e.isTruncated=s}function CF(e,t,r,n){n=n||{};var i=Q({},n);r=be(r,"..."),i.maxIterations=be(n.maxIterations,2);var a=i.minChar=be(n.minChar,0),o=i.fontMeasureInfo=Wa(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=Ha(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 TF(e,t,r){var n=r.containerWidth,i=r.contentWidth,a=r.fontMeasureInfo;if(!n){e.textLine="",e.isTruncated=!1;return}var o=Ha(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?tK(t,i,a):o>0?Math.floor(t.length*i/o):0;t=t.substr(0,l),o=Ha(a,t)}t===""&&(t=r.placeholder),e.textLine=t,e.isTruncated=!0}function tK(e,t,r){for(var n=0,i=0,a=e.length;iy&&d){var w=Math.floor(y/f);g=g||x.length>w,x=x.slice(0,w),_=x.length*f}if(i&&c&&m!=null)for(var S=CF(m,u,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),T={},M=0;Mg&&pb(a,o.substring(g,y),t,d),pb(a,m[2],t,d,m[1]),g=vb.lastIndex}gh){var Z=a.lines.length;O>0?(I.tokens=I.tokens.slice(0,O),A(I,D,N),a.lines=a.lines.slice(0,P+1)):a.lines=a.lines.slice(0,P),a.isTruncated=a.isTruncated||a.lines.length0&&g+n.accumWidth>n.width&&(c=t.split(` `),u=!0),n.accumWidth=g}else{var m=MF(t,l,n.width,n.breakAll,n.accumWidth);n.accumWidth=m.accumWidth+d,h=m.linesWidths,c=m.lines}}c||(c=t.split(` -`));for(var y=Wa(l),_=0;_=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var sK=Ei(",&?/;] ".split(""),function(e,t){return e[t]=!0,e},{});function lK(e){return oK(e)?!!sK[e]:!0}function MF(e,t,r,n,i){for(var a=[],o=[],s="",l="",u=0,c=0,h=Wa(t),f=0;fr:i+c+g>r){c?(s||l)&&(m?(s||(s=l,l="",u=0,c=u),a.push(s),o.push(c-u),l+=d,u+=g,s="",c=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(c),s=d,c=g)):m?(a.push(l),o.push(u),l=d,u=g):(a.push(d),o.push(g));continue}c+=g,m?(l+=d,u+=g):(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 SI(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;Pe.set(CI,Rh(r,o,i),_u(n,s,a),o,s),Pe.intersect(t,CI,null,TI);var l=TI.outIntersectRect;e.outerWidth=l.width,e.outerHeight=l.height,e.baseX=Rh(l.x,l.width,i,!0),e.baseY=_u(l.y,l.height,a,!0)}}var CI=new Pe(0,0,0,0),TI={outIntersectRect:{},clamp:!0};function sA(e){return e!=null?e+="":e=""}function uK(e){var t=sA(e.text),r=e.font,n=Ha(Wa(r),t),i=Fp(r);return YC(e,n,i,null)}function YC(e,t,r,n){var i=new Pe(Rh(e.x||0,t,e.textAlign),_u(e.y||0,r,e.textBaseline),t,r),a=n??(AF(e)?e.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function AF(e){var t=e.stroke;return t!=null&&t!=="none"&&e.lineWidth>0}var XC="__zr_style_"+Math.round(Math.random()*10),xu={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},vx={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};xu[XC]=!0;var MI=["z","z2","invisible"],cK=["invisible"],Ri=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype._init=function(r){for(var n=Qe(r),i=0;i1e-4){s[0]=e-r,s[1]=t-n,l[0]=e+r,l[1]=t+n;return}if(am[0]=_b(i)*r+e,am[1]=yb(i)*n+t,om[0]=_b(a)*r+e,om[1]=yb(a)*n+t,u(s,am,om),c(l,am,om),i=i%Ll,i<0&&(i=i+Ll),a=a%Ll,a<0&&(a=a+Ll),i>a&&!o?a+=Ll:ii&&(sm[0]=_b(d)*r+e,sm[1]=yb(d)*n+t,u(s,sm,s),c(l,sm,l))}var At={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Nl=[],Pl=[],xa=[],ns=[],ba=[],wa=[],xb=Math.min,bb=Math.max,Il=Math.cos,Dl=Math.sin,fo=Math.abs,qC=Math.PI,ds=qC*2,wb=typeof Float32Array<"u",ld=[];function Sb(e){var t=Math.round(e/qC*1e8)/1e8;return t%2*qC}function gx(e,t){var r=Sb(e[0]);r<0&&(r+=ds);var n=r-e[0],i=e[1];i+=n,!t&&i-r>=ds?i=r+ds:t&&r-i>=ds?i=r-ds:!t&&r>i?i=r+(ds-Sb(r-i)):t&&r0&&(this._ux=fo(n/k0/t)||0,this._uy=fo(n/k0/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(At.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=fo(t-this._xi),i=fo(r-this._yi),a=n>this._ux||i>this._uy;if(this.addData(At.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(At.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(At.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(),ld[0]=i,ld[1]=a,gx(ld,o),i=ld[0],a=ld[1];var s=a-i;return this.addData(At.A,t,r,n,n,i,s,0,o?0:1),this._ctx&&this._ctx.arc(t,r,n,i,a,o),this._xi=Il(a)*n+t,this._yi=Dl(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(At.R,t,r,n,i),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(At.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)&&wb&&(this.data=new Float32Array(r));for(var n=0;n0&&o))for(var s=0;sc.length&&(this._expandData(),c=this.data);for(var h=0;h0&&(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(){xa[0]=xa[1]=ba[0]=ba[1]=Number.MAX_VALUE,ns[0]=ns[1]=wa[0]=wa[1]=-Number.MAX_VALUE;var t=this.data,r=0,n=0,i=0,a=0,o;for(o=0;on||fo(w)>i||f===r-1)&&(m=Math.sqrt(x*x+w*w),a=y,o=_);break}case At.C:{var S=t[f++],T=t[f++],y=t[f++],_=t[f++],M=t[f++],A=t[f++];m=CX(a,o,S,T,y,_,M,A,10),a=M,o=A;break}case At.Q:{var S=t[f++],T=t[f++],y=t[f++],_=t[f++];m=MX(a,o,S,T,y,_,10),a=y,o=_;break}case At.A:var P=t[f++],I=t[f++],N=t[f++],D=t[f++],O=t[f++],R=t[f++],F=R+O;f+=1,g&&(s=Il(O)*N+P,l=Dl(O)*D+I),m=bb(N,D)*xb(ds,Math.abs(R)),a=Il(F)*N+P,o=Dl(F)*D+I;break;case At.R:{s=a=t[f++],l=o=t[f++];var H=t[f++],W=t[f++];m=H*2+W*2;break}case At.Z:{var x=s-a,w=l-o;m=Math.sqrt(x*x+w*w),a=s,o=l;break}}m>=0&&(u[h++]=m,c+=m)}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,h,f,d=r<1,g,m,y=0,_=0,x,w=0,S,T;if(!(d&&(this._pathSegLen||this._calculateLength(),g=this._pathSegLen,m=this._pathLen,x=r*m,!x)))e:for(var M=0;M0&&(t.lineTo(S,T),w=0),A){case At.M:s=u=n[M++],l=c=n[M++],t.moveTo(u,c);break;case At.L:{h=n[M++],f=n[M++];var I=fo(h-u),N=fo(f-c);if(I>i||N>a){if(d){var D=g[_++];if(y+D>x){var O=(x-y)/D;t.lineTo(u*(1-O)+h*O,c*(1-O)+f*O);break e}y+=D}t.lineTo(h,f),u=h,c=f,w=0}else{var R=I*I+N*N;R>w&&(S=h,T=f,w=R)}break}case At.C:{var F=n[M++],H=n[M++],W=n[M++],V=n[M++],z=n[M++],Z=n[M++];if(d){var D=g[_++];if(y+D>x){var O=(x-y)/D;Qs(u,F,W,z,O,Nl),Qs(c,H,V,Z,O,Pl),t.bezierCurveTo(Nl[1],Pl[1],Nl[2],Pl[2],Nl[3],Pl[3]);break e}y+=D}t.bezierCurveTo(F,H,W,V,z,Z),u=z,c=Z;break}case At.Q:{var F=n[M++],H=n[M++],W=n[M++],V=n[M++];if(d){var D=g[_++];if(y+D>x){var O=(x-y)/D;qv(u,F,W,O,Nl),qv(c,H,V,O,Pl),t.quadraticCurveTo(Nl[1],Pl[1],Nl[2],Pl[2]);break e}y+=D}t.quadraticCurveTo(F,H,W,V),u=W,c=V;break}case At.A:var U=n[M++],$=n[M++],Y=n[M++],te=n[M++],ie=n[M++],se=n[M++],le=n[M++],Ee=!n[M++],me=Y>te?Y:te,ye=fo(Y-te)>.001,Me=ie+se,pe=!1;if(d){var D=g[_++];y+D>x&&(Me=ie+se*(x-y)/D,pe=!0),y+=D}if(ye&&t.ellipse?t.ellipse(U,$,Y,te,le,ie,Me,Ee):t.arc(U,$,me,ie,Me,Ee),pe)break e;P&&(s=Il(ie)*Y+U,l=Dl(ie)*te+$),u=Il(Me)*Y+U,c=Dl(Me)*te+$;break;case At.R:s=u=n[M],l=c=n[M+1],h=n[M++],f=n[M++];var Te=n[M++],st=n[M++];if(d){var D=g[_++];if(y+D>x){var ze=x-y;t.moveTo(h,f),t.lineTo(h+xb(ze,Te),f),ze-=Te,ze>0&&t.lineTo(h+Te,f+xb(ze,st)),ze-=st,ze>0&&t.lineTo(h+bb(Te-ze,0),f+st),ze-=Te,ze>0&&t.lineTo(h,f+bb(st-ze,0));break e}y+=D}t.rect(h,f,Te,st);break;case At.Z:if(d){var D=g[_++];if(y+D>x){var O=(x-y)/D;t.lineTo(u*(1-O)+s*O,c*(1-O)+l*O);break e}y+=D}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=At,e.initDefaultProps=function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0}(),e}();function ms(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+h&&c>n+h&&c>a+h&&c>s+h||ce+h&&u>r+h&&u>i+h&&u>o+h||ut+u&&l>n+u&&l>a+u||le+u&&s>r+u&&s>i+u||sr||c+ui&&(i+=ud);var f=Math.atan2(l,s);return f<0&&(f+=ud),f>=n&&f<=i||f+ud>=n&&f+ud<=i}function xo(e,t,r,n,i,a){if(a>t&&a>n||ai?s:0}var is=qa.CMD,El=Math.PI*2,mK=1e-4;function yK(e,t){return Math.abs(e-t)t&&u>n&&u>a&&u>s||u1&&_K(),d=kr(t,n,a,s,_i[0]),f>1&&(g=kr(t,n,a,s,_i[1]))),f===2?y<_i[0]?h+=dt&&s>n&&s>a||s=0&&u<=1){for(var c=0,h=Br(t,n,a,u),f=0;fr||s<-r)return 0;var l=Math.sqrt(r*r-s*s);yn[0]=-l,yn[1]=l;var u=Math.abs(n-i);if(u<1e-4)return 0;if(u>=El-1e-4){n=0,i=El;var c=a?1:-1;return o>=yn[0]+e&&o<=yn[1]+e?c:0}if(n>i){var h=n;n=i,i=h}n<0&&(n+=El,i+=El);for(var f=0,d=0;d<2;d++){var g=yn[d];if(g+e>o){var m=Math.atan2(s,g),c=a?1:-1;m<0&&(m=El+m),(m>=n&&m<=i||m+El>=n&&m+El<=i)&&(m>Math.PI/2&&m1&&(r||(s+=xo(l,u,c,h,n,i))),y&&(l=a[g],u=a[g+1],c=l,h=u),m){case is.M:c=a[g++],h=a[g++],l=c,u=h;break;case is.L:if(r){if(ms(l,u,a[g],a[g+1],t,n,i))return!0}else s+=xo(l,u,a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case is.C:if(r){if(pK(l,u,a[g++],a[g++],a[g++],a[g++],a[g],a[g+1],t,n,i))return!0}else s+=xK(l,u,a[g++],a[g++],a[g++],a[g++],a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case is.Q:if(r){if(kF(l,u,a[g++],a[g++],a[g],a[g+1],t,n,i))return!0}else s+=bK(l,u,a[g++],a[g++],a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case is.A:var _=a[g++],x=a[g++],w=a[g++],S=a[g++],T=a[g++],M=a[g++];g+=1;var A=!!(1-a[g++]);f=Math.cos(T)*w+_,d=Math.sin(T)*S+x,y?(c=f,h=d):s+=xo(l,u,f,d,n,i);var P=(n-_)*S/w+_;if(r){if(gK(_,x,S,T,T+M,A,t,P,i))return!0}else s+=wK(_,x,S,T,T+M,A,P,i);l=Math.cos(T+M)*w+_,u=Math.sin(T+M)*S+x;break;case is.R:c=l=a[g++],h=u=a[g++];var I=a[g++],N=a[g++];if(f=c+I,d=h+N,r){if(ms(c,h,f,h,t,n,i)||ms(f,h,f,d,t,n,i)||ms(f,d,c,d,t,n,i)||ms(c,d,c,h,t,n,i))return!0}else s+=xo(f,h,f,d,n,i),s+=xo(c,d,c,h,n,i);break;case is.Z:if(r){if(ms(l,u,c,h,t,n,i))return!0}else s+=xo(l,u,c,h,n,i);l=c,u=h;break}}return!r&&!yK(u,h)&&(s+=xo(l,u,c,h,n,i)||0),s!==0}function SK(e,t,r){return LF(e,0,!1,t,r)}function CK(e,t,r,n){return LF(e,t,!0,r,n)}var I0=Ae({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},xu),TK={style:Ae({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},vx.style)},Cb=Ya.concat(["invisible","culling","z","z2","zlevel","parent"]),Ke=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?FC:n>.2?nq:VC}else if(r)return VC}return FC},t.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if(he(n)){var i=this.__zr,a=!!(i&&i.isDarkMode()),o=Qv(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&Wc)&&(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)),CK(s,l/u,r,n)))return!0}if(this.hasFill())return SK(s,r,n)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=Wc,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:Q(i,r),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&Wc)},t.prototype.createStyle=function(r){return Op(I0,r)},t.prototype._innerSaveToNormal=function(r){e.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.shape&&!n.shape&&(n.shape=Q({},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=Q({},i.shape),Q(u,n.shape)):(u=Q({},a?this.shape:i.shape),Q(u,n.shape)):l&&(u=i.shape),u)if(o){this.shape=Q({},this.shape);for(var c={},h=Qe(u),f=0;fi&&(h=s+l,s*=i/h,l*=i/h),u+c>i&&(h=u+c,u*=i/h,c*=i/h),l+u>a&&(h=l+u,l*=a/h,u*=a/h),s+c>a&&(h=s+c,s*=a/h,c*=a/h),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 sh=Math.round;function mx(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&&(sh(n*2)===sh(i*2)&&(e.x1=e.x2=ti(n,s,!0)),sh(a*2)===sh(o*2)&&(e.y1=e.y2=ti(a,s,!0))),e}}function NF(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=ti(n,s,!0),e.y=ti(i,s,!0),e.width=Math.max(ti(n+a,s,!1)-e.x,a===0?0:1),e.height=Math.max(ti(i+o,s,!1)-e.y,o===0?0:1)),e}}function ti(e,t,r){if(!t)return e;var n=sh(e*2);return(n+sh(t))%2===0?n/2:(n+(r?1:-1))/2}var PK=function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e}(),IK={},Ze=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new PK},t.prototype.buildPath=function(r,n){var i,a,o,s;if(this.subPixelOptimize){var l=NF(IK,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?NK(r,n):r.rect(i,a,o,s)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(Ke);Ze.prototype.type="rect";var PI={fill:"#000"},II=2,Sa={},DK={style:Ae({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},vx.style)},tt=function(e){q(t,e);function t(r){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=PI,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,O=0;O=0&&(F=M[R],F.align==="right");)this._placeToken(F,r,P,_,O,"right",w),I-=F.width,O-=F.width,R--;for(D+=(c-(D-y)-(x-O)-I)/2;N<=R;)F=M[N],this._placeToken(F,r,P,_,D+F.width/2,"center",w),D+=F.width,N++;_+=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,h=a+i/2;c==="top"?h=a+r.height/2:c==="bottom"&&(h=a+i-r.height/2);var f=!r.isLineHolder&&Tb(u);f&&this._renderBackground(u,n,s==="right"?o-r.width:s==="center"?o-r.width/2:o,h-r.height/2,r.width,r.height);var d=!!u.backgroundColor,g=r.textPadding;g&&(o=zI(o,s,g),h-=r.height/2-g[0]-r.innerHeight/2);var m=this._getOrCreateChild(zh),y=m.createStyle();m.useStyle(y);var _=this._defaultStyle,x=!1,w=0,S=!1,T=OI("fill"in u?u.fill:"fill"in n?n.fill:(x=!0,_.fill)),M=RI("stroke"in u?u.stroke:"stroke"in n?n.stroke:!d&&!l&&(!_.autoStroke||x)?(w=II,S=!0,_.stroke):null),A=u.textShadowBlur>0||n.textShadowBlur>0;y.text=r.text,y.x=o,y.y=h,A&&(y.shadowBlur=u.textShadowBlur||n.textShadowBlur||0,y.shadowColor=u.textShadowColor||n.textShadowColor||"transparent",y.shadowOffsetX=u.textShadowOffsetX||n.textShadowOffsetX||0,y.shadowOffsetY=u.textShadowOffsetY||n.textShadowOffsetY||0),y.textAlign=s,y.textBaseline="middle",y.font=r.font||Go,y.opacity=zn(u.opacity,n.opacity,1),EI(y,u),M&&(y.lineWidth=zn(u.lineWidth,n.lineWidth,w),y.lineDash=be(u.lineDash,n.lineDash),y.lineDashOffset=n.lineDashOffset||0,y.stroke=M),T&&(y.fill=T),m.setBoundingRect(YC(y,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,h=l&&l.image,f=l&&!h,d=r.borderRadius,g=this,m,y;if(f||r.lineHeight||u&&c){m=this._getOrCreateChild(Ze),m.useStyle(m.createStyle()),m.style.fill=null;var _=m.shape;_.x=i,_.y=a,_.width=o,_.height=s,_.r=d,m.dirtyShape()}if(f){var x=m.style;x.fill=l||null,x.fillOpacity=be(r.fillOpacity,1)}else if(h){y=this._getOrCreateChild(Er),y.onload=function(){g.dirtyStyle()};var w=y.style;w.image=l.image,w.x=i,w.y=a,w.width=o,w.height=s}if(u&&c){var x=m.style;x.lineWidth=u,x.stroke=c,x.strokeOpacity=be(r.strokeOpacity,1),x.lineDash=r.borderDash,x.lineDashOffset=r.borderDashOffset||0,m.strokeContainThreshold=0,m.hasFill()&&m.hasStroke()&&(x.strokeFirst=!0,x.lineWidth*=2)}var S=(m||y).style;S.shadowBlur=r.shadowBlur||0,S.shadowColor=r.shadowColor||"transparent",S.shadowOffsetX=r.shadowOffsetX||0,S.shadowOffsetY=r.shadowOffsetY||0,S.opacity=zn(r.opacity,n.opacity,1)},t.makeFont=function(r){var n="";return IF(r)&&(n=[r.fontStyle,r.fontWeight,PF(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&Jn(n)||r.textFont||r.font},t}(Ri),EK={left:!0,right:1,center:1},jK={top:1,bottom:1,middle:1},DI=["fontStyle","fontWeight","fontSize","fontFamily"];function PF(e){return typeof e=="string"&&(e.indexOf("px")!==-1||e.indexOf("rem")!==-1||e.indexOf("em")!==-1)?e:isNaN(+e)?VM+"px":e+"px"}function EI(e,t){for(var r=0;r=0,a=!1;if(e instanceof Ke){var o=DF(e),s=i&&o.selectFill||o.normalFill,l=i&&o.selectStroke||o.normalStroke;if(xc(s)||xc(l)){n=n||{};var u=n.style||{};u.fill==="inherit"?(a=!0,n=Q({},n),u=Q({},u),u.fill=s):!xc(u.fill)&&xc(s)?(a=!0,n=Q({},n),u=Q({},u),u.fill=M0(s)):!xc(u.stroke)&&xc(l)&&(a||(n=Q({},n),u=Q({},u)),u.stroke=M0(l)),n.style=u}}if(n&&n.z2==null){a||(n=Q({},n));var c=e.z2EmphasisLift;n.z2=e.z2+(c??uf)}return n}function GK(e,t,r){if(r&&r.z2==null){r=Q({},r);var n=e.z2SelectLift;r.z2=e.z2+(n??OK)}return r}function WK(e,t,r){var n=Ve(e.currentStates,t)>=0,i=e.style.opacity,a=n?null:FK(e,["opacity"],t,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=Q({},r),o=Q({opacity:n?i:a.opacity*.1},o),r.style=o),r}function Mb(e,t){var r=this.states[e];if(this.style){if(e==="emphasis")return VK(this,e,t,r);if(e==="blur")return WK(this,e,r);if(e==="select")return GK(this,e,r)}return r}function zu(e){e.stateProxy=Mb;var t=e.getTextContent(),r=e.getTextGuideLine();t&&(t.stateProxy=Mb),r&&(r.stateProxy=Mb)}function WI(e,t){!FF(e,t)&&!e.__highByOuter&&Jo(e,EF)}function HI(e,t){!FF(e,t)&&!e.__highByOuter&&Jo(e,jF)}function Ho(e,t){e.__highByOuter|=1<<(t||0),Jo(e,EF)}function Uo(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&Jo(e,jF)}function OF(e){Jo(e,hA)}function fA(e){Jo(e,RF)}function zF(e){Jo(e,zK)}function BF(e){Jo(e,BK)}function FF(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function VF(e){var t=e.getModel(),r=[],n=[];t.eachComponent(function(i,a){var o=lA(a),s=i==="series",l=s?e.getViewOfSeriesModel(a):e.getViewOfComponentModel(a);!s&&n.push(l),o.isBlured&&(l.group.traverse(function(u){RF(u)}),s&&r.push(a)),o.isBlured=!1}),j(n,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(r,!1,t)})}function QC(e,t,r,n){var i=n.getModel();r=r||"coordinateSystem";function a(u,c){for(var h=0;h0){var s={dataIndex:o,seriesIndex:r.seriesIndex};a!=null&&(s.dataType=a),t.push(s)}})}),t}function Hs(e,t,r){fu(e,!0),Jo(e,zu),tT(e,t,r)}function XK(e){fu(e,!1)}function Dt(e,t,r,n){n?XK(e):Hs(e,t,r)}function tT(e,t,r){var n=De(e);t!=null?(n.focus=t,n.blurScope=r):n.focus&&(n.focus=null)}var ZI=["emphasis","blur","select"],qK={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Sr(e,t,r,n){r=r||"itemStyle";for(var i=0;i1&&(o*=Ab(g),s*=Ab(g));var m=(i===a?-1:1)*Ab((o*o*(s*s)-o*o*(d*d)-s*s*(f*f))/(o*o*(d*d)+s*s*(f*f)))||0,y=m*o*d/s,_=m*-s*f/o,x=(e+r)/2+um(h)*y-lm(h)*_,w=(t+n)/2+lm(h)*y+um(h)*_,S=qI([1,0],[(f-y)/o,(d-_)/s]),T=[(f-y)/o,(d-_)/s],M=[(-1*f-y)/o,(-1*d-_)/s],A=qI(T,M);if(nT(T,M)<=-1&&(A=cd),nT(T,M)>=1&&(A=0),A<0){var P=Math.round(A/cd*1e6)/1e6;A=cd*2+P%2*cd}c.addData(u,x,w,o,s,S,A,h,a)}var rJ=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,nJ=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function iJ(e){var t=new qa;if(!e)return t;var r=0,n=0,i=r,a=n,o,s=qa.CMD,l=e.match(rJ);if(!l)return t;for(var u=0;uF*F+H*H&&(P=N,I=D),{cx:P,cy:I,x0:-c,y0:-h,x1:P*(i/T-1),y1:I*(i/T-1)}}function hJ(e){var t;if(re(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 fJ(e,t){var r,n=Hd(t.r,0),i=Hd(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,h=t.cy,f=!!t.clockwise,d=JI(u-l),g=d>kb&&d%kb;if(g>Yi&&(d=g),!(n>Yi))e.moveTo(c,h);else if(d>kb-Yi)e.moveTo(c+n*wc(l),h+n*jl(l)),e.arc(c,h,n,l,u,!f),i>Yi&&(e.moveTo(c+i*wc(u),h+i*jl(u)),e.arc(c,h,i,u,l,f));else{var m=void 0,y=void 0,_=void 0,x=void 0,w=void 0,S=void 0,T=void 0,M=void 0,A=void 0,P=void 0,I=void 0,N=void 0,D=void 0,O=void 0,R=void 0,F=void 0,H=n*wc(l),W=n*jl(l),V=i*wc(u),z=i*jl(u),Z=d>Yi;if(Z){var U=t.cornerRadius;U&&(r=hJ(U),m=r[0],y=r[1],_=r[2],x=r[3]);var $=JI(n-i)/2;if(w=Ca($,_),S=Ca($,x),T=Ca($,m),M=Ca($,y),I=A=Hd(w,S),N=P=Hd(T,M),(A>Yi||P>Yi)&&(D=n*wc(u),O=n*jl(u),R=i*wc(l),F=i*jl(l),d<$F)){var Y=cJ(H,W,R,F,D,O,V,z);if(Y){var te=H-Y[0],ie=W-Y[1],se=D-Y[0],le=O-Y[1],Ee=1/jl(uJ((te*se+ie*le)/(yv(te*te+ie*ie)*yv(se*se+le*le)))/2),me=yv(Y[0]*Y[0]+Y[1]*Y[1]);I=Ca(A,(n-me)/(Ee+1)),N=Ca(P,(i-me)/(Ee-1))}}}if(!Z)e.moveTo(c+H,h+W);else if(I>Yi){var ye=Ca(_,I),Me=Ca(x,I),pe=cm(R,F,H,W,n,ye,f),Te=cm(D,O,V,z,n,Me,f);e.moveTo(c+pe.cx+pe.x0,h+pe.cy+pe.y0),I0&&e.arc(c+pe.cx,h+pe.cy,ye,on(pe.y0,pe.x0),on(pe.y1,pe.x1),!f),e.arc(c,h,n,on(pe.cy+pe.y1,pe.cx+pe.x1),on(Te.cy+Te.y1,Te.cx+Te.x1),!f),Me>0&&e.arc(c+Te.cx,h+Te.cy,Me,on(Te.y1,Te.x1),on(Te.y0,Te.x0),!f))}else e.moveTo(c+H,h+W),e.arc(c,h,n,l,u,!f);if(!(i>Yi)||!Z)e.lineTo(c+V,h+z);else if(N>Yi){var ye=Ca(m,N),Me=Ca(y,N),pe=cm(V,z,D,O,i,-Me,f),Te=cm(H,W,R,F,i,-ye,f);e.lineTo(c+pe.cx+pe.x0,h+pe.cy+pe.y0),N0&&e.arc(c+pe.cx,h+pe.cy,Me,on(pe.y0,pe.x0),on(pe.y1,pe.x1),!f),e.arc(c,h,i,on(pe.cy+pe.y1,pe.cx+pe.x1),on(Te.cy+Te.y1,Te.cx+Te.x1),f),ye>0&&e.arc(c+Te.cx,h+Te.cy,ye,on(Te.y1,Te.x1),on(Te.y0,Te.x0),!f))}else e.lineTo(c+V,h+z),e.arc(c,h,i,u,l,f)}e.closePath()}}}var dJ=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}(),Qr=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new dJ},t.prototype.buildPath=function(r,n){fJ(r,n)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(Ke);Qr.prototype.type="sector";var vJ=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e}(),cf=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new vJ},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}(Ke);cf.prototype.type="ring";function pJ(e,t,r,n){var i=[],a=[],o=[],s=[],l,u,c,h;if(n){c=[1/0,1/0],h=[-1/0,-1/0];for(var f=0,d=e.length;f=2){if(n){var a=pJ(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,h=i.length;sOl[1]){if(a=!1,Or.negativeSize||n)return a;var l=hm(Ol[0]-Rl[1]),u=hm(Rl[0]-Ol[1]);Lb(l,u)>dm.len()&&(l=u||!Or.bidirectional)&&(Ne.scale(fm,s,-u*i),Or.useDir&&Or.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 h=c.duration,f=c.delay,d=c.easing,g={duration:h,delay:f||0,easing:d,done:a,force:!!a||!!o,setToFinal:!u,scope:e,during:o};s?t.animateFrom(r,g):t.animateTo(r,g)}else t.stopAnimation(),!s&&t.attr(r),o&&o(1),a&&a()}function it(e,t,r,n,i,a){gA("update",e,t,r,n,i,a)}function Nt(e,t,r,n,i,a){gA("enter",e,t,r,n,i,a)}function bh(e){if(!e.__zr)return!0;for(var t=0;tja(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function tD(e){return!e.isGroup}function AJ(e){return e.shape!=null}function Up(e,t,r){if(!e||!t)return;function n(o){var s={};return o.traverse(function(l){tD(l)&&l.anid&&(s[l.anid]=l)}),s}function i(o){var s={x:o.x,y:o.y,rotation:o.rotation};return AJ(o)&&(s.shape=Se(o.shape)),s}var a=n(e);t.traverse(function(o){if(tD(o)&&o.anid){var s=a[o.anid];if(s){var l=i(o);o.attr(i(s)),it(o,l,r,De(o).dataIndex)}}})}function _A(e,t){return ae(e,function(r){var n=r[0];n=nr(n,t.x),n=ni(n,t.x+t.width);var i=r[1];return i=nr(i,t.y),i=ni(i,t.y+t.height),[n,i]})}function rV(e,t){var r=nr(e.x,t.x),n=ni(e.x+e.width,t.x+t.width),i=nr(e.y,t.y),a=ni(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 df(e,t,r){var n=Q({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),Ae(i,r),new Er(n)):Bh(e.replace("path://",""),n,r,"center")}function Ud(e,t,r,n,i){for(var a=0,o=i[i.length-1];a1)return!1;var y=Nb(d,g,c,h)/f;return!(y<0||y>1)}function Nb(e,t,r,n){return e*n-r*t}function kJ(e){return e<=1e-6&&e>=-1e-6}function Bu(e,t,r,n,i){return t==null||(rt(t)?Ot[0]=Ot[1]=Ot[2]=Ot[3]=t:(Ot[0]=t[0],Ot[1]=t[1],Ot[2]=t[2],Ot[3]=t[3]),n&&(Ot[0]=nr(0,Ot[0]),Ot[1]=nr(0,Ot[1]),Ot[2]=nr(0,Ot[2]),Ot[3]=nr(0,Ot[3])),r&&(Ot[0]=-Ot[0],Ot[1]=-Ot[1],Ot[2]=-Ot[2],Ot[3]=-Ot[3]),rD(e,Ot,"x","width",3,1,i&&i[0]||0),rD(e,Ot,"y","height",0,2,i&&i[1]||0)),e}var Ot=[0,0,0,0];function rD(e,t,r,n,i,a,o){var s=t[a]+t[i],l=e[n];e[n]+=s,o=nr(0,ni(o,l)),e[n]=0?-t[i]:t[a]>=0?l+t[a]:ja(s)>1e-8?(l-o)*t[i]/s:0):e[r]-=t[i]}function Qo(e){var t=e.itemTooltipOption,r=e.componentModel,n=e.itemName,i=he(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&&j(Qe(l),function(c){ge(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:Ae({content:n,encodeHTMLContent:!0,formatterParams:s},i)}}function aT(e,t){var r;e.isGroup&&(r=t(e)),r||e.traverse(t)}function hl(e,t){if(e)if(re(e))for(var r=0;rt&&(t=o),ot&&(r=t=0),{min:r,max:t}}function bx(e,t,r){aV(e,t,r,-1/0)}function aV(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 fl(e,t){return Ge(Ge({},e,!0),t,!0)}const FJ={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:". "}}}},VJ={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 O0="ZH",SA="EN",wh=SA,Iy={},CA={},hV=Je.domSupported?function(){var e=(document.documentElement.lang||navigator.language||navigator.browserLanguage||wh).toUpperCase();return e.indexOf(O0)>-1?O0:wh}():wh;function TA(e,t){e=e.toUpperCase(),CA[e]=new qe(t),Iy[e]=t}function GJ(e){if(he(e)){var t=Iy[e.toUpperCase()]||{};return e===O0||e===SA?Se(t):Ge(Se(t),Se(Iy[wh]),!1)}else return Ge(Se(e),Se(Iy[wh]),!1)}function sT(e){return CA[e]}function WJ(){return CA[wh]}TA(SA,FJ);TA(O0,VJ);var lT=null;function HJ(e){lT||(lT=e)}function vr(){return lT}var MA=1e3,AA=MA*60,_v=AA*60,Ti=_v*24,sD=Ti*365,UJ={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})/},Dy={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},ZJ="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}",pm="{yyyy}-{MM}-{dd}",lD={year:"{yyyy}",month:"{yyyy}-{MM}",day:pm,hour:pm+" "+Dy.hour,minute:pm+" "+Dy.minute,second:pm+" "+Dy.second,millisecond:ZJ},$n=["year","month","day","hour","minute","second","millisecond"],$J=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function YJ(e){return!he(e)&&!we(e)?XJ(e):e}function XJ(e){e=e||{};var t={},r=!0;return j($n,function(n){r&&(r=e[n]==null)}),j($n,function(n,i){var a=e[n];t[n]={};for(var o=null,s=i;s>=0;s--){var l=$n[s],u=ke(a)&&!re(a)?a[l]:a,c=void 0;re(u)?(c=u.slice(),o=c[0]||""):he(u)?(o=u,c=[o]):(o==null?o=Dy[n]:UJ[l].test(o)||(o=t[l][l][0]+" "+o),c=[o],r&&(c[1]="{primary|"+o+"}")),t[n][l]=c}}),t}function _n(e,t){return e+="","0000".substr(0,t-e.length)+e}function xv(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 qJ(e){return e===xv(e)}function KJ(e){switch(e){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function Zp(e,t,r,n){var i=to(e),a=i[fV(r)](),o=i[kA(r)]()+1,s=Math.floor((o-1)/3)+1,l=i[LA(r)](),u=i["get"+(r?"UTC":"")+"Day"](),c=i[NA(r)](),h=(c-1)%12+1,f=i[PA(r)](),d=i[IA(r)](),g=i[DA(r)](),m=c>=12?"pm":"am",y=m.toUpperCase(),_=n instanceof qe?n:sT(n||hV)||WJ(),x=_.getModel("time"),w=x.get("month"),S=x.get("monthAbbr"),T=x.get("dayOfWeek"),M=x.get("dayOfWeekAbbr");return(t||"").replace(/{a}/g,m+"").replace(/{A}/g,y+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,_n(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,w[o-1]).replace(/{MMM}/g,S[o-1]).replace(/{MM}/g,_n(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,_n(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,T[u]).replace(/{ee}/g,M[u]).replace(/{e}/g,u+"").replace(/{HH}/g,_n(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,_n(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,_n(f,2)).replace(/{m}/g,f+"").replace(/{ss}/g,_n(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,_n(g,3)).replace(/{S}/g,g+"")}function JJ(e,t,r,n,i){var a=null;if(he(r))a=r;else if(we(r)){var o={time:e.time,level:e.time.level},s=vr();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=uh(e.value,i);a=r[c][c][0]}}return Zp(new Date(e.value),a,i,n)}function uh(e,t){var r=to(e),n=r[kA(t)]()+1,i=r[LA(t)](),a=r[NA(t)](),o=r[PA(t)](),s=r[IA(t)](),l=r[DA(t)](),u=l===0,c=u&&s===0,h=c&&o===0,f=h&&a===0,d=f&&i===1,g=d&&n===1;return g?"year":d?"month":f?"day":h?"hour":c?"minute":u?"second":"millisecond"}function z0(e,t,r){switch(t){case"year":e[dV(r)](0);case"month":e[vV(r)](1);case"day":e[pV(r)](0);case"hour":e[gV(r)](0);case"minute":e[mV(r)](0);case"second":e[yV(r)](0)}return e}function fV(e){return e?"getUTCFullYear":"getFullYear"}function kA(e){return e?"getUTCMonth":"getMonth"}function LA(e){return e?"getUTCDate":"getDate"}function NA(e){return e?"getUTCHours":"getHours"}function PA(e){return e?"getUTCMinutes":"getMinutes"}function IA(e){return e?"getUTCSeconds":"getSeconds"}function DA(e){return e?"getUTCMilliseconds":"getMilliseconds"}function QJ(e){return e?"setUTCFullYear":"setFullYear"}function dV(e){return e?"setUTCMonth":"setMonth"}function vV(e){return e?"setUTCDate":"setDate"}function pV(e){return e?"setUTCHours":"setHours"}function gV(e){return e?"setUTCMinutes":"setMinutes"}function mV(e){return e?"setUTCSeconds":"setSeconds"}function yV(e){return e?"setUTCMilliseconds":"setMilliseconds"}function eQ(e,t,r,n,i,a,o,s){var l=new tt({style:{text:e,font:t,align:r,verticalAlign:n,padding:i,rich:a,overflow:o?"truncate":null,lineHeight:s}});return l.getBoundingRect()}function EA(e){if(!rA(e))return he(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function jA(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 gf=Rp;function uT(e,t,r){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(c){return c&&Jn(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?to(e):e;if(isNaN(+l)){if(s)return"-"}else return Zp(l,n,r)}if(t==="ordinal")return y0(e)?i(e):rt(e)&&a(e)?e+"":"-";var u=Xa(e);return a(u)?EA(u):y0(e)?i(e):typeof e=="boolean"?e+"":"-"}var uD=["a","b","c","d","e","f","g"],Db=function(e,t){return"{"+e+(t??"")+"}"};function RA(e,t,r){re(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 rQ(e,t,r){(e==="week"||e==="month"||e==="quarter"||e==="half-year"||e==="year")&&(e=`MM-dd -yyyy`);var n=to(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"](),h=n[i+"Milliseconds"]();return e=e.replace("MM",_n(o,2)).replace("M",o).replace("yyyy",a).replace("yy",_n(a%100+"",2)).replace("dd",_n(s,2)).replace("d",s).replace("hh",_n(l,2)).replace("h",l).replace("mm",_n(u,2)).replace("m",u).replace("ss",_n(c,2)).replace("s",c).replace("SSS",_n(h,3)),e}function nQ(e){return e&&e.charAt(0).toUpperCase()+e.substr(1)}function Vu(e,t){return t=t||"transparent",he(e)?e:ke(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function B0(e,t){if(t==="_blank"||t==="blank"){var r=window.open();r.opener=null,r.location.href=e}else window.open(e,t)}var Ey={},Eb={},mf=function(){function e(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return e.prototype.create=function(t,r){this._nonSeriesBoxMasterList=n(Ey),this._normalMasterList=n(Eb);function n(i,a){var o=[];return j(i,function(s,l){var u=s.create(t,r);o=o.concat(u||[])}),o}},e.prototype.update=function(t,r){j(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"){Ey[t]=r;return}Eb[t]=r},e.get=function(t){return Eb[t]||Ey[t]},e}();function iQ(e){return!!Ey[e]}var cT={coord:1,coord2:2};function aQ(e){xV.set(e.fullType,{getCoord2:void 0}).getCoord2=e.getCoord2}var xV=xe();function oQ(e){var t=e.getShallow("coord",!0),r=cT.coord;if(t==null){var n=xV.get(e.type);n&&n.getCoord2&&(r=cT.coord2,t=n.getCoord2(e))}return{coord:t,from:r}}var Da={none:0,dataCoordSys:1,boxCoordSys:2};function bV(e,t){var r=e.getShallow("coordinateSystem"),n=e.getShallow("coordinateSystemUsage",!0),i=Da.none;if(r){var a=e.mainType==="series";n==null&&(n=a?"data":"box"),n==="data"?(i=Da.dataCoordSys,a||(i=Da.none)):n==="box"&&(i=Da.boxCoordSys,!a&&!iQ(r)&&(i=Da.none))}return{coordSysType:r,kind:i}}function $p(e){var t=e.targetModel,r=e.coordSysType,n=e.coordSysProvider,i=e.isDefaultDataCoordSys;e.allowNotFound;var a=bV(t),o=a.kind,s=a.coordSysType;if(i&&o!==Da.dataCoordSys&&(o=Da.dataCoordSys,s=r),o===Da.none||s!==r)return!1;var l=n(r,t);return l?(o===Da.dataCoordSys?t.coordinateSystem=l:t.boxCoordinateSystem=l,!0):!1}var wV=function(e,t){var r=t.getReferringComponents(e,Ht).models[0];return r&&r.coordinateSystem},jy=j,SV=["left","right","top","bottom","width","height"],du=[["width","left","right"],["height","top","bottom"]];function OA(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(),h=t.childAt(u+1),f=h&&h.getBoundingRect(),d,g;if(e==="horizontal"){var m=c.width+(f?-f.x+c.x:0);d=a+m,d>n||l.newline?(a=0,d=m,o+=s+r,s=c.height):s=Math.max(s,c.height)}else{var y=c.height+(f?-f.y+c.y:0);g=o+y,g>i||l.newline?(a+=s+r,o=0,g=y,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=g+r)})}var wu=OA;Fe(OA,"vertical");Fe(OA,"horizontal");function CV(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 sQ(e,t){var r=Tr(e,t,{enableLayoutOnlyByCenter:!0}),n=e.getBoxLayoutParams(),i,a;if(r.type===Zd.point)a=r.refPoint,i=It(n,{width:t.getWidth(),height:t.getHeight()});else{var o=e.get("center"),s=re(o)?o:[o,o];i=It(n,r.refContainer),a=r.boxCoordFrom===cT.coord2?r.refPoint:[ce(s[0],i.width)+i.x,ce(s[1],i.height)+i.y]}return{viewRect:i,center:a}}function TV(e,t){var r=sQ(e,t),n=r.viewRect,i=r.center,a=e.get("radius");re(a)||(a=[0,a]);var o=ce(n.width,t.getWidth()),s=ce(n.height,t.getHeight()),l=Math.min(o,s),u=ce(a[0],l/2),c=ce(a[1],l/2);return{cx:i[0],cy:i[1],r0:u,r:c,viewRect:n}}function It(e,t,r){r=gf(r||0);var n=t.width,i=t.height,a=ce(e.left,n),o=ce(e.top,i),s=ce(e.right,n),l=ce(e.bottom,i),u=ce(e.width,n),c=ce(e.height,i),h=r[2]+r[0],f=r[1]+r[3],d=e.aspect;switch(isNaN(u)&&(u=n-s-f-a),isNaN(c)&&(c=i-l-h-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-f),isNaN(o)&&(o=i-l-c-h),e.left||e.right){case"center":a=n/2-u/2-r[3];break;case"right":a=n-u-f;break}switch(e.top||e.bottom){case"middle":case"center":o=i/2-c/2-r[0];break;case"bottom":o=i-c-h;break}a=a||0,o=o||0,isNaN(u)&&(u=n-f-a-(s||0)),isNaN(c)&&(c=i-h-o-(l||0));var g=new Pe((t.x||0)+a+r[3],(t.y||0)+o+r[0],u,c);return g.margin=r,g}function MV(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=m)return h;for(var y=0;y=0;l--)s=Ge(s,i[l],!0);n.defaultOption=s}return n.defaultOption},t.prototype.getReferringComponents=function(r,n){var i=r+"Index",a=r+"Id";return lf(this.ecModel,r,{index:this.get(i,!0),id:this.get(a,!0)},n)},t.prototype.getBoxLayoutParams=function(){return CV(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}(qe);wF($e,qe);fx($e);zJ($e);BJ($e,cQ);function cQ(e){var t=[];return j($e.getClassesByMainType(e),function(r){t=t.concat(r.dependencies||r.prototype.dependencies||[])}),t=ae(t,function(r){return Ra(r).main}),e!=="dataset"&&Ve(t,"dataset")<=0&&t.unshift("dataset"),t}var K={color:{},darkColor:{},size:{}},er=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)"};Q(er,{primary:er.neutral80,secondary:er.neutral70,tertiary:er.neutral60,quaternary:er.neutral50,disabled:er.neutral20,border:er.neutral30,borderTint:er.neutral20,borderShade:er.neutral40,background:er.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:er.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:er.neutral70,axisLineTint:er.neutral40,axisTick:er.neutral70,axisTickMinor:er.neutral60,axisLabel:er.neutral70,axisSplitLine:er.neutral15,axisMinorSplitLine:er.neutral05});for(var zl in er)if(er.hasOwnProperty(zl)){var cD=er[zl];zl==="theme"?K.darkColor.theme=er.theme.slice():zl==="highlight"?K.darkColor.highlight="rgba(255,231,130,0.4)":zl.indexOf("accent")===0?K.darkColor[zl]=Io(cD,null,function(e){return e*.5},function(e){return Math.min(1,1.3-e)}):K.darkColor[zl]=Io(cD,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 kV="";typeof navigator<"u"&&(kV=navigator.platform||"");var Sc="rgba(0, 0, 0, 0.2)",LV=K.color.theme[0],hQ=Io(LV,null,null,.9);const fQ={darkMode:"auto",colorBy:"series",color:K.color.theme,gradientColor:[hQ,LV],aria:{decal:{decals:[{color:Sc,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Sc,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Sc,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Sc,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Sc,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Sc,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:kV.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 NV=xe(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),si="original",Wr="arrayRows",li="objectRows",va="keyedColumns",Zs="typedArray",PV="unknown",la="column",Qu="row",Zr={Must:1,Might:2,Not:3},IV=Ye();function dQ(e){IV(e).datasetMap=xe()}function DV(e,t,r){var n={},i=BA(t);if(!i||!e)return n;var a=[],o=[],s=t.ecModel,l=IV(s).datasetMap,u=i.uid+"_"+r.seriesLayoutBy,c,h;e=e.slice(),j(e,function(m,y){var _=ke(m)?m:e[y]={name:m};_.type==="ordinal"&&c==null&&(c=y,h=g(_)),n[_.name]=[]});var f=l.get(u)||l.set(u,{categoryWayDim:h,valueWayDim:0});j(e,function(m,y){var _=m.name,x=g(m);if(c==null){var w=f.valueWayDim;d(n[_],w,x),d(o,w,x),f.valueWayDim+=x}else if(c===y)d(n[_],0,x),d(a,0,x);else{var w=f.categoryWayDim;d(n[_],w,x),d(o,w,x),f.categoryWayDim+=x}});function d(m,y,_){for(var x=0;x<_;x++)m.push(y+x)}function g(m){var y=m.dimsDef;return y?y.length:1}return a.length&&(n.itemName=a),o.length&&(n.seriesName=o),n}function zA(e,t,r){var n={},i=BA(e);if(!i)return n;var a=t.sourceFormat,o=t.dimensionsDefine,s;(a===li||a===va)&&j(o,function(c,h){(ke(c)?c.name:c)==="name"&&(s=h)});var l=function(){for(var c={},h={},f=[],d=0,g=Math.min(5,r);dt)return e[n];return e[r-1]}function RV(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:yQ(n,o);if(c=c||r,!(!c||!c.length)){var h=c[l];return i&&(u[i]=h),s.paletteIdx=(l+1)%c.length,h}}function _Q(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}var gm,hd,fD,dD="\0_ec_inner",xQ=1,VA=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 qe(a),this._locale=new qe(o),this._optionManager=s},t.prototype.setOption=function(r,n,i){var a=gD(n);this._optionManager.setOption(r,i,a),this._resetOption(null,a)},t.prototype.resetOption=function(r,n){return this._resetOption(r,gD(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"?fD(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&&j(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=xe(),u=n&&n.replaceMergeMainTypeMap;dQ(this),j(r,function(h,f){h!=null&&($e.hasClass(f)?f&&(s.push(f),l.set(f,!0)):i[f]=i[f]==null?Se(h):Ge(i[f],h,!0))}),u&&u.each(function(h,f){$e.hasClass(f)&&!l.get(f)&&(s.push(f),l.set(f,!0))}),$e.topologicalTravel(s,$e.getAllClassMainTypes(),c,this);function c(h){var f=gQ(this,h,Tt(r[h])),d=a.get(h),g=d?u&&u.get(h)?"replaceMerge":"normalMerge":"replaceAll",m=mF(d,f,g);jq(m,h,$e),i[h]=null,a.set(h,null),o.set(h,0);var y=[],_=[],x=0,w;j(m,function(S,T){var M=S.existing,A=S.newOption;if(!A)M&&(M.mergeOption({},this),M.optionUpdated({},!1));else{var P=h==="series",I=$e.getClass(h,S.keyInfo.subType,!P);if(!I)return;if(h==="tooltip"){if(w)return;w=!0}if(M&&M.constructor===I)M.name=S.keyInfo.name,M.mergeOption(A,this),M.optionUpdated(A,!1);else{var N=Q({componentIndex:T},S.keyInfo);M=new I(A,this,this,N),Q(M,N),S.brandNew&&(M.__requireNewView=!0),M.init(A,this,this),M.optionUpdated(null,!0)}}M?(y.push(M.option),_.push(M),x++):(y.push(void 0),_.push(void 0))},this),i[h]=y,a.set(h,_),o.set(h,x),h==="series"&&gm(this)}this._seriesIndices||gm(this)},t.prototype.getOption=function(){var r=Se(this.option);return j(r,function(n,i){if($e.hasClass(i)){for(var a=Tt(n),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!tp(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,r[i]=a}}),delete r[dD],r},t.prototype.setTheme=function(r){this._theme=new qe(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 LQ(e,t){return e.join(",")===t.join(",")}var Zi=j,sp=ke,mD=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function jb(e){var t=e&&e.itemStyle;if(t)for(var r=0,n=mD.length;r0?r[o-1].seriesModel:null)}),zQ(r)}})}function zQ(e){j(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,h){var f=o.get(t.stackedDimension,h);if(isNaN(f))return i;var d,g;s?g=o.getRawIndex(h):d=o.get(t.stackedByDimension,h);for(var m=NaN,y=r-1;y>=0;y--){var _=e[y];if(s||(g=_.data.rawIndexOf(_.stackedByDimension,d)),g>=0){var x=_.data.getByRawIndex(_.stackResultDimension,g);if(l==="all"||l==="positive"&&x>0||l==="negative"&&x<0||l==="samesign"&&f>=0&&x>0||l==="samesign"&&f<=0&&x<0){f=wq(f,x),m=x;break}}}return n[0]=f,n[1]=m,n})})}var Tx=function(){function e(t){this.data=t.data||(t.sourceFormat===va?{}:[]),this.sourceFormat=t.sourceFormat||PV,this.seriesLayoutBy=t.seriesLayoutBy||la,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;nm&&(m=w)}d[0]=g,d[1]=m}},i=function(){return this._data?this._data.length/this._dimSize:0};CD=(t={},t[Wr+"_"+la]={pure:!0,appendData:a},t[Wr+"_"+Qu]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},t[li]={pure:!0,appendData:a},t[va]={pure:!0,appendData:function(o){var s=this._data;j(o,function(l,u){for(var c=s[u]||(s[u]=[]),h=0;h<(l||[]).length;h++)c.push(l[h])})}},t[si]={appendData:a},t[Zs]={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&&(m=o.interpolatedValue[y])}return m!=null?m+"":""})}},e.prototype.getRawValue=function(t,r){return Vh(this.getData(r),t)},e.prototype.formatTooltip=function(t,r,n){},e}();function kD(e){var t,r;return ke(e)?e.type&&(r=e):t=e,{text:t,frag:r}}function bv(e){return new ZQ(e)}var ZQ=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 h;(this._dirty||a==="reset")&&(this._dirty=!1,h=this._doReset(n)),this._modBy=l,this._modDataCount=u;var f=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,g=Math.min(f!=null?this._dueIndex+f:1/0,this._dueEnd);if(!n&&(h||d1&&n>0?s:o}};return a;function o(){return t=e?null:lt},gte:function(e,t){return e>=t}},YQ=function(){function e(t,r){if(!rt(r)){var n="";ft(n)}this._opFn=$V[t],this._rvalFloat=Xa(r)}return e.prototype.evaluate=function(t){return rt(t)?this._opFn(t,this._rvalFloat):this._opFn(Xa(t),this._rvalFloat)},e}(),YV=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=rt(t)?t:Xa(t),i=rt(r)?r:Xa(r),a=isNaN(n),o=isNaN(i);if(a&&(n=this._incomparable),o&&(i=this._incomparable),a&&o){var s=he(t),l=he(r);s&&(n=l?t:0),l&&(i=s?r:0)}return ni?-this._resultLT:0},e}(),XQ=function(){function e(t,r){this._rval=r,this._isEQ=t,this._rvalTypeof=typeof r,this._rvalFloat=Xa(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=Xa(t)===this._rvalFloat)}return this._isEQ?r:!r},e}();function qQ(e,t){return e==="eq"||e==="ne"?new XQ(e==="eq",t):ge($V,e)?new YQ(e,t):null}var KQ=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 $s(t,r)},e}();function JQ(e,t){var r=new KQ,n=e.data,i=r.sourceFormat=e.sourceFormat,a=e.startIndex,o="";e.seriesLayoutBy!==la&&ft(o);var s=[],l={},u=e.dimensionsDefine;if(u)j(u,function(m,y){var _=m.name,x={index:y,name:_,displayName:m.displayName};if(s.push(x),_!=null){var w="";ge(l,_)&&ft(w),l[_]=x}});else for(var c=0;c65535?oee:see}function Tc(){return[1/0,-1/0]}function lee(e){var t=e.constructor;return t===Array?e.slice():new t(e)}function PD(e,t,r,n,i){var a=KV[r||"float"];if(i){var o=e[t],s=o&&o.length;if(s!==n){for(var l=new a(n),u=0;uy[1]&&(y[1]=m)}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=ae(o,function(x){return x.property}),c=0;c_[1]&&(_[1]=y)}}!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=h&&x<=f||isNaN(x))&&(l[u++]=m),m++}g=!0}else if(a===2){for(var y=d[i[0]],w=d[i[1]],S=t[i[1]][0],T=t[i[1]][1],_=0;_=h&&x<=f||isNaN(x))&&(M>=S&&M<=T||isNaN(M))&&(l[u++]=m),m++}g=!0}}if(!g)if(a===1)for(var _=0;_=h&&x<=f||isNaN(x))&&(l[u++]=A)}else for(var _=0;_t[N][1])&&(P=!1)}P&&(l[u++]=r.getRawIndex(_))}return u_[1]&&(_[1]=y)}}}},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,h,f,d=new(Cc(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));d[s++]=u;for(var g=1;gc&&(c=h,f=S)}D>0&&Ds&&(m=s-c);for(var y=0;yg&&(g=x,d=c+y)}var w=this.getRawIndex(h),S=this.getRawIndex(d);hc-g&&(l=c-g,s.length=l);for(var m=0;mh[1]&&(h[1]=_),f[d++]=x}return a._count=d,a._indices=f,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=h)}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 $s(r[a],this._dimensions[a])}zb={arrayRows:t,objectRows:function(r,n,i,a){return $s(r[n],this._dimensions[a])},keyedColumns:t,original:function(r,n,i,a){var o=r&&(r.value==null?r:r.value);return $s(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(r,n,i,a){return r[a]}}}(),e}(),JV=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(ym(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=Sn(s)?Zs:si,a=[];var h=this._getSourceMetaRawOption()||{},f=u&&u.metaRawOption||{},d=be(h.seriesLayoutBy,f.seriesLayoutBy)||null,g=be(h.sourceHeader,f.sourceHeader),m=be(h.dimensions,f.dimensions),y=d!==f.seriesLayoutBy||!!g!=!!f.sourceHeader||m;i=y?[dT(s,{seriesLayoutBy:d,sourceHeader:g,dimensions:m},l)]:[]}else{var _=t;if(n){var x=this._applyTransform(r);i=x.sourceList,a=x.upstreamSignList}else{var w=_.get("source",!0);i=[dT(w,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&&DD(a)}var o,s=[],l=[];return j(t,function(u){u.prepareSource();var c=u.getSource(i||0),h="";i!=null&&!c&&DD(h),s.push(c),l.push(u._getVersionSign())}),n?o=iee(n,s,{datasetIndex:r.componentIndex}):i!=null&&(o=[BQ(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 sK=Ei(",&?/;] ".split(""),function(e,t){return e[t]=!0,e},{});function lK(e){return oK(e)?!!sK[e]:!0}function MF(e,t,r,n,i){for(var a=[],o=[],s="",l="",u=0,c=0,h=Wa(t),f=0;fr:i+c+g>r){c?(s||l)&&(m?(s||(s=l,l="",u=0,c=u),a.push(s),o.push(c-u),l+=d,u+=g,s="",c=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(c),s=d,c=g)):m?(a.push(l),o.push(u),l=d,u=g):(a.push(d),o.push(g));continue}c+=g,m?(l+=d,u+=g):(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 SI(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;Pe.set(CI,Rh(r,o,i),xu(n,s,a),o,s),Pe.intersect(t,CI,null,TI);var l=TI.outIntersectRect;e.outerWidth=l.width,e.outerHeight=l.height,e.baseX=Rh(l.x,l.width,i,!0),e.baseY=xu(l.y,l.height,a,!0)}}var CI=new Pe(0,0,0,0),TI={outIntersectRect:{},clamp:!0};function sA(e){return e!=null?e+="":e=""}function uK(e){var t=sA(e.text),r=e.font,n=Ha(Wa(r),t),i=Fp(r);return YC(e,n,i,null)}function YC(e,t,r,n){var i=new Pe(Rh(e.x||0,t,e.textAlign),xu(e.y||0,r,e.textBaseline),t,r),a=n??(AF(e)?e.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function AF(e){var t=e.stroke;return t!=null&&t!=="none"&&e.lineWidth>0}var XC="__zr_style_"+Math.round(Math.random()*10),_u={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},p_={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};_u[XC]=!0;var MI=["z","z2","invisible"],cK=["invisible"],Ri=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype._init=function(r){for(var n=Qe(r),i=0;i1e-4){s[0]=e-r,s[1]=t-n,l[0]=e+r,l[1]=t+n;return}if(am[0]=xb(i)*r+e,am[1]=yb(i)*n+t,om[0]=xb(a)*r+e,om[1]=yb(a)*n+t,u(s,am,om),c(l,am,om),i=i%Ll,i<0&&(i=i+Ll),a=a%Ll,a<0&&(a=a+Ll),i>a&&!o?a+=Ll:ii&&(sm[0]=xb(d)*r+e,sm[1]=yb(d)*n+t,u(s,sm,s),c(l,sm,l))}var At={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Nl=[],Pl=[],_a=[],ns=[],ba=[],wa=[],_b=Math.min,bb=Math.max,Il=Math.cos,Dl=Math.sin,fo=Math.abs,qC=Math.PI,ds=qC*2,wb=typeof Float32Array<"u",ld=[];function Sb(e){var t=Math.round(e/qC*1e8)/1e8;return t%2*qC}function m_(e,t){var r=Sb(e[0]);r<0&&(r+=ds);var n=r-e[0],i=e[1];i+=n,!t&&i-r>=ds?i=r+ds:t&&r-i>=ds?i=r-ds:!t&&r>i?i=r+(ds-Sb(r-i)):t&&r0&&(this._ux=fo(n/k0/t)||0,this._uy=fo(n/k0/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(At.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=fo(t-this._xi),i=fo(r-this._yi),a=n>this._ux||i>this._uy;if(this.addData(At.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(At.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(At.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(),ld[0]=i,ld[1]=a,m_(ld,o),i=ld[0],a=ld[1];var s=a-i;return this.addData(At.A,t,r,n,n,i,s,0,o?0:1),this._ctx&&this._ctx.arc(t,r,n,i,a,o),this._xi=Il(a)*n+t,this._yi=Dl(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(At.R,t,r,n,i),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(At.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)&&wb&&(this.data=new Float32Array(r));for(var n=0;n0&&o))for(var s=0;sc.length&&(this._expandData(),c=this.data);for(var h=0;h0&&(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(){_a[0]=_a[1]=ba[0]=ba[1]=Number.MAX_VALUE,ns[0]=ns[1]=wa[0]=wa[1]=-Number.MAX_VALUE;var t=this.data,r=0,n=0,i=0,a=0,o;for(o=0;on||fo(w)>i||f===r-1)&&(m=Math.sqrt(_*_+w*w),a=y,o=x);break}case At.C:{var S=t[f++],T=t[f++],y=t[f++],x=t[f++],M=t[f++],A=t[f++];m=CX(a,o,S,T,y,x,M,A,10),a=M,o=A;break}case At.Q:{var S=t[f++],T=t[f++],y=t[f++],x=t[f++];m=MX(a,o,S,T,y,x,10),a=y,o=x;break}case At.A:var P=t[f++],I=t[f++],N=t[f++],D=t[f++],O=t[f++],R=t[f++],F=R+O;f+=1,g&&(s=Il(O)*N+P,l=Dl(O)*D+I),m=bb(N,D)*_b(ds,Math.abs(R)),a=Il(F)*N+P,o=Dl(F)*D+I;break;case At.R:{s=a=t[f++],l=o=t[f++];var H=t[f++],W=t[f++];m=H*2+W*2;break}case At.Z:{var _=s-a,w=l-o;m=Math.sqrt(_*_+w*w),a=s,o=l;break}}m>=0&&(u[h++]=m,c+=m)}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,h,f,d=r<1,g,m,y=0,x=0,_,w=0,S,T;if(!(d&&(this._pathSegLen||this._calculateLength(),g=this._pathSegLen,m=this._pathLen,_=r*m,!_)))e:for(var M=0;M0&&(t.lineTo(S,T),w=0),A){case At.M:s=u=n[M++],l=c=n[M++],t.moveTo(u,c);break;case At.L:{h=n[M++],f=n[M++];var I=fo(h-u),N=fo(f-c);if(I>i||N>a){if(d){var D=g[x++];if(y+D>_){var O=(_-y)/D;t.lineTo(u*(1-O)+h*O,c*(1-O)+f*O);break e}y+=D}t.lineTo(h,f),u=h,c=f,w=0}else{var R=I*I+N*N;R>w&&(S=h,T=f,w=R)}break}case At.C:{var F=n[M++],H=n[M++],W=n[M++],V=n[M++],z=n[M++],Z=n[M++];if(d){var D=g[x++];if(y+D>_){var O=(_-y)/D;Qs(u,F,W,z,O,Nl),Qs(c,H,V,Z,O,Pl),t.bezierCurveTo(Nl[1],Pl[1],Nl[2],Pl[2],Nl[3],Pl[3]);break e}y+=D}t.bezierCurveTo(F,H,W,V,z,Z),u=z,c=Z;break}case At.Q:{var F=n[M++],H=n[M++],W=n[M++],V=n[M++];if(d){var D=g[x++];if(y+D>_){var O=(_-y)/D;qv(u,F,W,O,Nl),qv(c,H,V,O,Pl),t.quadraticCurveTo(Nl[1],Pl[1],Nl[2],Pl[2]);break e}y+=D}t.quadraticCurveTo(F,H,W,V),u=W,c=V;break}case At.A:var U=n[M++],$=n[M++],Y=n[M++],te=n[M++],ie=n[M++],se=n[M++],le=n[M++],Ee=!n[M++],me=Y>te?Y:te,ye=fo(Y-te)>.001,Me=ie+se,pe=!1;if(d){var D=g[x++];y+D>_&&(Me=ie+se*(_-y)/D,pe=!0),y+=D}if(ye&&t.ellipse?t.ellipse(U,$,Y,te,le,ie,Me,Ee):t.arc(U,$,me,ie,Me,Ee),pe)break e;P&&(s=Il(ie)*Y+U,l=Dl(ie)*te+$),u=Il(Me)*Y+U,c=Dl(Me)*te+$;break;case At.R:s=u=n[M],l=c=n[M+1],h=n[M++],f=n[M++];var Te=n[M++],st=n[M++];if(d){var D=g[x++];if(y+D>_){var ze=_-y;t.moveTo(h,f),t.lineTo(h+_b(ze,Te),f),ze-=Te,ze>0&&t.lineTo(h+Te,f+_b(ze,st)),ze-=st,ze>0&&t.lineTo(h+bb(Te-ze,0),f+st),ze-=Te,ze>0&&t.lineTo(h,f+bb(st-ze,0));break e}y+=D}t.rect(h,f,Te,st);break;case At.Z:if(d){var D=g[x++];if(y+D>_){var O=(_-y)/D;t.lineTo(u*(1-O)+s*O,c*(1-O)+l*O);break e}y+=D}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=At,e.initDefaultProps=function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0}(),e}();function ms(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+h&&c>n+h&&c>a+h&&c>s+h||ce+h&&u>r+h&&u>i+h&&u>o+h||ut+u&&l>n+u&&l>a+u||le+u&&s>r+u&&s>i+u||sr||c+ui&&(i+=ud);var f=Math.atan2(l,s);return f<0&&(f+=ud),f>=n&&f<=i||f+ud>=n&&f+ud<=i}function _o(e,t,r,n,i,a){if(a>t&&a>n||ai?s:0}var is=qa.CMD,El=Math.PI*2,mK=1e-4;function yK(e,t){return Math.abs(e-t)t&&u>n&&u>a&&u>s||u1&&xK(),d=kr(t,n,a,s,xi[0]),f>1&&(g=kr(t,n,a,s,xi[1]))),f===2?yt&&s>n&&s>a||s=0&&u<=1){for(var c=0,h=Br(t,n,a,u),f=0;fr||s<-r)return 0;var l=Math.sqrt(r*r-s*s);yn[0]=-l,yn[1]=l;var u=Math.abs(n-i);if(u<1e-4)return 0;if(u>=El-1e-4){n=0,i=El;var c=a?1:-1;return o>=yn[0]+e&&o<=yn[1]+e?c:0}if(n>i){var h=n;n=i,i=h}n<0&&(n+=El,i+=El);for(var f=0,d=0;d<2;d++){var g=yn[d];if(g+e>o){var m=Math.atan2(s,g),c=a?1:-1;m<0&&(m=El+m),(m>=n&&m<=i||m+El>=n&&m+El<=i)&&(m>Math.PI/2&&m1&&(r||(s+=_o(l,u,c,h,n,i))),y&&(l=a[g],u=a[g+1],c=l,h=u),m){case is.M:c=a[g++],h=a[g++],l=c,u=h;break;case is.L:if(r){if(ms(l,u,a[g],a[g+1],t,n,i))return!0}else s+=_o(l,u,a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case is.C:if(r){if(pK(l,u,a[g++],a[g++],a[g++],a[g++],a[g],a[g+1],t,n,i))return!0}else s+=_K(l,u,a[g++],a[g++],a[g++],a[g++],a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case is.Q:if(r){if(kF(l,u,a[g++],a[g++],a[g],a[g+1],t,n,i))return!0}else s+=bK(l,u,a[g++],a[g++],a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case is.A:var x=a[g++],_=a[g++],w=a[g++],S=a[g++],T=a[g++],M=a[g++];g+=1;var A=!!(1-a[g++]);f=Math.cos(T)*w+x,d=Math.sin(T)*S+_,y?(c=f,h=d):s+=_o(l,u,f,d,n,i);var P=(n-x)*S/w+x;if(r){if(gK(x,_,S,T,T+M,A,t,P,i))return!0}else s+=wK(x,_,S,T,T+M,A,P,i);l=Math.cos(T+M)*w+x,u=Math.sin(T+M)*S+_;break;case is.R:c=l=a[g++],h=u=a[g++];var I=a[g++],N=a[g++];if(f=c+I,d=h+N,r){if(ms(c,h,f,h,t,n,i)||ms(f,h,f,d,t,n,i)||ms(f,d,c,d,t,n,i)||ms(c,d,c,h,t,n,i))return!0}else s+=_o(f,h,f,d,n,i),s+=_o(c,d,c,h,n,i);break;case is.Z:if(r){if(ms(l,u,c,h,t,n,i))return!0}else s+=_o(l,u,c,h,n,i);l=c,u=h;break}}return!r&&!yK(u,h)&&(s+=_o(l,u,c,h,n,i)||0),s!==0}function SK(e,t,r){return LF(e,0,!1,t,r)}function CK(e,t,r,n){return LF(e,t,!0,r,n)}var I0=Ae({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},_u),TK={style:Ae({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},p_.style)},Cb=Ya.concat(["invisible","culling","z","z2","zlevel","parent"]),Ke=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?FC:n>.2?nq:VC}else if(r)return VC}return FC},t.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if(he(n)){var i=this.__zr,a=!!(i&&i.isDarkMode()),o=Qv(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&Wc)&&(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)),CK(s,l/u,r,n)))return!0}if(this.hasFill())return SK(s,r,n)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=Wc,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:Q(i,r),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&Wc)},t.prototype.createStyle=function(r){return Op(I0,r)},t.prototype._innerSaveToNormal=function(r){e.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.shape&&!n.shape&&(n.shape=Q({},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=Q({},i.shape),Q(u,n.shape)):(u=Q({},a?this.shape:i.shape),Q(u,n.shape)):l&&(u=i.shape),u)if(o){this.shape=Q({},this.shape);for(var c={},h=Qe(u),f=0;fi&&(h=s+l,s*=i/h,l*=i/h),u+c>i&&(h=u+c,u*=i/h,c*=i/h),l+u>a&&(h=l+u,l*=a/h,u*=a/h),s+c>a&&(h=s+c,s*=a/h,c*=a/h),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 sh=Math.round;function y_(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&&(sh(n*2)===sh(i*2)&&(e.x1=e.x2=ti(n,s,!0)),sh(a*2)===sh(o*2)&&(e.y1=e.y2=ti(a,s,!0))),e}}function NF(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=ti(n,s,!0),e.y=ti(i,s,!0),e.width=Math.max(ti(n+a,s,!1)-e.x,a===0?0:1),e.height=Math.max(ti(i+o,s,!1)-e.y,o===0?0:1)),e}}function ti(e,t,r){if(!t)return e;var n=sh(e*2);return(n+sh(t))%2===0?n/2:(n+(r?1:-1))/2}var PK=function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e}(),IK={},Ze=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new PK},t.prototype.buildPath=function(r,n){var i,a,o,s;if(this.subPixelOptimize){var l=NF(IK,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?NK(r,n):r.rect(i,a,o,s)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(Ke);Ze.prototype.type="rect";var PI={fill:"#000"},II=2,Sa={},DK={style:Ae({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},p_.style)},tt=function(e){q(t,e);function t(r){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=PI,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,O=0;O=0&&(F=M[R],F.align==="right");)this._placeToken(F,r,P,x,O,"right",w),I-=F.width,O-=F.width,R--;for(D+=(c-(D-y)-(_-O)-I)/2;N<=R;)F=M[N],this._placeToken(F,r,P,x,D+F.width/2,"center",w),D+=F.width,N++;x+=P}},t.prototype._placeToken=function(r,n,i,a,o,s,l){var u=n.rich[r.styleName]||{};u.text=r.text;var c=r.verticalAlign,h=a+i/2;c==="top"?h=a+r.height/2:c==="bottom"&&(h=a+i-r.height/2);var f=!r.isLineHolder&&Tb(u);f&&this._renderBackground(u,n,s==="right"?o-r.width:s==="center"?o-r.width/2:o,h-r.height/2,r.width,r.height);var d=!!u.backgroundColor,g=r.textPadding;g&&(o=zI(o,s,g),h-=r.height/2-g[0]-r.innerHeight/2);var m=this._getOrCreateChild(zh),y=m.createStyle();m.useStyle(y);var x=this._defaultStyle,_=!1,w=0,S=!1,T=OI("fill"in u?u.fill:"fill"in n?n.fill:(_=!0,x.fill)),M=RI("stroke"in u?u.stroke:"stroke"in n?n.stroke:!d&&!l&&(!x.autoStroke||_)?(w=II,S=!0,x.stroke):null),A=u.textShadowBlur>0||n.textShadowBlur>0;y.text=r.text,y.x=o,y.y=h,A&&(y.shadowBlur=u.textShadowBlur||n.textShadowBlur||0,y.shadowColor=u.textShadowColor||n.textShadowColor||"transparent",y.shadowOffsetX=u.textShadowOffsetX||n.textShadowOffsetX||0,y.shadowOffsetY=u.textShadowOffsetY||n.textShadowOffsetY||0),y.textAlign=s,y.textBaseline="middle",y.font=r.font||Go,y.opacity=zn(u.opacity,n.opacity,1),EI(y,u),M&&(y.lineWidth=zn(u.lineWidth,n.lineWidth,w),y.lineDash=be(u.lineDash,n.lineDash),y.lineDashOffset=n.lineDashOffset||0,y.stroke=M),T&&(y.fill=T),m.setBoundingRect(YC(y,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,h=l&&l.image,f=l&&!h,d=r.borderRadius,g=this,m,y;if(f||r.lineHeight||u&&c){m=this._getOrCreateChild(Ze),m.useStyle(m.createStyle()),m.style.fill=null;var x=m.shape;x.x=i,x.y=a,x.width=o,x.height=s,x.r=d,m.dirtyShape()}if(f){var _=m.style;_.fill=l||null,_.fillOpacity=be(r.fillOpacity,1)}else if(h){y=this._getOrCreateChild(Er),y.onload=function(){g.dirtyStyle()};var w=y.style;w.image=l.image,w.x=i,w.y=a,w.width=o,w.height=s}if(u&&c){var _=m.style;_.lineWidth=u,_.stroke=c,_.strokeOpacity=be(r.strokeOpacity,1),_.lineDash=r.borderDash,_.lineDashOffset=r.borderDashOffset||0,m.strokeContainThreshold=0,m.hasFill()&&m.hasStroke()&&(_.strokeFirst=!0,_.lineWidth*=2)}var S=(m||y).style;S.shadowBlur=r.shadowBlur||0,S.shadowColor=r.shadowColor||"transparent",S.shadowOffsetX=r.shadowOffsetX||0,S.shadowOffsetY=r.shadowOffsetY||0,S.opacity=zn(r.opacity,n.opacity,1)},t.makeFont=function(r){var n="";return IF(r)&&(n=[r.fontStyle,r.fontWeight,PF(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&Jn(n)||r.textFont||r.font},t}(Ri),EK={left:!0,right:1,center:1},jK={top:1,bottom:1,middle:1},DI=["fontStyle","fontWeight","fontSize","fontFamily"];function PF(e){return typeof e=="string"&&(e.indexOf("px")!==-1||e.indexOf("rem")!==-1||e.indexOf("em")!==-1)?e:isNaN(+e)?VM+"px":e+"px"}function EI(e,t){for(var r=0;r=0,a=!1;if(e instanceof Ke){var o=DF(e),s=i&&o.selectFill||o.normalFill,l=i&&o.selectStroke||o.normalStroke;if(_c(s)||_c(l)){n=n||{};var u=n.style||{};u.fill==="inherit"?(a=!0,n=Q({},n),u=Q({},u),u.fill=s):!_c(u.fill)&&_c(s)?(a=!0,n=Q({},n),u=Q({},u),u.fill=M0(s)):!_c(u.stroke)&&_c(l)&&(a||(n=Q({},n),u=Q({},u)),u.stroke=M0(l)),n.style=u}}if(n&&n.z2==null){a||(n=Q({},n));var c=e.z2EmphasisLift;n.z2=e.z2+(c??uf)}return n}function GK(e,t,r){if(r&&r.z2==null){r=Q({},r);var n=e.z2SelectLift;r.z2=e.z2+(n??OK)}return r}function WK(e,t,r){var n=Ve(e.currentStates,t)>=0,i=e.style.opacity,a=n?null:FK(e,["opacity"],t,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=Q({},r),o=Q({opacity:n?i:a.opacity*.1},o),r.style=o),r}function Mb(e,t){var r=this.states[e];if(this.style){if(e==="emphasis")return VK(this,e,t,r);if(e==="blur")return WK(this,e,r);if(e==="select")return GK(this,e,r)}return r}function zu(e){e.stateProxy=Mb;var t=e.getTextContent(),r=e.getTextGuideLine();t&&(t.stateProxy=Mb),r&&(r.stateProxy=Mb)}function WI(e,t){!FF(e,t)&&!e.__highByOuter&&Jo(e,EF)}function HI(e,t){!FF(e,t)&&!e.__highByOuter&&Jo(e,jF)}function Ho(e,t){e.__highByOuter|=1<<(t||0),Jo(e,EF)}function Uo(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&Jo(e,jF)}function OF(e){Jo(e,hA)}function fA(e){Jo(e,RF)}function zF(e){Jo(e,zK)}function BF(e){Jo(e,BK)}function FF(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function VF(e){var t=e.getModel(),r=[],n=[];t.eachComponent(function(i,a){var o=lA(a),s=i==="series",l=s?e.getViewOfSeriesModel(a):e.getViewOfComponentModel(a);!s&&n.push(l),o.isBlured&&(l.group.traverse(function(u){RF(u)}),s&&r.push(a)),o.isBlured=!1}),j(n,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(r,!1,t)})}function QC(e,t,r,n){var i=n.getModel();r=r||"coordinateSystem";function a(u,c){for(var h=0;h0){var s={dataIndex:o,seriesIndex:r.seriesIndex};a!=null&&(s.dataType=a),t.push(s)}})}),t}function Hs(e,t,r){fu(e,!0),Jo(e,zu),tT(e,t,r)}function XK(e){fu(e,!1)}function Dt(e,t,r,n){n?XK(e):Hs(e,t,r)}function tT(e,t,r){var n=De(e);t!=null?(n.focus=t,n.blurScope=r):n.focus&&(n.focus=null)}var ZI=["emphasis","blur","select"],qK={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Sr(e,t,r,n){r=r||"itemStyle";for(var i=0;i1&&(o*=Ab(g),s*=Ab(g));var m=(i===a?-1:1)*Ab((o*o*(s*s)-o*o*(d*d)-s*s*(f*f))/(o*o*(d*d)+s*s*(f*f)))||0,y=m*o*d/s,x=m*-s*f/o,_=(e+r)/2+um(h)*y-lm(h)*x,w=(t+n)/2+lm(h)*y+um(h)*x,S=qI([1,0],[(f-y)/o,(d-x)/s]),T=[(f-y)/o,(d-x)/s],M=[(-1*f-y)/o,(-1*d-x)/s],A=qI(T,M);if(nT(T,M)<=-1&&(A=cd),nT(T,M)>=1&&(A=0),A<0){var P=Math.round(A/cd*1e6)/1e6;A=cd*2+P%2*cd}c.addData(u,_,w,o,s,S,A,h,a)}var rJ=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,nJ=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function iJ(e){var t=new qa;if(!e)return t;var r=0,n=0,i=r,a=n,o,s=qa.CMD,l=e.match(rJ);if(!l)return t;for(var u=0;uF*F+H*H&&(P=N,I=D),{cx:P,cy:I,x0:-c,y0:-h,x1:P*(i/T-1),y1:I*(i/T-1)}}function hJ(e){var t;if(re(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 fJ(e,t){var r,n=Hd(t.r,0),i=Hd(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,h=t.cy,f=!!t.clockwise,d=JI(u-l),g=d>kb&&d%kb;if(g>Yi&&(d=g),!(n>Yi))e.moveTo(c,h);else if(d>kb-Yi)e.moveTo(c+n*wc(l),h+n*jl(l)),e.arc(c,h,n,l,u,!f),i>Yi&&(e.moveTo(c+i*wc(u),h+i*jl(u)),e.arc(c,h,i,u,l,f));else{var m=void 0,y=void 0,x=void 0,_=void 0,w=void 0,S=void 0,T=void 0,M=void 0,A=void 0,P=void 0,I=void 0,N=void 0,D=void 0,O=void 0,R=void 0,F=void 0,H=n*wc(l),W=n*jl(l),V=i*wc(u),z=i*jl(u),Z=d>Yi;if(Z){var U=t.cornerRadius;U&&(r=hJ(U),m=r[0],y=r[1],x=r[2],_=r[3]);var $=JI(n-i)/2;if(w=Ca($,x),S=Ca($,_),T=Ca($,m),M=Ca($,y),I=A=Hd(w,S),N=P=Hd(T,M),(A>Yi||P>Yi)&&(D=n*wc(u),O=n*jl(u),R=i*wc(l),F=i*jl(l),d<$F)){var Y=cJ(H,W,R,F,D,O,V,z);if(Y){var te=H-Y[0],ie=W-Y[1],se=D-Y[0],le=O-Y[1],Ee=1/jl(uJ((te*se+ie*le)/(yv(te*te+ie*ie)*yv(se*se+le*le)))/2),me=yv(Y[0]*Y[0]+Y[1]*Y[1]);I=Ca(A,(n-me)/(Ee+1)),N=Ca(P,(i-me)/(Ee-1))}}}if(!Z)e.moveTo(c+H,h+W);else if(I>Yi){var ye=Ca(x,I),Me=Ca(_,I),pe=cm(R,F,H,W,n,ye,f),Te=cm(D,O,V,z,n,Me,f);e.moveTo(c+pe.cx+pe.x0,h+pe.cy+pe.y0),I0&&e.arc(c+pe.cx,h+pe.cy,ye,on(pe.y0,pe.x0),on(pe.y1,pe.x1),!f),e.arc(c,h,n,on(pe.cy+pe.y1,pe.cx+pe.x1),on(Te.cy+Te.y1,Te.cx+Te.x1),!f),Me>0&&e.arc(c+Te.cx,h+Te.cy,Me,on(Te.y1,Te.x1),on(Te.y0,Te.x0),!f))}else e.moveTo(c+H,h+W),e.arc(c,h,n,l,u,!f);if(!(i>Yi)||!Z)e.lineTo(c+V,h+z);else if(N>Yi){var ye=Ca(m,N),Me=Ca(y,N),pe=cm(V,z,D,O,i,-Me,f),Te=cm(H,W,R,F,i,-ye,f);e.lineTo(c+pe.cx+pe.x0,h+pe.cy+pe.y0),N0&&e.arc(c+pe.cx,h+pe.cy,Me,on(pe.y0,pe.x0),on(pe.y1,pe.x1),!f),e.arc(c,h,i,on(pe.cy+pe.y1,pe.cx+pe.x1),on(Te.cy+Te.y1,Te.cx+Te.x1),f),ye>0&&e.arc(c+Te.cx,h+Te.cy,ye,on(Te.y1,Te.x1),on(Te.y0,Te.x0),!f))}else e.lineTo(c+V,h+z),e.arc(c,h,i,u,l,f)}e.closePath()}}}var dJ=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}(),Qr=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new dJ},t.prototype.buildPath=function(r,n){fJ(r,n)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(Ke);Qr.prototype.type="sector";var vJ=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e}(),cf=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new vJ},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}(Ke);cf.prototype.type="ring";function pJ(e,t,r,n){var i=[],a=[],o=[],s=[],l,u,c,h;if(n){c=[1/0,1/0],h=[-1/0,-1/0];for(var f=0,d=e.length;f=2){if(n){var a=pJ(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,h=i.length;sOl[1]){if(a=!1,Or.negativeSize||n)return a;var l=hm(Ol[0]-Rl[1]),u=hm(Rl[0]-Ol[1]);Lb(l,u)>dm.len()&&(l=u||!Or.bidirectional)&&(Ne.scale(fm,s,-u*i),Or.useDir&&Or.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 h=c.duration,f=c.delay,d=c.easing,g={duration:h,delay:f||0,easing:d,done:a,force:!!a||!!o,setToFinal:!u,scope:e,during:o};s?t.animateFrom(r,g):t.animateTo(r,g)}else t.stopAnimation(),!s&&t.attr(r),o&&o(1),a&&a()}function it(e,t,r,n,i,a){gA("update",e,t,r,n,i,a)}function Nt(e,t,r,n,i,a){gA("enter",e,t,r,n,i,a)}function bh(e){if(!e.__zr)return!0;for(var t=0;tja(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function tD(e){return!e.isGroup}function AJ(e){return e.shape!=null}function Up(e,t,r){if(!e||!t)return;function n(o){var s={};return o.traverse(function(l){tD(l)&&l.anid&&(s[l.anid]=l)}),s}function i(o){var s={x:o.x,y:o.y,rotation:o.rotation};return AJ(o)&&(s.shape=Se(o.shape)),s}var a=n(e);t.traverse(function(o){if(tD(o)&&o.anid){var s=a[o.anid];if(s){var l=i(o);o.attr(i(s)),it(o,l,r,De(o).dataIndex)}}})}function xA(e,t){return ae(e,function(r){var n=r[0];n=nr(n,t.x),n=ni(n,t.x+t.width);var i=r[1];return i=nr(i,t.y),i=ni(i,t.y+t.height),[n,i]})}function rV(e,t){var r=nr(e.x,t.x),n=ni(e.x+e.width,t.x+t.width),i=nr(e.y,t.y),a=ni(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 df(e,t,r){var n=Q({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),Ae(i,r),new Er(n)):Bh(e.replace("path://",""),n,r,"center")}function Ud(e,t,r,n,i){for(var a=0,o=i[i.length-1];a1)return!1;var y=Nb(d,g,c,h)/f;return!(y<0||y>1)}function Nb(e,t,r,n){return e*n-r*t}function kJ(e){return e<=1e-6&&e>=-1e-6}function Bu(e,t,r,n,i){return t==null||(rt(t)?Ot[0]=Ot[1]=Ot[2]=Ot[3]=t:(Ot[0]=t[0],Ot[1]=t[1],Ot[2]=t[2],Ot[3]=t[3]),n&&(Ot[0]=nr(0,Ot[0]),Ot[1]=nr(0,Ot[1]),Ot[2]=nr(0,Ot[2]),Ot[3]=nr(0,Ot[3])),r&&(Ot[0]=-Ot[0],Ot[1]=-Ot[1],Ot[2]=-Ot[2],Ot[3]=-Ot[3]),rD(e,Ot,"x","width",3,1,i&&i[0]||0),rD(e,Ot,"y","height",0,2,i&&i[1]||0)),e}var Ot=[0,0,0,0];function rD(e,t,r,n,i,a,o){var s=t[a]+t[i],l=e[n];e[n]+=s,o=nr(0,ni(o,l)),e[n]=0?-t[i]:t[a]>=0?l+t[a]:ja(s)>1e-8?(l-o)*t[i]/s:0):e[r]-=t[i]}function Qo(e){var t=e.itemTooltipOption,r=e.componentModel,n=e.itemName,i=he(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&&j(Qe(l),function(c){ge(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:Ae({content:n,encodeHTMLContent:!0,formatterParams:s},i)}}function aT(e,t){var r;e.isGroup&&(r=t(e)),r||e.traverse(t)}function hl(e,t){if(e)if(re(e))for(var r=0;rt&&(t=o),ot&&(r=t=0),{min:r,max:t}}function w_(e,t,r){aV(e,t,r,-1/0)}function aV(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 fl(e,t){return Ge(Ge({},e,!0),t,!0)}const FJ={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:". "}}}},VJ={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 O0="ZH",SA="EN",wh=SA,Iy={},CA={},hV=Je.domSupported?function(){var e=(document.documentElement.lang||navigator.language||navigator.browserLanguage||wh).toUpperCase();return e.indexOf(O0)>-1?O0:wh}():wh;function TA(e,t){e=e.toUpperCase(),CA[e]=new qe(t),Iy[e]=t}function GJ(e){if(he(e)){var t=Iy[e.toUpperCase()]||{};return e===O0||e===SA?Se(t):Ge(Se(t),Se(Iy[wh]),!1)}else return Ge(Se(e),Se(Iy[wh]),!1)}function sT(e){return CA[e]}function WJ(){return CA[wh]}TA(SA,FJ);TA(O0,VJ);var lT=null;function HJ(e){lT||(lT=e)}function vr(){return lT}var MA=1e3,AA=MA*60,xv=AA*60,Ti=xv*24,sD=Ti*365,UJ={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})/},Dy={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},ZJ="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}",pm="{yyyy}-{MM}-{dd}",lD={year:"{yyyy}",month:"{yyyy}-{MM}",day:pm,hour:pm+" "+Dy.hour,minute:pm+" "+Dy.minute,second:pm+" "+Dy.second,millisecond:ZJ},$n=["year","month","day","hour","minute","second","millisecond"],$J=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function YJ(e){return!he(e)&&!we(e)?XJ(e):e}function XJ(e){e=e||{};var t={},r=!0;return j($n,function(n){r&&(r=e[n]==null)}),j($n,function(n,i){var a=e[n];t[n]={};for(var o=null,s=i;s>=0;s--){var l=$n[s],u=ke(a)&&!re(a)?a[l]:a,c=void 0;re(u)?(c=u.slice(),o=c[0]||""):he(u)?(o=u,c=[o]):(o==null?o=Dy[n]:UJ[l].test(o)||(o=t[l][l][0]+" "+o),c=[o],r&&(c[1]="{primary|"+o+"}")),t[n][l]=c}}),t}function xn(e,t){return e+="","0000".substr(0,t-e.length)+e}function _v(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 qJ(e){return e===_v(e)}function KJ(e){switch(e){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function Zp(e,t,r,n){var i=to(e),a=i[fV(r)](),o=i[kA(r)]()+1,s=Math.floor((o-1)/3)+1,l=i[LA(r)](),u=i["get"+(r?"UTC":"")+"Day"](),c=i[NA(r)](),h=(c-1)%12+1,f=i[PA(r)](),d=i[IA(r)](),g=i[DA(r)](),m=c>=12?"pm":"am",y=m.toUpperCase(),x=n instanceof qe?n:sT(n||hV)||WJ(),_=x.getModel("time"),w=_.get("month"),S=_.get("monthAbbr"),T=_.get("dayOfWeek"),M=_.get("dayOfWeekAbbr");return(t||"").replace(/{a}/g,m+"").replace(/{A}/g,y+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,xn(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,w[o-1]).replace(/{MMM}/g,S[o-1]).replace(/{MM}/g,xn(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,xn(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,T[u]).replace(/{ee}/g,M[u]).replace(/{e}/g,u+"").replace(/{HH}/g,xn(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,xn(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,xn(f,2)).replace(/{m}/g,f+"").replace(/{ss}/g,xn(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,xn(g,3)).replace(/{S}/g,g+"")}function JJ(e,t,r,n,i){var a=null;if(he(r))a=r;else if(we(r)){var o={time:e.time,level:e.time.level},s=vr();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=uh(e.value,i);a=r[c][c][0]}}return Zp(new Date(e.value),a,i,n)}function uh(e,t){var r=to(e),n=r[kA(t)]()+1,i=r[LA(t)](),a=r[NA(t)](),o=r[PA(t)](),s=r[IA(t)](),l=r[DA(t)](),u=l===0,c=u&&s===0,h=c&&o===0,f=h&&a===0,d=f&&i===1,g=d&&n===1;return g?"year":d?"month":f?"day":h?"hour":c?"minute":u?"second":"millisecond"}function z0(e,t,r){switch(t){case"year":e[dV(r)](0);case"month":e[vV(r)](1);case"day":e[pV(r)](0);case"hour":e[gV(r)](0);case"minute":e[mV(r)](0);case"second":e[yV(r)](0)}return e}function fV(e){return e?"getUTCFullYear":"getFullYear"}function kA(e){return e?"getUTCMonth":"getMonth"}function LA(e){return e?"getUTCDate":"getDate"}function NA(e){return e?"getUTCHours":"getHours"}function PA(e){return e?"getUTCMinutes":"getMinutes"}function IA(e){return e?"getUTCSeconds":"getSeconds"}function DA(e){return e?"getUTCMilliseconds":"getMilliseconds"}function QJ(e){return e?"setUTCFullYear":"setFullYear"}function dV(e){return e?"setUTCMonth":"setMonth"}function vV(e){return e?"setUTCDate":"setDate"}function pV(e){return e?"setUTCHours":"setHours"}function gV(e){return e?"setUTCMinutes":"setMinutes"}function mV(e){return e?"setUTCSeconds":"setSeconds"}function yV(e){return e?"setUTCMilliseconds":"setMilliseconds"}function eQ(e,t,r,n,i,a,o,s){var l=new tt({style:{text:e,font:t,align:r,verticalAlign:n,padding:i,rich:a,overflow:o?"truncate":null,lineHeight:s}});return l.getBoundingRect()}function EA(e){if(!rA(e))return he(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function jA(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 gf=Rp;function uT(e,t,r){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(c){return c&&Jn(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?to(e):e;if(isNaN(+l)){if(s)return"-"}else return Zp(l,n,r)}if(t==="ordinal")return y0(e)?i(e):rt(e)&&a(e)?e+"":"-";var u=Xa(e);return a(u)?EA(u):y0(e)?i(e):typeof e=="boolean"?e+"":"-"}var uD=["a","b","c","d","e","f","g"],Db=function(e,t){return"{"+e+(t??"")+"}"};function RA(e,t,r){re(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 rQ(e,t,r){(e==="week"||e==="month"||e==="quarter"||e==="half-year"||e==="year")&&(e=`MM-dd +yyyy`);var n=to(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"](),h=n[i+"Milliseconds"]();return e=e.replace("MM",xn(o,2)).replace("M",o).replace("yyyy",a).replace("yy",xn(a%100+"",2)).replace("dd",xn(s,2)).replace("d",s).replace("hh",xn(l,2)).replace("h",l).replace("mm",xn(u,2)).replace("m",u).replace("ss",xn(c,2)).replace("s",c).replace("SSS",xn(h,3)),e}function nQ(e){return e&&e.charAt(0).toUpperCase()+e.substr(1)}function Vu(e,t){return t=t||"transparent",he(e)?e:ke(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function B0(e,t){if(t==="_blank"||t==="blank"){var r=window.open();r.opener=null,r.location.href=e}else window.open(e,t)}var Ey={},Eb={},mf=function(){function e(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return e.prototype.create=function(t,r){this._nonSeriesBoxMasterList=n(Ey),this._normalMasterList=n(Eb);function n(i,a){var o=[];return j(i,function(s,l){var u=s.create(t,r);o=o.concat(u||[])}),o}},e.prototype.update=function(t,r){j(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"){Ey[t]=r;return}Eb[t]=r},e.get=function(t){return Eb[t]||Ey[t]},e}();function iQ(e){return!!Ey[e]}var cT={coord:1,coord2:2};function aQ(e){_V.set(e.fullType,{getCoord2:void 0}).getCoord2=e.getCoord2}var _V=_e();function oQ(e){var t=e.getShallow("coord",!0),r=cT.coord;if(t==null){var n=_V.get(e.type);n&&n.getCoord2&&(r=cT.coord2,t=n.getCoord2(e))}return{coord:t,from:r}}var Da={none:0,dataCoordSys:1,boxCoordSys:2};function bV(e,t){var r=e.getShallow("coordinateSystem"),n=e.getShallow("coordinateSystemUsage",!0),i=Da.none;if(r){var a=e.mainType==="series";n==null&&(n=a?"data":"box"),n==="data"?(i=Da.dataCoordSys,a||(i=Da.none)):n==="box"&&(i=Da.boxCoordSys,!a&&!iQ(r)&&(i=Da.none))}return{coordSysType:r,kind:i}}function $p(e){var t=e.targetModel,r=e.coordSysType,n=e.coordSysProvider,i=e.isDefaultDataCoordSys;e.allowNotFound;var a=bV(t),o=a.kind,s=a.coordSysType;if(i&&o!==Da.dataCoordSys&&(o=Da.dataCoordSys,s=r),o===Da.none||s!==r)return!1;var l=n(r,t);return l?(o===Da.dataCoordSys?t.coordinateSystem=l:t.boxCoordinateSystem=l,!0):!1}var wV=function(e,t){var r=t.getReferringComponents(e,Ht).models[0];return r&&r.coordinateSystem},jy=j,SV=["left","right","top","bottom","width","height"],du=[["width","left","right"],["height","top","bottom"]];function OA(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(),h=t.childAt(u+1),f=h&&h.getBoundingRect(),d,g;if(e==="horizontal"){var m=c.width+(f?-f.x+c.x:0);d=a+m,d>n||l.newline?(a=0,d=m,o+=s+r,s=c.height):s=Math.max(s,c.height)}else{var y=c.height+(f?-f.y+c.y:0);g=o+y,g>i||l.newline?(a+=s+r,o=0,g=y,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=g+r)})}var wu=OA;Fe(OA,"vertical");Fe(OA,"horizontal");function CV(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 sQ(e,t){var r=Tr(e,t,{enableLayoutOnlyByCenter:!0}),n=e.getBoxLayoutParams(),i,a;if(r.type===Zd.point)a=r.refPoint,i=It(n,{width:t.getWidth(),height:t.getHeight()});else{var o=e.get("center"),s=re(o)?o:[o,o];i=It(n,r.refContainer),a=r.boxCoordFrom===cT.coord2?r.refPoint:[ce(s[0],i.width)+i.x,ce(s[1],i.height)+i.y]}return{viewRect:i,center:a}}function TV(e,t){var r=sQ(e,t),n=r.viewRect,i=r.center,a=e.get("radius");re(a)||(a=[0,a]);var o=ce(n.width,t.getWidth()),s=ce(n.height,t.getHeight()),l=Math.min(o,s),u=ce(a[0],l/2),c=ce(a[1],l/2);return{cx:i[0],cy:i[1],r0:u,r:c,viewRect:n}}function It(e,t,r){r=gf(r||0);var n=t.width,i=t.height,a=ce(e.left,n),o=ce(e.top,i),s=ce(e.right,n),l=ce(e.bottom,i),u=ce(e.width,n),c=ce(e.height,i),h=r[2]+r[0],f=r[1]+r[3],d=e.aspect;switch(isNaN(u)&&(u=n-s-f-a),isNaN(c)&&(c=i-l-h-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-f),isNaN(o)&&(o=i-l-c-h),e.left||e.right){case"center":a=n/2-u/2-r[3];break;case"right":a=n-u-f;break}switch(e.top||e.bottom){case"middle":case"center":o=i/2-c/2-r[0];break;case"bottom":o=i-c-h;break}a=a||0,o=o||0,isNaN(u)&&(u=n-f-a-(s||0)),isNaN(c)&&(c=i-h-o-(l||0));var g=new Pe((t.x||0)+a+r[3],(t.y||0)+o+r[0],u,c);return g.margin=r,g}function MV(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=m)return h;for(var y=0;y=0;l--)s=Ge(s,i[l],!0);n.defaultOption=s}return n.defaultOption},t.prototype.getReferringComponents=function(r,n){var i=r+"Index",a=r+"Id";return lf(this.ecModel,r,{index:this.get(i,!0),id:this.get(a,!0)},n)},t.prototype.getBoxLayoutParams=function(){return CV(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}(qe);wF($e,qe);d_($e);zJ($e);BJ($e,cQ);function cQ(e){var t=[];return j($e.getClassesByMainType(e),function(r){t=t.concat(r.dependencies||r.prototype.dependencies||[])}),t=ae(t,function(r){return Ra(r).main}),e!=="dataset"&&Ve(t,"dataset")<=0&&t.unshift("dataset"),t}var K={color:{},darkColor:{},size:{}},er=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)"};Q(er,{primary:er.neutral80,secondary:er.neutral70,tertiary:er.neutral60,quaternary:er.neutral50,disabled:er.neutral20,border:er.neutral30,borderTint:er.neutral20,borderShade:er.neutral40,background:er.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:er.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:er.neutral70,axisLineTint:er.neutral40,axisTick:er.neutral70,axisTickMinor:er.neutral60,axisLabel:er.neutral70,axisSplitLine:er.neutral15,axisMinorSplitLine:er.neutral05});for(var zl in er)if(er.hasOwnProperty(zl)){var cD=er[zl];zl==="theme"?K.darkColor.theme=er.theme.slice():zl==="highlight"?K.darkColor.highlight="rgba(255,231,130,0.4)":zl.indexOf("accent")===0?K.darkColor[zl]=Io(cD,null,function(e){return e*.5},function(e){return Math.min(1,1.3-e)}):K.darkColor[zl]=Io(cD,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 kV="";typeof navigator<"u"&&(kV=navigator.platform||"");var Sc="rgba(0, 0, 0, 0.2)",LV=K.color.theme[0],hQ=Io(LV,null,null,.9);const fQ={darkMode:"auto",colorBy:"series",color:K.color.theme,gradientColor:[hQ,LV],aria:{decal:{decals:[{color:Sc,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Sc,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Sc,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Sc,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Sc,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Sc,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:kV.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 NV=_e(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),si="original",Wr="arrayRows",li="objectRows",va="keyedColumns",Zs="typedArray",PV="unknown",la="column",Qu="row",Zr={Must:1,Might:2,Not:3},IV=Ye();function dQ(e){IV(e).datasetMap=_e()}function DV(e,t,r){var n={},i=BA(t);if(!i||!e)return n;var a=[],o=[],s=t.ecModel,l=IV(s).datasetMap,u=i.uid+"_"+r.seriesLayoutBy,c,h;e=e.slice(),j(e,function(m,y){var x=ke(m)?m:e[y]={name:m};x.type==="ordinal"&&c==null&&(c=y,h=g(x)),n[x.name]=[]});var f=l.get(u)||l.set(u,{categoryWayDim:h,valueWayDim:0});j(e,function(m,y){var x=m.name,_=g(m);if(c==null){var w=f.valueWayDim;d(n[x],w,_),d(o,w,_),f.valueWayDim+=_}else if(c===y)d(n[x],0,_),d(a,0,_);else{var w=f.categoryWayDim;d(n[x],w,_),d(o,w,_),f.categoryWayDim+=_}});function d(m,y,x){for(var _=0;_t)return e[n];return e[r-1]}function RV(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:yQ(n,o);if(c=c||r,!(!c||!c.length)){var h=c[l];return i&&(u[i]=h),s.paletteIdx=(l+1)%c.length,h}}function xQ(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}var gm,hd,fD,dD="\0_ec_inner",_Q=1,VA=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 qe(a),this._locale=new qe(o),this._optionManager=s},t.prototype.setOption=function(r,n,i){var a=gD(n);this._optionManager.setOption(r,i,a),this._resetOption(null,a)},t.prototype.resetOption=function(r,n){return this._resetOption(r,gD(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"?fD(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&&j(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;dQ(this),j(r,function(h,f){h!=null&&($e.hasClass(f)?f&&(s.push(f),l.set(f,!0)):i[f]=i[f]==null?Se(h):Ge(i[f],h,!0))}),u&&u.each(function(h,f){$e.hasClass(f)&&!l.get(f)&&(s.push(f),l.set(f,!0))}),$e.topologicalTravel(s,$e.getAllClassMainTypes(),c,this);function c(h){var f=gQ(this,h,Tt(r[h])),d=a.get(h),g=d?u&&u.get(h)?"replaceMerge":"normalMerge":"replaceAll",m=mF(d,f,g);jq(m,h,$e),i[h]=null,a.set(h,null),o.set(h,0);var y=[],x=[],_=0,w;j(m,function(S,T){var M=S.existing,A=S.newOption;if(!A)M&&(M.mergeOption({},this),M.optionUpdated({},!1));else{var P=h==="series",I=$e.getClass(h,S.keyInfo.subType,!P);if(!I)return;if(h==="tooltip"){if(w)return;w=!0}if(M&&M.constructor===I)M.name=S.keyInfo.name,M.mergeOption(A,this),M.optionUpdated(A,!1);else{var N=Q({componentIndex:T},S.keyInfo);M=new I(A,this,this,N),Q(M,N),S.brandNew&&(M.__requireNewView=!0),M.init(A,this,this),M.optionUpdated(null,!0)}}M?(y.push(M.option),x.push(M),_++):(y.push(void 0),x.push(void 0))},this),i[h]=y,a.set(h,x),o.set(h,_),h==="series"&&gm(this)}this._seriesIndices||gm(this)},t.prototype.getOption=function(){var r=Se(this.option);return j(r,function(n,i){if($e.hasClass(i)){for(var a=Tt(n),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!tp(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,r[i]=a}}),delete r[dD],r},t.prototype.setTheme=function(r){this._theme=new qe(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 LQ(e,t){return e.join(",")===t.join(",")}var Zi=j,sp=ke,mD=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function jb(e){var t=e&&e.itemStyle;if(t)for(var r=0,n=mD.length;r0?r[o-1].seriesModel:null)}),zQ(r)}})}function zQ(e){j(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,h){var f=o.get(t.stackedDimension,h);if(isNaN(f))return i;var d,g;s?g=o.getRawIndex(h):d=o.get(t.stackedByDimension,h);for(var m=NaN,y=r-1;y>=0;y--){var x=e[y];if(s||(g=x.data.rawIndexOf(x.stackedByDimension,d)),g>=0){var _=x.data.getByRawIndex(x.stackResultDimension,g);if(l==="all"||l==="positive"&&_>0||l==="negative"&&_<0||l==="samesign"&&f>=0&&_>0||l==="samesign"&&f<=0&&_<0){f=wq(f,_),m=_;break}}}return n[0]=f,n[1]=m,n})})}var T_=function(){function e(t){this.data=t.data||(t.sourceFormat===va?{}:[]),this.sourceFormat=t.sourceFormat||PV,this.seriesLayoutBy=t.seriesLayoutBy||la,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;nm&&(m=w)}d[0]=g,d[1]=m}},i=function(){return this._data?this._data.length/this._dimSize:0};CD=(t={},t[Wr+"_"+la]={pure:!0,appendData:a},t[Wr+"_"+Qu]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},t[li]={pure:!0,appendData:a},t[va]={pure:!0,appendData:function(o){var s=this._data;j(o,function(l,u){for(var c=s[u]||(s[u]=[]),h=0;h<(l||[]).length;h++)c.push(l[h])})}},t[si]={appendData:a},t[Zs]={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&&(m=o.interpolatedValue[y])}return m!=null?m+"":""})}},e.prototype.getRawValue=function(t,r){return Vh(this.getData(r),t)},e.prototype.formatTooltip=function(t,r,n){},e}();function kD(e){var t,r;return ke(e)?e.type&&(r=e):t=e,{text:t,frag:r}}function bv(e){return new ZQ(e)}var ZQ=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 h;(this._dirty||a==="reset")&&(this._dirty=!1,h=this._doReset(n)),this._modBy=l,this._modDataCount=u;var f=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,g=Math.min(f!=null?this._dueIndex+f:1/0,this._dueEnd);if(!n&&(h||d1&&n>0?s:o}};return a;function o(){return t=e?null:lt},gte:function(e,t){return e>=t}},YQ=function(){function e(t,r){if(!rt(r)){var n="";ft(n)}this._opFn=$V[t],this._rvalFloat=Xa(r)}return e.prototype.evaluate=function(t){return rt(t)?this._opFn(t,this._rvalFloat):this._opFn(Xa(t),this._rvalFloat)},e}(),YV=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=rt(t)?t:Xa(t),i=rt(r)?r:Xa(r),a=isNaN(n),o=isNaN(i);if(a&&(n=this._incomparable),o&&(i=this._incomparable),a&&o){var s=he(t),l=he(r);s&&(n=l?t:0),l&&(i=s?r:0)}return ni?-this._resultLT:0},e}(),XQ=function(){function e(t,r){this._rval=r,this._isEQ=t,this._rvalTypeof=typeof r,this._rvalFloat=Xa(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=Xa(t)===this._rvalFloat)}return this._isEQ?r:!r},e}();function qQ(e,t){return e==="eq"||e==="ne"?new XQ(e==="eq",t):ge($V,e)?new YQ(e,t):null}var KQ=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 $s(t,r)},e}();function JQ(e,t){var r=new KQ,n=e.data,i=r.sourceFormat=e.sourceFormat,a=e.startIndex,o="";e.seriesLayoutBy!==la&&ft(o);var s=[],l={},u=e.dimensionsDefine;if(u)j(u,function(m,y){var x=m.name,_={index:y,name:x,displayName:m.displayName};if(s.push(_),x!=null){var w="";ge(l,x)&&ft(w),l[x]=_}});else for(var c=0;c65535?oee:see}function Tc(){return[1/0,-1/0]}function lee(e){var t=e.constructor;return t===Array?e.slice():new t(e)}function PD(e,t,r,n,i){var a=KV[r||"float"];if(i){var o=e[t],s=o&&o.length;if(s!==n){for(var l=new a(n),u=0;uy[1]&&(y[1]=m)}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=ae(o,function(_){return _.property}),c=0;cx[1]&&(x[1]=y)}}!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=h&&_<=f||isNaN(_))&&(l[u++]=m),m++}g=!0}else if(a===2){for(var y=d[i[0]],w=d[i[1]],S=t[i[1]][0],T=t[i[1]][1],x=0;x=h&&_<=f||isNaN(_))&&(M>=S&&M<=T||isNaN(M))&&(l[u++]=m),m++}g=!0}}if(!g)if(a===1)for(var x=0;x=h&&_<=f||isNaN(_))&&(l[u++]=A)}else for(var x=0;xt[N][1])&&(P=!1)}P&&(l[u++]=r.getRawIndex(x))}return ux[1]&&(x[1]=y)}}}},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,h,f,d=new(Cc(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));d[s++]=u;for(var g=1;gc&&(c=h,f=S)}D>0&&Ds&&(m=s-c);for(var y=0;yg&&(g=_,d=c+y)}var w=this.getRawIndex(h),S=this.getRawIndex(d);hc-g&&(l=c-g,s.length=l);for(var m=0;mh[1]&&(h[1]=x),f[d++]=_}return a._count=d,a._indices=f,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=h)}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 $s(r[a],this._dimensions[a])}zb={arrayRows:t,objectRows:function(r,n,i,a){return $s(r[n],this._dimensions[a])},keyedColumns:t,original:function(r,n,i,a){var o=r&&(r.value==null?r:r.value);return $s(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(r,n,i,a){return r[a]}}}(),e}(),JV=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(ym(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=Sn(s)?Zs:si,a=[];var h=this._getSourceMetaRawOption()||{},f=u&&u.metaRawOption||{},d=be(h.seriesLayoutBy,f.seriesLayoutBy)||null,g=be(h.sourceHeader,f.sourceHeader),m=be(h.dimensions,f.dimensions),y=d!==f.seriesLayoutBy||!!g!=!!f.sourceHeader||m;i=y?[dT(s,{seriesLayoutBy:d,sourceHeader:g,dimensions:m},l)]:[]}else{var x=t;if(n){var _=this._applyTransform(r);i=_.sourceList,a=_.upstreamSignList}else{var w=x.get("source",!0);i=[dT(w,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&&DD(a)}var o,s=[],l=[];return j(t,function(u){u.prepareSource();var c=u.getSource(i||0),h="";i!=null&&!c&&DD(h),s.push(c),l.push(u._getVersionSign())}),n?o=iee(n,s,{datasetIndex:r.componentIndex}):i!=null&&(o=[BQ(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 j(e.blocks,function(i){var a=r6(i);a>=t&&(t=a+ +(n&&(!a||pT(i)&&!i.noHeader)))}),t}return 0}function fee(e,t,r,n){var i=t.noHeader,a=vee(r6(t)),o=[],s=t.blocks||[];Jr(!s||re(s)),s=s||[];var l=e.orderMode;if(t.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(ge(u,l)){var c=new YV(u[l],null);s.sort(function(m,y){return c.evaluate(m.sortParam,y.sortParam)})}else l==="seriesDesc"&&s.reverse()}j(s,function(m,y){var _=t.valueFormatter,x=t6(m)(_?Q(Q({},e),{valueFormatter:_}):e,m,y>0?a.html:0,n);x!=null&&o.push(x)});var h=e.renderMode==="richText"?o.join(a.richText):gT(n,o.join(""),i?r:a.html);if(i)return h;var f=uT(t.header,"ordinal",e.useUTC),d=e6(n,e.renderMode).nameStyle,g=QV(n);return e.renderMode==="richText"?n6(e,f,d)+a.richText+h:gT(n,'
'+hn(f)+"
"+h,r)}function dee(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=re(S)?S:[S],ae(S,function(T,M){return uT(T,re(d)?d[M]:d,u)})};if(!(a&&o)){var h=s?"":e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||K.color.secondary,i),f=a?"":uT(l,"ordinal",u),d=t.valueType,g=o?[]:c(t.value,t.dataIndex),m=!s||!a,y=!s&&a,_=e6(n,i),x=_.nameStyle,w=_.valueStyle;return i==="richText"?(s?"":h)+(a?"":n6(e,f,x))+(o?"":mee(e,g,m,y,w)):gT(n,(s?"":h)+(a?"":pee(f,!s,x))+(o?"":gee(g,m,y,w)),r)}}function ED(e,t,r,n,i,a){if(e){var o=t6(e),s={useUTC:i,renderMode:r,orderMode:n,markupStyleCreator:t,valueFormatter:e.valueFormatter};return o(s,e,0,a)}}function vee(e){return{html:cee[e],richText:hee[e]}}function gT(e,t,r){var n='
',i="margin: "+r+"px 0 0",a=QV(e);return'
'+t+n+"
"}function pee(e,t,r){var n=t?"margin-left:2px":"";return''+hn(e)+""}function gee(e,t,r,n){var i=r?"10px":"20px",a=t?"float:right;margin-left:"+i:"";return e=re(e)?e:[e],''+ae(e,function(o){return hn(o)}).join("  ")+""}function n6(e,t,r){return e.markupStyleCreator.wrapRichTextStyle(t,r)}function mee(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(re(t)?t.join(" "):t,a)}function i6(e,t){var r=e.getData().getItemVisual(t,"style"),n=r[e.visualDrawType];return Vu(n)}function a6(e,t){var r=e.get("padding");return r??(t==="richText"?[8,10]:10)}var Bb=function(){function e(){this.richTextStyles={},this._nextStyleNameId=fF()}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=_V({color:r,type:t,renderMode:n,markerId:i});return he(a)?a:(this.richTextStyles[i]=a.style,a.content)},e.prototype.wrapRichTextStyle=function(t,r){var n={};re(r)?j(r,function(a){return Q(n,a)}):Q(n,r);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},e}();function o6(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=re(s),u=i6(t,r),c,h,f,d;if(o>1||l&&!o){var g=yee(s,t,r,a,u);c=g.inlineValues,h=g.inlineValueTypes,f=g.blocks,d=g.inlineValues[0]}else if(o){var m=i.getDimensionInfo(a[0]);d=c=Vh(i,r,a[0]),h=m.type}else d=c=l?s[0]:s;var y=nA(t),_=y&&t.name||"",x=i.getName(r),w=n?_:x;return gr("section",{header:_,noHeader:n||!y,sortParam:d,blocks:[gr("nameValue",{markerType:"item",markerColor:u,name:w,noName:!Jn(w),value:c,valueType:h,dataIndex:r})].concat(f||[])})}function yee(e,t,r,n,i){var a=t.getData(),o=Ei(e,function(h,f,d){var g=a.getDimensionInfo(d);return h=h||g&&g.tooltip!==!1&&g.displayName!=null},!1),s=[],l=[],u=[];n.length?j(n,function(h){c(Vh(a,r,h),h)}):j(e,c);function c(h,f){var d=a.getDimensionInfo(f);!d||d.otherDims.tooltip===!1||(o?u.push(gr("nameValue",{markerType:"subItem",markerColor:i,name:d.displayName,value:h,valueType:d.type})):(s.push(h),l.push(d.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var as=Ye();function _m(e,t){return e.getName(t)||e.getId(t)}var Ry="__universalTransitionEnabled",bt=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=bv({count:xee,reset:bee}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,i);var a=as(this).sourceManager=new JV(this);a.prepareSource();var o=this.getInitialData(r,i);RD(o,this),this.dataTask.context.data=o,as(this).dataBeforeProcessed=o,jD(this),this._initSelectedMapFromData(o)},t.prototype.mergeDefaultAndTheme=function(r,n){var i=op(this),a=i?Ju(r):{},o=this.subType;$e.hasClass(o)&&(o+="Series"),Ge(r,n.getTheme().get(this.subType)),Ge(r,this.getDefaultOption()),ju(r,"label",["show"]),this.fillDataTextStyle(r.data),i&&Ka(r,a,i)},t.prototype.mergeOption=function(r,n){r=Ge(this.option,r,!0),this.fillDataTextStyle(r.data);var i=op(this);i&&Ka(this.option,r,i);var a=as(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(r,n);RD(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,as(this).dataBeforeProcessed=o,jD(this),this._initSelectedMapFromData(o)},t.prototype.fillDataTextStyle=function(r){if(r&&!Sn(r))for(var n=["show"],i=0;i=0&&f<0)&&(h=x,f=_,d=0),_===f&&(c[d++]=m))}),c.length=d,c},t.prototype.formatTooltip=function(r,n,i){return o6({series:this,dataIndex:r,multipleSeries:n})},t.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(Je.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=FA.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[_m(a,r)])&&!a.getItemModel(r).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this[Ry])return!0;var r=this.option.universalTransition;return r?r===!0?!0:r&&r.enabled:!1},t.prototype._innerSelect=function(r,n){var i,a,o=this.option,s=o.selectedMode,l=n.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){ke(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,c=0;c0&&this._innerSelect(r,n)}},t.registerClass=function(r){return $e.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}($e);Qt(bt,Mx);Qt(bt,FA);wF(bt,$e);function jD(e){var t=e.name;nA(e)||(e.name=_ee(e)||t)}function _ee(e){var t=e.getRawData(),r=t.mapDimensionsAll("seriesName"),n=[];return j(r,function(i){var a=t.getDimensionInfo(i);a.displayName&&n.push(a.displayName)}),n.join(" ")}function xee(e){return e.model.getRawData().count()}function bee(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),wee}function wee(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function RD(e,t){j(Eh(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(r){e.wrapMethod(r,Fe(See,t))})}function See(e,t){var r=mT(e);return r&&r.setOutputEnd((t||this).count()),t}function mT(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 Mt=function(){function e(){this.group=new Ce,this.uid=pf("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}();aA(Mt);fx(Mt);function yf(){var e=Ye();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 s6=Ye(),Cee=yf(),gt=function(){function e(){this.group=new Ce,this.uid=pf("viewChart"),this.renderTask=bv({plan:Tee,reset:Mee}),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&&zD(a,i,"emphasis")},e.prototype.downplay=function(t,r,n,i){var a=t.getData(i&&i.dataType);a&&zD(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){hl(this.group,t)},e.markUpdateMethod=function(t,r){s6(t).updateMethod=r},e.protoInitialize=function(){var t=e.prototype;t.type="chart"}(),e}();function OD(e,t,r){e&&np(e)&&(t==="emphasis"?Ho:Uo)(e,r)}function zD(e,t,r){var n=Ru(e,t),i=t&&t.highlightKey!=null?JK(t.highlightKey):null;n!=null?j(Tt(n),function(a){OD(e.getItemGraphicEl(a),r,i)}):e.eachItemGraphicEl(function(a){OD(a,r,i)})}aA(gt);fx(gt);function Tee(e){return Cee(e.model)}function Mee(e){var t=e.model,r=e.ecModel,n=e.api,i=e.payload,a=t.pipelineContext.progressiveRender,o=e.view,s=i&&s6(i).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](t,r,n,i),Aee[l]}var Aee={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)}}},F0="\0__throttleOriginMethod",BD="\0__throttleRate",FD="\0__throttleType";function kx(e,t,r){var n,i=0,a=0,o=null,s,l,u,c;t=t||0;function h(){a=new Date().getTime(),o=null,e.apply(l,u||[])}var f=function(){for(var d=[],g=0;g=0?h():o=setTimeout(h,-s),i=n};return f.clear=function(){o&&(clearTimeout(o),o=null)},f.debounceNextCall=function(d){c=d},f}function _f(e,t,r,n){var i=e[t];if(i){var a=i[F0]||i,o=i[FD],s=i[BD];if(s!==r||o!==n){if(r==null||!n)return e[t]=a;i=e[t]=kx(a,r,n==="debounce"),i[F0]=a,i[FD]=n,i[BD]=r}return i}}function lp(e,t){var r=e[t];r&&r[F0]&&(r.clear&&r.clear(),e[t]=r[F0])}var VD=Ye(),GD={itemStyle:Ou(cV,!0),lineStyle:Ou(uV,!0)},kee={lineStyle:"stroke",itemStyle:"fill"};function l6(e,t){var r=e.visualStyleMapper||GD[t];return r||(console.warn("Unknown style type '"+t+"'."),GD.itemStyle)}function u6(e,t){var r=e.visualDrawType||kee[t];return r||(console.warn("Unknown style type '"+t+"'."),"fill")}var Lee={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=e.getModel(n),a=l6(e,n),o=a(i),s=i.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=u6(e,n),u=o[l],c=we(u)?u:null,h=o.fill==="auto"||o.stroke==="auto";if(!o[l]||c||h){var f=e.getColorFromPalette(e.name,null,t.getSeriesCount());o[l]||(o[l]=f,r.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||we(o.fill)?f:o.fill,o.stroke=o.stroke==="auto"||we(o.stroke)?f:o.stroke}if(r.setVisual("style",o),r.setVisual("drawType",l),!t.isSeriesFiltered(e)&&c)return r.setVisual("colorFromPalette",!1),{dataEach:function(d,g){var m=e.getDataParams(g),y=Q({},o);y[l]=c(m),d.setItemVisual(g,"style",y)}}}},dd=new qe,Nee={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!(e.ignoreStyleOnData||t.isSeriesFiltered(e))){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=l6(e,n),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){dd.option=l[n];var u=i(dd),c=o.ensureUniqueItemVisual(s,"style");Q(c,u),dd.option.decal&&(o.setItemVisual(s,"decal",dd.option.decal),dd.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},Pee={performRawSeries:!0,overallReset:function(e){var t=xe();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)),VD(r).scope=a}}),e.eachSeries(function(r){if(!(r.isColorBySeries()||e.isSeriesFiltered(r))){var n=r.getRawData(),i={},a=r.getData(),o=VD(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=u6(r,s);a.each(function(u){var c=a.getRawIndex(u);i[c]=u}),n.each(function(u){var c=i[u],h=a.getItemVisual(c,"colorFromPalette");if(h){var f=a.ensureUniqueItemVisual(c,"style"),d=n.getName(u)||u+"",g=n.count();f[l]=r.getColorFromPalette(d,o,g)}})}})}},xm=Math.PI;function Iee(e,t){t=t||{},Ae(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 Ce,n=new Ze({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});r.add(n);var i=new tt({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 Ze({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 Wp({shape:{startAngle:-xm/2,endAngle:-xm/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:xm*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:xm*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 c6=function(){function e(t,r,n,i){this._stageTaskMap=xe(),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=xe();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;j(this._allHandlers,function(i){var a=t.get(i.uid)||t.set(i.uid,{}),o="";Jr(!(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;j(t,function(l,u){if(!(i.visualType&&i.visualType!==l.visualType)){var c=o._stageTaskMap.get(l.uid),h=c.seriesTaskMap,f=c.overallTask;if(f){var d,g=f.agentStubMap;g.each(function(y){s(i,y)&&(y.dirty(),d=!0)}),d&&f.dirty(),o.updatePayload(f,n);var m=o.getPerformArgs(f,i.block);g.each(function(y){y.perform(m)}),f.perform(m)&&(a=!0)}else h&&h.each(function(y,_){s(i,y)&&y.dirty();var x=o.getPerformArgs(y,i.block);x.skip=!l.performRawSeries&&r.isSeriesFiltered(y.context.model),o.updatePayload(y,n),y.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=xe(),l=t.seriesType,u=t.getTargetSeries;t.createOnAllSeries?n.eachRawSeries(c):l?n.eachRawSeriesByType(l,c):u&&u(n,i).each(c);function c(h){var f=h.uid,d=s.set(f,o&&o.get(f)||bv({plan:Oee,reset:zee,count:Fee}));d.context={model:h,ecModel:n,api:i,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:a},a._pipe(h,d)}},e.prototype._createOverallStageTask=function(t,r,n,i){var a=this,o=r.overallTask=r.overallTask||bv({reset:Dee});o.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=xe(),u=t.seriesType,c=t.getTargetSeries,h=!0,f=!1,d="";Jr(!t.createOnAllSeries,d),u?n.eachRawSeriesByType(u,g):c?c(n,i).each(g):(h=!1,j(n.getSeries(),g));function g(m){var y=m.uid,_=l.set(y,s&&s.get(y)||(f=!0,bv({reset:Eee,onDirty:Ree})));_.context={model:m,overallProgress:h},_.agent=o,_.__block=h,a._pipe(m,_)}f&&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 we(t)&&(t={overallReset:t,seriesType:Vee(t)}),t.uid=pf("stageHandler"),r&&(t.visualType=r),t},e}();function Dee(e){e.overallReset(e.ecModel,e.api,e.payload)}function Eee(e){return e.overallProgress&&jee}function jee(){this.agent.dirty(),this.getDownstream().dirty()}function Ree(){this.agent&&this.agent.dirty()}function Oee(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function zee(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=Tt(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?ae(t,function(r,n){return h6(n)}):Bee}var Bee=h6(0);function h6(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-f.length){var g=u.slice(0,d);g!=="data"&&(r.mainType=g,r[f.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(h,f,d,g){return h[d]==null||f[g||d]===h[d]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),yT=["symbol","symbolSize","symbolRotate","symbolOffset"],HD=yT.concat(["symbolKeepAspect"]),Hee={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&&pu(l)?l:.5;var u=e.createRadialGradient(o,s,0,o,s,l);return u}function _T(e,t,r){for(var n=t.type==="radial"?ate(e,t,r):ite(e,t,r),i=t.colorStops,a=0;a0)?null:e==="dashed"?[4*t,2*t]:e==="dotted"?[t]:rt(e)?[e]:re(e)?e:null}function $A(e){var t=e.style,r=t.lineDash&&t.lineWidth>0&&ste(t.lineDash,t.lineWidth),n=t.lineDashOffset;if(r){var i=t.strokeNoScale&&e.getLineScale?e.getLineScale():1;i&&i!==1&&(r=ae(r,function(a){return a/i}),n/=i)}return[r,n]}var lte=new qa(!0);function W0(e){var t=e.stroke;return!(t==null||t==="none"||!(e.lineWidth>0))}function UD(e){return typeof e=="string"&&e!=="none"}function H0(e){var t=e.fill;return t!=null&&t!=="none"}function ZD(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 $D(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 xT(e,t,r){var n=oA(t.image,t.__image,r);if(dx(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)*cv),a.scaleSelf(t.scaleX||1,t.scaleY||1),i.setTransform(a)}return i}}function ute(e,t,r,n){var i,a=W0(r),o=H0(r),s=r.strokePercent,l=s<1,u=!t.path;(!t.silent||l)&&u&&t.createPathProxy();var c=t.path||lte,h=t.__dirty;if(!n){var f=r.fill,d=r.stroke,g=o&&!!f.colorStops,m=a&&!!d.colorStops,y=o&&!!f.image,_=a&&!!d.image,x=void 0,w=void 0,S=void 0,T=void 0,M=void 0;(g||m)&&(M=t.getBoundingRect()),g&&(x=h?_T(e,f,M):t.__canvasFillGradient,t.__canvasFillGradient=x),m&&(w=h?_T(e,d,M):t.__canvasStrokeGradient,t.__canvasStrokeGradient=w),y&&(S=h||!t.__canvasFillPattern?xT(e,f,t):t.__canvasFillPattern,t.__canvasFillPattern=S),_&&(T=h||!t.__canvasStrokePattern?xT(e,d,t):t.__canvasStrokePattern,t.__canvasStrokePattern=T),g?e.fillStyle=x:y&&(S?e.fillStyle=S:o=!1),m?e.strokeStyle=w:_&&(T?e.strokeStyle=T:a=!1)}var A=t.getGlobalScale();c.setScale(A[0],A[1],t.segmentIgnoreThreshold);var P,I;e.setLineDash&&r.lineDash&&(i=$A(t),P=i[0],I=i[1]);var N=!0;(u||h&Wc)&&(c.setDPR(e.dpr),l?c.setContext(null):(c.setContext(e),N=!1),c.reset(),t.buildPath(c,t.shape,n),c.toStatic(),t.pathUpdated()),N&&c.rebuildPath(e,l?s:1),P&&(e.setLineDash(P),e.lineDashOffset=I),n||(r.strokeFirst?(a&&$D(e,r),o&&ZD(e,r)):(o&&ZD(e,r),a&&$D(e,r))),P&&e.setLineDash([])}function cte(e,t,r){var n=t.__image=oA(r.image,t.__image,t,t.onload);if(!(!n||!dx(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,h=o-u,f=s-c;e.drawImage(n,u,c,h,f,i,a,o,s)}else e.drawImage(n,i,a,o,s)}}function hte(e,t,r){var n,i=r.text;if(i!=null&&(i+=""),i){e.font=r.font||Go,e.textAlign=r.textAlign,e.textBaseline=r.textBaseline;var a=void 0,o=void 0;e.setLineDash&&r.lineDash&&(n=$A(t),a=n[0],o=n[1]),a&&(e.setLineDash(a),e.lineDashOffset=o),r.strokeFirst?(W0(r)&&e.strokeText(i,r.x,r.y),H0(r)&&e.fillText(i,r.x,r.y)):(H0(r)&&e.fillText(i,r.x,r.y),W0(r)&&e.strokeText(i,r.x,r.y)),a&&e.setLineDash([])}}var YD=["shadowBlur","shadowOffsetX","shadowOffsetY"],XD=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function m6(e,t,r,n,i){var a=!1;if(!n&&(r=r||{},t===r))return!1;if(n||t.opacity!==r.opacity){Dn(e,i),a=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?xu.opacity:o}(n||t.blend!==r.blend)&&(a||(Dn(e,i),a=!0),e.globalCompositeOperation=t.blend||xu.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[_r]){if(this._disposed){this.id;return}var a,o,s;if(ke(n)&&(i=n.lazyUpdate,a=n.silent,o=n.replaceMerge,s=n.transition,n=n.notMerge),this[_r]=!0,Lc(this),!this._model||n){var l=new TQ(this._api),u=this._theme,c=this._model=new VA;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,u,this._locale,l)}this._model.setOption(r,{replaceMerge:o},CT);var h={seriesTransition:s,optionChanged:!0};if(i)this[Rr]={silent:a,updateParams:h},this[_r]=!1,this.getZr().wakeUp();else{try{Wl(this),po.update.call(this,null,h)}catch(f){throw this[Rr]=null,this[_r]=!1,f}this._ssr||this._zr.flush(),this[Rr]=null,this[_r]=!1,Ac.call(this,a),kc.call(this,a)}}},t.prototype.setTheme=function(r,n){if(!this[_r]){if(this._disposed){this.id;return}var i=this._model;if(i){var a=n&&n.silent,o=null;this[Rr]&&(a==null&&(a=this[Rr].silent),o=this[Rr].updateParams,this[Rr]=null),this[_r]=!0,Lc(this);try{this._updateTheme(r),i.setTheme(this._theme),Wl(this),po.update.call(this,{type:"setTheme"},o)}catch(s){throw this[_r]=!1,s}this[_r]=!1,Ac.call(this,a),kc.call(this,a)}}},t.prototype._updateTheme=function(r){he(r)&&(r=R6[r]),r&&(r=Se(r),r&&BV(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||Je.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 j(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;j(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 j(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(Y0[i]){var l=s,u=s,c=-s,h=-s,f=[],d=r&&r.pixelRatio||this.getDevicePixelRatio();j(Su,function(w,S){if(w.group===i){var T=n?w.getZr().painter.getSvgDom().innerHTML:w.renderToCanvas(Se(r)),M=w.getDom().getBoundingClientRect();l=a(M.left,l),u=a(M.top,u),c=o(M.right,c),h=o(M.bottom,h),f.push({dom:T,left:M.left,top:M.top})}}),l*=d,u*=d,c*=d,h*=d;var g=c-l,m=h-u,y=Bn.createCanvas(),_=GC(y,{renderer:n?"svg":"canvas"});if(_.resize({width:g,height:m}),n){var x="";return j(f,function(w){var S=w.left-l,T=w.top-u;x+=''+w.dom+""}),_.painter.getSvgRoot().innerHTML=x,r.connectedBackgroundColor&&_.painter.setBackgroundColor(r.connectedBackgroundColor),_.refreshImmediately(),_.painter.toDataURL()}else return r.connectedBackgroundColor&&_.add(new Ze({shape:{x:0,y:0,width:g,height:m},style:{fill:r.connectedBackgroundColor}})),j(f,function(w){var S=new Er({style:{x:w.left*d-l,y:w.top*d-u,image:w.dom}});_.add(S)}),_.refreshImmediately(),y.toDataURL("image/"+(r&&r.type||"png"))}else return this.getDataURL(r)},t.prototype.convertToPixel=function(r,n,i){return Cm(this,"convertToPixel",r,n,i)},t.prototype.convertToLayout=function(r,n,i){return Cm(this,"convertToLayout",r,n,i)},t.prototype.convertFromPixel=function(r,n,i){return Cm(this,"convertFromPixel",r,n,i)},t.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var i=this._model,a,o=xh(i,r);return j(o,function(s,l){l.indexOf("Models")>=0&&j(s,function(u){var c=u.coordinateSystem;if(c&&c.containPoint)a=a||!!c.containPoint(n);else if(l==="seriesModels"){var h=this._chartsMap[u.__viewId];h&&h.containPoint&&(a=a||h.containPoint(n,u))}},this)},this),!!a},t.prototype.getVisual=function(r,n){var i=this._model,a=xh(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?ZA(s,l,n):Yp(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;j(Ote,function(i){var a=function(o){var s=r.getModel(),l=o.target,u,c=i==="globalout";if(c?u={}:l&&vu(l,function(m){var y=De(m);if(y&&y.dataIndex!=null){var _=y.dataModel||s.getSeriesByIndex(y.seriesIndex);return u=_&&_.getDataParams(y.dataIndex,y.dataType,l)||{},!0}else if(y.eventData)return u=Q({},y.eventData),!0},!0),u){var h=u.componentType,f=u.componentIndex;(h==="markLine"||h==="markPoint"||h==="markArea")&&(h="series",f=u.seriesIndex);var d=h&&f!=null&&s.getComponent(h,f),g=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:g},r.trigger(i,u)}};a.zrEventfulCallAtLast=!0,r._zr.on(i,a,r)});var n=this._messageCenter;j(wT,function(i,a){n.on(a,function(o){r.trigger(a,o)})}),Zee(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&&_F(this.getDom(),KA,"");var n=this,i=n._api,a=n._model;j(n._componentsViews,function(o){o.dispose(a,i)}),j(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 Su[n.id]},t.prototype.resize=function(r){if(!this[_r]){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[Rr]&&(a==null&&(a=this[Rr].silent),i=!0,this[Rr]=null),this[_r]=!0,Lc(this);try{i&&Wl(this),po.update.call(this,{type:"resize",animation:Q({duration:0},r&&r.animation)})}catch(o){throw this[_r]=!1,o}this[_r]=!1,Ac.call(this,a),kc.call(this,a)}}},t.prototype.showLoading=function(r,n){if(this._disposed){this.id;return}if(ke(r)&&(n=r,r=""),r=r||"default",this.hideLoading(),!!TT[r]){var i=TT[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=Q({},r);return n.type=bT[r.type],n},t.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(ke(n)||(n={silent:!!n}),!!Z0[r.type]&&this._model){if(this[_r]){this._pendingActions.push(r);return}var i=n.silent;Ub.call(this,r,i);var a=n.flush;a?this._zr.flush():a!==!1&&Je.browser.weChat&&this._throttledZrFlush(),Ac.call(this,i),kc.call(this,i)}},t.prototype.updateLabelLayout=function(){qi.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(){Wl=function(h){var f=h._scheduler;f.restorePipelines(h._model),f.prepareStageTasks(),Wb(h,!0),Wb(h,!1),f.plan()},Wb=function(h,f){for(var d=h._model,g=h._scheduler,m=f?h._componentsViews:h._chartsViews,y=f?h._componentsMap:h._chartsMap,_=h._zr,x=h._api,w=0;wf.get("hoverLayerThreshold")&&!Je.node&&!Je.worker&&f.eachSeries(function(y){if(!y.preventUsingHoverLayer){var _=h._chartsMap[y.__viewId];_.__alive&&_.eachRendered(function(x){x.states.emphasis&&(x.states.emphasis.hoverLayer=!0)})}})}function s(h,f){var d=h.get("blendMode")||null;f.eachRendered(function(g){g.isGroup||(g.style.blend=d)})}function l(h,f){if(!h.preventAutoZ){var d=Fu(h);f.eachRendered(function(g){return bx(g,d.z,d.zlevel),!0})}}function u(h,f){f.eachRendered(function(d){if(!bh(d)){var g=d.getTextContent(),m=d.getTextGuideLine();d.stateTransition&&(d.stateTransition=null),g&&g.stateTransition&&(g.stateTransition=null),m&&m.stateTransition&&(m.stateTransition=null),d.hasState()?(d.prevStates=d.currentStates,d.clearStates()):d.prevStates&&(d.prevStates=null)}})}function c(h,f){var d=h.getModel("stateAnimation"),g=h.isAnimationEnabled(),m=d.get("duration"),y=m>0?{duration:m,delay:d.get("delay"),easing:d.get("easing")}:null;f.eachRendered(function(_){if(_.states&&_.states.emphasis){if(bh(_))return;if(_ instanceof Ke&&QK(_),_.__dirty){var x=_.prevStates;x&&_.useStates(x)}if(g){_.stateTransition=y;var w=_.getTextContent(),S=_.getTextGuideLine();w&&(w.stateTransition=y),S&&(S.stateTransition=y)}_.__dirty&&a(_)}})}lE=function(h){return new(function(f){q(d,f);function d(){return f!==null&&f.apply(this,arguments)||this}return d.prototype.getCoordinateSystems=function(){return h._coordSysMgr.getCoordinateSystems()},d.prototype.getComponentByElement=function(g){for(;g;){var m=g.__ecComponentInfo;if(m!=null)return h._model.getComponent(m.mainType,m.index);g=g.parent}},d.prototype.enterEmphasis=function(g,m){Ho(g,m),di(h)},d.prototype.leaveEmphasis=function(g,m){Uo(g,m),di(h)},d.prototype.enterBlur=function(g){OF(g),di(h)},d.prototype.leaveBlur=function(g){fA(g),di(h)},d.prototype.enterSelect=function(g){zF(g),di(h)},d.prototype.leaveSelect=function(g){BF(g),di(h)},d.prototype.getModel=function(){return h.getModel()},d.prototype.getViewOfComponentModel=function(g){return h.getViewOfComponentModel(g)},d.prototype.getViewOfSeriesModel=function(g){return h.getViewOfSeriesModel(g)},d.prototype.getMainProcessVersion=function(){return h[wm]},d}(OV))(h)},j6=function(h){function f(d,g){for(var m=0;m=0)){cE.push(r);var a=c6.wrapStageHandler(r,i);a.__prio=t,a.__raw=r,e.push(a)}}function nk(e,t){TT[e]=t}function $te(e){CB({createCanvas:e})}function G6(e,t,r){var n=S6("registerMap");n&&n(e,t,r)}function Yte(e){var t=S6("getMap");return t&&t(e)}var W6=nee;dl(XA,Lee);dl(Lx,Nee);dl(Lx,Pee);dl(XA,Hee);dl(Lx,Uee);dl(k6,_te);ek(BV);tk(Mte,OQ);nk("default",Iee);pa({type:bu,event:bu,update:bu},qt);pa({type:Ny,event:Ny,update:Ny},qt);pa({type:D0,event:cA,update:D0,action:qt,refineEvent:ik,publishNonRefinedEvent:!0});pa({type:JC,event:cA,update:JC,action:qt,refineEvent:ik,publishNonRefinedEvent:!0});pa({type:E0,event:cA,update:E0,action:qt,refineEvent:ik,publishNonRefinedEvent:!0});function ik(e,t,r,n){return{eventContent:{selected:YK(r),isFromClick:t.isFromClick||!1}}}QA("default",{});QA("dark",v6);var Xte={},hE=[],qte={registerPreprocessor:ek,registerProcessor:tk,registerPostInit:z6,registerPostUpdate:B6,registerUpdateLifecycle:Nx,registerAction:pa,registerCoordinateSystem:F6,registerLayout:V6,registerVisual:dl,registerTransform:W6,registerLoading:nk,registerMap:G6,registerImpl:xte,PRIORITY:L6,ComponentModel:$e,ComponentView:Mt,SeriesModel:bt,ChartView:gt,registerComponentModel:function(e){$e.registerClass(e)},registerComponentView:function(e){Mt.registerClass(e)},registerSeriesModel:function(e){bt.registerClass(e)},registerChartView:function(e){gt.registerClass(e)},registerCustomSeries:function(e,t){T6(e,t)},registerSubTypeDefaulter:function(e,t){$e.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){aF(e,t)}};function He(e){if(re(e)){j(e,function(t){He(t)});return}Ve(hE,e)>=0||(hE.push(e),we(e)&&(e={install:e}),e.install(qte))}function pd(e){return e==null?0:e.length||1}function fE(e){return e}var Zo=function(){function e(t,r,n,i,a,o){this._old=t,this._new=r,this._oldKeyGetter=n||fE,this._newKeyGetter=i||fE,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&&f===1)this._updateManyToOne&&this._updateManyToOne(c,u),i[l]=null;else if(h===1&&f>1)this._updateOneToMany&&this._updateOneToMany(c,u),i[l]=null;else if(h===1&&f===1)this._update&&this._update(c,u),i[l]=null;else if(h>1&&f>1)this._updateManyToMany&&this._updateManyToMany(c,u),i[l]=null;else if(h>1)for(var d=0;d1)for(var s=0;s30}var gd=ke,os=ae,rre=typeof Int32Array>"u"?Array:Int32Array,nre="e\0\0",dE=-1,ire=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],are=["_approximateExtent"],vE,Mm,md,yd,Yb,_d,Xb,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;U6(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===si;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),re(a)?a=a.slice():gd(a)&&(a=Q({},a)),i[r]=a),a},e.prototype.setItemVisual=function(t,r,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,gd(r)?Q(i,r):i[r]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(t,r){gd(t)?Q(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?Q(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;KC(n,this.dataType,t,r),this._graphicEls[t]=r},e.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},e.prototype.eachItemGraphicEl=function(t,r){j(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:os(this.dimensions,this._getDimInfo,this),this.hostModel)),Yb(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(t,r){var n=this[t];we(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var i=n.apply(this,arguments);return r.apply(this,[i].concat(ax(arguments)))})},e.internalField=function(){vE=function(t){var r=t._invertedIndicesMap;j(r,function(n,i){var a=t._dimInfos[i],o=a.ordinalMeta,s=t._store;if(o){n=r[i]=new rre(o.categories.length);for(var l=0;l1&&(l+="__ec__"+c),i[r]=l}}}(),e}();function ore(e,t){return bf(e,t).dimensions}function bf(e,t){GA(e)||(e=WA(e)),t=t||{};var r=t.coordDimensions||[],n=t.dimensionsDefine||e.dimensionsDefine||[],i=xe(),a=[],o=lre(e,r,n,t.dimensionsCount),s=t.canOmitUnusedDimensions&&Y6(o),l=n===e.dimensionsDefine,u=l?$6(e):Z6(n),c=t.encodeDefine;!c&&t.encodeDefaulter&&(c=t.encodeDefaulter(e,o));for(var h=xe(c),f=new qV(o),d=0;d0&&(n.name=i+(a-1)),a++,t.set(i,a)}}function lre(e,t,r,n){var i=Math.max(e.dimensionsDetectedCount||1,t.length,r.length,n||0);return j(t,function(a){var o;ke(a)&&(o=a.dimsDef)&&(i=Math.max(i,o.length))}),i}function ure(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 cre=function(){function e(t){this.coordSysDims=[],this.axisMap=xe(),this.categoryAxisMap=xe(),this.coordSysName=t}return e}();function hre(e){var t=e.get("coordinateSystem"),r=new cre(t),n=fre[t];if(n)return n(e,r,r.axisMap,r.categoryAxisMap),r}var fre={cartesian2d:function(e,t,r,n){var i=e.getReferringComponents("xAxis",Ht).models[0],a=e.getReferringComponents("yAxis",Ht).models[0];t.coordSysDims=["x","y"],r.set("x",i),r.set("y",a),Nc(i)&&(n.set("x",i),t.firstCategoryDimIndex=0),Nc(a)&&(n.set("y",a),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},singleAxis:function(e,t,r,n){var i=e.getReferringComponents("singleAxis",Ht).models[0];t.coordSysDims=["single"],r.set("single",i),Nc(i)&&(n.set("single",i),t.firstCategoryDimIndex=0)},polar:function(e,t,r,n){var i=e.getReferringComponents("polar",Ht).models[0],a=i.findAxisModel("radiusAxis"),o=i.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],r.set("radius",a),r.set("angle",o),Nc(a)&&(n.set("radius",a),t.firstCategoryDimIndex=0),Nc(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();j(a.parallelAxisIndex,function(s,l){var u=i.getComponent("parallelAxis",s),c=o[l];r.set(c,u),Nc(u)&&(n.set(c,u),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=l))})},matrix:function(e,t,r,n){var i=e.getReferringComponents("matrix",Ht).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 Nc(e){return e.get("type")==="category"}function X6(e,t,r){r=r||{};var n=r.byIndex,i=r.stackedCoordDimension,a,o,s;dre(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var l=!!(e&&e.get("stack")),u,c,h,f;if(j(a,function(x,w){he(x)&&(a[w]=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){h="__\0ecstackresult_"+e.id,f="__\0ecstackedover_"+e.id,u&&(u.createInvertedIndices=!0);var d=c.coordDim,g=c.type,m=0;j(a,function(x){x.coordDim===d&&m++});var y={name:h,coordDim:d,coordDimIndex:m,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},_={name:f,coordDim:f,coordDimIndex:m+1,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(y.storeDimIndex=s.ensureCalculationDimension(f,g),_.storeDimIndex=s.ensureCalculationDimension(h,g)),o.appendCalculationDimension(y),o.appendCalculationDimension(_)):(a.push(y),a.push(_))}return{stackedDimension:c&&c.name,stackedByDimension:u&&u.name,isStackedByIndex:n,stackedOverDimension:f,stackResultDimension:h}}function dre(e){return!U6(e.schema)}function $o(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}function ak(e,t){return $o(e,t)?e.getCalculationInfo("stackResultDimension"):t}function vre(e,t){var r=e.get("coordinateSystem"),n=mf.get(r),i;return t&&t.coordSysDims&&(i=ae(t.coordSysDims,function(a){var o={name:a},s=t.axisMap.get(a);if(s){var l=s.get("type");o.type=X0(l)}return o})),i||(i=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),i}function pre(e,t,r){var n,i;return r&&j(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 no(e,t,r){r=r||{};var n=t.getSourceManager(),i,a=!1;e?(a=!0,i=WA(e)):(i=n.getSource(),a=i.sourceFormat===si);var o=hre(t),s=vre(t,o),l=r.useEncodeDefaulter,u=we(l)?l:l?Fe(DV,s,t):null,c={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},h=bf(i,c),f=pre(h.dimensions,r.createInvertedIndices,o),d=a?null:n.getSharedDataStore(h),g=X6(t,{schema:h,store:d}),m=new dn(h,t);m.setCalculationInfo(g);var y=f!=null&&gre(i)?function(_,x,w,S){return S===f?w:this.defaultDimValueGetter(_,x,w,S)}:null;return m.hasItemOption=!1,m.initData(a?i:d,null,y),m}function gre(e){if(e.sourceFormat===si){var t=mre(e.data||[]);return!re(sf(t))}}function mre(e){for(var t=0;ti&&(o=a.interval=i);var s=a.intervalPrecision=hp(o),l=a.niceTickExtent=[ir(Math.ceil(e[0]/o)*o,s),ir(Math.floor(e[1]/o)*o,s)];return _re(l,e),a}function qb(e){var t=Math.pow(10,hx(e)),r=e/t;return r?r===2?r=3:r===3?r=5:r*=2:r=1,ir(r*t)}function hp(e){return ta(e)+2}function pE(e,t,r){e[t]=Math.max(Math.min(e[t],r[1]),r[0])}function _re(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),pE(e,0,t),pE(e,1,t),e[0]>e[1]&&(e[0]=e[1])}function ok(e,t){return e>=t[0]&&e<=t[1]}var xre=function(){function e(){this.normalize=gE,this.scale=mE}return e.prototype.updateMethods=function(t){t.hasBreaks()?(this.normalize=fe(t.normalize,t),this.scale=fe(t.scale,t)):(this.normalize=gE,this.scale=mE)},e}();function gE(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function mE(e,t){return e*(t[1]-t[0])+t[0]}function AT(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 vl=function(){function e(t){this._calculator=new xre,this._setting=t||{},this._extent=[1/0,-1/0];var r=vr();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=vr();r&&this._innerSetBreak(r.parseAxisBreakOption(t,fe(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}();fx(vl);var bre=0,fp=function(){function e(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++bre,this._onCollect=t.onCollect}return e.createByAxisModel=function(t){var r=t.option,n=r.data,i=n&&ae(n,wre);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(!he(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=xe(this.categories))},e}();function wre(e){return ke(e)&&e.value!=null?e.value:e+""}var Wh=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 fp({})),re(i)&&(i=new fp({categories:ae(i,function(a){return ke(a)?a.value:a})})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return t.prototype.parse=function(r){return r==null?NaN:he(r)?this._ordinalMeta.getOrdinal(r):Math.round(r)},t.prototype.contain=function(r){return ok(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}(vl);vl.registerClass(Wh);var ss=ir,Yo=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 ok(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=hp(r)},t.prototype.getTicks=function(r){r=r||{};var n=this._interval,i=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=vr(),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&&(h=ss(h+f*n,o))}if(l.length>0&&h===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:ss(d+n,o)}):l.push({value:i[1]})),s&&s.pruneTicksByBreak(r.pruneByBreak,l,this._brkCtx.breaks,function(g){return g.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]&&g0&&(a=a===null?s:Math.min(a,s))}r[n]=a}}return r}function Q6(e){var t=Tre(e),r=[];return j(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]),h=a.scale.getExtent(),f=Math.abs(h[1]-h[0]);s=u?c/f*u:c}else{var d=n.getData();s=Math.abs(o[1]-o[0])/d.count()}var g=ce(n.get("barWidth"),s),m=ce(n.get("barMaxWidth"),s),y=ce(n.get("barMinWidth")||(iG(n)?.5:1),s),_=n.get("barGap"),x=n.get("barCategoryGap"),w=n.get("defaultBarGap");r.push({bandWidth:s,barWidth:g,barMaxWidth:m,barMinWidth:y,barGap:_,barCategoryGap:x,defaultBarGap:w,axisKey:sk(a),stackId:K6(n)})}),eG(r)}function eG(e){var t={};j(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 h=n.barMaxWidth;h&&(l[u].maxWidth=h);var f=n.barMinWidth;f&&(l[u].minWidth=f);var d=n.barGap;d!=null&&(s.gap=d);var g=n.barCategoryGap;g!=null&&(s.categoryGap=g)});var r={};return j(t,function(n,i){r[i]={};var a=n.stacks,o=n.bandWidth,s=n.categoryGap;if(s==null){var l=Qe(a).length;s=Math.max(35-l*4,15)+"%"}var u=ce(s,o),c=ce(n.gap,1),h=n.remainedWidth,f=n.autoWidthCount,d=(h-u)/(f+(f-1)*c);d=Math.max(d,0),j(a,function(_){var x=_.maxWidth,w=_.minWidth;if(_.width){var S=_.width;x&&(S=Math.min(S,x)),w&&(S=Math.max(S,w)),_.width=S,h-=S+c*S,f--}else{var S=d;x&&xS&&(S=w),S!==d&&(_.width=S,h-=S+c*S,f--)}}),d=(h-u)/(f+(f-1)*c),d=Math.max(d,0);var g=0,m;j(a,function(_,x){_.width||(_.width=d),m=_,g+=_.width*(1+c)}),m&&(g-=m.width*c);var y=-g/2;j(a,function(_,x){r[i][x]=r[i][x]||{bandWidth:o,offset:y,width:_.width},y+=_.width*(1+c)})}),r}function Mre(e,t,r){if(e&&t){var n=e[sk(t)];return n}}function tG(e,t){var r=J6(e,t),n=Q6(r);j(r,function(i){var a=i.getData(),o=i.coordinateSystem,s=o.getBaseAxis(),l=K6(i),u=n[sk(s)][l],c=u.offset,h=u.width;a.setLayout({bandWidth:u.bandWidth,offset:c,size:h})})}function rG(e){return{seriesType:e,plan:yf(),reset:function(t){if(nG(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"),h=$o(r,u)&&!!r.getCalculationInfo("stackedOnSeries"),f=a.isHorizontal(),d=Are(i,a),g=iG(t),m=t.get("barMinHeight")||0,y=c&&r.getDimensionIndex(c),_=r.getLayout("size"),x=r.getLayout("offset");return{progress:function(w,S){for(var T=w.count,M=g&&Oa(T*3),A=g&&l&&Oa(T*3),P=g&&Oa(T),I=n.master.getRect(),N=f?I.width:I.height,D,O=S.getStore(),R=0;(D=w.next())!=null;){var F=O.get(h?y:o,D),H=O.get(s,D),W=d,V=void 0;h&&(V=+F-O.get(o,D));var z=void 0,Z=void 0,U=void 0,$=void 0;if(f){var Y=n.dataToPoint([F,H]);if(h){var te=n.dataToPoint([V,H]);W=te[0]}z=W,Z=Y[1]+x,U=Y[0]-W,$=_,Math.abs(U)0?r:1:r))}var kre=function(e,t,r,n){for(;r>>1;e[i][1]i&&(this._approxInterval=i);var o=Am.length,s=Math.min(kre(Am,this._approxInterval,0,o),o-1);this._interval=Am[s][1],this._intervalPrecision=hp(this._interval),this._minLevelUnit=Am[Math.max(s-1,0)][0]},t.prototype.parse=function(r){return rt(r)?r:+to(r)},t.prototype.contain=function(r){return ok(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}(Yo),Am=[["second",MA],["minute",AA],["hour",_v],["quarter-day",_v*6],["half-day",_v*12],["day",Ti*1.2],["half-week",Ti*3.5],["week",Ti*7],["month",Ti*31],["quarter",Ti*95],["half-year",sD/2],["year",sD]];function aG(e,t,r,n){return z0(new Date(t),e,n).getTime()===z0(new Date(r),e,n).getTime()}function Lre(e,t){return e/=Ti,e>16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function Nre(e){var t=30*Ti;return e/=t,e>6?6:e>3?3:e>2?2:1}function Pre(e){return e/=_v,e>12?12:e>6?6:e>3.5?4:e>2?2:1}function yE(e,t){return e/=t?AA:MA,e>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function Ire(e){return tA(e,!0)}function Dre(e,t,r){var n=Math.max(0,Ve($n,t)-1);return z0(new Date(e),$n[n],r).getTime()}function Ere(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 jre(e,t,r,n,i,a){var o=1e4,s=$J,l=0;function u(R,F,H,W,V,z,Z){for(var U=Ere(V,R),$=F,Y=new Date($);$o));)if(Y[V](Y[W]()+R),$=Y.getTime(),a){var te=a.calcNiceTickMultiple($,U);te>0&&(Y[V](Y[W]()+te*R),$=Y.getTime())}Z.push({value:$,notAdd:!0})}function c(R,F,H){var W=[],V=!F.length;if(!aG(xv(R),n[0],n[1],r)){V&&(F=[{value:Dre(n[0],R,r)},{value:n[1]}]);for(var z=0;z=n[0]&&Z<=n[1]&&u($,Z,U,Y,te,ie,W),R==="year"&&H.length>1&&z===0&&H.unshift({value:H[0].value-$})}}for(var z=0;z=n[0]&&S<=n[1]&&d++)}var T=i/t;if(d>T*1.5&&g>T/1.5||(h.push(x),d>T||e===s[m]))break}f=[]}}}for(var M=ot(ae(h,function(R){return ot(R,function(F){return F.value>=n[0]&&F.value<=n[1]&&!F.notAdd})}),function(R){return R.length>0}),A=[],P=M.length-1,m=0;m0;)a*=10;var s=[LT(Ore(n[0]/a)*a),LT(Rre(n[1]/a)*a)];this._interval=a,this._intervalPrecision=hp(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=Lm(r)/Lm(this.base),e.prototype.contain.call(this,r)},t.prototype.normalize=function(r){return r=Lm(r)/Lm(this.base),e.prototype.normalize.call(this,r)},t.prototype.scale=function(r){return r=e.prototype.scale.call(this,r),km(this.base,r)},t.prototype.setBreaksFromOption=function(r){var n=vr();if(n){var i=n.logarithmicParseBreaksFromOption(r,this.base,fe(this.parse,this)),a=i.parsedOriginal,o=i.parsedLogged;this._originalScale._innerSetBreak(a),this._innerSetBreak(o)}},t.type="log",t}(Yo);function Nm(e,t){return LT(e,ta(t))}vl.registerClass(oG);var zre=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 f=this._determinedMin,d=this._determinedMax;return f!=null&&(s=f,u=!0),d!=null&&(l=d,c=!0),{min:s,max:l,minFixed:u,maxFixed:c,isBlank:h}},e.prototype.modifyDataMinMax=function(t,r){this[Fre[t]]=r},e.prototype.setDeterminedMinMax=function(t,r){var n=Bre[t];this[n]=r},e.prototype.freeze=function(){this.frozen=!0},e}(),Bre={min:"_determinedMin",max:"_determinedMax"},Fre={min:"_dataMin",max:"_dataMax"};function sG(e,t,r){var n=e.rawExtentInfo;return n||(n=new zre(e,t,r),e.rawExtentInfo=n,n)}function Pm(e,t){return t==null?null:Xr(t)?NaN:e.parse(t)}function lG(e,t){var r=e.type,n=sG(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=J6("bar",o),l=!1;if(j(s,function(h){l=l||h.getBaseAxis()===t.axis}),l){var u=Q6(s),c=Vre(i,a,t,u);i=c.min,a=c.max}}return{extent:[i,a],fixMin:n.minFixed,fixMax:n.maxFixed}}function Vre(e,t,r,n){var i=r.axis.getExtent(),a=Math.abs(i[1]-i[0]),o=Mre(n,r.axis);if(o===void 0)return{min:e,max:t};var s=1/0;j(o,function(d){s=Math.min(d.offset,s)});var l=-1/0;j(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,h=1-(s+l)/a,f=c/h-c;return t+=f*(l/u),e-=f*(s/u),{min:e,max:t}}function Gu(e,t){var r=t,n=lG(e,r),i=n.extent,a=r.get("splitNumber");e instanceof oG&&(e.base=r.get("logBase"));var o=e.type,s=r.get("interval"),l=o==="interval"||o==="time";e.setBreaksFromOption(cG(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 Xp(e,t){if(t=t||e.get("type"),t)switch(t){case"category":return new Wh({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new lk({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new(vl.getClass(t)||Yo)}}function Gre(e){var t=e.scale.getExtent(),r=t[0],n=t[1];return!(r>0&&n>0||r<0&&n<0)}function wf(e){var t=e.getLabelModel().get("formatter");if(e.type==="time"){var r=YJ(t);return function(i,a){return e.scale.getFormattedLabel(i,a,r)}}else{if(he(t))return function(i){var a=e.scale.getLabel(i),o=t.replace("{value}",a??"");return o};if(we(t)){if(e.type==="category")return function(i,a){return t(q0(e,i),i.value-e.scale.getExtent()[0],null)};var n=vr();return function(i,a){var o=null;return n&&(o=n.makeAxisLabelFormatterParamBreak(o,i.break)),t(q0(e,i),a,o)}}else return function(i){return e.scale.getLabel(i)}}}function q0(e,t){return e.type==="category"?e.scale.getLabel(t):t.value}function uk(e){var t=e.get("interval");return t??"auto"}function uG(e){return e.type==="category"&&uk(e.getLabelModel())===0}function K0(e,t){var r={};return j(e.mapDimensionsAll(t),function(n){r[ak(e,n)]=!0}),Qe(r)}function Wre(e,t,r){t&&j(K0(t,r),function(n){var i=t.getApproximateExtent(n);i[0]e[1]&&(e[1]=i[1])})}function Hh(e){return e==="middle"||e==="center"}function dp(e){return e.getShallow("show")}function cG(e){var t=e.get("breaks",!0);if(t!=null)return!vr()||!Hre(e.axis)?void 0:t}function Hre(e){return(e.dim==="x"||e.dim==="y"||e.dim==="z"||e.dim==="single")&&e.type!=="category"}var Sf=function(){function e(){}return e.prototype.getNeedCrossZero=function(){var t=this.option;return!t.scale},e.prototype.getCoordSysModel=function(){},e}();function Ure(e){return no(null,e)}var Zre={isDimensionStacked:$o,enableDataStack:X6,getStackedDimension:ak};function $re(e,t){var r=t;t instanceof qe||(r=new qe(t));var n=Xp(r);return n.setExtent(e[0],e[1]),Gu(n,r),n}function Yre(e){Qt(e,Sf)}function Xre(e,t){return t=t||{},Ct(e,null,null,t.state!=="normal")}const qre=Object.freeze(Object.defineProperty({__proto__:null,createDimensions:ore,createList:Ure,createScale:$re,createSymbol:sr,createTextStyle:Xre,dataStack:Zre,enableHoverEmphasis:Hs,getECData:De,getLayoutRect:It,mixinAxisModelCommonMethods:Yre},Symbol.toStringTag,{value:"Module"}));var Kre=1e-8;function _E(e,t){return Math.abs(e-t)i&&(n=o,i=l)}if(n)return Qre(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 j(o,function(s){s.type==="polygon"?xE(s.exterior,i,a,r):j(s.points,function(l){xE(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 Pe(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 NT(e,t){return e=tne(e),ae(ot(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 bE(o[0],o.slice(1)));break;case"MultiPolygon":j(i.coordinates,function(l){l[0]&&a.push(new bE(l[0],l.slice(1)))});break;case"LineString":a.push(new wE([i.coordinates]));break;case"MultiLineString":a.push(new wE(i.coordinates))}var s=new fG(n[t||"name"],a,n.cp);return s.properties=n,s})}const rne=Object.freeze(Object.defineProperty({__proto__:null,MAX_SAFE_INTEGER:HC,asc:Qn,getPercentWithPrecision:bq,getPixelPrecision:QM,getPrecision:ta,getPrecisionSafe:uF,isNumeric:rA,isRadianAroundZero:Oh,linearMap:ht,nice:tA,numericToNumber:Xa,parseDate:to,parsePercent:ce,quantile:Ly,quantity:hF,quantityExponent:hx,reformIntervals:UC,remRadian:eA,round:ir},Symbol.toStringTag,{value:"Module"})),nne=Object.freeze(Object.defineProperty({__proto__:null,format:Zp,parse:to,roundTime:z0},Symbol.toStringTag,{value:"Module"})),ine=Object.freeze(Object.defineProperty({__proto__:null,Arc:Wp,BezierCurve:hf,BoundingRect:Pe,Circle:ro,CompoundPath:Hp,Ellipse:Gp,Group:Ce,Image:Er,IncrementalDisplayable:KF,Line:ar,LinearGradient:qu,Polygon:en,Polyline:Gr,RadialGradient:pA,Rect:Ze,Ring:cf,Sector:Qr,Text:tt,clipPointsByRect:_A,clipRectByRect:rV,createIcon:df,extendPath:eV,extendShape:QF,getShapeClass:ip,getTransform:Us,initProps:Nt,makeImage:mA,makePath:Bh,mergePath:qn,registerShape:Fi,resizePath:yA,updateProps:it},Symbol.toStringTag,{value:"Module"})),ane=Object.freeze(Object.defineProperty({__proto__:null,addCommas:EA,capitalFirst:nQ,encodeHTML:hn,formatTime:rQ,formatTpl:RA,getTextRect:eQ,getTooltipMarker:_V,normalizeCssArray:gf,toCamelCase:jA,truncateText:eK},Symbol.toStringTag,{value:"Module"})),one=Object.freeze(Object.defineProperty({__proto__:null,bind:fe,clone:Se,curry:Fe,defaults:Ae,each:j,extend:Q,filter:ot,indexOf:Ve,inherits:UM,isArray:re,isFunction:we,isObject:ke,isString:he,map:ae,merge:Ge,reduce:Ei},Symbol.toStringTag,{value:"Module"}));var sne=Ye(),wv=Ye(),da={estimate:1,determine:2};function J0(e){return{out:{noPxChangeTryDetermine:[]},kind:e}}function vG(e,t){var r=ae(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 lne(e,t){var r=e.getLabelModel().get("customValues");if(r){var n=wf(e),i=e.scale.getExtent(),a=vG(e,r),o=ot(a,function(s){return s>=i[0]&&s<=i[1]});return{labels:ae(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"?cne(e,t):fne(e)}function une(e,t,r){var n=e.getTickModel().get("customValues");if(n){var i=e.scale.getExtent(),a=vG(e,n);return{ticks:ot(a,function(o){return o>=i[0]&&o<=i[1]})}}return e.type==="category"?hne(e,t):{ticks:ae(e.scale.getTicks(r),function(o){return o.value})}}function cne(e,t){var r=e.getLabelModel(),n=pG(e,r,t);return!r.get("show")||e.scale.isBlank()?{labels:[]}:n}function pG(e,t,r){var n=vne(e),i=uk(t),a=r.kind===da.estimate;if(!a){var o=mG(n,i);if(o)return o}var s,l;we(i)?s=xG(e,i):(l=i==="auto"?pne(e,r):i,s=_G(e,l));var u={labels:s,labelCategoryInterval:l};return a?r.out.noPxChangeTryDetermine.push(function(){return PT(n,i,u),!0}):PT(n,i,u),u}function hne(e,t){var r=dne(e),n=uk(t),i=mG(r,n);if(i)return i;var a,o;if((!t.get("show")||e.scale.isBlank())&&(a=[]),we(n))a=xG(e,n,!0);else if(n==="auto"){var s=pG(e,e.getLabelModel(),J0(da.determine));o=s.labelCategoryInterval,a=ae(s.labels,function(l){return l.tickValue})}else o=n,a=_G(e,o,!0);return PT(r,n,{ticks:a,tickCategoryInterval:o})}function fne(e){var t=e.scale.getTicks(),r=wf(e);return{labels:ae(t,function(n,i){return{formattedLabel:r(n,i),rawLabel:e.scale.getLabel(n),tickValue:n.value,time:n.time,break:n.break}})}}var dne=gG("axisTick"),vne=gG("axisLabel");function gG(e){return function(r){return wv(r)[e]||(wv(r)[e]={list:[]})}}function mG(e,t){for(var r=0;rc&&(u=Math.max(1,Math.floor(l/c)));for(var h=s[0],f=e.dataToCoord(h+1)-e.dataToCoord(h),d=Math.abs(f*Math.cos(a)),g=Math.abs(f*Math.sin(a)),m=0,y=0;h<=s[1];h+=u){var _=0,x=0,w=ux(i({value:h}),n.font,"center","top");_=w.width*1.3,x=w.height*1.3,m=Math.max(m,_,7),y=Math.max(y,x,7)}var S=m/d,T=y/g;isNaN(S)&&(S=1/0),isNaN(T)&&(T=1/0);var M=Math.max(0,Math.floor(Math.min(S,T)));if(r===da.estimate)return t.out.noPxChangeTryDetermine.push(fe(mne,null,e,M,l)),M;var A=yG(e,M,l);return A??M}function mne(e,t,r){return yG(e,t,r)==null}function yG(e,t,r){var n=sne(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 yne(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 _G(e,t,r){var n=wf(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 h=uG(e),f=o.get("showMinLabel")||h,d=o.get("showMaxLabel")||h;f&&u!==a[0]&&m(a[0]);for(var g=u;g<=a[1];g+=l)m(g);d&&g-l!==a[1]&&m(a[1]);function m(y){var _={value:y};s.push(r?y:{formattedLabel:n(_),rawLabel:i.getLabel(_),tickValue:y,time:void 0,break:void 0})}return s}function xG(e,t,r){var n=e.scale,i=wf(e),a=[];return j(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 SE=[0,1],Vi=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 QM(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(),CE(n,i.count())),ht(t,SE,n,r)},e.prototype.coordToData=function(t,r){var n=this._extent,i=this.scale;this.onBand&&i.type==="ordinal"&&(n=n.slice(),CE(n,i.count()));var a=ht(t,n,SE,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=une(this,r,{breakTicks:t.breakTicks,pruneByBreak:t.pruneByBreak}),i=n.ticks,a=ae(i,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=r.get("alignWithLabel");return _ne(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=ae(n,function(a){return ae(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return i},e.prototype.getViewLabels=function(t){return t=t||J0(da.determine),lne(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||J0(da.determine),gne(this,t)},e}();function CE(e,t){var r=e[1]-e[0],n=t,i=r/n/2;e[0]+=i,e[1]-=i}function _ne(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;j(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 h=a[0]>a[1];f(t[0].coord,a[0])&&(n?t[0].coord=a[0]:t.shift()),n&&f(a[0],t[0].coord)&&t.unshift({coord:a[0],onBand:!0}),f(a[1],o.coord)&&(n?o.coord=a[1]:t.pop()),n&&f(o.coord,a[1])&&t.push({coord:a[1],onBand:!0});function f(d,g){return d=ir(d),g=ir(g),h?d>g:di&&(i+=xd);var d=Math.atan2(s,o);if(d<0&&(d+=xd),d>=n&&d<=i||d+xd>=n&&d+xd<=i)return l[0]=c,l[1]=h,u-r;var g=r*Math.cos(n)+e,m=r*Math.sin(n)+t,y=r*Math.cos(i)+e,_=r*Math.sin(i)+t,x=(g-o)*(g-o)+(m-s)*(m-s),w=(y-o)*(y-o)+(_-s)*(_-s);return x0){t=t/180*Math.PI,ra.fromArray(e[0]),kt.fromArray(e[1]),rr.fromArray(e[2]),Ne.sub(za,ra,kt),Ne.sub(Ea,rr,kt);var r=za.len(),n=Ea.len();if(!(r<.001||n<.001)){za.scale(1/r),Ea.scale(1/n);var i=za.dot(Ea),a=Math.cos(t);if(a1&&Ne.copy(xn,rr),xn.toArray(e[1])}}}}function Lne(e,t,r){if(r<=180&&r>0){r=r/180*Math.PI,ra.fromArray(e[0]),kt.fromArray(e[1]),rr.fromArray(e[2]),Ne.sub(za,kt,ra),Ne.sub(Ea,rr,kt);var n=za.len(),i=Ea.len();if(!(n<.001||i<.001)){za.scale(1/n),Ea.scale(1/i);var a=za.dot(t),o=Math.cos(r);if(a=l)Ne.copy(xn,rr);else{xn.scaleAndAdd(Ea,s/Math.tan(Math.PI/2-c));var h=rr.x!==kt.x?(xn.x-kt.x)/(rr.x-kt.x):(xn.y-kt.y)/(rr.y-kt.y);if(isNaN(h))return;h<0?Ne.copy(xn,kt):h>1&&Ne.copy(xn,rr)}xn.toArray(e[1])}}}}function Qb(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 Nne(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=To(n[0],n[1]),a=To(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=fv([],n[1],n[0],o/i),l=fv([],n[1],n[2],o/a),u=fv([],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(N*I,0,a);var D=N+A;D<0&&T(-D*I,1)}else T(-A*I,1)}}function S(A,P,I){A!==0&&(c=!0);for(var N=P;N0)for(var D=0;D0;D--){var H=I[D-1]*F;S(-H,D,a)}}}function M(A){var P=A<0?-1:1;A=Math.abs(A);for(var I=Math.ceil(A/(a-1)),N=0;N0?S(I,0,N+1):S(-I,a-N-1,a),A-=I,A<=0)return}return c}function Dne(e){for(var t=0;t=0&&n.attr(a.oldLayoutSelect),Ve(f,"emphasis")>=0&&n.attr(a.oldLayoutEmphasis)),it(n,u,r,l)}else if(n.attr(u),!vf(n).valueAnimation){var h=be(n.style.opacity,1);n.style.opacity=0,Nt(n,{style:{opacity:h}},r,l)}if(a.oldLayout=u,n.states.select){var d=a.oldLayoutSelect={};Im(d,u,Dm),Im(d,n.states.select,Dm)}if(n.states.emphasis){var g=a.oldLayoutEmphasis={};Im(g,u,Dm),Im(g,n.states.emphasis,Dm)}lV(n,l,c,r,r)}if(i&&!i.ignore&&!i.invisible){var a=Rne(i),o=a.oldLayout,m={points:i.shape.points};o?(i.attr({shape:o}),it(i,{shape:m},r)):(i.setShape(m),i.style.strokePercent=0,Nt(i,{style:{strokePercent:1}},r)),a.oldLayout=m}},e}(),rw=Ye();function zne(e){e.registerUpdateLifecycle("series:beforeupdate",function(t,r,n){var i=rw(r).labelManager;i||(i=rw(r).labelManager=new One),i.clearLabels()}),e.registerUpdateLifecycle("series:layoutlabels",function(t,r,n){var i=rw(r).labelManager;n.updatedSeries.forEach(function(a){i.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),i.updateLayoutConfig(r),i.layout(r),i.processLabelsOverall()})}var nw=Math.sin,iw=Math.cos,AG=Math.PI,Ul=Math.PI*2,Bne=180/AG,kG=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,h=Math.abs(u),f=ks(h-Ul)||(c?u>=Ul:-u>=Ul),d=u>0?u%Ul:u%Ul+Ul,g=!1;f?g=!0:ks(h)?g=!1:g=d>=AG==!!c;var m=t+n*iw(o),y=r+i*nw(o);this._start&&this._add("M",m,y);var _=Math.round(a*Bne);if(f){var x=1/this._p,w=(c?1:-1)*(Ul-x);this._add("A",n,i,_,1,+c,t+n*iw(o+w),r+i*nw(o+w)),x>.01&&this._add("A",n,i,_,0,+c,m,y)}else{var S=t+n*iw(s),T=r+i*nw(s);this._add("A",n,i,_,+g,+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=[],h=this._p,f=1;f"}function Yne(e){return""}function dk(e,t){t=t||{};var r=t.newline?` +`];function gr(e,t){return t.type=e,t}function pT(e){return e.type==="section"}function t6(e){return pT(e)?fee:dee}function r6(e){if(pT(e)){var t=0,r=e.blocks.length,n=r>1||r>0&&!e.noHeader;return j(e.blocks,function(i){var a=r6(i);a>=t&&(t=a+ +(n&&(!a||pT(i)&&!i.noHeader)))}),t}return 0}function fee(e,t,r,n){var i=t.noHeader,a=vee(r6(t)),o=[],s=t.blocks||[];Jr(!s||re(s)),s=s||[];var l=e.orderMode;if(t.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(ge(u,l)){var c=new YV(u[l],null);s.sort(function(m,y){return c.evaluate(m.sortParam,y.sortParam)})}else l==="seriesDesc"&&s.reverse()}j(s,function(m,y){var x=t.valueFormatter,_=t6(m)(x?Q(Q({},e),{valueFormatter:x}):e,m,y>0?a.html:0,n);_!=null&&o.push(_)});var h=e.renderMode==="richText"?o.join(a.richText):gT(n,o.join(""),i?r:a.html);if(i)return h;var f=uT(t.header,"ordinal",e.useUTC),d=e6(n,e.renderMode).nameStyle,g=QV(n);return e.renderMode==="richText"?n6(e,f,d)+a.richText+h:gT(n,'
'+hn(f)+"
"+h,r)}function dee(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=re(S)?S:[S],ae(S,function(T,M){return uT(T,re(d)?d[M]:d,u)})};if(!(a&&o)){var h=s?"":e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||K.color.secondary,i),f=a?"":uT(l,"ordinal",u),d=t.valueType,g=o?[]:c(t.value,t.dataIndex),m=!s||!a,y=!s&&a,x=e6(n,i),_=x.nameStyle,w=x.valueStyle;return i==="richText"?(s?"":h)+(a?"":n6(e,f,_))+(o?"":mee(e,g,m,y,w)):gT(n,(s?"":h)+(a?"":pee(f,!s,_))+(o?"":gee(g,m,y,w)),r)}}function ED(e,t,r,n,i,a){if(e){var o=t6(e),s={useUTC:i,renderMode:r,orderMode:n,markupStyleCreator:t,valueFormatter:e.valueFormatter};return o(s,e,0,a)}}function vee(e){return{html:cee[e],richText:hee[e]}}function gT(e,t,r){var n='
',i="margin: "+r+"px 0 0",a=QV(e);return'
'+t+n+"
"}function pee(e,t,r){var n=t?"margin-left:2px":"";return''+hn(e)+""}function gee(e,t,r,n){var i=r?"10px":"20px",a=t?"float:right;margin-left:"+i:"";return e=re(e)?e:[e],''+ae(e,function(o){return hn(o)}).join("  ")+""}function n6(e,t,r){return e.markupStyleCreator.wrapRichTextStyle(t,r)}function mee(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(re(t)?t.join(" "):t,a)}function i6(e,t){var r=e.getData().getItemVisual(t,"style"),n=r[e.visualDrawType];return Vu(n)}function a6(e,t){var r=e.get("padding");return r??(t==="richText"?[8,10]:10)}var Bb=function(){function e(){this.richTextStyles={},this._nextStyleNameId=fF()}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=xV({color:r,type:t,renderMode:n,markerId:i});return he(a)?a:(this.richTextStyles[i]=a.style,a.content)},e.prototype.wrapRichTextStyle=function(t,r){var n={};re(r)?j(r,function(a){return Q(n,a)}):Q(n,r);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},e}();function o6(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=re(s),u=i6(t,r),c,h,f,d;if(o>1||l&&!o){var g=yee(s,t,r,a,u);c=g.inlineValues,h=g.inlineValueTypes,f=g.blocks,d=g.inlineValues[0]}else if(o){var m=i.getDimensionInfo(a[0]);d=c=Vh(i,r,a[0]),h=m.type}else d=c=l?s[0]:s;var y=nA(t),x=y&&t.name||"",_=i.getName(r),w=n?x:_;return gr("section",{header:x,noHeader:n||!y,sortParam:d,blocks:[gr("nameValue",{markerType:"item",markerColor:u,name:w,noName:!Jn(w),value:c,valueType:h,dataIndex:r})].concat(f||[])})}function yee(e,t,r,n,i){var a=t.getData(),o=Ei(e,function(h,f,d){var g=a.getDimensionInfo(d);return h=h||g&&g.tooltip!==!1&&g.displayName!=null},!1),s=[],l=[],u=[];n.length?j(n,function(h){c(Vh(a,r,h),h)}):j(e,c);function c(h,f){var d=a.getDimensionInfo(f);!d||d.otherDims.tooltip===!1||(o?u.push(gr("nameValue",{markerType:"subItem",markerColor:i,name:d.displayName,value:h,valueType:d.type})):(s.push(h),l.push(d.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var as=Ye();function xm(e,t){return e.getName(t)||e.getId(t)}var Ry="__universalTransitionEnabled",bt=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=bv({count:_ee,reset:bee}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,i);var a=as(this).sourceManager=new JV(this);a.prepareSource();var o=this.getInitialData(r,i);RD(o,this),this.dataTask.context.data=o,as(this).dataBeforeProcessed=o,jD(this),this._initSelectedMapFromData(o)},t.prototype.mergeDefaultAndTheme=function(r,n){var i=op(this),a=i?Ju(r):{},o=this.subType;$e.hasClass(o)&&(o+="Series"),Ge(r,n.getTheme().get(this.subType)),Ge(r,this.getDefaultOption()),ju(r,"label",["show"]),this.fillDataTextStyle(r.data),i&&Ka(r,a,i)},t.prototype.mergeOption=function(r,n){r=Ge(this.option,r,!0),this.fillDataTextStyle(r.data);var i=op(this);i&&Ka(this.option,r,i);var a=as(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(r,n);RD(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,as(this).dataBeforeProcessed=o,jD(this),this._initSelectedMapFromData(o)},t.prototype.fillDataTextStyle=function(r){if(r&&!Sn(r))for(var n=["show"],i=0;i=0&&f<0)&&(h=_,f=x,d=0),x===f&&(c[d++]=m))}),c.length=d,c},t.prototype.formatTooltip=function(r,n,i){return o6({series:this,dataIndex:r,multipleSeries:n})},t.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(Je.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=FA.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[xm(a,r)])&&!a.getItemModel(r).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this[Ry])return!0;var r=this.option.universalTransition;return r?r===!0?!0:r&&r.enabled:!1},t.prototype._innerSelect=function(r,n){var i,a,o=this.option,s=o.selectedMode,l=n.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){ke(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,c=0;c0&&this._innerSelect(r,n)}},t.registerClass=function(r){return $e.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}($e);Qt(bt,M_);Qt(bt,FA);wF(bt,$e);function jD(e){var t=e.name;nA(e)||(e.name=xee(e)||t)}function xee(e){var t=e.getRawData(),r=t.mapDimensionsAll("seriesName"),n=[];return j(r,function(i){var a=t.getDimensionInfo(i);a.displayName&&n.push(a.displayName)}),n.join(" ")}function _ee(e){return e.model.getRawData().count()}function bee(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),wee}function wee(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function RD(e,t){j(Eh(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(r){e.wrapMethod(r,Fe(See,t))})}function See(e,t){var r=mT(e);return r&&r.setOutputEnd((t||this).count()),t}function mT(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 Mt=function(){function e(){this.group=new Ce,this.uid=pf("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}();aA(Mt);d_(Mt);function yf(){var e=Ye();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 s6=Ye(),Cee=yf(),gt=function(){function e(){this.group=new Ce,this.uid=pf("viewChart"),this.renderTask=bv({plan:Tee,reset:Mee}),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&&zD(a,i,"emphasis")},e.prototype.downplay=function(t,r,n,i){var a=t.getData(i&&i.dataType);a&&zD(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){hl(this.group,t)},e.markUpdateMethod=function(t,r){s6(t).updateMethod=r},e.protoInitialize=function(){var t=e.prototype;t.type="chart"}(),e}();function OD(e,t,r){e&&np(e)&&(t==="emphasis"?Ho:Uo)(e,r)}function zD(e,t,r){var n=Ru(e,t),i=t&&t.highlightKey!=null?JK(t.highlightKey):null;n!=null?j(Tt(n),function(a){OD(e.getItemGraphicEl(a),r,i)}):e.eachItemGraphicEl(function(a){OD(a,r,i)})}aA(gt);d_(gt);function Tee(e){return Cee(e.model)}function Mee(e){var t=e.model,r=e.ecModel,n=e.api,i=e.payload,a=t.pipelineContext.progressiveRender,o=e.view,s=i&&s6(i).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](t,r,n,i),Aee[l]}var Aee={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)}}},F0="\0__throttleOriginMethod",BD="\0__throttleRate",FD="\0__throttleType";function k_(e,t,r){var n,i=0,a=0,o=null,s,l,u,c;t=t||0;function h(){a=new Date().getTime(),o=null,e.apply(l,u||[])}var f=function(){for(var d=[],g=0;g=0?h():o=setTimeout(h,-s),i=n};return f.clear=function(){o&&(clearTimeout(o),o=null)},f.debounceNextCall=function(d){c=d},f}function xf(e,t,r,n){var i=e[t];if(i){var a=i[F0]||i,o=i[FD],s=i[BD];if(s!==r||o!==n){if(r==null||!n)return e[t]=a;i=e[t]=k_(a,r,n==="debounce"),i[F0]=a,i[FD]=n,i[BD]=r}return i}}function lp(e,t){var r=e[t];r&&r[F0]&&(r.clear&&r.clear(),e[t]=r[F0])}var VD=Ye(),GD={itemStyle:Ou(cV,!0),lineStyle:Ou(uV,!0)},kee={lineStyle:"stroke",itemStyle:"fill"};function l6(e,t){var r=e.visualStyleMapper||GD[t];return r||(console.warn("Unknown style type '"+t+"'."),GD.itemStyle)}function u6(e,t){var r=e.visualDrawType||kee[t];return r||(console.warn("Unknown style type '"+t+"'."),"fill")}var Lee={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=e.getModel(n),a=l6(e,n),o=a(i),s=i.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=u6(e,n),u=o[l],c=we(u)?u:null,h=o.fill==="auto"||o.stroke==="auto";if(!o[l]||c||h){var f=e.getColorFromPalette(e.name,null,t.getSeriesCount());o[l]||(o[l]=f,r.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||we(o.fill)?f:o.fill,o.stroke=o.stroke==="auto"||we(o.stroke)?f:o.stroke}if(r.setVisual("style",o),r.setVisual("drawType",l),!t.isSeriesFiltered(e)&&c)return r.setVisual("colorFromPalette",!1),{dataEach:function(d,g){var m=e.getDataParams(g),y=Q({},o);y[l]=c(m),d.setItemVisual(g,"style",y)}}}},dd=new qe,Nee={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!(e.ignoreStyleOnData||t.isSeriesFiltered(e))){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=l6(e,n),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){dd.option=l[n];var u=i(dd),c=o.ensureUniqueItemVisual(s,"style");Q(c,u),dd.option.decal&&(o.setItemVisual(s,"decal",dd.option.decal),dd.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},Pee={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)),VD(r).scope=a}}),e.eachSeries(function(r){if(!(r.isColorBySeries()||e.isSeriesFiltered(r))){var n=r.getRawData(),i={},a=r.getData(),o=VD(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=u6(r,s);a.each(function(u){var c=a.getRawIndex(u);i[c]=u}),n.each(function(u){var c=i[u],h=a.getItemVisual(c,"colorFromPalette");if(h){var f=a.ensureUniqueItemVisual(c,"style"),d=n.getName(u)||u+"",g=n.count();f[l]=r.getColorFromPalette(d,o,g)}})}})}},_m=Math.PI;function Iee(e,t){t=t||{},Ae(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 Ce,n=new Ze({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});r.add(n);var i=new tt({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 Ze({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 Wp({shape:{startAngle:-_m/2,endAngle:-_m/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:_m*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:_m*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 c6=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;j(this._allHandlers,function(i){var a=t.get(i.uid)||t.set(i.uid,{}),o="";Jr(!(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;j(t,function(l,u){if(!(i.visualType&&i.visualType!==l.visualType)){var c=o._stageTaskMap.get(l.uid),h=c.seriesTaskMap,f=c.overallTask;if(f){var d,g=f.agentStubMap;g.each(function(y){s(i,y)&&(y.dirty(),d=!0)}),d&&f.dirty(),o.updatePayload(f,n);var m=o.getPerformArgs(f,i.block);g.each(function(y){y.perform(m)}),f.perform(m)&&(a=!0)}else h&&h.each(function(y,x){s(i,y)&&y.dirty();var _=o.getPerformArgs(y,i.block);_.skip=!l.performRawSeries&&r.isSeriesFiltered(y.context.model),o.updatePayload(y,n),y.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(h){var f=h.uid,d=s.set(f,o&&o.get(f)||bv({plan:Oee,reset:zee,count:Fee}));d.context={model:h,ecModel:n,api:i,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:a},a._pipe(h,d)}},e.prototype._createOverallStageTask=function(t,r,n,i){var a=this,o=r.overallTask=r.overallTask||bv({reset:Dee});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,h=!0,f=!1,d="";Jr(!t.createOnAllSeries,d),u?n.eachRawSeriesByType(u,g):c?c(n,i).each(g):(h=!1,j(n.getSeries(),g));function g(m){var y=m.uid,x=l.set(y,s&&s.get(y)||(f=!0,bv({reset:Eee,onDirty:Ree})));x.context={model:m,overallProgress:h},x.agent=o,x.__block=h,a._pipe(m,x)}f&&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 we(t)&&(t={overallReset:t,seriesType:Vee(t)}),t.uid=pf("stageHandler"),r&&(t.visualType=r),t},e}();function Dee(e){e.overallReset(e.ecModel,e.api,e.payload)}function Eee(e){return e.overallProgress&&jee}function jee(){this.agent.dirty(),this.getDownstream().dirty()}function Ree(){this.agent&&this.agent.dirty()}function Oee(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function zee(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=Tt(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?ae(t,function(r,n){return h6(n)}):Bee}var Bee=h6(0);function h6(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-f.length){var g=u.slice(0,d);g!=="data"&&(r.mainType=g,r[f.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(h,f,d,g){return h[d]==null||f[g||d]===h[d]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),yT=["symbol","symbolSize","symbolRotate","symbolOffset"],HD=yT.concat(["symbolKeepAspect"]),Hee={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&&pu(l)?l:.5;var u=e.createRadialGradient(o,s,0,o,s,l);return u}function xT(e,t,r){for(var n=t.type==="radial"?ate(e,t,r):ite(e,t,r),i=t.colorStops,a=0;a0)?null:e==="dashed"?[4*t,2*t]:e==="dotted"?[t]:rt(e)?[e]:re(e)?e:null}function $A(e){var t=e.style,r=t.lineDash&&t.lineWidth>0&&ste(t.lineDash,t.lineWidth),n=t.lineDashOffset;if(r){var i=t.strokeNoScale&&e.getLineScale?e.getLineScale():1;i&&i!==1&&(r=ae(r,function(a){return a/i}),n/=i)}return[r,n]}var lte=new qa(!0);function W0(e){var t=e.stroke;return!(t==null||t==="none"||!(e.lineWidth>0))}function UD(e){return typeof e=="string"&&e!=="none"}function H0(e){var t=e.fill;return t!=null&&t!=="none"}function ZD(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 $D(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 _T(e,t,r){var n=oA(t.image,t.__image,r);if(v_(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)*cv),a.scaleSelf(t.scaleX||1,t.scaleY||1),i.setTransform(a)}return i}}function ute(e,t,r,n){var i,a=W0(r),o=H0(r),s=r.strokePercent,l=s<1,u=!t.path;(!t.silent||l)&&u&&t.createPathProxy();var c=t.path||lte,h=t.__dirty;if(!n){var f=r.fill,d=r.stroke,g=o&&!!f.colorStops,m=a&&!!d.colorStops,y=o&&!!f.image,x=a&&!!d.image,_=void 0,w=void 0,S=void 0,T=void 0,M=void 0;(g||m)&&(M=t.getBoundingRect()),g&&(_=h?xT(e,f,M):t.__canvasFillGradient,t.__canvasFillGradient=_),m&&(w=h?xT(e,d,M):t.__canvasStrokeGradient,t.__canvasStrokeGradient=w),y&&(S=h||!t.__canvasFillPattern?_T(e,f,t):t.__canvasFillPattern,t.__canvasFillPattern=S),x&&(T=h||!t.__canvasStrokePattern?_T(e,d,t):t.__canvasStrokePattern,t.__canvasStrokePattern=T),g?e.fillStyle=_:y&&(S?e.fillStyle=S:o=!1),m?e.strokeStyle=w:x&&(T?e.strokeStyle=T:a=!1)}var A=t.getGlobalScale();c.setScale(A[0],A[1],t.segmentIgnoreThreshold);var P,I;e.setLineDash&&r.lineDash&&(i=$A(t),P=i[0],I=i[1]);var N=!0;(u||h&Wc)&&(c.setDPR(e.dpr),l?c.setContext(null):(c.setContext(e),N=!1),c.reset(),t.buildPath(c,t.shape,n),c.toStatic(),t.pathUpdated()),N&&c.rebuildPath(e,l?s:1),P&&(e.setLineDash(P),e.lineDashOffset=I),n||(r.strokeFirst?(a&&$D(e,r),o&&ZD(e,r)):(o&&ZD(e,r),a&&$D(e,r))),P&&e.setLineDash([])}function cte(e,t,r){var n=t.__image=oA(r.image,t.__image,t,t.onload);if(!(!n||!v_(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,h=o-u,f=s-c;e.drawImage(n,u,c,h,f,i,a,o,s)}else e.drawImage(n,i,a,o,s)}}function hte(e,t,r){var n,i=r.text;if(i!=null&&(i+=""),i){e.font=r.font||Go,e.textAlign=r.textAlign,e.textBaseline=r.textBaseline;var a=void 0,o=void 0;e.setLineDash&&r.lineDash&&(n=$A(t),a=n[0],o=n[1]),a&&(e.setLineDash(a),e.lineDashOffset=o),r.strokeFirst?(W0(r)&&e.strokeText(i,r.x,r.y),H0(r)&&e.fillText(i,r.x,r.y)):(H0(r)&&e.fillText(i,r.x,r.y),W0(r)&&e.strokeText(i,r.x,r.y)),a&&e.setLineDash([])}}var YD=["shadowBlur","shadowOffsetX","shadowOffsetY"],XD=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function m6(e,t,r,n,i){var a=!1;if(!n&&(r=r||{},t===r))return!1;if(n||t.opacity!==r.opacity){Dn(e,i),a=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?_u.opacity:o}(n||t.blend!==r.blend)&&(a||(Dn(e,i),a=!0),e.globalCompositeOperation=t.blend||_u.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[xr]){if(this._disposed){this.id;return}var a,o,s;if(ke(n)&&(i=n.lazyUpdate,a=n.silent,o=n.replaceMerge,s=n.transition,n=n.notMerge),this[xr]=!0,Lc(this),!this._model||n){var l=new TQ(this._api),u=this._theme,c=this._model=new VA;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,u,this._locale,l)}this._model.setOption(r,{replaceMerge:o},CT);var h={seriesTransition:s,optionChanged:!0};if(i)this[Rr]={silent:a,updateParams:h},this[xr]=!1,this.getZr().wakeUp();else{try{Wl(this),po.update.call(this,null,h)}catch(f){throw this[Rr]=null,this[xr]=!1,f}this._ssr||this._zr.flush(),this[Rr]=null,this[xr]=!1,Ac.call(this,a),kc.call(this,a)}}},t.prototype.setTheme=function(r,n){if(!this[xr]){if(this._disposed){this.id;return}var i=this._model;if(i){var a=n&&n.silent,o=null;this[Rr]&&(a==null&&(a=this[Rr].silent),o=this[Rr].updateParams,this[Rr]=null),this[xr]=!0,Lc(this);try{this._updateTheme(r),i.setTheme(this._theme),Wl(this),po.update.call(this,{type:"setTheme"},o)}catch(s){throw this[xr]=!1,s}this[xr]=!1,Ac.call(this,a),kc.call(this,a)}}},t.prototype._updateTheme=function(r){he(r)&&(r=R6[r]),r&&(r=Se(r),r&&BV(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||Je.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 j(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;j(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 j(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(Y0[i]){var l=s,u=s,c=-s,h=-s,f=[],d=r&&r.pixelRatio||this.getDevicePixelRatio();j(Su,function(w,S){if(w.group===i){var T=n?w.getZr().painter.getSvgDom().innerHTML:w.renderToCanvas(Se(r)),M=w.getDom().getBoundingClientRect();l=a(M.left,l),u=a(M.top,u),c=o(M.right,c),h=o(M.bottom,h),f.push({dom:T,left:M.left,top:M.top})}}),l*=d,u*=d,c*=d,h*=d;var g=c-l,m=h-u,y=Bn.createCanvas(),x=GC(y,{renderer:n?"svg":"canvas"});if(x.resize({width:g,height:m}),n){var _="";return j(f,function(w){var S=w.left-l,T=w.top-u;_+=''+w.dom+""}),x.painter.getSvgRoot().innerHTML=_,r.connectedBackgroundColor&&x.painter.setBackgroundColor(r.connectedBackgroundColor),x.refreshImmediately(),x.painter.toDataURL()}else return r.connectedBackgroundColor&&x.add(new Ze({shape:{x:0,y:0,width:g,height:m},style:{fill:r.connectedBackgroundColor}})),j(f,function(w){var S=new Er({style:{x:w.left*d-l,y:w.top*d-u,image:w.dom}});x.add(S)}),x.refreshImmediately(),y.toDataURL("image/"+(r&&r.type||"png"))}else return this.getDataURL(r)},t.prototype.convertToPixel=function(r,n,i){return Cm(this,"convertToPixel",r,n,i)},t.prototype.convertToLayout=function(r,n,i){return Cm(this,"convertToLayout",r,n,i)},t.prototype.convertFromPixel=function(r,n,i){return Cm(this,"convertFromPixel",r,n,i)},t.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var i=this._model,a,o=_h(i,r);return j(o,function(s,l){l.indexOf("Models")>=0&&j(s,function(u){var c=u.coordinateSystem;if(c&&c.containPoint)a=a||!!c.containPoint(n);else if(l==="seriesModels"){var h=this._chartsMap[u.__viewId];h&&h.containPoint&&(a=a||h.containPoint(n,u))}},this)},this),!!a},t.prototype.getVisual=function(r,n){var i=this._model,a=_h(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?ZA(s,l,n):Yp(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;j(Ote,function(i){var a=function(o){var s=r.getModel(),l=o.target,u,c=i==="globalout";if(c?u={}:l&&vu(l,function(m){var y=De(m);if(y&&y.dataIndex!=null){var x=y.dataModel||s.getSeriesByIndex(y.seriesIndex);return u=x&&x.getDataParams(y.dataIndex,y.dataType,l)||{},!0}else if(y.eventData)return u=Q({},y.eventData),!0},!0),u){var h=u.componentType,f=u.componentIndex;(h==="markLine"||h==="markPoint"||h==="markArea")&&(h="series",f=u.seriesIndex);var d=h&&f!=null&&s.getComponent(h,f),g=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:g},r.trigger(i,u)}};a.zrEventfulCallAtLast=!0,r._zr.on(i,a,r)});var n=this._messageCenter;j(wT,function(i,a){n.on(a,function(o){r.trigger(a,o)})}),Zee(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&&xF(this.getDom(),KA,"");var n=this,i=n._api,a=n._model;j(n._componentsViews,function(o){o.dispose(a,i)}),j(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 Su[n.id]},t.prototype.resize=function(r){if(!this[xr]){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[Rr]&&(a==null&&(a=this[Rr].silent),i=!0,this[Rr]=null),this[xr]=!0,Lc(this);try{i&&Wl(this),po.update.call(this,{type:"resize",animation:Q({duration:0},r&&r.animation)})}catch(o){throw this[xr]=!1,o}this[xr]=!1,Ac.call(this,a),kc.call(this,a)}}},t.prototype.showLoading=function(r,n){if(this._disposed){this.id;return}if(ke(r)&&(n=r,r=""),r=r||"default",this.hideLoading(),!!TT[r]){var i=TT[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=Q({},r);return n.type=bT[r.type],n},t.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(ke(n)||(n={silent:!!n}),!!Z0[r.type]&&this._model){if(this[xr]){this._pendingActions.push(r);return}var i=n.silent;Ub.call(this,r,i);var a=n.flush;a?this._zr.flush():a!==!1&&Je.browser.weChat&&this._throttledZrFlush(),Ac.call(this,i),kc.call(this,i)}},t.prototype.updateLabelLayout=function(){qi.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(){Wl=function(h){var f=h._scheduler;f.restorePipelines(h._model),f.prepareStageTasks(),Wb(h,!0),Wb(h,!1),f.plan()},Wb=function(h,f){for(var d=h._model,g=h._scheduler,m=f?h._componentsViews:h._chartsViews,y=f?h._componentsMap:h._chartsMap,x=h._zr,_=h._api,w=0;wf.get("hoverLayerThreshold")&&!Je.node&&!Je.worker&&f.eachSeries(function(y){if(!y.preventUsingHoverLayer){var x=h._chartsMap[y.__viewId];x.__alive&&x.eachRendered(function(_){_.states.emphasis&&(_.states.emphasis.hoverLayer=!0)})}})}function s(h,f){var d=h.get("blendMode")||null;f.eachRendered(function(g){g.isGroup||(g.style.blend=d)})}function l(h,f){if(!h.preventAutoZ){var d=Fu(h);f.eachRendered(function(g){return w_(g,d.z,d.zlevel),!0})}}function u(h,f){f.eachRendered(function(d){if(!bh(d)){var g=d.getTextContent(),m=d.getTextGuideLine();d.stateTransition&&(d.stateTransition=null),g&&g.stateTransition&&(g.stateTransition=null),m&&m.stateTransition&&(m.stateTransition=null),d.hasState()?(d.prevStates=d.currentStates,d.clearStates()):d.prevStates&&(d.prevStates=null)}})}function c(h,f){var d=h.getModel("stateAnimation"),g=h.isAnimationEnabled(),m=d.get("duration"),y=m>0?{duration:m,delay:d.get("delay"),easing:d.get("easing")}:null;f.eachRendered(function(x){if(x.states&&x.states.emphasis){if(bh(x))return;if(x instanceof Ke&&QK(x),x.__dirty){var _=x.prevStates;_&&x.useStates(_)}if(g){x.stateTransition=y;var w=x.getTextContent(),S=x.getTextGuideLine();w&&(w.stateTransition=y),S&&(S.stateTransition=y)}x.__dirty&&a(x)}})}lE=function(h){return new(function(f){q(d,f);function d(){return f!==null&&f.apply(this,arguments)||this}return d.prototype.getCoordinateSystems=function(){return h._coordSysMgr.getCoordinateSystems()},d.prototype.getComponentByElement=function(g){for(;g;){var m=g.__ecComponentInfo;if(m!=null)return h._model.getComponent(m.mainType,m.index);g=g.parent}},d.prototype.enterEmphasis=function(g,m){Ho(g,m),di(h)},d.prototype.leaveEmphasis=function(g,m){Uo(g,m),di(h)},d.prototype.enterBlur=function(g){OF(g),di(h)},d.prototype.leaveBlur=function(g){fA(g),di(h)},d.prototype.enterSelect=function(g){zF(g),di(h)},d.prototype.leaveSelect=function(g){BF(g),di(h)},d.prototype.getModel=function(){return h.getModel()},d.prototype.getViewOfComponentModel=function(g){return h.getViewOfComponentModel(g)},d.prototype.getViewOfSeriesModel=function(g){return h.getViewOfSeriesModel(g)},d.prototype.getMainProcessVersion=function(){return h[wm]},d}(OV))(h)},j6=function(h){function f(d,g){for(var m=0;m=0)){cE.push(r);var a=c6.wrapStageHandler(r,i);a.__prio=t,a.__raw=r,e.push(a)}}function nk(e,t){TT[e]=t}function $te(e){CB({createCanvas:e})}function G6(e,t,r){var n=S6("registerMap");n&&n(e,t,r)}function Yte(e){var t=S6("getMap");return t&&t(e)}var W6=nee;dl(XA,Lee);dl(L_,Nee);dl(L_,Pee);dl(XA,Hee);dl(L_,Uee);dl(k6,xte);ek(BV);tk(Mte,OQ);nk("default",Iee);pa({type:bu,event:bu,update:bu},qt);pa({type:Ny,event:Ny,update:Ny},qt);pa({type:D0,event:cA,update:D0,action:qt,refineEvent:ik,publishNonRefinedEvent:!0});pa({type:JC,event:cA,update:JC,action:qt,refineEvent:ik,publishNonRefinedEvent:!0});pa({type:E0,event:cA,update:E0,action:qt,refineEvent:ik,publishNonRefinedEvent:!0});function ik(e,t,r,n){return{eventContent:{selected:YK(r),isFromClick:t.isFromClick||!1}}}QA("default",{});QA("dark",v6);var Xte={},hE=[],qte={registerPreprocessor:ek,registerProcessor:tk,registerPostInit:z6,registerPostUpdate:B6,registerUpdateLifecycle:N_,registerAction:pa,registerCoordinateSystem:F6,registerLayout:V6,registerVisual:dl,registerTransform:W6,registerLoading:nk,registerMap:G6,registerImpl:_te,PRIORITY:L6,ComponentModel:$e,ComponentView:Mt,SeriesModel:bt,ChartView:gt,registerComponentModel:function(e){$e.registerClass(e)},registerComponentView:function(e){Mt.registerClass(e)},registerSeriesModel:function(e){bt.registerClass(e)},registerChartView:function(e){gt.registerClass(e)},registerCustomSeries:function(e,t){T6(e,t)},registerSubTypeDefaulter:function(e,t){$e.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){aF(e,t)}};function He(e){if(re(e)){j(e,function(t){He(t)});return}Ve(hE,e)>=0||(hE.push(e),we(e)&&(e={install:e}),e.install(qte))}function pd(e){return e==null?0:e.length||1}function fE(e){return e}var Zo=function(){function e(t,r,n,i,a,o){this._old=t,this._new=r,this._oldKeyGetter=n||fE,this._newKeyGetter=i||fE,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&&f===1)this._updateManyToOne&&this._updateManyToOne(c,u),i[l]=null;else if(h===1&&f>1)this._updateOneToMany&&this._updateOneToMany(c,u),i[l]=null;else if(h===1&&f===1)this._update&&this._update(c,u),i[l]=null;else if(h>1&&f>1)this._updateManyToMany&&this._updateManyToMany(c,u),i[l]=null;else if(h>1)for(var d=0;d1)for(var s=0;s30}var gd=ke,os=ae,rre=typeof Int32Array>"u"?Array:Int32Array,nre="e\0\0",dE=-1,ire=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],are=["_approximateExtent"],vE,Mm,md,yd,Yb,xd,Xb,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;U6(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===si;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),re(a)?a=a.slice():gd(a)&&(a=Q({},a)),i[r]=a),a},e.prototype.setItemVisual=function(t,r,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,gd(r)?Q(i,r):i[r]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(t,r){gd(t)?Q(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?Q(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;KC(n,this.dataType,t,r),this._graphicEls[t]=r},e.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},e.prototype.eachItemGraphicEl=function(t,r){j(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:os(this.dimensions,this._getDimInfo,this),this.hostModel)),Yb(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(t,r){var n=this[t];we(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var i=n.apply(this,arguments);return r.apply(this,[i].concat(o_(arguments)))})},e.internalField=function(){vE=function(t){var r=t._invertedIndicesMap;j(r,function(n,i){var a=t._dimInfos[i],o=a.ordinalMeta,s=t._store;if(o){n=r[i]=new rre(o.categories.length);for(var l=0;l1&&(l+="__ec__"+c),i[r]=l}}}(),e}();function ore(e,t){return bf(e,t).dimensions}function bf(e,t){GA(e)||(e=WA(e)),t=t||{};var r=t.coordDimensions||[],n=t.dimensionsDefine||e.dimensionsDefine||[],i=_e(),a=[],o=lre(e,r,n,t.dimensionsCount),s=t.canOmitUnusedDimensions&&Y6(o),l=n===e.dimensionsDefine,u=l?$6(e):Z6(n),c=t.encodeDefine;!c&&t.encodeDefaulter&&(c=t.encodeDefaulter(e,o));for(var h=_e(c),f=new qV(o),d=0;d0&&(n.name=i+(a-1)),a++,t.set(i,a)}}function lre(e,t,r,n){var i=Math.max(e.dimensionsDetectedCount||1,t.length,r.length,n||0);return j(t,function(a){var o;ke(a)&&(o=a.dimsDef)&&(i=Math.max(i,o.length))}),i}function ure(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 cre=function(){function e(t){this.coordSysDims=[],this.axisMap=_e(),this.categoryAxisMap=_e(),this.coordSysName=t}return e}();function hre(e){var t=e.get("coordinateSystem"),r=new cre(t),n=fre[t];if(n)return n(e,r,r.axisMap,r.categoryAxisMap),r}var fre={cartesian2d:function(e,t,r,n){var i=e.getReferringComponents("xAxis",Ht).models[0],a=e.getReferringComponents("yAxis",Ht).models[0];t.coordSysDims=["x","y"],r.set("x",i),r.set("y",a),Nc(i)&&(n.set("x",i),t.firstCategoryDimIndex=0),Nc(a)&&(n.set("y",a),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},singleAxis:function(e,t,r,n){var i=e.getReferringComponents("singleAxis",Ht).models[0];t.coordSysDims=["single"],r.set("single",i),Nc(i)&&(n.set("single",i),t.firstCategoryDimIndex=0)},polar:function(e,t,r,n){var i=e.getReferringComponents("polar",Ht).models[0],a=i.findAxisModel("radiusAxis"),o=i.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],r.set("radius",a),r.set("angle",o),Nc(a)&&(n.set("radius",a),t.firstCategoryDimIndex=0),Nc(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();j(a.parallelAxisIndex,function(s,l){var u=i.getComponent("parallelAxis",s),c=o[l];r.set(c,u),Nc(u)&&(n.set(c,u),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=l))})},matrix:function(e,t,r,n){var i=e.getReferringComponents("matrix",Ht).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 Nc(e){return e.get("type")==="category"}function X6(e,t,r){r=r||{};var n=r.byIndex,i=r.stackedCoordDimension,a,o,s;dre(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var l=!!(e&&e.get("stack")),u,c,h,f;if(j(a,function(_,w){he(_)&&(a[w]=_={name:_}),l&&!_.isExtraCoord&&(!n&&!u&&_.ordinalMeta&&(u=_),!c&&_.type!=="ordinal"&&_.type!=="time"&&(!i||i===_.coordDim)&&(c=_))}),c&&!n&&!u&&(n=!0),c){h="__\0ecstackresult_"+e.id,f="__\0ecstackedover_"+e.id,u&&(u.createInvertedIndices=!0);var d=c.coordDim,g=c.type,m=0;j(a,function(_){_.coordDim===d&&m++});var y={name:h,coordDim:d,coordDimIndex:m,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},x={name:f,coordDim:f,coordDimIndex:m+1,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(y.storeDimIndex=s.ensureCalculationDimension(f,g),x.storeDimIndex=s.ensureCalculationDimension(h,g)),o.appendCalculationDimension(y),o.appendCalculationDimension(x)):(a.push(y),a.push(x))}return{stackedDimension:c&&c.name,stackedByDimension:u&&u.name,isStackedByIndex:n,stackedOverDimension:f,stackResultDimension:h}}function dre(e){return!U6(e.schema)}function $o(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}function ak(e,t){return $o(e,t)?e.getCalculationInfo("stackResultDimension"):t}function vre(e,t){var r=e.get("coordinateSystem"),n=mf.get(r),i;return t&&t.coordSysDims&&(i=ae(t.coordSysDims,function(a){var o={name:a},s=t.axisMap.get(a);if(s){var l=s.get("type");o.type=X0(l)}return o})),i||(i=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),i}function pre(e,t,r){var n,i;return r&&j(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 no(e,t,r){r=r||{};var n=t.getSourceManager(),i,a=!1;e?(a=!0,i=WA(e)):(i=n.getSource(),a=i.sourceFormat===si);var o=hre(t),s=vre(t,o),l=r.useEncodeDefaulter,u=we(l)?l:l?Fe(DV,s,t):null,c={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},h=bf(i,c),f=pre(h.dimensions,r.createInvertedIndices,o),d=a?null:n.getSharedDataStore(h),g=X6(t,{schema:h,store:d}),m=new dn(h,t);m.setCalculationInfo(g);var y=f!=null&&gre(i)?function(x,_,w,S){return S===f?w:this.defaultDimValueGetter(x,_,w,S)}:null;return m.hasItemOption=!1,m.initData(a?i:d,null,y),m}function gre(e){if(e.sourceFormat===si){var t=mre(e.data||[]);return!re(sf(t))}}function mre(e){for(var t=0;ti&&(o=a.interval=i);var s=a.intervalPrecision=hp(o),l=a.niceTickExtent=[ir(Math.ceil(e[0]/o)*o,s),ir(Math.floor(e[1]/o)*o,s)];return xre(l,e),a}function qb(e){var t=Math.pow(10,f_(e)),r=e/t;return r?r===2?r=3:r===3?r=5:r*=2:r=1,ir(r*t)}function hp(e){return ta(e)+2}function pE(e,t,r){e[t]=Math.max(Math.min(e[t],r[1]),r[0])}function xre(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),pE(e,0,t),pE(e,1,t),e[0]>e[1]&&(e[0]=e[1])}function ok(e,t){return e>=t[0]&&e<=t[1]}var _re=function(){function e(){this.normalize=gE,this.scale=mE}return e.prototype.updateMethods=function(t){t.hasBreaks()?(this.normalize=fe(t.normalize,t),this.scale=fe(t.scale,t)):(this.normalize=gE,this.scale=mE)},e}();function gE(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function mE(e,t){return e*(t[1]-t[0])+t[0]}function AT(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 vl=function(){function e(t){this._calculator=new _re,this._setting=t||{},this._extent=[1/0,-1/0];var r=vr();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=vr();r&&this._innerSetBreak(r.parseAxisBreakOption(t,fe(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}();d_(vl);var bre=0,fp=function(){function e(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++bre,this._onCollect=t.onCollect}return e.createByAxisModel=function(t){var r=t.option,n=r.data,i=n&&ae(n,wre);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(!he(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 wre(e){return ke(e)&&e.value!=null?e.value:e+""}var Wh=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 fp({})),re(i)&&(i=new fp({categories:ae(i,function(a){return ke(a)?a.value:a})})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return t.prototype.parse=function(r){return r==null?NaN:he(r)?this._ordinalMeta.getOrdinal(r):Math.round(r)},t.prototype.contain=function(r){return ok(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}(vl);vl.registerClass(Wh);var ss=ir,Yo=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 ok(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=hp(r)},t.prototype.getTicks=function(r){r=r||{};var n=this._interval,i=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=vr(),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&&(h=ss(h+f*n,o))}if(l.length>0&&h===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:ss(d+n,o)}):l.push({value:i[1]})),s&&s.pruneTicksByBreak(r.pruneByBreak,l,this._brkCtx.breaks,function(g){return g.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]&&g0&&(a=a===null?s:Math.min(a,s))}r[n]=a}}return r}function Q6(e){var t=Tre(e),r=[];return j(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]),h=a.scale.getExtent(),f=Math.abs(h[1]-h[0]);s=u?c/f*u:c}else{var d=n.getData();s=Math.abs(o[1]-o[0])/d.count()}var g=ce(n.get("barWidth"),s),m=ce(n.get("barMaxWidth"),s),y=ce(n.get("barMinWidth")||(iG(n)?.5:1),s),x=n.get("barGap"),_=n.get("barCategoryGap"),w=n.get("defaultBarGap");r.push({bandWidth:s,barWidth:g,barMaxWidth:m,barMinWidth:y,barGap:x,barCategoryGap:_,defaultBarGap:w,axisKey:sk(a),stackId:K6(n)})}),eG(r)}function eG(e){var t={};j(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 h=n.barMaxWidth;h&&(l[u].maxWidth=h);var f=n.barMinWidth;f&&(l[u].minWidth=f);var d=n.barGap;d!=null&&(s.gap=d);var g=n.barCategoryGap;g!=null&&(s.categoryGap=g)});var r={};return j(t,function(n,i){r[i]={};var a=n.stacks,o=n.bandWidth,s=n.categoryGap;if(s==null){var l=Qe(a).length;s=Math.max(35-l*4,15)+"%"}var u=ce(s,o),c=ce(n.gap,1),h=n.remainedWidth,f=n.autoWidthCount,d=(h-u)/(f+(f-1)*c);d=Math.max(d,0),j(a,function(x){var _=x.maxWidth,w=x.minWidth;if(x.width){var S=x.width;_&&(S=Math.min(S,_)),w&&(S=Math.max(S,w)),x.width=S,h-=S+c*S,f--}else{var S=d;_&&_S&&(S=w),S!==d&&(x.width=S,h-=S+c*S,f--)}}),d=(h-u)/(f+(f-1)*c),d=Math.max(d,0);var g=0,m;j(a,function(x,_){x.width||(x.width=d),m=x,g+=x.width*(1+c)}),m&&(g-=m.width*c);var y=-g/2;j(a,function(x,_){r[i][_]=r[i][_]||{bandWidth:o,offset:y,width:x.width},y+=x.width*(1+c)})}),r}function Mre(e,t,r){if(e&&t){var n=e[sk(t)];return n}}function tG(e,t){var r=J6(e,t),n=Q6(r);j(r,function(i){var a=i.getData(),o=i.coordinateSystem,s=o.getBaseAxis(),l=K6(i),u=n[sk(s)][l],c=u.offset,h=u.width;a.setLayout({bandWidth:u.bandWidth,offset:c,size:h})})}function rG(e){return{seriesType:e,plan:yf(),reset:function(t){if(nG(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"),h=$o(r,u)&&!!r.getCalculationInfo("stackedOnSeries"),f=a.isHorizontal(),d=Are(i,a),g=iG(t),m=t.get("barMinHeight")||0,y=c&&r.getDimensionIndex(c),x=r.getLayout("size"),_=r.getLayout("offset");return{progress:function(w,S){for(var T=w.count,M=g&&Oa(T*3),A=g&&l&&Oa(T*3),P=g&&Oa(T),I=n.master.getRect(),N=f?I.width:I.height,D,O=S.getStore(),R=0;(D=w.next())!=null;){var F=O.get(h?y:o,D),H=O.get(s,D),W=d,V=void 0;h&&(V=+F-O.get(o,D));var z=void 0,Z=void 0,U=void 0,$=void 0;if(f){var Y=n.dataToPoint([F,H]);if(h){var te=n.dataToPoint([V,H]);W=te[0]}z=W,Z=Y[1]+_,U=Y[0]-W,$=x,Math.abs(U)0?r:1:r))}var kre=function(e,t,r,n){for(;r>>1;e[i][1]i&&(this._approxInterval=i);var o=Am.length,s=Math.min(kre(Am,this._approxInterval,0,o),o-1);this._interval=Am[s][1],this._intervalPrecision=hp(this._interval),this._minLevelUnit=Am[Math.max(s-1,0)][0]},t.prototype.parse=function(r){return rt(r)?r:+to(r)},t.prototype.contain=function(r){return ok(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}(Yo),Am=[["second",MA],["minute",AA],["hour",xv],["quarter-day",xv*6],["half-day",xv*12],["day",Ti*1.2],["half-week",Ti*3.5],["week",Ti*7],["month",Ti*31],["quarter",Ti*95],["half-year",sD/2],["year",sD]];function aG(e,t,r,n){return z0(new Date(t),e,n).getTime()===z0(new Date(r),e,n).getTime()}function Lre(e,t){return e/=Ti,e>16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function Nre(e){var t=30*Ti;return e/=t,e>6?6:e>3?3:e>2?2:1}function Pre(e){return e/=xv,e>12?12:e>6?6:e>3.5?4:e>2?2:1}function yE(e,t){return e/=t?AA:MA,e>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function Ire(e){return tA(e,!0)}function Dre(e,t,r){var n=Math.max(0,Ve($n,t)-1);return z0(new Date(e),$n[n],r).getTime()}function Ere(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 jre(e,t,r,n,i,a){var o=1e4,s=$J,l=0;function u(R,F,H,W,V,z,Z){for(var U=Ere(V,R),$=F,Y=new Date($);$o));)if(Y[V](Y[W]()+R),$=Y.getTime(),a){var te=a.calcNiceTickMultiple($,U);te>0&&(Y[V](Y[W]()+te*R),$=Y.getTime())}Z.push({value:$,notAdd:!0})}function c(R,F,H){var W=[],V=!F.length;if(!aG(_v(R),n[0],n[1],r)){V&&(F=[{value:Dre(n[0],R,r)},{value:n[1]}]);for(var z=0;z=n[0]&&Z<=n[1]&&u($,Z,U,Y,te,ie,W),R==="year"&&H.length>1&&z===0&&H.unshift({value:H[0].value-$})}}for(var z=0;z=n[0]&&S<=n[1]&&d++)}var T=i/t;if(d>T*1.5&&g>T/1.5||(h.push(_),d>T||e===s[m]))break}f=[]}}}for(var M=ot(ae(h,function(R){return ot(R,function(F){return F.value>=n[0]&&F.value<=n[1]&&!F.notAdd})}),function(R){return R.length>0}),A=[],P=M.length-1,m=0;m0;)a*=10;var s=[LT(Ore(n[0]/a)*a),LT(Rre(n[1]/a)*a)];this._interval=a,this._intervalPrecision=hp(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=Lm(r)/Lm(this.base),e.prototype.contain.call(this,r)},t.prototype.normalize=function(r){return r=Lm(r)/Lm(this.base),e.prototype.normalize.call(this,r)},t.prototype.scale=function(r){return r=e.prototype.scale.call(this,r),km(this.base,r)},t.prototype.setBreaksFromOption=function(r){var n=vr();if(n){var i=n.logarithmicParseBreaksFromOption(r,this.base,fe(this.parse,this)),a=i.parsedOriginal,o=i.parsedLogged;this._originalScale._innerSetBreak(a),this._innerSetBreak(o)}},t.type="log",t}(Yo);function Nm(e,t){return LT(e,ta(t))}vl.registerClass(oG);var zre=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 f=this._determinedMin,d=this._determinedMax;return f!=null&&(s=f,u=!0),d!=null&&(l=d,c=!0),{min:s,max:l,minFixed:u,maxFixed:c,isBlank:h}},e.prototype.modifyDataMinMax=function(t,r){this[Fre[t]]=r},e.prototype.setDeterminedMinMax=function(t,r){var n=Bre[t];this[n]=r},e.prototype.freeze=function(){this.frozen=!0},e}(),Bre={min:"_determinedMin",max:"_determinedMax"},Fre={min:"_dataMin",max:"_dataMax"};function sG(e,t,r){var n=e.rawExtentInfo;return n||(n=new zre(e,t,r),e.rawExtentInfo=n,n)}function Pm(e,t){return t==null?null:Xr(t)?NaN:e.parse(t)}function lG(e,t){var r=e.type,n=sG(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=J6("bar",o),l=!1;if(j(s,function(h){l=l||h.getBaseAxis()===t.axis}),l){var u=Q6(s),c=Vre(i,a,t,u);i=c.min,a=c.max}}return{extent:[i,a],fixMin:n.minFixed,fixMax:n.maxFixed}}function Vre(e,t,r,n){var i=r.axis.getExtent(),a=Math.abs(i[1]-i[0]),o=Mre(n,r.axis);if(o===void 0)return{min:e,max:t};var s=1/0;j(o,function(d){s=Math.min(d.offset,s)});var l=-1/0;j(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,h=1-(s+l)/a,f=c/h-c;return t+=f*(l/u),e-=f*(s/u),{min:e,max:t}}function Gu(e,t){var r=t,n=lG(e,r),i=n.extent,a=r.get("splitNumber");e instanceof oG&&(e.base=r.get("logBase"));var o=e.type,s=r.get("interval"),l=o==="interval"||o==="time";e.setBreaksFromOption(cG(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 Xp(e,t){if(t=t||e.get("type"),t)switch(t){case"category":return new Wh({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new lk({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new(vl.getClass(t)||Yo)}}function Gre(e){var t=e.scale.getExtent(),r=t[0],n=t[1];return!(r>0&&n>0||r<0&&n<0)}function wf(e){var t=e.getLabelModel().get("formatter");if(e.type==="time"){var r=YJ(t);return function(i,a){return e.scale.getFormattedLabel(i,a,r)}}else{if(he(t))return function(i){var a=e.scale.getLabel(i),o=t.replace("{value}",a??"");return o};if(we(t)){if(e.type==="category")return function(i,a){return t(q0(e,i),i.value-e.scale.getExtent()[0],null)};var n=vr();return function(i,a){var o=null;return n&&(o=n.makeAxisLabelFormatterParamBreak(o,i.break)),t(q0(e,i),a,o)}}else return function(i){return e.scale.getLabel(i)}}}function q0(e,t){return e.type==="category"?e.scale.getLabel(t):t.value}function uk(e){var t=e.get("interval");return t??"auto"}function uG(e){return e.type==="category"&&uk(e.getLabelModel())===0}function K0(e,t){var r={};return j(e.mapDimensionsAll(t),function(n){r[ak(e,n)]=!0}),Qe(r)}function Wre(e,t,r){t&&j(K0(t,r),function(n){var i=t.getApproximateExtent(n);i[0]e[1]&&(e[1]=i[1])})}function Hh(e){return e==="middle"||e==="center"}function dp(e){return e.getShallow("show")}function cG(e){var t=e.get("breaks",!0);if(t!=null)return!vr()||!Hre(e.axis)?void 0:t}function Hre(e){return(e.dim==="x"||e.dim==="y"||e.dim==="z"||e.dim==="single")&&e.type!=="category"}var Sf=function(){function e(){}return e.prototype.getNeedCrossZero=function(){var t=this.option;return!t.scale},e.prototype.getCoordSysModel=function(){},e}();function Ure(e){return no(null,e)}var Zre={isDimensionStacked:$o,enableDataStack:X6,getStackedDimension:ak};function $re(e,t){var r=t;t instanceof qe||(r=new qe(t));var n=Xp(r);return n.setExtent(e[0],e[1]),Gu(n,r),n}function Yre(e){Qt(e,Sf)}function Xre(e,t){return t=t||{},Ct(e,null,null,t.state!=="normal")}const qre=Object.freeze(Object.defineProperty({__proto__:null,createDimensions:ore,createList:Ure,createScale:$re,createSymbol:sr,createTextStyle:Xre,dataStack:Zre,enableHoverEmphasis:Hs,getECData:De,getLayoutRect:It,mixinAxisModelCommonMethods:Yre},Symbol.toStringTag,{value:"Module"}));var Kre=1e-8;function xE(e,t){return Math.abs(e-t)i&&(n=o,i=l)}if(n)return Qre(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 j(o,function(s){s.type==="polygon"?_E(s.exterior,i,a,r):j(s.points,function(l){_E(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 Pe(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 NT(e,t){return e=tne(e),ae(ot(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 bE(o[0],o.slice(1)));break;case"MultiPolygon":j(i.coordinates,function(l){l[0]&&a.push(new bE(l[0],l.slice(1)))});break;case"LineString":a.push(new wE([i.coordinates]));break;case"MultiLineString":a.push(new wE(i.coordinates))}var s=new fG(n[t||"name"],a,n.cp);return s.properties=n,s})}const rne=Object.freeze(Object.defineProperty({__proto__:null,MAX_SAFE_INTEGER:HC,asc:Qn,getPercentWithPrecision:bq,getPixelPrecision:QM,getPrecision:ta,getPrecisionSafe:uF,isNumeric:rA,isRadianAroundZero:Oh,linearMap:ht,nice:tA,numericToNumber:Xa,parseDate:to,parsePercent:ce,quantile:Ly,quantity:hF,quantityExponent:f_,reformIntervals:UC,remRadian:eA,round:ir},Symbol.toStringTag,{value:"Module"})),nne=Object.freeze(Object.defineProperty({__proto__:null,format:Zp,parse:to,roundTime:z0},Symbol.toStringTag,{value:"Module"})),ine=Object.freeze(Object.defineProperty({__proto__:null,Arc:Wp,BezierCurve:hf,BoundingRect:Pe,Circle:ro,CompoundPath:Hp,Ellipse:Gp,Group:Ce,Image:Er,IncrementalDisplayable:KF,Line:ar,LinearGradient:qu,Polygon:en,Polyline:Gr,RadialGradient:pA,Rect:Ze,Ring:cf,Sector:Qr,Text:tt,clipPointsByRect:xA,clipRectByRect:rV,createIcon:df,extendPath:eV,extendShape:QF,getShapeClass:ip,getTransform:Us,initProps:Nt,makeImage:mA,makePath:Bh,mergePath:qn,registerShape:Fi,resizePath:yA,updateProps:it},Symbol.toStringTag,{value:"Module"})),ane=Object.freeze(Object.defineProperty({__proto__:null,addCommas:EA,capitalFirst:nQ,encodeHTML:hn,formatTime:rQ,formatTpl:RA,getTextRect:eQ,getTooltipMarker:xV,normalizeCssArray:gf,toCamelCase:jA,truncateText:eK},Symbol.toStringTag,{value:"Module"})),one=Object.freeze(Object.defineProperty({__proto__:null,bind:fe,clone:Se,curry:Fe,defaults:Ae,each:j,extend:Q,filter:ot,indexOf:Ve,inherits:UM,isArray:re,isFunction:we,isObject:ke,isString:he,map:ae,merge:Ge,reduce:Ei},Symbol.toStringTag,{value:"Module"}));var sne=Ye(),wv=Ye(),da={estimate:1,determine:2};function J0(e){return{out:{noPxChangeTryDetermine:[]},kind:e}}function vG(e,t){var r=ae(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 lne(e,t){var r=e.getLabelModel().get("customValues");if(r){var n=wf(e),i=e.scale.getExtent(),a=vG(e,r),o=ot(a,function(s){return s>=i[0]&&s<=i[1]});return{labels:ae(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"?cne(e,t):fne(e)}function une(e,t,r){var n=e.getTickModel().get("customValues");if(n){var i=e.scale.getExtent(),a=vG(e,n);return{ticks:ot(a,function(o){return o>=i[0]&&o<=i[1]})}}return e.type==="category"?hne(e,t):{ticks:ae(e.scale.getTicks(r),function(o){return o.value})}}function cne(e,t){var r=e.getLabelModel(),n=pG(e,r,t);return!r.get("show")||e.scale.isBlank()?{labels:[]}:n}function pG(e,t,r){var n=vne(e),i=uk(t),a=r.kind===da.estimate;if(!a){var o=mG(n,i);if(o)return o}var s,l;we(i)?s=_G(e,i):(l=i==="auto"?pne(e,r):i,s=xG(e,l));var u={labels:s,labelCategoryInterval:l};return a?r.out.noPxChangeTryDetermine.push(function(){return PT(n,i,u),!0}):PT(n,i,u),u}function hne(e,t){var r=dne(e),n=uk(t),i=mG(r,n);if(i)return i;var a,o;if((!t.get("show")||e.scale.isBlank())&&(a=[]),we(n))a=_G(e,n,!0);else if(n==="auto"){var s=pG(e,e.getLabelModel(),J0(da.determine));o=s.labelCategoryInterval,a=ae(s.labels,function(l){return l.tickValue})}else o=n,a=xG(e,o,!0);return PT(r,n,{ticks:a,tickCategoryInterval:o})}function fne(e){var t=e.scale.getTicks(),r=wf(e);return{labels:ae(t,function(n,i){return{formattedLabel:r(n,i),rawLabel:e.scale.getLabel(n),tickValue:n.value,time:n.time,break:n.break}})}}var dne=gG("axisTick"),vne=gG("axisLabel");function gG(e){return function(r){return wv(r)[e]||(wv(r)[e]={list:[]})}}function mG(e,t){for(var r=0;rc&&(u=Math.max(1,Math.floor(l/c)));for(var h=s[0],f=e.dataToCoord(h+1)-e.dataToCoord(h),d=Math.abs(f*Math.cos(a)),g=Math.abs(f*Math.sin(a)),m=0,y=0;h<=s[1];h+=u){var x=0,_=0,w=c_(i({value:h}),n.font,"center","top");x=w.width*1.3,_=w.height*1.3,m=Math.max(m,x,7),y=Math.max(y,_,7)}var S=m/d,T=y/g;isNaN(S)&&(S=1/0),isNaN(T)&&(T=1/0);var M=Math.max(0,Math.floor(Math.min(S,T)));if(r===da.estimate)return t.out.noPxChangeTryDetermine.push(fe(mne,null,e,M,l)),M;var A=yG(e,M,l);return A??M}function mne(e,t,r){return yG(e,t,r)==null}function yG(e,t,r){var n=sne(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 yne(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 xG(e,t,r){var n=wf(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 h=uG(e),f=o.get("showMinLabel")||h,d=o.get("showMaxLabel")||h;f&&u!==a[0]&&m(a[0]);for(var g=u;g<=a[1];g+=l)m(g);d&&g-l!==a[1]&&m(a[1]);function m(y){var x={value:y};s.push(r?y:{formattedLabel:n(x),rawLabel:i.getLabel(x),tickValue:y,time:void 0,break:void 0})}return s}function _G(e,t,r){var n=e.scale,i=wf(e),a=[];return j(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 SE=[0,1],Vi=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 QM(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(),CE(n,i.count())),ht(t,SE,n,r)},e.prototype.coordToData=function(t,r){var n=this._extent,i=this.scale;this.onBand&&i.type==="ordinal"&&(n=n.slice(),CE(n,i.count()));var a=ht(t,n,SE,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=une(this,r,{breakTicks:t.breakTicks,pruneByBreak:t.pruneByBreak}),i=n.ticks,a=ae(i,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=r.get("alignWithLabel");return xne(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=ae(n,function(a){return ae(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return i},e.prototype.getViewLabels=function(t){return t=t||J0(da.determine),lne(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||J0(da.determine),gne(this,t)},e}();function CE(e,t){var r=e[1]-e[0],n=t,i=r/n/2;e[0]+=i,e[1]-=i}function xne(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;j(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 h=a[0]>a[1];f(t[0].coord,a[0])&&(n?t[0].coord=a[0]:t.shift()),n&&f(a[0],t[0].coord)&&t.unshift({coord:a[0],onBand:!0}),f(a[1],o.coord)&&(n?o.coord=a[1]:t.pop()),n&&f(o.coord,a[1])&&t.push({coord:a[1],onBand:!0});function f(d,g){return d=ir(d),g=ir(g),h?d>g:di&&(i+=_d);var d=Math.atan2(s,o);if(d<0&&(d+=_d),d>=n&&d<=i||d+_d>=n&&d+_d<=i)return l[0]=c,l[1]=h,u-r;var g=r*Math.cos(n)+e,m=r*Math.sin(n)+t,y=r*Math.cos(i)+e,x=r*Math.sin(i)+t,_=(g-o)*(g-o)+(m-s)*(m-s),w=(y-o)*(y-o)+(x-s)*(x-s);return _0){t=t/180*Math.PI,ra.fromArray(e[0]),kt.fromArray(e[1]),rr.fromArray(e[2]),Ne.sub(za,ra,kt),Ne.sub(Ea,rr,kt);var r=za.len(),n=Ea.len();if(!(r<.001||n<.001)){za.scale(1/r),Ea.scale(1/n);var i=za.dot(Ea),a=Math.cos(t);if(a1&&Ne.copy(_n,rr),_n.toArray(e[1])}}}}function Lne(e,t,r){if(r<=180&&r>0){r=r/180*Math.PI,ra.fromArray(e[0]),kt.fromArray(e[1]),rr.fromArray(e[2]),Ne.sub(za,kt,ra),Ne.sub(Ea,rr,kt);var n=za.len(),i=Ea.len();if(!(n<.001||i<.001)){za.scale(1/n),Ea.scale(1/i);var a=za.dot(t),o=Math.cos(r);if(a=l)Ne.copy(_n,rr);else{_n.scaleAndAdd(Ea,s/Math.tan(Math.PI/2-c));var h=rr.x!==kt.x?(_n.x-kt.x)/(rr.x-kt.x):(_n.y-kt.y)/(rr.y-kt.y);if(isNaN(h))return;h<0?Ne.copy(_n,kt):h>1&&Ne.copy(_n,rr)}_n.toArray(e[1])}}}}function Qb(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 Nne(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=To(n[0],n[1]),a=To(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=fv([],n[1],n[0],o/i),l=fv([],n[1],n[2],o/a),u=fv([],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(N*I,0,a);var D=N+A;D<0&&T(-D*I,1)}else T(-A*I,1)}}function S(A,P,I){A!==0&&(c=!0);for(var N=P;N0)for(var D=0;D0;D--){var H=I[D-1]*F;S(-H,D,a)}}}function M(A){var P=A<0?-1:1;A=Math.abs(A);for(var I=Math.ceil(A/(a-1)),N=0;N0?S(I,0,N+1):S(-I,a-N-1,a),A-=I,A<=0)return}return c}function Dne(e){for(var t=0;t=0&&n.attr(a.oldLayoutSelect),Ve(f,"emphasis")>=0&&n.attr(a.oldLayoutEmphasis)),it(n,u,r,l)}else if(n.attr(u),!vf(n).valueAnimation){var h=be(n.style.opacity,1);n.style.opacity=0,Nt(n,{style:{opacity:h}},r,l)}if(a.oldLayout=u,n.states.select){var d=a.oldLayoutSelect={};Im(d,u,Dm),Im(d,n.states.select,Dm)}if(n.states.emphasis){var g=a.oldLayoutEmphasis={};Im(g,u,Dm),Im(g,n.states.emphasis,Dm)}lV(n,l,c,r,r)}if(i&&!i.ignore&&!i.invisible){var a=Rne(i),o=a.oldLayout,m={points:i.shape.points};o?(i.attr({shape:o}),it(i,{shape:m},r)):(i.setShape(m),i.style.strokePercent=0,Nt(i,{style:{strokePercent:1}},r)),a.oldLayout=m}},e}(),rw=Ye();function zne(e){e.registerUpdateLifecycle("series:beforeupdate",function(t,r,n){var i=rw(r).labelManager;i||(i=rw(r).labelManager=new One),i.clearLabels()}),e.registerUpdateLifecycle("series:layoutlabels",function(t,r,n){var i=rw(r).labelManager;n.updatedSeries.forEach(function(a){i.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),i.updateLayoutConfig(r),i.layout(r),i.processLabelsOverall()})}var nw=Math.sin,iw=Math.cos,AG=Math.PI,Ul=Math.PI*2,Bne=180/AG,kG=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,h=Math.abs(u),f=ks(h-Ul)||(c?u>=Ul:-u>=Ul),d=u>0?u%Ul:u%Ul+Ul,g=!1;f?g=!0:ks(h)?g=!1:g=d>=AG==!!c;var m=t+n*iw(o),y=r+i*nw(o);this._start&&this._add("M",m,y);var x=Math.round(a*Bne);if(f){var _=1/this._p,w=(c?1:-1)*(Ul-_);this._add("A",n,i,x,1,+c,t+n*iw(o+w),r+i*nw(o+w)),_>.01&&this._add("A",n,i,x,0,+c,m,y)}else{var S=t+n*iw(s),T=r+i*nw(s);this._add("A",n,i,x,+g,+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=[],h=this._p,f=1;f"}function Yne(e){return""}function dk(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 $ne(o,s)+(o!=="style"?hn(l):l||"")+(a?""+r+ae(a,function(u){return n(u)}).join(r)+r:"")+Yne(o)}return n(e)}function Xne(e,t,r){r=r||{};var n=r.newline?` -`:"",i=" {"+n,a=n+"}",o=ae(Qe(e),function(l){return l+i+ae(Qe(e[l]),function(u){return u+":"+e[l][u]+";"}).join(n)+a}).join(n),s=ae(Qe(t),function(l){return"@keyframes "+l+i+ae(Qe(t[l]),function(u){return u+i+ae(Qe(t[l][u]),function(c){var h=t[l][u][c];return c==="d"&&(h='path("'+h+'")'),c+":"+h+";"}).join(n)+a}).join(n)+a}).join(n);return!o&&!s?"":[""].join(n)}function RT(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function NE(e,t,r,n){return Nr("svg","root",{width:e,height:t,xmlns:LG,"xmlns:xlink":NG,version:"1.1",baseProfile:"full",viewBox:n?"0 0 "+e+" "+t:!1},r)}var qne=0;function IG(){return qne++}var PE={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"},ql="transform-origin";function Kne(e,t,r){var n=Q({},e.shape);Q(n,t),e.buildPath(r,n);var i=new kG;return i.reset(JB(e)),r.rebuildPath(i,1),i.generateStr(),i.getStr()}function Jne(e,t){var r=t.originX,n=t.originY;(r||n)&&(e[ql]=r+"px "+n+"px")}var Qne={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function DG(e,t){var r=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[r]=e,r}function eie(e,t,r){var n=e.shape.paths,i={},a,o;if(j(n,function(l){var u=RT(r.zrId);u.animation=!0,Ix(l,{},u,!0);var c=u.cssAnims,h=u.cssNodes,f=Qe(c),d=f.length;if(d){o=f[d-1];var g=c[o];for(var m in g){var y=g[m];i[m]=i[m]||{d:""},i[m].d+=y.d||""}for(var _ in h){var x=h[_].animation;x.indexOf(o)>=0&&(a=x)}}}),!!a){t.d=!1;var s=DG(i,r);return a.replace(o,s)}}function IE(e){return he(e)?PE[e]?"cubic-bezier("+PE[e]+")":XM(e)?e:"":""}function Ix(e,t,r,n){var i=e.animators,a=i.length,o=[];if(e instanceof Hp){var s=eie(e,t,r);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var Ee=DG(A,r);return Ee+" "+x[0]+" both"}}for(var y in l){var s=m(l[y]);s&&o.push(s)}if(o.length){var _=r.zrId+"-cls-"+IG();r.cssNodes["."+_]={animation:o.join(",")},t.class=_}}function tie(e,t,r){if(!e.ignore)if(e.isSilent()){var n={"pointer-events":"none"};DE(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=M0(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),DE(n,t,r)}}function DE(e,t,r,n){var i=JSON.stringify(e),a=r.cssStyleCache[i];a||(a=r.zrId+"-cls-"+IG(),r.cssStyleCache[i]=a,r.cssNodes["."+a+":hover"]=e),t.class=t.class?t.class+" "+a:a}var vp=Math.round;function EG(e){return e&&he(e.src)}function jG(e){return e&&we(e.toDataURL)}function vk(e,t,r,n){Hne(function(i,a){var o=i==="fill"||i==="stroke";o&&KB(a)?OG(t,e,i,n):o&&KM(a)?zG(r,e,i,n):e[i]=a,o&&n.ssr&&a==="none"&&(e["pointer-events"]="visible")},t,r,!1),lie(r,e,n)}function pk(e,t){var r=oF(t);r&&(r.each(function(n,i){n!=null&&(e[(LE+i).toLowerCase()]=n+"")}),t.isSilent()&&(e[LE+"silent"]="true"))}function EE(e){return ks(e[0]-1)&&ks(e[1])&&ks(e[2])&&ks(e[3]-1)}function rie(e){return ks(e[4])&&ks(e[5])}function gk(e,t,r){if(t&&!(rie(t)&&EE(t))){var n=1e4;e.transform=EE(t)?"translate("+vp(t[4]*n)/n+" "+vp(t[5]*n)/n+")":OX(t)}}function jE(e,t,r){for(var n=e.points,i=[],a=0;a"u"){var y="Image width/height must been given explictly in svg-ssr renderer.";Jr(f,y),Jr(d,y)}else if(f==null||d==null){var _=function(N,D){if(N){var O=N.elm,R=f||D.width,F=d||D.height;N.tag==="pattern"&&(u?(F=1,R/=a.width):c&&(R=1,F/=a.height)),N.attrs.width=R,N.attrs.height=F,O&&(O.setAttribute("width",R),O.setAttribute("height",F))}},x=oA(g,null,e,function(N){l||_(M,N),_(h,N)});x&&x.width&&x.height&&(f=f||x.width,d=d||x.height)}h=Nr("image","img",{href:g,width:f,height:d}),o.width=f,o.height=d}else i.svgElement&&(h=Se(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(h){var w,S;l?w=S=1:u?(S=1,w=o.width/a.width):c?(w=1,S=o.height/a.height):o.patternUnits="userSpaceOnUse",w!=null&&!isNaN(w)&&(o.width=w),S!=null&&!isNaN(S)&&(o.height=S);var T=QB(i);T&&(o.patternTransform=T);var M=Nr("pattern","",o,[h]),A=dk(M),P=n.patternCache,I=P[A];I||(I=n.zrId+"-p"+n.patternIdx++,P[A]=I,o.id=I,M=n.defs[I]=Nr("pattern",I,o,[h])),t[r]=lx(I)}}function uie(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]=Nr("clipPath",a,o,[RG(e,r)])}t["clip-path"]=lx(a)}function zE(e){return document.createTextNode(e)}function nu(e,t,r){e.insertBefore(t,r)}function BE(e,t){e.removeChild(t)}function FE(e,t){e.appendChild(t)}function BG(e){return e.parentNode}function FG(e){return e.nextSibling}function aw(e,t){e.textContent=t}var VE=58,cie=120,hie=Nr("","");function OT(e){return e===void 0}function Na(e){return e!==void 0}function fie(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 Yd(e,t){var r=e.key===t.key,n=e.tag===t.tag;return n&&r}function pp(e){var t,r=e.children,n=e.tag;if(Na(n)){var i=e.elm=PG(n);if(mk(hie,e),re(r))for(t=0;ta?(g=r[l+1]==null?null:r[l+1].elm,VG(e,g,r,i,l)):n_(e,t,n,a))}function Hc(e,t){var r=t.elm=e.elm,n=e.children,i=t.children;e!==t&&(mk(e,t),OT(t.text)?Na(n)&&Na(i)?n!==i&&die(r,n,i):Na(i)?(Na(e.text)&&aw(r,""),VG(r,null,i,0,i.length-1)):Na(n)?n_(r,n,0,n.length-1):Na(e.text)&&aw(r,""):e.text!==t.text&&(Na(n)&&n_(r,n,0,n.length-1),aw(r,t.text)))}function vie(e,t){if(Yd(e,t))Hc(e,t);else{var r=e.elm,n=BG(r);pp(t),n!==null&&(nu(n,t.elm,FG(r)),n_(n,[e],0,0))}return t}var pie=0,gie=function(){function e(t,r,n){if(this.type="svg",this.refreshHover=GE(),this.configLayer=GE(),this.storage=r,this._opts=n=Q({},n),this.root=t,this._id="zr"+pie++,this._oldVNode=NE(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=PG("svg");mk(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",vie(this._oldVNode,t),this._oldVNode=t}},e.prototype.renderOneToVNode=function(t){return OE(t,RT(this._id))},e.prototype.renderToVNode=function(t){t=t||{};var r=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=RT(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=mie(n,i,this._backgroundColor,a);s&&o.push(s);var l=t.compress?null:this._mainVNode=Nr("g","main",{},[]);this._paintList(r,a,l?l.children:o),l&&o.push(l);var u=ae(Qe(a.defs),function(f){return a.defs[f]});if(u.length&&o.push(Nr("defs","defs",{},u)),t.animation){var c=Xne(a.cssNodes,a.cssAnims,{newline:!0});if(c){var h=Nr("style","stl",{},[],c);o.push(h)}}return NE(n,i,o,t.useViewBox)},e.prototype.renderToString=function(t){return t=t||{},dk(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&&!(f&&l&&f[m]===l[m]);m--);for(var y=g-1;y>m;y--)o--,s=a[o-1];for(var _=m+1;_=s)}}for(var h=this.__startIndex;h15)break}}F.prevElClipPaths&&_.restore()};if(x)if(x.length===0)P=y.__endIndex;else for(var N=d.dpr,D=0;D0&&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?Em:0),this._needsManuallyCompositing),c.__builtin__||nx("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&Xn&&!i.__inHover&&(c.__dirty=!0,c.incremental&&c.__drawIndex<0&&(c.__drawIndex=l))}r(l),this.eachBuiltinLayer(function(h,f){!h.__used&&h.getElementCount()>0&&(h.__dirty=!0,h.__startIndex=h.__endIndex=h.__drawIndex=0),h.__dirty&&h.__drawIndex<0&&(h.__drawIndex=h.__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,j(this._layers,function(r){r.setUnpainted()})},e.prototype.configLayer=function(t,r){if(r){var n=this._layerConfig;n[t]?Ge(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}(bt);function Uh(e,t){var r=e.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var i=Vh(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 qp=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=sr(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=Tie,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(){Ho(this.childAt(0))},t.prototype.downplay=function(){Uo(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,h=a&&a.disableAnimation;if(c){var f=r.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,r,n,l,u,f)}else{var d=this.childAt(0);d.silent=!1;var g={scaleX:l[0]/2,scaleY:l[1]/2};h?d.attr(g):it(d,g,s,n),Oi(d)}if(this._updateCommon(r,n,l,i,a),c){var d=this.childAt(0);if(!h){var g={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:d.style.opacity}};d.scaleX=d.scaleY=0,d.style.opacity=0,Nt(d,g,s,n)}}h&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(r,n,i,a,o){var s=this.childAt(0),l=r.hostModel,u,c,h,f,d,g,m,y,_;if(a&&(u=a.emphasisItemStyle,c=a.blurItemStyle,h=a.selectItemStyle,f=a.focus,d=a.blurScope,m=a.labelStatesModels,y=a.hoverScale,_=a.cursorStyle,g=a.emphasisDisabled),!a||r.hasItemOption){var x=a&&a.itemModel?a.itemModel:r.getItemModel(n),w=x.getModel("emphasis");u=w.getModel("itemStyle").getItemStyle(),h=x.getModel(["select","itemStyle"]).getItemStyle(),c=x.getModel(["blur","itemStyle"]).getItemStyle(),f=w.get("focus"),d=w.get("blurScope"),g=w.get("disabled"),m=Cr(x),y=w.getShallow("scale"),_=x.getShallow("cursor")}var S=r.getItemVisual(n,"symbolRotate");s.attr("rotation",(S||0)*Math.PI/180||0);var T=ec(r.getItemVisual(n,"symbolOffset"),i);T&&(s.x=T[0],s.y=T[1]),_&&s.attr("cursor",_);var M=r.getItemVisual(n,"style"),A=M.fill;if(s instanceof Er){var P=s.style;s.useStyle(Q({image:P.image,x:P.x,y:P.y,width:P.width,height:P.height},M))}else s.__isEmptyBrush?s.useStyle(Q({},M)):s.useStyle(M),s.style.decal=null,s.setColor(A,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var I=r.getItemVisual(n,"liftZ"),N=this._z2;I!=null?N==null&&(this._z2=s.z2,s.z2+=I):N!=null&&(s.z2=N,this._z2=null);var D=o&&o.useNameLabel;Dr(s,m,{labelFetcher:l,labelDataIndex:n,defaultText:O,inheritColor:A,defaultOpacity:M.opacity});function O(H){return D?r.getName(H):Uh(r,H)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var R=s.ensureState("emphasis");R.style=u,s.ensureState("select").style=h,s.ensureState("blur").style=c;var F=y==null||y===!0?Math.max(1.1,3/this._sizeY):isFinite(y)&&y>0?+y:1;R.scaleX=this._sizeX*F,R.scaleY=this._sizeY*F,this.setSymbolScale(1),Dt(this,f,d,g)},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&&el(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();el(a,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:r,removeOpt:s})},t.getSymbolSize=function(r,n){return xf(r.getItemVisual(n,"symbolSize"))},t.getSymbolZ2=function(r,n){return r.getItemVisual(n,"z2")},t}(Ce);function Tie(e,t){this.parent.drift(e,t)}function sw(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 UE(e){return e!=null&&!ke(e)&&(e={isIgnore:e}),e||{}}function ZE(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:Cr(t),cursorStyle:t.get("cursor")}}var Kp=function(){function e(t){this.group=new Ce,this._SymbolCtor=t||qp}return e.prototype.updateData=function(t,r){this._progressiveEls=null,r=UE(r);var n=this.group,i=t.hostModel,a=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=ZE(t),u={disableAnimation:s},c=r.getSymbolPoint||function(h){return t.getItemLayout(h)};a||n.removeAll(),t.diff(a).add(function(h){var f=c(h);if(sw(t,f,h,r)){var d=new o(t,h,l,u);d.setPosition(f),t.setItemGraphicEl(h,d),n.add(d)}}).update(function(h,f){var d=a.getItemGraphicEl(f),g=c(h);if(!sw(t,g,h,r)){n.remove(d);return}var m=t.getItemVisual(h,"symbol")||"circle",y=d&&d.getSymbolType&&d.getSymbolType();if(!d||y&&y!==m)n.remove(d),d=new o(t,h,l,u),d.setPosition(g);else{d.updateData(t,h,l,u);var _={x:g[0],y:g[1]};s?d.attr(_):it(d,_,i)}n.add(d),t.setItemGraphicEl(h,d)}).remove(function(h){var f=a.getItemGraphicEl(h);f&&f.fadeOut(function(){n.remove(f)},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=ZE(t),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(t,r,n){this._progressiveEls=[],n=UE(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 HG(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 Aie(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 kie(e,t,r,n,i,a,o,s){for(var l=Aie(e,t),u=[],c=[],h=[],f=[],d=[],g=[],m=[],y=WG(i,t,o),_=e.getLayout("points")||[],x=t.getLayout("points")||[],w=0;w=i||m<0)break;if(Cu(_,x)){if(l){m+=a;continue}break}if(m===r)e[a>0?"moveTo":"lineTo"](_,x),h=_,f=x;else{var w=_-u,S=x-c;if(w*w+S*S<.5){m+=a;continue}if(o>0){for(var T=m+a,M=t[T*2],A=t[T*2+1];M===_&&A===x&&y=n||Cu(M,A))d=_,g=x;else{N=M-u,D=A-c;var F=_-u,H=M-_,W=x-c,V=A-x,z=void 0,Z=void 0;if(s==="x"){z=Math.abs(F),Z=Math.abs(H);var U=N>0?1:-1;d=_-U*z*o,g=x,O=_+U*Z*o,R=x}else if(s==="y"){z=Math.abs(W),Z=Math.abs(V);var $=D>0?1:-1;d=_,g=x-$*z*o,O=_,R=x+$*Z*o}else z=Math.sqrt(F*F+W*W),Z=Math.sqrt(H*H+V*V),I=Z/(Z+z),d=_-N*o*(1-I),g=x-D*o*(1-I),O=_+N*o*I,R=x+D*o*I,O=ls(O,us(M,_)),R=ls(R,us(A,x)),O=us(O,ls(M,_)),R=us(R,ls(A,x)),N=O-_,D=R-x,d=_-N*z/Z,g=x-D*z/Z,d=ls(d,us(u,_)),g=ls(g,us(c,x)),d=us(d,ls(u,_)),g=us(g,ls(c,x)),N=_-d,D=x-g,O=_+N*Z/z,R=x+D*Z/z}e.bezierCurveTo(h,f,d,g,_,x),h=O,f=R}else e.lineTo(_,x)}u=_,c=x,m+=a}return y}var UG=function(){function e(){this.smooth=0,this.smoothConstraint=!0}return e}(),Lie=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 UG},t.prototype.buildPath=function(r,n){var i=n.points,a=0,o=i.length/2;if(n.connectNulls){for(;o>0&&Cu(i[o*2-2],i[o*2-1]);o--);for(;a=0){var S=u?(g-l)*w+l:(d-s)*w+s;return u?[r,S]:[S,r]}s=d,l=g;break;case o.C:d=a[h++],g=a[h++],m=a[h++],y=a[h++],_=a[h++],x=a[h++];var T=u?C0(s,d,m,_,r,c):C0(l,g,y,x,r,c);if(T>0)for(var M=0;M=0){var S=u?kr(l,g,y,x,A):kr(s,d,m,_,A);return u?[r,S]:[S,r]}}s=_,l=x;break}}},t}(Ke),Nie=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(UG),ZG=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 Nie},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&&Cu(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 Die(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=ae(a.stops,function(w){return{coord:l.toGlobalCoord(l.dataToCoord(w.value)),color:w.color}}),c=u.length,h=a.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),h.reverse());var f=Iie(u,i==="x"?r.getWidth():r.getHeight()),d=f.length;if(!d&&c)return u[0].coord<0?h[1]?h[1]:u[c-1].color:h[0]?h[0]:u[0].color;var g=10,m=f[0].coord-g,y=f[d-1].coord+g,_=y-m;if(_<.001)return"transparent";j(f,function(w){w.offset=(w.coord-m)/_}),f.push({offset:d?f[d-1].offset:.5,color:h[1]||"transparent"}),f.unshift({offset:d?f[0].offset:.5,color:h[0]||"transparent"});var x=new qu(0,0,0,0,f,!0);return x[i]=m,x[i+"2"]=y,x}}}function Eie(e,t,r){var n=e.get("showAllSymbol"),i=n==="auto";if(!(n&&!i)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(i&&jie(a,t))){var o=t.mapDimension(a.dim),s={};return j(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(t.get(o,l))}}}}function jie(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 Rie(e,t){return isNaN(e)||isNaN(t)}function Oie(e){for(var t=e.length/2;t>0&&Rie(e[t*2-2],e[t*2-1]);t--);return t-1}function KE(e,t){return[e[t*2],e[t*2+1]]}function zie(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 XG(e){if(e.get(["endLabel","show"]))return!0;for(var t=0;t0&&r.get(["emphasis","lineStyle","width"])==="bolder"){var Z=g.getState("emphasis").style;Z.lineWidth=+g.style.lineWidth+1}De(g).seriesIndex=r.seriesIndex,Dt(g,W,V,z);var U=qE(r.get("smooth")),$=r.get("smoothMonotone");if(g.setShape({smooth:U,smoothMonotone:$,connectNulls:A}),m){var Y=s.getCalculationInfo("stackedOnSeries"),te=0;m.useStyle(Ae(u.getAreaStyle(),{fill:O,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),Y&&(te=qE(Y.get("smooth"))),m.setShape({smooth:U,stackedOnSmooth:te,smoothMonotone:$,connectNulls:A}),Sr(m,r,"areaStyle"),De(m).seriesIndex=r.seriesIndex,Dt(m,W,V,z)}var ie=this._changePolyState;s.eachItemGraphicEl(function(se){se&&(se.onHoverStateChange=ie)}),this._polyline.onHoverStateChange=ie,this._data=s,this._coordSys=a,this._stackedOnPoints=T,this._points=c,this._step=N,this._valueOrigin=w,r.get("triggerLineEvent")&&(this.packEventData(r,g),m&&this.packEventData(r,m))},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=Ru(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],h=l[s*2+1];if(isNaN(c)||isNaN(h)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(c,h))return;var f=r.get("zlevel")||0,d=r.get("z")||0;u=new qp(o,s),u.x=c,u.y=h,u.setZ(f,d);var g=u.getSymbolPath().getTextContent();g&&(g.zlevel=f,g.z=d,g.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else gt.prototype.highlight.call(this,r,n,i,a)},t.prototype.downplay=function(r,n,i,a){var o=r.getData(),s=Ru(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 gt.prototype.downplay.call(this,r,n,i,a)},t.prototype._changePolyState=function(r){var n=this._polygon;j0(this._polyline,r),n&&j0(n,r)},t.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new Lie({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 ZG({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");we(c)&&(c=c(null));var h=u.get("animationDelay")||0,f=we(h)?h(null):h;r.eachItemGraphicEl(function(d,g){var m=d;if(m){var y=[d.x,d.y],_=void 0,x=void 0,w=void 0;if(i)if(o){var S=i,T=n.pointToCoord(y);a?(_=S.startAngle,x=S.endAngle,w=-T[1]/180*Math.PI):(_=S.r0,x=S.r,w=T[0])}else{var M=i;a?(_=M.x,x=M.x+M.width,w=d.x):(_=M.y+M.height,x=M.y,w=d.y)}var A=x===_?0:(w-_)/(x-_);l&&(A=1-A);var P=we(h)?h(g):c*A+f,I=m.getSymbolPath(),N=I.getTextContent();m.attr({scaleX:0,scaleY:0}),m.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:P}),N&&N.animateFrom({style:{opacity:0}},{duration:300,delay:P}),I.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(r,n,i){var a=r.getModel("endLabel");if(XG(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 tt({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var c=Oie(l);c>=0&&(Dr(s,Cr(r,"endLabel"),{inheritColor:i,labelFetcher:r,labelDataIndex:c,defaultText:function(h,f,d){return d!=null?GG(o,d):Uh(o,h)},enableTextSetter:!0},Bie(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 h=i.getLayout("points"),f=i.hostModel,d=f.get("connectNulls"),g=s.get("precision"),m=s.get("distance")||0,y=l.getBaseAxis(),_=y.isHorizontal(),x=y.inverse,w=n.shape,S=x?_?w.x:w.y+w.height:_?w.x+w.width:w.y,T=(_?m:0)*(x?-1:1),M=(_?0:-m)*(x?-1:1),A=_?"x":"y",P=zie(h,S,A),I=P.range,N=I[1]-I[0],D=void 0;if(N>=1){if(N>1&&!d){var O=KE(h,I[0]);u.attr({x:O[0]+T,y:O[1]+M}),o&&(D=f.getRawValue(I[0]))}else{var O=c.getPointOn(S,A);O&&u.attr({x:O[0]+T,y:O[1]+M});var R=f.getRawValue(I[0]),F=f.getRawValue(I[1]);o&&(D=xF(i,g,R,F,P.t))}a.lastFrameIndex=I[0]}else{var H=r===1||a.lastFrameIndex>0?I[0]:0,O=KE(h,H);o&&(D=f.getRawValue(H)),u.attr({x:O[0]+T,y:O[1]+M})}if(o){var W=vf(u);typeof W.setLabelText=="function"&&W.setLabelText(D)}}},t.prototype._doUpdateAnimation=function(r,n,i,a,o,s,l){var u=this._polyline,c=this._polygon,h=r.hostModel,f=kie(this._data,r,this._stackedOnPoints,n,this._coordSys,i,this._valueOrigin),d=f.current,g=f.stackedOnCurrent,m=f.next,y=f.stackedOnNext;if(o&&(g=cs(f.stackedOnCurrent,f.current,i,o,l),d=cs(f.current,null,i,o,l),y=cs(f.stackedOnNext,f.next,i,o,l),m=cs(f.next,null,i,o,l)),XE(d,m)>3e3||c&&XE(g,y)>3e3){u.stopAnimation(),u.setShape({points:m}),c&&(c.stopAnimation(),c.setShape({points:m,stackedOnPoints:y}));return}u.shape.__points=f.current,u.shape.points=d;var _={shape:{points:m}};f.current!==d&&(_.shape.__points=f.next),u.stopAnimation(),it(u,_,h),c&&(c.setShape({points:d,stackedOnPoints:g}),c.stopAnimation(),it(c,{shape:{stackedOnPoints:y}},h),u.shape.points!==c.shape.points&&(c.shape.points=u.shape.points));for(var x=[],w=f.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(),h=n.getDevicePixelRatio(),f=Math.abs(c[1]-c[0])*(h||1),d=Math.round(s/f);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 g=void 0;he(a)?g=Vie[a]:we(a)&&(g=a),g&&t.setData(i.downSample(i.mapDimension(u.dim),1/d,g,Gie))}}}}}function Wie(e){e.registerChartView(Fie),e.registerSeriesModel(Cie),e.registerLayout(Qp("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,qG("line"))}var gp=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 no(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)j(a.getAxes(),function(f,d){if(f.type==="category"&&n!=null){var g=f.getTicksCoords(),m=f.getTickModel().get("alignWithLabel"),y=o[d],_=n[d]==="x1"||n[d]==="y1";if(_&&!m&&(y+=1),g.length<2)return;if(g.length===2){s[d]=f.toGlobalCoord(f.getExtent()[_?1:0]);return}for(var x=void 0,w=void 0,S=1,T=0;Ty){w=(M+x)/2;break}T===1&&(S=A-g[0].tickValue)}w==null&&(x?x&&(w=g[g.length-1].coord):w=g[0].coord),s[d]=f.toGlobalCoord(w)}});else{var l=this.getData(),u=l.getLayout("offset"),c=l.getLayout("size"),h=a.getBaseAxis().isHorizontal()?0:1;s[h]+=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}(bt);bt.registerClass(gp);var Hie=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 no(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=fl(gp.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}(gp),Uie=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}(),i_=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 Uie},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,h=n.endAngle,f=n.clockwise,d=Math.PI*2,g=f?h-cMath.PI/2&&cs)return!0;s=h}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){Do(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}(gt),JE={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=uw(t.x,e.x),s=cw(t.x+t.width,i),l=uw(t.y,e.y),u=cw(t.y+t.height,a),c=si?s:o,t.y=h&&l>a?u:l,t.width=c?0:s-o,t.height=h?0:u-l,r<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height),c||h},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=cw(t.r,e.r),a=uw(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}},QE={cartesian2d:function(e,t,r,n,i,a,o,s,l){var u=new Ze({shape:Q({},n),z2:1});if(u.__dataIndex=r,u.name="item",a){var c=u.shape,h=i?"height":"width";c[h]=0}return u},polar:function(e,t,r,n,i,a,o,s,l){var u=!i&&l?i_:Qr,c=new u({shape:n,z2:1});c.name="item";var h=KG(i);if(c.calculateTextPosition=Zie(h,{isRoundCap:u===i_}),a){var f=c.shape,d=i?"r":"endAngle",g={};f[d]=i?n.r0:n.startAngle,g[d]=n[d],(s?it:Nt)(c,{shape:g},a)}return c}};function qie(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 ej(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?it:Nt)(r,{shape:l},t,i,null);var c=t?e.baseAxis.model:null;(o?it:Nt)(r,{shape:u},c,i)}function tj(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 Qie(e){return e.startAngle!=null&&e.endAngle!=null&&e.startAngle===e.endAngle}function KG(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 nj(e,t,r,n,i,a,o,s){var l=t.getItemVisual(r,"style");if(s){if(!a.get("roundCap")){var c=e.shape,h=Ba(n.getModel("itemStyle"),c,!0);Q(c,h),e.setShape(c)}}else{var u=n.get(["itemStyle","borderRadius"])||0;e.setShape("r",u)}e.useStyle(l);var f=n.getShallow("cursor");f&&e.attr("cursor",f);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",g=Cr(n);Dr(e,g,{labelFetcher:a,labelDataIndex:r,defaultText:Uh(a.getData(),r),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var m=e.getTextContent();if(s&&m){var y=n.get(["label","position"]);e.textConfig.inside=y==="middle"?!0:null,$ie(e,y==="outside"?d:y,KG(o),n.get(["label","rotate"]))}sV(m,g,a.getRawValue(r),function(x){return GG(t,x)});var _=n.getModel(["emphasis"]);Dt(e,_.get("focus"),_.get("blurScope"),_.get("disabled")),Sr(e,n),Qie(i)&&(e.style.fill="none",e.style.stroke="none",j(e.states,function(x){x.style&&(x.style.fill=x.style.stroke="none")}))}function eae(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 tae=function(){function e(){}return e}(),ij=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 tae},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 rae(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,h=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 JG(e,t,r){if(tl(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 nae(e,t,r){var n=e.type==="polar"?Qr:Ze;return new n({shape:JG(t,r,e),silent:!0,z2:0})}function iae(e){e.registerChartView(Xie),e.registerSeriesModel(Hie),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Fe(tG,"bar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,rG("bar")),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,qG("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 sj=Math.PI*2,zm=Math.PI/180;function aae(e,t,r){t.eachSeriesByType(e,function(n){var i=n.getData(),a=i.mapDimension("value"),o=TV(n,r),s=o.cx,l=o.cy,u=o.r,c=o.r0,h=o.viewRect,f=-n.get("startAngle")*zm,d=n.get("endAngle"),g=n.get("padAngle")*zm;d=d==="auto"?f-sj:-d*zm;var m=n.get("minAngle")*zm,y=m+g,_=0;i.each(a,function(V){!isNaN(V)&&_++});var x=i.getSum(a),w=Math.PI/(x||_)*2,S=n.get("clockwise"),T=n.get("roseType"),M=n.get("stillShowZeroSum"),A=i.getDataExtent(a);A[0]=0;var P=S?1:-1,I=[f,d],N=P*g/2;gx(I,!S),f=I[0],d=I[1];var D=QG(n);D.startAngle=f,D.endAngle=d,D.clockwise=S,D.cx=s,D.cy=l,D.r=u,D.r0=c;var O=Math.abs(d-f),R=O,F=0,H=f;if(i.setLayout({viewRect:h,r:u}),i.each(a,function(V,z){var Z;if(isNaN(V)){i.setItemLayout(z,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:S,cx:s,cy:l,r0:c,r:T?NaN:u});return}T!=="area"?Z=x===0&&M?w:V*w:Z=O/_,ZZ?($=H+P*Z/2,Y=$):($=H+N,Y=U-N),i.setItemLayout(z,{angle:Z,startAngle:$,endAngle:Y,clockwise:S,cx:s,cy:l,r0:c,r:T?ht(V,A,[c,u]):u}),H=U}),Rr?_:y,T=Math.abs(w.label.y-r);if(T>=S.maxY){var M=w.label.x-t-w.len2*i,A=n+w.len,P=Math.abs(M)e.unconstrainedWidth?null:f:null;n.setStyle("width",d)}tW(a,n)}}}function tW(e,t){uj.rect=e,TG(uj,t,lae)}var lae={minMarginForce:[null,0,null,0],marginDefault:[1,0,1,0]},uj={};function hw(e){return e.position==="center"}function uae(e){var t=e.getData(),r=[],n,i,a=!1,o=(e.get("minShowLabelAngle")||0)*oae,s=t.getLayout("viewRect"),l=t.getLayout("r"),u=s.width,c=s.x,h=s.y,f=s.height;function d(M){M.ignore=!0}function g(M){if(!M.ignore)return!0;for(var A in M.states)if(M.states[A].ignore===!1)return!0;return!1}t.each(function(M){var A=t.getItemGraphicEl(M),P=A.shape,I=A.getTextContent(),N=A.getTextGuideLine(),D=t.getItemModel(M),O=D.getModel("label"),R=O.get("position")||D.get(["emphasis","label","position"]),F=O.get("distanceToLabelLine"),H=O.get("alignTo"),W=ce(O.get("edgeDistance"),u),V=O.get("bleedMargin");V==null&&(V=Math.min(u,f)>200?10:2);var z=D.getModel("labelLine"),Z=z.get("length");Z=ce(Z,u);var U=z.get("length2");if(U=ce(U,u),Math.abs(P.endAngle-P.startAngle)0?"right":"left":Y>0?"left":"right"}var et=Math.PI,lt=0,Et=O.get("rotate");if(rt(Et))lt=Et*(et/180);else if(R==="center")lt=0;else if(Et==="radial"||Et===!0){var lr=Y<0?-$+et:-$;lt=lr}else if(Et==="tangential"&&R!=="outside"&&R!=="outer"){var Mr=Math.atan2(Y,te);Mr<0&&(Mr=et*2+Mr);var Gn=te>0;Gn&&(Mr=et+Mr),lt=Mr-et}if(a=!!lt,I.x=ie,I.y=se,I.rotation=lt,I.setStyle({verticalAlign:"middle"}),me){I.setStyle({align:Ee});var io=I.states.select;io&&(io.x+=I.x,io.y+=I.y)}else{var Wn=new Pe(0,0,0,0);tW(Wn,I),r.push({label:I,labelLine:N,position:R,len:Z,len2:U,minTurnAngle:z.get("minTurnAngle"),maxSurfaceAngle:z.get("maxSurfaceAngle"),surfaceNormal:new Ne(Y,te),linePoints:le,textAlign:Ee,labelDistance:F,labelAlignTo:H,edgeDistance:W,bleedMargin:V,rect:Wn,unconstrainedWidth:Wn.width,labelStyleWidth:I.style.width})}A.setTextConfig({inside:me})}}),!a&&e.get("avoidLabelOverlap")&&sae(r,n,i,l,u,f,c,h);for(var m=0;m0){for(var c=o.getItemLayout(0),h=1;isNaN(c&&c.startAngle)&&h=a.r0}},t.type="pie",t}(gt);function Tf(e,t,r){t=re(t)&&{coordDimensions:t}||Q({encodeDefine:e.getEncode()},t);var n=e.getSource(),i=bf(n,t).dimensions,a=new dn(i,e);return a.initData(n,r),a}var Mf=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}(),fae=Ye(),rW=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 Mf(fe(this.getData,this),fe(this.getRawData,this)),this._defaultLabelLine(r)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return Tf(this,{coordDimensions:["value"],encodeDefaulter:Fe(zA,this)})},t.prototype.getDataParams=function(r){var n=this.getData(),i=fae(n),a=i.seats;if(!a){var o=[];n.each(n.mapDimension("value"),function(l){o.push(l)}),a=i.seats=cF(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){ju(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}(bt);aQ({fullType:rW.type,getCoord2:function(e){return e.getShallow("center")}});function dae(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!(rt(o)&&!isNaN(o)&&o<0)})}}}function vae(e){e.registerChartView(hae),e.registerSeriesModel(rW),g6("pie",e.registerAction),e.registerLayout(Fe(aae,"pie")),e.registerProcessor(Cf("pie")),e.registerProcessor(dae("pie"))}var pae=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 no(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}(bt),nW=4,gae=function(){function e(){}return e}(),mae=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 gae},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,h=a[c]-s/2,f=a[c+1]-l/2;if(r>=h&&n>=f&&r<=h+s&&n<=f+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,h=-1/0,f=0;f=0&&(u.dataIndex=h+(t.startIndex||0))})},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),_ae=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=Qp("").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 yae:new Kp,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}(gt),iW={left:0,right:0,top:0,bottom:0},a_=["25%","25%"],xae=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.mergeDefaultAndTheme=function(r,n){var i=Ju(r.outerBounds);e.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&r.outerBounds&&Ka(r.outerBounds,i)},t.prototype.mergeOption=function(r,n){e.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&r.outerBounds&&Ka(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:iW,outerBoundsContain:"all",outerBoundsClampWidth:a_[0],outerBoundsClampHeight:a_[1],backgroundColor:K.color.transparent,borderWidth:1,borderColor:K.color.neutral30},t}($e),BT=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Ht).models[0]},t.type="cartesian2dAxis",t}($e);Qt(BT,Sf);var aW={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"}},bae=Ge({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},aW),yk=Ge({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}}},aW),wae=Ge({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},yk),Sae=Ae({logBase:10},yk);const oW={category:bae,value:yk,time:wae,log:Sae};var Cae={value:1,category:1,time:1,log:1},FT=null;function Tae(e){FT||(FT=e)}function eg(){return FT}function Zh(e,t,r,n){j(Cae,function(i,a){var o=Ge(Ge({},oW[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,h){var f=op(this),d=f?Ju(c):{},g=h.getTheme();Ge(c,g.get(a+"Axis")),Ge(c,this.getDefaultOption()),c.type=cj(c),f&&Ka(c,d,f)},u.prototype.optionUpdated=function(){var c=this.option;c.type==="category"&&(this.__ordinalMeta=fp.createByAxisModel(this))},u.prototype.getCategories=function(c){var h=this.option;if(h.type==="category")return c?h.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.prototype.updateAxisBreaks=function(c){var h=eg();return h?h.updateModelAxisBreak(this,c):{breaks:[]}},u.type=t+"Axis."+a,u.defaultOption=o,u}(r);e.registerComponentModel(s)}),e.registerSubTypeDefaulter(t+"Axis",cj)}function cj(e){return e.type||(e.data?"category":"value")}var Mae=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 ae(this._dimList,function(t){return this._axes[t]},this)},e.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),ot(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}(),VT=["x","y"];function hj(e){return(e.type==="interval"||e.type==="time")&&!e.hasBreaks()}var Aae=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type="cartesian2d",r.dimensions=VT,r}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!hj(r)||!hj(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,h=(s[1]-o[1])/u,f=o[0]-i[0]*c,d=o[1]-a[0]*h,g=this._transform=[c,0,0,h,f,d];this._invTransform=ji([],g)}}},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 Pe(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 Kt(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 Kt(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 Pe(a,o,s,l)},t}(Mae),sW=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}(Vi),Dx="expandAxisBreak",lW="collapseAxisBreak",uW="toggleAxisBreak",_k="axisbreakchanged",kae={type:Dx,event:_k,update:"update",refineEvent:xk},Lae={type:lW,event:_k,update:"update",refineEvent:xk},Nae={type:uW,event:_k,update:"update",refineEvent:xk};function xk(e,t,r,n){var i=[];return j(e,function(a){i=i.concat(a.eventBreaks)}),{eventContent:{breaks:i}}}function Pae(e){e.registerAction(kae,t),e.registerAction(Lae,t),e.registerAction(Nae,t);function t(r,n){var i=[],a=xh(n,r);function o(s,l){j(a[s],function(u){var c=u.updateAxisBreaks(r);j(c.breaks,function(h){var f;i.push(Ae((f={},f[l]=u.componentIndex,f),h))})})}return o("xAxisModels","xAxisIndex"),o("yAxisModels","yAxisIndex"),o("singleAxisModels","singleAxisIndex"),{eventBreaks:i}}}var Ls=Math.PI,Iae=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],Dae=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],$h=Ye(),cW=Ye(),hW=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 Eae(e,t,r,n){var i=r.axis,a=t.ensureRecord(r),o=[],s,l=bk(e.axisName)&&Hh(e.nameLocation);j(n,function(g){var m=Ja(g);if(!(!m||m.label.ignore)){o.push(m);var y=a.transGroup;l&&(y.transform?ji(bd,y.transform):zp(bd),m.transform&&aa(bd,bd,m.transform),Pe.copy(Bm,m.localRect),Bm.applyTransform(bd),s?s.union(Bm):Pe.copy(s=new Pe(0,0,0,0),Bm))}});var u=Math.abs(a.dirVec.x)>.1?"x":"y",c=a.transGroup[u];if(o.sort(function(g,m){return Math.abs(g.label[u]-c)-Math.abs(m.label[u]-c)}),l&&s){var h=i.getExtent(),f=Math.min(h[0],h[1]),d=Math.max(h[0],h[1])-f;s.union(new Pe(f,0,d,1))}a.stOccupiedRect=s,a.labelInfoList=o}var bd=Pr(),Bm=new Pe(0,0,0,0),fW=function(e,t,r,n,i,a){if(Hh(e.nameLocation)){var o=a.stOccupiedRect;o&&dW(Ine({},o,a.transGroup.transform),n,i)}else vW(a.labelInfoList,a.dirVec,n,i)};function dW(e,t,r){var n=new Ne;Px(e,t,n,{direction:Math.atan2(r.y,r.x),bidirectional:!1,touchThreshold:.05})&&IT(t,n)}function vW(e,t,r,n){for(var i=Ne.dot(n,t)>=0,a=0,o=e.length;a0?"top":"bottom",a="center"):Oh(i-Ls)?(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}(),jae=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],Rae={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],h=[l[1],0],f=c[0]>h[0];u&&(Kt(c,c,u),Kt(h,h,u));var d=Q({lineCap:"round"},n.getModel(["axisLine","lineStyle"]).getLineStyle()),g={strokeContainThreshold:e.raw.strokeContainThreshold||5,silent:!0,z2:1,style:d};if(n.get(["axisLine","breakLine"])&&n.axis.scale.hasBreaks())eg().buildAxisBreakLine(n,i,a,g);else{var m=new ar(Q({shape:{x1:c[0],y1:c[1],x2:h[0],y2:h[1]}},g));Fh(m.shape,m.style.lineWidth),m.anid="line",i.add(m)}var y=n.get(["axisLine","symbol"]);if(y!=null){var _=n.get(["axisLine","symbolSize"]);he(y)&&(y=[y,y]),(he(_)||rt(_))&&(_=[_,_]);var x=ec(n.get(["axisLine","symbolOffset"])||0,_),w=_[0],S=_[1];j([{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]-h[0])*(c[0]-h[0])+(c[1]-h[1])*(c[1]-h[1]))}],function(T,M){if(y[M]!=="none"&&y[M]!=null){var A=sr(y[M],-w/2,-S/2,w,S,d.stroke,!0),P=T.r+T.offset,I=f?h:c;A.attr({rotation:T.rotate,x:I[0]+P*Math.cos(e.rotation),y:I[1]-P*Math.sin(e.rotation),silent:!0,z2:11}),i.add(A)}})}}},axisTickLabelEstimate:function(e,t,r,n,i,a,o,s){var l=dj(t,i,s);l&&fj(e,t,r,n,i,a,o,da.estimate)},axisTickLabelDetermine:function(e,t,r,n,i,a,o,s){var l=dj(t,i,s);l&&fj(e,t,r,n,i,a,o,da.determine);var u=Fae(e,i,a,n);Bae(e,t.labelLayoutList,u),Vae(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(bk(u)){var c=e.nameLocation,h=e.nameDirection,f=n.getModel("nameTextStyle"),d=n.get("nameGap")||0,g=n.axis.getExtent(),m=n.axis.inverse?-1:1,y=new Ne(0,0),_=new Ne(0,0);c==="start"?(y.x=g[0]-m*d,_.x=-m):c==="end"?(y.x=g[1]+m*d,_.x=m):(y.x=(g[0]+g[1])/2,y.y=e.labelOffset+h*d,_.y=h);var x=Pr();_.transform(Ko(x,x,e.rotation));var w=n.get("nameRotate");w!=null&&(w=w*Ls/180);var S,T;Hh(c)?S=wn.innerTextLayout(e.rotation,w??e.rotation,h):(S=Oae(e.rotation,c,w||0,g),T=e.raw.axisNameAvailableWidth,T!=null&&(T=Math.abs(T/Math.sin(S.rotation)),!isFinite(T)&&(T=null)));var M=f.getFont(),A=n.get("nameTruncate",!0)||{},P=A.ellipsis,I=Fr(e.raw.nameTruncateMaxWidth,A.maxWidth,T),N=s.nameMarginLevel||0,D=new tt({x:y.x,y:y.y,rotation:S.rotation,silent:wn.isLabelSilent(n),style:Ct(f,{text:u,font:M,overflow:"truncate",width:I,ellipsis:P,fill:f.getTextColor()||n.get(["axisLine","lineStyle","color"]),align:f.get("align")||S.textAlign,verticalAlign:f.get("verticalAlign")||S.textVerticalAlign}),z2:1});if(Qo({el:D,componentModel:n,itemName:u}),D.__fullText=u,D.anid="name",n.get("triggerEvent")){var O=wn.makeAxisEventDataBase(n);O.targetType="axisName",O.name=u,De(D).eventData=O}a.add(D),D.updateTransform(),t.nameEl=D;var R=l.nameLayout=Ja({label:D,priority:D.z2,defaultAttr:{ignore:D.ignore},marginDefault:Hh(c)?Iae[N]:Dae[N]});if(l.nameLocation=c,i.add(D),D.decomposeTransform(),e.shouldNameMoveOverlap&&R){var F=r.ensureRecord(n);r.resolveAxisNameOverlap(e,r,n,R,_,F)}}}};function fj(e,t,r,n,i,a,o,s){gW(t)||Gae(e,t,i,s,n,o);var l=t.labelLayoutList;Wae(e,n,l,a),Zae(n,e.rotation,l);var u=e.optionHideOverlap;zae(n,l,u),u&&MG(ot(l,function(c){return c&&!c.label.ignore})),Eae(e,r,n,l)}function Oae(e,t,r,n){var i=eA(r-e),a,o,s=n[0]>n[1],l=t==="start"&&!s||t!=="start"&&s;return Oh(i-Ls/2)?(o=l?"bottom":"top",a="center"):Oh(i-Ls*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",iLs/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:o}}function zae(e,t,r){if(uG(e.axis))return;function n(s,l,u){var c=Ja(t[l]),h=Ja(t[u]);if(!(!c||!h)){if(s===!1||c.suggestIgnore){Xd(c.label);return}if(h.suggestIgnore){Xd(h.label);return}var f=.1;if(!r){var d=[0,0,0,0];c=DT({marginForce:d},c),h=DT({marginForce:d},h)}Px(c,h,null,{touchThreshold:f})&&Xd(s?h.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 Bae(e,t,r){e.showMinorTicks||j(t,function(n){if(n&&n.label.ignore)for(var i=0;iu[0]&&isFinite(g)&&isFinite(u[0]);)d=qb(d),g=u[1]-d*o;else{var y=e.getTicks().length-1;y>o&&(d=qb(d));var _=d*o;m=Math.ceil(u[1]/d)*d,g=ir(m-_),g<0&&u[0]>=0?(g=0,m=ir(_)):m>0&&u[1]<=0&&(m=0,g=-ir(_))}var x=(i[0].value-a[0].value)/s,w=(i[o].value-a[o].value)/s;n.setExtent.call(e,g+d*x,m+d*w),n.setInterval.call(e,d),(x||w)&&n.setNiceExtent.call(e,g+d,m-d)}var pj=[[3,1],[0,2]],qae=function(){function e(t,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=VT,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=Qe(o),u=l.length;if(u){for(var c=[],h=u-1;h>=0;h--){var f=+l[h],d=o[f],g=d.model,m=d.scale;MT(m)&&g.get("alignTicks")&&g.get("interval")==null?c.push(d):(Gu(m,g),MT(m)&&(s=d))}c.length&&(s||(s=c.pop(),Gu(s.scale,s.model)),j(c,function(y){mW(y.scale,y.model,s.scale)}))}}i(n.x),i(n.y);var a={};j(n.x,function(o){gj(n,"y",o,a)}),j(n.y,function(o){gj(n,"x",o,a)}),this.resize(this.model,r)},e.prototype.resize=function(t,r,n){var i=Tr(t,r),a=this._rect=It(t.getBoxLayoutParams(),i.refContainer),o=this._axesMap,s=this._coordsList,l=t.get("containLabel");if(WT(o,a),!n){var u=Qae(a,s,o,l,r),c=void 0;if(l)HT?(HT(this._axesList,a),WT(o,a)):c=_j(a.clone(),"axisLabel",null,a,o,u,i);else{var h=eoe(t,a,i),f=h.outerBoundsRect,d=h.parsedOuterBoundsContain,g=h.outerBoundsClamp;f&&(c=_j(f,d,g,a,o,u,i))}yW(a,o,da.determine,null,c,i)}j(this._coordsList,function(m){m.calcAffineTransform()})},e.prototype.getAxis=function(t,r){var n=this._axesMap[t];if(n!=null)return n[r||0]},e.prototype.getAxes=function(){return this._axesList.slice()},e.prototype.getCartesian=function(t,r){if(t!=null&&r!=null){var n="x"+t+"y"+r;return this._coordsMap[n]}ke(t)&&(r=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,a=this._coordsList;i0})==null;return Bu(n,s,!0,!0,r),WT(i,n),l;function u(f){j(i[Oe[f]],function(d){if(dp(d.model)){var g=a.ensureRecord(d.model),m=g.labelInfoList;if(m)for(var y=0;y0&&!Xr(d)&&d>1e-4&&(f/=d),f}}function Qae(e,t,r,n,i){var a=new hW(toe);return j(r,function(o){return j(o,function(s){if(dp(s.model)){var l=!n;s.axisBuilder=Yae(e,t,s.model,i,a,l)}})}),a}function yW(e,t,r,n,i,a){var o=r===da.determine;j(t,function(u){return j(u,function(c){dp(c.model)&&(Xae(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[Oe[1-u]]=e[pr[u]]<=a.refContainer[pr[u]]*.5?0:1-u===1?2:1}j(t,function(u,c){return j(u,function(h){dp(h.model)&&((n==="all"||o)&&h.axisBuilder.build({axisName:!0},{nameMarginLevel:s[c]}),o&&h.axisBuilder.build({axisLine:!0}))})})}function eoe(e,t,r){var n,i=e.get("outerBoundsMode",!0);i==="same"?n=t.clone():(i==null||i==="auto")&&(n=It(e.get("outerBounds",!0)||iW,r.refContainer));var a=e.get("outerBoundsContain",!0),o;a==null||a==="auto"||Ve(["all","axisLabel"],a)<0?o="all":o=a;var s=[P0(be(e.get("outerBoundsClampWidth",!0),a_[0]),t.width),P0(be(e.get("outerBoundsClampHeight",!0),a_[1]),t.height)];return{outerBoundsRect:n,parsedOuterBoundsContain:o,outerBoundsClamp:s}}var toe=function(e,t,r,n,i,a){var o=r.axis.dim==="x"?"y":"x";fW(e,t,r,n,i,a),Hh(e.nameLocation)||j(t.recordMap[o],function(s){s&&s.labelInfoList&&s.dirVec&&vW(s.labelInfoList,s.dirVec,n,i)})};function roe(e,t){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return noe(r,e,t),r.seriesInvolved&&aoe(r,e),r}function noe(e,t,r){var n=t.getComponent("tooltip"),i=t.getComponent("axisPointer"),a=i.get("link",!0)||[],o=[];j(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=mp(s.model),u=e.coordSysAxesInfo[l]={};e.coordSysMap[l]=s;var c=s.model,h=c.getModel("tooltip",n);if(j(s.getAxes(),Fe(m,!1,null)),s.getTooltipAxes&&n&&h.get("show")){var f=h.get("trigger")==="axis",d=h.get(["axisPointer","type"])==="cross",g=s.getTooltipAxes(h.get(["axisPointer","axis"]));(f||d)&&j(g.baseAxes,Fe(m,d?"cross":!0,f)),d&&j(g.otherAxes,Fe(m,"cross",!1))}function m(y,_,x){var w=x.model.getModel("axisPointer",i),S=w.get("show");if(!(!S||S==="auto"&&!y&&!UT(w))){_==null&&(_=w.get("triggerTooltip")),w=y?ioe(x,h,i,t,y,_):w;var T=w.get("snap"),M=w.get("triggerEmphasis"),A=mp(x.model),P=_||T||x.type==="category",I=e.axesInfo[A]={key:A,axis:x,coordSys:s,axisPointerModel:w,triggerTooltip:_,triggerEmphasis:M,involveSeries:P,snap:T,useHandle:UT(w),seriesModels:[],linkGroup:null};u[A]=I,e.seriesInvolved=e.seriesInvolved||P;var N=ooe(a,x);if(N!=null){var D=o[N]||(o[N]={axesInfo:{}});D.axesInfo[A]=I,D.mapper=a[N].mapper,I.linkGroup=D}}}})}function ioe(e,t,r,n,i,a){var o=t.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};j(s,function(f){l[f]=Se(o.get(f))}),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 h=l.lineStyle=o.get("crossStyle");h&&Ae(u,h.textStyle)}}return e.model.getModel("axisPointer",new qe(l,r,n))}function aoe(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||j(e.coordSysAxesInfo[mp(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 ooe(e,t){for(var r=t.model,n=t.dim,i=0;i=0||e===t}function soe(e){var t=wk(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=UT(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 voe=Ye();function wj(e,t,r,n){if(e instanceof sW){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?CW(r,o,u,n):poe(e,t,r,n,o,l):r}function CW(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 poe(e,t,r,n,i,a){var o=voe(e);o.items||(o.items=[]);var s=o.items,l=Sj(s,t,r,n,i,a,1),u=Sj(s,t,r,n,i,a,-1),c=Math.abs(l-r)i/2||h&&f>h/2-n?CW(r,i,h,n):(s.push({fixedCoord:t,floatCoord:c,r:n}),c)}function Sj(e,t,r,n,i,a,o){for(var s=r,l=0;li/2)return Number.MAX_VALUE;if(o===1&&g>s||o===-1&&g0&&!g.min?g.min=0:g.min!=null&&g.min<0&&!g.max&&(g.max=0);var m=l;g.color!=null&&(m=Ae({color:g.color},l));var y=Ge(Se(g),{boundaryGap:r,splitNumber:n,scale:i,axisLine:a,axisTick:o,axisLabel:s,name:g.text,showName:u,nameLocation:"end",nameGap:h,nameTextStyle:m,triggerEvent:f},!1);if(he(c)){var _=y.name;y.name=c.replace("{value}",_??"")}else we(c)&&(y.name=c(y.name,y));var x=new qe(y,null,this.ecModel);return Qt(x,Sf.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:Ge({lineStyle:{color:K.color.neutral20}},wd.axisLine),axisLabel:Fm(wd.axisLabel,!1),axisTick:Fm(wd.axisTick,!1),splitLine:Fm(wd.splitLine,!0),splitArea:Fm(wd.splitArea,!0),indicator:[]},t}($e),Coe=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=ae(a,function(s){var l=s.model.get("showName")?s.name:"",u=new wn(s.model,n,{axisName:l,position:[i.cx,i.cy],rotation:s.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return u});j(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"),h=s.get("show"),f=l.get("color"),d=u.get("color"),g=re(f)?f:[f],m=re(d)?d:[d],y=[],_=[];function x(H,W,V){var z=V%W.length;return H[z]=H[z]||[],z}if(a==="circle")for(var w=i[0].getTicksCoords(),S=n.cx,T=n.cy,M=0;M3?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 h=Math.abs(a),f=(a>0?1:-1)*(h>3?.4:h>1?.15:.05);this._checkTriggerMoveZoom(this,"scrollMove","moveOnMouseWheel",r,{scrollDelta:f,originX:s,originY:l,isAvailableBehavior:null})}}}},t.prototype._pinchHandler=function(r){if(!(Mj(this._zr,"globalPan")||Sd(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)&&(Wo(a.event),a.__ecRoamConsumed=!0,Aj(r,n,i,a,o))},t}(Bi);function Sd(e){return e.__ecRoamConsumed}var Ioe=Ye();function Ex(e){var t=Ioe(e);return t.roam=t.roam||{},t.uniform=t.uniform||{},t}function Cd(e,t,r,n){for(var i=Ex(e),a=i.roam,o=a[t]=a[t]||[],s=0;s=4&&(c={x:parseFloat(f[0]||0),y:parseFloat(f[1]||0),width:parseFloat(f[2]),height:parseFloat(f[3])})}if(c&&s!=null&&l!=null&&(h=NW(c,{x:0,y:0,width:s,height:l}),!r.ignoreViewBox)){var d=i;i=new Ce,i.add(d),d.scaleX=d.scaleY=h.scale,d.x=h.x,d.y=h.y}return!r.ignoreRootClip&&s!=null&&l!=null&&i.setClipPath(new Ze({shape:{x:0,y:0,width:s,height:l}})),{root:i,width:s,height:l,viewBoxRect:c,viewBoxTransform:h,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=vw[s];if(c&&ge(vw,s)){l=c.call(this,t,r);var h=t.getAttribute("name");if(h){var f={name:h,namedFrom:null,svgNodeTagLower:s,el:l};n.push(f),s==="g"&&(u=f)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:l});r.add(l)}}var d=Pj[s];if(d&&ge(Pj,s)){var g=d.call(this,t),m=t.getAttribute("id");m&&(this._defs[m]=g)}}if(l&&l.isGroup)for(var y=t.firstChild;y;)y.nodeType===1?this._parseNode(y,l,n,u,a,o):y.nodeType===3&&o&&this._parseText(y,l),y=y.nextSibling},e.prototype._parseText=function(t,r){var n=new zh({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});vi(r,n),Un(t,n,this._defsUsePending,!1,!1),Roe(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(){vw={g:function(t,r){var n=new Ce;return vi(r,n),Un(t,n,this._defsUsePending,!1,!1),n},rect:function(t,r){var n=new Ze;return vi(r,n),Un(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 ro;return vi(r,n),Un(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 ar;return vi(r,n),Un(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 Gp;return vi(r,n),Un(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=Ej(n));var a=new en({shape:{points:i||[]},silent:!0});return vi(r,a),Un(t,a,this._defsUsePending,!1,!1),a},polyline:function(t,r){var n=t.getAttribute("points"),i;n&&(i=Ej(n));var a=new Gr({shape:{points:i||[]},silent:!0});return vi(r,a),Un(t,a,this._defsUsePending,!1,!1),a},image:function(t,r){var n=new Er;return vi(r,n),Un(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 Ce;return vi(r,s),Un(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 Ce;return vi(r,s),Un(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=ZF(n);return vi(r,i),Un(t,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),e}(),Pj={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 qu(t,r,n,i);return Ij(e,a),Dj(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 pA(t,r,n);return Ij(e,i),Dj(e,i),i}};function Ij(e,t){var r=e.getAttribute("gradientUnits");r==="userSpaceOnUse"&&(t.global=!0)}function Dj(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={};LW(r,a,a);var o=a.stopColor||r.getAttribute("stop-color")||"#000000",s=a.stopOpacity||r.getAttribute("stop-opacity");if(s){var l=fn(o),u=l&&l[3];u&&(l[3]*=Po(s),o=Li(l,"rgba"))}t.colorStops.push({offset:i,color:o})}r=r.nextSibling}}function vi(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),Ae(t.__inheritedStyle,e.__inheritedStyle))}function Ej(e){for(var t=Rx(e),r=[],n=0;n0;a-=2){var o=n[a],s=n[a-1],l=Rx(o);switch(i=i||Pr(),s){case"translate":ha(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":sx(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":Ko(i,i,-parseFloat(l[0])*pw,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*pw);aa(i,[1,0,u,1,0,0],i);break;case"skewY":var c=Math.tan(parseFloat(l[0])*pw);aa(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 Rj=/([^\s:;]+)\s*:\s*([^:;]+)/g;function LW(e,t,r){var n=e.getAttribute("style");if(n){Rj.lastIndex=0;for(var i;(i=Rj.exec(n))!=null;){var a=i[1],o=ge(s_,a)?s_[a]:null;o&&(t[o]=i[2]);var s=ge(l_,a)?l_[a]:null;s&&(r[s]=i[2])}}}function Goe(e,t,r){for(var n=0;n0,x={api:n,geo:l,mapOrGeoModel:t,data:s,isVisualEncodedByVisualMap:_,isGeo:o,transformInfoRaw:f};l.resourceType==="geoJSON"?this._buildGeoJSON(x):l.resourceType==="geoSVG"&&this._buildSVG(x),this._updateController(t,y,r,n),this._updateMapSelectHandler(t,u,n,i)},e.prototype._buildGeoJSON=function(t){var r=this._regionsGroupByName=xe(),n=xe(),i=this._regionsGroup,a=t.transformInfoRaw,o=t.mapOrGeoModel,s=t.data,l=t.geo.projection,u=l&&l.stream;function c(d,g){return g&&(d=g(d)),d&&[d[0]*a.scaleX+a.x,d[1]*a.scaleY+a.y]}function h(d){for(var g=[],m=!u&&l&&l.project,y=0;y=0)&&(f=i);var d=o?{normal:{align:"center",verticalAlign:"middle"}}:null;Dr(t,Cr(n),{labelFetcher:f,labelDataIndex:h,defaultText:r},d);var g=t.getTextContent();if(g&&(PW(g).ignore=g.ignore,t.textConfig&&o)){var m=t.getBoundingRect().clone();t.textConfig.layoutRect=m,t.textConfig.position=[(o[0]-m.x)/m.width*100+"%",(o[1]-m.y)/m.height*100+"%"]}t.disableLabelAnimation=!0}else t.removeTextContent(),t.removeTextConfig(),t.disableLabelAnimation=null}function Vj(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 Gj(e,t,r,n,i){e.data||Qo({el:t,componentModel:i,itemName:r,itemTooltipOption:n.get("tooltip")})}function Wj(e,t,r,n,i){t.highDownSilentOnTouch=!!i.get("selectedMode");var a=n.getModel("emphasis"),o=a.get("focus");return Dt(t,o,a.get("blurScope"),a.get("disabled")),e.isGeo&&KK(t,i,r),o}function Hj(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(),j(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}(bt);function lse(e,t){var r={};return j(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?(w.width=x,w.height=x/m):(w.height=x,w.width=x*m),w.y=_[1]-w.height/2,w.x=_[0]-w.width/2;else{var S=e.getBoxLayoutParams();S.aspect=m,w=It(S,g),w=MV(e,w,m)}this.setViewRect(w.x,w.y,w.width,w.height),this.setCenter(e.get("center")),this.setZoom(e.get("zoom"))}function fse(e,t){j(t.get("geoCoord"),function(r,n){e.addGeoCoord(n,r)})}var dse=function(){function e(){this.dimensions=DW}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 YT(l+s,l,Q({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=Yj,u.resize(o,r)}),t.eachSeries(function(o){$p({targetModel:o,coordSysType:"geo",coordSysProvider:function(){var s=o.subType==="map"?o.getHostGeoModel():o.getReferringComponents("geo",Ht).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)}}),j(a,function(o,s){var l=ae(o,function(c){return c.get("nameMap")}),u=new YT(s,s,Q({nameMap:ix(l),api:r,ecModel:t},i(o[0])));u.zoomLimit=Fr.apply(null,ae(o,function(c){return c.get("scaleLimit")})),n.push(u),u.resize=Yj,u.resize(o[0],r),j(o,function(c){c.coordinateSystem=u,fse(u,c)})}),n},e.prototype.getFilledRegions=function(t,r,n,i){for(var a=(t||[]).slice(),o=xe(),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 _se(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){bse(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=wse(e,i,e.parentNode.hierNode.defaultAncestor||n[0],t)}function xse(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier}function Xj(e){return arguments.length?e:Tse}function qd(e,t){return e-=Math.PI/2,{x:t*Math.cos(e),y:t*Math.sin(e)}}function bse(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 wse(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,h=s.hierNode.modifier;s=gw(s),a=mw(a),s&&a;){i=gw(i),o=mw(o),i.hierNode.ancestor=e;var f=s.hierNode.prelim+h-a.hierNode.prelim-u+n(s,a);f>0&&(Cse(Sse(s,e,r),e,f),u+=f,l+=f),h+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=i.hierNode.modifier,c+=o.hierNode.modifier}s&&!gw(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=h-l),a&&!mw(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-c,r=e)}return r}function gw(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function mw(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function Sse(e,t,r){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:r}function Cse(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 Tse(e,t){return e.parentNode===t.parentNode?1:2}var Mse=function(){function e(){this.parentPoint=[],this.childPoints=[]}return e}(),Ase=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 Mse},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,h=1-c,f=ce(n.forkPosition,1),d=[];d[c]=o[c],d[h]=o[h]+(l[h]-o[h])*f,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 g=1;gx.x,T||(S=S-Math.PI));var A=T?"left":"right",P=s.getModel("label"),I=P.get("rotate"),N=I*(Math.PI/180),D=y.getTextContent();D&&(y.setTextConfig({position:P.get("position")||A,rotation:I==null?-S:N,origin:"center"}),D.setStyle("verticalAlign","middle"))}var O=s.get(["emphasis","focus"]),R=O==="relative"?Eh(o.getAncestorsIndices(),o.getDescendantIndices()):O==="ancestor"?o.getAncestorsIndices():O==="descendant"?o.getDescendantIndices():null;R&&(De(r).focus=R),Lse(i,o,c,r,g,d,m,n),r.__edge&&(r.onHoverStateChange=function(F){if(F!=="blur"){var H=o.parentNode&&e.getItemGraphicEl(o.parentNode.dataIndex);H&&H.hoverState===Vp||j0(r.__edge,F)}})}function Lse(e,t,r,n,i,a,o,s){var l=t.getModel(),u=e.get("edgeShape"),c=e.get("layout"),h=e.getOrient(),f=e.get(["lineStyle","curveness"]),d=e.get("edgeForkPosition"),g=l.getModel("lineStyle").getLineStyle(),m=n.__edge;if(u==="curve")t.parentNode&&t.parentNode!==r&&(m||(m=n.__edge=new hf({shape:XT(c,h,f,i,i)})),it(m,{shape:XT(c,h,f,a,o)},e));else if(u==="polyline"&&c==="orthogonal"&&t!==r&&t.children&&t.children.length!==0&&t.isExpand===!0){for(var y=t.children,_=[],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(he(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 BW(e){for(var t=[];e;)e=e.parentNode,e&&t.push(e);return t.reverse()}function Nk(e,t){var r=BW(e);return Ve(r,t)>=0}function Ox(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 zse=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 qe(i,this,this.ecModel),o=Lk.createTree(n,this,s);function s(h){h.wrapMethod("getItemModel",function(f,d){var g=o.getNodeByDataIndex(d);return g&&g.children.length&&g.isExpand||(f.parentModel=a),f})}var l=0;o.eachNode("preorder",function(h){h.depth>l&&(l=h.depth)});var u=r.expandAndCollapse,c=u&&r.initialTreeDepth>=0?r.initialTreeDepth:l;return o.root.eachNode("preorder",function(h){var f=h.hostTree.data.getRawDataItem(h.dataIndex);h.isExpand=f&&f.collapsed!=null?!f.collapsed:h.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 gr("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=Ox(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}(bt);function Bse(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 Fse(e,t){e.eachSeriesByType("tree",function(r){Vse(r,t)})}function Vse(e,t){var r=Tr(e,t).refContainer,n=It(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=Xj(function(S,T){return(S.parentNode===T.parentNode?1:2)/S.depth})):(a=n.width,o=n.height,s=Xj());var l=e.getData().tree.root,u=l.children[0];if(u){yse(l),Bse(u,_se,s),l.hierNode.modifier=-u.hierNode.prelim,Ad(u,xse);var c=u,h=u,f=u;Ad(u,function(S){var T=S.getLayout().x;Th.getLayout().x&&(h=S),S.depth>f.depth&&(f=S)});var d=c===h?1:s(c,h)/2,g=d-c.getLayout().x,m=0,y=0,_=0,x=0;if(i==="radial")m=a/(h.getLayout().x+d+g),y=o/(f.depth-1||1),Ad(u,function(S){_=(S.getLayout().x+g)*m,x=(S.depth-1)*y;var T=qd(_,x);S.setLayout({x:T.x,y:T.y,rawX:_,rawY:x},!0)});else{var w=e.getOrient();w==="RL"||w==="LR"?(y=o/(h.getLayout().x+d+g),m=a/(f.depth-1||1),Ad(u,function(S){x=(S.getLayout().x+g)*y,_=w==="LR"?(S.depth-1)*m:a-(S.depth-1)*m,S.setLayout({x:_,y:x},!0)})):(w==="TB"||w==="BT")&&(m=a/(h.getLayout().x+d+g),y=o/(f.depth-1||1),Ad(u,function(S){_=(S.getLayout().x+g)*m,x=w==="TB"?(S.depth-1)*y:o-(S.depth-1)*y,S.setLayout({x:_,y:x},!0)}))}}}function Gse(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");Q(s,o)})})}function Wse(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=jx(a,t,i.get("scaleLimit"));i.setCenter(o.center),i.setZoom(o.zoom)})})}function Hse(e){e.registerChartView(kse),e.registerSeriesModel(zse),e.registerLayout(Fse),e.registerVisual(Gse),Wse(e)}var eR=["treemapZoomToNode","treemapRender","treemapMove"];function Use(e){for(var t=0;t1;)a=a.parentNode;var o=fT(e.ecModel,a.name||a.dataIndex+"",n);i.setVisual("decal",o)})}var Zse=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};VW(i);var a=r.levels||[],o=this.designatedVisualItemStyle={},s=new qe({itemStyle:o},this,n);a=r.levels=$se(a,n);var l=ae(a||[],function(h){return new qe(h,s,n)},this),u=Lk.createTree(i,this,c);function c(h){h.wrapMethod("getItemModel",function(f,d){var g=u.getNodeByDataIndex(d),m=g?l[g.depth]:null;return f.parentModel=m||s,f})}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 gr("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=Ox(i,this),n.treePathInfo=n.treeAncestors,n},t.prototype.setLayoutInfo=function(r){this.layoutInfo=this.layoutInfo||{},Q(this.layoutInfo,r)},t.prototype.mapIdToIndex=function(r){var n=this._idIndexMap;n||(n=this._idIndexMap=xe(),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(){FW(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}(bt);function VW(e){var t=0;j(e.children,function(n){VW(n);var i=n.value;re(i)&&(i=i[0]),t+=i});var r=e.value;re(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=t),r<0&&(r=0),re(e.value)?e.value[0]=r:e.value=r}function $se(e,t){var r=Tt(t.get("color")),n=Tt(t.get(["aria","decal","decals"]));if(r){e=e||[];var i,a;j(e,function(s){var l=new qe(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 Yse=8,tR=8,yw=5,Xse=function(){function e(t){this.group=new Ce,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"]),h=Tr(t,r).refContainer,f={left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},d={emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]},g=It(f,h);this._prepare(n,d,u),this._renderContent(t,d,g,s,l,u,c,i),Cx(o,f,h)}},e.prototype._prepare=function(t,r,n){for(var i=t;i;i=i.parentNode){var a=br(i.getModel().get("name"),""),o=n.getTextRect(a),s=Math.max(o.width+Yse*2,r.emptyItemWidth);r.totalWidth+=s+tR,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,h=t.get(["breadcrumb","height"]),f=r.totalWidth,d=r.renderList,g=a.getModel("itemStyle").getItemStyle(),m=d.length-1;m>=0;m--){var y=d[m],_=y.node,x=y.width,w=y.text;f>n.width&&(f-=x-c,x=c,w=null);var S=new en({shape:{points:qse(u,0,x,h,m===d.length-1,m===0)},style:Ae(i.getItemStyle(),{lineJoin:"bevel"}),textContent:new tt({style:Ct(o,{text:w})}),textConfig:{position:"inside"},z2:uf*1e4,onclick:Fe(l,_)});S.disableLabelAnimation=!0,S.getTextContent().ensureState("emphasis").style=Ct(s,{text:w}),S.ensureState("emphasis").style=g,Dt(S,a.get("focus"),a.get("blurScope"),a.get("disabled")),this.group.add(S),Kse(S,t,_),u+=x+tR}},e.prototype.remove=function(){this.group.removeAll()},e}();function qse(e,t,r,n,i,a){var o=[[i?e:e-yw,t],[e+r,t],[e+r,t+n],[i?e:e-yw,t+n]];return!a&&o.splice(2,0,[e+r+yw,t+n/2]),!i&&o.push([e,t+n/2]),o}function Kse(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&&Ox(r,t)}}var Jse=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;inR||Math.abs(r.dy)>nR)){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 Pe(s.x,s.y,s.width,s.height),u=null,c=this._controllerHost;u=c.zoomLimit;var h=c.zoom=c.zoom||1;if(h*=a,u){var f=u.min||0,d=u.max||1/0;h=Math.max(Math.min(d,h),f)}var g=h/c.zoom;c.zoom=h;var m=this.seriesModel.layoutInfo;n-=m.x,i-=m.y;var y=Pr();ha(y,y,[-n,-i]),sx(y,y,[g,g]),ha(y,y,[n,i]),l.applyTransform(y),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&&B0(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 Xse(this.group))).render(r,n,i.node,function(o){a._state!=="animating"&&(Nk(r.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=kd(),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}(gt);function kd(){return{nodeGroup:[],background:[],content:[]}}function ile(e,t,r,n,i,a,o,s,l,u){if(!o)return;var c=o.getLayout(),h=e.getData(),f=o.getModel();if(h.setItemGraphicEl(o.dataIndex,null),!c||!c.isInView)return;var d=c.width,g=c.height,m=c.borderWidth,y=c.invisible,_=o.getRawIndex(),x=s&&s.getRawIndex(),w=o.viewChildren,S=c.upperHeight,T=w&&w.length,M=f.getModel("itemStyle"),A=f.getModel(["emphasis","itemStyle"]),P=f.getModel(["blur","itemStyle"]),I=f.getModel(["select","itemStyle"]),N=M.get("borderRadius")||0,D=se("nodeGroup",qT);if(!D)return;if(l.add(D),D.x=c.x||0,D.y=c.y||0,D.markRedraw(),u_(D).nodeWidth=d,u_(D).nodeHeight=g,c.isAboveViewRoot)return D;var O=se("background",rR,u,tle);O&&U(D,O,T&&c.upperLabelHeight);var R=f.getModel("emphasis"),F=R.get("focus"),H=R.get("blurScope"),W=R.get("disabled"),V=F==="ancestor"?o.getAncestorsIndices():F==="descendant"?o.getDescendantIndices():F;if(T)np(D)&&fu(D,!1),O&&(fu(O,!W),h.setItemGraphicEl(o.dataIndex,O),tT(O,V,H));else{var z=se("content",rR,u,rle);z&&$(D,z),O.disableMorphing=!0,O&&np(O)&&fu(O,!1),fu(D,!W),h.setItemGraphicEl(o.dataIndex,D);var Z=f.getShallow("cursor");Z&&z.attr("cursor",Z),tT(D,V,H)}return D;function U(me,ye,Me){var pe=De(ye);if(pe.dataIndex=o.dataIndex,pe.seriesIndex=e.seriesIndex,ye.setShape({x:0,y:0,width:d,height:g,r:N}),y)Y(ye);else{ye.invisible=!1;var Te=o.getVisual("style"),st=Te.stroke,ze=oR(M);ze.fill=st;var et=Jl(A);et.fill=A.get("borderColor");var lt=Jl(P);lt.fill=P.get("borderColor");var Et=Jl(I);if(Et.fill=I.get("borderColor"),Me){var lr=d-2*m;te(ye,st,Te.opacity,{x:m,y:0,width:lr,height:S})}else ye.removeTextContent();ye.setStyle(ze),ye.ensureState("emphasis").style=et,ye.ensureState("blur").style=lt,ye.ensureState("select").style=Et,zu(ye)}me.add(ye)}function $(me,ye){var Me=De(ye);Me.dataIndex=o.dataIndex,Me.seriesIndex=e.seriesIndex;var pe=Math.max(d-2*m,0),Te=Math.max(g-2*m,0);if(ye.culling=!0,ye.setShape({x:m,y:m,width:pe,height:Te,r:N}),y)Y(ye);else{ye.invisible=!1;var st=o.getVisual("style"),ze=st.fill,et=oR(M);et.fill=ze,et.decal=st.decal;var lt=Jl(A),Et=Jl(P),lr=Jl(I);te(ye,ze,st.opacity,null),ye.setStyle(et),ye.ensureState("emphasis").style=lt,ye.ensureState("blur").style=Et,ye.ensureState("select").style=lr,zu(ye)}me.add(ye)}function Y(me){!me.invisible&&a.push(me)}function te(me,ye,Me,pe){var Te=f.getModel(pe?aR:iR),st=br(f.get("name"),null),ze=Te.getShallow("show");Dr(me,Cr(f,pe?aR:iR),{defaultText:ze?st:null,inheritColor:ye,defaultOpacity:Me,labelFetcher:e,labelDataIndex:o.dataIndex});var et=me.getTextContent();if(et){var lt=et.style,Et=Rp(lt.padding||0);pe&&(me.setTextConfig({layoutRect:pe}),et.disableLabelLayout=!0),et.beforeUpdate=function(){var Mr=Math.max((pe?pe.width:me.shape.width)-Et[1]-Et[3],0),Gn=Math.max((pe?pe.height:me.shape.height)-Et[0]-Et[2],0);(lt.width!==Mr||lt.height!==Gn)&&et.setStyle({width:Mr,height:Gn})},lt.truncateMinChar=2,lt.lineOverflow="truncate",ie(lt,pe,c);var lr=et.getState("emphasis");ie(lr?lr.style:null,pe,c)}}function ie(me,ye,Me){var pe=me?me.text:null;if(!ye&&Me.isLeafRoot&&pe!=null){var Te=e.get("drillDownIcon",!0);me.text=Te?Te+" "+pe:pe}}function se(me,ye,Me,pe){var Te=x!=null&&r[me][x],st=i[me];return Te?(r[me][x]=null,le(st,Te)):y||(Te=new ye,Te instanceof Ri&&(Te.z2=ale(Me,pe)),Ee(st,Te)),t[me][_]=Te}function le(me,ye){var Me=me[_]={};ye instanceof qT?(Me.oldX=ye.x,Me.oldY=ye.y):Me.oldShape=Q({},ye.shape)}function Ee(me,ye){var Me=me[_]={},pe=o.parentNode,Te=ye instanceof Ce;if(pe&&(!n||n.direction==="drillDown")){var st=0,ze=0,et=i.background[pe.getRawIndex()];!n&&et&&et.oldShape&&(st=et.oldShape.width,ze=et.oldShape.height),Te?(Me.oldX=0,Me.oldY=ze):Me.oldShape={x:st,y:ze,width:0,height:0}}Me.fadein=!Te}}function ale(e,t){return e*ele+t}var _p=j,ole=ke,c_=-1,Ir=function(){function e(t){var r=t.mappingMethod,n=t.type,i=this.option=Se(t);this.type=n,this.mappingMethod=r,this._normalizeData=ule[r];var a=e.visualHandlers[n];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[r],r==="piecewise"?(_w(i),sle(i)):r==="category"?i.categories?lle(i):_w(i,!0):(Jr(r!=="linear"||i.dataExtent),_w(i))}return e.prototype.mapValueToVisual=function(t){var r=this._normalizeData(t);return this._normalizedToVisual(r,t)},e.prototype.getNormalizer=function(){return fe(this._normalizeData,this)},e.listVisualTypes=function(){return Qe(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(t,r,n){ke(t)?j(t,r,n):r.call(n,t)},e.mapVisual=function(t,r,n){var i,a=re(t)?[]:ke(t)?{}:(i=!0,null);return e.eachVisual(t,function(o,s){var l=r.call(n,o,s);i?a=l:a[s]=l}),a},e.retrieveVisuals=function(t){var r={},n;return t&&_p(e.visualHandlers,function(i,a){t.hasOwnProperty(a)&&(r[a]=t[a],n=!0)}),n?r:null},e.prepareVisualTypes=function(t){if(re(t))t=t.slice();else if(ole(t)){var r=[];_p(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 _w(e,t){var r=e.visual,n=[];ke(r)?_p(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]),GW(e,n)}function Gm(e){return{applyVisual:function(t,r,n){var i=this.mapValueToVisual(t);n("color",e(r("color"),i))},_normalizedToVisual:KT([0,1])}}function sR(e){var t=this.option.visual;return t[Math.round(ht(e,[0,1],[0,t.length-1],!0))]||{}}function Ld(e){return function(t,r,n){n(e,this.mapValueToVisual(t))}}function Kd(e){var t=this.option.visual;return t[this.option.loop&&e!==c_?e%t.length:e]}function Ql(){return this.option.visual[0]}function KT(e){return{linear:function(t){return ht(t,e,this.option.visual,!0)},category:Kd,piecewise:function(t,r){var n=JT.call(this,r);return n==null&&(n=ht(t,e,this.option.visual,!0)),n},fixed:Ql}}function JT(e){var t=this.option,r=t.pieceList;if(t.hasSpecialVisual){var n=Ir.findPieceIndex(e,r),i=r[n];if(i&&i.visual)return i.visual[this.type]}}function GW(e,t){return e.visual=t,e.type==="color"&&(e.parsedVisual=ae(t,function(r){var n=fn(r);return n||[0,0,0,1]})),t}var ule={linear:function(e){return ht(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,r=Ir.findPieceIndex(e,t,!0);if(r!=null)return ht(r,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return t??c_},fixed:qt};function Wm(e,t,r){return e?t<=r:t=r.length||m===r[m.depth]){var _=ple(i,l,m,y,g,n);HW(m,_,r,n)}})}}}function fle(e,t,r){var n=Q({},t),i=r.designatedVisualItemStyle;return j(["color","colorAlpha","colorSaturation"],function(a){i[a]=t[a];var o=e.get(a);i[a]=null,o!=null&&(n[a]=o)}),n}function lR(e){var t=xw(e,"color");if(t){var r=xw(e,"colorAlpha"),n=xw(e,"colorSaturation");return n&&(t=Io(t,null,null,n)),r&&(t=Jv(t,r)),t}}function dle(e,t){return t!=null?Io(t,null,null,e):null}function xw(e,t){var r=e[t];if(r!=null&&r!=="none")return r}function vle(e,t,r,n,i,a){if(!(!a||!a.length)){var o=bw(t,"color")||i.color!=null&&i.color!=="none"&&(bw(t,"colorAlpha")||bw(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"),h={type:o.name,dataExtent:u,visual:o.range};h.type==="color"&&(c==="index"||c==="id")?(h.mappingMethod="category",h.loop=!0):h.mappingMethod="linear";var f=new Ir(h);return WW(f).drColorMappingBy=c,f}}}function bw(e,t){var r=e.get(t);return re(r)&&r.length?{name:t,range:r}:null}function ple(e,t,r,n,i,a){var o=Q({},t);if(i){var s=i.type,l=s==="color"&&WW(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 xp=Math.max,h_=Math.min,uR=Fr,Pk=j,UW=["itemStyle","borderWidth"],gle=["itemStyle","gapWidth"],mle=["upperLabel","show"],yle=["upperLabel","height"];const _le={seriesType:"treemap",reset:function(e,t,r,n){var i=e.option,a=Tr(e,r).refContainer,o=It(e.getBoxLayoutParams(),a),s=i.size||[],l=ce(uR(o.width,s[0]),a.width),u=ce(uR(o.height,s[1]),a.height),c=n&&n.type,h=["treemapZoomToNode","treemapRootToNode"],f=yp(n,h,e),d=c==="treemapRender"||c==="treemapMove"?n.rootRect:null,g=e.getViewRoot(),m=BW(g);if(c!=="treemapMove"){var y=c==="treemapZoomToNode"?Tle(e,f,g,l,u):d?[d.width,d.height]:[l,u],_=i.sort;_&&_!=="asc"&&_!=="desc"&&(_="desc");var x={squareRatio:i.squareRatio,sort:_,leafDepth:i.leafDepth};g.hostTree.clearLayouts();var w={x:0,y:0,width:y[0],height:y[1],area:y[0]*y[1]};g.setLayout(w),ZW(g,x,!1,0),w=g.getLayout(),Pk(m,function(T,M){var A=(m[M+1]||g).getValue();T.setLayout(Q({dataExtent:[A,A],borderWidth:0,upperHeight:0},w))})}var S=e.getData().tree.root;S.setLayout(Mle(o,d,f),!0),e.setLayoutInfo(o),$W(S,new Pe(-o.x,-o.y,r.getWidth(),r.getHeight()),m,g,0)}};function ZW(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(UW),u=s.get(gle)/2,c=YW(s),h=Math.max(l,c),f=l-u,d=h-u;e.setLayout({borderWidth:l,upperHeight:h,upperLabelHeight:c},!0),i=xp(i-2*f,0),a=xp(a-f-d,0);var g=i*a,m=xle(e,s,g,t,r,n);if(m.length){var y={x:f,y:d,width:i,height:a},_=h_(i,a),x=1/0,w=[];w.area=0;for(var S=0,T=m.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 Cle(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?xp(u*n/l,l/(u*i)):1/0}function cR(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 h=0,f=e.length;hHC&&(u=HC),a=s}un&&(n=t);var a=n%2?n+2:n+3;i=[];for(var o=0;o0&&(T[0]=-T[0],T[1]=-T[1]);var A=S[0]<0?-1:1;if(a.__position!=="start"&&a.__position!=="end"){var P=-Math.atan2(S[1],S[0]);h[0].8?"left":f[0]<-.8?"right":"center",m=f[1]>.8?"top":f[1]<-.8?"bottom":"middle";break;case"start":a.x=-f[0]*_+c[0],a.y=-f[1]*x+c[1],g=f[0]>.8?"right":f[0]<-.8?"left":"center",m=f[1]>.8?"bottom":f[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":a.x=_*A+c[0],a.y=c[1]+I,g=S[0]<0?"right":"left",a.originX=-_*A,a.originY=-I;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=M[0],a.y=M[1]+I,g="center",a.originY=-I;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-_*A+h[0],a.y=h[1]+I,g=S[0]>=0?"right":"left",a.originX=_*A,a.originY=-I;break}a.scaleX=a.scaleY=o,a.setStyle({verticalAlign:a.__verticalAlign||m,align:a.__align||g})}},t}(Ce),Rk=function(){function e(t){this.group=new Ce,this._LineCtor=t||jk}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=gR(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=gR(t),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(t,r){this._progressiveEls=[];function n(s){!s.isGroup&&!Wle(s)&&(s.incremental=!0,s.ensureState("emphasis").hoverLayer=!0)}for(var i=t.start;i0}function gR(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:Cr(t)}}function mR(e){return isNaN(e[0])||isNaN(e[1])}function Mw(e){return e&&!mR(e[0])&&!mR(e[1])}var Aw=[],kw=[],Lw=[],Dc=Br,Nw=Vs,yR=Math.abs;function _R(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){Aw[0]=Dc(n[0],i[0],a[0],c),Aw[1]=Dc(n[1],i[1],a[1],c);var h=yR(Nw(Aw,t)-l);h=0?s=s+u:s=s-u:g>=0?s=s-u:s=s+u}return s}function Pw(e,t){var r=[],n=qv,i=[[],[],[]],a=[[],[]],o=[];t/=2,e.eachEdge(function(s,l){var u=s.getLayout(),c=s.getVisual("fromSymbol"),h=s.getVisual("toSymbol");u.__original||(u.__original=[Ga(u[0]),Ga(u[1])],u[2]&&u.__original.push(Ga(u[2])));var f=u.__original;if(u[2]!=null){if(ln(i[0],f[0]),ln(i[1],f[2]),ln(i[2],f[1]),c&&c!=="none"){var d=Qd(s.node1),g=_R(i,f[0],d*t);n(i[0][0],i[1][0],i[2][0],g,r),i[0][0]=r[3],i[1][0]=r[4],n(i[0][1],i[1][1],i[2][1],g,r),i[0][1]=r[3],i[1][1]=r[4]}if(h&&h!=="none"){var d=Qd(s.node2),g=_R(i,f[1],d*t);n(i[0][0],i[1][0],i[2][0],g,r),i[1][0]=r[1],i[2][0]=r[2],n(i[0][1],i[1][1],i[2][1],g,r),i[1][1]=r[1],i[2][1]=r[2]}ln(u[0],i[0]),ln(u[1],i[2]),ln(u[2],i[1])}else{if(ln(a[0],f[0]),ln(a[1],f[1]),Ts(o,a[1],a[0]),Xu(o,o),c&&c!=="none"){var d=Qd(s.node1);_0(a[0],a[0],o,d*t)}if(h&&h!=="none"){var d=Qd(s.node2);_0(a[1],a[1],o,-d*t)}ln(u[0],a[0]),ln(u[1],a[1])}})}var t8=Ye();function Hle(e){if(e)return t8(e).bridge}function xR(e,t){e&&(t8(e).bridge=t)}function bR(e){return e.type==="view"}var Ule=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 Kp,a=new Rk,o=this.group,s=new Ce;this._controller=new rc(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(bR(o)){var h={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?this._mainGroup.attr(h):it(this._mainGroup,h,r)}Pw(r.getGraph(),Jd(r));var f=r.getData();u.updateData(f);var d=r.getEdgeData();c.updateData(d),this._updateNodeAndLinkScale(),this._updateController(null,r,i),clearTimeout(this._layoutTimeout);var g=r.forceLayout,m=r.get(["force","layoutAnimation"]);g&&(s=!0,this._startForceLayoutIteration(g,i,m));var y=r.get("layout");f.graph.eachNode(function(S){var T=S.dataIndex,M=S.getGraphicEl(),A=S.getModel();if(M){M.off("drag").off("dragend");var P=A.get("draggable");P&&M.on("drag",function(N){switch(y){case"force":g.warmUp(),!a._layouting&&a._startForceLayoutIteration(g,i,m),g.setFixed(T),f.setItemLayout(T,[M.x,M.y]);break;case"circular":f.setItemLayout(T,[M.x,M.y]),S.setLayout({fixed:!0},!0),Ek(r,"symbolSize",S,[N.offsetX,N.offsetY]),a.updateLayout(r);break;case"none":default:f.setItemLayout(T,[M.x,M.y]),Dk(r.getGraph(),r),a.updateLayout(r);break}}).on("dragend",function(){g&&g.setUnfixed(T)}),M.setDraggable(P,!!A.get("cursor"));var I=A.get(["emphasis","focus"]);I==="adjacency"&&(De(M).focus=S.getAdjacentDataIndices())}}),f.graph.eachEdge(function(S){var T=S.getGraphicEl(),M=S.getModel().get(["emphasis","focus"]);T&&M==="adjacency"&&(De(T).focus={edge:[S.dataIndex],node:[S.node1.dataIndex,S.node2.dataIndex]})});var _=r.get("layout")==="circular"&&r.get(["circular","rotateLabel"]),x=f.getLayout("cx"),w=f.getLayout("cy");f.graph.eachNode(function(S){JW(S,_,x,w)}),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(!bR(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&&(Ck(this._controllerHost,i.dx,i.dy),this._updateThumbnailWindow())},t.prototype.updateViewOnZoom=function(r,n,i){this._active&&(Tk(this._controllerHost,i.zoom,i.originX,i.originY),this._updateNodeAndLinkScale(),Pw(r.getGraph(),Jd(r)),this._lineDraw.updateLayout(),n.updateLabelLayout(),this._updateThumbnailWindow())},t.prototype._updateNodeAndLinkScale=function(){var r=this._model,n=r.getData(),i=Jd(r);n.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(i)})},t.prototype.updateLayout=function(r){this._active&&(Pw(r.getGraph(),Jd(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=Hle(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 Ce,l=i.group.children(),u=a.group.children(),c=new Ce,h=new Ce;s.add(h),s.add(c);for(var f=0;f=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 eu||(r=this._nodesMap[Ec(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(g)&&(t.set(g,!0),o.push(d.node1))}for(l=0;l=0&&!t.hasKey(w)&&(t.set(w,!0),s.push(x.node2))}}}return{edge:t.keys(),node:r.keys()}},e}(),r8=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=xe(),r=xe();t.set(this.dataIndex,!0);for(var n=[this.node1],i=[this.node2],a=0;a=0&&!t.hasKey(h)&&(t.set(h,!0),n.push(c.node1))}for(a=0;a=0&&!t.hasKey(m)&&(t.set(m,!0),i.push(g.node2))}return{edge:t.keys(),node:r.keys()}},e}();function n8(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)}}}Qt(eu,n8("hostGraph","data"));Qt(r8,n8("hostGraph","edgeData"));function Ok(e,t,r,n,i){for(var a=new Zle(n),o=0;o "+f)),u++)}var d=r.get("coordinateSystem"),g;if(d==="cartesian2d"||d==="polar"||d==="matrix")g=no(e,r);else{var m=mf.get(d),y=m?m.dimensions||[]:[];Ve(y,"value")<0&&y.concat(["value"]);var _=bf(e,{coordDimensions:y,encodeDefine:r.getEncode()}).dimensions;g=new dn(_,r),g.initData(e)}var x=new dn(["value"],r);return x.initData(l,s),i&&i(g,x),OW({mainData:g,struct:a,structAttr:"graph",datas:{node:g,edge:x},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var $le=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 Mf(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),ju(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){Dle(this);var s=Ok(a,i,this,!0,l);return j(s.edges,function(u){Ele(u.node1,u.node2,this,u.dataIndex)},this),s.data}function l(u,c){u.wrapMethod("getItemModel",function(g){var m=o._categoriesModels,y=g.getShallow("category"),_=m[y];return _&&(_.parentModel=g.parentModel,g.parentModel=_),g});var h=qe.prototype.getModel;function f(g,m){var y=h.call(this,g,m);return y.resolveParentPath=d,y}c.wrapMethod("getItemModel",function(g){return g.resolveParentPath=d,g.getModel=f,g});function d(g){if(g&&(g[0]==="label"||g[1]==="label")){var m=g.slice();return g[0]==="label"?m[0]="edgeLabel":g[1]==="label"&&(m[1]="edgeLabel"),m}return g}}},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),gr("nameValue",{name:c.join(" > "),value:o.value,noValue:o.value==null})}var h=o6({series:this,dataIndex:r,multipleSeries:n});return h},t.prototype._updateCategoriesData=function(){var r=ae(this.option.categories||[],function(i){return i.value!=null?i:Q({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}(bt);function Yle(e){e.registerChartView(Ule),e.registerSeriesModel($le),e.registerProcessor(kle),e.registerVisual(Lle),e.registerVisual(Nle),e.registerLayout(jle),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,Ole),e.registerLayout(Ble),e.registerCoordinateSystem("graphView",{dimensions:nc.dimensions,create:Vle}),e.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},qt),e.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},qt),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=jx(o,t,i.get("scaleLimit"));i.setCenter&&i.setCenter(s.center),i.setZoom&&i.setZoom(s.zoom)})})}var wR=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 tt;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"),h=r.getItemLayout(n),f=Q(Ba(u.getModel("itemStyle"),h,!0),h),d=this;if(isNaN(f.startAngle)){d.setShape(f);return}a?d.setShape(f):it(d,{shape:f},l,n);var g=Q(Ba(u.getModel("itemStyle"),h,!0),h);o.setShape(g),o.useStyle(r.getItemVisual(n,"style")),Sr(o,u),this._updateLabel(l,u,s),r.setItemGraphicEl(n,d),Sr(d,u,"itemStyle");var m=c.get("focus");Dt(this,m==="adjacency"?s.getAdjacentDataIndices():m,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 h=Cr(n),f=i.getVisual("style");Dr(a,h,{labelFetcher:{getFormattedLabel:function(x,w,S,T,M,A){return r.getFormattedLabel(x,w,"node",T,zn(M,h.normal&&h.normal.get("formatter"),n.get("name")),A)}},labelDataIndex:i.dataIndex,defaultText:i.dataIndex+"",inheritColor:f.fill,defaultOpacity:f.opacity,defaultOutsidePosition:"startArc"});var d=c.get("position")||"outside",g=c.get("distance")||0,m;d==="outside"?m=o.r+g:m=(o.r+o.r0)/2,this.textConfig={inside:d!=="outside"};var y=d!=="outside"?c.get("align")||"center":l>0?"left":"right",_=d!=="outside"?c.get("verticalAlign")||"middle":u>0?"top":"bottom";a.attr({x:l*m+o.cx,y:u*m+o.cy,rotation:0,style:{align:y,verticalAlign:_}})},t}(Qr),Xle=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(),h=n.getItemModel(l.dataIndex),f=h.getModel("lineStyle"),d=h.getModel("emphasis"),g=d.get("focus"),m=Q(Ba(c.getModel("itemStyle"),u,!0),u),y=this;if(isNaN(m.sStartAngle)||isNaN(m.tStartAngle)){y.setShape(m);return}o?(y.setShape(m),SR(y,l,r,f)):(Oi(y),SR(y,l,r,f),it(y,{shape:m},s,i)),Dt(this,g==="adjacency"?l.getAdjacentDataIndices():g,d.get("blurScope"),d.get("disabled")),Sr(y,h,"lineStyle"),n.setItemGraphicEl(l.dataIndex,y)},t}(Ke);function SR(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(he(l)&&he(u)){var c=e.shape,h=(c.s1[0]+c.s2[0])/2,f=(c.s1[1]+c.s2[1])/2,d=(c.t1[0]+c.t2[0])/2,g=(c.t1[1]+c.t2[1])/2;o.fill=new qu(h,f,d,g,[{offset:0,color:l},{offset:1,color:u}],!0)}break}}var qle=Math.PI/180,Kle=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")*qle;if(a.diff(o).add(function(c){var h=a.getItemLayout(c);if(h){var f=new wR(a,c,l);De(f).dataIndex=c,s.add(f)}}).update(function(c,h){var f=o.getItemGraphicEl(h),d=a.getItemLayout(c);if(!d){f&&Do(f,r,h);return}f?f.updateData(a,c,l):f=new wR(a,c,l),s.add(f)}).remove(function(c){var h=o.getItemGraphicEl(c);h&&Do(h,r,c)}).execute(),!o){var u=r.get("center");this.group.scaleX=.01,this.group.scaleY=.01,this.group.originX=ce(u[0],i.getWidth()),this.group.originY=ce(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 Xle(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&&Do(u,r,l)}).execute(),this._edgeData=a},t.prototype.dispose=function(){},t.type="chord",t}(gt),Jle=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 Mf(fe(this.getData,this),fe(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=Ok(a,i,this,!0,s);return o.data}function s(l,u){var c=qe.prototype.getModel;function h(d,g){var m=c.call(this,d,g);return m.resolveParentPath=f,m}u.wrapMethod("getItemModel",function(d){return d.resolveParentPath=f,d.getModel=h,d});function f(d){if(d&&(d[0]==="label"||d[1]==="label")){var g=d.slice();return d[0]==="label"?g[0]="edgeLabel":d[1]==="label"&&(g[1]="edgeLabel"),g}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),gr("nameValue",{name:c.join(" > "),value:a.value,noValue:a.value==null})}return gr("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}(bt),Iw=Math.PI/180;function Qle(e,t){e.eachSeriesByType("chord",function(r){eue(r,t)})}function eue(e,t){var r=e.getData(),n=r.graph,i=e.getEdgeData(),a=i.count();if(a){var o=TV(e,t),s=o.cx,l=o.cy,u=o.r,c=o.r0,h=Math.max((e.get("padAngle")||0)*Iw,0),f=Math.max((e.get("minAngle")||0)*Iw,0),d=-e.get("startAngle")*Iw,g=d+Math.PI*2,m=e.get("clockwise"),y=m?1:-1,_=[d,g];gx(_,!m);var x=_[0],w=_[1],S=w-x,T=r.getSum("value")===0&&i.getSum("value")===0,M=[],A=0;n.eachEdge(function(z){var Z=T?1:z.getValue("value");T&&(Z>0||f)&&(A+=2);var U=z.node1.dataIndex,$=z.node2.dataIndex;M[U]=(M[U]||0)+Z,M[$]=(M[$]||0)+Z});var P=0;if(n.eachNode(function(z){var Z=z.getValue("value");isNaN(Z)||(M[z.dataIndex]=Math.max(Z,M[z.dataIndex]||0)),!T&&(M[z.dataIndex]>0||f)&&A++,P+=M[z.dataIndex]||0}),!(A===0||P===0)){h*A>=Math.abs(S)&&(h=Math.max(0,(Math.abs(S)-f*A)/A)),(h+f)*A>=Math.abs(S)&&(f=(Math.abs(S)-h*A)/A);var I=(S-h*A*y)/P,N=0,D=0,O=0;n.eachNode(function(z){var Z=M[z.dataIndex]||0,U=I*(P?Z:1)*y;Math.abs(U)D){var F=N/D;n.eachNode(function(z){var Z=z.getLayout().angle;Math.abs(Z)>=f?z.setLayout({angle:Z*F,ratio:F},!0):z.setLayout({angle:f,ratio:f===0?1:Z/f},!0)})}else n.eachNode(function(z){if(!R){var Z=z.getLayout().angle,U=Math.min(Z/O,1),$=U*N;Z-$f&&f>0){var U=R?1:Math.min(Z/O,1),$=Z-f,Y=Math.min($,Math.min(H,N*U));H-=Y,z.setLayout({angle:Z-Y,ratio:(Z-Y)/Z},!0)}else f>0&&z.setLayout({angle:f,ratio:Z===0?1:f/Z},!0)}});var W=x,V=[];n.eachNode(function(z){var Z=Math.max(z.getLayout().angle,f);z.setLayout({cx:s,cy:l,r0:c,r:u,startAngle:W,endAngle:W+Z*y,clockwise:m},!0),V[z.dataIndex]=W,W+=(Z+h)*y}),n.eachEdge(function(z){var Z=T?1:z.getValue("value"),U=I*(P?Z:1)*y,$=z.node1.dataIndex,Y=V[$]||0,te=Math.abs((z.node1.getLayout().ratio||1)*U),ie=Y+te*y,se=[s+c*Math.cos(Y),l+c*Math.sin(Y)],le=[s+c*Math.cos(ie),l+c*Math.sin(ie)],Ee=z.node2.dataIndex,me=V[Ee]||0,ye=Math.abs((z.node2.getLayout().ratio||1)*U),Me=me+ye*y,pe=[s+c*Math.cos(me),l+c*Math.sin(me)],Te=[s+c*Math.cos(Me),l+c*Math.sin(Me)];z.setLayout({s1:se,s2:le,sStartAngle:Y,sEndAngle:ie,t1:pe,t2:Te,tStartAngle:me,tEndAngle:Me,cx:s,cy:l,r:c,value:Z,clockwise:m}),V[$]=ie,V[Ee]=Me})}}}function tue(e){e.registerChartView(Kle),e.registerSeriesModel(Jle),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,Qle),e.registerProcessor(Cf("chord"))}var rue=function(){function e(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return e}(),nue=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 rue},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}(Ke);function iue(e,t){var r=e.get("center"),n=t.getWidth(),i=t.getHeight(),a=Math.min(n,i),o=ce(r[0],t.getWidth()),s=ce(r[1],t.getHeight()),l=ce(e.get("radius"),a/2);return{cx:o,cy:s,r:l}}function Um(e,t){var r=e==null?"":e+"";return t&&(he(t)?r=t.replace("{value}",r):we(t)&&(r=t(e))),r}var aue=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=iue(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,h=r.getModel("axisLine"),f=h.get("roundCap"),d=f?i_:Qr,g=h.get("show"),m=h.getModel("lineStyle"),y=m.get("width"),_=[u,c];gx(_,!l),u=_[0],c=_[1];for(var x=c-u,w=u,S=[],T=0;g&&T=I&&(N===0?0:a[N-1][0])Math.PI/2&&(ie+=Math.PI)):te==="tangential"?ie=-P-Math.PI/2:rt(te)&&(ie=te*Math.PI/180),ie===0?h.add(new tt({style:Ct(w,{text:Z,x:$,y:Y,verticalAlign:H<-.8?"top":H>.8?"bottom":"middle",align:F<-.4?"left":F>.4?"right":"center"},{inheritColor:U}),silent:!0})):h.add(new tt({style:Ct(w,{text:Z,x:$,y:Y,verticalAlign:"middle",align:"center"},{inheritColor:U}),silent:!0,originX:$,originY:Y,rotation:ie}))}if(x.get("show")&&W!==S){var V=x.get("distance");V=V?V+c:c;for(var se=0;se<=T;se++){F=Math.cos(P),H=Math.sin(P);var le=new ar({shape:{x1:F*(g-V)+f,y1:H*(g-V)+d,x2:F*(g-A-V)+f,y2:H*(g-A-V)+d},silent:!0,style:O});O.stroke==="auto"&&le.setStyle({stroke:a((W+se/T)/S)}),h.add(le),P+=N}P-=N}else P+=I}},t.prototype._renderPointer=function(r,n,i,a,o,s,l,u,c){var h=this.group,f=this._data,d=this._progressEls,g=[],m=r.get(["pointer","show"]),y=r.getModel("progress"),_=y.get("show"),x=r.getData(),w=x.mapDimension("value"),S=+r.get("min"),T=+r.get("max"),M=[S,T],A=[s,l];function P(N,D){var O=x.getItemModel(N),R=O.getModel("pointer"),F=ce(R.get("width"),o.r),H=ce(R.get("length"),o.r),W=r.get(["pointer","icon"]),V=R.get("offsetCenter"),z=ce(V[0],o.r),Z=ce(V[1],o.r),U=R.get("keepAspect"),$;return W?$=sr(W,z-F/2,Z-H,F,H,null,U):$=new nue({shape:{angle:-Math.PI/2,width:F,r:H,x:z,y:Z}}),$.rotation=-(D+Math.PI/2),$.x=o.cx,$.y=o.cy,$}function I(N,D){var O=y.get("roundCap"),R=O?i_:Qr,F=y.get("overlap"),H=F?y.get("width"):c/x.count(),W=F?o.r-H:o.r-(N+1)*H,V=F?o.r:o.r-N*H,z=new R({shape:{startAngle:s,endAngle:D,cx:o.cx,cy:o.cy,clockwise:u,r0:W,r:V}});return F&&(z.z2=ht(x.get(w,N),[S,T],[100,0],!0)),z}(_||m)&&(x.diff(f).add(function(N){var D=x.get(w,N);if(m){var O=P(N,s);Nt(O,{rotation:-((isNaN(+D)?A[0]:ht(D,M,A,!0))+Math.PI/2)},r),h.add(O),x.setItemGraphicEl(N,O)}if(_){var R=I(N,s),F=y.get("clip");Nt(R,{shape:{endAngle:ht(D,M,A,F)}},r),h.add(R),KC(r.seriesIndex,x.dataType,N,R),g[N]=R}}).update(function(N,D){var O=x.get(w,N);if(m){var R=f.getItemGraphicEl(D),F=R?R.rotation:s,H=P(N,F);H.rotation=F,it(H,{rotation:-((isNaN(+O)?A[0]:ht(O,M,A,!0))+Math.PI/2)},r),h.add(H),x.setItemGraphicEl(N,H)}if(_){var W=d[D],V=W?W.shape.endAngle:s,z=I(N,V),Z=y.get("clip");it(z,{shape:{endAngle:ht(O,M,A,Z)}},r),h.add(z),KC(r.seriesIndex,x.dataType,N,z),g[N]=z}}).execute(),x.each(function(N){var D=x.getItemModel(N),O=D.getModel("emphasis"),R=O.get("focus"),F=O.get("blurScope"),H=O.get("disabled");if(m){var W=x.getItemGraphicEl(N),V=x.getItemVisual(N,"style"),z=V.fill;if(W instanceof Er){var Z=W.style;W.useStyle(Q({image:Z.image,x:Z.x,y:Z.y,width:Z.width,height:Z.height},V))}else W.useStyle(V),W.type!=="pointer"&&W.setColor(z);W.setStyle(D.getModel(["pointer","itemStyle"]).getItemStyle()),W.style.fill==="auto"&&W.setStyle("fill",a(ht(x.get(w,N),M,[0,1],!0))),W.z2EmphasisLift=0,Sr(W,D),Dt(W,R,F,H)}if(_){var U=g[N];U.useStyle(x.getItemVisual(N,"style")),U.setStyle(D.getModel(["progress","itemStyle"]).getItemStyle()),U.z2EmphasisLift=0,Sr(U,D),Dt(U,R,F,H)}}),this._progressEls=g)},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=sr(s,n.cx-o/2+ce(l[0],n.r),n.cy-o/2+ce(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"),h=+r.get("max"),f=new Ce,d=[],g=[],m=r.isAnimationEnabled(),y=r.get(["pointer","showAbove"]);l.diff(this._data).add(function(_){d[_]=new tt({silent:!0}),g[_]=new tt({silent:!0})}).update(function(_,x){d[_]=s._titleEls[x],g[_]=s._detailEls[x]}).execute(),l.each(function(_){var x=l.getItemModel(_),w=l.get(u,_),S=new Ce,T=a(ht(w,[c,h],[0,1],!0)),M=x.getModel("title");if(M.get("show")){var A=M.get("offsetCenter"),P=o.cx+ce(A[0],o.r),I=o.cy+ce(A[1],o.r),N=d[_];N.attr({z2:y?0:2,style:Ct(M,{x:P,y:I,text:l.getName(_),align:"center",verticalAlign:"middle"},{inheritColor:T})}),S.add(N)}var D=x.getModel("detail");if(D.get("show")){var O=D.get("offsetCenter"),R=o.cx+ce(O[0],o.r),F=o.cy+ce(O[1],o.r),H=ce(D.get("width"),o.r),W=ce(D.get("height"),o.r),V=r.get(["progress","show"])?l.getItemVisual(_,"style").fill:T,N=g[_],z=D.get("formatter");N.attr({z2:y?0:2,style:Ct(D,{x:R,y:F,text:Um(w,z),width:isNaN(H)?null:H,height:isNaN(W)?null:W,align:"center",verticalAlign:"middle"},{inheritColor:V})}),sV(N,{normal:D},w,function(U){return Um(U,z)}),m&&lV(N,_,l,r,{getFormattedLabel:function(U,$,Y,te,ie,se){return Um(se?se.interpolatedValue:w,z)}}),S.add(N)}f.add(S)}),this.group.add(f),this._titleEls=d,this._detailEls=g},t.type="gauge",t}(gt),oue=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 Tf(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}(bt);function sue(e){e.registerChartView(aue),e.registerSeriesModel(oue)}var lue=["itemStyle","opacity"],uue=function(e){q(t,e);function t(r,n){var i=e.call(this)||this,a=i,o=new Gr,s=new tt;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(lue);c=c??1,i||Oi(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)):it(a,{style:{opacity:c},shape:{points:l.points}},o,n),Sr(a,s),this._updateLabel(r,n),Dt(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,h=r.getItemVisual(n,"style"),f=h.fill;Dr(o,Cr(l),{labelFetcher:r.hostModel,labelDataIndex:n,defaultOpacity:h.opacity,defaultText:r.getName(n)},{normal:{align:c.textAlign,verticalAlign:c.verticalAlign}});var d=l.getModel("label"),g=d.get("color"),m=g==="inherit"?f:null;i.setTextConfig({local:!0,inside:!!c.inside,insideStroke:m,outsideFill:m});var y=c.linePoints;a.setShape({points:y}),i.textGuideLineConfig={anchor:y?new Ne(y[0][0],y[0][1]):null},it(o,{style:{x:c.x,y:c.y}},s,n),o.attr({rotation:c.rotation,originX:c.x,originY:c.y,z2:10}),ck(i,hk(l),{stroke:f})},t}(en),cue=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 uue(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);Do(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}(gt),hue=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 Mf(fe(this.getData,this),fe(this.getRawData,this)),this._defaultLabelLine(r)},t.prototype.getInitialData=function(r,n){return Tf(this,{coordDimensions:["value"],encodeDefaulter:Fe(zA,this)})},t.prototype._defaultLabelLine=function(r){ju(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}(bt);function fue(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();okue)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||!Ew(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 Ew(e,t){var r=e._model;return r.get("axisExpandable")&&r.get("axisExpandTriggerOn")===t}var Pue=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&&Ge(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){j(["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=ot(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(a){return(a.get("parallelIndex")||0)===this.componentIndex},this);j(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}($e),Iue=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}(Vi);function rl(e,t,r,n,i,a){e=e||0;var o=r[1]-r[0];if(i!=null&&(i=jc(i,[0,o])),a!=null&&(a=Math.max(a,i??0)),n==="all"){var s=Math.abs(t[1]-t[0]);s=jc(s,[0,o]),i=a=jc(s,[i,a]),n=0}t[0]=jc(t[0],r),t[1]=jc(t[1],r);var l=jw(t,n);t[n]+=e;var u=i||0,c=r.slice();l.sign<0?c[0]+=u:c[1]-=u,t[n]=jc(t[n],c);var h;return h=jw(t,n),i!=null&&(h.sign!==l.sign||h.spana&&(t[1-n]=t[n]+h.sign*a),t}function jw(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 jc(e,t){return Math.min(t[1]!=null?t[1]:1/0,Math.max(t[0]!=null?t[0]:-1/0,e))}var Rw=j,a8=Math.min,o8=Math.max,MR=Math.floor,Due=Math.ceil,AR=ir,Eue=Math.PI,jue=function(){function e(t,r,n){this.type="parallel",this._axesMap=xe(),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;Rw(i,function(o,s){var l=a[s],u=r.getComponent("parallelAxis",l),c=this._axesMap.set(o,new Iue(o,Xp(u),[0,0],u.get("type"),l)),h=c.type==="category";c.onBand=h&&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();Rw(this.dimensions,function(a){var o=this._axesMap.get(a);o.scale.unionExtentFromData(i,i.mapDimension(a)),Gu(o.scale,o.model)},this)}},this)},e.prototype.resize=function(t,r){var n=Tr(t,r).refContainer;this._rect=It(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=Zm(t.get("axisExpandWidth"),l),h=Zm(t.get("axisExpandCount")||0,[0,u]),f=t.get("axisExpandable")&&u>3&&u>h&&h>1&&c>0&&s>0,d=t.get("axisExpandWindow"),g;if(d)g=Zm(d[1]-d[0],l),d[1]=d[0]+g;else{g=Zm(c*(h-1),l);var m=t.get("axisExpandCenter")||MR(u/2);d=[c*m-g/2],d[1]=d[0]+g}var y=(s-g)/(u-h);y<3&&(y=0);var _=[MR(AR(d[0]/c,1))+1,Due(AR(d[1]/c,1))-1],x=y/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:f,axisExpandWidth:c,axisCollapseWidth:y,axisExpandWindow:d,axisCount:u,winInnerIndices:_,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])}),Rw(n,function(o,s){var l=(i.axisExpandable?Oue:Rue)(s,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},c={horizontal:Eue/2,vertical:0},h=[u[a].x+t.x,u[a].y+t.y],f=c[a],d=Pr();Ko(d,d,f),ha(d,d,h),this._axesLayout[o]={position:h,rotation:f,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=[];j(o,function(y){s.push(t.mapDimension(y)),l.push(a.get(y).model)});for(var u=this.hasAxisBrushed(),c=n;ca*(1-h[0])?(u="jump",l=s-a*(1-h[2])):(l=s-a*h[1])>=0&&(l=s-a*(1-h[1]))<=0&&(l=0),l*=r.axisExpandWidth/c,l?rl(l,i,o,"all"):u="none";else{var d=i[1]-i[0],g=o[1]*s/d;i=[o8(0,g-d/2)],i[1]=a8(o[1],i[0]+d),i[0]=i[1]-d}return{axisExpandWindow:i,behavior:u}},e}();function Zm(e,t){return a8(o8(e,t[0]),t[1])}function Rue(e,t){var r=t.layoutLength/(t.axisCount-1);return{position:r*e,axisNameAvailableWidth:r,axisLabelShow:!0}}function Oue(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--)Qn(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;aGue}function f8(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function d8(e,t,r,n){var i=new Ce;return i.add(new Ze({name:"main",style:Gk(r),silent:!0,draggable:!0,cursor:"move",drift:Fe(NR,e,t,i,["n","s","w","e"]),ondragend:Fe(Hu,t,{isEnd:!0})})),j(n,function(a){i.add(new Ze({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:Fe(NR,e,t,i,a),ondragend:Fe(Hu,t,{isEnd:!0})}))}),i}function v8(e,t,r,n){var i=n.brushStyle.lineWidth||0,a=Yh(i,Wue),o=r[0][0],s=r[1][0],l=o-i/2,u=s-i/2,c=r[0][1],h=r[1][1],f=c-a+i/2,d=h-a+i/2,g=c-o,m=h-s,y=g+i,_=m+i;mo(e,t,"main",o,s,g,m),n.transformable&&(mo(e,t,"w",l,u,a,_),mo(e,t,"e",f,u,a,_),mo(e,t,"n",l,u,y,a),mo(e,t,"s",l,d,y,a),mo(e,t,"nw",l,u,a,a),mo(e,t,"ne",f,u,a,a),mo(e,t,"sw",l,d,a,a),mo(e,t,"se",f,d,a,a))}function i2(e,t){var r=t.__brushOption,n=r.transformable,i=t.childAt(0);i.useStyle(Gk(r)),i.attr({silent:!n,cursor:n?"move":"default"}),j([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=t.childOfName(a.join("")),s=a.length===1?a2(e,a[0]):Xue(e,a);o&&o.attr({silent:!n,invisible:!n,cursor:n?Uue[s]+"-resize":null})})}function mo(e,t,r,n,i,a,o){var s=t.childOfName(r);s&&s.setShape(Kue(Wk(e,t,[[n,i],[n+a,i+o]])))}function Gk(e){return Ae({strokeNoScale:!0},e.brushStyle)}function p8(e,t,r,n){var i=[wp(e,r),wp(t,n)],a=[Yh(e,r),Yh(t,n)];return[[i[0],a[0]],[i[1],a[1]]]}function Yue(e){return Us(e.group)}function a2(e,t){var r={w:"left",e:"right",n:"top",s:"bottom"},n={left:"w",right:"e",top:"n",bottom:"s"},i=xx(r[t],Yue(e));return n[i]}function Xue(e,t){var r=[a2(e,t[0]),a2(e,t[1])];return(r[0]==="e"||r[0]==="w")&&r.reverse(),r.join("")}function NR(e,t,r,n,i,a){var o=r.__brushOption,s=e.toRectRange(o.range),l=g8(t,i,a);j(n,function(u){var c=Hue[u];s[c[0]][c[1]]+=l[c[0]]}),o.range=e.fromRectRange(p8(s[0][0],s[1][0],s[0][1],s[1][1])),Bk(t,r),Hu(t,{isEnd:!1})}function que(e,t,r,n){var i=t.__brushOption.range,a=g8(e,r,n);j(i,function(o){o[0]+=a[0],o[1]+=a[1]}),Bk(e,t),Hu(e,{isEnd:!1})}function g8(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 Wk(e,t,r){var n=h8(e,t);return n&&n!==Wu?n.clipPath(r,e._transform):Se(r)}function Kue(e){var t=wp(e[0][0],e[1][0]),r=wp(e[0][1],e[1][1]),n=Yh(e[0][0],e[1][0]),i=Yh(e[0][1],e[1][1]);return{x:t,y:r,width:n-t,height:i-r}}function Jue(e,t,r){if(!(!e._brushType||ece(e,t.offsetX,t.offsetY))){var n=e._zr,i=e._covers,a=Vk(e,t,r);if(!e._dragging)for(var o=0;on.getWidth()||r<0||r>n.getHeight()}var Bx={lineX:DR(0),lineY:DR(1),rect:{createCover:function(e,t){function r(n){return n}return d8({toRectRange:r,fromRectRange:r},e,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(e){var t=f8(e);return p8(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,r,n){v8(e,t,r,n)},updateCommon:i2,contain:s2},polygon:{createCover:function(e,t){var r=new Ce;return r.add(new Gr({name:"main",style:Gk(t),silent:!0})),r},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new en({name:"main",draggable:!0,drift:Fe(que,e,t),ondragend:Fe(Hu,e,{isEnd:!0})}))},updateCoverShape:function(e,t,r,n){t.childAt(0).setShape({points:Wk(e,t,r)})},updateCommon:i2,contain:s2}};function DR(e){return{createCover:function(t,r){return d8({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=f8(t),n=wp(r[0][e],r[1][e]),i=Yh(r[0][e],r[1][e]);return[n,i]},updateCoverShape:function(t,r,n,i){var a,o=h8(t,r);if(o!==Wu&&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(),v8(t,r,l,i)},updateCommon:i2,contain:s2}}function y8(e){return e=Hk(e),function(t){return _A(t,e)}}function _8(e,t){return e=Hk(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 x8(e,t,r){var n=Hk(e);return function(i,a){return n.contain(a[0],a[1])&&!TW(i,t,r)}}function Hk(e){return Pe.create(e)}var tce=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 zk(n.getZr())).on("brush",fe(this._onBrush,this))},t.prototype.render=function(r,n,i,a){if(!rce(r,n,a)){this.axisModel=r,this.api=i,this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Ce,this.group.add(this._axisGroup),!!r.get("show")){var s=ice(r,n),l=s.coordinateSystem,u=r.getAreaSelectStyle(),c=u.width,h=r.axis.dim,f=l.getAxisLayout(h),d=Q({strokeContainThreshold:c},f),g=new wn(r,i,d);g.build(),this._axisGroup.add(g.group),this._refreshBrushController(d,u,r,s,c,i),Up(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),h=Pe.create({x:l[0],y:-o/2,width:u,height:o});h.x-=c,h.width+=2*c,this._brushController.mount({enableGlobalPan:!0,rotation:r.rotation,x:r.position[0],y:r.position[1]}).setPanels([{panelId:"pl",clipPath:y8(h),isTargetByCursor:x8(h,s,a),getLinearBrushOtherExtent:_8(h,0)}]).enableBrush({brushType:"lineX",brushStyle:n,removeOnClick:!0}).updateCovers(nce(i))},t.prototype._onBrush=function(r){var n=r.areas,i=this.axisModel,a=i.axis,o=ae(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}(Mt);function rce(e,t,r){return r&&r.type==="axisAreaSelect"&&t.findComponents({mainType:"parallelAxis",query:r})[0]===e}function nce(e){var t=e.axis;return ae(e.activeIntervals,function(r){return{brushType:"lineX",panelId:"pl",range:[t.dataToCoord(r[0],!0),t.dataToCoord(r[1],!0)]}})}function ice(e,t){return t.getComponent("parallel",e.get("parallelIndex"))}var ace={type:"axisAreaSelect",event:"axisAreaSelected"};function oce(e){e.registerAction(ace,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 sce={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function b8(e){e.registerComponentView(Lue),e.registerComponentModel(Pue),e.registerCoordinateSystem("parallel",Bue),e.registerPreprocessor(Tue),e.registerComponentModel(r2),e.registerComponentView(tce),Zh(e,"parallel",r2,sce),oce(e)}function lce(e){He(b8),e.registerChartView(mue),e.registerSeriesModel(xue),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,Cue)}var uce=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}(),cce=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new uce},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(){Ho(this)},t.prototype.downplay=function(){Uo(this)},t}(Ke),hce=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r._mainGroup=new Ce,r._focusAdjacencyDisabled=!1,r}return t.prototype.init=function(r,n){this._controller=new rc(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,h=r.getData(),f=r.getData("edge"),d=r.get("orient");this._model=r,s.removeAll(),s.x=l.x,s.y=l.y,this._updateViewCoordSys(r,i),MW(r,i,s,this._controller,this._controllerHost,null),o.eachEdge(function(g){var m=new cce,y=De(m);y.dataIndex=g.dataIndex,y.seriesIndex=r.seriesIndex,y.dataType="edge";var _=g.getModel(),x=_.getModel("lineStyle"),w=x.get("curveness"),S=g.node1.getLayout(),T=g.node1.getModel(),M=T.get("localX"),A=T.get("localY"),P=g.node2.getLayout(),I=g.node2.getModel(),N=I.get("localX"),D=I.get("localY"),O=g.getLayout(),R,F,H,W,V,z,Z,U;m.shape.extent=Math.max(1,O.dy),m.shape.orient=d,d==="vertical"?(R=(M!=null?M*u:S.x)+O.sy,F=(A!=null?A*c:S.y)+S.dy,H=(N!=null?N*u:P.x)+O.ty,W=D!=null?D*c:P.y,V=R,z=F*(1-w)+W*w,Z=H,U=F*w+W*(1-w)):(R=(M!=null?M*u:S.x)+S.dx,F=(A!=null?A*c:S.y)+O.sy,H=N!=null?N*u:P.x,W=(D!=null?D*c:P.y)+O.ty,V=R*(1-w)+H*w,z=F,Z=R*w+H*(1-w),U=W),m.setShape({x1:R,y1:F,x2:H,y2:W,cpx1:V,cpy1:z,cpx2:Z,cpy2:U}),m.useStyle(x.getItemStyle()),ER(m.style,d,g);var $=""+_.get("value"),Y=Cr(_,"edgeLabel");Dr(m,Y,{labelFetcher:{getFormattedLabel:function(se,le,Ee,me,ye,Me){return r.getFormattedLabel(se,le,"edge",me,zn(ye,Y.normal&&Y.normal.get("formatter"),$),Me)}},labelDataIndex:g.dataIndex,defaultText:$}),m.setTextConfig({position:"inside"});var te=_.getModel("emphasis");Sr(m,_,"lineStyle",function(se){var le=se.getItemStyle();return ER(le,d,g),le}),s.add(m),f.setItemGraphicEl(g.dataIndex,m);var ie=te.get("focus");Dt(m,ie==="adjacency"?g.getAdjacentDataIndices():ie==="trajectory"?g.getTrajectoryDataIndices():ie,te.get("blurScope"),te.get("disabled"))}),o.eachNode(function(g){var m=g.getLayout(),y=g.getModel(),_=y.get("localX"),x=y.get("localY"),w=y.getModel("emphasis"),S=y.get(["itemStyle","borderRadius"])||0,T=new Ze({shape:{x:_!=null?_*u:m.x,y:x!=null?x*c:m.y,width:m.dx,height:m.dy,r:S},style:y.getModel("itemStyle").getItemStyle(),z2:10});Dr(T,Cr(y),{labelFetcher:{getFormattedLabel:function(A,P){return r.getFormattedLabel(A,P,"node")}},labelDataIndex:g.dataIndex,defaultText:g.id}),T.disableLabelAnimation=!0,T.setStyle("fill",g.getVisual("color")),T.setStyle("decal",g.getVisual("style").decal),Sr(T,y),s.add(T),h.setItemGraphicEl(g.dataIndex,T),De(T).dataType="node";var M=w.get("focus");Dt(T,M==="adjacency"?g.getAdjacentDataIndices():M==="trajectory"?g.getTrajectoryDataIndices():M,w.get("blurScope"),w.get("disabled"))}),h.eachItemGraphicEl(function(g,m){var y=h.getItemModel(m);y.get("draggable")&&(g.drift=function(_,x){a._focusAdjacencyDisabled=!0,this.shape.x+=_,this.shape.y+=x,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:r.id,dataIndex:h.getRawIndex(m),localX:this.shape.x/u,localY:this.shape.y/c})},g.ondragend=function(){a._focusAdjacencyDisabled=!1},g.draggable=!0,g.cursor="move")}),!this._data&&r.isAnimationEnabled()&&s.setClipPath(fce(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 nc(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}(gt);function ER(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");he(n)&&he(i)&&(e.fill=new qu(0,0,+(t==="horizontal"),+(t==="vertical"),[{color:n,offset:0},{color:i,offset:1}]))}}function fce(e,t,r){var n=new Ze({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 dce=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 qe(o[l],this,n));var u=Ok(a,i,this,!0,c);return u.data;function c(h,f){h.wrapMethod("getItemModel",function(d,g){var m=d.parentModel,y=m.getData().getItemLayout(g);if(y){var _=y.depth,x=m.levelModels[_];x&&(d.parentModel=x)}return d}),f.wrapMethod("getItemModel",function(d,g){var m=d.parentModel,y=m.getGraph().getEdgeByIndex(g),_=y.node1.getLayout();if(_){var x=_.depth,w=m.levelModels[x];w&&(d.parentModel=w)}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 gr("nameValue",{name:u,value:l,noValue:a(l)})}else{var c=this.getGraph().getNodeByIndex(r),h=c.getLayout().value,f=this.getDataParams(r,i).data.name;return gr("nameValue",{name:f!=null?f+"":null,value:h,noValue:a(h)})}},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}(bt);function vce(e,t){e.eachSeriesByType("sankey",function(r){var n=r.get("nodeWidth"),i=r.get("nodeGap"),a=Tr(r,t).refContainer,o=It(r.getBoxLayoutParams(),a);r.layoutInfo=o;var s=o.width,l=o.height,u=r.getGraph(),c=u.nodes,h=u.edges;gce(c);var f=ot(c,function(y){return y.getLayout().value===0}),d=f.length!==0?0:r.get("layoutIterations"),g=r.get("orient"),m=r.get("nodeAlign");pce(c,h,n,i,s,l,d,g,m)})}function pce(e,t,r,n,i,a,o,s,l){mce(e,t,r,i,a,s,l),bce(e,t,a,i,n,o,s),Nce(e,s)}function gce(e){j(e,function(t){var r=Ys(t.outEdges,f_),n=Ys(t.inEdges,f_),i=t.getValue()||0,a=Math.max(r,n,i);t.setLayout({value:a},!0)})}function mce(e,t,r,n,i,a,o){for(var s=[],l=[],u=[],c=[],h=0,f=0;f=0;_&&y.depth>d&&(d=y.depth),m.setLayout({depth:_?y.depth:h},!0),a==="vertical"?m.setLayout({dy:r},!0):m.setLayout({dx:r},!0);for(var x=0;xh-1?d:h-1;o&&o!=="left"&&yce(e,o,a,A);var P=a==="vertical"?(i-r)/A:(n-r)/A;xce(e,P,a)}function w8(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return t.depth!=null&&t.depth>=0}function yce(e,t,r,n){if(t==="right"){for(var i=[],a=e,o=0;a.length;){for(var s=0;s0;a--)l*=.99,Cce(s,l,o),Ow(s,i,r,n,o),Lce(s,l,o),Ow(s,i,r,n,o)}function wce(e,t){var r=[],n=t==="vertical"?"y":"x",i=ZC(e,function(a){return a.getLayout()[n]});return i.keys.sort(function(a,o){return a-o}),j(i.keys,function(a){r.push(i.buckets.get(a))}),r}function Sce(e,t,r,n,i,a){var o=1/0;j(e,function(s){var l=s.length,u=0;j(s,function(h){u+=h.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()[f]+t;var g=i==="vertical"?n:r;if(u=c-t-g,u>0){s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0),c=s;for(var d=h-2;d>=0;--d)l=o[d],u=l.getLayout()[a]+l.getLayout()[f]+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 Cce(e,t,r){j(e.slice().reverse(),function(n){j(n,function(i){if(i.outEdges.length){var a=Ys(i.outEdges,Tce,r)/Ys(i.outEdges,f_);if(isNaN(a)){var o=i.outEdges.length;a=o?Ys(i.outEdges,Mce,r)/o:0}if(r==="vertical"){var s=i.getLayout().x+(a-nl(i,r))*t;i.setLayout({x:s},!0)}else{var l=i.getLayout().y+(a-nl(i,r))*t;i.setLayout({y:l},!0)}}})})}function Tce(e,t){return nl(e.node2,t)*e.getValue()}function Mce(e,t){return nl(e.node2,t)}function Ace(e,t){return nl(e.node1,t)*e.getValue()}function kce(e,t){return nl(e.node1,t)}function nl(e,t){return t==="vertical"?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function f_(e){return e.getValue()}function Ys(e,t,r){for(var n=0,i=e.length,a=-1;++ao&&(o=l)}),j(n,function(s){var l=new Ir({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&&j(i,function(s){var l=s.getModel().get("lineStyle");s.setVisual("style",l)})})}function Ice(e){e.registerChartView(hce),e.registerSeriesModel(dce),e.registerLayout(vce),e.registerVisual(Pce),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=jx(a,t,i.get("scaleLimit"));i.setCenter(o.center),i.setZoom(o.zoom)})})}var S8=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,h=this._baseAxisDim=u[c],f=u[1-c],d=[i,a],g=d[c].get("type"),m=d[1-c].get("type"),y=t.data;if(y&&l){var _=[];j(y,function(S,T){var M;re(S)?(M=S.slice(),S.unshift(T)):re(S.value)?(M=Q({},S),M.value=M.value.slice(),S.value.unshift(T)):M=S,_.push(M)}),t.data=_}var x=this.defaultValueDimensions,w=[{name:h,type:X0(g),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:f,type:X0(m),dimsDef:x.slice()}];return Tf(this,{coordDimensions:w,dimensionsCount:x.length+1,encodeDefaulter:Fe(DV,w,this)})},e.prototype.getBaseAxis=function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis},e}(),C8=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}(bt);Qt(C8,S8,!0);var Dce=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),h=jR(c,a,u,l,!0);a.setItemGraphicEl(u,h),o.add(h)}}).update(function(u,c){var h=s.getItemGraphicEl(c);if(!a.hasValue(u)){o.remove(h);return}var f=a.getItemLayout(u);h?(Oi(h),T8(f,h,a,u)):h=jR(f,a,u,l),o.add(h),a.setItemGraphicEl(u,h)}).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}(gt),Ece=function(){function e(){}return e}(),jce=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 Ece},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();am){var S=[_,w];n.push(S)}}}return{boxData:r,outliers:n}}var Gce={type:"echarts:boxplot",transform:function(t){var r=t.upstream;if(r.sourceFormat!==Wr){var n="";ft(n)}var i=Vce(r.getRawData(),t.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function Wce(e){e.registerSeriesModel(C8),e.registerChartView(Dce),e.registerLayout(Oce),e.registerTransform(Gce)}var Hce=["itemStyle","borderColor"],Uce=["itemStyle","borderColor0"],Zce=["itemStyle","borderColorDoji"],$ce=["itemStyle","color"],Yce=["itemStyle","color0"];function Uk(e,t){return t.get(e>0?$ce:Yce)}function Zk(e,t){return t.get(e===0?Zce:e>0?Hce:Uce)}var Xce={seriesType:"candlestick",plan:yf(),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=Uk(s,o),l.stroke=Zk(s,o)||l.fill;var u=i.ensureUniqueItemVisual(a,"style");Q(u,l)}}}}}},qce=["color","borderColor"],Kce=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){hl(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 h=n.getItemLayout(c);if(s&&RR(u,h))return;var f=zw(h,c,!0);Nt(f,{shape:{points:h.ends}},r,c),Bw(f,n,c,o),a.add(f),n.setItemGraphicEl(c,f)}}).update(function(c,h){var f=i.getItemGraphicEl(h);if(!n.hasValue(c)){a.remove(f);return}var d=n.getItemLayout(c);if(s&&RR(u,d)){a.remove(f);return}f?(it(f,{shape:{points:d.ends}},r,c),Oi(f)):f=zw(d),Bw(f,n,c,o),a.add(f),n.setItemGraphicEl(c,f)}).remove(function(c){var h=i.getItemGraphicEl(c);h&&a.remove(h)}).execute(),this._data=n},t.prototype._renderLarge=function(r){this._clear(),OR(r,this.group);var n=r.get("clip",!0)?Jp(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=zw(s);Bw(l,i,o,a),l.incremental=!0,this.group.add(l),this._progressiveEls.push(l)}},t.prototype._incrementalRenderLarge=function(r,n){OR(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}(gt),Jce=function(){function e(){}return e}(),Qce=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 Jce},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}(Ke);function zw(e,t,r){var n=e.ends;return new Qce({shape:{points:r?ehe(n,e):n},z2:100})}function RR(e,t){for(var r=!0,n=0;nT?D[a]:N[a],ends:F,brushRect:Z(M,A,w)})}function V($,Y){var te=[];return te[i]=Y,te[a]=$,isNaN(Y)||isNaN($)?[NaN,NaN]:t.dataToPoint(te)}function z($,Y,te){var ie=Y.slice(),se=Y.slice();ie[i]=Py(ie[i]+n/2,1,!1),se[i]=Py(se[i]-n/2,1,!0),te?$.push(ie,se):$.push(se,ie)}function Z($,Y,te){var ie=V($,te),se=V(Y,te);return ie[i]-=n/2,se[i]-=n/2,{x:ie[0],y:ie[1],width:n,height:se[1]-ie[1]}}function U($){return $[i]=Py($[i],1),$}}function g(m,y){for(var _=Oa(m.count*4),x=0,w,S=[],T=[],M,A=y.getStore(),P=!!e.get(["itemStyle","borderColorDoji"]);(M=m.next())!=null;){var I=A.get(s,M),N=A.get(u,M),D=A.get(c,M),O=A.get(h,M),R=A.get(f,M);if(isNaN(I)||isNaN(O)||isNaN(R)){_[x++]=NaN,x+=3;continue}_[x++]=zR(A,M,N,D,c,P),S[i]=I,S[a]=O,w=t.dataToPoint(S,null,T),_[x++]=w?w[0]:NaN,_[x++]=w?w[1]:NaN,S[a]=R,w=t.dataToPoint(S,null,T),_[x++]=w?w[1]:NaN}y.setLayout("largePoints",_)}}};function zR(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 ihe(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=ce(be(e.get("barMaxWidth"),i),i),o=ce(be(e.get("barMinWidth"),1),i),s=e.get("barWidth");return s!=null?ce(s,i):Math.max(Math.min(i/2,a),o)}function ahe(e){e.registerChartView(Kce),e.registerSeriesModel(M8),e.registerPreprocessor(rhe),e.registerVisual(Xce),e.registerLayout(nhe)}function BR(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 ohe=function(e){q(t,e);function t(r,n){var i=e.call(this)||this,a=new qp(r,n),o=new Ce;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 f=void 0;we(h)?f=h(i):f=h,a.__t>0&&(f=-s*a.__t),this._animateSymbol(a,s,f,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 To(r.__p1,r.__cp1)+To(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=Br,c=NC;s[0]=u(n[0],a[0],i[0],o),s[1]=u(n[1],a[1],i[1],o);var h=r.__t<1?c(n[0],a[0],i[0],o):c(i[0],a[0],n[0],1-o),f=r.__t<1?c(n[1],a[1],i[1],o):c(i[1],a[1],n[1],1-o);r.rotation=-Math.atan2(f,h)-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]),h=i[l],f=i[l+1];r.x=h[0]*(1-c)+c*f[0],r.y=h[1]*(1-c)+c*f[1];var d=r.__t<1?f[0]-h[0]:h[0]-f[0],g=r.__t<1?f[1]-h[1]:h[1]-f[1];r.rotation=-Math.atan2(g,d)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=n,r.ignore=!1}},t}(A8),hhe=function(){function e(){this.polyline=!1,this.curveness=0,this.segs=[]}return e}(),fhe=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 hhe},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+h)/2-(c-f)*a,g=(c+f)/2-(h-u)*a;r.quadraticCurveTo(d,g,h,f)}else r.lineTo(h,f)}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 h=a[u++],f=a[u++],d=1;d0){var y=(h+g)/2-(f-m)*o,_=(f+m)/2-(g-h)*o;if(kF(h,f,y,_,g,m,s,r,n))return l}else if(ms(h,f,g,m,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}(),L8={seriesType:"lines",plan:yf(),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 h=r.get("clip",!0)&&Jp(r.coordinateSystem,!1,r);h?this.group.setClipPath(h):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=L8.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 dhe:new Rk(o?a?che:k8:a?A8:jk),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}(gt),phe=typeof Uint32Array>"u"?Array:Uint32Array,ghe=typeof Float64Array>"u"?Array:Float64Array;function FR(e){var t=e.data;t&&t[0]&&t[0][0]&&t[0][0].coord&&(e.data=ae(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),ix([i,r[0],r[1]])}))}var mhe=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||[],FR(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(FR(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=Eh(this._flatCoords,n.flatCoords),this._flatCoordsOffset=Eh(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}(bt);function $m(e){return e instanceof Array||(e=[e,e]),e}var yhe={seriesType:"lines",reset:function(e){var t=$m(e.get("symbol")),r=$m(e.get("symbolSize")),n=e.getData();n.setVisual("fromSymbol",t&&t[0]),n.setVisual("toSymbol",t&&t[1]),n.setVisual("fromSymbolSize",r&&r[0]),n.setVisual("toSymbolSize",r&&r[1]);function i(a,o){var s=a.getItemModel(o),l=$m(s.getShallow("symbol",!0)),u=$m(s.getShallow("symbolSize",!0));l[0]&&a.setItemVisual(o,"fromSymbol",l[0]),l[1]&&a.setItemVisual(o,"toSymbol",l[1]),u[0]&&a.setItemVisual(o,"fromSymbolSize",u[0]),u[1]&&a.setItemVisual(o,"toSymbolSize",u[1])}return{dataEach:n.hasItemOption?i:null}}};function _he(e){e.registerChartView(vhe),e.registerSeriesModel(mhe),e.registerLayout(L8),e.registerVisual(yhe)}var xhe=256,bhe=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var t=Bn.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,h=this.canvas,f=h.getContext("2d"),d=t.length;h.width=r,h.height=n;for(var g=0;g0){var O=o(w)?l:u;w>0&&(w=w*N+P),T[M++]=O[D],T[M++]=O[D+1],T[M++]=O[D+2],T[M++]=O[D+3]*w*256}else M+=4}return f.putImageData(S,0,0),h},e.prototype._getBrush=function(){var t=this._brushCanvas||(this._brushCanvas=Bn.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 whe(e,t,r){var n=e[1]-e[0];t=ae(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 VR(e){var t=e.dimensions;return t[0]==="lng"&&t[1]==="lat"}var Che=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()):VR(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&&(VR(o)?this.render(n,i,a):(this._progressiveEls=[],this._renderOnGridLike(n,a,r.start,r.end,!0)))},t.prototype.eachRendered=function(r){hl(this._progressiveEls||this.group,r)},t.prototype._renderOnGridLike=function(r,n,i,a,o){var s=r.coordinateSystem,l=tl(s,"cartesian2d"),u=tl(s,"matrix"),c,h,f,d;if(l){var g=s.getAxis("x"),m=s.getAxis("y");c=g.getBandWidth()+.5,h=m.getBandWidth()+.5,f=g.scale.getExtent(),d=m.scale.getExtent()}for(var y=this.group,_=r.getData(),x=r.getModel(["emphasis","itemStyle"]).getItemStyle(),w=r.getModel(["blur","itemStyle"]).getItemStyle(),S=r.getModel(["select","itemStyle"]).getItemStyle(),T=r.get(["itemStyle","borderRadius"]),M=Cr(r),A=r.getModel("emphasis"),P=A.get("focus"),I=A.get("blurScope"),N=A.get("disabled"),D=l||u?[_.mapDimension("x"),_.mapDimension("y"),_.mapDimension("value")]:[_.mapDimension("time"),_.mapDimension("value")],O=i;Of[1]||Wd[1])continue;var V=s.dataToPoint([H,W]);R=new Ze({shape:{x:V[0]-c/2,y:V[1]-h/2,width:c,height:h},style:F})}else if(u){var z=s.dataToLayout([_.get(D[0],O),_.get(D[1],O)]).rect;if(Xr(z.x))continue;R=new Ze({z2:1,shape:z,style:F})}else{if(isNaN(_.get(D[1],O)))continue;var Z=s.dataToLayout([_.get(D[0],O)]),z=Z.contentRect||Z.rect;if(Xr(z.x)||Xr(z.y))continue;R=new Ze({z2:1,shape:z,style:F})}if(_.hasItemOption){var U=_.getItemModel(O),$=U.getModel("emphasis");x=$.getModel("itemStyle").getItemStyle(),w=U.getModel(["blur","itemStyle"]).getItemStyle(),S=U.getModel(["select","itemStyle"]).getItemStyle(),T=U.get(["itemStyle","borderRadius"]),P=$.get("focus"),I=$.get("blurScope"),N=$.get("disabled"),M=Cr(U)}R.shape.r=T;var Y=r.getRawValue(O),te="-";Y&&Y[2]!=null&&(te=Y[2]+""),Dr(R,M,{labelFetcher:r,labelDataIndex:O,defaultOpacity:F.opacity,defaultText:te}),R.ensureState("emphasis").style=x,R.ensureState("blur").style=w,R.ensureState("select").style=S,Dt(R,P,I,N),R.incremental=o,o&&(R.states.emphasis.hoverLayer=!0),y.add(R),_.setItemGraphicEl(O,R),this._progressiveEls&&this._progressiveEls.push(R)}},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 bhe;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(),h=r.getRoamTransform();c.applyTransform(h);var f=Math.max(c.x,0),d=Math.max(c.y,0),g=Math.min(c.width+c.x,a.getWidth()),m=Math.min(c.height+c.y,a.getHeight()),y=g-f,_=m-d,x=[l.mapDimension("lng"),l.mapDimension("lat"),l.mapDimension("value")],w=l.mapArray(x,function(A,P,I){var N=r.dataToPoint([A,P]);return N[0]-=f,N[1]-=d,N.push(I),N}),S=i.getExtent(),T=i.type==="visualMap.continuous"?She(S,i.option.range):whe(S,i.getPieceList(),i.option.selected);u.update(w,y,_,o.color.getNormalizer(),{inRange:o.color.getColorMapper(),outOfRange:s.color.getColorMapper()},T);var M=new Er({style:{width:y,height:_,x:f,y:d,image:u.canvas},silent:!0});this.group.add(M)},t.type="heatmap",t}(gt),The=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.getInitialData=function(r,n){return no(null,this,{generateCoord:"value"})},t.prototype.preventIncremental=function(){var r=mf.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}(bt);function Mhe(e){e.registerChartView(Che),e.registerSeriesModel(The)}var Ahe=["itemStyle","borderWidth"],GR=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],Gw=new ro,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.render=function(r,n,i){var a=this.group,o=r.getData(),s=this._data,l=r.coordinateSystem,u=l.getBaseAxis(),c=u.isHorizontal(),h=l.master.getRect(),f={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:r,coordSys:l,coordSysExtent:[[h.x,h.x+h.width],[h.y,h.y+h.height]],isHorizontal:c,valueDim:GR[+c],categoryDim:GR[1-+c]};o.diff(s).add(function(g){if(o.hasValue(g)){var m=HR(o,g),y=WR(o,g,m,f),_=UR(o,f,y);o.setItemGraphicEl(g,_),a.add(_),$R(_,f,y)}}).update(function(g,m){var y=s.getItemGraphicEl(m);if(!o.hasValue(g)){a.remove(y);return}var _=HR(o,g),x=WR(o,g,_,f),w=j8(o,x);y&&w!==y.__pictorialShapeStr&&(a.remove(y),o.setItemGraphicEl(g,null),y=null),y?jhe(y,f,x):y=UR(o,f,x,!0),o.setItemGraphicEl(g,y),y.__pictorialSymbolMeta=x,a.add(y),$R(y,f,x)}).remove(function(g){var m=s.getItemGraphicEl(g);m&&ZR(s,g,m.__pictorialSymbolMeta.animationModel,m)}).execute();var d=r.get("clip",!0)?Jp(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){ZR(a,De(o).dataIndex,r,o)}):i.removeAll()},t.type="pictorialBar",t}(gt);function WR(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,h=r.isAnimationEnabled(),f={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:h?r:null,hoverScale:h&&r.get(["emphasis","scale"]),z2:r.getShallow("z",!0)||0};Lhe(r,a,i,n,f),Nhe(e,t,i,a,o,f.boundingLength,f.pxSign,c,n,f),Phe(r,f.symbolScale,u,n,f);var d=f.symbolSize,g=ec(r.get("symbolOffset"),d);return Ihe(r,d,i,a,o,g,s,f.valueLineWidth,f.boundingLength,f.repeatCutLength,n,f),f}function Lhe(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(re(o)){var h=[Ww(s,o[0])-l,Ww(s,o[1])-l];h[1]=0?1:-1:c>0?1:-1}function Ww(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function Nhe(e,t,r,n,i,a,o,s,l,u){var c=l.valueDim,h=l.categoryDim,f=Math.abs(r[h.wh]),d=e.getItemVisual(t,"symbolSize"),g;re(d)?g=d.slice():d==null?g=["100%","100%"]:g=[d,d],g[h.index]=ce(g[h.index],f),g[c.index]=ce(g[c.index],n?f:Math.abs(a)),u.symbolSize=g;var m=u.symbolScale=[g[0]/s,g[1]/s];m[c.index]*=(l.isHorizontal?-1:1)*o}function Phe(e,t,r,n,i){var a=e.get(Ahe)||0;a&&(Gw.attr({scaleX:t[0],scaleY:t[1],rotation:r}),Gw.updateTransform(),a/=Gw.getLineScale(),a*=t[n.valueDim.index]),i.valueLineWidth=a||0}function Ihe(e,t,r,n,i,a,o,s,l,u,c,h){var f=c.categoryDim,d=c.valueDim,g=h.pxSign,m=Math.max(t[d.index]+s,0),y=m;if(n){var _=Math.abs(l),x=Fr(e.get("symbolMargin"),"15%")+"",w=!1;x.lastIndexOf("!")===x.length-1&&(w=!0,x=x.slice(0,x.length-1));var S=ce(x,t[d.index]),T=Math.max(m+S*2,0),M=w?0:S*2,A=rA(n),P=A?n:YR((_+M)/T),I=_-P*m;S=I/2/(w?P:Math.max(P-1,1)),T=m+S*2,M=w?0:S*2,!A&&n!=="fixed"&&(P=u?YR((Math.abs(u)+M)/T):0),y=P*T-M,h.repeatTimes=P,h.symbolMargin=S}var N=g*(y/2),D=h.pathPosition=[];D[f.index]=r[f.wh]/2,D[d.index]=o==="start"?N:o==="end"?l-N:l/2,a&&(D[0]+=a[0],D[1]+=a[1]);var O=h.bundlePosition=[];O[f.index]=r[f.xy],O[d.index]=r[d.xy];var R=h.barRectShape=Q({},r);R[d.wh]=g*Math.max(Math.abs(r[d.wh]),Math.abs(D[d.index]+N)),R[f.wh]=r[f.wh];var F=h.clipShape={};F[f.xy]=-r[f.xy],F[f.wh]=c.ecSize[f.wh],F[d.xy]=0,F[d.wh]=r[d.wh]}function N8(e){var t=e.symbolPatternSize,r=sr(e.symbolType,-t/2,-t/2,t,t);return r.attr({culling:!0}),r.type!=="image"&&r.setStyle({strokeNoScale:!0}),r}function P8(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,h=a[t.valueDim.index]+o+r.symbolMargin*2;for($k(e,function(m){m.__pictorialAnimationIndex=c,m.__pictorialRepeatTimes=u,c0:_<0)&&(x=u-1-m),y[l.index]=h*(x-u/2+.5)+s[l.index],{x:y[0],y:y[1],scaleX:r.symbolScale[0],scaleY:r.symbolScale[1],rotation:r.rotation}}}function I8(e,t,r,n){var i=e.__pictorialBundle,a=e.__pictorialMainPath;a?Sh(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=N8(r),i.add(a),Sh(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 D8(e,t,r){var n=Q({},t.barRectShape),i=e.__pictorialBarRect;i?Sh(i,null,{shape:n},t,r):(i=e.__pictorialBarRect=new Ze({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),i.disableMorphing=!0,e.add(i))}function E8(e,t,r,n){if(r.symbolClip){var i=e.__pictorialClipPath,a=Q({},r.clipShape),o=t.valueDim,s=r.animationModel,l=r.dataIndex;if(i)it(i,{shape:a},s,l);else{a[o.wh]=0,i=new Ze({shape:a}),e.__pictorialBundle.setClipPath(i),e.__pictorialClipPath=i;var u={};u[o.wh]=r.clipShape[o.wh],Ku[n?"updateProps":"initProps"](i,{shape:u},s,l)}}}function HR(e,t){var r=e.getItemModel(t);return r.getAnimationDelayParams=Dhe,r.isAnimationEnabled=Ehe,r}function Dhe(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function Ehe(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function UR(e,t,r,n){var i=new Ce,a=new Ce;return i.add(a),i.__pictorialBundle=a,a.x=r.bundlePosition[0],a.y=r.bundlePosition[1],r.symbolRepeat?P8(i,t,r):I8(i,t,r),D8(i,r,n),E8(i,t,r,n),i.__pictorialShapeStr=j8(e,r),i.__pictorialSymbolMeta=r,i}function jhe(e,t,r){var n=r.animationModel,i=r.dataIndex,a=e.__pictorialBundle;it(a,{x:r.bundlePosition[0],y:r.bundlePosition[1]},n,i),r.symbolRepeat?P8(e,t,r,!0):I8(e,t,r,!0),D8(e,r,!0),E8(e,t,r,!0)}function ZR(e,t,r,n){var i=n.__pictorialBarRect;i&&i.removeTextContent();var a=[];$k(n,function(o){a.push(o)}),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(r=null),j(a,function(o){el(o,{scaleX:0,scaleY:0},r,t,function(){n.parent&&n.parent.remove(n)})}),e.setItemGraphicEl(t,null)}function j8(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function $k(e,t,r){j(e.__pictorialBundle.children(),function(n){n!==e.__pictorialBarRect&&t.call(r,n)})}function Sh(e,t,r,n,i,a){t&&e.attr(t),n.symbolClip&&!i?r&&e.attr(r):r&&Ku[i?"updateProps":"initProps"](e,r,n.animationModel,n.dataIndex,a)}function $R(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"),h=a.get("blurScope"),f=a.get("scale");$k(e,function(m){if(m instanceof Er){var y=m.style;m.useStyle(Q({image:y.image,x:y.x,y:y.y,width:y.width,height:y.height},r.style))}else m.useStyle(r.style);var _=m.ensureState("emphasis");_.style=o,f&&(_.scaleX=m.scaleX*1.1,_.scaleY=m.scaleY*1.1),m.ensureState("blur").style=s,m.ensureState("select").style=l,u&&(m.cursor=u),m.z2=r.z2});var d=t.valueDim.posDesc[+(r.boundingLength>0)],g=e.__pictorialBarRect;g.ignoreClip=!0,Dr(g,Cr(i),{labelFetcher:t.seriesModel,labelDataIndex:n,defaultText:Uh(t.seriesModel.getData(),n),inheritColor:r.style.fill,defaultOpacity:r.style.opacity,defaultOutsidePosition:d}),Dt(e,c,h,a.get("disabled"))}function YR(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}var Rhe=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=fl(gp.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}(gp);function Ohe(e){e.registerChartView(khe),e.registerSeriesModel(Rhe),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Fe(tG,"pictorialBar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,rG("pictorialBar"))}var zhe=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,h=u.boundaryGap;s.x=0,s.y=c.y+h[0];function f(y){return y.name}var d=new Zo(this._layersSeries||[],l,f,f),g=[];d.add(fe(m,this,"add")).update(fe(m,this,"update")).remove(fe(m,this,"remove")).execute();function m(y,_,x){var w=o._layers;if(y==="remove"){s.remove(w[_]);return}for(var S=[],T=[],M,A=l[_].indices,P=0;Pa&&(a=s),n.push(s)}for(var u=0;ua&&(a=h)}return{y0:i,max:a}}function Whe(e){e.registerChartView(zhe),e.registerSeriesModel(Fhe),e.registerLayout(Vhe),e.registerProcessor(Cf("themeRiver"))}var Hhe=2,Uhe=4,qR=function(e){q(t,e);function t(r,n,i,a){var o=e.call(this)||this;o.z2=Hhe,o.textConfig={inside:!0},De(o).seriesIndex=n.seriesIndex;var s=new tt({z2:Uhe,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(),h=Q({},c);h.label=null;var f=n.getVisual("style");f.lineJoin="bevel";var d=n.getVisual("decal");d&&(f.decal=Gh(d,o));var g=Ba(l.getModel("itemStyle"),h,!0);Q(h,g),j(Cn,function(x){var w=s.ensureState(x),S=l.getModel([x,"itemStyle"]);w.style=S.getItemStyle();var T=Ba(S,h);T&&(w.shape=T)}),r?(s.setShape(h),s.shape.r=c.r0,Nt(s,{shape:{r:c.r}},i,n.dataIndex)):(it(s,{shape:h},i),Oi(s)),s.useStyle(f),this._updateLabel(i);var m=l.getShallow("cursor");m&&s.attr("cursor",m),this._seriesModel=i||this._seriesModel,this._ecModel=a||this._ecModel;var y=u.get("focus"),_=y==="relative"?Eh(n.getAncestorsIndices(),n.getDescendantIndices()):y==="ancestor"?n.getAncestorsIndices():y==="descendant"?n.getDescendantIndices():y;Dt(this,_,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),h=this,f=h.getTextContent(),d=this.node.dataIndex,g=a.get("minAngle")/180*Math.PI,m=a.get("show")&&!(g!=null&&Math.abs(s)F&&!Oh(W-F)&&W0?(o.virtualPiece?o.virtualPiece.updateData(!1,x,r,n,i):(o.virtualPiece=new qR(x,r,n,i),c.add(o.virtualPiece)),w.piece.off("click"),o.virtualPiece.on("click",function(S){o._rootToNode(w.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";B0(u,c)}}i=!0}})})},t.prototype._rootToNode=function(r){r!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:l2,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}(gt),Xhe=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};R8(i);var a=this._levelModels=ae(r.levels||[],function(l){return new qe(l,this,n)},this),o=Lk.createTree(i,this,s);function s(l){l.wrapMethod("getItemModel",function(u,c){var h=o.getNodeByDataIndex(c),f=a[h.depth];return f&&(u.parentModel=f),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=Ox(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(){FW(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}(bt);function R8(e){var t=0;j(e.children,function(n){R8(n);var i=n.value;re(i)&&(i=i[0]),t+=i});var r=e.value;re(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=t),r<0&&(r=0),re(e.value)?e.value[0]=r:e.value=r}var JR=Math.PI/180;function qhe(e,t,r){t.eachSeriesByType(e,function(n){var i=n.get("center"),a=n.get("radius");re(a)||(a=[0,a]),re(i)||(i=[i,i]);var o=r.getWidth(),s=r.getHeight(),l=Math.min(o,s),u=ce(i[0],o),c=ce(i[1],s),h=ce(a[0],l/2),f=ce(a[1],l/2),d=-n.get("startAngle")*JR,g=n.get("minAngle")*JR,m=n.getData().tree.root,y=n.getViewRoot(),_=y.depth,x=n.get("sort");x!=null&&O8(y,x);var w=0;j(y.children,function(W){!isNaN(W.getValue())&&w++});var S=y.getValue(),T=Math.PI/(S||w)*2,M=y.depth>0,A=y.height-(M?-1:1),P=(f-h)/(A||1),I=n.get("clockwise"),N=n.get("stillShowZeroSum"),D=I?1:-1,O=function(W,V){if(W){var z=V;if(W!==m){var Z=W.getValue(),U=S===0&&N?T:Z*T;U1;)o=o.parentNode;var s=i.getColorFromPalette(o.name||o.dataIndex+"",t);return n.depth>1&&he(s)&&(s=T0(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");Q(u,l)})})}function Qhe(e){e.registerChartView(Yhe),e.registerSeriesModel(Xhe),e.registerLayout(Fe(qhe,"sunburst")),e.registerProcessor(Fe(Cf,"sunburst")),e.registerVisual(Jhe),$he(e)}var QR={color:"fill",borderColor:"stroke"},efe={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},Eo=Ye(),tfe=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 no(null,this)},t.prototype.getDataParams=function(r,n,i){var a=e.prototype.getDataParams.call(this,r,n);return i&&(a.info=Eo(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}(bt);function rfe(e,t){return t=t||[0,0],ae(["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 nfe(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:fe(rfe,e)}}}function ife(e,t){return t=t||[0,0],ae([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 afe(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:fe(ife,e)}}}function ofe(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 sfe(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:fe(ofe,e)}}}function lfe(e,t){return t=t||[0,0],ae(["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 ufe(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:fe(lfe,e)}}}function cfe(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 hfe(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 z8(e,t,r,n){return e&&(e.legacy||e.legacy!==!1&&!r&&!n&&t!=="tspan"&&(t==="text"||ge(e,"text")))}function B8(e,t,r){var n=e,i,a,o;if(t==="text")o=n;else{o={},ge(n,"text")&&(o.text=n.text),ge(n,"rich")&&(o.rich=n.rich),ge(n,"textFill")&&(o.fill=n.textFill),ge(n,"textStroke")&&(o.stroke=n.textStroke),ge(n,"fontFamily")&&(o.fontFamily=n.fontFamily),ge(n,"fontSize")&&(o.fontSize=n.fontSize),ge(n,"fontStyle")&&(o.fontStyle=n.fontStyle),ge(n,"fontWeight")&&(o.fontWeight=n.fontWeight),a={type:"text",style:o,silent:!0},i={};var s=ge(n,"textPosition");r?i.position=s?n.textPosition:"inside":s&&(i.position=n.textPosition),ge(n,"textPosition")&&(i.position=n.textPosition),ge(n,"textOffset")&&(i.offset=n.textOffset),ge(n,"textRotation")&&(i.rotation=n.textRotation),ge(n,"textDistance")&&(i.distance=n.textDistance)}return eO(o,e),j(o.rich,function(l){eO(l,l)}),{textConfig:i,textContent:a}}function eO(e,t){t&&(t.font=t.textFont||t.font,ge(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),ge(t,"textAlign")&&(e.align=t.textAlign),ge(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),ge(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),ge(t,"textWidth")&&(e.width=t.textWidth),ge(t,"textHeight")&&(e.height=t.textHeight),ge(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),ge(t,"textPadding")&&(e.padding=t.textPadding),ge(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),ge(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),ge(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),ge(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),ge(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),ge(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),ge(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function tO(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;rO(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,j(t.rich,function(s){rO(s,s)}),n}function rO(e,t){t&&(ge(t,"fill")&&(e.textFill=t.fill),ge(t,"stroke")&&(e.textStroke=t.fill),ge(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),ge(t,"font")&&(e.font=t.font),ge(t,"fontStyle")&&(e.fontStyle=t.fontStyle),ge(t,"fontWeight")&&(e.fontWeight=t.fontWeight),ge(t,"fontSize")&&(e.fontSize=t.fontSize),ge(t,"fontFamily")&&(e.fontFamily=t.fontFamily),ge(t,"align")&&(e.textAlign=t.align),ge(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),ge(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),ge(t,"width")&&(e.textWidth=t.width),ge(t,"height")&&(e.textHeight=t.height),ge(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),ge(t,"padding")&&(e.textPadding=t.padding),ge(t,"borderColor")&&(e.textBorderColor=t.borderColor),ge(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),ge(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),ge(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),ge(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),ge(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),ge(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),ge(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),ge(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),ge(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),ge(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}var F8={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},nO=Qe(F8);Ei(Ya,function(e,t){return e[t]=1,e},{});Ya.join(", ");var d_=["","style","shape","extra"],Xh=Ye();function Yk(e,t,r,n,i){var a=e+"Animation",o=ff(e,n,i)||{},s=Xh(t).userDuring;return o.duration>0&&(o.during=s?fe(gfe,{el:t,userDuring:s}):null,o.setToFinal=!0,o.scope=e),Q(o,r[a]),o}function By(e,t,r,n){n=n||{};var i=n.dataIndex,a=n.isInit,o=n.clearStyle,s=r.isAnimationEnabled(),l=Xh(e),u=t.style;l.userDuring=t.during;var c={},h={};if(yfe(e,t,h),e.type==="compound")for(var f=e.shape.paths,d=t.shape.paths,g=0;g0&&e.animateFrom(y,_)}else dfe(e,t,i||0,r,c);V8(e,t),u?e.dirty():e.markRedraw()}function V8(e,t){for(var r=Xh(e).leaveToProps,n=0;n0&&e.animateFrom(i,a)}}function vfe(e,t){ge(t,"silent")&&(e.silent=t.silent),ge(t,"ignore")&&(e.ignore=t.ignore),e instanceof Ri&&ge(t,"invisible")&&(e.invisible=t.invisible),e instanceof Ke&&ge(t,"autoBatch")&&(e.autoBatch=t.autoBatch)}var Aa={},pfe={setTransform:function(e,t){return Aa.el[e]=t,this},getTransform:function(e){return Aa.el[e]},setShape:function(e,t){var r=Aa.el,n=r.shape||(r.shape={});return n[e]=t,r.dirtyShape&&r.dirtyShape(),this},getShape:function(e){var t=Aa.el.shape;if(t)return t[e]},setStyle:function(e,t){var r=Aa.el,n=r.style;return n&&(n[e]=t,r.dirtyStyle&&r.dirtyStyle()),this},getStyle:function(e){var t=Aa.el.style;if(t)return t[e]},setExtra:function(e,t){var r=Aa.el.extra||(Aa.el.extra={});return r[e]=t,this},getExtra:function(e){var t=Aa.el.extra;if(t)return t[e]}};function gfe(){var e=this,t=e.el;if(t){var r=Xh(t).userDuring,n=e.userDuring;if(r!==n){e.el=e.userDuring=null;return}Aa.el=t,n(pfe)}}function iO(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]={}),Tu(l))Q(o,a);else for(var u=Tt(l),c=0;c=0){!o&&(o=n[e]={});for(var d=Qe(a),c=0;c=0)){var f=e.getAnimationStyleProps(),d=f?f.style:null;if(d){!a&&(a=n.style={});for(var g=Qe(r),u=0;u=0?t.getStore().get(z,W):void 0}var Z=t.get(V.name,W),U=V&&V.ordinalMeta;return U?U.categories[Z]:Z}function A(H,W){W==null&&(W=c);var V=t.getItemVisual(W,"style"),z=V&&V.fill,Z=V&&V.opacity,U=w(W,Ns).getItemStyle();z!=null&&(U.fill=z),Z!=null&&(U.opacity=Z);var $={inheritColor:he(z)?z:K.color.neutral99},Y=S(W,Ns),te=Ct(Y,null,$,!1,!0);te.text=Y.getShallow("show")?be(e.getFormattedLabel(W,Ns),Uh(t,W)):null;var ie=R0(Y,$,!1);return N(H,U),U=tO(U,te,ie),H&&I(U,H),U.legacy=!0,U}function P(H,W){W==null&&(W=c);var V=w(W,jo).getItemStyle(),z=S(W,jo),Z=Ct(z,null,null,!0,!0);Z.text=z.getShallow("show")?zn(e.getFormattedLabel(W,jo),e.getFormattedLabel(W,Ns),Uh(t,W)):null;var U=R0(z,null,!0);return N(H,V),V=tO(V,Z,U),H&&I(V,H),V.legacy=!0,V}function I(H,W){for(var V in W)ge(W,V)&&(H[V]=W[V])}function N(H,W){H&&(H.textFill&&(W.textFill=H.textFill),H.textPosition&&(W.textPosition=H.textPosition))}function D(H,W){if(W==null&&(W=c),ge(QR,H)){var V=t.getItemVisual(W,"style");return V?V[QR[H]]:null}if(ge(efe,H))return t.getItemVisual(W,H)}function O(H){if(o.type==="cartesian2d"){var W=o.getBaseAxis();return Cre(Ae({axis:W},H))}}function R(){return r.getCurrentSeriesIndices()}function F(H){return wA(H,r)}}function Lfe(e){var t={};return j(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 Yw(e,t,r,n,i,a,o){if(!n){a.remove(t);return}var s=Qk(e,t,r,n,i,a);return s&&o.setItemGraphicEl(r,s),s&&Dt(s,n.focus,n.blurScope,n.emphasisDisabled),s}function Qk(e,t,r,n,i,a){var o=-1,s=t;t&&U8(t,n,i)&&(o=Ve(a.childrenRef(),t),t=null);var l=!t,u=t;u?u.clearStates():(u=Kk(n),s&&Tfe(s,u)),n.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),n.tooltipDisabled&&(u.tooltipDisabled=!0),pi.normal.cfg=pi.normal.conOpt=pi.emphasis.cfg=pi.emphasis.conOpt=pi.blur.cfg=pi.blur.conOpt=pi.select.cfg=pi.select.conOpt=null,pi.isLegacy=!1,Pfe(u,r,n,i,l,pi),Nfe(u,r,n,i,l),Jk(e,u,r,n,pi,i,l),ge(n,"info")&&(Eo(u).info=n.info);for(var c=0;c=0?a.replaceAt(u,o):a.add(u),u}function U8(e,t,r){var n=Eo(e),i=t.type,a=t.shape,o=t.style;return r.isUniversalTransitionEnabled()||i!=null&&i!==n.customGraphicType||i==="path"&&Rfe(a)&&Z8(a)!==n.customPathData||i==="image"&&ge(o,"image")&&o.image!==n.customImagePath}function Nfe(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&&U8(o,a,n)&&(o=null),o||(o=Kk(a),e.setClipPath(o)),Jk(null,o,t,a,null,n,i)}}function Pfe(e,t,r,n,i,a){if(!(e.isGroup||e.type==="compoundPath")){oO(r,null,a),oO(r,jo,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=Kk(o),e.setTextContent(c)),Jk(null,c,t,o,null,n,i);for(var h=o&&o.style,f=0;f=c;d--){var g=t.childAt(d);Dfe(t,g,i)}}}function Dfe(e,t,r){t&&Fx(t,Eo(e).option,r)}function Efe(e){new Zo(e.oldChildren,e.newChildren,sO,sO,e).add(lO).update(lO).remove(jfe).execute()}function sO(e,t){var r=e&&e.name;return r??Sfe+t}function lO(e,t){var r=this.context,n=e!=null?r.newChildren[e]:null,i=t!=null?r.oldChildren[t]:null;Qk(r.api,i,r.dataIndex,n,r.seriesModel,r.group)}function jfe(e){var t=this.context,r=t.oldChildren[e];r&&Fx(r,Eo(r).option,t.seriesModel)}function Z8(e){return e&&(e.pathData||e.d)}function Rfe(e){return e&&(ge(e,"pathData")||ge(e,"d"))}function Ofe(e){e.registerChartView(Mfe),e.registerSeriesModel(tfe)}var iu=Ye(),uO=Se,Xw=fe,tL=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 h=this._moveAnimation=this.determineAnimation(t,r);if(!s)s=this._group=new Ce,this.createPointerEl(s,u,t,r),this.createLabelEl(s,u,t,r),n.getZr().add(s);else{var f=Fe(cO,r,h);this.updatePointerEl(s,u,f),this.updateLabelEl(s,u,f,r)}fO(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=wk(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=iu(t).pointerEl=new Ku[a.type](uO(r.pointer));t.add(o)}},e.prototype.createLabelEl=function(t,r,n,i){if(r.label){var a=iu(t).labelEl=new tt(uO(r.label));t.add(a),hO(a,i)}},e.prototype.updatePointerEl=function(t,r,n){var i=iu(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=iu(t).labelEl;a&&(a.setStyle(r.label.style),n(a,{x:r.label.x,y:r.label.y}),hO(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=df(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){Wo(u.event)},onmousedown:Xw(this._onHandleDragMove,this,0,0),drift:Xw(this._onHandleDragMove,this),ondragend:Xw(this._onHandleDragEnd,this)}),n.add(i)),fO(i,r,!1),i.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");re(l)||(l=[l,l]),i.scaleX=l[0]/2,i.scaleY=l[1]/2,_f(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,s)}},e.prototype._moveHandleToValue=function(t,r){cO(this._axisPointerModel,!r&&this._moveAnimation,this._handle,qw(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(qw(n),[t,r],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(qw(i)),iu(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),lp(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 cO(e,t,r,n){$8(iu(r).lastProp,n)||(iu(r).lastProp=n,t?it(r,n,e):(r.stopAnimation(),r.attr(n)))}function $8(e,t){if(ke(e)&&ke(t)){var r=!0;return j(t,function(n,i){r=r&&$8(e[i],n)}),!!r}else return e===t}function hO(e,t){e[t.get(["label","show"])?"show":"hide"]()}function qw(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function fO(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 rL(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 Y8(e,t,r,n,i){var a=r.get("value"),o=X8(a,t.axis,t.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=gf(s.get("padding")||0),u=s.getFont(),c=ux(o,u),h=i.position,f=c.width+l[1]+l[3],d=c.height+l[0]+l[2],g=i.align;g==="right"&&(h[0]-=f),g==="center"&&(h[0]-=f/2);var m=i.verticalAlign;m==="bottom"&&(h[1]-=d),m==="middle"&&(h[1]-=d/2),zfe(h,f,d,n);var y=s.get("backgroundColor");(!y||y==="auto")&&(y=t.get(["axisLine","lineStyle","color"])),e.label={x:h[0],y:h[1],style:Ct(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:y}),z2:10}}function zfe(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 X8(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:q0(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};j(n,function(l){var u=r.getSeriesByIndex(l.seriesIndex),c=l.dataIndexInside,h=u&&u.getDataParams(c);h&&s.seriesData.push(h)}),he(o)?a=o.replace("{value}",a):we(o)&&(a=o(s))}return a}function nL(e,t,r){var n=Pr();return Ko(n,n,r.rotation),ha(n,n,r.position),sa([e.dataToCoord(t),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function q8(e,t,r,n,i,a){var o=wn.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=i.get(["label","margin"]),Y8(t,n,i,a,{position:nL(n.axis,e,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function iL(e,t,r){return r=r||0,{x1:e[r],y1:e[1-r],x2:t[r],y2:t[1-r]}}function K8(e,t,r){return r=r||0,{x:e[r],y:e[1-r],width:t[r],height:t[1-r]}}function dO(e,t,r,n,i,a){return{cx:e,cy:t,r0:r,r:n,startAngle:i,endAngle:a,clockwise:!0}}var Bfe=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=vO(l,s).getOtherAxis(s).getGlobalExtent(),h=s.toGlobalCoord(s.dataToCoord(n,!0));if(u&&u!=="none"){var f=rL(a),d=Ffe[u](s,h,c);d.style=f,r.graphicKey=d.type,r.pointer=d}var g=o_(l.getRect(),i);q8(n,r,g,i,a,o)},t.prototype.getHandleTransform=function(r,n,i){var a=o_(n.axis.grid.getRect(),n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=nL(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=vO(s,o).getOtherAxis(o).getGlobalExtent(),c=o.dim==="x"?0:1,h=[r.x,r.y];h[c]+=n[c],h[c]=Math.min(l[1],h[c]),h[c]=Math.max(l[0],h[c]);var f=(u[1]+u[0])/2,d=[f,f];d[c]=h[c];var g=[{verticalAlign:"middle"},{align:"center"}];return{x:h[0],y:h[1],rotation:r.rotation,cursorPoint:d,tooltipOption:g[c]}},t}(tL);function vO(e,t){var r={};return r[t.dim+"AxisIndex"]=t.index,e.getCartesian(r)}var Ffe={line:function(e,t,r){var n=iL([t,r[0]],[t,r[1]],pO(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:K8([t-n/2,r[0]],[n,i],pO(e))}}};function pO(e){return e.dim==="x"?0:1}var Vfe=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}($e),Lo=Ye(),Gfe=j;function J8(e,t,r){if(!Je.node){var n=t.getZr();Lo(n).records||(Lo(n).records={}),Wfe(n,t);var i=Lo(n).records[e]||(Lo(n).records[e]={});i.handler=r}}function Wfe(e,t){if(Lo(e).initialized)return;Lo(e).initialized=!0,r("click",Fe(gO,"click")),r("mousemove",Fe(gO,"mousemove")),r("globalout",Ufe);function r(n,i){e.on(n,function(a){var o=Zfe(t);Gfe(Lo(e).records,function(s){s&&i(s,a,o.dispatchAction)}),Hfe(o.pendings,t)})}}function Hfe(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 Ufe(e,t,r){e.handler("leave",null,r)}function gO(e,t,r,n){t.handler(e,r,n)}function Zfe(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 h2(e,t){if(!Je.node){var r=t.getZr(),n=(Lo(r).records||{})[e];n&&(Lo(r).records[e]=null)}}var $fe=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";J8("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){h2("axisPointer",n)},t.prototype.dispose=function(r,n){h2("axisPointer",n)},t.type="axisPointer",t}(Mt);function Q8(e,t){var r=[],n=e.seriesIndex,i;if(n==null||!(i=t.getSeriesByIndex(n)))return{point:[]};var a=i.getData(),o=Ru(a,e);if(o==null||o<0||re(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),h=c.dim,f=u.dim,d=h==="x"||h==="radius"?1:0,g=a.mapDimension(f),m=[];m[d]=a.get(g,o),m[1-d]=a.get(a.getCalculationInfo("stackResultDimension"),o),r=l.dataToPoint(m)||[]}else r=l.dataToPoint(a.getValues(ae(l.dimensions,function(_){return a.mapDimension(_)}),o))||[];else if(s){var y=s.getBoundingRect().clone();y.applyTransform(s.transform),r=[y.x+y.width/2,y.y+y.height/2]}return{point:r,el:s}}var mO=Ye();function Yfe(e,t,r){var n=e.currTrigger,i=[e.x,e.y],a=e,o=e.dispatchAction||fe(r.dispatchAction,r),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){Fy(i)&&(i=Q8({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var l=Fy(i),u=a.axesInfo,c=s.axesInfo,h=n==="leave"||Fy(i),f={},d={},g={list:[],map:{}},m={showPointer:Fe(qfe,d),showTooltip:Fe(Kfe,g)};j(s.coordSysMap,function(_,x){var w=l||_.containPoint(i);j(s.coordSysAxesInfo[x],function(S,T){var M=S.axis,A=tde(u,S);if(!h&&w&&(!u||A)){var P=A&&A.value;P==null&&!l&&(P=M.pointToData(i)),P!=null&&yO(S,P,m,!1,f)}})});var y={};return j(c,function(_,x){var w=_.linkGroup;w&&!d[x]&&j(w.axesInfo,function(S,T){var M=d[T];if(S!==_&&M){var A=M.value;w.mapper&&(A=_.axis.scale.parse(w.mapper(A,_O(S),_O(_)))),y[_.key]=A}})}),j(y,function(_,x){yO(c[x],_,m,!0,f)}),Jfe(d,c,f),Qfe(g,i,e,o),ede(c,o,r),f}}function yO(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=Xfe(t,e),s=o.payloadBatch,l=o.snapToValue;s[0]&&i.seriesIndex==null&&Q(i,s[0]),!n&&e.snap&&a.containData(l)&&l!=null&&(t=l),r.showPointer(e,t,s),r.showTooltip(e,o,l)}}function Xfe(e,t){var r=t.axis,n=r.dim,i=e,a=[],o=Number.MAX_VALUE,s=-1;return j(t.seriesModels,function(l,u){var c=l.getData().mapDimensionsAll(n),h,f;if(l.getAxisTooltipData){var d=l.getAxisTooltipData(c,e,r);f=d.dataIndices,h=d.nestestValue}else{if(f=l.indicesOfNearest(n,c[0],e,r.type==="category"?.5:null),!f.length)return;h=l.getData().get(c[0],f[0])}if(!(h==null||!isFinite(h))){var g=e-h,m=Math.abs(g);m<=o&&((m=0&&s<0)&&(o=m,s=g,i=h,a.length=0),j(f,function(y){a.push({seriesIndex:l.seriesIndex,dataIndexInside:y,dataIndex:l.getData().getRawIndex(y)})}))}}),{payloadBatch:a,snapToValue:i}}function qfe(e,t,r,n){e[t.key]={value:r,payloadBatch:n}}function Kfe(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=mp(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 Jfe(e,t,r){var n=r.axesInfo=[];j(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 Qfe(e,t,r,n){if(Fy(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 ede(e,t,r){var n=r.getZr(),i="axisPointerLastHighlights",a=mO(n)[i]||{},o=mO(n)[i]={};j(e,function(u,c){var h=u.axisPointerModel.option;h.status==="show"&&u.triggerEmphasis&&j(h.seriesDataIndices,function(f){var d=f.seriesIndex+" | "+f.dataIndex;o[d]=f})});var s=[],l=[];j(a,function(u,c){!o[c]&&l.push(u)}),j(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 tde(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 _O(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 Fy(e){return!e||e[0]==null||isNaN(e[0])||e[1]==null||isNaN(e[1])}function tg(e){tc.registerAxisPointerClass("CartesianAxisPointer",Bfe),e.registerComponentModel(Vfe),e.registerComponentView($fe),e.registerPreprocessor(function(t){if(t){(!t.axisPointer||t.axisPointer.length===0)&&(t.axisPointer={});var r=t.axisPointer.link;r&&!re(r)&&(t.axisPointer.link=[r])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,function(t,r){t.getComponent("axisPointer").coordSysAxesInfo=roe(t,r)}),e.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},Yfe)}function rde(e){He(SW),He(tg)}var nde=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(),h=s.dataToCoord(n),f=a.get("type");if(f&&f!=="none"){var d=rL(a),g=ade[f](s,l,h,c);g.style=d,r.graphicKey=g.type,r.pointer=g}var m=a.get(["label","margin"]),y=ide(n,i,a,l,m);Y8(r,i,a,o,y)},t}(tL);function ide(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,h;if(a.dim==="radius"){var f=Pr();Ko(f,f,s),ha(f,f,[n.cx,n.cy]),u=sa([o,-i],f);var d=t.getModel("axisLabel").get("rotate")||0,g=wn.innerTextLayout(s,d*Math.PI/180,-1);c=g.textAlign,h=g.textVerticalAlign}else{var m=l[1];u=n.coordToPoint([m+i,o]);var y=n.cx,_=n.cy;c=Math.abs(u[0]-y)/m<.3?"center":u[0]>y?"left":"right",h=Math.abs(u[1]-_)/m<.3?"middle":u[1]>_?"top":"bottom"}return{position:u,align:c,verticalAlign:h}}var ade={line:function(e,t,r,n){return e.dim==="angle"?{type:"Line",shape:iL(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:dO(t.cx,t.cy,n[0],n[1],(-r-i/2)*a,(-r+i/2)*a)}:{type:"Sector",shape:dO(t.cx,t.cy,r-i/2,r+i/2,0,Math.PI*2)}}},ode=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}($e),aL=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",Ht).models[0]},t.type="polarAxis",t}($e);Qt(aL,Sf);var sde=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}(aL),lde=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}(aL),oL=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}(Vi);oL.prototype.dataToRadius=Vi.prototype.dataToCoord;oL.prototype.radiusToData=Vi.prototype.coordToData;var ude=Ye(),sL=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=ux(s==null?"":s+"",n.getFont(),"center","top"),h=Math.max(c.height,7),f=h/u;isNaN(f)&&(f=1/0);var d=Math.max(0,Math.floor(f)),g=ude(r.model),m=g.lastAutoInterval,y=g.lastTickCount;return m!=null&&y!=null&&Math.abs(m-d)<=1&&Math.abs(y-o)<=1&&m>d?d=m:(g.lastTickCount=o,g.lastAutoInterval=d),d},t}(Vi);sL.prototype.dataToAngle=Vi.prototype.dataToCoord;sL.prototype.angleToData=Vi.prototype.coordToData;var eH=["radius","angle"],cde=function(){function e(t){this.dimensions=eH,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new oL,this._angleAxis=new sL,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,h=u*u+c*c,f=this.r,d=this.r0;return f!==d&&h-o<=f*f&&h+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=xO(r);return i===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,r,n){var i=xO(r);return i===this?this.pointToData(n):null},e}();function xO(e){var t=e.seriesModel,r=e.polarModel;return r&&r.coordinateSystem||t&&t.coordinateSystem}function hde(e,t,r){var n=t.get("center"),i=Tr(t,r).refContainer;e.cx=ce(n[0],i.width)+i.x,e.cy=ce(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%"]:re(s)||(s=[0,s]);var l=[ce(s[0],o),ce(s[1],o)];a.inverse?a.setExtent(l[1],l[0]):a.setExtent(l[0],l[1])}function fde(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();j(K0(l,"radius"),function(u){i.scale.unionExtentFromData(l,u)}),j(K0(l,"angle"),function(u){n.scale.unionExtentFromData(l,u)})}}),Gu(n.scale,n.model),Gu(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 dde(e){return e.mainType==="angleAxis"}function bO(e,t){var r;if(e.type=t.get("type"),e.scale=Xp(t),e.onBand=t.get("boundaryGap")&&e.type==="category",e.inverse=t.get("inverse"),dde(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 vde={dimensions:eH,create:function(e,t){var r=[];return e.eachComponent("polar",function(n,i){var a=new cde(i+"");a.update=fde;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=n.findAxisModel("radiusAxis"),u=n.findAxisModel("angleAxis");bO(o,l),bO(s,u),hde(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",Ht).models[0];n.coordinateSystem=i.coordinateSystem}}),r}},pde=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function Ym(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 Xm(e){var t=e.getRadiusAxis();return t.inverse?0:1}function wO(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 gde=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=ae(i.getViewLabels(),function(c){c=Se(c);var h=i.scale,f=h.type==="ordinal"?h.getRawOrdinalNumber(c.tickValue):c.tickValue;return c.coord=i.dataToCoord(f),c});wO(u),wO(s),j(pde,function(c){r.get([c,"show"])&&(!i.scale.isBlank()||c==="axisLine")&&mde[c](this.group,r,a,s,l,o,u)},this)}},t.type="angleAxis",t}(tc),mde={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=Xm(r),h=c?0:1,f,d=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[h]===0?f=new Ku[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}):f=new cf({shape:{cx:r.cx,cy:r.cy,r:a[c],r0:a[h]},style:o.getLineStyle(),z2:1,silent:!0}),f.style.fill=null,e.add(f)},axisTick:function(e,t,r,n,i,a){var o=t.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[Xm(r)],u=ae(n,function(c){return new ar({shape:Ym(r,[l,l+s],c.coord)})});e.add(qn(u,{style:Ae(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[Xm(r)],c=[],h=0;h_?"left":"right",S=Math.abs(y[1]-x)/m<.3?"middle":y[1]>x?"top":"bottom";if(s&&s[g]){var T=s[g];ke(T)&&T.textStyle&&(d=new qe(T.textStyle,l,l.ecModel))}var M=new tt({silent:wn.isLabelSilent(t),style:Ct(d,{x:y[0],y:y[1],fill:d.getTextColor()||t.get(["axisLine","lineStyle","color"]),text:h.formattedLabel,align:w,verticalAlign:S})});if(e.add(M),Qo({el:M,componentModel:t,itemName:h.formattedLabel,formatterParamsExtra:{isTruncated:function(){return M.isTruncated},value:h.rawLabel,tickIndex:f}}),c){var A=wn.makeAxisEventDataBase(t);A.targetType="axisLabel",A.value=h.rawLabel,De(M).eventData=A}},this)},splitLine:function(e,t,r,n,i,a){var o=t.getModel("splitLine"),s=o.getModel("lineStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var c=[],h=0;h=0?"p":"n",H=I;T&&(n[c][R]||(n[c][R]={p:I,n:I}),H=n[c][R][F]);var W=void 0,V=void 0,z=void 0,Z=void 0;if(g.dim==="radius"){var U=g.dataToCoord(O)-I,$=l.dataToCoord(R);Math.abs(U)<_&&(U=(U<0?-1:1)*_),W=H,V=H+U,z=$-f,Z=z-d,T&&(n[c][R][F]=V)}else{var Y=g.dataToCoord(O,M)-I,te=l.dataToCoord(R);Math.abs(Y)=Z})}}})}function Sde(e){var t={};j(e,function(n,i){var a=n.getData(),o=n.coordinateSystem,s=o.getBaseAxis(),l=rH(o,s),u=s.getExtent(),c=s.type==="category"?s.getBandWidth():Math.abs(u[1]-u[0])/a.count(),h=t[l]||{bandWidth:c,remainedWidth:c,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},f=h.stacks;t[l]=h;var d=tH(n);f[d]||h.autoWidthCount++,f[d]=f[d]||{width:0,maxWidth:0};var g=ce(n.get("barWidth"),c),m=ce(n.get("barMaxWidth"),c),y=n.get("barGap"),_=n.get("barCategoryGap");g&&!f[d].width&&(g=Math.min(h.remainedWidth,g),f[d].width=g,h.remainedWidth-=g),m&&(f[d].maxWidth=m),y!=null&&(h.gap=y),_!=null&&(h.categoryGap=_)});var r={};return j(t,function(n,i){r[i]={};var a=n.stacks,o=n.bandWidth,s=ce(n.categoryGap,o),l=ce(n.gap,1),u=n.remainedWidth,c=n.autoWidthCount,h=(u-s)/(c+(c-1)*l);h=Math.max(h,0),j(a,function(m,y){var _=m.maxWidth;_&&_=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=SO(r);return i===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,r,n){var i=SO(r);return i===this?this.pointToData(n):null},e}();function SO(e){var t=e.seriesModel,r=e.singleAxisModel;return r&&r.coordinateSystem||t&&t.coordinateSystem}function Dde(e,t){var r=[];return e.eachComponent("singleAxis",function(n,i){var a=new Ide(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",Ht).models[0];n.coordinateSystem=i&&i.coordinateSystem}}),r}var Ede={create:Dde,dimensions:nH},CO=["x","y"],jde=["width","height"],Rde=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=Kw(l,1-g_(s)),c=l.dataToPoint(n)[0],h=a.get("type");if(h&&h!=="none"){var f=rL(a),d=Ode[h](s,c,u);d.style=f,r.graphicKey=d.type,r.pointer=d}var g=f2(i);q8(n,r,g,i,a,o)},t.prototype.getHandleTransform=function(r,n,i){var a=f2(n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=nL(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=g_(o),u=Kw(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 h=Kw(s,1-l),f=(h[1]+h[0])/2,d=[f,f];return d[l]=c[l],{x:c[0],y:c[1],rotation:r.rotation,cursorPoint:d,tooltipOption:{verticalAlign:"middle"}}},t}(tL),Ode={line:function(e,t,r){var n=iL([t,r[0]],[t,r[1]],g_(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:K8([t-n/2,r[0]],[n,i],g_(e))}}};function g_(e){return e.isHorizontal()?0:1}function Kw(e,t){var r=e.getRect();return[r[CO[t]],r[CO[t]]+r[jde[t]]]}var zde=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}(Mt);function Bde(e){He(tg),tc.registerAxisPointerClass("SingleAxisPointer",Rde),e.registerComponentView(zde),e.registerComponentView(Lde),e.registerComponentModel(Vy),Zh(e,"single",Vy,Vy.defaultOption),e.registerCoordinateSystem("single",Ede)}var Fde=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=Ju(r);e.prototype.init.apply(this,arguments),TO(r,a)},t.prototype.mergeOption=function(r){e.prototype.mergeOption.apply(this,arguments),TO(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}($e);function TO(e,t){var r=e.cellSize,n;re(r)?n=r:n=e.cellSize=[r,r],n.length===1&&(n[1]=n[0]);var i=ae([0,1],function(a){return lQ(t,a)&&(n[a]="auto"),n[a]!=null&&n[a]!=="auto"});Ka(e,t,{type:"box",ignoreSize:i})}var Vde=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,h=new Ze({shape:{x:c[0],y:c[1],width:s,height:l},cursor:"default",style:o});i.add(h)}},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 h=n.start,f=0;h.time<=n.end.time;f++){g(h.formatedDate),f===0&&(h=s.getDateInfo(n.start.y+"-"+n.start.m));var d=h.date;d.setMonth(d.getMonth()+1),h=s.getDateInfo(d)}g(s.getNextNDay(n.end.time,1).formatedDate);function g(m){o._firstDayOfMonth.push(s.getDateInfo(m)),o._firstDayPoints.push(s.dataToCalendarLayout([m],!1).tl);var y=o._getLinePointsOfOneWeek(r,m,i);o._tlpoints.push(y[0]),o._blpoints.push(y[y.length-1]),u&&o._drawSplitline(y,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 Gr({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 he(r)&&r?tQ(r,n):we(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,h=(u[0][1]+u[1][1])/2,f=i==="horizontal"?0:1,d={top:[c,u[f][1]],bottom:[c,u[1-f][1]],left:[u[1-f][0],h],right:[u[f][0],h]},g=n.start.y;+n.end.y>+n.start.y&&(g=g+"-"+n.end.y);var m=o.get("formatter"),y={start:n.start.y,end:n.end.y,nameMap:g},_=this._formatterLabel(m,y),x=new tt({z2:30,style:Ct(o,{text:_}),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"),h=[this._tlpoints,this._blpoints];(!s||he(s))&&(s&&(n=sT(s)||n),s=n.get(["time","monthAbbr"])||[]);var f=u==="start"?0:1,d=i==="horizontal"?0:1;l=u==="start"?-l:l;for(var g=c==="center",m=o.get("silent"),y=0;y=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/Jw)-Math.floor(r[0].time/Jw)+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),h=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:h,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){$p({targetModel:a,coordSysType:"calendar",coordSysProvider:wV})}),n},e.dimensions=["time","value"],e}();function Qw(e){var t=e.calendarModel,r=e.seriesModel,n=t?t.coordinateSystem:r?r.coordinateSystem:null;return n}function Wde(e){e.registerComponentModel(Fde),e.registerComponentView(Vde),e.registerCoordinateSystem("calendar",Gde)}var wo={level:1,leaf:2,nonLeaf:3},Ro={none:0,all:1,body:2,corner:3};function d2(e,t,r){var n=t[Oe[r]].getCell(e);return!n&&rt(e)&&e<0&&(n=t[Oe[1-r]].getUnitLayoutInfo(r,Math.round(e))),n}function iH(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 aH(e,t,r,n,i){MO(e[0],t,i,r,n,0),MO(e[1],t,i,r,n,1)}function MO(e,t,r,n,i,a){e[0]=1/0,e[1]=-1/0;var o=n[a],s=re(o)?o:[o],l=s.length,u=!!r;if(l>=1?(AO(e,t,s,u,i,a,0),l>1&&AO(e,t,s,u,i,a,l-1)):e[0]=e[1]=NaN,u){var c=-i[Oe[1-a]].getLocatorCount(a),h=i[Oe[a]].getLocatorCount(a)-1;r===Ro.body?c=nr(0,c):r===Ro.corner&&(h=ni(-1,h)),h=t[0]&&e[0]<=t[1]}function NO(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 Zde(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 PO(e,t,r,n){var i=d2(t[n][0],r,n),a=d2(t[n][1],r,n);e[Oe[n]]=e[pr[n]]=NaN,i&&a&&(e[Oe[n]]=i.xy,e[pr[n]]=a.xy+a.wh-i.xy)}function Nd(e,t,r,n){return e[Oe[t]]=r,e[Oe[1-t]]=n,e}function $de(e){return e&&(e.type===wo.leaf||e.type===wo.nonLeaf)?e:null}function m_(){return{x:NaN,y:NaN,width:NaN,height:NaN}}var IO=function(){function e(t,r){this._cells=[],this._levels=[],this.dim=t,this.dimIdx=t==="x"?0:1,this._model=r,this._uniqueValueGen=Yde(t);var n=r.get("data",!0);n!=null&&!re(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,h){var f=0;return u&&j(u,function(d,g){var m;he(d)?m={value:d}:ke(d)?(m=d,d.value!=null&&!he(d.value)&&(m={value:null})):m={value:null};var y={type:wo.nonLeaf,ordinal:NaN,level:h,firstLeafLocator:c,id:new Ne,span:Nd(new Ne,r.dimIdx,1,1),option:m,xy:NaN,wh:NaN,dim:r,rect:m_()};o++,(a[c]||(a[c]=[])).push(y),i[h]||(i[h]={type:wo.level,xy:NaN,wh:NaN,option:null,id:new Ne,dim:r});var _=s(m.children,c,h+1),x=Math.max(1,_);y.span[Oe[r.dimIdx]]=x,f+=x,c+=x}),f}function l(){for(var u=[];n.length=1,w=r[Oe[n]],S=a.getLocatorCount(n)-1,T=new Ws;for(o.resetLayoutIterator(T,n);T.next();)M(T.item);for(a.resetLayoutIterator(T,n);T.next();)M(T.item);function M(A){Xr(A.wh)&&(A.wh=_),A.xy=w,A.id[Oe[n]]===S&&!x&&(A.wh=r[Oe[n]]+r[pr[n]]-A.xy),w+=A.wh}}function BO(e,t){for(var r=t[Oe[e]].resetCellIterator();r.next();){var n=r.item;y_(n.rect,e,n.id,n.span,t),y_(n.rect,1-e,n.id,n.span,t),n.type===wo.nonLeaf&&(n.xy=n.rect[Oe[e]],n.wh=n.rect[pr[e]])}}function FO(e,t){e.travelExistingCells(function(r){var n=r.span;if(n){var i=r.spanRect,a=r.id;y_(i,0,a,n,t),y_(i,1,a,n,t)}})}function y_(e,t,r,n,i){e[pr[t]]=0;var a=r[Oe[t]],o=a<0?i[Oe[1-t]]:i[Oe[t]],s=o.getUnitLayoutInfo(t,r[Oe[t]]);if(e[Oe[t]]=s.xy,e[pr[t]]=s.wh,n[Oe[t]]>1){var l=o.getUnitLayoutInfo(t,r[Oe[t]]+n[Oe[t]]-1);e[pr[t]]=l.xy+l.wh-s.xy}}function sve(e,t,r){var n=P0(e,r[pr[t]]);return p2(n,r[pr[t]])}function p2(e,t){return Math.max(Math.min(e,be(t,1/0)),0)}function rS(e){var t=e.matrixModel,r=e.seriesModel,n=t?t.coordinateSystem:r?r.coordinateSystem:null;return n}var $r={inBody:1,inCorner:2,outside:3},Ta={x:null,y:null,point:[]};function VO(e,t,r,n,i){var a=r[Oe[t]],o=r[Oe[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,h=e.point[t]=n[t];if(!l&&!c){e[Oe[t]]=$r.outside;return}if(i===Ro.body){l?(e[Oe[t]]=$r.inBody,h=ni(s.xy+s.wh,nr(l.xy,h)),e.point[t]=h):e[Oe[t]]=$r.outside;return}else if(i===Ro.corner){c?(e[Oe[t]]=$r.inCorner,h=ni(c.xy+c.wh,nr(u.xy,h)),e.point[t]=h):e[Oe[t]]=$r.outside;return}var f=l?l.xy:c?c.xy+c.wh:NaN,d=u?u.xy:f,g=s?s.xy+s.wh:f;if(hg){if(!i){e[Oe[t]]=$r.outside;return}h=g}e.point[t]=h,e[Oe[t]]=f<=h&&h<=g?$r.inBody:d<=h&&h<=f?$r.inCorner:$r.outside}function GO(e,t,r,n){var i=1-r;if(e[Oe[r]]!==$r.outside)for(n[Oe[r]].resetCellIterator(tS);tS.next();){var a=tS.item;if(HO(e.point[r],a.rect,r)&&HO(e.point[i],a.rect,i)){t[r]=a.ordinal,t[i]=a.id[Oe[i]];return}}}function WO(e,t,r,n){if(e[Oe[r]]!==$r.outside){var i=e[Oe[r]]===$r.inCorner?n[Oe[1-r]]:n[Oe[r]];for(i.resetLayoutIterator(ey,r);ey.next();)if(lve(e.point[r],ey.item)){t[r]=ey.item.id[Oe[r]];return}}}function lve(e,t){return t.xy<=e&&e<=t.xy+t.wh}function HO(e,t,r){return t[Oe[r]]<=e&&e<=t[Oe[r]]+t[pr[r]]}function uve(e){e.registerComponentModel(Jde),e.registerComponentView(nve),e.registerCoordinateSystem("matrix",ove)}function cve(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 UO(e,t){var r;return j(t,function(n){e[n]!=null&&e[n]!=="auto"&&(r=!0)}),r}function hve(e,t,r){var n=Q({},r),i=e[t],a=r.$action||"merge";a==="merge"?i?(Ge(i,n,!0),Ka(i,n,{ignoreSize:!0}),AV(r,i),ty(r,i),ty(r,i,"shape"),ty(r,i,"style"),ty(r,i,"extra"),r.clipPath=i.clipPath):e[t]=n:a==="replace"?e[t]=n:a==="remove"&&i&&(e[t]=null)}var sH=["transition","enterFrom","leaveTo"],fve=sH.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function ty(e,t,r){if(r&&(!e[r]&&t[r]&&(e[r]={}),e=e[r],t=t[r]),!(!e||!t))for(var n=r?sH:fve,i=0;i=0;c--){var h=i[c],f=br(h.id,null),d=f!=null?o.get(f):null;if(d){var g=d.parent,_=xi(g),x=g===a?{width:s,height:l}:{width:_.width,height:_.height},w={},S=Cx(d,h,x,null,{hv:h.hv,boundingMode:h.bounding},w);if(!xi(d).isNew&&S){for(var T=h.transition,M={},A=0;A=0)?M[P]=I:d[P]=I}it(d,M,r,0)}else d.attr(w)}}},t.prototype._clear=function(){var r=this,n=this._elMap;n.each(function(i){Gy(i,xi(i).option,n,r._lastGraphicModel)}),this._elMap=xe()},t.prototype.dispose=function(){this._clear()},t.type="graphic",t}(Mt);function g2(e){var t=ge(ZO,e)?ZO[e]:ip(e),r=new t({});return xi(r).type=e,r}function $O(e,t,r,n){var i=g2(r);return t.add(i),n.set(e,i),xi(i).id=e,xi(i).isNew=!0,i}function Gy(e,t,r,n){var i=e&&e.parent;i&&(e.type==="group"&&e.traverse(function(a){Gy(a,t,r,n)}),Fx(e,t,n),r.removeKey(xi(e).id))}function YO(e,t,r,n){e.isGroup||j([["cursor",Ri.prototype.cursor],["zlevel",n||0],["z",r||0],["z2",0]],function(i){var a=i[0];ge(t,a)?e[a]=be(t[a],i[1]):e[a]==null&&(e[a]=i[1])}),j(Qe(t),function(i){if(i.indexOf("on")===0){var a=t[i];e[i]=we(a)?a:null}}),ge(t,"draggable")&&(e.draggable=t.draggable),t.name!=null&&(e.name=t.name),t.id!=null&&(e.id=t.id)}function gve(e){return e=Q({},e),j(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(SV),function(t){delete e[t]}),e}function mve(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 yve(e){e.registerComponentModel(vve),e.registerComponentView(pve),e.registerPreprocessor(function(t){var r=t.graphic;re(r)?!r[0]||!r[0].elements?t.graphic=[{elements:r}]:t.graphic=[t.graphic[0]]:r&&!r.elements&&(t.graphic=[{elements:[r]}])})}var XO=["x","y","radius","angle","single"],_ve=["cartesian2d","polar","singleAxis"];function xve(e){var t=e.get("coordinateSystem");return Ve(_ve,t)>=0}function Ps(e){return e+"Axis"}function bve(e,t){var r=xe(),n=[],i=xe();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 h=!1;return c.eachTargetAxis(function(f,d){var g=r.get(f);g&&g[d]&&(h=!0)}),h}function u(c){c.eachTargetAxis(function(h,f){(r.get(h)||r.set(h,[]))[f]=!0})}return n}function lH(e){var t=e.ecModel,r={infoList:[],infoMap:xe()};return e.eachTargetAxis(function(n,i){var a=t.getComponent(Ps(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 nS=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}(),Sp=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=qO(r);this.settledOption=a,this.mergeDefaultAndTheme(r,i),this._doInit(a)},t.prototype.mergeOption=function(r){var n=qO(r);Ge(this.option,r,!0),Ge(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;j([["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=xe(),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 j(XO,function(i){var a=this.getReferringComponents(Ps(i),Bq);if(a.specified){n=!0;var o=new nS;j(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 h=u[0];if(h){var f=new nS;if(f.add(h.componentIndex),r.set(c,f),a=!1,c==="x"||c==="y"){var d=h.getReferringComponents("grid",Ht).models[0];d&&j(u,function(g){h.componentIndex!==g.componentIndex&&d===g.getReferringComponents("grid",Ht).models[0]&&f.add(g.componentIndex)})}}}a&&j(XO,function(u){if(a){var c=i.findComponents({mainType:Ps(u),filter:function(f){return f.get("type",!0)==="category"}});if(c[0]){var h=new nS;h.add(c[0].componentIndex),r.set(u,h),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");j([["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(Ps(n),i))},this),r},t.prototype.eachTargetAxis=function(r,n){this._targetAxisInfoMap.each(function(i,a){j(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(Ps(r),n)},t.prototype.setRawRange=function(r){var n=this.option,i=this.settledOption;j([["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;j(["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(w&&!S&&!T)return!0;w&&(y=!0),S&&(g=!0),T&&(m=!0)}return y&&g&&m})}else Uc(c,function(d){if(a==="empty")l.setData(u=u.map(d,function(m){return s(m)?m:NaN}));else{var g={};g[d]=o,u.selectRange(g)}});Uc(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;Uc(["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=ht(n[0]+o,n,[0,100],!0):a!=null&&(o=ht(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=QM(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 Tve(e,t,r){var n=[1/0,-1/0];Uc(r,function(o){Wre(n,o.getData(),t)});var i=e.getAxisModel(),a=sG(i.axis.scale,i,n).calculate();return[a.min,a.max]}var Mve={getTargetSeries:function(e){function t(i){e.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=e.getComponent(Ps(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 Cve(i,a,s,e),r.push(o.__dzAxisProxy))});var n=xe();return j(r,function(i){j(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 Ave(e){e.registerAction("dataZoom",function(t,r){var n=bve(r,t);j(n,function(i){i.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})})}var JO=!1;function hL(e){JO||(JO=!0,e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,Mve),Ave(e),e.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function kve(e){e.registerComponentModel(wve),e.registerComponentView(Sve),hL(e)}var Ci=function(){function e(){}return e}(),uH={};function Zc(e,t){uH[e]=t}function cH(e){return uH[e]}var Lve=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.optionUpdated=function(){e.prototype.optionUpdated.apply(this,arguments);var r=this.ecModel;j(this.option.feature,function(n,i){var a=cH(i);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(r)),Ge(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}($e);function hH(e,t){var r=gf(t.get("padding")),n=t.getItemStyle(["color","opacity"]);n.fill=t.get("backgroundColor");var i=new Ze({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 Nve=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={}),h=[];j(u,function(x,w){h.push(w)}),new Zo(this._featureNames||[],h).add(f).update(f).remove(Fe(f,null)).execute(),this._featureNames=h;function f(x,w){var S=h[x],T=h[w],M=u[S],A=new qe(M,r,r.ecModel),P;if(a&&a.newTitle!=null&&a.featureName===S&&(M.title=a.newTitle),S&&!T){if(Pve(S))P={onclick:A.option.onclick,featureName:S};else{var I=cH(S);if(!I)return;P=new I}c[S]=P}else if(P=c[T],!P)return;P.uid=pf("toolbox-feature"),P.model=A,P.ecModel=n,P.api=i;var N=P instanceof Ci;if(!S&&T){N&&P.dispose&&P.dispose(n,i);return}if(!A.get("show")||N&&P.unusable){N&&P.remove&&P.remove(n,i);return}d(A,P,S),A.setIconStatus=function(D,O){var R=this.option,F=this.iconPaths;R.iconStatus=R.iconStatus||{},R.iconStatus[D]=O,F[D]&&(O==="emphasis"?Ho:Uo)(F[D])},P instanceof Ci&&P.render&&P.render(A,n,i,a)}function d(x,w,S){var T=x.getModel("iconStyle"),M=x.getModel(["emphasis","iconStyle"]),A=w instanceof Ci&&w.getIcons?w.getIcons():x.get("icon"),P=x.get("title")||{},I,N;he(A)?(I={},I[S]=A):I=A,he(P)?(N={},N[S]=P):N=P;var D=x.iconPaths={};j(I,function(O,R){var F=df(O,{},{x:-s/2,y:-s/2,width:s,height:s});F.setStyle(T.getItemStyle());var H=F.ensureState("emphasis");H.style=M.getItemStyle();var W=new tt({style:{text:N[R],align:M.get("textAlign"),borderRadius:M.get("textBorderRadius"),padding:M.get("textPadding"),fill:null,font:wA({fontStyle:M.get("textFontStyle"),fontFamily:M.get("textFontFamily"),fontSize:M.get("textFontSize"),fontWeight:M.get("textFontWeight")},n)},ignore:!0});F.setTextContent(W),Qo({el:F,componentModel:r,itemName:R,formatterParamsExtra:{title:N[R]}}),F.__title=N[R],F.on("mouseover",function(){var V=M.getItemStyle(),z=l?r.get("right")==null&&r.get("left")!=="right"?"right":"left":r.get("bottom")==null&&r.get("top")!=="bottom"?"bottom":"top";W.setStyle({fill:M.get("textFill")||V.fill||V.stroke||K.color.neutral99,backgroundColor:M.get("textBackgroundColor")}),F.setTextConfig({position:M.get("textPosition")||z}),W.ignore=!r.get("showTitle"),i.enterEmphasis(this)}).on("mouseout",function(){x.get(["iconStatus",R])!=="emphasis"&&i.leaveEmphasis(this),W.hide()}),(x.get(["iconStatus",R])==="emphasis"?Ho:Uo)(F),o.add(F),F.on("click",fe(w.onclick,w,n,i,R)),D[R]=F})}var g=Tr(r,i).refContainer,m=r.getBoxLayoutParams(),y=r.get("padding"),_=It(m,g,y);wu(r.get("orient"),o,r.get("itemGap"),_.width,_.height),Cx(o,m,g,y),o.add(hH(o.getBoundingRect(),r)),l||o.eachChild(function(x){var w=x.__title,S=x.ensureState("emphasis"),T=S.textConfig||(S.textConfig={}),M=x.getTextContent(),A=M&&M.ensureState("emphasis");if(A&&!we(A)&&w){var P=A.style||(A.style={}),I=ux(w,tt.makeFont(P)),N=x.x+o.x,D=x.y+o.y+s,O=!1;D+I.height>i.getHeight()&&(T.position="top",O=!0);var R=O?-5-I.height:s+10;N+I.width/2>i.getWidth()?(T.position=["100%",R],P.align="right"):N-I.width/2<0&&(T.position=[0,R],P.align="left")}})},t.prototype.updateView=function(r,n,i,a){j(this._features,function(o){o instanceof Ci&&o.updateView&&o.updateView(o.model,n,i,a)})},t.prototype.remove=function(r,n){j(this._features,function(i){i instanceof Ci&&i.remove&&i.remove(r,n)}),this.group.removeAll()},t.prototype.dispose=function(r,n){j(this._features,function(i){i instanceof Ci&&i.dispose&&i.dispose(r,n)})},t.type="toolbox",t}(Mt);function Pve(e){return e.indexOf("my")===0}var Ive=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=Je.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 h=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});c.dispatchEvent(h)}else if(window.navigator.msSaveOrOpenBlob||o){var f=l.split(","),d=f[0].indexOf("base64")>-1,g=o?decodeURIComponent(f[1]):f[1];d&&(g=window.atob(g));var m=a+"."+s;if(window.navigator.msSaveOrOpenBlob){for(var y=g.length,_=new Uint8Array(y);y--;)_[y]=g.charCodeAt(y);var x=new Blob([_]);window.navigator.msSaveOrOpenBlob(x,m)}else{var w=document.createElement("iframe");document.body.appendChild(w);var S=w.contentWindow,T=S.document;T.open("image/svg+xml","replace"),T.write(g),T.close(),S.focus(),T.execCommand("SaveAs",!0,m),document.body.removeChild(w)}}else{var M=i.get("lang"),A='',P=window.open();P.document.write(A),P.document.title=a}},t.getDefaultOption=function(r){var n={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:r.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:K.color.neutral00,name:"",excludeComponents:["toolbox"],lang:r.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return n},t}(Ci),QO="__ec_magicType_stack__",Dve=[["line","bar"],["stack"]],Eve=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 j(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(e5[i]){var s={series:[]},l=function(h){var f=h.subType,d=h.id,g=e5[i](f,d,h,a);g&&(Ae(g,h.option),s.series.push(g));var m=h.coordinateSystem;if(m&&m.type==="cartesian2d"&&(i==="line"||i==="bar")){var y=m.getAxesByScale("ordinal")[0];if(y){var _=y.dim,x=_+"Axis",w=h.getReferringComponents(x,Ht).models[0],S=w.componentIndex;s[x]=s[x]||[];for(var T=0;T<=S;T++)s[x][S]=s[x][S]||{};s[x][S].boundaryGap=i==="bar"}}};j(Dve,function(h){Ve(h,i)>=0&&j(h,function(f){a.setIconStatus(f,"normal")})}),a.setIconStatus(i,"emphasis"),r.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var u,c=i;i==="stack"&&(u=Ge({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}(Ci),e5={line:function(e,t,r,n){if(e==="bar")return Ge({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 Ge({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")===QO;if(e==="line"||e==="bar")return n.setIconStatus("stack",i?"normal":"emphasis"),Ge({id:t,stack:i?"":QO},n.get(["option","stack"])||{},!0)}};pa({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(e,t){t.mergeOption(e.newOption)});var Vx=new Array(60).join("-"),qh=" ";function jve(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 Rve(e){var t=[];return j(e,function(r,n){var i=r.categoryAxis,a=r.valueAxis,o=a.dim,s=[" "].concat(ae(r.series,function(d){return d.name})),l=[i.model.getCategories()];j(r.series,function(d){var g=d.getRawData();l.push(d.getRawData().mapArray(g.mapDimension(o),function(m){return m}))});for(var u=[s.join(qh)],c=0;c"].join(n)}function RT(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function NE(e,t,r,n){return Nr("svg","root",{width:e,height:t,xmlns:LG,"xmlns:xlink":NG,version:"1.1",baseProfile:"full",viewBox:n?"0 0 "+e+" "+t:!1},r)}var qne=0;function IG(){return qne++}var PE={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"},ql="transform-origin";function Kne(e,t,r){var n=Q({},e.shape);Q(n,t),e.buildPath(r,n);var i=new kG;return i.reset(JB(e)),r.rebuildPath(i,1),i.generateStr(),i.getStr()}function Jne(e,t){var r=t.originX,n=t.originY;(r||n)&&(e[ql]=r+"px "+n+"px")}var Qne={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function DG(e,t){var r=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[r]=e,r}function eie(e,t,r){var n=e.shape.paths,i={},a,o;if(j(n,function(l){var u=RT(r.zrId);u.animation=!0,I_(l,{},u,!0);var c=u.cssAnims,h=u.cssNodes,f=Qe(c),d=f.length;if(d){o=f[d-1];var g=c[o];for(var m in g){var y=g[m];i[m]=i[m]||{d:""},i[m].d+=y.d||""}for(var x in h){var _=h[x].animation;_.indexOf(o)>=0&&(a=_)}}}),!!a){t.d=!1;var s=DG(i,r);return a.replace(o,s)}}function IE(e){return he(e)?PE[e]?"cubic-bezier("+PE[e]+")":XM(e)?e:"":""}function I_(e,t,r,n){var i=e.animators,a=i.length,o=[];if(e instanceof Hp){var s=eie(e,t,r);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var Ee=DG(A,r);return Ee+" "+_[0]+" both"}}for(var y in l){var s=m(l[y]);s&&o.push(s)}if(o.length){var x=r.zrId+"-cls-"+IG();r.cssNodes["."+x]={animation:o.join(",")},t.class=x}}function tie(e,t,r){if(!e.ignore)if(e.isSilent()){var n={"pointer-events":"none"};DE(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=M0(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),DE(n,t,r)}}function DE(e,t,r,n){var i=JSON.stringify(e),a=r.cssStyleCache[i];a||(a=r.zrId+"-cls-"+IG(),r.cssStyleCache[i]=a,r.cssNodes["."+a+":hover"]=e),t.class=t.class?t.class+" "+a:a}var vp=Math.round;function EG(e){return e&&he(e.src)}function jG(e){return e&&we(e.toDataURL)}function vk(e,t,r,n){Hne(function(i,a){var o=i==="fill"||i==="stroke";o&&KB(a)?OG(t,e,i,n):o&&KM(a)?zG(r,e,i,n):e[i]=a,o&&n.ssr&&a==="none"&&(e["pointer-events"]="visible")},t,r,!1),lie(r,e,n)}function pk(e,t){var r=oF(t);r&&(r.each(function(n,i){n!=null&&(e[(LE+i).toLowerCase()]=n+"")}),t.isSilent()&&(e[LE+"silent"]="true"))}function EE(e){return ks(e[0]-1)&&ks(e[1])&&ks(e[2])&&ks(e[3]-1)}function rie(e){return ks(e[4])&&ks(e[5])}function gk(e,t,r){if(t&&!(rie(t)&&EE(t))){var n=1e4;e.transform=EE(t)?"translate("+vp(t[4]*n)/n+" "+vp(t[5]*n)/n+")":OX(t)}}function jE(e,t,r){for(var n=e.points,i=[],a=0;a"u"){var y="Image width/height must been given explictly in svg-ssr renderer.";Jr(f,y),Jr(d,y)}else if(f==null||d==null){var x=function(N,D){if(N){var O=N.elm,R=f||D.width,F=d||D.height;N.tag==="pattern"&&(u?(F=1,R/=a.width):c&&(R=1,F/=a.height)),N.attrs.width=R,N.attrs.height=F,O&&(O.setAttribute("width",R),O.setAttribute("height",F))}},_=oA(g,null,e,function(N){l||x(M,N),x(h,N)});_&&_.width&&_.height&&(f=f||_.width,d=d||_.height)}h=Nr("image","img",{href:g,width:f,height:d}),o.width=f,o.height=d}else i.svgElement&&(h=Se(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(h){var w,S;l?w=S=1:u?(S=1,w=o.width/a.width):c?(w=1,S=o.height/a.height):o.patternUnits="userSpaceOnUse",w!=null&&!isNaN(w)&&(o.width=w),S!=null&&!isNaN(S)&&(o.height=S);var T=QB(i);T&&(o.patternTransform=T);var M=Nr("pattern","",o,[h]),A=dk(M),P=n.patternCache,I=P[A];I||(I=n.zrId+"-p"+n.patternIdx++,P[A]=I,o.id=I,M=n.defs[I]=Nr("pattern",I,o,[h])),t[r]=u_(I)}}function uie(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]=Nr("clipPath",a,o,[RG(e,r)])}t["clip-path"]=u_(a)}function zE(e){return document.createTextNode(e)}function nu(e,t,r){e.insertBefore(t,r)}function BE(e,t){e.removeChild(t)}function FE(e,t){e.appendChild(t)}function BG(e){return e.parentNode}function FG(e){return e.nextSibling}function aw(e,t){e.textContent=t}var VE=58,cie=120,hie=Nr("","");function OT(e){return e===void 0}function Na(e){return e!==void 0}function fie(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 Yd(e,t){var r=e.key===t.key,n=e.tag===t.tag;return n&&r}function pp(e){var t,r=e.children,n=e.tag;if(Na(n)){var i=e.elm=PG(n);if(mk(hie,e),re(r))for(t=0;ta?(g=r[l+1]==null?null:r[l+1].elm,VG(e,g,r,i,l)):nx(e,t,n,a))}function Hc(e,t){var r=t.elm=e.elm,n=e.children,i=t.children;e!==t&&(mk(e,t),OT(t.text)?Na(n)&&Na(i)?n!==i&&die(r,n,i):Na(i)?(Na(e.text)&&aw(r,""),VG(r,null,i,0,i.length-1)):Na(n)?nx(r,n,0,n.length-1):Na(e.text)&&aw(r,""):e.text!==t.text&&(Na(n)&&nx(r,n,0,n.length-1),aw(r,t.text)))}function vie(e,t){if(Yd(e,t))Hc(e,t);else{var r=e.elm,n=BG(r);pp(t),n!==null&&(nu(n,t.elm,FG(r)),nx(n,[e],0,0))}return t}var pie=0,gie=function(){function e(t,r,n){if(this.type="svg",this.refreshHover=GE(),this.configLayer=GE(),this.storage=r,this._opts=n=Q({},n),this.root=t,this._id="zr"+pie++,this._oldVNode=NE(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=PG("svg");mk(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",vie(this._oldVNode,t),this._oldVNode=t}},e.prototype.renderOneToVNode=function(t){return OE(t,RT(this._id))},e.prototype.renderToVNode=function(t){t=t||{};var r=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=RT(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=mie(n,i,this._backgroundColor,a);s&&o.push(s);var l=t.compress?null:this._mainVNode=Nr("g","main",{},[]);this._paintList(r,a,l?l.children:o),l&&o.push(l);var u=ae(Qe(a.defs),function(f){return a.defs[f]});if(u.length&&o.push(Nr("defs","defs",{},u)),t.animation){var c=Xne(a.cssNodes,a.cssAnims,{newline:!0});if(c){var h=Nr("style","stl",{},[],c);o.push(h)}}return NE(n,i,o,t.useViewBox)},e.prototype.renderToString=function(t){return t=t||{},dk(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&&!(f&&l&&f[m]===l[m]);m--);for(var y=g-1;y>m;y--)o--,s=a[o-1];for(var x=m+1;x=s)}}for(var h=this.__startIndex;h15)break}}F.prevElClipPaths&&x.restore()};if(_)if(_.length===0)P=y.__endIndex;else for(var N=d.dpr,D=0;D<_.length;++D){var O=_[D];x.save(),x.beginPath(),x.rect(O.x*N,O.y*N,O.width*N,O.height*N),x.clip(),I(O),x.restore()}else x.save(),I(),x.restore();y.__drawIndex=P,y.__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?Em:0),this._needsManuallyCompositing),c.__builtin__||i_("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&Xn&&!i.__inHover&&(c.__dirty=!0,c.incremental&&c.__drawIndex<0&&(c.__drawIndex=l))}r(l),this.eachBuiltinLayer(function(h,f){!h.__used&&h.getElementCount()>0&&(h.__dirty=!0,h.__startIndex=h.__endIndex=h.__drawIndex=0),h.__dirty&&h.__drawIndex<0&&(h.__drawIndex=h.__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,j(this._layers,function(r){r.setUnpainted()})},e.prototype.configLayer=function(t,r){if(r){var n=this._layerConfig;n[t]?Ge(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}(bt);function Uh(e,t){var r=e.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var i=Vh(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 qp=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=sr(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=Tie,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(){Ho(this.childAt(0))},t.prototype.downplay=function(){Uo(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,h=a&&a.disableAnimation;if(c){var f=r.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,r,n,l,u,f)}else{var d=this.childAt(0);d.silent=!1;var g={scaleX:l[0]/2,scaleY:l[1]/2};h?d.attr(g):it(d,g,s,n),Oi(d)}if(this._updateCommon(r,n,l,i,a),c){var d=this.childAt(0);if(!h){var g={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:d.style.opacity}};d.scaleX=d.scaleY=0,d.style.opacity=0,Nt(d,g,s,n)}}h&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(r,n,i,a,o){var s=this.childAt(0),l=r.hostModel,u,c,h,f,d,g,m,y,x;if(a&&(u=a.emphasisItemStyle,c=a.blurItemStyle,h=a.selectItemStyle,f=a.focus,d=a.blurScope,m=a.labelStatesModels,y=a.hoverScale,x=a.cursorStyle,g=a.emphasisDisabled),!a||r.hasItemOption){var _=a&&a.itemModel?a.itemModel:r.getItemModel(n),w=_.getModel("emphasis");u=w.getModel("itemStyle").getItemStyle(),h=_.getModel(["select","itemStyle"]).getItemStyle(),c=_.getModel(["blur","itemStyle"]).getItemStyle(),f=w.get("focus"),d=w.get("blurScope"),g=w.get("disabled"),m=Cr(_),y=w.getShallow("scale"),x=_.getShallow("cursor")}var S=r.getItemVisual(n,"symbolRotate");s.attr("rotation",(S||0)*Math.PI/180||0);var T=ec(r.getItemVisual(n,"symbolOffset"),i);T&&(s.x=T[0],s.y=T[1]),x&&s.attr("cursor",x);var M=r.getItemVisual(n,"style"),A=M.fill;if(s instanceof Er){var P=s.style;s.useStyle(Q({image:P.image,x:P.x,y:P.y,width:P.width,height:P.height},M))}else s.__isEmptyBrush?s.useStyle(Q({},M)):s.useStyle(M),s.style.decal=null,s.setColor(A,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var I=r.getItemVisual(n,"liftZ"),N=this._z2;I!=null?N==null&&(this._z2=s.z2,s.z2+=I):N!=null&&(s.z2=N,this._z2=null);var D=o&&o.useNameLabel;Dr(s,m,{labelFetcher:l,labelDataIndex:n,defaultText:O,inheritColor:A,defaultOpacity:M.opacity});function O(H){return D?r.getName(H):Uh(r,H)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var R=s.ensureState("emphasis");R.style=u,s.ensureState("select").style=h,s.ensureState("blur").style=c;var F=y==null||y===!0?Math.max(1.1,3/this._sizeY):isFinite(y)&&y>0?+y:1;R.scaleX=this._sizeX*F,R.scaleY=this._sizeY*F,this.setSymbolScale(1),Dt(this,f,d,g)},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&&el(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();el(a,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:r,removeOpt:s})},t.getSymbolSize=function(r,n){return _f(r.getItemVisual(n,"symbolSize"))},t.getSymbolZ2=function(r,n){return r.getItemVisual(n,"z2")},t}(Ce);function Tie(e,t){this.parent.drift(e,t)}function sw(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 UE(e){return e!=null&&!ke(e)&&(e={isIgnore:e}),e||{}}function ZE(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:Cr(t),cursorStyle:t.get("cursor")}}var Kp=function(){function e(t){this.group=new Ce,this._SymbolCtor=t||qp}return e.prototype.updateData=function(t,r){this._progressiveEls=null,r=UE(r);var n=this.group,i=t.hostModel,a=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=ZE(t),u={disableAnimation:s},c=r.getSymbolPoint||function(h){return t.getItemLayout(h)};a||n.removeAll(),t.diff(a).add(function(h){var f=c(h);if(sw(t,f,h,r)){var d=new o(t,h,l,u);d.setPosition(f),t.setItemGraphicEl(h,d),n.add(d)}}).update(function(h,f){var d=a.getItemGraphicEl(f),g=c(h);if(!sw(t,g,h,r)){n.remove(d);return}var m=t.getItemVisual(h,"symbol")||"circle",y=d&&d.getSymbolType&&d.getSymbolType();if(!d||y&&y!==m)n.remove(d),d=new o(t,h,l,u),d.setPosition(g);else{d.updateData(t,h,l,u);var x={x:g[0],y:g[1]};s?d.attr(x):it(d,x,i)}n.add(d),t.setItemGraphicEl(h,d)}).remove(function(h){var f=a.getItemGraphicEl(h);f&&f.fadeOut(function(){n.remove(f)},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=ZE(t),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(t,r,n){this._progressiveEls=[],n=UE(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 HG(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 Aie(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 kie(e,t,r,n,i,a,o,s){for(var l=Aie(e,t),u=[],c=[],h=[],f=[],d=[],g=[],m=[],y=WG(i,t,o),x=e.getLayout("points")||[],_=t.getLayout("points")||[],w=0;w=i||m<0)break;if(Cu(x,_)){if(l){m+=a;continue}break}if(m===r)e[a>0?"moveTo":"lineTo"](x,_),h=x,f=_;else{var w=x-u,S=_-c;if(w*w+S*S<.5){m+=a;continue}if(o>0){for(var T=m+a,M=t[T*2],A=t[T*2+1];M===x&&A===_&&y=n||Cu(M,A))d=x,g=_;else{N=M-u,D=A-c;var F=x-u,H=M-x,W=_-c,V=A-_,z=void 0,Z=void 0;if(s==="x"){z=Math.abs(F),Z=Math.abs(H);var U=N>0?1:-1;d=x-U*z*o,g=_,O=x+U*Z*o,R=_}else if(s==="y"){z=Math.abs(W),Z=Math.abs(V);var $=D>0?1:-1;d=x,g=_-$*z*o,O=x,R=_+$*Z*o}else z=Math.sqrt(F*F+W*W),Z=Math.sqrt(H*H+V*V),I=Z/(Z+z),d=x-N*o*(1-I),g=_-D*o*(1-I),O=x+N*o*I,R=_+D*o*I,O=ls(O,us(M,x)),R=ls(R,us(A,_)),O=us(O,ls(M,x)),R=us(R,ls(A,_)),N=O-x,D=R-_,d=x-N*z/Z,g=_-D*z/Z,d=ls(d,us(u,x)),g=ls(g,us(c,_)),d=us(d,ls(u,x)),g=us(g,ls(c,_)),N=x-d,D=_-g,O=x+N*Z/z,R=_+D*Z/z}e.bezierCurveTo(h,f,d,g,x,_),h=O,f=R}else e.lineTo(x,_)}u=x,c=_,m+=a}return y}var UG=function(){function e(){this.smooth=0,this.smoothConstraint=!0}return e}(),Lie=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 UG},t.prototype.buildPath=function(r,n){var i=n.points,a=0,o=i.length/2;if(n.connectNulls){for(;o>0&&Cu(i[o*2-2],i[o*2-1]);o--);for(;a=0){var S=u?(g-l)*w+l:(d-s)*w+s;return u?[r,S]:[S,r]}s=d,l=g;break;case o.C:d=a[h++],g=a[h++],m=a[h++],y=a[h++],x=a[h++],_=a[h++];var T=u?C0(s,d,m,x,r,c):C0(l,g,y,_,r,c);if(T>0)for(var M=0;M=0){var S=u?kr(l,g,y,_,A):kr(s,d,m,x,A);return u?[r,S]:[S,r]}}s=x,l=_;break}}},t}(Ke),Nie=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(UG),ZG=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 Nie},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&&Cu(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 Die(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=ae(a.stops,function(w){return{coord:l.toGlobalCoord(l.dataToCoord(w.value)),color:w.color}}),c=u.length,h=a.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),h.reverse());var f=Iie(u,i==="x"?r.getWidth():r.getHeight()),d=f.length;if(!d&&c)return u[0].coord<0?h[1]?h[1]:u[c-1].color:h[0]?h[0]:u[0].color;var g=10,m=f[0].coord-g,y=f[d-1].coord+g,x=y-m;if(x<.001)return"transparent";j(f,function(w){w.offset=(w.coord-m)/x}),f.push({offset:d?f[d-1].offset:.5,color:h[1]||"transparent"}),f.unshift({offset:d?f[0].offset:.5,color:h[0]||"transparent"});var _=new qu(0,0,0,0,f,!0);return _[i]=m,_[i+"2"]=y,_}}}function Eie(e,t,r){var n=e.get("showAllSymbol"),i=n==="auto";if(!(n&&!i)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(i&&jie(a,t))){var o=t.mapDimension(a.dim),s={};return j(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(t.get(o,l))}}}}function jie(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 Rie(e,t){return isNaN(e)||isNaN(t)}function Oie(e){for(var t=e.length/2;t>0&&Rie(e[t*2-2],e[t*2-1]);t--);return t-1}function KE(e,t){return[e[t*2],e[t*2+1]]}function zie(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 XG(e){if(e.get(["endLabel","show"]))return!0;for(var t=0;t0&&r.get(["emphasis","lineStyle","width"])==="bolder"){var Z=g.getState("emphasis").style;Z.lineWidth=+g.style.lineWidth+1}De(g).seriesIndex=r.seriesIndex,Dt(g,W,V,z);var U=qE(r.get("smooth")),$=r.get("smoothMonotone");if(g.setShape({smooth:U,smoothMonotone:$,connectNulls:A}),m){var Y=s.getCalculationInfo("stackedOnSeries"),te=0;m.useStyle(Ae(u.getAreaStyle(),{fill:O,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),Y&&(te=qE(Y.get("smooth"))),m.setShape({smooth:U,stackedOnSmooth:te,smoothMonotone:$,connectNulls:A}),Sr(m,r,"areaStyle"),De(m).seriesIndex=r.seriesIndex,Dt(m,W,V,z)}var ie=this._changePolyState;s.eachItemGraphicEl(function(se){se&&(se.onHoverStateChange=ie)}),this._polyline.onHoverStateChange=ie,this._data=s,this._coordSys=a,this._stackedOnPoints=T,this._points=c,this._step=N,this._valueOrigin=w,r.get("triggerLineEvent")&&(this.packEventData(r,g),m&&this.packEventData(r,m))},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=Ru(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],h=l[s*2+1];if(isNaN(c)||isNaN(h)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(c,h))return;var f=r.get("zlevel")||0,d=r.get("z")||0;u=new qp(o,s),u.x=c,u.y=h,u.setZ(f,d);var g=u.getSymbolPath().getTextContent();g&&(g.zlevel=f,g.z=d,g.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else gt.prototype.highlight.call(this,r,n,i,a)},t.prototype.downplay=function(r,n,i,a){var o=r.getData(),s=Ru(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 gt.prototype.downplay.call(this,r,n,i,a)},t.prototype._changePolyState=function(r){var n=this._polygon;j0(this._polyline,r),n&&j0(n,r)},t.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new Lie({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 ZG({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");we(c)&&(c=c(null));var h=u.get("animationDelay")||0,f=we(h)?h(null):h;r.eachItemGraphicEl(function(d,g){var m=d;if(m){var y=[d.x,d.y],x=void 0,_=void 0,w=void 0;if(i)if(o){var S=i,T=n.pointToCoord(y);a?(x=S.startAngle,_=S.endAngle,w=-T[1]/180*Math.PI):(x=S.r0,_=S.r,w=T[0])}else{var M=i;a?(x=M.x,_=M.x+M.width,w=d.x):(x=M.y+M.height,_=M.y,w=d.y)}var A=_===x?0:(w-x)/(_-x);l&&(A=1-A);var P=we(h)?h(g):c*A+f,I=m.getSymbolPath(),N=I.getTextContent();m.attr({scaleX:0,scaleY:0}),m.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:P}),N&&N.animateFrom({style:{opacity:0}},{duration:300,delay:P}),I.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(r,n,i){var a=r.getModel("endLabel");if(XG(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 tt({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var c=Oie(l);c>=0&&(Dr(s,Cr(r,"endLabel"),{inheritColor:i,labelFetcher:r,labelDataIndex:c,defaultText:function(h,f,d){return d!=null?GG(o,d):Uh(o,h)},enableTextSetter:!0},Bie(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 h=i.getLayout("points"),f=i.hostModel,d=f.get("connectNulls"),g=s.get("precision"),m=s.get("distance")||0,y=l.getBaseAxis(),x=y.isHorizontal(),_=y.inverse,w=n.shape,S=_?x?w.x:w.y+w.height:x?w.x+w.width:w.y,T=(x?m:0)*(_?-1:1),M=(x?0:-m)*(_?-1:1),A=x?"x":"y",P=zie(h,S,A),I=P.range,N=I[1]-I[0],D=void 0;if(N>=1){if(N>1&&!d){var O=KE(h,I[0]);u.attr({x:O[0]+T,y:O[1]+M}),o&&(D=f.getRawValue(I[0]))}else{var O=c.getPointOn(S,A);O&&u.attr({x:O[0]+T,y:O[1]+M});var R=f.getRawValue(I[0]),F=f.getRawValue(I[1]);o&&(D=_F(i,g,R,F,P.t))}a.lastFrameIndex=I[0]}else{var H=r===1||a.lastFrameIndex>0?I[0]:0,O=KE(h,H);o&&(D=f.getRawValue(H)),u.attr({x:O[0]+T,y:O[1]+M})}if(o){var W=vf(u);typeof W.setLabelText=="function"&&W.setLabelText(D)}}},t.prototype._doUpdateAnimation=function(r,n,i,a,o,s,l){var u=this._polyline,c=this._polygon,h=r.hostModel,f=kie(this._data,r,this._stackedOnPoints,n,this._coordSys,i,this._valueOrigin),d=f.current,g=f.stackedOnCurrent,m=f.next,y=f.stackedOnNext;if(o&&(g=cs(f.stackedOnCurrent,f.current,i,o,l),d=cs(f.current,null,i,o,l),y=cs(f.stackedOnNext,f.next,i,o,l),m=cs(f.next,null,i,o,l)),XE(d,m)>3e3||c&&XE(g,y)>3e3){u.stopAnimation(),u.setShape({points:m}),c&&(c.stopAnimation(),c.setShape({points:m,stackedOnPoints:y}));return}u.shape.__points=f.current,u.shape.points=d;var x={shape:{points:m}};f.current!==d&&(x.shape.__points=f.next),u.stopAnimation(),it(u,x,h),c&&(c.setShape({points:d,stackedOnPoints:g}),c.stopAnimation(),it(c,{shape:{stackedOnPoints:y}},h),u.shape.points!==c.shape.points&&(c.shape.points=u.shape.points));for(var _=[],w=f.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(),h=n.getDevicePixelRatio(),f=Math.abs(c[1]-c[0])*(h||1),d=Math.round(s/f);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 g=void 0;he(a)?g=Vie[a]:we(a)&&(g=a),g&&t.setData(i.downSample(i.mapDimension(u.dim),1/d,g,Gie))}}}}}function Wie(e){e.registerChartView(Fie),e.registerSeriesModel(Cie),e.registerLayout(Qp("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,qG("line"))}var gp=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 no(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)j(a.getAxes(),function(f,d){if(f.type==="category"&&n!=null){var g=f.getTicksCoords(),m=f.getTickModel().get("alignWithLabel"),y=o[d],x=n[d]==="x1"||n[d]==="y1";if(x&&!m&&(y+=1),g.length<2)return;if(g.length===2){s[d]=f.toGlobalCoord(f.getExtent()[x?1:0]);return}for(var _=void 0,w=void 0,S=1,T=0;Ty){w=(M+_)/2;break}T===1&&(S=A-g[0].tickValue)}w==null&&(_?_&&(w=g[g.length-1].coord):w=g[0].coord),s[d]=f.toGlobalCoord(w)}});else{var l=this.getData(),u=l.getLayout("offset"),c=l.getLayout("size"),h=a.getBaseAxis().isHorizontal()?0:1;s[h]+=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}(bt);bt.registerClass(gp);var Hie=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 no(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=fl(gp.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}(gp),Uie=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}(),ix=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 Uie},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,h=n.endAngle,f=n.clockwise,d=Math.PI*2,g=f?h-cMath.PI/2&&cs)return!0;s=h}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){Do(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}(gt),JE={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=uw(t.x,e.x),s=cw(t.x+t.width,i),l=uw(t.y,e.y),u=cw(t.y+t.height,a),c=si?s:o,t.y=h&&l>a?u:l,t.width=c?0:s-o,t.height=h?0:u-l,r<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height),c||h},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=cw(t.r,e.r),a=uw(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}},QE={cartesian2d:function(e,t,r,n,i,a,o,s,l){var u=new Ze({shape:Q({},n),z2:1});if(u.__dataIndex=r,u.name="item",a){var c=u.shape,h=i?"height":"width";c[h]=0}return u},polar:function(e,t,r,n,i,a,o,s,l){var u=!i&&l?ix:Qr,c=new u({shape:n,z2:1});c.name="item";var h=KG(i);if(c.calculateTextPosition=Zie(h,{isRoundCap:u===ix}),a){var f=c.shape,d=i?"r":"endAngle",g={};f[d]=i?n.r0:n.startAngle,g[d]=n[d],(s?it:Nt)(c,{shape:g},a)}return c}};function qie(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 ej(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?it:Nt)(r,{shape:l},t,i,null);var c=t?e.baseAxis.model:null;(o?it:Nt)(r,{shape:u},c,i)}function tj(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 Qie(e){return e.startAngle!=null&&e.endAngle!=null&&e.startAngle===e.endAngle}function KG(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 nj(e,t,r,n,i,a,o,s){var l=t.getItemVisual(r,"style");if(s){if(!a.get("roundCap")){var c=e.shape,h=Ba(n.getModel("itemStyle"),c,!0);Q(c,h),e.setShape(c)}}else{var u=n.get(["itemStyle","borderRadius"])||0;e.setShape("r",u)}e.useStyle(l);var f=n.getShallow("cursor");f&&e.attr("cursor",f);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",g=Cr(n);Dr(e,g,{labelFetcher:a,labelDataIndex:r,defaultText:Uh(a.getData(),r),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var m=e.getTextContent();if(s&&m){var y=n.get(["label","position"]);e.textConfig.inside=y==="middle"?!0:null,$ie(e,y==="outside"?d:y,KG(o),n.get(["label","rotate"]))}sV(m,g,a.getRawValue(r),function(_){return GG(t,_)});var x=n.getModel(["emphasis"]);Dt(e,x.get("focus"),x.get("blurScope"),x.get("disabled")),Sr(e,n),Qie(i)&&(e.style.fill="none",e.style.stroke="none",j(e.states,function(_){_.style&&(_.style.fill=_.style.stroke="none")}))}function eae(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 tae=function(){function e(){}return e}(),ij=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 tae},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 rae(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,h=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 JG(e,t,r){if(tl(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 nae(e,t,r){var n=e.type==="polar"?Qr:Ze;return new n({shape:JG(t,r,e),silent:!0,z2:0})}function iae(e){e.registerChartView(Xie),e.registerSeriesModel(Hie),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Fe(tG,"bar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,rG("bar")),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,qG("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 sj=Math.PI*2,zm=Math.PI/180;function aae(e,t,r){t.eachSeriesByType(e,function(n){var i=n.getData(),a=i.mapDimension("value"),o=TV(n,r),s=o.cx,l=o.cy,u=o.r,c=o.r0,h=o.viewRect,f=-n.get("startAngle")*zm,d=n.get("endAngle"),g=n.get("padAngle")*zm;d=d==="auto"?f-sj:-d*zm;var m=n.get("minAngle")*zm,y=m+g,x=0;i.each(a,function(V){!isNaN(V)&&x++});var _=i.getSum(a),w=Math.PI/(_||x)*2,S=n.get("clockwise"),T=n.get("roseType"),M=n.get("stillShowZeroSum"),A=i.getDataExtent(a);A[0]=0;var P=S?1:-1,I=[f,d],N=P*g/2;m_(I,!S),f=I[0],d=I[1];var D=QG(n);D.startAngle=f,D.endAngle=d,D.clockwise=S,D.cx=s,D.cy=l,D.r=u,D.r0=c;var O=Math.abs(d-f),R=O,F=0,H=f;if(i.setLayout({viewRect:h,r:u}),i.each(a,function(V,z){var Z;if(isNaN(V)){i.setItemLayout(z,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:S,cx:s,cy:l,r0:c,r:T?NaN:u});return}T!=="area"?Z=_===0&&M?w:V*w:Z=O/x,ZZ?($=H+P*Z/2,Y=$):($=H+N,Y=U-N),i.setItemLayout(z,{angle:Z,startAngle:$,endAngle:Y,clockwise:S,cx:s,cy:l,r0:c,r:T?ht(V,A,[c,u]):u}),H=U}),Rr?x:y,T=Math.abs(w.label.y-r);if(T>=S.maxY){var M=w.label.x-t-w.len2*i,A=n+w.len,P=Math.abs(M)e.unconstrainedWidth?null:f:null;n.setStyle("width",d)}tW(a,n)}}}function tW(e,t){uj.rect=e,TG(uj,t,lae)}var lae={minMarginForce:[null,0,null,0],marginDefault:[1,0,1,0]},uj={};function hw(e){return e.position==="center"}function uae(e){var t=e.getData(),r=[],n,i,a=!1,o=(e.get("minShowLabelAngle")||0)*oae,s=t.getLayout("viewRect"),l=t.getLayout("r"),u=s.width,c=s.x,h=s.y,f=s.height;function d(M){M.ignore=!0}function g(M){if(!M.ignore)return!0;for(var A in M.states)if(M.states[A].ignore===!1)return!0;return!1}t.each(function(M){var A=t.getItemGraphicEl(M),P=A.shape,I=A.getTextContent(),N=A.getTextGuideLine(),D=t.getItemModel(M),O=D.getModel("label"),R=O.get("position")||D.get(["emphasis","label","position"]),F=O.get("distanceToLabelLine"),H=O.get("alignTo"),W=ce(O.get("edgeDistance"),u),V=O.get("bleedMargin");V==null&&(V=Math.min(u,f)>200?10:2);var z=D.getModel("labelLine"),Z=z.get("length");Z=ce(Z,u);var U=z.get("length2");if(U=ce(U,u),Math.abs(P.endAngle-P.startAngle)0?"right":"left":Y>0?"left":"right"}var et=Math.PI,lt=0,Et=O.get("rotate");if(rt(Et))lt=Et*(et/180);else if(R==="center")lt=0;else if(Et==="radial"||Et===!0){var lr=Y<0?-$+et:-$;lt=lr}else if(Et==="tangential"&&R!=="outside"&&R!=="outer"){var Mr=Math.atan2(Y,te);Mr<0&&(Mr=et*2+Mr);var Gn=te>0;Gn&&(Mr=et+Mr),lt=Mr-et}if(a=!!lt,I.x=ie,I.y=se,I.rotation=lt,I.setStyle({verticalAlign:"middle"}),me){I.setStyle({align:Ee});var io=I.states.select;io&&(io.x+=I.x,io.y+=I.y)}else{var Wn=new Pe(0,0,0,0);tW(Wn,I),r.push({label:I,labelLine:N,position:R,len:Z,len2:U,minTurnAngle:z.get("minTurnAngle"),maxSurfaceAngle:z.get("maxSurfaceAngle"),surfaceNormal:new Ne(Y,te),linePoints:le,textAlign:Ee,labelDistance:F,labelAlignTo:H,edgeDistance:W,bleedMargin:V,rect:Wn,unconstrainedWidth:Wn.width,labelStyleWidth:I.style.width})}A.setTextConfig({inside:me})}}),!a&&e.get("avoidLabelOverlap")&&sae(r,n,i,l,u,f,c,h);for(var m=0;m0){for(var c=o.getItemLayout(0),h=1;isNaN(c&&c.startAngle)&&h=a.r0}},t.type="pie",t}(gt);function Tf(e,t,r){t=re(t)&&{coordDimensions:t}||Q({encodeDefine:e.getEncode()},t);var n=e.getSource(),i=bf(n,t).dimensions,a=new dn(i,e);return a.initData(n,r),a}var Mf=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}(),fae=Ye(),rW=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 Mf(fe(this.getData,this),fe(this.getRawData,this)),this._defaultLabelLine(r)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return Tf(this,{coordDimensions:["value"],encodeDefaulter:Fe(zA,this)})},t.prototype.getDataParams=function(r){var n=this.getData(),i=fae(n),a=i.seats;if(!a){var o=[];n.each(n.mapDimension("value"),function(l){o.push(l)}),a=i.seats=cF(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){ju(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}(bt);aQ({fullType:rW.type,getCoord2:function(e){return e.getShallow("center")}});function dae(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!(rt(o)&&!isNaN(o)&&o<0)})}}}function vae(e){e.registerChartView(hae),e.registerSeriesModel(rW),g6("pie",e.registerAction),e.registerLayout(Fe(aae,"pie")),e.registerProcessor(Cf("pie")),e.registerProcessor(dae("pie"))}var pae=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 no(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}(bt),nW=4,gae=function(){function e(){}return e}(),mae=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 gae},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,h=a[c]-s/2,f=a[c+1]-l/2;if(r>=h&&n>=f&&r<=h+s&&n<=f+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,h=-1/0,f=0;f=0&&(u.dataIndex=h+(t.startIndex||0))})},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),xae=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=Qp("").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 yae:new Kp,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}(gt),iW={left:0,right:0,top:0,bottom:0},ax=["25%","25%"],_ae=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.mergeDefaultAndTheme=function(r,n){var i=Ju(r.outerBounds);e.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&r.outerBounds&&Ka(r.outerBounds,i)},t.prototype.mergeOption=function(r,n){e.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&r.outerBounds&&Ka(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:iW,outerBoundsContain:"all",outerBoundsClampWidth:ax[0],outerBoundsClampHeight:ax[1],backgroundColor:K.color.transparent,borderWidth:1,borderColor:K.color.neutral30},t}($e),BT=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Ht).models[0]},t.type="cartesian2dAxis",t}($e);Qt(BT,Sf);var aW={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"}},bae=Ge({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},aW),yk=Ge({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}}},aW),wae=Ge({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},yk),Sae=Ae({logBase:10},yk);const oW={category:bae,value:yk,time:wae,log:Sae};var Cae={value:1,category:1,time:1,log:1},FT=null;function Tae(e){FT||(FT=e)}function eg(){return FT}function Zh(e,t,r,n){j(Cae,function(i,a){var o=Ge(Ge({},oW[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,h){var f=op(this),d=f?Ju(c):{},g=h.getTheme();Ge(c,g.get(a+"Axis")),Ge(c,this.getDefaultOption()),c.type=cj(c),f&&Ka(c,d,f)},u.prototype.optionUpdated=function(){var c=this.option;c.type==="category"&&(this.__ordinalMeta=fp.createByAxisModel(this))},u.prototype.getCategories=function(c){var h=this.option;if(h.type==="category")return c?h.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.prototype.updateAxisBreaks=function(c){var h=eg();return h?h.updateModelAxisBreak(this,c):{breaks:[]}},u.type=t+"Axis."+a,u.defaultOption=o,u}(r);e.registerComponentModel(s)}),e.registerSubTypeDefaulter(t+"Axis",cj)}function cj(e){return e.type||(e.data?"category":"value")}var Mae=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 ae(this._dimList,function(t){return this._axes[t]},this)},e.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),ot(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}(),VT=["x","y"];function hj(e){return(e.type==="interval"||e.type==="time")&&!e.hasBreaks()}var Aae=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type="cartesian2d",r.dimensions=VT,r}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!hj(r)||!hj(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,h=(s[1]-o[1])/u,f=o[0]-i[0]*c,d=o[1]-a[0]*h,g=this._transform=[c,0,0,h,f,d];this._invTransform=ji([],g)}}},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 Pe(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 Kt(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 Kt(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 Pe(a,o,s,l)},t}(Mae),sW=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}(Vi),D_="expandAxisBreak",lW="collapseAxisBreak",uW="toggleAxisBreak",xk="axisbreakchanged",kae={type:D_,event:xk,update:"update",refineEvent:_k},Lae={type:lW,event:xk,update:"update",refineEvent:_k},Nae={type:uW,event:xk,update:"update",refineEvent:_k};function _k(e,t,r,n){var i=[];return j(e,function(a){i=i.concat(a.eventBreaks)}),{eventContent:{breaks:i}}}function Pae(e){e.registerAction(kae,t),e.registerAction(Lae,t),e.registerAction(Nae,t);function t(r,n){var i=[],a=_h(n,r);function o(s,l){j(a[s],function(u){var c=u.updateAxisBreaks(r);j(c.breaks,function(h){var f;i.push(Ae((f={},f[l]=u.componentIndex,f),h))})})}return o("xAxisModels","xAxisIndex"),o("yAxisModels","yAxisIndex"),o("singleAxisModels","singleAxisIndex"),{eventBreaks:i}}}var Ls=Math.PI,Iae=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],Dae=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],$h=Ye(),cW=Ye(),hW=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 Eae(e,t,r,n){var i=r.axis,a=t.ensureRecord(r),o=[],s,l=bk(e.axisName)&&Hh(e.nameLocation);j(n,function(g){var m=Ja(g);if(!(!m||m.label.ignore)){o.push(m);var y=a.transGroup;l&&(y.transform?ji(bd,y.transform):zp(bd),m.transform&&aa(bd,bd,m.transform),Pe.copy(Bm,m.localRect),Bm.applyTransform(bd),s?s.union(Bm):Pe.copy(s=new Pe(0,0,0,0),Bm))}});var u=Math.abs(a.dirVec.x)>.1?"x":"y",c=a.transGroup[u];if(o.sort(function(g,m){return Math.abs(g.label[u]-c)-Math.abs(m.label[u]-c)}),l&&s){var h=i.getExtent(),f=Math.min(h[0],h[1]),d=Math.max(h[0],h[1])-f;s.union(new Pe(f,0,d,1))}a.stOccupiedRect=s,a.labelInfoList=o}var bd=Pr(),Bm=new Pe(0,0,0,0),fW=function(e,t,r,n,i,a){if(Hh(e.nameLocation)){var o=a.stOccupiedRect;o&&dW(Ine({},o,a.transGroup.transform),n,i)}else vW(a.labelInfoList,a.dirVec,n,i)};function dW(e,t,r){var n=new Ne;P_(e,t,n,{direction:Math.atan2(r.y,r.x),bidirectional:!1,touchThreshold:.05})&&IT(t,n)}function vW(e,t,r,n){for(var i=Ne.dot(n,t)>=0,a=0,o=e.length;a0?"top":"bottom",a="center"):Oh(i-Ls)?(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}(),jae=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],Rae={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],h=[l[1],0],f=c[0]>h[0];u&&(Kt(c,c,u),Kt(h,h,u));var d=Q({lineCap:"round"},n.getModel(["axisLine","lineStyle"]).getLineStyle()),g={strokeContainThreshold:e.raw.strokeContainThreshold||5,silent:!0,z2:1,style:d};if(n.get(["axisLine","breakLine"])&&n.axis.scale.hasBreaks())eg().buildAxisBreakLine(n,i,a,g);else{var m=new ar(Q({shape:{x1:c[0],y1:c[1],x2:h[0],y2:h[1]}},g));Fh(m.shape,m.style.lineWidth),m.anid="line",i.add(m)}var y=n.get(["axisLine","symbol"]);if(y!=null){var x=n.get(["axisLine","symbolSize"]);he(y)&&(y=[y,y]),(he(x)||rt(x))&&(x=[x,x]);var _=ec(n.get(["axisLine","symbolOffset"])||0,x),w=x[0],S=x[1];j([{rotate:e.rotation+Math.PI/2,offset:_[0],r:0},{rotate:e.rotation-Math.PI/2,offset:_[1],r:Math.sqrt((c[0]-h[0])*(c[0]-h[0])+(c[1]-h[1])*(c[1]-h[1]))}],function(T,M){if(y[M]!=="none"&&y[M]!=null){var A=sr(y[M],-w/2,-S/2,w,S,d.stroke,!0),P=T.r+T.offset,I=f?h:c;A.attr({rotation:T.rotate,x:I[0]+P*Math.cos(e.rotation),y:I[1]-P*Math.sin(e.rotation),silent:!0,z2:11}),i.add(A)}})}}},axisTickLabelEstimate:function(e,t,r,n,i,a,o,s){var l=dj(t,i,s);l&&fj(e,t,r,n,i,a,o,da.estimate)},axisTickLabelDetermine:function(e,t,r,n,i,a,o,s){var l=dj(t,i,s);l&&fj(e,t,r,n,i,a,o,da.determine);var u=Fae(e,i,a,n);Bae(e,t.labelLayoutList,u),Vae(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(bk(u)){var c=e.nameLocation,h=e.nameDirection,f=n.getModel("nameTextStyle"),d=n.get("nameGap")||0,g=n.axis.getExtent(),m=n.axis.inverse?-1:1,y=new Ne(0,0),x=new Ne(0,0);c==="start"?(y.x=g[0]-m*d,x.x=-m):c==="end"?(y.x=g[1]+m*d,x.x=m):(y.x=(g[0]+g[1])/2,y.y=e.labelOffset+h*d,x.y=h);var _=Pr();x.transform(Ko(_,_,e.rotation));var w=n.get("nameRotate");w!=null&&(w=w*Ls/180);var S,T;Hh(c)?S=wn.innerTextLayout(e.rotation,w??e.rotation,h):(S=Oae(e.rotation,c,w||0,g),T=e.raw.axisNameAvailableWidth,T!=null&&(T=Math.abs(T/Math.sin(S.rotation)),!isFinite(T)&&(T=null)));var M=f.getFont(),A=n.get("nameTruncate",!0)||{},P=A.ellipsis,I=Fr(e.raw.nameTruncateMaxWidth,A.maxWidth,T),N=s.nameMarginLevel||0,D=new tt({x:y.x,y:y.y,rotation:S.rotation,silent:wn.isLabelSilent(n),style:Ct(f,{text:u,font:M,overflow:"truncate",width:I,ellipsis:P,fill:f.getTextColor()||n.get(["axisLine","lineStyle","color"]),align:f.get("align")||S.textAlign,verticalAlign:f.get("verticalAlign")||S.textVerticalAlign}),z2:1});if(Qo({el:D,componentModel:n,itemName:u}),D.__fullText=u,D.anid="name",n.get("triggerEvent")){var O=wn.makeAxisEventDataBase(n);O.targetType="axisName",O.name=u,De(D).eventData=O}a.add(D),D.updateTransform(),t.nameEl=D;var R=l.nameLayout=Ja({label:D,priority:D.z2,defaultAttr:{ignore:D.ignore},marginDefault:Hh(c)?Iae[N]:Dae[N]});if(l.nameLocation=c,i.add(D),D.decomposeTransform(),e.shouldNameMoveOverlap&&R){var F=r.ensureRecord(n);r.resolveAxisNameOverlap(e,r,n,R,x,F)}}}};function fj(e,t,r,n,i,a,o,s){gW(t)||Gae(e,t,i,s,n,o);var l=t.labelLayoutList;Wae(e,n,l,a),Zae(n,e.rotation,l);var u=e.optionHideOverlap;zae(n,l,u),u&&MG(ot(l,function(c){return c&&!c.label.ignore})),Eae(e,r,n,l)}function Oae(e,t,r,n){var i=eA(r-e),a,o,s=n[0]>n[1],l=t==="start"&&!s||t!=="start"&&s;return Oh(i-Ls/2)?(o=l?"bottom":"top",a="center"):Oh(i-Ls*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",iLs/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:o}}function zae(e,t,r){if(uG(e.axis))return;function n(s,l,u){var c=Ja(t[l]),h=Ja(t[u]);if(!(!c||!h)){if(s===!1||c.suggestIgnore){Xd(c.label);return}if(h.suggestIgnore){Xd(h.label);return}var f=.1;if(!r){var d=[0,0,0,0];c=DT({marginForce:d},c),h=DT({marginForce:d},h)}P_(c,h,null,{touchThreshold:f})&&Xd(s?h.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 Bae(e,t,r){e.showMinorTicks||j(t,function(n){if(n&&n.label.ignore)for(var i=0;iu[0]&&isFinite(g)&&isFinite(u[0]);)d=qb(d),g=u[1]-d*o;else{var y=e.getTicks().length-1;y>o&&(d=qb(d));var x=d*o;m=Math.ceil(u[1]/d)*d,g=ir(m-x),g<0&&u[0]>=0?(g=0,m=ir(x)):m>0&&u[1]<=0&&(m=0,g=-ir(x))}var _=(i[0].value-a[0].value)/s,w=(i[o].value-a[o].value)/s;n.setExtent.call(e,g+d*_,m+d*w),n.setInterval.call(e,d),(_||w)&&n.setNiceExtent.call(e,g+d,m-d)}var pj=[[3,1],[0,2]],qae=function(){function e(t,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=VT,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=Qe(o),u=l.length;if(u){for(var c=[],h=u-1;h>=0;h--){var f=+l[h],d=o[f],g=d.model,m=d.scale;MT(m)&&g.get("alignTicks")&&g.get("interval")==null?c.push(d):(Gu(m,g),MT(m)&&(s=d))}c.length&&(s||(s=c.pop(),Gu(s.scale,s.model)),j(c,function(y){mW(y.scale,y.model,s.scale)}))}}i(n.x),i(n.y);var a={};j(n.x,function(o){gj(n,"y",o,a)}),j(n.y,function(o){gj(n,"x",o,a)}),this.resize(this.model,r)},e.prototype.resize=function(t,r,n){var i=Tr(t,r),a=this._rect=It(t.getBoxLayoutParams(),i.refContainer),o=this._axesMap,s=this._coordsList,l=t.get("containLabel");if(WT(o,a),!n){var u=Qae(a,s,o,l,r),c=void 0;if(l)HT?(HT(this._axesList,a),WT(o,a)):c=xj(a.clone(),"axisLabel",null,a,o,u,i);else{var h=eoe(t,a,i),f=h.outerBoundsRect,d=h.parsedOuterBoundsContain,g=h.outerBoundsClamp;f&&(c=xj(f,d,g,a,o,u,i))}yW(a,o,da.determine,null,c,i)}j(this._coordsList,function(m){m.calcAffineTransform()})},e.prototype.getAxis=function(t,r){var n=this._axesMap[t];if(n!=null)return n[r||0]},e.prototype.getAxes=function(){return this._axesList.slice()},e.prototype.getCartesian=function(t,r){if(t!=null&&r!=null){var n="x"+t+"y"+r;return this._coordsMap[n]}ke(t)&&(r=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,a=this._coordsList;i0})==null;return Bu(n,s,!0,!0,r),WT(i,n),l;function u(f){j(i[Oe[f]],function(d){if(dp(d.model)){var g=a.ensureRecord(d.model),m=g.labelInfoList;if(m)for(var y=0;y0&&!Xr(d)&&d>1e-4&&(f/=d),f}}function Qae(e,t,r,n,i){var a=new hW(toe);return j(r,function(o){return j(o,function(s){if(dp(s.model)){var l=!n;s.axisBuilder=Yae(e,t,s.model,i,a,l)}})}),a}function yW(e,t,r,n,i,a){var o=r===da.determine;j(t,function(u){return j(u,function(c){dp(c.model)&&(Xae(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[Oe[1-u]]=e[pr[u]]<=a.refContainer[pr[u]]*.5?0:1-u===1?2:1}j(t,function(u,c){return j(u,function(h){dp(h.model)&&((n==="all"||o)&&h.axisBuilder.build({axisName:!0},{nameMarginLevel:s[c]}),o&&h.axisBuilder.build({axisLine:!0}))})})}function eoe(e,t,r){var n,i=e.get("outerBoundsMode",!0);i==="same"?n=t.clone():(i==null||i==="auto")&&(n=It(e.get("outerBounds",!0)||iW,r.refContainer));var a=e.get("outerBoundsContain",!0),o;a==null||a==="auto"||Ve(["all","axisLabel"],a)<0?o="all":o=a;var s=[P0(be(e.get("outerBoundsClampWidth",!0),ax[0]),t.width),P0(be(e.get("outerBoundsClampHeight",!0),ax[1]),t.height)];return{outerBoundsRect:n,parsedOuterBoundsContain:o,outerBoundsClamp:s}}var toe=function(e,t,r,n,i,a){var o=r.axis.dim==="x"?"y":"x";fW(e,t,r,n,i,a),Hh(e.nameLocation)||j(t.recordMap[o],function(s){s&&s.labelInfoList&&s.dirVec&&vW(s.labelInfoList,s.dirVec,n,i)})};function roe(e,t){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return noe(r,e,t),r.seriesInvolved&&aoe(r,e),r}function noe(e,t,r){var n=t.getComponent("tooltip"),i=t.getComponent("axisPointer"),a=i.get("link",!0)||[],o=[];j(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=mp(s.model),u=e.coordSysAxesInfo[l]={};e.coordSysMap[l]=s;var c=s.model,h=c.getModel("tooltip",n);if(j(s.getAxes(),Fe(m,!1,null)),s.getTooltipAxes&&n&&h.get("show")){var f=h.get("trigger")==="axis",d=h.get(["axisPointer","type"])==="cross",g=s.getTooltipAxes(h.get(["axisPointer","axis"]));(f||d)&&j(g.baseAxes,Fe(m,d?"cross":!0,f)),d&&j(g.otherAxes,Fe(m,"cross",!1))}function m(y,x,_){var w=_.model.getModel("axisPointer",i),S=w.get("show");if(!(!S||S==="auto"&&!y&&!UT(w))){x==null&&(x=w.get("triggerTooltip")),w=y?ioe(_,h,i,t,y,x):w;var T=w.get("snap"),M=w.get("triggerEmphasis"),A=mp(_.model),P=x||T||_.type==="category",I=e.axesInfo[A]={key:A,axis:_,coordSys:s,axisPointerModel:w,triggerTooltip:x,triggerEmphasis:M,involveSeries:P,snap:T,useHandle:UT(w),seriesModels:[],linkGroup:null};u[A]=I,e.seriesInvolved=e.seriesInvolved||P;var N=ooe(a,_);if(N!=null){var D=o[N]||(o[N]={axesInfo:{}});D.axesInfo[A]=I,D.mapper=a[N].mapper,I.linkGroup=D}}}})}function ioe(e,t,r,n,i,a){var o=t.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};j(s,function(f){l[f]=Se(o.get(f))}),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 h=l.lineStyle=o.get("crossStyle");h&&Ae(u,h.textStyle)}}return e.model.getModel("axisPointer",new qe(l,r,n))}function aoe(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||j(e.coordSysAxesInfo[mp(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 ooe(e,t){for(var r=t.model,n=t.dim,i=0;i=0||e===t}function soe(e){var t=wk(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=UT(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 voe=Ye();function wj(e,t,r,n){if(e instanceof sW){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?CW(r,o,u,n):poe(e,t,r,n,o,l):r}function CW(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 poe(e,t,r,n,i,a){var o=voe(e);o.items||(o.items=[]);var s=o.items,l=Sj(s,t,r,n,i,a,1),u=Sj(s,t,r,n,i,a,-1),c=Math.abs(l-r)i/2||h&&f>h/2-n?CW(r,i,h,n):(s.push({fixedCoord:t,floatCoord:c,r:n}),c)}function Sj(e,t,r,n,i,a,o){for(var s=r,l=0;li/2)return Number.MAX_VALUE;if(o===1&&g>s||o===-1&&g0&&!g.min?g.min=0:g.min!=null&&g.min<0&&!g.max&&(g.max=0);var m=l;g.color!=null&&(m=Ae({color:g.color},l));var y=Ge(Se(g),{boundaryGap:r,splitNumber:n,scale:i,axisLine:a,axisTick:o,axisLabel:s,name:g.text,showName:u,nameLocation:"end",nameGap:h,nameTextStyle:m,triggerEvent:f},!1);if(he(c)){var x=y.name;y.name=c.replace("{value}",x??"")}else we(c)&&(y.name=c(y.name,y));var _=new qe(y,null,this.ecModel);return Qt(_,Sf.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:Ge({lineStyle:{color:K.color.neutral20}},wd.axisLine),axisLabel:Fm(wd.axisLabel,!1),axisTick:Fm(wd.axisTick,!1),splitLine:Fm(wd.splitLine,!0),splitArea:Fm(wd.splitArea,!0),indicator:[]},t}($e),Coe=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=ae(a,function(s){var l=s.model.get("showName")?s.name:"",u=new wn(s.model,n,{axisName:l,position:[i.cx,i.cy],rotation:s.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return u});j(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"),h=s.get("show"),f=l.get("color"),d=u.get("color"),g=re(f)?f:[f],m=re(d)?d:[d],y=[],x=[];function _(H,W,V){var z=V%W.length;return H[z]=H[z]||[],z}if(a==="circle")for(var w=i[0].getTicksCoords(),S=n.cx,T=n.cy,M=0;M3?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 h=Math.abs(a),f=(a>0?1:-1)*(h>3?.4:h>1?.15:.05);this._checkTriggerMoveZoom(this,"scrollMove","moveOnMouseWheel",r,{scrollDelta:f,originX:s,originY:l,isAvailableBehavior:null})}}}},t.prototype._pinchHandler=function(r){if(!(Mj(this._zr,"globalPan")||Sd(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)&&(Wo(a.event),a.__ecRoamConsumed=!0,Aj(r,n,i,a,o))},t}(Bi);function Sd(e){return e.__ecRoamConsumed}var Ioe=Ye();function E_(e){var t=Ioe(e);return t.roam=t.roam||{},t.uniform=t.uniform||{},t}function Cd(e,t,r,n){for(var i=E_(e),a=i.roam,o=a[t]=a[t]||[],s=0;s=4&&(c={x:parseFloat(f[0]||0),y:parseFloat(f[1]||0),width:parseFloat(f[2]),height:parseFloat(f[3])})}if(c&&s!=null&&l!=null&&(h=NW(c,{x:0,y:0,width:s,height:l}),!r.ignoreViewBox)){var d=i;i=new Ce,i.add(d),d.scaleX=d.scaleY=h.scale,d.x=h.x,d.y=h.y}return!r.ignoreRootClip&&s!=null&&l!=null&&i.setClipPath(new Ze({shape:{x:0,y:0,width:s,height:l}})),{root:i,width:s,height:l,viewBoxRect:c,viewBoxTransform:h,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=vw[s];if(c&&ge(vw,s)){l=c.call(this,t,r);var h=t.getAttribute("name");if(h){var f={name:h,namedFrom:null,svgNodeTagLower:s,el:l};n.push(f),s==="g"&&(u=f)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:l});r.add(l)}}var d=Pj[s];if(d&&ge(Pj,s)){var g=d.call(this,t),m=t.getAttribute("id");m&&(this._defs[m]=g)}}if(l&&l.isGroup)for(var y=t.firstChild;y;)y.nodeType===1?this._parseNode(y,l,n,u,a,o):y.nodeType===3&&o&&this._parseText(y,l),y=y.nextSibling},e.prototype._parseText=function(t,r){var n=new zh({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});vi(r,n),Un(t,n,this._defsUsePending,!1,!1),Roe(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(){vw={g:function(t,r){var n=new Ce;return vi(r,n),Un(t,n,this._defsUsePending,!1,!1),n},rect:function(t,r){var n=new Ze;return vi(r,n),Un(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 ro;return vi(r,n),Un(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 ar;return vi(r,n),Un(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 Gp;return vi(r,n),Un(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=Ej(n));var a=new en({shape:{points:i||[]},silent:!0});return vi(r,a),Un(t,a,this._defsUsePending,!1,!1),a},polyline:function(t,r){var n=t.getAttribute("points"),i;n&&(i=Ej(n));var a=new Gr({shape:{points:i||[]},silent:!0});return vi(r,a),Un(t,a,this._defsUsePending,!1,!1),a},image:function(t,r){var n=new Er;return vi(r,n),Un(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 Ce;return vi(r,s),Un(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 Ce;return vi(r,s),Un(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=ZF(n);return vi(r,i),Un(t,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),e}(),Pj={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 qu(t,r,n,i);return Ij(e,a),Dj(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 pA(t,r,n);return Ij(e,i),Dj(e,i),i}};function Ij(e,t){var r=e.getAttribute("gradientUnits");r==="userSpaceOnUse"&&(t.global=!0)}function Dj(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={};LW(r,a,a);var o=a.stopColor||r.getAttribute("stop-color")||"#000000",s=a.stopOpacity||r.getAttribute("stop-opacity");if(s){var l=fn(o),u=l&&l[3];u&&(l[3]*=Po(s),o=Li(l,"rgba"))}t.colorStops.push({offset:i,color:o})}r=r.nextSibling}}function vi(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),Ae(t.__inheritedStyle,e.__inheritedStyle))}function Ej(e){for(var t=R_(e),r=[],n=0;n0;a-=2){var o=n[a],s=n[a-1],l=R_(o);switch(i=i||Pr(),s){case"translate":ha(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":l_(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":Ko(i,i,-parseFloat(l[0])*pw,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*pw);aa(i,[1,0,u,1,0,0],i);break;case"skewY":var c=Math.tan(parseFloat(l[0])*pw);aa(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 Rj=/([^\s:;]+)\s*:\s*([^:;]+)/g;function LW(e,t,r){var n=e.getAttribute("style");if(n){Rj.lastIndex=0;for(var i;(i=Rj.exec(n))!=null;){var a=i[1],o=ge(sx,a)?sx[a]:null;o&&(t[o]=i[2]);var s=ge(lx,a)?lx[a]:null;s&&(r[s]=i[2])}}}function Goe(e,t,r){for(var n=0;n0,_={api:n,geo:l,mapOrGeoModel:t,data:s,isVisualEncodedByVisualMap:x,isGeo:o,transformInfoRaw:f};l.resourceType==="geoJSON"?this._buildGeoJSON(_):l.resourceType==="geoSVG"&&this._buildSVG(_),this._updateController(t,y,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,g){return g&&(d=g(d)),d&&[d[0]*a.scaleX+a.x,d[1]*a.scaleY+a.y]}function h(d){for(var g=[],m=!u&&l&&l.project,y=0;y=0)&&(f=i);var d=o?{normal:{align:"center",verticalAlign:"middle"}}:null;Dr(t,Cr(n),{labelFetcher:f,labelDataIndex:h,defaultText:r},d);var g=t.getTextContent();if(g&&(PW(g).ignore=g.ignore,t.textConfig&&o)){var m=t.getBoundingRect().clone();t.textConfig.layoutRect=m,t.textConfig.position=[(o[0]-m.x)/m.width*100+"%",(o[1]-m.y)/m.height*100+"%"]}t.disableLabelAnimation=!0}else t.removeTextContent(),t.removeTextConfig(),t.disableLabelAnimation=null}function Vj(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 Gj(e,t,r,n,i){e.data||Qo({el:t,componentModel:i,itemName:r,itemTooltipOption:n.get("tooltip")})}function Wj(e,t,r,n,i){t.highDownSilentOnTouch=!!i.get("selectedMode");var a=n.getModel("emphasis"),o=a.get("focus");return Dt(t,o,a.get("blurScope"),a.get("disabled")),e.isGeo&&KK(t,i,r),o}function Hj(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(),j(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}(bt);function lse(e,t){var r={};return j(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?(w.width=_,w.height=_/m):(w.height=_,w.width=_*m),w.y=x[1]-w.height/2,w.x=x[0]-w.width/2;else{var S=e.getBoxLayoutParams();S.aspect=m,w=It(S,g),w=MV(e,w,m)}this.setViewRect(w.x,w.y,w.width,w.height),this.setCenter(e.get("center")),this.setZoom(e.get("zoom"))}function fse(e,t){j(t.get("geoCoord"),function(r,n){e.addGeoCoord(n,r)})}var dse=function(){function e(){this.dimensions=DW}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 YT(l+s,l,Q({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=Yj,u.resize(o,r)}),t.eachSeries(function(o){$p({targetModel:o,coordSysType:"geo",coordSysProvider:function(){var s=o.subType==="map"?o.getHostGeoModel():o.getReferringComponents("geo",Ht).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)}}),j(a,function(o,s){var l=ae(o,function(c){return c.get("nameMap")}),u=new YT(s,s,Q({nameMap:a_(l),api:r,ecModel:t},i(o[0])));u.zoomLimit=Fr.apply(null,ae(o,function(c){return c.get("scaleLimit")})),n.push(u),u.resize=Yj,u.resize(o[0],r),j(o,function(c){c.coordinateSystem=u,fse(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 xse(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){bse(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=wse(e,i,e.parentNode.hierNode.defaultAncestor||n[0],t)}function _se(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier}function Xj(e){return arguments.length?e:Tse}function qd(e,t){return e-=Math.PI/2,{x:t*Math.cos(e),y:t*Math.sin(e)}}function bse(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 wse(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,h=s.hierNode.modifier;s=gw(s),a=mw(a),s&&a;){i=gw(i),o=mw(o),i.hierNode.ancestor=e;var f=s.hierNode.prelim+h-a.hierNode.prelim-u+n(s,a);f>0&&(Cse(Sse(s,e,r),e,f),u+=f,l+=f),h+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=i.hierNode.modifier,c+=o.hierNode.modifier}s&&!gw(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=h-l),a&&!mw(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-c,r=e)}return r}function gw(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function mw(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function Sse(e,t,r){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:r}function Cse(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 Tse(e,t){return e.parentNode===t.parentNode?1:2}var Mse=function(){function e(){this.parentPoint=[],this.childPoints=[]}return e}(),Ase=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 Mse},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,h=1-c,f=ce(n.forkPosition,1),d=[];d[c]=o[c],d[h]=o[h]+(l[h]-o[h])*f,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 g=1;g_.x,T||(S=S-Math.PI));var A=T?"left":"right",P=s.getModel("label"),I=P.get("rotate"),N=I*(Math.PI/180),D=y.getTextContent();D&&(y.setTextConfig({position:P.get("position")||A,rotation:I==null?-S:N,origin:"center"}),D.setStyle("verticalAlign","middle"))}var O=s.get(["emphasis","focus"]),R=O==="relative"?Eh(o.getAncestorsIndices(),o.getDescendantIndices()):O==="ancestor"?o.getAncestorsIndices():O==="descendant"?o.getDescendantIndices():null;R&&(De(r).focus=R),Lse(i,o,c,r,g,d,m,n),r.__edge&&(r.onHoverStateChange=function(F){if(F!=="blur"){var H=o.parentNode&&e.getItemGraphicEl(o.parentNode.dataIndex);H&&H.hoverState===Vp||j0(r.__edge,F)}})}function Lse(e,t,r,n,i,a,o,s){var l=t.getModel(),u=e.get("edgeShape"),c=e.get("layout"),h=e.getOrient(),f=e.get(["lineStyle","curveness"]),d=e.get("edgeForkPosition"),g=l.getModel("lineStyle").getLineStyle(),m=n.__edge;if(u==="curve")t.parentNode&&t.parentNode!==r&&(m||(m=n.__edge=new hf({shape:XT(c,h,f,i,i)})),it(m,{shape:XT(c,h,f,a,o)},e));else if(u==="polyline"&&c==="orthogonal"&&t!==r&&t.children&&t.children.length!==0&&t.isExpand===!0){for(var y=t.children,x=[],_=0;_r&&(r=i.height)}this.height=r+1},e.prototype.getNodeById=function(t){if(this.getId()===t)return this;for(var r=0,n=this.children,i=n.length;r=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,r)},e.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},e.prototype.getModel=function(t){if(!(this.dataIndex<0)){var r=this.hostTree,n=r.data.getItemModel(this.dataIndex);return n.getModel(t)}},e.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},e.prototype.setVisual=function(t,r){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,r)},e.prototype.getVisual=function(t){return this.hostTree.data.getItemVisual(this.dataIndex,t)},e.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},e.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},e.prototype.getChildIndex=function(){if(this.parentNode){for(var t=this.parentNode.children,r=0;r=0){var n=r.getData().tree.root,i=e.targetNode;if(he(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 BW(e){for(var t=[];e;)e=e.parentNode,e&&t.push(e);return t.reverse()}function Nk(e,t){var r=BW(e);return Ve(r,t)>=0}function O_(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 zse=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 qe(i,this,this.ecModel),o=Lk.createTree(n,this,s);function s(h){h.wrapMethod("getItemModel",function(f,d){var g=o.getNodeByDataIndex(d);return g&&g.children.length&&g.isExpand||(f.parentModel=a),f})}var l=0;o.eachNode("preorder",function(h){h.depth>l&&(l=h.depth)});var u=r.expandAndCollapse,c=u&&r.initialTreeDepth>=0?r.initialTreeDepth:l;return o.root.eachNode("preorder",function(h){var f=h.hostTree.data.getRawDataItem(h.dataIndex);h.isExpand=f&&f.collapsed!=null?!f.collapsed:h.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 gr("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=O_(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}(bt);function Bse(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 Fse(e,t){e.eachSeriesByType("tree",function(r){Vse(r,t)})}function Vse(e,t){var r=Tr(e,t).refContainer,n=It(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=Xj(function(S,T){return(S.parentNode===T.parentNode?1:2)/S.depth})):(a=n.width,o=n.height,s=Xj());var l=e.getData().tree.root,u=l.children[0];if(u){yse(l),Bse(u,xse,s),l.hierNode.modifier=-u.hierNode.prelim,Ad(u,_se);var c=u,h=u,f=u;Ad(u,function(S){var T=S.getLayout().x;Th.getLayout().x&&(h=S),S.depth>f.depth&&(f=S)});var d=c===h?1:s(c,h)/2,g=d-c.getLayout().x,m=0,y=0,x=0,_=0;if(i==="radial")m=a/(h.getLayout().x+d+g),y=o/(f.depth-1||1),Ad(u,function(S){x=(S.getLayout().x+g)*m,_=(S.depth-1)*y;var T=qd(x,_);S.setLayout({x:T.x,y:T.y,rawX:x,rawY:_},!0)});else{var w=e.getOrient();w==="RL"||w==="LR"?(y=o/(h.getLayout().x+d+g),m=a/(f.depth-1||1),Ad(u,function(S){_=(S.getLayout().x+g)*y,x=w==="LR"?(S.depth-1)*m:a-(S.depth-1)*m,S.setLayout({x,y:_},!0)})):(w==="TB"||w==="BT")&&(m=a/(h.getLayout().x+d+g),y=o/(f.depth-1||1),Ad(u,function(S){x=(S.getLayout().x+g)*m,_=w==="TB"?(S.depth-1)*y:o-(S.depth-1)*y,S.setLayout({x,y:_},!0)}))}}}function Gse(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");Q(s,o)})})}function Wse(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=j_(a,t,i.get("scaleLimit"));i.setCenter(o.center),i.setZoom(o.zoom)})})}function Hse(e){e.registerChartView(kse),e.registerSeriesModel(zse),e.registerLayout(Fse),e.registerVisual(Gse),Wse(e)}var eR=["treemapZoomToNode","treemapRender","treemapMove"];function Use(e){for(var t=0;t1;)a=a.parentNode;var o=fT(e.ecModel,a.name||a.dataIndex+"",n);i.setVisual("decal",o)})}var Zse=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};VW(i);var a=r.levels||[],o=this.designatedVisualItemStyle={},s=new qe({itemStyle:o},this,n);a=r.levels=$se(a,n);var l=ae(a||[],function(h){return new qe(h,s,n)},this),u=Lk.createTree(i,this,c);function c(h){h.wrapMethod("getItemModel",function(f,d){var g=u.getNodeByDataIndex(d),m=g?l[g.depth]:null;return f.parentModel=m||s,f})}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 gr("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=O_(i,this),n.treePathInfo=n.treeAncestors,n},t.prototype.setLayoutInfo=function(r){this.layoutInfo=this.layoutInfo||{},Q(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(){FW(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}(bt);function VW(e){var t=0;j(e.children,function(n){VW(n);var i=n.value;re(i)&&(i=i[0]),t+=i});var r=e.value;re(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=t),r<0&&(r=0),re(e.value)?e.value[0]=r:e.value=r}function $se(e,t){var r=Tt(t.get("color")),n=Tt(t.get(["aria","decal","decals"]));if(r){e=e||[];var i,a;j(e,function(s){var l=new qe(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 Yse=8,tR=8,yw=5,Xse=function(){function e(t){this.group=new Ce,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"]),h=Tr(t,r).refContainer,f={left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},d={emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]},g=It(f,h);this._prepare(n,d,u),this._renderContent(t,d,g,s,l,u,c,i),C_(o,f,h)}},e.prototype._prepare=function(t,r,n){for(var i=t;i;i=i.parentNode){var a=br(i.getModel().get("name"),""),o=n.getTextRect(a),s=Math.max(o.width+Yse*2,r.emptyItemWidth);r.totalWidth+=s+tR,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,h=t.get(["breadcrumb","height"]),f=r.totalWidth,d=r.renderList,g=a.getModel("itemStyle").getItemStyle(),m=d.length-1;m>=0;m--){var y=d[m],x=y.node,_=y.width,w=y.text;f>n.width&&(f-=_-c,_=c,w=null);var S=new en({shape:{points:qse(u,0,_,h,m===d.length-1,m===0)},style:Ae(i.getItemStyle(),{lineJoin:"bevel"}),textContent:new tt({style:Ct(o,{text:w})}),textConfig:{position:"inside"},z2:uf*1e4,onclick:Fe(l,x)});S.disableLabelAnimation=!0,S.getTextContent().ensureState("emphasis").style=Ct(s,{text:w}),S.ensureState("emphasis").style=g,Dt(S,a.get("focus"),a.get("blurScope"),a.get("disabled")),this.group.add(S),Kse(S,t,x),u+=_+tR}},e.prototype.remove=function(){this.group.removeAll()},e}();function qse(e,t,r,n,i,a){var o=[[i?e:e-yw,t],[e+r,t],[e+r,t+n],[i?e:e-yw,t+n]];return!a&&o.splice(2,0,[e+r+yw,t+n/2]),!i&&o.push([e,t+n/2]),o}function Kse(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&&O_(r,t)}}var Jse=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;inR||Math.abs(r.dy)>nR)){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 Pe(s.x,s.y,s.width,s.height),u=null,c=this._controllerHost;u=c.zoomLimit;var h=c.zoom=c.zoom||1;if(h*=a,u){var f=u.min||0,d=u.max||1/0;h=Math.max(Math.min(d,h),f)}var g=h/c.zoom;c.zoom=h;var m=this.seriesModel.layoutInfo;n-=m.x,i-=m.y;var y=Pr();ha(y,y,[-n,-i]),l_(y,y,[g,g]),ha(y,y,[n,i]),l.applyTransform(y),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&&B0(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 Xse(this.group))).render(r,n,i.node,function(o){a._state!=="animating"&&(Nk(r.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=kd(),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}(gt);function kd(){return{nodeGroup:[],background:[],content:[]}}function ile(e,t,r,n,i,a,o,s,l,u){if(!o)return;var c=o.getLayout(),h=e.getData(),f=o.getModel();if(h.setItemGraphicEl(o.dataIndex,null),!c||!c.isInView)return;var d=c.width,g=c.height,m=c.borderWidth,y=c.invisible,x=o.getRawIndex(),_=s&&s.getRawIndex(),w=o.viewChildren,S=c.upperHeight,T=w&&w.length,M=f.getModel("itemStyle"),A=f.getModel(["emphasis","itemStyle"]),P=f.getModel(["blur","itemStyle"]),I=f.getModel(["select","itemStyle"]),N=M.get("borderRadius")||0,D=se("nodeGroup",qT);if(!D)return;if(l.add(D),D.x=c.x||0,D.y=c.y||0,D.markRedraw(),ux(D).nodeWidth=d,ux(D).nodeHeight=g,c.isAboveViewRoot)return D;var O=se("background",rR,u,tle);O&&U(D,O,T&&c.upperLabelHeight);var R=f.getModel("emphasis"),F=R.get("focus"),H=R.get("blurScope"),W=R.get("disabled"),V=F==="ancestor"?o.getAncestorsIndices():F==="descendant"?o.getDescendantIndices():F;if(T)np(D)&&fu(D,!1),O&&(fu(O,!W),h.setItemGraphicEl(o.dataIndex,O),tT(O,V,H));else{var z=se("content",rR,u,rle);z&&$(D,z),O.disableMorphing=!0,O&&np(O)&&fu(O,!1),fu(D,!W),h.setItemGraphicEl(o.dataIndex,D);var Z=f.getShallow("cursor");Z&&z.attr("cursor",Z),tT(D,V,H)}return D;function U(me,ye,Me){var pe=De(ye);if(pe.dataIndex=o.dataIndex,pe.seriesIndex=e.seriesIndex,ye.setShape({x:0,y:0,width:d,height:g,r:N}),y)Y(ye);else{ye.invisible=!1;var Te=o.getVisual("style"),st=Te.stroke,ze=oR(M);ze.fill=st;var et=Jl(A);et.fill=A.get("borderColor");var lt=Jl(P);lt.fill=P.get("borderColor");var Et=Jl(I);if(Et.fill=I.get("borderColor"),Me){var lr=d-2*m;te(ye,st,Te.opacity,{x:m,y:0,width:lr,height:S})}else ye.removeTextContent();ye.setStyle(ze),ye.ensureState("emphasis").style=et,ye.ensureState("blur").style=lt,ye.ensureState("select").style=Et,zu(ye)}me.add(ye)}function $(me,ye){var Me=De(ye);Me.dataIndex=o.dataIndex,Me.seriesIndex=e.seriesIndex;var pe=Math.max(d-2*m,0),Te=Math.max(g-2*m,0);if(ye.culling=!0,ye.setShape({x:m,y:m,width:pe,height:Te,r:N}),y)Y(ye);else{ye.invisible=!1;var st=o.getVisual("style"),ze=st.fill,et=oR(M);et.fill=ze,et.decal=st.decal;var lt=Jl(A),Et=Jl(P),lr=Jl(I);te(ye,ze,st.opacity,null),ye.setStyle(et),ye.ensureState("emphasis").style=lt,ye.ensureState("blur").style=Et,ye.ensureState("select").style=lr,zu(ye)}me.add(ye)}function Y(me){!me.invisible&&a.push(me)}function te(me,ye,Me,pe){var Te=f.getModel(pe?aR:iR),st=br(f.get("name"),null),ze=Te.getShallow("show");Dr(me,Cr(f,pe?aR:iR),{defaultText:ze?st:null,inheritColor:ye,defaultOpacity:Me,labelFetcher:e,labelDataIndex:o.dataIndex});var et=me.getTextContent();if(et){var lt=et.style,Et=Rp(lt.padding||0);pe&&(me.setTextConfig({layoutRect:pe}),et.disableLabelLayout=!0),et.beforeUpdate=function(){var Mr=Math.max((pe?pe.width:me.shape.width)-Et[1]-Et[3],0),Gn=Math.max((pe?pe.height:me.shape.height)-Et[0]-Et[2],0);(lt.width!==Mr||lt.height!==Gn)&&et.setStyle({width:Mr,height:Gn})},lt.truncateMinChar=2,lt.lineOverflow="truncate",ie(lt,pe,c);var lr=et.getState("emphasis");ie(lr?lr.style:null,pe,c)}}function ie(me,ye,Me){var pe=me?me.text:null;if(!ye&&Me.isLeafRoot&&pe!=null){var Te=e.get("drillDownIcon",!0);me.text=Te?Te+" "+pe:pe}}function se(me,ye,Me,pe){var Te=_!=null&&r[me][_],st=i[me];return Te?(r[me][_]=null,le(st,Te)):y||(Te=new ye,Te instanceof Ri&&(Te.z2=ale(Me,pe)),Ee(st,Te)),t[me][x]=Te}function le(me,ye){var Me=me[x]={};ye instanceof qT?(Me.oldX=ye.x,Me.oldY=ye.y):Me.oldShape=Q({},ye.shape)}function Ee(me,ye){var Me=me[x]={},pe=o.parentNode,Te=ye instanceof Ce;if(pe&&(!n||n.direction==="drillDown")){var st=0,ze=0,et=i.background[pe.getRawIndex()];!n&&et&&et.oldShape&&(st=et.oldShape.width,ze=et.oldShape.height),Te?(Me.oldX=0,Me.oldY=ze):Me.oldShape={x:st,y:ze,width:0,height:0}}Me.fadein=!Te}}function ale(e,t){return e*ele+t}var xp=j,ole=ke,cx=-1,Ir=function(){function e(t){var r=t.mappingMethod,n=t.type,i=this.option=Se(t);this.type=n,this.mappingMethod=r,this._normalizeData=ule[r];var a=e.visualHandlers[n];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[r],r==="piecewise"?(xw(i),sle(i)):r==="category"?i.categories?lle(i):xw(i,!0):(Jr(r!=="linear"||i.dataExtent),xw(i))}return e.prototype.mapValueToVisual=function(t){var r=this._normalizeData(t);return this._normalizedToVisual(r,t)},e.prototype.getNormalizer=function(){return fe(this._normalizeData,this)},e.listVisualTypes=function(){return Qe(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(t,r,n){ke(t)?j(t,r,n):r.call(n,t)},e.mapVisual=function(t,r,n){var i,a=re(t)?[]:ke(t)?{}:(i=!0,null);return e.eachVisual(t,function(o,s){var l=r.call(n,o,s);i?a=l:a[s]=l}),a},e.retrieveVisuals=function(t){var r={},n;return t&&xp(e.visualHandlers,function(i,a){t.hasOwnProperty(a)&&(r[a]=t[a],n=!0)}),n?r:null},e.prepareVisualTypes=function(t){if(re(t))t=t.slice();else if(ole(t)){var r=[];xp(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 xw(e,t){var r=e.visual,n=[];ke(r)?xp(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]),GW(e,n)}function Gm(e){return{applyVisual:function(t,r,n){var i=this.mapValueToVisual(t);n("color",e(r("color"),i))},_normalizedToVisual:KT([0,1])}}function sR(e){var t=this.option.visual;return t[Math.round(ht(e,[0,1],[0,t.length-1],!0))]||{}}function Ld(e){return function(t,r,n){n(e,this.mapValueToVisual(t))}}function Kd(e){var t=this.option.visual;return t[this.option.loop&&e!==cx?e%t.length:e]}function Ql(){return this.option.visual[0]}function KT(e){return{linear:function(t){return ht(t,e,this.option.visual,!0)},category:Kd,piecewise:function(t,r){var n=JT.call(this,r);return n==null&&(n=ht(t,e,this.option.visual,!0)),n},fixed:Ql}}function JT(e){var t=this.option,r=t.pieceList;if(t.hasSpecialVisual){var n=Ir.findPieceIndex(e,r),i=r[n];if(i&&i.visual)return i.visual[this.type]}}function GW(e,t){return e.visual=t,e.type==="color"&&(e.parsedVisual=ae(t,function(r){var n=fn(r);return n||[0,0,0,1]})),t}var ule={linear:function(e){return ht(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,r=Ir.findPieceIndex(e,t,!0);if(r!=null)return ht(r,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return t??cx},fixed:qt};function Wm(e,t,r){return e?t<=r:t=r.length||m===r[m.depth]){var x=ple(i,l,m,y,g,n);HW(m,x,r,n)}})}}}function fle(e,t,r){var n=Q({},t),i=r.designatedVisualItemStyle;return j(["color","colorAlpha","colorSaturation"],function(a){i[a]=t[a];var o=e.get(a);i[a]=null,o!=null&&(n[a]=o)}),n}function lR(e){var t=_w(e,"color");if(t){var r=_w(e,"colorAlpha"),n=_w(e,"colorSaturation");return n&&(t=Io(t,null,null,n)),r&&(t=Jv(t,r)),t}}function dle(e,t){return t!=null?Io(t,null,null,e):null}function _w(e,t){var r=e[t];if(r!=null&&r!=="none")return r}function vle(e,t,r,n,i,a){if(!(!a||!a.length)){var o=bw(t,"color")||i.color!=null&&i.color!=="none"&&(bw(t,"colorAlpha")||bw(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"),h={type:o.name,dataExtent:u,visual:o.range};h.type==="color"&&(c==="index"||c==="id")?(h.mappingMethod="category",h.loop=!0):h.mappingMethod="linear";var f=new Ir(h);return WW(f).drColorMappingBy=c,f}}}function bw(e,t){var r=e.get(t);return re(r)&&r.length?{name:t,range:r}:null}function ple(e,t,r,n,i,a){var o=Q({},t);if(i){var s=i.type,l=s==="color"&&WW(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 _p=Math.max,hx=Math.min,uR=Fr,Pk=j,UW=["itemStyle","borderWidth"],gle=["itemStyle","gapWidth"],mle=["upperLabel","show"],yle=["upperLabel","height"];const xle={seriesType:"treemap",reset:function(e,t,r,n){var i=e.option,a=Tr(e,r).refContainer,o=It(e.getBoxLayoutParams(),a),s=i.size||[],l=ce(uR(o.width,s[0]),a.width),u=ce(uR(o.height,s[1]),a.height),c=n&&n.type,h=["treemapZoomToNode","treemapRootToNode"],f=yp(n,h,e),d=c==="treemapRender"||c==="treemapMove"?n.rootRect:null,g=e.getViewRoot(),m=BW(g);if(c!=="treemapMove"){var y=c==="treemapZoomToNode"?Tle(e,f,g,l,u):d?[d.width,d.height]:[l,u],x=i.sort;x&&x!=="asc"&&x!=="desc"&&(x="desc");var _={squareRatio:i.squareRatio,sort:x,leafDepth:i.leafDepth};g.hostTree.clearLayouts();var w={x:0,y:0,width:y[0],height:y[1],area:y[0]*y[1]};g.setLayout(w),ZW(g,_,!1,0),w=g.getLayout(),Pk(m,function(T,M){var A=(m[M+1]||g).getValue();T.setLayout(Q({dataExtent:[A,A],borderWidth:0,upperHeight:0},w))})}var S=e.getData().tree.root;S.setLayout(Mle(o,d,f),!0),e.setLayoutInfo(o),$W(S,new Pe(-o.x,-o.y,r.getWidth(),r.getHeight()),m,g,0)}};function ZW(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(UW),u=s.get(gle)/2,c=YW(s),h=Math.max(l,c),f=l-u,d=h-u;e.setLayout({borderWidth:l,upperHeight:h,upperLabelHeight:c},!0),i=_p(i-2*f,0),a=_p(a-f-d,0);var g=i*a,m=_le(e,s,g,t,r,n);if(m.length){var y={x:f,y:d,width:i,height:a},x=hx(i,a),_=1/0,w=[];w.area=0;for(var S=0,T=m.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 Cle(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?_p(u*n/l,l/(u*i)):1/0}function cR(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 h=0,f=e.length;hHC&&(u=HC),a=s}un&&(n=t);var a=n%2?n+2:n+3;i=[];for(var o=0;o0&&(T[0]=-T[0],T[1]=-T[1]);var A=S[0]<0?-1:1;if(a.__position!=="start"&&a.__position!=="end"){var P=-Math.atan2(S[1],S[0]);h[0].8?"left":f[0]<-.8?"right":"center",m=f[1]>.8?"top":f[1]<-.8?"bottom":"middle";break;case"start":a.x=-f[0]*x+c[0],a.y=-f[1]*_+c[1],g=f[0]>.8?"right":f[0]<-.8?"left":"center",m=f[1]>.8?"bottom":f[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":a.x=x*A+c[0],a.y=c[1]+I,g=S[0]<0?"right":"left",a.originX=-x*A,a.originY=-I;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=M[0],a.y=M[1]+I,g="center",a.originY=-I;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-x*A+h[0],a.y=h[1]+I,g=S[0]>=0?"right":"left",a.originX=x*A,a.originY=-I;break}a.scaleX=a.scaleY=o,a.setStyle({verticalAlign:a.__verticalAlign||m,align:a.__align||g})}},t}(Ce),Rk=function(){function e(t){this.group=new Ce,this._LineCtor=t||jk}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=gR(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=gR(t),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(t,r){this._progressiveEls=[];function n(s){!s.isGroup&&!Wle(s)&&(s.incremental=!0,s.ensureState("emphasis").hoverLayer=!0)}for(var i=t.start;i0}function gR(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:Cr(t)}}function mR(e){return isNaN(e[0])||isNaN(e[1])}function Mw(e){return e&&!mR(e[0])&&!mR(e[1])}var Aw=[],kw=[],Lw=[],Dc=Br,Nw=Vs,yR=Math.abs;function xR(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){Aw[0]=Dc(n[0],i[0],a[0],c),Aw[1]=Dc(n[1],i[1],a[1],c);var h=yR(Nw(Aw,t)-l);h=0?s=s+u:s=s-u:g>=0?s=s-u:s=s+u}return s}function Pw(e,t){var r=[],n=qv,i=[[],[],[]],a=[[],[]],o=[];t/=2,e.eachEdge(function(s,l){var u=s.getLayout(),c=s.getVisual("fromSymbol"),h=s.getVisual("toSymbol");u.__original||(u.__original=[Ga(u[0]),Ga(u[1])],u[2]&&u.__original.push(Ga(u[2])));var f=u.__original;if(u[2]!=null){if(ln(i[0],f[0]),ln(i[1],f[2]),ln(i[2],f[1]),c&&c!=="none"){var d=Qd(s.node1),g=xR(i,f[0],d*t);n(i[0][0],i[1][0],i[2][0],g,r),i[0][0]=r[3],i[1][0]=r[4],n(i[0][1],i[1][1],i[2][1],g,r),i[0][1]=r[3],i[1][1]=r[4]}if(h&&h!=="none"){var d=Qd(s.node2),g=xR(i,f[1],d*t);n(i[0][0],i[1][0],i[2][0],g,r),i[1][0]=r[1],i[2][0]=r[2],n(i[0][1],i[1][1],i[2][1],g,r),i[1][1]=r[1],i[2][1]=r[2]}ln(u[0],i[0]),ln(u[1],i[2]),ln(u[2],i[1])}else{if(ln(a[0],f[0]),ln(a[1],f[1]),Ts(o,a[1],a[0]),Xu(o,o),c&&c!=="none"){var d=Qd(s.node1);x0(a[0],a[0],o,d*t)}if(h&&h!=="none"){var d=Qd(s.node2);x0(a[1],a[1],o,-d*t)}ln(u[0],a[0]),ln(u[1],a[1])}})}var t8=Ye();function Hle(e){if(e)return t8(e).bridge}function _R(e,t){e&&(t8(e).bridge=t)}function bR(e){return e.type==="view"}var Ule=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 Kp,a=new Rk,o=this.group,s=new Ce;this._controller=new rc(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(bR(o)){var h={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?this._mainGroup.attr(h):it(this._mainGroup,h,r)}Pw(r.getGraph(),Jd(r));var f=r.getData();u.updateData(f);var d=r.getEdgeData();c.updateData(d),this._updateNodeAndLinkScale(),this._updateController(null,r,i),clearTimeout(this._layoutTimeout);var g=r.forceLayout,m=r.get(["force","layoutAnimation"]);g&&(s=!0,this._startForceLayoutIteration(g,i,m));var y=r.get("layout");f.graph.eachNode(function(S){var T=S.dataIndex,M=S.getGraphicEl(),A=S.getModel();if(M){M.off("drag").off("dragend");var P=A.get("draggable");P&&M.on("drag",function(N){switch(y){case"force":g.warmUp(),!a._layouting&&a._startForceLayoutIteration(g,i,m),g.setFixed(T),f.setItemLayout(T,[M.x,M.y]);break;case"circular":f.setItemLayout(T,[M.x,M.y]),S.setLayout({fixed:!0},!0),Ek(r,"symbolSize",S,[N.offsetX,N.offsetY]),a.updateLayout(r);break;case"none":default:f.setItemLayout(T,[M.x,M.y]),Dk(r.getGraph(),r),a.updateLayout(r);break}}).on("dragend",function(){g&&g.setUnfixed(T)}),M.setDraggable(P,!!A.get("cursor"));var I=A.get(["emphasis","focus"]);I==="adjacency"&&(De(M).focus=S.getAdjacentDataIndices())}}),f.graph.eachEdge(function(S){var T=S.getGraphicEl(),M=S.getModel().get(["emphasis","focus"]);T&&M==="adjacency"&&(De(T).focus={edge:[S.dataIndex],node:[S.node1.dataIndex,S.node2.dataIndex]})});var x=r.get("layout")==="circular"&&r.get(["circular","rotateLabel"]),_=f.getLayout("cx"),w=f.getLayout("cy");f.graph.eachNode(function(S){JW(S,x,_,w)}),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(!bR(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&&(Ck(this._controllerHost,i.dx,i.dy),this._updateThumbnailWindow())},t.prototype.updateViewOnZoom=function(r,n,i){this._active&&(Tk(this._controllerHost,i.zoom,i.originX,i.originY),this._updateNodeAndLinkScale(),Pw(r.getGraph(),Jd(r)),this._lineDraw.updateLayout(),n.updateLabelLayout(),this._updateThumbnailWindow())},t.prototype._updateNodeAndLinkScale=function(){var r=this._model,n=r.getData(),i=Jd(r);n.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(i)})},t.prototype.updateLayout=function(r){this._active&&(Pw(r.getGraph(),Jd(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=Hle(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 Ce,l=i.group.children(),u=a.group.children(),c=new Ce,h=new Ce;s.add(h),s.add(c);for(var f=0;f=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 eu||(r=this._nodesMap[Ec(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(g)&&(t.set(g,!0),o.push(d.node1))}for(l=0;l=0&&!t.hasKey(w)&&(t.set(w,!0),s.push(_.node2))}}}return{edge:t.keys(),node:r.keys()}},e}(),r8=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(h)&&(t.set(h,!0),n.push(c.node1))}for(a=0;a=0&&!t.hasKey(m)&&(t.set(m,!0),i.push(g.node2))}return{edge:t.keys(),node:r.keys()}},e}();function n8(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)}}}Qt(eu,n8("hostGraph","data"));Qt(r8,n8("hostGraph","edgeData"));function Ok(e,t,r,n,i){for(var a=new Zle(n),o=0;o "+f)),u++)}var d=r.get("coordinateSystem"),g;if(d==="cartesian2d"||d==="polar"||d==="matrix")g=no(e,r);else{var m=mf.get(d),y=m?m.dimensions||[]:[];Ve(y,"value")<0&&y.concat(["value"]);var x=bf(e,{coordDimensions:y,encodeDefine:r.getEncode()}).dimensions;g=new dn(x,r),g.initData(e)}var _=new dn(["value"],r);return _.initData(l,s),i&&i(g,_),OW({mainData:g,struct:a,structAttr:"graph",datas:{node:g,edge:_},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var $le=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 Mf(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),ju(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){Dle(this);var s=Ok(a,i,this,!0,l);return j(s.edges,function(u){Ele(u.node1,u.node2,this,u.dataIndex)},this),s.data}function l(u,c){u.wrapMethod("getItemModel",function(g){var m=o._categoriesModels,y=g.getShallow("category"),x=m[y];return x&&(x.parentModel=g.parentModel,g.parentModel=x),g});var h=qe.prototype.getModel;function f(g,m){var y=h.call(this,g,m);return y.resolveParentPath=d,y}c.wrapMethod("getItemModel",function(g){return g.resolveParentPath=d,g.getModel=f,g});function d(g){if(g&&(g[0]==="label"||g[1]==="label")){var m=g.slice();return g[0]==="label"?m[0]="edgeLabel":g[1]==="label"&&(m[1]="edgeLabel"),m}return g}}},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),gr("nameValue",{name:c.join(" > "),value:o.value,noValue:o.value==null})}var h=o6({series:this,dataIndex:r,multipleSeries:n});return h},t.prototype._updateCategoriesData=function(){var r=ae(this.option.categories||[],function(i){return i.value!=null?i:Q({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}(bt);function Yle(e){e.registerChartView(Ule),e.registerSeriesModel($le),e.registerProcessor(kle),e.registerVisual(Lle),e.registerVisual(Nle),e.registerLayout(jle),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,Ole),e.registerLayout(Ble),e.registerCoordinateSystem("graphView",{dimensions:nc.dimensions,create:Vle}),e.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},qt),e.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},qt),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=j_(o,t,i.get("scaleLimit"));i.setCenter&&i.setCenter(s.center),i.setZoom&&i.setZoom(s.zoom)})})}var wR=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 tt;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"),h=r.getItemLayout(n),f=Q(Ba(u.getModel("itemStyle"),h,!0),h),d=this;if(isNaN(f.startAngle)){d.setShape(f);return}a?d.setShape(f):it(d,{shape:f},l,n);var g=Q(Ba(u.getModel("itemStyle"),h,!0),h);o.setShape(g),o.useStyle(r.getItemVisual(n,"style")),Sr(o,u),this._updateLabel(l,u,s),r.setItemGraphicEl(n,d),Sr(d,u,"itemStyle");var m=c.get("focus");Dt(this,m==="adjacency"?s.getAdjacentDataIndices():m,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 h=Cr(n),f=i.getVisual("style");Dr(a,h,{labelFetcher:{getFormattedLabel:function(_,w,S,T,M,A){return r.getFormattedLabel(_,w,"node",T,zn(M,h.normal&&h.normal.get("formatter"),n.get("name")),A)}},labelDataIndex:i.dataIndex,defaultText:i.dataIndex+"",inheritColor:f.fill,defaultOpacity:f.opacity,defaultOutsidePosition:"startArc"});var d=c.get("position")||"outside",g=c.get("distance")||0,m;d==="outside"?m=o.r+g:m=(o.r+o.r0)/2,this.textConfig={inside:d!=="outside"};var y=d!=="outside"?c.get("align")||"center":l>0?"left":"right",x=d!=="outside"?c.get("verticalAlign")||"middle":u>0?"top":"bottom";a.attr({x:l*m+o.cx,y:u*m+o.cy,rotation:0,style:{align:y,verticalAlign:x}})},t}(Qr),Xle=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(),h=n.getItemModel(l.dataIndex),f=h.getModel("lineStyle"),d=h.getModel("emphasis"),g=d.get("focus"),m=Q(Ba(c.getModel("itemStyle"),u,!0),u),y=this;if(isNaN(m.sStartAngle)||isNaN(m.tStartAngle)){y.setShape(m);return}o?(y.setShape(m),SR(y,l,r,f)):(Oi(y),SR(y,l,r,f),it(y,{shape:m},s,i)),Dt(this,g==="adjacency"?l.getAdjacentDataIndices():g,d.get("blurScope"),d.get("disabled")),Sr(y,h,"lineStyle"),n.setItemGraphicEl(l.dataIndex,y)},t}(Ke);function SR(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(he(l)&&he(u)){var c=e.shape,h=(c.s1[0]+c.s2[0])/2,f=(c.s1[1]+c.s2[1])/2,d=(c.t1[0]+c.t2[0])/2,g=(c.t1[1]+c.t2[1])/2;o.fill=new qu(h,f,d,g,[{offset:0,color:l},{offset:1,color:u}],!0)}break}}var qle=Math.PI/180,Kle=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")*qle;if(a.diff(o).add(function(c){var h=a.getItemLayout(c);if(h){var f=new wR(a,c,l);De(f).dataIndex=c,s.add(f)}}).update(function(c,h){var f=o.getItemGraphicEl(h),d=a.getItemLayout(c);if(!d){f&&Do(f,r,h);return}f?f.updateData(a,c,l):f=new wR(a,c,l),s.add(f)}).remove(function(c){var h=o.getItemGraphicEl(c);h&&Do(h,r,c)}).execute(),!o){var u=r.get("center");this.group.scaleX=.01,this.group.scaleY=.01,this.group.originX=ce(u[0],i.getWidth()),this.group.originY=ce(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 Xle(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&&Do(u,r,l)}).execute(),this._edgeData=a},t.prototype.dispose=function(){},t.type="chord",t}(gt),Jle=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 Mf(fe(this.getData,this),fe(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=Ok(a,i,this,!0,s);return o.data}function s(l,u){var c=qe.prototype.getModel;function h(d,g){var m=c.call(this,d,g);return m.resolveParentPath=f,m}u.wrapMethod("getItemModel",function(d){return d.resolveParentPath=f,d.getModel=h,d});function f(d){if(d&&(d[0]==="label"||d[1]==="label")){var g=d.slice();return d[0]==="label"?g[0]="edgeLabel":d[1]==="label"&&(g[1]="edgeLabel"),g}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),gr("nameValue",{name:c.join(" > "),value:a.value,noValue:a.value==null})}return gr("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}(bt),Iw=Math.PI/180;function Qle(e,t){e.eachSeriesByType("chord",function(r){eue(r,t)})}function eue(e,t){var r=e.getData(),n=r.graph,i=e.getEdgeData(),a=i.count();if(a){var o=TV(e,t),s=o.cx,l=o.cy,u=o.r,c=o.r0,h=Math.max((e.get("padAngle")||0)*Iw,0),f=Math.max((e.get("minAngle")||0)*Iw,0),d=-e.get("startAngle")*Iw,g=d+Math.PI*2,m=e.get("clockwise"),y=m?1:-1,x=[d,g];m_(x,!m);var _=x[0],w=x[1],S=w-_,T=r.getSum("value")===0&&i.getSum("value")===0,M=[],A=0;n.eachEdge(function(z){var Z=T?1:z.getValue("value");T&&(Z>0||f)&&(A+=2);var U=z.node1.dataIndex,$=z.node2.dataIndex;M[U]=(M[U]||0)+Z,M[$]=(M[$]||0)+Z});var P=0;if(n.eachNode(function(z){var Z=z.getValue("value");isNaN(Z)||(M[z.dataIndex]=Math.max(Z,M[z.dataIndex]||0)),!T&&(M[z.dataIndex]>0||f)&&A++,P+=M[z.dataIndex]||0}),!(A===0||P===0)){h*A>=Math.abs(S)&&(h=Math.max(0,(Math.abs(S)-f*A)/A)),(h+f)*A>=Math.abs(S)&&(f=(Math.abs(S)-h*A)/A);var I=(S-h*A*y)/P,N=0,D=0,O=0;n.eachNode(function(z){var Z=M[z.dataIndex]||0,U=I*(P?Z:1)*y;Math.abs(U)D){var F=N/D;n.eachNode(function(z){var Z=z.getLayout().angle;Math.abs(Z)>=f?z.setLayout({angle:Z*F,ratio:F},!0):z.setLayout({angle:f,ratio:f===0?1:Z/f},!0)})}else n.eachNode(function(z){if(!R){var Z=z.getLayout().angle,U=Math.min(Z/O,1),$=U*N;Z-$f&&f>0){var U=R?1:Math.min(Z/O,1),$=Z-f,Y=Math.min($,Math.min(H,N*U));H-=Y,z.setLayout({angle:Z-Y,ratio:(Z-Y)/Z},!0)}else f>0&&z.setLayout({angle:f,ratio:Z===0?1:f/Z},!0)}});var W=_,V=[];n.eachNode(function(z){var Z=Math.max(z.getLayout().angle,f);z.setLayout({cx:s,cy:l,r0:c,r:u,startAngle:W,endAngle:W+Z*y,clockwise:m},!0),V[z.dataIndex]=W,W+=(Z+h)*y}),n.eachEdge(function(z){var Z=T?1:z.getValue("value"),U=I*(P?Z:1)*y,$=z.node1.dataIndex,Y=V[$]||0,te=Math.abs((z.node1.getLayout().ratio||1)*U),ie=Y+te*y,se=[s+c*Math.cos(Y),l+c*Math.sin(Y)],le=[s+c*Math.cos(ie),l+c*Math.sin(ie)],Ee=z.node2.dataIndex,me=V[Ee]||0,ye=Math.abs((z.node2.getLayout().ratio||1)*U),Me=me+ye*y,pe=[s+c*Math.cos(me),l+c*Math.sin(me)],Te=[s+c*Math.cos(Me),l+c*Math.sin(Me)];z.setLayout({s1:se,s2:le,sStartAngle:Y,sEndAngle:ie,t1:pe,t2:Te,tStartAngle:me,tEndAngle:Me,cx:s,cy:l,r:c,value:Z,clockwise:m}),V[$]=ie,V[Ee]=Me})}}}function tue(e){e.registerChartView(Kle),e.registerSeriesModel(Jle),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,Qle),e.registerProcessor(Cf("chord"))}var rue=function(){function e(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return e}(),nue=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 rue},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}(Ke);function iue(e,t){var r=e.get("center"),n=t.getWidth(),i=t.getHeight(),a=Math.min(n,i),o=ce(r[0],t.getWidth()),s=ce(r[1],t.getHeight()),l=ce(e.get("radius"),a/2);return{cx:o,cy:s,r:l}}function Um(e,t){var r=e==null?"":e+"";return t&&(he(t)?r=t.replace("{value}",r):we(t)&&(r=t(e))),r}var aue=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=iue(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,h=r.getModel("axisLine"),f=h.get("roundCap"),d=f?ix:Qr,g=h.get("show"),m=h.getModel("lineStyle"),y=m.get("width"),x=[u,c];m_(x,!l),u=x[0],c=x[1];for(var _=c-u,w=u,S=[],T=0;g&&T=I&&(N===0?0:a[N-1][0])Math.PI/2&&(ie+=Math.PI)):te==="tangential"?ie=-P-Math.PI/2:rt(te)&&(ie=te*Math.PI/180),ie===0?h.add(new tt({style:Ct(w,{text:Z,x:$,y:Y,verticalAlign:H<-.8?"top":H>.8?"bottom":"middle",align:F<-.4?"left":F>.4?"right":"center"},{inheritColor:U}),silent:!0})):h.add(new tt({style:Ct(w,{text:Z,x:$,y:Y,verticalAlign:"middle",align:"center"},{inheritColor:U}),silent:!0,originX:$,originY:Y,rotation:ie}))}if(_.get("show")&&W!==S){var V=_.get("distance");V=V?V+c:c;for(var se=0;se<=T;se++){F=Math.cos(P),H=Math.sin(P);var le=new ar({shape:{x1:F*(g-V)+f,y1:H*(g-V)+d,x2:F*(g-A-V)+f,y2:H*(g-A-V)+d},silent:!0,style:O});O.stroke==="auto"&&le.setStyle({stroke:a((W+se/T)/S)}),h.add(le),P+=N}P-=N}else P+=I}},t.prototype._renderPointer=function(r,n,i,a,o,s,l,u,c){var h=this.group,f=this._data,d=this._progressEls,g=[],m=r.get(["pointer","show"]),y=r.getModel("progress"),x=y.get("show"),_=r.getData(),w=_.mapDimension("value"),S=+r.get("min"),T=+r.get("max"),M=[S,T],A=[s,l];function P(N,D){var O=_.getItemModel(N),R=O.getModel("pointer"),F=ce(R.get("width"),o.r),H=ce(R.get("length"),o.r),W=r.get(["pointer","icon"]),V=R.get("offsetCenter"),z=ce(V[0],o.r),Z=ce(V[1],o.r),U=R.get("keepAspect"),$;return W?$=sr(W,z-F/2,Z-H,F,H,null,U):$=new nue({shape:{angle:-Math.PI/2,width:F,r:H,x:z,y:Z}}),$.rotation=-(D+Math.PI/2),$.x=o.cx,$.y=o.cy,$}function I(N,D){var O=y.get("roundCap"),R=O?ix:Qr,F=y.get("overlap"),H=F?y.get("width"):c/_.count(),W=F?o.r-H:o.r-(N+1)*H,V=F?o.r:o.r-N*H,z=new R({shape:{startAngle:s,endAngle:D,cx:o.cx,cy:o.cy,clockwise:u,r0:W,r:V}});return F&&(z.z2=ht(_.get(w,N),[S,T],[100,0],!0)),z}(x||m)&&(_.diff(f).add(function(N){var D=_.get(w,N);if(m){var O=P(N,s);Nt(O,{rotation:-((isNaN(+D)?A[0]:ht(D,M,A,!0))+Math.PI/2)},r),h.add(O),_.setItemGraphicEl(N,O)}if(x){var R=I(N,s),F=y.get("clip");Nt(R,{shape:{endAngle:ht(D,M,A,F)}},r),h.add(R),KC(r.seriesIndex,_.dataType,N,R),g[N]=R}}).update(function(N,D){var O=_.get(w,N);if(m){var R=f.getItemGraphicEl(D),F=R?R.rotation:s,H=P(N,F);H.rotation=F,it(H,{rotation:-((isNaN(+O)?A[0]:ht(O,M,A,!0))+Math.PI/2)},r),h.add(H),_.setItemGraphicEl(N,H)}if(x){var W=d[D],V=W?W.shape.endAngle:s,z=I(N,V),Z=y.get("clip");it(z,{shape:{endAngle:ht(O,M,A,Z)}},r),h.add(z),KC(r.seriesIndex,_.dataType,N,z),g[N]=z}}).execute(),_.each(function(N){var D=_.getItemModel(N),O=D.getModel("emphasis"),R=O.get("focus"),F=O.get("blurScope"),H=O.get("disabled");if(m){var W=_.getItemGraphicEl(N),V=_.getItemVisual(N,"style"),z=V.fill;if(W instanceof Er){var Z=W.style;W.useStyle(Q({image:Z.image,x:Z.x,y:Z.y,width:Z.width,height:Z.height},V))}else W.useStyle(V),W.type!=="pointer"&&W.setColor(z);W.setStyle(D.getModel(["pointer","itemStyle"]).getItemStyle()),W.style.fill==="auto"&&W.setStyle("fill",a(ht(_.get(w,N),M,[0,1],!0))),W.z2EmphasisLift=0,Sr(W,D),Dt(W,R,F,H)}if(x){var U=g[N];U.useStyle(_.getItemVisual(N,"style")),U.setStyle(D.getModel(["progress","itemStyle"]).getItemStyle()),U.z2EmphasisLift=0,Sr(U,D),Dt(U,R,F,H)}}),this._progressEls=g)},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=sr(s,n.cx-o/2+ce(l[0],n.r),n.cy-o/2+ce(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"),h=+r.get("max"),f=new Ce,d=[],g=[],m=r.isAnimationEnabled(),y=r.get(["pointer","showAbove"]);l.diff(this._data).add(function(x){d[x]=new tt({silent:!0}),g[x]=new tt({silent:!0})}).update(function(x,_){d[x]=s._titleEls[_],g[x]=s._detailEls[_]}).execute(),l.each(function(x){var _=l.getItemModel(x),w=l.get(u,x),S=new Ce,T=a(ht(w,[c,h],[0,1],!0)),M=_.getModel("title");if(M.get("show")){var A=M.get("offsetCenter"),P=o.cx+ce(A[0],o.r),I=o.cy+ce(A[1],o.r),N=d[x];N.attr({z2:y?0:2,style:Ct(M,{x:P,y:I,text:l.getName(x),align:"center",verticalAlign:"middle"},{inheritColor:T})}),S.add(N)}var D=_.getModel("detail");if(D.get("show")){var O=D.get("offsetCenter"),R=o.cx+ce(O[0],o.r),F=o.cy+ce(O[1],o.r),H=ce(D.get("width"),o.r),W=ce(D.get("height"),o.r),V=r.get(["progress","show"])?l.getItemVisual(x,"style").fill:T,N=g[x],z=D.get("formatter");N.attr({z2:y?0:2,style:Ct(D,{x:R,y:F,text:Um(w,z),width:isNaN(H)?null:H,height:isNaN(W)?null:W,align:"center",verticalAlign:"middle"},{inheritColor:V})}),sV(N,{normal:D},w,function(U){return Um(U,z)}),m&&lV(N,x,l,r,{getFormattedLabel:function(U,$,Y,te,ie,se){return Um(se?se.interpolatedValue:w,z)}}),S.add(N)}f.add(S)}),this.group.add(f),this._titleEls=d,this._detailEls=g},t.type="gauge",t}(gt),oue=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 Tf(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}(bt);function sue(e){e.registerChartView(aue),e.registerSeriesModel(oue)}var lue=["itemStyle","opacity"],uue=function(e){q(t,e);function t(r,n){var i=e.call(this)||this,a=i,o=new Gr,s=new tt;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(lue);c=c??1,i||Oi(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)):it(a,{style:{opacity:c},shape:{points:l.points}},o,n),Sr(a,s),this._updateLabel(r,n),Dt(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,h=r.getItemVisual(n,"style"),f=h.fill;Dr(o,Cr(l),{labelFetcher:r.hostModel,labelDataIndex:n,defaultOpacity:h.opacity,defaultText:r.getName(n)},{normal:{align:c.textAlign,verticalAlign:c.verticalAlign}});var d=l.getModel("label"),g=d.get("color"),m=g==="inherit"?f:null;i.setTextConfig({local:!0,inside:!!c.inside,insideStroke:m,outsideFill:m});var y=c.linePoints;a.setShape({points:y}),i.textGuideLineConfig={anchor:y?new Ne(y[0][0],y[0][1]):null},it(o,{style:{x:c.x,y:c.y}},s,n),o.attr({rotation:c.rotation,originX:c.x,originY:c.y,z2:10}),ck(i,hk(l),{stroke:f})},t}(en),cue=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 uue(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);Do(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}(gt),hue=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 Mf(fe(this.getData,this),fe(this.getRawData,this)),this._defaultLabelLine(r)},t.prototype.getInitialData=function(r,n){return Tf(this,{coordDimensions:["value"],encodeDefaulter:Fe(zA,this)})},t.prototype._defaultLabelLine=function(r){ju(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}(bt);function fue(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();okue)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||!Ew(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 Ew(e,t){var r=e._model;return r.get("axisExpandable")&&r.get("axisExpandTriggerOn")===t}var Pue=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&&Ge(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){j(["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=ot(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(a){return(a.get("parallelIndex")||0)===this.componentIndex},this);j(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}($e),Iue=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}(Vi);function rl(e,t,r,n,i,a){e=e||0;var o=r[1]-r[0];if(i!=null&&(i=jc(i,[0,o])),a!=null&&(a=Math.max(a,i??0)),n==="all"){var s=Math.abs(t[1]-t[0]);s=jc(s,[0,o]),i=a=jc(s,[i,a]),n=0}t[0]=jc(t[0],r),t[1]=jc(t[1],r);var l=jw(t,n);t[n]+=e;var u=i||0,c=r.slice();l.sign<0?c[0]+=u:c[1]-=u,t[n]=jc(t[n],c);var h;return h=jw(t,n),i!=null&&(h.sign!==l.sign||h.spana&&(t[1-n]=t[n]+h.sign*a),t}function jw(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 jc(e,t){return Math.min(t[1]!=null?t[1]:1/0,Math.max(t[0]!=null?t[0]:-1/0,e))}var Rw=j,a8=Math.min,o8=Math.max,MR=Math.floor,Due=Math.ceil,AR=ir,Eue=Math.PI,jue=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;Rw(i,function(o,s){var l=a[s],u=r.getComponent("parallelAxis",l),c=this._axesMap.set(o,new Iue(o,Xp(u),[0,0],u.get("type"),l)),h=c.type==="category";c.onBand=h&&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();Rw(this.dimensions,function(a){var o=this._axesMap.get(a);o.scale.unionExtentFromData(i,i.mapDimension(a)),Gu(o.scale,o.model)},this)}},this)},e.prototype.resize=function(t,r){var n=Tr(t,r).refContainer;this._rect=It(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=Zm(t.get("axisExpandWidth"),l),h=Zm(t.get("axisExpandCount")||0,[0,u]),f=t.get("axisExpandable")&&u>3&&u>h&&h>1&&c>0&&s>0,d=t.get("axisExpandWindow"),g;if(d)g=Zm(d[1]-d[0],l),d[1]=d[0]+g;else{g=Zm(c*(h-1),l);var m=t.get("axisExpandCenter")||MR(u/2);d=[c*m-g/2],d[1]=d[0]+g}var y=(s-g)/(u-h);y<3&&(y=0);var x=[MR(AR(d[0]/c,1))+1,Due(AR(d[1]/c,1))-1],_=y/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:f,axisExpandWidth:c,axisCollapseWidth:y,axisExpandWindow:d,axisCount:u,winInnerIndices:x,axisExpandWindow0Pos:_}},e.prototype._layoutAxes=function(){var t=this._rect,r=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),a=i.layout;r.each(function(o){var s=[0,i.axisLength],l=o.inverse?1:0;o.setExtent(s[l],s[1-l])}),Rw(n,function(o,s){var l=(i.axisExpandable?Oue:Rue)(s,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},c={horizontal:Eue/2,vertical:0},h=[u[a].x+t.x,u[a].y+t.y],f=c[a],d=Pr();Ko(d,d,f),ha(d,d,h),this._axesLayout[o]={position:h,rotation:f,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=[];j(o,function(y){s.push(t.mapDimension(y)),l.push(a.get(y).model)});for(var u=this.hasAxisBrushed(),c=n;ca*(1-h[0])?(u="jump",l=s-a*(1-h[2])):(l=s-a*h[1])>=0&&(l=s-a*(1-h[1]))<=0&&(l=0),l*=r.axisExpandWidth/c,l?rl(l,i,o,"all"):u="none";else{var d=i[1]-i[0],g=o[1]*s/d;i=[o8(0,g-d/2)],i[1]=a8(o[1],i[0]+d),i[0]=i[1]-d}return{axisExpandWindow:i,behavior:u}},e}();function Zm(e,t){return a8(o8(e,t[0]),t[1])}function Rue(e,t){var r=t.layoutLength/(t.axisCount-1);return{position:r*e,axisNameAvailableWidth:r,axisLabelShow:!0}}function Oue(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--)Qn(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;aGue}function f8(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function d8(e,t,r,n){var i=new Ce;return i.add(new Ze({name:"main",style:Gk(r),silent:!0,draggable:!0,cursor:"move",drift:Fe(NR,e,t,i,["n","s","w","e"]),ondragend:Fe(Hu,t,{isEnd:!0})})),j(n,function(a){i.add(new Ze({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:Fe(NR,e,t,i,a),ondragend:Fe(Hu,t,{isEnd:!0})}))}),i}function v8(e,t,r,n){var i=n.brushStyle.lineWidth||0,a=Yh(i,Wue),o=r[0][0],s=r[1][0],l=o-i/2,u=s-i/2,c=r[0][1],h=r[1][1],f=c-a+i/2,d=h-a+i/2,g=c-o,m=h-s,y=g+i,x=m+i;mo(e,t,"main",o,s,g,m),n.transformable&&(mo(e,t,"w",l,u,a,x),mo(e,t,"e",f,u,a,x),mo(e,t,"n",l,u,y,a),mo(e,t,"s",l,d,y,a),mo(e,t,"nw",l,u,a,a),mo(e,t,"ne",f,u,a,a),mo(e,t,"sw",l,d,a,a),mo(e,t,"se",f,d,a,a))}function i2(e,t){var r=t.__brushOption,n=r.transformable,i=t.childAt(0);i.useStyle(Gk(r)),i.attr({silent:!n,cursor:n?"move":"default"}),j([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=t.childOfName(a.join("")),s=a.length===1?a2(e,a[0]):Xue(e,a);o&&o.attr({silent:!n,invisible:!n,cursor:n?Uue[s]+"-resize":null})})}function mo(e,t,r,n,i,a,o){var s=t.childOfName(r);s&&s.setShape(Kue(Wk(e,t,[[n,i],[n+a,i+o]])))}function Gk(e){return Ae({strokeNoScale:!0},e.brushStyle)}function p8(e,t,r,n){var i=[wp(e,r),wp(t,n)],a=[Yh(e,r),Yh(t,n)];return[[i[0],a[0]],[i[1],a[1]]]}function Yue(e){return Us(e.group)}function a2(e,t){var r={w:"left",e:"right",n:"top",s:"bottom"},n={left:"w",right:"e",top:"n",bottom:"s"},i=b_(r[t],Yue(e));return n[i]}function Xue(e,t){var r=[a2(e,t[0]),a2(e,t[1])];return(r[0]==="e"||r[0]==="w")&&r.reverse(),r.join("")}function NR(e,t,r,n,i,a){var o=r.__brushOption,s=e.toRectRange(o.range),l=g8(t,i,a);j(n,function(u){var c=Hue[u];s[c[0]][c[1]]+=l[c[0]]}),o.range=e.fromRectRange(p8(s[0][0],s[1][0],s[0][1],s[1][1])),Bk(t,r),Hu(t,{isEnd:!1})}function que(e,t,r,n){var i=t.__brushOption.range,a=g8(e,r,n);j(i,function(o){o[0]+=a[0],o[1]+=a[1]}),Bk(e,t),Hu(e,{isEnd:!1})}function g8(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 Wk(e,t,r){var n=h8(e,t);return n&&n!==Wu?n.clipPath(r,e._transform):Se(r)}function Kue(e){var t=wp(e[0][0],e[1][0]),r=wp(e[0][1],e[1][1]),n=Yh(e[0][0],e[1][0]),i=Yh(e[0][1],e[1][1]);return{x:t,y:r,width:n-t,height:i-r}}function Jue(e,t,r){if(!(!e._brushType||ece(e,t.offsetX,t.offsetY))){var n=e._zr,i=e._covers,a=Vk(e,t,r);if(!e._dragging)for(var o=0;on.getWidth()||r<0||r>n.getHeight()}var B_={lineX:DR(0),lineY:DR(1),rect:{createCover:function(e,t){function r(n){return n}return d8({toRectRange:r,fromRectRange:r},e,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(e){var t=f8(e);return p8(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,r,n){v8(e,t,r,n)},updateCommon:i2,contain:s2},polygon:{createCover:function(e,t){var r=new Ce;return r.add(new Gr({name:"main",style:Gk(t),silent:!0})),r},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new en({name:"main",draggable:!0,drift:Fe(que,e,t),ondragend:Fe(Hu,e,{isEnd:!0})}))},updateCoverShape:function(e,t,r,n){t.childAt(0).setShape({points:Wk(e,t,r)})},updateCommon:i2,contain:s2}};function DR(e){return{createCover:function(t,r){return d8({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=f8(t),n=wp(r[0][e],r[1][e]),i=Yh(r[0][e],r[1][e]);return[n,i]},updateCoverShape:function(t,r,n,i){var a,o=h8(t,r);if(o!==Wu&&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(),v8(t,r,l,i)},updateCommon:i2,contain:s2}}function y8(e){return e=Hk(e),function(t){return xA(t,e)}}function x8(e,t){return e=Hk(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 _8(e,t,r){var n=Hk(e);return function(i,a){return n.contain(a[0],a[1])&&!TW(i,t,r)}}function Hk(e){return Pe.create(e)}var tce=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 zk(n.getZr())).on("brush",fe(this._onBrush,this))},t.prototype.render=function(r,n,i,a){if(!rce(r,n,a)){this.axisModel=r,this.api=i,this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Ce,this.group.add(this._axisGroup),!!r.get("show")){var s=ice(r,n),l=s.coordinateSystem,u=r.getAreaSelectStyle(),c=u.width,h=r.axis.dim,f=l.getAxisLayout(h),d=Q({strokeContainThreshold:c},f),g=new wn(r,i,d);g.build(),this._axisGroup.add(g.group),this._refreshBrushController(d,u,r,s,c,i),Up(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),h=Pe.create({x:l[0],y:-o/2,width:u,height:o});h.x-=c,h.width+=2*c,this._brushController.mount({enableGlobalPan:!0,rotation:r.rotation,x:r.position[0],y:r.position[1]}).setPanels([{panelId:"pl",clipPath:y8(h),isTargetByCursor:_8(h,s,a),getLinearBrushOtherExtent:x8(h,0)}]).enableBrush({brushType:"lineX",brushStyle:n,removeOnClick:!0}).updateCovers(nce(i))},t.prototype._onBrush=function(r){var n=r.areas,i=this.axisModel,a=i.axis,o=ae(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}(Mt);function rce(e,t,r){return r&&r.type==="axisAreaSelect"&&t.findComponents({mainType:"parallelAxis",query:r})[0]===e}function nce(e){var t=e.axis;return ae(e.activeIntervals,function(r){return{brushType:"lineX",panelId:"pl",range:[t.dataToCoord(r[0],!0),t.dataToCoord(r[1],!0)]}})}function ice(e,t){return t.getComponent("parallel",e.get("parallelIndex"))}var ace={type:"axisAreaSelect",event:"axisAreaSelected"};function oce(e){e.registerAction(ace,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 sce={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function b8(e){e.registerComponentView(Lue),e.registerComponentModel(Pue),e.registerCoordinateSystem("parallel",Bue),e.registerPreprocessor(Tue),e.registerComponentModel(r2),e.registerComponentView(tce),Zh(e,"parallel",r2,sce),oce(e)}function lce(e){He(b8),e.registerChartView(mue),e.registerSeriesModel(_ue),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,Cue)}var uce=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}(),cce=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new uce},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(){Ho(this)},t.prototype.downplay=function(){Uo(this)},t}(Ke),hce=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r._mainGroup=new Ce,r._focusAdjacencyDisabled=!1,r}return t.prototype.init=function(r,n){this._controller=new rc(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,h=r.getData(),f=r.getData("edge"),d=r.get("orient");this._model=r,s.removeAll(),s.x=l.x,s.y=l.y,this._updateViewCoordSys(r,i),MW(r,i,s,this._controller,this._controllerHost,null),o.eachEdge(function(g){var m=new cce,y=De(m);y.dataIndex=g.dataIndex,y.seriesIndex=r.seriesIndex,y.dataType="edge";var x=g.getModel(),_=x.getModel("lineStyle"),w=_.get("curveness"),S=g.node1.getLayout(),T=g.node1.getModel(),M=T.get("localX"),A=T.get("localY"),P=g.node2.getLayout(),I=g.node2.getModel(),N=I.get("localX"),D=I.get("localY"),O=g.getLayout(),R,F,H,W,V,z,Z,U;m.shape.extent=Math.max(1,O.dy),m.shape.orient=d,d==="vertical"?(R=(M!=null?M*u:S.x)+O.sy,F=(A!=null?A*c:S.y)+S.dy,H=(N!=null?N*u:P.x)+O.ty,W=D!=null?D*c:P.y,V=R,z=F*(1-w)+W*w,Z=H,U=F*w+W*(1-w)):(R=(M!=null?M*u:S.x)+S.dx,F=(A!=null?A*c:S.y)+O.sy,H=N!=null?N*u:P.x,W=(D!=null?D*c:P.y)+O.ty,V=R*(1-w)+H*w,z=F,Z=R*w+H*(1-w),U=W),m.setShape({x1:R,y1:F,x2:H,y2:W,cpx1:V,cpy1:z,cpx2:Z,cpy2:U}),m.useStyle(_.getItemStyle()),ER(m.style,d,g);var $=""+x.get("value"),Y=Cr(x,"edgeLabel");Dr(m,Y,{labelFetcher:{getFormattedLabel:function(se,le,Ee,me,ye,Me){return r.getFormattedLabel(se,le,"edge",me,zn(ye,Y.normal&&Y.normal.get("formatter"),$),Me)}},labelDataIndex:g.dataIndex,defaultText:$}),m.setTextConfig({position:"inside"});var te=x.getModel("emphasis");Sr(m,x,"lineStyle",function(se){var le=se.getItemStyle();return ER(le,d,g),le}),s.add(m),f.setItemGraphicEl(g.dataIndex,m);var ie=te.get("focus");Dt(m,ie==="adjacency"?g.getAdjacentDataIndices():ie==="trajectory"?g.getTrajectoryDataIndices():ie,te.get("blurScope"),te.get("disabled"))}),o.eachNode(function(g){var m=g.getLayout(),y=g.getModel(),x=y.get("localX"),_=y.get("localY"),w=y.getModel("emphasis"),S=y.get(["itemStyle","borderRadius"])||0,T=new Ze({shape:{x:x!=null?x*u:m.x,y:_!=null?_*c:m.y,width:m.dx,height:m.dy,r:S},style:y.getModel("itemStyle").getItemStyle(),z2:10});Dr(T,Cr(y),{labelFetcher:{getFormattedLabel:function(A,P){return r.getFormattedLabel(A,P,"node")}},labelDataIndex:g.dataIndex,defaultText:g.id}),T.disableLabelAnimation=!0,T.setStyle("fill",g.getVisual("color")),T.setStyle("decal",g.getVisual("style").decal),Sr(T,y),s.add(T),h.setItemGraphicEl(g.dataIndex,T),De(T).dataType="node";var M=w.get("focus");Dt(T,M==="adjacency"?g.getAdjacentDataIndices():M==="trajectory"?g.getTrajectoryDataIndices():M,w.get("blurScope"),w.get("disabled"))}),h.eachItemGraphicEl(function(g,m){var y=h.getItemModel(m);y.get("draggable")&&(g.drift=function(x,_){a._focusAdjacencyDisabled=!0,this.shape.x+=x,this.shape.y+=_,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:r.id,dataIndex:h.getRawIndex(m),localX:this.shape.x/u,localY:this.shape.y/c})},g.ondragend=function(){a._focusAdjacencyDisabled=!1},g.draggable=!0,g.cursor="move")}),!this._data&&r.isAnimationEnabled()&&s.setClipPath(fce(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 nc(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}(gt);function ER(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");he(n)&&he(i)&&(e.fill=new qu(0,0,+(t==="horizontal"),+(t==="vertical"),[{color:n,offset:0},{color:i,offset:1}]))}}function fce(e,t,r){var n=new Ze({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 dce=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 qe(o[l],this,n));var u=Ok(a,i,this,!0,c);return u.data;function c(h,f){h.wrapMethod("getItemModel",function(d,g){var m=d.parentModel,y=m.getData().getItemLayout(g);if(y){var x=y.depth,_=m.levelModels[x];_&&(d.parentModel=_)}return d}),f.wrapMethod("getItemModel",function(d,g){var m=d.parentModel,y=m.getGraph().getEdgeByIndex(g),x=y.node1.getLayout();if(x){var _=x.depth,w=m.levelModels[_];w&&(d.parentModel=w)}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 gr("nameValue",{name:u,value:l,noValue:a(l)})}else{var c=this.getGraph().getNodeByIndex(r),h=c.getLayout().value,f=this.getDataParams(r,i).data.name;return gr("nameValue",{name:f!=null?f+"":null,value:h,noValue:a(h)})}},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}(bt);function vce(e,t){e.eachSeriesByType("sankey",function(r){var n=r.get("nodeWidth"),i=r.get("nodeGap"),a=Tr(r,t).refContainer,o=It(r.getBoxLayoutParams(),a);r.layoutInfo=o;var s=o.width,l=o.height,u=r.getGraph(),c=u.nodes,h=u.edges;gce(c);var f=ot(c,function(y){return y.getLayout().value===0}),d=f.length!==0?0:r.get("layoutIterations"),g=r.get("orient"),m=r.get("nodeAlign");pce(c,h,n,i,s,l,d,g,m)})}function pce(e,t,r,n,i,a,o,s,l){mce(e,t,r,i,a,s,l),bce(e,t,a,i,n,o,s),Nce(e,s)}function gce(e){j(e,function(t){var r=Ys(t.outEdges,fx),n=Ys(t.inEdges,fx),i=t.getValue()||0,a=Math.max(r,n,i);t.setLayout({value:a},!0)})}function mce(e,t,r,n,i,a,o){for(var s=[],l=[],u=[],c=[],h=0,f=0;f=0;x&&y.depth>d&&(d=y.depth),m.setLayout({depth:x?y.depth:h},!0),a==="vertical"?m.setLayout({dy:r},!0):m.setLayout({dx:r},!0);for(var _=0;_h-1?d:h-1;o&&o!=="left"&&yce(e,o,a,A);var P=a==="vertical"?(i-r)/A:(n-r)/A;_ce(e,P,a)}function w8(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return t.depth!=null&&t.depth>=0}function yce(e,t,r,n){if(t==="right"){for(var i=[],a=e,o=0;a.length;){for(var s=0;s0;a--)l*=.99,Cce(s,l,o),Ow(s,i,r,n,o),Lce(s,l,o),Ow(s,i,r,n,o)}function wce(e,t){var r=[],n=t==="vertical"?"y":"x",i=ZC(e,function(a){return a.getLayout()[n]});return i.keys.sort(function(a,o){return a-o}),j(i.keys,function(a){r.push(i.buckets.get(a))}),r}function Sce(e,t,r,n,i,a){var o=1/0;j(e,function(s){var l=s.length,u=0;j(s,function(h){u+=h.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()[f]+t;var g=i==="vertical"?n:r;if(u=c-t-g,u>0){s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0),c=s;for(var d=h-2;d>=0;--d)l=o[d],u=l.getLayout()[a]+l.getLayout()[f]+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 Cce(e,t,r){j(e.slice().reverse(),function(n){j(n,function(i){if(i.outEdges.length){var a=Ys(i.outEdges,Tce,r)/Ys(i.outEdges,fx);if(isNaN(a)){var o=i.outEdges.length;a=o?Ys(i.outEdges,Mce,r)/o:0}if(r==="vertical"){var s=i.getLayout().x+(a-nl(i,r))*t;i.setLayout({x:s},!0)}else{var l=i.getLayout().y+(a-nl(i,r))*t;i.setLayout({y:l},!0)}}})})}function Tce(e,t){return nl(e.node2,t)*e.getValue()}function Mce(e,t){return nl(e.node2,t)}function Ace(e,t){return nl(e.node1,t)*e.getValue()}function kce(e,t){return nl(e.node1,t)}function nl(e,t){return t==="vertical"?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function fx(e){return e.getValue()}function Ys(e,t,r){for(var n=0,i=e.length,a=-1;++ao&&(o=l)}),j(n,function(s){var l=new Ir({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&&j(i,function(s){var l=s.getModel().get("lineStyle");s.setVisual("style",l)})})}function Ice(e){e.registerChartView(hce),e.registerSeriesModel(dce),e.registerLayout(vce),e.registerVisual(Pce),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=j_(a,t,i.get("scaleLimit"));i.setCenter(o.center),i.setZoom(o.zoom)})})}var S8=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,h=this._baseAxisDim=u[c],f=u[1-c],d=[i,a],g=d[c].get("type"),m=d[1-c].get("type"),y=t.data;if(y&&l){var x=[];j(y,function(S,T){var M;re(S)?(M=S.slice(),S.unshift(T)):re(S.value)?(M=Q({},S),M.value=M.value.slice(),S.value.unshift(T)):M=S,x.push(M)}),t.data=x}var _=this.defaultValueDimensions,w=[{name:h,type:X0(g),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:f,type:X0(m),dimsDef:_.slice()}];return Tf(this,{coordDimensions:w,dimensionsCount:_.length+1,encodeDefaulter:Fe(DV,w,this)})},e.prototype.getBaseAxis=function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis},e}(),C8=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}(bt);Qt(C8,S8,!0);var Dce=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),h=jR(c,a,u,l,!0);a.setItemGraphicEl(u,h),o.add(h)}}).update(function(u,c){var h=s.getItemGraphicEl(c);if(!a.hasValue(u)){o.remove(h);return}var f=a.getItemLayout(u);h?(Oi(h),T8(f,h,a,u)):h=jR(f,a,u,l),o.add(h),a.setItemGraphicEl(u,h)}).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}(gt),Ece=function(){function e(){}return e}(),jce=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 Ece},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();am){var S=[x,w];n.push(S)}}}return{boxData:r,outliers:n}}var Gce={type:"echarts:boxplot",transform:function(t){var r=t.upstream;if(r.sourceFormat!==Wr){var n="";ft(n)}var i=Vce(r.getRawData(),t.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function Wce(e){e.registerSeriesModel(C8),e.registerChartView(Dce),e.registerLayout(Oce),e.registerTransform(Gce)}var Hce=["itemStyle","borderColor"],Uce=["itemStyle","borderColor0"],Zce=["itemStyle","borderColorDoji"],$ce=["itemStyle","color"],Yce=["itemStyle","color0"];function Uk(e,t){return t.get(e>0?$ce:Yce)}function Zk(e,t){return t.get(e===0?Zce:e>0?Hce:Uce)}var Xce={seriesType:"candlestick",plan:yf(),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=Uk(s,o),l.stroke=Zk(s,o)||l.fill;var u=i.ensureUniqueItemVisual(a,"style");Q(u,l)}}}}}},qce=["color","borderColor"],Kce=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){hl(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 h=n.getItemLayout(c);if(s&&RR(u,h))return;var f=zw(h,c,!0);Nt(f,{shape:{points:h.ends}},r,c),Bw(f,n,c,o),a.add(f),n.setItemGraphicEl(c,f)}}).update(function(c,h){var f=i.getItemGraphicEl(h);if(!n.hasValue(c)){a.remove(f);return}var d=n.getItemLayout(c);if(s&&RR(u,d)){a.remove(f);return}f?(it(f,{shape:{points:d.ends}},r,c),Oi(f)):f=zw(d),Bw(f,n,c,o),a.add(f),n.setItemGraphicEl(c,f)}).remove(function(c){var h=i.getItemGraphicEl(c);h&&a.remove(h)}).execute(),this._data=n},t.prototype._renderLarge=function(r){this._clear(),OR(r,this.group);var n=r.get("clip",!0)?Jp(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=zw(s);Bw(l,i,o,a),l.incremental=!0,this.group.add(l),this._progressiveEls.push(l)}},t.prototype._incrementalRenderLarge=function(r,n){OR(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}(gt),Jce=function(){function e(){}return e}(),Qce=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 Jce},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}(Ke);function zw(e,t,r){var n=e.ends;return new Qce({shape:{points:r?ehe(n,e):n},z2:100})}function RR(e,t){for(var r=!0,n=0;nT?D[a]:N[a],ends:F,brushRect:Z(M,A,w)})}function V($,Y){var te=[];return te[i]=Y,te[a]=$,isNaN(Y)||isNaN($)?[NaN,NaN]:t.dataToPoint(te)}function z($,Y,te){var ie=Y.slice(),se=Y.slice();ie[i]=Py(ie[i]+n/2,1,!1),se[i]=Py(se[i]-n/2,1,!0),te?$.push(ie,se):$.push(se,ie)}function Z($,Y,te){var ie=V($,te),se=V(Y,te);return ie[i]-=n/2,se[i]-=n/2,{x:ie[0],y:ie[1],width:n,height:se[1]-ie[1]}}function U($){return $[i]=Py($[i],1),$}}function g(m,y){for(var x=Oa(m.count*4),_=0,w,S=[],T=[],M,A=y.getStore(),P=!!e.get(["itemStyle","borderColorDoji"]);(M=m.next())!=null;){var I=A.get(s,M),N=A.get(u,M),D=A.get(c,M),O=A.get(h,M),R=A.get(f,M);if(isNaN(I)||isNaN(O)||isNaN(R)){x[_++]=NaN,_+=3;continue}x[_++]=zR(A,M,N,D,c,P),S[i]=I,S[a]=O,w=t.dataToPoint(S,null,T),x[_++]=w?w[0]:NaN,x[_++]=w?w[1]:NaN,S[a]=R,w=t.dataToPoint(S,null,T),x[_++]=w?w[1]:NaN}y.setLayout("largePoints",x)}}};function zR(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 ihe(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=ce(be(e.get("barMaxWidth"),i),i),o=ce(be(e.get("barMinWidth"),1),i),s=e.get("barWidth");return s!=null?ce(s,i):Math.max(Math.min(i/2,a),o)}function ahe(e){e.registerChartView(Kce),e.registerSeriesModel(M8),e.registerPreprocessor(rhe),e.registerVisual(Xce),e.registerLayout(nhe)}function BR(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 ohe=function(e){q(t,e);function t(r,n){var i=e.call(this)||this,a=new qp(r,n),o=new Ce;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 f=void 0;we(h)?f=h(i):f=h,a.__t>0&&(f=-s*a.__t),this._animateSymbol(a,s,f,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 To(r.__p1,r.__cp1)+To(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=Br,c=NC;s[0]=u(n[0],a[0],i[0],o),s[1]=u(n[1],a[1],i[1],o);var h=r.__t<1?c(n[0],a[0],i[0],o):c(i[0],a[0],n[0],1-o),f=r.__t<1?c(n[1],a[1],i[1],o):c(i[1],a[1],n[1],1-o);r.rotation=-Math.atan2(f,h)-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]),h=i[l],f=i[l+1];r.x=h[0]*(1-c)+c*f[0],r.y=h[1]*(1-c)+c*f[1];var d=r.__t<1?f[0]-h[0]:h[0]-f[0],g=r.__t<1?f[1]-h[1]:h[1]-f[1];r.rotation=-Math.atan2(g,d)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=n,r.ignore=!1}},t}(A8),hhe=function(){function e(){this.polyline=!1,this.curveness=0,this.segs=[]}return e}(),fhe=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 hhe},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+h)/2-(c-f)*a,g=(c+f)/2-(h-u)*a;r.quadraticCurveTo(d,g,h,f)}else r.lineTo(h,f)}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 h=a[u++],f=a[u++],d=1;d0){var y=(h+g)/2-(f-m)*o,x=(f+m)/2-(g-h)*o;if(kF(h,f,y,x,g,m,s,r,n))return l}else if(ms(h,f,g,m,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}(),L8={seriesType:"lines",plan:yf(),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 h=r.get("clip",!0)&&Jp(r.coordinateSystem,!1,r);h?this.group.setClipPath(h):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=L8.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 dhe:new Rk(o?a?che:k8:a?A8:jk),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}(gt),phe=typeof Uint32Array>"u"?Array:Uint32Array,ghe=typeof Float64Array>"u"?Array:Float64Array;function FR(e){var t=e.data;t&&t[0]&&t[0][0]&&t[0][0].coord&&(e.data=ae(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),a_([i,r[0],r[1]])}))}var mhe=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||[],FR(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(FR(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=Eh(this._flatCoords,n.flatCoords),this._flatCoordsOffset=Eh(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}(bt);function $m(e){return e instanceof Array||(e=[e,e]),e}var yhe={seriesType:"lines",reset:function(e){var t=$m(e.get("symbol")),r=$m(e.get("symbolSize")),n=e.getData();n.setVisual("fromSymbol",t&&t[0]),n.setVisual("toSymbol",t&&t[1]),n.setVisual("fromSymbolSize",r&&r[0]),n.setVisual("toSymbolSize",r&&r[1]);function i(a,o){var s=a.getItemModel(o),l=$m(s.getShallow("symbol",!0)),u=$m(s.getShallow("symbolSize",!0));l[0]&&a.setItemVisual(o,"fromSymbol",l[0]),l[1]&&a.setItemVisual(o,"toSymbol",l[1]),u[0]&&a.setItemVisual(o,"fromSymbolSize",u[0]),u[1]&&a.setItemVisual(o,"toSymbolSize",u[1])}return{dataEach:n.hasItemOption?i:null}}};function xhe(e){e.registerChartView(vhe),e.registerSeriesModel(mhe),e.registerLayout(L8),e.registerVisual(yhe)}var _he=256,bhe=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var t=Bn.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,h=this.canvas,f=h.getContext("2d"),d=t.length;h.width=r,h.height=n;for(var g=0;g0){var O=o(w)?l:u;w>0&&(w=w*N+P),T[M++]=O[D],T[M++]=O[D+1],T[M++]=O[D+2],T[M++]=O[D+3]*w*256}else M+=4}return f.putImageData(S,0,0),h},e.prototype._getBrush=function(){var t=this._brushCanvas||(this._brushCanvas=Bn.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 whe(e,t,r){var n=e[1]-e[0];t=ae(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 VR(e){var t=e.dimensions;return t[0]==="lng"&&t[1]==="lat"}var Che=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()):VR(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&&(VR(o)?this.render(n,i,a):(this._progressiveEls=[],this._renderOnGridLike(n,a,r.start,r.end,!0)))},t.prototype.eachRendered=function(r){hl(this._progressiveEls||this.group,r)},t.prototype._renderOnGridLike=function(r,n,i,a,o){var s=r.coordinateSystem,l=tl(s,"cartesian2d"),u=tl(s,"matrix"),c,h,f,d;if(l){var g=s.getAxis("x"),m=s.getAxis("y");c=g.getBandWidth()+.5,h=m.getBandWidth()+.5,f=g.scale.getExtent(),d=m.scale.getExtent()}for(var y=this.group,x=r.getData(),_=r.getModel(["emphasis","itemStyle"]).getItemStyle(),w=r.getModel(["blur","itemStyle"]).getItemStyle(),S=r.getModel(["select","itemStyle"]).getItemStyle(),T=r.get(["itemStyle","borderRadius"]),M=Cr(r),A=r.getModel("emphasis"),P=A.get("focus"),I=A.get("blurScope"),N=A.get("disabled"),D=l||u?[x.mapDimension("x"),x.mapDimension("y"),x.mapDimension("value")]:[x.mapDimension("time"),x.mapDimension("value")],O=i;Of[1]||Wd[1])continue;var V=s.dataToPoint([H,W]);R=new Ze({shape:{x:V[0]-c/2,y:V[1]-h/2,width:c,height:h},style:F})}else if(u){var z=s.dataToLayout([x.get(D[0],O),x.get(D[1],O)]).rect;if(Xr(z.x))continue;R=new Ze({z2:1,shape:z,style:F})}else{if(isNaN(x.get(D[1],O)))continue;var Z=s.dataToLayout([x.get(D[0],O)]),z=Z.contentRect||Z.rect;if(Xr(z.x)||Xr(z.y))continue;R=new Ze({z2:1,shape:z,style:F})}if(x.hasItemOption){var U=x.getItemModel(O),$=U.getModel("emphasis");_=$.getModel("itemStyle").getItemStyle(),w=U.getModel(["blur","itemStyle"]).getItemStyle(),S=U.getModel(["select","itemStyle"]).getItemStyle(),T=U.get(["itemStyle","borderRadius"]),P=$.get("focus"),I=$.get("blurScope"),N=$.get("disabled"),M=Cr(U)}R.shape.r=T;var Y=r.getRawValue(O),te="-";Y&&Y[2]!=null&&(te=Y[2]+""),Dr(R,M,{labelFetcher:r,labelDataIndex:O,defaultOpacity:F.opacity,defaultText:te}),R.ensureState("emphasis").style=_,R.ensureState("blur").style=w,R.ensureState("select").style=S,Dt(R,P,I,N),R.incremental=o,o&&(R.states.emphasis.hoverLayer=!0),y.add(R),x.setItemGraphicEl(O,R),this._progressiveEls&&this._progressiveEls.push(R)}},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 bhe;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(),h=r.getRoamTransform();c.applyTransform(h);var f=Math.max(c.x,0),d=Math.max(c.y,0),g=Math.min(c.width+c.x,a.getWidth()),m=Math.min(c.height+c.y,a.getHeight()),y=g-f,x=m-d,_=[l.mapDimension("lng"),l.mapDimension("lat"),l.mapDimension("value")],w=l.mapArray(_,function(A,P,I){var N=r.dataToPoint([A,P]);return N[0]-=f,N[1]-=d,N.push(I),N}),S=i.getExtent(),T=i.type==="visualMap.continuous"?She(S,i.option.range):whe(S,i.getPieceList(),i.option.selected);u.update(w,y,x,o.color.getNormalizer(),{inRange:o.color.getColorMapper(),outOfRange:s.color.getColorMapper()},T);var M=new Er({style:{width:y,height:x,x:f,y:d,image:u.canvas},silent:!0});this.group.add(M)},t.type="heatmap",t}(gt),The=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.getInitialData=function(r,n){return no(null,this,{generateCoord:"value"})},t.prototype.preventIncremental=function(){var r=mf.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}(bt);function Mhe(e){e.registerChartView(Che),e.registerSeriesModel(The)}var Ahe=["itemStyle","borderWidth"],GR=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],Gw=new ro,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.render=function(r,n,i){var a=this.group,o=r.getData(),s=this._data,l=r.coordinateSystem,u=l.getBaseAxis(),c=u.isHorizontal(),h=l.master.getRect(),f={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:r,coordSys:l,coordSysExtent:[[h.x,h.x+h.width],[h.y,h.y+h.height]],isHorizontal:c,valueDim:GR[+c],categoryDim:GR[1-+c]};o.diff(s).add(function(g){if(o.hasValue(g)){var m=HR(o,g),y=WR(o,g,m,f),x=UR(o,f,y);o.setItemGraphicEl(g,x),a.add(x),$R(x,f,y)}}).update(function(g,m){var y=s.getItemGraphicEl(m);if(!o.hasValue(g)){a.remove(y);return}var x=HR(o,g),_=WR(o,g,x,f),w=j8(o,_);y&&w!==y.__pictorialShapeStr&&(a.remove(y),o.setItemGraphicEl(g,null),y=null),y?jhe(y,f,_):y=UR(o,f,_,!0),o.setItemGraphicEl(g,y),y.__pictorialSymbolMeta=_,a.add(y),$R(y,f,_)}).remove(function(g){var m=s.getItemGraphicEl(g);m&&ZR(s,g,m.__pictorialSymbolMeta.animationModel,m)}).execute();var d=r.get("clip",!0)?Jp(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){ZR(a,De(o).dataIndex,r,o)}):i.removeAll()},t.type="pictorialBar",t}(gt);function WR(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,h=r.isAnimationEnabled(),f={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:h?r:null,hoverScale:h&&r.get(["emphasis","scale"]),z2:r.getShallow("z",!0)||0};Lhe(r,a,i,n,f),Nhe(e,t,i,a,o,f.boundingLength,f.pxSign,c,n,f),Phe(r,f.symbolScale,u,n,f);var d=f.symbolSize,g=ec(r.get("symbolOffset"),d);return Ihe(r,d,i,a,o,g,s,f.valueLineWidth,f.boundingLength,f.repeatCutLength,n,f),f}function Lhe(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(re(o)){var h=[Ww(s,o[0])-l,Ww(s,o[1])-l];h[1]=0?1:-1:c>0?1:-1}function Ww(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function Nhe(e,t,r,n,i,a,o,s,l,u){var c=l.valueDim,h=l.categoryDim,f=Math.abs(r[h.wh]),d=e.getItemVisual(t,"symbolSize"),g;re(d)?g=d.slice():d==null?g=["100%","100%"]:g=[d,d],g[h.index]=ce(g[h.index],f),g[c.index]=ce(g[c.index],n?f:Math.abs(a)),u.symbolSize=g;var m=u.symbolScale=[g[0]/s,g[1]/s];m[c.index]*=(l.isHorizontal?-1:1)*o}function Phe(e,t,r,n,i){var a=e.get(Ahe)||0;a&&(Gw.attr({scaleX:t[0],scaleY:t[1],rotation:r}),Gw.updateTransform(),a/=Gw.getLineScale(),a*=t[n.valueDim.index]),i.valueLineWidth=a||0}function Ihe(e,t,r,n,i,a,o,s,l,u,c,h){var f=c.categoryDim,d=c.valueDim,g=h.pxSign,m=Math.max(t[d.index]+s,0),y=m;if(n){var x=Math.abs(l),_=Fr(e.get("symbolMargin"),"15%")+"",w=!1;_.lastIndexOf("!")===_.length-1&&(w=!0,_=_.slice(0,_.length-1));var S=ce(_,t[d.index]),T=Math.max(m+S*2,0),M=w?0:S*2,A=rA(n),P=A?n:YR((x+M)/T),I=x-P*m;S=I/2/(w?P:Math.max(P-1,1)),T=m+S*2,M=w?0:S*2,!A&&n!=="fixed"&&(P=u?YR((Math.abs(u)+M)/T):0),y=P*T-M,h.repeatTimes=P,h.symbolMargin=S}var N=g*(y/2),D=h.pathPosition=[];D[f.index]=r[f.wh]/2,D[d.index]=o==="start"?N:o==="end"?l-N:l/2,a&&(D[0]+=a[0],D[1]+=a[1]);var O=h.bundlePosition=[];O[f.index]=r[f.xy],O[d.index]=r[d.xy];var R=h.barRectShape=Q({},r);R[d.wh]=g*Math.max(Math.abs(r[d.wh]),Math.abs(D[d.index]+N)),R[f.wh]=r[f.wh];var F=h.clipShape={};F[f.xy]=-r[f.xy],F[f.wh]=c.ecSize[f.wh],F[d.xy]=0,F[d.wh]=r[d.wh]}function N8(e){var t=e.symbolPatternSize,r=sr(e.symbolType,-t/2,-t/2,t,t);return r.attr({culling:!0}),r.type!=="image"&&r.setStyle({strokeNoScale:!0}),r}function P8(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,h=a[t.valueDim.index]+o+r.symbolMargin*2;for($k(e,function(m){m.__pictorialAnimationIndex=c,m.__pictorialRepeatTimes=u,c0:x<0)&&(_=u-1-m),y[l.index]=h*(_-u/2+.5)+s[l.index],{x:y[0],y:y[1],scaleX:r.symbolScale[0],scaleY:r.symbolScale[1],rotation:r.rotation}}}function I8(e,t,r,n){var i=e.__pictorialBundle,a=e.__pictorialMainPath;a?Sh(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=N8(r),i.add(a),Sh(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 D8(e,t,r){var n=Q({},t.barRectShape),i=e.__pictorialBarRect;i?Sh(i,null,{shape:n},t,r):(i=e.__pictorialBarRect=new Ze({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),i.disableMorphing=!0,e.add(i))}function E8(e,t,r,n){if(r.symbolClip){var i=e.__pictorialClipPath,a=Q({},r.clipShape),o=t.valueDim,s=r.animationModel,l=r.dataIndex;if(i)it(i,{shape:a},s,l);else{a[o.wh]=0,i=new Ze({shape:a}),e.__pictorialBundle.setClipPath(i),e.__pictorialClipPath=i;var u={};u[o.wh]=r.clipShape[o.wh],Ku[n?"updateProps":"initProps"](i,{shape:u},s,l)}}}function HR(e,t){var r=e.getItemModel(t);return r.getAnimationDelayParams=Dhe,r.isAnimationEnabled=Ehe,r}function Dhe(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function Ehe(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function UR(e,t,r,n){var i=new Ce,a=new Ce;return i.add(a),i.__pictorialBundle=a,a.x=r.bundlePosition[0],a.y=r.bundlePosition[1],r.symbolRepeat?P8(i,t,r):I8(i,t,r),D8(i,r,n),E8(i,t,r,n),i.__pictorialShapeStr=j8(e,r),i.__pictorialSymbolMeta=r,i}function jhe(e,t,r){var n=r.animationModel,i=r.dataIndex,a=e.__pictorialBundle;it(a,{x:r.bundlePosition[0],y:r.bundlePosition[1]},n,i),r.symbolRepeat?P8(e,t,r,!0):I8(e,t,r,!0),D8(e,r,!0),E8(e,t,r,!0)}function ZR(e,t,r,n){var i=n.__pictorialBarRect;i&&i.removeTextContent();var a=[];$k(n,function(o){a.push(o)}),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(r=null),j(a,function(o){el(o,{scaleX:0,scaleY:0},r,t,function(){n.parent&&n.parent.remove(n)})}),e.setItemGraphicEl(t,null)}function j8(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function $k(e,t,r){j(e.__pictorialBundle.children(),function(n){n!==e.__pictorialBarRect&&t.call(r,n)})}function Sh(e,t,r,n,i,a){t&&e.attr(t),n.symbolClip&&!i?r&&e.attr(r):r&&Ku[i?"updateProps":"initProps"](e,r,n.animationModel,n.dataIndex,a)}function $R(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"),h=a.get("blurScope"),f=a.get("scale");$k(e,function(m){if(m instanceof Er){var y=m.style;m.useStyle(Q({image:y.image,x:y.x,y:y.y,width:y.width,height:y.height},r.style))}else m.useStyle(r.style);var x=m.ensureState("emphasis");x.style=o,f&&(x.scaleX=m.scaleX*1.1,x.scaleY=m.scaleY*1.1),m.ensureState("blur").style=s,m.ensureState("select").style=l,u&&(m.cursor=u),m.z2=r.z2});var d=t.valueDim.posDesc[+(r.boundingLength>0)],g=e.__pictorialBarRect;g.ignoreClip=!0,Dr(g,Cr(i),{labelFetcher:t.seriesModel,labelDataIndex:n,defaultText:Uh(t.seriesModel.getData(),n),inheritColor:r.style.fill,defaultOpacity:r.style.opacity,defaultOutsidePosition:d}),Dt(e,c,h,a.get("disabled"))}function YR(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}var Rhe=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=fl(gp.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}(gp);function Ohe(e){e.registerChartView(khe),e.registerSeriesModel(Rhe),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Fe(tG,"pictorialBar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,rG("pictorialBar"))}var zhe=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,h=u.boundaryGap;s.x=0,s.y=c.y+h[0];function f(y){return y.name}var d=new Zo(this._layersSeries||[],l,f,f),g=[];d.add(fe(m,this,"add")).update(fe(m,this,"update")).remove(fe(m,this,"remove")).execute();function m(y,x,_){var w=o._layers;if(y==="remove"){s.remove(w[x]);return}for(var S=[],T=[],M,A=l[x].indices,P=0;Pa&&(a=s),n.push(s)}for(var u=0;ua&&(a=h)}return{y0:i,max:a}}function Whe(e){e.registerChartView(zhe),e.registerSeriesModel(Fhe),e.registerLayout(Vhe),e.registerProcessor(Cf("themeRiver"))}var Hhe=2,Uhe=4,qR=function(e){q(t,e);function t(r,n,i,a){var o=e.call(this)||this;o.z2=Hhe,o.textConfig={inside:!0},De(o).seriesIndex=n.seriesIndex;var s=new tt({z2:Uhe,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(),h=Q({},c);h.label=null;var f=n.getVisual("style");f.lineJoin="bevel";var d=n.getVisual("decal");d&&(f.decal=Gh(d,o));var g=Ba(l.getModel("itemStyle"),h,!0);Q(h,g),j(Cn,function(_){var w=s.ensureState(_),S=l.getModel([_,"itemStyle"]);w.style=S.getItemStyle();var T=Ba(S,h);T&&(w.shape=T)}),r?(s.setShape(h),s.shape.r=c.r0,Nt(s,{shape:{r:c.r}},i,n.dataIndex)):(it(s,{shape:h},i),Oi(s)),s.useStyle(f),this._updateLabel(i);var m=l.getShallow("cursor");m&&s.attr("cursor",m),this._seriesModel=i||this._seriesModel,this._ecModel=a||this._ecModel;var y=u.get("focus"),x=y==="relative"?Eh(n.getAncestorsIndices(),n.getDescendantIndices()):y==="ancestor"?n.getAncestorsIndices():y==="descendant"?n.getDescendantIndices():y;Dt(this,x,u.get("blurScope"),u.get("disabled"))},t.prototype._updateLabel=function(r){var n=this,i=this.node.getModel(),a=i.getModel("label"),o=this.node.getLayout(),s=o.endAngle-o.startAngle,l=(o.startAngle+o.endAngle)/2,u=Math.cos(l),c=Math.sin(l),h=this,f=h.getTextContent(),d=this.node.dataIndex,g=a.get("minAngle")/180*Math.PI,m=a.get("show")&&!(g!=null&&Math.abs(s)F&&!Oh(W-F)&&W0?(o.virtualPiece?o.virtualPiece.updateData(!1,_,r,n,i):(o.virtualPiece=new qR(_,r,n,i),c.add(o.virtualPiece)),w.piece.off("click"),o.virtualPiece.on("click",function(S){o._rootToNode(w.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";B0(u,c)}}i=!0}})})},t.prototype._rootToNode=function(r){r!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:l2,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}(gt),Xhe=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};R8(i);var a=this._levelModels=ae(r.levels||[],function(l){return new qe(l,this,n)},this),o=Lk.createTree(i,this,s);function s(l){l.wrapMethod("getItemModel",function(u,c){var h=o.getNodeByDataIndex(c),f=a[h.depth];return f&&(u.parentModel=f),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=O_(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(){FW(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}(bt);function R8(e){var t=0;j(e.children,function(n){R8(n);var i=n.value;re(i)&&(i=i[0]),t+=i});var r=e.value;re(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=t),r<0&&(r=0),re(e.value)?e.value[0]=r:e.value=r}var JR=Math.PI/180;function qhe(e,t,r){t.eachSeriesByType(e,function(n){var i=n.get("center"),a=n.get("radius");re(a)||(a=[0,a]),re(i)||(i=[i,i]);var o=r.getWidth(),s=r.getHeight(),l=Math.min(o,s),u=ce(i[0],o),c=ce(i[1],s),h=ce(a[0],l/2),f=ce(a[1],l/2),d=-n.get("startAngle")*JR,g=n.get("minAngle")*JR,m=n.getData().tree.root,y=n.getViewRoot(),x=y.depth,_=n.get("sort");_!=null&&O8(y,_);var w=0;j(y.children,function(W){!isNaN(W.getValue())&&w++});var S=y.getValue(),T=Math.PI/(S||w)*2,M=y.depth>0,A=y.height-(M?-1:1),P=(f-h)/(A||1),I=n.get("clockwise"),N=n.get("stillShowZeroSum"),D=I?1:-1,O=function(W,V){if(W){var z=V;if(W!==m){var Z=W.getValue(),U=S===0&&N?T:Z*T;U1;)o=o.parentNode;var s=i.getColorFromPalette(o.name||o.dataIndex+"",t);return n.depth>1&&he(s)&&(s=T0(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");Q(u,l)})})}function Qhe(e){e.registerChartView(Yhe),e.registerSeriesModel(Xhe),e.registerLayout(Fe(qhe,"sunburst")),e.registerProcessor(Fe(Cf,"sunburst")),e.registerVisual(Jhe),$he(e)}var QR={color:"fill",borderColor:"stroke"},efe={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},Eo=Ye(),tfe=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 no(null,this)},t.prototype.getDataParams=function(r,n,i){var a=e.prototype.getDataParams.call(this,r,n);return i&&(a.info=Eo(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}(bt);function rfe(e,t){return t=t||[0,0],ae(["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 nfe(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:fe(rfe,e)}}}function ife(e,t){return t=t||[0,0],ae([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 afe(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:fe(ife,e)}}}function ofe(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 sfe(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:fe(ofe,e)}}}function lfe(e,t){return t=t||[0,0],ae(["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 ufe(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:fe(lfe,e)}}}function cfe(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 hfe(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 z8(e,t,r,n){return e&&(e.legacy||e.legacy!==!1&&!r&&!n&&t!=="tspan"&&(t==="text"||ge(e,"text")))}function B8(e,t,r){var n=e,i,a,o;if(t==="text")o=n;else{o={},ge(n,"text")&&(o.text=n.text),ge(n,"rich")&&(o.rich=n.rich),ge(n,"textFill")&&(o.fill=n.textFill),ge(n,"textStroke")&&(o.stroke=n.textStroke),ge(n,"fontFamily")&&(o.fontFamily=n.fontFamily),ge(n,"fontSize")&&(o.fontSize=n.fontSize),ge(n,"fontStyle")&&(o.fontStyle=n.fontStyle),ge(n,"fontWeight")&&(o.fontWeight=n.fontWeight),a={type:"text",style:o,silent:!0},i={};var s=ge(n,"textPosition");r?i.position=s?n.textPosition:"inside":s&&(i.position=n.textPosition),ge(n,"textPosition")&&(i.position=n.textPosition),ge(n,"textOffset")&&(i.offset=n.textOffset),ge(n,"textRotation")&&(i.rotation=n.textRotation),ge(n,"textDistance")&&(i.distance=n.textDistance)}return eO(o,e),j(o.rich,function(l){eO(l,l)}),{textConfig:i,textContent:a}}function eO(e,t){t&&(t.font=t.textFont||t.font,ge(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),ge(t,"textAlign")&&(e.align=t.textAlign),ge(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),ge(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),ge(t,"textWidth")&&(e.width=t.textWidth),ge(t,"textHeight")&&(e.height=t.textHeight),ge(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),ge(t,"textPadding")&&(e.padding=t.textPadding),ge(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),ge(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),ge(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),ge(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),ge(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),ge(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),ge(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function tO(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;rO(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,j(t.rich,function(s){rO(s,s)}),n}function rO(e,t){t&&(ge(t,"fill")&&(e.textFill=t.fill),ge(t,"stroke")&&(e.textStroke=t.fill),ge(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),ge(t,"font")&&(e.font=t.font),ge(t,"fontStyle")&&(e.fontStyle=t.fontStyle),ge(t,"fontWeight")&&(e.fontWeight=t.fontWeight),ge(t,"fontSize")&&(e.fontSize=t.fontSize),ge(t,"fontFamily")&&(e.fontFamily=t.fontFamily),ge(t,"align")&&(e.textAlign=t.align),ge(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),ge(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),ge(t,"width")&&(e.textWidth=t.width),ge(t,"height")&&(e.textHeight=t.height),ge(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),ge(t,"padding")&&(e.textPadding=t.padding),ge(t,"borderColor")&&(e.textBorderColor=t.borderColor),ge(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),ge(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),ge(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),ge(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),ge(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),ge(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),ge(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),ge(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),ge(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),ge(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}var F8={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},nO=Qe(F8);Ei(Ya,function(e,t){return e[t]=1,e},{});Ya.join(", ");var dx=["","style","shape","extra"],Xh=Ye();function Yk(e,t,r,n,i){var a=e+"Animation",o=ff(e,n,i)||{},s=Xh(t).userDuring;return o.duration>0&&(o.during=s?fe(gfe,{el:t,userDuring:s}):null,o.setToFinal=!0,o.scope=e),Q(o,r[a]),o}function By(e,t,r,n){n=n||{};var i=n.dataIndex,a=n.isInit,o=n.clearStyle,s=r.isAnimationEnabled(),l=Xh(e),u=t.style;l.userDuring=t.during;var c={},h={};if(yfe(e,t,h),e.type==="compound")for(var f=e.shape.paths,d=t.shape.paths,g=0;g0&&e.animateFrom(y,x)}else dfe(e,t,i||0,r,c);V8(e,t),u?e.dirty():e.markRedraw()}function V8(e,t){for(var r=Xh(e).leaveToProps,n=0;n0&&e.animateFrom(i,a)}}function vfe(e,t){ge(t,"silent")&&(e.silent=t.silent),ge(t,"ignore")&&(e.ignore=t.ignore),e instanceof Ri&&ge(t,"invisible")&&(e.invisible=t.invisible),e instanceof Ke&&ge(t,"autoBatch")&&(e.autoBatch=t.autoBatch)}var Aa={},pfe={setTransform:function(e,t){return Aa.el[e]=t,this},getTransform:function(e){return Aa.el[e]},setShape:function(e,t){var r=Aa.el,n=r.shape||(r.shape={});return n[e]=t,r.dirtyShape&&r.dirtyShape(),this},getShape:function(e){var t=Aa.el.shape;if(t)return t[e]},setStyle:function(e,t){var r=Aa.el,n=r.style;return n&&(n[e]=t,r.dirtyStyle&&r.dirtyStyle()),this},getStyle:function(e){var t=Aa.el.style;if(t)return t[e]},setExtra:function(e,t){var r=Aa.el.extra||(Aa.el.extra={});return r[e]=t,this},getExtra:function(e){var t=Aa.el.extra;if(t)return t[e]}};function gfe(){var e=this,t=e.el;if(t){var r=Xh(t).userDuring,n=e.userDuring;if(r!==n){e.el=e.userDuring=null;return}Aa.el=t,n(pfe)}}function iO(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]={}),Tu(l))Q(o,a);else for(var u=Tt(l),c=0;c=0){!o&&(o=n[e]={});for(var d=Qe(a),c=0;c=0)){var f=e.getAnimationStyleProps(),d=f?f.style:null;if(d){!a&&(a=n.style={});for(var g=Qe(r),u=0;u=0?t.getStore().get(z,W):void 0}var Z=t.get(V.name,W),U=V&&V.ordinalMeta;return U?U.categories[Z]:Z}function A(H,W){W==null&&(W=c);var V=t.getItemVisual(W,"style"),z=V&&V.fill,Z=V&&V.opacity,U=w(W,Ns).getItemStyle();z!=null&&(U.fill=z),Z!=null&&(U.opacity=Z);var $={inheritColor:he(z)?z:K.color.neutral99},Y=S(W,Ns),te=Ct(Y,null,$,!1,!0);te.text=Y.getShallow("show")?be(e.getFormattedLabel(W,Ns),Uh(t,W)):null;var ie=R0(Y,$,!1);return N(H,U),U=tO(U,te,ie),H&&I(U,H),U.legacy=!0,U}function P(H,W){W==null&&(W=c);var V=w(W,jo).getItemStyle(),z=S(W,jo),Z=Ct(z,null,null,!0,!0);Z.text=z.getShallow("show")?zn(e.getFormattedLabel(W,jo),e.getFormattedLabel(W,Ns),Uh(t,W)):null;var U=R0(z,null,!0);return N(H,V),V=tO(V,Z,U),H&&I(V,H),V.legacy=!0,V}function I(H,W){for(var V in W)ge(W,V)&&(H[V]=W[V])}function N(H,W){H&&(H.textFill&&(W.textFill=H.textFill),H.textPosition&&(W.textPosition=H.textPosition))}function D(H,W){if(W==null&&(W=c),ge(QR,H)){var V=t.getItemVisual(W,"style");return V?V[QR[H]]:null}if(ge(efe,H))return t.getItemVisual(W,H)}function O(H){if(o.type==="cartesian2d"){var W=o.getBaseAxis();return Cre(Ae({axis:W},H))}}function R(){return r.getCurrentSeriesIndices()}function F(H){return wA(H,r)}}function Lfe(e){var t={};return j(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 Yw(e,t,r,n,i,a,o){if(!n){a.remove(t);return}var s=Qk(e,t,r,n,i,a);return s&&o.setItemGraphicEl(r,s),s&&Dt(s,n.focus,n.blurScope,n.emphasisDisabled),s}function Qk(e,t,r,n,i,a){var o=-1,s=t;t&&U8(t,n,i)&&(o=Ve(a.childrenRef(),t),t=null);var l=!t,u=t;u?u.clearStates():(u=Kk(n),s&&Tfe(s,u)),n.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),n.tooltipDisabled&&(u.tooltipDisabled=!0),pi.normal.cfg=pi.normal.conOpt=pi.emphasis.cfg=pi.emphasis.conOpt=pi.blur.cfg=pi.blur.conOpt=pi.select.cfg=pi.select.conOpt=null,pi.isLegacy=!1,Pfe(u,r,n,i,l,pi),Nfe(u,r,n,i,l),Jk(e,u,r,n,pi,i,l),ge(n,"info")&&(Eo(u).info=n.info);for(var c=0;c=0?a.replaceAt(u,o):a.add(u),u}function U8(e,t,r){var n=Eo(e),i=t.type,a=t.shape,o=t.style;return r.isUniversalTransitionEnabled()||i!=null&&i!==n.customGraphicType||i==="path"&&Rfe(a)&&Z8(a)!==n.customPathData||i==="image"&&ge(o,"image")&&o.image!==n.customImagePath}function Nfe(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&&U8(o,a,n)&&(o=null),o||(o=Kk(a),e.setClipPath(o)),Jk(null,o,t,a,null,n,i)}}function Pfe(e,t,r,n,i,a){if(!(e.isGroup||e.type==="compoundPath")){oO(r,null,a),oO(r,jo,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=Kk(o),e.setTextContent(c)),Jk(null,c,t,o,null,n,i);for(var h=o&&o.style,f=0;f=c;d--){var g=t.childAt(d);Dfe(t,g,i)}}}function Dfe(e,t,r){t&&F_(t,Eo(e).option,r)}function Efe(e){new Zo(e.oldChildren,e.newChildren,sO,sO,e).add(lO).update(lO).remove(jfe).execute()}function sO(e,t){var r=e&&e.name;return r??Sfe+t}function lO(e,t){var r=this.context,n=e!=null?r.newChildren[e]:null,i=t!=null?r.oldChildren[t]:null;Qk(r.api,i,r.dataIndex,n,r.seriesModel,r.group)}function jfe(e){var t=this.context,r=t.oldChildren[e];r&&F_(r,Eo(r).option,t.seriesModel)}function Z8(e){return e&&(e.pathData||e.d)}function Rfe(e){return e&&(ge(e,"pathData")||ge(e,"d"))}function Ofe(e){e.registerChartView(Mfe),e.registerSeriesModel(tfe)}var iu=Ye(),uO=Se,Xw=fe,tL=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 h=this._moveAnimation=this.determineAnimation(t,r);if(!s)s=this._group=new Ce,this.createPointerEl(s,u,t,r),this.createLabelEl(s,u,t,r),n.getZr().add(s);else{var f=Fe(cO,r,h);this.updatePointerEl(s,u,f),this.updateLabelEl(s,u,f,r)}fO(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=wk(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=iu(t).pointerEl=new Ku[a.type](uO(r.pointer));t.add(o)}},e.prototype.createLabelEl=function(t,r,n,i){if(r.label){var a=iu(t).labelEl=new tt(uO(r.label));t.add(a),hO(a,i)}},e.prototype.updatePointerEl=function(t,r,n){var i=iu(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=iu(t).labelEl;a&&(a.setStyle(r.label.style),n(a,{x:r.label.x,y:r.label.y}),hO(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=df(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){Wo(u.event)},onmousedown:Xw(this._onHandleDragMove,this,0,0),drift:Xw(this._onHandleDragMove,this),ondragend:Xw(this._onHandleDragEnd,this)}),n.add(i)),fO(i,r,!1),i.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");re(l)||(l=[l,l]),i.scaleX=l[0]/2,i.scaleY=l[1]/2,xf(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,s)}},e.prototype._moveHandleToValue=function(t,r){cO(this._axisPointerModel,!r&&this._moveAnimation,this._handle,qw(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(qw(n),[t,r],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(qw(i)),iu(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),lp(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 cO(e,t,r,n){$8(iu(r).lastProp,n)||(iu(r).lastProp=n,t?it(r,n,e):(r.stopAnimation(),r.attr(n)))}function $8(e,t){if(ke(e)&&ke(t)){var r=!0;return j(t,function(n,i){r=r&&$8(e[i],n)}),!!r}else return e===t}function hO(e,t){e[t.get(["label","show"])?"show":"hide"]()}function qw(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function fO(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 rL(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 Y8(e,t,r,n,i){var a=r.get("value"),o=X8(a,t.axis,t.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=gf(s.get("padding")||0),u=s.getFont(),c=c_(o,u),h=i.position,f=c.width+l[1]+l[3],d=c.height+l[0]+l[2],g=i.align;g==="right"&&(h[0]-=f),g==="center"&&(h[0]-=f/2);var m=i.verticalAlign;m==="bottom"&&(h[1]-=d),m==="middle"&&(h[1]-=d/2),zfe(h,f,d,n);var y=s.get("backgroundColor");(!y||y==="auto")&&(y=t.get(["axisLine","lineStyle","color"])),e.label={x:h[0],y:h[1],style:Ct(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:y}),z2:10}}function zfe(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 X8(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:q0(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};j(n,function(l){var u=r.getSeriesByIndex(l.seriesIndex),c=l.dataIndexInside,h=u&&u.getDataParams(c);h&&s.seriesData.push(h)}),he(o)?a=o.replace("{value}",a):we(o)&&(a=o(s))}return a}function nL(e,t,r){var n=Pr();return Ko(n,n,r.rotation),ha(n,n,r.position),sa([e.dataToCoord(t),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function q8(e,t,r,n,i,a){var o=wn.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=i.get(["label","margin"]),Y8(t,n,i,a,{position:nL(n.axis,e,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function iL(e,t,r){return r=r||0,{x1:e[r],y1:e[1-r],x2:t[r],y2:t[1-r]}}function K8(e,t,r){return r=r||0,{x:e[r],y:e[1-r],width:t[r],height:t[1-r]}}function dO(e,t,r,n,i,a){return{cx:e,cy:t,r0:r,r:n,startAngle:i,endAngle:a,clockwise:!0}}var Bfe=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=vO(l,s).getOtherAxis(s).getGlobalExtent(),h=s.toGlobalCoord(s.dataToCoord(n,!0));if(u&&u!=="none"){var f=rL(a),d=Ffe[u](s,h,c);d.style=f,r.graphicKey=d.type,r.pointer=d}var g=ox(l.getRect(),i);q8(n,r,g,i,a,o)},t.prototype.getHandleTransform=function(r,n,i){var a=ox(n.axis.grid.getRect(),n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=nL(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=vO(s,o).getOtherAxis(o).getGlobalExtent(),c=o.dim==="x"?0:1,h=[r.x,r.y];h[c]+=n[c],h[c]=Math.min(l[1],h[c]),h[c]=Math.max(l[0],h[c]);var f=(u[1]+u[0])/2,d=[f,f];d[c]=h[c];var g=[{verticalAlign:"middle"},{align:"center"}];return{x:h[0],y:h[1],rotation:r.rotation,cursorPoint:d,tooltipOption:g[c]}},t}(tL);function vO(e,t){var r={};return r[t.dim+"AxisIndex"]=t.index,e.getCartesian(r)}var Ffe={line:function(e,t,r){var n=iL([t,r[0]],[t,r[1]],pO(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:K8([t-n/2,r[0]],[n,i],pO(e))}}};function pO(e){return e.dim==="x"?0:1}var Vfe=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}($e),Lo=Ye(),Gfe=j;function J8(e,t,r){if(!Je.node){var n=t.getZr();Lo(n).records||(Lo(n).records={}),Wfe(n,t);var i=Lo(n).records[e]||(Lo(n).records[e]={});i.handler=r}}function Wfe(e,t){if(Lo(e).initialized)return;Lo(e).initialized=!0,r("click",Fe(gO,"click")),r("mousemove",Fe(gO,"mousemove")),r("globalout",Ufe);function r(n,i){e.on(n,function(a){var o=Zfe(t);Gfe(Lo(e).records,function(s){s&&i(s,a,o.dispatchAction)}),Hfe(o.pendings,t)})}}function Hfe(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 Ufe(e,t,r){e.handler("leave",null,r)}function gO(e,t,r,n){t.handler(e,r,n)}function Zfe(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 h2(e,t){if(!Je.node){var r=t.getZr(),n=(Lo(r).records||{})[e];n&&(Lo(r).records[e]=null)}}var $fe=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";J8("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){h2("axisPointer",n)},t.prototype.dispose=function(r,n){h2("axisPointer",n)},t.type="axisPointer",t}(Mt);function Q8(e,t){var r=[],n=e.seriesIndex,i;if(n==null||!(i=t.getSeriesByIndex(n)))return{point:[]};var a=i.getData(),o=Ru(a,e);if(o==null||o<0||re(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),h=c.dim,f=u.dim,d=h==="x"||h==="radius"?1:0,g=a.mapDimension(f),m=[];m[d]=a.get(g,o),m[1-d]=a.get(a.getCalculationInfo("stackResultDimension"),o),r=l.dataToPoint(m)||[]}else r=l.dataToPoint(a.getValues(ae(l.dimensions,function(x){return a.mapDimension(x)}),o))||[];else if(s){var y=s.getBoundingRect().clone();y.applyTransform(s.transform),r=[y.x+y.width/2,y.y+y.height/2]}return{point:r,el:s}}var mO=Ye();function Yfe(e,t,r){var n=e.currTrigger,i=[e.x,e.y],a=e,o=e.dispatchAction||fe(r.dispatchAction,r),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){Fy(i)&&(i=Q8({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var l=Fy(i),u=a.axesInfo,c=s.axesInfo,h=n==="leave"||Fy(i),f={},d={},g={list:[],map:{}},m={showPointer:Fe(qfe,d),showTooltip:Fe(Kfe,g)};j(s.coordSysMap,function(x,_){var w=l||x.containPoint(i);j(s.coordSysAxesInfo[_],function(S,T){var M=S.axis,A=tde(u,S);if(!h&&w&&(!u||A)){var P=A&&A.value;P==null&&!l&&(P=M.pointToData(i)),P!=null&&yO(S,P,m,!1,f)}})});var y={};return j(c,function(x,_){var w=x.linkGroup;w&&!d[_]&&j(w.axesInfo,function(S,T){var M=d[T];if(S!==x&&M){var A=M.value;w.mapper&&(A=x.axis.scale.parse(w.mapper(A,xO(S),xO(x)))),y[x.key]=A}})}),j(y,function(x,_){yO(c[_],x,m,!0,f)}),Jfe(d,c,f),Qfe(g,i,e,o),ede(c,o,r),f}}function yO(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=Xfe(t,e),s=o.payloadBatch,l=o.snapToValue;s[0]&&i.seriesIndex==null&&Q(i,s[0]),!n&&e.snap&&a.containData(l)&&l!=null&&(t=l),r.showPointer(e,t,s),r.showTooltip(e,o,l)}}function Xfe(e,t){var r=t.axis,n=r.dim,i=e,a=[],o=Number.MAX_VALUE,s=-1;return j(t.seriesModels,function(l,u){var c=l.getData().mapDimensionsAll(n),h,f;if(l.getAxisTooltipData){var d=l.getAxisTooltipData(c,e,r);f=d.dataIndices,h=d.nestestValue}else{if(f=l.indicesOfNearest(n,c[0],e,r.type==="category"?.5:null),!f.length)return;h=l.getData().get(c[0],f[0])}if(!(h==null||!isFinite(h))){var g=e-h,m=Math.abs(g);m<=o&&((m=0&&s<0)&&(o=m,s=g,i=h,a.length=0),j(f,function(y){a.push({seriesIndex:l.seriesIndex,dataIndexInside:y,dataIndex:l.getData().getRawIndex(y)})}))}}),{payloadBatch:a,snapToValue:i}}function qfe(e,t,r,n){e[t.key]={value:r,payloadBatch:n}}function Kfe(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=mp(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 Jfe(e,t,r){var n=r.axesInfo=[];j(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 Qfe(e,t,r,n){if(Fy(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 ede(e,t,r){var n=r.getZr(),i="axisPointerLastHighlights",a=mO(n)[i]||{},o=mO(n)[i]={};j(e,function(u,c){var h=u.axisPointerModel.option;h.status==="show"&&u.triggerEmphasis&&j(h.seriesDataIndices,function(f){var d=f.seriesIndex+" | "+f.dataIndex;o[d]=f})});var s=[],l=[];j(a,function(u,c){!o[c]&&l.push(u)}),j(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 tde(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 xO(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 Fy(e){return!e||e[0]==null||isNaN(e[0])||e[1]==null||isNaN(e[1])}function tg(e){tc.registerAxisPointerClass("CartesianAxisPointer",Bfe),e.registerComponentModel(Vfe),e.registerComponentView($fe),e.registerPreprocessor(function(t){if(t){(!t.axisPointer||t.axisPointer.length===0)&&(t.axisPointer={});var r=t.axisPointer.link;r&&!re(r)&&(t.axisPointer.link=[r])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,function(t,r){t.getComponent("axisPointer").coordSysAxesInfo=roe(t,r)}),e.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},Yfe)}function rde(e){He(SW),He(tg)}var nde=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(),h=s.dataToCoord(n),f=a.get("type");if(f&&f!=="none"){var d=rL(a),g=ade[f](s,l,h,c);g.style=d,r.graphicKey=g.type,r.pointer=g}var m=a.get(["label","margin"]),y=ide(n,i,a,l,m);Y8(r,i,a,o,y)},t}(tL);function ide(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,h;if(a.dim==="radius"){var f=Pr();Ko(f,f,s),ha(f,f,[n.cx,n.cy]),u=sa([o,-i],f);var d=t.getModel("axisLabel").get("rotate")||0,g=wn.innerTextLayout(s,d*Math.PI/180,-1);c=g.textAlign,h=g.textVerticalAlign}else{var m=l[1];u=n.coordToPoint([m+i,o]);var y=n.cx,x=n.cy;c=Math.abs(u[0]-y)/m<.3?"center":u[0]>y?"left":"right",h=Math.abs(u[1]-x)/m<.3?"middle":u[1]>x?"top":"bottom"}return{position:u,align:c,verticalAlign:h}}var ade={line:function(e,t,r,n){return e.dim==="angle"?{type:"Line",shape:iL(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:dO(t.cx,t.cy,n[0],n[1],(-r-i/2)*a,(-r+i/2)*a)}:{type:"Sector",shape:dO(t.cx,t.cy,r-i/2,r+i/2,0,Math.PI*2)}}},ode=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}($e),aL=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",Ht).models[0]},t.type="polarAxis",t}($e);Qt(aL,Sf);var sde=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}(aL),lde=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}(aL),oL=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}(Vi);oL.prototype.dataToRadius=Vi.prototype.dataToCoord;oL.prototype.radiusToData=Vi.prototype.coordToData;var ude=Ye(),sL=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=c_(s==null?"":s+"",n.getFont(),"center","top"),h=Math.max(c.height,7),f=h/u;isNaN(f)&&(f=1/0);var d=Math.max(0,Math.floor(f)),g=ude(r.model),m=g.lastAutoInterval,y=g.lastTickCount;return m!=null&&y!=null&&Math.abs(m-d)<=1&&Math.abs(y-o)<=1&&m>d?d=m:(g.lastTickCount=o,g.lastAutoInterval=d),d},t}(Vi);sL.prototype.dataToAngle=Vi.prototype.dataToCoord;sL.prototype.angleToData=Vi.prototype.coordToData;var eH=["radius","angle"],cde=function(){function e(t){this.dimensions=eH,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new oL,this._angleAxis=new sL,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,h=u*u+c*c,f=this.r,d=this.r0;return f!==d&&h-o<=f*f&&h+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=_O(r);return i===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,r,n){var i=_O(r);return i===this?this.pointToData(n):null},e}();function _O(e){var t=e.seriesModel,r=e.polarModel;return r&&r.coordinateSystem||t&&t.coordinateSystem}function hde(e,t,r){var n=t.get("center"),i=Tr(t,r).refContainer;e.cx=ce(n[0],i.width)+i.x,e.cy=ce(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%"]:re(s)||(s=[0,s]);var l=[ce(s[0],o),ce(s[1],o)];a.inverse?a.setExtent(l[1],l[0]):a.setExtent(l[0],l[1])}function fde(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();j(K0(l,"radius"),function(u){i.scale.unionExtentFromData(l,u)}),j(K0(l,"angle"),function(u){n.scale.unionExtentFromData(l,u)})}}),Gu(n.scale,n.model),Gu(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 dde(e){return e.mainType==="angleAxis"}function bO(e,t){var r;if(e.type=t.get("type"),e.scale=Xp(t),e.onBand=t.get("boundaryGap")&&e.type==="category",e.inverse=t.get("inverse"),dde(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 vde={dimensions:eH,create:function(e,t){var r=[];return e.eachComponent("polar",function(n,i){var a=new cde(i+"");a.update=fde;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=n.findAxisModel("radiusAxis"),u=n.findAxisModel("angleAxis");bO(o,l),bO(s,u),hde(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",Ht).models[0];n.coordinateSystem=i.coordinateSystem}}),r}},pde=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function Ym(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 Xm(e){var t=e.getRadiusAxis();return t.inverse?0:1}function wO(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 gde=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=ae(i.getViewLabels(),function(c){c=Se(c);var h=i.scale,f=h.type==="ordinal"?h.getRawOrdinalNumber(c.tickValue):c.tickValue;return c.coord=i.dataToCoord(f),c});wO(u),wO(s),j(pde,function(c){r.get([c,"show"])&&(!i.scale.isBlank()||c==="axisLine")&&mde[c](this.group,r,a,s,l,o,u)},this)}},t.type="angleAxis",t}(tc),mde={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=Xm(r),h=c?0:1,f,d=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[h]===0?f=new Ku[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}):f=new cf({shape:{cx:r.cx,cy:r.cy,r:a[c],r0:a[h]},style:o.getLineStyle(),z2:1,silent:!0}),f.style.fill=null,e.add(f)},axisTick:function(e,t,r,n,i,a){var o=t.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[Xm(r)],u=ae(n,function(c){return new ar({shape:Ym(r,[l,l+s],c.coord)})});e.add(qn(u,{style:Ae(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[Xm(r)],c=[],h=0;hx?"left":"right",S=Math.abs(y[1]-_)/m<.3?"middle":y[1]>_?"top":"bottom";if(s&&s[g]){var T=s[g];ke(T)&&T.textStyle&&(d=new qe(T.textStyle,l,l.ecModel))}var M=new tt({silent:wn.isLabelSilent(t),style:Ct(d,{x:y[0],y:y[1],fill:d.getTextColor()||t.get(["axisLine","lineStyle","color"]),text:h.formattedLabel,align:w,verticalAlign:S})});if(e.add(M),Qo({el:M,componentModel:t,itemName:h.formattedLabel,formatterParamsExtra:{isTruncated:function(){return M.isTruncated},value:h.rawLabel,tickIndex:f}}),c){var A=wn.makeAxisEventDataBase(t);A.targetType="axisLabel",A.value=h.rawLabel,De(M).eventData=A}},this)},splitLine:function(e,t,r,n,i,a){var o=t.getModel("splitLine"),s=o.getModel("lineStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var c=[],h=0;h=0?"p":"n",H=I;T&&(n[c][R]||(n[c][R]={p:I,n:I}),H=n[c][R][F]);var W=void 0,V=void 0,z=void 0,Z=void 0;if(g.dim==="radius"){var U=g.dataToCoord(O)-I,$=l.dataToCoord(R);Math.abs(U)=Z})}}})}function Sde(e){var t={};j(e,function(n,i){var a=n.getData(),o=n.coordinateSystem,s=o.getBaseAxis(),l=rH(o,s),u=s.getExtent(),c=s.type==="category"?s.getBandWidth():Math.abs(u[1]-u[0])/a.count(),h=t[l]||{bandWidth:c,remainedWidth:c,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},f=h.stacks;t[l]=h;var d=tH(n);f[d]||h.autoWidthCount++,f[d]=f[d]||{width:0,maxWidth:0};var g=ce(n.get("barWidth"),c),m=ce(n.get("barMaxWidth"),c),y=n.get("barGap"),x=n.get("barCategoryGap");g&&!f[d].width&&(g=Math.min(h.remainedWidth,g),f[d].width=g,h.remainedWidth-=g),m&&(f[d].maxWidth=m),y!=null&&(h.gap=y),x!=null&&(h.categoryGap=x)});var r={};return j(t,function(n,i){r[i]={};var a=n.stacks,o=n.bandWidth,s=ce(n.categoryGap,o),l=ce(n.gap,1),u=n.remainedWidth,c=n.autoWidthCount,h=(u-s)/(c+(c-1)*l);h=Math.max(h,0),j(a,function(m,y){var x=m.maxWidth;x&&x=r.y&&t[1]<=r.y+r.height:n.contain(n.toLocalCoord(t[1]))&&t[0]>=r.y&&t[0]<=r.y+r.height},e.prototype.pointToData=function(t,r,n){n=n||[];var i=this.getAxis();return n[0]=i.coordToData(i.toLocalCoord(t[i.orient==="horizontal"?0:1])),n},e.prototype.dataToPoint=function(t,r,n){var i=this.getAxis(),a=this.getRect();n=n||[];var o=i.orient==="horizontal"?0:1;return t instanceof Array&&(t=t[0]),n[o]=i.toGlobalCoord(i.dataToCoord(+t)),n[1-o]=o===0?a.y+a.height/2:a.x+a.width/2,n},e.prototype.convertToPixel=function(t,r,n){var i=SO(r);return i===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,r,n){var i=SO(r);return i===this?this.pointToData(n):null},e}();function SO(e){var t=e.seriesModel,r=e.singleAxisModel;return r&&r.coordinateSystem||t&&t.coordinateSystem}function Dde(e,t){var r=[];return e.eachComponent("singleAxis",function(n,i){var a=new Ide(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",Ht).models[0];n.coordinateSystem=i&&i.coordinateSystem}}),r}var Ede={create:Dde,dimensions:nH},CO=["x","y"],jde=["width","height"],Rde=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=Kw(l,1-gx(s)),c=l.dataToPoint(n)[0],h=a.get("type");if(h&&h!=="none"){var f=rL(a),d=Ode[h](s,c,u);d.style=f,r.graphicKey=d.type,r.pointer=d}var g=f2(i);q8(n,r,g,i,a,o)},t.prototype.getHandleTransform=function(r,n,i){var a=f2(n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=nL(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=gx(o),u=Kw(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 h=Kw(s,1-l),f=(h[1]+h[0])/2,d=[f,f];return d[l]=c[l],{x:c[0],y:c[1],rotation:r.rotation,cursorPoint:d,tooltipOption:{verticalAlign:"middle"}}},t}(tL),Ode={line:function(e,t,r){var n=iL([t,r[0]],[t,r[1]],gx(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:K8([t-n/2,r[0]],[n,i],gx(e))}}};function gx(e){return e.isHorizontal()?0:1}function Kw(e,t){var r=e.getRect();return[r[CO[t]],r[CO[t]]+r[jde[t]]]}var zde=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}(Mt);function Bde(e){He(tg),tc.registerAxisPointerClass("SingleAxisPointer",Rde),e.registerComponentView(zde),e.registerComponentView(Lde),e.registerComponentModel(Vy),Zh(e,"single",Vy,Vy.defaultOption),e.registerCoordinateSystem("single",Ede)}var Fde=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=Ju(r);e.prototype.init.apply(this,arguments),TO(r,a)},t.prototype.mergeOption=function(r){e.prototype.mergeOption.apply(this,arguments),TO(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}($e);function TO(e,t){var r=e.cellSize,n;re(r)?n=r:n=e.cellSize=[r,r],n.length===1&&(n[1]=n[0]);var i=ae([0,1],function(a){return lQ(t,a)&&(n[a]="auto"),n[a]!=null&&n[a]!=="auto"});Ka(e,t,{type:"box",ignoreSize:i})}var Vde=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,h=new Ze({shape:{x:c[0],y:c[1],width:s,height:l},cursor:"default",style:o});i.add(h)}},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 h=n.start,f=0;h.time<=n.end.time;f++){g(h.formatedDate),f===0&&(h=s.getDateInfo(n.start.y+"-"+n.start.m));var d=h.date;d.setMonth(d.getMonth()+1),h=s.getDateInfo(d)}g(s.getNextNDay(n.end.time,1).formatedDate);function g(m){o._firstDayOfMonth.push(s.getDateInfo(m)),o._firstDayPoints.push(s.dataToCalendarLayout([m],!1).tl);var y=o._getLinePointsOfOneWeek(r,m,i);o._tlpoints.push(y[0]),o._blpoints.push(y[y.length-1]),u&&o._drawSplitline(y,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 Gr({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 he(r)&&r?tQ(r,n):we(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,h=(u[0][1]+u[1][1])/2,f=i==="horizontal"?0:1,d={top:[c,u[f][1]],bottom:[c,u[1-f][1]],left:[u[1-f][0],h],right:[u[f][0],h]},g=n.start.y;+n.end.y>+n.start.y&&(g=g+"-"+n.end.y);var m=o.get("formatter"),y={start:n.start.y,end:n.end.y,nameMap:g},x=this._formatterLabel(m,y),_=new tt({z2:30,style:Ct(o,{text:x}),silent:o.get("silent")});_.attr(this._yearTextPositionControl(_,d[l],i,l,s)),a.add(_)}},t.prototype._monthTextPositionControl=function(r,n,i,a,o){var s="left",l="top",u=r[0],c=r[1];return i==="horizontal"?(c=c+o,n&&(s="center"),a==="start"&&(l="bottom")):(u=u+o,n&&(l="middle"),a==="start"&&(s="right")),{x:u,y:c,align:s,verticalAlign:l}},t.prototype._renderMonthText=function(r,n,i,a){var o=r.getModel("monthLabel");if(o.get("show")){var s=o.get("nameMap"),l=o.get("margin"),u=o.get("position"),c=o.get("align"),h=[this._tlpoints,this._blpoints];(!s||he(s))&&(s&&(n=sT(s)||n),s=n.get(["time","monthAbbr"])||[]);var f=u==="start"?0:1,d=i==="horizontal"?0:1;l=u==="start"?-l:l;for(var g=c==="center",m=o.get("silent"),y=0;y=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/Jw)-Math.floor(r[0].time/Jw)+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),h=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:h,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){$p({targetModel:a,coordSysType:"calendar",coordSysProvider:wV})}),n},e.dimensions=["time","value"],e}();function Qw(e){var t=e.calendarModel,r=e.seriesModel,n=t?t.coordinateSystem:r?r.coordinateSystem:null;return n}function Wde(e){e.registerComponentModel(Fde),e.registerComponentView(Vde),e.registerCoordinateSystem("calendar",Gde)}var wo={level:1,leaf:2,nonLeaf:3},Ro={none:0,all:1,body:2,corner:3};function d2(e,t,r){var n=t[Oe[r]].getCell(e);return!n&&rt(e)&&e<0&&(n=t[Oe[1-r]].getUnitLayoutInfo(r,Math.round(e))),n}function iH(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 aH(e,t,r,n,i){MO(e[0],t,i,r,n,0),MO(e[1],t,i,r,n,1)}function MO(e,t,r,n,i,a){e[0]=1/0,e[1]=-1/0;var o=n[a],s=re(o)?o:[o],l=s.length,u=!!r;if(l>=1?(AO(e,t,s,u,i,a,0),l>1&&AO(e,t,s,u,i,a,l-1)):e[0]=e[1]=NaN,u){var c=-i[Oe[1-a]].getLocatorCount(a),h=i[Oe[a]].getLocatorCount(a)-1;r===Ro.body?c=nr(0,c):r===Ro.corner&&(h=ni(-1,h)),h=t[0]&&e[0]<=t[1]}function NO(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 Zde(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 PO(e,t,r,n){var i=d2(t[n][0],r,n),a=d2(t[n][1],r,n);e[Oe[n]]=e[pr[n]]=NaN,i&&a&&(e[Oe[n]]=i.xy,e[pr[n]]=a.xy+a.wh-i.xy)}function Nd(e,t,r,n){return e[Oe[t]]=r,e[Oe[1-t]]=n,e}function $de(e){return e&&(e.type===wo.leaf||e.type===wo.nonLeaf)?e:null}function mx(){return{x:NaN,y:NaN,width:NaN,height:NaN}}var IO=function(){function e(t,r){this._cells=[],this._levels=[],this.dim=t,this.dimIdx=t==="x"?0:1,this._model=r,this._uniqueValueGen=Yde(t);var n=r.get("data",!0);n!=null&&!re(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,h){var f=0;return u&&j(u,function(d,g){var m;he(d)?m={value:d}:ke(d)?(m=d,d.value!=null&&!he(d.value)&&(m={value:null})):m={value:null};var y={type:wo.nonLeaf,ordinal:NaN,level:h,firstLeafLocator:c,id:new Ne,span:Nd(new Ne,r.dimIdx,1,1),option:m,xy:NaN,wh:NaN,dim:r,rect:mx()};o++,(a[c]||(a[c]=[])).push(y),i[h]||(i[h]={type:wo.level,xy:NaN,wh:NaN,option:null,id:new Ne,dim:r});var x=s(m.children,c,h+1),_=Math.max(1,x);y.span[Oe[r.dimIdx]]=_,f+=_,c+=_}),f}function l(){for(var u=[];n.length=1,w=r[Oe[n]],S=a.getLocatorCount(n)-1,T=new Ws;for(o.resetLayoutIterator(T,n);T.next();)M(T.item);for(a.resetLayoutIterator(T,n);T.next();)M(T.item);function M(A){Xr(A.wh)&&(A.wh=x),A.xy=w,A.id[Oe[n]]===S&&!_&&(A.wh=r[Oe[n]]+r[pr[n]]-A.xy),w+=A.wh}}function BO(e,t){for(var r=t[Oe[e]].resetCellIterator();r.next();){var n=r.item;yx(n.rect,e,n.id,n.span,t),yx(n.rect,1-e,n.id,n.span,t),n.type===wo.nonLeaf&&(n.xy=n.rect[Oe[e]],n.wh=n.rect[pr[e]])}}function FO(e,t){e.travelExistingCells(function(r){var n=r.span;if(n){var i=r.spanRect,a=r.id;yx(i,0,a,n,t),yx(i,1,a,n,t)}})}function yx(e,t,r,n,i){e[pr[t]]=0;var a=r[Oe[t]],o=a<0?i[Oe[1-t]]:i[Oe[t]],s=o.getUnitLayoutInfo(t,r[Oe[t]]);if(e[Oe[t]]=s.xy,e[pr[t]]=s.wh,n[Oe[t]]>1){var l=o.getUnitLayoutInfo(t,r[Oe[t]]+n[Oe[t]]-1);e[pr[t]]=l.xy+l.wh-s.xy}}function sve(e,t,r){var n=P0(e,r[pr[t]]);return p2(n,r[pr[t]])}function p2(e,t){return Math.max(Math.min(e,be(t,1/0)),0)}function rS(e){var t=e.matrixModel,r=e.seriesModel,n=t?t.coordinateSystem:r?r.coordinateSystem:null;return n}var $r={inBody:1,inCorner:2,outside:3},Ta={x:null,y:null,point:[]};function VO(e,t,r,n,i){var a=r[Oe[t]],o=r[Oe[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,h=e.point[t]=n[t];if(!l&&!c){e[Oe[t]]=$r.outside;return}if(i===Ro.body){l?(e[Oe[t]]=$r.inBody,h=ni(s.xy+s.wh,nr(l.xy,h)),e.point[t]=h):e[Oe[t]]=$r.outside;return}else if(i===Ro.corner){c?(e[Oe[t]]=$r.inCorner,h=ni(c.xy+c.wh,nr(u.xy,h)),e.point[t]=h):e[Oe[t]]=$r.outside;return}var f=l?l.xy:c?c.xy+c.wh:NaN,d=u?u.xy:f,g=s?s.xy+s.wh:f;if(hg){if(!i){e[Oe[t]]=$r.outside;return}h=g}e.point[t]=h,e[Oe[t]]=f<=h&&h<=g?$r.inBody:d<=h&&h<=f?$r.inCorner:$r.outside}function GO(e,t,r,n){var i=1-r;if(e[Oe[r]]!==$r.outside)for(n[Oe[r]].resetCellIterator(tS);tS.next();){var a=tS.item;if(HO(e.point[r],a.rect,r)&&HO(e.point[i],a.rect,i)){t[r]=a.ordinal,t[i]=a.id[Oe[i]];return}}}function WO(e,t,r,n){if(e[Oe[r]]!==$r.outside){var i=e[Oe[r]]===$r.inCorner?n[Oe[1-r]]:n[Oe[r]];for(i.resetLayoutIterator(ey,r);ey.next();)if(lve(e.point[r],ey.item)){t[r]=ey.item.id[Oe[r]];return}}}function lve(e,t){return t.xy<=e&&e<=t.xy+t.wh}function HO(e,t,r){return t[Oe[r]]<=e&&e<=t[Oe[r]]+t[pr[r]]}function uve(e){e.registerComponentModel(Jde),e.registerComponentView(nve),e.registerCoordinateSystem("matrix",ove)}function cve(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 UO(e,t){var r;return j(t,function(n){e[n]!=null&&e[n]!=="auto"&&(r=!0)}),r}function hve(e,t,r){var n=Q({},r),i=e[t],a=r.$action||"merge";a==="merge"?i?(Ge(i,n,!0),Ka(i,n,{ignoreSize:!0}),AV(r,i),ty(r,i),ty(r,i,"shape"),ty(r,i,"style"),ty(r,i,"extra"),r.clipPath=i.clipPath):e[t]=n:a==="replace"?e[t]=n:a==="remove"&&i&&(e[t]=null)}var sH=["transition","enterFrom","leaveTo"],fve=sH.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function ty(e,t,r){if(r&&(!e[r]&&t[r]&&(e[r]={}),e=e[r],t=t[r]),!(!e||!t))for(var n=r?sH:fve,i=0;i=0;c--){var h=i[c],f=br(h.id,null),d=f!=null?o.get(f):null;if(d){var g=d.parent,x=_i(g),_=g===a?{width:s,height:l}:{width:x.width,height:x.height},w={},S=C_(d,h,_,null,{hv:h.hv,boundingMode:h.bounding},w);if(!_i(d).isNew&&S){for(var T=h.transition,M={},A=0;A=0)?M[P]=I:d[P]=I}it(d,M,r,0)}else d.attr(w)}}},t.prototype._clear=function(){var r=this,n=this._elMap;n.each(function(i){Gy(i,_i(i).option,n,r._lastGraphicModel)}),this._elMap=_e()},t.prototype.dispose=function(){this._clear()},t.type="graphic",t}(Mt);function g2(e){var t=ge(ZO,e)?ZO[e]:ip(e),r=new t({});return _i(r).type=e,r}function $O(e,t,r,n){var i=g2(r);return t.add(i),n.set(e,i),_i(i).id=e,_i(i).isNew=!0,i}function Gy(e,t,r,n){var i=e&&e.parent;i&&(e.type==="group"&&e.traverse(function(a){Gy(a,t,r,n)}),F_(e,t,n),r.removeKey(_i(e).id))}function YO(e,t,r,n){e.isGroup||j([["cursor",Ri.prototype.cursor],["zlevel",n||0],["z",r||0],["z2",0]],function(i){var a=i[0];ge(t,a)?e[a]=be(t[a],i[1]):e[a]==null&&(e[a]=i[1])}),j(Qe(t),function(i){if(i.indexOf("on")===0){var a=t[i];e[i]=we(a)?a:null}}),ge(t,"draggable")&&(e.draggable=t.draggable),t.name!=null&&(e.name=t.name),t.id!=null&&(e.id=t.id)}function gve(e){return e=Q({},e),j(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(SV),function(t){delete e[t]}),e}function mve(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 yve(e){e.registerComponentModel(vve),e.registerComponentView(pve),e.registerPreprocessor(function(t){var r=t.graphic;re(r)?!r[0]||!r[0].elements?t.graphic=[{elements:r}]:t.graphic=[t.graphic[0]]:r&&!r.elements&&(t.graphic=[{elements:[r]}])})}var XO=["x","y","radius","angle","single"],xve=["cartesian2d","polar","singleAxis"];function _ve(e){var t=e.get("coordinateSystem");return Ve(xve,t)>=0}function Ps(e){return e+"Axis"}function bve(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 h=!1;return c.eachTargetAxis(function(f,d){var g=r.get(f);g&&g[d]&&(h=!0)}),h}function u(c){c.eachTargetAxis(function(h,f){(r.get(h)||r.set(h,[]))[f]=!0})}return n}function lH(e){var t=e.ecModel,r={infoList:[],infoMap:_e()};return e.eachTargetAxis(function(n,i){var a=t.getComponent(Ps(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 nS=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}(),Sp=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=qO(r);this.settledOption=a,this.mergeDefaultAndTheme(r,i),this._doInit(a)},t.prototype.mergeOption=function(r){var n=qO(r);Ge(this.option,r,!0),Ge(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;j([["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 j(XO,function(i){var a=this.getReferringComponents(Ps(i),Bq);if(a.specified){n=!0;var o=new nS;j(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 h=u[0];if(h){var f=new nS;if(f.add(h.componentIndex),r.set(c,f),a=!1,c==="x"||c==="y"){var d=h.getReferringComponents("grid",Ht).models[0];d&&j(u,function(g){h.componentIndex!==g.componentIndex&&d===g.getReferringComponents("grid",Ht).models[0]&&f.add(g.componentIndex)})}}}a&&j(XO,function(u){if(a){var c=i.findComponents({mainType:Ps(u),filter:function(f){return f.get("type",!0)==="category"}});if(c[0]){var h=new nS;h.add(c[0].componentIndex),r.set(u,h),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");j([["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(Ps(n),i))},this),r},t.prototype.eachTargetAxis=function(r,n){this._targetAxisInfoMap.each(function(i,a){j(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(Ps(r),n)},t.prototype.setRawRange=function(r){var n=this.option,i=this.settledOption;j([["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;j(["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(w&&!S&&!T)return!0;w&&(y=!0),S&&(g=!0),T&&(m=!0)}return y&&g&&m})}else Uc(c,function(d){if(a==="empty")l.setData(u=u.map(d,function(m){return s(m)?m:NaN}));else{var g={};g[d]=o,u.selectRange(g)}});Uc(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;Uc(["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=ht(n[0]+o,n,[0,100],!0):a!=null&&(o=ht(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=QM(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 Tve(e,t,r){var n=[1/0,-1/0];Uc(r,function(o){Wre(n,o.getData(),t)});var i=e.getAxisModel(),a=sG(i.axis.scale,i,n).calculate();return[a.min,a.max]}var Mve={getTargetSeries:function(e){function t(i){e.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=e.getComponent(Ps(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 Cve(i,a,s,e),r.push(o.__dzAxisProxy))});var n=_e();return j(r,function(i){j(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 Ave(e){e.registerAction("dataZoom",function(t,r){var n=bve(r,t);j(n,function(i){i.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})})}var JO=!1;function hL(e){JO||(JO=!0,e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,Mve),Ave(e),e.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function kve(e){e.registerComponentModel(wve),e.registerComponentView(Sve),hL(e)}var Ci=function(){function e(){}return e}(),uH={};function Zc(e,t){uH[e]=t}function cH(e){return uH[e]}var Lve=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.optionUpdated=function(){e.prototype.optionUpdated.apply(this,arguments);var r=this.ecModel;j(this.option.feature,function(n,i){var a=cH(i);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(r)),Ge(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}($e);function hH(e,t){var r=gf(t.get("padding")),n=t.getItemStyle(["color","opacity"]);n.fill=t.get("backgroundColor");var i=new Ze({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 Nve=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={}),h=[];j(u,function(_,w){h.push(w)}),new Zo(this._featureNames||[],h).add(f).update(f).remove(Fe(f,null)).execute(),this._featureNames=h;function f(_,w){var S=h[_],T=h[w],M=u[S],A=new qe(M,r,r.ecModel),P;if(a&&a.newTitle!=null&&a.featureName===S&&(M.title=a.newTitle),S&&!T){if(Pve(S))P={onclick:A.option.onclick,featureName:S};else{var I=cH(S);if(!I)return;P=new I}c[S]=P}else if(P=c[T],!P)return;P.uid=pf("toolbox-feature"),P.model=A,P.ecModel=n,P.api=i;var N=P instanceof Ci;if(!S&&T){N&&P.dispose&&P.dispose(n,i);return}if(!A.get("show")||N&&P.unusable){N&&P.remove&&P.remove(n,i);return}d(A,P,S),A.setIconStatus=function(D,O){var R=this.option,F=this.iconPaths;R.iconStatus=R.iconStatus||{},R.iconStatus[D]=O,F[D]&&(O==="emphasis"?Ho:Uo)(F[D])},P instanceof Ci&&P.render&&P.render(A,n,i,a)}function d(_,w,S){var T=_.getModel("iconStyle"),M=_.getModel(["emphasis","iconStyle"]),A=w instanceof Ci&&w.getIcons?w.getIcons():_.get("icon"),P=_.get("title")||{},I,N;he(A)?(I={},I[S]=A):I=A,he(P)?(N={},N[S]=P):N=P;var D=_.iconPaths={};j(I,function(O,R){var F=df(O,{},{x:-s/2,y:-s/2,width:s,height:s});F.setStyle(T.getItemStyle());var H=F.ensureState("emphasis");H.style=M.getItemStyle();var W=new tt({style:{text:N[R],align:M.get("textAlign"),borderRadius:M.get("textBorderRadius"),padding:M.get("textPadding"),fill:null,font:wA({fontStyle:M.get("textFontStyle"),fontFamily:M.get("textFontFamily"),fontSize:M.get("textFontSize"),fontWeight:M.get("textFontWeight")},n)},ignore:!0});F.setTextContent(W),Qo({el:F,componentModel:r,itemName:R,formatterParamsExtra:{title:N[R]}}),F.__title=N[R],F.on("mouseover",function(){var V=M.getItemStyle(),z=l?r.get("right")==null&&r.get("left")!=="right"?"right":"left":r.get("bottom")==null&&r.get("top")!=="bottom"?"bottom":"top";W.setStyle({fill:M.get("textFill")||V.fill||V.stroke||K.color.neutral99,backgroundColor:M.get("textBackgroundColor")}),F.setTextConfig({position:M.get("textPosition")||z}),W.ignore=!r.get("showTitle"),i.enterEmphasis(this)}).on("mouseout",function(){_.get(["iconStatus",R])!=="emphasis"&&i.leaveEmphasis(this),W.hide()}),(_.get(["iconStatus",R])==="emphasis"?Ho:Uo)(F),o.add(F),F.on("click",fe(w.onclick,w,n,i,R)),D[R]=F})}var g=Tr(r,i).refContainer,m=r.getBoxLayoutParams(),y=r.get("padding"),x=It(m,g,y);wu(r.get("orient"),o,r.get("itemGap"),x.width,x.height),C_(o,m,g,y),o.add(hH(o.getBoundingRect(),r)),l||o.eachChild(function(_){var w=_.__title,S=_.ensureState("emphasis"),T=S.textConfig||(S.textConfig={}),M=_.getTextContent(),A=M&&M.ensureState("emphasis");if(A&&!we(A)&&w){var P=A.style||(A.style={}),I=c_(w,tt.makeFont(P)),N=_.x+o.x,D=_.y+o.y+s,O=!1;D+I.height>i.getHeight()&&(T.position="top",O=!0);var R=O?-5-I.height:s+10;N+I.width/2>i.getWidth()?(T.position=["100%",R],P.align="right"):N-I.width/2<0&&(T.position=[0,R],P.align="left")}})},t.prototype.updateView=function(r,n,i,a){j(this._features,function(o){o instanceof Ci&&o.updateView&&o.updateView(o.model,n,i,a)})},t.prototype.remove=function(r,n){j(this._features,function(i){i instanceof Ci&&i.remove&&i.remove(r,n)}),this.group.removeAll()},t.prototype.dispose=function(r,n){j(this._features,function(i){i instanceof Ci&&i.dispose&&i.dispose(r,n)})},t.type="toolbox",t}(Mt);function Pve(e){return e.indexOf("my")===0}var Ive=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=Je.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 h=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});c.dispatchEvent(h)}else if(window.navigator.msSaveOrOpenBlob||o){var f=l.split(","),d=f[0].indexOf("base64")>-1,g=o?decodeURIComponent(f[1]):f[1];d&&(g=window.atob(g));var m=a+"."+s;if(window.navigator.msSaveOrOpenBlob){for(var y=g.length,x=new Uint8Array(y);y--;)x[y]=g.charCodeAt(y);var _=new Blob([x]);window.navigator.msSaveOrOpenBlob(_,m)}else{var w=document.createElement("iframe");document.body.appendChild(w);var S=w.contentWindow,T=S.document;T.open("image/svg+xml","replace"),T.write(g),T.close(),S.focus(),T.execCommand("SaveAs",!0,m),document.body.removeChild(w)}}else{var M=i.get("lang"),A='',P=window.open();P.document.write(A),P.document.title=a}},t.getDefaultOption=function(r){var n={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:r.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:K.color.neutral00,name:"",excludeComponents:["toolbox"],lang:r.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return n},t}(Ci),QO="__ec_magicType_stack__",Dve=[["line","bar"],["stack"]],Eve=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 j(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(e5[i]){var s={series:[]},l=function(h){var f=h.subType,d=h.id,g=e5[i](f,d,h,a);g&&(Ae(g,h.option),s.series.push(g));var m=h.coordinateSystem;if(m&&m.type==="cartesian2d"&&(i==="line"||i==="bar")){var y=m.getAxesByScale("ordinal")[0];if(y){var x=y.dim,_=x+"Axis",w=h.getReferringComponents(_,Ht).models[0],S=w.componentIndex;s[_]=s[_]||[];for(var T=0;T<=S;T++)s[_][S]=s[_][S]||{};s[_][S].boundaryGap=i==="bar"}}};j(Dve,function(h){Ve(h,i)>=0&&j(h,function(f){a.setIconStatus(f,"normal")})}),a.setIconStatus(i,"emphasis"),r.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var u,c=i;i==="stack"&&(u=Ge({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}(Ci),e5={line:function(e,t,r,n){if(e==="bar")return Ge({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 Ge({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")===QO;if(e==="line"||e==="bar")return n.setIconStatus("stack",i?"normal":"emphasis"),Ge({id:t,stack:i?"":QO},n.get(["option","stack"])||{},!0)}};pa({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(e,t){t.mergeOption(e.newOption)});var V_=new Array(60).join("-"),qh=" ";function jve(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 Rve(e){var t=[];return j(e,function(r,n){var i=r.categoryAxis,a=r.valueAxis,o=a.dim,s=[" "].concat(ae(r.series,function(d){return d.name})),l=[i.model.getCategories()];j(r.series,function(d){var g=d.getRawData();l.push(d.getRawData().mapArray(g.mapDimension(o),function(m){return m}))});for(var u=[s.join(qh)],c=0;c=0)return!0}var m2=new RegExp("["+qh+"]+","g");function Fve(e){for(var t=e.split(/\n+/g),r=__(t.shift()).split(m2),n=[],i=ae(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 Zve(e){var t=fL(e),r=t[t.length-1];t.length>1&&t.pop();var n={};return fH(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 $ve(e){dH(e).snapshots=null}function Yve(e){return fL(e).length}function fL(e){var t=dH(e);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var Xve=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(r,n){$ve(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}(Ci);pa({type:"restore",event:"restore",update:"prepareAndUpdate"},function(e,t){t.resetOption("recreate")});var qve=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],dL=function(){function e(t,r,n){var i=this;this._targetInfoList=[];var a=t5(r,t);j(Kve,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=iS[n.brushType](0,a,i);n.__rangeOffset={offset:a5[n.brushType](o.values,n.range,[1,1]),xyMinMax:o.xyMinMax}}}),t},e.prototype.matchOutputRanges=function(t,r,n){j(t,function(i){var a=this.findTargetInfo(i,r);a&&a!==!0&&j(a.coordSyses,function(o){var s=iS[i.brushType](1,o,i.range,!0);n(i,s.values,o,r)})},this)},e.prototype.setInputRanges=function(t,r){j(t,function(n){var i=this.findTargetInfo(n,r);if(n.range=n.range||[],i&&i!==!0){n.panelId=i.panelId;var a=iS[n.brushType](0,i.coordSys,n.coordRange),o=n.__rangeOffset;n.range=o?a5[n.brushType](a.values,o.offset,Jve(a.xyMinMax,o.xyMinMax)):a.values}},this)},e.prototype.makePanelOpts=function(t,r){return ae(this._targetInfoList,function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:r?r(n):null,clipPath:y8(i),isTargetByCursor:x8(i,t,n.coordSysModel),getLinearBrushOtherExtent:_8(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=t5(r,t),a=0;ae[1]&&e.reverse(),e}function t5(e,t){return xh(e,t,{includeMainTypes:qve})}var Kve={grid:function(e,t){var r=e.xAxisModels,n=e.yAxisModels,i=e.gridModels,a=xe(),o={},s={};!r&&!n&&!i||(j(r,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),j(n,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),j(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=[];j(u.getCartesians(),function(h,f){(Ve(r,h.getAxis("x").model)>=0||Ve(n,h.getAxis("y").model)>=0)&&c.push(h)}),t.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:c[0],coordSyses:c,getPanelRect:n5.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(e,t){j(e.geoModels,function(r){var n=r.coordinateSystem;t.push({panelId:"geo--"+r.id,geoModel:r,coordSysModel:r,coordSys:n,coordSyses:[n],getPanelRect:n5.geo})})}},r5=[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}],n5={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(Us(e)),t}},iS={lineX:Fe(i5,0),lineY:Fe(i5,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=[y2([i[0],a[0]]),y2([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=ae(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 i5(e,t,r,n){var i=r.getAxis(["x","y"][e]),a=y2(ae([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 a5={lineX:Fe(o5,0),lineY:Fe(o5,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 ae(e,function(n,i){return[n[0]-r[0]*t[i][0],n[1]-r[1]*t[i][1]]})}};function o5(e,t,r,n){return[t[0]-n[e]*r[0],t[1]-n[e]*r[1]]}function Jve(e,t){var r=s5(e),n=s5(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 s5(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var _2=j,Qve=Eq("toolbox-dataZoom_"),epe=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 zk(i.getZr()),this._brushController.on("brush",fe(this._onBrush,this)).mount()),npe(r,n,this,a,i),rpe(r,n)},t.prototype.onclick=function(r,n,i){tpe[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 dL(vL(this.model),a,{include:["grid"]});o.matchOutputRanges(n,a,function(u,c,h){if(h.type==="cartesian2d"){var f=u.brushType;f==="rect"?(s("x",h,c[0]),s("y",h,c[1])):s({lineX:"x",lineY:"y"}[f],h,c)}}),Uve(a,i),this._dispatchZoomAction(i);function s(u,c,h){var f=c.getAxis(u),d=f.model,g=l(u,d,a),m=g.findRepresentativeAxisProxy(d).getMinMaxSpan();(m.minValueSpan!=null||m.maxValueSpan!=null)&&(h=rl(0,h.slice(),f.scale.getExtent(),0,m.minValueSpan,m.maxValueSpan)),g&&(i[g.id]={dataZoomId:g.id,startValue:h[0],endValue:h[1]})}function l(u,c,h){var f;return h.eachComponent({mainType:"dataZoom",subType:"select"},function(d){var g=d.getAxisModel(u,c.componentIndex);g&&(f=d)}),f}},t.prototype._dispatchZoomAction=function(r){var n=[];_2(r,function(i,a){n.push(Se(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}(Ci),tpe={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(Zve(this.ecModel))}};function vL(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 rpe(e,t){e.setIconStatus("back",Yve(t)>1?"emphasis":"normal")}function npe(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 dL(vL(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)}pQ("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=vL(n),o=xh(e,a);_2(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),_2(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,c){var h=l.componentIndex,f={type:"select",$fromToolbox:!0,filterMode:n.get("filterMode",!0)||"filter",id:Qve+u+h};f[c]=h,i.push(f)}return i});function ipe(e){e.registerComponentModel(Lve),e.registerComponentView(Nve),Zc("saveAsImage",Ive),Zc("magicType",Eve),Zc("dataView",Wve),Zc("dataZoom",epe),Zc("restore",Xve),He(kve)}var ape=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}($e);function vH(e){var t=e.get("confine");return t!=null?!!t:e.get("renderMode")==="richText"}function pH(e){if(Je.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,h=o+i,f=h*Math.abs(Math.cos(c))+h*Math.abs(Math.sin(c)),d=Math.round(((f-Math.SQRT2*i)/2+Math.SQRT2*i-(f-h)/2)*100)/100;s+=";"+a+":-"+d+"px";var g=t+" solid "+i+"px;",m=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+g,"border-right:"+g,"background-color:"+n+";"];return'
'}function fpe(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?",":"")+(Je.transformSupported?""+pL+i:",left"+i+",top"+i)),lpe+":"+a}function l5(e,t,r){var n=e.toFixed(0)+"px",i=t.toFixed(0)+"px";if(!Je.transformSupported)return r?"top:"+i+";left:"+n+";":[["top",i],["left",n]];var a=Je.transform3dSupported,o="translate"+(a?"3d":"")+"("+n+","+i+(a?",0":"")+")";return r?"top:0;left:0;"+pL+":"+o+";":[["top",0],["left",0],[gH,o]]}function dpe(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),j(["decoration","align"],function(u){var c=e.get(u);c&&t.push("text-"+u+":"+c)}),t.join(";")}function vpe(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"),h=e.getModel("textStyle"),f=a6(e,"html"),d=u+"px "+c+"px "+s+"px "+l;return i.push("box-shadow:"+d),t&&a>0&&i.push(fpe(a,r,n)),o&&i.push("background-color:"+o),j(["width","color","radius"],function(g){var m="border-"+g,y=jA(m),_=e.get(y);_!=null&&i.push(m+":"+_+(g==="color"?"":"px"))}),i.push(dpe(h)),f!=null&&i.push("padding:"+gf(f).join("px ")+"px"),i.join(";")+";"}function u5(e,t,r,n,i){var a=t&&t.painter;if(r){var o=a&&a.getViewportRoot();o&&QY(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 ppe=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,Je.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&&(he(a)?document.querySelector(a):Eu(a)?a:we(a)&&a(t.getDom()));u5(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();mi(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=spe(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=upe+vpe(t,!this._firstShow,this._longHide,this._enableDisplayTransition)+l5(a[0],a[1],!0)+("border-color:"+Vu(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(he(a)&&n.get("trigger")==="item"&&!vH(n)&&(s=hpe(n,i,a)),he(t))o.innerHTML=t+s;else if(t){o.innerHTML="",re(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||Je.node||!i.getDom())){var o=f5(a,i);this._ticket="";var s=a.dataByCoordSys,l=wpe(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=mpe;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 h=Q8(a,n),f=h.point[0],d=h.point[1];f!=null&&d!=null&&this._tryShow({offsetX:f,offsetY:d,target:h.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(f5(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(),h=Id([c.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(h.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;vu(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=fe(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=Id([n.tooltipOption],a),l=this._renderMode,u=[],c=gr("section",{blocks:[],noHeader:!0}),h=[],f=new Bb;j(r,function(x){j(x.dataByAxis,function(w){var S=i.getComponent(w.axisDim+"Axis",w.axisIndex),T=w.value;if(!(!S||T==null)){var M=X8(T,S.axis,i,w.seriesDataIndices,w.valueLabelOpt),A=gr("section",{header:M,noHeader:!Jn(M),sortBlocks:!0,blocks:[]});c.blocks.push(A),j(w.seriesDataIndices,function(P){var I=i.getSeriesByIndex(P.seriesIndex),N=P.dataIndexInside,D=I.getDataParams(N);if(!(D.dataIndex<0)){D.axisDim=w.axisDim,D.axisIndex=w.axisIndex,D.axisType=w.axisType,D.axisId=w.axisId,D.axisValue=q0(S.axis,{value:T}),D.axisValueLabel=M,D.marker=f.makeTooltipMarker("item",Vu(D.color),l);var O=kD(I.formatTooltip(N,!0,null)),R=O.frag;if(R){var F=Id([I],a).get("valueFormatter");A.blocks.push(F?Q({valueFormatter:F},R):R)}O.text&&h.push(O.text),u.push(D)}})}})}),c.blocks.reverse(),h.reverse();var d=n.position,g=s.get("order"),m=ED(c,f,l,g,i.get("useUTC"),s.get("textStyle"));m&&h.unshift(m);var y=l==="richText"?` +`),meta:t.meta}}function xx(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Bve(e){var t=e.slice(0,e.indexOf(` +`));if(t.indexOf(qh)>=0)return!0}var m2=new RegExp("["+qh+"]+","g");function Fve(e){for(var t=e.split(/\n+/g),r=xx(t.shift()).split(m2),n=[],i=ae(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 Zve(e){var t=fL(e),r=t[t.length-1];t.length>1&&t.pop();var n={};return fH(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 $ve(e){dH(e).snapshots=null}function Yve(e){return fL(e).length}function fL(e){var t=dH(e);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var Xve=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(r,n){$ve(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}(Ci);pa({type:"restore",event:"restore",update:"prepareAndUpdate"},function(e,t){t.resetOption("recreate")});var qve=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],dL=function(){function e(t,r,n){var i=this;this._targetInfoList=[];var a=t5(r,t);j(Kve,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=iS[n.brushType](0,a,i);n.__rangeOffset={offset:a5[n.brushType](o.values,n.range,[1,1]),xyMinMax:o.xyMinMax}}}),t},e.prototype.matchOutputRanges=function(t,r,n){j(t,function(i){var a=this.findTargetInfo(i,r);a&&a!==!0&&j(a.coordSyses,function(o){var s=iS[i.brushType](1,o,i.range,!0);n(i,s.values,o,r)})},this)},e.prototype.setInputRanges=function(t,r){j(t,function(n){var i=this.findTargetInfo(n,r);if(n.range=n.range||[],i&&i!==!0){n.panelId=i.panelId;var a=iS[n.brushType](0,i.coordSys,n.coordRange),o=n.__rangeOffset;n.range=o?a5[n.brushType](a.values,o.offset,Jve(a.xyMinMax,o.xyMinMax)):a.values}},this)},e.prototype.makePanelOpts=function(t,r){return ae(this._targetInfoList,function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:r?r(n):null,clipPath:y8(i),isTargetByCursor:_8(i,t,n.coordSysModel),getLinearBrushOtherExtent:x8(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=t5(r,t),a=0;ae[1]&&e.reverse(),e}function t5(e,t){return _h(e,t,{includeMainTypes:qve})}var Kve={grid:function(e,t){var r=e.xAxisModels,n=e.yAxisModels,i=e.gridModels,a=_e(),o={},s={};!r&&!n&&!i||(j(r,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),j(n,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),j(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=[];j(u.getCartesians(),function(h,f){(Ve(r,h.getAxis("x").model)>=0||Ve(n,h.getAxis("y").model)>=0)&&c.push(h)}),t.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:c[0],coordSyses:c,getPanelRect:n5.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(e,t){j(e.geoModels,function(r){var n=r.coordinateSystem;t.push({panelId:"geo--"+r.id,geoModel:r,coordSysModel:r,coordSys:n,coordSyses:[n],getPanelRect:n5.geo})})}},r5=[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}],n5={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(Us(e)),t}},iS={lineX:Fe(i5,0),lineY:Fe(i5,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=[y2([i[0],a[0]]),y2([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=ae(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 i5(e,t,r,n){var i=r.getAxis(["x","y"][e]),a=y2(ae([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 a5={lineX:Fe(o5,0),lineY:Fe(o5,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 ae(e,function(n,i){return[n[0]-r[0]*t[i][0],n[1]-r[1]*t[i][1]]})}};function o5(e,t,r,n){return[t[0]-n[e]*r[0],t[1]-n[e]*r[1]]}function Jve(e,t){var r=s5(e),n=s5(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 s5(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var x2=j,Qve=Eq("toolbox-dataZoom_"),epe=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 zk(i.getZr()),this._brushController.on("brush",fe(this._onBrush,this)).mount()),npe(r,n,this,a,i),rpe(r,n)},t.prototype.onclick=function(r,n,i){tpe[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 dL(vL(this.model),a,{include:["grid"]});o.matchOutputRanges(n,a,function(u,c,h){if(h.type==="cartesian2d"){var f=u.brushType;f==="rect"?(s("x",h,c[0]),s("y",h,c[1])):s({lineX:"x",lineY:"y"}[f],h,c)}}),Uve(a,i),this._dispatchZoomAction(i);function s(u,c,h){var f=c.getAxis(u),d=f.model,g=l(u,d,a),m=g.findRepresentativeAxisProxy(d).getMinMaxSpan();(m.minValueSpan!=null||m.maxValueSpan!=null)&&(h=rl(0,h.slice(),f.scale.getExtent(),0,m.minValueSpan,m.maxValueSpan)),g&&(i[g.id]={dataZoomId:g.id,startValue:h[0],endValue:h[1]})}function l(u,c,h){var f;return h.eachComponent({mainType:"dataZoom",subType:"select"},function(d){var g=d.getAxisModel(u,c.componentIndex);g&&(f=d)}),f}},t.prototype._dispatchZoomAction=function(r){var n=[];x2(r,function(i,a){n.push(Se(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}(Ci),tpe={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(Zve(this.ecModel))}};function vL(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 rpe(e,t){e.setIconStatus("back",Yve(t)>1?"emphasis":"normal")}function npe(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 dL(vL(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)}pQ("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=vL(n),o=_h(e,a);x2(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),x2(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,c){var h=l.componentIndex,f={type:"select",$fromToolbox:!0,filterMode:n.get("filterMode",!0)||"filter",id:Qve+u+h};f[c]=h,i.push(f)}return i});function ipe(e){e.registerComponentModel(Lve),e.registerComponentView(Nve),Zc("saveAsImage",Ive),Zc("magicType",Eve),Zc("dataView",Wve),Zc("dataZoom",epe),Zc("restore",Xve),He(kve)}var ape=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}($e);function vH(e){var t=e.get("confine");return t!=null?!!t:e.get("renderMode")==="richText"}function pH(e){if(Je.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,h=o+i,f=h*Math.abs(Math.cos(c))+h*Math.abs(Math.sin(c)),d=Math.round(((f-Math.SQRT2*i)/2+Math.SQRT2*i-(f-h)/2)*100)/100;s+=";"+a+":-"+d+"px";var g=t+" solid "+i+"px;",m=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+g,"border-right:"+g,"background-color:"+n+";"];return'
'}function fpe(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?",":"")+(Je.transformSupported?""+pL+i:",left"+i+",top"+i)),lpe+":"+a}function l5(e,t,r){var n=e.toFixed(0)+"px",i=t.toFixed(0)+"px";if(!Je.transformSupported)return r?"top:"+i+";left:"+n+";":[["top",i],["left",n]];var a=Je.transform3dSupported,o="translate"+(a?"3d":"")+"("+n+","+i+(a?",0":"")+")";return r?"top:0;left:0;"+pL+":"+o+";":[["top",0],["left",0],[gH,o]]}function dpe(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),j(["decoration","align"],function(u){var c=e.get(u);c&&t.push("text-"+u+":"+c)}),t.join(";")}function vpe(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"),h=e.getModel("textStyle"),f=a6(e,"html"),d=u+"px "+c+"px "+s+"px "+l;return i.push("box-shadow:"+d),t&&a>0&&i.push(fpe(a,r,n)),o&&i.push("background-color:"+o),j(["width","color","radius"],function(g){var m="border-"+g,y=jA(m),x=e.get(y);x!=null&&i.push(m+":"+x+(g==="color"?"":"px"))}),i.push(dpe(h)),f!=null&&i.push("padding:"+gf(f).join("px ")+"px"),i.join(";")+";"}function u5(e,t,r,n,i){var a=t&&t.painter;if(r){var o=a&&a.getViewportRoot();o&&QY(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 ppe=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,Je.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&&(he(a)?document.querySelector(a):Eu(a)?a:we(a)&&a(t.getDom()));u5(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();mi(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=spe(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=upe+vpe(t,!this._firstShow,this._longHide,this._enableDisplayTransition)+l5(a[0],a[1],!0)+("border-color:"+Vu(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(he(a)&&n.get("trigger")==="item"&&!vH(n)&&(s=hpe(n,i,a)),he(t))o.innerHTML=t+s;else if(t){o.innerHTML="",re(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||Je.node||!i.getDom())){var o=f5(a,i);this._ticket="";var s=a.dataByCoordSys,l=wpe(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=mpe;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 h=Q8(a,n),f=h.point[0],d=h.point[1];f!=null&&d!=null&&this._tryShow({offsetX:f,offsetY:d,target:h.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(f5(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(),h=Id([c.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(h.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;vu(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=fe(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=Id([n.tooltipOption],a),l=this._renderMode,u=[],c=gr("section",{blocks:[],noHeader:!0}),h=[],f=new Bb;j(r,function(_){j(_.dataByAxis,function(w){var S=i.getComponent(w.axisDim+"Axis",w.axisIndex),T=w.value;if(!(!S||T==null)){var M=X8(T,S.axis,i,w.seriesDataIndices,w.valueLabelOpt),A=gr("section",{header:M,noHeader:!Jn(M),sortBlocks:!0,blocks:[]});c.blocks.push(A),j(w.seriesDataIndices,function(P){var I=i.getSeriesByIndex(P.seriesIndex),N=P.dataIndexInside,D=I.getDataParams(N);if(!(D.dataIndex<0)){D.axisDim=w.axisDim,D.axisIndex=w.axisIndex,D.axisType=w.axisType,D.axisId=w.axisId,D.axisValue=q0(S.axis,{value:T}),D.axisValueLabel=M,D.marker=f.makeTooltipMarker("item",Vu(D.color),l);var O=kD(I.formatTooltip(N,!0,null)),R=O.frag;if(R){var F=Id([I],a).get("valueFormatter");A.blocks.push(F?Q({valueFormatter:F},R):R)}O.text&&h.push(O.text),u.push(D)}})}})}),c.blocks.reverse(),h.reverse();var d=n.position,g=s.get("order"),m=ED(c,f,l,g,i.get("useUTC"),s.get("textStyle"));m&&h.unshift(m);var y=l==="richText"?` -`:"
",_=h.join(y);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(r,u)?this._updatePosition(s,d,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,_,u,Math.random()+"",o[0],o[1],d,null,f)})},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,h=o.dataType,f=u.getData(h),d=this._renderMode,g=r.positionDefault,m=Id([f.getItemModel(c),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,g?{position:g}:null),y=m.get("trigger");if(!(y!=null&&y!=="item")){var _=u.getDataParams(c,h),x=new Bb;_.marker=x.makeTooltipMarker("item",Vu(_.color),d);var w=kD(u.formatTooltip(c,!1,h)),S=m.get("order"),T=m.get("valueFormatter"),M=w.frag,A=M?ED(T?Q({valueFormatter:T},M):M,x,d,S,a.get("useUTC"),m.get("textStyle")):w.text,P="item_"+u.name+"_"+c;this._showOrMove(m,function(){this._showTooltipContent(m,A,_,P,r.offsetX,r.offsetY,r.position,r.target,x)}),i({type:"showTip",dataIndexInside:c,dataIndex:f.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(he(l)){var c=l;l={content:c,formatter:c},u=!0}u&&a&&l.content&&(l=Se(l),l.content=hn(l.content));var h=[l],f=this._ecModel.getComponent(o.componentMainType,o.componentIndex);f&&h.push(f),h.push({formatter:l.content});var d=r.positionDefault,g=Id(h,this._tooltipModel,d?{position:d}:null),m=g.get("content"),y=Math.random()+"",_=new Bb;this._showOrMove(g,function(){var x=Se(g.get("formatterParams")||{});this._showTooltipContent(g,m,x,y,r.offsetX,r.offsetY,r.position,n,_)}),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 h=this._tooltipContent;h.setEnterable(r.get("enterable"));var f=r.get("formatter");l=l||r.get("position");var d=n,g=this._getNearestPoint([o,s],i,r.get("trigger"),r.get("borderColor"),r.get("defaultBorderColor",!0)),m=g.color;if(f)if(he(f)){var y=r.ecModel.get("useUTC"),_=re(i)?i[0]:i,x=_&&_.axisType&&_.axisType.indexOf("time")>=0;d=f,x&&(d=Zp(_.axisValue,d,y)),d=RA(d,i,!0)}else if(we(f)){var w=fe(function(S,T){S===this._ticket&&(h.setContent(T,c,r,m,l),this._updatePosition(r,l,o,s,h,i,u))},this);this._ticket=a,d=f(i,a,w)}else d=f;h.setContent(d,c,r,m,l),h.show(r,m),this._updatePosition(r,l,o,s,h,i,u)}},t.prototype._getNearestPoint=function(r,n,i,a,o){if(i==="axis"||re(n))return{color:a||o};if(!re(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 h=o.getSize(),f=r.get("align"),d=r.get("verticalAlign"),g=l&&l.getBoundingRect().clone();if(l&&g.applyTransform(l.transform),we(n)&&(n=n([i,a],s,o.el,g,{viewSize:[u,c],contentSize:h.slice()})),re(n))i=ce(n[0],u),a=ce(n[1],c);else if(ke(n)){var m=n;m.width=h[0],m.height=h[1];var y=It(m,{width:u,height:c});i=y.x,a=y.y,f=null,d=null}else if(he(n)&&l){var _=bpe(n,g,h,r.get("borderWidth"));i=_[0],a=_[1]}else{var _=_pe(i,a,o,u,c,f?null:20,d?null:20);i=_[0],a=_[1]}if(f&&(i-=d5(f)?h[0]/2:f==="right"?h[0]:0),d&&(a-=d5(d)?h[1]/2:d==="bottom"?h[1]:0),vH(r)){var _=xpe(i,a,o,u,c);i=_[0],a=_[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&&j(i,function(s,l){var u=s.dataByAxis||[],c=r[l]||{},h=c.dataByAxis||[];o=o&&u.length===h.length,o&&j(u,function(f,d){var g=h[d]||{},m=f.seriesDataIndices||[],y=g.seriesDataIndices||[];o=o&&f.value===g.value&&f.axisType===g.axisType&&f.axisId===g.axisId&&m.length===y.length,o&&j(m,function(_,x){var w=y[x];o=o&&_.seriesIndex===w.seriesIndex&&_.dataIndex===w.dataIndex}),a&&j(f.seriesDataIndices,function(_){var x=_.seriesIndex,w=n[x],S=a[x];w&&S&&S.data!==w.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){Je.node||!n.getDom()||(lp(this,"_updatePosition"),this._tooltipContent.dispose(),h2("itemTooltip",n))},t.type="tooltip",t}(Mt);function Id(e,t,r){var n=t.ecModel,i;r?(i=new qe(r,n,n),i=new qe(t.option,i,n)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof qe&&(o=o.get("tooltip",!0)),he(o)&&(o={formatter:o}),o&&(i=new qe(o,i,n)))}return i}function f5(e,t){return e.dispatchAction||fe(t.dispatchAction,t)}function _pe(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 xpe(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 bpe(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 d5(e){return e==="center"||e==="middle"}function wpe(e,t,r){var n=iA(e).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=lf(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 Spe(e){He(tg),e.registerComponentModel(ape),e.registerComponentView(ype),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},qt),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},qt)}var Cpe=["rect","polygon","keep","clear"];function Tpe(e,t){var r=Tt(e?e.brush:[]);if(r.length){var n=[];j(r,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(n=n.concat(u))});var i=e&&e.toolbox;re(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),Mpe(s),t&&!s.length&&s.push.apply(s,Cpe)}}function Mpe(e){var t={};j(e,function(r){t[r]=1}),e.length=0,j(t,function(r,n){e.push(n)})}var v5=j;function p5(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function x2(e,t,r){var n={};return v5(t,function(a){var o=n[a]=i();v5(e[a],function(s,l){if(Ir.isValidType(l)){var u={type:l,visual:s};r&&r(u,a),o[l]=new Ir(u),l==="opacity"&&(u=Se(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new Ir(u))}})}),n;function i(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function yH(e,t,r){var n;j(r,function(i){t.hasOwnProperty(i)&&p5(t[i])&&(n=!0)}),n&&j(r,function(i){t.hasOwnProperty(i)&&p5(t[i])?e[i]=Se(t[i]):delete e[i]})}function Ape(e,t,r,n,i,a){var o={};j(e,function(h){var f=Ir.prepareVisualTypes(t[h]);o[h]=f});var s;function l(h){return ZA(r,s,h)}function u(h,f){p6(r,s,h,f)}r.each(c);function c(h,f){s=h;var d=r.getRawDataItem(s);if(!(d&&d.visualMap===!1))for(var g=n.call(i,h),m=t[g],y=o[g],_=0,x=y.length;_t[0][1]&&(t[0][1]=a[0]),a[1]t[1][1]&&(t[1][1]=a[1])}return t&&x5(t)}};function x5(e){return new Pe(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var jpe=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 zk(n.getZr())).on("brush",fe(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){_H(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:Se(i),$from:n}),r.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:n,areas:Se(i),$from:n})},t.type="brush",t}(Mt),Rpe=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&&yH(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=ae(r,function(n){return b5(this.option,n)},this))},t.prototype.setBrushOption=function(r){this.brushOption=b5(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}($e);function b5(e,t){return Ge({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new qe(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}var Ope=["rect","polygon","lineX","lineY","keep","clear"],zpe=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,j(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 j(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:Ope.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}(Ci);function Bpe(e){e.registerComponentView(jpe),e.registerComponentModel(Rpe),e.registerPreprocessor(Tpe),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,Npe),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"},qt),e.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},qt),Zc("brush",zpe)}var Fpe=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}($e),Vpe=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 tt({style:Ct(o,{text:r.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),h=c.getBoundingRect(),f=r.get("subtext"),d=new tt({style:Ct(s,{text:f,fill:s.getTextColor(),y:h.height+r.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),g=r.get("link"),m=r.get("sublink"),y=r.get("triggerEvent",!0);c.silent=!g&&!y,d.silent=!m&&!y,g&&c.on("click",function(){B0(g,"_"+r.get("target"))}),m&&d.on("click",function(){B0(m,"_"+r.get("subtarget"))}),De(c).eventData=De(d).eventData=y?{componentType:"title",componentIndex:r.componentIndex}:null,a.add(c),f&&a.add(d);var _=a.getBoundingRect(),x=r.getBoxLayoutParams();x.width=_.width,x.height=_.height;var w=Tr(r,i),S=It(x,w.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),_=a.getBoundingRect();var M=S.margin,A=r.getItemStyle(["color","opacity"]);A.fill=r.get("backgroundColor");var P=new Ze({shape:{x:_.x-M[3],y:_.y-M[0],width:_.width+M[1]+M[3],height:_.height+M[0]+M[2],r:r.get("borderRadius")},style:A,subPixelOptimize:!0,silent:!0});a.add(P)}},t.type="title",t}(Mt);function Gpe(e){e.registerComponentModel(Fpe),e.registerComponentView(Vpe)}var w5=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=[],j(n,function(u,c){var h=br(sf(u),""),f;ke(u)?(f=Se(u),f.value=c):f=c,o.push(f),a.push(h)})):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}($e),xH=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=fl(w5.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}(w5);Qt(xH,Mx.prototype);var Wpe=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}(Mt),Hpe=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}(Vi),oS=Math.PI,S5=Ye(),Upe=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 gr("nameValue",{noName:!0,value:c})},j(["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=$pe(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:oS/2},h=a==="vertical"?o.height:o.width,f=r.getModel("controlStyle"),d=f.get("show",!0),g=d?f.get("itemSize"):0,m=d?f.get("itemGap"):0,y=g+m,_=r.get(["label","rotate"])||0;_=_*oS/180;var x,w,S,T=f.get("position",!0),M=d&&f.get("showPlayBtn",!0),A=d&&f.get("showPrevBtn",!0),P=d&&f.get("showNextBtn",!0),I=0,N=h;T==="left"||T==="bottom"?(M&&(x=[0,0],I+=y),A&&(w=[I,0],I+=y),P&&(S=[N-g,0],N-=y)):(M&&(x=[N-g,0],N-=y),A&&(w=[0,0],I+=y),P&&(S=[N-g,0],N-=y));var D=[I,N];return r.get("inverse")&&D.reverse(),{viewRect:o,mainLength:h,orient:a,rotation:c[a],labelRotation:_,labelPosOpt:s,labelAlign:r.get(["label","align"])||l[a],labelBaseline:r.get(["label","verticalAlign"])||r.get(["label","baseline"])||u[a],playPosition:x,prevBtnPosition:w,nextBtnPosition:S,axisExtent:D,controlSize:g,controlGap:m}},t.prototype._position=function(r,n){var i=this._mainGroup,a=this._labelGroup,o=r.viewRect;if(r.orient==="vertical"){var s=Pr(),l=o.x,u=o.y+o.height;ha(s,s,[-l,-u]),Ko(s,s,-oS/2),ha(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var c=x(o),h=x(i.getBoundingRect()),f=x(a.getBoundingRect()),d=[i.x,i.y],g=[a.x,a.y];g[0]=d[0]=c[0][0];var m=r.labelPosOpt;if(m==null||he(m)){var y=m==="+"?0:1;w(d,h,c,1,y),w(g,f,c,1,1-y)}else{var y=m>=0?0:1;w(d,h,c,1,y),g[1]=d[1]+m}i.setPosition(d),a.setPosition(g),i.rotation=a.rotation=r.rotation,_(i),_(a);function _(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 w(S,T,M,A,P){S[A]+=M[A][P]-T[A][P]}},t.prototype._createAxis=function(r,n){var i=n.getData(),a=n.get("axisType"),o=Zpe(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 Hpe("value",o,r.axisExtent,a);return l.model=n,l},t.prototype._createGroup=function(r){var n=this[r]=new Ce;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 ar({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:Q({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});n.add(s);var l=this._progressLine=new ar({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:Ae({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=[],j(l,function(u){var c=i.dataToCoord(u.value),h=s.getItemModel(u.value),f=h.getModel("itemStyle"),d=h.getModel(["emphasis","itemStyle"]),g=h.getModel(["progress","itemStyle"]),m={x:c,y:0,onclick:fe(o._changeTimeline,o,u.value)},y=C5(h,f,n,m);y.ensureState("emphasis").style=d.getItemStyle(),y.ensureState("progress").style=g.getItemStyle(),Hs(y);var _=De(y);h.get("tooltip")?(_.dataIndex=u.value,_.dataModel=a):_.dataIndex=_.dataModel=null,o._tickSymbols.push(y)})},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=[],j(u,function(c){var h=c.tickValue,f=l.getItemModel(h),d=f.getModel("label"),g=f.getModel(["emphasis","label"]),m=f.getModel(["progress","label"]),y=i.dataToCoord(c.tickValue),_=new tt({x:y,y:0,rotation:r.labelRotation-r.rotation,onclick:fe(o._changeTimeline,o,h),silent:!1,style:Ct(d,{text:c.formattedLabel,align:r.labelAlign,verticalAlign:r.labelBaseline})});_.ensureState("emphasis").style=Ct(g),_.ensureState("progress").style=Ct(m),n.add(_),Hs(_),S5(_).dataIndex=h,o._tickLabels.push(_)})}},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(),h=a.get("inverse",!0);f(r.nextBtnPosition,"next",fe(this._changeTimeline,this,h?"-":"+")),f(r.prevBtnPosition,"prev",fe(this._changeTimeline,this,h?"+":"-")),f(r.playPosition,c?"stop":"play",fe(this._handlePlayClick,this,!c),!0);function f(d,g,m,y){if(d){var _=fa(be(a.get(["controlStyle",g+"BtnSize"]),o),o),x=[0,-_/2,_,_],w=Ype(a,g+"Icon",x,{x:d[0],y:d[1],originX:o/2,originY:0,rotation:y?-s:0,rectHover:!0,style:l,onclick:m});w.ensureState("emphasis").style=u,n.add(w),Hs(w)}}},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(h){h.draggable=!0,h.drift=fe(u._handlePointerDrag,u),h.ondragend=fe(u._handlePointerDragend,u),T5(h,u._progressLine,s,i,a,!0)},onUpdate:function(h){T5(h,u._progressLine,s,i,a)}};this._currentPointer=C5(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=Qn(a.getExtent().slice());i>o[1]&&(i=o[1]),i=0&&(s[o]=+s[o].toFixed(g)),[s,d]}var ay={min:Fe(iy,"min"),max:Fe(iy,"max"),average:Fe(iy,"average"),median:Fe(iy,"median")};function Cp(e,t){if(t){var r=e.getData(),n=e.coordinateSystem,i=n&&n.dimensions;if(!ege(t)&&!re(t.coord)&&re(i)){var a=bH(t,r,n,e);if(t=Se(t),t.type&&ay[t.type]&&a.baseAxis&&a.valueAxis){var o=Ve(i,a.baseAxis.dim),s=Ve(i,a.valueAxis.dim),l=ay[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||!re(i)){t.coord=[];var u=e.getBaseAxis();if(u&&t.type&&ay[t.type]){var c=n.getOtherAxis(u);c&&(t.value=x_(r,r.mapDimension(c.dim),t.type))}}else for(var h=t.coord,f=0;f<2;f++)ay[h[f]]&&(h[f]=x_(r,r.mapDimension(i[f]),h[f]));return t}}function bH(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(tge(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 tge(e,t){var r=e.getData().getDimensionInfo(t);return r&&r.coordDim}function Tp(e,t){return e&&e.containData&&t.coord&&!w2(t)?e.containData(t.coord):!0}function rge(e,t,r){return e&&e.containZone&&t.coord&&r.coord&&!w2(t)&&!w2(r)?e.containZone(t.coord,r.coord):!0}function wH(e,t){return e?function(r,n,i,a){var o=a<2?r.coord&&r.coord[a]:r.value;return $s(o,t[a])}:function(r,n,i,a){return $s(r.value,t[a])}}function x_(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 sS=Ye(),mL=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=xe()},t.prototype.render=function(r,n,i){var a=this,o=this.markerGroupMap;o.each(function(s){sS(s).keep=!1}),n.eachSeries(function(s){var l=Qa.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,n,i)}),o.each(function(s){!sS(s).keep&&a.group.remove(s.group)}),nge(n,o,this.type)},t.prototype.markKeep=function(r){sS(r).keep=!0},t.prototype.toggleBlurSeries=function(r,n){var i=this;j(r,function(a){var o=Qa.getMarkerModelFromSeries(a,i.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(n?OF(l):fA(l))})}})},t.type="marker",t}(Mt);function nge(e,t,r){e.eachSeries(function(n){var i=Qa.getMarkerModelFromSeries(n,r),a=t.get(n.id);if(i&&a&&a.group){var o=Fu(i),s=o.z,l=o.zlevel;bx(a.group,s,l)}})}function A5(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,h=u?o?o.height:0:a,f=u&&o?o.x:0,d=u&&o?o.y:0,g,m=ce(l.get("x"),c)+f,y=ce(l.get("y"),h)+d;if(!isNaN(m)&&!isNaN(y))g=[m,y];else if(t.getMarkerPosition)g=t.getMarkerPosition(e.getValues(e.dimensions,s));else if(n){var _=e.get(n.dimensions[0],s),x=e.get(n.dimensions[1],s);g=n.dataToPoint([_,x])}isNaN(m)||(g[0]=m),isNaN(y)||(g[1]=y),e.setItemLayout(s,g)})}var ige=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=Qa.getMarkerModelFromSeries(a,"markPoint");o&&(A5(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 Kp),h=age(o,r,n);n.setData(h),A5(n.getData(),r,a),h.each(function(f){var d=h.getItemModel(f),g=d.getShallow("symbol"),m=d.getShallow("symbolSize"),y=d.getShallow("symbolRotate"),_=d.getShallow("symbolOffset"),x=d.getShallow("symbolKeepAspect");if(we(g)||we(m)||we(y)||we(_)){var w=n.getRawValue(f),S=n.getDataParams(f);we(g)&&(g=g(w,S)),we(m)&&(m=m(w,S)),we(y)&&(y=y(w,S)),we(_)&&(_=_(w,S))}var T=d.getModel("itemStyle").getItemStyle(),M=d.get("z2"),A=Yp(l,"color");T.fill||(T.fill=A),h.setItemVisual(f,{z2:be(M,0),symbol:g,symbolSize:m,symbolRotate:y,symbolOffset:_,symbolKeepAspect:x,style:T})}),c.updateData(h),this.group.add(c.group),h.eachItemGraphicEl(function(f){f.traverse(function(d){De(d).dataModel=n})}),this.markKeep(c),c.group.silent=n.get("silent")||r.get("silent")},t.type="markPoint",t}(mL);function age(e,t,r){var n;e?n=ae(e&&e.dimensions,function(s){var l=t.getData().getDimensionInfo(t.getData().mapDimension(s))||{};return Q(Q({},l),{name:s,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new dn(n,r),a=ae(r.get("data"),Fe(Cp,t));e&&(a=ot(a,Fe(Tp,e)));var o=wH(!!e,n);return i.initData(a,null,o),i}function oge(e){e.registerComponentModel(Qpe),e.registerComponentView(ige),e.registerPreprocessor(function(t){gL(t.series,"markPoint")&&(t.markPoint=t.markPoint||{})})}var sge=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}(Qa),oy=Ye(),lge=function(e,t,r,n){var i=e.getData(),a;if(re(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=Fr(n.yAxis,n.xAxis);else{var u=bH(n,i,t,e);s=u.valueAxis;var c=ak(i,u.valueDataDim);l=x_(i,c,o)}var h=s.dim==="x"?0:1,f=1-h,d=Se(n),g={coord:[]};d.type=null,d.coord=[],d.coord[f]=-1/0,g.coord[f]=1/0;var m=r.get("precision");m>=0&&rt(l)&&(l=+l.toFixed(Math.min(m,20))),d.coord[h]=g.coord[h]=l,a=[d,g,{type:o,valueIndex:n.valueIndex,value:l}]}else a=[]}var y=[Cp(e,a[0]),Cp(e,a[1]),Q({},a[2])];return y[2].type=y[2].type||null,Ge(y[2],y[0]),Ge(y[2],y[1]),y};function b_(e){return!isNaN(e)&&!isFinite(e)}function k5(e,t,r,n){var i=1-e,a=n.dimensions[e];return b_(t[i])&&b_(r[i])&&t[e]===r[e]&&n.getAxis(a).containData(t[e])}function uge(e,t){if(e.type==="cartesian2d"){var r=t[0].coord,n=t[1].coord;if(r&&n&&(k5(1,r,n,e)||k5(0,r,n,e)))return!0}return Tp(e,t[0])&&Tp(e,t[1])}function lS(e,t,r,n,i){var a=n.coordinateSystem,o=e.getItemModel(t),s,l=ce(o.get("x"),i.getWidth()),u=ce(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,h=e.get(c[0],t),f=e.get(c[1],t);s=a.dataToPoint([h,f])}if(tl(a,"cartesian2d")){var d=a.getAxis("x"),g=a.getAxis("y"),c=a.dimensions;b_(e.get(c[0],t))?s[0]=d.toGlobalCoord(d.getExtent()[r?0:1]):b_(e.get(c[1],t))&&(s[1]=g.toGlobalCoord(g.getExtent()[r?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}e.setItemLayout(t,s)}var cge=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var o=Qa.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=oy(o).from,u=oy(o).to;l.each(function(c){lS(l,c,!0,a,i),lS(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 Rk);this.group.add(c.group);var h=hge(o,r,n),f=h.from,d=h.to,g=h.line;oy(n).from=f,oy(n).to=d,n.setData(g);var m=n.get("symbol"),y=n.get("symbolSize"),_=n.get("symbolRotate"),x=n.get("symbolOffset");re(m)||(m=[m,m]),re(y)||(y=[y,y]),re(_)||(_=[_,_]),re(x)||(x=[x,x]),h.from.each(function(S){w(f,S,!0),w(d,S,!1)}),g.each(function(S){var T=g.getItemModel(S),M=T.getModel("lineStyle").getLineStyle();g.setItemLayout(S,[f.getItemLayout(S),d.getItemLayout(S)]);var A=T.get("z2");M.stroke==null&&(M.stroke=f.getItemVisual(S,"style").fill),g.setItemVisual(S,{z2:be(A,0),fromSymbolKeepAspect:f.getItemVisual(S,"symbolKeepAspect"),fromSymbolOffset:f.getItemVisual(S,"symbolOffset"),fromSymbolRotate:f.getItemVisual(S,"symbolRotate"),fromSymbolSize:f.getItemVisual(S,"symbolSize"),fromSymbol:f.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:M})}),c.updateData(g),h.line.eachItemGraphicEl(function(S){De(S).dataModel=n,S.traverse(function(T){De(T).dataModel=n})});function w(S,T,M){var A=S.getItemModel(T);lS(S,T,M,r,a);var P=A.getModel("itemStyle").getItemStyle();P.fill==null&&(P.fill=Yp(l,"color")),S.setItemVisual(T,{symbolKeepAspect:A.get("symbolKeepAspect"),symbolOffset:be(A.get("symbolOffset",!0),x[M?0:1]),symbolRotate:be(A.get("symbolRotate",!0),_[M?0:1]),symbolSize:be(A.get("symbolSize"),y[M?0:1]),symbol:be(A.get("symbol",!0),m[M?0:1]),style:P})}this.markKeep(c),c.group.silent=n.get("silent")||r.get("silent")},t.type="markLine",t}(mL);function hge(e,t,r){var n;e?n=ae(e&&e.dimensions,function(u){var c=t.getData().getDimensionInfo(t.getData().mapDimension(u))||{};return Q(Q({},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=ae(r.get("data"),Fe(lge,t,e,r));e&&(s=ot(s,Fe(uge,e)));var l=wH(!!e,n);return i.initData(ae(s,function(u){return u[0]}),null,l),a.initData(ae(s,function(u){return u[1]}),null,l),o.initData(ae(s,function(u){return u[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}function fge(e){e.registerComponentModel(sge),e.registerComponentView(cge),e.registerPreprocessor(function(t){gL(t.series,"markLine")&&(t.markLine=t.markLine||{})})}var dge=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}(Qa),sy=Ye(),vge=function(e,t,r,n){var i=n[0],a=n[1];if(!(!i||!a)){var o=Cp(e,i),s=Cp(e,a),l=o.coord,u=s.coord;l[0]=Fr(l[0],-1/0),l[1]=Fr(l[1],-1/0),u[0]=Fr(u[0],1/0),u[1]=Fr(u[1],1/0);var c=ix([{},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 w_(e){return!isNaN(e)&&!isFinite(e)}function L5(e,t,r,n){var i=1-e;return w_(t[i])&&w_(r[i])}function pge(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 tl(e,"cartesian2d")?r&&n&&(L5(1,r,n)||L5(0,r,n))?!0:rge(e,i,a):Tp(e,i)||Tp(e,a)}function N5(e,t,r,n,i){var a=n.coordinateSystem,o=e.getItemModel(t),s,l=ce(o.get(r[0]),i.getWidth()),u=ce(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),h=e.getValues(["x1","y1"],t),f=a.clampData(c),d=a.clampData(h),g=[];r[0]==="x0"?g[0]=f[0]>d[0]?h[0]:c[0]:g[0]=f[0]>d[0]?c[0]:h[0],r[1]==="y0"?g[1]=f[1]>d[1]?h[1]:c[1]:g[1]=f[1]>d[1]?c[1]:h[1],s=n.getMarkerPosition(g,r,!0)}else{var m=e.get(r[0],t),y=e.get(r[1],t),_=[m,y];a.clampData&&a.clampData(_,_),s=a.dataToPoint(_,!0)}if(tl(a,"cartesian2d")){var x=a.getAxis("x"),w=a.getAxis("y"),m=e.get(r[0],t),y=e.get(r[1],t);w_(m)?s[0]=x.toGlobalCoord(x.getExtent()[r[0]==="x0"?0:1]):w_(y)&&(s[1]=w.toGlobalCoord(w.getExtent()[r[1]==="y0"?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}return s}var P5=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],gge=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=Qa.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=ae(P5,function(h){return N5(s,l,h,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 Ce});this.group.add(c.group),this.markKeep(c);var h=mge(o,r,n);n.setData(h),h.each(function(f){var d=ae(P5,function(N){return N5(h,f,N,r,a)}),g=o.getAxis("x").scale,m=o.getAxis("y").scale,y=g.getExtent(),_=m.getExtent(),x=[g.parse(h.get("x0",f)),g.parse(h.get("x1",f))],w=[m.parse(h.get("y0",f)),m.parse(h.get("y1",f))];Qn(x),Qn(w);var S=!(y[0]>x[1]||y[1]w[1]||_[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}($e),zc=Fe,C2=j,ly=Ce,SH=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 ly),this.group.add(this._selectorGroup=new ly),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=Tr(r,i).refContainer,h=r.getBoxLayoutParams(),f=r.get("padding"),d=It(h,c,f),g=this.layoutInner(r,o,d,a,l,u),m=It(Ae({width:g.width,height:g.height},h),c,f);this.group.x=m.x-g.x,this.group.y=m.y-g.y,this.group.markRedraw(),this.group.add(this._backgroundEl=hH(g,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=xe(),h=n.get("selectedMode"),f=n.get("triggerEvent"),d=[];i.eachRawSeries(function(g){!g.get("legendHoverLink")&&d.push(g.id)}),C2(n.getData(),function(g,m){var y=this,_=g.get("name");if(!this.newlineDisabled&&(_===""||_===` -`)){var x=new ly;x.newline=!0,u.add(x);return}var w=i.getSeriesByName(_)[0];if(!c.get(_))if(w){var S=w.getData(),T=S.getVisual("legendLineStyle")||{},M=S.getVisual("legendIcon"),A=S.getVisual("style"),P=this._createItem(w,_,m,g,n,r,T,A,M,h,a);P.on("click",zc(I5,_,null,a,d)).on("mouseover",zc(T2,w.name,null,a,d)).on("mouseout",zc(M2,w.name,null,a,d)),i.ssr&&P.eachChild(function(I){var N=De(I);N.seriesIndex=w.seriesIndex,N.dataIndex=m,N.ssrType="legend"}),f&&P.eachChild(function(I){y.packEventData(I,n,w,m,_)}),c.set(_,!0)}else i.eachRawSeries(function(I){var N=this;if(!c.get(_)&&I.legendVisualProvider){var D=I.legendVisualProvider;if(!D.containName(_))return;var O=D.indexOfName(_),R=D.getItemVisual(O,"style"),F=D.getItemVisual(O,"legendIcon"),H=fn(R.fill);H&&H[3]===0&&(H[3]=.2,R=Q(Q({},R),{fill:Li(H,"rgba")}));var W=this._createItem(I,_,m,g,n,r,{},R,F,h,a);W.on("click",zc(I5,null,_,a,d)).on("mouseover",zc(T2,null,_,a,d)).on("mouseout",zc(M2,null,_,a,d)),i.ssr&&W.eachChild(function(V){var z=De(V);z.seriesIndex=I.seriesIndex,z.dataIndex=m,z.ssrType="legend"}),f&&W.eachChild(function(V){N.packEventData(V,n,I,m,_)}),c.set(_,!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();C2(r,function(u){var c=u.type,h=new tt({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:c==="all"?"legendAllSelect":"legendInverseSelect",legendId:n.id})}});s.add(h);var f=n.getModel("selectorLabel"),d=n.getModel(["emphasis","selectorLabel"]);Dr(h,{normal:f,emphasis:d},{defaultText:u.title}),Hs(h)})},t.prototype._createItem=function(r,n,i,a,o,s,l,u,c,h,f){var d=r.visualDrawType,g=o.get("itemWidth"),m=o.get("itemHeight"),y=o.isSelected(n),_=a.get("symbolRotate"),x=a.get("symbolKeepAspect"),w=a.get("icon");c=w||c||"roundRect";var S=xge(c,a,l,u,d,y,f),T=new ly,M=a.getModel("textStyle");if(we(r.getLegendIcon)&&(!w||w==="inherit"))T.add(r.getLegendIcon({itemWidth:g,itemHeight:m,icon:c,iconRotate:_,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:x}));else{var A=w==="inherit"&&r.getData().getVisual("symbol")?_==="inherit"?r.getData().getVisual("symbolRotate"):_:0;T.add(bge({itemWidth:g,itemHeight:m,icon:c,iconRotate:A,itemStyle:S.itemStyle,symbolKeepAspect:x}))}var P=s==="left"?g+5:-5,I=s,N=o.get("formatter"),D=n;he(N)&&N?D=N.replace("{name}",n??""):we(N)&&(D=N(n));var O=y?M.getTextColor():a.get("inactiveColor");T.add(new tt({style:Ct(M,{text:D,x:P,y:m/2,fill:O,align:I,verticalAlign:"middle"},{inheritColor:O})}));var R=new Ze({shape:T.getBoundingRect(),style:{fill:"transparent"}}),F=a.getModel("tooltip");return F.get("show")&&Qo({el:R,componentModel:o,itemName:n,itemTooltipOption:F.option}),T.add(R),T.eachChild(function(H){H.silent=!0}),R.silent=!h,this.getContentGroup().add(T),Hs(T),T.__legendDataIndex=i,T},t.prototype.layoutInner=function(r,n,i,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();wu(r.get("orient"),l,r.get("itemGap"),i.width,i.height);var c=l.getBoundingRect(),h=[-c.x,-c.y];if(u.markRedraw(),l.markRedraw(),o){wu("horizontal",u,r.get("selectorItemGap",!0));var f=u.getBoundingRect(),d=[-f.x,-f.y],g=r.get("selectorButtonGap",!0),m=r.getOrient().index,y=m===0?"width":"height",_=m===0?"height":"width",x=m===0?"y":"x";s==="end"?d[m]+=c[y]+g:h[m]+=f[y]+g,d[1-m]+=c[_]/2-f[_]/2,u.x=d[0],u.y=d[1],l.x=h[0],l.y=h[1];var w={x:0,y:0};return w[y]=c[y]+g+f[y],w[_]=Math.max(c[_],f[_]),w[x]=Math.min(0,f[x]+d[1-m]),w}else return l.x=h[0],l.y=h[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(Mt);function xge(e,t,r,n,i,a,o){function s(y,_){y.lineWidth==="auto"&&(y.lineWidth=_.lineWidth>0?2:0),C2(y,function(x,w){y[w]==="inherit"&&(y[w]=_[w])})}var l=t.getModel("itemStyle"),u=l.getItemStyle(),c=e.lastIndexOf("empty",0)===0?"fill":"stroke",h=l.getShallow("decal");u.decal=!h||h==="inherit"?n.decal:Gh(h,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 f=t.getModel("lineStyle"),d=f.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 g=t.get("inactiveBorderWidth"),m=u[c];u.lineWidth=g==="auto"?n.lineWidth>0&&m?2:0:u.lineWidth,u.fill=t.get("inactiveColor"),u.stroke=t.get("inactiveBorderColor"),d.stroke=f.get("inactiveColor"),d.lineWidth=f.get("inactiveWidth")}return{itemStyle:u,lineStyle:d}}function bge(e){var t=e.icon||"roundRect",r=sr(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 I5(e,t,r,n){M2(e,t,r,n),r.dispatchAction({type:"legendToggleSelect",name:e??t}),T2(e,t,r,n)}function CH(e){for(var t=e.getZr().storage.getDisplayList(),r,n=0,i=t.length;ni[o],y=[-d.x,-d.y];n||(y[a]=c[u]);var _=[0,0],x=[-g.x,-g.y],w=be(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(m){var S=r.get("pageButtonPosition",!0);S==="end"?x[a]+=i[o]-g[o]:_[a]+=g[o]+w}x[1-a]+=d[s]/2-g[s]/2,c.setPosition(y),h.setPosition(_),f.setPosition(x);var T={x:0,y:0};if(T[o]=m?i[o]:d[o],T[s]=Math.max(d[s],g[s]),T[l]=Math.min(0,g[l]+x[1-a]),h.__rectSize=i[o],m){var M={x:0,y:0};M[o]=Math.max(i[o]-g[o]-w,0),M[s]=T[s],h.setClipPath(new Ze({shape:M})),h.__rectSize=M[o]}else f.eachChild(function(P){P.attr({invisible:!0,silent:!0})});var A=this._getPageInfo(r);return A.pageIndex!=null&&it(c,{x:A.contentPosition[0],y:A.contentPosition[1]},m?r:null),this._updatePageInfoView(r,A),T},t.prototype._pageGo=function(r,n,i){var a=this._getPageInfo(n)[r];a!=null&&i.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:n.id})},t.prototype._updatePageInfoView=function(r,n){var i=this._controllerGroup;j(["pagePrev","pageNext"],function(c){var h=c+"DataIndex",f=n[h]!=null,d=i.childOfName(c);d&&(d.setStyle("fill",f?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),d.cursor=f?"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",he(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=uS[o],l=cS[o],u=this._findTargetItemIndex(n),c=i.children(),h=c[u],f=c.length,d=f?1:0,g={contentPosition:[i.x,i.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!h)return g;var m=S(h);g.contentPosition[o]=-m.s;for(var y=u+1,_=m,x=m,w=null;y<=f;++y)w=S(c[y]),(!w&&x.e>_.s+a||w&&!T(w,_.s))&&(x.i>_.i?_=x:_=w,_&&(g.pageNextDataIndex==null&&(g.pageNextDataIndex=_.i),++g.pageCount)),x=w;for(var y=u-1,_=m,x=m,w=null;y>=-1;--y)w=S(c[y]),(!w||!T(x,w.s))&&_.i=A&&M.s<=A+a}},t.prototype._findTargetItemIndex=function(r){if(!this._showController)return 0;var n,i=this.getContentGroup(),a;return i.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===r&&(n=s)}),n??a},t.type="legend.scroll",t}(SH);function Mge(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 Age(e){He(TH),e.registerComponentModel(Cge),e.registerComponentView(Tge),Mge(e)}function kge(e){He(TH),He(Age)}var Lge=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=fl(Sp.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(Sp),yL=Ye();function Nge(e,t,r){yL(e).coordSysRecordMap.each(function(n){var i=n.dataZoomInfoMap.get(t.uid);i&&(i.getRange=r)})}function Pge(e,t){for(var r=yL(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 Rge(e){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,function(t,r){var n=yL(r),i=n.coordSysRecordMap||(n.coordSysRecordMap=xe());i.each(function(a){a.dataZoomInfoMap=null}),t.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=lH(a);j(o.infoList,function(s){var l=s.model.uid,u=i.get(l)||i.set(l,Ige(r,s.model)),c=u.dataZoomInfoMap||(u.dataZoomInfoMap=xe());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){MH(i,a);return}var c=jge(l,a,r);o.enable(c.controlType,c.opt),_f(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var Oge=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(),Nge(i,r,{pan:fe(hS.pan,this),zoom:fe(hS.zoom,this),scrollMove:fe(hS.scrollMove,this)})},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){Pge(this.api,this.dataZoomModel),this.range=null},t.type="dataZoom.inside",t}(cL),hS={zoom:function(e,t,r,n){var i=this.range,a=i.slice(),o=e.axisModels[0];if(o){var s=fS[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(rl(0,a,[0,100],0,c.minSpan,c.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:R5(function(e,t,r,n,i,a){var o=fS[n]([a.oldX,a.oldY],[a.newX,a.newY],t,i,r);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength}),scrollMove:R5(function(e,t,r,n,i,a){var o=fS[n]([0,0],[a.scrollDelta,a.scrollDelta],t,i,r);return o.signal*(e[1]-e[0])*a.scrollDelta})};function R5(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(rl(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var fS={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 AH(e){hL(e),e.registerComponentModel(Lge),e.registerComponentView(Oge),Rge(e)}var zge=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=fl(Sp.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}(Sp),jd=Ze,Bge=1,dS=30,Fge=7,Rd="horizontal",O5="vertical",Vge=5,Gge=["line","bar","candlestick","scatter"],Wge={easing:"cubicOut",duration:100,delay:0},Hge=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=fe(this._onBrush,this),this._onBrushEnd=fe(this._onBrushEnd,this)},t.prototype.render=function(r,n,i,a){if(e.prototype.render.apply(this,arguments),_f(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(){lp(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 Ce;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?Fge:0,o=Tr(r,n).refContainer,s=this._findCoordRect(),l=r.get("defaultLocationEdgeGap",!0)||0,u=this._orient===Rd?{right:o.width-s.x-s.width,top:o.height-dS-l-a,width:s.width,height:dS}:{right:l,top:s.y,width:dS,height:s.height},c=Ju(r.option);j(["right","top","width","height"],function(f){c[f]==="ph"&&(c[f]=u[f])});var h=It(c,o);this._location={x:h.x,y:h.y},this._size=[h.width,h.height],this._orient===O5&&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===Rd&&!o?{scaleY:l?1:-1,scaleX:1}:i===Rd&&o?{scaleY:l?1:-1,scaleX:-1}:i===O5&&!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 jd({silent:!0,shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:r.get("backgroundColor")},z2:-40}));var o=new jd({shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:"transparent"},z2:0,onclick:fe(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 h=o.getDataExtent(r.thisDim),f=o.getDataExtent(l),d=(f[1]-f[0])*.3;f=[f[0]-d,f[1]+d];var g=[0,n[1]],m=[0,n[0]],y=[[n[0],0],[0,0]],_=[],x=m[1]/Math.max(1,o.count()-1),w=n[0]/(h[1]-h[0]),S=r.thisAxis.type==="time",T=-x,M=Math.round(o.count()/n[0]),A;o.each([r.thisDim,l],function(O,R,F){if(M>0&&F%M){S||(T+=x);return}T=S?(+O-h[0])*w:T+x;var H=R==null||isNaN(R)||R==="",W=H?0:ht(R,f,g,!0);H&&!A&&F?(y.push([y[y.length-1][0],0]),_.push([_[_.length-1][0],0])):!H&&A&&(y.push([T,0]),_.push([T,0])),H||(y.push([T,W]),_.push([T,W])),A=H}),u=this._shadowPolygonPts=y,c=this._shadowPolylinePts=_}this._shadowData=o,this._shadowDim=l,this._shadowSize=[n[0],n[1]];var P=this.dataZoomModel;function I(O){var R=P.getModel(O?"selectedDataBackground":"dataBackground"),F=new Ce,H=new en({shape:{points:u},segmentIgnoreThreshold:1,style:R.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),W=new Gr({shape:{points:c},segmentIgnoreThreshold:1,style:R.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return F.add(H),F.add(W),F}for(var N=0;N<3;N++){var D=I(N===1);this._displayables.sliderGroup.add(D),this._displayables.dataShadowSegs.push(D)}},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();j(l,function(u){if(!i&&!(n!==!0&&Ve(Gge,u.get("type"))<0)){var c=a.getComponent(Ps(o),s).axis,h=Uge(o),f,d=u.coordinateSystem;h!=null&&d.getOtherAxis&&(f=d.getOtherAxis(c).inverse),h=u.getData().mapDimension(h);var g=u.getData().mapDimension(o);i={thisAxis:c,series:u,thisDim:g,otherDim:h,otherAxisInverse:f}}},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,h=l.get("brushSelect"),f=n.filler=new jd({silent:h,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(f),o.add(new jd({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:Bge,fill:K.color.transparent}})),j([0,1],function(w){var S=l.get("handleIcon");!G0[S]&&S.indexOf("path://")<0&&S.indexOf("image://")<0&&(S="path://"+S);var T=sr(S,-1,0,2,2,null,!0);T.attr({cursor:Zge(this._orient),draggable:!0,drift:fe(this._onDragMove,this,w),ondragend:fe(this._onDragEnd,this),onmouseover:fe(this._showDataInfo,this,!0),onmouseout:fe(this._showDataInfo,this,!1),z2:5});var M=T.getBoundingRect(),A=l.get("handleSize");this._handleHeight=ce(A,this._size[1]),this._handleWidth=M.width/M.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(),Hs(T);var P=l.get("handleColor");P!=null&&(T.style.fill=P),o.add(i[w]=T);var I=l.getModel("textStyle"),N=l.get("handleLabel")||{},D=N.show||!1;r.add(a[w]=new tt({silent:!0,invisible:!D,style:Ct(I,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:I.getTextColor(),font:I.getFont()}),z2:10}))},this);var d=f;if(h){var g=ce(l.get("moveHandleSize"),s[1]),m=n.moveHandle=new Ze({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:g}}),y=g*.8,_=n.moveHandleIcon=sr(l.get("moveHandleIcon"),-y/2,-y/2,y,y,K.color.neutral00,!0);_.silent=!0,_.y=s[1]+g/2-.5,m.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var x=Math.min(s[1]/2,Math.max(g,10));d=n.moveZone=new Ze({invisible:!0,shape:{y:s[1]-x,height:g+x}}),d.on("mouseover",function(){u.enterEmphasis(m)}).on("mouseout",function(){u.leaveEmphasis(m)}),o.add(m),o.add(_),o.add(d)}d.attr({draggable:!0,cursor:"default",drift:fe(this._onDragMove,this,"all"),ondragstart:fe(this._showDataInfo,this,!0),ondragend:fe(this._onDragEnd,this),onmouseover:fe(this._showDataInfo,this,!0),onmouseout:fe(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var r=this._range=this.dataZoomModel.getPercentRange(),n=this._getViewExtent();this._handleEnds=[ht(r[0],[0,100],n,!0),ht(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];rl(n,a,o,i.get("zoomLock")?"all":r,s.minSpan!=null?ht(s.minSpan,l,o,!0):null,s.maxSpan!=null?ht(s.maxSpan,l,o,!0):null);var u=this._range,c=this._range=Qn([ht(a[0],o,l,!0),ht(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=Qn(i.slice()),o=this._size;j([0,1],function(d){var g=n.handles[d],m=this._handleHeight;g.attr({scaleX:m/2,scaleY:m/2,x:i[d]+(d?-1:1),y:o[1]/2-m/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 Ne(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();rl(0,l,o,0,u.minSpan!=null?ht(u.minSpan,s,o,!0):null,u.maxSpan!=null?ht(u.maxSpan,s,o,!0):null),this._range=Qn([ht(l[0],o,s,!0),ht(l[1],o,s,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(r){this._brushing&&(Wo(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 jd({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),h=this._size;u[0]=Math.max(Math.min(h[0],u[0]),0),o.setShape({x:c[0],y:0,width:u[0]-c[0],height:h[1]})},t.prototype._dispatchZoomAction=function(r){var n=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:r?Wge:null,start:n[0],end:n[1]})},t.prototype._findCoordRect=function(){var r,n=lH(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}(cL);function Uge(e){var t={x:"y",y:"x",radius:"angle",angle:"radius"};return t[e]}function Zge(e){return e==="vertical"?"ns-resize":"ew-resize"}function kH(e){e.registerComponentModel(zge),e.registerComponentView(Hge),hL(e)}function $ge(e){He(AH),He(kH)}var LH={get:function(e,t,r){var n=Se((Yge[e]||{})[t]);return r&&re(n)?n[n.length-1]:n}},Yge={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]}},z5=Ir.mapVisual,Xge=Ir.eachVisual,qge=re,B5=j,Kge=Qn,Jge=ht,S_=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&&yH(i,r,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(r){var n=this.stateList;r=fe(r,this),this.controllerVisuals=x2(this.option.controller,n,r),this.targetVisuals=x2(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=lf(this.ecModel,"series",{index:n,id:r},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return ae(i,function(a){return a.componentIndex})},t.prototype.eachTargetSeries=function(r,n){j(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||["<",">"],re(r)&&(r=r.slice(),u=!0);var c=n?r:u?[h(r[0]),h(r[1])]:h(r);if(he(l))return l.replace("{value}",u?c[0]:c).replace("{value2}",u?c[1]:c);if(we(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 h(f){return f===s[0]?"min":f===s[1]?"max":(+f).toFixed(Math.min(o,20))}},t.prototype.resetExtent=function(){var r=this.option,n=Kge([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={});Ge(a,i),Ge(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(h){qge(n.color)&&!h.inRange&&(h.inRange={color:n.color.slice().reverse()}),h.inRange=h.inRange||{color:r.get("gradientColor")}}function u(h,f,d){var g=h[f],m=h[d];g&&!m&&(m=h[d]={},B5(g,function(y,_){if(Ir.isValidType(_)){var x=LH.get(_,"inactive",s);x!=null&&(m[_]=x,_==="color"&&!m.hasOwnProperty("opacity")&&!m.hasOwnProperty("colorAlpha")&&(m.opacity=[0,0]))}}))}function c(h){var f=(h.inRange||{}).symbol||(h.outOfRange||{}).symbol,d=(h.inRange||{}).symbolSize||(h.outOfRange||{}).symbolSize,g=this.get("inactiveColor"),m=this.getItemSymbol(),y=m||"roundRect";B5(this.stateList,function(_){var x=this.itemSize,w=h[_];w||(w=h[_]={color:s?g:[g]}),w.symbol==null&&(w.symbol=f&&Se(f)||(s?y:[y])),w.symbolSize==null&&(w.symbolSize=d&&Se(d)||(s?x[0]:[x[0],x[0]])),w.symbol=z5(w.symbol,function(M){return M==="none"?y:M});var S=w.symbolSize;if(S!=null){var T=-1/0;Xge(S,function(M){M>T&&(T=M)}),w.symbolSize=z5(S,function(M){return Jge(M,[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}($e),F5=[20,140],Qge=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]=F5[0]),(r[1]==null||isNaN(r[1]))&&(r[1]=F5[1])},t.prototype._resetRange=function(){var r=this.getExtent(),n=this.option.range;!n||n.auto?(r.auto=1,this.option.range=r):re(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),j(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=Qn((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=V5(this,"outOfRange",this.getExtent()),i=V5(this,"inRange",this.option.range.slice()),a=[];function o(d,g){a.push({value:d,color:r(d,g)})}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 Ce(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);eme([0,1],function(h){var f=o[h];f.setStyle("fill",n.handlesColor[h]),f.y=r[h];var d=ka(r[h],[0,l[1]],u,!0),g=this.getControllerVisual(d,"symbolSize");f.scaleX=f.scaleY=g/l[0],f.x=l[0]-g/2;var m=sa(i.handleLabelPoints[h],Us(f,this.group));if(this._orient==="horizontal"){var y=c==="left"||c==="top"?(l[0]-g)/2:(l[0]-g)/-2;m[1]+=y}s[h].setStyle({x:m[0],y:m[1],text:a.formatValueText(this._dataInterval[h]),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,h=c.indicator;if(h){h.attr("invisible",!1);var f={convertOpacityToAlpha:!0},d=this.getControllerVisual(r,"color",f),g=this.getControllerVisual(r,"symbolSize"),m=ka(r,s,u,!0),y=l[0]-g/2,_={x:h.x,y:h.y};h.y=m,h.x=y;var x=sa(c.indicatorLabelPoint,Us(h,this.group)),w=c.indicatorLabel;w.attr("invisible",!1);var S=this._applyTransform("left",c.mainGroup),T=this._orient,M=T==="horizontal";w.setStyle({text:(i||"")+o.formatValueText(n),verticalAlign:M?S:"middle",align:M?"center":S});var A={x:y,y:m,style:{fill:d}},P={style:{x:x[0],y:x[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var I={duration:100,easing:"cubicInOut",additive:!0};h.x=_.x,h.y=_.y,h.animateTo(A,I),w.animateTo(P,I)}else h.attr(A),w.attr(P);this._firstShowIndicator=!1;var N=this._shapes.handleLabels;if(N)for(var D=0;Do[1]&&(h[1]=1/0),n&&(h[0]===-1/0?this._showIndicator(c,h[1],"< ",l):h[1]===1/0?this._showIndicator(c,h[0],"> ",l):this._showIndicator(c,c,"โ‰ˆ ",l));var f=this._hoverLinkDataIndices,d=[];(n||U5(i))&&(d=this._hoverLinkDataIndices=i.findTargetDataIndices(h));var g=Oq(f,d);this._dispatchHighDown("downplay",Wy(g[0],i)),this._dispatchHighDown("highlight",Wy(g[1],i))}},t.prototype._hoverLinkFromSeriesMouseOver=function(r){var n;if(vu(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 lme(e,t,r,n){for(var i=t.targetVisuals[n],a=Ir.prepareVisualTypes(i),o={color:Yp(e.getData(),"color")},s=0,l=a.length;s0:t.splitNumber>0)||t.calculable)?"continuous":"piecewise"}),e.registerAction(ame,ome),j(sme,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(ume))}function DH(e){e.registerComponentModel(Qge),e.registerComponentView(nme),IH(e)}var cme=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=[],hme[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=Se(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=ae(this._pieceList,function(l){return l=Se(l),s!=="inRange"&&(l.visual=null),l}))})},t.prototype.completeVisualOption=function(){var r=this.option,n={},i=Ir.listVisualTypes(),a=this.isCategory();j(r.pieces,function(s){j(i,function(l){s.hasOwnProperty(l)&&(n[l]=1)})}),j(n,function(s,l){var u=!1;j(this.stateList,function(c){u=u||o(r,c,l)||o(r.target,c,l)},this),!u&&j(this.stateList,function(c){(r[c]||(r[c]={}))[l]=LH.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,j(a,function(l,u){var c=this.getSelectedMapKey(l);o.hasOwnProperty(c)||(o[c]=!0)},this),i.selectedMode==="single"){var s=!1;j(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=Se(r)},t.prototype.getValueState=function(r){var n=Ir.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=Ir.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,h){var f=a.getRepresentValue({interval:c});h||(h=a.getValueState(f));var d=r(f,h);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 j(s,function(c){var h=c.interval;h&&(h[0]>u&&o([u,h[0]],"outOfRange"),o(h.slice()),u=h[1])},this),{stops:n,outerColors:i}},t.type="visualMap.piecewise",t.defaultOption=fl(S_.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}(S_),hme={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 X5(e,t){var r=e.inverse;(e.orient==="vertical"?!r:r)&&t.reverse()}var fme=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=Fr(n.get("showLabel",!0),!u),h=!n.get("selectedMode");u&&this._renderEndsText(r,u[0],s,c,o),j(l.viewPieceList,function(f){var d=f.piece,g=new Ce;g.onclick=fe(this._onItemClick,this,d),this._enableHoverLink(g,f.indexInModelPieceList);var m=n.getRepresentValue(d);if(this._createItemSymbol(g,m,[0,0,s[0],s[1]],h),c){var y=this.visualMapModel.getValueState(m),_=a.get("align")||o;g.add(new tt({style:Ct(a,{x:_==="right"?-i:s[0]+i,y:s[1]/2,text:d.text,verticalAlign:a.get("verticalAlign")||"middle",align:_,opacity:be(a.get("opacity"),y==="outOfRange"?.5:1)}),silent:h}))}r.add(g)},this),u&&this._renderEndsText(r,u[1],s,c,o),wu(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:Wy(s.findTargetDataIndices(n),s)})}},t.prototype._getItemAlign=function(){var r=this.visualMapModel,n=r.option;if(n.orient==="vertical")return PH(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 Ce,l=this.visualMapModel.textStyleModel;s.add(new tt({style:Ct(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=ae(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=sr(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=Se(i.selected),s=n.getSelectedMapKey(r);a==="single"||a===!0?(o[s]=!0,j(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}(NH);function EH(e){e.registerComponentModel(cme),e.registerComponentView(fme),IH(e)}function dme(e){He(DH),He(EH)}var vme=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:iV(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}(),pme=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 vme(this);if(this._target=null,this.ecModel.eachSeries(function(i){xR(i,null)}),this.shouldShow()){var n=this.getTarget();xR(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}($e),gme=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 nc),!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=Tr(r,i).refContainer,u=It(CV(r,!0),l),c=s.lineWidth||0,h=this._contentRect=Bu(u.clone(),c/2,!0,!0),f=new Ce;a.add(f),f.setClipPath(new Ze({shape:h.plain()}));var d=this._targetGroup=new Ce;f.add(d);var g=u.plain();g.r=o.getShallow("borderRadius",!0),a.add(this._bgRect=new Ze({style:s,shape:g,silent:!1,cursor:"grab"}));var m=r.getModel("windowStyle"),y=m.getShallow("borderRadius",!0);f.add(this._windowRect=new Ze({shape:{x:0,y:0,width:0,height:0,r:y},style:m.getItemStyle(),silent:!1,cursor:"grab"})),this._dealRenderContent(),this._dealUpdateWindow(),K5(r,this)},t.prototype.renderContent=function(r){this._bridgeRendered=r,this._isEnabled()&&(this._dealRenderContent(),this._dealUpdateWindow(),K5(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=It({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=ji([],r.targetTrans),i=aa([],this._coordSys.transform,n);this._transThisToTarget=ji([],i);var a=r.viewportRect;a?a=a.clone():a=new Pe(0,0,this._api.getWidth(),this._api.getHeight()),a.applyTransform(i);var o=this._windowRect,s=o.shape.r;o.setShape(Ae({r:s},a))}},t.prototype._resetRoamController=function(r){var n=this,i=this._api,a=this._roamController;if(a||(a=this._roamController=new rc(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",fe(this._onPan,this)).on("zoom",fe(this._onZoom,this))},t.prototype._onPan=function(r){var n=this._transThisToTarget;if(!(!this._isEnabled()||!n)){var i=Kt([],[r.oldX,r.oldY],n),a=Kt([],[r.oldX-r.dx,r.oldY-r.dy],n);this._api.dispatchAction(q5(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=Kt([],[r.originX,r.originY],n);this._api.dispatchAction(q5(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}(Mt);function q5(e,t){var r=e.mainType==="series"?e.subType+"Roam":e.mainType+"Roam",n={type:r};return n[e.mainType+"Id"]=e.id,Q(n,t),n}function K5(e,t){var r=Fu(e);bx(t.group,r.z,r.zlevel)}function mme(e){e.registerComponentModel(pme),e.registerComponentView(gme)}var yme={label:{enabled:!0},decal:{show:!1}},J5=Ye(),_me={};function xme(e,t){var r=e.getModel("aria");if(!r.get("enabled"))return;var n=Se(yme);Ge(n.label,e.getLocaleModel().get("aria"),!1),Ge(r.option,n,!1),i(),a();function i(){var u=r.getModel("decal"),c=u.get("show");if(c){var h=xe();e.eachSeries(function(f){if(!f.isColorBySeries()){var d=h.get(f.type);d||(d={},h.set(f.type,d)),J5(f).scope=d}}),e.eachRawSeries(function(f){if(e.isSeriesFiltered(f))return;if(we(f.enableAriaDecal)){f.enableAriaDecal();return}var d=f.getData();if(f.isColorBySeries()){var x=fT(f.ecModel,f.name,_me,e.getSeriesCount()),w=d.getVisual("decal");d.setVisual("decal",S(w,x))}else{var g=f.getRawData(),m={},y=J5(f).scope;d.each(function(T){var M=d.getRawIndex(T);m[M]=T});var _=g.count();g.each(function(T){var M=m[T],A=g.getName(T)||T+"",P=fT(f.ecModel,A,y,_),I=d.getItemVisual(M,"decal");d.setItemVisual(M,"decal",S(I,P))})}function S(T,M){var A=T?Q(Q({},M),T):M;return A.dirty=!0,A}})}}function a(){var u=t.getZr().dom;if(u){var c=e.getLocaleModel().get("aria"),h=r.getModel("label");if(h.option=Ae(h.option,c),!!h.get("enabled")){if(u.setAttribute("role","img"),h.get("description")){u.setAttribute("aria-label",h.get("description"));return}var f=e.getSeriesCount(),d=h.get(["data","maxCount"])||10,g=h.get(["series","maxCount"])||10,m=Math.min(f,g),y;if(!(f<1)){var _=s();if(_){var x=h.get(["general","withTitle"]);y=o(x,{title:_})}else y=h.get(["general","withoutTitle"]);var w=[],S=f>1?h.get(["series","multiple","prefix"]):h.get(["series","single","prefix"]);y+=o(S,{seriesCount:f}),e.eachSeries(function(P,I){if(I1?h.get(["series","multiple",O]):h.get(["series","single",O]),N=o(N,{seriesId:P.seriesIndex,seriesName:P.get("name"),seriesType:l(P.subType)});var R=P.getData();if(R.count()>d){var F=h.get(["data","partialData"]);N+=o(F,{displayCnt:d})}else N+=h.get(["data","allData"]);for(var H=h.get(["data","separator","middle"]),W=h.get(["data","separator","end"]),V=h.get(["data","excludeDimensionId"]),z=[],Z=0;Z":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},Sme=function(){function e(t){var r=this._condVal=he(t)?new RegExp(t):kB(t)?t:null;if(r==null){var n="";ft(n)}}return e.prototype.evaluate=function(t){var r=typeof t;return he(r)?this._condVal.test(t):rt(r)?this._condVal.test(t+""):!1},e}(),Cme=function(){function e(){}return e.prototype.evaluate=function(){return this.value},e}(),Tme=function(){function e(){}return e.prototype.evaluate=function(){for(var t=this.children,r=0;r2&&n.push(i),i=[R,F]}function c(R,F,H,W){hh(R,H)&&hh(F,W)||i.push(R,F,H,W,H,W)}function h(R,F,H,W,V,z){var Z=Math.abs(F-R),U=Math.tan(Z/4)*4/3,$=FP:D2&&n.push(i),n}function k2(e,t,r,n,i,a,o,s,l,u){if(hh(e,r)&&hh(t,n)&&hh(i,o)&&hh(a,s)){l.push(o,s);return}var c=2/u,h=c*c,f=o-e,d=s-t,g=Math.sqrt(f*f+d*d);f/=g,d/=g;var m=r-e,y=n-t,_=i-o,x=a-s,w=m*m+y*y,S=_*_+x*x;if(w=0&&P=0){l.push(o,s);return}var I=[],N=[];Qs(e,r,i,o,.5,I),Qs(t,n,a,s,.5,N),k2(I[0],N[0],I[1],N[1],I[2],N[2],I[3],N[3],l,u),k2(I[4],N[4],I[5],N[5],I[6],N[6],I[7],N[7],l,u)}function Bme(e,t){var r=A2(e),n=[];t=t||1;for(var i=0;i0)for(var u=0;uMath.abs(u),h=RH([l,u],c?0:1,t),f=(c?s:u)/h.length,d=0;di,o=RH([n,i],a?0:1,t),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",c=a?"y":"x",h=e[s]/o.length,f=0;f1?null:new Ne(m*l+e,m*u+t)}function Gme(e,t,r){var n=new Ne;Ne.sub(n,r,t),n.normalize();var i=new Ne;Ne.sub(i,e,t);var a=i.dot(n);return a}function Fc(e,t){var r=e[e.length-1];r&&r[0]===t[0]&&r[1]===t[1]||e.push(t)}function Wme(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),Wme(t,u,c)}function C_(e,t,r,n){if(r===1)n.push(t);else{var i=Math.floor(r/2),a=e(t);C_(e,a[0],i,n),C_(e,a[1],r-i,n)}return n}function Hme(e,t){for(var r=[],n=0;n0;u/=2){var c=0,h=0;(e&u)>0&&(c=1),(t&u)>0&&(h=1),s+=u*u*(3*c^h),h===0&&(c===1&&(e=u-1-e,t=u-1-t),l=e,e=t,t=l)}return s}function A_(e){var t=1/0,r=1/0,n=-1/0,i=-1/0,a=ae(e,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),c=l.x+l.width/2+(u?u[4]:0),h=l.y+l.height/2+(u?u[5]:0);return t=Math.min(c,t),r=Math.min(h,r),n=Math.max(c,n),i=Math.max(h,i),[c,h]}),o=ae(a,function(s,l){return{cp:s,z:Qme(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 BH(e){return $me(e.path,e.count)}function L2(){return{fromIndividuals:[],toIndividuals:[],count:0}}function eye(e,t,r){var n=[];function i(T){for(var M=0;M=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 rye={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;s3(e)&&(u=e,c=t),s3(t)&&(u=t,c=e);function h(_,x,w,S,T){var M=_.many,A=_.one;if(M.length===1&&!T){var P=x?M[0]:A,I=x?A:M[0];if(T_(P))h({many:[P],one:I},!0,w,S,!0);else{var N=s?Ae({delay:s(w,S)},l):l;xL(P,I,N),a(P,I,P,I,N)}}else for(var D=Ae({dividePath:rye[r],individualDelay:s&&function(V,z,Z,U){return s(V+w,S)}},l),O=x?eye(M,A,D):tye(A,M,D),R=O.fromIndividuals,F=O.toIndividuals,H=R.length,W=0;Wt.length,d=u?l3(c,u):l3(f?t:e,[f?e:t]),g=0,m=0;mFH))for(var a=n.getIndices(),o=0;o0&&M.group.traverse(function(P){P instanceof Ke&&!P.animators.length&&P.animateFrom({style:{opacity:0}},A)})})}function d3(e){var t=e.getModel("universalTransition").get("seriesKey");return t||e.id}function v3(e){return re(e)?e.sort().join(","):e}function ys(e){if(e.hostModel)return e.hostModel.getModel("universalTransition").get("divideShape")}function uye(e,t){var r=xe(),n=xe(),i=xe();return j(e.oldSeries,function(a,o){var s=e.oldDataGroupIds[o],l=e.oldData[o],u=d3(a),c=v3(u);n.set(c,{dataGroupId:s,data:l}),re(u)&&j(u,function(h){i.set(h,{key:c,dataGroupId:s,data:l})})}),j(t.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var o=a.get("dataGroupId"),s=a.getData(),l=d3(a),u=v3(l),c=n.get(u);if(c)r.set(u,{oldSeries:[{dataGroupId:c.dataGroupId,divide:ys(c.data),data:c.data}],newSeries:[{dataGroupId:o,divide:ys(s),data:s}]});else if(re(l)){var h=[];j(l,function(g){var m=n.get(g);m.data&&h.push({dataGroupId:m.dataGroupId,divide:ys(m.data),data:m.data})}),h.length&&r.set(u,{oldSeries:h,newSeries:[{dataGroupId:o,data:s,divide:ys(s)}]})}else{var f=i.get(l);if(f){var d=r.get(f.key);d||(d={oldSeries:[{dataGroupId:f.dataGroupId,data:f.data,divide:ys(f.data)}],newSeries:[]},r.set(f.key,d)),d.newSeries.push({dataGroupId:o,data:s,divide:ys(s)})}}}}),r}function p3(e,t){for(var r=0;r=0&&i.push({dataGroupId:t.oldDataGroupIds[s],data:t.oldData[s],divide:ys(t.oldData[s]),groupIdDim:o.dimension})}),j(Tt(e.to),function(o){var s=p3(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:t.oldDataGroupIds[s],data:l,divide:ys(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&VH(i,a,n)}function hye(e){e.registerUpdateLifecycle("series:beforeupdate",function(t,r,n){j(Tt(n.seriesTransition),function(i){j(Tt(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=g3,n=m3,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 dye(){return new fye}var g3=0,m3=0;function vye(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()}};j(e.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(r+=l.val);var u=bL(s,t);if(u){var c=u.vmin!==s.vmin,h=u.vmax!==s.vmax,f=u.vmax-u.vmin;if(!(c&&h))if(c||h){var d=c?"S":"E";a[d][l.type].has=!0,a[d][l.type].span=f,a[d][l.type].inExtFrac=f/(s.vmax-s.vmin),a[d][l.type].val=l.val}else n[l.type].span+=f,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));j(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 pye(e,t,r,n,i,a){e!=="no"&&j(r,function(o){var s=bL(o,a);if(s)for(var l=t.length-1;l>=0;l--){var u=t[l],c=n(u),h=i*3/4;c>s.vmin-h&&ct[0]&&r=0&&o<1-1e-5}j(e,function(o){if(!(!o||o.start==null||o.end==null)&&!o.isExpanded){var s={breakOption:Se(o),vmin:t(o.start),vmax:t(o.end),gapParsed:{type:"tpAbs",val:0},gapReal:null};if(o.gap!=null){var l=!1;if(he(o.gap)){var u=Jn(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 h=t(o.gap);(!isFinite(h)||h<0)&&(h=0),s.gapParsed.type="tpAbs",s.gapParsed.val=h}}if(s.vmin===s.vmax&&(s.gapParsed.type="tpAbs",s.gapParsed.val=0),r&&r.noNegative&&j(["vmin","vmax"],function(d){s[d]<0&&(s[d]=0)}),s.vmin>s.vmax){var f=s.vmax;s.vmax=s.vmin,s.vmin=f}n.push(s)}}),n.sort(function(o,s){return o.vmin-s.vmin});var a=-1/0;return j(n,function(o,s){a>o.vmin&&(n[s]=null),a=o.vmax}),{breaks:n.filter(function(o){return!!o})}}function wL(e,t){return P2(t)===P2(e)}function P2(e){return e.start+"_\0_"+e.end}function mye(e,t,r){var n=[];j(e,function(a,o){var s=t(a);s&&s.type==="vmin"&&n.push([o])}),j(e,function(a,o){var s=t(a);if(s&&s.type==="vmax"){var l=ul(n,function(u){return wL(t(e[u[0]]).parsedBreak.breakOption,s.parsedBreak.breakOption)});l&&l.push(o)}});var i=[];return j(n,function(a){a.length===2&&i.push(r?a:[e[a[0]],e[a[1]]])}),i}function yye(e,t,r,n){var i,a;if(e.break){var o=e.break.parsedBreak,s=ul(r,function(h){return wL(h.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"?ir(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 _ye(e,t,r){var n={noNegative:!0},i=N2(e,r,n),a=N2(e,r,n),o=Math.log(t);return a.breaks=ae(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 xye={vmin:"start",vmax:"end"};function bye(e,t){return t&&(e=e||{},e.break={type:xye[t.type],start:t.parsedBreak.vmin,end:t.parsedBreak.vmax}),e}function wye(){HJ({createScaleBreakContext:dye,pruneTicksByBreak:pye,addBreaksToTicks:gye,parseAxisBreakOption:N2,identifyAxisBreak:wL,serializeAxisBreakIdentifier:P2,retrieveAxisBreakPairs:mye,getTicksLogTransformBreak:yye,logarithmicParseBreaksFromOption:_ye,makeAxisLabelFormatterParamBreak:bye})}var y3=Ye();function Sye(e,t){var r=ul(e,function(n){return vr().identifyAxisBreak(n.parsedBreak.breakOption,t.breakOption)});return r||e.push(r={zigzagRandomList:[],parsedBreak:t,shouldRemove:!1}),r}function Cye(e){j(e,function(t){return t.shouldRemove=!0})}function Tye(e){for(var t=e.length-1;t>=0;t--)e[t].shouldRemove&&e.splice(t,1)}function Mye(e,t,r,n,i){var a=r.axis;if(a.scale.isBlank()||!vr())return;var o=vr().retrieveAxisBreakPairs(a.scale.getTicks({breakTicks:"only_break"}),function(I){return I.break},!1);if(!o.length)return;var s=r.getModel("breakArea"),l=s.get("zigzagAmplitude"),u=s.get("zigzagMinSpan"),c=s.get("zigzagMaxSpan");u=Math.max(2,u||0),c=Math.max(u,c||0);var h=s.get("expandOnClick"),f=s.get("zigzagZ"),d=s.getModel("itemStyle"),g=d.getItemStyle(),m=g.stroke,y=g.lineWidth,_=g.lineDash,x=g.fill,w=new Ce({ignoreModelZ:!0}),S=a.isHorizontal(),T=y3(t).visualList||(y3(t).visualList=[]);Cye(T);for(var M=function(I){var N=o[I][0].break.parsedBreak,D=[];D[0]=a.toGlobalCoord(a.dataToCoord(N.vmin,!0)),D[1]=a.toGlobalCoord(a.dataToCoord(N.vmax,!0)),D[1]=z;le&&(te=z);var Ee=[],me=[];Ee[W]=D,me[W]=O,!se&&!le&&(Ee[W]+=Y?-l:l,me[W]-=Y?l:-l),Ee[V]=te,me[V]=te,U.push(Ee),$.push(me);var ye=void 0;if(iex[1]&&x.reverse(),{coordPair:x,brkId:vr().serializeAxisBreakIdentifier(_.breakOption)}});l.sort(function(y,_){return y.coordPair[0]-_.coordPair[0]});for(var u=o[0],c=null,h=0;h=0?l[0].width:l[1].width),f=(h+c.x)/2-u.x,d=Math.min(f,f-c.x),g=Math.max(f,f-c.x),m=g<0?g:d>0?d:0;s=(f-m)/c.x}var y=new Ne,_=new Ne;Ne.scale(y,n,-s),Ne.scale(_,n,1-s),IT(r[0],y),IT(r[1],_)}function Lye(e,t){var r={breaks:[]};return j(t.breaks,function(n){if(n){var i=ul(e.get("breaks",!0),function(s){return vr().identifyAxisBreak(s,n)});if(i){var a=t.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===Dx?!0:a===lW?!1:a===uW?!i.isExpanded:i.isExpanded,r.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}}),r}function Nye(){Tae({adjustBreakLabelPair:kye,buildAxisBreakLine:Aye,rectCoordBuildBreakAxis:Mye,updateModelAxisBreak:Lye})}function Pye(e){Pae(e),wye(),Nye()}function Iye(){Jae(Dye)}function Dye(e,t){j(e,function(r){if(!r.model.get(["axisLabel","inside"])){var n=Eye(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 Eye(e){var t=e.model,r=e.scale;if(!t.get(["axisLabel","show"])||r.isBlank())return;var n,i,a=r.getExtent();r instanceof Wh?i=r.count():(n=r.getTicks(),i=n.length);var o=e.getLabelModel(),s=wf(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 Kye(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function Jye(e){return e==="ROUTER"||e==="ROUTER_LATE"?30:e==="REPEATER"||e==="TRACKER"?25:e==="CLIENT_MUTE"?7:e==="CLIENT_BASE"?12:15}function Qye({nodes:e,edges:t,selectedNodeId:r,onSelectNode:n}){const i=G.useRef(null),[a,o]=G.useState("connected"),s=G.useMemo(()=>{const y=new Set;return t.forEach(_=>{y.add(_.from_node),y.add(_.to_node)}),y},[t]),l=G.useMemo(()=>{let y=e;return a==="connected"?y=y.filter(_=>s.has(_.node_num)):a==="infra"&&(y=y.filter(_=>b3.includes(_.role))),y},[e,a,s]),u=G.useMemo(()=>new Map(l.map(y=>[y.node_num,y])),[l]),c=G.useMemo(()=>t.filter(y=>u.has(y.from_node)&&u.has(y.to_node)),[t,u]),h=G.useMemo(()=>{const y=new Set;return r!==null&&c.forEach(_=>{_.from_node===r&&y.add(_.to_node),_.to_node===r&&y.add(_.from_node)}),y},[r,c]),f=G.useMemo(()=>{const y=l.map(x=>{const w=Kye(x.latitude),S=x3[w%x3.length],T=b3.includes(x.role),M=x.node_num===r,A=h.has(x.node_num),P=r===null||M||A;return{id:String(x.node_num),name:x.short_name,value:x.node_num,symbolSize:Jye(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}}),_=c.map(x=>{const w=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:qye(x.snr),width:w&&r!==null?2:1,opacity:r===null?.4:w?.6:.04}}});return{nodes:y,links:_}},[l,c,r,h]),d=G.useMemo(()=>({backgroundColor:"#111827",tooltip:{trigger:"item",backgroundColor:"#1e293b",borderColor:"#334155",textStyle:{color:"#e2e8f0",fontFamily:"JetBrains Mono, monospace",fontSize:11},formatter:y=>{if(y.data&&y.data.longName){const _=y.data;return`${_.name}
${_.longName}
Role: ${_.role}`}return""}},series:[{type:"graph",layout:"force",roam:!0,draggable:!0,animation:!1,data:f.nodes,links:f.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"]}]}),[f]),g=G.useCallback(y=>{if(y.data&&"nodeNum"in y.data){const _=y.data.nodeNum;n(r===_?null:_??null)}},[r,n]),m=G.useMemo(()=>({click:g}),[g]);return G.useEffect(()=>{var _;const y=(_=i.current)==null?void 0:_.getEchartsInstance();y&&y.setOption(d,{notMerge:!1,lazyUpdate:!0})},[d]),v.jsxs("div",{className:"relative bg-bg-card rounded-lg border border-border overflow-hidden",children:[v.jsx(Xye,{ref:i,option:d,style:{height:"540px",width:"100%"},onEvents:m,opts:{renderer:"canvas"}}),v.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:[v.jsx(RM,{size:14,className:"text-slate-500"}),v.jsx("div",{className:"flex gap-1",children:[{key:"connected",label:"Connected"},{key:"infra",label:"Infra"},{key:"all",label:"All"}].map(({key:y,label:_})=>v.jsx("button",{onClick:()=>o(y),className:`px-2 py-1 text-xs rounded transition-colors ${a===y?"bg-accent text-white":"bg-bg-hover text-slate-400 hover:text-slate-200"}`,children:_},y))}),v.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[l.length," nodes โ€ข ",c.length," edges"]})]}),v.jsxs("div",{className:"absolute bottom-4 left-4 bg-bg-card/90 backdrop-blur-sm border border-border rounded p-3",children:[v.jsx("div",{className:"text-xs text-slate-400 font-medium mb-2",children:"Edge Quality (SNR)"}),v.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(y=>v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-4 h-0.5",style:{backgroundColor:y.color}}),v.jsx("span",{className:"text-xs text-slate-500",children:y.label})]},y.label))})]}),v.jsxs("div",{className:"absolute bottom-4 right-4 bg-bg-card/90 backdrop-blur-sm border border-border rounded p-3",children:[v.jsx("div",{className:"text-xs text-slate-400 font-medium mb-2",children:"Node Type"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-3 h-3 rounded-full bg-blue-500"}),v.jsx("span",{className:"text-xs text-slate-500",children:"Infrastructure"})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-3 h-3 rounded-full bg-gray-900 border-2 border-blue-500"}),v.jsx("span",{className:"text-xs text-slate-500",children:"Client"})]})]})]})]})}function HH(e,t){const r=G.useRef(t);G.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 e0e(e,t,r){t.center!==r.center&&e.setLatLng(t.center),t.radius!=null&&t.radius!==r.radius&&e.setRadius(t.radius)}const t0e=1;function r0e(e){return Object.freeze({__version:t0e,map:e})}function UH(e,t){return Object.freeze({...e,...t})}const ZH=G.createContext(null),$H=ZH.Provider;function Ux(){const e=G.useContext(ZH);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of ");return e}function n0e(e){function t(r,n){const{instance:i,context:a}=e(r).current;return G.useImperativeHandle(n,()=>i),r.children==null?null:Ch.createElement($H,{value:a},r.children)}return G.forwardRef(t)}function i0e(e){function t(r,n){const[i,a]=G.useState(!1),{instance:o}=e(r,a).current;G.useImperativeHandle(n,()=>o),G.useEffect(function(){i&&o.update()},[o,i,r.children]);const s=o._contentNode;return s?Z4.createPortal(r.children,s):null}return G.forwardRef(t)}function a0e(e){function t(r,n){const{instance:i}=e(r).current;return G.useImperativeHandle(n,()=>i),null}return G.forwardRef(t)}function ML(e,t){const r=G.useRef();G.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 Zx(e,t){const r=e.pane??t.pane;return r?{...e,pane:r}:e}function o0e(e,t){return function(n,i){const a=Ux(),o=e(Zx(n,a),a);return HH(a.map,n.attribution),ML(o.current,n.eventHandlers),t(o.current,a,n,i),o}}var E2={exports:{}};/* @preserve +`:"
",x=h.join(y);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(r,u)?this._updatePosition(s,d,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,x,u,Math.random()+"",o[0],o[1],d,null,f)})},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,h=o.dataType,f=u.getData(h),d=this._renderMode,g=r.positionDefault,m=Id([f.getItemModel(c),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,g?{position:g}:null),y=m.get("trigger");if(!(y!=null&&y!=="item")){var x=u.getDataParams(c,h),_=new Bb;x.marker=_.makeTooltipMarker("item",Vu(x.color),d);var w=kD(u.formatTooltip(c,!1,h)),S=m.get("order"),T=m.get("valueFormatter"),M=w.frag,A=M?ED(T?Q({valueFormatter:T},M):M,_,d,S,a.get("useUTC"),m.get("textStyle")):w.text,P="item_"+u.name+"_"+c;this._showOrMove(m,function(){this._showTooltipContent(m,A,x,P,r.offsetX,r.offsetY,r.position,r.target,_)}),i({type:"showTip",dataIndexInside:c,dataIndex:f.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(he(l)){var c=l;l={content:c,formatter:c},u=!0}u&&a&&l.content&&(l=Se(l),l.content=hn(l.content));var h=[l],f=this._ecModel.getComponent(o.componentMainType,o.componentIndex);f&&h.push(f),h.push({formatter:l.content});var d=r.positionDefault,g=Id(h,this._tooltipModel,d?{position:d}:null),m=g.get("content"),y=Math.random()+"",x=new Bb;this._showOrMove(g,function(){var _=Se(g.get("formatterParams")||{});this._showTooltipContent(g,m,_,y,r.offsetX,r.offsetY,r.position,n,x)}),i({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(r,n,i,a,o,s,l,u,c){if(this._ticket="",!(!r.get("showContent")||!r.get("show"))){var h=this._tooltipContent;h.setEnterable(r.get("enterable"));var f=r.get("formatter");l=l||r.get("position");var d=n,g=this._getNearestPoint([o,s],i,r.get("trigger"),r.get("borderColor"),r.get("defaultBorderColor",!0)),m=g.color;if(f)if(he(f)){var y=r.ecModel.get("useUTC"),x=re(i)?i[0]:i,_=x&&x.axisType&&x.axisType.indexOf("time")>=0;d=f,_&&(d=Zp(x.axisValue,d,y)),d=RA(d,i,!0)}else if(we(f)){var w=fe(function(S,T){S===this._ticket&&(h.setContent(T,c,r,m,l),this._updatePosition(r,l,o,s,h,i,u))},this);this._ticket=a,d=f(i,a,w)}else d=f;h.setContent(d,c,r,m,l),h.show(r,m),this._updatePosition(r,l,o,s,h,i,u)}},t.prototype._getNearestPoint=function(r,n,i,a,o){if(i==="axis"||re(n))return{color:a||o};if(!re(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 h=o.getSize(),f=r.get("align"),d=r.get("verticalAlign"),g=l&&l.getBoundingRect().clone();if(l&&g.applyTransform(l.transform),we(n)&&(n=n([i,a],s,o.el,g,{viewSize:[u,c],contentSize:h.slice()})),re(n))i=ce(n[0],u),a=ce(n[1],c);else if(ke(n)){var m=n;m.width=h[0],m.height=h[1];var y=It(m,{width:u,height:c});i=y.x,a=y.y,f=null,d=null}else if(he(n)&&l){var x=bpe(n,g,h,r.get("borderWidth"));i=x[0],a=x[1]}else{var x=xpe(i,a,o,u,c,f?null:20,d?null:20);i=x[0],a=x[1]}if(f&&(i-=d5(f)?h[0]/2:f==="right"?h[0]:0),d&&(a-=d5(d)?h[1]/2:d==="bottom"?h[1]:0),vH(r)){var x=_pe(i,a,o,u,c);i=x[0],a=x[1]}o.moveTo(i,a)},t.prototype._updateContentNotChangedOnAxis=function(r,n){var i=this._lastDataByCoordSys,a=this._cbParamsList,o=!!i&&i.length===r.length;return o&&j(i,function(s,l){var u=s.dataByAxis||[],c=r[l]||{},h=c.dataByAxis||[];o=o&&u.length===h.length,o&&j(u,function(f,d){var g=h[d]||{},m=f.seriesDataIndices||[],y=g.seriesDataIndices||[];o=o&&f.value===g.value&&f.axisType===g.axisType&&f.axisId===g.axisId&&m.length===y.length,o&&j(m,function(x,_){var w=y[_];o=o&&x.seriesIndex===w.seriesIndex&&x.dataIndex===w.dataIndex}),a&&j(f.seriesDataIndices,function(x){var _=x.seriesIndex,w=n[_],S=a[_];w&&S&&S.data!==w.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){Je.node||!n.getDom()||(lp(this,"_updatePosition"),this._tooltipContent.dispose(),h2("itemTooltip",n))},t.type="tooltip",t}(Mt);function Id(e,t,r){var n=t.ecModel,i;r?(i=new qe(r,n,n),i=new qe(t.option,i,n)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof qe&&(o=o.get("tooltip",!0)),he(o)&&(o={formatter:o}),o&&(i=new qe(o,i,n)))}return i}function f5(e,t){return e.dispatchAction||fe(t.dispatchAction,t)}function xpe(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 _pe(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 bpe(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 d5(e){return e==="center"||e==="middle"}function wpe(e,t,r){var n=iA(e).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=lf(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 Spe(e){He(tg),e.registerComponentModel(ape),e.registerComponentView(ype),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},qt),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},qt)}var Cpe=["rect","polygon","keep","clear"];function Tpe(e,t){var r=Tt(e?e.brush:[]);if(r.length){var n=[];j(r,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(n=n.concat(u))});var i=e&&e.toolbox;re(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),Mpe(s),t&&!s.length&&s.push.apply(s,Cpe)}}function Mpe(e){var t={};j(e,function(r){t[r]=1}),e.length=0,j(t,function(r,n){e.push(n)})}var v5=j;function p5(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function _2(e,t,r){var n={};return v5(t,function(a){var o=n[a]=i();v5(e[a],function(s,l){if(Ir.isValidType(l)){var u={type:l,visual:s};r&&r(u,a),o[l]=new Ir(u),l==="opacity"&&(u=Se(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new Ir(u))}})}),n;function i(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function yH(e,t,r){var n;j(r,function(i){t.hasOwnProperty(i)&&p5(t[i])&&(n=!0)}),n&&j(r,function(i){t.hasOwnProperty(i)&&p5(t[i])?e[i]=Se(t[i]):delete e[i]})}function Ape(e,t,r,n,i,a){var o={};j(e,function(h){var f=Ir.prepareVisualTypes(t[h]);o[h]=f});var s;function l(h){return ZA(r,s,h)}function u(h,f){p6(r,s,h,f)}r.each(c);function c(h,f){s=h;var d=r.getRawDataItem(s);if(!(d&&d.visualMap===!1))for(var g=n.call(i,h),m=t[g],y=o[g],x=0,_=y.length;x<_;x++){var w=y[x];m[w]&&m[w].applyVisual(h,l,u)}}}function kpe(e,t,r,n){var i={};return j(e,function(a){var o=Ir.prepareVisualTypes(t[a]);i[a]=o}),{progress:function(o,s){var l;n!=null&&(l=s.getDimensionIndex(n));function u(T){return ZA(s,h,T)}function c(T,M){p6(s,h,T,M)}for(var h,f=s.getStore();(h=o.next())!=null;){var d=s.getRawDataItem(h);if(!(d&&d.visualMap===!1))for(var g=n!=null?f.get(l,h):h,m=r(g),y=t[m],x=i[m],_=0,w=x.length;_t[0][1]&&(t[0][1]=a[0]),a[1]t[1][1]&&(t[1][1]=a[1])}return t&&_5(t)}};function _5(e){return new Pe(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var jpe=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 zk(n.getZr())).on("brush",fe(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){xH(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:Se(i),$from:n}),r.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:n,areas:Se(i),$from:n})},t.type="brush",t}(Mt),Rpe=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&&yH(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=ae(r,function(n){return b5(this.option,n)},this))},t.prototype.setBrushOption=function(r){this.brushOption=b5(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}($e);function b5(e,t){return Ge({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new qe(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}var Ope=["rect","polygon","lineX","lineY","keep","clear"],zpe=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,j(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 j(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:Ope.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}(Ci);function Bpe(e){e.registerComponentView(jpe),e.registerComponentModel(Rpe),e.registerPreprocessor(Tpe),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,Npe),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"},qt),e.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},qt),Zc("brush",zpe)}var Fpe=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}($e),Vpe=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 tt({style:Ct(o,{text:r.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),h=c.getBoundingRect(),f=r.get("subtext"),d=new tt({style:Ct(s,{text:f,fill:s.getTextColor(),y:h.height+r.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),g=r.get("link"),m=r.get("sublink"),y=r.get("triggerEvent",!0);c.silent=!g&&!y,d.silent=!m&&!y,g&&c.on("click",function(){B0(g,"_"+r.get("target"))}),m&&d.on("click",function(){B0(m,"_"+r.get("subtarget"))}),De(c).eventData=De(d).eventData=y?{componentType:"title",componentIndex:r.componentIndex}:null,a.add(c),f&&a.add(d);var x=a.getBoundingRect(),_=r.getBoxLayoutParams();_.width=x.width,_.height=x.height;var w=Tr(r,i),S=It(_,w.refContainer,r.get("padding"));l||(l=r.get("left")||r.get("right"),l==="middle"&&(l="center"),l==="right"?S.x+=S.width:l==="center"&&(S.x+=S.width/2)),u||(u=r.get("top")||r.get("bottom"),u==="center"&&(u="middle"),u==="bottom"?S.y+=S.height:u==="middle"&&(S.y+=S.height/2),u=u||"top"),a.x=S.x,a.y=S.y,a.markRedraw();var T={align:l,verticalAlign:u};c.setStyle(T),d.setStyle(T),x=a.getBoundingRect();var M=S.margin,A=r.getItemStyle(["color","opacity"]);A.fill=r.get("backgroundColor");var P=new Ze({shape:{x:x.x-M[3],y:x.y-M[0],width:x.width+M[1]+M[3],height:x.height+M[0]+M[2],r:r.get("borderRadius")},style:A,subPixelOptimize:!0,silent:!0});a.add(P)}},t.type="title",t}(Mt);function Gpe(e){e.registerComponentModel(Fpe),e.registerComponentView(Vpe)}var w5=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=[],j(n,function(u,c){var h=br(sf(u),""),f;ke(u)?(f=Se(u),f.value=c):f=c,o.push(f),a.push(h)})):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}($e),_H=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=fl(w5.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}(w5);Qt(_H,M_.prototype);var Wpe=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}(Mt),Hpe=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}(Vi),oS=Math.PI,S5=Ye(),Upe=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 gr("nameValue",{noName:!0,value:c})},j(["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=$pe(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:oS/2},h=a==="vertical"?o.height:o.width,f=r.getModel("controlStyle"),d=f.get("show",!0),g=d?f.get("itemSize"):0,m=d?f.get("itemGap"):0,y=g+m,x=r.get(["label","rotate"])||0;x=x*oS/180;var _,w,S,T=f.get("position",!0),M=d&&f.get("showPlayBtn",!0),A=d&&f.get("showPrevBtn",!0),P=d&&f.get("showNextBtn",!0),I=0,N=h;T==="left"||T==="bottom"?(M&&(_=[0,0],I+=y),A&&(w=[I,0],I+=y),P&&(S=[N-g,0],N-=y)):(M&&(_=[N-g,0],N-=y),A&&(w=[0,0],I+=y),P&&(S=[N-g,0],N-=y));var D=[I,N];return r.get("inverse")&&D.reverse(),{viewRect:o,mainLength:h,orient:a,rotation:c[a],labelRotation:x,labelPosOpt:s,labelAlign:r.get(["label","align"])||l[a],labelBaseline:r.get(["label","verticalAlign"])||r.get(["label","baseline"])||u[a],playPosition:_,prevBtnPosition:w,nextBtnPosition:S,axisExtent:D,controlSize:g,controlGap:m}},t.prototype._position=function(r,n){var i=this._mainGroup,a=this._labelGroup,o=r.viewRect;if(r.orient==="vertical"){var s=Pr(),l=o.x,u=o.y+o.height;ha(s,s,[-l,-u]),Ko(s,s,-oS/2),ha(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var c=_(o),h=_(i.getBoundingRect()),f=_(a.getBoundingRect()),d=[i.x,i.y],g=[a.x,a.y];g[0]=d[0]=c[0][0];var m=r.labelPosOpt;if(m==null||he(m)){var y=m==="+"?0:1;w(d,h,c,1,y),w(g,f,c,1,1-y)}else{var y=m>=0?0:1;w(d,h,c,1,y),g[1]=d[1]+m}i.setPosition(d),a.setPosition(g),i.rotation=a.rotation=r.rotation,x(i),x(a);function x(S){S.originX=c[0][0]-S.x,S.originY=c[1][0]-S.y}function _(S){return[[S.x,S.x+S.width],[S.y,S.y+S.height]]}function w(S,T,M,A,P){S[A]+=M[A][P]-T[A][P]}},t.prototype._createAxis=function(r,n){var i=n.getData(),a=n.get("axisType"),o=Zpe(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 Hpe("value",o,r.axisExtent,a);return l.model=n,l},t.prototype._createGroup=function(r){var n=this[r]=new Ce;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 ar({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:Q({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});n.add(s);var l=this._progressLine=new ar({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:Ae({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=[],j(l,function(u){var c=i.dataToCoord(u.value),h=s.getItemModel(u.value),f=h.getModel("itemStyle"),d=h.getModel(["emphasis","itemStyle"]),g=h.getModel(["progress","itemStyle"]),m={x:c,y:0,onclick:fe(o._changeTimeline,o,u.value)},y=C5(h,f,n,m);y.ensureState("emphasis").style=d.getItemStyle(),y.ensureState("progress").style=g.getItemStyle(),Hs(y);var x=De(y);h.get("tooltip")?(x.dataIndex=u.value,x.dataModel=a):x.dataIndex=x.dataModel=null,o._tickSymbols.push(y)})},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=[],j(u,function(c){var h=c.tickValue,f=l.getItemModel(h),d=f.getModel("label"),g=f.getModel(["emphasis","label"]),m=f.getModel(["progress","label"]),y=i.dataToCoord(c.tickValue),x=new tt({x:y,y:0,rotation:r.labelRotation-r.rotation,onclick:fe(o._changeTimeline,o,h),silent:!1,style:Ct(d,{text:c.formattedLabel,align:r.labelAlign,verticalAlign:r.labelBaseline})});x.ensureState("emphasis").style=Ct(g),x.ensureState("progress").style=Ct(m),n.add(x),Hs(x),S5(x).dataIndex=h,o._tickLabels.push(x)})}},t.prototype._renderControl=function(r,n,i,a){var o=r.controlSize,s=r.rotation,l=a.getModel("controlStyle").getItemStyle(),u=a.getModel(["emphasis","controlStyle"]).getItemStyle(),c=a.getPlayState(),h=a.get("inverse",!0);f(r.nextBtnPosition,"next",fe(this._changeTimeline,this,h?"-":"+")),f(r.prevBtnPosition,"prev",fe(this._changeTimeline,this,h?"+":"-")),f(r.playPosition,c?"stop":"play",fe(this._handlePlayClick,this,!c),!0);function f(d,g,m,y){if(d){var x=fa(be(a.get(["controlStyle",g+"BtnSize"]),o),o),_=[0,-x/2,x,x],w=Ype(a,g+"Icon",_,{x:d[0],y:d[1],originX:o/2,originY:0,rotation:y?-s:0,rectHover:!0,style:l,onclick:m});w.ensureState("emphasis").style=u,n.add(w),Hs(w)}}},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(h){h.draggable=!0,h.drift=fe(u._handlePointerDrag,u),h.ondragend=fe(u._handlePointerDragend,u),T5(h,u._progressLine,s,i,a,!0)},onUpdate:function(h){T5(h,u._progressLine,s,i,a)}};this._currentPointer=C5(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=Qn(a.getExtent().slice());i>o[1]&&(i=o[1]),i=0&&(s[o]=+s[o].toFixed(g)),[s,d]}var ay={min:Fe(iy,"min"),max:Fe(iy,"max"),average:Fe(iy,"average"),median:Fe(iy,"median")};function Cp(e,t){if(t){var r=e.getData(),n=e.coordinateSystem,i=n&&n.dimensions;if(!ege(t)&&!re(t.coord)&&re(i)){var a=bH(t,r,n,e);if(t=Se(t),t.type&&ay[t.type]&&a.baseAxis&&a.valueAxis){var o=Ve(i,a.baseAxis.dim),s=Ve(i,a.valueAxis.dim),l=ay[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||!re(i)){t.coord=[];var u=e.getBaseAxis();if(u&&t.type&&ay[t.type]){var c=n.getOtherAxis(u);c&&(t.value=_x(r,r.mapDimension(c.dim),t.type))}}else for(var h=t.coord,f=0;f<2;f++)ay[h[f]]&&(h[f]=_x(r,r.mapDimension(i[f]),h[f]));return t}}function bH(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(tge(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 tge(e,t){var r=e.getData().getDimensionInfo(t);return r&&r.coordDim}function Tp(e,t){return e&&e.containData&&t.coord&&!w2(t)?e.containData(t.coord):!0}function rge(e,t,r){return e&&e.containZone&&t.coord&&r.coord&&!w2(t)&&!w2(r)?e.containZone(t.coord,r.coord):!0}function wH(e,t){return e?function(r,n,i,a){var o=a<2?r.coord&&r.coord[a]:r.value;return $s(o,t[a])}:function(r,n,i,a){return $s(r.value,t[a])}}function _x(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 sS=Ye(),mL=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){sS(s).keep=!1}),n.eachSeries(function(s){var l=Qa.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,n,i)}),o.each(function(s){!sS(s).keep&&a.group.remove(s.group)}),nge(n,o,this.type)},t.prototype.markKeep=function(r){sS(r).keep=!0},t.prototype.toggleBlurSeries=function(r,n){var i=this;j(r,function(a){var o=Qa.getMarkerModelFromSeries(a,i.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(n?OF(l):fA(l))})}})},t.type="marker",t}(Mt);function nge(e,t,r){e.eachSeries(function(n){var i=Qa.getMarkerModelFromSeries(n,r),a=t.get(n.id);if(i&&a&&a.group){var o=Fu(i),s=o.z,l=o.zlevel;w_(a.group,s,l)}})}function A5(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,h=u?o?o.height:0:a,f=u&&o?o.x:0,d=u&&o?o.y:0,g,m=ce(l.get("x"),c)+f,y=ce(l.get("y"),h)+d;if(!isNaN(m)&&!isNaN(y))g=[m,y];else if(t.getMarkerPosition)g=t.getMarkerPosition(e.getValues(e.dimensions,s));else if(n){var x=e.get(n.dimensions[0],s),_=e.get(n.dimensions[1],s);g=n.dataToPoint([x,_])}isNaN(m)||(g[0]=m),isNaN(y)||(g[1]=y),e.setItemLayout(s,g)})}var ige=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=Qa.getMarkerModelFromSeries(a,"markPoint");o&&(A5(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 Kp),h=age(o,r,n);n.setData(h),A5(n.getData(),r,a),h.each(function(f){var d=h.getItemModel(f),g=d.getShallow("symbol"),m=d.getShallow("symbolSize"),y=d.getShallow("symbolRotate"),x=d.getShallow("symbolOffset"),_=d.getShallow("symbolKeepAspect");if(we(g)||we(m)||we(y)||we(x)){var w=n.getRawValue(f),S=n.getDataParams(f);we(g)&&(g=g(w,S)),we(m)&&(m=m(w,S)),we(y)&&(y=y(w,S)),we(x)&&(x=x(w,S))}var T=d.getModel("itemStyle").getItemStyle(),M=d.get("z2"),A=Yp(l,"color");T.fill||(T.fill=A),h.setItemVisual(f,{z2:be(M,0),symbol:g,symbolSize:m,symbolRotate:y,symbolOffset:x,symbolKeepAspect:_,style:T})}),c.updateData(h),this.group.add(c.group),h.eachItemGraphicEl(function(f){f.traverse(function(d){De(d).dataModel=n})}),this.markKeep(c),c.group.silent=n.get("silent")||r.get("silent")},t.type="markPoint",t}(mL);function age(e,t,r){var n;e?n=ae(e&&e.dimensions,function(s){var l=t.getData().getDimensionInfo(t.getData().mapDimension(s))||{};return Q(Q({},l),{name:s,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new dn(n,r),a=ae(r.get("data"),Fe(Cp,t));e&&(a=ot(a,Fe(Tp,e)));var o=wH(!!e,n);return i.initData(a,null,o),i}function oge(e){e.registerComponentModel(Qpe),e.registerComponentView(ige),e.registerPreprocessor(function(t){gL(t.series,"markPoint")&&(t.markPoint=t.markPoint||{})})}var sge=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}(Qa),oy=Ye(),lge=function(e,t,r,n){var i=e.getData(),a;if(re(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=Fr(n.yAxis,n.xAxis);else{var u=bH(n,i,t,e);s=u.valueAxis;var c=ak(i,u.valueDataDim);l=_x(i,c,o)}var h=s.dim==="x"?0:1,f=1-h,d=Se(n),g={coord:[]};d.type=null,d.coord=[],d.coord[f]=-1/0,g.coord[f]=1/0;var m=r.get("precision");m>=0&&rt(l)&&(l=+l.toFixed(Math.min(m,20))),d.coord[h]=g.coord[h]=l,a=[d,g,{type:o,valueIndex:n.valueIndex,value:l}]}else a=[]}var y=[Cp(e,a[0]),Cp(e,a[1]),Q({},a[2])];return y[2].type=y[2].type||null,Ge(y[2],y[0]),Ge(y[2],y[1]),y};function bx(e){return!isNaN(e)&&!isFinite(e)}function k5(e,t,r,n){var i=1-e,a=n.dimensions[e];return bx(t[i])&&bx(r[i])&&t[e]===r[e]&&n.getAxis(a).containData(t[e])}function uge(e,t){if(e.type==="cartesian2d"){var r=t[0].coord,n=t[1].coord;if(r&&n&&(k5(1,r,n,e)||k5(0,r,n,e)))return!0}return Tp(e,t[0])&&Tp(e,t[1])}function lS(e,t,r,n,i){var a=n.coordinateSystem,o=e.getItemModel(t),s,l=ce(o.get("x"),i.getWidth()),u=ce(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,h=e.get(c[0],t),f=e.get(c[1],t);s=a.dataToPoint([h,f])}if(tl(a,"cartesian2d")){var d=a.getAxis("x"),g=a.getAxis("y"),c=a.dimensions;bx(e.get(c[0],t))?s[0]=d.toGlobalCoord(d.getExtent()[r?0:1]):bx(e.get(c[1],t))&&(s[1]=g.toGlobalCoord(g.getExtent()[r?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}e.setItemLayout(t,s)}var cge=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var o=Qa.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=oy(o).from,u=oy(o).to;l.each(function(c){lS(l,c,!0,a,i),lS(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 Rk);this.group.add(c.group);var h=hge(o,r,n),f=h.from,d=h.to,g=h.line;oy(n).from=f,oy(n).to=d,n.setData(g);var m=n.get("symbol"),y=n.get("symbolSize"),x=n.get("symbolRotate"),_=n.get("symbolOffset");re(m)||(m=[m,m]),re(y)||(y=[y,y]),re(x)||(x=[x,x]),re(_)||(_=[_,_]),h.from.each(function(S){w(f,S,!0),w(d,S,!1)}),g.each(function(S){var T=g.getItemModel(S),M=T.getModel("lineStyle").getLineStyle();g.setItemLayout(S,[f.getItemLayout(S),d.getItemLayout(S)]);var A=T.get("z2");M.stroke==null&&(M.stroke=f.getItemVisual(S,"style").fill),g.setItemVisual(S,{z2:be(A,0),fromSymbolKeepAspect:f.getItemVisual(S,"symbolKeepAspect"),fromSymbolOffset:f.getItemVisual(S,"symbolOffset"),fromSymbolRotate:f.getItemVisual(S,"symbolRotate"),fromSymbolSize:f.getItemVisual(S,"symbolSize"),fromSymbol:f.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:M})}),c.updateData(g),h.line.eachItemGraphicEl(function(S){De(S).dataModel=n,S.traverse(function(T){De(T).dataModel=n})});function w(S,T,M){var A=S.getItemModel(T);lS(S,T,M,r,a);var P=A.getModel("itemStyle").getItemStyle();P.fill==null&&(P.fill=Yp(l,"color")),S.setItemVisual(T,{symbolKeepAspect:A.get("symbolKeepAspect"),symbolOffset:be(A.get("symbolOffset",!0),_[M?0:1]),symbolRotate:be(A.get("symbolRotate",!0),x[M?0:1]),symbolSize:be(A.get("symbolSize"),y[M?0:1]),symbol:be(A.get("symbol",!0),m[M?0:1]),style:P})}this.markKeep(c),c.group.silent=n.get("silent")||r.get("silent")},t.type="markLine",t}(mL);function hge(e,t,r){var n;e?n=ae(e&&e.dimensions,function(u){var c=t.getData().getDimensionInfo(t.getData().mapDimension(u))||{};return Q(Q({},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=ae(r.get("data"),Fe(lge,t,e,r));e&&(s=ot(s,Fe(uge,e)));var l=wH(!!e,n);return i.initData(ae(s,function(u){return u[0]}),null,l),a.initData(ae(s,function(u){return u[1]}),null,l),o.initData(ae(s,function(u){return u[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}function fge(e){e.registerComponentModel(sge),e.registerComponentView(cge),e.registerPreprocessor(function(t){gL(t.series,"markLine")&&(t.markLine=t.markLine||{})})}var dge=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}(Qa),sy=Ye(),vge=function(e,t,r,n){var i=n[0],a=n[1];if(!(!i||!a)){var o=Cp(e,i),s=Cp(e,a),l=o.coord,u=s.coord;l[0]=Fr(l[0],-1/0),l[1]=Fr(l[1],-1/0),u[0]=Fr(u[0],1/0),u[1]=Fr(u[1],1/0);var c=a_([{},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 Sx(e){return!isNaN(e)&&!isFinite(e)}function L5(e,t,r,n){var i=1-e;return Sx(t[i])&&Sx(r[i])}function pge(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 tl(e,"cartesian2d")?r&&n&&(L5(1,r,n)||L5(0,r,n))?!0:rge(e,i,a):Tp(e,i)||Tp(e,a)}function N5(e,t,r,n,i){var a=n.coordinateSystem,o=e.getItemModel(t),s,l=ce(o.get(r[0]),i.getWidth()),u=ce(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),h=e.getValues(["x1","y1"],t),f=a.clampData(c),d=a.clampData(h),g=[];r[0]==="x0"?g[0]=f[0]>d[0]?h[0]:c[0]:g[0]=f[0]>d[0]?c[0]:h[0],r[1]==="y0"?g[1]=f[1]>d[1]?h[1]:c[1]:g[1]=f[1]>d[1]?c[1]:h[1],s=n.getMarkerPosition(g,r,!0)}else{var m=e.get(r[0],t),y=e.get(r[1],t),x=[m,y];a.clampData&&a.clampData(x,x),s=a.dataToPoint(x,!0)}if(tl(a,"cartesian2d")){var _=a.getAxis("x"),w=a.getAxis("y"),m=e.get(r[0],t),y=e.get(r[1],t);Sx(m)?s[0]=_.toGlobalCoord(_.getExtent()[r[0]==="x0"?0:1]):Sx(y)&&(s[1]=w.toGlobalCoord(w.getExtent()[r[1]==="y0"?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}return s}var P5=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],gge=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=Qa.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=ae(P5,function(h){return N5(s,l,h,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 Ce});this.group.add(c.group),this.markKeep(c);var h=mge(o,r,n);n.setData(h),h.each(function(f){var d=ae(P5,function(N){return N5(h,f,N,r,a)}),g=o.getAxis("x").scale,m=o.getAxis("y").scale,y=g.getExtent(),x=m.getExtent(),_=[g.parse(h.get("x0",f)),g.parse(h.get("x1",f))],w=[m.parse(h.get("y0",f)),m.parse(h.get("y1",f))];Qn(_),Qn(w);var S=!(y[0]>_[1]||y[1]<_[0]||x[0]>w[1]||x[1]=0},t.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},t.type="legend.plain",t.dependencies=["series"],t.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",bottom: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}($e),zc=Fe,C2=j,ly=Ce,SH=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 ly),this.group.add(this._selectorGroup=new ly),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=Tr(r,i).refContainer,h=r.getBoxLayoutParams(),f=r.get("padding"),d=It(h,c,f),g=this.layoutInner(r,o,d,a,l,u),m=It(Ae({width:g.width,height:g.height},h),c,f);this.group.x=m.x-g.x,this.group.y=m.y-g.y,this.group.markRedraw(),this.group.add(this._backgroundEl=hH(g,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(),h=n.get("selectedMode"),f=n.get("triggerEvent"),d=[];i.eachRawSeries(function(g){!g.get("legendHoverLink")&&d.push(g.id)}),C2(n.getData(),function(g,m){var y=this,x=g.get("name");if(!this.newlineDisabled&&(x===""||x===` +`)){var _=new ly;_.newline=!0,u.add(_);return}var w=i.getSeriesByName(x)[0];if(!c.get(x))if(w){var S=w.getData(),T=S.getVisual("legendLineStyle")||{},M=S.getVisual("legendIcon"),A=S.getVisual("style"),P=this._createItem(w,x,m,g,n,r,T,A,M,h,a);P.on("click",zc(I5,x,null,a,d)).on("mouseover",zc(T2,w.name,null,a,d)).on("mouseout",zc(M2,w.name,null,a,d)),i.ssr&&P.eachChild(function(I){var N=De(I);N.seriesIndex=w.seriesIndex,N.dataIndex=m,N.ssrType="legend"}),f&&P.eachChild(function(I){y.packEventData(I,n,w,m,x)}),c.set(x,!0)}else i.eachRawSeries(function(I){var N=this;if(!c.get(x)&&I.legendVisualProvider){var D=I.legendVisualProvider;if(!D.containName(x))return;var O=D.indexOfName(x),R=D.getItemVisual(O,"style"),F=D.getItemVisual(O,"legendIcon"),H=fn(R.fill);H&&H[3]===0&&(H[3]=.2,R=Q(Q({},R),{fill:Li(H,"rgba")}));var W=this._createItem(I,x,m,g,n,r,{},R,F,h,a);W.on("click",zc(I5,null,x,a,d)).on("mouseover",zc(T2,null,x,a,d)).on("mouseout",zc(M2,null,x,a,d)),i.ssr&&W.eachChild(function(V){var z=De(V);z.seriesIndex=I.seriesIndex,z.dataIndex=m,z.ssrType="legend"}),f&&W.eachChild(function(V){N.packEventData(V,n,I,m,x)}),c.set(x,!0)}},this)},this),o&&this._createSelector(o,n,a,s,l)},t.prototype.packEventData=function(r,n,i,a,o){var s={componentType:"legend",componentIndex:n.componentIndex,dataIndex:a,value:o,seriesIndex:i.seriesIndex};De(r).eventData=s},t.prototype._createSelector=function(r,n,i,a,o){var s=this.getSelectorGroup();C2(r,function(u){var c=u.type,h=new tt({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:c==="all"?"legendAllSelect":"legendInverseSelect",legendId:n.id})}});s.add(h);var f=n.getModel("selectorLabel"),d=n.getModel(["emphasis","selectorLabel"]);Dr(h,{normal:f,emphasis:d},{defaultText:u.title}),Hs(h)})},t.prototype._createItem=function(r,n,i,a,o,s,l,u,c,h,f){var d=r.visualDrawType,g=o.get("itemWidth"),m=o.get("itemHeight"),y=o.isSelected(n),x=a.get("symbolRotate"),_=a.get("symbolKeepAspect"),w=a.get("icon");c=w||c||"roundRect";var S=_ge(c,a,l,u,d,y,f),T=new ly,M=a.getModel("textStyle");if(we(r.getLegendIcon)&&(!w||w==="inherit"))T.add(r.getLegendIcon({itemWidth:g,itemHeight:m,icon:c,iconRotate:x,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:_}));else{var A=w==="inherit"&&r.getData().getVisual("symbol")?x==="inherit"?r.getData().getVisual("symbolRotate"):x:0;T.add(bge({itemWidth:g,itemHeight:m,icon:c,iconRotate:A,itemStyle:S.itemStyle,symbolKeepAspect:_}))}var P=s==="left"?g+5:-5,I=s,N=o.get("formatter"),D=n;he(N)&&N?D=N.replace("{name}",n??""):we(N)&&(D=N(n));var O=y?M.getTextColor():a.get("inactiveColor");T.add(new tt({style:Ct(M,{text:D,x:P,y:m/2,fill:O,align:I,verticalAlign:"middle"},{inheritColor:O})}));var R=new Ze({shape:T.getBoundingRect(),style:{fill:"transparent"}}),F=a.getModel("tooltip");return F.get("show")&&Qo({el:R,componentModel:o,itemName:n,itemTooltipOption:F.option}),T.add(R),T.eachChild(function(H){H.silent=!0}),R.silent=!h,this.getContentGroup().add(T),Hs(T),T.__legendDataIndex=i,T},t.prototype.layoutInner=function(r,n,i,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();wu(r.get("orient"),l,r.get("itemGap"),i.width,i.height);var c=l.getBoundingRect(),h=[-c.x,-c.y];if(u.markRedraw(),l.markRedraw(),o){wu("horizontal",u,r.get("selectorItemGap",!0));var f=u.getBoundingRect(),d=[-f.x,-f.y],g=r.get("selectorButtonGap",!0),m=r.getOrient().index,y=m===0?"width":"height",x=m===0?"height":"width",_=m===0?"y":"x";s==="end"?d[m]+=c[y]+g:h[m]+=f[y]+g,d[1-m]+=c[x]/2-f[x]/2,u.x=d[0],u.y=d[1],l.x=h[0],l.y=h[1];var w={x:0,y:0};return w[y]=c[y]+g+f[y],w[x]=Math.max(c[x],f[x]),w[_]=Math.min(0,f[_]+d[1-m]),w}else return l.x=h[0],l.y=h[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(Mt);function _ge(e,t,r,n,i,a,o){function s(y,x){y.lineWidth==="auto"&&(y.lineWidth=x.lineWidth>0?2:0),C2(y,function(_,w){y[w]==="inherit"&&(y[w]=x[w])})}var l=t.getModel("itemStyle"),u=l.getItemStyle(),c=e.lastIndexOf("empty",0)===0?"fill":"stroke",h=l.getShallow("decal");u.decal=!h||h==="inherit"?n.decal:Gh(h,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 f=t.getModel("lineStyle"),d=f.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 g=t.get("inactiveBorderWidth"),m=u[c];u.lineWidth=g==="auto"?n.lineWidth>0&&m?2:0:u.lineWidth,u.fill=t.get("inactiveColor"),u.stroke=t.get("inactiveBorderColor"),d.stroke=f.get("inactiveColor"),d.lineWidth=f.get("inactiveWidth")}return{itemStyle:u,lineStyle:d}}function bge(e){var t=e.icon||"roundRect",r=sr(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 I5(e,t,r,n){M2(e,t,r,n),r.dispatchAction({type:"legendToggleSelect",name:e??t}),T2(e,t,r,n)}function CH(e){for(var t=e.getZr().storage.getDisplayList(),r,n=0,i=t.length;ni[o],y=[-d.x,-d.y];n||(y[a]=c[u]);var x=[0,0],_=[-g.x,-g.y],w=be(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(m){var S=r.get("pageButtonPosition",!0);S==="end"?_[a]+=i[o]-g[o]:x[a]+=g[o]+w}_[1-a]+=d[s]/2-g[s]/2,c.setPosition(y),h.setPosition(x),f.setPosition(_);var T={x:0,y:0};if(T[o]=m?i[o]:d[o],T[s]=Math.max(d[s],g[s]),T[l]=Math.min(0,g[l]+_[1-a]),h.__rectSize=i[o],m){var M={x:0,y:0};M[o]=Math.max(i[o]-g[o]-w,0),M[s]=T[s],h.setClipPath(new Ze({shape:M})),h.__rectSize=M[o]}else f.eachChild(function(P){P.attr({invisible:!0,silent:!0})});var A=this._getPageInfo(r);return A.pageIndex!=null&&it(c,{x:A.contentPosition[0],y:A.contentPosition[1]},m?r:null),this._updatePageInfoView(r,A),T},t.prototype._pageGo=function(r,n,i){var a=this._getPageInfo(n)[r];a!=null&&i.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:n.id})},t.prototype._updatePageInfoView=function(r,n){var i=this._controllerGroup;j(["pagePrev","pageNext"],function(c){var h=c+"DataIndex",f=n[h]!=null,d=i.childOfName(c);d&&(d.setStyle("fill",f?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),d.cursor=f?"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",he(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=uS[o],l=cS[o],u=this._findTargetItemIndex(n),c=i.children(),h=c[u],f=c.length,d=f?1:0,g={contentPosition:[i.x,i.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!h)return g;var m=S(h);g.contentPosition[o]=-m.s;for(var y=u+1,x=m,_=m,w=null;y<=f;++y)w=S(c[y]),(!w&&_.e>x.s+a||w&&!T(w,x.s))&&(_.i>x.i?x=_:x=w,x&&(g.pageNextDataIndex==null&&(g.pageNextDataIndex=x.i),++g.pageCount)),_=w;for(var y=u-1,x=m,_=m,w=null;y>=-1;--y)w=S(c[y]),(!w||!T(_,w.s))&&x.i<_.i&&(_=x,g.pagePrevDataIndex==null&&(g.pagePrevDataIndex=x.i),++g.pageCount,++g.pageIndex),x=w;return g;function S(M){if(M){var A=M.getBoundingRect(),P=A[l]+M[l];return{s:P,e:P+A[s],i:M.__legendDataIndex}}}function T(M,A){return M.e>=A&&M.s<=A+a}},t.prototype._findTargetItemIndex=function(r){if(!this._showController)return 0;var n,i=this.getContentGroup(),a;return i.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===r&&(n=s)}),n??a},t.type="legend.scroll",t}(SH);function Mge(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 Age(e){He(TH),e.registerComponentModel(Cge),e.registerComponentView(Tge),Mge(e)}function kge(e){He(TH),He(Age)}var Lge=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=fl(Sp.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(Sp),yL=Ye();function Nge(e,t,r){yL(e).coordSysRecordMap.each(function(n){var i=n.dataZoomInfoMap.get(t.uid);i&&(i.getRange=r)})}function Pge(e,t){for(var r=yL(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 Rge(e){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,function(t,r){var n=yL(r),i=n.coordSysRecordMap||(n.coordSysRecordMap=_e());i.each(function(a){a.dataZoomInfoMap=null}),t.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=lH(a);j(o.infoList,function(s){var l=s.model.uid,u=i.get(l)||i.set(l,Ige(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){MH(i,a);return}var c=jge(l,a,r);o.enable(c.controlType,c.opt),xf(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var Oge=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(),Nge(i,r,{pan:fe(hS.pan,this),zoom:fe(hS.zoom,this),scrollMove:fe(hS.scrollMove,this)})},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){Pge(this.api,this.dataZoomModel),this.range=null},t.type="dataZoom.inside",t}(cL),hS={zoom:function(e,t,r,n){var i=this.range,a=i.slice(),o=e.axisModels[0];if(o){var s=fS[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(rl(0,a,[0,100],0,c.minSpan,c.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:R5(function(e,t,r,n,i,a){var o=fS[n]([a.oldX,a.oldY],[a.newX,a.newY],t,i,r);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength}),scrollMove:R5(function(e,t,r,n,i,a){var o=fS[n]([0,0],[a.scrollDelta,a.scrollDelta],t,i,r);return o.signal*(e[1]-e[0])*a.scrollDelta})};function R5(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(rl(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var fS={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 AH(e){hL(e),e.registerComponentModel(Lge),e.registerComponentView(Oge),Rge(e)}var zge=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=fl(Sp.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}(Sp),jd=Ze,Bge=1,dS=30,Fge=7,Rd="horizontal",O5="vertical",Vge=5,Gge=["line","bar","candlestick","scatter"],Wge={easing:"cubicOut",duration:100,delay:0},Hge=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=fe(this._onBrush,this),this._onBrushEnd=fe(this._onBrushEnd,this)},t.prototype.render=function(r,n,i,a){if(e.prototype.render.apply(this,arguments),xf(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(){lp(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 Ce;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?Fge:0,o=Tr(r,n).refContainer,s=this._findCoordRect(),l=r.get("defaultLocationEdgeGap",!0)||0,u=this._orient===Rd?{right:o.width-s.x-s.width,top:o.height-dS-l-a,width:s.width,height:dS}:{right:l,top:s.y,width:dS,height:s.height},c=Ju(r.option);j(["right","top","width","height"],function(f){c[f]==="ph"&&(c[f]=u[f])});var h=It(c,o);this._location={x:h.x,y:h.y},this._size=[h.width,h.height],this._orient===O5&&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===Rd&&!o?{scaleY:l?1:-1,scaleX:1}:i===Rd&&o?{scaleY:l?1:-1,scaleX:-1}:i===O5&&!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 jd({silent:!0,shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:r.get("backgroundColor")},z2:-40}));var o=new jd({shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:"transparent"},z2:0,onclick:fe(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 h=o.getDataExtent(r.thisDim),f=o.getDataExtent(l),d=(f[1]-f[0])*.3;f=[f[0]-d,f[1]+d];var g=[0,n[1]],m=[0,n[0]],y=[[n[0],0],[0,0]],x=[],_=m[1]/Math.max(1,o.count()-1),w=n[0]/(h[1]-h[0]),S=r.thisAxis.type==="time",T=-_,M=Math.round(o.count()/n[0]),A;o.each([r.thisDim,l],function(O,R,F){if(M>0&&F%M){S||(T+=_);return}T=S?(+O-h[0])*w:T+_;var H=R==null||isNaN(R)||R==="",W=H?0:ht(R,f,g,!0);H&&!A&&F?(y.push([y[y.length-1][0],0]),x.push([x[x.length-1][0],0])):!H&&A&&(y.push([T,0]),x.push([T,0])),H||(y.push([T,W]),x.push([T,W])),A=H}),u=this._shadowPolygonPts=y,c=this._shadowPolylinePts=x}this._shadowData=o,this._shadowDim=l,this._shadowSize=[n[0],n[1]];var P=this.dataZoomModel;function I(O){var R=P.getModel(O?"selectedDataBackground":"dataBackground"),F=new Ce,H=new en({shape:{points:u},segmentIgnoreThreshold:1,style:R.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),W=new Gr({shape:{points:c},segmentIgnoreThreshold:1,style:R.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return F.add(H),F.add(W),F}for(var N=0;N<3;N++){var D=I(N===1);this._displayables.sliderGroup.add(D),this._displayables.dataShadowSegs.push(D)}},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();j(l,function(u){if(!i&&!(n!==!0&&Ve(Gge,u.get("type"))<0)){var c=a.getComponent(Ps(o),s).axis,h=Uge(o),f,d=u.coordinateSystem;h!=null&&d.getOtherAxis&&(f=d.getOtherAxis(c).inverse),h=u.getData().mapDimension(h);var g=u.getData().mapDimension(o);i={thisAxis:c,series:u,thisDim:g,otherDim:h,otherAxisInverse:f}}},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,h=l.get("brushSelect"),f=n.filler=new jd({silent:h,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(f),o.add(new jd({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:Bge,fill:K.color.transparent}})),j([0,1],function(w){var S=l.get("handleIcon");!G0[S]&&S.indexOf("path://")<0&&S.indexOf("image://")<0&&(S="path://"+S);var T=sr(S,-1,0,2,2,null,!0);T.attr({cursor:Zge(this._orient),draggable:!0,drift:fe(this._onDragMove,this,w),ondragend:fe(this._onDragEnd,this),onmouseover:fe(this._showDataInfo,this,!0),onmouseout:fe(this._showDataInfo,this,!1),z2:5});var M=T.getBoundingRect(),A=l.get("handleSize");this._handleHeight=ce(A,this._size[1]),this._handleWidth=M.width/M.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(),Hs(T);var P=l.get("handleColor");P!=null&&(T.style.fill=P),o.add(i[w]=T);var I=l.getModel("textStyle"),N=l.get("handleLabel")||{},D=N.show||!1;r.add(a[w]=new tt({silent:!0,invisible:!D,style:Ct(I,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:I.getTextColor(),font:I.getFont()}),z2:10}))},this);var d=f;if(h){var g=ce(l.get("moveHandleSize"),s[1]),m=n.moveHandle=new Ze({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:g}}),y=g*.8,x=n.moveHandleIcon=sr(l.get("moveHandleIcon"),-y/2,-y/2,y,y,K.color.neutral00,!0);x.silent=!0,x.y=s[1]+g/2-.5,m.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var _=Math.min(s[1]/2,Math.max(g,10));d=n.moveZone=new Ze({invisible:!0,shape:{y:s[1]-_,height:g+_}}),d.on("mouseover",function(){u.enterEmphasis(m)}).on("mouseout",function(){u.leaveEmphasis(m)}),o.add(m),o.add(x),o.add(d)}d.attr({draggable:!0,cursor:"default",drift:fe(this._onDragMove,this,"all"),ondragstart:fe(this._showDataInfo,this,!0),ondragend:fe(this._onDragEnd,this),onmouseover:fe(this._showDataInfo,this,!0),onmouseout:fe(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var r=this._range=this.dataZoomModel.getPercentRange(),n=this._getViewExtent();this._handleEnds=[ht(r[0],[0,100],n,!0),ht(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];rl(n,a,o,i.get("zoomLock")?"all":r,s.minSpan!=null?ht(s.minSpan,l,o,!0):null,s.maxSpan!=null?ht(s.maxSpan,l,o,!0):null);var u=this._range,c=this._range=Qn([ht(a[0],o,l,!0),ht(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=Qn(i.slice()),o=this._size;j([0,1],function(d){var g=n.handles[d],m=this._handleHeight;g.attr({scaleX:m/2,scaleY:m/2,x:i[d]+(d?-1:1),y:o[1]/2-m/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 Ne(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();rl(0,l,o,0,u.minSpan!=null?ht(u.minSpan,s,o,!0):null,u.maxSpan!=null?ht(u.maxSpan,s,o,!0):null),this._range=Qn([ht(l[0],o,s,!0),ht(l[1],o,s,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(r){this._brushing&&(Wo(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 jd({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),h=this._size;u[0]=Math.max(Math.min(h[0],u[0]),0),o.setShape({x:c[0],y:0,width:u[0]-c[0],height:h[1]})},t.prototype._dispatchZoomAction=function(r){var n=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:r?Wge:null,start:n[0],end:n[1]})},t.prototype._findCoordRect=function(){var r,n=lH(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}(cL);function Uge(e){var t={x:"y",y:"x",radius:"angle",angle:"radius"};return t[e]}function Zge(e){return e==="vertical"?"ns-resize":"ew-resize"}function kH(e){e.registerComponentModel(zge),e.registerComponentView(Hge),hL(e)}function $ge(e){He(AH),He(kH)}var LH={get:function(e,t,r){var n=Se((Yge[e]||{})[t]);return r&&re(n)?n[n.length-1]:n}},Yge={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]}},z5=Ir.mapVisual,Xge=Ir.eachVisual,qge=re,B5=j,Kge=Qn,Jge=ht,Cx=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&&yH(i,r,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(r){var n=this.stateList;r=fe(r,this),this.controllerVisuals=_2(this.option.controller,n,r),this.targetVisuals=_2(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=lf(this.ecModel,"series",{index:n,id:r},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return ae(i,function(a){return a.componentIndex})},t.prototype.eachTargetSeries=function(r,n){j(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||["<",">"],re(r)&&(r=r.slice(),u=!0);var c=n?r:u?[h(r[0]),h(r[1])]:h(r);if(he(l))return l.replace("{value}",u?c[0]:c).replace("{value2}",u?c[1]:c);if(we(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 h(f){return f===s[0]?"min":f===s[1]?"max":(+f).toFixed(Math.min(o,20))}},t.prototype.resetExtent=function(){var r=this.option,n=Kge([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={});Ge(a,i),Ge(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(h){qge(n.color)&&!h.inRange&&(h.inRange={color:n.color.slice().reverse()}),h.inRange=h.inRange||{color:r.get("gradientColor")}}function u(h,f,d){var g=h[f],m=h[d];g&&!m&&(m=h[d]={},B5(g,function(y,x){if(Ir.isValidType(x)){var _=LH.get(x,"inactive",s);_!=null&&(m[x]=_,x==="color"&&!m.hasOwnProperty("opacity")&&!m.hasOwnProperty("colorAlpha")&&(m.opacity=[0,0]))}}))}function c(h){var f=(h.inRange||{}).symbol||(h.outOfRange||{}).symbol,d=(h.inRange||{}).symbolSize||(h.outOfRange||{}).symbolSize,g=this.get("inactiveColor"),m=this.getItemSymbol(),y=m||"roundRect";B5(this.stateList,function(x){var _=this.itemSize,w=h[x];w||(w=h[x]={color:s?g:[g]}),w.symbol==null&&(w.symbol=f&&Se(f)||(s?y:[y])),w.symbolSize==null&&(w.symbolSize=d&&Se(d)||(s?_[0]:[_[0],_[0]])),w.symbol=z5(w.symbol,function(M){return M==="none"?y:M});var S=w.symbolSize;if(S!=null){var T=-1/0;Xge(S,function(M){M>T&&(T=M)}),w.symbolSize=z5(S,function(M){return Jge(M,[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}($e),F5=[20,140],Qge=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]=F5[0]),(r[1]==null||isNaN(r[1]))&&(r[1]=F5[1])},t.prototype._resetRange=function(){var r=this.getExtent(),n=this.option.range;!n||n.auto?(r.auto=1,this.option.range=r):re(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),j(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=Qn((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=V5(this,"outOfRange",this.getExtent()),i=V5(this,"inRange",this.option.range.slice()),a=[];function o(d,g){a.push({value:d,color:r(d,g)})}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 Ce(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);eme([0,1],function(h){var f=o[h];f.setStyle("fill",n.handlesColor[h]),f.y=r[h];var d=ka(r[h],[0,l[1]],u,!0),g=this.getControllerVisual(d,"symbolSize");f.scaleX=f.scaleY=g/l[0],f.x=l[0]-g/2;var m=sa(i.handleLabelPoints[h],Us(f,this.group));if(this._orient==="horizontal"){var y=c==="left"||c==="top"?(l[0]-g)/2:(l[0]-g)/-2;m[1]+=y}s[h].setStyle({x:m[0],y:m[1],text:a.formatValueText(this._dataInterval[h]),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,h=c.indicator;if(h){h.attr("invisible",!1);var f={convertOpacityToAlpha:!0},d=this.getControllerVisual(r,"color",f),g=this.getControllerVisual(r,"symbolSize"),m=ka(r,s,u,!0),y=l[0]-g/2,x={x:h.x,y:h.y};h.y=m,h.x=y;var _=sa(c.indicatorLabelPoint,Us(h,this.group)),w=c.indicatorLabel;w.attr("invisible",!1);var S=this._applyTransform("left",c.mainGroup),T=this._orient,M=T==="horizontal";w.setStyle({text:(i||"")+o.formatValueText(n),verticalAlign:M?S:"middle",align:M?"center":S});var A={x:y,y:m,style:{fill:d}},P={style:{x:_[0],y:_[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var I={duration:100,easing:"cubicInOut",additive:!0};h.x=x.x,h.y=x.y,h.animateTo(A,I),w.animateTo(P,I)}else h.attr(A),w.attr(P);this._firstShowIndicator=!1;var N=this._shapes.handleLabels;if(N)for(var D=0;Do[1]&&(h[1]=1/0),n&&(h[0]===-1/0?this._showIndicator(c,h[1],"< ",l):h[1]===1/0?this._showIndicator(c,h[0],"> ",l):this._showIndicator(c,c,"โ‰ˆ ",l));var f=this._hoverLinkDataIndices,d=[];(n||U5(i))&&(d=this._hoverLinkDataIndices=i.findTargetDataIndices(h));var g=Oq(f,d);this._dispatchHighDown("downplay",Wy(g[0],i)),this._dispatchHighDown("highlight",Wy(g[1],i))}},t.prototype._hoverLinkFromSeriesMouseOver=function(r){var n;if(vu(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 lme(e,t,r,n){for(var i=t.targetVisuals[n],a=Ir.prepareVisualTypes(i),o={color:Yp(e.getData(),"color")},s=0,l=a.length;s0:t.splitNumber>0)||t.calculable)?"continuous":"piecewise"}),e.registerAction(ame,ome),j(sme,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(ume))}function DH(e){e.registerComponentModel(Qge),e.registerComponentView(nme),IH(e)}var cme=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=[],hme[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=Se(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=ae(this._pieceList,function(l){return l=Se(l),s!=="inRange"&&(l.visual=null),l}))})},t.prototype.completeVisualOption=function(){var r=this.option,n={},i=Ir.listVisualTypes(),a=this.isCategory();j(r.pieces,function(s){j(i,function(l){s.hasOwnProperty(l)&&(n[l]=1)})}),j(n,function(s,l){var u=!1;j(this.stateList,function(c){u=u||o(r,c,l)||o(r.target,c,l)},this),!u&&j(this.stateList,function(c){(r[c]||(r[c]={}))[l]=LH.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,j(a,function(l,u){var c=this.getSelectedMapKey(l);o.hasOwnProperty(c)||(o[c]=!0)},this),i.selectedMode==="single"){var s=!1;j(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=Se(r)},t.prototype.getValueState=function(r){var n=Ir.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=Ir.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,h){var f=a.getRepresentValue({interval:c});h||(h=a.getValueState(f));var d=r(f,h);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 j(s,function(c){var h=c.interval;h&&(h[0]>u&&o([u,h[0]],"outOfRange"),o(h.slice()),u=h[1])},this),{stops:n,outerColors:i}},t.type="visualMap.piecewise",t.defaultOption=fl(Cx.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}(Cx),hme={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 X5(e,t){var r=e.inverse;(e.orient==="vertical"?!r:r)&&t.reverse()}var fme=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=Fr(n.get("showLabel",!0),!u),h=!n.get("selectedMode");u&&this._renderEndsText(r,u[0],s,c,o),j(l.viewPieceList,function(f){var d=f.piece,g=new Ce;g.onclick=fe(this._onItemClick,this,d),this._enableHoverLink(g,f.indexInModelPieceList);var m=n.getRepresentValue(d);if(this._createItemSymbol(g,m,[0,0,s[0],s[1]],h),c){var y=this.visualMapModel.getValueState(m),x=a.get("align")||o;g.add(new tt({style:Ct(a,{x:x==="right"?-i:s[0]+i,y:s[1]/2,text:d.text,verticalAlign:a.get("verticalAlign")||"middle",align:x,opacity:be(a.get("opacity"),y==="outOfRange"?.5:1)}),silent:h}))}r.add(g)},this),u&&this._renderEndsText(r,u[1],s,c,o),wu(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:Wy(s.findTargetDataIndices(n),s)})}},t.prototype._getItemAlign=function(){var r=this.visualMapModel,n=r.option;if(n.orient==="vertical")return PH(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 Ce,l=this.visualMapModel.textStyleModel;s.add(new tt({style:Ct(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=ae(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=sr(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=Se(i.selected),s=n.getSelectedMapKey(r);a==="single"||a===!0?(o[s]=!0,j(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}(NH);function EH(e){e.registerComponentModel(cme),e.registerComponentView(fme),IH(e)}function dme(e){He(DH),He(EH)}var vme=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:iV(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}(),pme=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 vme(this);if(this._target=null,this.ecModel.eachSeries(function(i){_R(i,null)}),this.shouldShow()){var n=this.getTarget();_R(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}($e),gme=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 nc),!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=Tr(r,i).refContainer,u=It(CV(r,!0),l),c=s.lineWidth||0,h=this._contentRect=Bu(u.clone(),c/2,!0,!0),f=new Ce;a.add(f),f.setClipPath(new Ze({shape:h.plain()}));var d=this._targetGroup=new Ce;f.add(d);var g=u.plain();g.r=o.getShallow("borderRadius",!0),a.add(this._bgRect=new Ze({style:s,shape:g,silent:!1,cursor:"grab"}));var m=r.getModel("windowStyle"),y=m.getShallow("borderRadius",!0);f.add(this._windowRect=new Ze({shape:{x:0,y:0,width:0,height:0,r:y},style:m.getItemStyle(),silent:!1,cursor:"grab"})),this._dealRenderContent(),this._dealUpdateWindow(),K5(r,this)},t.prototype.renderContent=function(r){this._bridgeRendered=r,this._isEnabled()&&(this._dealRenderContent(),this._dealUpdateWindow(),K5(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=It({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=ji([],r.targetTrans),i=aa([],this._coordSys.transform,n);this._transThisToTarget=ji([],i);var a=r.viewportRect;a?a=a.clone():a=new Pe(0,0,this._api.getWidth(),this._api.getHeight()),a.applyTransform(i);var o=this._windowRect,s=o.shape.r;o.setShape(Ae({r:s},a))}},t.prototype._resetRoamController=function(r){var n=this,i=this._api,a=this._roamController;if(a||(a=this._roamController=new rc(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",fe(this._onPan,this)).on("zoom",fe(this._onZoom,this))},t.prototype._onPan=function(r){var n=this._transThisToTarget;if(!(!this._isEnabled()||!n)){var i=Kt([],[r.oldX,r.oldY],n),a=Kt([],[r.oldX-r.dx,r.oldY-r.dy],n);this._api.dispatchAction(q5(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=Kt([],[r.originX,r.originY],n);this._api.dispatchAction(q5(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}(Mt);function q5(e,t){var r=e.mainType==="series"?e.subType+"Roam":e.mainType+"Roam",n={type:r};return n[e.mainType+"Id"]=e.id,Q(n,t),n}function K5(e,t){var r=Fu(e);w_(t.group,r.z,r.zlevel)}function mme(e){e.registerComponentModel(pme),e.registerComponentView(gme)}var yme={label:{enabled:!0},decal:{show:!1}},J5=Ye(),xme={};function _me(e,t){var r=e.getModel("aria");if(!r.get("enabled"))return;var n=Se(yme);Ge(n.label,e.getLocaleModel().get("aria"),!1),Ge(r.option,n,!1),i(),a();function i(){var u=r.getModel("decal"),c=u.get("show");if(c){var h=_e();e.eachSeries(function(f){if(!f.isColorBySeries()){var d=h.get(f.type);d||(d={},h.set(f.type,d)),J5(f).scope=d}}),e.eachRawSeries(function(f){if(e.isSeriesFiltered(f))return;if(we(f.enableAriaDecal)){f.enableAriaDecal();return}var d=f.getData();if(f.isColorBySeries()){var _=fT(f.ecModel,f.name,xme,e.getSeriesCount()),w=d.getVisual("decal");d.setVisual("decal",S(w,_))}else{var g=f.getRawData(),m={},y=J5(f).scope;d.each(function(T){var M=d.getRawIndex(T);m[M]=T});var x=g.count();g.each(function(T){var M=m[T],A=g.getName(T)||T+"",P=fT(f.ecModel,A,y,x),I=d.getItemVisual(M,"decal");d.setItemVisual(M,"decal",S(I,P))})}function S(T,M){var A=T?Q(Q({},M),T):M;return A.dirty=!0,A}})}}function a(){var u=t.getZr().dom;if(u){var c=e.getLocaleModel().get("aria"),h=r.getModel("label");if(h.option=Ae(h.option,c),!!h.get("enabled")){if(u.setAttribute("role","img"),h.get("description")){u.setAttribute("aria-label",h.get("description"));return}var f=e.getSeriesCount(),d=h.get(["data","maxCount"])||10,g=h.get(["series","maxCount"])||10,m=Math.min(f,g),y;if(!(f<1)){var x=s();if(x){var _=h.get(["general","withTitle"]);y=o(_,{title:x})}else y=h.get(["general","withoutTitle"]);var w=[],S=f>1?h.get(["series","multiple","prefix"]):h.get(["series","single","prefix"]);y+=o(S,{seriesCount:f}),e.eachSeries(function(P,I){if(I1?h.get(["series","multiple",O]):h.get(["series","single",O]),N=o(N,{seriesId:P.seriesIndex,seriesName:P.get("name"),seriesType:l(P.subType)});var R=P.getData();if(R.count()>d){var F=h.get(["data","partialData"]);N+=o(F,{displayCnt:d})}else N+=h.get(["data","allData"]);for(var H=h.get(["data","separator","middle"]),W=h.get(["data","separator","end"]),V=h.get(["data","excludeDimensionId"]),z=[],Z=0;Z":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},Sme=function(){function e(t){var r=this._condVal=he(t)?new RegExp(t):kB(t)?t:null;if(r==null){var n="";ft(n)}}return e.prototype.evaluate=function(t){var r=typeof t;return he(r)?this._condVal.test(t):rt(r)?this._condVal.test(t+""):!1},e}(),Cme=function(){function e(){}return e.prototype.evaluate=function(){return this.value},e}(),Tme=function(){function e(){}return e.prototype.evaluate=function(){for(var t=this.children,r=0;r2&&n.push(i),i=[R,F]}function c(R,F,H,W){hh(R,H)&&hh(F,W)||i.push(R,F,H,W,H,W)}function h(R,F,H,W,V,z){var Z=Math.abs(F-R),U=Math.tan(Z/4)*4/3,$=FP:D2&&n.push(i),n}function k2(e,t,r,n,i,a,o,s,l,u){if(hh(e,r)&&hh(t,n)&&hh(i,o)&&hh(a,s)){l.push(o,s);return}var c=2/u,h=c*c,f=o-e,d=s-t,g=Math.sqrt(f*f+d*d);f/=g,d/=g;var m=r-e,y=n-t,x=i-o,_=a-s,w=m*m+y*y,S=x*x+_*_;if(w=0&&P=0){l.push(o,s);return}var I=[],N=[];Qs(e,r,i,o,.5,I),Qs(t,n,a,s,.5,N),k2(I[0],N[0],I[1],N[1],I[2],N[2],I[3],N[3],l,u),k2(I[4],N[4],I[5],N[5],I[6],N[6],I[7],N[7],l,u)}function Bme(e,t){var r=A2(e),n=[];t=t||1;for(var i=0;i0)for(var u=0;uMath.abs(u),h=RH([l,u],c?0:1,t),f=(c?s:u)/h.length,d=0;di,o=RH([n,i],a?0:1,t),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",c=a?"y":"x",h=e[s]/o.length,f=0;f1?null:new Ne(m*l+e,m*u+t)}function Gme(e,t,r){var n=new Ne;Ne.sub(n,r,t),n.normalize();var i=new Ne;Ne.sub(i,e,t);var a=i.dot(n);return a}function Fc(e,t){var r=e[e.length-1];r&&r[0]===t[0]&&r[1]===t[1]||e.push(t)}function Wme(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),Wme(t,u,c)}function Tx(e,t,r,n){if(r===1)n.push(t);else{var i=Math.floor(r/2),a=e(t);Tx(e,a[0],i,n),Tx(e,a[1],r-i,n)}return n}function Hme(e,t){for(var r=[],n=0;n0;u/=2){var c=0,h=0;(e&u)>0&&(c=1),(t&u)>0&&(h=1),s+=u*u*(3*c^h),h===0&&(c===1&&(e=u-1-e,t=u-1-t),l=e,e=t,t=l)}return s}function kx(e){var t=1/0,r=1/0,n=-1/0,i=-1/0,a=ae(e,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),c=l.x+l.width/2+(u?u[4]:0),h=l.y+l.height/2+(u?u[5]:0);return t=Math.min(c,t),r=Math.min(h,r),n=Math.max(c,n),i=Math.max(h,i),[c,h]}),o=ae(a,function(s,l){return{cp:s,z:Qme(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 BH(e){return $me(e.path,e.count)}function L2(){return{fromIndividuals:[],toIndividuals:[],count:0}}function eye(e,t,r){var n=[];function i(T){for(var M=0;M=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 rye={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;s3(e)&&(u=e,c=t),s3(t)&&(u=t,c=e);function h(x,_,w,S,T){var M=x.many,A=x.one;if(M.length===1&&!T){var P=_?M[0]:A,I=_?A:M[0];if(Mx(P))h({many:[P],one:I},!0,w,S,!0);else{var N=s?Ae({delay:s(w,S)},l):l;_L(P,I,N),a(P,I,P,I,N)}}else for(var D=Ae({dividePath:rye[r],individualDelay:s&&function(V,z,Z,U){return s(V+w,S)}},l),O=_?eye(M,A,D):tye(A,M,D),R=O.fromIndividuals,F=O.toIndividuals,H=R.length,W=0;Wt.length,d=u?l3(c,u):l3(f?t:e,[f?e:t]),g=0,m=0;mFH))for(var a=n.getIndices(),o=0;o0&&M.group.traverse(function(P){P instanceof Ke&&!P.animators.length&&P.animateFrom({style:{opacity:0}},A)})})}function d3(e){var t=e.getModel("universalTransition").get("seriesKey");return t||e.id}function v3(e){return re(e)?e.sort().join(","):e}function ys(e){if(e.hostModel)return e.hostModel.getModel("universalTransition").get("divideShape")}function uye(e,t){var r=_e(),n=_e(),i=_e();return j(e.oldSeries,function(a,o){var s=e.oldDataGroupIds[o],l=e.oldData[o],u=d3(a),c=v3(u);n.set(c,{dataGroupId:s,data:l}),re(u)&&j(u,function(h){i.set(h,{key:c,dataGroupId:s,data:l})})}),j(t.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var o=a.get("dataGroupId"),s=a.getData(),l=d3(a),u=v3(l),c=n.get(u);if(c)r.set(u,{oldSeries:[{dataGroupId:c.dataGroupId,divide:ys(c.data),data:c.data}],newSeries:[{dataGroupId:o,divide:ys(s),data:s}]});else if(re(l)){var h=[];j(l,function(g){var m=n.get(g);m.data&&h.push({dataGroupId:m.dataGroupId,divide:ys(m.data),data:m.data})}),h.length&&r.set(u,{oldSeries:h,newSeries:[{dataGroupId:o,data:s,divide:ys(s)}]})}else{var f=i.get(l);if(f){var d=r.get(f.key);d||(d={oldSeries:[{dataGroupId:f.dataGroupId,data:f.data,divide:ys(f.data)}],newSeries:[]},r.set(f.key,d)),d.newSeries.push({dataGroupId:o,data:s,divide:ys(s)})}}}}),r}function p3(e,t){for(var r=0;r=0&&i.push({dataGroupId:t.oldDataGroupIds[s],data:t.oldData[s],divide:ys(t.oldData[s]),groupIdDim:o.dimension})}),j(Tt(e.to),function(o){var s=p3(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:t.oldDataGroupIds[s],data:l,divide:ys(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&VH(i,a,n)}function hye(e){e.registerUpdateLifecycle("series:beforeupdate",function(t,r,n){j(Tt(n.seriesTransition),function(i){j(Tt(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=g3,n=m3,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 dye(){return new fye}var g3=0,m3=0;function vye(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()}};j(e.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(r+=l.val);var u=bL(s,t);if(u){var c=u.vmin!==s.vmin,h=u.vmax!==s.vmax,f=u.vmax-u.vmin;if(!(c&&h))if(c||h){var d=c?"S":"E";a[d][l.type].has=!0,a[d][l.type].span=f,a[d][l.type].inExtFrac=f/(s.vmax-s.vmin),a[d][l.type].val=l.val}else n[l.type].span+=f,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));j(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 pye(e,t,r,n,i,a){e!=="no"&&j(r,function(o){var s=bL(o,a);if(s)for(var l=t.length-1;l>=0;l--){var u=t[l],c=n(u),h=i*3/4;c>s.vmin-h&&ct[0]&&r=0&&o<1-1e-5}j(e,function(o){if(!(!o||o.start==null||o.end==null)&&!o.isExpanded){var s={breakOption:Se(o),vmin:t(o.start),vmax:t(o.end),gapParsed:{type:"tpAbs",val:0},gapReal:null};if(o.gap!=null){var l=!1;if(he(o.gap)){var u=Jn(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 h=t(o.gap);(!isFinite(h)||h<0)&&(h=0),s.gapParsed.type="tpAbs",s.gapParsed.val=h}}if(s.vmin===s.vmax&&(s.gapParsed.type="tpAbs",s.gapParsed.val=0),r&&r.noNegative&&j(["vmin","vmax"],function(d){s[d]<0&&(s[d]=0)}),s.vmin>s.vmax){var f=s.vmax;s.vmax=s.vmin,s.vmin=f}n.push(s)}}),n.sort(function(o,s){return o.vmin-s.vmin});var a=-1/0;return j(n,function(o,s){a>o.vmin&&(n[s]=null),a=o.vmax}),{breaks:n.filter(function(o){return!!o})}}function wL(e,t){return P2(t)===P2(e)}function P2(e){return e.start+"_\0_"+e.end}function mye(e,t,r){var n=[];j(e,function(a,o){var s=t(a);s&&s.type==="vmin"&&n.push([o])}),j(e,function(a,o){var s=t(a);if(s&&s.type==="vmax"){var l=ul(n,function(u){return wL(t(e[u[0]]).parsedBreak.breakOption,s.parsedBreak.breakOption)});l&&l.push(o)}});var i=[];return j(n,function(a){a.length===2&&i.push(r?a:[e[a[0]],e[a[1]]])}),i}function yye(e,t,r,n){var i,a;if(e.break){var o=e.break.parsedBreak,s=ul(r,function(h){return wL(h.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"?ir(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 xye(e,t,r){var n={noNegative:!0},i=N2(e,r,n),a=N2(e,r,n),o=Math.log(t);return a.breaks=ae(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 _ye={vmin:"start",vmax:"end"};function bye(e,t){return t&&(e=e||{},e.break={type:_ye[t.type],start:t.parsedBreak.vmin,end:t.parsedBreak.vmax}),e}function wye(){HJ({createScaleBreakContext:dye,pruneTicksByBreak:pye,addBreaksToTicks:gye,parseAxisBreakOption:N2,identifyAxisBreak:wL,serializeAxisBreakIdentifier:P2,retrieveAxisBreakPairs:mye,getTicksLogTransformBreak:yye,logarithmicParseBreaksFromOption:xye,makeAxisLabelFormatterParamBreak:bye})}var y3=Ye();function Sye(e,t){var r=ul(e,function(n){return vr().identifyAxisBreak(n.parsedBreak.breakOption,t.breakOption)});return r||e.push(r={zigzagRandomList:[],parsedBreak:t,shouldRemove:!1}),r}function Cye(e){j(e,function(t){return t.shouldRemove=!0})}function Tye(e){for(var t=e.length-1;t>=0;t--)e[t].shouldRemove&&e.splice(t,1)}function Mye(e,t,r,n,i){var a=r.axis;if(a.scale.isBlank()||!vr())return;var o=vr().retrieveAxisBreakPairs(a.scale.getTicks({breakTicks:"only_break"}),function(I){return I.break},!1);if(!o.length)return;var s=r.getModel("breakArea"),l=s.get("zigzagAmplitude"),u=s.get("zigzagMinSpan"),c=s.get("zigzagMaxSpan");u=Math.max(2,u||0),c=Math.max(u,c||0);var h=s.get("expandOnClick"),f=s.get("zigzagZ"),d=s.getModel("itemStyle"),g=d.getItemStyle(),m=g.stroke,y=g.lineWidth,x=g.lineDash,_=g.fill,w=new Ce({ignoreModelZ:!0}),S=a.isHorizontal(),T=y3(t).visualList||(y3(t).visualList=[]);Cye(T);for(var M=function(I){var N=o[I][0].break.parsedBreak,D=[];D[0]=a.toGlobalCoord(a.dataToCoord(N.vmin,!0)),D[1]=a.toGlobalCoord(a.dataToCoord(N.vmax,!0)),D[1]=z;le&&(te=z);var Ee=[],me=[];Ee[W]=D,me[W]=O,!se&&!le&&(Ee[W]+=Y?-l:l,me[W]-=Y?l:-l),Ee[V]=te,me[V]=te,U.push(Ee),$.push(me);var ye=void 0;if(ie_[1]&&_.reverse(),{coordPair:_,brkId:vr().serializeAxisBreakIdentifier(x.breakOption)}});l.sort(function(y,x){return y.coordPair[0]-x.coordPair[0]});for(var u=o[0],c=null,h=0;h=0?l[0].width:l[1].width),f=(h+c.x)/2-u.x,d=Math.min(f,f-c.x),g=Math.max(f,f-c.x),m=g<0?g:d>0?d:0;s=(f-m)/c.x}var y=new Ne,x=new Ne;Ne.scale(y,n,-s),Ne.scale(x,n,1-s),IT(r[0],y),IT(r[1],x)}function Lye(e,t){var r={breaks:[]};return j(t.breaks,function(n){if(n){var i=ul(e.get("breaks",!0),function(s){return vr().identifyAxisBreak(s,n)});if(i){var a=t.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===D_?!0:a===lW?!1:a===uW?!i.isExpanded:i.isExpanded,r.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}}),r}function Nye(){Tae({adjustBreakLabelPair:kye,buildAxisBreakLine:Aye,rectCoordBuildBreakAxis:Mye,updateModelAxisBreak:Lye})}function Pye(e){Pae(e),wye(),Nye()}function Iye(){Jae(Dye)}function Dye(e,t){j(e,function(r){if(!r.model.get(["axisLabel","inside"])){var n=Eye(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 Eye(e){var t=e.model,r=e.scale;if(!t.get(["axisLabel","show"])||r.isBlank())return;var n,i,a=r.getExtent();r instanceof Wh?i=r.count():(n=r.getTicks(),i=n.length);var o=e.getLabelModel(),s=wf(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 Kye(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function Jye(e){return e==="ROUTER"||e==="ROUTER_LATE"?30:e==="REPEATER"||e==="TRACKER"?25:e==="CLIENT_MUTE"?7:e==="CLIENT_BASE"?12:15}function Qye({nodes:e,edges:t,selectedNodeId:r,onSelectNode:n}){const i=G.useRef(null),[a,o]=G.useState("connected"),s=G.useMemo(()=>{const y=new Set;return t.forEach(x=>{y.add(x.from_node),y.add(x.to_node)}),y},[t]),l=G.useMemo(()=>{let y=e;return a==="connected"?y=y.filter(x=>s.has(x.node_num)):a==="infra"&&(y=y.filter(x=>b3.includes(x.role))),y},[e,a,s]),u=G.useMemo(()=>new Map(l.map(y=>[y.node_num,y])),[l]),c=G.useMemo(()=>t.filter(y=>u.has(y.from_node)&&u.has(y.to_node)),[t,u]),h=G.useMemo(()=>{const y=new Set;return r!==null&&c.forEach(x=>{x.from_node===r&&y.add(x.to_node),x.to_node===r&&y.add(x.from_node)}),y},[r,c]),f=G.useMemo(()=>{const y=l.map(_=>{const w=Kye(_.latitude),S=_3[w%_3.length],T=b3.includes(_.role),M=_.node_num===r,A=h.has(_.node_num),P=r===null||M||A;return{id:String(_.node_num),name:_.short_name,value:_.node_num,symbolSize:Jye(_.role),itemStyle:{color:T?S:"#111827",borderColor:S,borderWidth:T?0:2,opacity:P?1:.15},label:{show:!0,position:"bottom",distance:5,fontSize:10,fontFamily:"JetBrains Mono, monospace",color:P?"#94a3b8":"#94a3b820"},nodeNum:_.node_num,longName:_.long_name,role:_.role}}),x=c.map(_=>{const w=r===null||_.from_node===r||_.to_node===r;return{source:String(_.from_node),target:String(_.to_node),value:_.snr,lineStyle:{color:qye(_.snr),width:w&&r!==null?2:1,opacity:r===null?.4:w?.6:.04}}});return{nodes:y,links:x}},[l,c,r,h]),d=G.useMemo(()=>({backgroundColor:"#111827",tooltip:{trigger:"item",backgroundColor:"#1e293b",borderColor:"#334155",textStyle:{color:"#e2e8f0",fontFamily:"JetBrains Mono, monospace",fontSize:11},formatter:y=>{if(y.data&&y.data.longName){const x=y.data;return`${x.name}
${x.longName}
Role: ${x.role}`}return""}},series:[{type:"graph",layout:"force",roam:!0,draggable:!0,animation:!1,data:f.nodes,links:f.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"]}]}),[f]),g=G.useCallback(y=>{if(y.data&&"nodeNum"in y.data){const x=y.data.nodeNum;n(r===x?null:x??null)}},[r,n]),m=G.useMemo(()=>({click:g}),[g]);return G.useEffect(()=>{var x;const y=(x=i.current)==null?void 0:x.getEchartsInstance();y&&y.setOption(d,{notMerge:!1,lazyUpdate:!0})},[d]),v.jsxs("div",{className:"relative bg-bg-card rounded-lg border border-border overflow-hidden",children:[v.jsx(Xye,{ref:i,option:d,style:{height:"540px",width:"100%"},onEvents:m,opts:{renderer:"canvas"}}),v.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:[v.jsx(RM,{size:14,className:"text-slate-500"}),v.jsx("div",{className:"flex gap-1",children:[{key:"connected",label:"Connected"},{key:"infra",label:"Infra"},{key:"all",label:"All"}].map(({key:y,label:x})=>v.jsx("button",{onClick:()=>o(y),className:`px-2 py-1 text-xs rounded transition-colors ${a===y?"bg-accent text-white":"bg-bg-hover text-slate-400 hover:text-slate-200"}`,children:x},y))}),v.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[l.length," nodes โ€ข ",c.length," edges"]})]}),v.jsxs("div",{className:"absolute bottom-4 left-4 bg-bg-card/90 backdrop-blur-sm border border-border rounded p-3",children:[v.jsx("div",{className:"text-xs text-slate-400 font-medium mb-2",children:"Edge Quality (SNR)"}),v.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(y=>v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-4 h-0.5",style:{backgroundColor:y.color}}),v.jsx("span",{className:"text-xs text-slate-500",children:y.label})]},y.label))})]}),v.jsxs("div",{className:"absolute bottom-4 right-4 bg-bg-card/90 backdrop-blur-sm border border-border rounded p-3",children:[v.jsx("div",{className:"text-xs text-slate-400 font-medium mb-2",children:"Node Type"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-3 h-3 rounded-full bg-blue-500"}),v.jsx("span",{className:"text-xs text-slate-500",children:"Infrastructure"})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-3 h-3 rounded-full bg-gray-900 border-2 border-blue-500"}),v.jsx("span",{className:"text-xs text-slate-500",children:"Client"})]})]})]})]})}function HH(e,t){const r=G.useRef(t);G.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 e0e(e,t,r){t.center!==r.center&&e.setLatLng(t.center),t.radius!=null&&t.radius!==r.radius&&e.setRadius(t.radius)}const t0e=1;function r0e(e){return Object.freeze({__version:t0e,map:e})}function UH(e,t){return Object.freeze({...e,...t})}const ZH=G.createContext(null),$H=ZH.Provider;function U_(){const e=G.useContext(ZH);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of ");return e}function n0e(e){function t(r,n){const{instance:i,context:a}=e(r).current;return G.useImperativeHandle(n,()=>i),r.children==null?null:Ch.createElement($H,{value:a},r.children)}return G.forwardRef(t)}function i0e(e){function t(r,n){const[i,a]=G.useState(!1),{instance:o}=e(r,a).current;G.useImperativeHandle(n,()=>o),G.useEffect(function(){i&&o.update()},[o,i,r.children]);const s=o._contentNode;return s?Z4.createPortal(r.children,s):null}return G.forwardRef(t)}function a0e(e){function t(r,n){const{instance:i}=e(r).current;return G.useImperativeHandle(n,()=>i),null}return G.forwardRef(t)}function ML(e,t){const r=G.useRef();G.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 Z_(e,t){const r=e.pane??t.pane;return r?{...e,pane:r}:e}function o0e(e,t){return function(n,i){const a=U_(),o=e(Z_(n,a),a);return HH(a.map,n.attribution),ML(o.current,n.eventHandlers),t(o.current,a,n,i),o}}var E2={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)})(n7,function(r){var n="1.9.4";function i(p){var b,C,k,E;for(C=1,k=arguments.length;C"u"||!L||!L.Mixin)){p=w(p)?p:[p];for(var b=0;b0?Math.floor(p):Math.ceil(p)};z.prototype={clone:function(){return new z(this.x,this.y)},add:function(p){return this.clone()._add(U(p))},_add:function(p){return this.x+=p.x,this.y+=p.y,this},subtract:function(p){return this.clone()._subtract(U(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=Z(this.x),this.y=Z(this.y),this},distanceTo:function(p){p=U(p);var b=p.x-this.x,C=p.y-this.y;return Math.sqrt(b*b+C*C)},equals:function(p){return p=U(p),p.x===this.x&&p.y===this.y},contains:function(p){return p=U(p),Math.abs(p.x)<=Math.abs(this.x)&&Math.abs(p.y)<=Math.abs(this.y)},toString:function(){return"Point("+f(this.x)+", "+f(this.y)+")"}};function U(p,b,C){return p instanceof z?p:w(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,b,C)}function $(p,b){if(p)for(var C=b?[p,b]:p,k=0,E=C.length;k=this.min.x&&C.x<=this.max.x&&b.y>=this.min.y&&C.y<=this.max.y},intersects:function(p){p=Y(p);var b=this.min,C=this.max,k=p.min,E=p.max,B=E.x>=b.x&&k.x<=C.x,X=E.y>=b.y&&k.y<=C.y;return B&&X},overlaps:function(p){p=Y(p);var b=this.min,C=this.max,k=p.min,E=p.max,B=E.x>b.x&&k.xb.y&&k.y=b.lat&&E.lat<=C.lat&&k.lng>=b.lng&&E.lng<=C.lng},intersects:function(p){p=ie(p);var b=this._southWest,C=this._northEast,k=p.getSouthWest(),E=p.getNorthEast(),B=E.lat>=b.lat&&k.lat<=C.lat,X=E.lng>=b.lng&&k.lng<=C.lng;return B&&X},overlaps:function(p){p=ie(p);var b=this._southWest,C=this._northEast,k=p.getSouthWest(),E=p.getNorthEast(),B=E.lat>b.lat&&k.latb.lng&&k.lng1,gl=function(){var p=!1;try{var b=Object.defineProperty({},"passive",{get:function(){p=!0}});window.addEventListener("testPassiveEventSupport",h,b),window.removeEventListener("testPassiveEventSupport",h,b)}catch{}return p}(),ee=function(){return!!document.createElement("canvas").getContext}(),_t=!!(document.createElementNS&&et("svg").createSVGRect),pt=!!_t&&function(){var p=document.createElement("div");return p.innerHTML="",(p.firstChild&&p.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),dt=!_t&&function(){try{var p=document.createElement("div");p.innerHTML='';var b=p.firstChild;return b.style.behavior="url(#default#VML)",b&&typeof b.adj=="object"}catch{return!1}}(),ur=navigator.platform.indexOf("Mac")===0,oo=navigator.platform.indexOf("Linux")===0;function rn(p){return navigator.userAgent.toLowerCase().indexOf(p)>=0}var Be={ie:lr,ielt9:Mr,edge:Gn,webkit:Wn,android:io,android23:Af,androidStock:ig,opera:ac,chrome:ag,gecko:jt,safari:$x,phantom:og,opera12:sg,win:Ue,ie3d:lg,webkit3d:kf,gecko3d:ao,any3d:tn,mobile:pl,mobileWebkit:ug,mobileWebkit3d:cg,msPointer:Lf,pointer:Nf,touch:Ut,touchNative:_e,mobileOpera:Hn,mobileGecko:ui,retina:Gi,passiveEvents:gl,canvas:ee,svg:_t,vml:dt,inlineSvg:pt,mac:ur,linux:oo},Pf=Be.msPointer?"MSPointerDown":"pointerdown",If=Be.msPointer?"MSPointerMove":"pointermove",Df=Be.msPointer?"MSPointerUp":"pointerup",Ef=Be.msPointer?"MSPointerCancel":"pointercancel",oc={touchstart:Pf,touchmove:If,touchend:Df,touchcancel:Ef},jf={touchstart:rU,touchmove:dg,touchend:dg,touchcancel:dg},so={},Rf=!1;function hg(p,b,C){return b==="touchstart"&&Ft(),jf[b]?(C=jf[b].bind(this,C),p.addEventListener(oc[b],C,!1),C):(console.warn("wrong event specified:",b),h)}function Of(p,b,C){if(!oc[b]){console.warn("wrong event specified:",b);return}p.removeEventListener(oc[b],C,!1)}function fg(p){so[p.pointerId]=p}function Bt(p){so[p.pointerId]&&(so[p.pointerId]=p)}function wt(p){delete so[p.pointerId]}function Ft(){Rf||(document.addEventListener(Pf,fg,!0),document.addEventListener(If,Bt,!0),document.addEventListener(Df,wt,!0),document.addEventListener(Ef,wt,!0),Rf=!0)}function dg(p,b){if(b.pointerType!==(b.MSPOINTER_TYPE_MOUSE||"mouse")){b.touches=[];for(var C in so)b.touches.push(so[C]);b.changedTouches=[b],p(b)}}function rU(p,b){b.MSPOINTER_TYPE_TOUCH&&b.pointerType===b.MSPOINTER_TYPE_TOUCH&&Hr(b),dg(p,b)}function nU(p){var b={},C,k;for(k in p)C=p[k],b[k]=C&&C.bind?C.bind(p):C;return p=b,b.type="dblclick",b.detail=2,b.isTrusted=!1,b._simulated=!0,b}var iU=200;function aU(p,b){p.addEventListener("dblclick",b);var C=0,k;function E(B){if(B.detail!==1){k=B.detail;return}if(!(B.pointerType==="mouse"||B.sourceCapabilities&&!B.sourceCapabilities.firesTouchEvents)){var X=EL(B);if(!(X.some(function(ne){return ne instanceof HTMLLabelElement&&ne.attributes.for})&&!X.some(function(ne){return ne instanceof HTMLInputElement||ne instanceof HTMLSelectElement}))){var J=Date.now();J-C<=iU?(k++,k===2&&b(nU(B))):k=1,C=J}}}return p.addEventListener("click",E),{dblclick:b,simDblclick:E}}function oU(p,b){p.removeEventListener("dblclick",b.dblclick),p.removeEventListener("click",b.simDblclick)}var Yx=gg(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),zf=gg(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),NL=zf==="webkitTransition"||zf==="OTransition"?zf+"End":"transitionend";function PL(p){return typeof p=="string"?document.getElementById(p):p}function Bf(p,b){var C=p.style[b]||p.currentStyle&&p.currentStyle[b];if((!C||C==="auto")&&document.defaultView){var k=document.defaultView.getComputedStyle(p,null);C=k?k[b]:null}return C==="auto"?null:C}function St(p,b,C){var k=document.createElement(p);return k.className=b||"",C&&C.appendChild(k),k}function Zt(p){var b=p.parentNode;b&&b.removeChild(p)}function vg(p){for(;p.firstChild;)p.removeChild(p.firstChild)}function sc(p){var b=p.parentNode;b&&b.lastChild!==p&&b.appendChild(p)}function lc(p){var b=p.parentNode;b&&b.firstChild!==p&&b.insertBefore(p,b.firstChild)}function Xx(p,b){if(p.classList!==void 0)return p.classList.contains(b);var C=pg(p);return C.length>0&&new RegExp("(^|\\s)"+b+"(\\s|$)").test(C)}function at(p,b){if(p.classList!==void 0)for(var C=g(b),k=0,E=C.length;k0?2*window.devicePixelRatio:1;function RL(p){return Be.edge?p.wheelDeltaY/2:p.deltaY&&p.deltaMode===0?-p.deltaY/uU: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 s1(p,b){var C=b.relatedTarget;if(!C)return!0;try{for(;C&&C!==p;)C=C.parentNode}catch{return!1}return C!==p}var cU={__proto__:null,on:nt,off:Rt,stopPropagation:_l,disableScrollPropagation:o1,disableClickPropagation:Wf,preventDefault:Hr,stop:xl,getPropagationPath:EL,getMousePosition:jL,getWheelDelta:RL,isExternalTarget:s1,addListener:nt,removeListener:Rt},OL=V.extend({run:function(p,b,C,k){this.stop(),this._el=p,this._inProgress=!0,this._duration=C||.25,this._easeOutPower=1/Math.max(k||.5,.2),this._startPos=yl(p),this._offset=b.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=D(this._animate,this),this._step()},_step:function(p){var b=+new Date-this._startTime,C=this._duration*1e3;bthis.options.maxZoom)?this.setZoom(p):this},panInsideBounds:function(p,b){this._enforcingBounds=!0;var C=this.getCenter(),k=this._limitCenter(C,this._zoom,ie(p));return C.equals(k)||this.panTo(k,b),this._enforcingBounds=!1,this},panInside:function(p,b){b=b||{};var C=U(b.paddingTopLeft||b.padding||[0,0]),k=U(b.paddingBottomRight||b.padding||[0,0]),E=this.project(this.getCenter()),B=this.project(p),X=this.getPixelBounds(),J=Y([X.min.add(C),X.max.subtract(k)]),ne=J.getSize();if(!J.contains(B)){this._enforcingBounds=!0;var ue=B.subtract(J.getCenter()),Ie=J.extend(B).getSize().subtract(ne);E.x+=ue.x<0?-Ie.x:Ie.x,E.y+=ue.y<0?-Ie.y:Ie.y,this.panTo(this.unproject(E),b),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 b=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var C=this.getSize(),k=b.divideBy(2).round(),E=C.divideBy(2).round(),B=k.subtract(E);return!B.x&&!B.y?this:(p.animate&&p.pan?this.panBy(B):(p.pan&&this._rawPanBy(B),this.fire("move"),p.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:b,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 b=o(this._handleGeolocationResponse,this),C=o(this._handleGeolocationError,this);return p.watch?this._locationWatchId=navigator.geolocation.watchPosition(b,C,p):navigator.geolocation.getCurrentPosition(b,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 b=p.code,C=p.message||(b===1?"permission denied":b===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:b,message:"Geolocation error: "+C+"."})}},_handleGeolocationResponse:function(p){if(this._container._leaflet_id){var b=p.coords.latitude,C=p.coords.longitude,k=new se(b,C),E=k.toBounds(p.coords.accuracy*2),B=this._locateOptions;if(B.setView){var X=this.getBoundsZoom(E);this.setView(k,B.maxZoom?Math.min(X,B.maxZoom):X)}var J={latlng:k,bounds:E,timestamp:p.timestamp};for(var ne in p.coords)typeof p.coords[ne]=="number"&&(J[ne]=p.coords[ne]);this.fire("locationfound",J)}},addHandler:function(p,b){if(!b)return this;var C=this[p]=new b(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(),Zt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(O(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)Zt(this._panes[p]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(p,b){var C="leaflet-pane"+(p?" leaflet-"+p.replace("Pane","")+"-pane":""),k=St("div",C,b||this._mapPane);return p&&(this._panes[p]=k),k},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(),b=this.unproject(p.getBottomLeft()),C=this.unproject(p.getTopRight());return new te(b,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,b,C){p=ie(p),C=U(C||[0,0]);var k=this.getZoom()||0,E=this.getMinZoom(),B=this.getMaxZoom(),X=p.getNorthWest(),J=p.getSouthEast(),ne=this.getSize().subtract(C),ue=Y(this.project(J,k),this.project(X,k)).getSize(),Ie=Be.any3d?this.options.zoomSnap:1,Xe=ne.x/ue.x,ut=ne.y/ue.y,pn=b?Math.max(Xe,ut):Math.min(Xe,ut);return k=this.getScaleZoom(pn,k),Ie&&(k=Math.round(k/(Ie/100))*(Ie/100),k=b?Math.ceil(k/Ie)*Ie:Math.floor(k/Ie)*Ie),Math.max(E,Math.min(B,k))},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,b){var C=this._getTopLeftPoint(p,b);return new $(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,b){var C=this.options.crs;return b=b===void 0?this._zoom:b,C.scale(p)/C.scale(b)},getScaleZoom:function(p,b){var C=this.options.crs;b=b===void 0?this._zoom:b;var k=C.zoom(p*C.scale(b));return isNaN(k)?1/0:k},project:function(p,b){return b=b===void 0?this._zoom:b,this.options.crs.latLngToPoint(le(p),b)},unproject:function(p,b){return b=b===void 0?this._zoom:b,this.options.crs.pointToLatLng(U(p),b)},layerPointToLatLng:function(p){var b=U(p).add(this.getPixelOrigin());return this.unproject(b)},latLngToLayerPoint:function(p){var b=this.project(le(p))._round();return b._subtract(this.getPixelOrigin())},wrapLatLng:function(p){return this.options.crs.wrapLatLng(le(p))},wrapLatLngBounds:function(p){return this.options.crs.wrapLatLngBounds(ie(p))},distance:function(p,b){return this.options.crs.distance(le(p),le(b))},containerPointToLayerPoint:function(p){return U(p).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(p){return U(p).add(this._getMapPanePos())},containerPointToLatLng:function(p){var b=this.containerPointToLayerPoint(U(p));return this.layerPointToLatLng(b)},latLngToContainerPoint:function(p){return this.layerPointToContainerPoint(this.latLngToLayerPoint(le(p)))},mouseEventToContainerPoint:function(p){return jL(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 b=this._container=PL(p);if(b){if(b._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");nt(b,"scroll",this._onScroll,this),this._containerId=l(b)},_initLayout:function(){var p=this._container;this._fadeAnimated=this.options.fadeAnimation&&Be.any3d,at(p,"leaflet-container"+(Be.touch?" leaflet-touch":"")+(Be.retina?" leaflet-retina":"")+(Be.ielt9?" leaflet-oldie":"")+(Be.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var b=Bf(p,"position");b!=="absolute"&&b!=="relative"&&b!=="fixed"&&b!=="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),mr(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||(at(p.markerPane,"leaflet-zoom-hide"),at(p.shadowPane,"leaflet-zoom-hide"))},_resetView:function(p,b,C){mr(this._mapPane,new z(0,0));var k=!this._loaded;this._loaded=!0,b=this._limitZoom(b),this.fire("viewprereset");var E=this._zoom!==b;this._moveStart(E,C)._move(p,b)._moveEnd(E),this.fire("viewreset"),k&&this.fire("load")},_moveStart:function(p,b){return p&&this.fire("zoomstart"),b||this.fire("movestart"),this},_move:function(p,b,C,k){b===void 0&&(b=this._zoom);var E=this._zoom!==b;return this._zoom=b,this._lastCenter=p,this._pixelOrigin=this._getNewPixelOrigin(p),k?C&&C.pinch&&this.fire("zoom",C):((E||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 O(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(p){mr(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 b=p?Rt:nt;b(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&b(window,"resize",this._onResize,this),Be.any3d&&this.options.transform3DLimit&&(p?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){O(this._resizeRequest),this._resizeRequest=D(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,b){for(var C=[],k,E=b==="mouseout"||b==="mouseover",B=p.target||p.srcElement,X=!1;B;){if(k=this._targets[l(B)],k&&(b==="click"||b==="preclick")&&this._draggableMoved(k)){X=!0;break}if(k&&k.listens(b,!0)&&(E&&!s1(B,p)||(C.push(k),E))||B===this._container)break;B=B.parentNode}return!C.length&&!X&&!E&&this.listens(b,!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 b=p.target||p.srcElement;if(!(!this._loaded||b._leaflet_disable_events||p.type==="click"&&this._isClickDisabled(b))){var C=p.type;C==="mousedown"&&t1(b),this._fireDOMEvent(p,C)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(p,b,C){if(p.type==="click"){var k=i({},p);k.type="preclick",this._fireDOMEvent(k,k.type,C)}var E=this._findEventTargets(p,b);if(C){for(var B=[],X=0;X0?Math.round(p-b)/2:Math.max(0,Math.ceil(p))-Math.max(0,Math.floor(b))},_limitZoom:function(p){var b=this.getMinZoom(),C=this.getMaxZoom(),k=Be.any3d?this.options.zoomSnap:1;return k&&(p=Math.round(p/k)*k),Math.max(b,Math.min(C,p))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){cr(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(p,b){var C=this._getCenterOffset(p)._trunc();return(b&&b.animate)!==!0&&!this.getSize().contains(C)?!1:(this.panBy(C,b),!0)},_createAnimProxy:function(){var p=this._proxy=St("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(p),this.on("zoomanim",function(b){var C=Yx,k=this._proxy.style[C];ml(this._proxy,this.project(b.center,b.zoom),this.getZoomScale(b.zoom,1)),k===this._proxy.style[C]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Zt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var p=this.getCenter(),b=this.getZoom();ml(this._proxy,this.project(p,b),this.getZoomScale(b,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,b,C){if(this._animatingZoom)return!0;if(C=C||{},!this._zoomAnimated||C.animate===!1||this._nothingToAnimate()||Math.abs(b-this._zoom)>this.options.zoomAnimationThreshold)return!1;var k=this.getZoomScale(b),E=this._getCenterOffset(p)._divideBy(1-1/k);return C.animate!==!0&&!this.getSize().contains(E)?!1:(D(function(){this._moveStart(!0,C.noMoveStart||!1)._animateZoom(p,b,!0)},this),!0)},_animateZoom:function(p,b,C,k){this._mapPane&&(C&&(this._animatingZoom=!0,this._animateToCenter=p,this._animateToZoom=b,at(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:p,zoom:b,noUpdate:k}),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&&cr(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 hU(p,b){return new mt(p,b)}var Wi=F.extend({options:{position:"topright"},initialize:function(p){m(this,p)},getPosition:function(){return this.options.position},setPosition:function(p){var b=this._map;return b&&b.removeControl(this),this.options.position=p,b&&b.addControl(this),this},getContainer:function(){return this._container},addTo:function(p){this.remove(),this._map=p;var b=this._container=this.onAdd(p),C=this.getPosition(),k=p._controlCorners[C];return at(b,"leaflet-control"),C.indexOf("bottom")!==-1?k.insertBefore(b,k.firstChild):k.appendChild(b),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Zt(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()}}),Hf=function(p){return new Wi(p)};mt.include({addControl:function(p){return p.addTo(this),this},removeControl:function(p){return p.remove(),this},_initControlPos:function(){var p=this._controlCorners={},b="leaflet-",C=this._controlContainer=St("div",b+"control-container",this._container);function k(E,B){var X=b+E+" "+b+B;p[E+B]=St("div",X,C)}k("top","left"),k("top","right"),k("bottom","left"),k("bottom","right")},_clearControlPos:function(){for(var p in this._controlCorners)Zt(this._controlCorners[p]);Zt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var zL=Wi.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(p,b,C,k){return C1,this._baseLayersList.style.display=p?"":"none"),this._separator.style.display=b&&p?"":"none",this},_onLayerChange:function(p){this._handlingClick||this._update();var b=this._getLayer(l(p.target)),C=b.overlay?p.type==="add"?"overlayadd":"overlayremove":p.type==="add"?"baselayerchange":null;C&&this._map.fire(C,b)},_createRadioElement:function(p,b){var C='",k=document.createElement("div");return k.innerHTML=C,k.firstChild},_addItem:function(p){var b=document.createElement("label"),C=this._map.hasLayer(p.layer),k;p.overlay?(k=document.createElement("input"),k.type="checkbox",k.className="leaflet-control-layers-selector",k.defaultChecked=C):k=this._createRadioElement("leaflet-base-layers_"+l(this),C),this._layerControlInputs.push(k),k.layerId=l(p.layer),nt(k,"click",this._onInputClick,this);var E=document.createElement("span");E.innerHTML=" "+p.name;var B=document.createElement("span");b.appendChild(B),B.appendChild(k),B.appendChild(E);var X=p.overlay?this._overlaysList:this._baseLayersList;return X.appendChild(b),this._checkDisabledLayers(),b},_onInputClick:function(){if(!this._preventClick){var p=this._layerControlInputs,b,C,k=[],E=[];this._handlingClick=!0;for(var B=p.length-1;B>=0;B--)b=p[B],C=this._getLayer(b.layerId).layer,b.checked?k.push(C):b.checked||E.push(C);for(B=0;B=0;E--)b=p[E],C=this._getLayer(b.layerId).layer,b.disabled=C.options.minZoom!==void 0&&kC.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var p=this._section;this._preventClick=!0,nt(p,"click",Hr),this.expand();var b=this;setTimeout(function(){Rt(p,"click",Hr),b._preventClick=!1})}}),fU=function(p,b,C){return new zL(p,b,C)},l1=Wi.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(p){var b="leaflet-control-zoom",C=St("div",b+" leaflet-bar"),k=this.options;return this._zoomInButton=this._createButton(k.zoomInText,k.zoomInTitle,b+"-in",C,this._zoomIn),this._zoomOutButton=this._createButton(k.zoomOutText,k.zoomOutTitle,b+"-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,b,C,k,E){var B=St("a",C,k);return B.innerHTML=p,B.href="#",B.title=b,B.setAttribute("role","button"),B.setAttribute("aria-label",b),Wf(B),nt(B,"click",xl),nt(B,"click",E,this),nt(B,"click",this._refocusOnMap,this),B},_updateDisabled:function(){var p=this._map,b="leaflet-disabled";cr(this._zoomInButton,b),cr(this._zoomOutButton,b),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||p._zoom===p.getMinZoom())&&(at(this._zoomOutButton,b),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||p._zoom===p.getMaxZoom())&&(at(this._zoomInButton,b),this._zoomInButton.setAttribute("aria-disabled","true"))}});mt.mergeOptions({zoomControl:!0}),mt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new l1,this.addControl(this.zoomControl))});var dU=function(p){return new l1(p)},BL=Wi.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(p){var b="leaflet-control-scale",C=St("div",b),k=this.options;return this._addScales(k,b+"-line",C),p.on(k.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,b,C){p.metric&&(this._mScale=St("div",b,C)),p.imperial&&(this._iScale=St("div",b,C))},_update:function(){var p=this._map,b=p.getSize().y/2,C=p.distance(p.containerPointToLatLng([0,b]),p.containerPointToLatLng([this.options.maxWidth,b]));this._updateScales(C)},_updateScales:function(p){this.options.metric&&p&&this._updateMetric(p),this.options.imperial&&p&&this._updateImperial(p)},_updateMetric:function(p){var b=this._getRoundNum(p),C=b<1e3?b+" m":b/1e3+" km";this._updateScale(this._mScale,C,b/p)},_updateImperial:function(p){var b=p*3.2808399,C,k,E;b>5280?(C=b/5280,k=this._getRoundNum(C),this._updateScale(this._iScale,k+" mi",k/C)):(E=this._getRoundNum(b),this._updateScale(this._iScale,E+" ft",E/b))},_updateScale:function(p,b,C){p.style.width=Math.round(this.options.maxWidth*C)+"px",p.innerHTML=b},_getRoundNum:function(p){var b=Math.pow(10,(Math.floor(p)+"").length-1),C=p/b;return C=C>=10?10:C>=5?5:C>=3?3:C>=2?2:1,b*C}}),vU=function(p){return new BL(p)},pU='',u1=Wi.extend({options:{position:"bottomright",prefix:''+(Be.inlineSvg?pU+" ":"")+"Leaflet"},initialize:function(p){m(this,p),this._attributions={}},onAdd:function(p){p.attributionControl=this,this._container=St("div","leaflet-control-attribution"),Wf(this._container);for(var b in p._layers)p._layers[b].getAttribution&&this.addAttribution(p._layers[b].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 b in this._attributions)this._attributions[b]&&p.push(b);var C=[];this.options.prefix&&C.push(this.options.prefix),p.length&&C.push(p.join(", ")),this._container.innerHTML=C.join(' ')}}});mt.mergeOptions({attributionControl:!0}),mt.addInitHook(function(){this.options.attributionControl&&new u1().addTo(this)});var gU=function(p){return new u1(p)};Wi.Layers=zL,Wi.Zoom=l1,Wi.Scale=BL,Wi.Attribution=u1,Hf.layers=fU,Hf.zoom=dU,Hf.scale=vU,Hf.attribution=gU;var ma=F.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}});ma.addTo=function(p,b){return p.addHandler(b,this),this};var mU={Events:W},FL=Be.touch?"touchstart mousedown":"mousedown",es=V.extend({options:{clickTolerance:3},initialize:function(p,b,C,k){m(this,k),this._element=p,this._dragStartTarget=b||p,this._preventOutline=C},enable:function(){this._enabled||(nt(this._dragStartTarget,FL,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(es._dragging===this&&this.finishDrag(!0),Rt(this._dragStartTarget,FL,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(p){if(this._enabled&&(this._moved=!1,!Xx(this._element,"leaflet-zoom-anim"))){if(p.touches&&p.touches.length!==1){es._dragging===this&&this.finishDrag();return}if(!(es._dragging||p.shiftKey||p.which!==1&&p.button!==1&&!p.touches)&&(es._dragging=this,this._preventOutline&&t1(this._element),Jx(),Ff(),!this._moving)){this.fire("down");var b=p.touches?p.touches[0]:p,C=IL(this._element);this._startPoint=new z(b.clientX,b.clientY),this._startPos=yl(this._element),this._parentScale=r1(C);var k=p.type==="mousedown";nt(document,k?"mousemove":"touchmove",this._onMove,this),nt(document,k?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(p){if(this._enabled){if(p.touches&&p.touches.length>1){this._moved=!0;return}var b=p.touches&&p.touches.length===1?p.touches[0]:p,C=new z(b.clientX,b.clientY)._subtract(this._startPoint);!C.x&&!C.y||Math.abs(C.x)+Math.abs(C.y)B&&(X=J,B=ne);B>C&&(b[X]=1,h1(p,b,C,k,X),h1(p,b,C,X,E))}function bU(p,b){for(var C=[p[0]],k=1,E=0,B=p.length;kb&&(C.push(p[k]),E=k);return Eb.max.x&&(C|=2),p.yb.max.y&&(C|=8),C}function wU(p,b){var C=b.x-p.x,k=b.y-p.y;return C*C+k*k}function Uf(p,b,C,k){var E=b.x,B=b.y,X=C.x-E,J=C.y-B,ne=X*X+J*J,ue;return ne>0&&(ue=((p.x-E)*X+(p.y-B)*J)/ne,ue>1?(E=C.x,B=C.y):ue>0&&(E+=X*ue,B+=J*ue)),X=p.x-E,J=p.y-B,k?X*X+J*J:new z(E,B)}function hi(p){return!w(p[0])||typeof p[0][0]!="object"&&typeof p[0][0]<"u"}function $L(p){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),hi(p)}function YL(p,b){var C,k,E,B,X,J,ne,ue;if(!p||p.length===0)throw new Error("latlngs not passed");hi(p)||(console.warn("latlngs are not flat! Only the first ring will be used"),p=p[0]);var Ie=le([0,0]),Xe=ie(p),ut=Xe.getNorthWest().distanceTo(Xe.getSouthWest())*Xe.getNorthEast().distanceTo(Xe.getNorthWest());ut<1700&&(Ie=c1(p));var pn=p.length,jr=[];for(C=0;Ck){ne=(B-k)/E,ue=[J.x-ne*(J.x-X.x),J.y-ne*(J.y-X.y)];break}var An=b.unproject(U(ue));return le([An.lat+Ie.lat,An.lng+Ie.lng])}var SU={__proto__:null,simplify:WL,pointToSegmentDistance:HL,closestPointOnSegment:_U,clipSegment:ZL,_getEdgeIntersection:_g,_getBitCode:bl,_sqClosestPointOnSegment:Uf,isFlat:hi,_flat:$L,polylineCenter:YL},f1={project:function(p){return new z(p.lng,p.lat)},unproject:function(p){return new se(p.y,p.x)},bounds:new $([-180,-90],[180,90])},d1={R:6378137,R_MINOR:6356752314245179e-9,bounds:new $([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(p){var b=Math.PI/180,C=this.R,k=p.lat*b,E=this.R_MINOR/C,B=Math.sqrt(1-E*E),X=B*Math.sin(k),J=Math.tan(Math.PI/4-k/2)/Math.pow((1-X)/(1+X),B/2);return k=-C*Math.log(Math.max(J,1e-10)),new z(p.lng*b*C,k)},unproject:function(p){for(var b=180/Math.PI,C=this.R,k=this.R_MINOR/C,E=Math.sqrt(1-k*k),B=Math.exp(-p.y/C),X=Math.PI/2-2*Math.atan(B),J=0,ne=.1,ue;J<15&&Math.abs(ne)>1e-7;J++)ue=E*Math.sin(X),ue=Math.pow((1-ue)/(1+ue),E/2),ne=Math.PI/2-2*Math.atan(B*ue)-X,X+=ne;return new se(X*b,p.x*b/C)}},CU={__proto__:null,LonLat:f1,Mercator:d1,SphericalMercator:Me},TU=i({},me,{code:"EPSG:3395",projection:d1,transformation:function(){var p=.5/(Math.PI*d1.R);return Te(p,.5,-p,.5)}()}),XL=i({},me,{code:"EPSG:4326",projection:f1,transformation:Te(1/180,1,-1/180,.5)}),MU=i({},Ee,{projection:f1,transformation:Te(1,0,-1,0),scale:function(p){return Math.pow(2,p)},zoom:function(p){return Math.log(p)/Math.LN2},distance:function(p,b){var C=b.lng-p.lng,k=b.lat-p.lat;return Math.sqrt(C*C+k*k)},infinite:!0});Ee.Earth=me,Ee.EPSG3395=TU,Ee.EPSG3857=st,Ee.EPSG900913=ze,Ee.EPSG4326=XL,Ee.Simple=MU;var Hi=V.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 b=p.target;if(b.hasLayer(this)){if(this._map=b,this._zoomAnimated=b._zoomAnimated,this.getEvents){var C=this.getEvents();b.on(C,this),this.once("remove",function(){b.off(C,this)},this)}this.onAdd(b),this.fire("add"),b.fire("layeradd",{layer:this})}}});mt.include({addLayer:function(p){if(!p._layerAdd)throw new Error("The provided object is not a Layer.");var b=l(p);return this._layers[b]?this:(this._layers[b]=p,p._mapToAdd=this,p.beforeAdd&&p.beforeAdd(this),this.whenReady(p._layerAdd,p),this)},removeLayer:function(p){var b=l(p);return this._layers[b]?(this._loaded&&p.onRemove(this),delete this._layers[b],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,b){for(var C in this._layers)p.call(b,this._layers[C]);return this},_addLayers:function(p){p=p?w(p)?p:[p]:[];for(var b=0,C=p.length;bthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&b[0]instanceof se&&b[0].equals(b[C-1])&&b.pop(),b},_setLatLngs:function(p){uo.prototype._setLatLngs.call(this,p),hi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return hi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var p=this._renderer._bounds,b=this.options.weight,C=new z(b,b);if(p=new $(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 k=0,E=this._rings.length,B;kp.y!=E.y>p.y&&p.x<(E.x-k.x)*(p.y-k.y)/(E.y-k.y)+k.x&&(b=!b);return b||uo.prototype._containsPoint.call(this,p,!0)}});function EU(p,b){return new hc(p,b)}var co=lo.extend({initialize:function(p,b){m(this,b),this._layers={},p&&this.addData(p)},addData:function(p){var b=w(p)?p:p.features,C,k,E;if(b){for(C=0,k=b.length;C0&&E.push(E[0].slice()),E}function fc(p,b){return p.feature?i({},p.feature,{geometry:b}):Tg(b)}function Tg(p){return p.type==="Feature"||p.type==="FeatureCollection"?p:{type:"Feature",properties:{},geometry:p}}var m1={toGeoJSON:function(p){return fc(this,{type:"Point",coordinates:g1(this.getLatLng(),p)})}};xg.include(m1),v1.include(m1),bg.include(m1),uo.include({toGeoJSON:function(p){var b=!hi(this._latlngs),C=Cg(this._latlngs,b?1:0,!1,p);return fc(this,{type:(b?"Multi":"")+"LineString",coordinates:C})}}),hc.include({toGeoJSON:function(p){var b=!hi(this._latlngs),C=b&&!hi(this._latlngs[0]),k=Cg(this._latlngs,C?2:b?1:0,!0,p);return b||(k=[k]),fc(this,{type:(C?"Multi":"")+"Polygon",coordinates:k})}}),uc.include({toMultiPoint:function(p){var b=[];return this.eachLayer(function(C){b.push(C.toGeoJSON(p).geometry.coordinates)}),fc(this,{type:"MultiPoint",coordinates:b})},toGeoJSON:function(p){var b=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(b==="MultiPoint")return this.toMultiPoint(p);var C=b==="GeometryCollection",k=[];return this.eachLayer(function(E){if(E.toGeoJSON){var B=E.toGeoJSON(p);if(C)k.push(B.geometry);else{var X=Tg(B);X.type==="FeatureCollection"?k.push.apply(k,X.features):k.push(X)}}}),C?fc(this,{geometries:k,type:"GeometryCollection"}):{type:"FeatureCollection",features:k}}});function JL(p,b){return new co(p,b)}var jU=JL,Mg=Hi.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(p,b,C){this._url=p,this._bounds=ie(b),m(this,C)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(at(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Zt(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&&sc(this._image),this},bringToBack:function(){return this._map&&lc(this._image),this},setUrl:function(p){return this._url=p,this._image&&(this._image.src=p),this},setBounds:function(p){return this._bounds=ie(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",b=this._image=p?this._url:St("img");if(at(b,"leaflet-image-layer"),this._zoomAnimated&&at(b,"leaflet-zoom-animated"),this.options.className&&at(b,this.options.className),b.onselectstart=h,b.onmousemove=h,b.onload=o(this.fire,this,"load"),b.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(b.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),p){this._url=b.src;return}b.src=this._url,b.alt=this.options.alt},_animateZoom:function(p){var b=this._map.getZoomScale(p.zoom),C=this._map._latLngBoundsToNewLayerBounds(this._bounds,p.zoom,p.center).min;ml(this._image,C,b)},_reset:function(){var p=this._image,b=new $(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),C=b.getSize();mr(p,b.min),p.style.width=C.x+"px",p.style.height=C.y+"px"},_updateOpacity:function(){ci(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()}}),RU=function(p,b,C){return new Mg(p,b,C)},QL=Mg.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var p=this._url.tagName==="VIDEO",b=this._image=p?this._url:St("video");if(at(b,"leaflet-image-layer"),this._zoomAnimated&&at(b,"leaflet-zoom-animated"),this.options.className&&at(b,this.options.className),b.onselectstart=h,b.onmousemove=h,b.onloadeddata=o(this.fire,this,"load"),p){for(var C=b.getElementsByTagName("source"),k=[],E=0;E0?k:[b.src];return}w(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(b.style,"objectFit")&&(b.style.objectFit="fill"),b.autoplay=!!this.options.autoplay,b.loop=!!this.options.loop,b.muted=!!this.options.muted,b.playsInline=!!this.options.playsInline;for(var B=0;BE?(b.height=E+"px",at(p,B)):cr(p,B),this._containerWidth=this._container.offsetWidth},_animateZoom:function(p){var b=this._map._latLngToNewLayerPoint(this._latlng,p.zoom,p.center),C=this._getAnchor();mr(this._container,b.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,b=parseInt(Bf(this._container,"marginBottom"),10)||0,C=this._container.offsetHeight+b,k=this._containerWidth,E=new z(this._containerLeft,-C-this._containerBottom);E._add(yl(this._container));var B=p.layerPointToContainerPoint(E),X=U(this.options.autoPanPadding),J=U(this.options.autoPanPaddingTopLeft||X),ne=U(this.options.autoPanPaddingBottomRight||X),ue=p.getSize(),Ie=0,Xe=0;B.x+k+ne.x>ue.x&&(Ie=B.x+k-ue.x+ne.x),B.x-Ie-J.x<0&&(Ie=B.x-J.x),B.y+C+ne.y>ue.y&&(Xe=B.y+C-ue.y+ne.y),B.y-Xe-J.y<0&&(Xe=B.y-J.y),(Ie||Xe)&&(this.options.keepInView&&(this._autopanning=!0),p.fire("autopanstart").panBy([Ie,Xe]))}},_getAnchor:function(){return U(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),BU=function(p,b){return new Ag(p,b)};mt.mergeOptions({closePopupOnClick:!0}),mt.include({openPopup:function(p,b,C){return this._initOverlay(Ag,p,b,C).openOn(this),this},closePopup:function(p){return p=arguments.length?p:this._popup,p&&p.close(),this}}),Hi.include({bindPopup:function(p,b){return this._popup=this._initOverlay(Ag,this._popup,p,b),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 lo||(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)){xl(p);var b=p.layer||p.target;if(this._popup._source===b&&!(b instanceof ts)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(p.latlng);return}this._popup._source=b,this.openPopup(p.latlng)}},_movePopup:function(p){this._popup.setLatLng(p.latlng)},_onKeyPress:function(p){p.originalEvent.keyCode===13&&this._openPopup(p)}});var kg=ya.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(p){ya.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){ya.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=ya.prototype.getEvents.call(this);return this.options.permanent||(p.preclick=this.close),p},_initLayout:function(){var p="leaflet-tooltip",b=p+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=St("div",b),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+l(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(p){var b,C,k=this._map,E=this._container,B=k.latLngToContainerPoint(k.getCenter()),X=k.layerPointToContainerPoint(p),J=this.options.direction,ne=E.offsetWidth,ue=E.offsetHeight,Ie=U(this.options.offset),Xe=this._getAnchor();J==="top"?(b=ne/2,C=ue):J==="bottom"?(b=ne/2,C=0):J==="center"?(b=ne/2,C=ue/2):J==="right"?(b=0,C=ue/2):J==="left"?(b=ne,C=ue/2):X.xthis.options.maxZoom||Ck?this._retainParent(E,B,X,k):!1)},_retainChildren:function(p,b,C,k){for(var E=2*p;E<2*p+2;E++)for(var B=2*b;B<2*b+2;B++){var X=new z(E,B);X.z=C+1;var J=this._tileCoordsToKey(X),ne=this._tiles[J];if(ne&&ne.active){ne.retain=!0;continue}else ne&&ne.loaded&&(ne.retain=!0);C+1this.options.maxZoom||this.options.minZoom!==void 0&&E1){this._setView(p,C);return}for(var Xe=E.min.y;Xe<=E.max.y;Xe++)for(var ut=E.min.x;ut<=E.max.x;ut++){var pn=new z(ut,Xe);if(pn.z=this._tileZoom,!!this._isValidTile(pn)){var jr=this._tiles[this._tileCoordsToKey(pn)];jr?jr.current=!0:X.push(pn)}}if(X.sort(function(An,vc){return An.distanceTo(B)-vc.distanceTo(B)}),X.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var fi=document.createDocumentFragment();for(ut=0;utC.max.x)||!b.wrapLat&&(p.yC.max.y))return!1}if(!this.options.bounds)return!0;var k=this._tileCoordsToBounds(p);return ie(this.options.bounds).overlaps(k)},_keyToBounds:function(p){return this._tileCoordsToBounds(this._keyToTileCoords(p))},_tileCoordsToNwSe:function(p){var b=this._map,C=this.getTileSize(),k=p.scaleBy(C),E=k.add(C),B=b.unproject(k,p.z),X=b.unproject(E,p.z);return[B,X]},_tileCoordsToBounds:function(p){var b=this._tileCoordsToNwSe(p),C=new te(b[0],b[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 b=p.split(":"),C=new z(+b[0],+b[1]);return C.z=+b[2],C},_removeTile:function(p){var b=this._tiles[p];b&&(Zt(b.el),delete this._tiles[p],this.fire("tileunload",{tile:b.el,coords:this._keyToTileCoords(p)}))},_initTile:function(p){at(p,"leaflet-tile");var b=this.getTileSize();p.style.width=b.x+"px",p.style.height=b.y+"px",p.onselectstart=h,p.onmousemove=h,Be.ielt9&&this.options.opacity<1&&ci(p,this.options.opacity)},_addTile:function(p,b){var C=this._getTilePos(p),k=this._tileCoordsToKey(p),E=this.createTile(this._wrapCoords(p),o(this._tileReady,this,p));this._initTile(E),this.createTile.length<2&&D(o(this._tileReady,this,p,null,E)),mr(E,C),this._tiles[k]={el:E,coords:p,current:!0},b.appendChild(E),this.fire("tileloadstart",{tile:E,coords:p})},_tileReady:function(p,b,C){b&&this.fire("tileerror",{error:b,tile:C,coords:p});var k=this._tileCoordsToKey(p);C=this._tiles[k],C&&(C.loaded=+new Date,this._map._fadeAnimated?(ci(C.el,0),O(this._fadeFrame),this._fadeFrame=D(this._updateOpacity,this)):(C.active=!0,this._pruneTiles()),b||(at(C.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:C.el,coords:p})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Be.ielt9||!this._map._fadeAnimated?D(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 b=new z(this._wrapX?c(p.x,this._wrapX):p.x,this._wrapY?c(p.y,this._wrapY):p.y);return b.z=p.z,b},_pxBoundsToTileRange:function(p){var b=this.getTileSize();return new $(p.min.unscaleBy(b).floor(),p.max.unscaleBy(b).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var p in this._tiles)if(!this._tiles[p].loaded)return!1;return!0}});function GU(p){return new $f(p)}var dc=$f.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(p,b){this._url=p,b=m(this,b),b.detectRetina&&Be.retina&&b.maxZoom>0?(b.tileSize=Math.floor(b.tileSize/2),b.zoomReverse?(b.zoomOffset--,b.minZoom=Math.min(b.maxZoom,b.minZoom+1)):(b.zoomOffset++,b.maxZoom=Math.max(b.minZoom,b.maxZoom-1)),b.minZoom=Math.max(0,b.minZoom)):b.zoomReverse?b.minZoom=Math.min(b.maxZoom,b.minZoom):b.maxZoom=Math.max(b.minZoom,b.maxZoom),typeof b.subdomains=="string"&&(b.subdomains=b.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(p,b){return this._url===p&&b===void 0&&(b=!0),this._url=p,b||this.redraw(),this},createTile:function(p,b){var C=document.createElement("img");return nt(C,"load",o(this._tileOnLoad,this,b,C)),nt(C,"error",o(this._tileOnError,this,b,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 b={r:Be.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&&(b.y=C),b["-y"]=C}return x(this._url,i(b,this.options))},_tileOnLoad:function(p,b){Be.ielt9?setTimeout(o(p,this,null,b),0):p(null,b)},_tileOnError:function(p,b,C){var k=this.options.errorTileUrl;k&&b.getAttribute("src")!==k&&(b.src=k),p(C,b)},_onTileRemove:function(p){p.tile.onload=null},_getZoomForUrl:function(){var p=this._tileZoom,b=this.options.maxZoom,C=this.options.zoomReverse,k=this.options.zoomOffset;return C&&(p=b-p),p+k},_getSubdomain:function(p){var b=Math.abs(p.x+p.y)%this.options.subdomains.length;return this.options.subdomains[b]},_abortLoading:function(){var p,b;for(p in this._tiles)if(this._tiles[p].coords.z!==this._tileZoom&&(b=this._tiles[p].el,b.onload=h,b.onerror=h,!b.complete)){b.src=T;var C=this._tiles[p].coords;Zt(b),delete this._tiles[p],this.fire("tileabort",{tile:b,coords:C})}},_removeTile:function(p){var b=this._tiles[p];if(b)return b.el.setAttribute("src",T),$f.prototype._removeTile.call(this,p)},_tileReady:function(p,b,C){if(!(!this._map||C&&C.getAttribute("src")===T))return $f.prototype._tileReady.call(this,p,b,C)}});function rN(p,b){return new dc(p,b)}var nN=dc.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,b){this._url=p;var C=i({},this.defaultWmsParams);for(var k in b)k in this.options||(C[k]=b[k]);b=m(this,b);var E=b.detectRetina&&Be.retina?2:1,B=this.getTileSize();C.width=B.x*E,C.height=B.y*E,this.wmsParams=C},onAdd:function(p){this._crs=this.options.crs||p.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var b=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[b]=this._crs.code,dc.prototype.onAdd.call(this,p)},getTileUrl:function(p){var b=this._tileCoordsToNwSe(p),C=this._crs,k=Y(C.project(b[0]),C.project(b[1])),E=k.min,B=k.max,X=(this._wmsVersion>=1.3&&this._crs===XL?[E.y,E.x,B.y,B.x]:[E.x,E.y,B.x,B.y]).join(","),J=dc.prototype.getTileUrl.call(this,p);return J+y(this.wmsParams,J,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+X},setParams:function(p,b){return i(this.wmsParams,p),b||this.redraw(),this}});function WU(p,b){return new nN(p,b)}dc.WMS=nN,rN.wms=WU;var ho=Hi.extend({options:{padding:.1},initialize:function(p){m(this,p),l(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),at(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,b){var C=this._map.getZoomScale(b,this._zoom),k=this._map.getSize().multiplyBy(.5+this.options.padding),E=this._map.project(this._center,b),B=k.multiplyBy(-C).add(E).subtract(this._map._getNewPixelOrigin(p,b));Be.any3d?ml(this._container,B,C):mr(this._container,B)},_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,b=this._map.getSize(),C=this._map.containerPointToLayerPoint(b.multiplyBy(-p)).round();this._bounds=new $(C,C.add(b.multiplyBy(1+p*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),iN=ho.extend({options:{tolerance:0},getEvents:function(){var p=ho.prototype.getEvents.call(this);return p.viewprereset=this._onViewPreReset,p},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ho.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var p=this._container=document.createElement("canvas");nt(p,"mousemove",this._onMouseMove,this),nt(p,"click dblclick mousedown mouseup contextmenu",this._onClick,this),nt(p,"mouseout",this._handleMouseOut,this),p._leaflet_disable_events=!0,this._ctx=p.getContext("2d")},_destroyContainer:function(){O(this._redrawRequest),delete this._ctx,Zt(this._container),Rt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var p;this._redrawBounds=null;for(var b in this._layers)p=this._layers[b],p._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ho.prototype._update.call(this);var p=this._bounds,b=this._container,C=p.getSize(),k=Be.retina?2:1;mr(b,p.min),b.width=k*C.x,b.height=k*C.y,b.style.width=C.x+"px",b.style.height=C.y+"px",Be.retina&&this._ctx.scale(2,2),this._ctx.translate(-p.min.x,-p.min.y),this.fire("update")}},_reset:function(){ho.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(p){this._updateDashArray(p),this._layers[l(p)]=p;var b=p._order={layer:p,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=b),this._drawLast=b,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(p){this._requestRedraw(p)},_removePath:function(p){var b=p._order,C=b.next,k=b.prev;C?C.prev=k:this._drawLast=k,k?k.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 b=p.options.dashArray.split(/[, ]+/),C=[],k,E;for(E=0;E')}}catch{}return function(p){return document.createElement("<"+p+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),HU={_initContainer:function(){this._container=St("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ho.prototype._update.call(this),this.fire("update"))},_initPath:function(p){var b=p._container=Yf("shape");at(b,"leaflet-vml-shape "+(this.options.className||"")),b.coordsize="1 1",p._path=Yf("path"),b.appendChild(p._path),this._updateStyle(p),this._layers[l(p)]=p},_addPath:function(p){var b=p._container;this._container.appendChild(b),p.options.interactive&&p.addInteractiveTarget(b)},_removePath:function(p){var b=p._container;Zt(b),p.removeInteractiveTarget(b),delete this._layers[l(p)]},_updateStyle:function(p){var b=p._stroke,C=p._fill,k=p.options,E=p._container;E.stroked=!!k.stroke,E.filled=!!k.fill,k.stroke?(b||(b=p._stroke=Yf("stroke")),E.appendChild(b),b.weight=k.weight+"px",b.color=k.color,b.opacity=k.opacity,k.dashArray?b.dashStyle=w(k.dashArray)?k.dashArray.join(" "):k.dashArray.replace(/( *, *)/g," "):b.dashStyle="",b.endcap=k.lineCap.replace("butt","flat"),b.joinstyle=k.lineJoin):b&&(E.removeChild(b),p._stroke=null),k.fill?(C||(C=p._fill=Yf("fill")),E.appendChild(C),C.color=k.fillColor||k.color,C.opacity=k.fillOpacity):C&&(E.removeChild(C),p._fill=null)},_updateCircle:function(p){var b=p._point.round(),C=Math.round(p._radius),k=Math.round(p._radiusY||C);this._setPath(p,p._empty()?"M0 0":"AL "+b.x+","+b.y+" "+C+","+k+" 0,"+65535*360)},_setPath:function(p,b){p._path.v=b},_bringToFront:function(p){sc(p._container)},_bringToBack:function(p){lc(p._container)}},Lg=Be.vml?Yf:et,Xf=ho.extend({_initContainer:function(){this._container=Lg("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Lg("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Zt(this._container),Rt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ho.prototype._update.call(this);var p=this._bounds,b=p.getSize(),C=this._container;(!this._svgSize||!this._svgSize.equals(b))&&(this._svgSize=b,C.setAttribute("width",b.x),C.setAttribute("height",b.y)),mr(C,p.min),C.setAttribute("viewBox",[p.min.x,p.min.y,b.x,b.y].join(" ")),this.fire("update")}},_initPath:function(p){var b=p._path=Lg("path");p.options.className&&at(b,p.options.className),p.options.interactive&&at(b,"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){Zt(p._path),p.removeInteractiveTarget(p._path),delete this._layers[l(p)]},_updatePath:function(p){p._project(),p._update()},_updateStyle:function(p){var b=p._path,C=p.options;b&&(C.stroke?(b.setAttribute("stroke",C.color),b.setAttribute("stroke-opacity",C.opacity),b.setAttribute("stroke-width",C.weight),b.setAttribute("stroke-linecap",C.lineCap),b.setAttribute("stroke-linejoin",C.lineJoin),C.dashArray?b.setAttribute("stroke-dasharray",C.dashArray):b.removeAttribute("stroke-dasharray"),C.dashOffset?b.setAttribute("stroke-dashoffset",C.dashOffset):b.removeAttribute("stroke-dashoffset")):b.setAttribute("stroke","none"),C.fill?(b.setAttribute("fill",C.fillColor||C.color),b.setAttribute("fill-opacity",C.fillOpacity),b.setAttribute("fill-rule",C.fillRule||"evenodd")):b.setAttribute("fill","none"))},_updatePoly:function(p,b){this._setPath(p,lt(p._parts,b))},_updateCircle:function(p){var b=p._point,C=Math.max(Math.round(p._radius),1),k=Math.max(Math.round(p._radiusY),1)||C,E="a"+C+","+k+" 0 1,0 ",B=p._empty()?"M0 0":"M"+(b.x-C)+","+b.y+E+C*2+",0 "+E+-C*2+",0 ";this._setPath(p,B)},_setPath:function(p,b){p._path.setAttribute("d",b)},_bringToFront:function(p){sc(p._path)},_bringToBack:function(p){lc(p._path)}});Be.vml&&Xf.include(HU);function oN(p){return Be.svg||Be.vml?new Xf(p):null}mt.include({getRenderer:function(p){var b=p.options.renderer||this._getPaneRenderer(p.options.pane)||this.options.renderer||this._renderer;return b||(b=this._renderer=this._createRenderer()),this.hasLayer(b)||this.addLayer(b),b},_getPaneRenderer:function(p){if(p==="overlayPane"||p===void 0)return!1;var b=this._paneRenderers[p];return b===void 0&&(b=this._createRenderer({pane:p}),this._paneRenderers[p]=b),b},_createRenderer:function(p){return this.options.preferCanvas&&aN(p)||oN(p)}});var sN=hc.extend({initialize:function(p,b){hc.prototype.initialize.call(this,this._boundsToLatLngs(p),b)},setBounds:function(p){return this.setLatLngs(this._boundsToLatLngs(p))},_boundsToLatLngs:function(p){return p=ie(p),[p.getSouthWest(),p.getNorthWest(),p.getNorthEast(),p.getSouthEast()]}});function UU(p,b){return new sN(p,b)}Xf.create=Lg,Xf.pointsToPath=lt,co.geometryToLayer=wg,co.coordsToLatLng=p1,co.coordsToLatLngs=Sg,co.latLngToCoords=g1,co.latLngsToCoords=Cg,co.getFeature=fc,co.asFeature=Tg,mt.mergeOptions({boxZoom:!0});var lN=ma.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(){nt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Rt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Zt(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(),Ff(),Jx(),this._startPoint=this._map.mouseEventToContainerPoint(p),nt(document,{contextmenu:xl,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(p){this._moved||(this._moved=!0,this._box=St("div","leaflet-zoom-box",this._container),at(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(p);var b=new $(this._point,this._startPoint),C=b.getSize();mr(this._box,b.min),this._box.style.width=C.x+"px",this._box.style.height=C.y+"px"},_finish:function(){this._moved&&(Zt(this._box),cr(this._container,"leaflet-crosshair")),Vf(),Qx(),Rt(document,{contextmenu:xl,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 b=new te(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(b).fire("boxzoomend",{boxZoomBounds:b})}},_onKeyDown:function(p){p.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});mt.addInitHook("addHandler","boxZoom",lN),mt.mergeOptions({doubleClickZoom:!0});var uN=ma.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(p){var b=this._map,C=b.getZoom(),k=b.options.zoomDelta,E=p.originalEvent.shiftKey?C-k:C+k;b.options.doubleClickZoom==="center"?b.setZoom(E):b.setZoomAround(p.containerPoint,E)}});mt.addInitHook("addHandler","doubleClickZoom",uN),mt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var cN=ma.extend({addHooks:function(){if(!this._draggable){var p=this._map;this._draggable=new es(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))}at(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){cr(this._map._container,"leaflet-grab"),cr(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 b=ie(this._map.options.maxBounds);this._offsetLimit=Y(this._map.latLngToContainerPoint(b.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(b.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 b=this._lastTime=+new Date,C=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(C),this._times.push(b),this._prunePositions(b)}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),b=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=b.subtract(p).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(p,b){return p-(p-b)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var p=this._draggable._newPos.subtract(this._draggable._startPos),b=this._offsetLimit;p.xb.max.x&&(p.x=this._viscousLimit(p.x,b.max.x)),p.y>b.max.y&&(p.y=this._viscousLimit(p.y,b.max.y)),this._draggable._newPos=this._draggable._startPos.add(p)}},_onPreDragWrap:function(){var p=this._worldWidth,b=Math.round(p/2),C=this._initialWorldOffset,k=this._draggable._newPos.x,E=(k-b+C)%p+b-C,B=(k+b+C)%p-b-C,X=Math.abs(E+C)0?B:-B))-b;this._delta=0,this._startTime=null,X&&(p.options.scrollWheelZoom==="center"?p.setZoom(b+X):p.setZoomAround(this._lastMousePos,b+X))}});mt.addInitHook("addHandler","scrollWheelZoom",fN);var ZU=600;mt.mergeOptions({tapHold:Be.touchNative&&Be.safari&&Be.mobile,tapTolerance:15});var dN=ma.extend({addHooks:function(){nt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Rt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(p){if(clearTimeout(this._holdTimeout),p.touches.length===1){var b=p.touches[0];this._startPos=this._newPos=new z(b.clientX,b.clientY),this._holdTimeout=setTimeout(o(function(){this._cancel(),this._isTapValid()&&(nt(document,"touchend",Hr),nt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",b))},this),ZU),nt(document,"touchend touchcancel contextmenu",this._cancel,this),nt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function p(){Rt(document,"touchend",Hr),Rt(document,"touchend touchcancel",p)},_cancel:function(){clearTimeout(this._holdTimeout),Rt(document,"touchend touchcancel contextmenu",this._cancel,this),Rt(document,"touchmove",this._onMove,this)},_onMove:function(p){var b=p.touches[0];this._newPos=new z(b.clientX,b.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(p,b){var C=new MouseEvent(p,{bubbles:!0,cancelable:!0,view:window,screenX:b.screenX,screenY:b.screenY,clientX:b.clientX,clientY:b.clientY});C._simulated=!0,b.target.dispatchEvent(C)}});mt.addInitHook("addHandler","tapHold",dN),mt.mergeOptions({touchZoom:Be.touch,bounceAtZoomLimits:!0});var vN=ma.extend({addHooks:function(){at(this._map._container,"leaflet-touch-zoom"),nt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){cr(this._map._container,"leaflet-touch-zoom"),Rt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(p){var b=this._map;if(!(!p.touches||p.touches.length!==2||b._animatingZoom||this._zooming)){var C=b.mouseEventToContainerPoint(p.touches[0]),k=b.mouseEventToContainerPoint(p.touches[1]);this._centerPoint=b.getSize()._divideBy(2),this._startLatLng=b.containerPointToLatLng(this._centerPoint),b.options.touchZoom!=="center"&&(this._pinchStartLatLng=b.containerPointToLatLng(C.add(k)._divideBy(2))),this._startDist=C.distanceTo(k),this._startZoom=b.getZoom(),this._moved=!1,this._zooming=!0,b._stop(),nt(document,"touchmove",this._onTouchMove,this),nt(document,"touchend touchcancel",this._onTouchEnd,this),Hr(p)}},_onTouchMove:function(p){if(!(!p.touches||p.touches.length!==2||!this._zooming)){var b=this._map,C=b.mouseEventToContainerPoint(p.touches[0]),k=b.mouseEventToContainerPoint(p.touches[1]),E=C.distanceTo(k)/this._startDist;if(this._zoom=b.getScaleZoom(E,this._startZoom),!b.options.bounceAtZoomLimits&&(this._zoomb.getMaxZoom()&&E>1)&&(this._zoom=b._limitZoom(this._zoom)),b.options.touchZoom==="center"){if(this._center=this._startLatLng,E===1)return}else{var B=C._add(k)._divideBy(2)._subtract(this._centerPoint);if(E===1&&B.x===0&&B.y===0)return;this._center=b.unproject(b.project(this._pinchStartLatLng,this._zoom).subtract(B),this._zoom)}this._moved||(b._moveStart(!0,!1),this._moved=!0),O(this._animRequest);var X=o(b._move,b,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=D(X,this,!0),Hr(p)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,O(this._animRequest),Rt(document,"touchmove",this._onTouchMove,this),Rt(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))}});mt.addInitHook("addHandler","touchZoom",vN),mt.BoxZoom=lN,mt.DoubleClickZoom=uN,mt.Drag=cN,mt.Keyboard=hN,mt.ScrollWheelZoom=fN,mt.TapHold=dN,mt.TouchZoom=vN,r.Bounds=$,r.Browser=Be,r.CRS=Ee,r.Canvas=iN,r.Circle=v1,r.CircleMarker=bg,r.Class=F,r.Control=Wi,r.DivIcon=tN,r.DivOverlay=ya,r.DomEvent=cU,r.DomUtil=lU,r.Draggable=es,r.Evented=V,r.FeatureGroup=lo,r.GeoJSON=co,r.GridLayer=$f,r.Handler=ma,r.Icon=cc,r.ImageOverlay=Mg,r.LatLng=se,r.LatLngBounds=te,r.Layer=Hi,r.LayerGroup=uc,r.LineUtil=SU,r.Map=mt,r.Marker=xg,r.Mixin=mU,r.Path=ts,r.Point=z,r.PolyUtil=yU,r.Polygon=hc,r.Polyline=uo,r.Popup=Ag,r.PosAnimation=OL,r.Projection=CU,r.Rectangle=sN,r.Renderer=ho,r.SVG=Xf,r.SVGOverlay=eN,r.TileLayer=dc,r.Tooltip=kg,r.Transformation=pe,r.Util=R,r.VideoOverlay=QL,r.bind=o,r.bounds=Y,r.canvas=aN,r.circle=IU,r.circleMarker=PU,r.control=Hf,r.divIcon=VU,r.extend=i,r.featureGroup=kU,r.geoJSON=JL,r.geoJson=jU,r.gridLayer=GU,r.icon=LU,r.imageOverlay=RU,r.latLng=le,r.latLngBounds=ie,r.layerGroup=AU,r.map=hU,r.marker=NU,r.point=U,r.polygon=EU,r.polyline=DU,r.popup=BU,r.rectangle=UU,r.setOptions=m,r.stamp=l,r.svg=oN,r.svgOverlay=zU,r.tileLayer=rN,r.tooltip=FU,r.transformation=Te,r.version=n,r.videoOverlay=OU;var $U=window.L;r.noConflict=function(){return window.L=$U,this},window.L=r})})(E2,E2.exports);var ic=E2.exports;const YH=R2(ic);function rg(e,t,r){return Object.freeze({instance:e,context:t,container:r})}function AL(e,t){return t==null?function(n,i){const a=G.useRef();return a.current||(a.current=e(n,i)),a}:function(n,i){const a=G.useRef();a.current||(a.current=e(n,i));const o=G.useRef(n),{instance:s}=a.current;return G.useEffect(function(){o.current!==n&&(t(s,n,o.current),o.current=n)},[s,n,i]),a}}function XH(e,t){G.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 s0e(e){return function(r){const n=Ux(),i=e(Zx(r,n),n);return HH(n.map,r.attribution),ML(i.current,r.eventHandlers),XH(i.current,n),i}}function l0e(e,t){const r=G.useRef();G.useEffect(function(){if(t.pathOptions!==r.current){const i=t.pathOptions??{};e.instance.setStyle(i),r.current=i}},[e,t])}function u0e(e){return function(r){const n=Ux(),i=e(Zx(r,n),n);return ML(i.current,r.eventHandlers),XH(i.current,n),l0e(i.current,r),i}}function qH(e,t){const r=AL(e),n=o0e(r,t);return i0e(n)}function KH(e,t){const r=AL(e,t),n=u0e(r);return n0e(n)}function c0e(e,t){const r=AL(e,t),n=s0e(r);return a0e(n)}function h0e(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 f0e(){return Ux().map}const d0e=KH(function({center:t,children:r,...n},i){const a=new ic.CircleMarker(t,n);return rg(a,UH(i,{overlayContainer:a}))},e0e);function j2(){return j2=Object.assign||function(e){for(var t=1;t(d==null?void 0:d.map)??null,[d]);const m=G.useCallback(_=>{if(_!==null&&d===null){const x=new ic.Map(_,c);r!=null&&u!=null?x.setView(r,u):e!=null&&x.fitBounds(e,t),l!=null&&x.whenReady(l),g(r0e(x))}},[]);G.useEffect(()=>()=>{d==null||d.map.remove()},[d]);const y=d?Ch.createElement($H,{value:d},n):o??null;return Ch.createElement("div",j2({},f,{ref:m}),y)}const p0e=G.forwardRef(v0e),g0e=KH(function({positions:t,...r},n){const i=new ic.Polyline(t,r);return rg(i,UH(n,{overlayContainer:i}))},function(t,r,n){r.positions!==n.positions&&t.setLatLngs(r.positions)}),m0e=qH(function(t,r){const n=new ic.Popup(t,r.overlayContainer);return rg(n,r)},function(t,r,{position:n},i){G.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])}),y0e=c0e(function({url:t,...r},n){const i=new ic.TileLayer(t,Zx(r,n));return rg(i,n)},function(t,r,n){h0e(t,r,n);const{url:i}=r;i!=null&&i!==n.url&&t.setUrl(i)}),_0e=qH(function(t,r){const n=new ic.Tooltip(t,r.overlayContainer);return rg(n,r)},function(t,r,{position:n},i){G.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])}),x0e="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=",b0e="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==",w0e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC";delete YH.Icon.Default.prototype._getIconUrl;YH.Icon.Default.mergeOptions({iconUrl:x0e,iconRetinaUrl:b0e,shadowUrl:w0e});const w3=["#3b82f6","#a78bfa","#06b6d4","#f59e0b","#22c55e","#ec4899","#8b5cf6","#14b8a6"],S0e=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function C0e(e){return e>12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function T0e(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function M0e(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 A0e({bounds:e}){const t=f0e();return G.useEffect(()=>{e&&t.fitBounds(e,{padding:[50,50]})},[t,e]),null}function k0e({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 v.jsxs("div",{className:"min-w-[200px]",children:[v.jsx("div",{className:"font-semibold text-slate-800",children:e.short_name}),v.jsx("div",{className:"text-xs text-slate-600 mb-2",children:e.long_name}),v.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-xs",children:[v.jsx("div",{className:"text-slate-500",children:"Role"}),v.jsx("div",{className:"text-slate-700 font-medium",children:e.role}),v.jsx("div",{className:"text-slate-500",children:"Hardware"}),v.jsx("div",{className:"text-slate-700",children:e.hardware||"Unknown"}),v.jsx("div",{className:"text-slate-500",children:"Battery"}),v.jsx("div",{className:"text-slate-700",children:r}),v.jsx("div",{className:"text-slate-500",children:"Last Heard"}),v.jsx("div",{className:"text-slate-700",children:M0e(e.last_heard)})]}),t&&v.jsxs("div",{className:"mt-3 pt-2 border-t border-slate-200 flex gap-2",children:[v.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:[v.jsx(Ih,{size:10}),"Google Maps"]}),v.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:[v.jsx(Ih,{size:10}),"OSM"]})]})]})}function L0e({nodes:e,edges:t,selectedNodeId:r,onSelectNode:n}){const i=G.useMemo(()=>e.filter(h=>h.latitude!==null&&h.longitude!==null),[e]),a=e.length-i.length,o=G.useMemo(()=>new Map(i.map(h=>[h.node_num,h])),[i]),s=G.useMemo(()=>t.filter(h=>o.has(h.from_node)&&o.has(h.to_node)),[t,o]),l=G.useMemo(()=>{if(i.length===0)return null;const h=i.map(d=>d.latitude),f=i.map(d=>d.longitude);return[[Math.min(...h),Math.min(...f)],[Math.max(...h),Math.max(...f)]]},[i]),u=[43.6,-114.4],c=G.useMemo(()=>{const h=new Set;return r!==null&&t.forEach(f=>{f.from_node===r&&h.add(f.to_node),f.to_node===r&&h.add(f.from_node)}),h},[r,t]);return v.jsxs("div",{className:"relative bg-bg-card rounded-lg border border-border overflow-hidden",children:[v.jsxs(p0e,{center:u,zoom:7,style:{width:"100%",height:"540px"},className:"z-0",children:[v.jsx(y0e,{url:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",attribution:'ยฉ OpenStreetMap, ยฉ CARTO'}),v.jsx(A0e,{bounds:l}),s.map((h,f)=>{const d=o.get(h.from_node),g=o.get(h.to_node),m=r===null||h.from_node===r||h.to_node===r;return v.jsx(g0e,{positions:[[d.latitude,d.longitude],[g.latitude,g.longitude]],color:C0e(h.snr),weight:m&&r!==null?2.5:1.5,opacity:r===null?.3:m?.6:.08},f)}),i.map(h=>{const f=h.node_num===r,d=c.has(h.node_num),g=r===null||f||d,m=S0e.includes(h.role),y=T0e(h.latitude),_=w3[y%w3.length];return v.jsxs(d0e,{center:[h.latitude,h.longitude],radius:m?8:5,fillColor:m?_:"#111827",fillOpacity:g?.9:.2,stroke:!0,color:f?"#ffffff":_,weight:f?3:m?0:2,opacity:g?1:.3,eventHandlers:{click:()=>n(f?null:h.node_num)},children:[v.jsx(_0e,{direction:"top",offset:[0,-8],children:v.jsx("span",{className:"font-mono text-xs",children:h.short_name})}),v.jsx(m0e,{children:v.jsx(k0e,{node:h})})]},h.node_num)})]}),v.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:[v.jsx(nf,{size:12}),v.jsxs("span",{children:["Showing ",i.length," of ",e.length," nodes",a>0&&v.jsxs("span",{className:"text-slate-500",children:[" (",a," without coordinates)"]})]})]})]})}const S3=["#3b82f6","#a78bfa","#06b6d4","#f59e0b","#22c55e","#ec4899","#8b5cf6","#14b8a6"],N0e=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function C3(e){return e>12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function P0e(e){return e>12?"excellent":e>8?"good":e>5?"fair":e>3?"marginal":"poor"}function I0e(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function D0e(e){return["Northern ID","Central ID","SW Idaho","SC Idaho"][e]||"Unknown"}function E0e(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 j0e(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 R0e({node:e,edges:t,nodes:r,onSelectNode:n}){const i=G.useMemo(()=>{if(!e)return[];const h=new Map(r.map(d=>[d.node_num,d])),f=[];return t.forEach(d=>{if(d.from_node===e.node_num){const g=h.get(d.to_node);g&&f.push({node:g,snr:d.snr,quality:d.quality})}else if(d.to_node===e.node_num){const g=h.get(d.from_node);g&&f.push({node:g,snr:d.snr,quality:d.quality})}}),f.sort((d,g)=>g.snr-d.snr)},[e,t,r]);if(!e)return v.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:[v.jsx("div",{className:"w-12 h-12 rounded-full bg-bg-hover border border-border flex items-center justify-center mb-3",children:v.jsx(Di,{size:24,className:"text-slate-500"})}),v.jsx("p",{className:"text-sm text-slate-500 text-center",children:"Click a node to inspect"})]});const a=N0e.includes(e.role),o=I0e(e.latitude),s=S3[o%S3.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 v.jsxs("div",{className:"w-[250px] flex-shrink-0 bg-bg-card border-l border-border flex flex-col h-[540px] overflow-hidden",children:[v.jsxs("div",{className:"p-4 border-b border-border",children:[v.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}),v.jsx("div",{className:"font-mono text-lg text-slate-100",children:e.short_name}),v.jsx("div",{className:"text-xs text-slate-500 truncate",children:e.long_name})]}),v.jsxs("div",{className:"p-4 border-b border-border grid grid-cols-2 gap-3",children:[v.jsxs("div",{children:[v.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Role"}),v.jsx("div",{className:`text-sm font-medium ${a?"text-cyan-400":"text-slate-300"}`,children:e.role})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Region"}),v.jsx("div",{className:"text-sm text-slate-300",children:D0e(o)})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Battery"}),v.jsxs("div",{className:"text-sm text-slate-300 flex items-center gap-1",children:[c&&v.jsx(Dh,{size:12,className:"text-amber-400"}),u]})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Status"}),v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${j0e(e.last_heard)}`}),v.jsx("span",{className:"text-sm text-slate-300",children:E0e(e.last_heard)})]})]}),v.jsxs("div",{className:"col-span-2",children:[v.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Hardware"}),v.jsx("div",{className:"text-sm text-slate-300 font-mono truncate",children:e.hardware||"Unknown"})]})]}),l&&v.jsxs("div",{className:"px-4 py-3 border-b border-border flex gap-3",children:[v.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:[v.jsx(Ih,{size:10}),"Google Maps"]}),v.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:[v.jsx(Ih,{size:10}),"OSM"]})]}),v.jsxs("div",{className:"flex-1 overflow-y-auto",children:[v.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?v.jsx("div",{className:"divide-y divide-border",children:i.map(h=>v.jsxs("button",{onClick:()=>n(h.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:C3(h.snr)},children:[v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("div",{className:"text-sm text-slate-200 font-mono truncate",children:h.node.short_name}),v.jsx("div",{className:"text-xs text-slate-500 truncate",children:h.node.long_name})]}),v.jsxs("div",{className:"text-right flex-shrink-0",children:[v.jsxs("div",{className:"text-xs font-mono",style:{color:C3(h.snr)},children:[h.snr.toFixed(1)," dB"]}),v.jsx("div",{className:"text-xs text-slate-500",children:P0e(h.snr)})]})]},h.node.node_num))}):v.jsx("div",{className:"px-4 py-6 text-center text-sm text-slate-500",children:"No known neighbors"})]})]})}const T3=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function O0e(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 z0e(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 B0e(e){return e.battery_level===null?"โ€”":e.battery_level>100||e.voltage&&e.voltage>4.1?"USB โšก":`${e.battery_level.toFixed(0)}%`}function M3(e){return e===null?"โ€”":e>46?"Northern":e>44.5?"Central":e>43?"SW Idaho":"SC Idaho"}function F0e({nodes:e,selectedNodeId:t,onSelectNode:r}){const[n,i]=G.useState(""),[a,o]=G.useState("short_name"),[s,l]=G.useState("asc"),[u,c]=G.useState("all"),h=G.useMemo(()=>{let g=[...e];if(u==="infra"?g=g.filter(m=>T3.includes(m.role)):u==="online"&&(g=g.filter(m=>{if(!m.last_heard)return!1;const y=new Date(m.last_heard);return(new Date().getTime()-y.getTime())/36e5<1})),n){const m=n.toLowerCase();g=g.filter(y=>y.short_name.toLowerCase().includes(m)||y.long_name.toLowerCase().includes(m)||y.role.toLowerCase().includes(m)||M3(y.latitude).toLowerCase().includes(m))}return g.sort((m,y)=>{let _="",x="";switch(a){case"short_name":_=m.short_name.toLowerCase(),x=y.short_name.toLowerCase();break;case"role":_=m.role,x=y.role;break;case"battery_level":_=m.battery_level??-1,x=y.battery_level??-1;break;case"last_heard":_=m.last_heard?new Date(m.last_heard).getTime():0,x=y.last_heard?new Date(y.last_heard).getTime():0;break;case"hardware":_=m.hardware.toLowerCase(),x=y.hardware.toLowerCase();break}return _x?s==="asc"?1:-1:0}),g},[e,n,a,s,u]),f=g=>{a===g?l(s==="asc"?"desc":"asc"):(o(g),l("asc"))},d=({field:g})=>a!==g?null:s==="asc"?v.jsx(V$,{size:14,className:"inline ml-1"}):v.jsx(ll,{size:14,className:"inline ml-1"});return v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg overflow-hidden",children:[v.jsxs("div",{className:"p-3 border-b border-border flex items-center gap-3",children:[v.jsxs("div",{className:"relative flex-1 max-w-xs",children:[v.jsx(Q_,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),v.jsx("input",{type:"text",placeholder:"Search nodes...",value:n,onChange:g=>i(g.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"})]}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx(RM,{size:14,className:"text-slate-500 mr-1"}),["all","infra","online"].map(g=>v.jsx("button",{onClick:()=>c(g),className:`px-2 py-1 text-xs rounded transition-colors ${u===g?"bg-accent text-white":"bg-bg-hover text-slate-400 hover:text-slate-200"}`,children:g==="all"?"All":g==="infra"?"Infra":"Online"},g))]}),v.jsxs("div",{className:"text-xs text-slate-500 ml-auto",children:[h.length," of ",e.length," nodes"]})]}),v.jsxs("div",{className:"overflow-x-auto",children:[v.jsxs("table",{className:"w-full text-sm",children:[v.jsx("thead",{children:v.jsxs("tr",{className:"bg-bg-hover text-slate-400 text-xs",children:[v.jsx("th",{className:"w-8 px-3 py-2"}),v.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>f("short_name"),children:["Name ",v.jsx(d,{field:"short_name"})]}),v.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>f("role"),children:["Role ",v.jsx(d,{field:"role"})]}),v.jsx("th",{className:"px-3 py-2 text-left",children:"Region"}),v.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>f("battery_level"),children:[v.jsx("span",{title:"Battery percent (4.20V = 100%, 3.60V ~ 30% warning, 3.30V ~ 3% critical). USB โšก = USB-powered (>100% or >4.1V); no battery management applies.",children:"Battery"})," ",v.jsx(d,{field:"battery_level"})]}),v.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>f("last_heard"),children:[v.jsx("span",{title:"Status dot: green = heard in the last hour; amber = within 24h; slate = offline (past the configured threshold). See Reference โ†’ Mesh Health for thresholds by node type.",children:"Last Heard"})," ",v.jsx(d,{field:"last_heard"})]}),v.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>f("hardware"),children:["Hardware ",v.jsx(d,{field:"hardware"})]})]})}),v.jsx("tbody",{className:"divide-y divide-border",children:h.slice(0,100).map(g=>{const m=T3.includes(g.role),y=g.node_num===t;return v.jsxs("tr",{onClick:()=>r(g.node_num),className:`cursor-pointer transition-colors ${y?"bg-accent/10":"hover:bg-bg-hover"}`,children:[v.jsx("td",{className:"px-3 py-2",children:v.jsx("div",{className:`w-2 h-2 rounded-full ${O0e(g.last_heard)}`})}),v.jsxs("td",{className:"px-3 py-2",children:[v.jsx("div",{className:"font-mono text-slate-200",children:g.short_name}),v.jsx("div",{className:"text-xs text-slate-500 truncate max-w-[200px]",children:g.long_name})]}),v.jsx("td",{className:"px-3 py-2",children:v.jsx("span",{className:`inline-block px-1.5 py-0.5 rounded text-xs font-medium ${m?"bg-cyan-500/20 text-cyan-400":"bg-slate-500/20 text-slate-400"}`,children:g.role})}),v.jsx("td",{className:"px-3 py-2 text-slate-400",children:M3(g.latitude)}),v.jsx("td",{className:"px-3 py-2 font-mono text-slate-300",children:B0e(g)}),v.jsx("td",{className:"px-3 py-2 text-slate-400",children:z0e(g.last_heard)}),v.jsx("td",{className:"px-3 py-2 font-mono text-xs text-slate-400 truncate max-w-[150px]",children:g.hardware||"โ€”"})]},g.node_num)})})]}),h.length>100&&v.jsxs("div",{className:"px-3 py-2 text-xs text-slate-500 text-center border-t border-border",children:["Showing first 100 of ",h.length," nodes"]}),h.length===0&&v.jsx("div",{className:"px-3 py-8 text-sm text-slate-500 text-center",children:"No nodes match your filters"})]})]})}function V0e(){const[e,t]=G.useState([]),[r,n]=G.useState([]),[i,a]=G.useState([]),[o,s]=G.useState(null),[l,u]=G.useState("topo"),[c,h]=G.useState(!0),[f,d]=G.useState(null);G.useEffect(()=>{document.title="Mesh โ€” MeshAI",Promise.all([tY(),rY(),oY()]).then(([y,_,x])=>{t(y),n(_),a(x),h(!1)}).catch(y=>{d(y.message),h(!1)})},[]);const g=G.useMemo(()=>e.find(y=>y.node_num===o)||null,[e,o]),m=G.useCallback(y=>{s(y)},[]);return c?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-slate-400",children:"Loading mesh data..."})}):f?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsxs("div",{className:"text-red-400",children:["Error: ",f]})}):v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"text-sm text-slate-400",children:[e.length," nodes โ€ข ",r.length," edges"]}),v.jsxs("div",{className:"flex items-center bg-bg-card border border-border rounded-lg p-1",children:[v.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:[v.jsx(dB,{size:14}),v.jsx("span",{title:"Force-directed graph of nodes + neighbor links. Edge weight reflects SNR; node color reflects status (green = active, amber = stale, slate = offline).",children:"Topology"})]}),v.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:[v.jsx(X$,{size:14}),v.jsx("span",{title:"Nodes plotted by lat/lon on a basemap. Nodes without a reported position are clustered at the top edge.",children:"Geographic"})]})]})]}),v.jsxs("div",{className:"flex gap-0",children:[v.jsx("div",{className:"flex-1 min-w-0",children:l==="topo"?v.jsx(Qye,{nodes:e,edges:r,selectedNodeId:o,onSelectNode:m}):v.jsx(L0e,{nodes:e,edges:r,selectedNodeId:o,onSelectNode:m})}),v.jsx(R0e,{node:g,edges:r,nodes:e,onSelectNode:m})]}),v.jsx(F0e,{nodes:e,selectedNodeId:o,onSelectNode:m})]})}function kL({label:e,value:t,onChange:r,helper:n,info:i,roleFilter:a,valueType:o="short_name"}){const[s,l]=G.useState([]),[u,c]=G.useState(!0),[h,f]=G.useState(""),[d,g]=G.useState(!1);G.useEffect(()=>{fetch("/api/nodes").then(S=>S.json()).then(S=>{l(S),c(!1)}).catch(()=>{l([]),c(!1)})},[]);const m=G.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)),h.trim()){const T=h.toLowerCase();S=S.filter(M=>{var A,P,I,N;return((A=M.short_name)==null?void 0:A.toLowerCase().includes(T))||((P=M.long_name)==null?void 0:P.toLowerCase().includes(T))||((I=M.role)==null?void 0:I.toLowerCase().includes(T))||((N=M.node_id_hex)==null?void 0:N.toLowerCase().includes(T))})}return S.sort((T,M)=>(T.short_name||"").localeCompare(M.short_name||""))},[s,h,a]),y=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)}},_=S=>{const T=y(S);return t.includes(T)},x=S=>{const T=y(S);t.includes(T)?r(t.filter(M=>M!==T)):r([...t,T])},w=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?v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e}),v.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&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]}):v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e}),t.length>0&&v.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:t.map(S=>{const T=s.find(M=>y(M)===S);return v.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,v.jsx("button",{type:"button",onClick:()=>r(t.filter(M=>M!==S)),className:"hover:text-white",children:v.jsx(ca,{size:14})})]},S)})}),v.jsxs("div",{className:"relative",children:[v.jsxs("div",{className:"relative",children:[v.jsx(Q_,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),v.jsx("input",{type:"text",value:h,onChange:S=>f(S.target.value),onFocus:()=>g(!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&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>g(!1)}),v.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:m.length===0?v.jsx("div",{className:"p-3 text-sm text-slate-500 text-center",children:"No nodes found"}):m.map(S=>v.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] ${_(S)?"bg-accent/10":""}`,children:[v.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center ${_(S)?"bg-accent border-accent":"border-slate-600"}`,children:_(S)&&v.jsx(Za,{size:12,className:"text-white"})}),v.jsx("span",{className:"text-slate-200",children:w(S)})]},S.node_num))})]})]}),n&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function LL(e){const[t,r]=G.useState([]),[n,i]=G.useState(!0);G.useEffect(()=>{fetch("/api/channels").then(f=>f.json()).then(f=>{r(f),i(!1)}).catch(()=>{r([]),i(!1)})},[]);const a=f=>{const d=f.role==="PRIMARY"?"Primary":f.role==="SECONDARY"?"Secondary":"";return`${f.index}: ${f.name}${d?` (${d})`:""}`};if(!n&&t.length===0)return e.mode==="single"?v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e.label}),v.jsx("input",{type:"number",value:e.value,onChange:f=>e.onChange(Number(f.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&&v.jsx("p",{className:"text-xs text-slate-600",children:e.helper})]}):v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e.label}),v.jsx("input",{type:"text",value:e.value.join(", "),onChange:f=>{const d=f.target.value.split(",").map(g=>parseInt(g.trim())).filter(g=>!isNaN(g));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&&v.jsx("p",{className:"text-xs text-slate-600",children:e.helper})]});if(e.mode==="single"){const{value:f,onChange:d,label:g,helper:m,includeDisabled:y}=e,_=t.filter(x=>x.enabled);return v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:g}),v.jsxs("select",{value:f,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:[y&&v.jsx("option",{value:-1,children:"Disabled"}),_.map(x=>v.jsx("option",{value:x.index,children:a(x)},x.index))]}),m&&v.jsx("p",{className:"text-xs text-slate-600",children:m})]})}const{value:o,onChange:s,label:l,helper:u}=e,c=t.filter(f=>f.enabled),h=f=>{o.includes(f)?s(o.filter(d=>d!==f)):s([...o,f].sort((d,g)=>d-g))};return v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:l}),v.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-2 space-y-1",children:[c.map(f=>v.jsxs("label",{onClick:()=>h(f.index),className:"flex items-center gap-2 p-2 rounded hover:bg-[#0a0e17] cursor-pointer",children:[v.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center ${o.includes(f.index)?"bg-accent border-accent":"border-slate-600"}`,children:o.includes(f.index)&&v.jsx(Za,{size:12,className:"text-white"})}),v.jsx("span",{className:"text-sm text-slate-200",children:a(f)})]},f.index)),c.length===0&&v.jsx("div",{className:"text-sm text-slate-500 p-2",children:"No channels available"})]}),u&&v.jsx("p",{className:"text-xs text-slate-600",children:u})]})}const A3=[{key:"bot",label:"Bot",icon:O$},{key:"connection",label:"Connection",icon:ex},{key:"response",label:"Response",icon:OM},{key:"history",label:"History",icon:uB},{key:"memory",label:"Memory",icon:z$},{key:"context",label:"Context",icon:jM},{key:"commands",label:"Commands",icon:gB},{key:"llm",label:"LLM",icon:lB},{key:"weather",label:"Weather",icon:Du},{key:"meshmonitor",label:"MeshMonitor",icon:Di},{key:"knowledge",label:"Knowledge",icon:oB},{key:"mesh_sources",label:"Mesh Sources",icon:hB},{key:"mesh_intelligence",label:"Intelligence",icon:rf},{key:"dashboard",label:"Dashboard",icon:fB}],Fn={bot:"Identity and behavior settings for the bot on the mesh network.",connection:"How MeshAI connects to your Meshtastic radio.",response:"Controls how quickly and how much the bot responds on the mesh.",history:"Conversation history storage and cleanup.",memory:"Short-term conversation memory management. Controls how the bot maintains context within a conversation.",context:"Passive channel monitoring. The bot listens to mesh channels and uses recent messages as context when responding.",commands:"Mesh commands available via the configured prefix. Toggle individual commands on or off.",llm:"AI model configuration. MeshAI uses an LLM to understand questions and generate responses.",weather:"Weather data for the !weather command. This is separate from NWS environmental alerts.",meshmonitor:"AIDA MeshMonitor integration. An additional data source for mesh network monitoring.",knowledge:"Knowledge base for answering questions from stored documents. Connects to Qdrant vector database or local SQLite.",mesh_sources:"Data sources for mesh network information. MeshAI can pull data from multiple sources simultaneously and merge them into a unified view.",mesh_intelligence:"Advanced mesh analysis: health scoring, region management, and automated alerting. The intelligence engine monitors your mesh and detects problems automatically.",dashboard:"Web dashboard settings. You're looking at it right now."},G0e=[{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"}],W0e=[{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 eo({info:e,link:t,linkText:r="Learn more"}){const[n,i]=G.useState(!1),a=G.useRef(null);return G.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]),v.jsxs("div",{className:"relative inline-block",ref:a,children:[v.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&&v.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:[v.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:v.jsx(ca,{size:12})}),v.jsx("div",{className:"pr-4",children:e}),t&&v.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," ",v.jsx(Ih,{size:10})]})]})]})}function Vn({text:e}){return v.jsx("p",{className:"text-sm text-slate-500 mb-6 pb-4 border-b border-[#1e2a3a]",children:e})}function ct({label:e,value:t,onChange:r,type:n="text",placeholder:i="",helper:a="",info:o="",infoLink:s=""}){const[l,u]=G.useState(!1),c=n==="password";return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,o&&v.jsx(eo,{info:o,link:s})]}),v.jsxs("div",{className:"relative",children:[v.jsx("input",{type:c&&!l?"password":"text",value:t,onChange:h=>r(h.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&&v.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?v.jsx(cB,{size:16}):v.jsx(jM,{size:16})})]}),a&&v.jsx("p",{className:"text-xs text-slate-600",children:a})]})}function We({label:e,value:t,onChange:r,min:n,max:i,step:a=1,helper:o="",info:s="",infoLink:l=""}){return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,s&&v.jsx(eo,{info:s,link:l})]}),v.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&&v.jsx("p",{className:"text-xs text-slate-600",children:o})]})}function or({label:e,checked:t,onChange:r,helper:n="",info:i="",infoLink:a=""}){return v.jsxs("div",{className:"flex items-center justify-between py-2",children:[v.jsxs("div",{children:[v.jsxs("span",{className:"flex items-center text-sm text-slate-300",children:[e,i&&v.jsx(eo,{info:i,link:a})]}),n&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]}),v.jsx("button",{type:"button",onClick:()=>r(!t),className:`relative w-11 h-6 rounded-full transition-colors ${t?"bg-accent":"bg-[#1e2a3a]"}`,children:v.jsx("span",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${t?"translate-x-5":""}`})})]})}function Ln({label:e,value:t,onChange:r,options:n,helper:i="",info:a="",infoLink:o=""}){return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&v.jsx(eo,{info:a,link:o})]}),v.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=>v.jsx("option",{value:s.value,children:s.label},s.value))}),i&&v.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function H0e({label:e,value:t,onChange:r,rows:n=4,helper:i="",info:a="",infoLink:o=""}){return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&v.jsx(eo,{info:a,link:o})]}),v.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&&v.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function ou({label:e,value:t,onChange:r,helper:n="",info:i="",infoLink:a=""}){const[o,s]=G.useState(t.join(", "));G.useEffect(()=>{s(t.join(", "))},[t]);const l=()=>{const u=o.split(",").map(c=>c.trim()).filter(Boolean);r(u)};return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&v.jsx(eo,{info:i,link:a})]}),v.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&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function U0e({label:e,value:t,onChange:r,helper:n="",info:i="",infoLink:a=""}){const[o,s]=G.useState(t.join(", "));G.useEffect(()=>{s(t.join(", "))},[t]);const l=()=>{const u=o.split(",").map(c=>parseInt(c.trim(),10)).filter(c=>!isNaN(c));r(u)};return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&v.jsx(eo,{info:i,link:a})]}),v.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&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function sn({label:e,description:t,checked:r,onChange:n,threshold:i,onThresholdChange:a,thresholdLabel:o,thresholdMin:s,thresholdMax:l,thresholdStep:u=1,thresholdSuffix:c=""}){return v.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-3 space-y-2",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"flex-1",children:[v.jsx("span",{className:"text-sm text-slate-300",children:e}),v.jsx("p",{className:"text-xs text-slate-600",children:t})]}),v.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:v.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&&v.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-[#1e2a3a]",children:[v.jsxs("span",{className:"text-xs text-slate-500",children:[o||"Threshold",":"]}),v.jsx("input",{type:"number",value:i,onChange:h=>a(Number(h.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&&v.jsx("span",{className:"text-xs text-slate-500",children:c})]})]})}function Z0e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.bot}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{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."}),v.jsx(ct,{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."})]}),v.jsx(or,{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."}),v.jsx(or,{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 $0e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.connection}),v.jsx(Ln,{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"?v.jsx(ct,{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."}):v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{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"}),v.jsx(We,{label:"TCP Port",value:e.tcp_port,onChange:r=>t({...e,tcp_port:r}),min:1,max:65535,helper:"Default 4403 for meshtasticd"})]})]})}function Y0e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.response}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{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."}),v.jsx(We,{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."})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{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."}),v.jsx(We,{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 X0e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.history}),v.jsx(ct,{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."}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{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."}),v.jsx(We,{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."})]}),v.jsx(or,{label:"Auto Cleanup",checked:e.auto_cleanup,onChange:r=>t({...e,auto_cleanup:r}),helper:"Automatically prune old conversations"}),e.auto_cleanup&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Cleanup Interval (hours)",value:e.cleanup_interval_hours,onChange:r=>t({...e,cleanup_interval_hours:r}),min:1,helper:"Hours between cleanup runs"}),v.jsx(We,{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 q0e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.memory}),v.jsx(or,{label:"Enable Memory",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Keep conversation context between messages"}),e.enabled&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{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."}),v.jsx(We,{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 K0e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.context}),v.jsx(or,{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&&v.jsxs(v.Fragment,{children:[v.jsx(LL,{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"}),v.jsx(kL,{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."}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Max Age (sec)",value:e.max_age,onChange:r=>t({...e,max_age:r}),min:0,helper:"Ignore messages older than this"}),v.jsx(We,{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 J0e({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 v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.commands}),v.jsx(or,{label:"Enable Commands",checked:e.enabled,onChange:i=>t({...e,enabled:i}),helper:"Allow !commands on the mesh"}),e.enabled&&v.jsxs(v.Fragment,{children:[v.jsx(ct,{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."}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Available Commands",v.jsx(eo,{info:"Toggle commands on or off. Disabled commands won't respond when users invoke them."})]}),v.jsx("div",{className:"grid gap-1",children:G0e.map(i=>{const a=!r.has(i.name.toLowerCase());return v.jsxs("div",{className:"flex items-center justify-between p-2 bg-[#0a0e17] border border-[#1e2a3a] rounded hover:border-[#2a3a4a] transition-colors",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsxs("code",{className:"text-accent text-sm",children:["!",i.name]}),v.jsx("span",{className:"text-xs text-slate-500",children:i.description})]}),v.jsx("button",{type:"button",onClick:()=>n(i.name),className:`relative w-9 h-5 rounded-full transition-colors ${a?"bg-accent":"bg-[#1e2a3a]"}`,children:v.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 Q0e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.llm}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Ln,{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."}),v.jsx(ct,{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)."})]}),v.jsx(ct,{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."}),v.jsx(ct,{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."}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Timeout (sec)",value:e.timeout,onChange:r=>t({...e,timeout:r}),min:5,max:120,helper:"Maximum seconds to wait for response"}),v.jsx(We,{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"})]}),v.jsx(or,{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&&v.jsx(H0e,{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."}),v.jsx(or,{label:"Web Search",checked:e.web_search,onChange:r=>t({...e,web_search:r}),helper:"Enable web search tool (Open WebUI feature)"}),v.jsx(or,{label:"Google Grounding",checked:e.google_grounding,onChange:r=>t({...e,google_grounding:r}),helper:"Ground responses in web search (Gemini only)"})]})}function e_e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.weather}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Ln,{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"}),v.jsx(Ln,{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"})]}),v.jsx(ct,{label:"Default Location",value:e.default_location,onChange:r=>t({...e,default_location:r}),placeholder:"Your city, state",helper:"Location when none specified"})]})}function t_e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.meshmonitor}),v.jsx(or,{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&&v.jsxs(v.Fragment,{children:[v.jsx(ct,{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."}),v.jsx(or,{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."}),v.jsx(We,{label:"Refresh Interval (sec)",value:e.refresh_interval,onChange:r=>t({...e,refresh_interval:r}),min:10,helper:"How often to fetch patterns"}),v.jsx(or,{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 r_e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.knowledge}),v.jsx(or,{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&&v.jsxs(v.Fragment,{children:[v.jsx(Ln,{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")&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{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."}),v.jsx(We,{label:"Qdrant Port",value:e.qdrant_port,onChange:r=>t({...e,qdrant_port:r}),helper:"Default 6333"})]}),v.jsx(ct,{label:"Collection",value:e.qdrant_collection,onChange:r=>t({...e,qdrant_collection:r}),helper:"Qdrant collection name"}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{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."}),v.jsx(We,{label:"TEI Port",value:e.tei_port,onChange:r=>t({...e,tei_port:r}),helper:"Default 8090"})]}),v.jsx(or,{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."})]}),v.jsx(ct,{label:"SQLite DB Path",value:e.db_path,onChange:r=>t({...e,db_path:r}),helper:"Local knowledge database file"}),v.jsx(We,{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 n_e({source:e,onChange:t,onDelete:r}){const[n,i]=G.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 v.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg overflow-hidden",children:[v.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>i(!n),children:[v.jsxs("div",{className:"flex items-center gap-3",children:[n?v.jsx(ll,{size:16}):v.jsx(Js,{size:16}),v.jsx("div",{className:`w-2 h-2 rounded-full ${e.enabled?"bg-green-500":"bg-slate-500"}`}),v.jsx("span",{className:"font-mono text-sm text-slate-200",children:e.name||"Unnamed Source"}),v.jsx("span",{className:"text-xs text-slate-500 bg-[#1e2a3a] px-2 py-0.5 rounded",children:e.type})]}),v.jsx("button",{onClick:o=>{o.stopPropagation(),r()},className:"p-1 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",children:v.jsx(Ep,{size:14})})]}),n&&v.jsxs("div",{className:"p-4 space-y-4 border-t border-[#1e2a3a]",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{label:"Name",value:e.name,onChange:o=>t({...e,name:o}),helper:"Friendly name for this source"}),v.jsx(Ln,{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"&&v.jsx(ct,{label:"URL",value:e.url,onChange:o=>t({...e,url:o}),helper:"Full URL including protocol"}),e.type==="meshmonitor"&&v.jsx(ct,{label:"API Token",value:e.api_token,onChange:o=>t({...e,api_token:o}),type:"password",helper:"Bearer token for authentication"}),e.type==="mqtt"&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{label:"Host",value:e.host||"",onChange:o=>t({...e,host:o}),helper:"MQTT broker hostname"}),v.jsx(We,{label:"Port",value:e.port||1883,onChange:o=>t({...e,port:o}),min:1,max:65535,helper:"1883 plain, 8883 TLS"})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{label:"Username",value:e.username||"",onChange:o=>t({...e,username:o})}),v.jsx(ct,{label:"Password",value:e.password||"",onChange:o=>t({...e,password:o}),type:"password"})]}),v.jsx(ct,{label:"Topic Root",value:e.topic_root||"msh/US",onChange:o=>t({...e,topic_root:o}),helper:"Base topic to subscribe to"}),v.jsx(or,{label:"Use TLS",checked:e.use_tls||!1,onChange:o=>t({...e,use_tls:o}),helper:"Encrypt MQTT connection"})]}),v.jsx(We,{label:"Refresh Interval (sec)",value:e.refresh_interval,onChange:o=>t({...e,refresh_interval:o}),min:10,helper:"Polling frequency"}),v.jsx(or,{label:"Enabled",checked:e.enabled,onChange:o=>t({...e,enabled:o})}),v.jsx(or,{label:"Polite Mode",checked:e.polite_mode,onChange:o=>t({...e,polite_mode:o}),helper:"Reduce polling for shared instances"})]})]})}function i_e({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 v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.mesh_sources}),e.map((n,i)=>v.jsx(n_e,{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)),v.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:[v.jsx(af,{size:16})," Add Source"]})]})}function a_e({data:e,onChange:t}){const[r,n]=G.useState(null);return v.jsxs("div",{className:"space-y-6",children:[v.jsx(Vn,{text:Fn.mesh_intelligence}),v.jsx(or,{label:"Enable Mesh Intelligence",checked:e.enabled,onChange:i=>t({...e,enabled:i}),helper:"Activate health scoring and alerting"}),e.enabled&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{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."}),v.jsx(We,{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."})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{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."}),v.jsx(We,{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"})]}),v.jsx(kL,{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"}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(LL,{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}),v.jsx(We,{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)."})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Regions",v.jsx(eo,{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)=>v.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg overflow-hidden",children:[v.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>n(r===a?null:a),children:[v.jsxs("div",{className:"flex items-center gap-3",children:[r===a?v.jsx(ll,{size:16}):v.jsx(Js,{size:16}),v.jsx("span",{className:"font-medium text-slate-200",children:i.name||"Unnamed Region"}),v.jsx("span",{className:"text-xs text-slate-500",children:i.local_name})]}),v.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:v.jsx(Ep,{size:14})})]}),r===a&&v.jsxs("div",{className:"p-4 space-y-3 border-t border-[#1e2a3a]",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{label:"Name",value:i.name,onChange:o=>{const s=[...e.regions];s[a]={...i,name:o},t({...e,regions:s})}}),v.jsx(ct,{label:"Local Name",value:i.local_name,onChange:o=>{const s=[...e.regions];s[a]={...i,local_name:o},t({...e,regions:s})}})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Latitude",value:i.lat,onChange:o=>{const s=[...e.regions];s[a]={...i,lat:o},t({...e,regions:s})},step:1e-4}),v.jsx(We,{label:"Longitude",value:i.lon,onChange:o=>{const s=[...e.regions];s[a]={...i,lon:o},t({...e,regions:s})},step:1e-4})]}),v.jsx(ct,{label:"Description",value:i.description,onChange:o=>{const s=[...e.regions];s[a]={...i,description:o},t({...e,regions:s})}}),v.jsx(ou,{label:"Aliases",value:i.aliases,onChange:o=>{const s=[...e.regions];s[a]={...i,aliases:o},t({...e,regions:s})}}),v.jsx(ou,{label:"Cities",value:i.cities,onChange:o=>{const s=[...e.regions];s[a]={...i,cities:o},t({...e,regions:s})}})]})]},a)),v.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:[v.jsx(af,{size:16})," Add Region"]})]}),v.jsxs("div",{className:"space-y-3",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Alert Rules",v.jsx(eo,{info:"Configure which conditions trigger alerts. Each rule can have an optional threshold value."})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Infrastructure"}),v.jsx(sn,{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}})}),v.jsx(sn,{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}})}),v.jsx(sn,{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}})}),v.jsx(sn,{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}})}),v.jsx(sn,{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}})}),v.jsx(sn,{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}})})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Power"}),v.jsx(sn,{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:"%"}),v.jsx(sn,{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:"%"}),v.jsx(sn,{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:"%"}),v.jsx(sn,{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}})}),v.jsx(sn,{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}})}),v.jsx(sn,{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}})})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Utilization"}),v.jsx(sn,{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`}),v.jsx(sn,{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"})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Health Scores"}),v.jsx(sn,{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"}),v.jsx(sn,{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 o_e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.dashboard}),v.jsx(or,{label:"Enable Dashboard",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Run the web dashboard"}),e.enabled&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{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."}),v.jsx(We,{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 s_e(){var I;const[e,t]=G.useState(null),[r,n]=G.useState(null),[i,a]=G.useState("bot"),[o,s]=G.useState(!0),[l,u]=G.useState(!1),[c,h]=G.useState(null),[f,d]=G.useState(null),[g,m]=G.useState(!1),[y,_]=G.useState(!1),x=G.useCallback(async()=>{try{const N=await fetch("/api/config");if(!N.ok)throw new Error("Failed to fetch config");const D=await N.json();t(D),n(JSON.parse(JSON.stringify(D))),_(!1),h(null)}catch(N){h(N instanceof Error?N.message:"Unknown error")}finally{s(!1)}},[]);G.useEffect(()=>{document.title="Config โ€” MeshAI",x()},[x]),G.useEffect(()=>{e&&r&&_(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);const w=async()=>{if(e){u(!0),h(null),d(null);try{const N=e[i],D=await fetch(`/api/config/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(N)}),O=await D.json();if(!D.ok)throw new Error(O.detail||"Save failed");d(`${i} saved successfully`),n(JSON.parse(JSON.stringify(e))),_(!1),O.restart_required&&(m(!0),hY(Array.isArray(O.changed_keys)?O.changed_keys:[])),setTimeout(()=>d(null),3e3)}catch(N){h(N instanceof Error?N.message:"Save failed")}finally{u(!1)}}},S=()=>{r&&(t(JSON.parse(JSON.stringify(r))),_(!1))},T=async()=>{try{await fetch("/api/restart",{method:"POST"}),m(!1),d("Restart initiated")}catch{h("Restart failed")}},M=(N,D)=>{e&&t({...e,[N]:D})};if(o)return v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-slate-400",children:"Loading configuration..."})});if(!e)return v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-red-400",children:"Failed to load configuration"})});const A=()=>{switch(i){case"bot":return v.jsx(Z0e,{data:e.bot,onChange:N=>M("bot",N)});case"connection":return v.jsx($0e,{data:e.connection,onChange:N=>M("connection",N)});case"response":return v.jsx(Y0e,{data:e.response,onChange:N=>M("response",N)});case"history":return v.jsx(X0e,{data:e.history,onChange:N=>M("history",N)});case"memory":return v.jsx(q0e,{data:e.memory,onChange:N=>M("memory",N)});case"context":return v.jsx(K0e,{data:e.context,onChange:N=>M("context",N)});case"commands":return v.jsx(J0e,{data:e.commands,onChange:N=>M("commands",N)});case"llm":return v.jsx(Q0e,{data:e.llm,onChange:N=>M("llm",N)});case"weather":return v.jsx(e_e,{data:e.weather,onChange:N=>M("weather",N)});case"meshmonitor":return v.jsx(t_e,{data:e.meshmonitor,onChange:N=>M("meshmonitor",N)});case"knowledge":return v.jsx(r_e,{data:e.knowledge,onChange:N=>M("knowledge",N)});case"mesh_sources":return v.jsx(i_e,{data:e.mesh_sources,onChange:N=>M("mesh_sources",N)});case"mesh_intelligence":return v.jsx(a_e,{data:e.mesh_intelligence,onChange:N=>M("mesh_intelligence",N)});case"dashboard":return v.jsx(o_e,{data:e.dashboard,onChange:N=>M("dashboard",N)});default:return null}},P=((I=A3.find(N=>N.key===i))==null?void 0:I.label)||i;return v.jsxs("div",{className:"flex gap-6 h-[calc(100vh-8rem)]",children:[v.jsx("div",{className:"w-48 flex-shrink-0 space-y-1",children:A3.map(({key:N,label:D,icon:O})=>v.jsxs("button",{onClick:()=>a(N),className:`w-full flex items-center gap-2 px-3 py-2 rounded text-sm transition-colors ${i===N?"bg-accent text-white":"text-slate-400 hover:text-slate-200 hover:bg-bg-hover"}`,children:[v.jsx(O,{size:16}),v.jsx("span",{children:D}),y&&i===N&&v.jsx("span",{className:"ml-auto w-2 h-2 bg-amber-500 rounded-full"})]},N))}),v.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[v.jsxs("div",{className:"flex items-center justify-between mb-6",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(vB,{size:20,className:"text-slate-500"}),v.jsx("h2",{className:"text-lg font-semibold text-slate-200",children:P})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[y&&v.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:[v.jsx(K_,{size:14}),"Discard"]}),v.jsxs("button",{onClick:w,disabled:l||!y,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?v.jsx($v,{size:14,className:"animate-spin"}):v.jsx(zM,{size:14}),"Save"]})]})]}),g&&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:[v.jsxs("div",{className:"flex items-center gap-2 text-amber-400",children:[v.jsx($a,{size:16}),v.jsx("span",{className:"text-sm",children:"Restart required for changes to take effect"})]}),v.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&&v.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:[v.jsx(ca,{size:16}),v.jsx("span",{className:"text-sm",children:c})]}),f&&v.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:[v.jsx(Za,{size:16}),v.jsx("span",{className:"text-sm",children:f})]}),v.jsx("div",{className:"flex-1 overflow-y-auto pr-2",children:v.jsx("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:A()})})]})]})}function l_e({feed:e}){const t=e.is_loaded?e.consecutive_errors>0?"bg-amber-500":"bg-green-500":"bg-red-500",r=e.is_loaded?e.consecutive_errors>0?`${e.consecutive_errors} errors`:"Healthy":"Not loaded",n=e.last_fetch?new Date(e.last_fetch*1e3).toLocaleTimeString():"Never";return v.jsxs("div",{className:"bg-bg-hover rounded-lg p-4",children:[v.jsxs("div",{className:"flex items-center justify-between mb-2",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${t}`}),v.jsx("span",{className:"text-sm font-medium text-slate-200 uppercase",children:e.source})]}),v.jsx("span",{className:"text-xs text-slate-400",children:r})]}),v.jsxs("div",{className:"text-xs text-slate-500 space-y-1",children:[v.jsxs("div",{children:["Events: ",e.event_count]}),v.jsxs("div",{children:["Last fetch: ",n]}),e.last_error&&v.jsx("div",{className:"text-amber-500 truncate",children:e.last_error})]})]})}function u_e({event:e}){const t=e.severity.toLowerCase(),r=t==="extreme"||t==="severe"||t==="immediate"?{bg:"bg-red-500/10",border:"border-red-500",Icon:Vo,color:"text-red-500"}:t==="moderate"||t==="warning"||t==="priority"?{bg:"bg-amber-500/10",border:"border-amber-500",Icon:$a,color:"text-amber-500"}:{bg:"bg-blue-500/10",border:"border-blue-500",Icon:X_,color:"text-blue-500"},n=r.Icon;return v.jsx("div",{className:`p-3 rounded-lg ${r.bg} border-l-2 ${r.border}`,children:v.jsxs("div",{className:"flex items-start gap-3",children:[v.jsx(n,{size:16,className:r.color}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[v.jsx("span",{className:"text-sm font-medium text-slate-200",children:e.event_type}),v.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${r.bg} ${r.color}`,children:e.severity})]}),v.jsx("div",{className:"text-sm text-slate-300",children:e.headline})]})]})})}function JH({value:e,onChange:t,disabled:r,centralDisabled:n}){const i="px-2 py-1 text-xs transition-colors";return v.jsxs("div",{className:`flex rounded border border-[#1e2a3a] overflow-hidden ${r?"opacity-40":""}`,children:[v.jsx("button",{type:"button",disabled:r,onClick:()=>t("native"),className:`${i} ${e==="native"?"bg-accent text-white":"text-slate-400 hover:text-slate-200"}`,children:"native"}),v.jsx("button",{type:"button",disabled:r||n,title:n?"Central not available for this adapter":"",onClick:()=>{n||t("central")},className:`${i} ${n?"text-slate-600 cursor-not-allowed":e==="central"?"bg-accent text-white":"text-slate-400 hover:text-slate-200"}`,children:"central"})]})}function c_e({title:e,subtitle:t,enabled:r,onEnabled:n,feedSource:i,onFeedSource:a,hasCentral:o,nativeOnly:s,hasKey:l,health:u,events:c,children:h}){const f=s||!o;return v.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{children:[v.jsx("span",{className:"text-sm font-medium text-slate-300",children:e}),t&&v.jsx("p",{className:"text-xs text-slate-600",children:t})]}),v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx("span",{className:"text-[10px] uppercase tracking-wide text-slate-600",children:"source"}),v.jsx(JH,{value:i,onChange:a,disabled:!r,centralDisabled:f})]}),v.jsx(or,{label:"",checked:r,onChange:n})]})]}),!l&&v.jsx("div",{className:"text-xs text-amber-400 bg-amber-500/10 rounded p-2",children:"API key not configured โ€” contact admin"}),s&&v.jsx("div",{className:"text-[11px] text-slate-600",children:"Central not available for this adapter โ€” native only"}),v.jsx("div",{className:r?"space-y-3":"space-y-3 opacity-40 pointer-events-none select-none",children:h}),(u||c&&c.length>0)&&v.jsxs("div",{className:"pt-2 border-t border-[#1e2a3a] space-y-3",children:[v.jsx("div",{className:"text-[10px] uppercase tracking-wide text-slate-600",children:"Live status"}),u?v.jsx(l_e,{feed:u}):v.jsx("div",{className:"text-xs text-slate-600",children:"No status reported."}),c&&c.length>0&&v.jsx("div",{className:"space-y-2",children:c.slice(0,5).map((d,g)=>v.jsx(u_e,{event:d},g))})]})]})}const hs={nws:{label:"NWS Weather Alerts",subtitle:"National Weather Service alerts",health:"nws",hasCentral:!0,nativeOnly:!1,hasKey:!0},fires:{label:"NIFC Fire Perimeters",subtitle:"Active wildfires (National Interagency Fire Center)",health:"nifc",hasCentral:!0,nativeOnly:!1,hasKey:!0},firms:{label:"NASA FIRMS Hotspots",subtitle:"Satellite thermal-anomaly detections",health:"firms",hasCentral:!0,nativeOnly:!1,hasKey:!1},swpc:{label:"NOAA Space Weather (SWPC)",subtitle:"Solar indices, geomagnetic storms",health:"swpc",hasCentral:!0,nativeOnly:!1,hasKey:!0},ducting:{label:"Tropospheric Ducting",subtitle:"VHF/UHF extended-range conditions",health:"ducting",hasCentral:!1,nativeOnly:!0,hasKey:!0},traffic:{label:"TomTom Traffic",subtitle:"Traffic flow on monitored corridors",health:"traffic",hasCentral:!0,nativeOnly:!1,hasKey:!0},roads511:{label:"511 Road Conditions",subtitle:"State DOT road events and closures",health:"roads511",hasCentral:!0,nativeOnly:!1,hasKey:!1},wzdx:{label:"WZDx Work Zones",subtitle:"Planned road work and construction events from ITD",health:"roads511",hasCentral:!0,nativeOnly:!1,hasKey:!0},usgs_quake:{label:"USGS Earthquakes",subtitle:"Seismic events from the USGS feed",health:"usgs_quake",hasCentral:!0,nativeOnly:!1,hasKey:!0},usgs:{label:"USGS Stream Gauges",subtitle:"River and stream water levels",health:"usgs",hasCentral:!0,nativeOnly:!1,hasKey:!0},avalanche:{label:"Avalanche Advisories",subtitle:"Backcountry avalanche danger ratings",health:"avalanche",hasCentral:!0,nativeOnly:!1,hasKey:!0}},xS=[{key:"central",label:"Central",icon:K$,adapters:[]},{key:"weather",label:"Weather",icon:Du,adapters:["nws"]},{key:"fire",label:"Fire",icon:Y_,adapters:["fires","firms"]},{key:"rf",label:"RF Propagation",icon:Di,adapters:["swpc","ducting"]},{key:"roads",label:"Roads",icon:Z_,adapters:["traffic","roads511","wzdx"]},{key:"geohazards",label:"Geohazards",icon:q_,adapters:["usgs_quake","usgs","avalanche"]},{key:"tracking",label:"Tracking",icon:J_,adapters:[]},{key:"mesh",label:"Mesh Health",icon:rf,adapters:[]}];function h_e(){var Lf,Nf;const[e,t]=G.useState(null),[r,n]=G.useState(""),[i,a]=G.useState(null),[o,s]=G.useState([]),[l,u]=G.useState(!0),[c,h]=G.useState(!1),[f,d]=G.useState(null),[g,m]=G.useState(null),[y,_]=G.useState(!1),[x,w]=G.useState("weather"),[S,T]=G.useState("nws"),[M,A]=G.useState({allowed_incident_types:["WF"],freshness_seconds:0,cooldown_seconds:28800,broadcast_on_acres:!0,broadcast_on_contained:!0}),[P,I]=G.useState(""),[N,D]=G.useState({digest_enabled:!0,digest_schedule:["06:00","18:00"],digest_timezone:"America/Boise"}),[O,R]=G.useState(""),[F,H]=G.useState({min_magnitude:4,drop_non_present:!0,drop_zero_magnitude:!0}),[W,V]=G.useState(""),[z,Z]=G.useState({min_severity:"None",enabled_categories:["incident","closure"],enabled_sub_types:["accident","road_closed","closure","lane_closed","vehicle_on_fire","flooding","debris"]}),[U,$]=G.useState(""),[Y,te]=G.useState({broadcast:!1,min_severity:"Minor",sub_types:["road_works","lane_closed","road_closed"]}),[ie,se]=G.useState(""),[le,Ee]=G.useState({broadcast_severities:["Extreme","Severe"],duplicate_allowed_after_seconds:3600}),[me,ye]=G.useState(""),[Me,pe]=G.useState({min_danger_level:3}),[Te,st]=G.useState(""),[ze,et]=G.useState({geomag_kp_floor:7,flare_class_floor:"X1",proton_pfu_floor:10}),[lt,Et]=G.useState("");G.useEffect(()=>{document.title="Environment โ€” MeshAI",(async()=>{var _e,Ut,Hn,ui,Gi,gl,ee,_t,pt,dt,ur,oo,rn,Be,Pf,If,Df,Ef,oc,jf,so,Rf,hg;try{const fg=await(await fetch("/api/config/environmental")).json();t(fg),n(JSON.stringify(fg));try{const Bt=await fetch("/api/adapter-config/wfigs");if(Bt.ok){const wt=await Bt.json(),Ft={allowed_incident_types:((_e=wt.allowed_incident_types)==null?void 0:_e.value)??["WF"],freshness_seconds:((Ut=wt.freshness_seconds)==null?void 0:Ut.value)??0,cooldown_seconds:((Hn=wt.cooldown_seconds)==null?void 0:Hn.value)??28800,broadcast_on_acres:((ui=wt.broadcast_on_acres)==null?void 0:ui.value)??!0,broadcast_on_contained:((Gi=wt.broadcast_on_contained)==null?void 0:Gi.value)??!0};A(Ft),I(JSON.stringify(Ft))}}catch{}try{const Bt=await fetch("/api/adapter-config/fires");if(Bt.ok){const wt=await Bt.json(),Ft={digest_enabled:((gl=wt.digest_enabled)==null?void 0:gl.value)??!0,digest_schedule:((ee=wt.digest_schedule)==null?void 0:ee.value)??["06:00","18:00"],digest_timezone:((_t=wt.digest_timezone)==null?void 0:_t.value)??"America/Boise"};D(Ft),R(JSON.stringify(Ft))}}catch{}try{const Bt=await fetch("/api/adapter-config/tomtom_incidents");if(Bt.ok){const wt=await Bt.json(),Ft={min_magnitude:((pt=wt.min_magnitude)==null?void 0:pt.value)??4,drop_non_present:((dt=wt.drop_non_present)==null?void 0:dt.value)??!0,drop_zero_magnitude:((ur=wt.drop_zero_magnitude)==null?void 0:ur.value)??!0};H(Ft),V(JSON.stringify(Ft))}}catch{}try{const Bt=await fetch("/api/adapter-config/itd_511");if(Bt.ok){const wt=await Bt.json(),Ft={min_severity:((oo=wt.min_severity)==null?void 0:oo.value)??"None",enabled_categories:((rn=wt.enabled_categories)==null?void 0:rn.value)??["incident","closure"],enabled_sub_types:((Be=wt.enabled_sub_types)==null?void 0:Be.value)??["accident","road_closed","closure","lane_closed","vehicle_on_fire","flooding","debris"]};Z(Ft),$(JSON.stringify(Ft))}}catch{}try{const Bt=await fetch("/api/adapter-config/wzdx");if(Bt.ok){const wt=await Bt.json(),Ft={broadcast:((Pf=wt.broadcast)==null?void 0:Pf.value)??!1,min_severity:((If=wt.min_severity)==null?void 0:If.value)??"Minor",sub_types:((Df=wt.sub_types)==null?void 0:Df.value)??["road_works","lane_closed","road_closed"]};te(Ft),se(JSON.stringify(Ft))}}catch{}try{const Bt=await fetch("/api/adapter-config/nws");if(Bt.ok){const wt=await Bt.json(),Ft={broadcast_severities:((Ef=wt.broadcast_severities)==null?void 0:Ef.value)??["Extreme","Severe"],duplicate_allowed_after_seconds:((oc=wt.duplicate_allowed_after_seconds)==null?void 0:oc.value)??3600};Ee(Ft),ye(JSON.stringify(Ft))}}catch{}try{const Bt=await fetch("/api/adapter-config/avalanche");if(Bt.ok){const Ft={min_danger_level:((jf=(await Bt.json()).min_danger_level)==null?void 0:jf.value)??3};pe(Ft),st(JSON.stringify(Ft))}}catch{}try{const Bt=await fetch("/api/adapter-config/swpc");if(Bt.ok){const wt=await Bt.json(),Ft={geomag_kp_floor:((so=wt.geomag_kp_floor)==null?void 0:so.value)??7,flare_class_floor:((Rf=wt.flare_class_floor)==null?void 0:Rf.value)??"X1",proton_pfu_floor:((hg=wt.proton_pfu_floor)==null?void 0:hg.value)??10};et(Ft),Et(JSON.stringify(Ft))}}catch{}}catch(Of){d(Of instanceof Error?Of.message:"Failed to load config")}finally{u(!1)}})()},[]),G.useEffect(()=>{const _e=async()=>{try{a(await _B()),s(await xB())}catch{}};_e();const Ut=setInterval(_e,3e4);return()=>clearInterval(Ut)},[]);const lr=e!==null&&JSON.stringify(e)!==r,Mr=JSON.stringify(M)!==P,Gn=JSON.stringify(N)!==O,Wn=JSON.stringify(F)!==W,io=JSON.stringify(z)!==U,Af=JSON.stringify(Y)!==ie,ng=JSON.stringify(le)!==me,ig=JSON.stringify(Me)!==Te,ac=JSON.stringify(ze)!==lt,ag=lr||Mr||Gn||Wn||io||Af||ng||ig||ac,jt=async(_e,Ut,Hn)=>{const ui=await fetch(`/api/adapter-config/${_e}/${Ut}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:Hn})});if(!ui.ok){const Gi=await ui.json().catch(()=>({}));throw new Error(Gi.detail||`Failed to save ${_e}.${Ut}`)}},$x=async()=>{if(e){h(!0),d(null),m(null);try{if(lr){const _e=await fetch("/api/config/environmental",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Ut=await _e.json();if(!_e.ok)throw new Error(Ut.detail||"Save failed");n(JSON.stringify(e)),Ut.restart_required&&_(!0)}if(Mr){const _e=JSON.parse(P);M.freshness_seconds!==_e.freshness_seconds&&await jt("wfigs","freshness_seconds",M.freshness_seconds),JSON.stringify(M.allowed_incident_types)!==JSON.stringify(_e.allowed_incident_types)&&await jt("wfigs","allowed_incident_types",M.allowed_incident_types),M.cooldown_seconds!==_e.cooldown_seconds&&await jt("wfigs","cooldown_seconds",M.cooldown_seconds),M.broadcast_on_acres!==_e.broadcast_on_acres&&await jt("wfigs","broadcast_on_acres",M.broadcast_on_acres),M.broadcast_on_contained!==_e.broadcast_on_contained&&await jt("wfigs","broadcast_on_contained",M.broadcast_on_contained),I(JSON.stringify(M))}if(Gn){const _e=JSON.parse(O);N.digest_enabled!==_e.digest_enabled&&await jt("fires","digest_enabled",N.digest_enabled),JSON.stringify(N.digest_schedule)!==JSON.stringify(_e.digest_schedule)&&await jt("fires","digest_schedule",N.digest_schedule),N.digest_timezone!==_e.digest_timezone&&await jt("fires","digest_timezone",N.digest_timezone),R(JSON.stringify(N))}if(Wn){const _e=JSON.parse(W);F.min_magnitude!==_e.min_magnitude&&await jt("tomtom_incidents","min_magnitude",F.min_magnitude),F.drop_non_present!==_e.drop_non_present&&await jt("tomtom_incidents","drop_non_present",F.drop_non_present),F.drop_zero_magnitude!==_e.drop_zero_magnitude&&await jt("tomtom_incidents","drop_zero_magnitude",F.drop_zero_magnitude),V(JSON.stringify(F))}if(io){const _e=JSON.parse(U);z.min_severity!==_e.min_severity&&await jt("itd_511","min_severity",z.min_severity),JSON.stringify(z.enabled_categories)!==JSON.stringify(_e.enabled_categories)&&await jt("itd_511","enabled_categories",z.enabled_categories),JSON.stringify(z.enabled_sub_types)!==JSON.stringify(_e.enabled_sub_types)&&await jt("itd_511","enabled_sub_types",z.enabled_sub_types),$(JSON.stringify(z))}if(Af){const _e=JSON.parse(ie);Y.broadcast!==_e.broadcast&&await jt("wzdx","broadcast",Y.broadcast),Y.min_severity!==_e.min_severity&&await jt("wzdx","min_severity",Y.min_severity),JSON.stringify(Y.sub_types)!==JSON.stringify(_e.sub_types)&&await jt("wzdx","sub_types",Y.sub_types),se(JSON.stringify(Y))}if(ng){const _e=JSON.parse(me);JSON.stringify(le.broadcast_severities)!==JSON.stringify(_e.broadcast_severities)&&await jt("nws","broadcast_severities",le.broadcast_severities),le.duplicate_allowed_after_seconds!==_e.duplicate_allowed_after_seconds&&await jt("nws","duplicate_allowed_after_seconds",le.duplicate_allowed_after_seconds),ye(JSON.stringify(le))}if(ig){const _e=JSON.parse(Te);Me.min_danger_level!==_e.min_danger_level&&await jt("avalanche","min_danger_level",Me.min_danger_level),st(JSON.stringify(Me))}if(ac){const _e=JSON.parse(lt);ze.geomag_kp_floor!==_e.geomag_kp_floor&&await jt("swpc","geomag_kp_floor",ze.geomag_kp_floor),ze.flare_class_floor!==_e.flare_class_floor&&await jt("swpc","flare_class_floor",ze.flare_class_floor),ze.proton_pfu_floor!==_e.proton_pfu_floor&&await jt("swpc","proton_pfu_floor",ze.proton_pfu_floor),Et(JSON.stringify(ze))}m("Config saved"),setTimeout(()=>m(null),3e3)}catch(_e){d(_e instanceof Error?_e.message:"Save failed")}finally{h(!1)}}},og=()=>{e&&t(JSON.parse(r)),A(JSON.parse(P||JSON.stringify(M))),D(JSON.parse(O||JSON.stringify(N))),H(JSON.parse(W||JSON.stringify(F))),Z(JSON.parse(U||JSON.stringify(z))),te(JSON.parse(ie||JSON.stringify(Y))),Ee(JSON.parse(me||JSON.stringify(le))),pe(JSON.parse(Te||JSON.stringify(Me))),et(JSON.parse(lt||JSON.stringify(ze)))},sg=async()=>{try{await fetch("/api/restart",{method:"POST"}),_(!1),m("Restart initiated")}catch{d("Restart failed")}},Ue=_e=>e&&t({...e,..._e});if(l)return v.jsx("div",{className:"flex items-center justify-center h-64 text-slate-400",children:"Loading environmental configโ€ฆ"});if(!e)return v.jsx("div",{className:"flex items-center justify-center h-64 text-red-400",children:f||"No config"});const lg=_e=>i==null?void 0:i.feeds.find(Ut=>Ut.source===hs[_e].health),kf=_e=>o.filter(Ut=>Ut.source===hs[_e].health),ao=xS.find(_e=>_e.key===x),tn=ao.adapters.length===0?null:S&&ao.adapters.includes(S)?S:ao.adapters[0],pl=_e=>{var Ut,Hn,ui,Gi,gl;switch(_e){case"nws":return v.jsxs(v.Fragment,{children:[v.jsx(ou,{label:"NWS Zones",value:e.nws_zones,onChange:ee=>Ue({nws_zones:ee}),helper:"Zone IDs like IDZ016, IDZ030",infoLink:"https://www.weather.gov/pimar/PubZone"}),e.nws.feed_source!=="central"&&v.jsxs(v.Fragment,{children:[v.jsx(ct,{label:"User Agent",value:e.nws.user_agent,onChange:ee=>Ue({nws:{...e.nws,user_agent:ee}}),placeholder:"(MeshAI, you@email.com)",helper:"Format: (app_name, contact_email)"}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Tick Seconds",value:e.nws.tick_seconds,onChange:ee=>Ue({nws:{...e.nws,tick_seconds:ee}}),min:30}),v.jsx(Ln,{label:"Min Severity",value:e.nws.severity_min,onChange:ee=>Ue({nws:{...e.nws,severity_min:ee}}),options:[{value:"minor",label:"Minor"},{value:"moderate",label:"Moderate"},{value:"severe",label:"Severe"},{value:"extreme",label:"Extreme"}]})]})]}),e.nws.feed_source==="central"&&v.jsxs("div",{className:"border-t border-slate-700/50 pt-4 mt-4",children:[v.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Filters"}),v.jsxs("div",{className:"mb-3",children:[v.jsx("div",{className:"text-xs text-slate-400 mb-2",children:"Severities to broadcast"}),v.jsx("div",{className:"flex gap-6",children:["Extreme","Severe","Moderate","Minor"].map(ee=>v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:le.broadcast_severities.includes(ee),onChange:_t=>{const pt=le.broadcast_severities;Ee({...le,broadcast_severities:_t.target.checked?[...pt,ee]:pt.filter(dt=>dt!==ee)})},className:"w-4 h-4 rounded accent-blue-500"}),v.jsx("span",{className:"text-sm text-slate-300",children:ee})]},ee))})]}),v.jsx(We,{label:"Re-broadcast Cooldown (seconds)",value:le.duplicate_allowed_after_seconds,onChange:ee=>Ee({...le,duplicate_allowed_after_seconds:ee}),min:0,helper:"Minimum seconds before the same alert ID can be re-broadcast"})]})]});case"swpc":return v.jsx("div",{className:"space-y-6",children:v.jsxs("div",{children:[v.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Thresholds"}),v.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[v.jsx(Ln,{label:"Geomag Kp Floor",value:String(ze.geomag_kp_floor),onChange:ee=>et({...ze,geomag_kp_floor:Number(ee)}),options:[{value:"5",label:"5 โ€” G1 Minor"},{value:"6",label:"6 โ€” G2 Moderate"},{value:"7",label:"7 โ€” G3 Strong"},{value:"8",label:"8 โ€” G4 Severe"},{value:"9",label:"9 โ€” G5 Extreme"}],helper:"Kp at or above this triggers geomag broadcast"}),v.jsx(Ln,{label:"Flare Class Floor",value:ze.flare_class_floor,onChange:ee=>et({...ze,flare_class_floor:ee}),options:[{value:"M1",label:"M1 โ€” R1 Minor"},{value:"M5",label:"M5 โ€” R2 Moderate"},{value:"X1",label:"X1 โ€” R3 Strong"},{value:"X10",label:"X10 โ€” R4 Severe"}],helper:"X-ray flare class floor for broadcast"}),v.jsx(Ln,{label:"Proton pfu Floor",value:String(ze.proton_pfu_floor),onChange:ee=>et({...ze,proton_pfu_floor:Number(ee)}),options:[{value:"10",label:"10 โ€” S1 Minor"},{value:"100",label:"100 โ€” S2 Moderate"},{value:"1000",label:"1000 โ€” S3 Strong"},{value:"10000",label:"10000 โ€” S4 Severe"}],helper:"Proton flux (pfu) at โ‰ฅ10 MeV for broadcast"})]})]})});case"ducting":return v.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[v.jsx(We,{label:"Tick Seconds",value:e.ducting.tick_seconds,onChange:ee=>Ue({ducting:{...e.ducting,tick_seconds:ee}}),min:60}),v.jsx(We,{label:"Latitude",value:e.ducting.latitude,onChange:ee=>Ue({ducting:{...e.ducting,latitude:ee}}),step:.01}),v.jsx(We,{label:"Longitude",value:e.ducting.longitude,onChange:ee=>Ue({ducting:{...e.ducting,longitude:ee}}),step:.01})]});case"fires":return v.jsxs("div",{className:"space-y-6",children:[e.fires.feed_source!=="central"&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Tick Seconds",value:e.fires.tick_seconds,onChange:ee=>Ue({fires:{...e.fires,tick_seconds:ee}}),min:60}),v.jsx(Ln,{label:"State",value:e.fires.state,onChange:ee=>Ue({fires:{...e.fires,state:ee}}),options:W0e})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Incident Types"}),v.jsx("div",{className:"flex gap-6",children:[["WF","Wildfire"],["RX","Prescribed Burn"],["OTHER","Other"]].map(([ee,_t])=>{var pt;return v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:((pt=M.allowed_incident_types)==null?void 0:pt.includes(ee))??ee==="WF",onChange:dt=>{const ur=M.allowed_incident_types??["WF"];A({...M,allowed_incident_types:dt.target.checked?[...ur,ee]:ur.filter(oo=>oo!==ee)})},className:"w-4 h-4 rounded accent-blue-500"}),v.jsx("span",{className:"text-sm text-slate-300",children:_t})]},ee)})})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Triggers"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm text-slate-300",children:"Broadcast on acres increase"}),v.jsx("input",{type:"checkbox",checked:M.broadcast_on_acres,onChange:ee=>A({...M,broadcast_on_acres:ee.target.checked}),className:"w-4 h-4 rounded accent-blue-500"})]}),v.jsxs("label",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm text-slate-300",children:"Broadcast on containment increase"}),v.jsx("input",{type:"checkbox",checked:M.broadcast_on_contained,onChange:ee=>A({...M,broadcast_on_contained:ee.target.checked}),className:"w-4 h-4 rounded accent-blue-500"})]})]})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Update Cooldown (hours)",value:Math.round(M.cooldown_seconds/3600),onChange:ee=>A({...M,cooldown_seconds:ee*3600}),min:0,helper:"Minimum hours between updates for the same fire"}),v.jsx(We,{label:"Freshness Window (hours)",value:Math.round(M.freshness_seconds/3600),onChange:ee=>A({...M,freshness_seconds:ee*3600}),min:0,helper:"0 = always broadcast regardless of event age"})]})]});case"avalanche":return v.jsxs("div",{className:"space-y-6",children:[e.avalanche.feed_source!=="central"&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Tick Seconds",value:e.avalanche.tick_seconds,onChange:ee=>Ue({avalanche:{...e.avalanche,tick_seconds:ee}}),min:60}),v.jsx(U0e,{label:"Season Months",value:e.avalanche.season_months,onChange:ee=>Ue({avalanche:{...e.avalanche,season_months:ee}}),helper:"e.g., 12, 1, 2, 3, 4"})]}),v.jsx(ou,{label:"Center IDs",value:e.avalanche.center_ids,onChange:ee=>Ue({avalanche:{...e.avalanche,center_ids:ee}}),helper:"e.g., SNFAC",infoLink:"https://avalanche.org/avalanche-centers/"}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Settings"}),v.jsx("div",{className:"grid grid-cols-2 gap-4",children:v.jsx(Ln,{label:"Min Danger Level",value:String(Me.min_danger_level),onChange:ee=>pe({...Me,min_danger_level:Number(ee)}),options:[{value:"3",label:"3 โ€” Considerable"},{value:"4",label:"4 โ€” High"},{value:"5",label:"5 โ€” Extreme"}],helper:"Minimum avalanche danger level to broadcast"})})]})]});case"usgs":return v.jsxs(v.Fragment,{children:[v.jsx(We,{label:"Tick Seconds",value:e.usgs.tick_seconds,onChange:ee=>Ue({usgs:{...e.usgs,tick_seconds:ee}}),min:900,helper:"Minimum 15 min (900s). tick_seconds is the native-mode poll interval; ignored when this adapter is set to feed_source=central."}),v.jsx(ou,{label:"Site IDs",value:e.usgs.sites,onChange:ee=>Ue({usgs:{...e.usgs,sites:ee}}),helper:"USGS gauge site numbers",infoLink:"https://waterdata.usgs.gov/nwis"})]});case"usgs_quake":return v.jsxs("div",{className:"space-y-6",children:[e.usgs_quake.feed_source!=="central"&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Tick Seconds",value:e.usgs_quake.tick_seconds,onChange:ee=>Ue({usgs_quake:{...e.usgs_quake,tick_seconds:ee}}),min:60}),v.jsx(ct,{label:"Region Tag",value:e.usgs_quake.region,onChange:ee=>Ue({usgs_quake:{...e.usgs_quake,region:ee}})})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Magnitude Thresholds"}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Global Floor",value:e.usgs_quake.global_mag_floor,onChange:ee=>Ue({usgs_quake:{...e.usgs_quake,global_mag_floor:ee}}),step:.1,min:0,helper:"Broadcast anywhere at or above this magnitude"}),v.jsx(We,{label:"Regional Floor",value:e.usgs_quake.regional_mag_floor,onChange:ee=>Ue({usgs_quake:{...e.usgs_quake,regional_mag_floor:ee}}),step:.1,min:0,helper:"Reduced floor within regional radius"}),v.jsx(We,{label:"Regional Radius (mi)",value:e.usgs_quake.regional_radius_mi,onChange:ee=>Ue({usgs_quake:{...e.usgs_quake,regional_radius_mi:ee}}),min:50,helper:"Radius around region centroid for reduced floor"}),v.jsx(We,{label:"Escalation Floor",value:e.usgs_quake.escalate_mag_floor,onChange:ee=>Ue({usgs_quake:{...e.usgs_quake,escalate_mag_floor:ee}}),step:.1,min:0,helper:"Magnitude at which broadcast uses warning emoji"})]})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"PAGER Alert Levels"}),v.jsx("div",{className:"text-xs text-slate-500 mb-2",children:"Broadcast at any magnitude when USGS PAGER alert reaches these levels"}),v.jsx("div",{className:"flex gap-6",children:["green","yellow","orange","red"].map(ee=>v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:(e.usgs_quake.broadcast_pager_alerts??[]).includes(ee),onChange:_t=>{const pt=e.usgs_quake.broadcast_pager_alerts??[];Ue({usgs_quake:{...e.usgs_quake,broadcast_pager_alerts:_t.target.checked?[...pt,ee]:pt.filter(dt=>dt!==ee)}})},className:"w-4 h-4 rounded accent-blue-500"}),v.jsx("span",{className:"text-sm text-slate-300 capitalize",children:ee})]},ee))})]})]});case"traffic":return v.jsxs(v.Fragment,{children:[v.jsx(ct,{label:"API Key",value:e.traffic.api_key,onChange:ee=>Ue({traffic:{...e.traffic,api_key:ee}}),type:"password",helper:"developer.tomtom.com"}),v.jsx(We,{label:"Tick Seconds",value:e.traffic.tick_seconds,onChange:ee=>Ue({traffic:{...e.traffic,tick_seconds:ee}}),min:60}),v.jsx("div",{className:"text-xs text-slate-500 mt-2",children:"Corridors:"}),(e.traffic.corridors||[]).map((ee,_t)=>v.jsxs("div",{className:"grid grid-cols-4 gap-2 items-end",children:[v.jsx(ct,{label:"Name",value:ee.name,onChange:pt=>{const dt=[...e.traffic.corridors];dt[_t]={...ee,name:pt},Ue({traffic:{...e.traffic,corridors:dt}})}}),v.jsx(We,{label:"Lat",value:ee.lat,onChange:pt=>{const dt=[...e.traffic.corridors];dt[_t]={...ee,lat:pt},Ue({traffic:{...e.traffic,corridors:dt}})},step:.01}),v.jsx(We,{label:"Lon",value:ee.lon,onChange:pt=>{const dt=[...e.traffic.corridors];dt[_t]={...ee,lon:pt},Ue({traffic:{...e.traffic,corridors:dt}})},step:.01}),v.jsx("button",{onClick:()=>Ue({traffic:{...e.traffic,corridors:e.traffic.corridors.filter((pt,dt)=>dt!==_t)}}),className:"px-2 py-2 text-xs text-red-400 hover:text-red-300 border border-red-400/30 rounded",children:"Remove"})]},_t)),v.jsx("button",{onClick:()=>Ue({traffic:{...e.traffic,corridors:[...e.traffic.corridors||[],{name:"",lat:0,lon:0}]}}),className:"text-xs text-accent hover:underline",children:"+ Add Corridor"}),v.jsxs("div",{className:"border-t border-slate-700/50 pt-4 mt-4",children:[v.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Filters"}),v.jsx("div",{className:"grid grid-cols-2 gap-4",children:v.jsxs("div",{children:[v.jsx("label",{className:"text-xs text-slate-400 mb-1 block",children:"Minimum Magnitude"}),v.jsxs("select",{value:F.min_magnitude,onChange:ee=>H({...F,min_magnitude:parseInt(ee.target.value)}),className:"w-full bg-slate-900 border border-slate-700 rounded px-3 py-2 text-sm",children:[v.jsx("option",{value:1,children:"1 โ€” Minor (all)"}),v.jsx("option",{value:2,children:"2 โ€” Moderate (yellow+)"}),v.jsx("option",{value:3,children:"3 โ€” Major (orange+)"}),v.jsx("option",{value:4,children:"4 โ€” Severe (red only)"})]}),v.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Drop TomTom incidents below this severity level"})]})}),v.jsxs("div",{className:"mt-3 space-y-2",children:[v.jsxs("label",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm text-slate-300",children:"Drop non-present time validity"}),v.jsx("input",{type:"checkbox",checked:F.drop_non_present,onChange:ee=>H({...F,drop_non_present:ee.target.checked}),className:"w-4 h-4 rounded accent-blue-500"})]}),v.jsxs("label",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm text-slate-300",children:"Drop zero-magnitude events"}),v.jsx("input",{type:"checkbox",checked:F.drop_zero_magnitude,onChange:ee=>H({...F,drop_zero_magnitude:ee.target.checked}),className:"w-4 h-4 rounded accent-blue-500"})]})]})]})]});case"roads511":return v.jsxs(v.Fragment,{children:[v.jsx(ct,{label:"Base URL",value:e.roads511.base_url,onChange:ee=>Ue({roads511:{...e.roads511,base_url:ee}}),placeholder:"https://511.yourstate.gov/api/v2"}),v.jsx(ct,{label:"API Key",value:e.roads511.api_key,onChange:ee=>Ue({roads511:{...e.roads511,api_key:ee}}),type:"password",helper:"Leave empty if not required"}),v.jsx(We,{label:"Tick Seconds",value:e.roads511.tick_seconds,onChange:ee=>Ue({roads511:{...e.roads511,tick_seconds:ee}}),min:60}),v.jsx(ou,{label:"Endpoints",value:e.roads511.endpoints,onChange:ee=>Ue({roads511:{...e.roads511,endpoints:ee}}),helper:"e.g., /get/event"}),v.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((ee,_t)=>{var pt;return v.jsx(We,{label:ee,value:((pt=e.roads511.bbox)==null?void 0:pt[_t])??0,onChange:dt=>{const ur=[...e.roads511.bbox||[0,0,0,0]];ur[_t]=dt,Ue({roads511:{...e.roads511,bbox:ur}})},step:.01},ee)})}),v.jsxs("div",{className:"border-t border-slate-700/50 pt-4 mt-4",children:[v.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Filters"}),v.jsx("div",{className:"grid grid-cols-2 gap-4",children:v.jsxs("div",{children:[v.jsx("label",{className:"text-xs text-slate-400 mb-1 block",children:"Minimum Severity"}),v.jsxs("select",{value:z.min_severity,onChange:ee=>Z({...z,min_severity:ee.target.value}),className:"w-full bg-slate-900 border border-slate-700 rounded px-3 py-2 text-sm",children:[v.jsx("option",{value:"None",children:"None (all)"}),v.jsx("option",{value:"Minor",children:"Minor+"}),v.jsx("option",{value:"Major",children:"Major only"})]}),v.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Drop ITD 511 events below this severity"})]})}),v.jsxs("div",{className:"mt-4",children:[v.jsx("div",{className:"text-xs text-slate-400 mb-2",children:"Categories"}),v.jsx("div",{className:"flex gap-6",children:[["incident","Incident"],["closure","Closure"],["special_event","Special Event"]].map(([ee,_t])=>v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:z.enabled_categories.includes(ee),onChange:pt=>{const dt=z.enabled_categories;Z({...z,enabled_categories:pt.target.checked?[...dt,ee]:dt.filter(ur=>ur!==ee)})},className:"w-4 h-4 rounded accent-blue-500"}),v.jsx("span",{className:"text-sm text-slate-300",children:_t})]},ee))})]}),v.jsxs("div",{className:"mt-4",children:[v.jsx("div",{className:"text-xs text-slate-400 mb-2",children:"Sub-types"}),v.jsx("div",{className:"grid grid-cols-2 gap-2",children:[["accident","Crash"],["road_closed","Road Closed"],["lane_closed","Lane Closure"],["vehicle_on_fire","Vehicle Fire"],["flooding","Flooding"],["debris","Debris"],["road_works","Road Works"],["disabled_vehicle","Disabled Vehicle"]].map(([ee,_t])=>v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:z.enabled_sub_types.includes(ee),onChange:pt=>{const dt=z.enabled_sub_types;Z({...z,enabled_sub_types:pt.target.checked?[...dt,ee]:dt.filter(ur=>ur!==ee)})},className:"w-4 h-4 rounded accent-blue-500"}),v.jsx("span",{className:"text-sm text-slate-300",children:_t})]},ee))})]})]})]});case"wzdx":return v.jsxs(v.Fragment,{children:[((Ut=e.wzdx)==null?void 0:Ut.feed_source)!=="central"&&v.jsxs(v.Fragment,{children:[v.jsx(ct,{label:"Base URL",value:((Hn=e.wzdx)==null?void 0:Hn.base_url)??"",onChange:ee=>Ue({wzdx:{...e.wzdx,base_url:ee}}),placeholder:"https://511.yourstate.gov/api/v2"}),v.jsx(ct,{label:"API Key",value:((ui=e.wzdx)==null?void 0:ui.api_key)??"",onChange:ee=>Ue({wzdx:{...e.wzdx,api_key:ee}}),type:"password",helper:"Leave empty if not required"}),v.jsx(We,{label:"Tick Seconds",value:((Gi=e.wzdx)==null?void 0:Gi.tick_seconds)??300,onChange:ee=>Ue({wzdx:{...e.wzdx,tick_seconds:ee}}),min:60}),v.jsx(ou,{label:"Endpoints",value:((gl=e.wzdx)==null?void 0:gl.endpoints)??["/get/event"],onChange:ee=>Ue({wzdx:{...e.wzdx,endpoints:ee}}),helper:"e.g., /get/event"}),v.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((ee,_t)=>{var pt,dt;return v.jsx(We,{label:ee,value:((dt=(pt=e.wzdx)==null?void 0:pt.bbox)==null?void 0:dt[_t])??0,onChange:ur=>{var rn;const oo=[...((rn=e.wzdx)==null?void 0:rn.bbox)||[0,0,0,0]];oo[_t]=ur,Ue({wzdx:{...e.wzdx,bbox:oo}})},step:.01},ee)})}),v.jsx("div",{className:"text-xs text-slate-500",children:"Bounding box [W,S,E,N] geographic filter"})]}),v.jsxs("div",{className:"border-t border-slate-700/50 pt-4 mt-4",children:[v.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Settings"}),v.jsxs("label",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm text-slate-300",children:"Broadcast work zone events"}),v.jsx("input",{type:"checkbox",checked:Y.broadcast,onChange:ee=>te({...Y,broadcast:ee.target.checked}),className:"w-4 h-4 rounded accent-blue-500"})]}),Y.broadcast?v.jsxs("div",{className:"space-y-3 mt-3",children:[v.jsxs("div",{children:[v.jsx("label",{className:"text-xs text-slate-400 mb-1 block",children:"Min Severity"}),v.jsxs("select",{value:Y.min_severity,onChange:ee=>te({...Y,min_severity:ee.target.value}),className:"w-full bg-slate-900 border border-slate-700 rounded px-3 py-2 text-sm",children:[v.jsx("option",{value:"None",children:"None (all)"}),v.jsx("option",{value:"Minor",children:"Minor+"}),v.jsx("option",{value:"Major",children:"Major only"})]})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs text-slate-400 mb-2",children:"Sub-types"}),v.jsx("div",{className:"flex gap-6",children:[["road_works","Road Works"],["lane_closed","Lane Closure"],["road_closed","Road Closed"]].map(([ee,_t])=>v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:Y.sub_types.includes(ee),onChange:pt=>{const dt=Y.sub_types;te({...Y,sub_types:pt.target.checked?[...dt,ee]:dt.filter(ur=>ur!==ee)})},className:"w-4 h-4 rounded accent-blue-500"}),v.jsx("span",{className:"text-sm text-slate-300",children:_t})]},ee))})]})]}):v.jsxs("p",{className:"text-xs text-slate-500 mt-2",children:["Work zone events stored for LLM context only ","โ€”"," no mesh broadcasts."]})]})]});case"firms":return v.jsxs(v.Fragment,{children:[v.jsx(ct,{label:"MAP Key",value:e.firms.map_key,onChange:ee=>Ue({firms:{...e.firms,map_key:ee}}),type:"password",helper:"firms.modaps.eosdis.nasa.gov/api/area/",infoLink:"https://firms.modaps.eosdis.nasa.gov/api/area/"}),v.jsx(We,{label:"Tick Seconds",value:e.firms.tick_seconds,onChange:ee=>Ue({firms:{...e.firms,tick_seconds:ee}}),min:300}),v.jsx(Ln,{label:"Satellite Source",value:e.firms.source,onChange:ee=>Ue({firms:{...e.firms,source:ee}}),options:[{value:"VIIRS_SNPP_NRT",label:"VIIRS SNPP (NRT)"},{value:"VIIRS_NOAA20_NRT",label:"VIIRS NOAA-20 (NRT)"},{value:"MODIS_NRT",label:"MODIS (NRT)"}]}),v.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[v.jsx(We,{label:"Day Range",value:e.firms.day_range,onChange:ee=>Ue({firms:{...e.firms,day_range:ee}}),min:1,max:10}),v.jsx(Ln,{label:"Min Confidence",value:e.firms.confidence_min,onChange:ee=>Ue({firms:{...e.firms,confidence_min:ee}}),options:[{value:"low",label:"Low"},{value:"nominal",label:"Nominal"},{value:"high",label:"High"}]}),v.jsx(We,{label:"Proximity (km)",value:e.firms.proximity_km,onChange:ee=>Ue({firms:{...e.firms,proximity_km:ee}}),step:.5})]}),v.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((ee,_t)=>{var pt;return v.jsx(We,{label:ee,value:((pt=e.firms.bbox)==null?void 0:pt[_t])??0,onChange:dt=>{const ur=[...e.firms.bbox||[0,0,0,0]];ur[_t]=dt,Ue({firms:{...e.firms,bbox:ur}})},step:.01},ee)})})]})}},ug=e,cg=(_e,Ut)=>{const Hn=e[_e]||{};Ue({[_e]:{...Hn,...Ut}})};return v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("h1",{className:"text-xl font-semibold text-slate-200",children:"Environment"}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(or,{label:"Feeds Enabled",checked:e.enabled,onChange:_e=>Ue({enabled:_e})}),ag&&v.jsxs(v.Fragment,{children:[v.jsxs("button",{onClick:og,className:"flex items-center gap-1 px-3 py-1.5 text-sm text-slate-400 hover:text-slate-200 border border-border rounded",children:[v.jsx(K_,{size:14})," Discard"]}),v.jsxs("button",{onClick:$x,disabled:c,className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-accent text-white rounded disabled:opacity-50",children:[v.jsx(zM,{size:14})," ",c?"Savingโ€ฆ":"Save"]})]})]})]}),f&&v.jsx("div",{className:"text-sm text-red-400 bg-red-500/10 rounded p-3",children:f}),g&&v.jsx("div",{className:"text-sm text-green-400 bg-green-500/10 rounded p-3",children:g}),y&&v.jsxs("div",{className:"flex items-center justify-between text-sm text-amber-400 bg-amber-500/10 border border-amber-500/30 rounded p-3",children:[v.jsxs("span",{className:"flex items-center gap-2",children:[v.jsx($v,{size:14})," A restart is required for some changes to take effect."]}),v.jsx("button",{onClick:sg,className:"px-3 py-1 bg-amber-500/20 hover:bg-amber-500/30 rounded",children:"Restart now"})]}),v.jsx("div",{className:"flex gap-1 border-b border-border overflow-x-auto",children:xS.map(({key:_e,label:Ut,icon:Hn})=>v.jsxs("button",{onClick:()=>{w(_e);const ui=xS.find(Gi=>Gi.key===_e);T(ui.adapters[0]??null)},className:`flex items-center gap-2 px-4 py-2 text-sm whitespace-nowrap border-b-2 -mb-px transition-colors ${x===_e?"border-accent text-accent":"border-transparent text-slate-400 hover:text-slate-200"}`,children:[v.jsx(Hn,{size:15})," ",Ut]},_e))}),x==="central"&&e.central&&v.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{children:[v.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Central Connection"}),v.jsx("p",{className:"text-xs text-slate-600",children:'NATS JetStream source for any adapter set to "central"'})]}),v.jsx(or,{label:"",checked:!!e.central.enabled,onChange:_e=>Ue({central:{...e.central,enabled:_e}})})]}),v.jsxs("div",{className:e.central.enabled?"space-y-3":"space-y-3 opacity-40 pointer-events-none select-none",children:[v.jsx(ct,{label:"URL",value:e.central.url||"",onChange:_e=>Ue({central:{...e.central,url:_e}}),placeholder:"nats://central.echo6.mesh:4222"}),v.jsx(ct,{label:"Durable",value:e.central.durable||"",onChange:_e=>Ue({central:{...e.central,durable:_e}}),placeholder:"meshai-v04"}),v.jsx(ct,{label:"Region",value:e.central.region||"",onChange:_e=>Ue({central:{...e.central,region:_e}}),placeholder:"us.id",helper:"Central v0.9.20 region token (dotted, e.g. 'us.id'). Empty = bare wildcards (all-US firehose). Each adapter is either Central or native, never both โ€” see Reference โ†’ OR-not-AND Architecture for why."})]})]}),x==="tracking"&&v.jsxs("div",{className:"flex flex-col items-center justify-center h-[40vh] text-center",children:[v.jsx(J_,{size:32,className:"text-slate-600 mb-4"}),v.jsx("p",{className:"text-slate-500 max-w-md",children:"No adapters yet. ADS-B / AIS / satellite passes are planned for v0.5."})]}),x==="mesh"&&v.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{children:[v.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Mesh Health"}),v.jsx("p",{className:"text-xs text-slate-600",children:"Node/infra telemetry โ€” sourced from the mesh, not an environmental feed."})]}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx("span",{className:"text-[10px] uppercase tracking-wide text-slate-600",children:"source"}),v.jsx(JH,{value:"native",onChange:()=>{},disabled:!1,centralDisabled:!0})]})]}),v.jsx("div",{className:"text-[11px] text-slate-600",children:"Central not available โ€” reserved for a future migration."})]}),ao.adapters.length>0&&tn&&v.jsxs(v.Fragment,{children:[ao.adapters.length>1&&v.jsx("div",{className:"flex gap-1",children:ao.adapters.map(_e=>v.jsx("button",{onClick:()=>T(_e),className:`px-3 py-1.5 text-sm rounded ${tn===_e?"bg-bg-hover text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:hs[_e].label},_e))}),v.jsx(c_e,{title:hs[tn].label,subtitle:hs[tn].subtitle,enabled:((Lf=ug[tn])==null?void 0:Lf.enabled)??!1,onEnabled:_e=>cg(tn,{enabled:_e}),feedSource:((Nf=ug[tn])==null?void 0:Nf.feed_source)??"native",onFeedSource:_e=>cg(tn,{feed_source:_e}),hasCentral:hs[tn].hasCentral,nativeOnly:hs[tn].nativeOnly,hasKey:hs[tn].hasKey,health:lg(tn),events:kf(tn),children:pl(tn)})]})]})}const k3={infra_offline:mB,infra_recovery:ex,battery_warning:Z1,battery_critical:Z1,battery_emergency:Z1,hf_blackout:Dh,uhf_ducting:Di,weather_warning:Du,weather_watch:Du,new_router:Di,packet_flood:$a,sustained_high_util:$a,region_blackout:Vo,default:Zv};function f_e(e){return k3[e]||k3.default}function QH(e){switch(e==null?void 0:e.toLowerCase()){case"immediate":return{bg:"bg-red-500/10",border:"border-red-500",badge:"bg-red-500/20 text-red-400",iconColor:"text-red-500"};case"priority":return{bg:"bg-amber-500/10",border:"border-amber-500",badge:"bg-amber-500/20 text-amber-400",iconColor:"text-amber-500"};case"routine":default:return{bg:"bg-blue-500/10",border:"border-blue-500",badge:"bg-blue-500/20 text-blue-400",iconColor:"text-blue-500"}}}function d_e(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 v_e(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 p_e(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 g_e({alert:e,onAcknowledge:t}){var i;const r=QH(e.severity),n=f_e(e.type);return v.jsx("div",{className:`p-4 rounded-lg ${r.bg} border-l-4 ${r.border}`,children:v.jsxs("div",{className:"flex items-start gap-3",children:[v.jsx(n,{size:20,className:r.iconColor}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[v.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${r.badge}`,children:(i=e.severity)==null?void 0:i.toUpperCase()}),v.jsx("span",{className:"text-xs text-slate-500",children:e.type})]}),v.jsx("div",{className:"text-sm text-slate-200",children:e.message}),v.jsxs("div",{className:"flex items-center gap-4 mt-2 text-xs text-slate-500",children:[v.jsxs("span",{className:"flex items-center gap-1",children:[v.jsx(Iu,{size:12}),e.timestamp?d_e(e.timestamp):"Just now"]}),e.scope_value&&v.jsxs("span",{children:[e.scope_type,": ",e.scope_value]})]})]}),v.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 m_e({history:e,typeFilter:t,severityFilter:r,onTypeFilterChange:n,onSeverityFilterChange:i,page:a,totalPages:o,onPageChange:s}){const l=["all","infra_offline","infra_recovery","battery_warning","battery_critical","hf_blackout","uhf_ducting","weather_warning","new_router","packet_flood"],u=["all","immediate","priority","routine"];return v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg",children:[v.jsxs("div",{className:"p-4 border-b border-border flex items-center gap-4",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(RM,{size:14,className:"text-slate-400"}),v.jsx("span",{className:"text-sm text-slate-400",children:"Filter:"})]}),v.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=>v.jsx("option",{value:c,children:c==="all"?"All Types":c.replace(/_/g," ")},c))}),v.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=>v.jsx("option",{value:c,children:c==="all"?"All Severities":c.charAt(0).toUpperCase()+c.slice(1)},c))})]}),v.jsx("div",{className:"overflow-x-auto",children:v.jsxs("table",{className:"w-full",children:[v.jsx("thead",{children:v.jsxs("tr",{className:"border-b border-border",children:[v.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Time"}),v.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Type"}),v.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Severity"}),v.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Message"}),v.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Duration"})]})}),v.jsx("tbody",{children:e.length>0?e.map((c,h)=>{const f=QH(c.severity);return v.jsxs("tr",{className:"border-b border-border hover:bg-bg-hover",children:[v.jsx("td",{className:"p-4 text-sm text-slate-400 font-mono whitespace-nowrap",children:v_e(c.timestamp)}),v.jsx("td",{className:"p-4 text-sm text-slate-300",children:c.type.replace(/_/g," ")}),v.jsx("td",{className:"p-4",children:v.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${f.badge}`,children:c.severity})}),v.jsx("td",{className:"p-4 text-sm text-slate-200 max-w-md truncate",children:c.message}),v.jsx("td",{className:"p-4 text-sm text-slate-400 font-mono",children:c.duration?p_e(c.duration):"-"})]},c.id||h)}):v.jsx("tr",{children:v.jsx("td",{colSpan:5,className:"p-8 text-center text-slate-500",children:"No alert history available"})})})]})}),o>1&&v.jsxs("div",{className:"p-4 border-t border-border flex items-center justify-between",children:[v.jsxs("span",{className:"text-sm text-slate-400",children:["Page ",a," of ",o]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.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:v.jsx(F$,{size:16})}),v.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:v.jsx(Js,{size:16})})]})]})]})}function y_e({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 h=`${s%12||12}:${l} ${u}`;return e.sub_type==="weekly"&&e.schedule_day&&(h+=` ${e.schedule_day.charAt(0).toUpperCase()}${e.schedule_day.slice(1)}`),h},a=(()=>{switch(e.sub_type){case"alerts":return Zv;case"daily":return Iu;case"weekly":return Iu;default:return Zv}})();return v.jsx("div",{className:"p-4 rounded-lg bg-bg-hover border border-border",children:v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:"w-10 h-10 rounded-lg bg-blue-500/10 flex items-center justify-center",children:v.jsx(a,{size:18,className:"text-blue-400"})}),v.jsxs("div",{className:"flex-1",children:[v.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&&v.jsxs("span",{className:"text-slate-400 font-normal ml-2",children:["(",e.scope_type,": ",e.scope_value,")"]})]}),v.jsxs("div",{className:"text-xs text-slate-500 mt-0.5",children:[n()," โ€ข ",r(e.user_id)]})]}),v.jsx("div",{className:`w-2 h-2 rounded-full ${e.enabled?"bg-green-500":"bg-slate-500"}`})]})})}function __e(){const[e,t]=G.useState([]),[r,n]=G.useState([]),[i,a]=G.useState([]),[o,s]=G.useState([]),[l,u]=G.useState(!0),[c,h]=G.useState(null),[f,d]=G.useState("all"),[g,m]=G.useState("all"),[y,_]=G.useState(1),[x,w]=G.useState(1),S=20,[T,M]=G.useState(new Set),{lastAlert:A}=FM();G.useEffect(()=>{document.title="Alerts โ€” MeshAI"},[]),G.useEffect(()=>{Promise.all([yB().catch(()=>[]),OP(S,0).catch(()=>({items:[],total:0})),iY().catch(()=>[]),fetch("/api/nodes").then(N=>N.json()).catch(()=>[])]).then(([N,D,O,R])=>{t(N),Array.isArray(D)?(n(D),w(1)):(n(D.items||[]),w(Math.ceil((D.total||0)/S))),a(O),s(R),u(!1)}).catch(N=>{h(N.message),u(!1)})},[]),G.useEffect(()=>{A&&t(N=>N.some(O=>O.type===A.type&&O.message===A.message)?N:[A,...N])},[A]),G.useEffect(()=>{const N=(y-1)*S;OP(S,N,f,g).then(D=>{Array.isArray(D)?(n(D),w(1)):(n(D.items||[]),w(Math.ceil((D.total||0)/S)))}).catch(()=>{})},[y,f,g]);const P=G.useCallback(N=>{const D=`${N.type}-${N.message}-${N.timestamp}`;M(O=>new Set([...O,D]))},[]),I=e.filter(N=>{const D=`${N.type}-${N.message}-${N.timestamp}`;return!T.has(D)});return l?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-slate-400",children:"Loading alerts..."})}):c?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsxs("div",{className:"text-red-400",children:["Error: ",c]})}):v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[v.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[v.jsx($a,{size:14}),"Active Alerts (",I.length,")"]}),I.length>0?v.jsx("div",{className:"space-y-3",children:I.map((N,D)=>v.jsx(g_e,{alert:N,onAcknowledge:P},`${N.type}-${N.timestamp}-${D}`))}):v.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-8",children:[v.jsx(EM,{size:20,className:"text-green-500"}),v.jsx("span",{children:"No active alerts โ€” all systems nominal"})]})]}),v.jsxs("div",{children:[v.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[v.jsx(Iu,{size:14}),"Alert History"]}),v.jsx(m_e,{history:r,typeFilter:f,severityFilter:g,onTypeFilterChange:N=>{d(N),_(1)},onSeverityFilterChange:N=>{m(N),_(1)},page:y,totalPages:x,onPageChange:_})]}),v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[v.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[v.jsx(Q$,{size:14}),"Mesh Subscriptions (",i.length,")"]}),i.length>0?v.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:i.map(N=>v.jsx(y_e,{subscription:N,nodes:o},N.id))}):v.jsxs("div",{className:"text-slate-500 py-4",children:[v.jsx("p",{children:"No active subscriptions."}),v.jsxs("p",{className:"text-xs mt-2",children:["Manage subscriptions via ",v.jsx("code",{className:"text-blue-400",children:"!subscribe"})," on mesh. Broadcasts arrive with one of three prefixes โ€” ",v.jsx("strong",{children:"New:"})," (first sight), ",v.jsx("strong",{children:"Update:"})," (material change), or ",v.jsx("strong",{children:"Active:"})," (clock-driven reminder while the event is still live). See ",v.jsx("a",{href:"/reference#broadcast-types",className:"text-blue-400 hover:underline",children:"Broadcast Types"})," and ",v.jsx("a",{href:"/reference#reminders",className:"text-blue-400 hover:underline",children:"Reminder System"})," in Reference."]})]})]})]})}const Hy=[{value:"routine",label:"Routine",description:"Informational, no time pressure (ducting, new node, weather advisory, battery declining)"},{value:"priority",label:"Priority",description:"Needs attention soon (severe weather, fire nearby, node offline, HF blackout)"},{value:"immediate",label:"Immediate",description:"Act now, drop everything (fire at infrastructure, extreme weather, region blackout)"}],L3=[{id:"mesh_health",name:"Mesh Health Monitoring",description:"Infrastructure problems - offline nodes, low battery, channel congestion",rule:{name:"Mesh Health Monitoring",enabled:!0,trigger_type:"condition",categories:["infra_offline","critical_node_down","infra_recovery","battery_warning","battery_critical","battery_emergency","high_utilization","packet_flood","mesh_score_low"],min_severity:"routine",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:30,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"weather_fire",name:"Weather & Fire Alerts",description:"Environmental threats - severe weather, nearby wildfires, new ignitions, flooding",rule:{name:"Weather & Fire Alerts",enabled:!0,trigger_type:"condition",categories:["weather_warning","fire_proximity","new_ignition","stream_flood_warning"],min_severity:"priority",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:15,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"rf_conditions",name:"RF Conditions",description:"Propagation changes - solar events, HF blackouts, tropospheric ducting",rule:{name:"RF Conditions",enabled:!0,trigger_type:"condition",categories:["hf_blackout","tropospheric_ducting","geomagnetic_storm"],min_severity:"routine",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:60,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"road_traffic",name:"Road & Traffic",description:"Road closures and severe congestion",rule:{name:"Road & Traffic",enabled:!0,trigger_type:"condition",categories:["road_closure","traffic_congestion"],min_severity:"routine",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:30,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"everything_critical",name:"Everything Critical",description:"All emergency-level events regardless of type",rule:{name:"Everything Critical",enabled:!0,trigger_type:"condition",categories:[],min_severity:"immediate",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:5,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"morning_briefing",name:"Morning Briefing",description:"Daily health and conditions summary at 7am",rule:{name:"Morning Briefing",enabled:!0,trigger_type:"schedule",categories:[],min_severity:"routine",schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"mesh_health_summary",custom_message:"",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:0,node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}}];function uy(e){if(!e)return"Never";const r=Date.now()/1e3-e;return r<60?"Just now":r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:r<604800?`${Math.floor(r/86400)}d ago`:new Date(e*1e3).toLocaleDateString()}function Ai({info:e}){const[t,r]=G.useState(!1);return v.jsxs("div",{className:"relative inline-block",children:[v.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&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>r(!1)}),v.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 _s({label:e,value:t,onChange:r,type:n="text",placeholder:i="",helper:a="",info:o=""}){const[s,l]=G.useState(!1),u=n==="password";return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,o&&v.jsx(Ai,{info:o})]}),v.jsxs("div",{className:"relative",children:[v.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&&v.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?v.jsx(cB,{size:16}):v.jsx(jM,{size:16})})]}),a&&v.jsx("p",{className:"text-xs text-slate-600",children:a})]})}function Mp({label:e,value:t,onChange:r,min:n,max:i,step:a=1,helper:o="",info:s=""}){return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,s&&v.jsx(Ai,{info:s})]}),v.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&&v.jsx("p",{className:"text-xs text-slate-600",children:o})]})}function k_({label:e,checked:t,onChange:r,helper:n="",info:i=""}){return v.jsxs("div",{className:"flex items-center justify-between py-2",children:[v.jsxs("div",{children:[v.jsxs("span",{className:"flex items-center text-sm text-slate-300",children:[e,i&&v.jsx(Ai,{info:i})]}),n&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]}),v.jsx("button",{type:"button",onClick:()=>r(!t),className:`relative w-11 h-6 rounded-full transition-colors ${t?"bg-accent":"bg-[#1e2a3a]"}`,children:v.jsx("span",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${t?"translate-x-5":""}`})})]})}function Mv({label:e,value:t,onChange:r,helper:n="",info:i=""}){return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&v.jsx(Ai,{info:i})]}),v.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&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function Uy({label:e,value:t,onChange:r,placeholder:n="Add item...",helper:i="",info:a=""}){const[o,s]=G.useState(""),l=()=>{o.trim()&&!t.includes(o.trim())&&(r([...t,o.trim()]),s(""))},u=c=>{r(t.filter((h,f)=>f!==c))};return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&v.jsx(Ai,{info:a})]}),v.jsxs("div",{className:"flex gap-2",children:[v.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}),v.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:v.jsx(af,{size:16})})]}),t.length>0&&v.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:t.map((c,h)=>v.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-[#1e2a3a] rounded text-sm text-slate-300",children:[c,v.jsx("button",{type:"button",onClick:()=>u(h),className:"text-slate-500 hover:text-red-400",children:v.jsx(ca,{size:14})})]},h))}),i&&v.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function eU({value:e,onChange:t}){const[r,n]=G.useState(!1),i=Hy.find(a=>a.value===e)||Hy[0];return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Severity Threshold",v.jsx(Ai,{info:"Only alerts at or above this severity trigger this rule. ROUTINE = informational, PRIORITY = needs attention, IMMEDIATE = act now."})]}),v.jsxs("div",{className:"relative",children:[v.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:[v.jsxs("div",{children:[v.jsx("span",{className:"text-slate-200",children:i.label}),v.jsxs("span",{className:"text-slate-500 ml-2",children:["- ",i.description]})]}),v.jsx(ll,{size:16,className:`text-slate-500 transition-transform ${r?"rotate-180":""}`})]}),r&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>n(!1)}),v.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:Hy.map(a=>v.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:[v.jsx("div",{className:"font-medium text-slate-200",children:a.label}),v.jsx("div",{className:"text-xs text-slate-500",children:a.description})]},a.value))})]})]}),v.jsx("p",{className:"text-xs text-slate-600",children:'Lower = more notifications. "Warning" recommended for most rules.'})]})}function cy({rule:e}){const[t,r]=G.useState(!1),[n,i]=G.useState(null),a=async()=>{r(!0),i(null);try{let s={type:e.delivery_type};e.delivery_type==="mesh_broadcast"?s.channel_index=e.broadcast_channel:e.delivery_type==="mesh_dm"?s.node_ids=e.node_ids:e.delivery_type==="email"?s={type:"email",smtp_host:e.smtp_host,smtp_port:e.smtp_port,smtp_user:e.smtp_user,smtp_password:e.smtp_password,smtp_tls:e.smtp_tls,from_address:e.from_address,recipients:e.recipients}:e.delivery_type==="webhook"&&(s={type:"webhook",url:e.webhook_url,headers:e.webhook_headers});const u=await(await fetch("/api/notifications/channels/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})).json();i(u)}catch(s){i({success:!1,message:"Test failed",error:s instanceof Error?s.message:"Unknown error",details:{}})}finally{r(!1)}};if(!e.delivery_type)return null;const o={mesh_broadcast:v.jsx(Di,{size:14}),mesh_dm:v.jsx(OM,{size:14}),email:v.jsx(Y$,{size:14}),webhook:v.jsx(Z$,{size:14})}[e.delivery_type]||v.jsx(ex,{size:14});return v.jsxs("div",{className:"space-y-2",children:[v.jsx("button",{type:"button",onClick:a,disabled:t,className:"flex items-center gap-2 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 rounded text-sm disabled:opacity-50",children:t?v.jsxs(v.Fragment,{children:[v.jsx($v,{size:14,className:"animate-spin"}),"Testing..."]}):v.jsxs(v.Fragment,{children:[o,"Test Channel"]})}),n&&v.jsx("div",{className:`p-2 rounded text-xs ${n.success?"bg-green-500/10 border border-green-500/30 text-green-400":"bg-red-500/10 border border-red-500/30 text-red-400"}`,children:v.jsxs("div",{className:"flex items-start gap-2",children:[n.success?v.jsx(Za,{size:14,className:"mt-0.5 flex-shrink-0"}):v.jsx(ca,{size:14,className:"mt-0.5 flex-shrink-0"}),v.jsxs("div",{children:[v.jsx("div",{className:"font-medium",children:n.message}),n.error&&v.jsx("div",{className:"mt-1 text-red-300",children:n.error})]})]})})]})}function x_e({rule:e,ruleIndex:t,categories:r,regions:n,onChange:i,onDelete:a,onDuplicate:o,onTest:s}){var O,R,F,H,W;const[l,u]=G.useState(!e.name),[c,h]=G.useState(!1),[f,d]=G.useState(null),[g,m]=G.useState(null);G.useEffect(()=>{var V;e.name&&t>=0&&(fetch(`/api/notifications/rules/${t}/stats`).then(z=>z.json()).then(z=>d(z)).catch(()=>{}),(V=e.categories)!=null&&V.length&&fetch("/api/notifications/rules/sources",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({categories:e.categories})}).then(z=>z.json()).then(z=>m(z)).catch(()=>{}))},[e.name,t,e.categories]);const y=[{value:"",label:"(None)",description:"Rule matches but does not deliver"},{value:"mesh_broadcast",label:"Mesh Broadcast",description:"Send to a mesh radio channel"},{value:"mesh_dm",label:"Mesh DM",description:"Direct message to specific nodes"},{value:"email",label:"Email",description:"Send via SMTP"},{value:"webhook",label:"Webhook",description:"POST to any URL"}],_=[{value:"daily",label:"Daily"},{value:"twice_daily",label:"Twice Daily"},{value:"weekly",label:"Weekly"}],x=[{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"}],w=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],S=V=>{const z=e.categories||[];z.includes(V)?i({...e,categories:z.filter(Z=>Z!==V)}):i({...e,categories:[...z,V]})},T=(V,z)=>{const Z=e.categories||[];if(z==="add"){const U=Array.from(new Set([...Z,...V]));i({...e,categories:U})}else{const U=new Set(V);i({...e,categories:Z.filter($=>!U.has($))})}},M=V=>{const z=e.region_scope||[];z.includes(V)?i({...e,region_scope:z.filter(Z=>Z!==V)}):i({...e,region_scope:[...z,V]})},A=V=>{const z=e.schedule_days||[];z.includes(V)?i({...e,schedule_days:z.filter(Z=>Z!==V)}):i({...e,schedule_days:[...z,V]})},P=async()=>{h(!0),await s(),h(!1)},I=()=>{if(e.trigger_type==="schedule")return"[Scheduled report preview would appear here]";const V=e.categories||[];if(V.length===0&&r.length>0)return r[0].example_message||"Alert notification";const z=r.find(Z=>V.includes(Z.id));return(z==null?void 0:z.example_message)||"Alert notification"},N=()=>{var z,Z,U,$,Y,te,ie,se;const V=[];if(e.trigger_type==="schedule"){const le=((z=_.find(me=>me.value===e.schedule_frequency))==null?void 0:z.label)||e.schedule_frequency,Ee=((Z=x.find(me=>me.value===e.message_type))==null?void 0:Z.label)||e.message_type;V.push(`${le} at ${e.schedule_time||"??:??"}`),V.push(Ee)}else{const le=((U=e.categories)==null?void 0:U.length)||0,Ee=le===0?"All":r.filter(ye=>{var Me;return(Me=e.categories)==null?void 0:Me.includes(ye.id)}).map(ye=>ye.name).slice(0,2).join(", ")+(le>2?` +${le-2}`:""),me=(($=Hy.find(ye=>ye.value===e.min_severity))==null?void 0:$.label)||e.min_severity;V.push(`${Ee} at ${me}+`)}if(!e.delivery_type)V.push("No delivery");else{const le=((Y=y.find(me=>me.value===e.delivery_type))==null?void 0:Y.label)||e.delivery_type;let Ee="";if(e.delivery_type==="mesh_broadcast")Ee=`Ch ${e.broadcast_channel}`;else if(e.delivery_type==="mesh_dm")Ee=`${((te=e.node_ids)==null?void 0:te.length)||0} nodes`;else if(e.delivery_type==="email")Ee=(ie=e.recipients)!=null&&ie.length?e.recipients[0]+(e.recipients.length>1?` +${e.recipients.length-1}`:""):"no recipients";else if(e.delivery_type==="webhook")try{Ee=new URL(e.webhook_url).hostname}catch{Ee=((se=e.webhook_url)==null?void 0:se.slice(0,20))||"no URL"}V.push(`${le}${Ee?` (${Ee})`:""}`)}return V.join(" -> ")},D=()=>{var z;if(!g||!((z=e.categories)!=null&&z.length))return null;const V=new Map;for(const[,Z]of Object.entries(g)){const U=V.get(Z.source);U?(U.events+=Z.active_events,U.enabled=U.enabled&&Z.enabled):V.set(Z.source,{enabled:Z.enabled,events:Z.active_events})}return Array.from(V.entries()).map(([Z,{enabled:U,events:$}])=>v.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs ${U?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"}`,title:U?`${$} active`:"Not enabled",children:[U?v.jsx(ex,{size:10}):v.jsx(mB,{size:10}),Z.toUpperCase(),U&&$>0&&` (${$})`]},Z))};return v.jsxs("div",{className:`border rounded-lg overflow-hidden ${e.enabled?"border-[#1e2a3a]":"border-slate-700 opacity-60"}`,children:[v.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>u(!l),children:[v.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[l?v.jsx(ll,{size:16,className:"text-slate-500 flex-shrink-0"}):v.jsx(Js,{size:16,className:"text-slate-500 flex-shrink-0"}),v.jsx("button",{onClick:V=>{V.stopPropagation(),i({...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"?v.jsx(Iu,{size:14,className:"text-blue-400 flex-shrink-0"}):v.jsx(Dh,{size:14,className:"text-yellow-400 flex-shrink-0"}),v.jsx("span",{className:"font-medium text-slate-200 truncate",title:e.name||void 0,children:e.name||"New Rule"}),!l&&v.jsx("span",{className:`text-xs truncate hidden sm:block ${e.delivery_type?"text-slate-500":"text-amber-400"}`,children:N()})]}),v.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[!l&&(()=>{const V="hidden sm:inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs mr-2";if(!e.enabled)return v.jsx("span",{className:`${V} bg-slate-800 text-slate-500`,children:"Disabled"});if(!f)return null;const z=f.fire_count||0,Z=f.last_fired,U=Date.now()/1e3-7*86400;return z>0&&Z&&Z>=U?v.jsx("span",{className:`${V} bg-green-500/10 text-green-400`,title:`Last fired ${uy(Z)}`,children:"Active"}):z>0&&Z?v.jsx("span",{className:`${V} bg-yellow-500/10 text-yellow-400`,title:`Last fired ${uy(Z)}`,children:"Idle (no recent activity)"}):v.jsx("span",{className:`${V} bg-slate-800 text-slate-400`,children:"No activity yet"})})(),!l&&v.jsx("div",{className:"hidden md:flex items-center gap-1 mr-2",children:D()}),v.jsx("button",{onClick:V=>{V.stopPropagation(),P()},disabled:c||!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:v.jsx(xC,{size:14})}),v.jsx("button",{onClick:V=>{V.stopPropagation(),o()},className:"p-1.5 text-slate-400 hover:text-slate-200 hover:bg-slate-500/10 rounded",title:"Duplicate",children:v.jsx(H$,{size:14})}),v.jsx("button",{onClick:V=>{V.stopPropagation(),a()},className:"p-1.5 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",title:"Delete",children:v.jsx(Ep,{size:14})})]})]}),!l&&e.name&&v.jsxs("div",{className:"px-3 pb-2 pt-0 bg-[#0a0e17] flex items-center gap-2 flex-wrap text-xs",children:[!e.delivery_type&&v.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 bg-amber-500/10 text-amber-400 rounded",children:[v.jsx(Vo,{size:10}),"No delivery method"]}),(f==null?void 0:f.fire_count)!==void 0&&f.fire_count>0&&v.jsxs("span",{className:"text-slate-500",children:["Fired ",f.fire_count,"x"]})]}),l&&v.jsxs("div",{className:"p-4 space-y-6 border-t border-[#1e2a3a]",children:[v.jsx(_s,{label:"Rule Name",value:e.name,onChange:V=>i({...e,name:V}),placeholder:"e.g., Emergency Broadcast, Daily Health Report",helper:"A descriptive name for this rule"}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Trigger Type"}),v.jsxs("div",{className:"flex gap-2",children:[v.jsxs("button",{type:"button",onClick:()=>i({...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:[v.jsx(Dh,{size:16}),v.jsx("span",{children:"Condition"})]}),v.jsxs("button",{type:"button",onClick:()=>i({...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:[v.jsx(Iu,{size:16}),v.jsx("span",{children:"Schedule"})]})]}),v.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"&&v.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[v.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[v.jsx($a,{size:14}),"WHEN (Condition)"]}),v.jsx(eU,{value:e.min_severity,onChange:V=>i({...e,min_severity:V})}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Alert Categories",v.jsx(Ai,{info:"Select which types of alerts trigger this rule. Leave all unchecked to match ALL categories. Categories are grouped by family โ€” use the 'All' / 'Clear' buttons in each header to bulk-toggle."})]}),v.jsx("div",{className:"text-xs text-slate-500 mb-2",children:(((O=e.categories)==null?void 0:O.length)||0)===0?"All categories (none selected)":`${(R=e.categories)==null?void 0:R.length} selected`}),v.jsx(b_e,{categories:r,selected:e.categories||[],onToggle:S,onSelectMany:T})]}),g&&Object.keys(g).length>0&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Data Sources"}),v.jsx("div",{className:"flex flex-wrap gap-2",children:D()})]})]}),e.trigger_type==="schedule"&&v.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[v.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[v.jsx(B$,{size:14}),"WHEN (Schedule)"]}),v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Frequency"}),v.jsx("select",{value:e.schedule_frequency||"daily",onChange:V=>i({...e,schedule_frequency:V.target.value}),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:_.map(V=>v.jsx("option",{value:V.value,children:V.label},V.value))})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Mv,{label:"Time",value:e.schedule_time||"07:00",onChange:V=>i({...e,schedule_time:V})}),e.schedule_frequency==="twice_daily"&&v.jsx(Mv,{label:"Second Time",value:e.schedule_time_2||"19:00",onChange:V=>i({...e,schedule_time_2:V})})]}),e.schedule_frequency==="weekly"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Days"}),v.jsx("div",{className:"flex flex-wrap gap-2",children:w.map(V=>{var z;return v.jsx("button",{type:"button",onClick:()=>A(V),className:`px-3 py-1.5 rounded text-sm capitalize transition-colors ${(z=e.schedule_days)!=null&&z.includes(V)?"bg-accent text-white":"bg-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,children:V.slice(0,3)},V)})})]}),v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Report Type"}),v.jsx("select",{value:e.message_type||"mesh_health_summary",onChange:V=>i({...e,message_type:V.target.value}),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:x.map(V=>v.jsx("option",{value:V.value,children:V.label},V.value))}),v.jsx("p",{className:"text-xs text-slate-600",children:(F=x.find(V=>V.value===e.message_type))==null?void 0:F.description})]}),e.message_type==="custom"&&v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Custom Message",v.jsx(Ai,{info:"Available tokens: {MESH_SCORE}, {NODE_COUNT}, {NODES_ONLINE}, {ACTIVE_ALERTS}, {KP}, {SFI}, {DATE}, {TIME}"})]}),v.jsx("textarea",{value:e.custom_message||"",onChange:V=>i({...e,custom_message:V.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"})]})]}),v.jsxs("div",{className:"space-y-2 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[v.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[v.jsx(nf,{size:14}),"REGIONS",v.jsx(Ai,{info:"Limit this rule to alerts from specific regions. Empty selection = all regions (backward compatible). Region names come from /api/regions."})]}),v.jsx("div",{className:"text-xs text-slate-500",children:(((H=e.region_scope)==null?void 0:H.length)||0)===0?"All regions (none selected)":`${e.region_scope.length} of ${n.length} selected`}),n.length===0?v.jsx("div",{className:"text-xs text-slate-600 italic",children:"No regions configured."}):v.jsx("div",{className:"flex flex-wrap gap-2",children:n.map(V=>{const z=(e.region_scope||[]).includes(V.name);return v.jsx("button",{type:"button",onClick:()=>M(V.name),className:`px-3 py-1.5 rounded text-sm transition-colors ${z?"bg-accent text-white":"bg-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,title:V.local_name||V.name,children:V.local_name||V.name},V.name)})})]}),v.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[v.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[v.jsx(xC,{size:14}),"SEND VIA"]}),v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Delivery Method",v.jsx(Ai,{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."})]}),v.jsx("select",{value:e.delivery_type||"",onChange:V=>i({...e,delivery_type:V.target.value}),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:y.map(V=>v.jsx("option",{value:V.value,children:V.label},V.value))}),v.jsx("p",{className:"text-xs text-slate-600",children:(W=y.find(V=>V.value===(e.delivery_type||"")))==null?void 0:W.description})]}),!e.delivery_type&&v.jsxs("div",{className:"flex items-start gap-2 p-3 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:[v.jsx(Vo,{size:16,className:"text-amber-400 mt-0.5 flex-shrink-0"}),v.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"&&v.jsxs(v.Fragment,{children:[v.jsx(LL,{label:"Broadcast Channel",value:e.broadcast_channel??0,onChange:V=>i({...e,broadcast_channel:V}),helper:"Select the mesh radio channel",mode:"single"}),v.jsx(cy,{rule:e})]}),e.delivery_type==="mesh_dm"&&v.jsxs(v.Fragment,{children:[v.jsx(kL,{label:"Recipient Nodes",value:e.node_ids||[],onChange:V=>i({...e,node_ids:V}),helper:"Nodes that receive direct messages",valueType:"node_id_hex"}),v.jsx(cy,{rule:e})]}),e.delivery_type==="email"&&v.jsxs("div",{className:"space-y-4",children:[v.jsx(Uy,{label:"Recipients",value:e.recipients||[],onChange:V=>i({...e,recipients:V}),placeholder:"email@example.com",helper:"Email addresses to receive alerts"}),v.jsxs("details",{className:"group",children:[v.jsxs("summary",{className:"flex items-center gap-2 cursor-pointer text-sm text-slate-400 hover:text-slate-200",children:[v.jsx(Js,{size:14,className:"group-open:rotate-90 transition-transform"}),"SMTP Configuration"]}),v.jsxs("div",{className:"mt-4 space-y-4 pl-6 border-l border-[#1e2a3a]",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(_s,{label:"SMTP Host",value:e.smtp_host||"",onChange:V=>i({...e,smtp_host:V}),placeholder:"smtp.gmail.com"}),v.jsx(Mp,{label:"SMTP Port",value:e.smtp_port??587,onChange:V=>i({...e,smtp_port:V}),min:1,max:65535})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(_s,{label:"Username",value:e.smtp_user||"",onChange:V=>i({...e,smtp_user:V})}),v.jsx(_s,{label:"Password",value:e.smtp_password||"",onChange:V=>i({...e,smtp_password:V}),type:"password",info:"Gmail users: use an App Password from myaccount.google.com/apppasswords"})]}),v.jsx(k_,{label:"Use TLS",checked:e.smtp_tls??!0,onChange:V=>i({...e,smtp_tls:V})}),v.jsx(_s,{label:"From Address",value:e.from_address||"",onChange:V=>i({...e,from_address:V}),placeholder:"alerts@yourdomain.com"})]})]}),v.jsx(cy,{rule:e})]}),e.delivery_type==="webhook"&&v.jsxs(v.Fragment,{children:[v.jsx(_s,{label:"Webhook URL",value:e.webhook_url||"",onChange:V=>i({...e,webhook_url:V}),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."}),v.jsx(cy,{rule:e})]})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Mp,{label:"Cooldown (minutes)",value:e.cooldown_minutes??10,onChange:V=>i({...e,cooldown_minutes:V}),min:0,helper:"Min time between repeat sends",info:"Prevents alert spam. Same condition won't re-trigger this rule within this window."})," "]}),f&&v.jsxs("div",{className:"flex items-center gap-4 text-xs text-slate-500",children:[v.jsxs("span",{children:["Last fired: ",uy(f.last_fired)]}),v.jsxs("span",{children:["Last tested: ",uy(f.last_test)]}),v.jsxs("span",{children:["Total fires: ",f.fire_count]})]}),e.trigger_type!=="schedule"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Example Message"}),v.jsx("div",{className:"p-3 bg-[#1e2a3a]/50 rounded-lg border border-[#1e2a3a]",children:v.jsx("p",{className:"text-sm text-slate-300 font-mono",children:I()})}),v.jsx("p",{className:"text-xs text-slate-600",children:"This is an example of what this rule would send."})]})]})]})}const Zy=[{key:"mesh_health",label:"Mesh Health",Icon:rf},{key:"weather",label:"Weather",Icon:Du},{key:"fire",label:"Fire",Icon:Y_},{key:"rf_propagation",label:"RF Propagation",Icon:Di},{key:"roads",label:"Roads",Icon:Z_},{key:"avalanche",label:"Avalanche",Icon:J$},{key:"seismic",label:"Seismic",Icon:q_},{key:"tracking",label:"Tracking",Icon:nf}];function b_e({categories:e,selected:t,onToggle:r,onSelectMany:n}){const i=new Set(Zy.map(f=>f.key)),a=new Map;Zy.forEach(f=>a.set(f.key,[]));const o=[];for(const f of e){const d=f.toggle;d&&i.has(d)?a.get(d).push(f):o.push(f)}const s=new Set;for(const[f,d]of a)d.some(g=>t.includes(g.id))&&s.add(f);o.some(f=>t.includes(f.id))&&s.add("other");const[l,u]=G.useState(s),c=f=>{u(d=>{const g=new Set(d);return g.has(f)?g.delete(f):g.add(f),g})},h=(f,d,g,m)=>{if(!m.length)return null;const y=l.has(f),_=m.map(w=>w.id),x=_.filter(w=>t.includes(w)).length;return v.jsxs("div",{className:"border border-[#1e2a3a] rounded",children:[v.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 bg-[#0d1420]",children:[v.jsxs("button",{type:"button",onClick:()=>c(f),className:"flex items-center gap-2 text-sm text-slate-200 flex-1 min-w-0",children:[y?v.jsx(ll,{size:14,className:"text-slate-500 flex-shrink-0"}):v.jsx(Js,{size:14,className:"text-slate-500 flex-shrink-0"}),g&&v.jsx(g,{size:14,className:"text-slate-400 flex-shrink-0"}),v.jsxs("span",{className:"truncate",children:[d," (",m.length,")"]}),x>0&&v.jsxs("span",{className:"ml-1 text-xs text-accent",children:[x," selected"]})]}),v.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[v.jsx("button",{type:"button",onClick:w=>{w.stopPropagation(),n(_,"add")},className:"text-xs px-2 py-0.5 rounded text-slate-400 hover:text-accent hover:bg-accent/10",title:"Select all in family",children:"All"}),v.jsx("button",{type:"button",onClick:w=>{w.stopPropagation(),n(_,"remove")},className:"text-xs px-2 py-0.5 rounded text-slate-400 hover:text-red-400 hover:bg-red-500/10",title:"Clear family",children:"Clear"})]})]}),y&&v.jsx("div",{className:"p-1 space-y-1",children:m.map(w=>v.jsxs("label",{onClick:()=>r(w.id),className:"flex items-start gap-2 p-2 rounded hover:bg-[#1e2a3a]/50 cursor-pointer",children:[v.jsx("div",{className:`w-4 h-4 mt-0.5 rounded border flex items-center justify-center flex-shrink-0 ${t.includes(w.id)?"bg-accent border-accent":"border-slate-600"}`,children:t.includes(w.id)&&v.jsx(Za,{size:12,className:"text-white"})}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("div",{className:"text-sm text-slate-200",children:w.name}),v.jsx("div",{className:"text-xs text-slate-500",children:w.description})]})]},w.id))})]},f)};return v.jsxs("div",{className:"max-h-96 overflow-y-auto border border-[#1e2a3a] rounded-lg p-2 space-y-2",children:[Zy.map(f=>h(f.key,f.label,f.Icon,a.get(f.key)||[])),h("other","Other",null,o)]})}const N3=["digest","mesh_broadcast","mesh_dm","email","webhook"],w_e=["routine","priority","immediate"];function S_e({toggles:e,onChange:t}){const[r,n]=G.useState(null),i=(a,o)=>t({...e,[a]:{...e[a]||{},name:a,...o}});return v.jsxs("div",{className:"space-y-3 mb-8",children:[v.jsxs("div",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Master Toggles",v.jsx(Ai,{info:"Per-family notification policy: enable a family, set its severity threshold, choose which channels fire at each severity, and scope to regions (PagerDuty/Grafana-style)."})]}),v.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Zy.map(({key:a,label:o,Icon:s})=>{const l=e[a]||{},u=r===a,c=Object.values(l.severity_channels||{}).reduce((f,d)=>f+((d==null?void 0:d.length)||0),0),h=(l.regions||[]).length;return v.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("button",{type:"button",onClick:()=>n(u?null:a),className:"flex items-center gap-2 text-sm text-slate-200",children:[v.jsx(s,{size:15})," ",o,u?v.jsx(ll,{size:14}):v.jsx(Js,{size:14})]}),v.jsx(k_,{label:"",checked:!!l.enabled,onChange:f=>i(a,{enabled:f})})]}),!u&&v.jsx("div",{className:"text-xs text-slate-600 mt-1",children:l.enabled?`${h||"all"} region${h===1?"":"s"}, ${c} channel${c===1?"":"s"} at ${l.min_severity||"priority"}+`:"OFF"}),u&&v.jsxs("div",{className:`mt-3 space-y-3 ${l.enabled?"":"opacity-40 pointer-events-none select-none"}`,children:[v.jsx(eU,{value:l.min_severity||"priority",onChange:f=>i(a,{min_severity:f})}),v.jsx("div",{className:"text-xs text-slate-500",children:"Severity โ†’ channels"}),v.jsxs("table",{className:"text-xs w-full",children:[v.jsx("thead",{children:v.jsxs("tr",{children:[v.jsx("th",{}),N3.map(f=>v.jsx("th",{className:"text-slate-500 font-normal px-1",children:f.replace("_"," ")},f))]})}),v.jsx("tbody",{children:w_e.map(f=>v.jsxs("tr",{children:[v.jsx("td",{className:"text-slate-400 pr-2",children:f}),N3.map(d=>{var m;const g=(((m=l.severity_channels)==null?void 0:m[f])||[]).includes(d);return v.jsx("td",{className:"text-center",children:v.jsx("input",{type:"checkbox",checked:g,onChange:y=>{const _={...l.severity_channels||{}},x=new Set(_[f]||[]);y.target.checked?x.add(d):x.delete(d),_[f]=Array.from(x),i(a,{severity_channels:_})}})},d)})]},f))})]}),v.jsx(Uy,{label:"Regions (empty = all)",value:l.regions||[],onChange:f=>i(a,{regions:f}),placeholder:"Add region..."})," ",v.jsx("div",{className:"text-xs text-slate-500 pt-1",children:"Channel config"}),v.jsx(Mp,{label:"Broadcast channel",value:l.broadcast_channel??0,onChange:f=>i(a,{broadcast_channel:f})}),v.jsx(Uy,{label:"DM node IDs",value:l.node_ids||[],onChange:f=>i(a,{node_ids:f}),placeholder:"!nodeid"}),v.jsx(Uy,{label:"Email recipients",value:l.recipients||[],onChange:f=>i(a,{recipients:f}),placeholder:"ops@example.com"}),v.jsx(_s,{label:"SMTP host",value:l.smtp_host||"",onChange:f=>i(a,{smtp_host:f}),placeholder:"smtp.example.com"}),v.jsx(Mp,{label:"SMTP port",value:l.smtp_port??587,onChange:f=>i(a,{smtp_port:f})}),v.jsx(_s,{label:"Webhook URL",value:l.webhook_url||"",onChange:f=>i(a,{webhook_url:f}),placeholder:"https://..."})]})]},a)})})]})}function C_e(){var z,Z,U;const[e,t]=G.useState(null),[r,n]=G.useState(null),[i,a]=G.useState([]),[o,s]=G.useState([]),[l,u]=G.useState(!0),[c,h]=G.useState(!1),[f,d]=G.useState(null),[g,m]=G.useState(null),[y,_]=G.useState(null),[x,w]=G.useState({open:!1,ruleIndex:-1,loading:!1,action:""}),[S,T]=G.useState(!1),[M,A]=G.useState(!1),P=G.useCallback(async()=>{try{const[$,Y,te]=await Promise.all([fetch("/api/config/notifications"),fetch("/api/notifications/categories"),fetch("/api/regions")]);if(!$.ok)throw new Error("Failed to fetch notifications config");const ie=await $.json(),se=await Y.json(),le=te.ok?await te.json():[];t(ie),n(JSON.parse(JSON.stringify(ie))),a(se),s(Array.isArray(le)?le:[]),A(!1),d(null)}catch($){d($ instanceof Error?$.message:"Unknown error")}finally{u(!1)}},[]);G.useEffect(()=>{document.title="Notifications - MeshAI",P()},[P]),G.useEffect(()=>{e&&r&&A(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);const I=async()=>{if(e){h(!0),d(null),m(null);try{const $=await fetch("/api/config/notifications",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Y=await $.json();if(!$.ok)throw new Error(Y.detail||"Save failed");m("Notifications config saved successfully"),n(JSON.parse(JSON.stringify(e))),A(!1),setTimeout(()=>m(null),3e3)}catch($){d($ instanceof Error?$.message:"Save failed")}finally{h(!1)}}},N=()=>{r&&(t(JSON.parse(JSON.stringify(r))),A(!1))},D=()=>({name:"",enabled:!0,trigger_type:"condition",categories:[],min_severity:"routine",schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"19:00",schedule_days:["monday"],message_type:"mesh_health_summary",custom_message:"",delivery_type:"",broadcast_channel:0,node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{},cooldown_minutes:10,region_scope:[]}),O=()=>{e&&t({...e,rules:[...e.rules||[],D()]})},R=$=>{if(!e)return;const Y=L3.find(te=>te.id===$);Y&&(t({...e,rules:[...e.rules||[],{...D(),...Y.rule}]}),T(!1))},F=$=>{if(!e)return;const Y=e.rules[$],te={...JSON.parse(JSON.stringify(Y)),name:`${Y.name} (copy)`},ie=[...e.rules];ie.splice($+1,0,te),t({...e,rules:ie})},H=async $=>{w({open:!0,ruleIndex:$,loading:!0,action:""});try{const te=await(await fetch(`/api/notifications/rules/${$}/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"preview"})})).json();_(te),w(ie=>({...ie,loading:!1}))}catch{_({success:!1,message:"Failed to get preview"}),w(Y=>({...Y,loading:!1}))}},W=async $=>{const Y=x.ruleIndex;w(te=>({...te,loading:!0,action:$}));try{const ie=await(await fetch(`/api/notifications/rules/${Y}/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:$})})).json();_(ie),w(se=>({...se,loading:!1}))}catch{_({success:!1,message:`Failed to ${$}`}),w(te=>({...te,loading:!1}))}},V=()=>{w({open:!1,ruleIndex:-1,loading:!1,action:""}),_(null)};return l?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-slate-400",children:"Loading notifications config..."})}):e?v.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[x.open&&v.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:v.jsxs("div",{className:"bg-[#1a2332] border border-[#2a3a4a] rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[85vh] overflow-auto",children:[v.jsxs("div",{className:"p-4 border-b border-[#2a3a4a] flex items-center justify-between sticky top-0 bg-[#1a2332]",children:[v.jsx("h3",{className:"text-lg font-semibold",children:"Test Notification Rule"}),v.jsx("button",{onClick:V,className:"text-slate-500 hover:text-slate-300",children:v.jsx(ca,{size:20})})]}),v.jsx("div",{className:"p-4 space-y-4",children:x.loading?v.jsxs("div",{className:"flex items-center justify-center py-8",children:[v.jsx($v,{size:20,className:"animate-spin text-slate-400 mr-2"}),v.jsx("div",{className:"text-slate-400",children:x.action?`${x.action.replace("_"," ").replace("send ","Sending ")}...`:"Loading current data..."})]}):y?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"space-y-2",children:[v.jsx("div",{className:"text-sm font-medium text-slate-400 uppercase tracking-wide",children:"Current Data"}),y.live_data_summary&&y.live_data_summary.length>0?v.jsx("div",{className:"p-3 bg-slate-800/50 rounded space-y-1",children:y.live_data_summary.map(($,Y)=>v.jsx("div",{className:`text-sm font-mono ${$.startsWith("[!]")?"text-amber-400":""}`,children:$},Y))}):v.jsx("div",{className:"p-3 bg-slate-800/50 rounded text-sm text-slate-500",children:"No live data available for this rule's categories"})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("div",{className:"text-sm font-medium text-slate-400 uppercase tracking-wide",children:"Rule Matching"}),v.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[y.conditions_matched&&y.conditions_matched>0?v.jsxs("span",{className:"px-2 py-1 bg-green-500/20 text-green-400 rounded text-sm",children:[y.conditions_matched," condition",y.conditions_matched!==1?"s":""," match - this rule WOULD fire"]}):v.jsx("span",{className:"px-2 py-1 bg-slate-700 text-slate-400 rounded text-sm",children:"No conditions trigger this rule right now"}),y.conditions_below_threshold&&y.conditions_below_threshold>0&&v.jsxs("span",{className:"px-2 py-1 bg-yellow-500/20 text-yellow-400 rounded text-sm",children:[y.conditions_below_threshold," below threshold"]})]}),y.conditions_below_threshold&&y.conditions_below_threshold>0&&v.jsxs("div",{className:"p-3 bg-yellow-500/10 border border-yellow-500/30 rounded text-sm space-y-2",children:[v.jsx("div",{className:"text-yellow-300",children:y.below_threshold_summary}),y.below_threshold_events&&y.below_threshold_events.length>0&&v.jsx("div",{className:"space-y-1 text-yellow-200/80",children:y.below_threshold_events.slice(0,3).map(($,Y)=>v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-yellow-500/20 rounded",children:$.severity}),v.jsx("span",{children:$.headline})]},Y))}),y.suggestion&&v.jsxs("div",{className:"text-yellow-400 text-xs mt-2",children:["Tip: ",y.suggestion]})]})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("div",{className:"text-sm font-medium text-slate-400 uppercase tracking-wide",children:y.is_example?"Example Messages":"Messages That Would Fire"}),(z=y.preview_messages)==null?void 0:z.map(($,Y)=>v.jsx("div",{className:"p-3 bg-slate-800 rounded text-sm font-mono break-words",children:$},Y))]}),y.delivered!==void 0&&y.delivery_result&&v.jsx("div",{className:`p-3 rounded text-sm ${y.delivered?"bg-green-500/10 border border-green-500/30 text-green-400":"bg-red-500/10 border border-red-500/30 text-red-400"}`,children:v.jsxs("div",{className:"flex items-start gap-2",children:[y.delivered?v.jsx(Za,{size:16,className:"mt-0.5"}):v.jsx(ca,{size:16,className:"mt-0.5"}),v.jsxs("div",{children:[v.jsx("div",{children:y.delivery_result}),y.delivery_error&&v.jsx("div",{className:"mt-1 text-red-300",children:y.delivery_error})]})]})}),y.message&&!y.preview_messages&&v.jsx("div",{className:`p-3 rounded text-sm ${y.success?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"}`,children:y.message})]}):null}),v.jsxs("div",{className:"p-4 border-t border-[#2a3a4a] flex justify-between sticky bottom-0 bg-[#1a2332]",children:[v.jsx("button",{onClick:V,className:"px-4 py-2 text-slate-400 hover:text-slate-200",children:"Close"}),y&&!y.delivered&&v.jsx("div",{className:"flex gap-2",children:y.delivery_method?v.jsxs(v.Fragment,{children:[y.live_data_summary&&y.live_data_summary.length>0&&v.jsx("button",{onClick:()=>W("send_status"),disabled:x.loading,className:"px-3 py-2 bg-slate-700 hover:bg-slate-600 rounded text-sm disabled:opacity-50",title:"Send current conditions summary",children:"Send Current Conditions"}),v.jsx("button",{onClick:()=>W("send_test"),disabled:x.loading,className:"px-3 py-2 bg-slate-700 hover:bg-slate-600 rounded text-sm disabled:opacity-50",title:"Send example alert message",children:"Send Example Alert"}),y.can_send_live&&v.jsx("button",{onClick:()=>W("send_live"),disabled:x.loading,className:"px-3 py-2 bg-accent hover:bg-accent/80 rounded text-sm disabled:opacity-50",title:"Send actual live alert",children:"Send Live Alert"})]}):v.jsx("span",{className:"px-3 py-2 text-amber-400 text-sm",children:"Configure a delivery method to send test messages"})})]})]})}),v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("div",{children:v.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."})}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("button",{onClick:P,className:"p-2 text-slate-400 hover:text-slate-200 hover:bg-bg-hover rounded transition-colors",title:"Refresh",children:v.jsx($v,{size:18})}),v.jsxs("button",{onClick:N,disabled:!M,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:[v.jsx(K_,{size:16}),"Discard"]}),v.jsxs("button",{onClick:I,disabled:c||!M,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:[v.jsx(zM,{size:16}),c?"Saving...":"Save"]})]})]}),f&&v.jsx("div",{className:"p-3 rounded-lg text-sm bg-red-500/10 text-red-400 border border-red-500/20",children:f}),g&&v.jsxs("div",{className:"p-3 rounded-lg text-sm bg-green-500/10 text-green-400 border border-green-500/20",children:[v.jsx(Za,{size:14,className:"inline mr-2"}),g]}),v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6 space-y-6",children:[v.jsx(k_,{label:"Enable Notifications",checked:e.enabled,onChange:$=>t({...e,enabled:$}),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&&v.jsxs(v.Fragment,{children:[" ",v.jsxs("div",{className:"space-y-3 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[v.jsx("div",{className:"flex items-center gap-2",children:v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Cold-start grace"})}),v.jsx(Mp,{label:"Grace period (seconds)",value:e.cold_start_grace_seconds??60,onChange:$=>t({...e,cold_start_grace_seconds:$}),min:0,max:600,helper:"Suppress broadcasts for this many seconds after the first event arrives",info:"When meshai starts seeing events for the first time, suppress mesh broadcasts for this many seconds to absorb any JetStream backlog. Persistence rows still get written; only broadcasts are suppressed."})]}),v.jsxs("div",{className:"space-y-3 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[v.jsx("div",{className:"flex items-center gap-2",children:v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Band Conditions (HF propagation)"})}),v.jsx(k_,{label:"Enable scheduled band-conditions broadcasts",checked:e.band_conditions_enabled??!0,onChange:$=>t({...e,band_conditions_enabled:$}),helper:"3x/day HF propagation summary (Day/Night ratings per band group). The daily fire digest (twice-daily LLM summary of active fires + the last 24h of growth/spotting) is configured separately under Adapter Config -> fires.digest_*. See Reference -> Fire Tracker (Fusion) and Reference -> Broadcast Types for the New/Update/Active prefix system.",info:"Source priority: (1) recent SWPC readings persisted locally; (2) HamQSL.com fallback; (3) silent skip if both fail. Persistence rows are written either way for an audit trail."}),(e.band_conditions_enabled??!0)&&v.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[v.jsx(Mv,{label:"Slot 1",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[0]||"06:00",onChange:$=>{const Y=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];Y[0]=$,t({...e,band_conditions_schedule:Y})},helper:"Morning (default 06:00 MT)"}),v.jsx(Mv,{label:"Slot 2",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[1]||"14:00",onChange:$=>{const Y=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];Y[1]=$,t({...e,band_conditions_schedule:Y})},helper:"Afternoon (default 14:00 MT)"}),v.jsx(Mv,{label:"Slot 3",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[2]||"22:00",onChange:$=>{const Y=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];Y[2]=$,t({...e,band_conditions_schedule:Y})},helper:"Night (default 22:00 MT)"})]}),v.jsx("p",{className:"text-xs text-slate-600",children:"All times are Mountain Time (America/Boise). DST handled automatically."})]}),e.toggles&&v.jsx(S_e,{toggles:e.toggles,onChange:$=>t({...e,toggles:$})}),v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Notification Rules",v.jsx(Ai,{info:"Each rule is self-contained: define what triggers it (condition or schedule), where to send it (mesh, email, webhook), and behavior settings."})]}),v.jsxs("span",{className:"text-xs text-slate-500",children:[((Z=e.rules)==null?void 0:Z.length)||0," rule",(((U=e.rules)==null?void 0:U.length)||0)!==1?"s":""]})]}),(e.rules||[]).map(($,Y)=>v.jsx(x_e,{rule:$,ruleIndex:Y,categories:i,regions:o,onChange:te=>{const ie=[...e.rules||[]];ie[Y]=te,t({...e,rules:ie})},onDelete:()=>{confirm(`Delete rule "${$.name||"New Rule"}"?`)&&t({...e,rules:(e.rules||[]).filter((te,ie)=>ie!==Y)})},onDuplicate:()=>F(Y),onTest:()=>H(Y)},Y)),v.jsxs("div",{className:"flex gap-2",children:[v.jsxs("button",{onClick:O,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:[v.jsx(af,{size:16})," Add Rule"]}),v.jsxs("div",{className:"relative",children:[v.jsxs("button",{onClick:()=>T(!S),className:"py-3 px-4 border border-dashed border-[#1e2a3a] rounded-lg text-slate-500 hover:text-slate-300 hover:border-accent flex items-center gap-2 transition-colors",children:[v.jsx(hB,{size:16})," Add from Template"]}),S&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>T(!1)}),v.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:[v.jsx("div",{className:"p-2 border-b border-[#2a3a4a] text-xs text-slate-500 uppercase",children:"Rule Templates"}),L3.map($=>v.jsxs("button",{onClick:()=>R($.id),className:"w-full p-3 text-left hover:bg-[#2a3a4a] transition-colors",children:[v.jsx("div",{className:"font-medium text-slate-200",children:$.name}),v.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:$.description})]},$.id))]})]})]})]})]})]})]})]}):v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-red-400",children:"Failed to load notifications config"})})}const P3=[{id:"stream-gauges",label:"Stream Gauges",icon:$_},{id:"wildfire",label:"Wildfire",icon:Y_},{id:"firms",label:"Satellite Fire Detection (FIRMS)",icon:J_},{id:"fire-tracker",label:"Fire Tracker (Fusion)",icon:U$},{id:"weather-alerts",label:"Weather Alerts",icon:G$},{id:"solar",label:"Solar & Geomagnetic",icon:pB},{id:"ducting",label:"Tropospheric Ducting",icon:Di},{id:"avalanche",label:"Avalanche Danger",icon:q_},{id:"traffic",label:"Traffic Flow",icon:Z_},{id:"roads-511",label:"Road Conditions (511)",icon:sB},{id:"mesh-health",label:"Mesh Health",icon:rf},{id:"broadcast-types",label:"Broadcast Types",icon:xC},{id:"reminders",label:"Reminder System",icon:Iu},{id:"notifications",label:"Notifications",icon:Zv},{id:"commands",label:"Commands",icon:gB},{id:"llm-dm",label:"LLM DM Queries",icon:OM},{id:"or-not-and",label:"OR-not-AND Architecture",icon:dB},{id:"adapter-config",label:"Adapter Config & CODE Rule",icon:BM},{id:"curation",label:"Curation: Gauges & Towns",icon:uB},{id:"schema",label:"Schema Migrations",icon:$$},{id:"api",label:"API Reference",icon:W$}];function $t({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 v.jsx("span",{className:`inline-block w-3 h-3 rounded-full ${t[e]}`})}function yt({headers:e,rows:t}){return v.jsx("div",{className:"overflow-x-auto my-4",children:v.jsxs("table",{className:"w-full text-sm",children:[v.jsx("thead",{children:v.jsx("tr",{className:"bg-[#1a2332] border-b border-[#2a3a4a]",children:e.map((r,n)=>v.jsx("th",{className:"px-4 py-2 text-left text-slate-400 font-medium",children:r},n))})}),v.jsx("tbody",{children:t.map((r,n)=>v.jsx("tr",{className:`border-b border-[#1e2a3a] ${n%2===0?"bg-[#0d1219]":"bg-[#0a0e17]"}`,children:r.map((i,a)=>v.jsx("td",{className:"px-4 py-2 text-slate-300",children:i},a))},n))})]})})}function Pt({href:e,children:t}){return v.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline inline-flex items-center gap-1",children:[t," ",v.jsx(Ih,{size:12})]})}function de({children:e}){return v.jsx("h3",{className:"text-lg font-semibold text-slate-200 mt-6 mb-3",children:e})}function fs({children:e}){return v.jsx("h4",{className:"text-base font-medium text-slate-300 mt-4 mb-2",children:e})}function oe({children:e}){return v.jsx("code",{className:"font-mono text-accent bg-[#1a2332] px-1 rounded",children:e})}function hr({id:e,title:t,children:r}){return v.jsxs("section",{id:e,className:"mb-12 scroll-mt-6",children:[v.jsx("h2",{className:"text-2xl font-bold text-slate-100 mb-4 pb-2 border-b border-[#2a3a4a]",children:t}),v.jsx("div",{className:"text-slate-300 leading-relaxed space-y-4",children:r})]})}function T_e(){const e=tf(),[t,r]=G.useState(""),[n,i]=G.useState("stream-gauges"),a=G.useRef(null);G.useEffect(()=>{const l=e.hash.replace("#","");if(l&&P3.find(u=>u.id===l)){i(l);const u=document.getElementById(l);u&&u.scrollIntoView({behavior:"smooth"})}},[e.hash]);const o=P3.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 v.jsxs("div",{className:"flex h-full -m-6",children:[v.jsxs("aside",{className:"w-64 flex-shrink-0 bg-bg-card border-r border-border overflow-y-auto",children:[v.jsx("div",{className:"p-4 border-b border-border",children:v.jsxs("div",{className:"relative",children:[v.jsx(Q_,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),v.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"})]})}),v.jsx("nav",{className:"py-2",children:o.map(l=>{const u=l.icon,c=n===l.id;return v.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:[v.jsx(u,{size:16}),l.label]},l.id)})})]}),v.jsx("div",{ref:a,className:"flex-1 overflow-y-auto p-6",children:v.jsxs("div",{className:"max-w-4xl",children:[v.jsx("p",{className:"text-slate-400 mb-8",children:"Everything you need to understand and configure MeshAI's monitoring and alerting systems."}),v.jsxs(hr,{id:"stream-gauges",title:"Stream Gauges",children:[v.jsx(de,{children:"What You're Looking At"}),v.jsx("p",{children:"MeshAI watches river and stream levels at gauges you configure. Each gauge reports two things:"}),v.jsxs("p",{children:[v.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.`]}),v.jsxs("p",{children:[v.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:`]}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"A small creek: 50-200 CFS"}),v.jsx("li",{children:"A mid-size river: 1,000-5,000 CFS"}),v.jsx("li",{children:"A big river in spring runoff: 10,000+ CFS"})]}),v.jsx(de,{children:"When Does It Flood?"}),v.jsxs("p",{children:["Flood levels are set by the ",v.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.']}),v.jsxs("p",{children:[v.jsx("strong",{children:"Action Stage"})," โ€” water is rising, time to start paying attention. Usually still inside the riverbanks."]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Minor Flood"})," โ€” low-lying roads start getting water on them. NWS issues a Flood Advisory."]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Moderate Flood"})," โ€” water in buildings near the river. Some people need to evacuate. NWS issues a Flood Warning."]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Major Flood"})," โ€” widespread flooding. Many people evacuating. Serious property damage."]}),v.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."}),v.jsx(de,{children:"Low Water / Drought"}),v.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.`}),v.jsx(de,{children:"Setting It Up"}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:["Find your gauge at ",v.jsx(Pt,{href:"https://waterdata.usgs.gov/nwis",children:"waterdata.usgs.gov/nwis"})]}),v.jsxs("li",{children:["Copy the site number (like ",v.jsx(oe,{children:"13090500"}),")"]}),v.jsx("li",{children:"Add it in Config โ†’ Environmental โ†’ USGS"}),v.jsx("li",{children:"MeshAI auto-fills the gauge name and flood levels from NWS"})]}),v.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."}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://waterdata.usgs.gov/nwis",children:"USGS Water Data"})," โ€” find gauges near you"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://water.noaa.gov",children:"NWS Water Prediction Service"})," โ€” flood forecasts and thresholds"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.usgs.gov/special-topics/water-science-school/science/how-streamflow-measured",children:"Understanding Streamflow"})," โ€” USGS explainer"]})]})]}),v.jsxs(hr,{id:"wildfire",title:"Wildfire",children:[v.jsx(de,{children:"What You're Looking At"}),v.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."}),v.jsx(de,{children:"Fire Size โ€” How Big Is It?"}),v.jsx(yt,{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."]]}),v.jsx("p",{children:"For reference, 1,000 acres is about 1.5 square miles."}),v.jsx(de,{children:"Containment โ€” Is It Under Control?"}),v.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."}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"0-30%"})," โ€” Essentially uncontrolled. The fire goes where it wants."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"50%"})," โ€” Good progress, but half the edge can still grow."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"80%+"})," โ€” Well controlled. Major growth unlikely."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"100%"}),' โ€” The edge is fully controlled. But the fire may STILL be actively burning inside. "100% contained" does NOT mean "out."']})]}),v.jsx(de,{children:"How Far Away Should I Worry?"}),v.jsx(yt,{headers:["Distance","What To Do"],rows:[[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"red"})," Under 5 km (3 miles)"]}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Immediate threat."})," This is evacuation-order range. Embers can fly this far in wind."]})],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"orange"})," 5-15 km (3-10 miles)"]}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Prepare."})," The fire could reach you in hours under bad conditions. Have a plan."]})],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"yellow"})," 15-30 km (10-20 miles)"]}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Watch."})," Smoke is likely. Wind shifts could change things fast."]})],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"green"})," Over 30 km (20 miles)"]}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Awareness."})," Keep an eye on it, but no immediate threat."]})]]}),v.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."}),v.jsx(de,{children:"Which Matters More โ€” Size or Distance?"}),v.jsxs("p",{children:[v.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."]}),v.jsx(de,{children:"Setting It Up"}),v.jsxs("p",{children:["Just configure your state code (like ",v.jsx(oe,{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."]}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://inciweb.nwcg.gov",children:"InciWeb"})," โ€” detailed incident information"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://data-nifc.opendata.arcgis.com",children:"NIFC Fire Map"})," โ€” raw perimeter data"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.ready.gov/wildfires",children:"Ready.gov Wildfires"})," โ€” preparedness guide"]})]})]}),v.jsxs(hr,{id:"firms",title:"Satellite Fire Detection (FIRMS)",children:[v.jsx(de,{children:"What You're Looking At"}),v.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.`}),v.jsxs("p",{children:[v.jsx("strong",{children:"Why this matters"}),": satellite hotspots show up ",v.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."]}),v.jsx(de,{children:"Confidence โ€” Is It Really a Fire?"}),v.jsx("p",{children:"Each detection gets a confidence rating:"}),v.jsx(yt,{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."]]}),v.jsxs("p",{children:[v.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.`]}),v.jsx(de,{children:"FRP โ€” How Intense Is It?"}),v.jsx("p",{children:'FRP (Fire Radiative Power) measures the heat output in megawatts. Think of it as "how hot is this thing":'}),v.jsx(yt,{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"]]}),v.jsx("p",{children:"Setting the minimum FRP to 5 MW filters out most industrial and agricultural false alarms."}),v.jsx(de,{children:"New Ignition Detection"}),v.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 ",v.jsx("strong",{children:"potential new ignition"})," โ€” maybe a new fire just started. These get elevated priority regardless of confidence level."]}),v.jsx(de,{children:"Timing"}),v.jsxs("p",{children:["Satellite data arrives ",v.jsx("strong",{children:"1-3 hours"})," after the satellite passes overhead. Each location gets observed about ",v.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."`]}),v.jsx(de,{children:"Getting an API Key"}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:["Go to ",v.jsx(Pt,{href:"https://firms.modaps.eosdis.nasa.gov/api/area/",children:"FIRMS API page"})]}),v.jsx("li",{children:'Click "Get MAP_KEY"'}),v.jsx("li",{children:"Register for a free Earthdata account"}),v.jsx("li",{children:"Your key arrives by email"}),v.jsx("li",{children:"Enter it in Config โ†’ Environmental โ†’ FIRMS"})]}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://firms.modaps.eosdis.nasa.gov",children:"FIRMS Fire Map"})," โ€” see hotspots on a map"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://earthdata.nasa.gov/data/tools/firms/faq",children:"FIRMS FAQ"})," โ€” how it works"]})]})]}),v.jsxs(hr,{id:"fire-tracker",title:"Fire Tracker (Fusion)",children:[v.jsx("p",{children:"FIRMS hotspots are fast but noisy; WFIGS incidents are accurate but slow. The Fire Tracker fuses both feeds and a per-pixel attribution graph so a single fire's name, declared acreage, real-time perimeter movement, and spotting events all land as separate broadcasts on the mesh."}),v.jsx(de,{children:"What you'll see on the mesh"}),v.jsx("p",{children:"Six fire-family alert categories, in order of when they fire during an incident's lifecycle:"}),v.jsx(yt,{headers:["Category","Severity","Trigger","Example broadcast"],rows:[[v.jsx(oe,{children:"unattributed_hotspot_cluster"}),"Priority","3+ FIRMS pixels within 1 mi over 60 min, no WFIGS match โ€” possible new ignition before NIFC declares it",v.jsx("span",{className:"text-amber-300",children:"๐Ÿ”ฅ Possible new fire: 3 hotspots within 1 mi @ 42.93,-114.45 (combined 78 MW)"})],[v.jsx(oe,{children:"wildfire_declared"}),"Priority","WFIGS first-sight of a new IRWIN incident โ€” the official 'this is a fire and here is its name' record",v.jsx("span",{className:"text-amber-300",children:"๐Ÿ”ฅ New: Cache Peak Fire (WF), 3 mi N of Almo: 250 ac, 0% contained"})],[v.jsx(oe,{children:"wildfire_growth"}),"Priority","Per-pass centroid drift >= 0.5 mi (configurable) between consecutive satellite passes โ€” the fire's footprint moved",v.jsx("span",{className:"text-amber-300",children:"๐Ÿ”ฅ Cache Peak Fire moving NE 1.2 mi/h, ~3 mi from Almo"})],[v.jsx(oe,{children:"wildfire_spotting"}),"Immediate","FIRMS pixel attributed to a tracked fire but >= 1.5 mi (configurable) outside its prior-pass convex-hull perimeter โ€” ember spread",v.jsx("span",{className:"text-amber-300",children:"๐Ÿ”ฅ Possible spotting 2.1 mi NE of Cache Peak Fire perimeter"})],[v.jsx(oe,{children:"wildfire_incident"}),"Priority","WFIGS acreage or containment increased on a fire already broadcast once (the Update path; the New path uses wildfire_declared)",v.jsx("span",{className:"text-amber-300",children:"๐Ÿ”ฅ Update: Cache Peak Fire: 1,847 ac, 23% contained"})],[v.jsx(oe,{children:"wildfire_halted"}),"Routine","No FIRMS pixels attributed for 12+ hours (configurable) โ€” fire stalled or out",v.jsx("span",{className:"text-amber-300",children:"๐Ÿ”ฅ Cache Peak Fire no growth in 14h"})]]}),v.jsx(de,{children:"Daily LLM digest"}),v.jsxs("p",{children:["Twice a day (default 06:00 and 18:00 Mountain Time) the bot runs an LLM summary across every active fire and the last 24 h of growth + spotting events, then broadcasts one terse line to the mesh. Shape:"," ",v.jsx("span",{className:"text-amber-300",children:'"Fires today: Cache Peak 1,847 ac +200 NE; Twin Peaks 320 ac stable; possible new fire 15 mi from Cache Peak."'})," ","Configure the schedule and timezone under ",v.jsx(oe,{children:"fires.digest_*"})," ","keys on the Adapter Config page."]}),v.jsx(de,{children:"How attribution works"}),v.jsxs("p",{children:["When a FIRMS hotspot lands, the bot walks every active fire (those not yet tombstoned) and matches by Haversine distance to that fire's running centroid. If the pixel is within the fire's ",v.jsx(oe,{children:"spread_radius_mi"})," ","(default 5 mi, per-fire override available) the pixel is attributed and appended to that fire's growth history. The centroid then re-computes as the median of the last 24 h of attributed pixels, so single-pixel outliers don't drag the perimeter around."]}),v.jsxs("p",{children:["Pixels that match no fire feed the cluster detector instead: if at least"," ",v.jsx(oe,{children:"cluster_min_pixels"})," (default 3) lie within"," ",v.jsx(oe,{children:"cluster_max_radius_mi"})," (default 1.0) over"," ",v.jsx(oe,{children:"cluster_time_window_minutes"})," (default 60), the bot fires a single ",v.jsx(oe,{children:"unattributed_hotspot_cluster"})," broadcast and marks the member pixels so a fourth arrival doesn't re-fire the same cluster."]}),v.jsx(de,{children:"How movement is computed"}),v.jsxs("p",{children:["Each VIIRS pass groups pixels into a ",v.jsx(oe,{children:"pass_id"})," (satellite + 90-min bucket). When a pixel from a different bucket arrives, the prior pass closes: its convex hull becomes the perimeter, its median centroid becomes the comparison anchor, and the bot computes drift (Haversine to the previous pass's centroid), an 8-way compass bearing, and a wall-clock mi/h speed. If drift โ‰ฅ ",v.jsx(oe,{children:"growth_drift_threshold_mi"})," the"," ",v.jsx(oe,{children:"wildfire_growth"})," broadcast fires."]}),v.jsx(de,{children:"How spotting is detected"}),v.jsxs("p",{children:["Once a pass closes its perimeter (a GeoJSON polygon stored on the fire), every subsequent attributed pixel runs a point-in-polygon test. Pixels outside the polygon with a vertex distance โ‰ฅ"," ",v.jsx(oe,{children:"spotting_distance_threshold_mi"})," (default 1.5) fire the"," ",v.jsx(oe,{children:"wildfire_spotting"})," broadcast at ",v.jsx("em",{children:"immediate"})," severity โ€” spread beyond the existing perimeter is the most actionable fire signal we emit. A per-fire cooldown (",v.jsx(oe,{children:"spotting_cooldown_seconds"}),", default 1 h) prevents an ember burst in the same area from spamming the mesh."]}),v.jsx(de,{children:"Tunable knobs (Adapter Config โ†’ fires)"}),v.jsx(yt,{headers:["Key","Default","What it does"],rows:[[v.jsx(oe,{children:"spread_radius_mi_default"}),"5.0 mi","Attribution radius for FIRMS โ†’ fire matching. Per-fire override in the fires.spread_radius_mi column."],[v.jsx(oe,{children:"growth_drift_threshold_mi"}),"0.5 mi","Per-pass centroid drift at or above this fires wildfire_growth."],[v.jsx(oe,{children:"halt_passes_threshold"}),"2","Consecutive empty satellite passes before wildfire_halted (documented; the time gate below is the operational rule)."],[v.jsx(oe,{children:"halt_minimum_seconds"}),"43,200 (12 h)","Minimum elapsed seconds since the most recent attributed pixel before wildfire_halted can fire."],[v.jsx(oe,{children:"spotting_distance_threshold_mi"}),"1.5 mi","Distance from prior-pass perimeter that fires wildfire_spotting."],[v.jsx(oe,{children:"spotting_cooldown_seconds"}),"3,600 (1 h)","Minimum seconds between consecutive spotting broadcasts per fire."],[v.jsx(oe,{children:"digest_enabled"}),"true","Master toggle for the twice-daily digest."],[v.jsx(oe,{children:"digest_schedule"}),'["06:00","18:00"]',"Local-time slots for the digest."],[v.jsx(oe,{children:"digest_timezone"}),"America/Boise","IANA tz for digest_schedule."],[v.jsx(oe,{children:"digest_max_chars"}),"200","Hard cap on the digest wire (the LLM is told to fit; the chunker enforces)."]]})]}),v.jsxs(hr,{id:"weather-alerts",title:"Weather Alerts",children:[v.jsx(de,{children:"What You're Looking At"}),v.jsx("p",{children:"MeshAI watches for NWS (National Weather Service) alerts affecting your area โ€” warnings, watches, and advisories."}),v.jsx(de,{children:"Alert Severity โ€” How Serious Is It?"}),v.jsx(yt,{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"]]}),v.jsx(de,{children:"When Should I Act? (Urgency)"}),v.jsx(yt,{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"]]}),v.jsx(de,{children:"How Sure Are They? (Certainty)"}),v.jsx(yt,{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"]]}),v.jsx(de,{children:"These Are Separate Scales"}),v.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."'}),v.jsx(de,{children:"What Minimum Severity Should I Set?"}),v.jsx(yt,{headers:["Setting","What You Get","What You Miss"],rows:[["Minor","Everything โ€” high volume","Nothing"],[v.jsxs(v.Fragment,{children:[v.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"]]}),v.jsxs("p",{children:[v.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."]}),v.jsx(de,{children:"Finding Your NWS Zone"}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:["Go to ",v.jsx(Pt,{href:"https://www.weather.gov",children:"weather.gov"})]}),v.jsx("li",{children:"Enter your location"}),v.jsxs("li",{children:["Find your zone code at ",v.jsx(Pt,{href:"https://www.weather.gov/pimar/PubZone",children:"NWS Zone Map"})]}),v.jsxs("li",{children:["Zone codes look like: ",v.jsx(oe,{children:"IDZ016"}),", ",v.jsx(oe,{children:"UTZ040"}),", etc."]})]}),v.jsx(de,{children:"The User-Agent Field"}),v.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:"}),v.jsx("p",{children:v.jsx(oe,{children:"(meshai, you@email.com)"})}),v.jsx("p",{children:"No registration. No waiting. Just type it in."}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://alerts.weather.gov",children:"NWS Active Alerts"})," โ€” see current alerts"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.weather.gov/documentation/services-web-api",children:"NWS API Docs"})," โ€” technical details"]})]})]}),v.jsxs(hr,{id:"solar",title:"Solar & Geomagnetic Conditions",children:[v.jsx(de,{children:"What You're Looking At"}),v.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."}),v.jsx(de,{children:"Solar Flux Index (SFI)"}),v.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.'}),v.jsx(yt,{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."]]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Quick rule"}),": SFI above 90 and Kp below 4 = good day for HF radio."]}),v.jsx(de,{children:"Kp Index"}),v.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."}),v.jsx(yt,{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."],[v.jsx("strong",{children:"5"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Minor storm (G1)."})," HF noticeably degraded. Aurora visible at high latitudes (~60ยฐN)."]})],[v.jsx("strong",{children:"6"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Moderate storm (G2)."})," HF getting rough. Aurora moving south (~55ยฐN)."]})],[v.jsx("strong",{children:"7"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Strong storm (G3)."})," HF unreliable for 1-2 days. Aurora at mid-latitudes."]})],[v.jsx("strong",{children:"8-9"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Severe/Extreme storm."})," HF may black out completely. Aurora visible at very low latitudes. Power grid stress possible."]})]]}),v.jsx(de,{children:"R / S / G Scales"}),v.jsx("p",{children:"NOAA's shorthand for three types of space weather events:"}),v.jsx(fs,{children:"R (Radio Blackouts) โ€” from solar flares:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"R1-R2: Brief HF disruption. You might not notice."}),v.jsx("li",{children:"R3: HF goes out for about an hour on the sunlit side of Earth."}),v.jsx("li",{children:"R4-R5: HF dead for hours. Serious."})]}),v.jsx(fs,{children:"S (Solar Radiation Storms) โ€” from energetic particles:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"Mostly affects polar regions and satellites"}),v.jsx("li",{children:"S3+: Polar HF goes out entirely"})]}),v.jsx(fs,{children:"G (Geomagnetic Storms) โ€” from solar wind disturbances:"}),v.jsx("ul",{className:"list-disc list-inside ml-4 space-y-1",children:v.jsx("li",{children:"Same as the Kp scale: G1 = Kp 5, up to G5 = Kp 9"})}),v.jsx(de,{children:"Bz โ€” The Storm Predictor"}),v.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."}),v.jsx(yt,{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."]]}),v.jsx("p",{children:"Bz can change fast โ€” minute to minute. What matters is whether it stays negative for hours, not brief dips."}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.swpc.noaa.gov",children:"SWPC Space Weather Dashboard"})," โ€” live data"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.swpc.noaa.gov/noaa-scales-explanation",children:"NOAA Space Weather Scales"})," โ€” what R/S/G mean"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.hamqsl.com/solar.html",children:"HamQSL Solar Page"})," โ€” ham-friendly display"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.swpc.noaa.gov/products/planetary-k-index",children:"Planetary K-Index"})," โ€” live Kp"]})]})]}),v.jsxs(hr,{id:"ducting",title:"Tropospheric Ducting",children:[v.jsx(de,{children:"What You're Looking At"}),v.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.'}),v.jsx("p",{children:"MeshAI watches for these conditions by analyzing weather data (temperature and humidity at different altitudes) over your mesh area."}),v.jsx(de,{children:"How Do I Know If Ducting Is Happening?"}),v.jsx("p",{children:'MeshAI reports a "condition" based on the atmospheric profile:'}),v.jsx(yt,{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.']]}),v.jsx(de,{children:"What You'll Actually Notice"}),v.jsx("p",{children:"When ducting happens on your mesh:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"Distant repeaters you've never heard suddenly come in"}),v.jsx("li",{children:"Nodes appear from far outside your normal range"}),v.jsx("li",{children:"You hear FM radio stations from other cities"}),v.jsx("li",{children:"ADS-B flight tracking range gets much longer"}),v.jsx("li",{children:"There might be interference from distant stations on your frequency"})]}),v.jsx(de,{children:"The dM/dz Number"}),v.jsx("p",{children:`The dashboard shows a "dM/dz" value in "M-units/km." You don't need to understand the math โ€” just know:`}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"Around 118"})," = normal atmosphere"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Below 79"})," = enhanced propagation starting"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Below 0 (negative)"})," = ducting is happening"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Below -50"})," = strong ducting โ€” classic VHF/UHF DX event"]})]}),v.jsx(de,{children:"When Does Ducting Happen?"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"Under high-pressure weather systems (clear, stable air)"}),v.jsx("li",{children:"When warm air sits on top of cool air (temperature inversion)"}),v.jsx("li",{children:"Most common in late summer and early fall"}),v.jsx("li",{children:"Strongest along coastlines and over water"}),v.jsx("li",{children:"In mountain valleys: cold air pooling in fall/winter can create surface ducts"})]}),v.jsx(de,{children:"Setting It Up"}),v.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."}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://dxinfocentre.com/tropo.html",children:"Tropo Forecast Maps (Hepburn)"})," โ€” 6-day tropo prediction"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://dxmaps.com",children:"DX Maps"})," โ€” real-time VHF/UHF propagation reports"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://en.wikipedia.org/wiki/Tropospheric_propagation",children:"Wikipedia: Tropospheric Propagation"})," โ€” background"]})]})]}),v.jsxs(hr,{id:"avalanche",title:"Avalanche Danger",children:[v.jsx(de,{children:"What You're Looking At"}),v.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."}),v.jsx(de,{children:"The Danger Scale"}),v.jsx(yt,{headers:["Level","Name","Color","What To Do"],rows:[["1","Low",v.jsx($t,{color:"green"}),"Generally safe. Normal caution in steep terrain."],["2","Moderate",v.jsx($t,{color:"yellow"}),"Be careful on specific terrain features. Evaluate conditions."],["3","Considerable",v.jsx($t,{color:"orange"}),v.jsxs(v.Fragment,{children:[v.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",v.jsx($t,{color:"red"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Very dangerous."})," Stay off anything steep."]})],["5","Extreme",v.jsx($t,{color:"black"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Don't go out."})," Avalanches are happening on their own."]})]]}),v.jsx(de,{children:"The Most Important Thing to Know"}),v.jsxs("p",{children:[v.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.']}),v.jsx(de,{children:"Seasonal"}),v.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.'}),v.jsx(de,{children:"Finding Your Avalanche Center"}),v.jsxs("p",{children:["Go to ",v.jsx(Pt,{href:"https://avalanche.org/avalanche-centers/",children:"avalanche.org/avalanche-centers/"})," for a map. Common center codes:"]}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(oe,{children:"SNFAC"})," โ€” Sawtooth (central Idaho)"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"UAC"})," โ€” Utah"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"NWAC"})," โ€” Cascades/Olympics (WA/OR)"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"CAIC"})," โ€” Colorado"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"SAC"})," โ€” Sierra Nevada (CA)"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GNFAC"})," โ€” Gallatin (SW Montana)"]})]}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://avalanche.org",children:"Avalanche.org"})," โ€” US forecasts"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://avalanche.org/avalanche-encyclopedia/human/resources/north-american-public-avalanche-danger-scale/",children:"Avalanche Danger Scale"})," โ€” full scale explanation"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://kbyg.org",children:"Know Before You Go"})," โ€” avalanche awareness"]})]})]}),v.jsxs(hr,{id:"traffic",title:"Traffic Flow",children:[v.jsx(de,{children:"What You're Looking At"}),v.jsx("p",{children:"MeshAI monitors traffic speed on road segments you configure, using data from TomTom (real vehicles with navigation apps reporting their speed)."}),v.jsx(de,{children:"Speed Ratio โ€” The Key Number"}),v.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:'}),v.jsx(yt,{headers:["Ratio","What It Means"],rows:[[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"green"})," Above 85%"]}),"Normal. Traffic flowing fine."],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"yellow"})," 65-85%"]}),"Slow. Heavier than usual but moving."],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"orange"})," 40-65%"]}),"Congested. Significant delays."],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"red"})," Below 40%"]}),"Gridlock. Barely moving."]]}),v.jsxs("p",{children:[v.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.`]}),v.jsx(de,{children:"Confidence โ€” Can You Trust the Data?"}),v.jsx("p",{children:"TomTom's confidence score tells you how much of the reading comes from real vehicles right now vs historical averages:"}),v.jsx(yt,{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",v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Unreliable"})," โ€” mostly guessing from historical patterns. Don't alert on this."]})]]}),v.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."}),v.jsx(de,{children:"Setting Up Corridors"}),v.jsx("p",{children:'Each "corridor" is a point on a road you want to monitor. To add one:'}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"Go to Google Maps, find the road"}),v.jsx("li",{children:`Right-click the road โ†’ "What's here?" โ†’ copy the coordinates`}),v.jsx("li",{children:"Add the corridor in Config with a name and those coordinates"}),v.jsx("li",{children:"TomTom finds the nearest road segment automatically"})]}),v.jsx(de,{children:"Getting an API Key"}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:["Sign up at ",v.jsx(Pt,{href:"https://developer.tomtom.com",children:"developer.tomtom.com"})," (free)"]}),v.jsx("li",{children:"Create an app โ†’ get your API key"}),v.jsx("li",{children:"Free tier: 2,500 requests/day (plenty for 5-10 corridors)"})]}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://developer.tomtom.com",children:"TomTom Developer Portal"})," โ€” API docs and key signup"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.tomtom.com/traffic-index/",children:"TomTom Traffic Index"})," โ€” city congestion rankings"]})]})]}),v.jsxs(hr,{id:"roads-511",title:"Road Conditions (511)",children:[v.jsx(de,{children:"What You're Looking At"}),v.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."}),v.jsx(de,{children:"Setting It Up"}),v.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."}),v.jsx("p",{children:"Configure in Config โ†’ Environmental โ†’ 511:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"Base URL"})," โ€” your state's API endpoint"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"API Key"})," โ€” if required by your state"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Endpoints"})," โ€” which data feeds to poll (varies by state)"]})]}),v.jsx(de,{children:"Learn More"}),v.jsx("p",{children:"Check your state's 511 or DOT website for developer information."})]}),v.jsxs(hr,{id:"mesh-health",title:"Mesh Health",children:[v.jsx(de,{children:"Health Score"}),v.jsx("p",{children:"MeshAI computes a 0-100 health score for your mesh network by looking at five areas, each weighted differently:"}),v.jsx(yt,{headers:["Pillar","Weight","What It Measures"],rows:[[v.jsx("strong",{children:"Infrastructure"}),"30%","Are your routers online?"],[v.jsx("strong",{children:"Utilization"}),"25%","Is the radio channel congested?"],[v.jsx("strong",{children:"Coverage"}),"20%","Do nodes have redundant paths to gateways?"],[v.jsx("strong",{children:"Behavior"}),"15%","Are any nodes flooding the channel?"],[v.jsx("strong",{children:"Power"}),"10%","Are battery-powered nodes running low?"]]}),v.jsx("p",{children:"The overall score is the weighted sum:"}),v.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%)"}),v.jsx(de,{children:"How Each Pillar Is Calculated"}),v.jsx(fs,{children:"Infrastructure (30%)"}),v.jsx("p",{children:"This is the simplest pillar โ€” what percentage of your infrastructure nodes are currently online?"}),v.jsx("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:"(routers online รท total routers) ร— 100"}),v.jsxs("p",{children:["Only nodes with the ",v.jsx(oe,{children:"ROUTER"}),", ",v.jsx(oe,{children:"ROUTER_LATE"}),", or ",v.jsx(oe,{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."]}),v.jsxs("p",{children:[v.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."]}),v.jsx(fs,{children:"Utilization (25%)"}),v.jsxs("p",{children:["MeshAI reads the channel utilization that each router reports in its telemetry โ€” this is the firmware's own measurement of how busy the radio channel is. MeshAI uses the ",v.jsx("strong",{children:"highest"})," value from any infrastructure node because the busiest router is the bottleneck for the whole mesh."]}),v.jsx("p",{children:v.jsx("strong",{children:"How it works:"})}),v.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-4",children:[v.jsxs("li",{children:["Collect ",v.jsx(oe,{children:"channel_utilization"})," from all infrastructure nodes that report it"]}),v.jsx("li",{children:"If no infra nodes have telemetry, try all nodes"}),v.jsxs("li",{children:["Use the ",v.jsx("strong",{children:"maximum"})," value for scoring (busiest node = bottleneck)"]}),v.jsx("li",{children:"If no nodes report utilization (older firmware), fall back to packet count estimate"})]}),v.jsxs("p",{className:"mt-4",children:[v.jsx("strong",{children:"Fallback method"})," (when telemetry unavailable): estimates from packet counts using 200ms/packet airtime. This is less accurate โ€” it assumes MediumFast preset and sums packets across all nodes."]}),v.jsx(yt,{headers:["Channel Utilization","Score","What It Means"],rows:[["Under 20%","100","Channel is clear โ€” this is the goal"],["20-25%","75-100","Slight degradation, occasional collisions"],["25-35%","50-75","Severe degradation โ€” firmware throttling active"],["35-45%","25-50","Mesh struggling badly โ€” reliability dropping"],["Over 45%","0-25","Mesh is effectively unusable"]]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Special case:"})," If no utilization data is available (no telemetry and no packet data), this pillar scores 100. You're not penalized for missing data."]}),v.jsx(fs,{children:"Coverage (20%)"}),v.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.'}),v.jsxs("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:["coverage_ratio = average_gateways_per_node รท total_sources",v.jsx("br",{}),"single_gw_penalty = (single_gateway_nodes รท total_nodes) ร— 40"]}),v.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."}),v.jsx(yt,{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"]]}),v.jsxs("p",{children:[v.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.)."]}),v.jsx(fs,{children:"Behavior (15%)"}),v.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."}),v.jsxs("p",{children:[v.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."]}),v.jsx(yt,{headers:["Flagged Nodes","Score"],rows:[["0","100"],["1","80"],["2-3","60"],["4-5","40"],["6+","20"]]}),v.jsx("p",{children:"A single misbehaving node only drops the score to 80. It takes multiple problem nodes to seriously hurt the behavior pillar."}),v.jsx(fs,{children:"Power (10%)"}),v.jsx("p",{children:"Measures what fraction of battery-powered nodes are below the warning threshold (default 20%)."}),v.jsx("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:"100 ร— (1 โˆ’ low_battery_nodes รท total_battery_nodes)"}),v.jsx("p",{children:"If 2 out of 10 battery nodes are below 20%, power scores 80."}),v.jsxs("p",{children:[v.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."]}),v.jsx(de,{children:"Health Tiers"}),v.jsx(yt,{headers:["Score","Tier","What It Means"],rows:[["90-100",v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"green"})," Healthy"]}),"Everything's working well."],["75-89",v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"yellow"})," Slight degradation"]}),"Some issues but the mesh is functional."],["50-74",v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"orange"})," Unhealthy"]}),"Multiple problems. Reliability is affected."],["25-49",v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"red"})," Warning"]}),"Significant issues. The mesh is struggling."],["0-24",v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"black"})," Critical"]}),"Major failures. Barely functional."]]}),v.jsx(de,{children:"Channel Utilization โ€” Is the Radio Channel Full?"}),v.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."}),v.jsx(yt,{headers:["Utilization","What's Happening"],rows:[[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"green"})," Under 25%"]}),"Healthy. The firmware itself starts throttling above 25% to protect the channel โ€” so under 25% is the target."],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"yellow"})," 25-40%"]}),"Getting busy. Common on larger meshes. Worth watching."],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"orange"})," 40-50%"]}),"Congested. The firmware throttles GPS updates above 40%. Messages are colliding and retrying."],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"red"})," Over 50%"]}),"Serious problem. More time is spent retrying than communicating. Mesh reliability drops fast."],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"black"})," Over 65%"]}),"Documented failure point on busy LONG_FAST meshes. The mesh becomes unusable."]]}),v.jsx(de,{children:"Packet Flooding"}),v.jsx("p",{className:"p-3 bg-yellow-500/10 border border-yellow-500/30 rounded text-yellow-200",children:v.jsx("strong",{children:'โš ๏ธ "Packet flooding" means a node sending too many RADIO PACKETS. This has nothing to do with water flooding.'})}),v.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."}),v.jsx(yt,{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."]]}),v.jsx(de,{children:"Battery Levels"}),v.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:"}),v.jsx(yt,{headers:["Voltage","Charge","What To Do"],rows:[["4.20V","100%","Full"],["3.80V","~60%","Fine"],[v.jsx("strong",{children:"3.60V"}),v.jsx("strong",{children:"~30%"}),v.jsx(v.Fragment,{children:v.jsx("strong",{children:"โš ๏ธ Warning โ€” charge it soon"})})],[v.jsx("strong",{children:"3.50V"}),v.jsx("strong",{children:"~15%"}),v.jsx(v.Fragment,{children:v.jsx("strong",{children:"๐Ÿ”ด Low โ€” charge it now"})})],[v.jsx("strong",{children:"3.40V"}),v.jsx("strong",{children:"~7%"}),v.jsx(v.Fragment,{children:v.jsx("strong",{children:"โšซ About to die"})})],["3.30V","~3%","Device shutting down"]]}),v.jsxs("p",{children:[v.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."]}),v.jsx(de,{children:"Node Offline Detection"}),v.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:`}),v.jsx(yt,{headers:["Node Type","Recommended Threshold","Why"],rows:[["Fixed infrastructure (wall power)",v.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."]]}),v.jsxs("p",{children:[v.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.`]})]}),v.jsxs(hr,{id:"broadcast-types",title:"Broadcast Types",children:[v.jsx("p",{children:"Every broadcast the bot sends to the mesh carries a one-word prefix that tells you what kind of update it is. Three types:"}),v.jsx(yt,{headers:["Prefix","What it means","When you see it"],rows:[[v.jsx(oe,{children:"New:"}),"The first time the bot has ever broadcast about this event","Cache Peak Fire's WFIGS first-sight; FIRMS cluster's first 3-pixel detection; first NWS warning for a CAP id"],[v.jsx(oe,{children:"Update:"}),"A material change on something the bot already announced","Cache Peak Fire's acreage grew; ITD 511 work zone's lane status changed; quake event's magnitude was revised"],[v.jsx(oe,{children:"Active:"}),"A clock-driven reminder that an already-announced event is still live","Cache Peak Fire is still burning 8 hours later; an SWPC G3 storm is still in progress"]]}),v.jsx("p",{children:"The bot tracks first-broadcast time and last-broadcast time separately on every event row, so a New: prefix is only emitted once even after a container restart. Update: respects per-adapter cooldowns (WFIGS is 8 h by default; ITD 511 is per-incident). Active: is the reminder system, covered in the next section."})]}),v.jsxs(hr,{id:"reminders",title:"Reminder System",children:[v.jsxs("p",{children:["Some events stay live for days. A wildfire doesn't go out because WFIGS stopped publishing updates; a geomagnetic storm doesn't end because SWPC went quiet on the wire. The reminder system fires a clock-driven"," ",v.jsx(oe,{children:"Active:"}),"-prefixed re-broadcast on a human-scale cadence so an operator who came on shift after the original announcement still sees the event."]}),v.jsx(de,{children:"Cadences"}),v.jsx(yt,{headers:["Adapter","Reminder cadence","Termination"],rows:[[v.jsxs(v.Fragment,{children:[v.jsx(oe,{children:"wfigs"})," (wildfires)"]}),"Every 8 h while the fire is still active","WFIGS publishes a tombstone (incident closed) โ†’ fires.tombstoned_at is stamped โ†’ reminder loop stops"],[v.jsxs(v.Fragment,{children:[v.jsx(oe,{children:"swpc"})," (space weather)"]}),"Every 8 h while a Kp >= floor / X-class flare / proton-storm event is ongoing","The next SWPC envelope shows the storm has subsided"],[v.jsx(oe,{children:"itd_511_work_zone"}),"Per-zone, configurable in the rule UI","WZDx publishes the zone with end_date in the past"]]}),v.jsx(de,{children:"The tombstone"}),v.jsxs("p",{children:["When a WFIGS update declares an incident closed, the bot stamps"," ",v.jsx(oe,{children:"fires.tombstoned_at"})," with the close time. The reminder scheduler treats ",v.jsx(oe,{children:"tombstoned_at IS NOT NULL"}),` as "stop broadcasting Active: for this fire," and the LLM context layer treats it as "this fire is in the closed-out archive." A subsequent FIRMS pixel inside that fire's spread radius does not re-open it โ€” closure is authoritative from NIFC.`]}),v.jsx(de,{children:"Turning reminders off"}),v.jsxs("p",{children:["Per-adapter on/off lives in ",v.jsx(oe,{children:"adapter_meta.reminder_enabled"})," ","and is exposed on the Adapter Config page. The reminders themselves flow through the same dispatcher gates as everything else, so they still respect cooldowns, the cold-start grace window, and your notification rules."]})]}),v.jsxs(hr,{id:"notifications",title:"Notifications",children:[v.jsx(de,{children:"How It Works"}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"Something happens"})," โ€” a fire is detected, weather warning issued, node goes offline, etc."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"MeshAI checks your rules"})," โ€” does this event match any of your notification rules? Is it severe enough?"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"If a rule matches"})," โ€” MeshAI sends the notification through whatever delivery method that rule is configured for."]})]}),v.jsx(de,{children:"Building Rules"}),v.jsx("p",{children:"Each rule answers three questions:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"WHEN"})," does it trigger? (which categories, what severity)"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"WHERE"})," does it send? (mesh broadcast, email, webhook, etc.)"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"HOW OFTEN"})," at most? (cooldown period)"]})]}),v.jsx("p",{children:'Use "Add from Template" to start with a pre-built rule and customize it, or build from scratch with "Add Rule."'}),v.jsx(de,{children:"Severity Levels โ€” What Should I Set?"}),v.jsx(yt,{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"],[v.jsxs(v.Fragment,{children:[v.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"]]}),v.jsxs("p",{children:[v.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."]}),v.jsx(de,{children:"Webhook โ€” The Swiss Army Knife"}),v.jsx("p",{children:"A webhook sends your alert as an HTTP POST to any URL. This one delivery method works with:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"Discord"})," โ€” use a Discord webhook URL"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Slack"})," โ€” use a Slack incoming webhook URL"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"ntfy.sh"})," โ€” POST to ",v.jsx(oe,{children:"https://ntfy.sh/your-topic"})]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Pushover"})," โ€” POST to the Pushover API"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Home Assistant"})," โ€” POST to an automation webhook URL"]}),v.jsx("li",{children:"Anything else that accepts HTTP POST"})]}),v.jsx("p",{children:"MeshAI doesn't need to know what's on the other end. Give it the URL and it works."})]}),v.jsxs(hr,{id:"commands",title:"Commands",children:[v.jsxs("p",{children:["All commands use the ",v.jsx(oe,{children:"!"})," prefix (configurable). Send these as a direct message to MeshAI on your mesh."]}),v.jsx(de,{children:"Basic Commands"}),v.jsx(yt,{headers:["Command","What It Does"],rows:[[v.jsx(oe,{children:"!help"}),"Shows all available commands"],[v.jsx(oe,{children:"!ping"}),"Tests if the bot is alive"],[v.jsx(oe,{children:"!status"}),"Quick mesh summary (nodes online, health score)"],[v.jsx(oe,{children:"!health"}),"Detailed health report with pillar scores"],[v.jsx(oe,{children:"!weather"}),"Current weather for your area"]]}),v.jsx(de,{children:"Environmental Commands"}),v.jsx(yt,{headers:["Command","What It Does"],rows:[[v.jsx(oe,{children:"!alerts"}),"Active NWS weather alerts for your area"],[v.jsxs(v.Fragment,{children:[v.jsx(oe,{children:"!solar"})," (or ",v.jsx(oe,{children:"!hf"}),")"]}),"Current solar indices and RF conditions"],[v.jsx(oe,{children:"!fire"}),"Active wildfires near your mesh"],[v.jsx(oe,{children:"!avy"}),'Avalanche advisory (seasonal โ€” shows "off season" in summer)'],[v.jsxs(v.Fragment,{children:[v.jsx(oe,{children:"!streams"})," (or ",v.jsx(oe,{children:"!gauges"}),")"]}),"Stream gauge readings"],[v.jsxs(v.Fragment,{children:[v.jsx(oe,{children:"!roads"})," (or ",v.jsx(oe,{children:"!traffic"}),")"]}),"Road conditions and traffic flow"],[v.jsx(oe,{children:"!hotspots"}),"Satellite fire detections"]]}),v.jsx(de,{children:"Subscription Commands"}),v.jsx(yt,{headers:["Command","What It Does"],rows:[[v.jsx(oe,{children:"!subscribe"}),"Lists all alert categories you can subscribe to"],[v.jsx(oe,{children:"!subscribe fire_proximity"}),"Subscribe to a specific category"],[v.jsx(oe,{children:"!subscribe all"}),"Subscribe to everything"],[v.jsx(oe,{children:"!unsubscribe fire_proximity"}),"Unsubscribe from a category"],[v.jsx(oe,{children:"!subscriptions"}),"Shows what you're currently subscribed to"]]}),v.jsx(de,{children:"Conversational"}),v.jsxs("p",{children:[`Bang commands are the short, predictable interface. For anything that doesn't map cleanly to a single command โ€” "how's the mesh doing?", "is there any ducting?", "why didn\\'t I hear about anything today?" โ€” you can DM the bot in plain English. The LLM DM path covers the same data the commands cover, plus the dispatcher drop audit, with honest "no data" answers when a feed is quiet. Full catalog under`," ",v.jsx("a",{href:"#llm-dm",className:"text-accent hover:underline",children:"LLM DM Queries"}),"."]})]}),v.jsxs(hr,{id:"llm-dm",title:"LLM DM (Natural-Language Queries)",children:[v.jsxs("p",{children:["Bang commands like ",v.jsx(oe,{children:"!fire"})," are short and predictable โ€” the right tool on a mesh-constrained interface. For anything else, you can DM the bot in plain English and it will answer from the same live environmental data the broadcast pipeline uses. Both paths work; pick whichever fits the question."]}),v.jsx(de,{children:"What it can answer"}),v.jsx("p",{children:"When you DM the bot a question, the env_reporter layer assembles up to seven data blocks and injects them into the LLM's system prompt. Each block maps to one adapter:"}),v.jsx(yt,{headers:["Adapter block","Example question that hits it","What you get back"],rows:[[v.jsx(oe,{children:"build_fires_detail"}),'"are there any fires near me?"',"Active WFIGS-declared fires, acreage, containment, declared_at, county/state"],[v.jsx(oe,{children:"build_alerts_detail"}),'"any weather alerts?"',"Active NWS CAP alerts: type, severity, area, expiry"],[v.jsx(oe,{children:"build_quakes_detail"}),'"any earthquakes nearby?"',"USGS quakes in the last 24h: magnitude, depth, place"],[v.jsx(oe,{children:"build_traffic_detail"}),'"how is traffic on I-84?" / "any road closures?"',"TomTom + ITD 511 active incidents"],[v.jsx(oe,{children:"build_gauges_detail"}),'"what is the snake river level?"',"USGS NWIS latest readings + flood stages"],[v.jsx(oe,{children:"build_swpc_detail"}),'"what are the band conditions?" / "any space weather?"',"Recent SWPC events + band-conditions ratings"],[v.jsx(oe,{children:"build_drop_audit"}),`"why didn't I hear about anything today?"`,"Event log: what envelopes the dispatcher filtered, by adapter + category"]]}),v.jsx(de,{children:"The grounding rule"}),v.jsxs("p",{children:["The bot is told to answer ",v.jsx("em",{children:"only"}),' from the blocks in the system prompt. If a block is empty (no recent quakes, no active NWS alerts), the response is honest about it: "No active weather alerts right now," not a fabricated "144 earthquakes worldwide in the past 24 hours." That clamp closes the failure mode where the LLM defaulted to its training data when local tables were quiet.']}),v.jsx(de,{children:"Excluding an adapter from LLM context"}),v.jsxs("p",{children:["The ",v.jsx(oe,{children:"include_in_llm_context"})," toggle on each adapter's row in Adapter Config decides whether that adapter's ",v.jsx(oe,{children:"build_*"})," ","block lands in the system prompt. Turn an adapter off here if you don't want the bot's natural-language answers to draw on it (e.g. you ingest TomTom for situational awareness but don't want it cited in DM answers). Broadcasts are unaffected โ€” this toggle gates LLM context only."]}),v.jsx(de,{children:"What it can't answer"}),v.jsx("p",{children:`The bot has no general internet access. Questions that need data the env_reporter doesn't carry ("what's the weather forecast tomorrow", "who's the current president") fall back to whatever the configured LLM backend knows from training. The grounding clamp keeps the bot from inventing local data, but it can't keep the LLM from speculating about non-local topics.`})]}),v.jsxs(hr,{id:"or-not-and",title:"OR-not-AND Architecture",children:[v.jsx("p",{children:"Every environmental adapter pulls its data from one of two places:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"Central"})," (canonical) โ€” Central polls the upstream feed once on behalf of the whole fleet and re-publishes normalized envelopes over NATS JetStream. MeshAI subscribes. One Central poll, one canonical normalization, many subscribers."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Native"})," โ€” MeshAI polls the upstream feed directly. Stays around for adapters Central doesn't carry yet (currently Tropospheric Ducting and Avalanche Center advisories) and for operators who don't run Central."]})]}),v.jsx(de,{children:"Why mutually exclusive"}),v.jsxs("p",{children:["An adapter is set to ",v.jsx("strong",{children:"either"})," Central ",v.jsx("strong",{children:"or"})," ","native, never both. Running both at the same time is what the codebase calls the ",v.jsx("em",{children:"AND-mode anti-pattern"}),": two independent poll loops on the same upstream feed, duplicate broadcasts, duplicate cursor state, no shared dedup. The Spokane-class leak (cross-state broadcasts that escaped the bbox filter in May 2026) was caused by an inadvertent AND-mode on the traffic adapter; the fix made the gate enforce mutual exclusion at boot and on every config save."]}),v.jsx(de,{children:"The per-adapter source toggle"}),v.jsxs("p",{children:["Set ",v.jsx(oe,{children:"feed_source"})," on each adapter's row in Environment:"]}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(oe,{children:"central"})," โ€” disable the native poll loop, subscribe to the matching Central subject pattern."]}),v.jsxs("li",{children:[v.jsx(oe,{children:"native"})," โ€” disable the Central subscription for this adapter, run the native poller."]})]}),v.jsxs("p",{children:["On the GUI, adapters with ",v.jsx("em",{children:"no Central counterpart yet"}),` show their Central button disabled with a "native only" tooltip. That's not an AND state; the adapter is still single-source, just locked to native by upstream availability.`]}),v.jsx(de,{children:"Where this surfaces in tooltips"}),v.jsxs("p",{children:[`You'll see "AND-model anti-pattern" referenced in two places: the USGS-lookup button on Gauge Sites (disabled when the USGS adapter is on Central, because doing a one-off direct USGS poll from the GUI while the runtime is on Central is precisely the AND-mode this rule forbids) and the env_routes 404 response on`," ",v.jsxs(oe,{children:["/api/env/usgs/lookup/","{site_id}"]})," in central-feed mode. Both surfaces refuse to fall back to a direct upstream call; the right answer is to enter values manually or source them from Central."]})]}),v.jsxs(hr,{id:"adapter-config",title:"Adapter Config & the CODE Rule",children:[v.jsx("p",{children:"The Adapter Config page is the single hub for ~50 GUI-editable knobs across the 13 adapters that touch the broadcast pipeline. Changes take effect on the next handler call โ€” no container restart needed for most keys."}),v.jsx(de,{children:"The CONFIG-vs-CODE rule"}),v.jsx("p",{children:"Not everything tunable becomes a GUI row. The codebase splits along one rule:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"CONFIG"})," (lives on this page) โ€” where you send (channels), how often (cadences, schedules), thresholds (magnitude floors, severity gates, distance radii, cooldown durations, freshness windows), curation data (which sites, states, codes), toggles (enabled, include_in_llm_context)."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"CODE"})," (stays in the handlers, not on the GUI) โ€” sentence templates, emoji choices, mapping / translation functions (TomTom icon_map, ITD sub_type_map, Central adapter_map and category_map), rendering logic (anchor priority order, expires-buckets formatting, threshold-state labels), heuristic logic (band_conditions Kp/SFI โ†’ Good/Fair/Poor function)."]})]}),v.jsx("p",{children:"If you find yourself wanting to add a wire-string template or an emoji to the GUI, stop โ€” that's CODE. If you want to change a threshold or a curation list, the GUI is the right place."}),v.jsx(de,{children:"Restart-required vs live"}),v.jsx("p",{children:"Most keys take effect on the next handler call (the env_store re-reads from the database). A short list requires a container restart, because they govern startup-only wiring:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:["Anything under the ",v.jsx(oe,{children:"environmental"})," section on the Config page (feed_source, central URL, etc.). The Spokane-fix gate runs at env_store boot and at CentralConsumer subscribe โ€” both happen only at startup."]}),v.jsx("li",{children:"The LLM backend swap (Google โ†’ Anthropic โ†’ OpenAI)."}),v.jsx("li",{children:"The dispatcher cold-start grace window."})]}),v.jsx("p",{children:`When you save one of those keys via the GUI, a yellow Restart-Required banner surfaces at the top of the page with a "Restart now" button. Until you click it, the on-disk config and the running config intentionally disagree โ€” that's the OR-not-AND gate refusing to transition mid-flight.`}),v.jsxs(de,{children:["The ",v.jsx(oe,{children:"include_in_llm_context"})," toggle"]}),v.jsxs("p",{children:[`Each adapter's card on Adapter Config carries a per-adapter "LLM context" switch. When off, that adapter's `,v.jsx(oe,{children:"build_*"})," ","env_reporter block is skipped during system-prompt assembly. Broadcasts are unaffected; this toggle is purely about what the LLM sees when you DM it. See the LLM DM section above for the seven adapter blocks this gates."]})]}),v.jsxs(hr,{id:"curation",title:"Curation: Gauge Sites & Town Anchors",children:[v.jsx("p",{children:"Two curation tables drive the broadcast text the bot puts on the mesh. Both are CRUD UIs with per-row enable/disable; both fall through to fallback chains when a row is missing or disabled."}),v.jsx(de,{children:"Gauge Sites"}),v.jsx("p",{children:"Stream gauge thresholds for the USGS NWIS handler. Each row pairs a USGS site_id with a human gauge name, lat/lon, and four NWS-AHPS flood thresholds in feet: Action, Minor, Moderate, Major. The handler compares an incoming gauge reading to those thresholds and emits the right broadcast severity."}),v.jsxs("p",{children:[v.jsx("strong",{children:"USGS lookup button"})," โ€” when you add a new row in native-feed mode, the lookup queries the USGS Site Service plus NWS NWPS to auto-populate name, coordinates, and flood stages. In central-feed mode the button is disabled with a tooltip: a one-off direct USGS poll from the GUI while the runtime is on Central is the AND-mode anti-pattern the architecture forbids. Enter values manually or pull them from Central."]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Disabled rows"})," are ignored at dispatch time. The corresponding gauge still ingests into ",v.jsx(oe,{children:"gauge_readings"})," ","(so historical queries still work), it just doesn't broadcast."]}),v.jsx(de,{children:"Town Anchors"}),v.jsxs("p",{children:['Lookup table for the "X mi ',"<","bearing",">"," of ","<","town",">",'" suffix in broadcast text. When a fire or NWS alert renders, the bot walks an anchor chain to figure out where to say it is:']}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsx("li",{children:'Photon nearest-town lookup (the WFIGS path uses this โ€” produces "near Long Creek Summit Home" style anchors)'}),v.jsx("li",{children:"Town Anchors table (your curated list)"}),v.jsx("li",{children:"Landclass label (county / federal-land identifier)"}),v.jsx("li",{children:"County + state fallback"}),v.jsx("li",{children:"Bare lat/lon coords"})]}),v.jsx("p",{children:'Each row carries a name (lowercased on save), state, lat/lon, and an enable flag. The "lowercased on save" rule keeps "Almo" / "ALMO" / "almo" from being three distinct rows. Disabled rows fall through to the next anchor in the chain โ€” the broadcast text still goes out, it just uses a different anchor.'}),v.jsxs("p",{children:["Example broadcast text rendered from a Town Anchors row:"," ",v.jsx("span",{className:"text-amber-300",children:'"๐Ÿ”ฅ New: Cache Peak Fire (WF), 3 mi N of Almo: 250 ac, 0% contained, @ 42.118,-113.643"'})]})]}),v.jsxs(hr,{id:"schema",title:"Schema Migrations",children:[v.jsxs("p",{children:["MeshAI persists state in a single SQLite database (",v.jsx(oe,{children:"/data/meshai.sqlite"}),") with WAL journaling. Schema migrations live in ",v.jsx(oe,{children:"meshai/persistence/migrations/v*.sql"})," ","and apply automatically on container start. The runner reads the migrations directory, sorts by version, and applies anything past the current ",v.jsx(oe,{children:"schema_meta.version"})," in order. Idempotent re-runs are no-ops."]}),v.jsx(de,{children:"v0.6 + v0.7 additions"}),v.jsx(yt,{headers:["Migration","What it added"],rows:[[v.jsx(oe,{children:"v11"}),"first_broadcast_at + last_broadcast_at split + reminder_enabled per adapter (the schema basis for New / Update / Active)"],[v.jsx(oe,{children:"v12"}),"fires.tombstoned_at (WFIGS closure stamp; terminates the reminder loop)"],[v.jsx(oe,{children:"v13"}),"Fire Tracker Phase 1 โ€” fire_pixels table + spread_radius_mi + current_centroid_lat/lon + last_hotspot_at; firms_pixels attributed_at + cluster_broadcast_at"],[v.jsx(oe,{children:"v14"}),"Fire Tracker Phase 2 โ€” fire_passes table (per-satellite-pass centroid + drift) + last_pass_id + halt_broadcast_at on fires"],[v.jsx(oe,{children:"v15"}),"Fire Tracker Phase 3 โ€” fire_passes.perimeter_geojson (convex hull) + fires.last_spotting_broadcast_at"],[v.jsx(oe,{children:"v16"}),"Fire Tracker Phase 4 โ€” fire_digest_broadcasts table (idempotent twice-daily LLM digest)"]]}),v.jsx(de,{children:"When migrations fail"}),v.jsxs("p",{children:["A migration failure leaves the database at the prior version and raises in the runner. Container logs surface the SQL error;"," ",v.jsx(oe,{children:"schema_meta.version"})," tells you where the last successful migration stopped. Re-running the container after the underlying issue is fixed picks up from there."]})]}),v.jsxs(hr,{id:"api",title:"API Reference",children:[v.jsxs("p",{children:["MeshAI's REST API is available at ",v.jsx(oe,{children:"http://your-host:8080"}),". All endpoints return JSON."]}),v.jsx(de,{children:"System"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/status"})," โ€” version, uptime, node count"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/channels"})," โ€” radio channel list"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"POST /api/restart"})," โ€” restart the bot"]})]}),v.jsx(de,{children:"Mesh Data"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/health"})," โ€” health score and pillars"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/nodes"})," โ€” all nodes with positions and telemetry"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/edges"})," โ€” neighbor links with signal quality"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/regions"})," โ€” region summaries"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/sources"})," โ€” data source health"]})]}),v.jsx(de,{children:"Configuration"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/config"})," โ€” full config"]}),v.jsxs("li",{children:[v.jsxs(oe,{children:["GET /api/config/","{section}"]})," โ€” one section"]}),v.jsxs("li",{children:[v.jsxs(oe,{children:["PUT /api/config/","{section}"]})," โ€” update a section"]})]}),v.jsx(de,{children:"Environmental"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/env/status"})," โ€” per-feed health"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/env/active"})," โ€” all active events"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/env/swpc"})," โ€” solar/geomagnetic data"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/env/ducting"})," โ€” atmospheric profile"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/env/fires"})," โ€” wildfire perimeters"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/env/hotspots"})," โ€” satellite fire detections"]})]}),v.jsx(de,{children:"Alerts"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/alerts/active"})," โ€” current alerts"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/alerts/history"})," โ€” past alerts"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/notifications/categories"})," โ€” available alert categories"]})]}),v.jsx(de,{children:"Real-time"}),v.jsx("ul",{className:"list-disc list-inside ml-4 space-y-1",children:v.jsxs("li",{children:[v.jsx(oe,{children:"ws://your-host:8080/ws/live"})," โ€” WebSocket for live updates"]})})]})]})})]})}const M_e=1500;function A_e(){const[e,t]=G.useState({}),[r,n]=G.useState({}),[i,a]=G.useState(!0),[o,s]=G.useState(null),[l,u]=G.useState({}),[c,h]=G.useState({}),[f,d]=G.useState({}),g=G.useCallback(async()=>{a(!0),s(null);try{const[S,T]=await Promise.all([fetch("/api/adapter-config"),fetch("/api/adapter-meta")]);if(!S.ok)throw new Error(`GET /adapter-config: ${S.status}`);if(!T.ok)throw new Error(`GET /adapter-meta: ${T.status}`);t(await S.json()),n(await T.json())}catch(S){s(String(S))}finally{a(!1)}},[]);G.useEffect(()=>{g()},[g]);const m=G.useCallback((S,T,M)=>{h(A=>({...A,[S]:T})),M&&d(A=>({...A,[S]:M})),T==="saved"&&setTimeout(()=>{h(A=>A[S]==="saved"?{...A,[S]:"idle"}:A)},M_e)},[]),y=G.useCallback(async(S,T,M)=>{const A=`${S}.${T}`;m(A,"saving");try{const P=await fetch(`/api/adapter-config/${S}/${T}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:M})});if(!P.ok){const D=(await P.json().catch(()=>({}))).detail||P.statusText;m(A,"error",String(D));return}const I=await P.json();t(N=>({...N,[S]:(N[S]||[]).map(D=>D.key===T?I:D)})),m(A,"saved")}catch(P){m(A,"error",String(P))}},[m]),_=G.useCallback(async(S,T)=>{const M=`${S}.${T}`;m(M,"saving");try{const A=await fetch(`/api/adapter-config/${S}/${T}/reset`,{method:"POST"});if(!A.ok){m(M,"error",`reset failed (${A.status})`);return}const P=await A.json();t(I=>({...I,[S]:(I[S]||[]).map(N=>N.key===T?P:N)})),m(M,"saved")}catch(A){m(M,"error",String(A))}},[m]),x=G.useCallback(async(S,T)=>{const M=`meta:${S}`;m(M,"saving");try{const A=await fetch(`/api/adapter-meta/${S}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)});if(!A.ok){const I=await A.json().catch(()=>({}));m(M,"error",String(I.detail||A.statusText));return}const P=await A.json();n(I=>({...I,[S]:P})),m(M,"saved")}catch(A){m(M,"error",String(A))}},[m]);if(i)return v.jsxs("div",{className:"p-6 flex items-center gap-2 text-slate-400",children:[v.jsx(Dp,{className:"w-5 h-5 animate-spin"})," Loading adapter configโ€ฆ"]});if(o)return v.jsxs("div",{className:"p-6 text-red-400",children:[v.jsx(Vo,{className:"w-5 h-5 inline mr-2"}),"Failed to load: ",o]});const w=Array.from(new Set([...Object.keys(r),...Object.keys(e)])).sort();return v.jsxs("div",{className:"p-6 space-y-4",children:[v.jsxs("div",{className:"flex items-center gap-2 text-slate-200",children:[v.jsx(BM,{className:"w-5 h-5"}),v.jsx("h1",{className:"text-xl font-semibold",children:"Adapter Config"}),v.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[Object.values(e).reduce((S,T)=>S+T.length,0)," settings across ",w.length," adapters"]})]}),v.jsxs("p",{className:"text-xs text-slate-400 max-w-3xl",children:["Per-adapter tunables (thresholds, freshness windows, toggles, curation lists). Changes take effect on the next handler call -- no container restart needed. Sentence templates, emoji, and translation maps live in code by design โ€” see the CODE rule under ",v.jsx("a",{href:"/reference#adapter-config",className:"text-accent hover:underline",children:"Adapter Config & the CODE Rule"})," in Reference. The ",v.jsx("strong",{children:"LLM context"})," toggle on each card gates whether that adapter's data lands in the system prompt when you DM the bot; broadcasts are unaffected."]}),w.map(S=>{const T=r[S]||{display_name:S,include_in_llm_context:!0,description:""},M=e[S]||[],A=l[S]??!1,P=`meta:${S}`,I=c[P]||"idle";return v.jsxs("div",{className:"bg-slate-800/60 border border-slate-700 rounded-lg",children:[v.jsxs("div",{className:"p-4 flex items-start gap-4",children:[v.jsx("button",{onClick:()=>u(N=>({...N,[S]:!N[S]})),className:"text-slate-400 hover:text-white","aria-label":"toggle expand",children:A?v.jsx(ll,{className:"w-5 h-5"}):v.jsx(Js,{className:"w-5 h-5"})}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("h2",{className:"text-base font-semibold text-slate-100",children:T.display_name}),v.jsx("code",{className:"text-xs text-slate-500",children:S}),M.length>0&&v.jsxs("span",{className:"text-xs text-slate-400 ml-1",children:["(",M.length," settings)"]}),M.length===0&&v.jsx("span",{className:"text-xs text-slate-500 ml-1 italic",children:"(meta only)"})]}),T.description&&v.jsx("p",{className:"text-xs text-slate-400 mt-1",children:T.description})]}),v.jsxs("label",{className:"flex items-center gap-2 text-xs text-slate-300 select-none",children:[v.jsx("input",{type:"checkbox",checked:T.include_in_llm_context,onChange:N=>x(S,{include_in_llm_context:N.target.checked}),className:"w-4 h-4 accent-cyan-500"}),"LLM context",v.jsx(tU,{status:I,error:f[P]})]})]}),A&&M.length>0&&v.jsx("div",{className:"border-t border-slate-700 divide-y divide-slate-700/60",children:M.map(N=>v.jsx(k_e,{row:N,status:c[`${S}.${N.key}`]||"idle",error:f[`${S}.${N.key}`],onCommit:D=>y(S,N.key,D),onReset:()=>_(S,N.key)},N.key))})]},S)})]})}function k_e({row:e,status:t,error:r,onCommit:n,onReset:i}){const[a,o]=G.useState(bS(e));G.useEffect(()=>{o(bS(e))},[e.value,e.type]);const s=a!==bS(e),l=JSON.stringify(e.value)===JSON.stringify(e.default),u=()=>{const c=L_e(a,e.type);c.error||c.changed(e.value)&&n(c.value)};return v.jsxs("div",{className:"px-6 py-3 flex items-start gap-4",children:[v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("code",{className:"text-sm font-mono text-cyan-300",children:e.key}),v.jsxs("span",{className:"text-xs text-slate-500",children:["[",e.type,"]"]}),!l&&v.jsx("span",{className:"text-xs text-amber-400",children:"edited"})]}),e.description&&v.jsx("p",{className:"text-xs text-slate-400 mt-1",children:e.description})]}),v.jsxs("div",{className:"flex items-center gap-2 min-w-[280px] justify-end",children:[e.type==="bool"?v.jsx("input",{type:"checkbox",checked:e.value===!0,onChange:c=>n(c.target.checked),className:"w-5 h-5 accent-cyan-500"}):e.type==="json"?v.jsx("textarea",{className:"w-72 h-20 bg-slate-900 border border-slate-700 rounded px-2 py-1 text-xs font-mono text-slate-100",value:a,onChange:c=>o(c.target.value),onBlur:u}):v.jsx("input",{type:e.type==="int"||e.type==="float"?"number":"text",step:e.type==="float"?"any":"1",className:"w-48 bg-slate-900 border border-slate-700 rounded px-2 py-1 text-sm text-slate-100",value:a,onChange:c=>o(c.target.value),onBlur:u,onKeyDown:c=>{c.key==="Enter"&&c.target.blur()}}),v.jsx(tU,{status:t,error:r,dirty:s}),v.jsx("button",{onClick:i,disabled:l,className:"text-slate-400 hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",title:"Reset to default",children:v.jsx(K_,{className:"w-4 h-4"})})]})]})}function tU({status:e,error:t,dirty:r}){return e==="saving"?v.jsx(Dp,{className:"w-4 h-4 text-cyan-400 animate-spin"}):e==="saved"?v.jsx(Za,{className:"w-4 h-4 text-emerald-400"}):e==="error"?v.jsx("span",{title:t,className:"text-red-400 cursor-help",children:v.jsx(Vo,{className:"w-4 h-4"})}):r?v.jsx("span",{className:"w-2 h-2 bg-amber-400 rounded-full",title:"unsaved"}):v.jsx("span",{className:"w-4 h-4"})}function bS(e){return e.type==="bool"?String(e.value===!0):e.type==="json"?JSON.stringify(e.value,null,2):e.value===null||e.value===void 0?"":String(e.value)}function L_e(e,t){if(t==="int"){const r=Number(e);return!Number.isFinite(r)||!Number.isInteger(r)?{error:"expected integer",value:null,changed:()=>!1}:{error:null,value:r,changed:n=>n!==r}}if(t==="float"){const r=Number(e);return Number.isFinite(r)?{error:null,value:r,changed:n=>n!==r}:{error:"expected number",value:null,changed:()=>!1}}if(t==="str")return{error:null,value:e,changed:r=>r!==e};if(t==="json")try{const r=JSON.parse(e);return{error:null,value:r,changed:n=>JSON.stringify(n)!==JSON.stringify(r)}}catch{return{error:"invalid JSON",value:null,changed:()=>!1}}return{error:null,value:e,changed:()=>!0}}const wS={site_id:"",gauge_name:"",lat:0,lon:0,action_ft:null,flood_minor_ft:null,flood_moderate_ft:null,flood_major_ft:null,enabled:!0,updated_at:0};function N_e(){const[e,t]=G.useState([]),[r,n]=G.useState(!0),[i,a]=G.useState(null),[o,s]=G.useState(null),[l,u]=G.useState(wS),[c,h]=G.useState(!1),[f,d]=G.useState("unknown"),g=G.useCallback(async()=>{n(!0),a(null);try{const S=await fetch("/api/gauge-sites");if(!S.ok)throw new Error(`GET: ${S.status}`);t(await S.json())}catch(S){a(String(S))}finally{n(!1)}},[]);G.useEffect(()=>{g()},[g]),G.useEffect(()=>{fetch("/api/config/environmental").then(S=>S.json()).then(S=>{var T;return d(((T=S==null?void 0:S.usgs)==null?void 0:T.feed_source)||"unknown")}).catch(()=>d("unknown"))},[]);const m=S=>{s(S.site_id),u({...S}),h(!1)},y=()=>{h(!0),s(null),u({...wS})},_=()=>{s(null),h(!1),u(wS)},x=async()=>{try{const S=c?"/api/gauge-sites":`/api/gauge-sites/${o}`,M=await fetch(S,{method:c?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!M.ok){const A=await M.json().catch(()=>({}));alert(`save failed: ${A.detail||M.statusText}`);return}_(),g()}catch(S){alert(String(S))}},w=async S=>{if(!confirm(`Delete ${S}?`))return;const T=await fetch(`/api/gauge-sites/${S}`,{method:"DELETE"});if(!T.ok){alert(`delete failed: ${T.status}`);return}g()};return r?v.jsxs("div",{className:"p-6 text-slate-400",children:[v.jsx(Dp,{className:"w-5 h-5 animate-spin inline mr-2"}),"Loadingโ€ฆ"]}):i?v.jsxs("div",{className:"p-6 text-red-400",children:["Load failed: ",i]}):v.jsxs("div",{className:"p-6 space-y-4",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx($_,{className:"w-5 h-5 text-cyan-400"}),v.jsx("h1",{className:"text-xl font-semibold text-slate-100",children:"Gauge Sites"}),v.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[e.length," sites"]}),v.jsxs("button",{onClick:y,className:"ml-auto flex items-center gap-1 px-3 py-1 bg-cyan-700 hover:bg-cyan-600 rounded text-white text-sm",children:[v.jsx(af,{className:"w-4 h-4"})," Add site"]})]}),v.jsx("p",{className:"text-xs text-slate-400 max-w-3xl",children:"NWS-AHPS stream gauge thresholds for the USGS NWIS handler. Each row pairs a USGS site_id with a human gauge name, lat/lon, and four flood thresholds (Action / Minor / Moderate / Major, all in feet). Disabled rows still ingest into gauge_readings -- they don't broadcast. The USGS lookup button auto-populates name + coords + thresholds from USGS Site Service + NWS NWPS when this adapter is on native feed_source; Central-feed mode disables it (see Reference โ†’ OR-not-AND for why). Changes take effect on the next event."}),c&&v.jsx(I3,{draft:l,setDraft:u,onSave:x,onCancel:_,adding:!0,feedSource:f}),v.jsx("div",{className:"bg-slate-800/60 border border-slate-700 rounded-lg overflow-x-auto",children:v.jsxs("table",{className:"w-full text-sm text-slate-200",children:[v.jsx("thead",{className:"bg-slate-900 text-xs text-slate-400 uppercase",children:v.jsxs("tr",{children:[v.jsx("th",{className:"px-3 py-2 text-left",children:"Site ID"}),v.jsx("th",{className:"px-3 py-2 text-left",children:"Name"}),v.jsx("th",{className:"px-3 py-2 text-right",children:"Lat,Lon"}),v.jsx("th",{className:"px-3 py-2 text-right",children:"Action"}),v.jsx("th",{className:"px-3 py-2 text-right",children:"Minor"}),v.jsx("th",{className:"px-3 py-2 text-right",children:"Moderate"}),v.jsx("th",{className:"px-3 py-2 text-right",children:"Major"}),v.jsx("th",{className:"px-3 py-2 text-center",children:"On"}),v.jsx("th",{className:"px-3 py-2"})]})}),v.jsx("tbody",{className:"divide-y divide-slate-700/60",children:e.map(S=>o===S.site_id?v.jsx("tr",{className:"bg-slate-900/40",children:v.jsx("td",{colSpan:9,className:"px-3 py-2",children:v.jsx(I3,{draft:l,setDraft:u,onSave:x,onCancel:_,feedSource:f})})},S.site_id):v.jsxs("tr",{className:"hover:bg-slate-800/50",children:[v.jsx("td",{className:"px-3 py-2 font-mono text-xs",children:S.site_id}),v.jsx("td",{className:"px-3 py-2",children:S.gauge_name}),v.jsxs("td",{className:"px-3 py-2 text-right text-xs",children:[S.lat.toFixed(3),",",S.lon.toFixed(3)]}),v.jsx("td",{className:"px-3 py-2 text-right",children:S.action_ft??"-"}),v.jsx("td",{className:"px-3 py-2 text-right",children:S.flood_minor_ft??"-"}),v.jsx("td",{className:"px-3 py-2 text-right",children:S.flood_moderate_ft??"-"}),v.jsx("td",{className:"px-3 py-2 text-right",children:S.flood_major_ft??"-"}),v.jsx("td",{className:"px-3 py-2 text-center",children:S.enabled?v.jsx(Za,{className:"w-4 h-4 text-emerald-400 inline"}):v.jsx(ca,{className:"w-4 h-4 text-slate-500 inline"})}),v.jsxs("td",{className:"px-3 py-2 text-right",children:[v.jsx("button",{onClick:()=>m(S),className:"text-cyan-400 hover:text-cyan-300 text-xs mr-3",children:"Edit"}),v.jsx("button",{onClick:()=>w(S.site_id),className:"text-red-400 hover:text-red-300",children:v.jsx(Ep,{className:"w-4 h-4 inline"})})]})]},S.site_id))})]})})]})}function I3({draft:e,setDraft:t,onSave:r,onCancel:n,adding:i,feedSource:a}){const o=(g,m)=>t({...e,[g]:m}),[s,l]=G.useState(!1),[u,c]=G.useState(null),h=a!=="native"||!e.site_id.trim(),f=a!=="native"?"USGS lookup not available in central-feed mode (would be AND-model anti-pattern). Enter values manually.":e.site_id.trim()?"Auto-populate from USGS / NWS NWPS":"Enter a site_id first",d=async()=>{if(!h){l(!0),c(null);try{const g=e.site_id.replace(/^USGS-/i,""),m=await fetch(`/api/env/usgs/lookup/${encodeURIComponent(g)}`);if(m.status===404){const x=await m.json().catch(()=>({}));c(x.detail||"Lookup unavailable -- enter values manually"),l(!1);return}if(!m.ok){c(`Lookup failed (${m.status})`),l(!1);return}const y=await m.json(),_={...e};y.name&&!_.gauge_name&&(_.gauge_name=y.name),typeof y.lat=="number"&&(_.lat=y.lat),typeof y.lon=="number"&&(_.lon=y.lon),typeof y.action_ft=="number"&&(_.action_ft=y.action_ft),typeof y.flood_minor_ft=="number"&&(_.flood_minor_ft=y.flood_minor_ft),typeof y.flood_moderate_ft=="number"&&(_.flood_moderate_ft=y.flood_moderate_ft),typeof y.flood_major_ft=="number"&&(_.flood_major_ft=y.flood_major_ft),t(_)}catch(g){c(String(g))}finally{l(!1)}}};return v.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 p-3 bg-slate-900/50 rounded",children:[v.jsxs("label",{className:"text-xs text-slate-400 col-span-2",children:["Site ID",v.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[v.jsx("input",{className:"flex-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100 font-mono text-xs",value:e.site_id,onChange:g=>o("site_id",g.target.value),disabled:!i}),v.jsxs("button",{type:"button",onClick:d,disabled:h||s,title:f,className:"px-2 py-1 bg-slate-700 hover:bg-slate-600 disabled:opacity-30 disabled:cursor-not-allowed rounded text-xs text-slate-100 flex items-center gap-1",children:[s?v.jsx(Dp,{className:"w-3 h-3 animate-spin"}):v.jsx(Q_,{className:"w-3 h-3"}),"USGS lookup"]})]}),u&&v.jsx("span",{className:"text-amber-400 text-xs mt-1 block",children:u})]}),v.jsxs("label",{className:"text-xs text-slate-400 col-span-2",children:["Gauge name",v.jsx("input",{className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.gauge_name,onChange:g=>o("gauge_name",g.target.value)})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Lat",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.lat,onChange:g=>o("lat",parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Lon",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.lon,onChange:g=>o("lon",parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Action ft",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.action_ft??"",onChange:g=>o("action_ft",g.target.value===""?null:parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Minor flood ft",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.flood_minor_ft??"",onChange:g=>o("flood_minor_ft",g.target.value===""?null:parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Moderate flood ft",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.flood_moderate_ft??"",onChange:g=>o("flood_moderate_ft",g.target.value===""?null:parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Major flood ft",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.flood_major_ft??"",onChange:g=>o("flood_major_ft",g.target.value===""?null:parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-300 col-span-2 flex items-center gap-2 mt-2",children:[v.jsx("input",{type:"checkbox",checked:e.enabled,onChange:g=>o("enabled",g.target.checked),className:"accent-cyan-500"}),"Enabled"]}),v.jsxs("div",{className:"col-span-2 flex items-center justify-end gap-2 mt-2",children:[v.jsx("button",{onClick:n,className:"px-3 py-1 text-slate-300 hover:bg-slate-700 rounded text-sm",children:"Cancel"}),v.jsx("button",{onClick:r,className:"px-3 py-1 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-sm",children:"Save"})]})]})}const SS={anchor_id:0,name:"",lat:0,lon:0,state:"ID",enabled:!0,updated_at:0};function P_e(){const[e,t]=G.useState([]),[r,n]=G.useState(!0),[i,a]=G.useState(null),[o,s]=G.useState(null),[l,u]=G.useState(!1),[c,h]=G.useState(SS),f=G.useCallback(async()=>{n(!0),a(null);try{const x=await fetch("/api/town-anchors");if(!x.ok)throw new Error(`GET: ${x.status}`);t(await x.json())}catch(x){a(String(x))}finally{n(!1)}},[]);G.useEffect(()=>{f()},[f]);const d=x=>{s(x.anchor_id),h({...x}),u(!1)},g=()=>{u(!0),s(null),h({...SS})},m=()=>{s(null),u(!1),h(SS)},y=async()=>{const x=l?"/api/town-anchors":`/api/town-anchors/${o}`,S=await fetch(x,{method:l?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(!S.ok){const T=await S.json().catch(()=>({}));alert(`save failed: ${T.detail||S.statusText}`);return}m(),f()},_=async x=>{if(!confirm(`Delete anchor ${x}?`))return;const w=await fetch(`/api/town-anchors/${x}`,{method:"DELETE"});if(!w.ok){alert(`delete failed: ${w.status}`);return}f()};return r?v.jsxs("div",{className:"p-6 text-slate-400",children:[v.jsx(Dp,{className:"w-5 h-5 animate-spin inline mr-2"}),"Loadingโ€ฆ"]}):i?v.jsxs("div",{className:"p-6 text-red-400",children:["Load failed: ",i]}):v.jsxs("div",{className:"p-6 space-y-4",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(nf,{className:"w-5 h-5 text-cyan-400"}),v.jsx("h1",{className:"text-xl font-semibold text-slate-100",children:"Town Anchors"}),v.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[e.length," towns"]}),v.jsxs("button",{onClick:g,className:"ml-auto flex items-center gap-1 px-3 py-1 bg-cyan-700 hover:bg-cyan-600 rounded text-white text-sm",children:[v.jsx(af,{className:"w-4 h-4"})," Add town"]})]}),v.jsx("p",{className:"text-xs text-slate-400 max-w-3xl",children:`Lookup table for the "X mi of " suffix in the bot's broadcast text. When a fire or NWS alert renders, the bot walks: Photon nearest-town โ†’ this table โ†’ landclass โ†’ county/state โ†’ bare coords. Disabled rows fall through to the next anchor in the chain; the broadcast still goes out, it just uses a different anchor. Example: "3 mi N of Almo". See Reference โ†’ Curation: Gauges & Towns for the full chain.`}),l&&v.jsx(D3,{draft:c,setDraft:h,onSave:y,onCancel:m,adding:!0}),v.jsx("div",{className:"bg-slate-800/60 border border-slate-700 rounded-lg overflow-x-auto",children:v.jsxs("table",{className:"w-full text-sm text-slate-200",children:[v.jsx("thead",{className:"bg-slate-900 text-xs text-slate-400 uppercase",children:v.jsxs("tr",{children:[v.jsx("th",{className:"px-3 py-2 text-left",children:"Name"}),v.jsx("th",{className:"px-3 py-2 text-right",children:"Lat"}),v.jsx("th",{className:"px-3 py-2 text-right",children:"Lon"}),v.jsx("th",{className:"px-3 py-2 text-center",children:"State"}),v.jsx("th",{className:"px-3 py-2 text-center",children:"On"}),v.jsx("th",{className:"px-3 py-2"})]})}),v.jsx("tbody",{className:"divide-y divide-slate-700/60",children:e.map(x=>o===x.anchor_id?v.jsx("tr",{className:"bg-slate-900/40",children:v.jsx("td",{colSpan:6,className:"px-3 py-2",children:v.jsx(D3,{draft:c,setDraft:h,onSave:y,onCancel:m})})},x.anchor_id):v.jsxs("tr",{className:"hover:bg-slate-800/50",children:[v.jsx("td",{className:"px-3 py-2 capitalize",children:x.name}),v.jsx("td",{className:"px-3 py-2 text-right text-xs",children:x.lat.toFixed(4)}),v.jsx("td",{className:"px-3 py-2 text-right text-xs",children:x.lon.toFixed(4)}),v.jsx("td",{className:"px-3 py-2 text-center text-xs",children:x.state||"-"}),v.jsx("td",{className:"px-3 py-2 text-center",children:x.enabled?v.jsx(Za,{className:"w-4 h-4 text-emerald-400 inline"}):v.jsx(ca,{className:"w-4 h-4 text-slate-500 inline"})}),v.jsxs("td",{className:"px-3 py-2 text-right",children:[v.jsx("button",{onClick:()=>d(x),className:"text-cyan-400 hover:text-cyan-300 text-xs mr-3",children:"Edit"}),v.jsx("button",{onClick:()=>_(x.anchor_id),className:"text-red-400 hover:text-red-300",children:v.jsx(Ep,{className:"w-4 h-4 inline"})})]})]},x.anchor_id))})]})})]})}function D3({draft:e,setDraft:t,onSave:r,onCancel:n,adding:i}){const a=(o,s)=>t({...e,[o]:s});return v.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 p-3 bg-slate-900/50 rounded",children:[v.jsxs("label",{className:"text-xs text-slate-400 col-span-2",children:["Name (lowercased on save)",v.jsx("input",{className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.name,onChange:o=>a("name",o.target.value),disabled:!i})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["State",v.jsx("input",{className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.state??"",onChange:o=>a("state",o.target.value)})]}),v.jsxs("label",{className:"text-xs text-slate-400 flex items-center gap-2",children:[v.jsx("input",{type:"checkbox",checked:e.enabled,onChange:o=>a("enabled",o.target.checked),className:"accent-cyan-500 mt-4"}),"Enabled"]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Lat",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.lat,onChange:o=>a("lat",parseFloat(o.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Lon",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.lon,onChange:o=>a("lon",parseFloat(o.target.value))})]}),v.jsxs("div",{className:"col-span-2 flex items-center justify-end gap-2 mt-2",children:[v.jsx("button",{onClick:n,className:"px-3 py-1 text-slate-300 hover:bg-slate-700 rounded text-sm",children:"Cancel"}),v.jsx("button",{onClick:r,className:"px-3 py-1 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-sm",children:"Save"})]})]})}function I_e(){return v.jsx(cY,{children:v.jsx(pY,{children:v.jsxs(b$,{children:[v.jsx($i,{path:"/",element:v.jsx(CY,{})}),v.jsx($i,{path:"/mesh",element:v.jsx(V0e,{})}),v.jsx($i,{path:"/environment",element:v.jsx(h_e,{})}),v.jsx($i,{path:"/config",element:v.jsx(s_e,{})}),v.jsx($i,{path:"/alerts",element:v.jsx(__e,{})}),v.jsx($i,{path:"/notifications",element:v.jsx(C_e,{})}),v.jsx($i,{path:"/reference",element:v.jsx(T_e,{})}),v.jsx($i,{path:"/adapter-config",element:v.jsx(A_e,{})}),v.jsx($i,{path:"/gauge-sites",element:v.jsx(N_e,{})}),v.jsx($i,{path:"/town-anchors",element:v.jsx(P_e,{})})]})})})}CS.createRoot(document.getElementById("root")).render(v.jsx(Ch.StrictMode,{children:v.jsx(k$,{children:v.jsx(I_e,{})})})); + */(function(e,t){(function(r,n){n(t)})(n7,function(r){var n="1.9.4";function i(p){var b,C,k,E;for(C=1,k=arguments.length;C"u"||!L||!L.Mixin)){p=w(p)?p:[p];for(var b=0;b0?Math.floor(p):Math.ceil(p)};z.prototype={clone:function(){return new z(this.x,this.y)},add:function(p){return this.clone()._add(U(p))},_add:function(p){return this.x+=p.x,this.y+=p.y,this},subtract:function(p){return this.clone()._subtract(U(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=Z(this.x),this.y=Z(this.y),this},distanceTo:function(p){p=U(p);var b=p.x-this.x,C=p.y-this.y;return Math.sqrt(b*b+C*C)},equals:function(p){return p=U(p),p.x===this.x&&p.y===this.y},contains:function(p){return p=U(p),Math.abs(p.x)<=Math.abs(this.x)&&Math.abs(p.y)<=Math.abs(this.y)},toString:function(){return"Point("+f(this.x)+", "+f(this.y)+")"}};function U(p,b,C){return p instanceof z?p:w(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,b,C)}function $(p,b){if(p)for(var C=b?[p,b]:p,k=0,E=C.length;k=this.min.x&&C.x<=this.max.x&&b.y>=this.min.y&&C.y<=this.max.y},intersects:function(p){p=Y(p);var b=this.min,C=this.max,k=p.min,E=p.max,B=E.x>=b.x&&k.x<=C.x,X=E.y>=b.y&&k.y<=C.y;return B&&X},overlaps:function(p){p=Y(p);var b=this.min,C=this.max,k=p.min,E=p.max,B=E.x>b.x&&k.xb.y&&k.y=b.lat&&E.lat<=C.lat&&k.lng>=b.lng&&E.lng<=C.lng},intersects:function(p){p=ie(p);var b=this._southWest,C=this._northEast,k=p.getSouthWest(),E=p.getNorthEast(),B=E.lat>=b.lat&&k.lat<=C.lat,X=E.lng>=b.lng&&k.lng<=C.lng;return B&&X},overlaps:function(p){p=ie(p);var b=this._southWest,C=this._northEast,k=p.getSouthWest(),E=p.getNorthEast(),B=E.lat>b.lat&&k.latb.lng&&k.lng1,gl=function(){var p=!1;try{var b=Object.defineProperty({},"passive",{get:function(){p=!0}});window.addEventListener("testPassiveEventSupport",h,b),window.removeEventListener("testPassiveEventSupport",h,b)}catch{}return p}(),ee=function(){return!!document.createElement("canvas").getContext}(),xt=!!(document.createElementNS&&et("svg").createSVGRect),pt=!!xt&&function(){var p=document.createElement("div");return p.innerHTML="",(p.firstChild&&p.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),dt=!xt&&function(){try{var p=document.createElement("div");p.innerHTML='';var b=p.firstChild;return b.style.behavior="url(#default#VML)",b&&typeof b.adj=="object"}catch{return!1}}(),ur=navigator.platform.indexOf("Mac")===0,oo=navigator.platform.indexOf("Linux")===0;function rn(p){return navigator.userAgent.toLowerCase().indexOf(p)>=0}var Be={ie:lr,ielt9:Mr,edge:Gn,webkit:Wn,android:io,android23:Af,androidStock:ig,opera:ac,chrome:ag,gecko:jt,safari:$_,phantom:og,opera12:sg,win:Ue,ie3d:lg,webkit3d:kf,gecko3d:ao,any3d:tn,mobile:pl,mobileWebkit:ug,mobileWebkit3d:cg,msPointer:Lf,pointer:Nf,touch:Ut,touchNative:xe,mobileOpera:Hn,mobileGecko:ui,retina:Gi,passiveEvents:gl,canvas:ee,svg:xt,vml:dt,inlineSvg:pt,mac:ur,linux:oo},Pf=Be.msPointer?"MSPointerDown":"pointerdown",If=Be.msPointer?"MSPointerMove":"pointermove",Df=Be.msPointer?"MSPointerUp":"pointerup",Ef=Be.msPointer?"MSPointerCancel":"pointercancel",oc={touchstart:Pf,touchmove:If,touchend:Df,touchcancel:Ef},jf={touchstart:rU,touchmove:dg,touchend:dg,touchcancel:dg},so={},Rf=!1;function hg(p,b,C){return b==="touchstart"&&Ft(),jf[b]?(C=jf[b].bind(this,C),p.addEventListener(oc[b],C,!1),C):(console.warn("wrong event specified:",b),h)}function Of(p,b,C){if(!oc[b]){console.warn("wrong event specified:",b);return}p.removeEventListener(oc[b],C,!1)}function fg(p){so[p.pointerId]=p}function Bt(p){so[p.pointerId]&&(so[p.pointerId]=p)}function wt(p){delete so[p.pointerId]}function Ft(){Rf||(document.addEventListener(Pf,fg,!0),document.addEventListener(If,Bt,!0),document.addEventListener(Df,wt,!0),document.addEventListener(Ef,wt,!0),Rf=!0)}function dg(p,b){if(b.pointerType!==(b.MSPOINTER_TYPE_MOUSE||"mouse")){b.touches=[];for(var C in so)b.touches.push(so[C]);b.changedTouches=[b],p(b)}}function rU(p,b){b.MSPOINTER_TYPE_TOUCH&&b.pointerType===b.MSPOINTER_TYPE_TOUCH&&Hr(b),dg(p,b)}function nU(p){var b={},C,k;for(k in p)C=p[k],b[k]=C&&C.bind?C.bind(p):C;return p=b,b.type="dblclick",b.detail=2,b.isTrusted=!1,b._simulated=!0,b}var iU=200;function aU(p,b){p.addEventListener("dblclick",b);var C=0,k;function E(B){if(B.detail!==1){k=B.detail;return}if(!(B.pointerType==="mouse"||B.sourceCapabilities&&!B.sourceCapabilities.firesTouchEvents)){var X=EL(B);if(!(X.some(function(ne){return ne instanceof HTMLLabelElement&&ne.attributes.for})&&!X.some(function(ne){return ne instanceof HTMLInputElement||ne instanceof HTMLSelectElement}))){var J=Date.now();J-C<=iU?(k++,k===2&&b(nU(B))):k=1,C=J}}}return p.addEventListener("click",E),{dblclick:b,simDblclick:E}}function oU(p,b){p.removeEventListener("dblclick",b.dblclick),p.removeEventListener("click",b.simDblclick)}var Y_=gg(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),zf=gg(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),NL=zf==="webkitTransition"||zf==="OTransition"?zf+"End":"transitionend";function PL(p){return typeof p=="string"?document.getElementById(p):p}function Bf(p,b){var C=p.style[b]||p.currentStyle&&p.currentStyle[b];if((!C||C==="auto")&&document.defaultView){var k=document.defaultView.getComputedStyle(p,null);C=k?k[b]:null}return C==="auto"?null:C}function St(p,b,C){var k=document.createElement(p);return k.className=b||"",C&&C.appendChild(k),k}function Zt(p){var b=p.parentNode;b&&b.removeChild(p)}function vg(p){for(;p.firstChild;)p.removeChild(p.firstChild)}function sc(p){var b=p.parentNode;b&&b.lastChild!==p&&b.appendChild(p)}function lc(p){var b=p.parentNode;b&&b.firstChild!==p&&b.insertBefore(p,b.firstChild)}function X_(p,b){if(p.classList!==void 0)return p.classList.contains(b);var C=pg(p);return C.length>0&&new RegExp("(^|\\s)"+b+"(\\s|$)").test(C)}function at(p,b){if(p.classList!==void 0)for(var C=g(b),k=0,E=C.length;k0?2*window.devicePixelRatio:1;function RL(p){return Be.edge?p.wheelDeltaY/2:p.deltaY&&p.deltaMode===0?-p.deltaY/uU: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 s1(p,b){var C=b.relatedTarget;if(!C)return!0;try{for(;C&&C!==p;)C=C.parentNode}catch{return!1}return C!==p}var cU={__proto__:null,on:nt,off:Rt,stopPropagation:xl,disableScrollPropagation:o1,disableClickPropagation:Wf,preventDefault:Hr,stop:_l,getPropagationPath:EL,getMousePosition:jL,getWheelDelta:RL,isExternalTarget:s1,addListener:nt,removeListener:Rt},OL=V.extend({run:function(p,b,C,k){this.stop(),this._el=p,this._inProgress=!0,this._duration=C||.25,this._easeOutPower=1/Math.max(k||.5,.2),this._startPos=yl(p),this._offset=b.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=D(this._animate,this),this._step()},_step:function(p){var b=+new Date-this._startTime,C=this._duration*1e3;bthis.options.maxZoom)?this.setZoom(p):this},panInsideBounds:function(p,b){this._enforcingBounds=!0;var C=this.getCenter(),k=this._limitCenter(C,this._zoom,ie(p));return C.equals(k)||this.panTo(k,b),this._enforcingBounds=!1,this},panInside:function(p,b){b=b||{};var C=U(b.paddingTopLeft||b.padding||[0,0]),k=U(b.paddingBottomRight||b.padding||[0,0]),E=this.project(this.getCenter()),B=this.project(p),X=this.getPixelBounds(),J=Y([X.min.add(C),X.max.subtract(k)]),ne=J.getSize();if(!J.contains(B)){this._enforcingBounds=!0;var ue=B.subtract(J.getCenter()),Ie=J.extend(B).getSize().subtract(ne);E.x+=ue.x<0?-Ie.x:Ie.x,E.y+=ue.y<0?-Ie.y:Ie.y,this.panTo(this.unproject(E),b),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 b=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var C=this.getSize(),k=b.divideBy(2).round(),E=C.divideBy(2).round(),B=k.subtract(E);return!B.x&&!B.y?this:(p.animate&&p.pan?this.panBy(B):(p.pan&&this._rawPanBy(B),this.fire("move"),p.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:b,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 b=o(this._handleGeolocationResponse,this),C=o(this._handleGeolocationError,this);return p.watch?this._locationWatchId=navigator.geolocation.watchPosition(b,C,p):navigator.geolocation.getCurrentPosition(b,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 b=p.code,C=p.message||(b===1?"permission denied":b===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:b,message:"Geolocation error: "+C+"."})}},_handleGeolocationResponse:function(p){if(this._container._leaflet_id){var b=p.coords.latitude,C=p.coords.longitude,k=new se(b,C),E=k.toBounds(p.coords.accuracy*2),B=this._locateOptions;if(B.setView){var X=this.getBoundsZoom(E);this.setView(k,B.maxZoom?Math.min(X,B.maxZoom):X)}var J={latlng:k,bounds:E,timestamp:p.timestamp};for(var ne in p.coords)typeof p.coords[ne]=="number"&&(J[ne]=p.coords[ne]);this.fire("locationfound",J)}},addHandler:function(p,b){if(!b)return this;var C=this[p]=new b(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(),Zt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(O(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)Zt(this._panes[p]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(p,b){var C="leaflet-pane"+(p?" leaflet-"+p.replace("Pane","")+"-pane":""),k=St("div",C,b||this._mapPane);return p&&(this._panes[p]=k),k},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(),b=this.unproject(p.getBottomLeft()),C=this.unproject(p.getTopRight());return new te(b,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,b,C){p=ie(p),C=U(C||[0,0]);var k=this.getZoom()||0,E=this.getMinZoom(),B=this.getMaxZoom(),X=p.getNorthWest(),J=p.getSouthEast(),ne=this.getSize().subtract(C),ue=Y(this.project(J,k),this.project(X,k)).getSize(),Ie=Be.any3d?this.options.zoomSnap:1,Xe=ne.x/ue.x,ut=ne.y/ue.y,pn=b?Math.max(Xe,ut):Math.min(Xe,ut);return k=this.getScaleZoom(pn,k),Ie&&(k=Math.round(k/(Ie/100))*(Ie/100),k=b?Math.ceil(k/Ie)*Ie:Math.floor(k/Ie)*Ie),Math.max(E,Math.min(B,k))},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,b){var C=this._getTopLeftPoint(p,b);return new $(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,b){var C=this.options.crs;return b=b===void 0?this._zoom:b,C.scale(p)/C.scale(b)},getScaleZoom:function(p,b){var C=this.options.crs;b=b===void 0?this._zoom:b;var k=C.zoom(p*C.scale(b));return isNaN(k)?1/0:k},project:function(p,b){return b=b===void 0?this._zoom:b,this.options.crs.latLngToPoint(le(p),b)},unproject:function(p,b){return b=b===void 0?this._zoom:b,this.options.crs.pointToLatLng(U(p),b)},layerPointToLatLng:function(p){var b=U(p).add(this.getPixelOrigin());return this.unproject(b)},latLngToLayerPoint:function(p){var b=this.project(le(p))._round();return b._subtract(this.getPixelOrigin())},wrapLatLng:function(p){return this.options.crs.wrapLatLng(le(p))},wrapLatLngBounds:function(p){return this.options.crs.wrapLatLngBounds(ie(p))},distance:function(p,b){return this.options.crs.distance(le(p),le(b))},containerPointToLayerPoint:function(p){return U(p).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(p){return U(p).add(this._getMapPanePos())},containerPointToLatLng:function(p){var b=this.containerPointToLayerPoint(U(p));return this.layerPointToLatLng(b)},latLngToContainerPoint:function(p){return this.layerPointToContainerPoint(this.latLngToLayerPoint(le(p)))},mouseEventToContainerPoint:function(p){return jL(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 b=this._container=PL(p);if(b){if(b._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");nt(b,"scroll",this._onScroll,this),this._containerId=l(b)},_initLayout:function(){var p=this._container;this._fadeAnimated=this.options.fadeAnimation&&Be.any3d,at(p,"leaflet-container"+(Be.touch?" leaflet-touch":"")+(Be.retina?" leaflet-retina":"")+(Be.ielt9?" leaflet-oldie":"")+(Be.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var b=Bf(p,"position");b!=="absolute"&&b!=="relative"&&b!=="fixed"&&b!=="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),mr(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||(at(p.markerPane,"leaflet-zoom-hide"),at(p.shadowPane,"leaflet-zoom-hide"))},_resetView:function(p,b,C){mr(this._mapPane,new z(0,0));var k=!this._loaded;this._loaded=!0,b=this._limitZoom(b),this.fire("viewprereset");var E=this._zoom!==b;this._moveStart(E,C)._move(p,b)._moveEnd(E),this.fire("viewreset"),k&&this.fire("load")},_moveStart:function(p,b){return p&&this.fire("zoomstart"),b||this.fire("movestart"),this},_move:function(p,b,C,k){b===void 0&&(b=this._zoom);var E=this._zoom!==b;return this._zoom=b,this._lastCenter=p,this._pixelOrigin=this._getNewPixelOrigin(p),k?C&&C.pinch&&this.fire("zoom",C):((E||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 O(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(p){mr(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 b=p?Rt:nt;b(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&b(window,"resize",this._onResize,this),Be.any3d&&this.options.transform3DLimit&&(p?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){O(this._resizeRequest),this._resizeRequest=D(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,b){for(var C=[],k,E=b==="mouseout"||b==="mouseover",B=p.target||p.srcElement,X=!1;B;){if(k=this._targets[l(B)],k&&(b==="click"||b==="preclick")&&this._draggableMoved(k)){X=!0;break}if(k&&k.listens(b,!0)&&(E&&!s1(B,p)||(C.push(k),E))||B===this._container)break;B=B.parentNode}return!C.length&&!X&&!E&&this.listens(b,!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 b=p.target||p.srcElement;if(!(!this._loaded||b._leaflet_disable_events||p.type==="click"&&this._isClickDisabled(b))){var C=p.type;C==="mousedown"&&t1(b),this._fireDOMEvent(p,C)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(p,b,C){if(p.type==="click"){var k=i({},p);k.type="preclick",this._fireDOMEvent(k,k.type,C)}var E=this._findEventTargets(p,b);if(C){for(var B=[],X=0;X0?Math.round(p-b)/2:Math.max(0,Math.ceil(p))-Math.max(0,Math.floor(b))},_limitZoom:function(p){var b=this.getMinZoom(),C=this.getMaxZoom(),k=Be.any3d?this.options.zoomSnap:1;return k&&(p=Math.round(p/k)*k),Math.max(b,Math.min(C,p))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){cr(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(p,b){var C=this._getCenterOffset(p)._trunc();return(b&&b.animate)!==!0&&!this.getSize().contains(C)?!1:(this.panBy(C,b),!0)},_createAnimProxy:function(){var p=this._proxy=St("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(p),this.on("zoomanim",function(b){var C=Y_,k=this._proxy.style[C];ml(this._proxy,this.project(b.center,b.zoom),this.getZoomScale(b.zoom,1)),k===this._proxy.style[C]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Zt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var p=this.getCenter(),b=this.getZoom();ml(this._proxy,this.project(p,b),this.getZoomScale(b,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,b,C){if(this._animatingZoom)return!0;if(C=C||{},!this._zoomAnimated||C.animate===!1||this._nothingToAnimate()||Math.abs(b-this._zoom)>this.options.zoomAnimationThreshold)return!1;var k=this.getZoomScale(b),E=this._getCenterOffset(p)._divideBy(1-1/k);return C.animate!==!0&&!this.getSize().contains(E)?!1:(D(function(){this._moveStart(!0,C.noMoveStart||!1)._animateZoom(p,b,!0)},this),!0)},_animateZoom:function(p,b,C,k){this._mapPane&&(C&&(this._animatingZoom=!0,this._animateToCenter=p,this._animateToZoom=b,at(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:p,zoom:b,noUpdate:k}),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&&cr(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 hU(p,b){return new mt(p,b)}var Wi=F.extend({options:{position:"topright"},initialize:function(p){m(this,p)},getPosition:function(){return this.options.position},setPosition:function(p){var b=this._map;return b&&b.removeControl(this),this.options.position=p,b&&b.addControl(this),this},getContainer:function(){return this._container},addTo:function(p){this.remove(),this._map=p;var b=this._container=this.onAdd(p),C=this.getPosition(),k=p._controlCorners[C];return at(b,"leaflet-control"),C.indexOf("bottom")!==-1?k.insertBefore(b,k.firstChild):k.appendChild(b),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Zt(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()}}),Hf=function(p){return new Wi(p)};mt.include({addControl:function(p){return p.addTo(this),this},removeControl:function(p){return p.remove(),this},_initControlPos:function(){var p=this._controlCorners={},b="leaflet-",C=this._controlContainer=St("div",b+"control-container",this._container);function k(E,B){var X=b+E+" "+b+B;p[E+B]=St("div",X,C)}k("top","left"),k("top","right"),k("bottom","left"),k("bottom","right")},_clearControlPos:function(){for(var p in this._controlCorners)Zt(this._controlCorners[p]);Zt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var zL=Wi.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(p,b,C,k){return C1,this._baseLayersList.style.display=p?"":"none"),this._separator.style.display=b&&p?"":"none",this},_onLayerChange:function(p){this._handlingClick||this._update();var b=this._getLayer(l(p.target)),C=b.overlay?p.type==="add"?"overlayadd":"overlayremove":p.type==="add"?"baselayerchange":null;C&&this._map.fire(C,b)},_createRadioElement:function(p,b){var C='",k=document.createElement("div");return k.innerHTML=C,k.firstChild},_addItem:function(p){var b=document.createElement("label"),C=this._map.hasLayer(p.layer),k;p.overlay?(k=document.createElement("input"),k.type="checkbox",k.className="leaflet-control-layers-selector",k.defaultChecked=C):k=this._createRadioElement("leaflet-base-layers_"+l(this),C),this._layerControlInputs.push(k),k.layerId=l(p.layer),nt(k,"click",this._onInputClick,this);var E=document.createElement("span");E.innerHTML=" "+p.name;var B=document.createElement("span");b.appendChild(B),B.appendChild(k),B.appendChild(E);var X=p.overlay?this._overlaysList:this._baseLayersList;return X.appendChild(b),this._checkDisabledLayers(),b},_onInputClick:function(){if(!this._preventClick){var p=this._layerControlInputs,b,C,k=[],E=[];this._handlingClick=!0;for(var B=p.length-1;B>=0;B--)b=p[B],C=this._getLayer(b.layerId).layer,b.checked?k.push(C):b.checked||E.push(C);for(B=0;B=0;E--)b=p[E],C=this._getLayer(b.layerId).layer,b.disabled=C.options.minZoom!==void 0&&kC.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var p=this._section;this._preventClick=!0,nt(p,"click",Hr),this.expand();var b=this;setTimeout(function(){Rt(p,"click",Hr),b._preventClick=!1})}}),fU=function(p,b,C){return new zL(p,b,C)},l1=Wi.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(p){var b="leaflet-control-zoom",C=St("div",b+" leaflet-bar"),k=this.options;return this._zoomInButton=this._createButton(k.zoomInText,k.zoomInTitle,b+"-in",C,this._zoomIn),this._zoomOutButton=this._createButton(k.zoomOutText,k.zoomOutTitle,b+"-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,b,C,k,E){var B=St("a",C,k);return B.innerHTML=p,B.href="#",B.title=b,B.setAttribute("role","button"),B.setAttribute("aria-label",b),Wf(B),nt(B,"click",_l),nt(B,"click",E,this),nt(B,"click",this._refocusOnMap,this),B},_updateDisabled:function(){var p=this._map,b="leaflet-disabled";cr(this._zoomInButton,b),cr(this._zoomOutButton,b),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||p._zoom===p.getMinZoom())&&(at(this._zoomOutButton,b),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||p._zoom===p.getMaxZoom())&&(at(this._zoomInButton,b),this._zoomInButton.setAttribute("aria-disabled","true"))}});mt.mergeOptions({zoomControl:!0}),mt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new l1,this.addControl(this.zoomControl))});var dU=function(p){return new l1(p)},BL=Wi.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(p){var b="leaflet-control-scale",C=St("div",b),k=this.options;return this._addScales(k,b+"-line",C),p.on(k.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,b,C){p.metric&&(this._mScale=St("div",b,C)),p.imperial&&(this._iScale=St("div",b,C))},_update:function(){var p=this._map,b=p.getSize().y/2,C=p.distance(p.containerPointToLatLng([0,b]),p.containerPointToLatLng([this.options.maxWidth,b]));this._updateScales(C)},_updateScales:function(p){this.options.metric&&p&&this._updateMetric(p),this.options.imperial&&p&&this._updateImperial(p)},_updateMetric:function(p){var b=this._getRoundNum(p),C=b<1e3?b+" m":b/1e3+" km";this._updateScale(this._mScale,C,b/p)},_updateImperial:function(p){var b=p*3.2808399,C,k,E;b>5280?(C=b/5280,k=this._getRoundNum(C),this._updateScale(this._iScale,k+" mi",k/C)):(E=this._getRoundNum(b),this._updateScale(this._iScale,E+" ft",E/b))},_updateScale:function(p,b,C){p.style.width=Math.round(this.options.maxWidth*C)+"px",p.innerHTML=b},_getRoundNum:function(p){var b=Math.pow(10,(Math.floor(p)+"").length-1),C=p/b;return C=C>=10?10:C>=5?5:C>=3?3:C>=2?2:1,b*C}}),vU=function(p){return new BL(p)},pU='',u1=Wi.extend({options:{position:"bottomright",prefix:''+(Be.inlineSvg?pU+" ":"")+"Leaflet"},initialize:function(p){m(this,p),this._attributions={}},onAdd:function(p){p.attributionControl=this,this._container=St("div","leaflet-control-attribution"),Wf(this._container);for(var b in p._layers)p._layers[b].getAttribution&&this.addAttribution(p._layers[b].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 b in this._attributions)this._attributions[b]&&p.push(b);var C=[];this.options.prefix&&C.push(this.options.prefix),p.length&&C.push(p.join(", ")),this._container.innerHTML=C.join(' ')}}});mt.mergeOptions({attributionControl:!0}),mt.addInitHook(function(){this.options.attributionControl&&new u1().addTo(this)});var gU=function(p){return new u1(p)};Wi.Layers=zL,Wi.Zoom=l1,Wi.Scale=BL,Wi.Attribution=u1,Hf.layers=fU,Hf.zoom=dU,Hf.scale=vU,Hf.attribution=gU;var ma=F.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}});ma.addTo=function(p,b){return p.addHandler(b,this),this};var mU={Events:W},FL=Be.touch?"touchstart mousedown":"mousedown",es=V.extend({options:{clickTolerance:3},initialize:function(p,b,C,k){m(this,k),this._element=p,this._dragStartTarget=b||p,this._preventOutline=C},enable:function(){this._enabled||(nt(this._dragStartTarget,FL,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(es._dragging===this&&this.finishDrag(!0),Rt(this._dragStartTarget,FL,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(p){if(this._enabled&&(this._moved=!1,!X_(this._element,"leaflet-zoom-anim"))){if(p.touches&&p.touches.length!==1){es._dragging===this&&this.finishDrag();return}if(!(es._dragging||p.shiftKey||p.which!==1&&p.button!==1&&!p.touches)&&(es._dragging=this,this._preventOutline&&t1(this._element),J_(),Ff(),!this._moving)){this.fire("down");var b=p.touches?p.touches[0]:p,C=IL(this._element);this._startPoint=new z(b.clientX,b.clientY),this._startPos=yl(this._element),this._parentScale=r1(C);var k=p.type==="mousedown";nt(document,k?"mousemove":"touchmove",this._onMove,this),nt(document,k?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(p){if(this._enabled){if(p.touches&&p.touches.length>1){this._moved=!0;return}var b=p.touches&&p.touches.length===1?p.touches[0]:p,C=new z(b.clientX,b.clientY)._subtract(this._startPoint);!C.x&&!C.y||Math.abs(C.x)+Math.abs(C.y)B&&(X=J,B=ne);B>C&&(b[X]=1,h1(p,b,C,k,X),h1(p,b,C,X,E))}function bU(p,b){for(var C=[p[0]],k=1,E=0,B=p.length;kb&&(C.push(p[k]),E=k);return Eb.max.x&&(C|=2),p.yb.max.y&&(C|=8),C}function wU(p,b){var C=b.x-p.x,k=b.y-p.y;return C*C+k*k}function Uf(p,b,C,k){var E=b.x,B=b.y,X=C.x-E,J=C.y-B,ne=X*X+J*J,ue;return ne>0&&(ue=((p.x-E)*X+(p.y-B)*J)/ne,ue>1?(E=C.x,B=C.y):ue>0&&(E+=X*ue,B+=J*ue)),X=p.x-E,J=p.y-B,k?X*X+J*J:new z(E,B)}function hi(p){return!w(p[0])||typeof p[0][0]!="object"&&typeof p[0][0]<"u"}function $L(p){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),hi(p)}function YL(p,b){var C,k,E,B,X,J,ne,ue;if(!p||p.length===0)throw new Error("latlngs not passed");hi(p)||(console.warn("latlngs are not flat! Only the first ring will be used"),p=p[0]);var Ie=le([0,0]),Xe=ie(p),ut=Xe.getNorthWest().distanceTo(Xe.getSouthWest())*Xe.getNorthEast().distanceTo(Xe.getNorthWest());ut<1700&&(Ie=c1(p));var pn=p.length,jr=[];for(C=0;Ck){ne=(B-k)/E,ue=[J.x-ne*(J.x-X.x),J.y-ne*(J.y-X.y)];break}var An=b.unproject(U(ue));return le([An.lat+Ie.lat,An.lng+Ie.lng])}var SU={__proto__:null,simplify:WL,pointToSegmentDistance:HL,closestPointOnSegment:xU,clipSegment:ZL,_getEdgeIntersection:xg,_getBitCode:bl,_sqClosestPointOnSegment:Uf,isFlat:hi,_flat:$L,polylineCenter:YL},f1={project:function(p){return new z(p.lng,p.lat)},unproject:function(p){return new se(p.y,p.x)},bounds:new $([-180,-90],[180,90])},d1={R:6378137,R_MINOR:6356752314245179e-9,bounds:new $([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(p){var b=Math.PI/180,C=this.R,k=p.lat*b,E=this.R_MINOR/C,B=Math.sqrt(1-E*E),X=B*Math.sin(k),J=Math.tan(Math.PI/4-k/2)/Math.pow((1-X)/(1+X),B/2);return k=-C*Math.log(Math.max(J,1e-10)),new z(p.lng*b*C,k)},unproject:function(p){for(var b=180/Math.PI,C=this.R,k=this.R_MINOR/C,E=Math.sqrt(1-k*k),B=Math.exp(-p.y/C),X=Math.PI/2-2*Math.atan(B),J=0,ne=.1,ue;J<15&&Math.abs(ne)>1e-7;J++)ue=E*Math.sin(X),ue=Math.pow((1-ue)/(1+ue),E/2),ne=Math.PI/2-2*Math.atan(B*ue)-X,X+=ne;return new se(X*b,p.x*b/C)}},CU={__proto__:null,LonLat:f1,Mercator:d1,SphericalMercator:Me},TU=i({},me,{code:"EPSG:3395",projection:d1,transformation:function(){var p=.5/(Math.PI*d1.R);return Te(p,.5,-p,.5)}()}),XL=i({},me,{code:"EPSG:4326",projection:f1,transformation:Te(1/180,1,-1/180,.5)}),MU=i({},Ee,{projection:f1,transformation:Te(1,0,-1,0),scale:function(p){return Math.pow(2,p)},zoom:function(p){return Math.log(p)/Math.LN2},distance:function(p,b){var C=b.lng-p.lng,k=b.lat-p.lat;return Math.sqrt(C*C+k*k)},infinite:!0});Ee.Earth=me,Ee.EPSG3395=TU,Ee.EPSG3857=st,Ee.EPSG900913=ze,Ee.EPSG4326=XL,Ee.Simple=MU;var Hi=V.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 b=p.target;if(b.hasLayer(this)){if(this._map=b,this._zoomAnimated=b._zoomAnimated,this.getEvents){var C=this.getEvents();b.on(C,this),this.once("remove",function(){b.off(C,this)},this)}this.onAdd(b),this.fire("add"),b.fire("layeradd",{layer:this})}}});mt.include({addLayer:function(p){if(!p._layerAdd)throw new Error("The provided object is not a Layer.");var b=l(p);return this._layers[b]?this:(this._layers[b]=p,p._mapToAdd=this,p.beforeAdd&&p.beforeAdd(this),this.whenReady(p._layerAdd,p),this)},removeLayer:function(p){var b=l(p);return this._layers[b]?(this._loaded&&p.onRemove(this),delete this._layers[b],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,b){for(var C in this._layers)p.call(b,this._layers[C]);return this},_addLayers:function(p){p=p?w(p)?p:[p]:[];for(var b=0,C=p.length;bthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&b[0]instanceof se&&b[0].equals(b[C-1])&&b.pop(),b},_setLatLngs:function(p){uo.prototype._setLatLngs.call(this,p),hi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return hi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var p=this._renderer._bounds,b=this.options.weight,C=new z(b,b);if(p=new $(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 k=0,E=this._rings.length,B;kp.y!=E.y>p.y&&p.x<(E.x-k.x)*(p.y-k.y)/(E.y-k.y)+k.x&&(b=!b);return b||uo.prototype._containsPoint.call(this,p,!0)}});function EU(p,b){return new hc(p,b)}var co=lo.extend({initialize:function(p,b){m(this,b),this._layers={},p&&this.addData(p)},addData:function(p){var b=w(p)?p:p.features,C,k,E;if(b){for(C=0,k=b.length;C0&&E.push(E[0].slice()),E}function fc(p,b){return p.feature?i({},p.feature,{geometry:b}):Tg(b)}function Tg(p){return p.type==="Feature"||p.type==="FeatureCollection"?p:{type:"Feature",properties:{},geometry:p}}var m1={toGeoJSON:function(p){return fc(this,{type:"Point",coordinates:g1(this.getLatLng(),p)})}};_g.include(m1),v1.include(m1),bg.include(m1),uo.include({toGeoJSON:function(p){var b=!hi(this._latlngs),C=Cg(this._latlngs,b?1:0,!1,p);return fc(this,{type:(b?"Multi":"")+"LineString",coordinates:C})}}),hc.include({toGeoJSON:function(p){var b=!hi(this._latlngs),C=b&&!hi(this._latlngs[0]),k=Cg(this._latlngs,C?2:b?1:0,!0,p);return b||(k=[k]),fc(this,{type:(C?"Multi":"")+"Polygon",coordinates:k})}}),uc.include({toMultiPoint:function(p){var b=[];return this.eachLayer(function(C){b.push(C.toGeoJSON(p).geometry.coordinates)}),fc(this,{type:"MultiPoint",coordinates:b})},toGeoJSON:function(p){var b=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(b==="MultiPoint")return this.toMultiPoint(p);var C=b==="GeometryCollection",k=[];return this.eachLayer(function(E){if(E.toGeoJSON){var B=E.toGeoJSON(p);if(C)k.push(B.geometry);else{var X=Tg(B);X.type==="FeatureCollection"?k.push.apply(k,X.features):k.push(X)}}}),C?fc(this,{geometries:k,type:"GeometryCollection"}):{type:"FeatureCollection",features:k}}});function JL(p,b){return new co(p,b)}var jU=JL,Mg=Hi.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(p,b,C){this._url=p,this._bounds=ie(b),m(this,C)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(at(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Zt(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&&sc(this._image),this},bringToBack:function(){return this._map&&lc(this._image),this},setUrl:function(p){return this._url=p,this._image&&(this._image.src=p),this},setBounds:function(p){return this._bounds=ie(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",b=this._image=p?this._url:St("img");if(at(b,"leaflet-image-layer"),this._zoomAnimated&&at(b,"leaflet-zoom-animated"),this.options.className&&at(b,this.options.className),b.onselectstart=h,b.onmousemove=h,b.onload=o(this.fire,this,"load"),b.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(b.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),p){this._url=b.src;return}b.src=this._url,b.alt=this.options.alt},_animateZoom:function(p){var b=this._map.getZoomScale(p.zoom),C=this._map._latLngBoundsToNewLayerBounds(this._bounds,p.zoom,p.center).min;ml(this._image,C,b)},_reset:function(){var p=this._image,b=new $(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),C=b.getSize();mr(p,b.min),p.style.width=C.x+"px",p.style.height=C.y+"px"},_updateOpacity:function(){ci(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()}}),RU=function(p,b,C){return new Mg(p,b,C)},QL=Mg.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var p=this._url.tagName==="VIDEO",b=this._image=p?this._url:St("video");if(at(b,"leaflet-image-layer"),this._zoomAnimated&&at(b,"leaflet-zoom-animated"),this.options.className&&at(b,this.options.className),b.onselectstart=h,b.onmousemove=h,b.onloadeddata=o(this.fire,this,"load"),p){for(var C=b.getElementsByTagName("source"),k=[],E=0;E0?k:[b.src];return}w(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(b.style,"objectFit")&&(b.style.objectFit="fill"),b.autoplay=!!this.options.autoplay,b.loop=!!this.options.loop,b.muted=!!this.options.muted,b.playsInline=!!this.options.playsInline;for(var B=0;BE?(b.height=E+"px",at(p,B)):cr(p,B),this._containerWidth=this._container.offsetWidth},_animateZoom:function(p){var b=this._map._latLngToNewLayerPoint(this._latlng,p.zoom,p.center),C=this._getAnchor();mr(this._container,b.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,b=parseInt(Bf(this._container,"marginBottom"),10)||0,C=this._container.offsetHeight+b,k=this._containerWidth,E=new z(this._containerLeft,-C-this._containerBottom);E._add(yl(this._container));var B=p.layerPointToContainerPoint(E),X=U(this.options.autoPanPadding),J=U(this.options.autoPanPaddingTopLeft||X),ne=U(this.options.autoPanPaddingBottomRight||X),ue=p.getSize(),Ie=0,Xe=0;B.x+k+ne.x>ue.x&&(Ie=B.x+k-ue.x+ne.x),B.x-Ie-J.x<0&&(Ie=B.x-J.x),B.y+C+ne.y>ue.y&&(Xe=B.y+C-ue.y+ne.y),B.y-Xe-J.y<0&&(Xe=B.y-J.y),(Ie||Xe)&&(this.options.keepInView&&(this._autopanning=!0),p.fire("autopanstart").panBy([Ie,Xe]))}},_getAnchor:function(){return U(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),BU=function(p,b){return new Ag(p,b)};mt.mergeOptions({closePopupOnClick:!0}),mt.include({openPopup:function(p,b,C){return this._initOverlay(Ag,p,b,C).openOn(this),this},closePopup:function(p){return p=arguments.length?p:this._popup,p&&p.close(),this}}),Hi.include({bindPopup:function(p,b){return this._popup=this._initOverlay(Ag,this._popup,p,b),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 lo||(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)){_l(p);var b=p.layer||p.target;if(this._popup._source===b&&!(b instanceof ts)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(p.latlng);return}this._popup._source=b,this.openPopup(p.latlng)}},_movePopup:function(p){this._popup.setLatLng(p.latlng)},_onKeyPress:function(p){p.originalEvent.keyCode===13&&this._openPopup(p)}});var kg=ya.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(p){ya.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){ya.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=ya.prototype.getEvents.call(this);return this.options.permanent||(p.preclick=this.close),p},_initLayout:function(){var p="leaflet-tooltip",b=p+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=St("div",b),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+l(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(p){var b,C,k=this._map,E=this._container,B=k.latLngToContainerPoint(k.getCenter()),X=k.layerPointToContainerPoint(p),J=this.options.direction,ne=E.offsetWidth,ue=E.offsetHeight,Ie=U(this.options.offset),Xe=this._getAnchor();J==="top"?(b=ne/2,C=ue):J==="bottom"?(b=ne/2,C=0):J==="center"?(b=ne/2,C=ue/2):J==="right"?(b=0,C=ue/2):J==="left"?(b=ne,C=ue/2):X.xthis.options.maxZoom||Ck?this._retainParent(E,B,X,k):!1)},_retainChildren:function(p,b,C,k){for(var E=2*p;E<2*p+2;E++)for(var B=2*b;B<2*b+2;B++){var X=new z(E,B);X.z=C+1;var J=this._tileCoordsToKey(X),ne=this._tiles[J];if(ne&&ne.active){ne.retain=!0;continue}else ne&&ne.loaded&&(ne.retain=!0);C+1this.options.maxZoom||this.options.minZoom!==void 0&&E1){this._setView(p,C);return}for(var Xe=E.min.y;Xe<=E.max.y;Xe++)for(var ut=E.min.x;ut<=E.max.x;ut++){var pn=new z(ut,Xe);if(pn.z=this._tileZoom,!!this._isValidTile(pn)){var jr=this._tiles[this._tileCoordsToKey(pn)];jr?jr.current=!0:X.push(pn)}}if(X.sort(function(An,vc){return An.distanceTo(B)-vc.distanceTo(B)}),X.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var fi=document.createDocumentFragment();for(ut=0;utC.max.x)||!b.wrapLat&&(p.yC.max.y))return!1}if(!this.options.bounds)return!0;var k=this._tileCoordsToBounds(p);return ie(this.options.bounds).overlaps(k)},_keyToBounds:function(p){return this._tileCoordsToBounds(this._keyToTileCoords(p))},_tileCoordsToNwSe:function(p){var b=this._map,C=this.getTileSize(),k=p.scaleBy(C),E=k.add(C),B=b.unproject(k,p.z),X=b.unproject(E,p.z);return[B,X]},_tileCoordsToBounds:function(p){var b=this._tileCoordsToNwSe(p),C=new te(b[0],b[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 b=p.split(":"),C=new z(+b[0],+b[1]);return C.z=+b[2],C},_removeTile:function(p){var b=this._tiles[p];b&&(Zt(b.el),delete this._tiles[p],this.fire("tileunload",{tile:b.el,coords:this._keyToTileCoords(p)}))},_initTile:function(p){at(p,"leaflet-tile");var b=this.getTileSize();p.style.width=b.x+"px",p.style.height=b.y+"px",p.onselectstart=h,p.onmousemove=h,Be.ielt9&&this.options.opacity<1&&ci(p,this.options.opacity)},_addTile:function(p,b){var C=this._getTilePos(p),k=this._tileCoordsToKey(p),E=this.createTile(this._wrapCoords(p),o(this._tileReady,this,p));this._initTile(E),this.createTile.length<2&&D(o(this._tileReady,this,p,null,E)),mr(E,C),this._tiles[k]={el:E,coords:p,current:!0},b.appendChild(E),this.fire("tileloadstart",{tile:E,coords:p})},_tileReady:function(p,b,C){b&&this.fire("tileerror",{error:b,tile:C,coords:p});var k=this._tileCoordsToKey(p);C=this._tiles[k],C&&(C.loaded=+new Date,this._map._fadeAnimated?(ci(C.el,0),O(this._fadeFrame),this._fadeFrame=D(this._updateOpacity,this)):(C.active=!0,this._pruneTiles()),b||(at(C.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:C.el,coords:p})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Be.ielt9||!this._map._fadeAnimated?D(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 b=new z(this._wrapX?c(p.x,this._wrapX):p.x,this._wrapY?c(p.y,this._wrapY):p.y);return b.z=p.z,b},_pxBoundsToTileRange:function(p){var b=this.getTileSize();return new $(p.min.unscaleBy(b).floor(),p.max.unscaleBy(b).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var p in this._tiles)if(!this._tiles[p].loaded)return!1;return!0}});function GU(p){return new $f(p)}var dc=$f.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(p,b){this._url=p,b=m(this,b),b.detectRetina&&Be.retina&&b.maxZoom>0?(b.tileSize=Math.floor(b.tileSize/2),b.zoomReverse?(b.zoomOffset--,b.minZoom=Math.min(b.maxZoom,b.minZoom+1)):(b.zoomOffset++,b.maxZoom=Math.max(b.minZoom,b.maxZoom-1)),b.minZoom=Math.max(0,b.minZoom)):b.zoomReverse?b.minZoom=Math.min(b.maxZoom,b.minZoom):b.maxZoom=Math.max(b.minZoom,b.maxZoom),typeof b.subdomains=="string"&&(b.subdomains=b.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(p,b){return this._url===p&&b===void 0&&(b=!0),this._url=p,b||this.redraw(),this},createTile:function(p,b){var C=document.createElement("img");return nt(C,"load",o(this._tileOnLoad,this,b,C)),nt(C,"error",o(this._tileOnError,this,b,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 b={r:Be.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&&(b.y=C),b["-y"]=C}return _(this._url,i(b,this.options))},_tileOnLoad:function(p,b){Be.ielt9?setTimeout(o(p,this,null,b),0):p(null,b)},_tileOnError:function(p,b,C){var k=this.options.errorTileUrl;k&&b.getAttribute("src")!==k&&(b.src=k),p(C,b)},_onTileRemove:function(p){p.tile.onload=null},_getZoomForUrl:function(){var p=this._tileZoom,b=this.options.maxZoom,C=this.options.zoomReverse,k=this.options.zoomOffset;return C&&(p=b-p),p+k},_getSubdomain:function(p){var b=Math.abs(p.x+p.y)%this.options.subdomains.length;return this.options.subdomains[b]},_abortLoading:function(){var p,b;for(p in this._tiles)if(this._tiles[p].coords.z!==this._tileZoom&&(b=this._tiles[p].el,b.onload=h,b.onerror=h,!b.complete)){b.src=T;var C=this._tiles[p].coords;Zt(b),delete this._tiles[p],this.fire("tileabort",{tile:b,coords:C})}},_removeTile:function(p){var b=this._tiles[p];if(b)return b.el.setAttribute("src",T),$f.prototype._removeTile.call(this,p)},_tileReady:function(p,b,C){if(!(!this._map||C&&C.getAttribute("src")===T))return $f.prototype._tileReady.call(this,p,b,C)}});function rN(p,b){return new dc(p,b)}var nN=dc.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,b){this._url=p;var C=i({},this.defaultWmsParams);for(var k in b)k in this.options||(C[k]=b[k]);b=m(this,b);var E=b.detectRetina&&Be.retina?2:1,B=this.getTileSize();C.width=B.x*E,C.height=B.y*E,this.wmsParams=C},onAdd:function(p){this._crs=this.options.crs||p.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var b=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[b]=this._crs.code,dc.prototype.onAdd.call(this,p)},getTileUrl:function(p){var b=this._tileCoordsToNwSe(p),C=this._crs,k=Y(C.project(b[0]),C.project(b[1])),E=k.min,B=k.max,X=(this._wmsVersion>=1.3&&this._crs===XL?[E.y,E.x,B.y,B.x]:[E.x,E.y,B.x,B.y]).join(","),J=dc.prototype.getTileUrl.call(this,p);return J+y(this.wmsParams,J,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+X},setParams:function(p,b){return i(this.wmsParams,p),b||this.redraw(),this}});function WU(p,b){return new nN(p,b)}dc.WMS=nN,rN.wms=WU;var ho=Hi.extend({options:{padding:.1},initialize:function(p){m(this,p),l(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),at(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,b){var C=this._map.getZoomScale(b,this._zoom),k=this._map.getSize().multiplyBy(.5+this.options.padding),E=this._map.project(this._center,b),B=k.multiplyBy(-C).add(E).subtract(this._map._getNewPixelOrigin(p,b));Be.any3d?ml(this._container,B,C):mr(this._container,B)},_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,b=this._map.getSize(),C=this._map.containerPointToLayerPoint(b.multiplyBy(-p)).round();this._bounds=new $(C,C.add(b.multiplyBy(1+p*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),iN=ho.extend({options:{tolerance:0},getEvents:function(){var p=ho.prototype.getEvents.call(this);return p.viewprereset=this._onViewPreReset,p},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ho.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var p=this._container=document.createElement("canvas");nt(p,"mousemove",this._onMouseMove,this),nt(p,"click dblclick mousedown mouseup contextmenu",this._onClick,this),nt(p,"mouseout",this._handleMouseOut,this),p._leaflet_disable_events=!0,this._ctx=p.getContext("2d")},_destroyContainer:function(){O(this._redrawRequest),delete this._ctx,Zt(this._container),Rt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var p;this._redrawBounds=null;for(var b in this._layers)p=this._layers[b],p._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ho.prototype._update.call(this);var p=this._bounds,b=this._container,C=p.getSize(),k=Be.retina?2:1;mr(b,p.min),b.width=k*C.x,b.height=k*C.y,b.style.width=C.x+"px",b.style.height=C.y+"px",Be.retina&&this._ctx.scale(2,2),this._ctx.translate(-p.min.x,-p.min.y),this.fire("update")}},_reset:function(){ho.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(p){this._updateDashArray(p),this._layers[l(p)]=p;var b=p._order={layer:p,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=b),this._drawLast=b,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(p){this._requestRedraw(p)},_removePath:function(p){var b=p._order,C=b.next,k=b.prev;C?C.prev=k:this._drawLast=k,k?k.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 b=p.options.dashArray.split(/[, ]+/),C=[],k,E;for(E=0;E')}}catch{}return function(p){return document.createElement("<"+p+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),HU={_initContainer:function(){this._container=St("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ho.prototype._update.call(this),this.fire("update"))},_initPath:function(p){var b=p._container=Yf("shape");at(b,"leaflet-vml-shape "+(this.options.className||"")),b.coordsize="1 1",p._path=Yf("path"),b.appendChild(p._path),this._updateStyle(p),this._layers[l(p)]=p},_addPath:function(p){var b=p._container;this._container.appendChild(b),p.options.interactive&&p.addInteractiveTarget(b)},_removePath:function(p){var b=p._container;Zt(b),p.removeInteractiveTarget(b),delete this._layers[l(p)]},_updateStyle:function(p){var b=p._stroke,C=p._fill,k=p.options,E=p._container;E.stroked=!!k.stroke,E.filled=!!k.fill,k.stroke?(b||(b=p._stroke=Yf("stroke")),E.appendChild(b),b.weight=k.weight+"px",b.color=k.color,b.opacity=k.opacity,k.dashArray?b.dashStyle=w(k.dashArray)?k.dashArray.join(" "):k.dashArray.replace(/( *, *)/g," "):b.dashStyle="",b.endcap=k.lineCap.replace("butt","flat"),b.joinstyle=k.lineJoin):b&&(E.removeChild(b),p._stroke=null),k.fill?(C||(C=p._fill=Yf("fill")),E.appendChild(C),C.color=k.fillColor||k.color,C.opacity=k.fillOpacity):C&&(E.removeChild(C),p._fill=null)},_updateCircle:function(p){var b=p._point.round(),C=Math.round(p._radius),k=Math.round(p._radiusY||C);this._setPath(p,p._empty()?"M0 0":"AL "+b.x+","+b.y+" "+C+","+k+" 0,"+65535*360)},_setPath:function(p,b){p._path.v=b},_bringToFront:function(p){sc(p._container)},_bringToBack:function(p){lc(p._container)}},Lg=Be.vml?Yf:et,Xf=ho.extend({_initContainer:function(){this._container=Lg("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Lg("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Zt(this._container),Rt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ho.prototype._update.call(this);var p=this._bounds,b=p.getSize(),C=this._container;(!this._svgSize||!this._svgSize.equals(b))&&(this._svgSize=b,C.setAttribute("width",b.x),C.setAttribute("height",b.y)),mr(C,p.min),C.setAttribute("viewBox",[p.min.x,p.min.y,b.x,b.y].join(" ")),this.fire("update")}},_initPath:function(p){var b=p._path=Lg("path");p.options.className&&at(b,p.options.className),p.options.interactive&&at(b,"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){Zt(p._path),p.removeInteractiveTarget(p._path),delete this._layers[l(p)]},_updatePath:function(p){p._project(),p._update()},_updateStyle:function(p){var b=p._path,C=p.options;b&&(C.stroke?(b.setAttribute("stroke",C.color),b.setAttribute("stroke-opacity",C.opacity),b.setAttribute("stroke-width",C.weight),b.setAttribute("stroke-linecap",C.lineCap),b.setAttribute("stroke-linejoin",C.lineJoin),C.dashArray?b.setAttribute("stroke-dasharray",C.dashArray):b.removeAttribute("stroke-dasharray"),C.dashOffset?b.setAttribute("stroke-dashoffset",C.dashOffset):b.removeAttribute("stroke-dashoffset")):b.setAttribute("stroke","none"),C.fill?(b.setAttribute("fill",C.fillColor||C.color),b.setAttribute("fill-opacity",C.fillOpacity),b.setAttribute("fill-rule",C.fillRule||"evenodd")):b.setAttribute("fill","none"))},_updatePoly:function(p,b){this._setPath(p,lt(p._parts,b))},_updateCircle:function(p){var b=p._point,C=Math.max(Math.round(p._radius),1),k=Math.max(Math.round(p._radiusY),1)||C,E="a"+C+","+k+" 0 1,0 ",B=p._empty()?"M0 0":"M"+(b.x-C)+","+b.y+E+C*2+",0 "+E+-C*2+",0 ";this._setPath(p,B)},_setPath:function(p,b){p._path.setAttribute("d",b)},_bringToFront:function(p){sc(p._path)},_bringToBack:function(p){lc(p._path)}});Be.vml&&Xf.include(HU);function oN(p){return Be.svg||Be.vml?new Xf(p):null}mt.include({getRenderer:function(p){var b=p.options.renderer||this._getPaneRenderer(p.options.pane)||this.options.renderer||this._renderer;return b||(b=this._renderer=this._createRenderer()),this.hasLayer(b)||this.addLayer(b),b},_getPaneRenderer:function(p){if(p==="overlayPane"||p===void 0)return!1;var b=this._paneRenderers[p];return b===void 0&&(b=this._createRenderer({pane:p}),this._paneRenderers[p]=b),b},_createRenderer:function(p){return this.options.preferCanvas&&aN(p)||oN(p)}});var sN=hc.extend({initialize:function(p,b){hc.prototype.initialize.call(this,this._boundsToLatLngs(p),b)},setBounds:function(p){return this.setLatLngs(this._boundsToLatLngs(p))},_boundsToLatLngs:function(p){return p=ie(p),[p.getSouthWest(),p.getNorthWest(),p.getNorthEast(),p.getSouthEast()]}});function UU(p,b){return new sN(p,b)}Xf.create=Lg,Xf.pointsToPath=lt,co.geometryToLayer=wg,co.coordsToLatLng=p1,co.coordsToLatLngs=Sg,co.latLngToCoords=g1,co.latLngsToCoords=Cg,co.getFeature=fc,co.asFeature=Tg,mt.mergeOptions({boxZoom:!0});var lN=ma.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(){nt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Rt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Zt(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(),Ff(),J_(),this._startPoint=this._map.mouseEventToContainerPoint(p),nt(document,{contextmenu:_l,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(p){this._moved||(this._moved=!0,this._box=St("div","leaflet-zoom-box",this._container),at(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(p);var b=new $(this._point,this._startPoint),C=b.getSize();mr(this._box,b.min),this._box.style.width=C.x+"px",this._box.style.height=C.y+"px"},_finish:function(){this._moved&&(Zt(this._box),cr(this._container,"leaflet-crosshair")),Vf(),Q_(),Rt(document,{contextmenu:_l,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 b=new te(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(b).fire("boxzoomend",{boxZoomBounds:b})}},_onKeyDown:function(p){p.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});mt.addInitHook("addHandler","boxZoom",lN),mt.mergeOptions({doubleClickZoom:!0});var uN=ma.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(p){var b=this._map,C=b.getZoom(),k=b.options.zoomDelta,E=p.originalEvent.shiftKey?C-k:C+k;b.options.doubleClickZoom==="center"?b.setZoom(E):b.setZoomAround(p.containerPoint,E)}});mt.addInitHook("addHandler","doubleClickZoom",uN),mt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var cN=ma.extend({addHooks:function(){if(!this._draggable){var p=this._map;this._draggable=new es(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))}at(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){cr(this._map._container,"leaflet-grab"),cr(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 b=ie(this._map.options.maxBounds);this._offsetLimit=Y(this._map.latLngToContainerPoint(b.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(b.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 b=this._lastTime=+new Date,C=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(C),this._times.push(b),this._prunePositions(b)}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),b=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=b.subtract(p).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(p,b){return p-(p-b)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var p=this._draggable._newPos.subtract(this._draggable._startPos),b=this._offsetLimit;p.xb.max.x&&(p.x=this._viscousLimit(p.x,b.max.x)),p.y>b.max.y&&(p.y=this._viscousLimit(p.y,b.max.y)),this._draggable._newPos=this._draggable._startPos.add(p)}},_onPreDragWrap:function(){var p=this._worldWidth,b=Math.round(p/2),C=this._initialWorldOffset,k=this._draggable._newPos.x,E=(k-b+C)%p+b-C,B=(k+b+C)%p-b-C,X=Math.abs(E+C)0?B:-B))-b;this._delta=0,this._startTime=null,X&&(p.options.scrollWheelZoom==="center"?p.setZoom(b+X):p.setZoomAround(this._lastMousePos,b+X))}});mt.addInitHook("addHandler","scrollWheelZoom",fN);var ZU=600;mt.mergeOptions({tapHold:Be.touchNative&&Be.safari&&Be.mobile,tapTolerance:15});var dN=ma.extend({addHooks:function(){nt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Rt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(p){if(clearTimeout(this._holdTimeout),p.touches.length===1){var b=p.touches[0];this._startPos=this._newPos=new z(b.clientX,b.clientY),this._holdTimeout=setTimeout(o(function(){this._cancel(),this._isTapValid()&&(nt(document,"touchend",Hr),nt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",b))},this),ZU),nt(document,"touchend touchcancel contextmenu",this._cancel,this),nt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function p(){Rt(document,"touchend",Hr),Rt(document,"touchend touchcancel",p)},_cancel:function(){clearTimeout(this._holdTimeout),Rt(document,"touchend touchcancel contextmenu",this._cancel,this),Rt(document,"touchmove",this._onMove,this)},_onMove:function(p){var b=p.touches[0];this._newPos=new z(b.clientX,b.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(p,b){var C=new MouseEvent(p,{bubbles:!0,cancelable:!0,view:window,screenX:b.screenX,screenY:b.screenY,clientX:b.clientX,clientY:b.clientY});C._simulated=!0,b.target.dispatchEvent(C)}});mt.addInitHook("addHandler","tapHold",dN),mt.mergeOptions({touchZoom:Be.touch,bounceAtZoomLimits:!0});var vN=ma.extend({addHooks:function(){at(this._map._container,"leaflet-touch-zoom"),nt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){cr(this._map._container,"leaflet-touch-zoom"),Rt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(p){var b=this._map;if(!(!p.touches||p.touches.length!==2||b._animatingZoom||this._zooming)){var C=b.mouseEventToContainerPoint(p.touches[0]),k=b.mouseEventToContainerPoint(p.touches[1]);this._centerPoint=b.getSize()._divideBy(2),this._startLatLng=b.containerPointToLatLng(this._centerPoint),b.options.touchZoom!=="center"&&(this._pinchStartLatLng=b.containerPointToLatLng(C.add(k)._divideBy(2))),this._startDist=C.distanceTo(k),this._startZoom=b.getZoom(),this._moved=!1,this._zooming=!0,b._stop(),nt(document,"touchmove",this._onTouchMove,this),nt(document,"touchend touchcancel",this._onTouchEnd,this),Hr(p)}},_onTouchMove:function(p){if(!(!p.touches||p.touches.length!==2||!this._zooming)){var b=this._map,C=b.mouseEventToContainerPoint(p.touches[0]),k=b.mouseEventToContainerPoint(p.touches[1]),E=C.distanceTo(k)/this._startDist;if(this._zoom=b.getScaleZoom(E,this._startZoom),!b.options.bounceAtZoomLimits&&(this._zoomb.getMaxZoom()&&E>1)&&(this._zoom=b._limitZoom(this._zoom)),b.options.touchZoom==="center"){if(this._center=this._startLatLng,E===1)return}else{var B=C._add(k)._divideBy(2)._subtract(this._centerPoint);if(E===1&&B.x===0&&B.y===0)return;this._center=b.unproject(b.project(this._pinchStartLatLng,this._zoom).subtract(B),this._zoom)}this._moved||(b._moveStart(!0,!1),this._moved=!0),O(this._animRequest);var X=o(b._move,b,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=D(X,this,!0),Hr(p)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,O(this._animRequest),Rt(document,"touchmove",this._onTouchMove,this),Rt(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))}});mt.addInitHook("addHandler","touchZoom",vN),mt.BoxZoom=lN,mt.DoubleClickZoom=uN,mt.Drag=cN,mt.Keyboard=hN,mt.ScrollWheelZoom=fN,mt.TapHold=dN,mt.TouchZoom=vN,r.Bounds=$,r.Browser=Be,r.CRS=Ee,r.Canvas=iN,r.Circle=v1,r.CircleMarker=bg,r.Class=F,r.Control=Wi,r.DivIcon=tN,r.DivOverlay=ya,r.DomEvent=cU,r.DomUtil=lU,r.Draggable=es,r.Evented=V,r.FeatureGroup=lo,r.GeoJSON=co,r.GridLayer=$f,r.Handler=ma,r.Icon=cc,r.ImageOverlay=Mg,r.LatLng=se,r.LatLngBounds=te,r.Layer=Hi,r.LayerGroup=uc,r.LineUtil=SU,r.Map=mt,r.Marker=_g,r.Mixin=mU,r.Path=ts,r.Point=z,r.PolyUtil=yU,r.Polygon=hc,r.Polyline=uo,r.Popup=Ag,r.PosAnimation=OL,r.Projection=CU,r.Rectangle=sN,r.Renderer=ho,r.SVG=Xf,r.SVGOverlay=eN,r.TileLayer=dc,r.Tooltip=kg,r.Transformation=pe,r.Util=R,r.VideoOverlay=QL,r.bind=o,r.bounds=Y,r.canvas=aN,r.circle=IU,r.circleMarker=PU,r.control=Hf,r.divIcon=VU,r.extend=i,r.featureGroup=kU,r.geoJSON=JL,r.geoJson=jU,r.gridLayer=GU,r.icon=LU,r.imageOverlay=RU,r.latLng=le,r.latLngBounds=ie,r.layerGroup=AU,r.map=hU,r.marker=NU,r.point=U,r.polygon=EU,r.polyline=DU,r.popup=BU,r.rectangle=UU,r.setOptions=m,r.stamp=l,r.svg=oN,r.svgOverlay=zU,r.tileLayer=rN,r.tooltip=FU,r.transformation=Te,r.version=n,r.videoOverlay=OU;var $U=window.L;r.noConflict=function(){return window.L=$U,this},window.L=r})})(E2,E2.exports);var ic=E2.exports;const YH=R2(ic);function rg(e,t,r){return Object.freeze({instance:e,context:t,container:r})}function AL(e,t){return t==null?function(n,i){const a=G.useRef();return a.current||(a.current=e(n,i)),a}:function(n,i){const a=G.useRef();a.current||(a.current=e(n,i));const o=G.useRef(n),{instance:s}=a.current;return G.useEffect(function(){o.current!==n&&(t(s,n,o.current),o.current=n)},[s,n,i]),a}}function XH(e,t){G.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 s0e(e){return function(r){const n=U_(),i=e(Z_(r,n),n);return HH(n.map,r.attribution),ML(i.current,r.eventHandlers),XH(i.current,n),i}}function l0e(e,t){const r=G.useRef();G.useEffect(function(){if(t.pathOptions!==r.current){const i=t.pathOptions??{};e.instance.setStyle(i),r.current=i}},[e,t])}function u0e(e){return function(r){const n=U_(),i=e(Z_(r,n),n);return ML(i.current,r.eventHandlers),XH(i.current,n),l0e(i.current,r),i}}function qH(e,t){const r=AL(e),n=o0e(r,t);return i0e(n)}function KH(e,t){const r=AL(e,t),n=u0e(r);return n0e(n)}function c0e(e,t){const r=AL(e,t),n=s0e(r);return a0e(n)}function h0e(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 f0e(){return U_().map}const d0e=KH(function({center:t,children:r,...n},i){const a=new ic.CircleMarker(t,n);return rg(a,UH(i,{overlayContainer:a}))},e0e);function j2(){return j2=Object.assign||function(e){for(var t=1;t(d==null?void 0:d.map)??null,[d]);const m=G.useCallback(x=>{if(x!==null&&d===null){const _=new ic.Map(x,c);r!=null&&u!=null?_.setView(r,u):e!=null&&_.fitBounds(e,t),l!=null&&_.whenReady(l),g(r0e(_))}},[]);G.useEffect(()=>()=>{d==null||d.map.remove()},[d]);const y=d?Ch.createElement($H,{value:d},n):o??null;return Ch.createElement("div",j2({},f,{ref:m}),y)}const p0e=G.forwardRef(v0e),g0e=KH(function({positions:t,...r},n){const i=new ic.Polyline(t,r);return rg(i,UH(n,{overlayContainer:i}))},function(t,r,n){r.positions!==n.positions&&t.setLatLngs(r.positions)}),m0e=qH(function(t,r){const n=new ic.Popup(t,r.overlayContainer);return rg(n,r)},function(t,r,{position:n},i){G.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])}),y0e=c0e(function({url:t,...r},n){const i=new ic.TileLayer(t,Z_(r,n));return rg(i,n)},function(t,r,n){h0e(t,r,n);const{url:i}=r;i!=null&&i!==n.url&&t.setUrl(i)}),x0e=qH(function(t,r){const n=new ic.Tooltip(t,r.overlayContainer);return rg(n,r)},function(t,r,{position:n},i){G.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])}),_0e="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=",b0e="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==",w0e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC";delete YH.Icon.Default.prototype._getIconUrl;YH.Icon.Default.mergeOptions({iconUrl:_0e,iconRetinaUrl:b0e,shadowUrl:w0e});const w3=["#3b82f6","#a78bfa","#06b6d4","#f59e0b","#22c55e","#ec4899","#8b5cf6","#14b8a6"],S0e=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function C0e(e){return e>12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function T0e(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function M0e(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 A0e({bounds:e}){const t=f0e();return G.useEffect(()=>{e&&t.fitBounds(e,{padding:[50,50]})},[t,e]),null}function k0e({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 v.jsxs("div",{className:"min-w-[200px]",children:[v.jsx("div",{className:"font-semibold text-slate-800",children:e.short_name}),v.jsx("div",{className:"text-xs text-slate-600 mb-2",children:e.long_name}),v.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-xs",children:[v.jsx("div",{className:"text-slate-500",children:"Role"}),v.jsx("div",{className:"text-slate-700 font-medium",children:e.role}),v.jsx("div",{className:"text-slate-500",children:"Hardware"}),v.jsx("div",{className:"text-slate-700",children:e.hardware||"Unknown"}),v.jsx("div",{className:"text-slate-500",children:"Battery"}),v.jsx("div",{className:"text-slate-700",children:r}),v.jsx("div",{className:"text-slate-500",children:"Last Heard"}),v.jsx("div",{className:"text-slate-700",children:M0e(e.last_heard)})]}),t&&v.jsxs("div",{className:"mt-3 pt-2 border-t border-slate-200 flex gap-2",children:[v.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:[v.jsx(Ih,{size:10}),"Google Maps"]}),v.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:[v.jsx(Ih,{size:10}),"OSM"]})]})]})}function L0e({nodes:e,edges:t,selectedNodeId:r,onSelectNode:n}){const i=G.useMemo(()=>e.filter(h=>h.latitude!==null&&h.longitude!==null),[e]),a=e.length-i.length,o=G.useMemo(()=>new Map(i.map(h=>[h.node_num,h])),[i]),s=G.useMemo(()=>t.filter(h=>o.has(h.from_node)&&o.has(h.to_node)),[t,o]),l=G.useMemo(()=>{if(i.length===0)return null;const h=i.map(d=>d.latitude),f=i.map(d=>d.longitude);return[[Math.min(...h),Math.min(...f)],[Math.max(...h),Math.max(...f)]]},[i]),u=[43.6,-114.4],c=G.useMemo(()=>{const h=new Set;return r!==null&&t.forEach(f=>{f.from_node===r&&h.add(f.to_node),f.to_node===r&&h.add(f.from_node)}),h},[r,t]);return v.jsxs("div",{className:"relative bg-bg-card rounded-lg border border-border overflow-hidden",children:[v.jsxs(p0e,{center:u,zoom:7,style:{width:"100%",height:"540px"},className:"z-0",children:[v.jsx(y0e,{url:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",attribution:'ยฉ OpenStreetMap, ยฉ CARTO'}),v.jsx(A0e,{bounds:l}),s.map((h,f)=>{const d=o.get(h.from_node),g=o.get(h.to_node),m=r===null||h.from_node===r||h.to_node===r;return v.jsx(g0e,{positions:[[d.latitude,d.longitude],[g.latitude,g.longitude]],color:C0e(h.snr),weight:m&&r!==null?2.5:1.5,opacity:r===null?.3:m?.6:.08},f)}),i.map(h=>{const f=h.node_num===r,d=c.has(h.node_num),g=r===null||f||d,m=S0e.includes(h.role),y=T0e(h.latitude),x=w3[y%w3.length];return v.jsxs(d0e,{center:[h.latitude,h.longitude],radius:m?8:5,fillColor:m?x:"#111827",fillOpacity:g?.9:.2,stroke:!0,color:f?"#ffffff":x,weight:f?3:m?0:2,opacity:g?1:.3,eventHandlers:{click:()=>n(f?null:h.node_num)},children:[v.jsx(x0e,{direction:"top",offset:[0,-8],children:v.jsx("span",{className:"font-mono text-xs",children:h.short_name})}),v.jsx(m0e,{children:v.jsx(k0e,{node:h})})]},h.node_num)})]}),v.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:[v.jsx(nf,{size:12}),v.jsxs("span",{children:["Showing ",i.length," of ",e.length," nodes",a>0&&v.jsxs("span",{className:"text-slate-500",children:[" (",a," without coordinates)"]})]})]})]})}const S3=["#3b82f6","#a78bfa","#06b6d4","#f59e0b","#22c55e","#ec4899","#8b5cf6","#14b8a6"],N0e=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function C3(e){return e>12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function P0e(e){return e>12?"excellent":e>8?"good":e>5?"fair":e>3?"marginal":"poor"}function I0e(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function D0e(e){return["Northern ID","Central ID","SW Idaho","SC Idaho"][e]||"Unknown"}function E0e(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 j0e(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 R0e({node:e,edges:t,nodes:r,onSelectNode:n}){const i=G.useMemo(()=>{if(!e)return[];const h=new Map(r.map(d=>[d.node_num,d])),f=[];return t.forEach(d=>{if(d.from_node===e.node_num){const g=h.get(d.to_node);g&&f.push({node:g,snr:d.snr,quality:d.quality})}else if(d.to_node===e.node_num){const g=h.get(d.from_node);g&&f.push({node:g,snr:d.snr,quality:d.quality})}}),f.sort((d,g)=>g.snr-d.snr)},[e,t,r]);if(!e)return v.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:[v.jsx("div",{className:"w-12 h-12 rounded-full bg-bg-hover border border-border flex items-center justify-center mb-3",children:v.jsx(Di,{size:24,className:"text-slate-500"})}),v.jsx("p",{className:"text-sm text-slate-500 text-center",children:"Click a node to inspect"})]});const a=N0e.includes(e.role),o=I0e(e.latitude),s=S3[o%S3.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 v.jsxs("div",{className:"w-[250px] flex-shrink-0 bg-bg-card border-l border-border flex flex-col h-[540px] overflow-hidden",children:[v.jsxs("div",{className:"p-4 border-b border-border",children:[v.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}),v.jsx("div",{className:"font-mono text-lg text-slate-100",children:e.short_name}),v.jsx("div",{className:"text-xs text-slate-500 truncate",children:e.long_name})]}),v.jsxs("div",{className:"p-4 border-b border-border grid grid-cols-2 gap-3",children:[v.jsxs("div",{children:[v.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Role"}),v.jsx("div",{className:`text-sm font-medium ${a?"text-cyan-400":"text-slate-300"}`,children:e.role})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Region"}),v.jsx("div",{className:"text-sm text-slate-300",children:D0e(o)})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Battery"}),v.jsxs("div",{className:"text-sm text-slate-300 flex items-center gap-1",children:[c&&v.jsx(Dh,{size:12,className:"text-amber-400"}),u]})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Status"}),v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${j0e(e.last_heard)}`}),v.jsx("span",{className:"text-sm text-slate-300",children:E0e(e.last_heard)})]})]}),v.jsxs("div",{className:"col-span-2",children:[v.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Hardware"}),v.jsx("div",{className:"text-sm text-slate-300 font-mono truncate",children:e.hardware||"Unknown"})]})]}),l&&v.jsxs("div",{className:"px-4 py-3 border-b border-border flex gap-3",children:[v.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:[v.jsx(Ih,{size:10}),"Google Maps"]}),v.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:[v.jsx(Ih,{size:10}),"OSM"]})]}),v.jsxs("div",{className:"flex-1 overflow-y-auto",children:[v.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?v.jsx("div",{className:"divide-y divide-border",children:i.map(h=>v.jsxs("button",{onClick:()=>n(h.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:C3(h.snr)},children:[v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("div",{className:"text-sm text-slate-200 font-mono truncate",children:h.node.short_name}),v.jsx("div",{className:"text-xs text-slate-500 truncate",children:h.node.long_name})]}),v.jsxs("div",{className:"text-right flex-shrink-0",children:[v.jsxs("div",{className:"text-xs font-mono",style:{color:C3(h.snr)},children:[h.snr.toFixed(1)," dB"]}),v.jsx("div",{className:"text-xs text-slate-500",children:P0e(h.snr)})]})]},h.node.node_num))}):v.jsx("div",{className:"px-4 py-6 text-center text-sm text-slate-500",children:"No known neighbors"})]})]})}const T3=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function O0e(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 z0e(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 B0e(e){return e.battery_level===null?"โ€”":e.battery_level>100||e.voltage&&e.voltage>4.1?"USB โšก":`${e.battery_level.toFixed(0)}%`}function M3(e){return e===null?"โ€”":e>46?"Northern":e>44.5?"Central":e>43?"SW Idaho":"SC Idaho"}function F0e({nodes:e,selectedNodeId:t,onSelectNode:r}){const[n,i]=G.useState(""),[a,o]=G.useState("short_name"),[s,l]=G.useState("asc"),[u,c]=G.useState("all"),h=G.useMemo(()=>{let g=[...e];if(u==="infra"?g=g.filter(m=>T3.includes(m.role)):u==="online"&&(g=g.filter(m=>{if(!m.last_heard)return!1;const y=new Date(m.last_heard);return(new Date().getTime()-y.getTime())/36e5<1})),n){const m=n.toLowerCase();g=g.filter(y=>y.short_name.toLowerCase().includes(m)||y.long_name.toLowerCase().includes(m)||y.role.toLowerCase().includes(m)||M3(y.latitude).toLowerCase().includes(m))}return g.sort((m,y)=>{let x="",_="";switch(a){case"short_name":x=m.short_name.toLowerCase(),_=y.short_name.toLowerCase();break;case"role":x=m.role,_=y.role;break;case"battery_level":x=m.battery_level??-1,_=y.battery_level??-1;break;case"last_heard":x=m.last_heard?new Date(m.last_heard).getTime():0,_=y.last_heard?new Date(y.last_heard).getTime():0;break;case"hardware":x=m.hardware.toLowerCase(),_=y.hardware.toLowerCase();break}return x<_?s==="asc"?-1:1:x>_?s==="asc"?1:-1:0}),g},[e,n,a,s,u]),f=g=>{a===g?l(s==="asc"?"desc":"asc"):(o(g),l("asc"))},d=({field:g})=>a!==g?null:s==="asc"?v.jsx(V$,{size:14,className:"inline ml-1"}):v.jsx(ll,{size:14,className:"inline ml-1"});return v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg overflow-hidden",children:[v.jsxs("div",{className:"p-3 border-b border-border flex items-center gap-3",children:[v.jsxs("div",{className:"relative flex-1 max-w-xs",children:[v.jsx(e_,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),v.jsx("input",{type:"text",placeholder:"Search nodes...",value:n,onChange:g=>i(g.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"})]}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx(RM,{size:14,className:"text-slate-500 mr-1"}),["all","infra","online"].map(g=>v.jsx("button",{onClick:()=>c(g),className:`px-2 py-1 text-xs rounded transition-colors ${u===g?"bg-accent text-white":"bg-bg-hover text-slate-400 hover:text-slate-200"}`,children:g==="all"?"All":g==="infra"?"Infra":"Online"},g))]}),v.jsxs("div",{className:"text-xs text-slate-500 ml-auto",children:[h.length," of ",e.length," nodes"]})]}),v.jsxs("div",{className:"overflow-x-auto",children:[v.jsxs("table",{className:"w-full text-sm",children:[v.jsx("thead",{children:v.jsxs("tr",{className:"bg-bg-hover text-slate-400 text-xs",children:[v.jsx("th",{className:"w-8 px-3 py-2"}),v.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>f("short_name"),children:["Name ",v.jsx(d,{field:"short_name"})]}),v.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>f("role"),children:["Role ",v.jsx(d,{field:"role"})]}),v.jsx("th",{className:"px-3 py-2 text-left",children:"Region"}),v.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>f("battery_level"),children:[v.jsx("span",{title:"Battery percent (4.20V = 100%, 3.60V ~ 30% warning, 3.30V ~ 3% critical). USB โšก = USB-powered (>100% or >4.1V); no battery management applies.",children:"Battery"})," ",v.jsx(d,{field:"battery_level"})]}),v.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>f("last_heard"),children:[v.jsx("span",{title:"Status dot: green = heard in the last hour; amber = within 24h; slate = offline (past the configured threshold). See Reference โ†’ Mesh Health for thresholds by node type.",children:"Last Heard"})," ",v.jsx(d,{field:"last_heard"})]}),v.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>f("hardware"),children:["Hardware ",v.jsx(d,{field:"hardware"})]})]})}),v.jsx("tbody",{className:"divide-y divide-border",children:h.slice(0,100).map(g=>{const m=T3.includes(g.role),y=g.node_num===t;return v.jsxs("tr",{onClick:()=>r(g.node_num),className:`cursor-pointer transition-colors ${y?"bg-accent/10":"hover:bg-bg-hover"}`,children:[v.jsx("td",{className:"px-3 py-2",children:v.jsx("div",{className:`w-2 h-2 rounded-full ${O0e(g.last_heard)}`})}),v.jsxs("td",{className:"px-3 py-2",children:[v.jsx("div",{className:"font-mono text-slate-200",children:g.short_name}),v.jsx("div",{className:"text-xs text-slate-500 truncate max-w-[200px]",children:g.long_name})]}),v.jsx("td",{className:"px-3 py-2",children:v.jsx("span",{className:`inline-block px-1.5 py-0.5 rounded text-xs font-medium ${m?"bg-cyan-500/20 text-cyan-400":"bg-slate-500/20 text-slate-400"}`,children:g.role})}),v.jsx("td",{className:"px-3 py-2 text-slate-400",children:M3(g.latitude)}),v.jsx("td",{className:"px-3 py-2 font-mono text-slate-300",children:B0e(g)}),v.jsx("td",{className:"px-3 py-2 text-slate-400",children:z0e(g.last_heard)}),v.jsx("td",{className:"px-3 py-2 font-mono text-xs text-slate-400 truncate max-w-[150px]",children:g.hardware||"โ€”"})]},g.node_num)})})]}),h.length>100&&v.jsxs("div",{className:"px-3 py-2 text-xs text-slate-500 text-center border-t border-border",children:["Showing first 100 of ",h.length," nodes"]}),h.length===0&&v.jsx("div",{className:"px-3 py-8 text-sm text-slate-500 text-center",children:"No nodes match your filters"})]})]})}function V0e(){const[e,t]=G.useState([]),[r,n]=G.useState([]),[i,a]=G.useState([]),[o,s]=G.useState(null),[l,u]=G.useState("topo"),[c,h]=G.useState(!0),[f,d]=G.useState(null);G.useEffect(()=>{document.title="Mesh โ€” MeshAI",Promise.all([tY(),rY(),oY()]).then(([y,x,_])=>{t(y),n(x),a(_),h(!1)}).catch(y=>{d(y.message),h(!1)})},[]);const g=G.useMemo(()=>e.find(y=>y.node_num===o)||null,[e,o]),m=G.useCallback(y=>{s(y)},[]);return c?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-slate-400",children:"Loading mesh data..."})}):f?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsxs("div",{className:"text-red-400",children:["Error: ",f]})}):v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"text-sm text-slate-400",children:[e.length," nodes โ€ข ",r.length," edges"]}),v.jsxs("div",{className:"flex items-center bg-bg-card border border-border rounded-lg p-1",children:[v.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:[v.jsx(dB,{size:14}),v.jsx("span",{title:"Force-directed graph of nodes + neighbor links. Edge weight reflects SNR; node color reflects status (green = active, amber = stale, slate = offline).",children:"Topology"})]}),v.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:[v.jsx(X$,{size:14}),v.jsx("span",{title:"Nodes plotted by lat/lon on a basemap. Nodes without a reported position are clustered at the top edge.",children:"Geographic"})]})]})]}),v.jsxs("div",{className:"flex gap-0",children:[v.jsx("div",{className:"flex-1 min-w-0",children:l==="topo"?v.jsx(Qye,{nodes:e,edges:r,selectedNodeId:o,onSelectNode:m}):v.jsx(L0e,{nodes:e,edges:r,selectedNodeId:o,onSelectNode:m})}),v.jsx(R0e,{node:g,edges:r,nodes:e,onSelectNode:m})]}),v.jsx(F0e,{nodes:e,selectedNodeId:o,onSelectNode:m})]})}function kL({label:e,value:t,onChange:r,helper:n,info:i,roleFilter:a,valueType:o="short_name"}){const[s,l]=G.useState([]),[u,c]=G.useState(!0),[h,f]=G.useState(""),[d,g]=G.useState(!1);G.useEffect(()=>{fetch("/api/nodes").then(S=>S.json()).then(S=>{l(S),c(!1)}).catch(()=>{l([]),c(!1)})},[]);const m=G.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)),h.trim()){const T=h.toLowerCase();S=S.filter(M=>{var A,P,I,N;return((A=M.short_name)==null?void 0:A.toLowerCase().includes(T))||((P=M.long_name)==null?void 0:P.toLowerCase().includes(T))||((I=M.role)==null?void 0:I.toLowerCase().includes(T))||((N=M.node_id_hex)==null?void 0:N.toLowerCase().includes(T))})}return S.sort((T,M)=>(T.short_name||"").localeCompare(M.short_name||""))},[s,h,a]),y=S=>{switch(o){case"node_num":return String(S.node_num);case"node_id_hex":return S.node_id_hex;default:return S.short_name||String(S.node_num)}},x=S=>{const T=y(S);return t.includes(T)},_=S=>{const T=y(S);t.includes(T)?r(t.filter(M=>M!==T)):r([...t,T])},w=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?v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e}),v.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&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]}):v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e}),t.length>0&&v.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:t.map(S=>{const T=s.find(M=>y(M)===S);return v.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,v.jsx("button",{type:"button",onClick:()=>r(t.filter(M=>M!==S)),className:"hover:text-white",children:v.jsx(ca,{size:14})})]},S)})}),v.jsxs("div",{className:"relative",children:[v.jsxs("div",{className:"relative",children:[v.jsx(e_,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),v.jsx("input",{type:"text",value:h,onChange:S=>f(S.target.value),onFocus:()=>g(!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&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>g(!1)}),v.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:m.length===0?v.jsx("div",{className:"p-3 text-sm text-slate-500 text-center",children:"No nodes found"}):m.map(S=>v.jsxs("button",{type:"button",onClick:()=>_(S),className:`w-full flex items-center gap-2 px-3 py-2 text-left text-sm hover:bg-[#1e2a3a] ${x(S)?"bg-accent/10":""}`,children:[v.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center ${x(S)?"bg-accent border-accent":"border-slate-600"}`,children:x(S)&&v.jsx(Za,{size:12,className:"text-white"})}),v.jsx("span",{className:"text-slate-200",children:w(S)})]},S.node_num))})]})]}),n&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function LL(e){const[t,r]=G.useState([]),[n,i]=G.useState(!0);G.useEffect(()=>{fetch("/api/channels").then(f=>f.json()).then(f=>{r(f),i(!1)}).catch(()=>{r([]),i(!1)})},[]);const a=f=>{const d=f.role==="PRIMARY"?"Primary":f.role==="SECONDARY"?"Secondary":"";return`${f.index}: ${f.name}${d?` (${d})`:""}`};if(!n&&t.length===0)return e.mode==="single"?v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e.label}),v.jsx("input",{type:"number",value:e.value,onChange:f=>e.onChange(Number(f.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&&v.jsx("p",{className:"text-xs text-slate-600",children:e.helper})]}):v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e.label}),v.jsx("input",{type:"text",value:e.value.join(", "),onChange:f=>{const d=f.target.value.split(",").map(g=>parseInt(g.trim())).filter(g=>!isNaN(g));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&&v.jsx("p",{className:"text-xs text-slate-600",children:e.helper})]});if(e.mode==="single"){const{value:f,onChange:d,label:g,helper:m,includeDisabled:y}=e,x=t.filter(_=>_.enabled);return v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:g}),v.jsxs("select",{value:f,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:[y&&v.jsx("option",{value:-1,children:"Disabled"}),x.map(_=>v.jsx("option",{value:_.index,children:a(_)},_.index))]}),m&&v.jsx("p",{className:"text-xs text-slate-600",children:m})]})}const{value:o,onChange:s,label:l,helper:u}=e,c=t.filter(f=>f.enabled),h=f=>{o.includes(f)?s(o.filter(d=>d!==f)):s([...o,f].sort((d,g)=>d-g))};return v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:l}),v.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-2 space-y-1",children:[c.map(f=>v.jsxs("label",{onClick:()=>h(f.index),className:"flex items-center gap-2 p-2 rounded hover:bg-[#0a0e17] cursor-pointer",children:[v.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center ${o.includes(f.index)?"bg-accent border-accent":"border-slate-600"}`,children:o.includes(f.index)&&v.jsx(Za,{size:12,className:"text-white"})}),v.jsx("span",{className:"text-sm text-slate-200",children:a(f)})]},f.index)),c.length===0&&v.jsx("div",{className:"text-sm text-slate-500 p-2",children:"No channels available"})]}),u&&v.jsx("p",{className:"text-xs text-slate-600",children:u})]})}const A3=[{key:"bot",label:"Bot",icon:O$},{key:"connection",label:"Connection",icon:t_},{key:"response",label:"Response",icon:OM},{key:"history",label:"History",icon:uB},{key:"memory",label:"Memory",icon:z$},{key:"context",label:"Context",icon:jM},{key:"commands",label:"Commands",icon:gB},{key:"llm",label:"LLM",icon:lB},{key:"weather",label:"Weather",icon:Du},{key:"meshmonitor",label:"MeshMonitor",icon:Di},{key:"knowledge",label:"Knowledge",icon:oB},{key:"mesh_sources",label:"Mesh Sources",icon:hB},{key:"mesh_intelligence",label:"Intelligence",icon:rf},{key:"dashboard",label:"Dashboard",icon:fB}],Fn={bot:"Identity and behavior settings for the bot on the mesh network.",connection:"How MeshAI connects to your Meshtastic radio.",response:"Controls how quickly and how much the bot responds on the mesh.",history:"Conversation history storage and cleanup.",memory:"Short-term conversation memory management. Controls how the bot maintains context within a conversation.",context:"Passive channel monitoring. The bot listens to mesh channels and uses recent messages as context when responding.",commands:"Mesh commands available via the configured prefix. Toggle individual commands on or off.",llm:"AI model configuration. MeshAI uses an LLM to understand questions and generate responses.",weather:"Weather data for the !weather command. This is separate from NWS environmental alerts.",meshmonitor:"AIDA MeshMonitor integration. An additional data source for mesh network monitoring.",knowledge:"Knowledge base for answering questions from stored documents. Connects to Qdrant vector database or local SQLite.",mesh_sources:"Data sources for mesh network information. MeshAI can pull data from multiple sources simultaneously and merge them into a unified view.",mesh_intelligence:"Advanced mesh analysis: health scoring, region management, and automated alerting. The intelligence engine monitors your mesh and detects problems automatically.",dashboard:"Web dashboard settings. You're looking at it right now."},G0e=[{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"}],W0e=[{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 eo({info:e,link:t,linkText:r="Learn more"}){const[n,i]=G.useState(!1),a=G.useRef(null);return G.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]),v.jsxs("div",{className:"relative inline-block",ref:a,children:[v.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&&v.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:[v.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:v.jsx(ca,{size:12})}),v.jsx("div",{className:"pr-4",children:e}),t&&v.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," ",v.jsx(Ih,{size:10})]})]})]})}function Vn({text:e}){return v.jsx("p",{className:"text-sm text-slate-500 mb-6 pb-4 border-b border-[#1e2a3a]",children:e})}function ct({label:e,value:t,onChange:r,type:n="text",placeholder:i="",helper:a="",info:o="",infoLink:s=""}){const[l,u]=G.useState(!1),c=n==="password";return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,o&&v.jsx(eo,{info:o,link:s})]}),v.jsxs("div",{className:"relative",children:[v.jsx("input",{type:c&&!l?"password":"text",value:t,onChange:h=>r(h.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&&v.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?v.jsx(cB,{size:16}):v.jsx(jM,{size:16})})]}),a&&v.jsx("p",{className:"text-xs text-slate-600",children:a})]})}function We({label:e,value:t,onChange:r,min:n,max:i,step:a=1,helper:o="",info:s="",infoLink:l=""}){return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,s&&v.jsx(eo,{info:s,link:l})]}),v.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&&v.jsx("p",{className:"text-xs text-slate-600",children:o})]})}function or({label:e,checked:t,onChange:r,helper:n="",info:i="",infoLink:a=""}){return v.jsxs("div",{className:"flex items-center justify-between py-2",children:[v.jsxs("div",{children:[v.jsxs("span",{className:"flex items-center text-sm text-slate-300",children:[e,i&&v.jsx(eo,{info:i,link:a})]}),n&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]}),v.jsx("button",{type:"button",onClick:()=>r(!t),className:`relative w-11 h-6 rounded-full transition-colors ${t?"bg-accent":"bg-[#1e2a3a]"}`,children:v.jsx("span",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${t?"translate-x-5":""}`})})]})}function Ln({label:e,value:t,onChange:r,options:n,helper:i="",info:a="",infoLink:o=""}){return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&v.jsx(eo,{info:a,link:o})]}),v.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=>v.jsx("option",{value:s.value,children:s.label},s.value))}),i&&v.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function H0e({label:e,value:t,onChange:r,rows:n=4,helper:i="",info:a="",infoLink:o=""}){return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&v.jsx(eo,{info:a,link:o})]}),v.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&&v.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function ou({label:e,value:t,onChange:r,helper:n="",info:i="",infoLink:a=""}){const[o,s]=G.useState(t.join(", "));G.useEffect(()=>{s(t.join(", "))},[t]);const l=()=>{const u=o.split(",").map(c=>c.trim()).filter(Boolean);r(u)};return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&v.jsx(eo,{info:i,link:a})]}),v.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&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function U0e({label:e,value:t,onChange:r,helper:n="",info:i="",infoLink:a=""}){const[o,s]=G.useState(t.join(", "));G.useEffect(()=>{s(t.join(", "))},[t]);const l=()=>{const u=o.split(",").map(c=>parseInt(c.trim(),10)).filter(c=>!isNaN(c));r(u)};return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&v.jsx(eo,{info:i,link:a})]}),v.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&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function sn({label:e,description:t,checked:r,onChange:n,threshold:i,onThresholdChange:a,thresholdLabel:o,thresholdMin:s,thresholdMax:l,thresholdStep:u=1,thresholdSuffix:c=""}){return v.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-3 space-y-2",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"flex-1",children:[v.jsx("span",{className:"text-sm text-slate-300",children:e}),v.jsx("p",{className:"text-xs text-slate-600",children:t})]}),v.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:v.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&&v.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-[#1e2a3a]",children:[v.jsxs("span",{className:"text-xs text-slate-500",children:[o||"Threshold",":"]}),v.jsx("input",{type:"number",value:i,onChange:h=>a(Number(h.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&&v.jsx("span",{className:"text-xs text-slate-500",children:c})]})]})}function Z0e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.bot}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{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."}),v.jsx(ct,{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."})]}),v.jsx(or,{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."}),v.jsx(or,{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 $0e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.connection}),v.jsx(Ln,{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"?v.jsx(ct,{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."}):v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{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"}),v.jsx(We,{label:"TCP Port",value:e.tcp_port,onChange:r=>t({...e,tcp_port:r}),min:1,max:65535,helper:"Default 4403 for meshtasticd"})]})]})}function Y0e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.response}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{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."}),v.jsx(We,{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."})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{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."}),v.jsx(We,{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 X0e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.history}),v.jsx(ct,{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."}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{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."}),v.jsx(We,{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."})]}),v.jsx(or,{label:"Auto Cleanup",checked:e.auto_cleanup,onChange:r=>t({...e,auto_cleanup:r}),helper:"Automatically prune old conversations"}),e.auto_cleanup&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Cleanup Interval (hours)",value:e.cleanup_interval_hours,onChange:r=>t({...e,cleanup_interval_hours:r}),min:1,helper:"Hours between cleanup runs"}),v.jsx(We,{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 q0e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.memory}),v.jsx(or,{label:"Enable Memory",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Keep conversation context between messages"}),e.enabled&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{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."}),v.jsx(We,{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 K0e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.context}),v.jsx(or,{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&&v.jsxs(v.Fragment,{children:[v.jsx(LL,{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"}),v.jsx(kL,{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."}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Max Age (sec)",value:e.max_age,onChange:r=>t({...e,max_age:r}),min:0,helper:"Ignore messages older than this"}),v.jsx(We,{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 J0e({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 v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.commands}),v.jsx(or,{label:"Enable Commands",checked:e.enabled,onChange:i=>t({...e,enabled:i}),helper:"Allow !commands on the mesh"}),e.enabled&&v.jsxs(v.Fragment,{children:[v.jsx(ct,{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."}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Available Commands",v.jsx(eo,{info:"Toggle commands on or off. Disabled commands won't respond when users invoke them."})]}),v.jsx("div",{className:"grid gap-1",children:G0e.map(i=>{const a=!r.has(i.name.toLowerCase());return v.jsxs("div",{className:"flex items-center justify-between p-2 bg-[#0a0e17] border border-[#1e2a3a] rounded hover:border-[#2a3a4a] transition-colors",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsxs("code",{className:"text-accent text-sm",children:["!",i.name]}),v.jsx("span",{className:"text-xs text-slate-500",children:i.description})]}),v.jsx("button",{type:"button",onClick:()=>n(i.name),className:`relative w-9 h-5 rounded-full transition-colors ${a?"bg-accent":"bg-[#1e2a3a]"}`,children:v.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 Q0e({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.llm}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Ln,{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."}),v.jsx(ct,{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)."})]}),v.jsx(ct,{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."}),v.jsx(ct,{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."}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Timeout (sec)",value:e.timeout,onChange:r=>t({...e,timeout:r}),min:5,max:120,helper:"Maximum seconds to wait for response"}),v.jsx(We,{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"})]}),v.jsx(or,{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&&v.jsx(H0e,{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."}),v.jsx(or,{label:"Web Search",checked:e.web_search,onChange:r=>t({...e,web_search:r}),helper:"Enable web search tool (Open WebUI feature)"}),v.jsx(or,{label:"Google Grounding",checked:e.google_grounding,onChange:r=>t({...e,google_grounding:r}),helper:"Ground responses in web search (Gemini only)"})]})}function exe({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.weather}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Ln,{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"}),v.jsx(Ln,{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"})]}),v.jsx(ct,{label:"Default Location",value:e.default_location,onChange:r=>t({...e,default_location:r}),placeholder:"Your city, state",helper:"Location when none specified"})]})}function txe({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.meshmonitor}),v.jsx(or,{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&&v.jsxs(v.Fragment,{children:[v.jsx(ct,{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."}),v.jsx(or,{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."}),v.jsx(We,{label:"Refresh Interval (sec)",value:e.refresh_interval,onChange:r=>t({...e,refresh_interval:r}),min:10,helper:"How often to fetch patterns"}),v.jsx(or,{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 rxe({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.knowledge}),v.jsx(or,{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&&v.jsxs(v.Fragment,{children:[v.jsx(Ln,{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")&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{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."}),v.jsx(We,{label:"Qdrant Port",value:e.qdrant_port,onChange:r=>t({...e,qdrant_port:r}),helper:"Default 6333"})]}),v.jsx(ct,{label:"Collection",value:e.qdrant_collection,onChange:r=>t({...e,qdrant_collection:r}),helper:"Qdrant collection name"}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{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."}),v.jsx(We,{label:"TEI Port",value:e.tei_port,onChange:r=>t({...e,tei_port:r}),helper:"Default 8090"})]}),v.jsx(or,{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."})]}),v.jsx(ct,{label:"SQLite DB Path",value:e.db_path,onChange:r=>t({...e,db_path:r}),helper:"Local knowledge database file"}),v.jsx(We,{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 nxe({source:e,onChange:t,onDelete:r}){const[n,i]=G.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 v.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg overflow-hidden",children:[v.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>i(!n),children:[v.jsxs("div",{className:"flex items-center gap-3",children:[n?v.jsx(ll,{size:16}):v.jsx(Js,{size:16}),v.jsx("div",{className:`w-2 h-2 rounded-full ${e.enabled?"bg-green-500":"bg-slate-500"}`}),v.jsx("span",{className:"font-mono text-sm text-slate-200",children:e.name||"Unnamed Source"}),v.jsx("span",{className:"text-xs text-slate-500 bg-[#1e2a3a] px-2 py-0.5 rounded",children:e.type})]}),v.jsx("button",{onClick:o=>{o.stopPropagation(),r()},className:"p-1 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",children:v.jsx(Ep,{size:14})})]}),n&&v.jsxs("div",{className:"p-4 space-y-4 border-t border-[#1e2a3a]",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{label:"Name",value:e.name,onChange:o=>t({...e,name:o}),helper:"Friendly name for this source"}),v.jsx(Ln,{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"&&v.jsx(ct,{label:"URL",value:e.url,onChange:o=>t({...e,url:o}),helper:"Full URL including protocol"}),e.type==="meshmonitor"&&v.jsx(ct,{label:"API Token",value:e.api_token,onChange:o=>t({...e,api_token:o}),type:"password",helper:"Bearer token for authentication"}),e.type==="mqtt"&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{label:"Host",value:e.host||"",onChange:o=>t({...e,host:o}),helper:"MQTT broker hostname"}),v.jsx(We,{label:"Port",value:e.port||1883,onChange:o=>t({...e,port:o}),min:1,max:65535,helper:"1883 plain, 8883 TLS"})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{label:"Username",value:e.username||"",onChange:o=>t({...e,username:o})}),v.jsx(ct,{label:"Password",value:e.password||"",onChange:o=>t({...e,password:o}),type:"password"})]}),v.jsx(ct,{label:"Topic Root",value:e.topic_root||"msh/US",onChange:o=>t({...e,topic_root:o}),helper:"Base topic to subscribe to"}),v.jsx(or,{label:"Use TLS",checked:e.use_tls||!1,onChange:o=>t({...e,use_tls:o}),helper:"Encrypt MQTT connection"})]}),v.jsx(We,{label:"Refresh Interval (sec)",value:e.refresh_interval,onChange:o=>t({...e,refresh_interval:o}),min:10,helper:"Polling frequency"}),v.jsx(or,{label:"Enabled",checked:e.enabled,onChange:o=>t({...e,enabled:o})}),v.jsx(or,{label:"Polite Mode",checked:e.polite_mode,onChange:o=>t({...e,polite_mode:o}),helper:"Reduce polling for shared instances"})]})]})}function ixe({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 v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.mesh_sources}),e.map((n,i)=>v.jsx(nxe,{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)),v.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:[v.jsx(af,{size:16})," Add Source"]})]})}function axe({data:e,onChange:t}){const[r,n]=G.useState(null);return v.jsxs("div",{className:"space-y-6",children:[v.jsx(Vn,{text:Fn.mesh_intelligence}),v.jsx(or,{label:"Enable Mesh Intelligence",checked:e.enabled,onChange:i=>t({...e,enabled:i}),helper:"Activate health scoring and alerting"}),e.enabled&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{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."}),v.jsx(We,{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."})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{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."}),v.jsx(We,{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"})]}),v.jsx(kL,{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"}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(LL,{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}),v.jsx(We,{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)."})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Regions",v.jsx(eo,{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)=>v.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg overflow-hidden",children:[v.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>n(r===a?null:a),children:[v.jsxs("div",{className:"flex items-center gap-3",children:[r===a?v.jsx(ll,{size:16}):v.jsx(Js,{size:16}),v.jsx("span",{className:"font-medium text-slate-200",children:i.name||"Unnamed Region"}),v.jsx("span",{className:"text-xs text-slate-500",children:i.local_name})]}),v.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:v.jsx(Ep,{size:14})})]}),r===a&&v.jsxs("div",{className:"p-4 space-y-3 border-t border-[#1e2a3a]",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{label:"Name",value:i.name,onChange:o=>{const s=[...e.regions];s[a]={...i,name:o},t({...e,regions:s})}}),v.jsx(ct,{label:"Local Name",value:i.local_name,onChange:o=>{const s=[...e.regions];s[a]={...i,local_name:o},t({...e,regions:s})}})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Latitude",value:i.lat,onChange:o=>{const s=[...e.regions];s[a]={...i,lat:o},t({...e,regions:s})},step:1e-4}),v.jsx(We,{label:"Longitude",value:i.lon,onChange:o=>{const s=[...e.regions];s[a]={...i,lon:o},t({...e,regions:s})},step:1e-4})]}),v.jsx(ct,{label:"Description",value:i.description,onChange:o=>{const s=[...e.regions];s[a]={...i,description:o},t({...e,regions:s})}}),v.jsx(ou,{label:"Aliases",value:i.aliases,onChange:o=>{const s=[...e.regions];s[a]={...i,aliases:o},t({...e,regions:s})}}),v.jsx(ou,{label:"Cities",value:i.cities,onChange:o=>{const s=[...e.regions];s[a]={...i,cities:o},t({...e,regions:s})}})]})]},a)),v.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:[v.jsx(af,{size:16})," Add Region"]})]}),v.jsxs("div",{className:"space-y-3",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Alert Rules",v.jsx(eo,{info:"Configure which conditions trigger alerts. Each rule can have an optional threshold value."})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Infrastructure"}),v.jsx(sn,{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}})}),v.jsx(sn,{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}})}),v.jsx(sn,{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}})}),v.jsx(sn,{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}})}),v.jsx(sn,{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}})}),v.jsx(sn,{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}})})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Power"}),v.jsx(sn,{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:"%"}),v.jsx(sn,{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:"%"}),v.jsx(sn,{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:"%"}),v.jsx(sn,{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}})}),v.jsx(sn,{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}})}),v.jsx(sn,{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}})})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Utilization"}),v.jsx(sn,{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`}),v.jsx(sn,{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"})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Health Scores"}),v.jsx(sn,{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"}),v.jsx(sn,{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 oxe({data:e,onChange:t}){return v.jsxs("div",{className:"space-y-4",children:[v.jsx(Vn,{text:Fn.dashboard}),v.jsx(or,{label:"Enable Dashboard",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Run the web dashboard"}),e.enabled&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(ct,{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."}),v.jsx(We,{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 sxe(){var I;const[e,t]=G.useState(null),[r,n]=G.useState(null),[i,a]=G.useState("bot"),[o,s]=G.useState(!0),[l,u]=G.useState(!1),[c,h]=G.useState(null),[f,d]=G.useState(null),[g,m]=G.useState(!1),[y,x]=G.useState(!1),_=G.useCallback(async()=>{try{const N=await fetch("/api/config");if(!N.ok)throw new Error("Failed to fetch config");const D=await N.json();t(D),n(JSON.parse(JSON.stringify(D))),x(!1),h(null)}catch(N){h(N instanceof Error?N.message:"Unknown error")}finally{s(!1)}},[]);G.useEffect(()=>{document.title="Config โ€” MeshAI",_()},[_]),G.useEffect(()=>{e&&r&&x(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);const w=async()=>{if(e){u(!0),h(null),d(null);try{const N=e[i],D=await fetch(`/api/config/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(N)}),O=await D.json();if(!D.ok)throw new Error(O.detail||"Save failed");d(`${i} saved successfully`),n(JSON.parse(JSON.stringify(e))),x(!1),O.restart_required&&(m(!0),hY(Array.isArray(O.changed_keys)?O.changed_keys:[])),setTimeout(()=>d(null),3e3)}catch(N){h(N instanceof Error?N.message:"Save failed")}finally{u(!1)}}},S=()=>{r&&(t(JSON.parse(JSON.stringify(r))),x(!1))},T=async()=>{try{await fetch("/api/restart",{method:"POST"}),m(!1),d("Restart initiated")}catch{h("Restart failed")}},M=(N,D)=>{e&&t({...e,[N]:D})};if(o)return v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-slate-400",children:"Loading configuration..."})});if(!e)return v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-red-400",children:"Failed to load configuration"})});const A=()=>{switch(i){case"bot":return v.jsx(Z0e,{data:e.bot,onChange:N=>M("bot",N)});case"connection":return v.jsx($0e,{data:e.connection,onChange:N=>M("connection",N)});case"response":return v.jsx(Y0e,{data:e.response,onChange:N=>M("response",N)});case"history":return v.jsx(X0e,{data:e.history,onChange:N=>M("history",N)});case"memory":return v.jsx(q0e,{data:e.memory,onChange:N=>M("memory",N)});case"context":return v.jsx(K0e,{data:e.context,onChange:N=>M("context",N)});case"commands":return v.jsx(J0e,{data:e.commands,onChange:N=>M("commands",N)});case"llm":return v.jsx(Q0e,{data:e.llm,onChange:N=>M("llm",N)});case"weather":return v.jsx(exe,{data:e.weather,onChange:N=>M("weather",N)});case"meshmonitor":return v.jsx(txe,{data:e.meshmonitor,onChange:N=>M("meshmonitor",N)});case"knowledge":return v.jsx(rxe,{data:e.knowledge,onChange:N=>M("knowledge",N)});case"mesh_sources":return v.jsx(ixe,{data:e.mesh_sources,onChange:N=>M("mesh_sources",N)});case"mesh_intelligence":return v.jsx(axe,{data:e.mesh_intelligence,onChange:N=>M("mesh_intelligence",N)});case"dashboard":return v.jsx(oxe,{data:e.dashboard,onChange:N=>M("dashboard",N)});default:return null}},P=((I=A3.find(N=>N.key===i))==null?void 0:I.label)||i;return v.jsxs("div",{className:"flex gap-6 h-[calc(100vh-8rem)]",children:[v.jsx("div",{className:"w-48 flex-shrink-0 space-y-1",children:A3.map(({key:N,label:D,icon:O})=>v.jsxs("button",{onClick:()=>a(N),className:`w-full flex items-center gap-2 px-3 py-2 rounded text-sm transition-colors ${i===N?"bg-accent text-white":"text-slate-400 hover:text-slate-200 hover:bg-bg-hover"}`,children:[v.jsx(O,{size:16}),v.jsx("span",{children:D}),y&&i===N&&v.jsx("span",{className:"ml-auto w-2 h-2 bg-amber-500 rounded-full"})]},N))}),v.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[v.jsxs("div",{className:"flex items-center justify-between mb-6",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(vB,{size:20,className:"text-slate-500"}),v.jsx("h2",{className:"text-lg font-semibold text-slate-200",children:P})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[y&&v.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:[v.jsx(Jx,{size:14}),"Discard"]}),v.jsxs("button",{onClick:w,disabled:l||!y,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?v.jsx($v,{size:14,className:"animate-spin"}):v.jsx(zM,{size:14}),"Save"]})]})]}),g&&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:[v.jsxs("div",{className:"flex items-center gap-2 text-amber-400",children:[v.jsx($a,{size:16}),v.jsx("span",{className:"text-sm",children:"Restart required for changes to take effect"})]}),v.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&&v.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:[v.jsx(ca,{size:16}),v.jsx("span",{className:"text-sm",children:c})]}),f&&v.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:[v.jsx(Za,{size:16}),v.jsx("span",{className:"text-sm",children:f})]}),v.jsx("div",{className:"flex-1 overflow-y-auto pr-2",children:v.jsx("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:A()})})]})]})}function lxe({feed:e}){const t=e.is_loaded?e.consecutive_errors>0?"bg-amber-500":"bg-green-500":"bg-red-500",r=e.is_loaded?e.consecutive_errors>0?`${e.consecutive_errors} errors`:"Healthy":"Not loaded",n=e.last_fetch?new Date(e.last_fetch*1e3).toLocaleTimeString():"Never";return v.jsxs("div",{className:"bg-bg-hover rounded-lg p-4",children:[v.jsxs("div",{className:"flex items-center justify-between mb-2",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${t}`}),v.jsx("span",{className:"text-sm font-medium text-slate-200 uppercase",children:e.source})]}),v.jsx("span",{className:"text-xs text-slate-400",children:r})]}),v.jsxs("div",{className:"text-xs text-slate-500 space-y-1",children:[v.jsxs("div",{children:["Events: ",e.event_count]}),v.jsxs("div",{children:["Last fetch: ",n]}),e.last_error&&v.jsx("div",{className:"text-amber-500 truncate",children:e.last_error})]})]})}function uxe({event:e}){const t=e.severity.toLowerCase(),r=t==="extreme"||t==="severe"||t==="immediate"?{bg:"bg-red-500/10",border:"border-red-500",Icon:Vo,color:"text-red-500"}:t==="moderate"||t==="warning"||t==="priority"?{bg:"bg-amber-500/10",border:"border-amber-500",Icon:$a,color:"text-amber-500"}:{bg:"bg-blue-500/10",border:"border-blue-500",Icon:qx,color:"text-blue-500"},n=r.Icon;return v.jsx("div",{className:`p-3 rounded-lg ${r.bg} border-l-2 ${r.border}`,children:v.jsxs("div",{className:"flex items-start gap-3",children:[v.jsx(n,{size:16,className:r.color}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[v.jsx("span",{className:"text-sm font-medium text-slate-200",children:e.event_type}),v.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${r.bg} ${r.color}`,children:e.severity})]}),v.jsx("div",{className:"text-sm text-slate-300",children:e.headline})]})]})})}function JH({value:e,onChange:t,disabled:r,centralDisabled:n}){const i="px-2 py-1 text-xs transition-colors";return v.jsxs("div",{className:`flex rounded border border-[#1e2a3a] overflow-hidden ${r?"opacity-40":""}`,children:[v.jsx("button",{type:"button",disabled:r,onClick:()=>t("native"),className:`${i} ${e==="native"?"bg-accent text-white":"text-slate-400 hover:text-slate-200"}`,children:"native"}),v.jsx("button",{type:"button",disabled:r||n,title:n?"Central not available for this adapter":"",onClick:()=>{n||t("central")},className:`${i} ${n?"text-slate-600 cursor-not-allowed":e==="central"?"bg-accent text-white":"text-slate-400 hover:text-slate-200"}`,children:"central"})]})}function cxe({title:e,subtitle:t,enabled:r,onEnabled:n,feedSource:i,onFeedSource:a,hasCentral:o,nativeOnly:s,hasKey:l,health:u,events:c,children:h}){const f=s||!o;return v.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{children:[v.jsx("span",{className:"text-sm font-medium text-slate-300",children:e}),t&&v.jsx("p",{className:"text-xs text-slate-600",children:t})]}),v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx("span",{className:"text-[10px] uppercase tracking-wide text-slate-600",children:"source"}),v.jsx(JH,{value:i,onChange:a,disabled:!r,centralDisabled:f})]}),v.jsx(or,{label:"",checked:r,onChange:n})]})]}),!l&&v.jsx("div",{className:"text-xs text-amber-400 bg-amber-500/10 rounded p-2",children:"API key not configured โ€” contact admin"}),s&&v.jsx("div",{className:"text-[11px] text-slate-600",children:"Central not available for this adapter โ€” native only"}),v.jsx("div",{className:r?"space-y-3":"space-y-3 opacity-40 pointer-events-none select-none",children:h}),(u||c&&c.length>0)&&v.jsxs("div",{className:"pt-2 border-t border-[#1e2a3a] space-y-3",children:[v.jsx("div",{className:"text-[10px] uppercase tracking-wide text-slate-600",children:"Live status"}),u?v.jsx(lxe,{feed:u}):v.jsx("div",{className:"text-xs text-slate-600",children:"No status reported."}),c&&c.length>0&&v.jsx("div",{className:"space-y-2",children:c.slice(0,5).map((d,g)=>v.jsx(uxe,{event:d},g))})]})]})}const hs={nws:{label:"NWS Weather Alerts",subtitle:"National Weather Service alerts",health:"nws",hasCentral:!0,nativeOnly:!1,hasKey:!0},fires:{label:"NIFC Fire Perimeters",subtitle:"Active wildfires (National Interagency Fire Center)",health:"nifc",hasCentral:!0,nativeOnly:!1,hasKey:!0},firms:{label:"NASA FIRMS Hotspots",subtitle:"Satellite thermal-anomaly detections",health:"firms",hasCentral:!0,nativeOnly:!1,hasKey:!1},swpc:{label:"NOAA Space Weather (SWPC)",subtitle:"Solar indices, geomagnetic storms",health:"swpc",hasCentral:!0,nativeOnly:!1,hasKey:!0},ducting:{label:"Tropospheric Ducting",subtitle:"VHF/UHF extended-range conditions",health:"ducting",hasCentral:!1,nativeOnly:!0,hasKey:!0},traffic:{label:"TomTom Traffic",subtitle:"Traffic flow on monitored corridors",health:"traffic",hasCentral:!0,nativeOnly:!1,hasKey:!0},roads511:{label:"511 Road Conditions",subtitle:"State DOT road events and closures",health:"roads511",hasCentral:!0,nativeOnly:!1,hasKey:!1},wzdx:{label:"WZDx Work Zones",subtitle:"Planned road work and construction events from ITD",health:"roads511",hasCentral:!0,nativeOnly:!1,hasKey:!0},usgs_quake:{label:"USGS Earthquakes",subtitle:"Seismic events from the USGS feed",health:"usgs_quake",hasCentral:!0,nativeOnly:!1,hasKey:!0},usgs:{label:"USGS Stream Gauges",subtitle:"River and stream water levels",health:"usgs",hasCentral:!0,nativeOnly:!1,hasKey:!0},avalanche:{label:"Avalanche Advisories",subtitle:"Backcountry avalanche danger ratings",health:"avalanche",hasCentral:!0,nativeOnly:!1,hasKey:!0}},_S=[{key:"central",label:"Central",icon:K$,adapters:[]},{key:"weather",label:"Weather",icon:Du,adapters:["nws"]},{key:"fire",label:"Fire",icon:Xx,adapters:["fires","firms"]},{key:"rf",label:"RF Propagation",icon:Di,adapters:["swpc","ducting"]},{key:"roads",label:"Roads",icon:$x,adapters:["traffic","roads511","wzdx"]},{key:"geohazards",label:"Geohazards",icon:Kx,adapters:["usgs_quake","usgs","avalanche"]},{key:"tracking",label:"Tracking",icon:Qx,adapters:[]},{key:"mesh",label:"Mesh Health",icon:rf,adapters:[]}];function hxe(){var Lf,Nf;const[e,t]=G.useState(null),[r,n]=G.useState(""),[i,a]=G.useState(null),[o,s]=G.useState([]),[l,u]=G.useState(!0),[c,h]=G.useState(!1),[f,d]=G.useState(null),[g,m]=G.useState(null),[y,x]=G.useState(!1),[_,w]=G.useState("weather"),[S,T]=G.useState("nws"),[M,A]=G.useState({allowed_incident_types:["WF"],freshness_seconds:0,cooldown_seconds:28800,broadcast_on_acres:!0,broadcast_on_contained:!0}),[P,I]=G.useState(""),[N,D]=G.useState({digest_enabled:!0,digest_schedule:["06:00","18:00"],digest_timezone:"America/Boise"}),[O,R]=G.useState(""),[F,H]=G.useState({min_magnitude:4,drop_non_present:!0,drop_zero_magnitude:!0}),[W,V]=G.useState(""),[z,Z]=G.useState({min_severity:"None",enabled_categories:["incident","closure"],enabled_sub_types:["accident","road_closed","closure","lane_closed","vehicle_on_fire","flooding","debris"]}),[U,$]=G.useState(""),[Y,te]=G.useState({broadcast:!1,min_severity:"Minor",sub_types:["road_works","lane_closed","road_closed"]}),[ie,se]=G.useState(""),[le,Ee]=G.useState({broadcast_severities:["Extreme","Severe"],duplicate_allowed_after_seconds:3600}),[me,ye]=G.useState(""),[Me,pe]=G.useState({min_danger_level:3}),[Te,st]=G.useState(""),[ze,et]=G.useState({geomag_kp_floor:7,flare_class_floor:"X1",proton_pfu_floor:10}),[lt,Et]=G.useState("");G.useEffect(()=>{document.title="Environment โ€” MeshAI",(async()=>{var xe,Ut,Hn,ui,Gi,gl,ee,xt,pt,dt,ur,oo,rn,Be,Pf,If,Df,Ef,oc,jf,so,Rf,hg;try{const fg=await(await fetch("/api/config/environmental")).json();t(fg),n(JSON.stringify(fg));try{const Bt=await fetch("/api/adapter-config/wfigs");if(Bt.ok){const wt=await Bt.json(),Ft={allowed_incident_types:((xe=wt.allowed_incident_types)==null?void 0:xe.value)??["WF"],freshness_seconds:((Ut=wt.freshness_seconds)==null?void 0:Ut.value)??0,cooldown_seconds:((Hn=wt.cooldown_seconds)==null?void 0:Hn.value)??28800,broadcast_on_acres:((ui=wt.broadcast_on_acres)==null?void 0:ui.value)??!0,broadcast_on_contained:((Gi=wt.broadcast_on_contained)==null?void 0:Gi.value)??!0};A(Ft),I(JSON.stringify(Ft))}}catch{}try{const Bt=await fetch("/api/adapter-config/fires");if(Bt.ok){const wt=await Bt.json(),Ft={digest_enabled:((gl=wt.digest_enabled)==null?void 0:gl.value)??!0,digest_schedule:((ee=wt.digest_schedule)==null?void 0:ee.value)??["06:00","18:00"],digest_timezone:((xt=wt.digest_timezone)==null?void 0:xt.value)??"America/Boise"};D(Ft),R(JSON.stringify(Ft))}}catch{}try{const Bt=await fetch("/api/adapter-config/tomtom_incidents");if(Bt.ok){const wt=await Bt.json(),Ft={min_magnitude:((pt=wt.min_magnitude)==null?void 0:pt.value)??4,drop_non_present:((dt=wt.drop_non_present)==null?void 0:dt.value)??!0,drop_zero_magnitude:((ur=wt.drop_zero_magnitude)==null?void 0:ur.value)??!0};H(Ft),V(JSON.stringify(Ft))}}catch{}try{const Bt=await fetch("/api/adapter-config/itd_511");if(Bt.ok){const wt=await Bt.json(),Ft={min_severity:((oo=wt.min_severity)==null?void 0:oo.value)??"None",enabled_categories:((rn=wt.enabled_categories)==null?void 0:rn.value)??["incident","closure"],enabled_sub_types:((Be=wt.enabled_sub_types)==null?void 0:Be.value)??["accident","road_closed","closure","lane_closed","vehicle_on_fire","flooding","debris"]};Z(Ft),$(JSON.stringify(Ft))}}catch{}try{const Bt=await fetch("/api/adapter-config/wzdx");if(Bt.ok){const wt=await Bt.json(),Ft={broadcast:((Pf=wt.broadcast)==null?void 0:Pf.value)??!1,min_severity:((If=wt.min_severity)==null?void 0:If.value)??"Minor",sub_types:((Df=wt.sub_types)==null?void 0:Df.value)??["road_works","lane_closed","road_closed"]};te(Ft),se(JSON.stringify(Ft))}}catch{}try{const Bt=await fetch("/api/adapter-config/nws");if(Bt.ok){const wt=await Bt.json(),Ft={broadcast_severities:((Ef=wt.broadcast_severities)==null?void 0:Ef.value)??["Extreme","Severe"],duplicate_allowed_after_seconds:((oc=wt.duplicate_allowed_after_seconds)==null?void 0:oc.value)??3600};Ee(Ft),ye(JSON.stringify(Ft))}}catch{}try{const Bt=await fetch("/api/adapter-config/avalanche");if(Bt.ok){const Ft={min_danger_level:((jf=(await Bt.json()).min_danger_level)==null?void 0:jf.value)??3};pe(Ft),st(JSON.stringify(Ft))}}catch{}try{const Bt=await fetch("/api/adapter-config/swpc");if(Bt.ok){const wt=await Bt.json(),Ft={geomag_kp_floor:((so=wt.geomag_kp_floor)==null?void 0:so.value)??7,flare_class_floor:((Rf=wt.flare_class_floor)==null?void 0:Rf.value)??"X1",proton_pfu_floor:((hg=wt.proton_pfu_floor)==null?void 0:hg.value)??10};et(Ft),Et(JSON.stringify(Ft))}}catch{}}catch(Of){d(Of instanceof Error?Of.message:"Failed to load config")}finally{u(!1)}})()},[]),G.useEffect(()=>{const xe=async()=>{try{a(await xB()),s(await _B())}catch{}};xe();const Ut=setInterval(xe,3e4);return()=>clearInterval(Ut)},[]);const lr=e!==null&&JSON.stringify(e)!==r,Mr=JSON.stringify(M)!==P,Gn=JSON.stringify(N)!==O,Wn=JSON.stringify(F)!==W,io=JSON.stringify(z)!==U,Af=JSON.stringify(Y)!==ie,ng=JSON.stringify(le)!==me,ig=JSON.stringify(Me)!==Te,ac=JSON.stringify(ze)!==lt,ag=lr||Mr||Gn||Wn||io||Af||ng||ig||ac,jt=async(xe,Ut,Hn)=>{const ui=await fetch(`/api/adapter-config/${xe}/${Ut}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:Hn})});if(!ui.ok){const Gi=await ui.json().catch(()=>({}));throw new Error(Gi.detail||`Failed to save ${xe}.${Ut}`)}},$_=async()=>{if(e){h(!0),d(null),m(null);try{if(lr){const xe=await fetch("/api/config/environmental",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Ut=await xe.json();if(!xe.ok)throw new Error(Ut.detail||"Save failed");n(JSON.stringify(e)),Ut.restart_required&&x(!0)}if(Mr){const xe=JSON.parse(P);M.freshness_seconds!==xe.freshness_seconds&&await jt("wfigs","freshness_seconds",M.freshness_seconds),JSON.stringify(M.allowed_incident_types)!==JSON.stringify(xe.allowed_incident_types)&&await jt("wfigs","allowed_incident_types",M.allowed_incident_types),M.cooldown_seconds!==xe.cooldown_seconds&&await jt("wfigs","cooldown_seconds",M.cooldown_seconds),M.broadcast_on_acres!==xe.broadcast_on_acres&&await jt("wfigs","broadcast_on_acres",M.broadcast_on_acres),M.broadcast_on_contained!==xe.broadcast_on_contained&&await jt("wfigs","broadcast_on_contained",M.broadcast_on_contained),I(JSON.stringify(M))}if(Gn){const xe=JSON.parse(O);N.digest_enabled!==xe.digest_enabled&&await jt("fires","digest_enabled",N.digest_enabled),JSON.stringify(N.digest_schedule)!==JSON.stringify(xe.digest_schedule)&&await jt("fires","digest_schedule",N.digest_schedule),N.digest_timezone!==xe.digest_timezone&&await jt("fires","digest_timezone",N.digest_timezone),R(JSON.stringify(N))}if(Wn){const xe=JSON.parse(W);F.min_magnitude!==xe.min_magnitude&&await jt("tomtom_incidents","min_magnitude",F.min_magnitude),F.drop_non_present!==xe.drop_non_present&&await jt("tomtom_incidents","drop_non_present",F.drop_non_present),F.drop_zero_magnitude!==xe.drop_zero_magnitude&&await jt("tomtom_incidents","drop_zero_magnitude",F.drop_zero_magnitude),V(JSON.stringify(F))}if(io){const xe=JSON.parse(U);z.min_severity!==xe.min_severity&&await jt("itd_511","min_severity",z.min_severity),JSON.stringify(z.enabled_categories)!==JSON.stringify(xe.enabled_categories)&&await jt("itd_511","enabled_categories",z.enabled_categories),JSON.stringify(z.enabled_sub_types)!==JSON.stringify(xe.enabled_sub_types)&&await jt("itd_511","enabled_sub_types",z.enabled_sub_types),$(JSON.stringify(z))}if(Af){const xe=JSON.parse(ie);Y.broadcast!==xe.broadcast&&await jt("wzdx","broadcast",Y.broadcast),Y.min_severity!==xe.min_severity&&await jt("wzdx","min_severity",Y.min_severity),JSON.stringify(Y.sub_types)!==JSON.stringify(xe.sub_types)&&await jt("wzdx","sub_types",Y.sub_types),se(JSON.stringify(Y))}if(ng){const xe=JSON.parse(me);JSON.stringify(le.broadcast_severities)!==JSON.stringify(xe.broadcast_severities)&&await jt("nws","broadcast_severities",le.broadcast_severities),le.duplicate_allowed_after_seconds!==xe.duplicate_allowed_after_seconds&&await jt("nws","duplicate_allowed_after_seconds",le.duplicate_allowed_after_seconds),ye(JSON.stringify(le))}if(ig){const xe=JSON.parse(Te);Me.min_danger_level!==xe.min_danger_level&&await jt("avalanche","min_danger_level",Me.min_danger_level),st(JSON.stringify(Me))}if(ac){const xe=JSON.parse(lt);ze.geomag_kp_floor!==xe.geomag_kp_floor&&await jt("swpc","geomag_kp_floor",ze.geomag_kp_floor),ze.flare_class_floor!==xe.flare_class_floor&&await jt("swpc","flare_class_floor",ze.flare_class_floor),ze.proton_pfu_floor!==xe.proton_pfu_floor&&await jt("swpc","proton_pfu_floor",ze.proton_pfu_floor),Et(JSON.stringify(ze))}m("Config saved"),setTimeout(()=>m(null),3e3)}catch(xe){d(xe instanceof Error?xe.message:"Save failed")}finally{h(!1)}}},og=()=>{e&&t(JSON.parse(r)),A(JSON.parse(P||JSON.stringify(M))),D(JSON.parse(O||JSON.stringify(N))),H(JSON.parse(W||JSON.stringify(F))),Z(JSON.parse(U||JSON.stringify(z))),te(JSON.parse(ie||JSON.stringify(Y))),Ee(JSON.parse(me||JSON.stringify(le))),pe(JSON.parse(Te||JSON.stringify(Me))),et(JSON.parse(lt||JSON.stringify(ze)))},sg=async()=>{try{await fetch("/api/restart",{method:"POST"}),x(!1),m("Restart initiated")}catch{d("Restart failed")}},Ue=xe=>e&&t({...e,...xe});if(l)return v.jsx("div",{className:"flex items-center justify-center h-64 text-slate-400",children:"Loading environmental configโ€ฆ"});if(!e)return v.jsx("div",{className:"flex items-center justify-center h-64 text-red-400",children:f||"No config"});const lg=xe=>i==null?void 0:i.feeds.find(Ut=>Ut.source===hs[xe].health),kf=xe=>o.filter(Ut=>Ut.source===hs[xe].health),ao=_S.find(xe=>xe.key===_),tn=ao.adapters.length===0?null:S&&ao.adapters.includes(S)?S:ao.adapters[0],pl=xe=>{var Ut,Hn,ui,Gi,gl;switch(xe){case"nws":return v.jsxs(v.Fragment,{children:[v.jsx(ou,{label:"NWS Zones",value:e.nws_zones,onChange:ee=>Ue({nws_zones:ee}),helper:"Zone IDs like IDZ016, IDZ030",infoLink:"https://www.weather.gov/pimar/PubZone"}),e.nws.feed_source!=="central"&&v.jsxs(v.Fragment,{children:[v.jsx(ct,{label:"User Agent",value:e.nws.user_agent,onChange:ee=>Ue({nws:{...e.nws,user_agent:ee}}),placeholder:"(MeshAI, you@email.com)",helper:"Format: (app_name, contact_email)"}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Tick Seconds",value:e.nws.tick_seconds,onChange:ee=>Ue({nws:{...e.nws,tick_seconds:ee}}),min:30}),v.jsx(Ln,{label:"Min Severity",value:e.nws.severity_min,onChange:ee=>Ue({nws:{...e.nws,severity_min:ee}}),options:[{value:"minor",label:"Minor"},{value:"moderate",label:"Moderate"},{value:"severe",label:"Severe"},{value:"extreme",label:"Extreme"}]})]})]}),e.nws.feed_source==="central"&&v.jsxs("div",{className:"border-t border-slate-700/50 pt-4 mt-4",children:[v.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Filters"}),v.jsxs("div",{className:"mb-3",children:[v.jsx("div",{className:"text-xs text-slate-400 mb-2",children:"Severities to broadcast"}),v.jsx("div",{className:"flex gap-6",children:["Extreme","Severe","Moderate","Minor"].map(ee=>v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:le.broadcast_severities.includes(ee),onChange:xt=>{const pt=le.broadcast_severities;Ee({...le,broadcast_severities:xt.target.checked?[...pt,ee]:pt.filter(dt=>dt!==ee)})},className:"w-4 h-4 rounded accent-blue-500"}),v.jsx("span",{className:"text-sm text-slate-300",children:ee})]},ee))})]}),v.jsx(We,{label:"Re-broadcast Cooldown (seconds)",value:le.duplicate_allowed_after_seconds,onChange:ee=>Ee({...le,duplicate_allowed_after_seconds:ee}),min:0,helper:"Minimum seconds before the same alert ID can be re-broadcast"})]})]});case"swpc":return v.jsx("div",{className:"space-y-6",children:v.jsxs("div",{children:[v.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Thresholds"}),v.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[v.jsx(Ln,{label:"Geomag Kp Floor",value:String(ze.geomag_kp_floor),onChange:ee=>et({...ze,geomag_kp_floor:Number(ee)}),options:[{value:"5",label:"5 โ€” G1 Minor"},{value:"6",label:"6 โ€” G2 Moderate"},{value:"7",label:"7 โ€” G3 Strong"},{value:"8",label:"8 โ€” G4 Severe"},{value:"9",label:"9 โ€” G5 Extreme"}],helper:"Kp at or above this triggers geomag broadcast"}),v.jsx(Ln,{label:"Flare Class Floor",value:ze.flare_class_floor,onChange:ee=>et({...ze,flare_class_floor:ee}),options:[{value:"M1",label:"M1 โ€” R1 Minor"},{value:"M5",label:"M5 โ€” R2 Moderate"},{value:"X1",label:"X1 โ€” R3 Strong"},{value:"X10",label:"X10 โ€” R4 Severe"}],helper:"X-ray flare class floor for broadcast"}),v.jsx(Ln,{label:"Proton pfu Floor",value:String(ze.proton_pfu_floor),onChange:ee=>et({...ze,proton_pfu_floor:Number(ee)}),options:[{value:"10",label:"10 โ€” S1 Minor"},{value:"100",label:"100 โ€” S2 Moderate"},{value:"1000",label:"1000 โ€” S3 Strong"},{value:"10000",label:"10000 โ€” S4 Severe"}],helper:"Proton flux (pfu) at โ‰ฅ10 MeV for broadcast"})]})]})});case"ducting":return v.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[v.jsx(We,{label:"Tick Seconds",value:e.ducting.tick_seconds,onChange:ee=>Ue({ducting:{...e.ducting,tick_seconds:ee}}),min:60}),v.jsx(We,{label:"Latitude",value:e.ducting.latitude,onChange:ee=>Ue({ducting:{...e.ducting,latitude:ee}}),step:.01}),v.jsx(We,{label:"Longitude",value:e.ducting.longitude,onChange:ee=>Ue({ducting:{...e.ducting,longitude:ee}}),step:.01})]});case"fires":return v.jsxs("div",{className:"space-y-6",children:[e.fires.feed_source!=="central"&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Tick Seconds",value:e.fires.tick_seconds,onChange:ee=>Ue({fires:{...e.fires,tick_seconds:ee}}),min:60}),v.jsx(Ln,{label:"State",value:e.fires.state,onChange:ee=>Ue({fires:{...e.fires,state:ee}}),options:W0e})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Incident Types"}),v.jsx("div",{className:"flex gap-6",children:[["WF","Wildfire"],["RX","Prescribed Burn"],["OTHER","Other"]].map(([ee,xt])=>{var pt;return v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:((pt=M.allowed_incident_types)==null?void 0:pt.includes(ee))??ee==="WF",onChange:dt=>{const ur=M.allowed_incident_types??["WF"];A({...M,allowed_incident_types:dt.target.checked?[...ur,ee]:ur.filter(oo=>oo!==ee)})},className:"w-4 h-4 rounded accent-blue-500"}),v.jsx("span",{className:"text-sm text-slate-300",children:xt})]},ee)})})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Triggers"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm text-slate-300",children:"Broadcast on acres increase"}),v.jsx("input",{type:"checkbox",checked:M.broadcast_on_acres,onChange:ee=>A({...M,broadcast_on_acres:ee.target.checked}),className:"w-4 h-4 rounded accent-blue-500"})]}),v.jsxs("label",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm text-slate-300",children:"Broadcast on containment increase"}),v.jsx("input",{type:"checkbox",checked:M.broadcast_on_contained,onChange:ee=>A({...M,broadcast_on_contained:ee.target.checked}),className:"w-4 h-4 rounded accent-blue-500"})]})]})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Update Cooldown (hours)",value:Math.round(M.cooldown_seconds/3600),onChange:ee=>A({...M,cooldown_seconds:ee*3600}),min:0,helper:"Minimum hours between updates for the same fire"}),v.jsx(We,{label:"Freshness Window (hours)",value:Math.round(M.freshness_seconds/3600),onChange:ee=>A({...M,freshness_seconds:ee*3600}),min:0,helper:"0 = always broadcast regardless of event age"})]})]});case"avalanche":return v.jsxs("div",{className:"space-y-6",children:[e.avalanche.feed_source!=="central"&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Tick Seconds",value:e.avalanche.tick_seconds,onChange:ee=>Ue({avalanche:{...e.avalanche,tick_seconds:ee}}),min:60}),v.jsx(U0e,{label:"Season Months",value:e.avalanche.season_months,onChange:ee=>Ue({avalanche:{...e.avalanche,season_months:ee}}),helper:"e.g., 12, 1, 2, 3, 4"})]}),v.jsx(ou,{label:"Center IDs",value:e.avalanche.center_ids,onChange:ee=>Ue({avalanche:{...e.avalanche,center_ids:ee}}),helper:"e.g., SNFAC",infoLink:"https://avalanche.org/avalanche-centers/"}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Settings"}),v.jsx("div",{className:"grid grid-cols-2 gap-4",children:v.jsx(Ln,{label:"Min Danger Level",value:String(Me.min_danger_level),onChange:ee=>pe({...Me,min_danger_level:Number(ee)}),options:[{value:"3",label:"3 โ€” Considerable"},{value:"4",label:"4 โ€” High"},{value:"5",label:"5 โ€” Extreme"}],helper:"Minimum avalanche danger level to broadcast"})})]})]});case"usgs":return v.jsxs(v.Fragment,{children:[v.jsx(We,{label:"Tick Seconds",value:e.usgs.tick_seconds,onChange:ee=>Ue({usgs:{...e.usgs,tick_seconds:ee}}),min:900,helper:"Minimum 15 min (900s). tick_seconds is the native-mode poll interval; ignored when this adapter is set to feed_source=central."}),v.jsx(ou,{label:"Site IDs",value:e.usgs.sites,onChange:ee=>Ue({usgs:{...e.usgs,sites:ee}}),helper:"USGS gauge site numbers",infoLink:"https://waterdata.usgs.gov/nwis"})]});case"usgs_quake":return v.jsxs("div",{className:"space-y-6",children:[e.usgs_quake.feed_source!=="central"&&v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Tick Seconds",value:e.usgs_quake.tick_seconds,onChange:ee=>Ue({usgs_quake:{...e.usgs_quake,tick_seconds:ee}}),min:60}),v.jsx(ct,{label:"Region Tag",value:e.usgs_quake.region,onChange:ee=>Ue({usgs_quake:{...e.usgs_quake,region:ee}})})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Magnitude Thresholds"}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(We,{label:"Global Floor",value:e.usgs_quake.global_mag_floor,onChange:ee=>Ue({usgs_quake:{...e.usgs_quake,global_mag_floor:ee}}),step:.1,min:0,helper:"Broadcast anywhere at or above this magnitude"}),v.jsx(We,{label:"Regional Floor",value:e.usgs_quake.regional_mag_floor,onChange:ee=>Ue({usgs_quake:{...e.usgs_quake,regional_mag_floor:ee}}),step:.1,min:0,helper:"Reduced floor within regional radius"}),v.jsx(We,{label:"Regional Radius (mi)",value:e.usgs_quake.regional_radius_mi,onChange:ee=>Ue({usgs_quake:{...e.usgs_quake,regional_radius_mi:ee}}),min:50,helper:"Radius around region centroid for reduced floor"}),v.jsx(We,{label:"Escalation Floor",value:e.usgs_quake.escalate_mag_floor,onChange:ee=>Ue({usgs_quake:{...e.usgs_quake,escalate_mag_floor:ee}}),step:.1,min:0,helper:"Magnitude at which broadcast uses warning emoji"})]})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"PAGER Alert Levels"}),v.jsx("div",{className:"text-xs text-slate-500 mb-2",children:"Broadcast at any magnitude when USGS PAGER alert reaches these levels"}),v.jsx("div",{className:"flex gap-6",children:["green","yellow","orange","red"].map(ee=>v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:(e.usgs_quake.broadcast_pager_alerts??[]).includes(ee),onChange:xt=>{const pt=e.usgs_quake.broadcast_pager_alerts??[];Ue({usgs_quake:{...e.usgs_quake,broadcast_pager_alerts:xt.target.checked?[...pt,ee]:pt.filter(dt=>dt!==ee)}})},className:"w-4 h-4 rounded accent-blue-500"}),v.jsx("span",{className:"text-sm text-slate-300 capitalize",children:ee})]},ee))})]})]});case"traffic":return v.jsxs(v.Fragment,{children:[v.jsx(ct,{label:"API Key",value:e.traffic.api_key,onChange:ee=>Ue({traffic:{...e.traffic,api_key:ee}}),type:"password",helper:"developer.tomtom.com"}),v.jsx(We,{label:"Tick Seconds",value:e.traffic.tick_seconds,onChange:ee=>Ue({traffic:{...e.traffic,tick_seconds:ee}}),min:60}),v.jsx("div",{className:"text-xs text-slate-500 mt-2",children:"Corridors:"}),(e.traffic.corridors||[]).map((ee,xt)=>v.jsxs("div",{className:"grid grid-cols-4 gap-2 items-end",children:[v.jsx(ct,{label:"Name",value:ee.name,onChange:pt=>{const dt=[...e.traffic.corridors];dt[xt]={...ee,name:pt},Ue({traffic:{...e.traffic,corridors:dt}})}}),v.jsx(We,{label:"Lat",value:ee.lat,onChange:pt=>{const dt=[...e.traffic.corridors];dt[xt]={...ee,lat:pt},Ue({traffic:{...e.traffic,corridors:dt}})},step:.01}),v.jsx(We,{label:"Lon",value:ee.lon,onChange:pt=>{const dt=[...e.traffic.corridors];dt[xt]={...ee,lon:pt},Ue({traffic:{...e.traffic,corridors:dt}})},step:.01}),v.jsx("button",{onClick:()=>Ue({traffic:{...e.traffic,corridors:e.traffic.corridors.filter((pt,dt)=>dt!==xt)}}),className:"px-2 py-2 text-xs text-red-400 hover:text-red-300 border border-red-400/30 rounded",children:"Remove"})]},xt)),v.jsx("button",{onClick:()=>Ue({traffic:{...e.traffic,corridors:[...e.traffic.corridors||[],{name:"",lat:0,lon:0}]}}),className:"text-xs text-accent hover:underline",children:"+ Add Corridor"}),v.jsxs("div",{className:"border-t border-slate-700/50 pt-4 mt-4",children:[v.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Filters"}),v.jsx("div",{className:"grid grid-cols-2 gap-4",children:v.jsxs("div",{children:[v.jsx("label",{className:"text-xs text-slate-400 mb-1 block",children:"Minimum Magnitude"}),v.jsxs("select",{value:F.min_magnitude,onChange:ee=>H({...F,min_magnitude:parseInt(ee.target.value)}),className:"w-full bg-slate-900 border border-slate-700 rounded px-3 py-2 text-sm",children:[v.jsx("option",{value:1,children:"1 โ€” Minor (all)"}),v.jsx("option",{value:2,children:"2 โ€” Moderate (yellow+)"}),v.jsx("option",{value:3,children:"3 โ€” Major (orange+)"}),v.jsx("option",{value:4,children:"4 โ€” Severe (red only)"})]}),v.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Drop TomTom incidents below this severity level"})]})}),v.jsxs("div",{className:"mt-3 space-y-2",children:[v.jsxs("label",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm text-slate-300",children:"Drop non-present time validity"}),v.jsx("input",{type:"checkbox",checked:F.drop_non_present,onChange:ee=>H({...F,drop_non_present:ee.target.checked}),className:"w-4 h-4 rounded accent-blue-500"})]}),v.jsxs("label",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm text-slate-300",children:"Drop zero-magnitude events"}),v.jsx("input",{type:"checkbox",checked:F.drop_zero_magnitude,onChange:ee=>H({...F,drop_zero_magnitude:ee.target.checked}),className:"w-4 h-4 rounded accent-blue-500"})]})]})]})]});case"roads511":return v.jsxs(v.Fragment,{children:[v.jsx(ct,{label:"Base URL",value:e.roads511.base_url,onChange:ee=>Ue({roads511:{...e.roads511,base_url:ee}}),placeholder:"https://511.yourstate.gov/api/v2"}),v.jsx(ct,{label:"API Key",value:e.roads511.api_key,onChange:ee=>Ue({roads511:{...e.roads511,api_key:ee}}),type:"password",helper:"Leave empty if not required"}),v.jsx(We,{label:"Tick Seconds",value:e.roads511.tick_seconds,onChange:ee=>Ue({roads511:{...e.roads511,tick_seconds:ee}}),min:60}),v.jsx(ou,{label:"Endpoints",value:e.roads511.endpoints,onChange:ee=>Ue({roads511:{...e.roads511,endpoints:ee}}),helper:"e.g., /get/event"}),v.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((ee,xt)=>{var pt;return v.jsx(We,{label:ee,value:((pt=e.roads511.bbox)==null?void 0:pt[xt])??0,onChange:dt=>{const ur=[...e.roads511.bbox||[0,0,0,0]];ur[xt]=dt,Ue({roads511:{...e.roads511,bbox:ur}})},step:.01},ee)})}),v.jsxs("div",{className:"border-t border-slate-700/50 pt-4 mt-4",children:[v.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Filters"}),v.jsx("div",{className:"grid grid-cols-2 gap-4",children:v.jsxs("div",{children:[v.jsx("label",{className:"text-xs text-slate-400 mb-1 block",children:"Minimum Severity"}),v.jsxs("select",{value:z.min_severity,onChange:ee=>Z({...z,min_severity:ee.target.value}),className:"w-full bg-slate-900 border border-slate-700 rounded px-3 py-2 text-sm",children:[v.jsx("option",{value:"None",children:"None (all)"}),v.jsx("option",{value:"Minor",children:"Minor+"}),v.jsx("option",{value:"Major",children:"Major only"})]}),v.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Drop ITD 511 events below this severity"})]})}),v.jsxs("div",{className:"mt-4",children:[v.jsx("div",{className:"text-xs text-slate-400 mb-2",children:"Categories"}),v.jsx("div",{className:"flex gap-6",children:[["incident","Incident"],["closure","Closure"],["special_event","Special Event"]].map(([ee,xt])=>v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:z.enabled_categories.includes(ee),onChange:pt=>{const dt=z.enabled_categories;Z({...z,enabled_categories:pt.target.checked?[...dt,ee]:dt.filter(ur=>ur!==ee)})},className:"w-4 h-4 rounded accent-blue-500"}),v.jsx("span",{className:"text-sm text-slate-300",children:xt})]},ee))})]}),v.jsxs("div",{className:"mt-4",children:[v.jsx("div",{className:"text-xs text-slate-400 mb-2",children:"Sub-types"}),v.jsx("div",{className:"grid grid-cols-2 gap-2",children:[["accident","Crash"],["road_closed","Road Closed"],["lane_closed","Lane Closure"],["vehicle_on_fire","Vehicle Fire"],["flooding","Flooding"],["debris","Debris"],["road_works","Road Works"],["disabled_vehicle","Disabled Vehicle"]].map(([ee,xt])=>v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:z.enabled_sub_types.includes(ee),onChange:pt=>{const dt=z.enabled_sub_types;Z({...z,enabled_sub_types:pt.target.checked?[...dt,ee]:dt.filter(ur=>ur!==ee)})},className:"w-4 h-4 rounded accent-blue-500"}),v.jsx("span",{className:"text-sm text-slate-300",children:xt})]},ee))})]})]})]});case"wzdx":return v.jsxs(v.Fragment,{children:[((Ut=e.wzdx)==null?void 0:Ut.feed_source)!=="central"&&v.jsxs(v.Fragment,{children:[v.jsx(ct,{label:"Base URL",value:((Hn=e.wzdx)==null?void 0:Hn.base_url)??"",onChange:ee=>Ue({wzdx:{...e.wzdx,base_url:ee}}),placeholder:"https://511.yourstate.gov/api/v2"}),v.jsx(ct,{label:"API Key",value:((ui=e.wzdx)==null?void 0:ui.api_key)??"",onChange:ee=>Ue({wzdx:{...e.wzdx,api_key:ee}}),type:"password",helper:"Leave empty if not required"}),v.jsx(We,{label:"Tick Seconds",value:((Gi=e.wzdx)==null?void 0:Gi.tick_seconds)??300,onChange:ee=>Ue({wzdx:{...e.wzdx,tick_seconds:ee}}),min:60}),v.jsx(ou,{label:"Endpoints",value:((gl=e.wzdx)==null?void 0:gl.endpoints)??["/get/event"],onChange:ee=>Ue({wzdx:{...e.wzdx,endpoints:ee}}),helper:"e.g., /get/event"}),v.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((ee,xt)=>{var pt,dt;return v.jsx(We,{label:ee,value:((dt=(pt=e.wzdx)==null?void 0:pt.bbox)==null?void 0:dt[xt])??0,onChange:ur=>{var rn;const oo=[...((rn=e.wzdx)==null?void 0:rn.bbox)||[0,0,0,0]];oo[xt]=ur,Ue({wzdx:{...e.wzdx,bbox:oo}})},step:.01},ee)})}),v.jsx("div",{className:"text-xs text-slate-500",children:"Bounding box [W,S,E,N] geographic filter"})]}),v.jsxs("div",{className:"border-t border-slate-700/50 pt-4 mt-4",children:[v.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Settings"}),v.jsxs("label",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm text-slate-300",children:"Broadcast work zone events"}),v.jsx("input",{type:"checkbox",checked:Y.broadcast,onChange:ee=>te({...Y,broadcast:ee.target.checked}),className:"w-4 h-4 rounded accent-blue-500"})]}),Y.broadcast?v.jsxs("div",{className:"space-y-3 mt-3",children:[v.jsxs("div",{children:[v.jsx("label",{className:"text-xs text-slate-400 mb-1 block",children:"Min Severity"}),v.jsxs("select",{value:Y.min_severity,onChange:ee=>te({...Y,min_severity:ee.target.value}),className:"w-full bg-slate-900 border border-slate-700 rounded px-3 py-2 text-sm",children:[v.jsx("option",{value:"None",children:"None (all)"}),v.jsx("option",{value:"Minor",children:"Minor+"}),v.jsx("option",{value:"Major",children:"Major only"})]})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-xs text-slate-400 mb-2",children:"Sub-types"}),v.jsx("div",{className:"flex gap-6",children:[["road_works","Road Works"],["lane_closed","Lane Closure"],["road_closed","Road Closed"]].map(([ee,xt])=>v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:Y.sub_types.includes(ee),onChange:pt=>{const dt=Y.sub_types;te({...Y,sub_types:pt.target.checked?[...dt,ee]:dt.filter(ur=>ur!==ee)})},className:"w-4 h-4 rounded accent-blue-500"}),v.jsx("span",{className:"text-sm text-slate-300",children:xt})]},ee))})]})]}):v.jsxs("p",{className:"text-xs text-slate-500 mt-2",children:["Work zone events stored for LLM context only ","โ€”"," no mesh broadcasts."]})]})]});case"firms":return v.jsxs(v.Fragment,{children:[v.jsx(ct,{label:"MAP Key",value:e.firms.map_key,onChange:ee=>Ue({firms:{...e.firms,map_key:ee}}),type:"password",helper:"firms.modaps.eosdis.nasa.gov/api/area/",infoLink:"https://firms.modaps.eosdis.nasa.gov/api/area/"}),v.jsx(We,{label:"Tick Seconds",value:e.firms.tick_seconds,onChange:ee=>Ue({firms:{...e.firms,tick_seconds:ee}}),min:300}),v.jsx(Ln,{label:"Satellite Source",value:e.firms.source,onChange:ee=>Ue({firms:{...e.firms,source:ee}}),options:[{value:"VIIRS_SNPP_NRT",label:"VIIRS SNPP (NRT)"},{value:"VIIRS_NOAA20_NRT",label:"VIIRS NOAA-20 (NRT)"},{value:"MODIS_NRT",label:"MODIS (NRT)"}]}),v.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[v.jsx(We,{label:"Day Range",value:e.firms.day_range,onChange:ee=>Ue({firms:{...e.firms,day_range:ee}}),min:1,max:10}),v.jsx(Ln,{label:"Min Confidence",value:e.firms.confidence_min,onChange:ee=>Ue({firms:{...e.firms,confidence_min:ee}}),options:[{value:"low",label:"Low"},{value:"nominal",label:"Nominal"},{value:"high",label:"High"}]}),v.jsx(We,{label:"Proximity (km)",value:e.firms.proximity_km,onChange:ee=>Ue({firms:{...e.firms,proximity_km:ee}}),step:.5})]}),v.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((ee,xt)=>{var pt;return v.jsx(We,{label:ee,value:((pt=e.firms.bbox)==null?void 0:pt[xt])??0,onChange:dt=>{const ur=[...e.firms.bbox||[0,0,0,0]];ur[xt]=dt,Ue({firms:{...e.firms,bbox:ur}})},step:.01},ee)})})]})}},ug=e,cg=(xe,Ut)=>{const Hn=e[xe]||{};Ue({[xe]:{...Hn,...Ut}})};return v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("h1",{className:"text-xl font-semibold text-slate-200",children:"Environment"}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(or,{label:"Feeds Enabled",checked:e.enabled,onChange:xe=>Ue({enabled:xe})}),ag&&v.jsxs(v.Fragment,{children:[v.jsxs("button",{onClick:og,className:"flex items-center gap-1 px-3 py-1.5 text-sm text-slate-400 hover:text-slate-200 border border-border rounded",children:[v.jsx(Jx,{size:14})," Discard"]}),v.jsxs("button",{onClick:$_,disabled:c,className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-accent text-white rounded disabled:opacity-50",children:[v.jsx(zM,{size:14})," ",c?"Savingโ€ฆ":"Save"]})]})]})]}),f&&v.jsx("div",{className:"text-sm text-red-400 bg-red-500/10 rounded p-3",children:f}),g&&v.jsx("div",{className:"text-sm text-green-400 bg-green-500/10 rounded p-3",children:g}),y&&v.jsxs("div",{className:"flex items-center justify-between text-sm text-amber-400 bg-amber-500/10 border border-amber-500/30 rounded p-3",children:[v.jsxs("span",{className:"flex items-center gap-2",children:[v.jsx($v,{size:14})," A restart is required for some changes to take effect."]}),v.jsx("button",{onClick:sg,className:"px-3 py-1 bg-amber-500/20 hover:bg-amber-500/30 rounded",children:"Restart now"})]}),v.jsx("div",{className:"flex gap-1 border-b border-border overflow-x-auto",children:_S.map(({key:xe,label:Ut,icon:Hn})=>v.jsxs("button",{onClick:()=>{w(xe);const ui=_S.find(Gi=>Gi.key===xe);T(ui.adapters[0]??null)},className:`flex items-center gap-2 px-4 py-2 text-sm whitespace-nowrap border-b-2 -mb-px transition-colors ${_===xe?"border-accent text-accent":"border-transparent text-slate-400 hover:text-slate-200"}`,children:[v.jsx(Hn,{size:15})," ",Ut]},xe))}),_==="central"&&e.central&&v.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{children:[v.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Central Connection"}),v.jsx("p",{className:"text-xs text-slate-600",children:'NATS JetStream source for any adapter set to "central"'})]}),v.jsx(or,{label:"",checked:!!e.central.enabled,onChange:xe=>Ue({central:{...e.central,enabled:xe}})})]}),v.jsxs("div",{className:e.central.enabled?"space-y-3":"space-y-3 opacity-40 pointer-events-none select-none",children:[v.jsx(ct,{label:"URL",value:e.central.url||"",onChange:xe=>Ue({central:{...e.central,url:xe}}),placeholder:"nats://central.echo6.mesh:4222"}),v.jsx(ct,{label:"Durable",value:e.central.durable||"",onChange:xe=>Ue({central:{...e.central,durable:xe}}),placeholder:"meshai-v04"}),v.jsx(ct,{label:"Region",value:e.central.region||"",onChange:xe=>Ue({central:{...e.central,region:xe}}),placeholder:"us.id",helper:"Central v0.9.20 region token (dotted, e.g. 'us.id'). Empty = bare wildcards (all-US firehose). Each adapter is either Central or native, never both โ€” see Reference โ†’ OR-not-AND Architecture for why."})]})]}),_==="tracking"&&v.jsxs("div",{className:"flex flex-col items-center justify-center h-[40vh] text-center",children:[v.jsx(Qx,{size:32,className:"text-slate-600 mb-4"}),v.jsx("p",{className:"text-slate-500 max-w-md",children:"No adapters yet. ADS-B / AIS / satellite passes are planned for v0.5."})]}),_==="mesh"&&v.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{children:[v.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Mesh Health"}),v.jsx("p",{className:"text-xs text-slate-600",children:"Node/infra telemetry โ€” sourced from the mesh, not an environmental feed."})]}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx("span",{className:"text-[10px] uppercase tracking-wide text-slate-600",children:"source"}),v.jsx(JH,{value:"native",onChange:()=>{},disabled:!1,centralDisabled:!0})]})]}),v.jsx("div",{className:"text-[11px] text-slate-600",children:"Central not available โ€” reserved for a future migration."})]}),ao.adapters.length>0&&tn&&v.jsxs(v.Fragment,{children:[ao.adapters.length>1&&v.jsx("div",{className:"flex gap-1",children:ao.adapters.map(xe=>v.jsx("button",{onClick:()=>T(xe),className:`px-3 py-1.5 text-sm rounded ${tn===xe?"bg-bg-hover text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:hs[xe].label},xe))}),v.jsx(cxe,{title:hs[tn].label,subtitle:hs[tn].subtitle,enabled:((Lf=ug[tn])==null?void 0:Lf.enabled)??!1,onEnabled:xe=>cg(tn,{enabled:xe}),feedSource:((Nf=ug[tn])==null?void 0:Nf.feed_source)??"native",onFeedSource:xe=>cg(tn,{feed_source:xe}),hasCentral:hs[tn].hasCentral,nativeOnly:hs[tn].nativeOnly,hasKey:hs[tn].hasKey,health:lg(tn),events:kf(tn),children:pl(tn)})]})]})}const k3={infra_offline:mB,infra_recovery:t_,battery_warning:Z1,battery_critical:Z1,battery_emergency:Z1,hf_blackout:Dh,uhf_ducting:Di,weather_warning:Du,weather_watch:Du,new_router:Di,packet_flood:$a,sustained_high_util:$a,region_blackout:Vo,default:Zv};function fxe(e){return k3[e]||k3.default}function QH(e){switch(e==null?void 0:e.toLowerCase()){case"immediate":return{bg:"bg-red-500/10",border:"border-red-500",badge:"bg-red-500/20 text-red-400",iconColor:"text-red-500"};case"priority":return{bg:"bg-amber-500/10",border:"border-amber-500",badge:"bg-amber-500/20 text-amber-400",iconColor:"text-amber-500"};case"routine":default:return{bg:"bg-blue-500/10",border:"border-blue-500",badge:"bg-blue-500/20 text-blue-400",iconColor:"text-blue-500"}}}function dxe(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 vxe(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 pxe(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 gxe({alert:e,onAcknowledge:t}){var i;const r=QH(e.severity),n=fxe(e.type);return v.jsx("div",{className:`p-4 rounded-lg ${r.bg} border-l-4 ${r.border}`,children:v.jsxs("div",{className:"flex items-start gap-3",children:[v.jsx(n,{size:20,className:r.iconColor}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[v.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${r.badge}`,children:(i=e.severity)==null?void 0:i.toUpperCase()}),v.jsx("span",{className:"text-xs text-slate-500",children:e.type})]}),v.jsx("div",{className:"text-sm text-slate-200",children:e.message}),v.jsxs("div",{className:"flex items-center gap-4 mt-2 text-xs text-slate-500",children:[v.jsxs("span",{className:"flex items-center gap-1",children:[v.jsx(Iu,{size:12}),e.timestamp?dxe(e.timestamp):"Just now"]}),e.scope_value&&v.jsxs("span",{children:[e.scope_type,": ",e.scope_value]})]})]}),v.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 mxe({history:e,typeFilter:t,severityFilter:r,onTypeFilterChange:n,onSeverityFilterChange:i,page:a,totalPages:o,onPageChange:s}){const l=["all","infra_offline","infra_recovery","battery_warning","battery_critical","hf_blackout","uhf_ducting","weather_warning","new_router","packet_flood"],u=["all","immediate","priority","routine"];return v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg",children:[v.jsxs("div",{className:"p-4 border-b border-border flex items-center gap-4",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(RM,{size:14,className:"text-slate-400"}),v.jsx("span",{className:"text-sm text-slate-400",children:"Filter:"})]}),v.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=>v.jsx("option",{value:c,children:c==="all"?"All Types":c.replace(/_/g," ")},c))}),v.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=>v.jsx("option",{value:c,children:c==="all"?"All Severities":c.charAt(0).toUpperCase()+c.slice(1)},c))})]}),v.jsx("div",{className:"overflow-x-auto",children:v.jsxs("table",{className:"w-full",children:[v.jsx("thead",{children:v.jsxs("tr",{className:"border-b border-border",children:[v.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Time"}),v.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Type"}),v.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Severity"}),v.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Message"}),v.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Duration"})]})}),v.jsx("tbody",{children:e.length>0?e.map((c,h)=>{const f=QH(c.severity);return v.jsxs("tr",{className:"border-b border-border hover:bg-bg-hover",children:[v.jsx("td",{className:"p-4 text-sm text-slate-400 font-mono whitespace-nowrap",children:vxe(c.timestamp)}),v.jsx("td",{className:"p-4 text-sm text-slate-300",children:c.type.replace(/_/g," ")}),v.jsx("td",{className:"p-4",children:v.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${f.badge}`,children:c.severity})}),v.jsx("td",{className:"p-4 text-sm text-slate-200 max-w-md truncate",children:c.message}),v.jsx("td",{className:"p-4 text-sm text-slate-400 font-mono",children:c.duration?pxe(c.duration):"-"})]},c.id||h)}):v.jsx("tr",{children:v.jsx("td",{colSpan:5,className:"p-8 text-center text-slate-500",children:"No alert history available"})})})]})}),o>1&&v.jsxs("div",{className:"p-4 border-t border-border flex items-center justify-between",children:[v.jsxs("span",{className:"text-sm text-slate-400",children:["Page ",a," of ",o]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.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:v.jsx(F$,{size:16})}),v.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:v.jsx(Js,{size:16})})]})]})]})}function yxe({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 h=`${s%12||12}:${l} ${u}`;return e.sub_type==="weekly"&&e.schedule_day&&(h+=` ${e.schedule_day.charAt(0).toUpperCase()}${e.schedule_day.slice(1)}`),h},a=(()=>{switch(e.sub_type){case"alerts":return Zv;case"daily":return Iu;case"weekly":return Iu;default:return Zv}})();return v.jsx("div",{className:"p-4 rounded-lg bg-bg-hover border border-border",children:v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:"w-10 h-10 rounded-lg bg-blue-500/10 flex items-center justify-center",children:v.jsx(a,{size:18,className:"text-blue-400"})}),v.jsxs("div",{className:"flex-1",children:[v.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&&v.jsxs("span",{className:"text-slate-400 font-normal ml-2",children:["(",e.scope_type,": ",e.scope_value,")"]})]}),v.jsxs("div",{className:"text-xs text-slate-500 mt-0.5",children:[n()," โ€ข ",r(e.user_id)]})]}),v.jsx("div",{className:`w-2 h-2 rounded-full ${e.enabled?"bg-green-500":"bg-slate-500"}`})]})})}function xxe(){const[e,t]=G.useState([]),[r,n]=G.useState([]),[i,a]=G.useState([]),[o,s]=G.useState([]),[l,u]=G.useState(!0),[c,h]=G.useState(null),[f,d]=G.useState("all"),[g,m]=G.useState("all"),[y,x]=G.useState(1),[_,w]=G.useState(1),S=20,[T,M]=G.useState(new Set),{lastAlert:A}=FM();G.useEffect(()=>{document.title="Alerts โ€” MeshAI"},[]),G.useEffect(()=>{Promise.all([yB().catch(()=>[]),OP(S,0).catch(()=>({items:[],total:0})),iY().catch(()=>[]),fetch("/api/nodes").then(N=>N.json()).catch(()=>[])]).then(([N,D,O,R])=>{t(N),Array.isArray(D)?(n(D),w(1)):(n(D.items||[]),w(Math.ceil((D.total||0)/S))),a(O),s(R),u(!1)}).catch(N=>{h(N.message),u(!1)})},[]),G.useEffect(()=>{A&&t(N=>N.some(O=>O.type===A.type&&O.message===A.message)?N:[A,...N])},[A]),G.useEffect(()=>{const N=(y-1)*S;OP(S,N,f,g).then(D=>{Array.isArray(D)?(n(D),w(1)):(n(D.items||[]),w(Math.ceil((D.total||0)/S)))}).catch(()=>{})},[y,f,g]);const P=G.useCallback(N=>{const D=`${N.type}-${N.message}-${N.timestamp}`;M(O=>new Set([...O,D]))},[]),I=e.filter(N=>{const D=`${N.type}-${N.message}-${N.timestamp}`;return!T.has(D)});return l?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-slate-400",children:"Loading alerts..."})}):c?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsxs("div",{className:"text-red-400",children:["Error: ",c]})}):v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[v.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[v.jsx($a,{size:14}),"Active Alerts (",I.length,")"]}),I.length>0?v.jsx("div",{className:"space-y-3",children:I.map((N,D)=>v.jsx(gxe,{alert:N,onAcknowledge:P},`${N.type}-${N.timestamp}-${D}`))}):v.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-8",children:[v.jsx(EM,{size:20,className:"text-green-500"}),v.jsx("span",{children:"No active alerts โ€” all systems nominal"})]})]}),v.jsxs("div",{children:[v.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[v.jsx(Iu,{size:14}),"Alert History"]}),v.jsx(mxe,{history:r,typeFilter:f,severityFilter:g,onTypeFilterChange:N=>{d(N),x(1)},onSeverityFilterChange:N=>{m(N),x(1)},page:y,totalPages:_,onPageChange:x})]}),v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[v.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[v.jsx(Q$,{size:14}),"Mesh Subscriptions (",i.length,")"]}),i.length>0?v.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:i.map(N=>v.jsx(yxe,{subscription:N,nodes:o},N.id))}):v.jsxs("div",{className:"text-slate-500 py-4",children:[v.jsx("p",{children:"No active subscriptions."}),v.jsxs("p",{className:"text-xs mt-2",children:["Manage subscriptions via ",v.jsx("code",{className:"text-blue-400",children:"!subscribe"})," on mesh. Broadcasts arrive with one of three prefixes โ€” ",v.jsx("strong",{children:"New:"})," (first sight), ",v.jsx("strong",{children:"Update:"})," (material change), or ",v.jsx("strong",{children:"Active:"})," (clock-driven reminder while the event is still live). See ",v.jsx("a",{href:"/reference#broadcast-types",className:"text-blue-400 hover:underline",children:"Broadcast Types"})," and ",v.jsx("a",{href:"/reference#reminders",className:"text-blue-400 hover:underline",children:"Reminder System"})," in Reference."]})]})]})]})}const Hy=[{value:"routine",label:"Routine",description:"Informational, no time pressure (ducting, new node, weather advisory, battery declining)"},{value:"priority",label:"Priority",description:"Needs attention soon (severe weather, fire nearby, node offline, HF blackout)"},{value:"immediate",label:"Immediate",description:"Act now, drop everything (fire at infrastructure, extreme weather, region blackout)"}],L3=[{id:"mesh_health",name:"Mesh Health Monitoring",description:"Infrastructure problems - offline nodes, low battery, channel congestion",rule:{name:"Mesh Health Monitoring",enabled:!0,trigger_type:"condition",categories:["infra_offline","critical_node_down","infra_recovery","battery_warning","battery_critical","battery_emergency","high_utilization","packet_flood","mesh_score_low"],min_severity:"routine",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:30,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"weather_fire",name:"Weather & Fire Alerts",description:"Environmental threats - severe weather, nearby wildfires, new ignitions, flooding",rule:{name:"Weather & Fire Alerts",enabled:!0,trigger_type:"condition",categories:["weather_warning","fire_proximity","new_ignition","stream_flood_warning"],min_severity:"priority",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:15,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"rf_conditions",name:"RF Conditions",description:"Propagation changes - solar events, HF blackouts, tropospheric ducting",rule:{name:"RF Conditions",enabled:!0,trigger_type:"condition",categories:["hf_blackout","tropospheric_ducting","geomagnetic_storm"],min_severity:"routine",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:60,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"road_traffic",name:"Road & Traffic",description:"Road closures and severe congestion",rule:{name:"Road & Traffic",enabled:!0,trigger_type:"condition",categories:["road_closure","traffic_congestion"],min_severity:"routine",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:30,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"everything_critical",name:"Everything Critical",description:"All emergency-level events regardless of type",rule:{name:"Everything Critical",enabled:!0,trigger_type:"condition",categories:[],min_severity:"immediate",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:5,schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"",custom_message:"",node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}},{id:"morning_briefing",name:"Morning Briefing",description:"Daily health and conditions summary at 7am",rule:{name:"Morning Briefing",enabled:!0,trigger_type:"schedule",categories:[],min_severity:"routine",schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"",schedule_days:[],message_type:"mesh_health_summary",custom_message:"",delivery_type:"mesh_broadcast",broadcast_channel:0,cooldown_minutes:0,node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{}}}];function uy(e){if(!e)return"Never";const r=Date.now()/1e3-e;return r<60?"Just now":r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:r<604800?`${Math.floor(r/86400)}d ago`:new Date(e*1e3).toLocaleDateString()}function Ai({info:e}){const[t,r]=G.useState(!1);return v.jsxs("div",{className:"relative inline-block",children:[v.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&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>r(!1)}),v.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 xs({label:e,value:t,onChange:r,type:n="text",placeholder:i="",helper:a="",info:o=""}){const[s,l]=G.useState(!1),u=n==="password";return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,o&&v.jsx(Ai,{info:o})]}),v.jsxs("div",{className:"relative",children:[v.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&&v.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?v.jsx(cB,{size:16}):v.jsx(jM,{size:16})})]}),a&&v.jsx("p",{className:"text-xs text-slate-600",children:a})]})}function Mp({label:e,value:t,onChange:r,min:n,max:i,step:a=1,helper:o="",info:s=""}){return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,s&&v.jsx(Ai,{info:s})]}),v.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&&v.jsx("p",{className:"text-xs text-slate-600",children:o})]})}function Lx({label:e,checked:t,onChange:r,helper:n="",info:i=""}){return v.jsxs("div",{className:"flex items-center justify-between py-2",children:[v.jsxs("div",{children:[v.jsxs("span",{className:"flex items-center text-sm text-slate-300",children:[e,i&&v.jsx(Ai,{info:i})]}),n&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]}),v.jsx("button",{type:"button",onClick:()=>r(!t),className:`relative w-11 h-6 rounded-full transition-colors ${t?"bg-accent":"bg-[#1e2a3a]"}`,children:v.jsx("span",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${t?"translate-x-5":""}`})})]})}function Mv({label:e,value:t,onChange:r,helper:n="",info:i=""}){return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&v.jsx(Ai,{info:i})]}),v.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&&v.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function Uy({label:e,value:t,onChange:r,placeholder:n="Add item...",helper:i="",info:a=""}){const[o,s]=G.useState(""),l=()=>{o.trim()&&!t.includes(o.trim())&&(r([...t,o.trim()]),s(""))},u=c=>{r(t.filter((h,f)=>f!==c))};return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&v.jsx(Ai,{info:a})]}),v.jsxs("div",{className:"flex gap-2",children:[v.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}),v.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:v.jsx(af,{size:16})})]}),t.length>0&&v.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:t.map((c,h)=>v.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-[#1e2a3a] rounded text-sm text-slate-300",children:[c,v.jsx("button",{type:"button",onClick:()=>u(h),className:"text-slate-500 hover:text-red-400",children:v.jsx(ca,{size:14})})]},h))}),i&&v.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function eU({value:e,onChange:t}){const[r,n]=G.useState(!1),i=Hy.find(a=>a.value===e)||Hy[0];return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Severity Threshold",v.jsx(Ai,{info:"Only alerts at or above this severity trigger this rule. ROUTINE = informational, PRIORITY = needs attention, IMMEDIATE = act now."})]}),v.jsxs("div",{className:"relative",children:[v.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:[v.jsxs("div",{children:[v.jsx("span",{className:"text-slate-200",children:i.label}),v.jsxs("span",{className:"text-slate-500 ml-2",children:["- ",i.description]})]}),v.jsx(ll,{size:16,className:`text-slate-500 transition-transform ${r?"rotate-180":""}`})]}),r&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>n(!1)}),v.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:Hy.map(a=>v.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:[v.jsx("div",{className:"font-medium text-slate-200",children:a.label}),v.jsx("div",{className:"text-xs text-slate-500",children:a.description})]},a.value))})]})]}),v.jsx("p",{className:"text-xs text-slate-600",children:'Lower = more notifications. "Warning" recommended for most rules.'})]})}function cy({rule:e}){const[t,r]=G.useState(!1),[n,i]=G.useState(null),a=async()=>{r(!0),i(null);try{let s={type:e.delivery_type};e.delivery_type==="mesh_broadcast"?s.channel_index=e.broadcast_channel:e.delivery_type==="mesh_dm"?s.node_ids=e.node_ids:e.delivery_type==="email"?s={type:"email",smtp_host:e.smtp_host,smtp_port:e.smtp_port,smtp_user:e.smtp_user,smtp_password:e.smtp_password,smtp_tls:e.smtp_tls,from_address:e.from_address,recipients:e.recipients}:e.delivery_type==="webhook"&&(s={type:"webhook",url:e.webhook_url,headers:e.webhook_headers});const u=await(await fetch("/api/notifications/channels/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})).json();i(u)}catch(s){i({success:!1,message:"Test failed",error:s instanceof Error?s.message:"Unknown error",details:{}})}finally{r(!1)}};if(!e.delivery_type)return null;const o={mesh_broadcast:v.jsx(Di,{size:14}),mesh_dm:v.jsx(OM,{size:14}),email:v.jsx(Y$,{size:14}),webhook:v.jsx(Z$,{size:14})}[e.delivery_type]||v.jsx(t_,{size:14});return v.jsxs("div",{className:"space-y-2",children:[v.jsx("button",{type:"button",onClick:a,disabled:t,className:"flex items-center gap-2 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 rounded text-sm disabled:opacity-50",children:t?v.jsxs(v.Fragment,{children:[v.jsx($v,{size:14,className:"animate-spin"}),"Testing..."]}):v.jsxs(v.Fragment,{children:[o,"Test Channel"]})}),n&&v.jsx("div",{className:`p-2 rounded text-xs ${n.success?"bg-green-500/10 border border-green-500/30 text-green-400":"bg-red-500/10 border border-red-500/30 text-red-400"}`,children:v.jsxs("div",{className:"flex items-start gap-2",children:[n.success?v.jsx(Za,{size:14,className:"mt-0.5 flex-shrink-0"}):v.jsx(ca,{size:14,className:"mt-0.5 flex-shrink-0"}),v.jsxs("div",{children:[v.jsx("div",{className:"font-medium",children:n.message}),n.error&&v.jsx("div",{className:"mt-1 text-red-300",children:n.error})]})]})})]})}function _xe({rule:e,ruleIndex:t,categories:r,regions:n,onChange:i,onDelete:a,onDuplicate:o,onTest:s}){var O,R,F,H,W;const[l,u]=G.useState(!e.name),[c,h]=G.useState(!1),[f,d]=G.useState(null),[g,m]=G.useState(null);G.useEffect(()=>{var V;e.name&&t>=0&&(fetch(`/api/notifications/rules/${t}/stats`).then(z=>z.json()).then(z=>d(z)).catch(()=>{}),(V=e.categories)!=null&&V.length&&fetch("/api/notifications/rules/sources",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({categories:e.categories})}).then(z=>z.json()).then(z=>m(z)).catch(()=>{}))},[e.name,t,e.categories]);const y=[{value:"",label:"(None)",description:"Rule matches but does not deliver"},{value:"mesh_broadcast",label:"Mesh Broadcast",description:"Send to a mesh radio channel"},{value:"mesh_dm",label:"Mesh DM",description:"Direct message to specific nodes"},{value:"email",label:"Email",description:"Send via SMTP"},{value:"webhook",label:"Webhook",description:"POST to any URL"}],x=[{value:"daily",label:"Daily"},{value:"twice_daily",label:"Twice Daily"},{value:"weekly",label:"Weekly"}],_=[{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"}],w=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],S=V=>{const z=e.categories||[];z.includes(V)?i({...e,categories:z.filter(Z=>Z!==V)}):i({...e,categories:[...z,V]})},T=(V,z)=>{const Z=e.categories||[];if(z==="add"){const U=Array.from(new Set([...Z,...V]));i({...e,categories:U})}else{const U=new Set(V);i({...e,categories:Z.filter($=>!U.has($))})}},M=V=>{const z=e.region_scope||[];z.includes(V)?i({...e,region_scope:z.filter(Z=>Z!==V)}):i({...e,region_scope:[...z,V]})},A=V=>{const z=e.schedule_days||[];z.includes(V)?i({...e,schedule_days:z.filter(Z=>Z!==V)}):i({...e,schedule_days:[...z,V]})},P=async()=>{h(!0),await s(),h(!1)},I=()=>{if(e.trigger_type==="schedule")return"[Scheduled report preview would appear here]";const V=e.categories||[];if(V.length===0&&r.length>0)return r[0].example_message||"Alert notification";const z=r.find(Z=>V.includes(Z.id));return(z==null?void 0:z.example_message)||"Alert notification"},N=()=>{var z,Z,U,$,Y,te,ie,se;const V=[];if(e.trigger_type==="schedule"){const le=((z=x.find(me=>me.value===e.schedule_frequency))==null?void 0:z.label)||e.schedule_frequency,Ee=((Z=_.find(me=>me.value===e.message_type))==null?void 0:Z.label)||e.message_type;V.push(`${le} at ${e.schedule_time||"??:??"}`),V.push(Ee)}else{const le=((U=e.categories)==null?void 0:U.length)||0,Ee=le===0?"All":r.filter(ye=>{var Me;return(Me=e.categories)==null?void 0:Me.includes(ye.id)}).map(ye=>ye.name).slice(0,2).join(", ")+(le>2?` +${le-2}`:""),me=(($=Hy.find(ye=>ye.value===e.min_severity))==null?void 0:$.label)||e.min_severity;V.push(`${Ee} at ${me}+`)}if(!e.delivery_type)V.push("No delivery");else{const le=((Y=y.find(me=>me.value===e.delivery_type))==null?void 0:Y.label)||e.delivery_type;let Ee="";if(e.delivery_type==="mesh_broadcast")Ee=`Ch ${e.broadcast_channel}`;else if(e.delivery_type==="mesh_dm")Ee=`${((te=e.node_ids)==null?void 0:te.length)||0} nodes`;else if(e.delivery_type==="email")Ee=(ie=e.recipients)!=null&&ie.length?e.recipients[0]+(e.recipients.length>1?` +${e.recipients.length-1}`:""):"no recipients";else if(e.delivery_type==="webhook")try{Ee=new URL(e.webhook_url).hostname}catch{Ee=((se=e.webhook_url)==null?void 0:se.slice(0,20))||"no URL"}V.push(`${le}${Ee?` (${Ee})`:""}`)}return V.join(" -> ")},D=()=>{var z;if(!g||!((z=e.categories)!=null&&z.length))return null;const V=new Map;for(const[,Z]of Object.entries(g)){const U=V.get(Z.source);U?(U.events+=Z.active_events,U.enabled=U.enabled&&Z.enabled):V.set(Z.source,{enabled:Z.enabled,events:Z.active_events})}return Array.from(V.entries()).map(([Z,{enabled:U,events:$}])=>v.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs ${U?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"}`,title:U?`${$} active`:"Not enabled",children:[U?v.jsx(t_,{size:10}):v.jsx(mB,{size:10}),Z.toUpperCase(),U&&$>0&&` (${$})`]},Z))};return v.jsxs("div",{className:`border rounded-lg overflow-hidden ${e.enabled?"border-[#1e2a3a]":"border-slate-700 opacity-60"}`,children:[v.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>u(!l),children:[v.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[l?v.jsx(ll,{size:16,className:"text-slate-500 flex-shrink-0"}):v.jsx(Js,{size:16,className:"text-slate-500 flex-shrink-0"}),v.jsx("button",{onClick:V=>{V.stopPropagation(),i({...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"?v.jsx(Iu,{size:14,className:"text-blue-400 flex-shrink-0"}):v.jsx(Dh,{size:14,className:"text-yellow-400 flex-shrink-0"}),v.jsx("span",{className:"font-medium text-slate-200 truncate",title:e.name||void 0,children:e.name||"New Rule"}),!l&&v.jsx("span",{className:`text-xs truncate hidden sm:block ${e.delivery_type?"text-slate-500":"text-amber-400"}`,children:N()})]}),v.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[!l&&(()=>{const V="hidden sm:inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs mr-2";if(!e.enabled)return v.jsx("span",{className:`${V} bg-slate-800 text-slate-500`,children:"Disabled"});if(!f)return null;const z=f.fire_count||0,Z=f.last_fired,U=Date.now()/1e3-7*86400;return z>0&&Z&&Z>=U?v.jsx("span",{className:`${V} bg-green-500/10 text-green-400`,title:`Last fired ${uy(Z)}`,children:"Active"}):z>0&&Z?v.jsx("span",{className:`${V} bg-yellow-500/10 text-yellow-400`,title:`Last fired ${uy(Z)}`,children:"Idle (no recent activity)"}):v.jsx("span",{className:`${V} bg-slate-800 text-slate-400`,children:"No activity yet"})})(),!l&&v.jsx("div",{className:"hidden md:flex items-center gap-1 mr-2",children:D()}),v.jsx("button",{onClick:V=>{V.stopPropagation(),P()},disabled:c||!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:v.jsx(_C,{size:14})}),v.jsx("button",{onClick:V=>{V.stopPropagation(),o()},className:"p-1.5 text-slate-400 hover:text-slate-200 hover:bg-slate-500/10 rounded",title:"Duplicate",children:v.jsx(H$,{size:14})}),v.jsx("button",{onClick:V=>{V.stopPropagation(),a()},className:"p-1.5 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",title:"Delete",children:v.jsx(Ep,{size:14})})]})]}),!l&&e.name&&v.jsxs("div",{className:"px-3 pb-2 pt-0 bg-[#0a0e17] flex items-center gap-2 flex-wrap text-xs",children:[!e.delivery_type&&v.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 bg-amber-500/10 text-amber-400 rounded",children:[v.jsx(Vo,{size:10}),"No delivery method"]}),(f==null?void 0:f.fire_count)!==void 0&&f.fire_count>0&&v.jsxs("span",{className:"text-slate-500",children:["Fired ",f.fire_count,"x"]})]}),l&&v.jsxs("div",{className:"p-4 space-y-6 border-t border-[#1e2a3a]",children:[v.jsx(xs,{label:"Rule Name",value:e.name,onChange:V=>i({...e,name:V}),placeholder:"e.g., Emergency Broadcast, Daily Health Report",helper:"A descriptive name for this rule"}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Trigger Type"}),v.jsxs("div",{className:"flex gap-2",children:[v.jsxs("button",{type:"button",onClick:()=>i({...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:[v.jsx(Dh,{size:16}),v.jsx("span",{children:"Condition"})]}),v.jsxs("button",{type:"button",onClick:()=>i({...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:[v.jsx(Iu,{size:16}),v.jsx("span",{children:"Schedule"})]})]}),v.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"&&v.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[v.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[v.jsx($a,{size:14}),"WHEN (Condition)"]}),v.jsx(eU,{value:e.min_severity,onChange:V=>i({...e,min_severity:V})}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Alert Categories",v.jsx(Ai,{info:"Select which types of alerts trigger this rule. Leave all unchecked to match ALL categories. Categories are grouped by family โ€” use the 'All' / 'Clear' buttons in each header to bulk-toggle."})]}),v.jsx("div",{className:"text-xs text-slate-500 mb-2",children:(((O=e.categories)==null?void 0:O.length)||0)===0?"All categories (none selected)":`${(R=e.categories)==null?void 0:R.length} selected`}),v.jsx(bxe,{categories:r,selected:e.categories||[],onToggle:S,onSelectMany:T})]}),g&&Object.keys(g).length>0&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Data Sources"}),v.jsx("div",{className:"flex flex-wrap gap-2",children:D()})]})]}),e.trigger_type==="schedule"&&v.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[v.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[v.jsx(B$,{size:14}),"WHEN (Schedule)"]}),v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Frequency"}),v.jsx("select",{value:e.schedule_frequency||"daily",onChange:V=>i({...e,schedule_frequency:V.target.value}),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:x.map(V=>v.jsx("option",{value:V.value,children:V.label},V.value))})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Mv,{label:"Time",value:e.schedule_time||"07:00",onChange:V=>i({...e,schedule_time:V})}),e.schedule_frequency==="twice_daily"&&v.jsx(Mv,{label:"Second Time",value:e.schedule_time_2||"19:00",onChange:V=>i({...e,schedule_time_2:V})})]}),e.schedule_frequency==="weekly"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Days"}),v.jsx("div",{className:"flex flex-wrap gap-2",children:w.map(V=>{var z;return v.jsx("button",{type:"button",onClick:()=>A(V),className:`px-3 py-1.5 rounded text-sm capitalize transition-colors ${(z=e.schedule_days)!=null&&z.includes(V)?"bg-accent text-white":"bg-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,children:V.slice(0,3)},V)})})]}),v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Report Type"}),v.jsx("select",{value:e.message_type||"mesh_health_summary",onChange:V=>i({...e,message_type:V.target.value}),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:_.map(V=>v.jsx("option",{value:V.value,children:V.label},V.value))}),v.jsx("p",{className:"text-xs text-slate-600",children:(F=_.find(V=>V.value===e.message_type))==null?void 0:F.description})]}),e.message_type==="custom"&&v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Custom Message",v.jsx(Ai,{info:"Available tokens: {MESH_SCORE}, {NODE_COUNT}, {NODES_ONLINE}, {ACTIVE_ALERTS}, {KP}, {SFI}, {DATE}, {TIME}"})]}),v.jsx("textarea",{value:e.custom_message||"",onChange:V=>i({...e,custom_message:V.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"})]})]}),v.jsxs("div",{className:"space-y-2 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[v.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[v.jsx(nf,{size:14}),"REGIONS",v.jsx(Ai,{info:"Limit this rule to alerts from specific regions. Empty selection = all regions (backward compatible). Region names come from /api/regions."})]}),v.jsx("div",{className:"text-xs text-slate-500",children:(((H=e.region_scope)==null?void 0:H.length)||0)===0?"All regions (none selected)":`${e.region_scope.length} of ${n.length} selected`}),n.length===0?v.jsx("div",{className:"text-xs text-slate-600 italic",children:"No regions configured."}):v.jsx("div",{className:"flex flex-wrap gap-2",children:n.map(V=>{const z=(e.region_scope||[]).includes(V.name);return v.jsx("button",{type:"button",onClick:()=>M(V.name),className:`px-3 py-1.5 rounded text-sm transition-colors ${z?"bg-accent text-white":"bg-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,title:V.local_name||V.name,children:V.local_name||V.name},V.name)})})]}),v.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[v.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[v.jsx(_C,{size:14}),"SEND VIA"]}),v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Delivery Method",v.jsx(Ai,{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."})]}),v.jsx("select",{value:e.delivery_type||"",onChange:V=>i({...e,delivery_type:V.target.value}),className:"w-full px-3 py-2 bg-[#0a0e17] border border-[#1e2a3a] rounded text-sm text-slate-200 focus:outline-none focus:border-accent",children:y.map(V=>v.jsx("option",{value:V.value,children:V.label},V.value))}),v.jsx("p",{className:"text-xs text-slate-600",children:(W=y.find(V=>V.value===(e.delivery_type||"")))==null?void 0:W.description})]}),!e.delivery_type&&v.jsxs("div",{className:"flex items-start gap-2 p-3 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:[v.jsx(Vo,{size:16,className:"text-amber-400 mt-0.5 flex-shrink-0"}),v.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"&&v.jsxs(v.Fragment,{children:[v.jsx(LL,{label:"Broadcast Channel",value:e.broadcast_channel??0,onChange:V=>i({...e,broadcast_channel:V}),helper:"Select the mesh radio channel",mode:"single"}),v.jsx(cy,{rule:e})]}),e.delivery_type==="mesh_dm"&&v.jsxs(v.Fragment,{children:[v.jsx(kL,{label:"Recipient Nodes",value:e.node_ids||[],onChange:V=>i({...e,node_ids:V}),helper:"Nodes that receive direct messages",valueType:"node_id_hex"}),v.jsx(cy,{rule:e})]}),e.delivery_type==="email"&&v.jsxs("div",{className:"space-y-4",children:[v.jsx(Uy,{label:"Recipients",value:e.recipients||[],onChange:V=>i({...e,recipients:V}),placeholder:"email@example.com",helper:"Email addresses to receive alerts"}),v.jsxs("details",{className:"group",children:[v.jsxs("summary",{className:"flex items-center gap-2 cursor-pointer text-sm text-slate-400 hover:text-slate-200",children:[v.jsx(Js,{size:14,className:"group-open:rotate-90 transition-transform"}),"SMTP Configuration"]}),v.jsxs("div",{className:"mt-4 space-y-4 pl-6 border-l border-[#1e2a3a]",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(xs,{label:"SMTP Host",value:e.smtp_host||"",onChange:V=>i({...e,smtp_host:V}),placeholder:"smtp.gmail.com"}),v.jsx(Mp,{label:"SMTP Port",value:e.smtp_port??587,onChange:V=>i({...e,smtp_port:V}),min:1,max:65535})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(xs,{label:"Username",value:e.smtp_user||"",onChange:V=>i({...e,smtp_user:V})}),v.jsx(xs,{label:"Password",value:e.smtp_password||"",onChange:V=>i({...e,smtp_password:V}),type:"password",info:"Gmail users: use an App Password from myaccount.google.com/apppasswords"})]}),v.jsx(Lx,{label:"Use TLS",checked:e.smtp_tls??!0,onChange:V=>i({...e,smtp_tls:V})}),v.jsx(xs,{label:"From Address",value:e.from_address||"",onChange:V=>i({...e,from_address:V}),placeholder:"alerts@yourdomain.com"})]})]}),v.jsx(cy,{rule:e})]}),e.delivery_type==="webhook"&&v.jsxs(v.Fragment,{children:[v.jsx(xs,{label:"Webhook URL",value:e.webhook_url||"",onChange:V=>i({...e,webhook_url:V}),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."}),v.jsx(cy,{rule:e})]})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsx(Mp,{label:"Cooldown (minutes)",value:e.cooldown_minutes??10,onChange:V=>i({...e,cooldown_minutes:V}),min:0,helper:"Min time between repeat sends",info:"Prevents alert spam. Same condition won't re-trigger this rule within this window."})," "]}),f&&v.jsxs("div",{className:"flex items-center gap-4 text-xs text-slate-500",children:[v.jsxs("span",{children:["Last fired: ",uy(f.last_fired)]}),v.jsxs("span",{children:["Last tested: ",uy(f.last_test)]}),v.jsxs("span",{children:["Total fires: ",f.fire_count]})]}),e.trigger_type!=="schedule"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Example Message"}),v.jsx("div",{className:"p-3 bg-[#1e2a3a]/50 rounded-lg border border-[#1e2a3a]",children:v.jsx("p",{className:"text-sm text-slate-300 font-mono",children:I()})}),v.jsx("p",{className:"text-xs text-slate-600",children:"This is an example of what this rule would send."})]})]})]})}const Zy=[{key:"mesh_health",label:"Mesh Health",Icon:rf},{key:"weather",label:"Weather",Icon:Du},{key:"fire",label:"Fire",Icon:Xx},{key:"rf_propagation",label:"RF Propagation",Icon:Di},{key:"roads",label:"Roads",Icon:$x},{key:"avalanche",label:"Avalanche",Icon:J$},{key:"seismic",label:"Seismic",Icon:Kx},{key:"tracking",label:"Tracking",Icon:nf}];function bxe({categories:e,selected:t,onToggle:r,onSelectMany:n}){const i=new Set(Zy.map(f=>f.key)),a=new Map;Zy.forEach(f=>a.set(f.key,[]));const o=[];for(const f of e){const d=f.toggle;d&&i.has(d)?a.get(d).push(f):o.push(f)}const s=new Set;for(const[f,d]of a)d.some(g=>t.includes(g.id))&&s.add(f);o.some(f=>t.includes(f.id))&&s.add("other");const[l,u]=G.useState(s),c=f=>{u(d=>{const g=new Set(d);return g.has(f)?g.delete(f):g.add(f),g})},h=(f,d,g,m)=>{if(!m.length)return null;const y=l.has(f),x=m.map(w=>w.id),_=x.filter(w=>t.includes(w)).length;return v.jsxs("div",{className:"border border-[#1e2a3a] rounded",children:[v.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 bg-[#0d1420]",children:[v.jsxs("button",{type:"button",onClick:()=>c(f),className:"flex items-center gap-2 text-sm text-slate-200 flex-1 min-w-0",children:[y?v.jsx(ll,{size:14,className:"text-slate-500 flex-shrink-0"}):v.jsx(Js,{size:14,className:"text-slate-500 flex-shrink-0"}),g&&v.jsx(g,{size:14,className:"text-slate-400 flex-shrink-0"}),v.jsxs("span",{className:"truncate",children:[d," (",m.length,")"]}),_>0&&v.jsxs("span",{className:"ml-1 text-xs text-accent",children:[_," selected"]})]}),v.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[v.jsx("button",{type:"button",onClick:w=>{w.stopPropagation(),n(x,"add")},className:"text-xs px-2 py-0.5 rounded text-slate-400 hover:text-accent hover:bg-accent/10",title:"Select all in family",children:"All"}),v.jsx("button",{type:"button",onClick:w=>{w.stopPropagation(),n(x,"remove")},className:"text-xs px-2 py-0.5 rounded text-slate-400 hover:text-red-400 hover:bg-red-500/10",title:"Clear family",children:"Clear"})]})]}),y&&v.jsx("div",{className:"p-1 space-y-1",children:m.map(w=>v.jsxs("label",{onClick:()=>r(w.id),className:"flex items-start gap-2 p-2 rounded hover:bg-[#1e2a3a]/50 cursor-pointer",children:[v.jsx("div",{className:`w-4 h-4 mt-0.5 rounded border flex items-center justify-center flex-shrink-0 ${t.includes(w.id)?"bg-accent border-accent":"border-slate-600"}`,children:t.includes(w.id)&&v.jsx(Za,{size:12,className:"text-white"})}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("div",{className:"text-sm text-slate-200",children:w.name}),v.jsx("div",{className:"text-xs text-slate-500",children:w.description})]})]},w.id))})]},f)};return v.jsxs("div",{className:"max-h-96 overflow-y-auto border border-[#1e2a3a] rounded-lg p-2 space-y-2",children:[Zy.map(f=>h(f.key,f.label,f.Icon,a.get(f.key)||[])),h("other","Other",null,o)]})}const N3=["digest","mesh_broadcast","mesh_dm","email","webhook"],wxe=["routine","priority","immediate"];function Sxe({toggles:e,onChange:t}){const[r,n]=G.useState(null),i=(a,o)=>t({...e,[a]:{...e[a]||{},name:a,...o}});return v.jsxs("div",{className:"space-y-3 mb-8",children:[v.jsxs("div",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Master Toggles",v.jsx(Ai,{info:"Per-family notification policy: enable a family, set its severity threshold, choose which channels fire at each severity, and scope to regions (PagerDuty/Grafana-style)."})]}),v.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Zy.map(({key:a,label:o,Icon:s})=>{const l=e[a]||{},u=r===a,c=Object.values(l.severity_channels||{}).reduce((f,d)=>f+((d==null?void 0:d.length)||0),0),h=(l.regions||[]).length;return v.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("button",{type:"button",onClick:()=>n(u?null:a),className:"flex items-center gap-2 text-sm text-slate-200",children:[v.jsx(s,{size:15})," ",o,u?v.jsx(ll,{size:14}):v.jsx(Js,{size:14})]}),v.jsx(Lx,{label:"",checked:!!l.enabled,onChange:f=>i(a,{enabled:f})})]}),!u&&v.jsx("div",{className:"text-xs text-slate-600 mt-1",children:l.enabled?`${h||"all"} region${h===1?"":"s"}, ${c} channel${c===1?"":"s"} at ${l.min_severity||"priority"}+`:"OFF"}),u&&v.jsxs("div",{className:`mt-3 space-y-3 ${l.enabled?"":"opacity-40 pointer-events-none select-none"}`,children:[v.jsx(eU,{value:l.min_severity||"priority",onChange:f=>i(a,{min_severity:f})}),v.jsx("div",{className:"text-xs text-slate-500",children:"Severity โ†’ channels"}),v.jsxs("table",{className:"text-xs w-full",children:[v.jsx("thead",{children:v.jsxs("tr",{children:[v.jsx("th",{}),N3.map(f=>v.jsx("th",{className:"text-slate-500 font-normal px-1",children:f.replace("_"," ")},f))]})}),v.jsx("tbody",{children:wxe.map(f=>v.jsxs("tr",{children:[v.jsx("td",{className:"text-slate-400 pr-2",children:f}),N3.map(d=>{var m;const g=(((m=l.severity_channels)==null?void 0:m[f])||[]).includes(d);return v.jsx("td",{className:"text-center",children:v.jsx("input",{type:"checkbox",checked:g,onChange:y=>{const x={...l.severity_channels||{}},_=new Set(x[f]||[]);y.target.checked?_.add(d):_.delete(d),x[f]=Array.from(_),i(a,{severity_channels:x})}})},d)})]},f))})]}),v.jsx(Uy,{label:"Regions (empty = all)",value:l.regions||[],onChange:f=>i(a,{regions:f}),placeholder:"Add region..."})," ",v.jsx("div",{className:"text-xs text-slate-500 pt-1",children:"Channel config"}),v.jsx(Mp,{label:"Broadcast channel",value:l.broadcast_channel??0,onChange:f=>i(a,{broadcast_channel:f})}),v.jsx(Uy,{label:"DM node IDs",value:l.node_ids||[],onChange:f=>i(a,{node_ids:f}),placeholder:"!nodeid"}),v.jsx(Uy,{label:"Email recipients",value:l.recipients||[],onChange:f=>i(a,{recipients:f}),placeholder:"ops@example.com"}),v.jsx(xs,{label:"SMTP host",value:l.smtp_host||"",onChange:f=>i(a,{smtp_host:f}),placeholder:"smtp.example.com"}),v.jsx(Mp,{label:"SMTP port",value:l.smtp_port??587,onChange:f=>i(a,{smtp_port:f})}),v.jsx(xs,{label:"Webhook URL",value:l.webhook_url||"",onChange:f=>i(a,{webhook_url:f}),placeholder:"https://..."})]})]},a)})})]})}function Cxe(){var z,Z,U;const[e,t]=G.useState(null),[r,n]=G.useState(null),[i,a]=G.useState([]),[o,s]=G.useState([]),[l,u]=G.useState(!0),[c,h]=G.useState(!1),[f,d]=G.useState(null),[g,m]=G.useState(null),[y,x]=G.useState(null),[_,w]=G.useState({open:!1,ruleIndex:-1,loading:!1,action:""}),[S,T]=G.useState(!1),[M,A]=G.useState(!1),P=G.useCallback(async()=>{try{const[$,Y,te]=await Promise.all([fetch("/api/config/notifications"),fetch("/api/notifications/categories"),fetch("/api/regions")]);if(!$.ok)throw new Error("Failed to fetch notifications config");const ie=await $.json(),se=await Y.json(),le=te.ok?await te.json():[];t(ie),n(JSON.parse(JSON.stringify(ie))),a(se),s(Array.isArray(le)?le:[]),A(!1),d(null)}catch($){d($ instanceof Error?$.message:"Unknown error")}finally{u(!1)}},[]);G.useEffect(()=>{document.title="Notifications - MeshAI",P()},[P]),G.useEffect(()=>{e&&r&&A(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);const I=async()=>{if(e){h(!0),d(null),m(null);try{const $=await fetch("/api/config/notifications",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Y=await $.json();if(!$.ok)throw new Error(Y.detail||"Save failed");m("Notifications config saved successfully"),n(JSON.parse(JSON.stringify(e))),A(!1),setTimeout(()=>m(null),3e3)}catch($){d($ instanceof Error?$.message:"Save failed")}finally{h(!1)}}},N=()=>{r&&(t(JSON.parse(JSON.stringify(r))),A(!1))},D=()=>({name:"",enabled:!0,trigger_type:"condition",categories:[],min_severity:"routine",schedule_frequency:"daily",schedule_time:"07:00",schedule_time_2:"19:00",schedule_days:["monday"],message_type:"mesh_health_summary",custom_message:"",delivery_type:"",broadcast_channel:0,node_ids:[],smtp_host:"",smtp_port:587,smtp_user:"",smtp_password:"",smtp_tls:!0,from_address:"",recipients:[],webhook_url:"",webhook_headers:{},cooldown_minutes:10,region_scope:[]}),O=()=>{e&&t({...e,rules:[...e.rules||[],D()]})},R=$=>{if(!e)return;const Y=L3.find(te=>te.id===$);Y&&(t({...e,rules:[...e.rules||[],{...D(),...Y.rule}]}),T(!1))},F=$=>{if(!e)return;const Y=e.rules[$],te={...JSON.parse(JSON.stringify(Y)),name:`${Y.name} (copy)`},ie=[...e.rules];ie.splice($+1,0,te),t({...e,rules:ie})},H=async $=>{w({open:!0,ruleIndex:$,loading:!0,action:""});try{const te=await(await fetch(`/api/notifications/rules/${$}/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"preview"})})).json();x(te),w(ie=>({...ie,loading:!1}))}catch{x({success:!1,message:"Failed to get preview"}),w(Y=>({...Y,loading:!1}))}},W=async $=>{const Y=_.ruleIndex;w(te=>({...te,loading:!0,action:$}));try{const ie=await(await fetch(`/api/notifications/rules/${Y}/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:$})})).json();x(ie),w(se=>({...se,loading:!1}))}catch{x({success:!1,message:`Failed to ${$}`}),w(te=>({...te,loading:!1}))}},V=()=>{w({open:!1,ruleIndex:-1,loading:!1,action:""}),x(null)};return l?v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-slate-400",children:"Loading notifications config..."})}):e?v.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[_.open&&v.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:v.jsxs("div",{className:"bg-[#1a2332] border border-[#2a3a4a] rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[85vh] overflow-auto",children:[v.jsxs("div",{className:"p-4 border-b border-[#2a3a4a] flex items-center justify-between sticky top-0 bg-[#1a2332]",children:[v.jsx("h3",{className:"text-lg font-semibold",children:"Test Notification Rule"}),v.jsx("button",{onClick:V,className:"text-slate-500 hover:text-slate-300",children:v.jsx(ca,{size:20})})]}),v.jsx("div",{className:"p-4 space-y-4",children:_.loading?v.jsxs("div",{className:"flex items-center justify-center py-8",children:[v.jsx($v,{size:20,className:"animate-spin text-slate-400 mr-2"}),v.jsx("div",{className:"text-slate-400",children:_.action?`${_.action.replace("_"," ").replace("send ","Sending ")}...`:"Loading current data..."})]}):y?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"space-y-2",children:[v.jsx("div",{className:"text-sm font-medium text-slate-400 uppercase tracking-wide",children:"Current Data"}),y.live_data_summary&&y.live_data_summary.length>0?v.jsx("div",{className:"p-3 bg-slate-800/50 rounded space-y-1",children:y.live_data_summary.map(($,Y)=>v.jsx("div",{className:`text-sm font-mono ${$.startsWith("[!]")?"text-amber-400":""}`,children:$},Y))}):v.jsx("div",{className:"p-3 bg-slate-800/50 rounded text-sm text-slate-500",children:"No live data available for this rule's categories"})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("div",{className:"text-sm font-medium text-slate-400 uppercase tracking-wide",children:"Rule Matching"}),v.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[y.conditions_matched&&y.conditions_matched>0?v.jsxs("span",{className:"px-2 py-1 bg-green-500/20 text-green-400 rounded text-sm",children:[y.conditions_matched," condition",y.conditions_matched!==1?"s":""," match - this rule WOULD fire"]}):v.jsx("span",{className:"px-2 py-1 bg-slate-700 text-slate-400 rounded text-sm",children:"No conditions trigger this rule right now"}),y.conditions_below_threshold&&y.conditions_below_threshold>0&&v.jsxs("span",{className:"px-2 py-1 bg-yellow-500/20 text-yellow-400 rounded text-sm",children:[y.conditions_below_threshold," below threshold"]})]}),y.conditions_below_threshold&&y.conditions_below_threshold>0&&v.jsxs("div",{className:"p-3 bg-yellow-500/10 border border-yellow-500/30 rounded text-sm space-y-2",children:[v.jsx("div",{className:"text-yellow-300",children:y.below_threshold_summary}),y.below_threshold_events&&y.below_threshold_events.length>0&&v.jsx("div",{className:"space-y-1 text-yellow-200/80",children:y.below_threshold_events.slice(0,3).map(($,Y)=>v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-yellow-500/20 rounded",children:$.severity}),v.jsx("span",{children:$.headline})]},Y))}),y.suggestion&&v.jsxs("div",{className:"text-yellow-400 text-xs mt-2",children:["Tip: ",y.suggestion]})]})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("div",{className:"text-sm font-medium text-slate-400 uppercase tracking-wide",children:y.is_example?"Example Messages":"Messages That Would Fire"}),(z=y.preview_messages)==null?void 0:z.map(($,Y)=>v.jsx("div",{className:"p-3 bg-slate-800 rounded text-sm font-mono break-words",children:$},Y))]}),y.delivered!==void 0&&y.delivery_result&&v.jsx("div",{className:`p-3 rounded text-sm ${y.delivered?"bg-green-500/10 border border-green-500/30 text-green-400":"bg-red-500/10 border border-red-500/30 text-red-400"}`,children:v.jsxs("div",{className:"flex items-start gap-2",children:[y.delivered?v.jsx(Za,{size:16,className:"mt-0.5"}):v.jsx(ca,{size:16,className:"mt-0.5"}),v.jsxs("div",{children:[v.jsx("div",{children:y.delivery_result}),y.delivery_error&&v.jsx("div",{className:"mt-1 text-red-300",children:y.delivery_error})]})]})}),y.message&&!y.preview_messages&&v.jsx("div",{className:`p-3 rounded text-sm ${y.success?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"}`,children:y.message})]}):null}),v.jsxs("div",{className:"p-4 border-t border-[#2a3a4a] flex justify-between sticky bottom-0 bg-[#1a2332]",children:[v.jsx("button",{onClick:V,className:"px-4 py-2 text-slate-400 hover:text-slate-200",children:"Close"}),y&&!y.delivered&&v.jsx("div",{className:"flex gap-2",children:y.delivery_method?v.jsxs(v.Fragment,{children:[y.live_data_summary&&y.live_data_summary.length>0&&v.jsx("button",{onClick:()=>W("send_status"),disabled:_.loading,className:"px-3 py-2 bg-slate-700 hover:bg-slate-600 rounded text-sm disabled:opacity-50",title:"Send current conditions summary",children:"Send Current Conditions"}),v.jsx("button",{onClick:()=>W("send_test"),disabled:_.loading,className:"px-3 py-2 bg-slate-700 hover:bg-slate-600 rounded text-sm disabled:opacity-50",title:"Send example alert message",children:"Send Example Alert"}),y.can_send_live&&v.jsx("button",{onClick:()=>W("send_live"),disabled:_.loading,className:"px-3 py-2 bg-accent hover:bg-accent/80 rounded text-sm disabled:opacity-50",title:"Send actual live alert",children:"Send Live Alert"})]}):v.jsx("span",{className:"px-3 py-2 text-amber-400 text-sm",children:"Configure a delivery method to send test messages"})})]})]})}),v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("div",{children:v.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."})}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("button",{onClick:P,className:"p-2 text-slate-400 hover:text-slate-200 hover:bg-bg-hover rounded transition-colors",title:"Refresh",children:v.jsx($v,{size:18})}),v.jsxs("button",{onClick:N,disabled:!M,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:[v.jsx(Jx,{size:16}),"Discard"]}),v.jsxs("button",{onClick:I,disabled:c||!M,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:[v.jsx(zM,{size:16}),c?"Saving...":"Save"]})]})]}),f&&v.jsx("div",{className:"p-3 rounded-lg text-sm bg-red-500/10 text-red-400 border border-red-500/20",children:f}),g&&v.jsxs("div",{className:"p-3 rounded-lg text-sm bg-green-500/10 text-green-400 border border-green-500/20",children:[v.jsx(Za,{size:14,className:"inline mr-2"}),g]}),v.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6 space-y-6",children:[v.jsx(Lx,{label:"Enable Notifications",checked:e.enabled,onChange:$=>t({...e,enabled:$}),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&&v.jsxs(v.Fragment,{children:[" ",v.jsxs("div",{className:"space-y-3 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[v.jsx("div",{className:"flex items-center gap-2",children:v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Cold-start grace"})}),v.jsx(Mp,{label:"Grace period (seconds)",value:e.cold_start_grace_seconds??60,onChange:$=>t({...e,cold_start_grace_seconds:$}),min:0,max:600,helper:"Suppress broadcasts for this many seconds after the first event arrives",info:"When meshai starts seeing events for the first time, suppress mesh broadcasts for this many seconds to absorb any JetStream backlog. Persistence rows still get written; only broadcasts are suppressed."})]}),v.jsxs("div",{className:"space-y-3 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[v.jsx("div",{className:"flex items-center gap-2",children:v.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Band Conditions (HF propagation)"})}),v.jsx(Lx,{label:"Enable scheduled band-conditions broadcasts",checked:e.band_conditions_enabled??!0,onChange:$=>t({...e,band_conditions_enabled:$}),helper:"3x/day HF propagation summary (Day/Night ratings per band group). The daily fire digest (twice-daily LLM summary of active fires + the last 24h of growth/spotting) is configured separately under Adapter Config -> fires.digest_*. See Reference -> Fire Tracker (Fusion) and Reference -> Broadcast Types for the New/Update/Active prefix system.",info:"Source priority: (1) recent SWPC readings persisted locally; (2) HamQSL.com fallback; (3) silent skip if both fail. Persistence rows are written either way for an audit trail."}),(e.band_conditions_enabled??!0)&&v.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[v.jsx(Mv,{label:"Slot 1",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[0]||"06:00",onChange:$=>{const Y=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];Y[0]=$,t({...e,band_conditions_schedule:Y})},helper:"Morning (default 06:00 MT)"}),v.jsx(Mv,{label:"Slot 2",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[1]||"14:00",onChange:$=>{const Y=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];Y[1]=$,t({...e,band_conditions_schedule:Y})},helper:"Afternoon (default 14:00 MT)"}),v.jsx(Mv,{label:"Slot 3",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[2]||"22:00",onChange:$=>{const Y=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];Y[2]=$,t({...e,band_conditions_schedule:Y})},helper:"Night (default 22:00 MT)"})]}),v.jsx("p",{className:"text-xs text-slate-600",children:"All times are Mountain Time (America/Boise). DST handled automatically."})]}),e.toggles&&v.jsx(Sxe,{toggles:e.toggles,onChange:$=>t({...e,toggles:$})}),v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Notification Rules",v.jsx(Ai,{info:"Each rule is self-contained: define what triggers it (condition or schedule), where to send it (mesh, email, webhook), and behavior settings."})]}),v.jsxs("span",{className:"text-xs text-slate-500",children:[((Z=e.rules)==null?void 0:Z.length)||0," rule",(((U=e.rules)==null?void 0:U.length)||0)!==1?"s":""]})]}),(e.rules||[]).map(($,Y)=>v.jsx(_xe,{rule:$,ruleIndex:Y,categories:i,regions:o,onChange:te=>{const ie=[...e.rules||[]];ie[Y]=te,t({...e,rules:ie})},onDelete:()=>{confirm(`Delete rule "${$.name||"New Rule"}"?`)&&t({...e,rules:(e.rules||[]).filter((te,ie)=>ie!==Y)})},onDuplicate:()=>F(Y),onTest:()=>H(Y)},Y)),v.jsxs("div",{className:"flex gap-2",children:[v.jsxs("button",{onClick:O,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:[v.jsx(af,{size:16})," Add Rule"]}),v.jsxs("div",{className:"relative",children:[v.jsxs("button",{onClick:()=>T(!S),className:"py-3 px-4 border border-dashed border-[#1e2a3a] rounded-lg text-slate-500 hover:text-slate-300 hover:border-accent flex items-center gap-2 transition-colors",children:[v.jsx(hB,{size:16})," Add from Template"]}),S&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>T(!1)}),v.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:[v.jsx("div",{className:"p-2 border-b border-[#2a3a4a] text-xs text-slate-500 uppercase",children:"Rule Templates"}),L3.map($=>v.jsxs("button",{onClick:()=>R($.id),className:"w-full p-3 text-left hover:bg-[#2a3a4a] transition-colors",children:[v.jsx("div",{className:"font-medium text-slate-200",children:$.name}),v.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:$.description})]},$.id))]})]})]})]})]})]})]})]}):v.jsx("div",{className:"flex items-center justify-center h-64",children:v.jsx("div",{className:"text-red-400",children:"Failed to load notifications config"})})}const P3=[{id:"stream-gauges",label:"Stream Gauges",icon:Yx},{id:"wildfire",label:"Wildfire",icon:Xx},{id:"firms",label:"Satellite Fire Detection (FIRMS)",icon:Qx},{id:"fire-tracker",label:"Fire Tracker (Fusion)",icon:U$},{id:"weather-alerts",label:"Weather Alerts",icon:G$},{id:"solar",label:"Solar & Geomagnetic",icon:pB},{id:"ducting",label:"Tropospheric Ducting",icon:Di},{id:"avalanche",label:"Avalanche Danger",icon:Kx},{id:"traffic",label:"Traffic Flow",icon:$x},{id:"roads-511",label:"Road Conditions (511)",icon:sB},{id:"mesh-health",label:"Mesh Health",icon:rf},{id:"broadcast-types",label:"Broadcast Types",icon:_C},{id:"reminders",label:"Reminder System",icon:Iu},{id:"notifications",label:"Notifications",icon:Zv},{id:"commands",label:"Commands",icon:gB},{id:"llm-dm",label:"LLM DM Queries",icon:OM},{id:"or-not-and",label:"OR-not-AND Architecture",icon:dB},{id:"adapter-config",label:"Adapter Config & CODE Rule",icon:BM},{id:"curation",label:"Curation: Gauges & Towns",icon:uB},{id:"schema",label:"Schema Migrations",icon:$$},{id:"api",label:"API Reference",icon:W$}];function $t({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 v.jsx("span",{className:`inline-block w-3 h-3 rounded-full ${t[e]}`})}function yt({headers:e,rows:t}){return v.jsx("div",{className:"overflow-x-auto my-4",children:v.jsxs("table",{className:"w-full text-sm",children:[v.jsx("thead",{children:v.jsx("tr",{className:"bg-[#1a2332] border-b border-[#2a3a4a]",children:e.map((r,n)=>v.jsx("th",{className:"px-4 py-2 text-left text-slate-400 font-medium",children:r},n))})}),v.jsx("tbody",{children:t.map((r,n)=>v.jsx("tr",{className:`border-b border-[#1e2a3a] ${n%2===0?"bg-[#0d1219]":"bg-[#0a0e17]"}`,children:r.map((i,a)=>v.jsx("td",{className:"px-4 py-2 text-slate-300",children:i},a))},n))})]})})}function Pt({href:e,children:t}){return v.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline inline-flex items-center gap-1",children:[t," ",v.jsx(Ih,{size:12})]})}function de({children:e}){return v.jsx("h3",{className:"text-lg font-semibold text-slate-200 mt-6 mb-3",children:e})}function fs({children:e}){return v.jsx("h4",{className:"text-base font-medium text-slate-300 mt-4 mb-2",children:e})}function oe({children:e}){return v.jsx("code",{className:"font-mono text-accent bg-[#1a2332] px-1 rounded",children:e})}function hr({id:e,title:t,children:r}){return v.jsxs("section",{id:e,className:"mb-12 scroll-mt-6",children:[v.jsx("h2",{className:"text-2xl font-bold text-slate-100 mb-4 pb-2 border-b border-[#2a3a4a]",children:t}),v.jsx("div",{className:"text-slate-300 leading-relaxed space-y-4",children:r})]})}function Txe(){const e=tf(),[t,r]=G.useState(""),[n,i]=G.useState("stream-gauges"),a=G.useRef(null);G.useEffect(()=>{const l=e.hash.replace("#","");if(l&&P3.find(u=>u.id===l)){i(l);const u=document.getElementById(l);u&&u.scrollIntoView({behavior:"smooth"})}},[e.hash]);const o=P3.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 v.jsxs("div",{className:"flex h-full -m-6",children:[v.jsxs("aside",{className:"w-64 flex-shrink-0 bg-bg-card border-r border-border overflow-y-auto",children:[v.jsx("div",{className:"p-4 border-b border-border",children:v.jsxs("div",{className:"relative",children:[v.jsx(e_,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),v.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"})]})}),v.jsx("nav",{className:"py-2",children:o.map(l=>{const u=l.icon,c=n===l.id;return v.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:[v.jsx(u,{size:16}),l.label]},l.id)})})]}),v.jsx("div",{ref:a,className:"flex-1 overflow-y-auto p-6",children:v.jsxs("div",{className:"max-w-4xl",children:[v.jsx("p",{className:"text-slate-400 mb-8",children:"Everything you need to understand and configure MeshAI's monitoring and alerting systems."}),v.jsxs(hr,{id:"stream-gauges",title:"Stream Gauges",children:[v.jsx(de,{children:"What You're Looking At"}),v.jsx("p",{children:"MeshAI watches river and stream levels at gauges you configure. Each gauge reports two things:"}),v.jsxs("p",{children:[v.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.`]}),v.jsxs("p",{children:[v.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:`]}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"A small creek: 50-200 CFS"}),v.jsx("li",{children:"A mid-size river: 1,000-5,000 CFS"}),v.jsx("li",{children:"A big river in spring runoff: 10,000+ CFS"})]}),v.jsx(de,{children:"When Does It Flood?"}),v.jsxs("p",{children:["Flood levels are set by the ",v.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.']}),v.jsxs("p",{children:[v.jsx("strong",{children:"Action Stage"})," โ€” water is rising, time to start paying attention. Usually still inside the riverbanks."]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Minor Flood"})," โ€” low-lying roads start getting water on them. NWS issues a Flood Advisory."]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Moderate Flood"})," โ€” water in buildings near the river. Some people need to evacuate. NWS issues a Flood Warning."]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Major Flood"})," โ€” widespread flooding. Many people evacuating. Serious property damage."]}),v.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."}),v.jsx(de,{children:"Low Water / Drought"}),v.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.`}),v.jsx(de,{children:"Setting It Up"}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:["Find your gauge at ",v.jsx(Pt,{href:"https://waterdata.usgs.gov/nwis",children:"waterdata.usgs.gov/nwis"})]}),v.jsxs("li",{children:["Copy the site number (like ",v.jsx(oe,{children:"13090500"}),")"]}),v.jsx("li",{children:"Add it in Config โ†’ Environmental โ†’ USGS"}),v.jsx("li",{children:"MeshAI auto-fills the gauge name and flood levels from NWS"})]}),v.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."}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://waterdata.usgs.gov/nwis",children:"USGS Water Data"})," โ€” find gauges near you"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://water.noaa.gov",children:"NWS Water Prediction Service"})," โ€” flood forecasts and thresholds"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.usgs.gov/special-topics/water-science-school/science/how-streamflow-measured",children:"Understanding Streamflow"})," โ€” USGS explainer"]})]})]}),v.jsxs(hr,{id:"wildfire",title:"Wildfire",children:[v.jsx(de,{children:"What You're Looking At"}),v.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."}),v.jsx(de,{children:"Fire Size โ€” How Big Is It?"}),v.jsx(yt,{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."]]}),v.jsx("p",{children:"For reference, 1,000 acres is about 1.5 square miles."}),v.jsx(de,{children:"Containment โ€” Is It Under Control?"}),v.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."}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"0-30%"})," โ€” Essentially uncontrolled. The fire goes where it wants."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"50%"})," โ€” Good progress, but half the edge can still grow."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"80%+"})," โ€” Well controlled. Major growth unlikely."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"100%"}),' โ€” The edge is fully controlled. But the fire may STILL be actively burning inside. "100% contained" does NOT mean "out."']})]}),v.jsx(de,{children:"How Far Away Should I Worry?"}),v.jsx(yt,{headers:["Distance","What To Do"],rows:[[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"red"})," Under 5 km (3 miles)"]}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Immediate threat."})," This is evacuation-order range. Embers can fly this far in wind."]})],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"orange"})," 5-15 km (3-10 miles)"]}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Prepare."})," The fire could reach you in hours under bad conditions. Have a plan."]})],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"yellow"})," 15-30 km (10-20 miles)"]}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Watch."})," Smoke is likely. Wind shifts could change things fast."]})],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"green"})," Over 30 km (20 miles)"]}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Awareness."})," Keep an eye on it, but no immediate threat."]})]]}),v.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."}),v.jsx(de,{children:"Which Matters More โ€” Size or Distance?"}),v.jsxs("p",{children:[v.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."]}),v.jsx(de,{children:"Setting It Up"}),v.jsxs("p",{children:["Just configure your state code (like ",v.jsx(oe,{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."]}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://inciweb.nwcg.gov",children:"InciWeb"})," โ€” detailed incident information"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://data-nifc.opendata.arcgis.com",children:"NIFC Fire Map"})," โ€” raw perimeter data"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.ready.gov/wildfires",children:"Ready.gov Wildfires"})," โ€” preparedness guide"]})]})]}),v.jsxs(hr,{id:"firms",title:"Satellite Fire Detection (FIRMS)",children:[v.jsx(de,{children:"What You're Looking At"}),v.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.`}),v.jsxs("p",{children:[v.jsx("strong",{children:"Why this matters"}),": satellite hotspots show up ",v.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."]}),v.jsx(de,{children:"Confidence โ€” Is It Really a Fire?"}),v.jsx("p",{children:"Each detection gets a confidence rating:"}),v.jsx(yt,{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."]]}),v.jsxs("p",{children:[v.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.`]}),v.jsx(de,{children:"FRP โ€” How Intense Is It?"}),v.jsx("p",{children:'FRP (Fire Radiative Power) measures the heat output in megawatts. Think of it as "how hot is this thing":'}),v.jsx(yt,{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"]]}),v.jsx("p",{children:"Setting the minimum FRP to 5 MW filters out most industrial and agricultural false alarms."}),v.jsx(de,{children:"New Ignition Detection"}),v.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 ",v.jsx("strong",{children:"potential new ignition"})," โ€” maybe a new fire just started. These get elevated priority regardless of confidence level."]}),v.jsx(de,{children:"Timing"}),v.jsxs("p",{children:["Satellite data arrives ",v.jsx("strong",{children:"1-3 hours"})," after the satellite passes overhead. Each location gets observed about ",v.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."`]}),v.jsx(de,{children:"Getting an API Key"}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:["Go to ",v.jsx(Pt,{href:"https://firms.modaps.eosdis.nasa.gov/api/area/",children:"FIRMS API page"})]}),v.jsx("li",{children:'Click "Get MAP_KEY"'}),v.jsx("li",{children:"Register for a free Earthdata account"}),v.jsx("li",{children:"Your key arrives by email"}),v.jsx("li",{children:"Enter it in Config โ†’ Environmental โ†’ FIRMS"})]}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://firms.modaps.eosdis.nasa.gov",children:"FIRMS Fire Map"})," โ€” see hotspots on a map"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://earthdata.nasa.gov/data/tools/firms/faq",children:"FIRMS FAQ"})," โ€” how it works"]})]})]}),v.jsxs(hr,{id:"fire-tracker",title:"Fire Tracker (Fusion)",children:[v.jsx("p",{children:"FIRMS hotspots are fast but noisy; WFIGS incidents are accurate but slow. The Fire Tracker fuses both feeds and a per-pixel attribution graph so a single fire's name, declared acreage, real-time perimeter movement, and spotting events all land as separate broadcasts on the mesh."}),v.jsx(de,{children:"What you'll see on the mesh"}),v.jsx("p",{children:"Six fire-family alert categories, in order of when they fire during an incident's lifecycle:"}),v.jsx(yt,{headers:["Category","Severity","Trigger","Example broadcast"],rows:[[v.jsx(oe,{children:"unattributed_hotspot_cluster"}),"Priority","3+ FIRMS pixels within 1 mi over 60 min, no WFIGS match โ€” possible new ignition before NIFC declares it",v.jsx("span",{className:"text-amber-300",children:"๐Ÿ”ฅ Possible new fire: 3 hotspots within 1 mi @ 42.93,-114.45 (combined 78 MW)"})],[v.jsx(oe,{children:"wildfire_declared"}),"Priority","WFIGS first-sight of a new IRWIN incident โ€” the official 'this is a fire and here is its name' record",v.jsx("span",{className:"text-amber-300",children:"๐Ÿ”ฅ New: Cache Peak Fire (WF), 3 mi N of Almo: 250 ac, 0% contained"})],[v.jsx(oe,{children:"wildfire_growth"}),"Priority","Per-pass centroid drift >= 0.5 mi (configurable) between consecutive satellite passes โ€” the fire's footprint moved",v.jsx("span",{className:"text-amber-300",children:"๐Ÿ”ฅ Cache Peak Fire moving NE 1.2 mi/h, ~3 mi from Almo"})],[v.jsx(oe,{children:"wildfire_spotting"}),"Immediate","FIRMS pixel attributed to a tracked fire but >= 1.5 mi (configurable) outside its prior-pass convex-hull perimeter โ€” ember spread",v.jsx("span",{className:"text-amber-300",children:"๐Ÿ”ฅ Possible spotting 2.1 mi NE of Cache Peak Fire perimeter"})],[v.jsx(oe,{children:"wildfire_incident"}),"Priority","WFIGS acreage or containment increased on a fire already broadcast once (the Update path; the New path uses wildfire_declared)",v.jsx("span",{className:"text-amber-300",children:"๐Ÿ”ฅ Update: Cache Peak Fire: 1,847 ac, 23% contained"})],[v.jsx(oe,{children:"wildfire_halted"}),"Routine","No FIRMS pixels attributed for 12+ hours (configurable) โ€” fire stalled or out",v.jsx("span",{className:"text-amber-300",children:"๐Ÿ”ฅ Cache Peak Fire no growth in 14h"})]]}),v.jsx(de,{children:"Daily LLM digest"}),v.jsxs("p",{children:["Twice a day (default 06:00 and 18:00 Mountain Time) the bot runs an LLM summary across every active fire and the last 24 h of growth + spotting events, then broadcasts one terse line to the mesh. Shape:"," ",v.jsx("span",{className:"text-amber-300",children:'"Fires today: Cache Peak 1,847 ac +200 NE; Twin Peaks 320 ac stable; possible new fire 15 mi from Cache Peak."'})," ","Configure the schedule and timezone under ",v.jsx(oe,{children:"fires.digest_*"})," ","keys on the Adapter Config page."]}),v.jsx(de,{children:"How attribution works"}),v.jsxs("p",{children:["When a FIRMS hotspot lands, the bot walks every active fire (those not yet tombstoned) and matches by Haversine distance to that fire's running centroid. If the pixel is within the fire's ",v.jsx(oe,{children:"spread_radius_mi"})," ","(default 5 mi, per-fire override available) the pixel is attributed and appended to that fire's growth history. The centroid then re-computes as the median of the last 24 h of attributed pixels, so single-pixel outliers don't drag the perimeter around."]}),v.jsxs("p",{children:["Pixels that match no fire feed the cluster detector instead: if at least"," ",v.jsx(oe,{children:"cluster_min_pixels"})," (default 3) lie within"," ",v.jsx(oe,{children:"cluster_max_radius_mi"})," (default 1.0) over"," ",v.jsx(oe,{children:"cluster_time_window_minutes"})," (default 60), the bot fires a single ",v.jsx(oe,{children:"unattributed_hotspot_cluster"})," broadcast and marks the member pixels so a fourth arrival doesn't re-fire the same cluster."]}),v.jsx(de,{children:"How movement is computed"}),v.jsxs("p",{children:["Each VIIRS pass groups pixels into a ",v.jsx(oe,{children:"pass_id"})," (satellite + 90-min bucket). When a pixel from a different bucket arrives, the prior pass closes: its convex hull becomes the perimeter, its median centroid becomes the comparison anchor, and the bot computes drift (Haversine to the previous pass's centroid), an 8-way compass bearing, and a wall-clock mi/h speed. If drift โ‰ฅ ",v.jsx(oe,{children:"growth_drift_threshold_mi"})," the"," ",v.jsx(oe,{children:"wildfire_growth"})," broadcast fires."]}),v.jsx(de,{children:"How spotting is detected"}),v.jsxs("p",{children:["Once a pass closes its perimeter (a GeoJSON polygon stored on the fire), every subsequent attributed pixel runs a point-in-polygon test. Pixels outside the polygon with a vertex distance โ‰ฅ"," ",v.jsx(oe,{children:"spotting_distance_threshold_mi"})," (default 1.5) fire the"," ",v.jsx(oe,{children:"wildfire_spotting"})," broadcast at ",v.jsx("em",{children:"immediate"})," severity โ€” spread beyond the existing perimeter is the most actionable fire signal we emit. A per-fire cooldown (",v.jsx(oe,{children:"spotting_cooldown_seconds"}),", default 1 h) prevents an ember burst in the same area from spamming the mesh."]}),v.jsx(de,{children:"Tunable knobs (Adapter Config โ†’ fires)"}),v.jsx(yt,{headers:["Key","Default","What it does"],rows:[[v.jsx(oe,{children:"spread_radius_mi_default"}),"5.0 mi","Attribution radius for FIRMS โ†’ fire matching. Per-fire override in the fires.spread_radius_mi column."],[v.jsx(oe,{children:"growth_drift_threshold_mi"}),"0.5 mi","Per-pass centroid drift at or above this fires wildfire_growth."],[v.jsx(oe,{children:"halt_passes_threshold"}),"2","Consecutive empty satellite passes before wildfire_halted (documented; the time gate below is the operational rule)."],[v.jsx(oe,{children:"halt_minimum_seconds"}),"43,200 (12 h)","Minimum elapsed seconds since the most recent attributed pixel before wildfire_halted can fire."],[v.jsx(oe,{children:"spotting_distance_threshold_mi"}),"1.5 mi","Distance from prior-pass perimeter that fires wildfire_spotting."],[v.jsx(oe,{children:"spotting_cooldown_seconds"}),"3,600 (1 h)","Minimum seconds between consecutive spotting broadcasts per fire."],[v.jsx(oe,{children:"digest_enabled"}),"true","Master toggle for the twice-daily digest."],[v.jsx(oe,{children:"digest_schedule"}),'["06:00","18:00"]',"Local-time slots for the digest."],[v.jsx(oe,{children:"digest_timezone"}),"America/Boise","IANA tz for digest_schedule."],[v.jsx(oe,{children:"digest_max_chars"}),"200","Hard cap on the digest wire (the LLM is told to fit; the chunker enforces)."]]})]}),v.jsxs(hr,{id:"weather-alerts",title:"Weather Alerts",children:[v.jsx(de,{children:"What You're Looking At"}),v.jsx("p",{children:"MeshAI watches for NWS (National Weather Service) alerts affecting your area โ€” warnings, watches, and advisories."}),v.jsx(de,{children:"Alert Severity โ€” How Serious Is It?"}),v.jsx(yt,{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"]]}),v.jsx(de,{children:"When Should I Act? (Urgency)"}),v.jsx(yt,{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"]]}),v.jsx(de,{children:"How Sure Are They? (Certainty)"}),v.jsx(yt,{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"]]}),v.jsx(de,{children:"These Are Separate Scales"}),v.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."'}),v.jsx(de,{children:"What Minimum Severity Should I Set?"}),v.jsx(yt,{headers:["Setting","What You Get","What You Miss"],rows:[["Minor","Everything โ€” high volume","Nothing"],[v.jsxs(v.Fragment,{children:[v.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"]]}),v.jsxs("p",{children:[v.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."]}),v.jsx(de,{children:"Finding Your NWS Zone"}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:["Go to ",v.jsx(Pt,{href:"https://www.weather.gov",children:"weather.gov"})]}),v.jsx("li",{children:"Enter your location"}),v.jsxs("li",{children:["Find your zone code at ",v.jsx(Pt,{href:"https://www.weather.gov/pimar/PubZone",children:"NWS Zone Map"})]}),v.jsxs("li",{children:["Zone codes look like: ",v.jsx(oe,{children:"IDZ016"}),", ",v.jsx(oe,{children:"UTZ040"}),", etc."]})]}),v.jsx(de,{children:"The User-Agent Field"}),v.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:"}),v.jsx("p",{children:v.jsx(oe,{children:"(meshai, you@email.com)"})}),v.jsx("p",{children:"No registration. No waiting. Just type it in."}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://alerts.weather.gov",children:"NWS Active Alerts"})," โ€” see current alerts"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.weather.gov/documentation/services-web-api",children:"NWS API Docs"})," โ€” technical details"]})]})]}),v.jsxs(hr,{id:"solar",title:"Solar & Geomagnetic Conditions",children:[v.jsx(de,{children:"What You're Looking At"}),v.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."}),v.jsx(de,{children:"Solar Flux Index (SFI)"}),v.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.'}),v.jsx(yt,{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."]]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Quick rule"}),": SFI above 90 and Kp below 4 = good day for HF radio."]}),v.jsx(de,{children:"Kp Index"}),v.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."}),v.jsx(yt,{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."],[v.jsx("strong",{children:"5"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Minor storm (G1)."})," HF noticeably degraded. Aurora visible at high latitudes (~60ยฐN)."]})],[v.jsx("strong",{children:"6"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Moderate storm (G2)."})," HF getting rough. Aurora moving south (~55ยฐN)."]})],[v.jsx("strong",{children:"7"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Strong storm (G3)."})," HF unreliable for 1-2 days. Aurora at mid-latitudes."]})],[v.jsx("strong",{children:"8-9"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Severe/Extreme storm."})," HF may black out completely. Aurora visible at very low latitudes. Power grid stress possible."]})]]}),v.jsx(de,{children:"R / S / G Scales"}),v.jsx("p",{children:"NOAA's shorthand for three types of space weather events:"}),v.jsx(fs,{children:"R (Radio Blackouts) โ€” from solar flares:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"R1-R2: Brief HF disruption. You might not notice."}),v.jsx("li",{children:"R3: HF goes out for about an hour on the sunlit side of Earth."}),v.jsx("li",{children:"R4-R5: HF dead for hours. Serious."})]}),v.jsx(fs,{children:"S (Solar Radiation Storms) โ€” from energetic particles:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"Mostly affects polar regions and satellites"}),v.jsx("li",{children:"S3+: Polar HF goes out entirely"})]}),v.jsx(fs,{children:"G (Geomagnetic Storms) โ€” from solar wind disturbances:"}),v.jsx("ul",{className:"list-disc list-inside ml-4 space-y-1",children:v.jsx("li",{children:"Same as the Kp scale: G1 = Kp 5, up to G5 = Kp 9"})}),v.jsx(de,{children:"Bz โ€” The Storm Predictor"}),v.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."}),v.jsx(yt,{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."]]}),v.jsx("p",{children:"Bz can change fast โ€” minute to minute. What matters is whether it stays negative for hours, not brief dips."}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.swpc.noaa.gov",children:"SWPC Space Weather Dashboard"})," โ€” live data"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.swpc.noaa.gov/noaa-scales-explanation",children:"NOAA Space Weather Scales"})," โ€” what R/S/G mean"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.hamqsl.com/solar.html",children:"HamQSL Solar Page"})," โ€” ham-friendly display"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.swpc.noaa.gov/products/planetary-k-index",children:"Planetary K-Index"})," โ€” live Kp"]})]})]}),v.jsxs(hr,{id:"ducting",title:"Tropospheric Ducting",children:[v.jsx(de,{children:"What You're Looking At"}),v.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.'}),v.jsx("p",{children:"MeshAI watches for these conditions by analyzing weather data (temperature and humidity at different altitudes) over your mesh area."}),v.jsx(de,{children:"How Do I Know If Ducting Is Happening?"}),v.jsx("p",{children:'MeshAI reports a "condition" based on the atmospheric profile:'}),v.jsx(yt,{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.']]}),v.jsx(de,{children:"What You'll Actually Notice"}),v.jsx("p",{children:"When ducting happens on your mesh:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"Distant repeaters you've never heard suddenly come in"}),v.jsx("li",{children:"Nodes appear from far outside your normal range"}),v.jsx("li",{children:"You hear FM radio stations from other cities"}),v.jsx("li",{children:"ADS-B flight tracking range gets much longer"}),v.jsx("li",{children:"There might be interference from distant stations on your frequency"})]}),v.jsx(de,{children:"The dM/dz Number"}),v.jsx("p",{children:`The dashboard shows a "dM/dz" value in "M-units/km." You don't need to understand the math โ€” just know:`}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"Around 118"})," = normal atmosphere"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Below 79"})," = enhanced propagation starting"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Below 0 (negative)"})," = ducting is happening"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Below -50"})," = strong ducting โ€” classic VHF/UHF DX event"]})]}),v.jsx(de,{children:"When Does Ducting Happen?"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"Under high-pressure weather systems (clear, stable air)"}),v.jsx("li",{children:"When warm air sits on top of cool air (temperature inversion)"}),v.jsx("li",{children:"Most common in late summer and early fall"}),v.jsx("li",{children:"Strongest along coastlines and over water"}),v.jsx("li",{children:"In mountain valleys: cold air pooling in fall/winter can create surface ducts"})]}),v.jsx(de,{children:"Setting It Up"}),v.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."}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://dxinfocentre.com/tropo.html",children:"Tropo Forecast Maps (Hepburn)"})," โ€” 6-day tropo prediction"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://dxmaps.com",children:"DX Maps"})," โ€” real-time VHF/UHF propagation reports"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://en.wikipedia.org/wiki/Tropospheric_propagation",children:"Wikipedia: Tropospheric Propagation"})," โ€” background"]})]})]}),v.jsxs(hr,{id:"avalanche",title:"Avalanche Danger",children:[v.jsx(de,{children:"What You're Looking At"}),v.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."}),v.jsx(de,{children:"The Danger Scale"}),v.jsx(yt,{headers:["Level","Name","Color","What To Do"],rows:[["1","Low",v.jsx($t,{color:"green"}),"Generally safe. Normal caution in steep terrain."],["2","Moderate",v.jsx($t,{color:"yellow"}),"Be careful on specific terrain features. Evaluate conditions."],["3","Considerable",v.jsx($t,{color:"orange"}),v.jsxs(v.Fragment,{children:[v.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",v.jsx($t,{color:"red"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Very dangerous."})," Stay off anything steep."]})],["5","Extreme",v.jsx($t,{color:"black"}),v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Don't go out."})," Avalanches are happening on their own."]})]]}),v.jsx(de,{children:"The Most Important Thing to Know"}),v.jsxs("p",{children:[v.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.']}),v.jsx(de,{children:"Seasonal"}),v.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.'}),v.jsx(de,{children:"Finding Your Avalanche Center"}),v.jsxs("p",{children:["Go to ",v.jsx(Pt,{href:"https://avalanche.org/avalanche-centers/",children:"avalanche.org/avalanche-centers/"})," for a map. Common center codes:"]}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(oe,{children:"SNFAC"})," โ€” Sawtooth (central Idaho)"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"UAC"})," โ€” Utah"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"NWAC"})," โ€” Cascades/Olympics (WA/OR)"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"CAIC"})," โ€” Colorado"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"SAC"})," โ€” Sierra Nevada (CA)"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GNFAC"})," โ€” Gallatin (SW Montana)"]})]}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://avalanche.org",children:"Avalanche.org"})," โ€” US forecasts"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://avalanche.org/avalanche-encyclopedia/human/resources/north-american-public-avalanche-danger-scale/",children:"Avalanche Danger Scale"})," โ€” full scale explanation"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://kbyg.org",children:"Know Before You Go"})," โ€” avalanche awareness"]})]})]}),v.jsxs(hr,{id:"traffic",title:"Traffic Flow",children:[v.jsx(de,{children:"What You're Looking At"}),v.jsx("p",{children:"MeshAI monitors traffic speed on road segments you configure, using data from TomTom (real vehicles with navigation apps reporting their speed)."}),v.jsx(de,{children:"Speed Ratio โ€” The Key Number"}),v.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:'}),v.jsx(yt,{headers:["Ratio","What It Means"],rows:[[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"green"})," Above 85%"]}),"Normal. Traffic flowing fine."],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"yellow"})," 65-85%"]}),"Slow. Heavier than usual but moving."],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"orange"})," 40-65%"]}),"Congested. Significant delays."],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"red"})," Below 40%"]}),"Gridlock. Barely moving."]]}),v.jsxs("p",{children:[v.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.`]}),v.jsx(de,{children:"Confidence โ€” Can You Trust the Data?"}),v.jsx("p",{children:"TomTom's confidence score tells you how much of the reading comes from real vehicles right now vs historical averages:"}),v.jsx(yt,{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",v.jsxs(v.Fragment,{children:[v.jsx("strong",{children:"Unreliable"})," โ€” mostly guessing from historical patterns. Don't alert on this."]})]]}),v.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."}),v.jsx(de,{children:"Setting Up Corridors"}),v.jsx("p",{children:'Each "corridor" is a point on a road you want to monitor. To add one:'}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsx("li",{children:"Go to Google Maps, find the road"}),v.jsx("li",{children:`Right-click the road โ†’ "What's here?" โ†’ copy the coordinates`}),v.jsx("li",{children:"Add the corridor in Config with a name and those coordinates"}),v.jsx("li",{children:"TomTom finds the nearest road segment automatically"})]}),v.jsx(de,{children:"Getting an API Key"}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:["Sign up at ",v.jsx(Pt,{href:"https://developer.tomtom.com",children:"developer.tomtom.com"})," (free)"]}),v.jsx("li",{children:"Create an app โ†’ get your API key"}),v.jsx("li",{children:"Free tier: 2,500 requests/day (plenty for 5-10 corridors)"})]}),v.jsx(de,{children:"Learn More"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(Pt,{href:"https://developer.tomtom.com",children:"TomTom Developer Portal"})," โ€” API docs and key signup"]}),v.jsxs("li",{children:[v.jsx(Pt,{href:"https://www.tomtom.com/traffic-index/",children:"TomTom Traffic Index"})," โ€” city congestion rankings"]})]})]}),v.jsxs(hr,{id:"roads-511",title:"Road Conditions (511)",children:[v.jsx(de,{children:"What You're Looking At"}),v.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."}),v.jsx(de,{children:"Setting It Up"}),v.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."}),v.jsx("p",{children:"Configure in Config โ†’ Environmental โ†’ 511:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"Base URL"})," โ€” your state's API endpoint"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"API Key"})," โ€” if required by your state"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Endpoints"})," โ€” which data feeds to poll (varies by state)"]})]}),v.jsx(de,{children:"Learn More"}),v.jsx("p",{children:"Check your state's 511 or DOT website for developer information."})]}),v.jsxs(hr,{id:"mesh-health",title:"Mesh Health",children:[v.jsx(de,{children:"Health Score"}),v.jsx("p",{children:"MeshAI computes a 0-100 health score for your mesh network by looking at five areas, each weighted differently:"}),v.jsx(yt,{headers:["Pillar","Weight","What It Measures"],rows:[[v.jsx("strong",{children:"Infrastructure"}),"30%","Are your routers online?"],[v.jsx("strong",{children:"Utilization"}),"25%","Is the radio channel congested?"],[v.jsx("strong",{children:"Coverage"}),"20%","Do nodes have redundant paths to gateways?"],[v.jsx("strong",{children:"Behavior"}),"15%","Are any nodes flooding the channel?"],[v.jsx("strong",{children:"Power"}),"10%","Are battery-powered nodes running low?"]]}),v.jsx("p",{children:"The overall score is the weighted sum:"}),v.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%)"}),v.jsx(de,{children:"How Each Pillar Is Calculated"}),v.jsx(fs,{children:"Infrastructure (30%)"}),v.jsx("p",{children:"This is the simplest pillar โ€” what percentage of your infrastructure nodes are currently online?"}),v.jsx("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:"(routers online รท total routers) ร— 100"}),v.jsxs("p",{children:["Only nodes with the ",v.jsx(oe,{children:"ROUTER"}),", ",v.jsx(oe,{children:"ROUTER_LATE"}),", or ",v.jsx(oe,{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."]}),v.jsxs("p",{children:[v.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."]}),v.jsx(fs,{children:"Utilization (25%)"}),v.jsxs("p",{children:["MeshAI reads the channel utilization that each router reports in its telemetry โ€” this is the firmware's own measurement of how busy the radio channel is. MeshAI uses the ",v.jsx("strong",{children:"highest"})," value from any infrastructure node because the busiest router is the bottleneck for the whole mesh."]}),v.jsx("p",{children:v.jsx("strong",{children:"How it works:"})}),v.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-4",children:[v.jsxs("li",{children:["Collect ",v.jsx(oe,{children:"channel_utilization"})," from all infrastructure nodes that report it"]}),v.jsx("li",{children:"If no infra nodes have telemetry, try all nodes"}),v.jsxs("li",{children:["Use the ",v.jsx("strong",{children:"maximum"})," value for scoring (busiest node = bottleneck)"]}),v.jsx("li",{children:"If no nodes report utilization (older firmware), fall back to packet count estimate"})]}),v.jsxs("p",{className:"mt-4",children:[v.jsx("strong",{children:"Fallback method"})," (when telemetry unavailable): estimates from packet counts using 200ms/packet airtime. This is less accurate โ€” it assumes MediumFast preset and sums packets across all nodes."]}),v.jsx(yt,{headers:["Channel Utilization","Score","What It Means"],rows:[["Under 20%","100","Channel is clear โ€” this is the goal"],["20-25%","75-100","Slight degradation, occasional collisions"],["25-35%","50-75","Severe degradation โ€” firmware throttling active"],["35-45%","25-50","Mesh struggling badly โ€” reliability dropping"],["Over 45%","0-25","Mesh is effectively unusable"]]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Special case:"})," If no utilization data is available (no telemetry and no packet data), this pillar scores 100. You're not penalized for missing data."]}),v.jsx(fs,{children:"Coverage (20%)"}),v.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.'}),v.jsxs("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:["coverage_ratio = average_gateways_per_node รท total_sources",v.jsx("br",{}),"single_gw_penalty = (single_gateway_nodes รท total_nodes) ร— 40"]}),v.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."}),v.jsx(yt,{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"]]}),v.jsxs("p",{children:[v.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.)."]}),v.jsx(fs,{children:"Behavior (15%)"}),v.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."}),v.jsxs("p",{children:[v.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."]}),v.jsx(yt,{headers:["Flagged Nodes","Score"],rows:[["0","100"],["1","80"],["2-3","60"],["4-5","40"],["6+","20"]]}),v.jsx("p",{children:"A single misbehaving node only drops the score to 80. It takes multiple problem nodes to seriously hurt the behavior pillar."}),v.jsx(fs,{children:"Power (10%)"}),v.jsx("p",{children:"Measures what fraction of battery-powered nodes are below the warning threshold (default 20%)."}),v.jsx("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:"100 ร— (1 โˆ’ low_battery_nodes รท total_battery_nodes)"}),v.jsx("p",{children:"If 2 out of 10 battery nodes are below 20%, power scores 80."}),v.jsxs("p",{children:[v.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."]}),v.jsx(de,{children:"Health Tiers"}),v.jsx(yt,{headers:["Score","Tier","What It Means"],rows:[["90-100",v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"green"})," Healthy"]}),"Everything's working well."],["75-89",v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"yellow"})," Slight degradation"]}),"Some issues but the mesh is functional."],["50-74",v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"orange"})," Unhealthy"]}),"Multiple problems. Reliability is affected."],["25-49",v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"red"})," Warning"]}),"Significant issues. The mesh is struggling."],["0-24",v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"black"})," Critical"]}),"Major failures. Barely functional."]]}),v.jsx(de,{children:"Channel Utilization โ€” Is the Radio Channel Full?"}),v.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."}),v.jsx(yt,{headers:["Utilization","What's Happening"],rows:[[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"green"})," Under 25%"]}),"Healthy. The firmware itself starts throttling above 25% to protect the channel โ€” so under 25% is the target."],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"yellow"})," 25-40%"]}),"Getting busy. Common on larger meshes. Worth watching."],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"orange"})," 40-50%"]}),"Congested. The firmware throttles GPS updates above 40%. Messages are colliding and retrying."],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"red"})," Over 50%"]}),"Serious problem. More time is spent retrying than communicating. Mesh reliability drops fast."],[v.jsxs(v.Fragment,{children:[v.jsx($t,{color:"black"})," Over 65%"]}),"Documented failure point on busy LONG_FAST meshes. The mesh becomes unusable."]]}),v.jsx(de,{children:"Packet Flooding"}),v.jsx("p",{className:"p-3 bg-yellow-500/10 border border-yellow-500/30 rounded text-yellow-200",children:v.jsx("strong",{children:'โš ๏ธ "Packet flooding" means a node sending too many RADIO PACKETS. This has nothing to do with water flooding.'})}),v.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."}),v.jsx(yt,{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."]]}),v.jsx(de,{children:"Battery Levels"}),v.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:"}),v.jsx(yt,{headers:["Voltage","Charge","What To Do"],rows:[["4.20V","100%","Full"],["3.80V","~60%","Fine"],[v.jsx("strong",{children:"3.60V"}),v.jsx("strong",{children:"~30%"}),v.jsx(v.Fragment,{children:v.jsx("strong",{children:"โš ๏ธ Warning โ€” charge it soon"})})],[v.jsx("strong",{children:"3.50V"}),v.jsx("strong",{children:"~15%"}),v.jsx(v.Fragment,{children:v.jsx("strong",{children:"๐Ÿ”ด Low โ€” charge it now"})})],[v.jsx("strong",{children:"3.40V"}),v.jsx("strong",{children:"~7%"}),v.jsx(v.Fragment,{children:v.jsx("strong",{children:"โšซ About to die"})})],["3.30V","~3%","Device shutting down"]]}),v.jsxs("p",{children:[v.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."]}),v.jsx(de,{children:"Node Offline Detection"}),v.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:`}),v.jsx(yt,{headers:["Node Type","Recommended Threshold","Why"],rows:[["Fixed infrastructure (wall power)",v.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."]]}),v.jsxs("p",{children:[v.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.`]})]}),v.jsxs(hr,{id:"broadcast-types",title:"Broadcast Types",children:[v.jsx("p",{children:"Every broadcast the bot sends to the mesh carries a one-word prefix that tells you what kind of update it is. Three types:"}),v.jsx(yt,{headers:["Prefix","What it means","When you see it"],rows:[[v.jsx(oe,{children:"New:"}),"The first time the bot has ever broadcast about this event","Cache Peak Fire's WFIGS first-sight; FIRMS cluster's first 3-pixel detection; first NWS warning for a CAP id"],[v.jsx(oe,{children:"Update:"}),"A material change on something the bot already announced","Cache Peak Fire's acreage grew; ITD 511 work zone's lane status changed; quake event's magnitude was revised"],[v.jsx(oe,{children:"Active:"}),"A clock-driven reminder that an already-announced event is still live","Cache Peak Fire is still burning 8 hours later; an SWPC G3 storm is still in progress"]]}),v.jsx("p",{children:"The bot tracks first-broadcast time and last-broadcast time separately on every event row, so a New: prefix is only emitted once even after a container restart. Update: respects per-adapter cooldowns (WFIGS is 8 h by default; ITD 511 is per-incident). Active: is the reminder system, covered in the next section."})]}),v.jsxs(hr,{id:"reminders",title:"Reminder System",children:[v.jsxs("p",{children:["Some events stay live for days. A wildfire doesn't go out because WFIGS stopped publishing updates; a geomagnetic storm doesn't end because SWPC went quiet on the wire. The reminder system fires a clock-driven"," ",v.jsx(oe,{children:"Active:"}),"-prefixed re-broadcast on a human-scale cadence so an operator who came on shift after the original announcement still sees the event."]}),v.jsx(de,{children:"Cadences"}),v.jsx(yt,{headers:["Adapter","Reminder cadence","Termination"],rows:[[v.jsxs(v.Fragment,{children:[v.jsx(oe,{children:"wfigs"})," (wildfires)"]}),"Every 8 h while the fire is still active","WFIGS publishes a tombstone (incident closed) โ†’ fires.tombstoned_at is stamped โ†’ reminder loop stops"],[v.jsxs(v.Fragment,{children:[v.jsx(oe,{children:"swpc"})," (space weather)"]}),"Every 8 h while a Kp >= floor / X-class flare / proton-storm event is ongoing","The next SWPC envelope shows the storm has subsided"],[v.jsx(oe,{children:"itd_511_work_zone"}),"Per-zone, configurable in the rule UI","WZDx publishes the zone with end_date in the past"]]}),v.jsx(de,{children:"The tombstone"}),v.jsxs("p",{children:["When a WFIGS update declares an incident closed, the bot stamps"," ",v.jsx(oe,{children:"fires.tombstoned_at"})," with the close time. The reminder scheduler treats ",v.jsx(oe,{children:"tombstoned_at IS NOT NULL"}),` as "stop broadcasting Active: for this fire," and the LLM context layer treats it as "this fire is in the closed-out archive." A subsequent FIRMS pixel inside that fire's spread radius does not re-open it โ€” closure is authoritative from NIFC.`]}),v.jsx(de,{children:"Turning reminders off"}),v.jsxs("p",{children:["Per-adapter on/off lives in ",v.jsx(oe,{children:"adapter_meta.reminder_enabled"})," ","and is exposed on the Adapter Config page. The reminders themselves flow through the same dispatcher gates as everything else, so they still respect cooldowns, the cold-start grace window, and your notification rules."]})]}),v.jsxs(hr,{id:"notifications",title:"Notifications",children:[v.jsx(de,{children:"How It Works"}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"Something happens"})," โ€” a fire is detected, weather warning issued, node goes offline, etc."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"MeshAI checks your rules"})," โ€” does this event match any of your notification rules? Is it severe enough?"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"If a rule matches"})," โ€” MeshAI sends the notification through whatever delivery method that rule is configured for."]})]}),v.jsx(de,{children:"Building Rules"}),v.jsx("p",{children:"Each rule answers three questions:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"WHEN"})," does it trigger? (which categories, what severity)"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"WHERE"})," does it send? (mesh broadcast, email, webhook, etc.)"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"HOW OFTEN"})," at most? (cooldown period)"]})]}),v.jsx("p",{children:'Use "Add from Template" to start with a pre-built rule and customize it, or build from scratch with "Add Rule."'}),v.jsx(de,{children:"Severity Levels โ€” What Should I Set?"}),v.jsx(yt,{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"],[v.jsxs(v.Fragment,{children:[v.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"]]}),v.jsxs("p",{children:[v.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."]}),v.jsx(de,{children:"Webhook โ€” The Swiss Army Knife"}),v.jsx("p",{children:"A webhook sends your alert as an HTTP POST to any URL. This one delivery method works with:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"Discord"})," โ€” use a Discord webhook URL"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Slack"})," โ€” use a Slack incoming webhook URL"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"ntfy.sh"})," โ€” POST to ",v.jsx(oe,{children:"https://ntfy.sh/your-topic"})]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Pushover"})," โ€” POST to the Pushover API"]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Home Assistant"})," โ€” POST to an automation webhook URL"]}),v.jsx("li",{children:"Anything else that accepts HTTP POST"})]}),v.jsx("p",{children:"MeshAI doesn't need to know what's on the other end. Give it the URL and it works."})]}),v.jsxs(hr,{id:"commands",title:"Commands",children:[v.jsxs("p",{children:["All commands use the ",v.jsx(oe,{children:"!"})," prefix (configurable). Send these as a direct message to MeshAI on your mesh."]}),v.jsx(de,{children:"Basic Commands"}),v.jsx(yt,{headers:["Command","What It Does"],rows:[[v.jsx(oe,{children:"!help"}),"Shows all available commands"],[v.jsx(oe,{children:"!ping"}),"Tests if the bot is alive"],[v.jsx(oe,{children:"!status"}),"Quick mesh summary (nodes online, health score)"],[v.jsx(oe,{children:"!health"}),"Detailed health report with pillar scores"],[v.jsx(oe,{children:"!weather"}),"Current weather for your area"]]}),v.jsx(de,{children:"Environmental Commands"}),v.jsx(yt,{headers:["Command","What It Does"],rows:[[v.jsx(oe,{children:"!alerts"}),"Active NWS weather alerts for your area"],[v.jsxs(v.Fragment,{children:[v.jsx(oe,{children:"!solar"})," (or ",v.jsx(oe,{children:"!hf"}),")"]}),"Current solar indices and RF conditions"],[v.jsx(oe,{children:"!fire"}),"Active wildfires near your mesh"],[v.jsx(oe,{children:"!avy"}),'Avalanche advisory (seasonal โ€” shows "off season" in summer)'],[v.jsxs(v.Fragment,{children:[v.jsx(oe,{children:"!streams"})," (or ",v.jsx(oe,{children:"!gauges"}),")"]}),"Stream gauge readings"],[v.jsxs(v.Fragment,{children:[v.jsx(oe,{children:"!roads"})," (or ",v.jsx(oe,{children:"!traffic"}),")"]}),"Road conditions and traffic flow"],[v.jsx(oe,{children:"!hotspots"}),"Satellite fire detections"]]}),v.jsx(de,{children:"Subscription Commands"}),v.jsx(yt,{headers:["Command","What It Does"],rows:[[v.jsx(oe,{children:"!subscribe"}),"Lists all alert categories you can subscribe to"],[v.jsx(oe,{children:"!subscribe fire_proximity"}),"Subscribe to a specific category"],[v.jsx(oe,{children:"!subscribe all"}),"Subscribe to everything"],[v.jsx(oe,{children:"!unsubscribe fire_proximity"}),"Unsubscribe from a category"],[v.jsx(oe,{children:"!subscriptions"}),"Shows what you're currently subscribed to"]]}),v.jsx(de,{children:"Conversational"}),v.jsxs("p",{children:[`Bang commands are the short, predictable interface. For anything that doesn't map cleanly to a single command โ€” "how's the mesh doing?", "is there any ducting?", "why didn\\'t I hear about anything today?" โ€” you can DM the bot in plain English. The LLM DM path covers the same data the commands cover, plus the dispatcher drop audit, with honest "no data" answers when a feed is quiet. Full catalog under`," ",v.jsx("a",{href:"#llm-dm",className:"text-accent hover:underline",children:"LLM DM Queries"}),"."]})]}),v.jsxs(hr,{id:"llm-dm",title:"LLM DM (Natural-Language Queries)",children:[v.jsxs("p",{children:["Bang commands like ",v.jsx(oe,{children:"!fire"})," are short and predictable โ€” the right tool on a mesh-constrained interface. For anything else, you can DM the bot in plain English and it will answer from the same live environmental data the broadcast pipeline uses. Both paths work; pick whichever fits the question."]}),v.jsx(de,{children:"What it can answer"}),v.jsx("p",{children:"When you DM the bot a question, the env_reporter layer assembles up to seven data blocks and injects them into the LLM's system prompt. Each block maps to one adapter:"}),v.jsx(yt,{headers:["Adapter block","Example question that hits it","What you get back"],rows:[[v.jsx(oe,{children:"build_fires_detail"}),'"are there any fires near me?"',"Active WFIGS-declared fires, acreage, containment, declared_at, county/state"],[v.jsx(oe,{children:"build_alerts_detail"}),'"any weather alerts?"',"Active NWS CAP alerts: type, severity, area, expiry"],[v.jsx(oe,{children:"build_quakes_detail"}),'"any earthquakes nearby?"',"USGS quakes in the last 24h: magnitude, depth, place"],[v.jsx(oe,{children:"build_traffic_detail"}),'"how is traffic on I-84?" / "any road closures?"',"TomTom + ITD 511 active incidents"],[v.jsx(oe,{children:"build_gauges_detail"}),'"what is the snake river level?"',"USGS NWIS latest readings + flood stages"],[v.jsx(oe,{children:"build_swpc_detail"}),'"what are the band conditions?" / "any space weather?"',"Recent SWPC events + band-conditions ratings"],[v.jsx(oe,{children:"build_drop_audit"}),`"why didn't I hear about anything today?"`,"Event log: what envelopes the dispatcher filtered, by adapter + category"]]}),v.jsx(de,{children:"The grounding rule"}),v.jsxs("p",{children:["The bot is told to answer ",v.jsx("em",{children:"only"}),' from the blocks in the system prompt. If a block is empty (no recent quakes, no active NWS alerts), the response is honest about it: "No active weather alerts right now," not a fabricated "144 earthquakes worldwide in the past 24 hours." That clamp closes the failure mode where the LLM defaulted to its training data when local tables were quiet.']}),v.jsx(de,{children:"Excluding an adapter from LLM context"}),v.jsxs("p",{children:["The ",v.jsx(oe,{children:"include_in_llm_context"})," toggle on each adapter's row in Adapter Config decides whether that adapter's ",v.jsx(oe,{children:"build_*"})," ","block lands in the system prompt. Turn an adapter off here if you don't want the bot's natural-language answers to draw on it (e.g. you ingest TomTom for situational awareness but don't want it cited in DM answers). Broadcasts are unaffected โ€” this toggle gates LLM context only."]}),v.jsx(de,{children:"What it can't answer"}),v.jsx("p",{children:`The bot has no general internet access. Questions that need data the env_reporter doesn't carry ("what's the weather forecast tomorrow", "who's the current president") fall back to whatever the configured LLM backend knows from training. The grounding clamp keeps the bot from inventing local data, but it can't keep the LLM from speculating about non-local topics.`})]}),v.jsxs(hr,{id:"or-not-and",title:"OR-not-AND Architecture",children:[v.jsx("p",{children:"Every environmental adapter pulls its data from one of two places:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"Central"})," (canonical) โ€” Central polls the upstream feed once on behalf of the whole fleet and re-publishes normalized envelopes over NATS JetStream. MeshAI subscribes. One Central poll, one canonical normalization, many subscribers."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"Native"})," โ€” MeshAI polls the upstream feed directly. Stays around for adapters Central doesn't carry yet (currently Tropospheric Ducting and Avalanche Center advisories) and for operators who don't run Central."]})]}),v.jsx(de,{children:"Why mutually exclusive"}),v.jsxs("p",{children:["An adapter is set to ",v.jsx("strong",{children:"either"})," Central ",v.jsx("strong",{children:"or"})," ","native, never both. Running both at the same time is what the codebase calls the ",v.jsx("em",{children:"AND-mode anti-pattern"}),": two independent poll loops on the same upstream feed, duplicate broadcasts, duplicate cursor state, no shared dedup. The Spokane-class leak (cross-state broadcasts that escaped the bbox filter in May 2026) was caused by an inadvertent AND-mode on the traffic adapter; the fix made the gate enforce mutual exclusion at boot and on every config save."]}),v.jsx(de,{children:"The per-adapter source toggle"}),v.jsxs("p",{children:["Set ",v.jsx(oe,{children:"feed_source"})," on each adapter's row in Environment:"]}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(oe,{children:"central"})," โ€” disable the native poll loop, subscribe to the matching Central subject pattern."]}),v.jsxs("li",{children:[v.jsx(oe,{children:"native"})," โ€” disable the Central subscription for this adapter, run the native poller."]})]}),v.jsxs("p",{children:["On the GUI, adapters with ",v.jsx("em",{children:"no Central counterpart yet"}),` show their Central button disabled with a "native only" tooltip. That's not an AND state; the adapter is still single-source, just locked to native by upstream availability.`]}),v.jsx(de,{children:"Where this surfaces in tooltips"}),v.jsxs("p",{children:[`You'll see "AND-model anti-pattern" referenced in two places: the USGS-lookup button on Gauge Sites (disabled when the USGS adapter is on Central, because doing a one-off direct USGS poll from the GUI while the runtime is on Central is precisely the AND-mode this rule forbids) and the env_routes 404 response on`," ",v.jsxs(oe,{children:["/api/env/usgs/lookup/","{site_id}"]})," in central-feed mode. Both surfaces refuse to fall back to a direct upstream call; the right answer is to enter values manually or source them from Central."]})]}),v.jsxs(hr,{id:"adapter-config",title:"Adapter Config & the CODE Rule",children:[v.jsx("p",{children:"The Adapter Config page is the single hub for ~50 GUI-editable knobs across the 13 adapters that touch the broadcast pipeline. Changes take effect on the next handler call โ€” no container restart needed for most keys."}),v.jsx(de,{children:"The CONFIG-vs-CODE rule"}),v.jsx("p",{children:"Not everything tunable becomes a GUI row. The codebase splits along one rule:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx("strong",{children:"CONFIG"})," (lives on this page) โ€” where you send (channels), how often (cadences, schedules), thresholds (magnitude floors, severity gates, distance radii, cooldown durations, freshness windows), curation data (which sites, states, codes), toggles (enabled, include_in_llm_context)."]}),v.jsxs("li",{children:[v.jsx("strong",{children:"CODE"})," (stays in the handlers, not on the GUI) โ€” sentence templates, emoji choices, mapping / translation functions (TomTom icon_map, ITD sub_type_map, Central adapter_map and category_map), rendering logic (anchor priority order, expires-buckets formatting, threshold-state labels), heuristic logic (band_conditions Kp/SFI โ†’ Good/Fair/Poor function)."]})]}),v.jsx("p",{children:"If you find yourself wanting to add a wire-string template or an emoji to the GUI, stop โ€” that's CODE. If you want to change a threshold or a curation list, the GUI is the right place."}),v.jsx(de,{children:"Restart-required vs live"}),v.jsx("p",{children:"Most keys take effect on the next handler call (the env_store re-reads from the database). A short list requires a container restart, because they govern startup-only wiring:"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:["Anything under the ",v.jsx(oe,{children:"environmental"})," section on the Config page (feed_source, central URL, etc.). The Spokane-fix gate runs at env_store boot and at CentralConsumer subscribe โ€” both happen only at startup."]}),v.jsx("li",{children:"The LLM backend swap (Google โ†’ Anthropic โ†’ OpenAI)."}),v.jsx("li",{children:"The dispatcher cold-start grace window."})]}),v.jsx("p",{children:`When you save one of those keys via the GUI, a yellow Restart-Required banner surfaces at the top of the page with a "Restart now" button. Until you click it, the on-disk config and the running config intentionally disagree โ€” that's the OR-not-AND gate refusing to transition mid-flight.`}),v.jsxs(de,{children:["The ",v.jsx(oe,{children:"include_in_llm_context"})," toggle"]}),v.jsxs("p",{children:[`Each adapter's card on Adapter Config carries a per-adapter "LLM context" switch. When off, that adapter's `,v.jsx(oe,{children:"build_*"})," ","env_reporter block is skipped during system-prompt assembly. Broadcasts are unaffected; this toggle is purely about what the LLM sees when you DM it. See the LLM DM section above for the seven adapter blocks this gates."]})]}),v.jsxs(hr,{id:"curation",title:"Curation: Gauge Sites & Town Anchors",children:[v.jsx("p",{children:"Two curation tables drive the broadcast text the bot puts on the mesh. Both are CRUD UIs with per-row enable/disable; both fall through to fallback chains when a row is missing or disabled."}),v.jsx(de,{children:"Gauge Sites"}),v.jsx("p",{children:"Stream gauge thresholds for the USGS NWIS handler. Each row pairs a USGS site_id with a human gauge name, lat/lon, and four NWS-AHPS flood thresholds in feet: Action, Minor, Moderate, Major. The handler compares an incoming gauge reading to those thresholds and emits the right broadcast severity."}),v.jsxs("p",{children:[v.jsx("strong",{children:"USGS lookup button"})," โ€” when you add a new row in native-feed mode, the lookup queries the USGS Site Service plus NWS NWPS to auto-populate name, coordinates, and flood stages. In central-feed mode the button is disabled with a tooltip: a one-off direct USGS poll from the GUI while the runtime is on Central is the AND-mode anti-pattern the architecture forbids. Enter values manually or pull them from Central."]}),v.jsxs("p",{children:[v.jsx("strong",{children:"Disabled rows"})," are ignored at dispatch time. The corresponding gauge still ingests into ",v.jsx(oe,{children:"gauge_readings"})," ","(so historical queries still work), it just doesn't broadcast."]}),v.jsx(de,{children:"Town Anchors"}),v.jsxs("p",{children:['Lookup table for the "X mi ',"<","bearing",">"," of ","<","town",">",'" suffix in broadcast text. When a fire or NWS alert renders, the bot walks an anchor chain to figure out where to say it is:']}),v.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[v.jsx("li",{children:'Photon nearest-town lookup (the WFIGS path uses this โ€” produces "near Long Creek Summit Home" style anchors)'}),v.jsx("li",{children:"Town Anchors table (your curated list)"}),v.jsx("li",{children:"Landclass label (county / federal-land identifier)"}),v.jsx("li",{children:"County + state fallback"}),v.jsx("li",{children:"Bare lat/lon coords"})]}),v.jsx("p",{children:'Each row carries a name (lowercased on save), state, lat/lon, and an enable flag. The "lowercased on save" rule keeps "Almo" / "ALMO" / "almo" from being three distinct rows. Disabled rows fall through to the next anchor in the chain โ€” the broadcast text still goes out, it just uses a different anchor.'}),v.jsxs("p",{children:["Example broadcast text rendered from a Town Anchors row:"," ",v.jsx("span",{className:"text-amber-300",children:'"๐Ÿ”ฅ New: Cache Peak Fire (WF), 3 mi N of Almo: 250 ac, 0% contained, @ 42.118,-113.643"'})]})]}),v.jsxs(hr,{id:"schema",title:"Schema Migrations",children:[v.jsxs("p",{children:["MeshAI persists state in a single SQLite database (",v.jsx(oe,{children:"/data/meshai.sqlite"}),") with WAL journaling. Schema migrations live in ",v.jsx(oe,{children:"meshai/persistence/migrations/v*.sql"})," ","and apply automatically on container start. The runner reads the migrations directory, sorts by version, and applies anything past the current ",v.jsx(oe,{children:"schema_meta.version"})," in order. Idempotent re-runs are no-ops."]}),v.jsx(de,{children:"v0.6 + v0.7 additions"}),v.jsx(yt,{headers:["Migration","What it added"],rows:[[v.jsx(oe,{children:"v11"}),"first_broadcast_at + last_broadcast_at split + reminder_enabled per adapter (the schema basis for New / Update / Active)"],[v.jsx(oe,{children:"v12"}),"fires.tombstoned_at (WFIGS closure stamp; terminates the reminder loop)"],[v.jsx(oe,{children:"v13"}),"Fire Tracker Phase 1 โ€” fire_pixels table + spread_radius_mi + current_centroid_lat/lon + last_hotspot_at; firms_pixels attributed_at + cluster_broadcast_at"],[v.jsx(oe,{children:"v14"}),"Fire Tracker Phase 2 โ€” fire_passes table (per-satellite-pass centroid + drift) + last_pass_id + halt_broadcast_at on fires"],[v.jsx(oe,{children:"v15"}),"Fire Tracker Phase 3 โ€” fire_passes.perimeter_geojson (convex hull) + fires.last_spotting_broadcast_at"],[v.jsx(oe,{children:"v16"}),"Fire Tracker Phase 4 โ€” fire_digest_broadcasts table (idempotent twice-daily LLM digest)"]]}),v.jsx(de,{children:"When migrations fail"}),v.jsxs("p",{children:["A migration failure leaves the database at the prior version and raises in the runner. Container logs surface the SQL error;"," ",v.jsx(oe,{children:"schema_meta.version"})," tells you where the last successful migration stopped. Re-running the container after the underlying issue is fixed picks up from there."]})]}),v.jsxs(hr,{id:"api",title:"API Reference",children:[v.jsxs("p",{children:["MeshAI's REST API is available at ",v.jsx(oe,{children:"http://your-host:8080"}),". All endpoints return JSON."]}),v.jsx(de,{children:"System"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/status"})," โ€” version, uptime, node count"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/channels"})," โ€” radio channel list"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"POST /api/restart"})," โ€” restart the bot"]})]}),v.jsx(de,{children:"Mesh Data"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/health"})," โ€” health score and pillars"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/nodes"})," โ€” all nodes with positions and telemetry"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/edges"})," โ€” neighbor links with signal quality"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/regions"})," โ€” region summaries"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/sources"})," โ€” data source health"]})]}),v.jsx(de,{children:"Configuration"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/config"})," โ€” full config"]}),v.jsxs("li",{children:[v.jsxs(oe,{children:["GET /api/config/","{section}"]})," โ€” one section"]}),v.jsxs("li",{children:[v.jsxs(oe,{children:["PUT /api/config/","{section}"]})," โ€” update a section"]})]}),v.jsx(de,{children:"Environmental"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/env/status"})," โ€” per-feed health"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/env/active"})," โ€” all active events"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/env/swpc"})," โ€” solar/geomagnetic data"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/env/ducting"})," โ€” atmospheric profile"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/env/fires"})," โ€” wildfire perimeters"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/env/hotspots"})," โ€” satellite fire detections"]})]}),v.jsx(de,{children:"Alerts"}),v.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/alerts/active"})," โ€” current alerts"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/alerts/history"})," โ€” past alerts"]}),v.jsxs("li",{children:[v.jsx(oe,{children:"GET /api/notifications/categories"})," โ€” available alert categories"]})]}),v.jsx(de,{children:"Real-time"}),v.jsx("ul",{className:"list-disc list-inside ml-4 space-y-1",children:v.jsxs("li",{children:[v.jsx(oe,{children:"ws://your-host:8080/ws/live"})," โ€” WebSocket for live updates"]})})]})]})})]})}const Mxe=1500;function Axe(){const[e,t]=G.useState({}),[r,n]=G.useState({}),[i,a]=G.useState(!0),[o,s]=G.useState(null),[l,u]=G.useState({}),[c,h]=G.useState({}),[f,d]=G.useState({}),g=G.useCallback(async()=>{a(!0),s(null);try{const[S,T]=await Promise.all([fetch("/api/adapter-config"),fetch("/api/adapter-meta")]);if(!S.ok)throw new Error(`GET /adapter-config: ${S.status}`);if(!T.ok)throw new Error(`GET /adapter-meta: ${T.status}`);t(await S.json()),n(await T.json())}catch(S){s(String(S))}finally{a(!1)}},[]);G.useEffect(()=>{g()},[g]);const m=G.useCallback((S,T,M)=>{h(A=>({...A,[S]:T})),M&&d(A=>({...A,[S]:M})),T==="saved"&&setTimeout(()=>{h(A=>A[S]==="saved"?{...A,[S]:"idle"}:A)},Mxe)},[]),y=G.useCallback(async(S,T,M)=>{const A=`${S}.${T}`;m(A,"saving");try{const P=await fetch(`/api/adapter-config/${S}/${T}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:M})});if(!P.ok){const D=(await P.json().catch(()=>({}))).detail||P.statusText;m(A,"error",String(D));return}const I=await P.json();t(N=>({...N,[S]:(N[S]||[]).map(D=>D.key===T?I:D)})),m(A,"saved")}catch(P){m(A,"error",String(P))}},[m]),x=G.useCallback(async(S,T)=>{const M=`${S}.${T}`;m(M,"saving");try{const A=await fetch(`/api/adapter-config/${S}/${T}/reset`,{method:"POST"});if(!A.ok){m(M,"error",`reset failed (${A.status})`);return}const P=await A.json();t(I=>({...I,[S]:(I[S]||[]).map(N=>N.key===T?P:N)})),m(M,"saved")}catch(A){m(M,"error",String(A))}},[m]),_=G.useCallback(async(S,T)=>{const M=`meta:${S}`;m(M,"saving");try{const A=await fetch(`/api/adapter-meta/${S}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)});if(!A.ok){const I=await A.json().catch(()=>({}));m(M,"error",String(I.detail||A.statusText));return}const P=await A.json();n(I=>({...I,[S]:P})),m(M,"saved")}catch(A){m(M,"error",String(A))}},[m]);if(i)return v.jsxs("div",{className:"p-6 flex items-center gap-2 text-slate-400",children:[v.jsx(Dp,{className:"w-5 h-5 animate-spin"})," Loading adapter configโ€ฆ"]});if(o)return v.jsxs("div",{className:"p-6 text-red-400",children:[v.jsx(Vo,{className:"w-5 h-5 inline mr-2"}),"Failed to load: ",o]});const w=Array.from(new Set([...Object.keys(r),...Object.keys(e)])).sort();return v.jsxs("div",{className:"p-6 space-y-4",children:[v.jsxs("div",{className:"flex items-center gap-2 text-slate-200",children:[v.jsx(BM,{className:"w-5 h-5"}),v.jsx("h1",{className:"text-xl font-semibold",children:"Adapter Config"}),v.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[Object.values(e).reduce((S,T)=>S+T.length,0)," settings across ",w.length," adapters"]})]}),v.jsxs("p",{className:"text-xs text-slate-400 max-w-3xl",children:["Per-adapter tunables (thresholds, freshness windows, toggles, curation lists). Changes take effect on the next handler call -- no container restart needed. Sentence templates, emoji, and translation maps live in code by design โ€” see the CODE rule under ",v.jsx("a",{href:"/reference#adapter-config",className:"text-accent hover:underline",children:"Adapter Config & the CODE Rule"})," in Reference. The ",v.jsx("strong",{children:"LLM context"})," toggle on each card gates whether that adapter's data lands in the system prompt when you DM the bot; broadcasts are unaffected."]}),w.map(S=>{const T=r[S]||{display_name:S,include_in_llm_context:!0,description:""},M=e[S]||[],A=l[S]??!1,P=`meta:${S}`,I=c[P]||"idle";return v.jsxs("div",{className:"bg-slate-800/60 border border-slate-700 rounded-lg",children:[v.jsxs("div",{className:"p-4 flex items-start gap-4",children:[v.jsx("button",{onClick:()=>u(N=>({...N,[S]:!N[S]})),className:"text-slate-400 hover:text-white","aria-label":"toggle expand",children:A?v.jsx(ll,{className:"w-5 h-5"}):v.jsx(Js,{className:"w-5 h-5"})}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("h2",{className:"text-base font-semibold text-slate-100",children:T.display_name}),v.jsx("code",{className:"text-xs text-slate-500",children:S}),M.length>0&&v.jsxs("span",{className:"text-xs text-slate-400 ml-1",children:["(",M.length," settings)"]}),M.length===0&&v.jsx("span",{className:"text-xs text-slate-500 ml-1 italic",children:"(meta only)"})]}),T.description&&v.jsx("p",{className:"text-xs text-slate-400 mt-1",children:T.description})]}),v.jsxs("label",{className:"flex items-center gap-2 text-xs text-slate-300 select-none",children:[v.jsx("input",{type:"checkbox",checked:T.include_in_llm_context,onChange:N=>_(S,{include_in_llm_context:N.target.checked}),className:"w-4 h-4 accent-cyan-500"}),"LLM context",v.jsx(tU,{status:I,error:f[P]})]})]}),A&&M.length>0&&v.jsx("div",{className:"border-t border-slate-700 divide-y divide-slate-700/60",children:M.map(N=>v.jsx(kxe,{row:N,status:c[`${S}.${N.key}`]||"idle",error:f[`${S}.${N.key}`],onCommit:D=>y(S,N.key,D),onReset:()=>x(S,N.key)},N.key))})]},S)})]})}function kxe({row:e,status:t,error:r,onCommit:n,onReset:i}){const[a,o]=G.useState(bS(e));G.useEffect(()=>{o(bS(e))},[e.value,e.type]);const s=a!==bS(e),l=JSON.stringify(e.value)===JSON.stringify(e.default),u=()=>{const c=Lxe(a,e.type);c.error||c.changed(e.value)&&n(c.value)};return v.jsxs("div",{className:"px-6 py-3 flex items-start gap-4",children:[v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("code",{className:"text-sm font-mono text-cyan-300",children:e.key}),v.jsxs("span",{className:"text-xs text-slate-500",children:["[",e.type,"]"]}),!l&&v.jsx("span",{className:"text-xs text-amber-400",children:"edited"})]}),e.description&&v.jsx("p",{className:"text-xs text-slate-400 mt-1",children:e.description})]}),v.jsxs("div",{className:"flex items-center gap-2 min-w-[280px] justify-end",children:[e.type==="bool"?v.jsx("input",{type:"checkbox",checked:e.value===!0,onChange:c=>n(c.target.checked),className:"w-5 h-5 accent-cyan-500"}):e.type==="json"?v.jsx("textarea",{className:"w-72 h-20 bg-slate-900 border border-slate-700 rounded px-2 py-1 text-xs font-mono text-slate-100",value:a,onChange:c=>o(c.target.value),onBlur:u}):v.jsx("input",{type:e.type==="int"||e.type==="float"?"number":"text",step:e.type==="float"?"any":"1",className:"w-48 bg-slate-900 border border-slate-700 rounded px-2 py-1 text-sm text-slate-100",value:a,onChange:c=>o(c.target.value),onBlur:u,onKeyDown:c=>{c.key==="Enter"&&c.target.blur()}}),v.jsx(tU,{status:t,error:r,dirty:s}),v.jsx("button",{onClick:i,disabled:l,className:"text-slate-400 hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",title:"Reset to default",children:v.jsx(Jx,{className:"w-4 h-4"})})]})]})}function tU({status:e,error:t,dirty:r}){return e==="saving"?v.jsx(Dp,{className:"w-4 h-4 text-cyan-400 animate-spin"}):e==="saved"?v.jsx(Za,{className:"w-4 h-4 text-emerald-400"}):e==="error"?v.jsx("span",{title:t,className:"text-red-400 cursor-help",children:v.jsx(Vo,{className:"w-4 h-4"})}):r?v.jsx("span",{className:"w-2 h-2 bg-amber-400 rounded-full",title:"unsaved"}):v.jsx("span",{className:"w-4 h-4"})}function bS(e){return e.type==="bool"?String(e.value===!0):e.type==="json"?JSON.stringify(e.value,null,2):e.value===null||e.value===void 0?"":String(e.value)}function Lxe(e,t){if(t==="int"){const r=Number(e);return!Number.isFinite(r)||!Number.isInteger(r)?{error:"expected integer",value:null,changed:()=>!1}:{error:null,value:r,changed:n=>n!==r}}if(t==="float"){const r=Number(e);return Number.isFinite(r)?{error:null,value:r,changed:n=>n!==r}:{error:"expected number",value:null,changed:()=>!1}}if(t==="str")return{error:null,value:e,changed:r=>r!==e};if(t==="json")try{const r=JSON.parse(e);return{error:null,value:r,changed:n=>JSON.stringify(n)!==JSON.stringify(r)}}catch{return{error:"invalid JSON",value:null,changed:()=>!1}}return{error:null,value:e,changed:()=>!0}}const wS={site_id:"",gauge_name:"",lat:0,lon:0,action_ft:null,flood_minor_ft:null,flood_moderate_ft:null,flood_major_ft:null,enabled:!0,updated_at:0};function Nxe(){const[e,t]=G.useState([]),[r,n]=G.useState(!0),[i,a]=G.useState(null),[o,s]=G.useState(null),[l,u]=G.useState(wS),[c,h]=G.useState(!1),[f,d]=G.useState("unknown"),g=G.useCallback(async()=>{n(!0),a(null);try{const S=await fetch("/api/gauge-sites");if(!S.ok)throw new Error(`GET: ${S.status}`);t(await S.json())}catch(S){a(String(S))}finally{n(!1)}},[]);G.useEffect(()=>{g()},[g]),G.useEffect(()=>{fetch("/api/config/environmental").then(S=>S.json()).then(S=>{var T;return d(((T=S==null?void 0:S.usgs)==null?void 0:T.feed_source)||"unknown")}).catch(()=>d("unknown"))},[]);const m=S=>{s(S.site_id),u({...S}),h(!1)},y=()=>{h(!0),s(null),u({...wS})},x=()=>{s(null),h(!1),u(wS)},_=async()=>{try{const S=c?"/api/gauge-sites":`/api/gauge-sites/${o}`,M=await fetch(S,{method:c?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!M.ok){const A=await M.json().catch(()=>({}));alert(`save failed: ${A.detail||M.statusText}`);return}x(),g()}catch(S){alert(String(S))}},w=async S=>{if(!confirm(`Delete ${S}?`))return;const T=await fetch(`/api/gauge-sites/${S}`,{method:"DELETE"});if(!T.ok){alert(`delete failed: ${T.status}`);return}g()};return r?v.jsxs("div",{className:"p-6 text-slate-400",children:[v.jsx(Dp,{className:"w-5 h-5 animate-spin inline mr-2"}),"Loadingโ€ฆ"]}):i?v.jsxs("div",{className:"p-6 text-red-400",children:["Load failed: ",i]}):v.jsxs("div",{className:"p-6 space-y-4",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Yx,{className:"w-5 h-5 text-cyan-400"}),v.jsx("h1",{className:"text-xl font-semibold text-slate-100",children:"Gauge Sites"}),v.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[e.length," sites"]}),v.jsxs("button",{onClick:y,className:"ml-auto flex items-center gap-1 px-3 py-1 bg-cyan-700 hover:bg-cyan-600 rounded text-white text-sm",children:[v.jsx(af,{className:"w-4 h-4"})," Add site"]})]}),v.jsx("p",{className:"text-xs text-slate-400 max-w-3xl",children:"NWS-AHPS stream gauge thresholds for the USGS NWIS handler. Each row pairs a USGS site_id with a human gauge name, lat/lon, and four flood thresholds (Action / Minor / Moderate / Major, all in feet). Disabled rows still ingest into gauge_readings -- they don't broadcast. The USGS lookup button auto-populates name + coords + thresholds from USGS Site Service + NWS NWPS when this adapter is on native feed_source; Central-feed mode disables it (see Reference โ†’ OR-not-AND for why). Changes take effect on the next event."}),c&&v.jsx(I3,{draft:l,setDraft:u,onSave:_,onCancel:x,adding:!0,feedSource:f}),v.jsx("div",{className:"bg-slate-800/60 border border-slate-700 rounded-lg overflow-x-auto",children:v.jsxs("table",{className:"w-full text-sm text-slate-200",children:[v.jsx("thead",{className:"bg-slate-900 text-xs text-slate-400 uppercase",children:v.jsxs("tr",{children:[v.jsx("th",{className:"px-3 py-2 text-left",children:"Site ID"}),v.jsx("th",{className:"px-3 py-2 text-left",children:"Name"}),v.jsx("th",{className:"px-3 py-2 text-right",children:"Lat,Lon"}),v.jsx("th",{className:"px-3 py-2 text-right",children:"Action"}),v.jsx("th",{className:"px-3 py-2 text-right",children:"Minor"}),v.jsx("th",{className:"px-3 py-2 text-right",children:"Moderate"}),v.jsx("th",{className:"px-3 py-2 text-right",children:"Major"}),v.jsx("th",{className:"px-3 py-2 text-center",children:"On"}),v.jsx("th",{className:"px-3 py-2"})]})}),v.jsx("tbody",{className:"divide-y divide-slate-700/60",children:e.map(S=>o===S.site_id?v.jsx("tr",{className:"bg-slate-900/40",children:v.jsx("td",{colSpan:9,className:"px-3 py-2",children:v.jsx(I3,{draft:l,setDraft:u,onSave:_,onCancel:x,feedSource:f})})},S.site_id):v.jsxs("tr",{className:"hover:bg-slate-800/50",children:[v.jsx("td",{className:"px-3 py-2 font-mono text-xs",children:S.site_id}),v.jsx("td",{className:"px-3 py-2",children:S.gauge_name}),v.jsxs("td",{className:"px-3 py-2 text-right text-xs",children:[S.lat.toFixed(3),",",S.lon.toFixed(3)]}),v.jsx("td",{className:"px-3 py-2 text-right",children:S.action_ft??"-"}),v.jsx("td",{className:"px-3 py-2 text-right",children:S.flood_minor_ft??"-"}),v.jsx("td",{className:"px-3 py-2 text-right",children:S.flood_moderate_ft??"-"}),v.jsx("td",{className:"px-3 py-2 text-right",children:S.flood_major_ft??"-"}),v.jsx("td",{className:"px-3 py-2 text-center",children:S.enabled?v.jsx(Za,{className:"w-4 h-4 text-emerald-400 inline"}):v.jsx(ca,{className:"w-4 h-4 text-slate-500 inline"})}),v.jsxs("td",{className:"px-3 py-2 text-right",children:[v.jsx("button",{onClick:()=>m(S),className:"text-cyan-400 hover:text-cyan-300 text-xs mr-3",children:"Edit"}),v.jsx("button",{onClick:()=>w(S.site_id),className:"text-red-400 hover:text-red-300",children:v.jsx(Ep,{className:"w-4 h-4 inline"})})]})]},S.site_id))})]})})]})}function I3({draft:e,setDraft:t,onSave:r,onCancel:n,adding:i,feedSource:a}){const o=(g,m)=>t({...e,[g]:m}),[s,l]=G.useState(!1),[u,c]=G.useState(null),h=a!=="native"||!e.site_id.trim(),f=a!=="native"?"USGS lookup not available in central-feed mode (would be AND-model anti-pattern). Enter values manually.":e.site_id.trim()?"Auto-populate from USGS / NWS NWPS":"Enter a site_id first",d=async()=>{if(!h){l(!0),c(null);try{const g=e.site_id.replace(/^USGS-/i,""),m=await fetch(`/api/env/usgs/lookup/${encodeURIComponent(g)}`);if(m.status===404){const _=await m.json().catch(()=>({}));c(_.detail||"Lookup unavailable -- enter values manually"),l(!1);return}if(!m.ok){c(`Lookup failed (${m.status})`),l(!1);return}const y=await m.json(),x={...e};y.name&&!x.gauge_name&&(x.gauge_name=y.name),typeof y.lat=="number"&&(x.lat=y.lat),typeof y.lon=="number"&&(x.lon=y.lon),typeof y.action_ft=="number"&&(x.action_ft=y.action_ft),typeof y.flood_minor_ft=="number"&&(x.flood_minor_ft=y.flood_minor_ft),typeof y.flood_moderate_ft=="number"&&(x.flood_moderate_ft=y.flood_moderate_ft),typeof y.flood_major_ft=="number"&&(x.flood_major_ft=y.flood_major_ft),t(x)}catch(g){c(String(g))}finally{l(!1)}}};return v.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 p-3 bg-slate-900/50 rounded",children:[v.jsxs("label",{className:"text-xs text-slate-400 col-span-2",children:["Site ID",v.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[v.jsx("input",{className:"flex-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100 font-mono text-xs",value:e.site_id,onChange:g=>o("site_id",g.target.value),disabled:!i}),v.jsxs("button",{type:"button",onClick:d,disabled:h||s,title:f,className:"px-2 py-1 bg-slate-700 hover:bg-slate-600 disabled:opacity-30 disabled:cursor-not-allowed rounded text-xs text-slate-100 flex items-center gap-1",children:[s?v.jsx(Dp,{className:"w-3 h-3 animate-spin"}):v.jsx(e_,{className:"w-3 h-3"}),"USGS lookup"]})]}),u&&v.jsx("span",{className:"text-amber-400 text-xs mt-1 block",children:u})]}),v.jsxs("label",{className:"text-xs text-slate-400 col-span-2",children:["Gauge name",v.jsx("input",{className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.gauge_name,onChange:g=>o("gauge_name",g.target.value)})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Lat",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.lat,onChange:g=>o("lat",parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Lon",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.lon,onChange:g=>o("lon",parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Action ft",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.action_ft??"",onChange:g=>o("action_ft",g.target.value===""?null:parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Minor flood ft",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.flood_minor_ft??"",onChange:g=>o("flood_minor_ft",g.target.value===""?null:parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Moderate flood ft",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.flood_moderate_ft??"",onChange:g=>o("flood_moderate_ft",g.target.value===""?null:parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Major flood ft",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.flood_major_ft??"",onChange:g=>o("flood_major_ft",g.target.value===""?null:parseFloat(g.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-300 col-span-2 flex items-center gap-2 mt-2",children:[v.jsx("input",{type:"checkbox",checked:e.enabled,onChange:g=>o("enabled",g.target.checked),className:"accent-cyan-500"}),"Enabled"]}),v.jsxs("div",{className:"col-span-2 flex items-center justify-end gap-2 mt-2",children:[v.jsx("button",{onClick:n,className:"px-3 py-1 text-slate-300 hover:bg-slate-700 rounded text-sm",children:"Cancel"}),v.jsx("button",{onClick:r,className:"px-3 py-1 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-sm",children:"Save"})]})]})}const SS={anchor_id:0,name:"",lat:0,lon:0,state:"ID",enabled:!0,updated_at:0};function Pxe(){const[e,t]=G.useState([]),[r,n]=G.useState(!0),[i,a]=G.useState(null),[o,s]=G.useState(null),[l,u]=G.useState(!1),[c,h]=G.useState(SS),f=G.useCallback(async()=>{n(!0),a(null);try{const _=await fetch("/api/town-anchors");if(!_.ok)throw new Error(`GET: ${_.status}`);t(await _.json())}catch(_){a(String(_))}finally{n(!1)}},[]);G.useEffect(()=>{f()},[f]);const d=_=>{s(_.anchor_id),h({..._}),u(!1)},g=()=>{u(!0),s(null),h({...SS})},m=()=>{s(null),u(!1),h(SS)},y=async()=>{const _=l?"/api/town-anchors":`/api/town-anchors/${o}`,S=await fetch(_,{method:l?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(!S.ok){const T=await S.json().catch(()=>({}));alert(`save failed: ${T.detail||S.statusText}`);return}m(),f()},x=async _=>{if(!confirm(`Delete anchor ${_}?`))return;const w=await fetch(`/api/town-anchors/${_}`,{method:"DELETE"});if(!w.ok){alert(`delete failed: ${w.status}`);return}f()};return r?v.jsxs("div",{className:"p-6 text-slate-400",children:[v.jsx(Dp,{className:"w-5 h-5 animate-spin inline mr-2"}),"Loadingโ€ฆ"]}):i?v.jsxs("div",{className:"p-6 text-red-400",children:["Load failed: ",i]}):v.jsxs("div",{className:"p-6 space-y-4",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(nf,{className:"w-5 h-5 text-cyan-400"}),v.jsx("h1",{className:"text-xl font-semibold text-slate-100",children:"Town Anchors"}),v.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[e.length," towns"]}),v.jsxs("button",{onClick:g,className:"ml-auto flex items-center gap-1 px-3 py-1 bg-cyan-700 hover:bg-cyan-600 rounded text-white text-sm",children:[v.jsx(af,{className:"w-4 h-4"})," Add town"]})]}),v.jsx("p",{className:"text-xs text-slate-400 max-w-3xl",children:`Lookup table for the "X mi of " suffix in the bot's broadcast text. When a fire or NWS alert renders, the bot walks: Photon nearest-town โ†’ this table โ†’ landclass โ†’ county/state โ†’ bare coords. Disabled rows fall through to the next anchor in the chain; the broadcast still goes out, it just uses a different anchor. Example: "3 mi N of Almo". See Reference โ†’ Curation: Gauges & Towns for the full chain.`}),l&&v.jsx(D3,{draft:c,setDraft:h,onSave:y,onCancel:m,adding:!0}),v.jsx("div",{className:"bg-slate-800/60 border border-slate-700 rounded-lg overflow-x-auto",children:v.jsxs("table",{className:"w-full text-sm text-slate-200",children:[v.jsx("thead",{className:"bg-slate-900 text-xs text-slate-400 uppercase",children:v.jsxs("tr",{children:[v.jsx("th",{className:"px-3 py-2 text-left",children:"Name"}),v.jsx("th",{className:"px-3 py-2 text-right",children:"Lat"}),v.jsx("th",{className:"px-3 py-2 text-right",children:"Lon"}),v.jsx("th",{className:"px-3 py-2 text-center",children:"State"}),v.jsx("th",{className:"px-3 py-2 text-center",children:"On"}),v.jsx("th",{className:"px-3 py-2"})]})}),v.jsx("tbody",{className:"divide-y divide-slate-700/60",children:e.map(_=>o===_.anchor_id?v.jsx("tr",{className:"bg-slate-900/40",children:v.jsx("td",{colSpan:6,className:"px-3 py-2",children:v.jsx(D3,{draft:c,setDraft:h,onSave:y,onCancel:m})})},_.anchor_id):v.jsxs("tr",{className:"hover:bg-slate-800/50",children:[v.jsx("td",{className:"px-3 py-2 capitalize",children:_.name}),v.jsx("td",{className:"px-3 py-2 text-right text-xs",children:_.lat.toFixed(4)}),v.jsx("td",{className:"px-3 py-2 text-right text-xs",children:_.lon.toFixed(4)}),v.jsx("td",{className:"px-3 py-2 text-center text-xs",children:_.state||"-"}),v.jsx("td",{className:"px-3 py-2 text-center",children:_.enabled?v.jsx(Za,{className:"w-4 h-4 text-emerald-400 inline"}):v.jsx(ca,{className:"w-4 h-4 text-slate-500 inline"})}),v.jsxs("td",{className:"px-3 py-2 text-right",children:[v.jsx("button",{onClick:()=>d(_),className:"text-cyan-400 hover:text-cyan-300 text-xs mr-3",children:"Edit"}),v.jsx("button",{onClick:()=>x(_.anchor_id),className:"text-red-400 hover:text-red-300",children:v.jsx(Ep,{className:"w-4 h-4 inline"})})]})]},_.anchor_id))})]})})]})}function D3({draft:e,setDraft:t,onSave:r,onCancel:n,adding:i}){const a=(o,s)=>t({...e,[o]:s});return v.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 p-3 bg-slate-900/50 rounded",children:[v.jsxs("label",{className:"text-xs text-slate-400 col-span-2",children:["Name (lowercased on save)",v.jsx("input",{className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.name,onChange:o=>a("name",o.target.value),disabled:!i})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["State",v.jsx("input",{className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.state??"",onChange:o=>a("state",o.target.value)})]}),v.jsxs("label",{className:"text-xs text-slate-400 flex items-center gap-2",children:[v.jsx("input",{type:"checkbox",checked:e.enabled,onChange:o=>a("enabled",o.target.checked),className:"accent-cyan-500 mt-4"}),"Enabled"]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Lat",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.lat,onChange:o=>a("lat",parseFloat(o.target.value))})]}),v.jsxs("label",{className:"text-xs text-slate-400",children:["Lon",v.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.lon,onChange:o=>a("lon",parseFloat(o.target.value))})]}),v.jsxs("div",{className:"col-span-2 flex items-center justify-end gap-2 mt-2",children:[v.jsx("button",{onClick:n,className:"px-3 py-1 text-slate-300 hover:bg-slate-700 rounded text-sm",children:"Cancel"}),v.jsx("button",{onClick:r,className:"px-3 py-1 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-sm",children:"Save"})]})]})}function Ixe(){return v.jsx(cY,{children:v.jsx(pY,{children:v.jsxs(b$,{children:[v.jsx($i,{path:"/",element:v.jsx(CY,{})}),v.jsx($i,{path:"/mesh",element:v.jsx(V0e,{})}),v.jsx($i,{path:"/environment",element:v.jsx(hxe,{})}),v.jsx($i,{path:"/config",element:v.jsx(sxe,{})}),v.jsx($i,{path:"/alerts",element:v.jsx(xxe,{})}),v.jsx($i,{path:"/notifications",element:v.jsx(Cxe,{})}),v.jsx($i,{path:"/reference",element:v.jsx(Txe,{})}),v.jsx($i,{path:"/adapter-config",element:v.jsx(Axe,{})}),v.jsx($i,{path:"/gauge-sites",element:v.jsx(Nxe,{})}),v.jsx($i,{path:"/town-anchors",element:v.jsx(Pxe,{})})]})})})}CS.createRoot(document.getElementById("root")).render(v.jsx(Ch.StrictMode,{children:v.jsx(k$,{children:v.jsx(Ixe,{})})})); diff --git a/meshai/dashboard/static/assets/index-kJaaQ570.css b/meshai/dashboard/static/assets/index-LGjCLdSa.css similarity index 69% rename from meshai/dashboard/static/assets/index-kJaaQ570.css rename to meshai/dashboard/static/assets/index-LGjCLdSa.css index d81b5c9..10378e7 100644 --- a/meshai/dashboard/static/assets/index-kJaaQ570.css +++ b/meshai/dashboard/static/assets/index-LGjCLdSa.css @@ -1 +1 @@ -.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px #0006;background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{display:inline!important;vertical-align:baseline!important;width:1em;height:.6669em}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;box-sizing:border-box;background:#fffc;text-shadow:1px 1px #fff}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;color:#333;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.70710678,M12=.70710678,M21=-.70710678,M22=.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:JetBrains Mono,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.left-0{left:0}.left-0\.5{left:.125rem}.left-1{left:.25rem}.left-3{left:.75rem}.left-4{left:1rem}.right-0{right:0}.right-1{right:.25rem}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-0\.5{top:.125rem}.top-1{top:.25rem}.top-1\/2{top:50%}.top-4{top:1rem}.top-6{top:1.5rem}.top-full{top:100%}.z-0{z-index:0}.z-40{z-index:40}.z-50{z-index:50}.col-span-2{grid-column:span 2 / span 2}.-m-6{margin:-1.5rem}.-my-4{margin-top:-1rem;margin-bottom:-1rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-4{margin-top:1rem;margin-bottom:1rem}.-mb-px{margin-bottom:-1px}.-ml-2{margin-left:-.5rem}.-ml-4{margin-left:-1rem}.-mr-1{margin-right:-.25rem}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-0\.5{height:.125rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-20{height:5rem}.h-3{height:.75rem}.h-4{height:1rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-\[40vh\]{height:40vh}.h-\[540px\]{height:540px}.h-\[calc\(100vh-8rem\)\]{height:calc(100vh - 8rem)}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:12rem}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.max-h-\[85vh\]{max-height:85vh}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-2{width:.5rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-64{width:16rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-\[220px\]{width:220px}.w-\[250px\]{width:250px}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[200px\]{min-width:200px}.min-w-\[280px\]{min-width:280px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-\[150px\]{max-width:150px}.max-w-\[200px\]{max-width:200px}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-4{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-5{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-y{resize:vertical}.scroll-mt-6{scroll-margin-top:1.5rem}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-1{row-gap:.25rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-border>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(30 42 58 / var(--tw-divide-opacity, 1))}.divide-slate-700\/60>:not([hidden])~:not([hidden]){border-color:#33415599}.self-stretch{align-self:stretch}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[\#1e2a3a\]{--tw-border-opacity: 1;border-color:rgb(30 42 58 / var(--tw-border-opacity, 1))}.border-\[\#2a3a4a\]{--tw-border-opacity: 1;border-color:rgb(42 58 74 / var(--tw-border-opacity, 1))}.border-accent{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-amber-500{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.border-amber-500\/20{border-color:#f59e0b33}.border-amber-500\/30{border-color:#f59e0b4d}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-blue-500\/30{border-color:#3b82f64d}.border-border{--tw-border-opacity: 1;border-color:rgb(30 42 58 / var(--tw-border-opacity, 1))}.border-border\/50{border-color:#1e2a3a80}.border-green-500\/20{border-color:#22c55e33}.border-green-500\/30{border-color:#22c55e4d}.border-red-400\/30{border-color:#f871714d}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-red-500\/20{border-color:#ef444433}.border-red-500\/30{border-color:#ef44444d}.border-red-600\/30{border-color:#dc26264d}.border-red-700\/30{border-color:#b91c1c4d}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-slate-500\/30{border-color:#64748b4d}.border-slate-600{--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity, 1))}.border-slate-700{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.border-slate-700\/50{border-color:#33415580}.border-transparent{border-color:transparent}.border-yellow-500\/30{border-color:#eab3084d}.border-yellow-700{--tw-border-opacity: 1;border-color:rgb(161 98 7 / var(--tw-border-opacity, 1))}.border-l-blue-500{--tw-border-opacity: 1;border-left-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.bg-\[\#0a0e17\]{--tw-bg-opacity: 1;background-color:rgb(10 14 23 / var(--tw-bg-opacity, 1))}.bg-\[\#0d1219\]{--tw-bg-opacity: 1;background-color:rgb(13 18 25 / var(--tw-bg-opacity, 1))}.bg-\[\#0d1420\]{--tw-bg-opacity: 1;background-color:rgb(13 20 32 / var(--tw-bg-opacity, 1))}.bg-\[\#1a2332\]{--tw-bg-opacity: 1;background-color:rgb(26 35 50 / var(--tw-bg-opacity, 1))}.bg-\[\#1e2a3a\]{--tw-bg-opacity: 1;background-color:rgb(30 42 58 / var(--tw-bg-opacity, 1))}.bg-\[\#1e2a3a\]\/50{background-color:#1e2a3a80}.bg-accent{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-accent\/10{background-color:#3b82f61a}.bg-accent\/20{background-color:#3b82f633}.bg-amber-400{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-amber-500\/10{background-color:#f59e0b1a}.bg-amber-500\/20{background-color:#f59e0b33}.bg-bg{--tw-bg-opacity: 1;background-color:rgb(10 14 23 / var(--tw-bg-opacity, 1))}.bg-bg-card{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-bg-card\/90{background-color:#111827e6}.bg-bg-hover{--tw-bg-opacity: 1;background-color:rgb(26 35 50 / var(--tw-bg-opacity, 1))}.bg-black\/50{background-color:#00000080}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/20{background-color:#3b82f633}.bg-border{--tw-bg-opacity: 1;background-color:rgb(30 42 58 / var(--tw-bg-opacity, 1))}.bg-cyan-500\/20{background-color:#06b6d433}.bg-cyan-700{--tw-bg-opacity: 1;background-color:rgb(14 116 144 / var(--tw-bg-opacity, 1))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-500\/10{background-color:#22c55e1a}.bg-green-500\/20{background-color:#22c55e33}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-500\/20{background-color:#ef444433}.bg-red-600\/20{background-color:#dc262633}.bg-red-700\/20{background-color:#b91c1c33}.bg-slate-500{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity, 1))}.bg-slate-500\/20{background-color:#64748b33}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-800\/50{background-color:#1e293b80}.bg-slate-800\/60{background-color:#1e293b99}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-slate-900\/40{background-color:#0f172a66}.bg-slate-900\/50{background-color:#0f172a80}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/10{background-color:#eab3081a}.bg-yellow-500\/20{background-color:#eab30833}.bg-yellow-700{--tw-bg-opacity: 1;background-color:rgb(161 98 7 / var(--tw-bg-opacity, 1))}.bg-yellow-900\/40{background-color:#713f1266}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-blue-700{--tw-gradient-to: #1d4ed8 var(--tw-gradient-to-position)}.fill-slate-100{fill:#f1f5f9}.fill-slate-400{fill:#94a3b8}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pl-2{padding-left:.5rem}.pl-6{padding-left:1.5rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:JetBrains Mono,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.text-accent{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-amber-300{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-cyan-300{--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-red-200{--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-100{--tw-text-opacity: 1;color:rgb(254 249 195 / var(--tw-text-opacity, 1))}.text-yellow-200{--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.text-yellow-200\/80{color:#fef08acc}.text-yellow-300{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.text-yellow-300\/80{color:#fde047cc}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.placeholder-slate-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(100 116 139 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(100 116 139 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-600::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(71 85 105 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-600::placeholder{--tw-placeholder-opacity: 1;color:rgb(71 85 105 / var(--tw-placeholder-opacity, 1))}.accent-blue-500{accent-color:#3b82f6}.accent-cyan-500{accent-color:#06b6d4}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}body{background:#0a0e17;margin:0;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:#0a0e17}::-webkit-scrollbar-thumb{background:#2d3a4d;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#3b4a5d}.font-mono{font-family:JetBrains Mono,monospace}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.animate-pulse-slow{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes slide-in{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}.animate-slide-in{animation:slide-in .3s ease-out}.line-clamp-2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.last\:border-0:last-child{border-width:0px}.hover\:border-\[\#2a3a4a\]:hover{--tw-border-opacity: 1;border-color:rgb(42 58 74 / var(--tw-border-opacity, 1))}.hover\:border-accent:hover{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.hover\:bg-\[\#0a0e17\]:hover{--tw-bg-opacity: 1;background-color:rgb(10 14 23 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#1e2a3a\]:hover{--tw-bg-opacity: 1;background-color:rgb(30 42 58 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#1e2a3a\]\/50:hover{background-color:#1e2a3a80}.hover\:bg-\[\#2a3a4a\]:hover{--tw-bg-opacity: 1;background-color:rgb(42 58 74 / var(--tw-bg-opacity, 1))}.hover\:bg-accent\/10:hover{background-color:#3b82f61a}.hover\:bg-accent\/80:hover{background-color:#3b82f6cc}.hover\:bg-amber-500\/30:hover{background-color:#f59e0b4d}.hover\:bg-amber-600:hover{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity, 1))}.hover\:bg-bg-hover:hover{--tw-bg-opacity: 1;background-color:rgb(26 35 50 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-500\/10:hover{background-color:#3b82f61a}.hover\:bg-cyan-600:hover{--tw-bg-opacity: 1;background-color:rgb(8 145 178 / var(--tw-bg-opacity, 1))}.hover\:bg-red-500\/10:hover{background-color:#ef44441a}.hover\:bg-slate-500\/10:hover{background-color:#64748b1a}.hover\:bg-slate-600:hover{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-700:hover{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-800\/50:hover{background-color:#1e293b80}.hover\:bg-yellow-600:hover{--tw-bg-opacity: 1;background-color:rgb(202 138 4 / var(--tw-bg-opacity, 1))}.hover\:text-accent:hover{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.hover\:text-blue-300:hover{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.hover\:text-blue-800:hover{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.hover\:text-cyan-300:hover{--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.hover\:text-red-300:hover{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:text-slate-200:hover{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.hover\:text-slate-300:hover{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.focus\:border-accent:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\:border-slate-500:focus{--tw-border-opacity: 1;border-color:rgb(100 116 139 / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-slate-700:disabled{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-50:disabled{opacity:.5}.group[open] .group-open\:rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media (min-width: 640px){.sm\:block{display:block}.sm\:inline-flex{display:inline-flex}}@media (min-width: 768px){.md\:flex{display:flex}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}} +.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px #0006;background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{display:inline!important;vertical-align:baseline!important;width:1em;height:.6669em}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;box-sizing:border-box;background:#fffc;text-shadow:1px 1px #fff}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;color:#333;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.70710678,M12=.70710678,M21=-.70710678,M22=.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:JetBrains Mono,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.left-0{left:0}.left-0\.5{left:.125rem}.left-1{left:.25rem}.left-3{left:.75rem}.left-4{left:1rem}.right-0{right:0}.right-1{right:.25rem}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-0\.5{top:.125rem}.top-1{top:.25rem}.top-1\/2{top:50%}.top-4{top:1rem}.top-6{top:1.5rem}.top-full{top:100%}.z-0{z-index:0}.z-40{z-index:40}.z-50{z-index:50}.col-span-2{grid-column:span 2 / span 2}.-m-6{margin:-1.5rem}.-my-4{margin-top:-1rem;margin-bottom:-1rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-4{margin-top:1rem;margin-bottom:1rem}.-mb-px{margin-bottom:-1px}.-ml-2{margin-left:-.5rem}.-ml-4{margin-left:-1rem}.-mr-1{margin-right:-.25rem}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-0\.5{height:.125rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-20{height:5rem}.h-3{height:.75rem}.h-4{height:1rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-\[40vh\]{height:40vh}.h-\[540px\]{height:540px}.h-\[calc\(100vh-8rem\)\]{height:calc(100vh - 8rem)}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:12rem}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.max-h-\[85vh\]{max-height:85vh}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-2{width:.5rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-64{width:16rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-\[220px\]{width:220px}.w-\[250px\]{width:250px}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[200px\]{min-width:200px}.min-w-\[280px\]{min-width:280px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-\[150px\]{max-width:150px}.max-w-\[200px\]{max-width:200px}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-4{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-5{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-y{resize:vertical}.scroll-mt-6{scroll-margin-top:1.5rem}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-1{row-gap:.25rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-border>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(30 42 58 / var(--tw-divide-opacity, 1))}.divide-slate-700\/60>:not([hidden])~:not([hidden]){border-color:#33415599}.self-stretch{align-self:stretch}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[\#1e2a3a\]{--tw-border-opacity: 1;border-color:rgb(30 42 58 / var(--tw-border-opacity, 1))}.border-\[\#2a3a4a\]{--tw-border-opacity: 1;border-color:rgb(42 58 74 / var(--tw-border-opacity, 1))}.border-accent{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-amber-500{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.border-amber-500\/20{border-color:#f59e0b33}.border-amber-500\/30{border-color:#f59e0b4d}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-blue-500\/30{border-color:#3b82f64d}.border-border{--tw-border-opacity: 1;border-color:rgb(30 42 58 / var(--tw-border-opacity, 1))}.border-border\/50{border-color:#1e2a3a80}.border-green-500\/20{border-color:#22c55e33}.border-green-500\/30{border-color:#22c55e4d}.border-red-400\/30{border-color:#f871714d}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-red-500\/20{border-color:#ef444433}.border-red-500\/30{border-color:#ef44444d}.border-red-600\/30{border-color:#dc26264d}.border-red-700\/30{border-color:#b91c1c4d}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-slate-500\/30{border-color:#64748b4d}.border-slate-600{--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity, 1))}.border-slate-700{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.border-slate-700\/50{border-color:#33415580}.border-transparent{border-color:transparent}.border-yellow-500\/30{border-color:#eab3084d}.border-yellow-700{--tw-border-opacity: 1;border-color:rgb(161 98 7 / var(--tw-border-opacity, 1))}.border-l-blue-500{--tw-border-opacity: 1;border-left-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.bg-\[\#0a0e17\]{--tw-bg-opacity: 1;background-color:rgb(10 14 23 / var(--tw-bg-opacity, 1))}.bg-\[\#0d1219\]{--tw-bg-opacity: 1;background-color:rgb(13 18 25 / var(--tw-bg-opacity, 1))}.bg-\[\#0d1420\]{--tw-bg-opacity: 1;background-color:rgb(13 20 32 / var(--tw-bg-opacity, 1))}.bg-\[\#1a2332\]{--tw-bg-opacity: 1;background-color:rgb(26 35 50 / var(--tw-bg-opacity, 1))}.bg-\[\#1e2a3a\]{--tw-bg-opacity: 1;background-color:rgb(30 42 58 / var(--tw-bg-opacity, 1))}.bg-\[\#1e2a3a\]\/50{background-color:#1e2a3a80}.bg-accent{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-accent\/10{background-color:#3b82f61a}.bg-accent\/20{background-color:#3b82f633}.bg-amber-400{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-amber-500\/10{background-color:#f59e0b1a}.bg-amber-500\/20{background-color:#f59e0b33}.bg-bg{--tw-bg-opacity: 1;background-color:rgb(10 14 23 / var(--tw-bg-opacity, 1))}.bg-bg-card{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-bg-card\/90{background-color:#111827e6}.bg-bg-hover{--tw-bg-opacity: 1;background-color:rgb(26 35 50 / var(--tw-bg-opacity, 1))}.bg-black\/50{background-color:#00000080}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/20{background-color:#3b82f633}.bg-border{--tw-bg-opacity: 1;background-color:rgb(30 42 58 / var(--tw-bg-opacity, 1))}.bg-cyan-500\/20{background-color:#06b6d433}.bg-cyan-700{--tw-bg-opacity: 1;background-color:rgb(14 116 144 / var(--tw-bg-opacity, 1))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-500\/10{background-color:#22c55e1a}.bg-green-500\/20{background-color:#22c55e33}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-500\/20{background-color:#ef444433}.bg-red-600\/20{background-color:#dc262633}.bg-red-700\/20{background-color:#b91c1c33}.bg-slate-500{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity, 1))}.bg-slate-500\/20{background-color:#64748b33}.bg-slate-600{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-800\/50{background-color:#1e293b80}.bg-slate-800\/60{background-color:#1e293b99}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-slate-900\/40{background-color:#0f172a66}.bg-slate-900\/50{background-color:#0f172a80}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/10{background-color:#eab3081a}.bg-yellow-500\/20{background-color:#eab30833}.bg-yellow-700{--tw-bg-opacity: 1;background-color:rgb(161 98 7 / var(--tw-bg-opacity, 1))}.bg-yellow-900\/40{background-color:#713f1266}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-blue-700{--tw-gradient-to: #1d4ed8 var(--tw-gradient-to-position)}.fill-slate-100{fill:#f1f5f9}.fill-slate-400{fill:#94a3b8}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pl-2{padding-left:.5rem}.pl-6{padding-left:1.5rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:JetBrains Mono,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.text-accent{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-amber-300{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-cyan-300{--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-red-200{--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-100{--tw-text-opacity: 1;color:rgb(254 249 195 / var(--tw-text-opacity, 1))}.text-yellow-200{--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.text-yellow-200\/80{color:#fef08acc}.text-yellow-300{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.text-yellow-300\/80{color:#fde047cc}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.placeholder-slate-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(100 116 139 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(100 116 139 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-600::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(71 85 105 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-600::placeholder{--tw-placeholder-opacity: 1;color:rgb(71 85 105 / var(--tw-placeholder-opacity, 1))}.accent-blue-500{accent-color:#3b82f6}.accent-cyan-500{accent-color:#06b6d4}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}body{background:#0a0e17;margin:0;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:#0a0e17}::-webkit-scrollbar-thumb{background:#2d3a4d;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#3b4a5d}.font-mono{font-family:JetBrains Mono,monospace}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.animate-pulse-slow{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes slide-in{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}.animate-slide-in{animation:slide-in .3s ease-out}.line-clamp-2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.last\:border-0:last-child{border-width:0px}.hover\:border-\[\#2a3a4a\]:hover{--tw-border-opacity: 1;border-color:rgb(42 58 74 / var(--tw-border-opacity, 1))}.hover\:border-accent:hover{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.hover\:bg-\[\#0a0e17\]:hover{--tw-bg-opacity: 1;background-color:rgb(10 14 23 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#1e2a3a\]:hover{--tw-bg-opacity: 1;background-color:rgb(30 42 58 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#1e2a3a\]\/50:hover{background-color:#1e2a3a80}.hover\:bg-\[\#2a3a4a\]:hover{--tw-bg-opacity: 1;background-color:rgb(42 58 74 / var(--tw-bg-opacity, 1))}.hover\:bg-accent\/10:hover{background-color:#3b82f61a}.hover\:bg-accent\/80:hover{background-color:#3b82f6cc}.hover\:bg-amber-500\/30:hover{background-color:#f59e0b4d}.hover\:bg-amber-600:hover{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity, 1))}.hover\:bg-bg-hover:hover{--tw-bg-opacity: 1;background-color:rgb(26 35 50 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-500\/10:hover{background-color:#3b82f61a}.hover\:bg-cyan-600:hover{--tw-bg-opacity: 1;background-color:rgb(8 145 178 / var(--tw-bg-opacity, 1))}.hover\:bg-red-500\/10:hover{background-color:#ef44441a}.hover\:bg-slate-500\/10:hover{background-color:#64748b1a}.hover\:bg-slate-600:hover{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-700:hover{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-800\/50:hover{background-color:#1e293b80}.hover\:bg-yellow-600:hover{--tw-bg-opacity: 1;background-color:rgb(202 138 4 / var(--tw-bg-opacity, 1))}.hover\:text-accent:hover{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.hover\:text-blue-300:hover{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.hover\:text-blue-800:hover{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.hover\:text-cyan-300:hover{--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.hover\:text-red-300:hover{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:text-slate-200:hover{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.hover\:text-slate-300:hover{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.focus\:border-accent:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\:border-slate-500:focus{--tw-border-opacity: 1;border-color:rgb(100 116 139 / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-slate-700:disabled{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-50:disabled{opacity:.5}.group[open] .group-open\:rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media (min-width: 640px){.sm\:block{display:block}.sm\:inline-flex{display:inline-flex}}@media (min-width: 768px){.md\:flex{display:flex}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}} diff --git a/meshai/dashboard/static/index.html b/meshai/dashboard/static/index.html index 81976bd..c7c582f 100644 --- a/meshai/dashboard/static/index.html +++ b/meshai/dashboard/static/index.html @@ -8,8 +8,8 @@ - - + +