From 871d20dd7d7f490a315fea396a4bd95795506553 Mon Sep 17 00:00:00 2001 From: dee077 Date: Tue, 19 May 2026 05:48:42 +0530 Subject: [PATCH 1/4] [change] Replace custom popup handling with nodePopup config #795 Refactored geo and indoor maps to use the configurable NetJSONGraph nodePopup config, reducing duplicated popup handling logic. Fixes #795 --- .../device/static/monitoring/js/device-map.js | 370 +++++++++--------- .../device/static/monitoring/js/floorplan.js | 39 +- .../monitoring/js/lib/netjsongraph.min.js | 32 +- 3 files changed, 203 insertions(+), 238 deletions(-) diff --git a/openwisp_monitoring/device/static/monitoring/js/device-map.js b/openwisp_monitoring/device/static/monitoring/js/device-map.js index 5ced2be5a..724328739 100644 --- a/openwisp_monitoring/device/static/monitoring/js/device-map.js +++ b/openwisp_monitoring/device/static/monitoring/js/device-map.js @@ -56,68 +56,70 @@ }); }; - let currentPopup = null; - let currentPopupLocationId = null; - - const loadPopUpContent = function (nodeData, netjsongraphInstance, url) { + async function loadPopUpContent(nodeData, netjsongraphInstance) { loadingOverlay.show(); const map = netjsongraphInstance.leaflet; const locationId = nodeData?.properties?.id || nodeData.id; - url = url || getLocationDeviceUrl(locationId); + let popupContent = null; + const url = getLocationDeviceUrl(locationId); - if (currentPopup) { - currentPopup.remove(); - } + try { + const data = await $.ajax({ + dataType: "json", + url: url, + xhrFields: { withCredentials: true }, + }); + let devices = data.results; - $.ajax({ - dataType: "json", - url: url, - xhrFields: { withCredentials: true }, - success: function (data) { - let devices = data.results; - let nextUrl = data.next; - let statusFilterButtons = ""; - Object.entries(STATUS_LABELS).forEach(([status_key, status_label]) => { - statusFilterButtons += ` { + statusFilterButtons += ` ${gettext(status_label)} × `; - }); - const has_floorplan = data.has_floorplan; - const buttonText = gettext("Switch to Indoor View"); - const floorplan_btn = has_floorplan - ? `` - : ""; + : ""; - const popupTitle = nodeData.label; + const popupTitle = nodeData.label; - // Determine coordinates for the popup. We support: - // 1. NetJSONGraph objects (nodeData.location) - // 2. GeoJSON Point array (nodeData.coordinates) - // 3. GeoJSON Feature geometry (nodeData.geometry.coordinates) - // This fallback chain ensures the popup always plots at the correct - // position regardless of datasource format. - let latLng; - if (nodeData.location && typeof nodeData.location.lat === "number") { - latLng = [nodeData.location.lat, nodeData.location.lng]; - } else if (Array.isArray(nodeData.coordinates)) { - latLng = [nodeData.coordinates[1], nodeData.coordinates[0]]; - } else if (nodeData.geometry?.coordinates?.length >= 2) { - latLng = [nodeData.geometry.coordinates[1], nodeData.geometry.coordinates[0]]; - } + // Determine coordinates for the popup. We support: + // 1. NetJSONGraph objects (nodeData.location) + // 2. GeoJSON Point array (nodeData.coordinates) + // 3. GeoJSON Feature geometry (nodeData.geometry.coordinates) + // This fallback chain ensures the popup always plots at the correct + // position regardless of datasource format. + let latLng; + if (nodeData.location && typeof nodeData.location.lat === "number") { + latLng = [nodeData.location.lat, nodeData.location.lng]; + } else if (Array.isArray(nodeData.coordinates)) { + latLng = [nodeData.coordinates[1], nodeData.coordinates[0]]; + } else if (nodeData.geometry?.coordinates?.length >= 2) { + latLng = [nodeData.geometry.coordinates[1], nodeData.geometry.coordinates[0]]; + } - if (!latLng || isNaN(latLng[0]) || isNaN(latLng[1])) { - console.warn(gettext("Could not determine coordinates for popup"), nodeData); - loadingOverlay.hide(); - return; - } + if (!latLng || isNaN(latLng[0]) || isNaN(latLng[1])) { + console.warn(gettext("Could not determine coordinates for popup"), nodeData); + loadingOverlay.hide(); + return; + } - const popupContent = ` + popupContent = `

${escapeHtml(popupTitle)} (${data.count})

@@ -135,151 +137,150 @@ ${gettext("status")} - ${renderRows()} + ${renderRows(netjsongraphInstance)}
${floorplan_btn}
`; + loadingOverlay.hide(); + return popupContent; + } catch (error) { + loadingOverlay.hide(); + alert(gettext("Error while retrieving data")); + console.error(error); + return null; + } + } - currentPopupLocationId = locationId; - currentPopup = L.popup({ - autoPan: true, - autoPanPadding: [25, 25], - }) - .setLatLng(latLng) - .setContent(popupContent) - .openOn(map); - const el = $(currentPopup.getElement()); - function renderRows(deviceList) { - deviceList = deviceList || devices; - const popup = $(".map-detail"); - if (deviceList.length === 0) { - popup.find("tbody").html(` - - - ${gettext("No devices found")} - - - `); - return ""; - } - const rows = deviceList - .map( - (device) => ` - - ${escapeHtml(device.name)} - - - ${escapeHtml(gettext(device.monitoring.status_label))} - - - - `, - ) - .join(""); - popup.find("tbody").html(rows); - return rows; + function renderRows(netjsongraphInstance, deviceList) { + deviceList = deviceList || netjsongraphInstance.leaflet._popupState.devices; + // deviceList = deviceList || devices; + const popup = $(".map-detail"); + if (deviceList.length === 0) { + popup.find("tbody").html(` + + + ${gettext("No devices found")} + + + `); + return ""; + } + const rows = deviceList + .map( + (device) => ` + + ${escapeHtml(device.name)} + + + ${escapeHtml(gettext(device.monitoring.status_label))} + + + + `, + ) + .join(""); + popup.find("tbody").html(rows); + return rows; + } + + function bindPopupEventListener(netjsongraphInstance) { + const currentPopup = netjsongraphInstance.leaflet.currentPopup; + if (!currentPopup) { + console.error("Popup not found, cann't bind event listeners"); + return; + } + let { devices, nextUrl, url, locationId } = + netjsongraphInstance.leaflet._popupState; + const el = $(currentPopup.getElement()); + let fetchDevicesTimeout; + let loading = false; + function fetchDevices(url, ms = 0, append) { + if (!url || loading) return; + clearTimeout(fetchDevicesTimeout); + loading = true; + const spinner = el.find(".table-spinner"); + const table = el.find(".table-container table"); + spinner.show(); + table.hide(); + fetchDevicesTimeout = setTimeout(() => { + let params = new URLSearchParams(); + const searchParam = el.find("#device-search").val().toLowerCase().trim(); + const statusParam = el.find("#status-filter").val(); + if (searchParam) { + params.append("search", searchParam); } - let fetchDevicesTimeout; - let loading = false; - function fetchDevices(url, ms = 0, append) { - if (!url || loading) return; - clearTimeout(fetchDevicesTimeout); - loading = true; - const spinner = el.find(".table-spinner"); - const table = el.find(".table-container table"); - spinner.show(); - table.hide(); - fetchDevicesTimeout = setTimeout(() => { - let params = new URLSearchParams(); - const searchParam = el.find("#device-search").val().toLowerCase().trim(); - const statusParam = el.find("#status-filter").val(); - if (searchParam) { - params.append("search", searchParam); - } - if (statusParam) { - statusParam.split(",").forEach((status) => { - params.append("status", status); - }); - } - const queryString = params.toString(); - let fetchUrl; - // if append is true, that means we are fetching for infinite scroll + if (statusParam) { + statusParam.split(",").forEach((status) => { + params.append("status", status); + }); + } + const queryString = params.toString(); + let fetchUrl; + // if append is true, that means we are fetching for infinite scroll + if (append) { + fetchUrl = url; // url is nextUrl, already contains params + } else { + fetchUrl = queryString ? `${url}?${queryString}` : url; + } + $.ajax({ + dataType: "json", + url: fetchUrl, + xhrFields: { withCredentials: true }, + success(data) { + debugger; if (append) { - fetchUrl = url; // url is nextUrl, already contains params + devices = devices.concat(data.results); } else { - fetchUrl = queryString ? `${url}?${queryString}` : url; + devices = data.results; } - $.ajax({ - dataType: "json", - url: fetchUrl, - xhrFields: { withCredentials: true }, - success(data) { - if (append) { - devices = devices.concat(data.results); - } else { - devices = data.results; - } - nextUrl = data.next; - renderRows(devices); - }, - error() { - console.error(gettext("Could not load more devices from"), url); - alert(gettext("Could not load more devices.")); - }, - complete() { - loading = false; - spinner.hide(); - table.show(); - }, - }); - }, ms); - } - el.find("#device-search").on("input", function () { - fetchDevices(url, 300); + nextUrl = data.next; + renderRows(netjsongraphInstance, devices); + }, + error() { + console.error(gettext("Could not load more devices from"), url); + alert(gettext("Could not load more devices.")); + }, + complete() { + loading = false; + spinner.hide(); + table.show(); + }, }); - let activeStatuses = []; - el.find(".status-filter").on("click", function (e) { - e.stopPropagation(); - const btn = $(this); - const status = btn.data("status"); + }, ms); + } + el.find("#device-search").on("input", function () { + fetchDevices(url, 300); + }); + let activeStatuses = []; + el.find(".status-filter").on("click", function (e) { + e.stopPropagation(); + const btn = $(this); + const status = btn.data("status"); - if (btn.hasClass("active")) { - btn.removeClass("active"); - activeStatuses = activeStatuses.filter((s) => s !== status); - } else { - btn.addClass("active"); - activeStatuses.push(status); - } - $(`#status-filter`).val(activeStatuses.join(",")); - fetchDevices(url); - }); - el.find(".table-container").on("scroll", function () { - if (this.scrollTop + this.clientHeight >= this.scrollHeight - 10) { - fetchDevices(nextUrl, 100, true); - } - }); - el.find(".floorplan-btn").on("click", function () { - const floorplanUrl = getIndoorCoordinatesUrl(locationId); - window.openFloorPlan(floorplanUrl, locationId); - }); - el.find(".leaflet-popup-close-button").on("click", function () { - const id = netjsongraphInstance.config.bookmarkableActions.id; - netjsongraphInstance.utils.removeUrlFragment(id); - currentPopup = null; - currentPopupLocationId = null; - }); - loadingOverlay.hide(); - }, - error: function () { - loadingOverlay.hide(); - alert(gettext("Error while retrieving data")); - }, + if (btn.hasClass("active")) { + btn.removeClass("active"); + activeStatuses = activeStatuses.filter((s) => s !== status); + } else { + btn.addClass("active"); + activeStatuses.push(status); + } + $(`#status-filter`).val(activeStatuses.join(",")); + fetchDevices(url); }); - }; + el.find(".table-container").on("scroll", function () { + if (this.scrollTop + this.clientHeight >= this.scrollHeight - 10) { + fetchDevices(nextUrl, 100, true); + } + }); + el.find(".floorplan-btn").on("click", function () { + const floorplanUrl = getIndoorCoordinatesUrl(locationId); + window.openFloorPlan(floorplanUrl, locationId); + }); + } const leafletConfig = JSON.parse($("#leaflet-config").text()); const tiles = leafletConfig.TILES.map((tile) => { @@ -341,6 +342,17 @@ }, ], }, + nodePopup: { + show: true, + content: loadPopUpContent, + onOpen: bindPopupEventListener, + config: { + closeOnClick: false, + autoPan: true, + autoPanPadding: [25, 25], + offset: [0, 0], + }, + }, }, bookmarkableActions: { enabled: true, @@ -353,7 +365,7 @@ nodeStyle: { color: STATUS_COLORS[status] }, })), // Hide ECharts node labels completely at any zoom level - showLabelsAtZoomLevel: 0, + showMapLabelsAtZoom: 0, echartsOption: { tooltip: { show: false, // Completely disable tooltips @@ -422,11 +434,7 @@ }); }, }, - onClickElement: function (type, data) { - if (type === "node") { - loadPopUpContent(data, this); - } - }, + onClickElement: function () {}, onReady: function () { const map = this; let scale = { imperial: false, metric: false }; diff --git a/openwisp_monitoring/device/static/monitoring/js/floorplan.js b/openwisp_monitoring/device/static/monitoring/js/floorplan.js index 4a080033d..c2ab3decf 100644 --- a/openwisp_monitoring/device/static/monitoring/js/floorplan.js +++ b/openwisp_monitoring/device/static/monitoring/js/floorplan.js @@ -352,12 +352,7 @@ indoorMap?.utils?.updateUrlFragments(fragments); } - let currentPopup = null; function loadPopUpContent(node, netjsongraphInstance) { - const map = netjsongraphInstance.leaflet; - if (currentPopup) { - currentPopup.remove(); - } const popupContent = `
@@ -382,29 +377,14 @@
`; - // Popup does not show on closeOnClick: true (default) - currentPopup = L.popup({ - closeOnClick: false, - }) - .setLatLng(node?.properties.location) - .setContent(popupContent) - .openOn(map); - currentPopup.on("remove", () => { - const fragments = netjsongraphInstance.utils.parseUrlFragments(); - const { id } = netjsongraphInstance.config.bookmarkableActions; - if (fragments[id]) { - fragments[id].delete("nodeId"); - netjsongraphInstance.utils.updateUrlFragments(fragments); - } - currentPopup = null; - }); + return popupContent; } function renderIndoorMap(allResults, imageUrl, divId, floor) { const indoorMap = new NetJSONGraph(allResults, { el: `#${divId}`, render: "map", - showLabelsAtZoomLevel: 0, + showMapLabelsAtZoom: 0, mapOptions: { center: [0, 0], zoom: 0, @@ -425,6 +405,16 @@ }, }, baseOptions: { media: [{ option: { tooltip: { show: false } } }] }, + nodePopup: { + show: true, + content: loadPopUpContent, + config: { + closeOnClick: false, + autoPan: true, + autoPanPadding: [25, 25], + offset: null, + }, + }, }, bookmarkableActions: { enabled: true, @@ -517,7 +507,6 @@ initialZoom = map.getZoom(); map.invalidateSize(); $(".floorplan-loading-spinner").hide(); - map.on("fullscreenchange", () => { const floorNavigation = $("#floorplan-navigation"); const zoomSnap = map.options.zoomSnap || 1; @@ -539,9 +528,7 @@ // without requiring a node click to add the fragment. pushIndoorMapIdFragment(this, locationId, floor); }, - onClickElement: function (type, data) { - loadPopUpContent(data, this); - }, + onClickElement: function () {}, }); indoorMap.setUtils({ // Added a utility function to open a specific popup for a device Id in selenium tests diff --git a/openwisp_monitoring/device/static/monitoring/js/lib/netjsongraph.min.js b/openwisp_monitoring/device/static/monitoring/js/lib/netjsongraph.min.js index ebb13a055..7d3e0807a 100644 --- a/openwisp_monitoring/device/static/monitoring/js/lib/netjsongraph.min.js +++ b/openwisp_monitoring/device/static/monitoring/js/lib/netjsongraph.min.js @@ -1,31 +1 @@ -(()=>{var t={123:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var i=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},r=new function(){this.browser=new i,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(r.wxa=!0,r.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?r.worker=!0:!r.hasGlobalWindow||"Deno"in window||"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Node.js")>-1?(r.node=!0,r.svgSupported=!0):function(t,e){var n=e.browser,i=t.match(/Firefox\/([\d.]+)/),r=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),o=t.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(t);i&&(n.firefox=!0,n.version=i[1]);r&&(n.ie=!0,n.version=r[1]);o&&(n.edge=!0,n.version=o[1],n.newEdge=+o[1].split(".")[0]>18);a&&(n.weChat=!0);e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,e.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11);var s=e.domSupported="undefined"!=typeof document;if(s){var l=document.documentElement.style;e.transform3dSupported=(n.ie&&"transition"in l||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in l)&&!("OTransition"in l),e.transformSupported=e.transform3dSupported||n.ie&&+n.version>=9}}(navigator.userAgent,r);const o=r},214:function(t,e){ -/* @preserve - * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com - * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade - */ -!function(t){"use strict";function e(t){for(var e,n,i=1,r=arguments.length;i=this.min.x&&n.x<=this.max.x&&e.y>=this.min.y&&n.y<=this.max.y},intersects:function(t){t=k(t);var e=this.min,n=this.max,i=t.min,r=(t=t.max).x>=e.x&&i.x<=n.x;return t=t.y>=e.y&&i.y<=n.y,r&&t},overlaps:function(t){t=k(t);var e=this.min,n=this.max,i=t.min,r=(t=t.max).x>e.x&&i.xe.y&&i.y=i.lat&&n.lat<=r.lat&&e.lng>=i.lng&&n.lng<=r.lng},intersects:function(t){t=B(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),r=(t=t.getNorthEast()).lat>=e.lat&&i.lat<=n.lat;return t=t.lng>=e.lng&&i.lng<=n.lng,r&&t},overlaps:function(t){t=B(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),r=(t=t.getNorthEast()).lat>e.lat&&i.late.lng&&i.lng","http://www.w3.org/2000/svg"===(Ct.firstChild&&Ct.firstChild.namespaceURI));function Lt(t){return 0<=navigator.userAgent.toLowerCase().indexOf(t)}var At={ie:J,ielt9:$,edge:Q,webkit:tt,android:et,android23:nt,androidStock:it,opera:rt,chrome:ot,gecko:at,safari:st,phantom:lt,opera12:ut,win:ht,ie3d:ct,webkit3d:dt,gecko3d:K,any3d:ft,mobile:Kn,mobileWebkit:pt,mobileWebkit3d:gt,msPointer:mt,pointer:vt,touch:yt,touchNative:_t,mobileOpera:xt,mobileGecko:wt,retina:bt,passiveEvents:Tt,canvas:St,svg:Mt,vml:!Mt&&function(){try{var t=document.createElement("div"),e=(t.innerHTML='',t.firstChild);return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),inlineSvg:Ct,mac:0===navigator.platform.indexOf("Mac"),linux:0===navigator.platform.indexOf("Linux")},Dt=At.msPointer?"MSPointerDown":"pointerdown",It=At.msPointer?"MSPointerMove":"pointermove",Pt=At.msPointer?"MSPointerUp":"pointerup",Et=At.msPointer?"MSPointerCancel":"pointercancel",Ot={touchstart:Dt,touchmove:It,touchend:Pt,touchcancel:Et},Nt={touchstart:function(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&Ee(e),Gt(t,e)},touchmove:Gt,touchend:Gt,touchcancel:Gt},Rt={},kt=!1;function zt(t,e,n){return"touchstart"!==e||kt||(document.addEventListener(Dt,Bt,!0),document.addEventListener(It,Ft,!0),document.addEventListener(Pt,Vt,!0),document.addEventListener(Et,Vt,!0),kt=!0),Nt[e]?(n=Nt[e].bind(this,n),t.addEventListener(Ot[e],n,!1),n):(console.warn("wrong event specified:",e),u)}function Bt(t){Rt[t.pointerId]=t}function Ft(t){Rt[t.pointerId]&&(Rt[t.pointerId]=t)}function Vt(t){delete Rt[t.pointerId]}function Gt(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var n in e.touches=[],Rt)e.touches.push(Rt[n]);e.changedTouches=[e],t(e)}}var Ht=200;function Ut(t,e){t.addEventListener("dblclick",e);var n,i=0;function r(t){var r;1!==t.detail?n=t.detail:"mouse"===t.pointerType||t.sourceCapabilities&&!t.sourceCapabilities.firesTouchEvents||(r=Ne(t)).some((function(t){return t instanceof HTMLLabelElement&&t.attributes.for}))&&!r.some((function(t){return t instanceof HTMLInputElement||t instanceof HTMLSelectElement}))||((r=Date.now())-i<=Ht?2==++n&&e(function(t){var e,n,i={};for(n in t)e=t[n],i[n]=e&&e.bind?e.bind(t):e;return(t=i).type="dblclick",i.detail=2,i.isTrusted=!1,i._simulated=!0,i}(t)):n=1,i=r)}return t.addEventListener("click",r),{dblclick:e,simDblclick:r}}var Wt,jt,Zt,Xt,qt,Yt,Kt=de(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Jt=de(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),$t="webkitTransition"===Jt||"OTransition"===Jt?Jt+"End":"transitionend";function Qt(t){return"string"==typeof t?document.getElementById(t):t}function te(t,e){var n=t.style[e]||t.currentStyle&&t.currentStyle[e];return"auto"===(n=n&&"auto"!==n||!document.defaultView?n:(t=document.defaultView.getComputedStyle(t,null))?t[e]:null)?null:n}function ee(t,e,n){return(t=document.createElement(t)).className=e||"",n&&n.appendChild(t),t}function ne(t){var e=t.parentNode;e&&e.removeChild(t)}function ie(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function re(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function oe(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ae(t,e){return void 0!==t.classList?t.classList.contains(e):0<(t=he(t)).length&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(t)}function se(t,e){var n;if(void 0!==t.classList)for(var i=d(e),r=0,o=i.length;rthis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var n=this.getCenter();return t=this._limitCenter(n,this._zoom,B(t)),n.equals(t)||this.panTo(t,e),this._enforcingBounds=!1,this},panInside:function(t,e){var n=N((e=e||{}).paddingTopLeft||e.padding||[0,0]),i=N(e.paddingBottomRight||e.padding||[0,0]),r=this.project(this.getCenter()),o=(t=this.project(t),(n=k([(o=this.getPixelBounds()).min.add(n),o.max.subtract(i)])).getSize());return n.contains(t)||(this._enforcingBounds=!0,i=t.subtract(n.getCenter()),n=n.extend(t).getSize().subtract(o),r.x+=i.x<0?-n.x:n.x,r.y+=i.y<0?-n.y:n.y,this.panTo(this.unproject(r),e),this._enforcingBounds=!1),this},invalidateSize:function(t){if(!this._loaded)return this;t=e({animate:!1,pan:!0},!0===t?{animate:!0}:t);var n=this.getSize(),i=(this._sizeChanged=!0,this._lastCenter=null,this.getSize()),o=n.divideBy(2).round(),a=i.divideBy(2).round();return(o=o.subtract(a)).x||o.y?(t.animate&&t.pan?this.panBy(o):(t.pan&&this._rawPanBy(o),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(r(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){var n,i;return t=this._locateOptions=e({timeout:1e4,watch:!1},t),"geolocation"in navigator?(n=r(this._handleGeolocationResponse,this),i=r(this._handleGeolocationError,this),t.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,i,t):navigator.geolocation.getCurrentPosition(n,i,t)):this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e;this._container._leaflet_id&&(e=t.code,t=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout"),this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+t+"."}))},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e,n,i=new F(t.coords.latitude,t.coords.longitude),r=i.toBounds(2*t.coords.accuracy),o=this._locateOptions,a=(o.setView&&(e=this.getBoundsZoom(r),this.setView(i,o.maxZoom?Math.min(e,o.maxZoom):e)),{latlng:i,bounds:r,timestamp:t.timestamp});for(n in t.coords)"number"==typeof t.coords[n]&&(a[n]=t.coords[n]);this.fire("locationfound",a)}},addHandler:function(t,e){return e&&(e=this[t]=new e(this),this._handlers.push(e),this.options[t]&&e.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(t){this._container._leaflet_id=void 0,this._containerId=void 0}for(var t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ne(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(C(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ne(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){return e=ee("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane),t&&(this._panes[t]=e),e},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new z(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,n){t=B(t),n=N(n||[0,0]);var i=this.getZoom()||0,r=this.getMinZoom(),o=this.getMaxZoom(),a=t.getNorthWest(),s=(t=t.getSouthEast(),n=this.getSize().subtract(n),t=k(this.project(t,i),this.project(a,i)).getSize(),a=At.any3d?this.options.zoomSnap:1,n.x/t.x);return n=n.y/t.y,t=e?Math.max(s,n):Math.min(s,n),i=this.getScaleZoom(t,i),a&&(i=Math.round(i/(a/100))*(a/100),i=e?Math.ceil(i/a)*a:Math.floor(i/a)*a),Math.max(r,Math.min(o,i))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new E(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){return new R(t=this._getTopLeftPoint(t,e),t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var n=this.options.crs;return e=void 0===e?this._zoom:e,n.scale(t)/n.scale(e)},getScaleZoom:function(t,e){var n=this.options.crs;return e=void 0===e?this._zoom:e,t=n.zoom(t*n.scale(e)),isNaN(t)?1/0:t},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(V(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(N(t),e)},layerPointToLatLng:function(t){return t=N(t).add(this.getPixelOrigin()),this.unproject(t)},latLngToLayerPoint:function(t){return this.project(V(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(V(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(B(t))},distance:function(t,e){return this.options.crs.distance(V(t),V(e))},containerPointToLayerPoint:function(t){return N(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return N(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){return t=this.containerPointToLayerPoint(N(t)),this.layerPointToLatLng(t)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(V(t)))},mouseEventToContainerPoint:function(t){return Re(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){if(!(t=this._container=Qt(t)))throw new Error("Map container not found.");if(t._leaflet_id)throw new Error("Map container is already initialized.");be(t,"scroll",this._onScroll,this),this._containerId=a(t)},_initLayout:function(){var t=this._container,e=(this._fadeAnimated=this.options.fadeAnimation&&At.any3d,se(t,"leaflet-container"+(At.touch?" leaflet-touch":"")+(At.retina?" leaflet-retina":"")+(At.ielt9?" leaflet-oldie":"")+(At.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":"")),te(t,"position"));"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),pe(this._mapPane,new E(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(se(t.markerPane,"leaflet-zoom-hide"),se(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,n){pe(this._mapPane,new E(0,0));var i=!this._loaded,r=(this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset"),this._zoom!==e);this._moveStart(r,n)._move(t,e)._moveEnd(r),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,n,i){void 0===e&&(e=this._zoom);var r=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),i?n&&n.pinch&&this.fire("zoom",n):((r||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return C(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){pe(this._mapPane,this._getMapPanePos().subtract(t))},_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(t){this._targets={};var e=t?Se:be;e((this._targets[a(this._container)]=this)._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),At.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){C(this._resizeRequest),this._resizeRequest=M((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var n,i=[],r="mouseout"===e||"mouseover"===e,o=t.target||t.srcElement,s=!1;o;){if((n=this._targets[a(o)])&&("click"===e||"preclick"===e)&&this._draggableMoved(n)){s=!0;break}if(n&&n.listens(e,!0)){if(r&&!Be(o,t))break;if(i.push(n),r)break}if(o===this._container)break;o=o.parentNode}return i.length||s||r||!this.listens(e,!0)?i:[this]},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e,n=t.target||t.srcElement;!this._loaded||n._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(n)||("mousedown"===(e=t.type)&&_e(n),this._fireDOMEvent(t,e))},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,n,i){"click"===t.type&&((l=e({},t)).type="preclick",this._fireDOMEvent(l,l.type,i));var r=this._findEventTargets(t,n);if(i){for(var o=[],a=0;athis.options.zoomAnimationThreshold)return!1;var i=this.getZoomScale(e);if(i=this._getCenterOffset(t)._divideBy(1-1/i),!0!==n.animate&&!this.getSize().contains(i))return!1;M((function(){this._moveStart(!0,n.noMoveStart||!1)._animateZoom(t,e,!0)}),this)}return!0},_animateZoom:function(t,e,n,i){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,se(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:i}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(r(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&le(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 Ge(t){return new Ue(t)}var He,Ue=D.extend({options:{position:"topright"},initialize:function(t){f(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),n=this.getPosition();return t=t._controlCorners[n],se(e,"leaflet-control"),-1!==n.indexOf("bottom")?t.insertBefore(e,t.firstChild):t.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(ne(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&0",(e=document.createElement("div")).innerHTML=t,e.firstChild},_addItem:function(t){var e,n=document.createElement("label"),i=this._map.hasLayer(t.layer),r=((t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=i):e=this._createRadioElement("leaflet-base-layers_"+a(this),i),this._layerControlInputs.push(e),e.layerId=a(t.layer),be(e,"click",this._onInputClick,this),i=document.createElement("span")).innerHTML=" "+t.name,document.createElement("span"));return n.appendChild(r),r.appendChild(e),r.appendChild(i),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var t,e,n=this._layerControlInputs,i=[],r=[];this._handlingClick=!0;for(var o=n.length-1;0<=o;o--)t=n[o],e=this._getLayer(t.layerId).layer,t.checked?i.push(e):t.checked||r.push(e);for(o=0;oe.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section,e=(this._preventClick=!0,be(t,"click",Ee),this.expand(),this);setTimeout((function(){Se(t,"click",Ee),e._preventClick=!1}))}})),je=Ue.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",n=ee("div",e+" leaflet-bar"),i=this.options;return this._zoomInButton=this._createButton(i.zoomInText,i.zoomInTitle,e+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(i.zoomOutText,i.zoomOutTitle,e+"-out",n,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(t){t.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(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,n,i,r){return(n=ee("a",n,i)).innerHTML=t,n.href="#",n.title=e,n.setAttribute("role","button"),n.setAttribute("aria-label",e),Pe(n),be(n,"click",Oe),be(n,"click",r,this),be(n,"click",this._refocusOnMap,this),n},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";le(this._zoomInButton,e),le(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),!this._disabled&&t._zoom!==t.getMinZoom()||(se(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),!this._disabled&&t._zoom!==t.getMaxZoom()||(se(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}}),Ze=(Ve.mergeOptions({zoomControl:!0}),Ve.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new je,this.addControl(this.zoomControl))})),Ue.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",n=ee("div",e),i=this.options;return this._addScales(i,e+"-line",n),t.on(i.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),n},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,n){t.metric&&(this._mScale=ee("div",e,n)),t.imperial&&(this._iScale=ee("div",e,n))},_update:function(){var t=(e=this._map).getSize().y/2,e=e.distance(e.containerPointToLatLng([0,t]),e.containerPointToLatLng([this.options.maxWidth,t]));this._updateScales(e)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,n;5280<(t*=3.2808399)?(n=this._getRoundNum(e=t/5280),this._updateScale(this._iScale,n+" mi",n/e)):(n=this._getRoundNum(t),this._updateScale(this._iScale,n+" ft",n/t))},_updateScale:function(t,e,n){t.style.width=Math.round(this.options.maxWidth*n)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1);return e*(10<=(t/=e)?10:5<=t?5:3<=t?3:2<=t?2:1)}})),Xe=Ue.extend({options:{position:"bottomright",prefix:''+(At.inlineSvg?' ':"")+"Leaflet"},initialize:function(t){f(this,t),this._attributions={}},onAdd:function(t){for(var e in(t.attributionControl=this)._container=ee("div","leaflet-control-attribution"),Pe(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",(function(){this.removeAttribution(t.layer.getAttribution())}),this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t&&(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update()),this},removeAttribution:function(t){return t&&this._attributions[t]&&(this._attributions[t]--,this._update()),this},_update:function(){if(this._map){var t,e=[];for(t in this._attributions)this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix),e.length&&n.push(e.join(", ")),this._container.innerHTML=n.join(' ')}}}),qe=(Ve.mergeOptions({attributionControl:!0}),Ve.addInitHook((function(){this.options.attributionControl&&(new Xe).addTo(this)})),Ue.Layers=We,Ue.Zoom=je,Ue.Scale=Ze,Ue.Attribution=Xe,Ge.layers=function(t,e,n){return new We(t,e,n)},Ge.zoom=function(t){return new je(t)},Ge.scale=function(t){return new Ze(t)},Ge.attribution=function(t){return new Xe(t)},Q=D.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}}),Q.addTo=function(t,e){return t.addHandler(e,this),this},tt={Events:I},At.touch?"touchstart mousedown":"mousedown"),Ye=P.extend({options:{clickTolerance:3},initialize:function(t,e,n,i){f(this,i),this._element=t,this._dragStartTarget=e||t,this._preventOutline=n},enable:function(){this._enabled||(be(this._dragStartTarget,qe,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Ye._dragging===this&&this.finishDrag(!0),Se(this._dragStartTarget,qe,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){var e,n;this._enabled&&(this._moved=!1,ae(this._element,"leaflet-zoom-anim")||(t.touches&&1!==t.touches.length?Ye._dragging===this&&this.finishDrag():Ye._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||((Ye._dragging=this)._preventOutline&&_e(this._element),me(),Zt(),this._moving||(this.fire("down"),n=t.touches?t.touches[0]:t,e=xe(this._element),this._startPoint=new E(n.clientX,n.clientY),this._startPos=ge(this._element),this._parentScale=we(e),n="mousedown"===t.type,be(document,n?"mousemove":"touchmove",this._onMove,this),be(document,n?"mouseup":"touchend touchcancel",this._onUp,this)))))},_onMove:function(t){var e;this._enabled&&(t.touches&&1e&&(n.push(t[i]),r=i);return re.max.x&&(n|=2),t.ye.max.y&&(n|=8),n}function on(t,e,n,i){var r=e.x,o=(e=e.y,n.x-r),a=n.y-e,s=o*o+a*a;return 0this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()t.y!=i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(u=!u);return u||yn.prototype._containsPoint.call(this,t,!0)}}),wn=cn.extend({initialize:function(t,e){f(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,n,i,r=v(t)?t:t.features;if(r){for(e=0,n=r.length;eo.x&&(a=n.x+s-o.x+r.x),n.x-a-i.x<(s=0)&&(a=n.x-i.x),n.y+e+r.y>o.y&&(s=n.y+e-o.y+r.y),n.y-s-i.y<0&&(s=n.y-i.y),(a||s)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([a,s]))))},_getAnchor:function(){return N(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}})),kn=(Ve.mergeOptions({closePopupOnClick:!0}),Ve.include({openPopup:function(t,e,n){return this._initOverlay(Rn,t,e,n).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),ut.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Rn,this._popup,t,e),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(t){return this._popup&&(this instanceof cn||(this._popup._source=this),this._popup._prepareOpen(t||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()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e;this._popup&&this._map&&(Oe(t),e=t.layer||t.target,this._popup._source!==e||e instanceof mn?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}}),Nn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){Nn.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){Nn.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=Nn.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=ee("div",t),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+a(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,n=this._map,i=this._container,r=n.latLngToContainerPoint(n.getCenter()),o=(n=n.layerPointToContainerPoint(t),this.options.direction),a=i.offsetWidth,s=i.offsetHeight,l=N(this.options.offset),u=this._getAnchor();n="top"===o?(e=a/2,s):"bottom"===o?(e=a/2,0):(e="center"===o?a/2:"right"===o?0:"left"===o?a:n.xthis.options.maxZoom||ithis.options.maxZoom||void 0!==this.options.minZoom&&rn.max.x)||!e.wrapLat&&(t.yn.max.y))return!1}return!this.options.bounds||(e=this._tileCoordsToBounds(t),B(this.options.bounds).overlaps(e))},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,n=this.getTileSize(),i=t.scaleBy(n);return n=i.add(n),[e.unproject(i,t.z),e.unproject(n,t.z)]},_tileCoordsToBounds:function(t){return t=new z((t=this._tileCoordsToNwSe(t))[0],t[1]),this.options.noWrap?t:this._map.wrapLatLngBounds(t)},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=new E(+(t=t.split(":"))[0],+t[1]);return e.z=+t[2],e},_removeTile:function(t){var e=this._tiles[t];e&&(ne(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){se(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=u,t.onmousemove=u,At.ielt9&&this.options.opacity<1&&ce(t,this.options.opacity)},_addTile:function(t,e){var n=this._getTilePos(t),i=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),r(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&M(r(this._tileReady,this,t,null,o)),pe(o,n),this._tiles[i]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,n){e&&this.fire("tileerror",{error:e,tile:n,coords:t});var i=this._tileCoordsToKey(t);(n=this._tiles[i])&&(n.loaded=+new Date,this._map._fadeAnimated?(ce(n.el,0),C(this._fadeFrame),this._fadeFrame=M(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),e||(se(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),At.ielt9||!this._map._fadeAnimated?M(this._pruneTiles,this):setTimeout(r(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new E(this._wrapX?l(t.x,this._wrapX):t.x,this._wrapY?l(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new R(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}}),Fn=Bn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=f(this,e)).detectRetina&&At.retina&&0')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Zn=(dt={_initContainer:function(){this._container=ee("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Hn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=jn("shape");se(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=jn("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[a(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;ne(e),t.removeInteractiveTarget(e),delete this._layers[a(t)]},_updateStyle:function(t){var e=t._stroke,n=t._fill,i=t.options,r=t._container;r.stroked=!!i.stroke,r.filled=!!i.fill,i.stroke?(e=e||(t._stroke=jn("stroke")),r.appendChild(e),e.weight=i.weight+"px",e.color=i.color,e.opacity=i.opacity,i.dashArray?e.dashStyle=v(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=i.lineCap.replace("butt","flat"),e.joinstyle=i.lineJoin):e&&(r.removeChild(e),t._stroke=null),i.fill?(n=n||(t._fill=jn("fill")),r.appendChild(n),n.color=i.fillColor||i.color,n.opacity=i.fillOpacity):n&&(r.removeChild(n),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),n=Math.round(t._radius),i=Math.round(t._radiusY||n);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+n+","+i+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){re(t._container)},_bringToBack:function(t){oe(t._container)}},At.vml?jn:q),Xn=Hn.extend({_initContainer:function(){this._container=Zn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Zn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ne(this._container),Se(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){var t,e,n;this._map._animatingZoom&&this._bounds||(Hn.prototype._update.call(this),e=(t=this._bounds).getSize(),n=this._container,this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,n.setAttribute("width",e.x),n.setAttribute("height",e.y)),pe(n,t.min),n.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update"))},_initPath:function(t){var e=t._path=Zn("path");t.options.className&&se(e,t.options.className),t.options.interactive&&se(e,"leaflet-interactive"),this._updateStyle(t),this._layers[a(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ne(t._path),t.removeInteractiveTarget(t._path),delete this._layers[a(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path;t=t.options,e&&(t.stroke?(e.setAttribute("stroke",t.color),e.setAttribute("stroke-opacity",t.opacity),e.setAttribute("stroke-width",t.weight),e.setAttribute("stroke-linecap",t.lineCap),e.setAttribute("stroke-linejoin",t.lineJoin),t.dashArray?e.setAttribute("stroke-dasharray",t.dashArray):e.removeAttribute("stroke-dasharray"),t.dashOffset?e.setAttribute("stroke-dashoffset",t.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),t.fill?(e.setAttribute("fill",t.fillColor||t.color),e.setAttribute("fill-opacity",t.fillOpacity),e.setAttribute("fill-rule",t.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,Y(t._parts,e))},_updateCircle:function(t){var e=t._point,n=Math.max(Math.round(t._radius),1),i="a"+n+","+(Math.max(Math.round(t._radiusY),1)||n)+" 0 1,0 ";e=t._empty()?"M0 0":"M"+(e.x-n)+","+e.y+i+2*n+",0 "+i+2*-n+",0 ",this._setPath(t,e)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){re(t._path)},_bringToBack:function(t){oe(t._path)}});function qn(t){return At.svg||At.vml?new Xn(t):null}At.vml&&Xn.include(dt),Ve.include({getRenderer:function(t){return t=(t=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer)||(this._renderer=this._createRenderer()),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(t){var e;return"overlayPane"!==t&&void 0!==t&&(void 0===(e=this._paneRenderers[t])&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e)},_createRenderer:function(t){return this.options.preferCanvas&&Wn(t)||qn(t)}});var Yn=xn.extend({initialize:function(t,e){xn.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=B(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});Xn.create=Zn,Xn.pointsToPath=Y,wn.geometryToLayer=bn,wn.coordsToLatLng=Sn,wn.coordsToLatLngs=Mn,wn.latLngToCoords=Cn,wn.latLngsToCoords=Ln,wn.getFeature=An,wn.asFeature=Dn,Ve.mergeOptions({boxZoom:!0}),K=Q.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){be(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Se(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ne(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),Zt(),me(),this._startPoint=this._map.mouseEventToContainerPoint(t),be(document,{contextmenu:Oe,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=ee("div","leaflet-zoom-box",this._container),se(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=(t=new R(this._point,this._startPoint)).getSize();pe(this._box,t.min),this._box.style.width=e.x+"px",this._box.style.height=e.y+"px"},_finish:function(){this._moved&&(ne(this._box),le(this._container,"leaflet-crosshair")),Xt(),ve(),Se(document,{contextmenu:Oe,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){1!==t.which&&1!==t.button||(this._finish(),this._moved&&(this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(r(this._resetState,this),0),t=new z(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point)),this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})))},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}}),Ve.addInitHook("addHandler","boxZoom",K),Ve.mergeOptions({doubleClickZoom:!0}),ft=Q.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,n=e.getZoom(),i=e.options.zoomDelta;n=t.originalEvent.shiftKey?n-i:n+i,"center"===e.options.doubleClickZoom?e.setZoom(n):e.setZoomAround(t.containerPoint,n)}});var Kn=(Ve.addInitHook("addHandler","doubleClickZoom",ft),Ve.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0}),Q.extend({addHooks:function(){var t;this._draggable||(t=this._map,this._draggable=new Ye(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))),se(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){le(this._map._container,"leaflet-grab"),le(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 t,e=this._map;e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity?(t=B(this._map.options.maxBounds),this._offsetLimit=k(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))):this._offsetLimit=null,e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){var e,n;this._map.options.inertia&&(e=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos,this._positions.push(n),this._times.push(e),this._prunePositions(e)),this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;1e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t))},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),n=this._initialWorldOffset,i=((r=this._draggable._newPos.x)-e+n)%t+e-n,r=(r+e+n)%t-e-n;t=Math.abs(i+n)e.getMaxZoom()&&1{"use strict";n.r(e),n.d(e,{EPSILON:()=>yt,HashMap:()=>ct,RADIAN_TO_DEGREE:()=>_t,assert:()=>rt,bind:()=>B,clone:()=>b,concatArray:()=>ft,createCanvas:()=>L,createHashMap:()=>dt,createObject:()=>pt,curry:()=>F,defaults:()=>C,disableUserSelect:()=>gt,each:()=>E,eqNaN:()=>$,extend:()=>M,filter:()=>R,find:()=>k,guid:()=>x,hasOwn:()=>mt,indexOf:()=>A,inherits:()=>D,isArray:()=>V,isArrayLike:()=>P,isBuiltInObject:()=>Z,isDom:()=>q,isFunction:()=>G,isGradientObject:()=>Y,isImagePatternObject:()=>K,isNumber:()=>W,isObject:()=>j,isPrimitive:()=>lt,isRegExp:()=>J,isString:()=>H,isStringSafe:()=>U,isTypedArray:()=>X,keys:()=>z,logError:()=>w,map:()=>O,merge:()=>T,mergeAll:()=>S,mixin:()=>I,noop:()=>vt,normalizeCssArray:()=>it,reduce:()=>N,retrieve:()=>Q,retrieve2:()=>tt,retrieve3:()=>et,setAsPrimitive:()=>st,slice:()=>nt,trim:()=>ot});var i="12px sans-serif";var r,o,a=function(t){var e={};if("undefined"==typeof JSON)return e;for(var n=0;n=0)h=u*t.length;else for(var c=0;c{"use strict";n.r(e),n.d(e,{fastLerp:()=>T,fastMapToColor:()=>S,lerp:()=>M,lift:()=>w,liftColor:()=>O,lum:()=>I,mapToColor:()=>C,modifyAlpha:()=>A,modifyHSL:()=>L,parse:()=>y,parseCssFloat:()=>c,parseCssInt:()=>h,random:()=>P,stringify:()=>D,toHex:()=>b});var i=function(t){this.value=t},r=function(){function t(){this._len=0}return t.prototype.insert=function(t){var e=new i(t);return this.insertEntry(e),e},t.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++},t.prototype.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}();const o=function(){function t(t){this._list=new r,this._maxSize=10,this._map={},this._maxSize=t}return t.prototype.put=function(t,e){var n=this._list,r=this._map,o=null;if(null==r[t]){var a=n.len(),s=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var l=n.head;n.remove(l),delete r[l.key],o=l.value,this._lastRemovedEntry=l}s?s.value=e:s=new i(e),s.key=t,n.insertEntry(s),r[t]=s}return o},t.prototype.get=function(t){var e=this._map[t],n=this._list;if(null!=e)return e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}();var a=n(627),s={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 l(t){return(t=Math.round(t))<0?0:t>255?255:t}function u(t){return t<0?0:t>1?1:t}function h(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?l(parseFloat(e)/100*255):l(parseInt(e,10))}function c(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?u(parseFloat(e)/100):u(parseFloat(e))}function d(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function f(t,e,n){return t+(e-t)*n}function p(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function g(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var m=new o(20),v=null;function _(t,e){v&&g(v,e),v=m.put(t,v||e.slice())}function y(t,e){if(t){e=e||[];var n=m.get(t);if(n)return g(e,n);var i=(t+="").replace(/ /g,"").toLowerCase();if(i in s)return g(e,s[i]),_(t,e),e;var r,o=i.length;if("#"===i.charAt(0))return 4===o||5===o?(r=parseInt(i.slice(1,4),16))>=0&&r<=4095?(p(e,(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,5===o?parseInt(i.slice(4),16)/15:1),_(t,e),e):void p(e,0,0,0,1):7===o||9===o?(r=parseInt(i.slice(1,7),16))>=0&&r<=16777215?(p(e,(16711680&r)>>16,(65280&r)>>8,255&r,9===o?parseInt(i.slice(7),16)/255:1),_(t,e),e):void p(e,0,0,0,1):void 0;var a=i.indexOf("("),l=i.indexOf(")");if(-1!==a&&l+1===o){var u=i.substr(0,a),d=i.substr(a+1,l-(a+1)).split(","),f=1;switch(u){case"rgba":if(4!==d.length)return 3===d.length?p(e,+d[0],+d[1],+d[2],1):p(e,0,0,0,1);f=c(d.pop());case"rgb":return d.length>=3?(p(e,h(d[0]),h(d[1]),h(d[2]),3===d.length?f:c(d[3])),_(t,e),e):void p(e,0,0,0,1);case"hsla":return 4!==d.length?void p(e,0,0,0,1):(d[3]=c(d[3]),x(d,e),_(t,e),e);case"hsl":return 3!==d.length?void p(e,0,0,0,1):(x(d,e),_(t,e),e);default:return}}p(e,0,0,0,1)}}function x(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=c(t[1]),r=c(t[2]),o=r<=.5?r*(i+1):r+i-r*i,a=2*r-o;return p(e=e||[],l(255*d(a,o,n+1/3)),l(255*d(a,o,n)),l(255*d(a,o,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function w(t,e){var n=y(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,n[i]>255?n[i]=255:n[i]<0&&(n[i]=0);return D(n,4===n.length?"rgba":"rgb")}}function b(t){var e=y(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function T(t,e,n){if(e&&e.length&&t>=0&&t<=1){n=n||[];var i=t*(e.length-1),r=Math.floor(i),o=Math.ceil(i),a=e[r],s=e[o],h=i-r;return n[0]=l(f(a[0],s[0],h)),n[1]=l(f(a[1],s[1],h)),n[2]=l(f(a[2],s[2],h)),n[3]=u(f(a[3],s[3],h)),n}}var S=T;function M(t,e,n){if(e&&e.length&&t>=0&&t<=1){var i=t*(e.length-1),r=Math.floor(i),o=Math.ceil(i),a=y(e[r]),s=y(e[o]),h=i-r,c=D([l(f(a[0],s[0],h)),l(f(a[1],s[1],h)),l(f(a[2],s[2],h)),u(f(a[3],s[3],h))],"rgba");return n?{color:c,leftIndex:r,rightIndex:o,value:i}:c}}var C=M;function L(t,e,n,i){var r,o=y(t);if(t)return o=function(t){if(t){var e,n,i=t[0]/255,r=t[1]/255,o=t[2]/255,a=Math.min(i,r,o),s=Math.max(i,r,o),l=s-a,u=(s+a)/2;if(0===l)e=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var h=((s-i)/6+l/2)/l,c=((s-r)/6+l/2)/l,d=((s-o)/6+l/2)/l;i===s?e=d-c:r===s?e=1/3+h-d:o===s&&(e=2/3+c-h),e<0&&(e+=1),e>1&&(e-=1)}var f=[360*e,n,u];return null!=t[3]&&f.push(t[3]),f}}(o),null!=e&&(o[0]=(r=(0,a.isFunction)(e)?e(o[0]):e,(r=Math.round(r))<0?0:r>360?360:r)),null!=n&&(o[1]=c((0,a.isFunction)(n)?n(o[1]):n)),null!=i&&(o[2]=c((0,a.isFunction)(i)?i(o[2]):i)),D(x(o),"rgba")}function A(t,e){var n=y(t);if(n&&null!=e)return n[3]=u(e),D(n,"rgba")}function D(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}function I(t,e){var n=y(t);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*e:0}function P(){return D([Math.round(255*Math.random()),Math.round(255*Math.random()),Math.round(255*Math.random())],"rgb")}var E=new o(100);function O(t){if((0,a.isString)(t)){var e=E.get(t);return e||(e=w(t,-.1),E.put(t,e)),e}if((0,a.isGradientObject)(t)){var n=(0,a.extend)({},t);return n.colorStops=(0,a.map)(t.colorStops,(function(t){return{offset:t.offset,color:w(t.color,-.1)}})),n}return t}}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";var t={};n.r(t),n.d(t,{HashMap:()=>Wt,RADIAN_TO_DEGREE:()=>Jt,assert:()=>zt,bind:()=>vt,clone:()=>et,concatArray:()=>Zt,createCanvas:()=>at,createHashMap:()=>jt,createObject:()=>Xt,curry:()=>_t,defaults:()=>ot,disableUserSelect:()=>qt,each:()=>ct,eqNaN:()=>Pt,extend:()=>rt,filter:()=>pt,find:()=>gt,guid:()=>Q,hasOwn:()=>Yt,indexOf:()=>st,inherits:()=>lt,isArray:()=>yt,isArrayLike:()=>ht,isBuiltInObject:()=>Mt,isDom:()=>Lt,isFunction:()=>xt,isGradientObject:()=>At,isImagePatternObject:()=>Dt,isNumber:()=>Tt,isObject:()=>St,isPrimitive:()=>Gt,isRegExp:()=>It,isString:()=>wt,isStringSafe:()=>bt,isTypedArray:()=>Ct,keys:()=>mt,logError:()=>tt,map:()=>dt,merge:()=>nt,mergeAll:()=>it,mixin:()=>ut,noop:()=>Kt,normalizeCssArray:()=>kt,reduce:()=>ft,retrieve:()=>Et,retrieve2:()=>Ot,retrieve3:()=>Nt,setAsPrimitive:()=>Vt,slice:()=>Rt,trim:()=>Bt});var e={};n.r(e),n.d(e,{add:()=>ne,applyTransform:()=>xe,clone:()=>te,copy:()=>Qt,create:()=>$t,dist:()=>ge,distSquare:()=>ve,distance:()=>pe,distanceSquare:()=>me,div:()=>he,dot:()=>ce,len:()=>oe,lenSquare:()=>se,length:()=>ae,lengthSquare:()=>le,lerp:()=>ye,max:()=>be,min:()=>we,mul:()=>ue,negate:()=>_e,normalize:()=>fe,scale:()=>de,scaleAndAdd:()=>ie,set:()=>ee,sub:()=>re});var i={};n.r(i),n.d(i,{clone:()=>an,copy:()=>Qe,create:()=>Je,identity:()=>$e,invert:()=>on,mul:()=>tn,rotate:()=>nn,scale:()=>rn,translate:()=>en});var r={};n.r(r),n.d(r,{fastLerp:()=>Fi,fastMapToColor:()=>Vi,lerp:()=>Gi,lift:()=>zi,liftColor:()=>Yi,lum:()=>Zi,mapToColor:()=>Hi,modifyAlpha:()=>Wi,modifyHSL:()=>Ui,parse:()=>Ri,random:()=>Xi,stringify:()=>ji,toHex:()=>Bi});var o={};n.r(o),n.d(o,{dispose:()=>Bo,disposeAll:()=>Fo,getElementSSRData:()=>Ho,getInstance:()=>Vo,init:()=>zo,registerPainter:()=>Go,registerSSRDataGetter:()=>Uo,version:()=>Wo});var a={};n.r(a),n.d(a,{Arc:()=>zg,BezierCurve:()=>Ng,BoundingRect:()=>_n,Circle:()=>Kp,CompoundPath:()=>Fg,Ellipse:()=>Qp,Group:()=>Eo,Image:()=>Pl,IncrementalDisplayable:()=>tm,Line:()=>Dg,LinearGradient:()=>Ug,OrientedBoundingRect:()=>Jg,Path:()=>Sl,Point:()=>ln,Polygon:()=>bg,Polyline:()=>Mg,RadialGradient:()=>jg,Rect:()=>Fl,Ring:()=>_g,Sector:()=>gg,Text:()=>eu,applyTransform:()=>_m,clipPointsByRect:()=>bm,clipRectByRect:()=>Tm,createIcon:()=>Sm,extendPath:()=>am,extendShape:()=>rm,getShapeClass:()=>lm,getTransform:()=>vm,groupTransition:()=>wm,initProps:()=>$u,isElementRemoved:()=>Qu,lineLineIntersect:()=>Cm,linePolygonIntersect:()=>Mm,makeImage:()=>hm,makePath:()=>um,mergePath:()=>dm,registerShape:()=>sm,removeElement:()=>th,removeElementWithFadeOut:()=>nh,resizePath:()=>fm,setTooltipConfig:()=>Am,subPixelOptimize:()=>mm,subPixelOptimizeLine:()=>pm,subPixelOptimizeRect:()=>gm,transformDirection:()=>ym,traverseElements:()=>Im,updateProps:()=>Ju});var s={};n.r(s),n.d(s,{createDimensions:()=>Lx,createList:()=>Ww,createScale:()=>Zw,createSymbol:()=>jv,createTextStyle:()=>qw,dataStack:()=>jw,enableHoverEmphasis:()=>Hu,getECData:()=>nu,getLayoutRect:()=>Oc,mixinAxisModelCommonMethods:()=>Xw});var l={};n.r(l),n.d(l,{MAX_SAFE_INTEGER:()=>na,asc:()=>Ko,getPercentWithPrecision:()=>ta,getPixelPrecision:()=>Qo,getPrecision:()=>Jo,getPrecisionSafe:()=>$o,isNumeric:()=>fa,isRadianAroundZero:()=>ra,linearMap:()=>Xo,nice:()=>ua,numericToNumber:()=>da,parseDate:()=>aa,quantile:()=>ha,quantity:()=>sa,quantityExponent:()=>la,reformIntervals:()=>ca,remRadian:()=>ia,round:()=>Yo});var u={};n.r(u),n.d(u,{format:()=>Qh,parse:()=>aa});var h={};n.r(h),n.d(h,{Arc:()=>zg,BezierCurve:()=>Ng,BoundingRect:()=>_n,Circle:()=>Kp,CompoundPath:()=>Fg,Ellipse:()=>Qp,Group:()=>Eo,Image:()=>Pl,IncrementalDisplayable:()=>tm,Line:()=>Dg,LinearGradient:()=>Ug,Polygon:()=>bg,Polyline:()=>Mg,RadialGradient:()=>jg,Rect:()=>Fl,Ring:()=>_g,Sector:()=>gg,Text:()=>eu,clipPointsByRect:()=>bm,clipRectByRect:()=>Tm,createIcon:()=>Sm,extendPath:()=>am,extendShape:()=>rm,getShapeClass:()=>lm,getTransform:()=>vm,initProps:()=>$u,makeImage:()=>hm,makePath:()=>um,mergePath:()=>dm,registerShape:()=>sm,resizePath:()=>fm,updateProps:()=>Ju});var c={};n.r(c),n.d(c,{addCommas:()=>mc,capitalFirst:()=>Mc,encodeHTML:()=>ze,formatTime:()=>Sc,formatTpl:()=>bc,getTextRect:()=>hb,getTooltipMarker:()=>Tc,normalizeCssArray:()=>_c,toCamelCase:()=>vc,truncateText:()=>rs});var d={};n.r(d),n.d(d,{bind:()=>vt,clone:()=>et,curry:()=>_t,defaults:()=>ot,each:()=>ct,extend:()=>rt,filter:()=>pt,indexOf:()=>st,inherits:()=>lt,isArray:()=>yt,isFunction:()=>xt,isObject:()=>St,isString:()=>wt,map:()=>dt,merge:()=>nt,reduce:()=>ft});var f={};n.r(f),n.d(f,{Axis:()=>Sb,ChartView:()=>Fm,ComponentModel:()=>Gc,ComponentView:()=>Dp,List:()=>Cx,Model:()=>Ih,PRIORITY:()=>k_,SeriesModel:()=>Lp,color:()=>r,connect:()=>Ay,dataTool:()=>$y,dependencies:()=>I_,disConnect:()=>Iy,disconnect:()=>Dy,dispose:()=>Py,env:()=>O,extendChartView:()=>Ab,extendComponentModel:()=>Mb,extendComponentView:()=>Cb,extendSeriesModel:()=>Lb,format:()=>c,getCoordinateSystemDimensions:()=>Hy,getInstanceByDom:()=>Ey,getInstanceById:()=>Oy,getMap:()=>Ky,graphic:()=>h,helper:()=>s,init:()=>Ly,innerDrawElementOnCanvas:()=>v_,matrix:()=>i,number:()=>l,parseGeoJSON:()=>ub,parseGeoJson:()=>ub,registerAction:()=>Vy,registerCoordinateSystem:()=>Gy,registerLayout:()=>Uy,registerLoading:()=>Xy,registerLocale:()=>Fh,registerMap:()=>Yy,registerPostInit:()=>zy,registerPostUpdate:()=>By,registerPreprocessor:()=>Ry,registerProcessor:()=>ky,registerTheme:()=>Ny,registerTransform:()=>Jy,registerUpdateLifecycle:()=>Fy,registerVisual:()=>Wy,setCanvasCreator:()=>qy,setPlatformAPI:()=>V,throttle:()=>Um,time:()=>u,use:()=>Jw,util:()=>d,vector:()=>e,version:()=>D_,zrUtil:()=>t,zrender:()=>o});var p=n(214),g=n.n(p);const m={metadata:!0,svgRender:!1,switchMode:!1,maxPointsFetched:1e4,loadMoreAtZoomLevel:9,clustering:!1,clusteringThreshold:100,disableClusteringAtLevel:8,clusterRadius:80,clusterSeparation:20,showMetaOnNarrowScreens:!1,showLabelsAtZoomLevel:13,showGraphLabelsAtZoom:null,crs:g().CRS.EPSG3857,echartsOption:{aria:{show:!0,description:"This is a force-oriented graph chart that depicts the relationship between ip nodes."},toolbox:{show:!0,iconStyle:{borderColor:"#fff"},feature:{restore:{show:!0,title:"Restore view"},saveAsImage:{show:!0,title:"Save image"}}}},graphConfig:{series:{layout:"force",label:{show:!0,color:"#fff",position:"top"},labelLayout:{hideOverlap:!0},force:{gravity:.1,edgeLength:[20,60],repulsion:120},roam:!0,draggable:!0,legendHoverLink:!0,emphasis:{focus:"none",lineStyle:{color:"#3acc38",opacity:1}},nodeStyle:{color:"#ffebc4"},linkStyle:{width:6,color:"#1ba619"},nodeSize:"15"},baseOptions:{backgroundColor:"#282222",media:[{query:{minWidth:320,maxWidth:500},option:{series:[{zoom:.7}],toolbox:{itemSize:18}}},{query:{minWidth:501},option:{series:[{zoom:1}],toolbox:{itemSize:15}}},{query:{minWidth:320,maxWidth:850},option:{tooltip:{show:!1}}},{query:{minWidth:851},option:{tooltip:{show:!0}}}]}},mapOptions:{roam:!0,zoomAnimation:!1,worldCopyJump:!0,minZoom:3,maxZoom:18,nodeConfig:{type:"scatter",label:{show:!1,color:"#000000",position:"top",formatter:"{b}",fontSize:13,backgroundColor:"rgba(255, 255, 255, 0.8)",padding:[6,8],borderRadius:5},emphasis:{scale:1},nodeStyle:{color:"#1566a9"},nodeSize:"17"},linkConfig:{linkStyle:{width:5,color:"#1ba619"},emphasis:{focus:"none",lineStyle:{color:"#3acc38",opacity:1}}},clusterConfig:{symbolSize:30,itemStyle:{color:"#1566a9"},tooltip:{show:!1},label:{show:!0,position:"inside",color:"#fff",offset:[0,0],backgroundColor:"transparent"}},baseOptions:{toolbox:{show:!1},media:[{query:{minWidth:320,maxWidth:850},option:{tooltip:{show:!1}}},{query:{minWidth:851},option:{tooltip:{show:!0}}}]}},mapTileConfig:[{urlTemplate:"MISSING_ENV_VAR".MAPBOX_URL_TEMPLATE||"http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",options:{attribution:'© OpenStreetMap contributors,\n tiles offered by Mapbox'}}],geoOptions:{style:{fillColor:"#1566a9",weight:0,fillOpacity:.8,radius:8}},nodeCategories:[{name:"ok",nodeStyle:{color:"#1ba619"}},{name:"problem",nodeStyle:{color:"#ffa500"}},{name:"critical",nodeStyle:{color:"#c92517"}}],linkCategories:[],bookmarkableActions:{enabled:!1,id:null,zoomOnRestore:!0,zoomLevel:null},prepareData(t){t&&t.nodes&&t.nodes.forEach((t=>{if(t.properties&&t.properties.status){const e=t.properties.status.toLowerCase();"ok"!==e&&"problem"!==e&&"critical"!==e||(t.category=e)}}))},onClickElement(t,e){let n;this.utils&&this.utils.isNetJSON(this.data)?(n="node"===t?this.utils.nodeInfo(e):"link"===t?this.utils.linkInfo(e):e,(this.config.showMetaOnNarrowScreens||this.el.clientWidth>850)&&(this.gui.metaInfoContainer.style.display="flex")):({nodeLinkData:n}={nodeLinkData:e}),this.gui.getNodeLinkInfo(t,n),this.gui.sideBar.classList.remove("hidden")},onReady(){}},{prepareData:v}=m,_={...m},y=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class x{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,n]=new Uint8Array(t,0,2);if(219!==e)throw new Error("Data does not appear to be in a KDBush format.");const i=n>>4;if(1!==i)throw new Error(`Got v${i} data when expected v1.`);const r=y[15&n];if(!r)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new x(a,o,r,t)}constructor(t,e=64,n=Float64Array,i){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=n,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const r=y.indexOf(this.ArrayType),o=2*t*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-a%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${n}.`);i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+a+s,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+o+a+s),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+a+s,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+r]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=t,this.coords[this._pos++]=e,n}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return w(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:o,nodeSize:a}=this,s=[0,r.length-1,0],l=[];for(;s.length;){const u=s.pop()||0,h=s.pop()||0,c=s.pop()||0;if(h-c<=a){for(let a=c;a<=h;a++){const s=o[2*a],u=o[2*a+1];s>=t&&s<=n&&u>=e&&u<=i&&l.push(r[a])}continue}const d=c+h>>1,f=o[2*d],p=o[2*d+1];f>=t&&f<=n&&p>=e&&p<=i&&l.push(r[d]),(0===u?t<=f:e<=p)&&(s.push(c),s.push(d-1),s.push(1-u)),(0===u?n>=f:i>=p)&&(s.push(d+1),s.push(h),s.push(1-u))}return l}within(t,e,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:r,nodeSize:o}=this,a=[0,i.length-1,0],s=[],l=n*n;for(;a.length;){const u=a.pop()||0,h=a.pop()||0,c=a.pop()||0;if(h-c<=o){for(let n=c;n<=h;n++)M(r[2*n],r[2*n+1],t,e)<=l&&s.push(i[n]);continue}const d=c+h>>1,f=r[2*d],p=r[2*d+1];M(f,p,t,e)<=l&&s.push(i[d]),(0===u?t-n<=f:e-n<=p)&&(a.push(c),a.push(d-1),a.push(1-u)),(0===u?t+n>=f:e+n>=p)&&(a.push(d+1),a.push(h),a.push(1-u))}return s}}function w(t,e,n,i,r,o){if(r-i<=n)return;const a=i+r>>1;b(t,e,a,i,r,o),w(t,e,n,i,a-1,1-o),w(t,e,n,a+1,r,1-o)}function b(t,e,n,i,r,o){for(;r>i;){if(r-i>600){const a=r-i+1,s=n-i+1,l=Math.log(a),u=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*u*(a-u)/a)*(s-a/2<0?-1:1);b(t,e,n,Math.max(i,Math.floor(n-s*u/a+h)),Math.min(r,Math.floor(n+(a-s)*u/a+h)),o)}const a=e[2*n+o];let s=i,l=r;for(T(t,e,i,n),e[2*r+o]>a&&T(t,e,i,r);sa;)l--}e[2*i+o]===a?T(t,e,i,l):(l++,T(t,e,l,r)),l<=n&&(i=l+1),n<=l&&(r=l-1)}}function T(t,e,n,i){S(t,n,i),S(e,2*n,2*i),S(e,2*n+1,2*i+1)}function S(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function M(t,e,n,i){const r=t-n,o=e-i;return r*r+o*o}const C=class{JSONParamParse(t){return"string"==typeof t?fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},credentials:"include"}).then((t=>t)).catch((t=>{console.error(t)})):Promise.resolve(t)}async paginatedDataParse(t){let e,n;try{let i=await this.utils.JSONParamParse(t);if(i.json)for(e=await i.json(),n=e.results?e.results:e;e.next&&n.nodes.length<=this.config.maxPointsFetched;)i=await this.utils.JSONParamParse(e.next),e=await i.json(),n.nodes=n.nodes.concat(e.results.nodes),n.links=n.links.concat(e.results.links),e.next?this.hasMoreData=!0:this.hasMoreData=!1;else n=i}catch(t){console.error(t)}return n}async getBBoxData(t,e){let n;try{const i=`${t=t[0].split("?")[0]}bbox?swLat=${e._southWest.lat}&swLng=${e._southWest.lng}&neLat=${e._northEast.lat}&neLng=${e._northEast.lng}`,r=await this.utils.JSONParamParse(i);n=await r.json()}catch(t){console.error(t)}return n}dateParse({dateString:t,parseRegular:e=/^([1-9]\d{3})-(\d{1,2})-(\d{1,2})T(\d{1,2}):(\d{1,2}):(\d{1,2})(?:\.(\d{1,3}))?Z$/,hourDiffer:n=(new Date).getTimezoneOffset()/60}){const i=e.exec(t);if(!i||i.length<7)return console.error("Date doesn't meet the specifications."),"";const r=["dateYear","dateMonth","dateDay","dateHour"],o={},a=i[1]%4==0&&i[1]%100!=0||i[1]%400==0,s=new Map([["dateMonth",12],["dateDay",[31,a?29:28,31,30,31,30,31,31,30,31,30,31]],["dateHour",24]]);for(let t=r.length;t>0;t-=1)o[r[t-1]]=parseInt(i[t],10);let l,u=-n;for(let t=r.length;t>0;t-=1){if("dateYear"===r[t-1]){o[r[t-1]]+=u;break}l="dateDay"===r[t-1]?s.get("dateDay")[o.dateMonth-1]:s.get(r[t-1]);let e=o[r[t-1]]+u;u="dateHour"===r[t-1]?e<0?-1:e>=l?1:0:e<=0?-1:e>l?1:0,1===u?e-=l:u<0&&("dateDay"===r[t-1]&&(l=s.get("dateDay")[(o[r[t-1]]+10)%11]),e+=l),o[r[t-1]]=e}return`${o.dateYear}.${this.numberMinDigit(o.dateMonth)}.${this.numberMinDigit(o.dateDay)} ${this.numberMinDigit(o.dateHour)}:${this.numberMinDigit(i[5])}:${this.numberMinDigit(i[6])}${i[7]?`.${this.numberMinDigit(i[7],3)}`:""}`}numberMinDigit(t,e=2,n="0"){return(Array(e).join(n)+t).slice(-e)}isObject(t){return"Object"===Object.prototype.toString.call(t).slice(8,14)}isArray(t){return"Array"===Object.prototype.toString.call(t).slice(8,13)}isElement(t){return"object"==typeof HTMLElement?t instanceof HTMLElement:t&&"object"==typeof t&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName}isNetJSON(t){return!(!t.nodes||!t.links)&&(this.isObject(t)&&this.isArray(t.nodes)&&this.isArray(t.links))}isGeoJSON(t){return t.type&&"FeatureCollection"===t.type?this.isObject(t)&&this.isArray(t.features):!(!t.type||"Feature"!==t.type)&&(this.isObject(t)&&this.isArray(t.geometry))}geojsonToNetjson(t){return function(t){const e=[],n=[];if(!t||!Array.isArray(t.features))return{nodes:e,links:n};const i=new Map,r=(t,n={})=>{const r=`${t[0]},${t[1]}`;if(i.has(r))return i.get(r);const o=n.id||n.node_id||null,a=n.label||n.name||o||null,s=o?String(o):`gjn_${e.length}`,l=!o,u={id:s,...a?{label:String(a)}:{},location:{lng:t[0],lat:t[1]},properties:{...n,location:{lng:t[0],lat:t[1]}},_generatedIdentity:l};return e.push(u),i.set(r,s),s},o=(t,e,i={})=>{n.push({source:t,target:e,properties:i})},a=(t,e,n=!1)=>{for(let n=0;n2){const n=r(t[0],e),i=r(t[t.length-1],e);o(i,n,e)}},s=(t,e)=>{if(!t)return;const{type:n,coordinates:i,geometries:o}=t;switch(n){case"Point":r(i,{...e,_featureType:"Point"});break;case"MultiPoint":i.forEach((t=>r(t,{...e,_featureType:"Point"})));break;case"LineString":a(i,{...e,_featureType:"LineString"},!1);break;case"MultiLineString":i.forEach((t=>a(t,{...e,_featureType:"LineString"},!1)));break;case"Polygon":case"MultiPolygon":break;case"GeometryCollection":o.forEach((t=>s(t,e)));break;default:console.warn(`Unsupported GeoJSON geometry type: ${n}`)}};return t.features.forEach((t=>{const e={...t.properties||{},...void 0!==t.id&&null!==t.id?{id:t.id}:{}};s(t.geometry,e)})),{nodes:e,links:n}}(t)}deepCopy(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map((t=>this.deepCopy(t)));const e={};return Object.keys(t).forEach((n=>{e[n]=this.deepCopy(t[n])})),e}fastDeepCopy(t){return"function"==typeof structuredClone?structuredClone(t):JSON.parse(JSON.stringify(t))}deepMergeObj(...t){const e=[...t].reverse(),n=e.length;for(let t=0;t{i[t]&&this.isObject(i[t])&&this.isObject(n[t])?this.deepMergeObj(i[t],n[t]):i[t]=n[t]})):i||(e[t+1]=n)}return e[n-1]}makeCluster(t){const{nodes:e,links:n}=t.data,i=t=>!(t.properties&&t.properties._featureType)||"Point"===t.properties._featureType,r=e.filter(i),o=e.filter((t=>!i(t))),a=[],s=[],l=new Map;o.forEach((t=>l.set(t.id,null)));let u=0;r.forEach((e=>{const n=e.properties&&e.properties.location||e.location;if(!n||void 0===n.lat||void 0===n.lng)return;e.location=n,e._origLocation?(n.lat=e._origLocation.lat,n.lng=e._origLocation.lng):e._origLocation={lat:n.lat,lng:n.lng};const i=t.leaflet.latLngToContainerPoint([n.lat,n.lng]);e.x=i.x,e.y=i.y,e.visited=!1,e.cluster=null}));const h=new x(r.length);r.forEach((({x:t,y:e})=>h.add(t,e))),h.finish();const c=t.config&&t.config.mapOptions&&t.config.mapOptions.clusterConfig&&t.config.mapOptions.clusterConfig.symbolSize,d=t=>{if("function"==typeof c)try{return c(t)}catch(t){return 30}return Array.isArray(c)?c[0]||30:"number"==typeof c?c:30},f=new Map;r.forEach((e=>{if(e.visited)return;const n=h.within(e.x,e.y,t.config.clusterRadius).map((t=>r[t]));if(n.length>1){const i=`${Math.round(e.x)},${Math.round(e.y)}`;f.has(i)||f.set(i,new Map);const r=f.get(i);n.forEach((e=>{if(e.visited)return;const n=t.config.clusteringAttribute?e.properties[t.config.clusteringAttribute]:"default";r.has(n)||r.set(n,[]),r.get(n).push(e),e.visited=!0}))}else e.visited=!0,l.set(e.id,null),o.push(e)})),f.forEach((e=>{const n=Array.from(e.entries()),i=n.length;let r=0;n.forEach((([,t])=>{const e=d(t.length);e>r&&(r=e)}));const a="number"==typeof t.config.clusterSeparation?t.config.clusterSeparation:Math.max(10,Math.floor(t.config.clusterRadius/2));let h=0;if(i>1){const t=Math.PI/i,e=Math.sin(t);e>0&&(h=r/(2*e))}const c=Math.max(a,h+4);n.forEach((([,e],n)=>{if(e.length>1){let r=0,o=0;if(e.forEach((t=>{t.cluster=u,l.set(t.id,t.cluster),r+=t.location.lng,o+=t.location.lat})),r/=e.length,o/=e.length,i>1){const e=2*Math.PI*n/i,a=t.leaflet.latLngToContainerPoint([o,r]),s=[a.x+c*Math.cos(e),a.y+c*Math.sin(e)],l=t.leaflet.containerPointToLatLng(s);r=l.lng,o=l.lat}const a={id:u,cluster:!0,name:e.length,value:[r,o],childNodes:e,...t.config.mapOptions.clusterConfig};if(t.config.clusteringAttribute){const n=t.config.nodeCategories.find((n=>n.name===e[0].properties[t.config.clusteringAttribute]));n&&(a.itemStyle={...a.itemStyle,color:n.nodeStyle.color})}s.push(a),u+=1}else if(1===e.length){const t=e[0];l.set(t.id,null),o.push(t)}}))})),n.forEach((t=>{null===l.get(t.source)&&null===l.get(t.target)&&a.push(t)}));const p=[...s.map((t=>({ref:t,isCluster:!0,count:t.childNodes.length,get value(){return t.value},set value([e,n]){t.value=[e,n]}}))),...o.filter(i).map((t=>({ref:t,isCluster:!1,count:1,get value(){return[t.location.lng,t.location.lat]},set value([e,n]){t.location.lng=e,t.location.lat=n}})))];if(p.length>1){const e=p.map((e=>{const[n,i]=e.value,r=t.leaflet.latLngToContainerPoint([i,n]);return{ref:e.ref,isCluster:e.isCluster,x:r.x,y:r.y,r:d(e.count)/2,setValue:([t,n])=>{e.value=[t,n]}}})),n=4,i=5;for(let t=0;t0&&s{const n=t.leaflet.containerPointToLatLng([e.x,e.y]);e.isCluster?e.ref.value=[n.lng,n.lat]:(e.ref.location.lng=n.lng,e.ref.location.lat=n.lat)}))}return{clusters:s,nonClusterNodes:o,nonClusterLinks:a}}updateMetadata(){if(this.config.metadata){const t=this.utils.getMetadata(this.data),e=document.querySelector(".njg-metaData"),n=document.querySelectorAll(".njg-metaDataItems");for(let t=0;t{const i=document.createElement("div");i.classList.add("njg-metaDataItems");const r=document.createElement("span");r.setAttribute("class","njg-keyLabel");const o=document.createElement("span");o.setAttribute("class","njg-valueLabel"),r.innerHTML=n,o.innerHTML=t[n],i.appendChild(r),i.appendChild(o),e.appendChild(i)}))}}getMetadata(t){const e=t,n={};return e.label&&(n.label=e.label),["protocol","version","revision","metric","router_id","topology_id"].forEach((t=>{e[t]&&(n[t]=e[t])})),n.nodes=e.nodes.length,n.links=e.links.length,n}nodeInfo(t){const e={};!t._generatedIdentity&&(e.id=t.id,t.label&&"string"==typeof t.label&&(e.label=t.label)),t.name&&(e.name=t.name),t.location&&(e.location=t.location);let n=null;Array.isArray(t.clients)?n=t.clients:t.properties&&Array.isArray(t.properties.clients)&&(n=t.properties.clients);let i=0;n?i=n.length:"number"==typeof t.clients?i=t.clients:t.properties&&"number"==typeof t.properties.clients&&(i=t.properties.clients),i>0&&(e.clients=i),n&&n.length&&n.forEach(((t,n)=>{e[`clients [${n+1}]`]=t}));const r=(t,e)=>"location"===t&&e&&"object"==typeof e?{lat:e.lat,lng:e.lng}:"time"===t&&"string"==typeof e?this.dateParse({dateString:e}):e,o=t._source&&this.isObject(t._source)?t._source:t;if(Object.keys(o).forEach((t=>{if("properties"===t||"clients"===t||"_source"===t||"_generatedIdentity"===t||"local_addresses"===t||"linkCount"===t)return;const n=r(t,o[t]);null!=n&&""!==n&&(e[t]=n)})),o.properties&&this.isObject(o.properties)&&Object.keys(o.properties).forEach((t=>{if("clients"===t)return;const n=r(t,o.properties[t]);null==n||"string"==typeof n&&""===n.trim()||(e[t]=n)})),t.linkCount&&(e.links=t.linkCount),Array.isArray(o.local_addresses)){const t=o.local_addresses.map((t=>"string"==typeof t?t:t&&"string"==typeof t.address?t.address:null)).filter((t=>t));t.length&&(e.localAddresses=t)}return t.local_addresses&&(e.localAddresses=t.local_addresses),e}createTooltipItem(t,e){const n=document.createElement("div");n.classList.add("njg-tooltip-item");const i=document.createElement("span");i.setAttribute("class","njg-tooltip-key");const r=document.createElement("span");return r.setAttribute("class","njg-tooltip-value"),i.innerHTML=t,r.innerHTML=e,n.appendChild(i),n.appendChild(r),n}getNodeTooltipInfo(t){const e=document.createElement("div");e.classList.add("njg-tooltip-inner");const n=!t._generatedIdentity;return n&&t.id&&e.appendChild(this.createTooltipItem("id",t.id)),n&&t.label&&"string"==typeof t.label&&e.appendChild(this.createTooltipItem("label",t.label)),t.properties&&Object.keys(t.properties).forEach((i=>{if("object"!=typeof t.properties[i]&&!i.startsWith("_")&&("id"!==i&&"label"!==i||!n))if("location"===i)e.appendChild(this.createTooltipItem("location",`${Math.round(1e3*t.properties.location.lat)/1e3}, ${Math.round(1e3*t.properties.location.lng)/1e3}`));else if("time"===i){const n=this.dateParse({dateString:t.properties[i]});e.appendChild(this.createTooltipItem("time",n))}else e.appendChild(this.createTooltipItem(`${i.replace(/_/g," ")}`,t.properties[i]))})),t.linkCount&&e.appendChild(this.createTooltipItem("Links",t.linkCount)),t.local_addresses&&e.appendChild(this.createTooltipItem("Local Addresses",t.local_addresses.join("
"))),e}getLinkTooltipInfo(t){const e=document.createElement("div");e.classList.add("njg-tooltip-inner");const n=t=>"string"==typeof t&&t.startsWith("gjn_");return n(t.source)||e.appendChild(this.createTooltipItem("source",t.source)),n(t.target)||e.appendChild(this.createTooltipItem("target",t.target)),void 0!==t.cost&&null!==t.cost&&e.appendChild(this.createTooltipItem("cost",t.cost)),t.properties&&Object.keys(t.properties).forEach((n=>{const i=t.properties[n];if(null!=i)if("time"===n){const t=this.dateParse({dateString:i});e.appendChild(this.createTooltipItem("time",t))}else{const t="string"==typeof i?i.replace(/\n/g,"
"):i;e.appendChild(this.createTooltipItem(`${n.replace(/_/g," ")}`,t))}})),e}linkInfo(t){const e={},n=t=>"string"==typeof t&&t.startsWith("gjn_");return n(t.source)||(e.source=t.source),n(t.target)||(e.target=t.target),void 0!==t.cost&&null!==t.cost&&(e.cost=t.cost),t.properties&&Object.keys(t.properties).forEach((n=>{const i=t.properties[n];if(null!=i)if("time"===n){const t=this.dateParse({dateString:i});e[n]=t}else{const t="string"==typeof i?i.replace(/\n/g,"
"):i;e[n.replace(/_/g," ")]=t}})),e}generateStyle(t,e){return"function"==typeof t?t(e):t}getNodeStyle(t,e,n){let i,r={},o={},a=!1;if(t.category&&e.nodeCategories&&e.nodeCategories.length){const n=e.nodeCategories.find((e=>e.name===t.category));if(n){a=!0,i=this.generateStyle(n.nodeStyle||{},t),r=this.generateStyle(n.nodeSize||{},t);let e={},s={};n.emphasis&&(e=this.generateStyle(n.emphasis.nodeStyle||{},t),s=this.generateStyle(n.emphasis.nodeSize||{},t),o={nodeStyle:e,nodeSize:s})}}if(!a)if("map"===n){const n=e.mapOptions&&e.mapOptions.nodeConfig;i=this.generateStyle(n&&n.nodeStyle||{},t),r=this.generateStyle(n&&n.nodeSize||{},t);const a=n&&n.emphasis;a&&(o={nodeStyle:this.generateStyle(a&&a.nodeStyle||{},t),nodeSize:this.generateStyle(a&&a.nodeSize||{},t)})}else{const n=e.graphConfig&&e.graphConfig.series;i=this.generateStyle(n&&n.nodeStyle||{},t),r=this.generateStyle(n&&n.nodeSize||{},t);const a=n&&n.emphasis;a&&(o={nodeStyle:this.generateStyle(a&&a.itemStyle||{},t),nodeSize:this.generateStyle(a&&a.symbolSize||r||{},t)})}return{nodeStyleConfig:i,nodeSizeConfig:r,nodeEmphasisConfig:o}}getLinkStyle(t,e,n){let i,r={};if(t.category&&e.linkCategories.length){const n=e.linkCategories.find((e=>e.name===t.category));i=this.generateStyle(n.linkStyle||{},t),r={...r,linkStyle:n.emphasis?this.generateStyle(n.emphasis.linkStyle||{},t):{}}}else i="map"===n?this.generateStyle(e.mapOptions.linkConfig.linkStyle,t):this.generateStyle(e.graphConfig.series.linkStyle,t);return{linkStyleConfig:i,linkEmphasisConfig:r}}showLoading(){let t=this.el.querySelector(".njg-loadingContainer");return t?t.style.visibility="visible":(t=document.createElement("div"),t.classList.add("njg-loadingContainer"),t.innerHTML='\n
\n
\n

Loading...

\n
\n ',this.el.appendChild(t)),t}hideLoading(){const t=this.el.querySelector(".njg-loadingContainer");return t&&(t.style.visibility="hidden"),t}createEvent(){const t=new Map,e=new Map;return{on(e,...n){t.set(e,[...t.get(e)||[],...n])},once(t,...n){e.set(t,[...e.get(t)||[],...n])},emit(n){const i=t.get(n)||[],r=e.get(n)||[],o=i.map((t=>t())),a=r.map((t=>t()));return e.delete(n),[...o,...a]},delete(n){t.delete(n),e.delete(n)}}}parseUrlFragments(){let t;try{t=decodeURIComponent(window.location.hash.replace(/^#/,""))}catch(e){t=window.location.hash.replace(/^#/,"")}const e={};return t.split(";").forEach((t=>{const n=new URLSearchParams(t),i=n.get("id");null!=i&&(e[i]=n)})),e}updateUrlFragments(t,e){const n=Object.values(t).map((t=>t.toString())).join(";").replace(/([^&=]+)=([^&;]*)/g,((t,e,n)=>`${e}=${encodeURIComponent(n.replace(/%7E/gi,"~"))}`));window.history.pushState(e,"",`#${n}`)}addActionToUrl(t,e){if(!t.config.bookmarkableActions.enabled||!e.data||e.data.cluster)return;if(!t.nodeLinkIndex)return void console.error("Lookup object for node or link not found.");const n=this.parseUrlFragments(),{id:i}=t.config.bookmarkableActions;let r;if(t.config.render===t.utils.graphRender){if("node"===e.dataType)r=e.data.id;else if("edge"===e.dataType){const{source:t,target:n}=e.data;r=`${t}~${n}`}}else if(t.config.render===t.utils.mapRender)if("scatter"===e.seriesType)r=e.data.node.id;else if("lines"===e.seriesType){const{source:t,target:n}=e.data.link;r=`${t}~${n}`}if(!r||!t.nodeLinkIndex[r])return void console.error("nodeId not found in nodeLinkIndex lookup.");n[i]||(n[i]=new URLSearchParams,n[i].set("id",i)),n[i].set("nodeId",r);const o=t.nodeLinkIndex[r];this.updateUrlFragments(n,o)}removeUrlFragment(t){const e=this.parseUrlFragments();e[t]&&delete e[t];const n={id:t};this.updateUrlFragments(e,n)}applyUrlFragmentState(t){if(!t.config.bookmarkableActions.enabled)return;const{id:e}=t.config.bookmarkableActions,n=t.utils.parseUrlFragments(),i=n[e]&&n[e].get?n[e]:null,r=i&&i.get?i.get("nodeId"):void 0;if(!r||!t.nodeLinkIndex||null==t.nodeLinkIndex[r])return;const[o,a]=r.split("~"),s=t.nodeLinkIndex[r],l=t.config.graphConfig&&t.config.graphConfig.series&&t.config.graphConfig.series.type||t.config.mapOptions&&t.config.mapOptions.nodeConfig&&t.config.mapOptions.nodeConfig.type,{location:u,cluster:h}=s||{};if(t.config.bookmarkableActions.zoomOnRestore&&["scatter","effectScatter"].includes(l)&&null==a&&null!=u){const e=[u.lat,u.lng],n=null!=h?t.config.disableClusteringAtLevel:t.config.bookmarkableActions.zoomLevel||t.config.showLabelsAtZoomLevel;t.leaflet&&t.leaflet.setView(e,n)}"function"==typeof t.config.onClickElement&&t.config.onClickElement.call(t,o&&a?"link":"node",s)}setupHashChangeHandler(t){return t._popstateHandler&&window.removeEventListener("popstate",t._popstateHandler),t._popstateHandler=()=>{this.applyUrlFragmentState(t)},window.addEventListener("popstate",t._popstateHandler),()=>{window.removeEventListener("popstate",t._popstateHandler),t._popstateHandler=null}}moveNodeInRealTime(t,e){if(!this.echarts||"function"!=typeof this.echarts.getOption)return void console.warn("moveNodeInRealTime: ECharts instance not ready");const n=this.echarts.getOption();if(!n||!Array.isArray(n.series))return void console.warn("moveNodeInRealTime: No series data available");const i=n.series.find((t=>"scatter"===t.type||"effectScatter"===t.type));if(!i)return void console.warn("moveNodeInRealTime: No scatter series found");const r=i.data.findIndex((e=>e.node.id===t));if(-1===r)return void console.warn(`moveNodeInRealTime: Node with id "${t}" not found`);const o=i.data[r],{node:a}=o;a.location=e,a.properties?(a.properties.location=e,o.value=[e.lng,e.lat],this.nodeLinkIndex[t].location=e,this.nodeLinkIndex[t].properties&&(this.nodeLinkIndex[t].properties.location=e,this.echarts.setOption({series:n.series}))):console.warn("moveNodeInRealTime: Node properties not found")}};const L=class extends C{searchElements(t){const e=this,n={"":{data:{...e.data},param:[...e.JSONParam]}};return window.history.pushState({searchValue:""},""),window.onpopstate=i=>{n[i.state.searchValue]?e.utils.JSONDataUpdate.call(e,n[i.state.searchValue].data).then((()=>{e.JSONParam=n[i.state.searchValue].param})):e.utils.JSONDataUpdate.call(e,t+i.state.searchValue)},function(i,r=!0,o=!0){const a=i.trim();if(!window.history.state||window.history.state&&window.history.state.searchValue!==a)return window.history.pushState({searchValue:a},""),e.utils.JSONDataUpdate.call(e,t+a,r,o).then((()=>{n[a]={data:{...e.data},param:[...e.JSONParam]}}))}}JSONDataUpdate(t,e=!0,n=!0){const i=this;return i.config.onUpdate.call(i),i.utils.paginatedDataParse.call(i,t).then((r=>{function o(){e?(i.JSONParam=[t],i.utils.overrideData(r,i)):(i.JSONParam.push(t),i.config.render===i.utils.mapRender?i.utils.appendData(r,i):i.utils.addData(r,i)),i.utils.isNetJSON(i.data)&&i.utils.updateMetadata.call(i)}return n?(i.utils.isNetJSON(i.data)&&i.config.prepareData.call(i,r),i.config.dealDataByWorker?i.utils.dealDataByWorker.call(i,r,i.config.dealDataByWorker,o):o()):o(),r})).catch((t=>{console.error(t)}))}dealDataByWorker(t,e,n){const i=new Worker(e),r=this;i.postMessage(t),i.addEventListener("error",(t=>{console.error(t),console.error("Error in dealing JSONData!")})),i.addEventListener("message",(t=>{n?n():(r.utils.overrideData(t.data,r),r.utils.isNetJSON(r.data)&&r.utils.updateMetadata.call(r))}))}overrideData(t,e){e.data=t,e.utils.isNetJSON(e.data)||e.leaflet.geoJSON.removeFrom(e.leaflet),e.utils.render(),e.config.afterUpdate.call(e)}};const A=class{constructor(t){this.utils=new L,this.config=this.utils.deepCopy(_),this.config.crs=_.crs,this.JSONParam=this.utils.isArray(t)?t:[t]}setConfig(t){if(this.utils.deepMergeObj(this.config,t),this.el)t&&t.el&&console.error("Can't change el again!");else if(this.config.el?this.utils.isElement(this.config.el)?this.el=this.config.el:this.el=document.querySelector(this.config.el):this.el=document.body,this.el){if(this.el.classList.add("njg-container"),this.el===document.body){const t=document.documentElement;t.style.width="100%",t.style.height="100%",this.el.classList.add("njg-relativePosition")}}else console.error("NetJSONGraph: The specified element for rendering was not found and could not be set.");return this.config}render(){const[t,...e]=this.JSONParam;this.config.onRender.call(this);const n=new Promise((t=>{this.event.once("onReady",(async()=>{try{await this.config.onReady.call(this)}catch(t){console.error("onReady callback failed:",t)}t()}))}));if(this.event.once("onLoad",this.config.onLoad.bind(this)),this.event.once("applyUrlFragmentState",(async()=>{try{await n}catch(t){console.error("onReady failed:",t)}this.utils.applyUrlFragmentState.call(this,this)})),this.utils.paginatedDataParse.call(this,t).then((t=>{if(this.utils.isNetJSON(t))this.type="netjson";else{if(!this.utils.isGeoJSON(t))throw new Error("Invalid data format!");this.type="geojson",this.originalGeoJSON=this.utils.fastDeepCopy(t),t=this.utils.geojsonToNetjson(t)}if(this.utils.isNetJSON(t)){t.nodes.length>this.config.maxPointsFetched&&(this.hasMoreData=!0),t.nodes.splice(this.config.maxPointsFetched-1,t.nodes.length-this.config.maxPointsFetched);const e=new Set;this.nodeLinkIndex={},t.nodes.forEach((t=>{e.add(t.id),this.nodeLinkIndex[t.id]=t})),t.links=t.links.filter((t=>{if(e.has(t.source)&&e.has(t.target)){const e=`${t.source}~${t.target}`;return this.nodeLinkIndex[e]=t,!0}return e.has(t.source)?console.warn(`Node ${t.target} does not exist!`):console.warn(`Node ${t.source} does not exist!`),!1}))}this.config.prepareData.call(this,t),this.data=t,this.config.dealDataByWorker?this.utils.dealDataByWorker.call(this,t,this.config.dealDataByWorker):(this.data=t,this.utils.render())})).catch((t=>{console.error(t)})),e.length){const n=function(){e.map((t=>this.utils.JSONDataUpdate.call(this,t,!1)))};this.JSONParam=[t],this.event.once("renderArray",n.bind(this))}}setUtils(t={}){const e=this;return e.utils=Object.assign(e.utils,{...t},{render(){if(!e.config.render)throw new Error("No render function!");e.config.render(e.data,e)}}),"function"==typeof e.utils.moveNodeInRealTime&&(e.utils.moveNodeInRealTime=e.utils.moveNodeInRealTime.bind(e)),e.utils}}; -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -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 D=function(t,e){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},D(t,e)};function I(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}D(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}Object.create;Object.create;var P=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},E=new function(){this.browser=new P,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(E.wxa=!0,E.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?E.worker=!0:!E.hasGlobalWindow||"Deno"in window?(E.node=!0,E.svgSupported=!0):function(t,e){var n=e.browser,i=t.match(/Firefox\/([\d.]+)/),r=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),o=t.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(t);i&&(n.firefox=!0,n.version=i[1]);r&&(n.ie=!0,n.version=r[1]);o&&(n.edge=!0,n.version=o[1],n.newEdge=+o[1].split(".")[0]>18);a&&(n.weChat=!0);e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,e.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11),e.domSupported="undefined"!=typeof document;var s=document.documentElement.style;e.transform3dSupported=(n.ie&&"transition"in s||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||n.ie&&+n.version>=9}(navigator.userAgent,E);const O=E;var N="sans-serif",R="12px "+N;var k,z,B=function(t){var e={};if("undefined"==typeof JSON)return e;for(var n=0;n=0)o=r*t.length;else for(var a=0;a>1)%2;a.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[s]+":0",r[l]+":0",i[1-s]+":auto",r[1-l]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}return n}(e,o),s=function(t,e,n){for(var i=n?"invTrans":"trans",r=e[i],o=e.srcCoords,a=[],s=[],l=!0,u=0;u<4;u++){var h=t[u].getBoundingClientRect(),c=2*u,d=h.left,f=h.top;a.push(d,f),l=l&&o&&d===o[c]&&f===o[c+1],s.push(t[u].offsetLeft,t[u].offsetTop)}return l&&r?r:(e.srcCoords=a,e[i]=n?Ie(s,a):Ie(a,s))}(a,o,r);if(s)return s(t,n,i),!0}return!1}function Ne(t){return"CANVAS"===t.nodeName.toUpperCase()}var Re=/([&<>"'])/g,ke={"&":"&","<":"<",">":">",'"':""","'":"'"};function ze(t){return null==t?"":(t+"").replace(Re,(function(t,e){return ke[e]}))}var Be=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Fe=[],Ve=O.browser.firefox&&+O.browser.version.split(".")[0]<39;function Ge(t,e,n,i){return n=n||{},i?He(t,e,n):Ve&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):He(t,e,n),n}function He(t,e,n){if(O.domSupported&&t.getBoundingClientRect){var i=e.clientX,r=e.clientY;if(Ne(t)){var o=t.getBoundingClientRect();return n.zrX=i-o.left,void(n.zrY=r-o.top)}if(Oe(Fe,t,i,r))return n.zrX=Fe[0],void(n.zrY=Fe[1])}n.zrX=n.zrY=0}function Ue(t){return t||window.event}function We(t,e,n){if(null!=(e=Ue(e)).zrX)return e;var i=e.type;if(i&&i.indexOf("touch")>=0){var r="touchend"!==i?e.targetTouches[0]:e.changedTouches[0];r&&Ge(t,r,e,n)}else{Ge(t,e,e,n);var o=function(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,i=t.deltaY;if(null==n||null==i)return e;var r=0!==i?Math.abs(i):Math.abs(n),o=i>0?-1:i<0?1:n>0?-1:1;return 3*r*o}(e);e.zrDelta=o?o/120:-(e.detail||0)/3}var a=e.button;return null==e.which&&void 0!==a&&Be.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function je(t,e,n,i){t.addEventListener(e,n,i)}var Ze=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0};function Xe(t){return 2===t.which||3===t.which}var qe=function(){function t(){this._track=[]}return t.prototype.recognize=function(t,e,n){return this._doTrack(t,e,n),this._recognize(t)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(t,e,n){var i=t.touches;if(i){for(var r={points:[],touches:[],target:e,event:t},o=0,a=i.length;o1&&r&&r.length>1){var a=Ye(r)/Ye(o);!isFinite(a)&&(a=1),e.pinchScale=a;var s=[((i=r)[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2];return e.pinchX=s[0],e.pinchY=s[1],{type:"pinch",target:t[0].target,event:e}}}}};function Je(){return[1,0,0,1,0,0]}function $e(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function Qe(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function tn(t,e,n){var i=e[0]*n[0]+e[2]*n[1],r=e[1]*n[0]+e[3]*n[1],o=e[0]*n[2]+e[2]*n[3],a=e[1]*n[2]+e[3]*n[3],s=e[0]*n[4]+e[2]*n[5]+e[4],l=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=i,t[1]=r,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t}function en(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function nn(t,e,n,i){void 0===i&&(i=[0,0]);var r=e[0],o=e[2],a=e[4],s=e[1],l=e[3],u=e[5],h=Math.sin(n),c=Math.cos(n);return t[0]=r*c+s*h,t[1]=-r*h+s*c,t[2]=o*c+l*h,t[3]=-o*h+c*l,t[4]=c*(a-i[0])+h*(u-i[1])+i[0],t[5]=c*(u-i[1])-h*(a-i[0])+i[1],t}function rn(t,e,n){var i=n[0],r=n[1];return t[0]=e[0]*i,t[1]=e[1]*r,t[2]=e[2]*i,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*r,t}function on(t,e){var n=e[0],i=e[2],r=e[4],o=e[1],a=e[3],s=e[5],l=n*a-o*i;return l?(l=1/l,t[0]=a*l,t[1]=-o*l,t[2]=-i*l,t[3]=n*l,t[4]=(i*s-a*r)*l,t[5]=(o*r-n*s)*l,t):null}function an(t){var e=[1,0,0,1,0,0];return Qe(e,t),e}var sn=function(){function t(t,e){this.x=t||0,this.y=e||0}return t.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},t.prototype.scale=function(t){this.x*=t,this.y*=t},t.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},t.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},t.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},t.prototype.distanceSquare=function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(t){if(t){var e=this.x,n=this.y;return this.x=t[0]*e+t[2]*n+t[4],this.y=t[1]*e+t[3]*n+t[5],this}},t.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},t.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},t.set=function(t,e,n){t.x=e,t.y=n},t.copy=function(t,e){t.x=e.x,t.y=e.y},t.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},t.lenSquare=function(t){return t.x*t.x+t.y*t.y},t.dot=function(t,e){return t.x*e.x+t.y*e.y},t.add=function(t,e,n){t.x=e.x+n.x,t.y=e.y+n.y},t.sub=function(t,e,n){t.x=e.x-n.x,t.y=e.y-n.y},t.scale=function(t,e,n){t.x=e.x*n,t.y=e.y*n},t.scaleAndAdd=function(t,e,n,i){t.x=e.x+n.x*i,t.y=e.y+n.y*i},t.lerp=function(t,e,n,i){var r=1-i;t.x=r*e.x+i*n.x,t.y=r*e.y+i*n.y},t}();const ln=sn;var un=Math.min,hn=Math.max,cn=new ln,dn=new ln,fn=new ln,pn=new ln,gn=new ln,mn=new ln,vn=function(){function t(t,e,n,i){n<0&&(t+=n,n=-n),i<0&&(e+=i,i=-i),this.x=t,this.y=e,this.width=n,this.height=i}return t.prototype.union=function(t){var e=un(t.x,this.x),n=un(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=hn(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=hn(t.y+t.height,this.y+this.height)-n:this.height=t.height,this.x=e,this.y=n},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(t){var e=this,n=t.width/e.width,i=t.height/e.height,r=[1,0,0,1,0,0];return en(r,r,[-e.x,-e.y]),rn(r,r,[n,i]),en(r,r,[t.x,t.y]),r},t.prototype.intersect=function(e,n){if(!e)return!1;e instanceof t||(e=t.create(e));var i=this,r=i.x,o=i.x+i.width,a=i.y,s=i.y+i.height,l=e.x,u=e.x+e.width,h=e.y,c=e.y+e.height,d=!(op&&(p=y,gp&&(p=x,v<_?ln.set(mn,0,-v):ln.set(mn,0,_)):y=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return 0===this.width||0===this.height},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},t.applyTransform=function(e,n,i){if(i){if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var r=i[0],o=i[3],a=i[4],s=i[5];return e.x=n.x*r+a,e.y=n.y*o+s,e.width=n.width*r,e.height=n.height*o,e.width<0&&(e.x+=e.width,e.width=-e.width),void(e.height<0&&(e.y+=e.height,e.height=-e.height))}cn.x=fn.x=n.x,cn.y=pn.y=n.y,dn.x=pn.x=n.x+n.width,dn.y=fn.y=n.y+n.height,cn.transform(i),pn.transform(i),dn.transform(i),fn.transform(i),e.x=un(cn.x,dn.x,fn.x,pn.x),e.y=un(cn.y,dn.y,fn.y,pn.y);var l=hn(cn.x,dn.x,fn.x,pn.x),u=hn(cn.y,dn.y,fn.y,pn.y);e.width=l-e.x,e.height=u-e.y}else e!==n&&t.copy(e,n)},t}();const _n=vn;var yn="silent";function xn(){Ze(this.event)}var wn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.handler=null,e}return I(e,t),e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(Le),bn=function(t,e){this.x=t,this.y=e},Tn=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Sn=new _n(0,0,0,0),Mn=function(t){function e(e,n,i,r,o){var a=t.call(this)||this;return a._hovered=new bn(0,0),a.storage=e,a.painter=n,a.painterRoot=r,a._pointerSize=o,i=i||new wn,a.proxy=null,a.setHandlerProxy(i),a._draggingMgr=new Me(a),a}return I(e,t),e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(ct(Tn,(function(e){t.on&&t.on(e,this[e],this)}),this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var e=t.zrX,n=t.zrY,i=An(this,e,n),r=this._hovered,o=r.target;o&&!o.__zr&&(o=(r=this.findHover(r.x,r.y)).target);var a=this._hovered=i?new bn(e,n):this.findHover(e,n),s=a.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),o&&s!==o&&this.dispatchToElement(r,"mouseout",t),this.dispatchToElement(a,"mousemove",t),s&&s!==o&&this.dispatchToElement(a,"mouseover",t)},e.prototype.mouseout=function(t){var e=t.zrEventControl;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new bn(0,0)},e.prototype.dispatch=function(t,e){var n=this[t];n&&n.call(this,e)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},e.prototype.dispatchToElement=function(t,e,n){var i=(t=t||{}).target;if(!i||!i.silent){for(var r="on"+e,o=function(t,e,n){return{type:t,event:n,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:xn}}(e,t,n);i&&(i[r]&&(o.cancelBubble=!!i[r].call(i,o)),i.trigger(e,o),i=i.__hostTarget?i.__hostTarget:i.parent,!o.cancelBubble););o.cancelBubble||(this.trigger(e,o),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer((function(t){"function"==typeof t[r]&&t[r].call(t,o),t.trigger&&t.trigger(e,o)})))}},e.prototype.findHover=function(t,e,n){var i=this.storage.getDisplayList(),r=new bn(t,e);if(Ln(i,r,t,e,n),this._pointerSize&&!r.target){for(var o=[],a=this._pointerSize,s=a/2,l=new _n(t-s,e-s,a,a),u=i.length-1;u>=0;u--){var h=i[u];h===n||h.ignore||h.ignoreCoarsePointer||h.parent&&h.parent.ignoreCoarsePointer||(Sn.copy(h.getBoundingRect()),h.transform&&Sn.applyTransform(h.transform),Sn.intersect(l)&&o.push(h))}if(o.length)for(var c=Math.PI/12,d=2*Math.PI,f=0;f=0;o--){var a=t[o],s=void 0;if(a!==r&&!a.ignore&&(s=Cn(a,n,i))&&(!e.topTarget&&(e.topTarget=a),s!==yn)){e.target=a;break}}}function An(t,e,n){var i=t.painter;return e<0||e>i.getWidth()||n<0||n>i.getHeight()}ct(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(t){Mn.prototype[t]=function(e){var n,i,r=e.zrX,o=e.zrY,a=An(this,r,o);if("mouseup"===t&&a||(i=(n=this.findHover(r,o)).target),"mousedown"===t)this._downEl=i,this._downPoint=[e.zrX,e.zrY],this._upEl=i;else if("mouseup"===t)this._upEl=i;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||ge(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,t,e)}}));const Dn=Mn;function In(t,e,n,i){var r=e+1;if(r===n)return 1;if(i(t[r++],t[e])<0){for(;r=0;)r++;return r-e}function Pn(t,e,n,i,r){for(i===e&&i++;i>>1])<0?l=o:s=o+1;var u=i-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;u>0;)t[s+u]=t[s+u-1],u--}t[s]=a}}function En(t,e,n,i,r,o){var a=0,s=0,l=1;if(o(t,e[n+r])>0){for(s=i-r;l0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=r,l+=r}else{for(s=r+1;ls&&(l=s);var u=a;a=r-l,l=r-u}for(a++;a>>1);o(t,e[n+h])>0?a=h+1:l=h}return l}function On(t,e,n,i,r,o){var a=0,s=0,l=1;if(o(t,e[n+r])<0){for(s=r+1;ls&&(l=s);var u=a;a=r-l,l=r-u}else{for(s=i-r;l=0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=r,l+=r}for(a++;a>>1);o(t,e[n+h])<0?l=h:a=h+1}return l}function Nn(t,e){var n,i,r=7,o=0,a=[];function s(s){var l=n[s],u=i[s],h=n[s+1],c=i[s+1];i[s]=u+c,s===o-3&&(n[s+1]=n[s+2],i[s+1]=i[s+2]),o--;var d=On(t[h],t,l,u,0,e);l+=d,0!==(u-=d)&&0!==(c=En(t[l+u-1],t,h,c,c-1,e))&&(u<=c?function(n,i,o,s){var l=0;for(l=0;l=7||f>=7);if(p)break;g<0&&(g=0),g+=2}if((r=g)<1&&(r=1),1===i){for(l=0;l=0;l--)t[f+l]=t[d+l];return void(t[c]=a[h])}var p=r;for(;;){var g=0,m=0,v=!1;do{if(e(a[h],t[u])<0){if(t[c--]=t[u--],g++,m=0,0==--i){v=!0;break}}else if(t[c--]=a[h--],m++,g=0,1==--s){v=!0;break}}while((g|m)=0;l--)t[f+l]=t[d+l];if(0===i){v=!0;break}}if(t[c--]=a[h--],1==--s){v=!0;break}if(0!==(m=s-En(t[u],a,0,s,s-1,e))){for(s-=m,f=(c-=m)+1,d=(h-=m)+1,l=0;l=7||m>=7);if(v)break;p<0&&(p=0),p+=2}(r=p)<1&&(r=1);if(1===s){for(f=(c-=i)+1,d=(u-=i)+1,l=i-1;l>=0;l--)t[f+l]=t[d+l];t[c]=a[h]}else{if(0===s)throw new Error;for(d=c-(s-1),l=0;l1;){var t=o-2;if(t>=1&&i[t-1]<=i[t]+i[t+1]||t>=2&&i[t-2]<=i[t]+i[t-1])i[t-1]i[t+1])break;s(t)}},forceMergeRuns:function(){for(;o>1;){var t=o-2;t>0&&i[t-1]=32;)e|=1&t,t>>=1;return t+e}(r);do{if((o=In(t,n,i,e))s&&(l=s),Pn(t,n,n+l,n+o,e),o=l}a.pushRun(n,o),a.mergeRuns(),r-=o,n+=o}while(0!==r);a.forceMergeRuns()}}}var kn=1,zn=4,Bn=!1;function Fn(){Bn||(Bn=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Vn(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var Gn=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Vn}return t.prototype.traverse=function(t,e){for(var n=0;n0&&(u.__clipPaths=[]),isNaN(u.z)&&(Fn(),u.z=0),isNaN(u.z2)&&(Fn(),u.z2=0),isNaN(u.zlevel)&&(Fn(),u.zlevel=0),this._displayList[this._displayListLen++]=u}var h=t.getDecalElement&&t.getDecalElement();h&&this._updateAndAddDisplayable(h,e,n);var c=t.getTextGuideLine();c&&this._updateAndAddDisplayable(c,e,n);var d=t.getTextContent();d&&this._updateAndAddDisplayable(d,e,n)}},t.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},t.prototype.delRoot=function(t){if(t instanceof Array)for(var e=0,n=t.length;e=0&&this._roots.splice(i,1)}},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}();const Hn=Gn;const Un=O.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};var Wn={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,n=.1,i=.4;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=i*Math.asin(1/n)/(2*Math.PI),(t*=2)<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-Wn.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*Wn.bounceIn(2*t):.5*Wn.bounceOut(2*t-1)+.5}};const jn=Wn;var Zn=Math.pow,Xn=Math.sqrt,qn=1e-8,Yn=1e-4,Kn=Xn(3),Jn=1/3,$n=$t(),Qn=$t(),ti=$t();function ei(t){return t>-1e-8&&tqn||t<-1e-8}function ii(t,e,n,i,r){var o=1-r;return o*o*(o*t+3*r*e)+r*r*(r*i+3*o*n)}function ri(t,e,n,i,r){var o=1-r;return 3*(((e-t)*o+2*(n-e)*r)*o+(i-n)*r*r)}function oi(t,e,n,i,r,o){var a=i+3*(e-n)-t,s=3*(n-2*e+t),l=3*(e-t),u=t-r,h=s*s-3*a*l,c=s*l-9*a*u,d=l*l-3*s*u,f=0;if(ei(h)&&ei(c)){if(ei(s))o[0]=0;else(S=-l/s)>=0&&S<=1&&(o[f++]=S)}else{var p=c*c-4*h*d;if(ei(p)){var g=c/h,m=-g/2;(S=-s/a+g)>=0&&S<=1&&(o[f++]=S),m>=0&&m<=1&&(o[f++]=m)}else if(p>0){var v=Xn(p),_=h*s+1.5*a*(-c+v),y=h*s+1.5*a*(-c-v);(S=(-s-((_=_<0?-Zn(-_,Jn):Zn(_,Jn))+(y=y<0?-Zn(-y,Jn):Zn(y,Jn))))/(3*a))>=0&&S<=1&&(o[f++]=S)}else{var x=(2*h*s-3*a*c)/(2*Xn(h*h*h)),w=Math.acos(x)/3,b=Xn(h),T=Math.cos(w),S=(-s-2*b*T)/(3*a),M=(m=(-s+b*(T+Kn*Math.sin(w)))/(3*a),(-s+b*(T-Kn*Math.sin(w)))/(3*a));S>=0&&S<=1&&(o[f++]=S),m>=0&&m<=1&&(o[f++]=m),M>=0&&M<=1&&(o[f++]=M)}}return f}function ai(t,e,n,i,r){var o=6*n-12*e+6*t,a=9*e+3*i-3*t-9*n,s=3*e-3*t,l=0;if(ei(a)){if(ni(o))(h=-s/o)>=0&&h<=1&&(r[l++]=h)}else{var u=o*o-4*a*s;if(ei(u))r[0]=-o/(2*a);else if(u>0){var h,c=Xn(u),d=(-o-c)/(2*a);(h=(-o+c)/(2*a))>=0&&h<=1&&(r[l++]=h),d>=0&&d<=1&&(r[l++]=d)}}return l}function si(t,e,n,i,r,o){var a=(e-t)*r+t,s=(n-e)*r+e,l=(i-n)*r+n,u=(s-a)*r+a,h=(l-s)*r+s,c=(h-u)*r+u;o[0]=t,o[1]=a,o[2]=u,o[3]=c,o[4]=c,o[5]=h,o[6]=l,o[7]=i}function li(t,e,n,i,r,o,a,s,l,u,h){var c,d,f,p,g,m=.005,v=1/0;$n[0]=l,$n[1]=u;for(var _=0;_<1;_+=.05)Qn[0]=ii(t,n,r,a,_),Qn[1]=ii(e,i,o,s,_),(p=ve($n,Qn))=0&&p=0&&m=1?1:oi(0,i,o,1,t,s)&&ii(0,r,a,1,s[0])}}}const _i=function(){function t(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||Kt,this.ondestroy=t.ondestroy||Kt,this.onrestart=t.onrestart||Kt,t.easing&&this.setEasing(t.easing)}return t.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),!this._paused){var n=this._life,i=t-this._startTime-this._pausedTime,r=i/n;r<0&&(r=0),r=Math.min(r,1);var o=this.easingFunc,a=o?o(r):r;if(this.onframe(a),1===r){if(!this.loop)return!0;var s=i%n;this._startTime=t-s,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=e},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(t){this.easing=t,this.easingFunc=xt(t)?t:jn[t]||vi(t)},t}();var yi=function(t){this.value=t},xi=function(){function t(){this._len=0}return t.prototype.insert=function(t){var e=new yi(t);return this.insertEntry(e),e},t.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++},t.prototype.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),wi=function(){function t(t){this._list=new xi,this._maxSize=10,this._map={},this._maxSize=t}return t.prototype.put=function(t,e){var n=this._list,i=this._map,r=null;if(null==i[t]){var o=n.len(),a=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var s=n.head;n.remove(s),delete i[s.key],r=s.value,this._lastRemovedEntry=s}a?a.value=e:a=new yi(e),a.key=t,n.insertEntry(a),i[t]=a}return r},t.prototype.get=function(t){var e=this._map[t],n=this._list;if(null!=e)return e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}();const bi=wi;var Ti={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 Si(t){return(t=Math.round(t))<0?0:t>255?255:t}function Mi(t){return t<0?0:t>1?1:t}function Ci(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?Si(parseFloat(e)/100*255):Si(parseInt(e,10))}function Li(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?Mi(parseFloat(e)/100):Mi(parseFloat(e))}function Ai(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function Di(t,e,n){return t+(e-t)*n}function Ii(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function Pi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var Ei=new bi(20),Oi=null;function Ni(t,e){Oi&&Pi(Oi,e),Oi=Ei.put(t,Oi||e.slice())}function Ri(t,e){if(t){e=e||[];var n=Ei.get(t);if(n)return Pi(e,n);var i=(t+="").replace(/ /g,"").toLowerCase();if(i in Ti)return Pi(e,Ti[i]),Ni(t,e),e;var r,o=i.length;if("#"===i.charAt(0))return 4===o||5===o?(r=parseInt(i.slice(1,4),16))>=0&&r<=4095?(Ii(e,(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,5===o?parseInt(i.slice(4),16)/15:1),Ni(t,e),e):void Ii(e,0,0,0,1):7===o||9===o?(r=parseInt(i.slice(1,7),16))>=0&&r<=16777215?(Ii(e,(16711680&r)>>16,(65280&r)>>8,255&r,9===o?parseInt(i.slice(7),16)/255:1),Ni(t,e),e):void Ii(e,0,0,0,1):void 0;var a=i.indexOf("("),s=i.indexOf(")");if(-1!==a&&s+1===o){var l=i.substr(0,a),u=i.substr(a+1,s-(a+1)).split(","),h=1;switch(l){case"rgba":if(4!==u.length)return 3===u.length?Ii(e,+u[0],+u[1],+u[2],1):Ii(e,0,0,0,1);h=Li(u.pop());case"rgb":return u.length>=3?(Ii(e,Ci(u[0]),Ci(u[1]),Ci(u[2]),3===u.length?h:Li(u[3])),Ni(t,e),e):void Ii(e,0,0,0,1);case"hsla":return 4!==u.length?void Ii(e,0,0,0,1):(u[3]=Li(u[3]),ki(u,e),Ni(t,e),e);case"hsl":return 3!==u.length?void Ii(e,0,0,0,1):(ki(u,e),Ni(t,e),e);default:return}}Ii(e,0,0,0,1)}}function ki(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=Li(t[1]),r=Li(t[2]),o=r<=.5?r*(i+1):r+i-r*i,a=2*r-o;return Ii(e=e||[],Si(255*Ai(a,o,n+1/3)),Si(255*Ai(a,o,n)),Si(255*Ai(a,o,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function zi(t,e){var n=Ri(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,n[i]>255?n[i]=255:n[i]<0&&(n[i]=0);return ji(n,4===n.length?"rgba":"rgb")}}function Bi(t){var e=Ri(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function Fi(t,e,n){if(e&&e.length&&t>=0&&t<=1){n=n||[];var i=t*(e.length-1),r=Math.floor(i),o=Math.ceil(i),a=e[r],s=e[o],l=i-r;return n[0]=Si(Di(a[0],s[0],l)),n[1]=Si(Di(a[1],s[1],l)),n[2]=Si(Di(a[2],s[2],l)),n[3]=Mi(Di(a[3],s[3],l)),n}}var Vi=Fi;function Gi(t,e,n){if(e&&e.length&&t>=0&&t<=1){var i=t*(e.length-1),r=Math.floor(i),o=Math.ceil(i),a=Ri(e[r]),s=Ri(e[o]),l=i-r,u=ji([Si(Di(a[0],s[0],l)),Si(Di(a[1],s[1],l)),Si(Di(a[2],s[2],l)),Mi(Di(a[3],s[3],l))],"rgba");return n?{color:u,leftIndex:r,rightIndex:o,value:i}:u}}var Hi=Gi;function Ui(t,e,n,i){var r,o=Ri(t);if(t)return o=function(t){if(t){var e,n,i=t[0]/255,r=t[1]/255,o=t[2]/255,a=Math.min(i,r,o),s=Math.max(i,r,o),l=s-a,u=(s+a)/2;if(0===l)e=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var h=((s-i)/6+l/2)/l,c=((s-r)/6+l/2)/l,d=((s-o)/6+l/2)/l;i===s?e=d-c:r===s?e=1/3+h-d:o===s&&(e=2/3+c-h),e<0&&(e+=1),e>1&&(e-=1)}var f=[360*e,n,u];return null!=t[3]&&f.push(t[3]),f}}(o),null!=e&&(o[0]=(r=e,(r=Math.round(r))<0?0:r>360?360:r)),null!=n&&(o[1]=Li(n)),null!=i&&(o[2]=Li(i)),ji(ki(o),"rgba")}function Wi(t,e){var n=Ri(t);if(n&&null!=e)return n[3]=Mi(e),ji(n,"rgba")}function ji(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}function Zi(t,e){var n=Ri(t);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*e:0}function Xi(){return ji([Math.round(255*Math.random()),Math.round(255*Math.random()),Math.round(255*Math.random())],"rgb")}var qi=new bi(100);function Yi(t){if(wt(t)){var e=qi.get(t);return e||(e=zi(t,-.1),qi.put(t,e)),e}if(At(t)){var n=rt({},t);return n.colorStops=dt(t.colorStops,(function(t){return{offset:t.offset,color:zi(t.color,-.1)}})),n}return t}var Ki=Math.round;function Ji(t){var e;if(t&&"transparent"!==t){if("string"==typeof t&&t.indexOf("rgba")>-1){var n=Ri(t);n&&(t="rgb("+n[0]+","+n[1]+","+n[2]+")",e=n[3])}}else t="none";return{color:t,opacity:null==e?1:e}}var $i=1e-4;function Qi(t){return t<$i&&t>-1e-4}function tr(t){return Ki(1e3*t)/1e3}function er(t){return Ki(1e4*t)/1e4}var nr={left:"start",right:"end",center:"middle",middle:"middle"};function ir(t){return t&&!!t.image}function rr(t){return ir(t)||function(t){return t&&!!t.svgElement}(t)}function or(t){return"linear"===t.type}function ar(t){return"radial"===t.type}function sr(t){return t&&("linear"===t.type||"radial"===t.type)}function lr(t){return"url(#"+t+")"}function ur(t){var e=t.getGlobalScale(),n=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(n)/Math.log(10)),1)}function hr(t){var e=t.x||0,n=t.y||0,i=(t.rotation||0)*Jt,r=Ot(t.scaleX,1),o=Ot(t.scaleY,1),a=t.skewX||0,s=t.skewY||0,l=[];return(e||n)&&l.push("translate("+e+"px,"+n+"px)"),i&&l.push("rotate("+i+")"),1===r&&1===o||l.push("scale("+r+","+o+")"),(a||s)&&l.push("skew("+Ki(a*Jt)+"deg, "+Ki(s*Jt)+"deg)"),l.join(" ")}var cr=O.hasGlobalWindow&&xt(window.btoa)?function(t){return window.btoa(unescape(encodeURIComponent(t)))}:"undefined"!=typeof Buffer?function(t){return Buffer.from(t).toString("base64")}:function(t){return null},dr=Array.prototype.slice;function fr(t,e,n){return(e-t)*n+t}function pr(t,e,n,i){for(var r=e.length,o=0;oi?e:t,o=Math.min(n,i),a=r[o-1]||{color:[0,0,0,0],offset:0},s=o;sa)i.length=a;else for(var s=o;s=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(t,e,n){this._needsSort=!0;var i=this.keyframes,r=i.length,o=!1,a=6,s=e;if(ht(e)){var l=function(t){return ht(t&&t[0])?2:1}(e);a=l,(1===l&&!Tt(e[0])||2===l&&!Tt(e[0][0]))&&(o=!0)}else if(Tt(e)&&!Pt(e))a=0;else if(wt(e))if(isNaN(+e)){var u=Ri(e);u&&(s=u,a=3)}else a=0;else if(At(e)){var h=rt({},s);h.colorStops=dt(e.colorStops,(function(t){return{offset:t.offset,color:Ri(t.color)}})),or(e)?a=4:ar(e)&&(a=5),s=h}0===r?this.valType=a:a===this.valType&&6!==a||(o=!0),this.discrete=this.discrete||o;var c={time:t,value:s,rawValue:e,percent:0};return n&&(c.easing=n,c.easingFunc=xt(n)?n:jn[n]||vi(n)),i.push(c),c},t.prototype.prepare=function(t,e){var n=this.keyframes;this._needsSort&&n.sort((function(t,e){return t.time-e.time}));for(var i=this.valType,r=n.length,o=n[r-1],a=this.discrete,s=br(i),l=wr(i),u=0;u=0&&!(l[n].percent<=e);n--);n=f(n,u-2)}else{for(n=d;ne);n++);n=f(n-1,u-2)}r=l[n+1],i=l[n]}if(i&&r){this._lastFr=n,this._lastFrP=e;var p=r.percent-i.percent,g=0===p?1:f((e-i.percent)/p,1);r.easingFunc&&(g=r.easingFunc(g));var m=o?this._additiveValue:c?Tr:t[h];if(!br(s)&&!c||m||(m=this._additiveValue=[]),this.discrete)t[h]=g<1?i.rawValue:r.rawValue;else if(br(s))1===s?pr(m,i[a],r[a],g):function(t,e,n,i){for(var r=e.length,o=r&&e[0].length,a=0;a0&&s.addKeyframe(0,yr(l),i),this._trackKeys.push(a)}s.addKeyframe(t,yr(e[a]),i)}return this._maxTime=Math.max(this._maxTime,t),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,n=0;n0)){this._started=1;for(var e=this,n=[],i=this._maxTime||0,r=0;r1){var a=o.pop();r.addKeyframe(a.time,t[i]),r.prepare(this._maxTime,r.getAdditiveTrack())}}}},t}();const Cr=Mr;function Lr(){return(new Date).getTime()}var Ar=function(t){function e(e){var n=t.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,e=e||{},n.stage=e.stage||{},n}return I(e,t),e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var e=t.getClip();e&&this.addClip(e)},e.prototype.removeClip=function(t){if(t.animation){var e=t.prev,n=t.next;e?e.next=n:this._head=n,n?n.prev=e:this._tail=e,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var e=t.getClip();e&&this.removeClip(e),t.animation=null},e.prototype.update=function(t){for(var e=Lr()-this._pausedTime,n=e-this._time,i=this._head;i;){var r=i.next;i.step(e,n)?(i.ondestroy(),this.removeClip(i),i=r):i=r}this._time=e,t||(this.trigger("frame",n),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0,Un((function e(){t._running&&(Un(e),!t._paused&&t.update())}))},e.prototype.start=function(){this._running||(this._time=Lr(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=Lr(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=Lr()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var e=t.next;t.prev=t.next=t.animation=null,t=e}this._head=this._tail=null},e.prototype.isFinished=function(){return null==this._head},e.prototype.animate=function(t,e){e=e||{},this.start();var n=new Cr(t,e.loop);return this.addAnimator(n),n},e}(Le);const Dr=Ar;var Ir,Pr,Er=O.domSupported,Or=(Pr={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:Ir=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:dt(Ir,(function(t){var e=t.replace("mouse","pointer");return Pr.hasOwnProperty(e)?e:t}))}),Nr=["mousemove","mouseup"],Rr=["pointermove","pointerup"],kr=!1;function zr(t){var e=t.pointerType;return"pen"===e||"touch"===e}function Br(t){t&&(t.zrByTouch=!0)}function Fr(t,e){for(var n=e,i=!1;n&&9!==n.nodeType&&!(i=n.domBelongToZr||n!==e&&n===t.painterRoot);)n=n.parentNode;return i}var Vr=function(t,e){this.stopPropagation=Kt,this.stopImmediatePropagation=Kt,this.preventDefault=Kt,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY},Gr={mousedown:function(t){t=We(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=We(this.dom,t);var e=this.__mayPointerCapture;!e||t.zrX===e[0]&&t.zrY===e[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=We(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){Fr(this,(t=We(this.dom,t)).toElement||t.relatedTarget)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){kr=!0,t=We(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){kr||(t=We(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){Br(t=We(this.dom,t)),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),Gr.mousemove.call(this,t),Gr.mousedown.call(this,t)},touchmove:function(t){Br(t=We(this.dom,t)),this.handler.processGesture(t,"change"),Gr.mousemove.call(this,t)},touchend:function(t){Br(t=We(this.dom,t)),this.handler.processGesture(t,"end"),Gr.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<300&&Gr.click.call(this,t)},pointerdown:function(t){Gr.mousedown.call(this,t)},pointermove:function(t){zr(t)||Gr.mousemove.call(this,t)},pointerup:function(t){Gr.mouseup.call(this,t)},pointerout:function(t){zr(t)||Gr.mouseout.call(this,t)}};ct(["click","dblclick","contextmenu"],(function(t){Gr[t]=function(e){e=We(this.dom,e),this.trigger(t,e)}}));var Hr={pointermove:function(t){zr(t)||Hr.mousemove.call(this,t)},pointerup:function(t){Hr.mouseup.call(this,t)},mousemove:function(t){this.trigger("mousemove",t)},mouseup:function(t){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",t),e&&(t.zrEventControl="only_globalout",this.trigger("mouseout",t))}};function Ur(t,e){var n=e.domHandlers;O.pointerEventsSupported?ct(Or.pointer,(function(i){jr(e,i,(function(e){n[i].call(t,e)}))})):(O.touchEventsSupported&&ct(Or.touch,(function(i){jr(e,i,(function(r){n[i].call(t,r),function(t){t.touching=!0,null!=t.touchTimer&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout((function(){t.touching=!1,t.touchTimer=null}),700)}(e)}))})),ct(Or.mouse,(function(i){jr(e,i,(function(r){r=Ue(r),e.touching||n[i].call(t,r)}))})))}function Wr(t,e){function n(n){jr(e,n,(function(i){i=Ue(i),Fr(t,i.target)||(i=function(t,e){return We(t.dom,new Vr(t,e),!0)}(t,i),e.domHandlers[n].call(t,i))}),{capture:!0})}O.pointerEventsSupported?ct(Rr,n):O.touchEventsSupported||ct(Nr,n)}function jr(t,e,n,i){t.mounted[e]=n,t.listenerOpts[e]=i,je(t.domTarget,e,n,i)}function Zr(t){var e,n,i,r,o=t.mounted;for(var a in o)o.hasOwnProperty(a)&&(e=t.domTarget,n=a,i=o[a],r=t.listenerOpts[a],e.removeEventListener(n,i,r));t.mounted={}}var Xr=function(t,e){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=t,this.domHandlers=e};const qr=function(t){function e(e,n){var i=t.call(this)||this;return i.__pointerCapturing=!1,i.dom=e,i.painterRoot=n,i._localHandlerScope=new Xr(e,Gr),Er&&(i._globalHandlerScope=new Xr(document,Hr)),Ur(i,i._localHandlerScope),i}return I(e,t),e.prototype.dispose=function(){Zr(this._localHandlerScope),Er&&Zr(this._globalHandlerScope)},e.prototype.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},e.prototype.__togglePointerCapture=function(t){if(this.__mayPointerCapture=null,Er&&+this.__pointerCapturing^+t){this.__pointerCapturing=t;var e=this._globalHandlerScope;t?Wr(this,e):Zr(e)}},e}(Le);var Yr=1;O.hasGlobalWindow&&(Yr=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var Kr=Yr,Jr="#333",$r="#ccc",Qr=$e,to=5e-5;function eo(t){return t>to||t<-5e-5}var no=[],io=[],ro=[1,0,0,1,0,0],oo=Math.abs,ao=function(){function t(){}return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},t.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},t.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},t.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},t.prototype.needLocalTransform=function(){return eo(this.rotation)||eo(this.x)||eo(this.y)||eo(this.scaleX-1)||eo(this.scaleY-1)||eo(this.skewX)||eo(this.skewY)},t.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),n=this.transform;e||t?(n=n||[1,0,0,1,0,0],e?this.getLocalTransform(n):Qr(n),t&&(e?tn(n,t,n):Qe(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)):n&&(Qr(n),this.invTransform=null)},t.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(null!=e&&1!==e){this.getGlobalScale(no);var n=no[0]<0?-1:1,i=no[1]<0?-1:1,r=((no[0]-n)*e+n)/no[0]||0,o=((no[1]-i)*e+i)/no[1]||0;t[0]*=r,t[1]*=r,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||[1,0,0,1,0,0],on(this.invTransform,t)},t.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},t.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],n=t[2]*t[2]+t[3]*t[3],i=Math.atan2(t[1],t[0]),r=Math.PI/2+i-Math.atan2(t[3],t[2]);n=Math.sqrt(n)*Math.cos(r),e=Math.sqrt(e),this.skewX=r,this.skewY=0,this.rotation=-i,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||[1,0,0,1,0,0],tn(io,t.invTransform,e),e=io);var n=this.originX,i=this.originY;(n||i)&&(ro[4]=n,ro[5]=i,tn(io,e,ro),io[4]-=n,io[5]-=i,e=io),this.setLocalTransform(e)}},t.prototype.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},t.prototype.transformCoordToLocal=function(t,e){var n=[t,e],i=this.invTransform;return i&&xe(n,n,i),n},t.prototype.transformCoordToGlobal=function(t,e){var n=[t,e],i=this.transform;return i&&xe(n,n,i),n},t.prototype.getLineScale=function(){var t=this.transform;return t&&oo(t[0]-1)>1e-10&&oo(t[3]-1)>1e-10?Math.sqrt(oo(t[0]*t[3]-t[2]*t[1])):1},t.prototype.copyTransform=function(t){lo(this,t)},t.getLocalTransform=function(t,e){e=e||[];var n=t.originX||0,i=t.originY||0,r=t.scaleX,o=t.scaleY,a=t.anchorX,s=t.anchorY,l=t.rotation||0,u=t.x,h=t.y,c=t.skewX?Math.tan(t.skewX):0,d=t.skewY?Math.tan(-t.skewY):0;if(n||i||a||s){var f=n+a,p=i+s;e[4]=-f*r-c*p*o,e[5]=-p*o-d*f*r}else e[4]=e[5]=0;return e[0]=r,e[3]=o,e[1]=d*r,e[2]=c*o,l&&nn(e,e,l),e[4]+=n+u,e[5]+=i+h,e},t.initDefaultProps=function(){var e=t.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0}(),t}(),so=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function lo(t,e){for(var n=0;n=0?parseFloat(t)/100*e:parseFloat(t):t}function yo(t,e,n){var i=e.position||"inside",r=null!=e.distance?e.distance:5,o=n.height,a=n.width,s=o/2,l=n.x,u=n.y,h="left",c="top";if(i instanceof Array)l+=_o(i[0],n.width),u+=_o(i[1],n.height),h=null,c=null;else switch(i){case"left":l-=r,u+=s,h="right",c="middle";break;case"right":l+=r+a,u+=s,c="middle";break;case"top":l+=a/2,u-=r,h="center",c="bottom";break;case"bottom":l+=a/2,u+=o+r,h="center";break;case"inside":l+=a/2,u+=s,h="center",c="middle";break;case"insideLeft":l+=r,u+=s,c="middle";break;case"insideRight":l+=a-r,u+=s,h="right",c="middle";break;case"insideTop":l+=a/2,u+=r,h="center";break;case"insideBottom":l+=a/2,u+=o-r,h="center",c="bottom";break;case"insideTopLeft":l+=r,u+=r;break;case"insideTopRight":l+=a-r,u+=r,h="right";break;case"insideBottomLeft":l+=r,u+=o-r,c="bottom";break;case"insideBottomRight":l+=a-r,u+=o-r,h="right",c="bottom"}return(t=t||{}).x=l,t.y=u,t.align=h,t.verticalAlign=c,t}var xo="__zr_normal__",wo=so.concat(["ignore"]),bo=ft(so,(function(t,e){return t[e]=!0,t}),{ignore:!1}),To={},So=new _n(0,0,0,0),Mo=function(){function t(t){this.id=Q(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return t.prototype._init=function(t){this.attr(t)},t.prototype.drift=function(t,e,n){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=e,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,r=e.innerTransformable,o=void 0,a=void 0,s=!1;r.parent=i?this:null;var l=!1;if(r.copyTransform(e),null!=n.position){var u=So;n.layoutRect?u.copy(n.layoutRect):u.copy(this.getBoundingRect()),i||u.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(To,n,u):yo(To,n,u),r.x=To.x,r.y=To.y,o=To.align,a=To.verticalAlign;var h=n.origin;if(h&&null!=n.rotation){var c=void 0,d=void 0;"center"===h?(c=.5*u.width,d=.5*u.height):(c=_o(h[0],u.width),d=_o(h[1],u.height)),l=!0,r.originX=-r.x+c+(i?0:u.x),r.originY=-r.y+d+(i?0:u.y)}}null!=n.rotation&&(r.rotation=n.rotation);var f=n.offset;f&&(r.x+=f[0],r.y+=f[1],l||(r.originX=-f[0],r.originY=-f[1]));var p=null==n.inside?"string"==typeof n.position&&n.position.indexOf("inside")>=0:n.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),m=void 0,v=void 0,_=void 0;p&&this.canBeInsideText()?(m=n.insideFill,v=n.insideStroke,null!=m&&"auto"!==m||(m=this.getInsideTextFill()),null!=v&&"auto"!==v||(v=this.getInsideTextStroke(m),_=!0)):(m=n.outsideFill,v=n.outsideStroke,null!=m&&"auto"!==m||(m=this.getOutsideFill()),null!=v&&"auto"!==v||(v=this.getOutsideStroke(m),_=!0)),(m=m||"#000")===g.fill&&v===g.stroke&&_===g.autoStroke&&o===g.align&&a===g.verticalAlign||(s=!0,g.fill=m,g.stroke=v,g.autoStroke=_,g.align=o,g.verticalAlign=a,e.setDefaultTextStyle(g)),e.__dirty|=kn,s&&e.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(t){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?$r:Jr},t.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),n="string"==typeof e&&Ri(e);n||(n=[255,255,255,1]);for(var i=n[3],r=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*i+(r?0:255)*(1-i);return n[3]=1,ji(n,"rgba")},t.prototype.traverse=function(t,e){},t.prototype.attrKV=function(t,e){"textConfig"===t?this.setTextConfig(e):"textContent"===t?this.setTextContent(e):"clipPath"===t?this.setClipPath(e):"extra"===t?(this.extra=this.extra||{},rt(this.extra,e)):this[t]=e},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(St(t))for(var n=mt(t),i=0;i0},t.prototype.getState=function(t){return this.states[t]},t.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},t.prototype.clearStates=function(t){this.useState(xo,!1,t)},t.prototype.useState=function(t,e,n,i){var r=t===xo;if(this.hasState()||!r){var o=this.currentStates,a=this.stateTransition;if(!(st(o,t)>=0)||!e&&1!==o.length){var s;if(this.stateProxy&&!r&&(s=this.stateProxy(t)),s||(s=this.states&&this.states[t]),s||r){r||this.saveCurrentToNormalState(s);var l=!!(s&&s.hoverLayer||i);l&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,s,this._normalState,e,!n&&!this.__inHover&&a&&a.duration>0,a);var u=this._textContent,h=this._textGuide;return u&&u.useState(t,e,n,l),h&&h.useState(t,e,n,l),r?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~kn),s}tt("State "+t+" not exists.")}}},t.prototype.useStates=function(t,e,n){if(t.length){var i=[],r=this.currentStates,o=t.length,a=o===r.length;if(a)for(var s=0;s0,f);var p=this._textContent,g=this._textGuide;p&&p.useStates(t,e,c),g&&g.useStates(t,e,c),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~kn)}else this.clearStates()},t.prototype.isSilent=function(){for(var t=this.silent,e=this.parent;!t&&e;){if(e.silent){t=!0;break}e=e.parent}return t},t.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var n=this.currentStates.slice();n.splice(e,1),this.useStates(n)}},t.prototype.replaceState=function(t,e,n){var i=this.currentStates.slice(),r=st(i,t),o=st(i,e)>=0;r>=0?o?i.splice(r,1):i[r]=e:n&&!o&&i.push(e),this.useStates(i)},t.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},t.prototype._mergeStates=function(t){for(var e,n={},i=0;i=0&&e.splice(n,1)})),this.animators.push(t),n&&n.animation.addAnimator(t),n&&n.wakeUp()},t.prototype.updateDuringAnimation=function(t){this.markRedraw()},t.prototype.stopAnimation=function(t,e){for(var n=this.animators,i=n.length,r=[],o=0;o0&&n.during&&o[0].during((function(t,e){n.during(e)}));for(var d=0;d0||r.force&&!a.length){var b,T=void 0,S=void 0,M=void 0;if(s){S={},d&&(T={});for(x=0;x=0&&(n.splice(i,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,e){var n=st(this._children,t);return n>=0&&this.replaceAt(e,n),this},e.prototype.replaceAt=function(t,e){var n=this._children,i=n[e];if(t&&t!==this&&t.parent!==this&&t!==i){n[e]=t,i.parent=null;var r=this.__zr;r&&i.removeSelfFromZr(r),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__zr;e&&e!==t.__zr&&t.addSelfToZr(e),e&&e.refresh()},e.prototype.remove=function(t){var e=this.__zr,n=this._children,i=st(n,t);return i<0||(n.splice(i,1),t.parent=null,e&&t.removeSelfFromZr(e),e&&e.refresh()),this},e.prototype.removeAll=function(){for(var t=this._children,e=this.__zr,n=0;n0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},t.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover())},t.prototype.resize=function(t){this._disposed||(t=t||{},this.painter.resize(t.width,t.height),this.handler.resize())},t.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},t.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},t.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},t.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},t.prototype.findHover=function(t,e){if(!this._disposed)return this.handler.findHover(t,e)},t.prototype.on=function(t,e,n){return this._disposed||this.handler.on(t,e,n),this},t.prototype.off=function(t,e){this._disposed||this.handler.off(t,e)},t.prototype.trigger=function(t,e){this._disposed||this.handler.trigger(t,e)},t.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),e=0;e0){if(t<=r)return a;if(t>=o)return s}else{if(t>=r)return a;if(t<=o)return s}else{if(t===r)return a;if(t===o)return s}return(t-r)/l*u+a}function qo(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return wt(t)?(n=t,n.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t;var n}function Yo(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),Zo),t=(+t).toFixed(e),n?t:+t}function Ko(t){return t.sort((function(t,e){return t-e})),t}function Jo(t){if(t=+t,isNaN(t))return 0;if(t>1e-14)for(var e=1,n=0;n<15;n++,e*=10)if(Math.round(t*e)/e===t)return n;return $o(t)}function $o(t){var e=t.toString().toLowerCase(),n=e.indexOf("e"),i=n>0?+e.slice(n+1):0,r=n>0?n:e.length,o=e.indexOf("."),a=o<0?0:r-1-o;return Math.max(0,a-i)}function Qo(t,e){var n=Math.log,i=Math.LN10,r=Math.floor(n(t[1]-t[0])/i),o=Math.round(n(Math.abs(e[1]-e[0]))/i),a=Math.min(Math.max(-r+o,0),20);return isFinite(a)?a:20}function ta(t,e,n){if(!t[e])return 0;var i=function(t,e){var n=ft(t,(function(t,e){return t+(isNaN(e)?0:e)}),0);if(0===n)return[];var i=Math.pow(10,e),r=dt(t,(function(t){return(isNaN(t)?0:t)/n*i*100})),o=100*i,a=dt(r,(function(t){return Math.floor(t)})),s=ft(a,(function(t,e){return t+e}),0),l=dt(r,(function(t,e){return t-a[e]}));for(;su&&(u=l[c],h=c);++a[h],l[h]=0,++s}return dt(a,(function(t){return t/i}))}(t,n);return i[e]||0}function ea(t,e){var n=Math.max(Jo(t),Jo(e)),i=t+e;return n>Zo?i:Yo(i,n)}var na=9007199254740991;function ia(t){var e=2*Math.PI;return(t%e+e)%e}function ra(t){return t>-jo&&t=10&&e++,e}function ua(t,e){var n=la(t),i=Math.pow(10,n),r=t/i;return t=(e?r<1.5?1:r<2.5?2:r<4?3:r<7?5:10:r<1?1:r<2?2:r<3?3:r<5?5:10)*i,n>=-20?+t.toFixed(n<0?-n:0):t}function ha(t,e){var n=(t.length-1)*e+1,i=Math.floor(n),r=+t[i-1],o=n-i;return o?r+o*(t[i]-r):r}function ca(t){t.sort((function(t,e){return s(t,e,0)?-1:1}));for(var e=-1/0,n=1,i=0;i=0||r&&st(r,s)<0)){var l=n.getShallow(s,e);null!=l&&(o[t[a][0]]=l)}}return o}}var Ka=Ya([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),Ja=function(){function t(){}return t.prototype.getAreaStyle=function(t,e){return Ka(this,t,e)},t}(),$a=new bi(50);function Qa(t){if("string"==typeof t){var e=$a.get(t);return e&&e.image}return t}function ts(t,e,n,i,r){if(t){if("string"==typeof t){if(e&&e.__zrImageSrc===t||!n)return e;var o=$a.get(t),a={hostEl:n,cb:i,cbPayload:r};return o?!ns(e=o.image)&&o.pending.push(a):((e=F.loadImage(t,es,es)).__zrImageSrc=t,$a.put(t,e.__cachedImgObj={image:e,pending:[a]})),e}return t}return e}function es(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=a;l++)s-=a;var u=co(n,e);return u>s&&(n="",u=0),s=t-u,r.ellipsis=n,r.ellipsisWidth=u,r.contentWidth=s,r.containerWidth=t,r}function ss(t,e,n){var i=n.containerWidth,r=n.font,o=n.contentWidth;if(!i)return t.textLine="",void(t.isTruncated=!1);var a=co(e,r);if(a<=i)return t.textLine=e,void(t.isTruncated=!1);for(var s=0;;s++){if(a<=o||s>=n.maxIterations){e+=n.ellipsis;break}var l=0===s?ls(e,o,n.ascCharWidth,n.cnCharWidth):a>0?Math.floor(e.length*o/a):0;a=co(e=e.substr(0,l),r)}""===e&&(e=n.placeholder),t.textLine=e,t.isTruncated=!0}function ls(t,e,n,i){for(var r=0,o=0,a=t.length;o0&&p+i.accumWidth>i.width&&(o=e.split("\n"),c=!0),i.accumWidth=p}else{var g=gs(e,h,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+f,a=g.linesWidths,o=g.lines}}else o=e.split("\n");for(var m=0;m=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}(t)||!!fs[t]}function gs(t,e,n,i,r){for(var o=[],a=[],s="",l="",u=0,h=0,c=0;cn:r+h+f>n)?h?(s||l)&&(p?(s||(s=l,l="",h=u=0),o.push(s),a.push(h-u),l+=d,s="",h=u+=f):(l&&(s+=l,l="",u=0),o.push(s),a.push(h),s=d,h=f)):p?(o.push(l),a.push(u),l=d,u=f):(o.push(d),a.push(f)):(h+=f,p?(l+=d,u+=f):(l&&(s+=l,l="",u=0),s+=d))}else l&&(s+=l,h+=u),o.push(s),a.push(h),s="",l="",u=0,h=0}return o.length||s||(s=t,l="",u=0),l&&(s+=l),s&&(o.push(s),a.push(h)),1===o.length&&(h+=r),{accumWidth:h,lines:o,linesWidths:a}}var ms="__zr_style_"+Math.round(10*Math.random()),vs={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},_s={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};vs[ms]=!0;var ys=["z","z2","invisible"],xs=["invisible"],ws=function(t){function e(e){return t.call(this,e)||this}var n;return I(e,t),e.prototype._init=function(e){for(var n=mt(e),i=0;i1e-4)return s[0]=t-n,s[1]=e-i,l[0]=t+n,void(l[1]=e+i);if(Is[0]=As(r)*n+t,Is[1]=Ls(r)*i+e,Ps[0]=As(o)*n+t,Ps[1]=Ls(o)*i+e,u(s,Is,Ps),h(l,Is,Ps),(r%=Ds)<0&&(r+=Ds),(o%=Ds)<0&&(o+=Ds),r>o&&!a?o+=Ds:rr&&(Es[0]=As(f)*n+t,Es[1]=Ls(f)*i+e,u(s,Es,s),h(l,Es,l))}var Fs={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Vs=[],Gs=[],Hs=[],Us=[],Ws=[],js=[],Zs=Math.min,Xs=Math.max,qs=Math.cos,Ys=Math.sin,Ks=Math.abs,Js=Math.PI,$s=2*Js,Qs="undefined"!=typeof Float32Array,tl=[];function el(t){return Math.round(t/Js*1e8)/1e8%2*Js}var nl=function(){function t(t){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,t&&(this._saveData=!1),this._saveData&&(this.data=[])}return t.prototype.increaseVersion=function(){this._version++},t.prototype.getVersion=function(){return this._version},t.prototype.setScale=function(t,e,n){(n=n||0)>0&&(this._ux=Ks(n/Kr/t)||0,this._uy=Ks(n/Kr/e)||0)},t.prototype.setDPR=function(t){this.dpr=t},t.prototype.setContext=function(t){this._ctx=t},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(Fs.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},t.prototype.lineTo=function(t,e){var n=Ks(t-this._xi),i=Ks(e-this._yi),r=n>this._ux||i>this._uy;if(this.addData(Fs.L,t,e),this._ctx&&r&&this._ctx.lineTo(t,e),r)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var o=n*n+i*i;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(t,e,n,i,r,o){return this._drawPendingPt(),this.addData(Fs.C,t,e,n,i,r,o),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,r,o),this._xi=r,this._yi=o,this},t.prototype.quadraticCurveTo=function(t,e,n,i){return this._drawPendingPt(),this.addData(Fs.Q,t,e,n,i),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this._xi=n,this._yi=i,this},t.prototype.arc=function(t,e,n,i,r,o){this._drawPendingPt(),tl[0]=i,tl[1]=r,function(t,e){var n=el(t[0]);n<0&&(n+=$s);var i=n-t[0],r=t[1];r+=i,!e&&r-n>=$s?r=n+$s:e&&n-r>=$s?r=n-$s:!e&&n>r?r=n+($s-el(n-r)):e&&nu.length&&(this._expandData(),u=this.data);for(var h=0;h0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e11&&(this.data=new Float32Array(t)))}},t.prototype.getBoundingRect=function(){Hs[0]=Hs[1]=Ws[0]=Ws[1]=Number.MAX_VALUE,Us[0]=Us[1]=js[0]=js[1]=-Number.MAX_VALUE;var t,e=this.data,n=0,i=0,r=0,o=0;for(t=0;tn||Ks(m)>i||c===e-1)&&(p=Math.sqrt(D*D+m*m),r=g,o=y);break;case Fs.C:var v=t[c++],_=t[c++],y=(g=t[c++],t[c++]),x=t[c++],w=t[c++];p=ui(r,o,v,_,g,y,x,w,10),r=x,o=w;break;case Fs.Q:p=gi(r,o,v=t[c++],_=t[c++],g=t[c++],y=t[c++],10),r=g,o=y;break;case Fs.A:var b=t[c++],T=t[c++],S=t[c++],M=t[c++],C=t[c++],L=t[c++],A=L+C;c+=1,f&&(a=qs(C)*S+b,s=Ys(C)*M+T),p=Xs(S,M)*Zs($s,Math.abs(L)),r=qs(A)*S+b,o=Ys(A)*M+T;break;case Fs.R:a=r=t[c++],s=o=t[c++],p=2*t[c++]+2*t[c++];break;case Fs.Z:var D=a-r;m=s-o;p=Math.sqrt(D*D+m*m),r=a,o=s}p>=0&&(l[h++]=p,u+=p)}return this._pathLen=u,u},t.prototype.rebuildPath=function(t,e){var n,i,r,o,a,s,l,u,h,c,d=this.data,f=this._ux,p=this._uy,g=this._len,m=e<1,v=0,_=0,y=0;if(!m||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=e*this._pathLen))t:for(var x=0;x0&&(t.lineTo(h,c),y=0),w){case Fs.M:n=r=d[x++],i=o=d[x++],t.moveTo(r,o);break;case Fs.L:a=d[x++],s=d[x++];var T=Ks(a-r),S=Ks(s-o);if(T>f||S>p){if(m){if(v+(q=l[_++])>u){var M=(u-v)/q;t.lineTo(r*(1-M)+a*M,o*(1-M)+s*M);break t}v+=q}t.lineTo(a,s),r=a,o=s,y=0}else{var C=T*T+S*S;C>y&&(h=a,c=s,y=C)}break;case Fs.C:var L=d[x++],A=d[x++],D=d[x++],I=d[x++],P=d[x++],E=d[x++];if(m){if(v+(q=l[_++])>u){si(r,L,D,P,M=(u-v)/q,Vs),si(o,A,I,E,M,Gs),t.bezierCurveTo(Vs[1],Gs[1],Vs[2],Gs[2],Vs[3],Gs[3]);break t}v+=q}t.bezierCurveTo(L,A,D,I,P,E),r=P,o=E;break;case Fs.Q:L=d[x++],A=d[x++],D=d[x++],I=d[x++];if(m){if(v+(q=l[_++])>u){fi(r,L,D,M=(u-v)/q,Vs),fi(o,A,I,M,Gs),t.quadraticCurveTo(Vs[1],Gs[1],Vs[2],Gs[2]);break t}v+=q}t.quadraticCurveTo(L,A,D,I),r=D,o=I;break;case Fs.A:var O=d[x++],N=d[x++],R=d[x++],k=d[x++],z=d[x++],B=d[x++],F=d[x++],V=!d[x++],G=R>k?R:k,H=Ks(R-k)>.001,U=z+B,W=!1;if(m)v+(q=l[_++])>u&&(U=z+B*(u-v)/q,W=!0),v+=q;if(H&&t.ellipse?t.ellipse(O,N,R,k,F,z,U,V):t.arc(O,N,G,z,U,V),W)break t;b&&(n=qs(z)*R+O,i=Ys(z)*k+N),r=qs(U)*R+O,o=Ys(U)*k+N;break;case Fs.R:n=r=d[x],i=o=d[x+1],a=d[x++],s=d[x++];var j=d[x++],Z=d[x++];if(m){if(v+(q=l[_++])>u){var X=u-v;t.moveTo(a,s),t.lineTo(a+Zs(X,j),s),(X-=j)>0&&t.lineTo(a+j,s+Zs(X,Z)),(X-=Z)>0&&t.lineTo(a+Xs(j-X,0),s+Z),(X-=j)>0&&t.lineTo(a,s+Xs(Z-X,0));break t}v+=q}t.rect(a,s,j,Z);break;case Fs.Z:if(m){var q;if(v+(q=l[_++])>u){M=(u-v)/q;t.lineTo(r*(1-M)+n*M,o*(1-M)+i*M);break t}v+=q}t.closePath(),r=n,o=i}}},t.prototype.clone=function(){var e=new t,n=this.data;return e.data=n.slice?n.slice():Array.prototype.slice.call(n),e._len=this._len,e},t.CMD=Fs,t.initDefaultProps=function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),t}();const il=nl;function rl(t,e,n,i,r,o,a){if(0===r)return!1;var s=r,l=0;if(a>e+s&&a>i+s||at+s&&o>n+s||oe+c&&h>i+c&&h>o+c&&h>s+c||ht+c&&u>n+c&&u>r+c&&u>a+c||ue+u&&l>i+u&&l>o+u||lt+u&&s>n+u&&s>r+u||sn||h+ur&&(r+=ul);var d=Math.atan2(l,s);return d<0&&(d+=ul),d>=i&&d<=r||d+ul>=i&&d+ul<=r}function cl(t,e,n,i,r,o){if(o>e&&o>i||or?s:0}var dl=il.CMD,fl=2*Math.PI;var pl=[-1,-1,-1],gl=[-1,-1];function ml(t,e,n,i,r,o,a,s,l,u){if(u>e&&u>i&&u>o&&u>s||u1&&(h=void 0,h=gl[0],gl[0]=gl[1],gl[1]=h),p=ii(e,i,o,s,gl[0]),f>1&&(g=ii(e,i,o,s,gl[1]))),2===f?ve&&s>i&&s>o||s=0&&h<=1&&(r[l++]=h);else{var u=a*a-4*o*s;if(ei(u))(h=-a/(2*o))>=0&&h<=1&&(r[l++]=h);else if(u>0){var h,c=Xn(u),d=(-a-c)/(2*o);(h=(-a+c)/(2*o))>=0&&h<=1&&(r[l++]=h),d>=0&&d<=1&&(r[l++]=d)}}return l}(e,i,o,s,pl);if(0===l)return 0;var u=di(e,i,o);if(u>=0&&u<=1){for(var h=0,c=hi(e,i,o,u),d=0;dn||s<-n)return 0;var l=Math.sqrt(n*n-s*s);pl[0]=-l,pl[1]=l;var u=Math.abs(i-r);if(u<1e-4)return 0;if(u>=fl-1e-4){i=0,r=fl;var h=o?1:-1;return a>=pl[0]+t&&a<=pl[1]+t?h:0}if(i>r){var c=i;i=r,r=c}i<0&&(i+=fl,r+=fl);for(var d=0,f=0;f<2;f++){var p=pl[f];if(p+t>a){var g=Math.atan2(s,p);h=o?1:-1;g<0&&(g=fl+g),(g>=i&&g<=r||g+fl>=i&&g+fl<=r)&&(g>Math.PI/2&&g<1.5*Math.PI&&(h=-h),d+=h)}}return d}function yl(t,e,n,i,r){for(var o,a,s,l,u=t.data,h=t.len(),c=0,d=0,f=0,p=0,g=0,m=0;m1&&(n||(c+=cl(d,f,p,g,i,r))),_&&(p=d=u[m],g=f=u[m+1]),v){case dl.M:d=p=u[m++],f=g=u[m++];break;case dl.L:if(n){if(rl(d,f,u[m],u[m+1],e,i,r))return!0}else c+=cl(d,f,u[m],u[m+1],i,r)||0;d=u[m++],f=u[m++];break;case dl.C:if(n){if(ol(d,f,u[m++],u[m++],u[m++],u[m++],u[m],u[m+1],e,i,r))return!0}else c+=ml(d,f,u[m++],u[m++],u[m++],u[m++],u[m],u[m+1],i,r)||0;d=u[m++],f=u[m++];break;case dl.Q:if(n){if(al(d,f,u[m++],u[m++],u[m],u[m+1],e,i,r))return!0}else c+=vl(d,f,u[m++],u[m++],u[m],u[m+1],i,r)||0;d=u[m++],f=u[m++];break;case dl.A:var y=u[m++],x=u[m++],w=u[m++],b=u[m++],T=u[m++],S=u[m++];m+=1;var M=!!(1-u[m++]);o=Math.cos(T)*w+y,a=Math.sin(T)*b+x,_?(p=o,g=a):c+=cl(d,f,o,a,i,r);var C=(i-y)*b/w+y;if(n){if(hl(y,x,b,T,T+S,M,e,C,r))return!0}else c+=_l(y,x,b,T,T+S,M,C,r);d=Math.cos(T+S)*w+y,f=Math.sin(T+S)*b+x;break;case dl.R:if(p=d=u[m++],g=f=u[m++],o=p+u[m++],a=g+u[m++],n){if(rl(p,g,o,g,e,i,r)||rl(o,g,o,a,e,i,r)||rl(o,a,p,a,e,i,r)||rl(p,a,p,g,e,i,r))return!0}else c+=cl(o,g,o,a,i,r),c+=cl(p,a,p,g,i,r);break;case dl.Z:if(n){if(rl(d,f,p,g,e,i,r))return!0}else c+=cl(d,f,p,g,i,r);d=p,f=g}}return n||(s=f,l=g,Math.abs(s-l)<1e-4)||(c+=cl(d,f,p,g,i,r)||0),0!==c}var xl=ot({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},vs),wl={style:ot({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},_s.style)},bl=so.concat(["invisible","culling","z","z2","zlevel","parent"]),Tl=function(t){function e(e){return t.call(this,e)||this}var n;return I(e,t),e.prototype.update=function(){var n=this;t.prototype.update.call(this);var i=this.style;if(i.decal){var r=this._decalEl=this._decalEl||new e;r.buildPath===e.prototype.buildPath&&(r.buildPath=function(t){n.buildPath(t,n.shape)}),r.silent=!0;var o=r.style;for(var a in i)o[a]!==i[a]&&(o[a]=i[a]);o.fill=i.fill?i.decal:null,o.decal=null,o.shadowColor=null,i.strokeFirst&&(o.stroke=null);for(var s=0;s.5?Jr:e>.2?"#eee":$r}if(t)return $r}return Jr},e.prototype.getInsideTextStroke=function(t){var e=this.style.fill;if(wt(e)){var n=this.__zr;if(!(!n||!n.isDarkMode())===Zi(t,0)<.4)return e}},e.prototype.buildPath=function(t,e,n){},e.prototype.pathUpdated=function(){this.__dirty&=~zn},e.prototype.getUpdatedPathProxy=function(t){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,t),this.path},e.prototype.createPathProxy=function(){this.path=new il(!1)},e.prototype.hasStroke=function(){var t=this.style,e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))},e.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},e.prototype.getBoundingRect=function(){var t=this._rect,e=this.style,n=!t;if(n){var i=!1;this.path||(i=!0,this.createPathProxy());var r=this.path;(i||this.__dirty&zn)&&(r.beginPath(),this.buildPath(r,this.shape,!1),this.pathUpdated()),t=r.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||n){o.copy(t);var a=e.strokeNoScale?this.getLineScale():1,s=e.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;s=Math.max(s,null==l?4:l)}a>1e-10&&(o.width+=s/a,o.height+=s/a,o.x-=s/a/2,o.y-=s/a/2)}return o}return t},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect(),r=this.style;if(t=n[0],e=n[1],i.contain(t,e)){var o=this.path;if(this.hasStroke()){var a=r.lineWidth,s=r.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),function(t,e,n,i){return yl(t,e,!0,n,i)}(o,a/s,t,e)))return!0}if(this.hasFill())return function(t,e,n){return yl(t,0,!1,e,n)}(o,t,e)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=zn,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():"shape"===t?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(e,n){"shape"===e?this.setShape(n):t.prototype.attrKV.call(this,e,n)},e.prototype.setShape=function(t,e){var n=this.shape;return n||(n=this.shape={}),"string"==typeof t?n[t]=e:rt(n,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&zn)},e.prototype.createStyle=function(t){return Xt(xl,t)},e.prototype._innerSaveToNormal=function(e){t.prototype._innerSaveToNormal.call(this,e);var n=this._normalState;e.shape&&!n.shape&&(n.shape=rt({},this.shape))},e.prototype._applyStateObj=function(e,n,i,r,o,a){t.prototype._applyStateObj.call(this,e,n,i,r,o,a);var s,l=!(n&&r);if(n&&n.shape?o?r?s=n.shape:(s=rt({},i.shape),rt(s,n.shape)):(s=rt({},r?this.shape:i.shape),rt(s,n.shape)):l&&(s=i.shape),s)if(o){this.shape=rt({},this.shape);for(var u={},h=mt(s),c=0;c0},e.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},e.prototype.createStyle=function(t){return Xt(Ml,t)},e.prototype.setBoundingRect=function(t){this._rect=t},e.prototype.getBoundingRect=function(){var t=this.style;if(!this._rect){var e=t.text;null!=e?e+="":e="";var n=po(e,t.font,t.textAlign,t.textBaseline);if(n.x+=t.x||0,n.y+=t.y||0,this.hasStroke()){var i=t.lineWidth;n.x-=i/2,n.y-=i/2,n.width+=i,n.height+=i}this._rect=n}return this._rect},e.initDefaultProps=void(e.prototype.dirtyRectTolerance=10),e}(Ss);Cl.prototype.type="tspan";const Ll=Cl;var Al=ot({x:0,y:0},vs),Dl={style:ot({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},_s.style)};var Il=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.prototype.createStyle=function(t){return Xt(Al,t)},e.prototype._getSize=function(t){var e=this.style,n=e[t];if(null!=n)return n;var i,r=(i=e.image)&&"string"!=typeof i&&i.width&&i.height?e.image:this.__image;if(!r)return 0;var o="width"===t?"height":"width",a=e[o];return null==a?r[t]:r[t]/r[o]*a},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return Dl},e.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new _n(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},e}(Ss);Il.prototype.type="image";const Pl=Il;var El=Math.round;function Ol(t,e,n){if(e){var i=e.x1,r=e.x2,o=e.y1,a=e.y2;t.x1=i,t.x2=r,t.y1=o,t.y2=a;var s=n&&n.lineWidth;return s?(El(2*i)===El(2*r)&&(t.x1=t.x2=Rl(i,s,!0)),El(2*o)===El(2*a)&&(t.y1=t.y2=Rl(o,s,!0)),t):t}}function Nl(t,e,n){if(e){var i=e.x,r=e.y,o=e.width,a=e.height;t.x=i,t.y=r,t.width=o,t.height=a;var s=n&&n.lineWidth;return s?(t.x=Rl(i,s,!0),t.y=Rl(r,s,!0),t.width=Math.max(Rl(i+o,s,!1)-t.x,0===o?0:1),t.height=Math.max(Rl(r+a,s,!1)-t.y,0===a?0:1),t):t}}function Rl(t,e,n){if(!e)return t;var i=El(2*t);return(i+El(e))%2==0?i/2:(i+(n?1:-1))/2}var kl=function(){this.x=0,this.y=0,this.width=0,this.height=0},zl={},Bl=function(t){function e(e){return t.call(this,e)||this}return I(e,t),e.prototype.getDefaultShape=function(){return new kl},e.prototype.buildPath=function(t,e){var n,i,r,o;if(this.subPixelOptimize){var a=Nl(zl,e,this.style);n=a.x,i=a.y,r=a.width,o=a.height,a.r=e.r,e=a}else n=e.x,i=e.y,r=e.width,o=e.height;e.r?function(t,e){var n,i,r,o,a,s=e.x,l=e.y,u=e.width,h=e.height,c=e.r;u<0&&(s+=u,u=-u),h<0&&(l+=h,h=-h),"number"==typeof c?n=i=r=o=c:c instanceof Array?1===c.length?n=i=r=o=c[0]:2===c.length?(n=r=c[0],i=o=c[1]):3===c.length?(n=c[0],i=o=c[1],r=c[2]):(n=c[0],i=c[1],r=c[2],o=c[3]):n=i=r=o=0,n+i>u&&(n*=u/(a=n+i),i*=u/a),r+o>u&&(r*=u/(a=r+o),o*=u/a),i+r>h&&(i*=h/(a=i+r),r*=h/a),n+o>h&&(n*=h/(a=n+o),o*=h/a),t.moveTo(s+n,l),t.lineTo(s+u-i,l),0!==i&&t.arc(s+u-i,l+i,i,-Math.PI/2,0),t.lineTo(s+u,l+h-r),0!==r&&t.arc(s+u-r,l+h-r,r,0,Math.PI/2),t.lineTo(s+o,l+h),0!==o&&t.arc(s+o,l+h-o,o,Math.PI/2,Math.PI),t.lineTo(s,l+n),0!==n&&t.arc(s+n,l+n,n,Math.PI,1.5*Math.PI)}(t,e):t.rect(n,i,r,o)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(Sl);Bl.prototype.type="rect";const Fl=Bl;var Vl={fill:"#000"},Gl={style:ot({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},_s.style)},Hl=function(t){function e(e){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=Vl,n.attr(e),n}return I(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var e=0;ep&&h){var g=Math.floor(p/l);c=c||n.length>g,n=n.slice(0,g)}if(t&&a&&null!=d)for(var m=as(d,o,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),v={},_=0;_0,M=null!=t.width&&("truncate"===t.overflow||"break"===t.overflow||"breakAll"===t.overflow),C=i.calculatedLineHeight,L=0;Ll&&ds(n,t.substring(l,u),e,s),ds(n,i[2],e,s,i[1]),l=is.lastIndex}lo){var A=n.lines.length;b>0?(y.tokens=y.tokens.slice(0,b),v(y,w,x),n.lines=n.lines.slice(0,_+1)):n.lines=n.lines.slice(0,_),n.isTruncated=n.isTruncated||n.lines.length=0&&"right"===(L=y[C]).align;)this._placeToken(L,t,w,p,M,"right",m),b-=L.width,M-=L.width,C--;for(S+=(n-(S-f)-(g-M)-b)/2;T<=C;)L=y[T],this._placeToken(L,t,w,p,S+L.width/2,"center",m),S+=L.width,T++;p+=w}},e.prototype._placeToken=function(t,e,n,i,r,o,a){var s=e.rich[t.styleName]||{};s.text=t.text;var l=t.verticalAlign,u=i+n/2;"top"===l?u=i+t.height/2:"bottom"===l&&(u=i+n-t.height/2),!t.isLineHolder&&tu(s)&&this._renderBackground(s,e,"right"===o?r-t.width:"center"===o?r-t.width/2:r,u-t.height/2,t.width,t.height);var h=!!s.backgroundColor,c=t.textPadding;c&&(r=$l(r,o,c),u-=t.height/2-c[0]-t.innerHeight/2);var d=this._getOrCreateChild(Ll),f=d.createStyle();d.useStyle(f);var p=this._defaultStyle,g=!1,m=0,v=Jl("fill"in s?s.fill:"fill"in e?e.fill:(g=!0,p.fill)),_=Kl("stroke"in s?s.stroke:"stroke"in e?e.stroke:h||a||p.autoStroke&&!g?null:(m=2,p.stroke)),y=s.textShadowBlur>0||e.textShadowBlur>0;f.text=t.text,f.x=r,f.y=u,y&&(f.shadowBlur=s.textShadowBlur||e.textShadowBlur||0,f.shadowColor=s.textShadowColor||e.textShadowColor||"transparent",f.shadowOffsetX=s.textShadowOffsetX||e.textShadowOffsetX||0,f.shadowOffsetY=s.textShadowOffsetY||e.textShadowOffsetY||0),f.textAlign=o,f.textBaseline="middle",f.font=t.font||R,f.opacity=Nt(s.opacity,e.opacity,1),Xl(f,s),_&&(f.lineWidth=Nt(s.lineWidth,e.lineWidth,m),f.lineDash=Ot(s.lineDash,e.lineDash),f.lineDashOffset=e.lineDashOffset||0,f.stroke=_),v&&(f.fill=v);var x=t.contentWidth,w=t.contentHeight;d.setBoundingRect(new _n(go(f.x,x,f.textAlign),mo(f.y,w,f.textBaseline),x,w))},e.prototype._renderBackground=function(t,e,n,i,r,o){var a,s,l,u=t.backgroundColor,h=t.borderWidth,c=t.borderColor,d=u&&u.image,f=u&&!d,p=t.borderRadius,g=this;if(f||t.lineHeight||h&&c){(a=this._getOrCreateChild(Fl)).useStyle(a.createStyle()),a.style.fill=null;var m=a.shape;m.x=n,m.y=i,m.width=r,m.height=o,m.r=p,a.dirtyShape()}if(f)(l=a.style).fill=u||null,l.fillOpacity=Ot(t.fillOpacity,1);else if(d){(s=this._getOrCreateChild(Pl)).onload=function(){g.dirtyStyle()};var v=s.style;v.image=u.image,v.x=n,v.y=i,v.width=r,v.height=o}h&&c&&((l=a.style).lineWidth=h,l.stroke=c,l.strokeOpacity=Ot(t.strokeOpacity,1),l.lineDash=t.borderDash,l.lineDashOffset=t.borderDashOffset||0,a.strokeContainThreshold=0,a.hasFill()&&a.hasStroke()&&(l.strokeFirst=!0,l.lineWidth*=2));var _=(a||s).style;_.shadowBlur=t.shadowBlur||0,_.shadowColor=t.shadowColor||"transparent",_.shadowOffsetX=t.shadowOffsetX||0,_.shadowOffsetY=t.shadowOffsetY||0,_.opacity=Nt(t.opacity,e.opacity,1)},e.makeFont=function(t){var e="";return ql(t)&&(e=[t.fontStyle,t.fontWeight,Zl(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),e&&Bt(e)||t.textFont||t.font},e}(Ss),Ul={left:!0,right:1,center:1},Wl={top:1,bottom:1,middle:1},jl=["fontStyle","fontWeight","fontSize","fontFamily"];function Zl(t){return"string"!=typeof t||-1===t.indexOf("px")&&-1===t.indexOf("rem")&&-1===t.indexOf("em")?isNaN(+t)?"12px":t+"px":t}function Xl(t,e){for(var n=0;n=0,o=!1;if(t instanceof Sl){var a=ou(t),s=r&&a.selectFill||a.normalFill,l=r&&a.selectStroke||a.normalStroke;if(mu(s)||mu(l)){var u=(i=i||{}).style||{};"inherit"===u.fill?(o=!0,i=rt({},i),(u=rt({},u)).fill=s):!mu(u.fill)&&mu(s)?(o=!0,i=rt({},i),(u=rt({},u)).fill=Yi(s)):!mu(u.stroke)&&mu(l)&&(o||(i=rt({},i),u=rt({},u)),u.stroke=Yi(l)),i.style=u}}if(i&&null==i.z2){o||(i=rt({},i));var h=t.z2EmphasisLift;i.z2=t.z2+(null!=h?h:uu)}return i}(this,0,e,n);if("blur"===t)return function(t,e,n){var i=st(t.currentStates,e)>=0,r=t.style.opacity,o=i?null:function(t,e,n,i){for(var r=t.style,o={},a=0;a0){var o={dataIndex:r,seriesIndex:t.seriesIndex};null!=i&&(o.dataType=i),e.push(o)}}))})),e}function Hu(t,e,n){Wu(t,!0),Mu(t,Lu),function(t,e,n){var i=nu(t);null!=e?(i.focus=e,i.blurScope=n):i.focus&&(i.focus=null)}(t,e,n)}function Uu(t,e,n,i){i?function(t){Wu(t,!1)}(t):Hu(t,e,n)}function Wu(t,e){var n=!1===e,i=t;t.highDownSilentOnTouch&&(i.__highDownSilentOnTouch=t.highDownSilentOnTouch),n&&!i.__highDownDispatcher||(i.__highByOuter=i.__highByOuter||0,i.__highDownDispatcher=!n)}function ju(t){return!(!t||!t.__highDownDispatcher)}function Zu(t){var e=t.type;return e===fu||e===pu||e===gu}function Xu(t){var e=t.type;return e===cu||e===du}var qu=Ea();function Yu(t,e,n,i,r){var o;if(e&&e.ecModel){var a=e.ecModel.getUpdatePayload();o=a&&a.animation}var s="update"===t;if(e&&e.isAnimationEnabled()){var l=void 0,u=void 0,h=void 0;return i?(l=Ot(i.duration,200),u=Ot(i.easing,"cubicOut"),h=0):(l=e.getShallow(s?"animationDurationUpdate":"animationDuration"),u=e.getShallow(s?"animationEasingUpdate":"animationEasing"),h=e.getShallow(s?"animationDelayUpdate":"animationDelay")),o&&(null!=o.duration&&(l=o.duration),null!=o.easing&&(u=o.easing),null!=o.delay&&(h=o.delay)),xt(h)&&(h=h(n,r)),xt(l)&&(l=l(n)),{duration:l||0,delay:h,easing:u}}return null}function Ku(t,e,n,i,r,o,a){var s,l=!1;xt(r)?(a=o,o=r,r=null):St(r)&&(o=r.cb,a=r.during,l=r.isFrom,s=r.removeOpt,r=r.dataIndex);var u="leave"===t;u||e.stopAnimation("leave");var h=Yu(t,i,r,u?s||{}:null,i&&i.getAnimationDelayParams?i.getAnimationDelayParams(e,r):null);if(h&&h.duration>0){var c={duration:h.duration,delay:h.delay||0,easing:h.easing,done:o,force:!!o||!!a,setToFinal:!u,scope:t,during:a};l?e.animateFrom(n,c):e.animateTo(n,c)}else e.stopAnimation(),!l&&e.attr(n),a&&a(1),o&&o()}function Ju(t,e,n,i,r,o){Ku("update",t,e,n,i,r,o)}function $u(t,e,n,i,r,o){Ku("enter",t,e,n,i,r,o)}function Qu(t){if(!t.__zr)return!0;for(var e=0;e-1?Oh:Rh;function Fh(t,e){t=t.toUpperCase(),zh[t]=new Ih(e),kh[t]=e}Fh(Nh,{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:". "}}}}),Fh(Oh,{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 Vh=1e3,Gh=6e4,Hh=36e5,Uh=864e5,Wh=31536e6,jh={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},Zh="{yyyy}-{MM}-{dd}",Xh={year:"{yyyy}",month:"{yyyy}-{MM}",day:Zh,hour:Zh+" "+jh.hour,minute:Zh+" "+jh.minute,second:Zh+" "+jh.second,millisecond:jh.none},qh=["year","month","day","hour","minute","second","millisecond"],Yh=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function Kh(t,e){return"0000".substr(0,e-(t+="").length)+t}function Jh(t){switch(t){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return t}}function $h(t){return t===Jh(t)}function Qh(t,e,n,i){var r=aa(t),o=r[nc(n)](),a=r[ic(n)]()+1,s=Math.floor((a-1)/3)+1,l=r[rc(n)](),u=r["get"+(n?"UTC":"")+"Day"](),h=r[oc(n)](),c=(h-1)%12+1,d=r[ac(n)](),f=r[sc(n)](),p=r[lc(n)](),g=h>=12?"pm":"am",m=g.toUpperCase(),v=i instanceof Ih?i:function(t){return zh[t]}(i||Bh)||zh[Rh],_=v.getModel("time"),y=_.get("month"),x=_.get("monthAbbr"),w=_.get("dayOfWeek"),b=_.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,g+"").replace(/{A}/g,m+"").replace(/{yyyy}/g,o+"").replace(/{yy}/g,Kh(o%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,y[a-1]).replace(/{MMM}/g,x[a-1]).replace(/{MM}/g,Kh(a,2)).replace(/{M}/g,a+"").replace(/{dd}/g,Kh(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,w[u]).replace(/{ee}/g,b[u]).replace(/{e}/g,u+"").replace(/{HH}/g,Kh(h,2)).replace(/{H}/g,h+"").replace(/{hh}/g,Kh(c+"",2)).replace(/{h}/g,c+"").replace(/{mm}/g,Kh(d,2)).replace(/{m}/g,d+"").replace(/{ss}/g,Kh(f,2)).replace(/{s}/g,f+"").replace(/{SSS}/g,Kh(p,3)).replace(/{S}/g,p+"")}function tc(t,e){var n=aa(t),i=n[ic(e)]()+1,r=n[rc(e)](),o=n[oc(e)](),a=n[ac(e)](),s=n[sc(e)](),l=0===n[lc(e)](),u=l&&0===s,h=u&&0===a,c=h&&0===o,d=c&&1===r;return d&&1===i?"year":d?"month":c?"day":h?"hour":u?"minute":l?"second":"millisecond"}function ec(t,e,n){var i=Tt(t)?aa(t):t;switch(e=e||tc(t,n)){case"year":return i[nc(n)]();case"half-year":return i[ic(n)]()>=6?1:0;case"quarter":return Math.floor((i[ic(n)]()+1)/4);case"month":return i[ic(n)]();case"day":return i[rc(n)]();case"half-day":return i[oc(n)]()/24;case"hour":return i[oc(n)]();case"minute":return i[ac(n)]();case"second":return i[sc(n)]();case"millisecond":return i[lc(n)]()}}function nc(t){return t?"getUTCFullYear":"getFullYear"}function ic(t){return t?"getUTCMonth":"getMonth"}function rc(t){return t?"getUTCDate":"getDate"}function oc(t){return t?"getUTCHours":"getHours"}function ac(t){return t?"getUTCMinutes":"getMinutes"}function sc(t){return t?"getUTCSeconds":"getSeconds"}function lc(t){return t?"getUTCMilliseconds":"getMilliseconds"}function uc(t){return t?"setUTCFullYear":"setFullYear"}function hc(t){return t?"setUTCMonth":"setMonth"}function cc(t){return t?"setUTCDate":"setDate"}function dc(t){return t?"setUTCHours":"setHours"}function fc(t){return t?"setUTCMinutes":"setMinutes"}function pc(t){return t?"setUTCSeconds":"setSeconds"}function gc(t){return t?"setUTCMilliseconds":"setMilliseconds"}function mc(t){if(!fa(t))return wt(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function vc(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()})),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}var _c=kt;function yc(t,e,n){function i(t){return t&&Bt(t)?t:"-"}function r(t){return!(null==t||isNaN(t)||!isFinite(t))}var o="time"===e,a=t instanceof Date;if(o||a){var s=o?aa(t):t;if(!isNaN(+s))return Qh(s,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",n);if(a)return"-"}if("ordinal"===e)return bt(t)?i(t):Tt(t)&&r(t)?t+"":"-";var l=da(t);return r(l)?mc(l):bt(t)?i(t):"boolean"==typeof t?t+"":"-"}var xc=["a","b","c","d","e","f","g"],wc=function(t,e){return"{"+t+(null==e?"":e)+"}"};function bc(t,e,n){yt(e)||(e=[e]);var i=e.length;if(!i)return"";for(var r=e[0].$vars||[],o=0;o
':'':{renderMode:o,content:"{"+(n.markerId||"markerX")+"|} ",style:"subItem"===r?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}:""}function Sc(t,e,n){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var i=aa(e),r=n?"getUTC":"get",o=i[r+"FullYear"](),a=i[r+"Month"]()+1,s=i[r+"Date"](),l=i[r+"Hours"](),u=i[r+"Minutes"](),h=i[r+"Seconds"](),c=i[r+"Milliseconds"]();return t=t.replace("MM",Kh(a,2)).replace("M",a).replace("yyyy",o).replace("yy",Kh(o%100+"",2)).replace("dd",Kh(s,2)).replace("d",s).replace("hh",Kh(l,2)).replace("h",l).replace("mm",Kh(u,2)).replace("m",u).replace("ss",Kh(h,2)).replace("s",h).replace("SSS",Kh(c,3))}function Mc(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t}function Cc(t,e){return e=e||"transparent",wt(t)?t:St(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}function Lc(t,e){if("_blank"===e||"blank"===e){var n=window.open();n.opener=null,n.location.href=t}else window.open(t,e)}var Ac=ct,Dc=["left","right","top","bottom","width","height"],Ic=[["width","left","right"],["height","top","bottom"]];function Pc(t,e,n,i,r){var o=0,a=0;null==i&&(i=1/0),null==r&&(r=1/0);var s=0;e.eachChild((function(l,u){var h,c,d=l.getBoundingRect(),f=e.childAt(u+1),p=f&&f.getBoundingRect();if("horizontal"===t){var g=d.width+(p?-p.x+d.x:0);(h=o+g)>i||l.newline?(o=0,h=g,a+=s+n,s=d.height):s=Math.max(s,d.height)}else{var m=d.height+(p?-p.y+d.y:0);(c=a+m)>r||l.newline?(o+=s+n,a=0,c=m,s=d.width):s=Math.max(s,d.width)}l.newline||(l.x=o,l.y=a,l.markRedraw(),"horizontal"===t?o=h+n:a=c+n)}))}var Ec=Pc;_t(Pc,"vertical"),_t(Pc,"horizontal");function Oc(t,e,n){n=_c(n||0);var i=e.width,r=e.height,o=qo(t.left,i),a=qo(t.top,r),s=qo(t.right,i),l=qo(t.bottom,r),u=qo(t.width,i),h=qo(t.height,r),c=n[2]+n[0],d=n[1]+n[3],f=t.aspect;switch(isNaN(u)&&(u=i-s-d-o),isNaN(h)&&(h=r-l-c-a),null!=f&&(isNaN(u)&&isNaN(h)&&(f>i/r?u=.8*i:h=.8*r),isNaN(u)&&(u=f*h),isNaN(h)&&(h=u/f)),isNaN(o)&&(o=i-s-u-d),isNaN(a)&&(a=r-l-h-c),t.left||t.right){case"center":o=i/2-u/2-n[3];break;case"right":o=i-u-d}switch(t.top||t.bottom){case"middle":case"center":a=r/2-h/2-n[0];break;case"bottom":a=r-h-c}o=o||0,a=a||0,isNaN(u)&&(u=i-d-o-(s||0)),isNaN(h)&&(h=r-c-a-(l||0));var p=new _n(o+n[3],a+n[0],u,h);return p.margin=n,p}function Nc(t,e,n,i,r,o){var a,s=!r||!r.hv||r.hv[0],l=!r||!r.hv||r.hv[1],u=r&&r.boundingMode||"all";if((o=o||t).x=t.x,o.y=t.y,!s&&!l)return!1;if("raw"===u)a="group"===t.type?new _n(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(a=t.getBoundingRect(),t.needLocalTransform()){var h=t.getLocalTransform();(a=a.clone()).applyTransform(h)}var c=Oc(ot({width:a.width,height:a.height},e),n,i),d=s?c.x-a.x:0,f=l?c.y-a.y:0;return"raw"===u?(o.x=d,o.y=f):(o.x+=d,o.y+=f),o===t&&t.markRedraw(),!0}function Rc(t){var e=t.layoutMode||t.constructor.layoutMode;return St(e)?e:e?{type:e}:null}function kc(t,e,n){var i=n&&n.ignoreSize;!yt(i)&&(i=[i,i]);var r=a(Ic[0],0),o=a(Ic[1],1);function a(n,r){var o={},a=0,u={},h=0;if(Ac(n,(function(e){u[e]=t[e]})),Ac(n,(function(t){s(e,t)&&(o[t]=u[t]=e[t]),l(o,t)&&a++,l(u,t)&&h++})),i[r])return l(e,n[1])?u[n[2]]=null:l(e,n[2])&&(u[n[1]]=null),u;if(2!==h&&a){if(a>=2)return o;for(var c=0;c=0;a--)o=nt(o,n[a],!0);e.defaultOption=o}return e.defaultOption},e.prototype.getReferringComponents=function(t,e){var n=t+"Index",i=t+"Id";return Ba(this.ecModel,t,{index:this.get(n,!0),id:this.get(i,!0)},e)},e.prototype.getBoxLayoutParams=function(){var t=this;return{left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")}},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(t){this.option.zlevel=t},e.protoInitialize=function(){var t=e.prototype;t.type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0}(),e}(Ih);Wa(Vc,Ih),qa(Vc),function(t){var e={};t.registerSubTypeDefaulter=function(t,n){var i=Ha(t);e[i.main]=n},t.determineSubType=function(n,i){var r=i.type;if(!r){var o=Ha(n).main;t.hasSubTypes(n)&&e[o]&&(r=e[o](i))}return r}}(Vc),function(t,e){function n(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}t.topologicalTravel=function(t,i,r,o){if(t.length){var a=function(t){var i={},r=[];return ct(t,(function(o){var a=n(i,o),s=function(t,e){var n=[];return ct(t,(function(t){st(e,t)>=0&&n.push(t)})),n}(a.originalDeps=e(o),t);a.entryCount=s.length,0===a.entryCount&&r.push(o),ct(s,(function(t){st(a.predecessor,t)<0&&a.predecessor.push(t);var e=n(i,t);st(e.successor,t)<0&&e.successor.push(o)}))})),{graph:i,noEntryList:r}}(i),s=a.graph,l=a.noEntryList,u={};for(ct(t,(function(t){u[t]=!0}));l.length;){var h=l.pop(),c=s[h],d=!!u[h];d&&(r.call(o,h,c.originalDeps.slice()),delete u[h]),ct(c.successor,d?p:f)}ct(u,(function(){throw new Error("")}))}function f(t){s[t].entryCount--,0===s[t].entryCount&&l.push(t)}function p(t){u[t]=!0,f(t)}}}(Vc,(function(t){var e=[];ct(Vc.getClassesByMainType(t),(function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])})),e=dt(e,(function(t){return Ha(t).main})),"dataset"!==t&&st(e,"dataset")<=0&&e.unshift("dataset");return e}));const Gc=Vc;var Hc="";"undefined"!=typeof navigator&&(Hc=navigator.platform||"");var Uc="rgba(0, 0, 0, 0.2)";const Wc={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:Uc,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Uc,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Uc,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Uc,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Uc,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Uc,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Hc.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 jc=jt(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),Zc="original",Xc="arrayRows",qc="objectRows",Yc="keyedColumns",Kc="typedArray",Jc="unknown",$c="column",Qc="row",td={Must:1,Might:2,Not:3},ed=Ea();function nd(t,e,n){var i={},r=id(e);if(!r||!t)return i;var o,a,s=[],l=[],u=e.ecModel,h=ed(u).datasetMap,c=r.uid+"_"+n.seriesLayoutBy;ct(t=t.slice(),(function(e,n){var r=St(e)?e:t[n]={name:e};"ordinal"===r.type&&null==o&&(o=n,a=p(r)),i[r.name]=[]}));var d=h.get(c)||h.set(c,{categoryWayDim:a,valueWayDim:0});function f(t,e,n){for(var i=0;ie)return t[i];return t[n-1]}(i,a):n;if((h=h||n)&&h.length){var c=h[l];return r&&(u[r]=c),s.paletteIdx=(l+1)%h.length,c}}var fd="\0_ec_inner";var pd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.prototype.init=function(t,e,n,i,r,o){i=i||{},this.option=null,this._theme=new Ih(i),this._locale=new Ih(r),this._optionManager=o},e.prototype.setOption=function(t,e,n){var i=vd(e);this._optionManager.setOption(t,n,i),this._resetOption(null,i)},e.prototype.resetOption=function(t,e){return this._resetOption(t,vd(e))},e.prototype._resetOption=function(t,e){var n=!1,i=this._optionManager;if(!t||"recreate"===t){var r=i.mountOption("recreate"===t);0,this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(r,e)):ud(this,r),n=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var o=i.getTimelineOption(this);o&&(n=!0,this._mergeOption(o,e))}if(!t||"recreate"===t||"media"===t){var a=i.getMediaOption(this);a.length&&ct(a,(function(t){n=!0,this._mergeOption(t,e)}),this)}return n},e.prototype.mergeOption=function(t){this._mergeOption(t,null)},e.prototype._mergeOption=function(t,e){var n=this.option,i=this._componentsMap,r=this._componentsCount,o=[],a=jt(),s=e&&e.replaceMergeMainTypeMap;ed(this).datasetMap=jt(),ct(t,(function(t,e){null!=t&&(Gc.hasClass(e)?e&&(o.push(e),a.set(e,!0)):n[e]=null==n[e]?et(t):nt(n[e],t,!0))})),s&&s.each((function(t,e){Gc.hasClass(e)&&!a.get(e)&&(o.push(e),a.set(e,!0))})),Gc.topologicalTravel(o,Gc.getAllClassMainTypes(),(function(e){var o=function(t,e,n){var i=ad.get(e);if(!i)return n;var r=i(t);return r?n.concat(r):n}(this,e,xa(t[e])),a=i.get(e),l=a?s&&s.get(e)?"replaceMerge":"normalMerge":"replaceAll",u=Ma(a,o,l);(function(t,e,n){ct(t,(function(t){var i=t.newOption;St(i)&&(t.keyInfo.mainType=e,t.keyInfo.subType=function(t,e,n,i){return e.type?e.type:n?n.subType:i.determineSubType(t,e)}(e,i,t.existing,n))}))})(u,e,Gc),n[e]=null,i.set(e,null),r.set(e,0);var h,c=[],d=[],f=0;ct(u,(function(t,n){var i=t.existing,r=t.newOption;if(r){var o="series"===e,a=Gc.getClass(e,t.keyInfo.subType,!o);if(!a)return;if("tooltip"===e){if(h)return void 0;h=!0}if(i&&i.constructor===a)i.name=t.keyInfo.name,i.mergeOption(r,this),i.optionUpdated(r,!1);else{var s=rt({componentIndex:n},t.keyInfo);rt(i=new a(r,this,this,s),s),t.brandNew&&(i.__requireNewView=!0),i.init(r,this,this),i.optionUpdated(null,!0)}}else i&&(i.mergeOption({},this),i.optionUpdated({},!1));i?(c.push(i.option),d.push(i),f++):(c.push(void 0),d.push(void 0))}),this),n[e]=c,i.set(e,d),r.set(e,f),"series"===e&&sd(this)}),this),this._seriesIndices||sd(this)},e.prototype.getOption=function(){var t=et(this.option);return ct(t,(function(e,n){if(Gc.hasClass(n)){for(var i=xa(e),r=i.length,o=!1,a=r-1;a>=0;a--)i[a]&&!Ia(i[a])?o=!0:(i[a]=null,!o&&r--);i.length=r,t[n]=i}})),delete t[fd],t},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(t){this._payload=t},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){var i=n[e||0];if(i)return i;if(null==e)for(var r=0;r=e:"max"===n?t<=e:t===e})(i[a],t,o)||(r=!1)}})),r}const Ld=Md;var Ad=ct,Dd=St,Id=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Pd(t){var e=t&&t.itemStyle;if(e)for(var n=0,i=Id.length;n=0;g--){var m=t[g];if(s||(d=m.data.rawIndexOf(m.stackedByDimension,c)),d>=0){var v=m.data.getByRawIndex(m.stackResultDimension,d);if("all"===l||"positive"===l&&v>0||"negative"===l&&v<0||"samesign"===l&&f>=0&&v>0||"samesign"===l&&f<=0&&v<0){f=ea(f,v),p=v;break}}}return i[0]=f,i[1]=p,i}))}))}var Yd,Kd,Jd,$d,Qd,tf=function(t){this.data=t.data||(t.sourceFormat===Yc?{}:[]),this.sourceFormat=t.sourceFormat||Jc,this.seriesLayoutBy=t.seriesLayoutBy||$c,this.startIndex=t.startIndex||0,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.metaRawOption=t.metaRawOption;var e=this.dimensionsDefine=t.dimensionsDefine;if(e)for(var n=0;nu&&(u=f)}s[0]=l,s[1]=u}},i=function(){return this._data?this._data.length/this._dimSize:0};function r(t){for(var e=0;e=0&&(s=o.interpolatedValue[l])}return null!=s?s+"":""})):void 0},t.prototype.getRawValue=function(t,e){return xf(this.getData(e),t)},t.prototype.formatTooltip=function(t,e,n){},t}();function Tf(t){var e,n;return St(t)?t.type&&(n=t):e=t,{text:e,frag:n}}function Sf(t){return new Mf(t)}var Mf=function(){function t(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return t.prototype.perform=function(t){var e,n=this._upstream,i=t&&t.skip;if(this._dirty&&n){var r=this.context;r.data=r.outputData=n.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!i&&(e=this._plan(this.context));var o,a=h(this._modBy),s=this._modDataCount||0,l=h(t&&t.modBy),u=t&&t.modDataCount||0;function h(t){return!(t>=1)&&(t=1),t}a===l&&s===u||(e="reset"),(this._dirty||"reset"===e)&&(this._dirty=!1,o=this._doReset(i)),this._modBy=l,this._modDataCount=u;var c=t&&t.step;if(this._dueEnd=n?n._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,f=Math.min(null!=c?this._dueIndex+c:1/0,this._dueEnd);if(!i&&(o||d1&&i>0?s:a}};return o;function a(){return e=t?null:oe},gte:function(t,e){return t>=e}},Pf=(function(){function t(t,e){if(!Tt(e)){0,Af("")}this._opFn=If[t],this._rvalFloat=da(e)}t.prototype.evaluate=function(t){return Tt(t)?this._opFn(t,this._rvalFloat):this._opFn(da(t),this._rvalFloat)}}(),function(){function t(t,e){var n="desc"===t;this._resultLT=n?1:-1,null==e&&(e=n?"min":"max"),this._incomparable="min"===e?-1/0:1/0}return t.prototype.evaluate=function(t,e){var n=Tt(t)?t:da(t),i=Tt(e)?e:da(e),r=isNaN(n),o=isNaN(i);if(r&&(n=this._incomparable),o&&(i=this._incomparable),r&&o){var a=wt(t),s=wt(e);a&&(n=s?t:0),s&&(i=a?e:0)}return ni?-this._resultLT:0},t}());!function(){function t(t,e){this._rval=e,this._isEQ=t,this._rvalTypeof=typeof e,this._rvalFloat=da(e)}t.prototype.evaluate=function(t){var e=t===this._rval;if(!e){var n=typeof t;n===this._rvalTypeof||"number"!==n&&"number"!==this._rvalTypeof||(e=da(t)===this._rvalFloat)}return this._isEQ?e:!e}}();var Ef=function(){function t(){}return t.prototype.getRawData=function(){throw new Error("not supported")},t.prototype.getRawDataItem=function(t){throw new Error("not supported")},t.prototype.cloneRawData=function(){},t.prototype.getDimensionInfo=function(t){},t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},t.prototype.retrieveValue=function(t,e){},t.prototype.retrieveValueFromItem=function(t,e){},t.prototype.convertValue=function(t,e){return Df(t,e)},t}();function Of(t){if(!Ff(t.sourceFormat)){0,Af("")}return t.data}function Nf(t){var e=t.sourceFormat,n=t.data;if(!Ff(e)){0,Af("")}if(e===Xc){for(var i=[],r=0,o=n.length;r65535?Hf:Uf}function qf(t,e,n,i,r){var o=Zf[n||"float"];if(r){var a=t[e],s=a&&a.length;if(s!==i){for(var l=new o(i),u=0;ug[1]&&(g[1]=p)}return this._rawCount=this._count=s,{start:a,end:s}},t.prototype._initDataFromProvider=function(t,e,n){for(var i=this._provider,r=this._chunks,o=this._dimensions,a=o.length,s=this._rawExtent,l=dt(o,(function(t){return t.property})),u=0;um[1]&&(m[1]=g)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=e,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(t,e){if(!(e>=0&&e=0&&e=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&nt))return o;r=o-1}}return-1},t.prototype.indicesOfNearest=function(t,e,n){var i=this._chunks[t],r=[];if(!i)return r;null==n&&(n=1/0);for(var o=1/0,a=-1,s=0,l=0,u=this.count();l=0&&a<0)&&(o=c,a=h,s=0),h===a&&(r[s++]=l))}return r.length=s,r},t.prototype.getIndices=function(){var t,e=this._indices;if(e){var n=e.constructor,i=this._count;if(n===Array){t=new n(i);for(var r=0;r=u&&y<=h||isNaN(y))&&(a[s++]=f),f++}d=!0}else if(2===r){p=c[i[0]];var m=c[i[1]],v=t[i[1]][0],_=t[i[1]][1];for(g=0;g=u&&y<=h||isNaN(y))&&(x>=v&&x<=_||isNaN(x))&&(a[s++]=f),f++}d=!0}}if(!d)if(1===r)for(g=0;g=u&&y<=h||isNaN(y))&&(a[s++]=w)}else for(g=0;gt[S][1])&&(b=!1)}b&&(a[s++]=e.getRawIndex(g))}return sm[1]&&(m[1]=g)}}}},t.prototype.lttbDownSample=function(t,e){var n,i,r,o=this.clone([t],!0),a=o._chunks[t],s=this.count(),l=0,u=Math.floor(1/e),h=this.getRawIndex(0),c=new(Xf(this._rawCount))(Math.min(2*(Math.ceil(s/u)+2),s));c[l++]=h;for(var d=1;dn&&(n=i,r=M)}S>0&&Sa&&(p=a-u);for(var g=0;gf&&(f=m,d=u+g)}var v=this.getRawIndex(h),_=this.getRawIndex(d);hu-f&&(s=u-f,a.length=s);for(var p=0;ph[1]&&(h[1]=m),c[d++]=v}return r._count=d,r._indices=c,r._updateGetRawIdx(),r},t.prototype.each=function(t,e){if(this._count)for(var n=t.length,i=this._chunks,r=0,o=this.count();ra&&(a=l)}return i=[o,a],this._extent[t]=i,i},t.prototype.getRawDataItem=function(t){var e=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(e);for(var n=[],i=this._chunks,r=0;r=0?this._indices[t]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=function(){function t(t,e,n,i){return Df(t[i],this._dimensions[i])}Vf={arrayRows:t,objectRows:function(t,e,n,i){return Df(t[e],this._dimensions[i])},keyedColumns:t,original:function(t,e,n,i){var r=t&&(null==t.value?t:t.value);return Df(r instanceof Array?r[i]:r,this._dimensions[i])},typedArray:function(t,e,n,i){return t[i]}}}(),t}();const Kf=Yf;var Jf=function(){function t(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(t,e){this._sourceList=t,this._upstreamSignList=e,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var t,e,n=this._sourceHost,i=this._getUpstreamSourceManagers(),r=!!i.length;if(Qf(n)){var o=n,a=void 0,s=void 0,l=void 0;if(r){var u=i[0];u.prepareSource(),a=(l=u.getSource()).data,s=l.sourceFormat,e=[u._getVersionSign()]}else s=Ct(a=o.get("data",!0))?Kc:Zc,e=[];var h=this._getSourceMetaRawOption()||{},c=l&&l.metaRawOption||{},d=Ot(h.seriesLayoutBy,c.seriesLayoutBy)||null,f=Ot(h.sourceHeader,c.sourceHeader),p=Ot(h.dimensions,c.dimensions);t=d!==c.seriesLayoutBy||!!f!=!!c.sourceHeader||p?[nf(a,{seriesLayoutBy:d,sourceHeader:f,dimensions:p},s)]:[]}else{var g=n;if(r){var m=this._applyTransform(i);t=m.sourceList,e=m.upstreamSignList}else{t=[nf(g.get("source",!0),this._getSourceMetaRawOption(),null)],e=[]}}this._setLocalSource(t,e)},t.prototype._applyTransform=function(t){var e,n=this._sourceHost,i=n.get("transform",!0),r=n.get("fromTransformResult",!0);if(null!=r){1!==t.length&&tp("")}var o,a=[],s=[];return ct(t,(function(t){t.prepareSource();var e=t.getSource(r||0);null==r||e||tp(""),a.push(e),s.push(t._getVersionSign())})),i?e=function(t,e){var n=xa(t),i=n.length;i||Af("");for(var r=0,o=i;r1||n>0&&!t.noHeader;return ct(t.blocks,(function(t){var n=lp(t);n>=e&&(e=n+ +(i&&(!n||ap(t)&&!t.noHeader)))})),e}return 0}function up(t,e,n,i){var r,o=e.noHeader,a=(r=lp(e),{html:ip[r],richText:rp[r]}),s=[],l=e.blocks||[];zt(!l||yt(l)),l=l||[];var u=t.orderMode;if(e.sortBlocks&&u){l=l.slice();var h={valueAsc:"asc",valueDesc:"desc"};if(Yt(h,u)){var c=new Pf(h[u],null);l.sort((function(t,e){return c.evaluate(t.sortParam,e.sortParam)}))}else"seriesDesc"===u&&l.reverse()}ct(l,(function(n,r){var o=e.valueFormatter,l=sp(n)(o?rt(rt({},t),{valueFormatter:o}):t,n,r>0?a.html:0,i);null!=l&&s.push(l)}));var d="richText"===t.renderMode?s.join(a.richText):dp(i,s.join(""),o?n:a.html);if(o)return d;var f=yc(e.header,"ordinal",t.useUTC),p=np(i,t.renderMode).nameStyle,g=ep(i);return"richText"===t.renderMode?fp(t,f,p)+a.richText+d:dp(i,'
'+ze(f)+"
"+d,n)}function hp(t,e,n,i){var r=t.renderMode,o=e.noName,a=e.noValue,s=!e.markerType,l=e.name,u=t.useUTC,h=e.valueFormatter||t.valueFormatter||function(t){return dt(t=yt(t)?t:[t],(function(t,e){return yc(t,yt(f)?f[e]:f,u)}))};if(!o||!a){var c=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",r),d=o?"":yc(l,"ordinal",u),f=e.valueType,p=a?[]:h(e.value,e.dataIndex),g=!s||!o,m=!s&&o,v=np(i,r),_=v.nameStyle,y=v.valueStyle;return"richText"===r?(s?"":c)+(o?"":fp(t,d,_))+(a?"":function(t,e,n,i,r){var o=[r],a=i?10:20;return n&&o.push({padding:[0,0,0,a],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(yt(e)?e.join(" "):e,o)}(t,p,g,m,y)):dp(i,(s?"":c)+(o?"":function(t,e,n){return''+ze(t)+""}(d,!s,_))+(a?"":function(t,e,n,i){var r=n?"10px":"20px",o=e?"float:right;margin-left:"+r:"";return t=yt(t)?t:[t],''+dt(t,(function(t){return ze(t)})).join("  ")+""}(p,g,m,y)),n)}}function cp(t,e,n,i,r,o){if(t)return sp(t)({useUTC:r,renderMode:n,orderMode:i,markupStyleCreator:e,valueFormatter:t.valueFormatter},t,0,o)}function dp(t,e,n){return'
'+e+'
'}function fp(t,e,n){return t.markupStyleCreator.wrapRichTextStyle(e,n)}function pp(t,e){var n=t.get("padding");return null!=n?n:"richText"===e?[8,10]:10}var gp=function(){function t(){this.richTextStyles={},this._nextStyleNameId=pa()}return t.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},t.prototype.makeTooltipMarker=function(t,e,n){var i="richText"===n?this._generateStyleName():null,r=Tc({color:e,type:t,renderMode:n,markerId:i});return wt(r)?r:(this.richTextStyles[i]=r.style,r.content)},t.prototype.wrapRichTextStyle=function(t,e){var n={};yt(e)?ct(e,(function(t){return rt(n,t)})):rt(n,e);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},t}();function mp(t){var e,n,i,r,o=t.series,a=t.dataIndex,s=t.multipleSeries,l=o.getData(),u=l.mapDimensionsAll("defaultedTooltip"),h=u.length,c=o.getRawValue(a),d=yt(c),f=function(t,e){return Cc(t.getData().getItemVisual(e,"style")[t.visualDrawType])}(o,a);if(h>1||d&&!h){var p=function(t,e,n,i,r){var o=e.getData(),a=ft(t,(function(t,e,n){var i=o.getDimensionInfo(n);return t||i&&!1!==i.tooltip&&null!=i.displayName}),!1),s=[],l=[],u=[];function h(t,e){var n=o.getDimensionInfo(e);n&&!1!==n.otherDims.tooltip&&(a?u.push(op("nameValue",{markerType:"subItem",markerColor:r,name:n.displayName,value:t,valueType:n.type})):(s.push(t),l.push(n.type)))}return i.length?ct(i,(function(t){h(xf(o,n,t),t)})):ct(t,h),{inlineValues:s,inlineValueTypes:l,blocks:u}}(c,o,a,u,f);e=p.inlineValues,n=p.inlineValueTypes,i=p.blocks,r=p.inlineValues[0]}else if(h){var g=l.getDimensionInfo(u[0]);r=e=xf(l,a,u[0]),n=g.type}else r=e=d?c[0]:c;var m=Da(o),v=m&&o.name||"",_=l.getName(a),y=s?v:_;return op("section",{header:v,noHeader:s||!m,sortParam:r,blocks:[op("nameValue",{markerType:"item",markerColor:f,name:y,noName:!Bt(y),value:e,valueType:n,dataIndex:a})].concat(i||[])})}var vp=Ea();function _p(t,e){return t.getName(e)||t.getId(e)}var yp=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._selectedDataIndicesMap={},e}return I(e,t),e.prototype.init=function(t,e,n){this.seriesIndex=this.componentIndex,this.dataTask=Sf({count:wp,reset:bp}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,n),(vp(this).sourceManager=new Jf(this)).prepareSource();var i=this.getInitialData(t,n);Sp(i,this),this.dataTask.context.data=i,vp(this).dataBeforeProcessed=i,xp(this),this._initSelectedMapFromData(i)},e.prototype.mergeDefaultAndTheme=function(t,e){var n=Rc(this),i=n?zc(t):{},r=this.subType;Gc.hasClass(r)&&(r+="Series"),nt(t,e.getTheme().get(this.subType)),nt(t,this.getDefaultOption()),wa(t,"label",["show"]),this.fillDataTextStyle(t.data),n&&kc(t,i,n)},e.prototype.mergeOption=function(t,e){t=nt(this.option,t,!0),this.fillDataTextStyle(t.data);var n=Rc(this);n&&kc(this.option,t,n);var i=vp(this).sourceManager;i.dirty(),i.prepareSource();var r=this.getInitialData(t,e);Sp(r,this),this.dataTask.dirty(),this.dataTask.context.data=r,vp(this).dataBeforeProcessed=r,xp(this),this._initSelectedMapFromData(r)},e.prototype.fillDataTextStyle=function(t){if(t&&!Ct(t))for(var e=["show"],n=0;nthis.getShallow("animationThreshold")&&(e=!1),!!e},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel,r=cd.prototype.getColorFromPalette.call(this,t,e,n);return r||(r=i.getColorFromPalette(t,e,n)),r},e.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},e.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n){var i=this.option.selectedMode,r=this.getData(e);if("series"===i||"all"===n)return this.option.selectedMap={},void(this._selectedDataIndicesMap={});for(var o=0;o=0&&n.push(r)}return n},e.prototype.isSelected=function(t,e){var n=this.option.selectedMap;if(!n)return!1;var i=this.getData(e);return("all"===n||n[_p(i,t)])&&!i.getItemModel(t).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this.__universalTransitionEnabled)return!0;var t=this.option.universalTransition;return!!t&&(!0===t||t&&t.enabled)},e.prototype._innerSelect=function(t,e){var n,i,r=this.option,o=r.selectedMode,a=e.length;if(o&&a)if("series"===o)r.selectedMap="all";else if("multiple"===o){St(r.selectedMap)||(r.selectedMap={});for(var s=r.selectedMap,l=0;l0&&this._innerSelect(t,e)}},e.registerClass=function(t){return Gc.registerClass(t)},e.protoInitialize=function(){var t=e.prototype;t.type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"}(),e}(Gc);function xp(t){var e=t.name;Da(t)||(t.name=function(t){var e=t.getRawData(),n=e.mapDimensionsAll("seriesName"),i=[];return ct(n,(function(t){var n=e.getDimensionInfo(t);n.displayName&&i.push(n.displayName)})),i.join(" ")}(t)||e)}function wp(t){return t.model.getRawData().count()}function bp(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),Tp}function Tp(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Sp(t,e){ct(Zt(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),(function(n){t.wrapMethod(n,_t(Mp,e))}))}function Mp(t,e){var n=Cp(t);return n&&n.setOutputEnd((e||this).count()),e}function Cp(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){var i=n.currentTask;if(i){var r=i.agentStubMap;r&&(i=r.get(t.uid))}return i}}ut(yp,bf),ut(yp,cd),Wa(yp,Gc);const Lp=yp;var Ap=function(){function t(){this.group=new Eo,this.uid=Eh("viewComponent")}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,i){},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,i){},t.prototype.updateLayout=function(t,e,n,i){},t.prototype.updateVisual=function(t,e,n,i){},t.prototype.toggleBlurSeries=function(t,e,n){},t.prototype.eachRendered=function(t){var e=this.group;e&&e.traverse(t)},t}();Ua(Ap),qa(Ap);const Dp=Ap;function Ip(){var t=Ea();return function(e){var n=t(e),i=e.pipelineContext,r=!!n.large,o=!!n.progressiveRender,a=n.large=!(!i||!i.large),s=n.progressiveRender=!(!i||!i.progressiveRender);return!(r===a&&o===s)&&"reset"}}var Pp=il.CMD,Ep=[[],[],[]],Op=Math.sqrt,Np=Math.atan2;var Rp=Math.sqrt,kp=Math.sin,zp=Math.cos,Bp=Math.PI;function Fp(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Vp(t,e){return(t[0]*e[0]+t[1]*e[1])/(Fp(t)*Fp(e))}function Gp(t,e){return(t[0]*e[1]1&&(a*=Rp(p),s*=Rp(p));var g=(r===o?-1:1)*Rp((a*a*(s*s)-a*a*(f*f)-s*s*(d*d))/(a*a*(f*f)+s*s*(d*d)))||0,m=g*a*f/s,v=g*-s*d/a,_=(t+n)/2+zp(c)*m-kp(c)*v,y=(e+i)/2+kp(c)*m+zp(c)*v,x=Gp([1,0],[(d-m)/a,(f-v)/s]),w=[(d-m)/a,(f-v)/s],b=[(-1*d-m)/a,(-1*f-v)/s],T=Gp(w,b);if(Vp(w,b)<=-1&&(T=Bp),Vp(w,b)>=1&&(T=0),T<0){var S=Math.round(T/Bp*1e6)/1e6;T=2*Bp+S%2*Bp}h.addData(u,_,y,a,s,x,T,c,o)}var Up=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Wp=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;var jp=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.prototype.applyTransform=function(t){},e}(Sl);function Zp(t){return null!=t.setData}function Xp(t,e){var n=function(t){var e=new il;if(!t)return e;var n,i=0,r=0,o=i,a=r,s=il.CMD,l=t.match(Up);if(!l)return e;for(var u=0;uI*I+P*P&&(S=C,M=L),{cx:S,cy:M,x0:-h,y0:-c,x1:S*(r/w-1),y1:M*(r/w-1)}}function dg(t,e){var n,i=lg(e.r,0),r=lg(e.r0||0,0),o=i>0;if(o||r>0){if(o||(i=r,r=0),r>i){var a=i;i=r,r=a}var s=e.startAngle,l=e.endAngle;if(!isNaN(s)&&!isNaN(l)){var u=e.cx,h=e.cy,c=!!e.clockwise,d=ag(l-s),f=d>eg&&d%eg;if(f>hg&&(d=f),i>hg)if(d>eg-hg)t.moveTo(u+i*ig(s),h+i*ng(s)),t.arc(u,h,i,s,l,!c),r>hg&&(t.moveTo(u+r*ig(l),h+r*ng(l)),t.arc(u,h,r,l,s,c));else{var p=void 0,g=void 0,m=void 0,v=void 0,_=void 0,y=void 0,x=void 0,w=void 0,b=void 0,T=void 0,S=void 0,M=void 0,C=void 0,L=void 0,A=void 0,D=void 0,I=i*ig(s),P=i*ng(s),E=r*ig(l),O=r*ng(l),N=d>hg;if(N){var R=e.cornerRadius;R&&(n=function(t){var e;if(yt(t)){var n=t.length;if(!n)return t;e=1===n?[t[0],t[0],0,0]:2===n?[t[0],t[0],t[1],t[1]]:3===n?t.concat(t[2]):t}else e=[t,t,t,t];return e}(R),p=n[0],g=n[1],m=n[2],v=n[3]);var k=ag(i-r)/2;if(_=ug(k,m),y=ug(k,v),x=ug(k,p),w=ug(k,g),S=b=lg(_,y),M=T=lg(x,w),(b>hg||T>hg)&&(C=i*ig(l),L=i*ng(l),A=r*ig(s),D=r*ng(s),dhg){var W=ug(m,S),j=ug(v,S),Z=cg(A,D,I,P,i,W,c),X=cg(C,L,E,O,i,j,c);t.moveTo(u+Z.cx+Z.x0,h+Z.cy+Z.y0),S0&&t.arc(u+Z.cx,h+Z.cy,W,og(Z.y0,Z.x0),og(Z.y1,Z.x1),!c),t.arc(u,h,i,og(Z.cy+Z.y1,Z.cx+Z.x1),og(X.cy+X.y1,X.cx+X.x1),!c),j>0&&t.arc(u+X.cx,h+X.cy,j,og(X.y1,X.x1),og(X.y0,X.x0),!c))}else t.moveTo(u+I,h+P),t.arc(u,h,i,s,l,!c);else t.moveTo(u+I,h+P);if(r>hg&&N)if(M>hg){W=ug(p,M),Z=cg(E,O,C,L,r,-(j=ug(g,M)),c),X=cg(I,P,A,D,r,-W,c);t.lineTo(u+Z.cx+Z.x0,h+Z.cy+Z.y0),M0&&t.arc(u+Z.cx,h+Z.cy,j,og(Z.y0,Z.x0),og(Z.y1,Z.x1),!c),t.arc(u,h,r,og(Z.cy+Z.y1,Z.cx+Z.x1),og(X.cy+X.y1,X.cx+X.x1),c),W>0&&t.arc(u+X.cx,h+X.cy,W,og(X.y1,X.x1),og(X.y0,X.x0),!c))}else t.lineTo(u+E,h+O),t.arc(u,h,r,l,s,c);else t.lineTo(u+E,h+O)}else t.moveTo(u,h);t.closePath()}}}var fg=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0},pg=function(t){function e(e){return t.call(this,e)||this}return I(e,t),e.prototype.getDefaultShape=function(){return new fg},e.prototype.buildPath=function(t,e){dg(t,e)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(Sl);pg.prototype.type="sector";const gg=pg;var mg=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},vg=function(t){function e(e){return t.call(this,e)||this}return I(e,t),e.prototype.getDefaultShape=function(){return new mg},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,r=2*Math.PI;t.moveTo(n+e.r,i),t.arc(n,i,e.r,0,r,!1),t.moveTo(n+e.r0,i),t.arc(n,i,e.r0,0,r,!0)},e}(Sl);vg.prototype.type="ring";const _g=vg;function yg(t,e,n){var i=e.smooth,r=e.points;if(r&&r.length>=2){if(i){var o=function(t,e,n,i){var r,o,a,s,l=[],u=[],h=[],c=[];if(i){a=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,f=t.length;dXg[1]){if(a=!1,r)return a;var u=Math.abs(Xg[0]-Zg[1]),h=Math.abs(Zg[0]-Xg[1]);Math.min(u,h)>i.len()&&(uMath.abs(o[1])?o[0]>0?"right":"left":o[1]>0?"bottom":"top"}function xm(t){return!t.isGroup}function wm(t,e,n){if(t&&e){var i=function(t){var e={};return t.traverse((function(t){xm(t)&&t.anid&&(e[t.anid]=t)})),e}(t);e.traverse((function(t){if(xm(t)&&t.anid){var e=i[t.anid];if(e){var o=r(t);t.attr(r(e)),Ju(t,o,n,nu(t).dataIndex)}}}))}function r(t){var e={x:t.x,y:t.y,rotation:t.rotation};return function(t){return null!=t.shape}(t)&&(e.shape=rt({},t.shape)),e}}function bm(t,e){return dt(t,(function(t){var n=t[0];n=em(n,e.x),n=nm(n,e.x+e.width);var i=t[1];return i=em(i,e.y),[n,i=nm(i,e.y+e.height)]}))}function Tm(t,e){var n=em(t.x,e.x),i=nm(t.x+t.width,e.x+e.width),r=em(t.y,e.y),o=nm(t.y+t.height,e.y+e.height);if(i>=n&&o>=r)return{x:n,y:r,width:i-n,height:o-r}}function Sm(t,e,n){var i=rt({rectHover:!0},e),r=i.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(r.image=t.slice(8),ot(r,n),new Pl(i)):um(t.replace("path://",""),i,n,"center")}function Mm(t,e,n,i,r){for(var o=0,a=r[r.length-1];o=-1e-6)return!1;var p=t-r,g=e-o,m=Lm(p,g,u,h)/f;if(m<0||m>1)return!1;var v=Lm(p,g,c,d)/f;return!(v<0||v>1)}function Lm(t,e,n,i){return t*i-n*e}function Am(t){var e=t.itemTooltipOption,n=t.componentModel,i=t.itemName,r=wt(e)?{formatter:e}:e,o=n.mainType,a=n.componentIndex,s={componentType:o,name:i,$vars:["name"]};s[o+"Index"]=a;var l=t.formatterParamsExtra;l&&ct(mt(l),(function(t){Yt(s,t)||(s[t]=l[t],s.$vars.push(t))}));var u=nu(t.el);u.componentMainType=o,u.componentIndex=a,u.tooltipConfig={name:i,option:ot({content:i,encodeHTMLContent:!0,formatterParams:s},r)}}function Dm(t,e){var n;t.isGroup&&(n=e(t)),n||t.traverse(e)}function Im(t,e){if(t)if(yt(t))for(var n=0;n=0?c():h=setTimeout(c,-r),l=i};return d.clear=function(){h&&(clearTimeout(h),h=null)},d.debounceNextCall=function(t){s=t},d}function Wm(t,e,n,i){var r=t[e];if(r){var o=r[Vm]||r,a=r[Hm];if(r[Gm]!==n||a!==i){if(null==n||!i)return t[e]=o;(r=t[e]=Um(o,n,"debounce"===i))[Vm]=o,r[Hm]=i,r[Gm]=n}return r}}function jm(t,e){var n=t[e];n&&n[Vm]&&(n.clear&&n.clear(),t[e]=n[Vm])}var Zm=Ea(),Xm={itemStyle:Ya(Ch,!0),lineStyle:Ya(Th,!0)},qm={lineStyle:"stroke",itemStyle:"fill"};function Ym(t,e){var n=t.visualStyleMapper||Xm[e];return n||(console.warn("Unknown style type '"+e+"'."),Xm.itemStyle)}function Km(t,e){var n=t.visualDrawType||qm[e];return n||(console.warn("Unknown style type '"+e+"'."),"fill")}var Jm={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData(),i=t.visualStyleAccessPath||"itemStyle",r=t.getModel(i),o=Ym(t,i)(r),a=r.getShallow("decal");a&&(n.setVisual("decal",a),a.dirty=!0);var s=Km(t,i),l=o[s],u=xt(l)?l:null,h="auto"===o.fill||"auto"===o.stroke;if(!o[s]||u||h){var c=t.getColorFromPalette(t.name,null,e.getSeriesCount());o[s]||(o[s]=c,n.setVisual("colorFromPalette",!0)),o.fill="auto"===o.fill||xt(o.fill)?c:o.fill,o.stroke="auto"===o.stroke||xt(o.stroke)?c:o.stroke}if(n.setVisual("style",o),n.setVisual("drawType",s),!e.isSeriesFiltered(t)&&u)return n.setVisual("colorFromPalette",!1),{dataEach:function(e,n){var i=t.getDataParams(n),r=rt({},o);r[s]=u(i),e.setItemVisual(n,"style",r)}}}},$m=new Ih,Qm={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!t.ignoreStyleOnData&&!e.isSeriesFiltered(t)){var n=t.getData(),i=t.visualStyleAccessPath||"itemStyle",r=Ym(t,i),o=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(t,e){var n=t.getRawDataItem(e);if(n&&n[i]){$m.option=n[i];var a=r($m);rt(t.ensureUniqueItemVisual(e,"style"),a),$m.option.decal&&(t.setItemVisual(e,"decal",$m.option.decal),$m.option.decal.dirty=!0),o in a&&t.setItemVisual(e,"colorFromPalette",!1)}}:null}}}},tv={performRawSeries:!0,overallReset:function(t){var e=jt();t.eachSeries((function(t){var n=t.getColorBy();if(!t.isColorBySeries()){var i=t.type+"-"+n,r=e.get(i);r||(r={},e.set(i,r)),Zm(t).scope=r}})),t.eachSeries((function(e){if(!e.isColorBySeries()&&!t.isSeriesFiltered(e)){var n=e.getRawData(),i={},r=e.getData(),o=Zm(e).scope,a=e.visualStyleAccessPath||"itemStyle",s=Km(e,a);r.each((function(t){var e=r.getRawIndex(t);i[e]=t})),n.each((function(t){var a=i[t];if(r.getItemVisual(a,"colorFromPalette")){var l=r.ensureUniqueItemVisual(a,"style"),u=n.getName(t)||t+"",h=n.count();l[s]=e.getColorFromPalette(u,o,h)}}))}}))}},ev=Math.PI;var nv=function(){function t(t,e,n,i){this._stageTaskMap=jt(),this.ecInstance=t,this.api=e,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return t.prototype.restoreData=function(t,e){t.restoreData(e),this._stageTaskMap.each((function(t){var e=t.overallTask;e&&e.dirty()}))},t.prototype.getPerformArgs=function(t,e){if(t.__pipeline){var n=this._pipelineMap.get(t.__pipeline.id),i=n.context,r=!e&&n.progressiveEnabled&&(!i||i.progressiveRender)&&t.__idxInPipeline>n.blockIndex?n.step:null,o=i&&i.modDataCount;return{step:r,modBy:null!=o?Math.ceil(o/r):null,modDataCount:o}}},t.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},t.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData().count(),r=n.progressiveEnabled&&e.incrementalPrepareRender&&i>=n.threshold,o=t.get("large")&&i>=t.get("largeThreshold"),a="mod"===t.get("progressiveChunkMode")?i:null;t.pipelineContext=n.context={progressiveRender:r,modDataCount:a,large:o}},t.prototype.restorePipelines=function(t){var e=this,n=e._pipelineMap=jt();t.eachSeries((function(t){var i=t.getProgressive(),r=t.uid;n.set(r,{id:r,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:i&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),e._pipe(t,t.dataTask)}))},t.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.api.getModel(),n=this.api;ct(this._allHandlers,(function(i){var r=t.get(i.uid)||t.set(i.uid,{});zt(!(i.reset&&i.overallReset),""),i.reset&&this._createSeriesStageTask(i,r,e,n),i.overallReset&&this._createOverallStageTask(i,r,e,n)}),this)},t.prototype.prepareView=function(t,e,n,i){var r=t.renderTask,o=r.context;o.model=e,o.ecModel=n,o.api=i,r.__block=!t.incrementalPrepareRender,this._pipe(e,r)},t.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},t.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},t.prototype._performStageTasks=function(t,e,n,i){i=i||{};var r=!1,o=this;function a(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}ct(t,(function(t,s){if(!i.visualType||i.visualType===t.visualType){var l=o._stageTaskMap.get(t.uid),u=l.seriesTaskMap,h=l.overallTask;if(h){var c,d=h.agentStubMap;d.each((function(t){a(i,t)&&(t.dirty(),c=!0)})),c&&h.dirty(),o.updatePayload(h,n);var f=o.getPerformArgs(h,i.block);d.each((function(t){t.perform(f)})),h.perform(f)&&(r=!0)}else u&&u.each((function(s,l){a(i,s)&&s.dirty();var u=o.getPerformArgs(s,i.block);u.skip=!t.performRawSeries&&e.isSeriesFiltered(s.context.model),o.updatePayload(s,n),s.perform(u)&&(r=!0)}))}})),this.unfinished=r||this.unfinished},t.prototype.performSeriesTasks=function(t){var e;t.eachSeries((function(t){e=t.dataTask.perform()||e})),this.unfinished=e||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each((function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)}))},t.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},t.prototype._createSeriesStageTask=function(t,e,n,i){var r=this,o=e.seriesTaskMap,a=e.seriesTaskMap=jt(),s=t.seriesType,l=t.getTargetSeries;function u(e){var s=e.uid,l=a.set(s,o&&o.get(s)||Sf({plan:sv,reset:lv,count:cv}));l.context={model:e,ecModel:n,api:i,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:r},r._pipe(e,l)}t.createOnAllSeries?n.eachRawSeries(u):s?n.eachRawSeriesByType(s,u):l&&l(n,i).each(u)},t.prototype._createOverallStageTask=function(t,e,n,i){var r=this,o=e.overallTask=e.overallTask||Sf({reset:iv});o.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:r};var a=o.agentStubMap,s=o.agentStubMap=jt(),l=t.seriesType,u=t.getTargetSeries,h=!0,c=!1;function d(t){var e=t.uid,n=s.set(e,a&&a.get(e)||(c=!0,Sf({reset:rv,onDirty:av})));n.context={model:t,overallProgress:h},n.agent=o,n.__block=h,r._pipe(t,n)}zt(!t.createOnAllSeries,""),l?n.eachRawSeriesByType(l,d):u?u(n,i).each(d):(h=!1,ct(n.getSeries(),d)),c&&o.dirty()},t.prototype._pipe=function(t,e){var n=t.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=e),i.tail&&i.tail.pipe(e),i.tail=e,e.__idxInPipeline=i.count++,e.__pipeline=i},t.wrapStageHandler=function(t,e){return xt(t)&&(t={overallReset:t,seriesType:dv(t)}),t.uid=Eh("stageHandler"),e&&(t.visualType=e),t},t}();function iv(t){t.overallReset(t.ecModel,t.api,t.payload)}function rv(t){return t.overallProgress&&ov}function ov(){this.agent.dirty(),this.getDownstream().dirty()}function av(){this.agent&&this.agent.dirty()}function sv(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function lv(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=xa(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?dt(e,(function(t,e){return hv(e)})):uv}var uv=hv(0);function hv(t){return function(e,n){var i=n.data,r=n.resetDefines[t];if(r&&r.dataEach)for(var o=e.start;o0&&h===r.length-u.length){var c=r.slice(0,h);"data"!==c&&(e.mainType=c,e[u.toLowerCase()]=t,s=!0)}}a.hasOwnProperty(r)&&(n[r]=t,s=!0),s||(i[r]=t)}))}return{cptQuery:e,dataQuery:n,otherQuery:i}},t.prototype.filter=function(t,e){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,r=n.packedEvent,o=n.model,a=n.view;if(!o||!a)return!0;var s=e.cptQuery,l=e.dataQuery;return u(s,o,"mainType")&&u(s,o,"subType")&&u(s,o,"index","componentIndex")&&u(s,o,"name")&&u(s,o,"id")&&u(l,r,"name")&&u(l,r,"dataIndex")&&u(l,r,"dataType")&&(!a.filterForExposedEvent||a.filterForExposedEvent(t,e.otherQuery,i,r));function u(t,e,n,i){return null==t[n]||e[i||n]===t[n]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),Lv=["symbol","symbolSize","symbolRotate","symbolOffset"],Av=Lv.concat(["symbolKeepAspect"]),Dv={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData();if(t.legendIcon&&n.setVisual("legendIcon",t.legendIcon),t.hasSymbolVisual){for(var i={},r={},o=!1,a=0;a=0&&qv(l)?l:.5,t.createRadialGradient(a,s,0,a,s,l)}(t,e,n):function(t,e,n){var i=null==e.x?0:e.x,r=null==e.x2?1:e.x2,o=null==e.y?0:e.y,a=null==e.y2?0:e.y2;return e.global||(i=i*n.width+n.x,r=r*n.width+n.x,o=o*n.height+n.y,a=a*n.height+n.y),i=qv(i)?i:0,r=qv(r)?r:1,o=qv(o)?o:0,a=qv(a)?a:0,t.createLinearGradient(i,o,r,a)}(t,e,n),r=e.colorStops,o=0;o0&&(e=i.lineDash,n=i.lineWidth,e&&"solid"!==e&&n>0?"dashed"===e?[4*n,2*n]:"dotted"===e?[n]:Tt(e)?[e]:yt(e)?e:null:null),o=i.lineDashOffset;if(r){var a=i.strokeNoScale&&t.getLineScale?t.getLineScale():1;a&&1!==a&&(r=dt(r,(function(t){return t/a})),o/=a)}return[r,o]}var Qv=new il(!0);function t_(t){var e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))}function e_(t){return"string"==typeof t&&"none"!==t}function n_(t){var e=t.fill;return null!=e&&"none"!==e}function i_(t,e){if(null!=e.fillOpacity&&1!==e.fillOpacity){var n=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=n}else t.fill()}function r_(t,e){if(null!=e.strokeOpacity&&1!==e.strokeOpacity){var n=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=n}else t.stroke()}function o_(t,e,n){var i=ts(e.image,e.__image,n);if(ns(i)){var r=t.createPattern(i,e.repeat||"repeat");if("function"==typeof DOMMatrix&&r&&r.setTransform){var o=new DOMMatrix;o.translateSelf(e.x||0,e.y||0),o.rotateSelf(0,0,(e.rotation||0)*Jt),o.scaleSelf(e.scaleX||1,e.scaleY||1),r.setTransform(o)}return r}}var a_=["shadowBlur","shadowOffsetX","shadowOffsetY"],s_=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function l_(t,e,n,i,r){var o=!1;if(!i&&e===(n=n||{}))return!1;if(i||e.opacity!==n.opacity){g_(t,r),o=!0;var a=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(a)?vs.opacity:a}(i||e.blend!==n.blend)&&(o||(g_(t,r),o=!0),t.globalCompositeOperation=e.blend||vs.blend);for(var s=0;s0&&t.unfinished);t.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(t,e,n){if(!this[z_])if(this._disposed)py(this.id);else{var i,r,o;if(St(e)&&(n=e.lazyUpdate,i=e.silent,r=e.replaceMerge,o=e.transition,e=e.notMerge),this[z_]=!0,!this._model||e){var a=new Ld(this._api),s=this._theme,l=this._model=new _d;l.scheduler=this._scheduler,l.ssr=this._ssr,l.init(null,null,null,s,this._locale,a)}this._model.setOption(t,{replaceMerge:r},_y);var u={seriesTransition:o,optionChanged:!0};if(n)this[B_]={silent:i,updateParams:u},this[z_]=!1,this.getZr().wakeUp();else{try{j_(this),q_.update.call(this,null,u)}catch(t){throw this[B_]=null,this[z_]=!1,t}this._ssr||this._zr.flush(),this[B_]=null,this[z_]=!1,$_.call(this,i),Q_.call(this,i)}}},e.prototype.setTheme=function(){Lf()},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||O.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},e.prototype.renderToCanvas=function(t){return t=t||{},this._zr.painter.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(t){return t=t||{},this._zr.painter.renderToString({useViewBox:t.useViewBox})},e.prototype.getSvgDataURL=function(){if(O.svgSupported){var t=this._zr;return ct(t.storage.getDisplayList(),(function(t){t.stopAnimation(null,!0)})),t.painter.toDataURL()}},e.prototype.getDataURL=function(t){if(!this._disposed){var e=(t=t||{}).excludeComponents,n=this._model,i=[],r=this;ct(e,(function(t){n.eachComponent({mainType:t},(function(t){var e=r._componentsMap[t.__viewId];e.group.ignore||(i.push(e),e.group.ignore=!0)}))}));var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return ct(i,(function(t){t.group.ignore=!1})),o}py(this.id)},e.prototype.getConnectedDataURL=function(t){if(!this._disposed){var e="svg"===t.type,n=this.group,i=Math.min,r=Math.max,o=1/0;if(Ty[n]){var a=o,s=o,l=-1/0,u=-1/0,h=[],c=t&&t.pixelRatio||this.getDevicePixelRatio();ct(by,(function(o,c){if(o.group===n){var d=e?o.getZr().painter.getSvgDom().innerHTML:o.renderToCanvas(et(t)),f=o.getDom().getBoundingClientRect();a=i(f.left,a),s=i(f.top,s),l=r(f.right,l),u=r(f.bottom,u),h.push({dom:d,left:f.left,top:f.top})}}));var d=(l*=c)-(a*=c),f=(u*=c)-(s*=c),p=F.createCanvas(),g=zo(p,{renderer:e?"svg":"canvas"});if(g.resize({width:d,height:f}),e){var m="";return ct(h,(function(t){var e=t.left-a,n=t.top-s;m+=''+t.dom+""})),g.painter.getSvgRoot().innerHTML=m,t.connectedBackgroundColor&&g.painter.setBackgroundColor(t.connectedBackgroundColor),g.refreshImmediately(),g.painter.toDataURL()}return t.connectedBackgroundColor&&g.add(new Fl({shape:{x:0,y:0,width:d,height:f},style:{fill:t.connectedBackgroundColor}})),ct(h,(function(t){var e=new Pl({style:{x:t.left*c-a,y:t.top*c-s,image:t.dom}});g.add(e)})),g.refreshImmediately(),p.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}py(this.id)},e.prototype.convertToPixel=function(t,e){return Y_(this,"convertToPixel",t,e)},e.prototype.convertFromPixel=function(t,e){return Y_(this,"convertFromPixel",t,e)},e.prototype.containPixel=function(t,e){var n;if(!this._disposed)return ct(Na(this._model,t),(function(t,i){i.indexOf("Models")>=0&&ct(t,(function(t){var r=t.coordinateSystem;if(r&&r.containPoint)n=n||!!r.containPoint(e);else if("seriesModels"===i){var o=this._chartsMap[t.__viewId];o&&o.containPoint&&(n=n||o.containPoint(e,t))}else 0}),this)}),this),!!n;py(this.id)},e.prototype.getVisual=function(t,e){var n=Na(this._model,t,{defaultMainType:"series"});var i=n.seriesModel.getData(),r=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?i.indexOfRawIndex(n.dataIndex):null;return null!=r?function(t,e,n){switch(n){case"color":return t.getItemVisual(e,"style")[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,n)}}(i,r,e):function(t,e){switch(e){case"color":return t.getVisual("style")[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e)}}(i,e)},e.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},e.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},e.prototype._initEvents=function(){var t,e,n,i=this;ct(fy,(function(t){var e=function(e){var n,r=i.getModel(),o=e.target;if("globalout"===t?n={}:o&&Ev(o,(function(t){var e=nu(t);if(e&&null!=e.dataIndex){var i=e.dataModel||r.getSeriesByIndex(e.seriesIndex);return n=i&&i.getDataParams(e.dataIndex,e.dataType,o)||{},!0}if(e.eventData)return n=rt({},e.eventData),!0}),!0),n){var a=n.componentType,s=n.componentIndex;"markLine"!==a&&"markPoint"!==a&&"markArea"!==a||(a="series",s=n.seriesIndex);var l=a&&null!=s&&r.getComponent(a,s),u=l&&i["series"===l.mainType?"_chartsMap":"_componentsMap"][l.__viewId];0,n.event=e,n.type=t,i._$eventProcessor.eventInfo={targetEl:o,packedEvent:n,model:l,view:u},i.trigger(t,n)}};e.zrEventfulCallAtLast=!0,i._zr.on(t,e,i)})),ct(my,(function(t,e){i._messageCenter.on(e,(function(t){this.trigger(e,t)}),i)})),ct(["selectchanged"],(function(t){i._messageCenter.on(t,(function(e){this.trigger(t,e)}),i)})),t=this._messageCenter,e=this,n=this._api,t.on("selectchanged",(function(t){var i=n.getModel();t.isFromClick?(Pv("map","selectchanged",e,i,t),Pv("pie","selectchanged",e,i,t)):"select"===t.fromAction?(Pv("map","selected",e,i,t),Pv("pie","selected",e,i,t)):"unselect"===t.fromAction&&(Pv("map","unselected",e,i,t),Pv("pie","unselected",e,i,t))}))},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){this._disposed?py(this.id):this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed)py(this.id);else{this._disposed=!0,this.getDom()&&Fa(this.getDom(),Cy,"");var t=this,e=t._api,n=t._model;ct(t._componentsViews,(function(t){t.dispose(n,e)})),ct(t._chartsViews,(function(t){t.dispose(n,e)})),t._zr.dispose(),t._dom=t._model=t._chartsMap=t._componentsMap=t._chartsViews=t._componentsViews=t._scheduler=t._api=t._zr=t._throttledZrFlush=t._theme=t._coordSysMgr=t._messageCenter=null,delete by[t.id]}},e.prototype.resize=function(t){if(!this[z_])if(this._disposed)py(this.id);else{this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var n=e.resetOption("media"),i=t&&t.silent;this[B_]&&(null==i&&(i=this[B_].silent),n=!0,this[B_]=null),this[z_]=!0;try{n&&j_(this),q_.update.call(this,{type:"resize",animation:rt({duration:0},t&&t.animation)})}catch(t){throw this[z_]=!1,t}this[z_]=!1,$_.call(this,i),Q_.call(this,i)}}},e.prototype.showLoading=function(t,e){if(this._disposed)py(this.id);else if(St(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),wy[t]){var n=wy[t](this._api,e),i=this._zr;this._loadingFX=n,i.add(n)}},e.prototype.hideLoading=function(){this._disposed?py(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},e.prototype.makeActionFromEvent=function(t){var e=rt({},t);return e.type=my[t.type],e},e.prototype.dispatchAction=function(t,e){if(this._disposed)py(this.id);else if(St(e)||(e={silent:!!e}),gy[t.type]&&this._model)if(this[z_])this._pendingActions.push(t);else{var n=e.silent;J_.call(this,t,n);var i=e.flush;i?this._zr.flush():!1!==i&&O.browser.weChat&&this._throttledZrFlush(),$_.call(this,n),Q_.call(this,n)}},e.prototype.updateLabelLayout=function(){C_.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(t){if(this._disposed)py(this.id);else{var e=t.seriesIndex;0,this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},e.internalField=function(){function t(t){t.clearColorPalette(),t.eachSeries((function(t){t.clearColorPalette()}))}function e(t){for(var e=[],n=t.currentStates,i=0;i0?{duration:o,delay:i.get("delay"),easing:i.get("easing")}:null;n.eachRendered((function(t){if(t.states&&t.states.emphasis){if(Qu(t))return;if(t instanceof Sl&&function(t){var e=ou(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var n=t.states.select||{};e.selectFill=n.style&&n.style.fill||null,e.selectStroke=n.style&&n.style.stroke||null}(t),t.__dirty){var n=t.prevStates;n&&t.useStates(n)}if(r){t.stateTransition=a;var i=t.getTextContent(),o=t.getTextGuideLine();i&&(i.stateTransition=a),o&&(o.stateTransition=a)}t.__dirty&&e(t)}}))}j_=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),Z_(t,!0),Z_(t,!1),e.plan()},Z_=function(t,e){for(var n=t._model,i=t._scheduler,r=e?t._componentsViews:t._chartsViews,o=e?t._componentsMap:t._chartsMap,a=t._zr,s=t._api,l=0;le.get("hoverLayerThreshold")&&!O.node&&!O.worker&&e.eachSeries((function(e){if(!e.preventUsingHoverLayer){var n=t._chartsMap[e.__viewId];n.__alive&&n.eachRendered((function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)}))}}))}(t,e),C_.trigger("series:afterupdate",e,i,s)},sy=function(t){t[F_]=!0,t.getZr().wakeUp()},ly=function(t){t[F_]&&(t.getZr().storage.traverse((function(t){Qu(t)||e(t)})),t[F_]=!1)},oy=function(t){return new(function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return I(n,e),n.prototype.getCoordinateSystems=function(){return t._coordSysMgr.getCoordinateSystems()},n.prototype.getComponentByElement=function(e){for(;e;){var n=e.__ecComponentInfo;if(null!=n)return t._model.getComponent(n.mainType,n.index);e=e.parent}},n.prototype.enterEmphasis=function(e,n){Iu(e,n),sy(t)},n.prototype.leaveEmphasis=function(e,n){Pu(e,n),sy(t)},n.prototype.enterBlur=function(e){!function(t){Mu(t,xu)}(e),sy(t)},n.prototype.leaveBlur=function(e){Eu(e),sy(t)},n.prototype.enterSelect=function(e){Ou(e),sy(t)},n.prototype.leaveSelect=function(e){Nu(e),sy(t)},n.prototype.getModel=function(){return t.getModel()},n.prototype.getViewOfComponentModel=function(e){return t.getViewOfComponentModel(e)},n.prototype.getViewOfSeriesModel=function(e){return t.getViewOfSeriesModel(e)},n}(xd))(t)},ay=function(t){function e(t,e){for(var n=0;n=0)){jy.push(n);var o=vv.wrapStageHandler(n,r);o.__prio=e,o.__raw=n,t.push(o)}}function Xy(t,e){wy[t]=e}function qy(t){V({createCanvas:t})}function Yy(t,e,n){var i=A_("registerMap");i&&i(t,e,n)}function Ky(t){var e=A_("getMap");return e&&e(t)}var Jy=function(t){var e=(t=et(t)).type;e||Af("");var n=e.split(":");2!==n.length&&Af("");var i=!1;"echarts"===n[0]&&(e=n[1],i=!0),t.__isBuiltIn=i,zf.set(e,t)};Wy(O_,Jm),Wy(R_,Qm),Wy(R_,tv),Wy(O_,Dv),Wy(R_,Iv),Wy(7e3,(function(t,e){t.eachRawSeries((function(n){if(!t.isSeriesFiltered(n)){var i=n.getData();i.hasItemVisual()&&i.each((function(t){var n=i.getItemVisual(t,"decal");n&&(i.ensureUniqueItemVisual(t,"style").decal=b_(n,e))}));var r=i.getVisual("decal");if(r)i.getVisual("style").decal=b_(r,e)}}))})),Ry(Xd),ky(900,(function(t){var e=jt();t.eachSeries((function(t){var n=t.get("stack");if(n){var i=e.get(n)||e.set(n,[]),r=t.getData(),o={stackResultDimension:r.getCalculationInfo("stackResultDimension"),stackedOverDimension:r.getCalculationInfo("stackedOverDimension"),stackedDimension:r.getCalculationInfo("stackedDimension"),stackedByDimension:r.getCalculationInfo("stackedByDimension"),isStackedByIndex:r.getCalculationInfo("isStackedByIndex"),data:r,seriesModel:t};if(!o.stackedDimension||!o.isStackedByIndex&&!o.stackedByDimension)return;i.length&&r.setCalculationInfo("stackedOnSeries",i[i.length-1].seriesModel),i.push(o)}})),e.each(qd)})),Xy("default",(function(t,e){ot(e=e||{},{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Eo,i=new Fl({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});n.add(i);var r,o=new eu({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new Fl({style:{fill:"none"},textContent:o,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});return n.add(a),e.showSpinner&&((r=new zg({shape:{startAngle:-ev/2,endAngle:-ev/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*ev/2}).start("circularInOut"),r.animateShape(!0).when(1e3,{startAngle:3*ev/2}).delay(300).start("circularInOut"),n.add(r)),n.resize=function(){var n=o.getBoundingRect().width,s=e.showSpinner?e.spinnerRadius:0,l=(t.getWidth()-2*s-(e.showSpinner&&n?10:0)-n)/2-(e.showSpinner&&n?0:5+n/2)+(e.showSpinner?0:n/2)+(n?0:s),u=t.getHeight()/2;e.showSpinner&&r.setShape({cx:l,cy:u}),a.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),i.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},n.resize(),n})),Vy({type:cu,event:cu,update:cu},Kt),Vy({type:du,event:du,update:du},Kt),Vy({type:fu,event:fu,update:fu},Kt),Vy({type:pu,event:pu,update:pu},Kt),Vy({type:gu,event:gu,update:gu},Kt),Ny("light",yv),Ny("dark",Mv);var $y={};function Qy(t){return null==t?0:t.length||1}function tx(t){return t}const ex=function(){function t(t,e,n,i,r,o){this._old=t,this._new=e,this._oldKeyGetter=n||tx,this._newKeyGetter=i||tx,this.context=r,this._diffModeMultiple="multiple"===o}return t.prototype.add=function(t){return this._add=t,this},t.prototype.update=function(t){return this._update=t,this},t.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},t.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},t.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},t.prototype.remove=function(t){return this._remove=t,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var t=this._old,e=this._new,n={},i=new Array(t.length),r=new Array(e.length);this._initIndexMap(t,null,i,"_oldKeyGetter"),this._initIndexMap(e,n,r,"_newKeyGetter");for(var o=0;o1){var u=s.shift();1===s.length&&(n[a]=s[0]),this._update&&this._update(u,o)}else 1===l?(n[a]=null,this._update&&this._update(s,o)):this._remove&&this._remove(o)}this._performRestAdd(r,n)},t.prototype._executeMultiple=function(){var t=this._old,e=this._new,n={},i={},r=[],o=[];this._initIndexMap(t,n,r,"_oldKeyGetter"),this._initIndexMap(e,i,o,"_newKeyGetter");for(var a=0;a1&&1===c)this._updateManyToOne&&this._updateManyToOne(u,l),i[s]=null;else if(1===h&&c>1)this._updateOneToMany&&this._updateOneToMany(u,l),i[s]=null;else if(1===h&&1===c)this._update&&this._update(u,l),i[s]=null;else if(h>1&&c>1)this._updateManyToMany&&this._updateManyToMany(u,l),i[s]=null;else if(h>1)for(var d=0;d1)for(var a=0;a30}var dx,fx,px,gx,mx,vx,_x,yx=St,xx=dt,bx="undefined"==typeof Int32Array?Array:Int32Array,Tx=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],Sx=["_approximateExtent"],Mx=function(){function t(t,e){var n;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 i=!1;lx(t)?(n=t.dimensions,this._dimOmitted=t.isDimensionOmitted(),this._schema=t):(i=!0,n=t),n=n||["x","y"];for(var r={},o=[],a={},s=!1,l={},u=0;u=e)){var n=this._store.getProvider();this._updateOrdinalMeta();var i=this._nameList,r=this._idList;if(n.getSource().sourceFormat===Zc&&!n.pure)for(var o=[],a=t;a0},t.prototype.ensureUniqueItemVisual=function(t,e){var n=this._itemVisuals,i=n[t];i||(i=n[t]={});var r=i[e];return null==r&&(yt(r=this.getVisual(e))?r=r.slice():yx(r)&&(r=rt({},r)),i[e]=r),r},t.prototype.setItemVisual=function(t,e,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,yx(e)?rt(i,e):i[e]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(t,e){yx(t)?rt(this._layout,t):this._layout[t]=e},t.prototype.getLayout=function(t){return this._layout[t]},t.prototype.getItemLayout=function(t){return this._itemLayouts[t]},t.prototype.setItemLayout=function(t,e,n){this._itemLayouts[t]=n?rt(this._itemLayouts[t]||{},e):e},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(t,e){!function(t,e,n,i){if(i){var r=nu(i);r.dataIndex=n,r.dataType=e,r.seriesIndex=t,r.ssrType="chart","group"===i.type&&i.traverse((function(i){var r=nu(i);r.seriesIndex=t,r.dataIndex=n,r.dataType=e,r.ssrType="chart"}))}}(this.hostModel&&this.hostModel.seriesIndex,this.dataType,t,e),this._graphicEls[t]=e},t.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},t.prototype.eachItemGraphicEl=function(t,e){ct(this._graphicEls,(function(n,i){n&&t&&t.call(e,n,i)}))},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:xx(this.dimensions,this._getDimInfo,this),this.hostModel)),mx(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(t,e){var n=this[t];xt(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=n.apply(this,arguments);return e.apply(this,[t].concat(Rt(arguments)))})},t.internalField=(dx=function(t){var e=t._invertedIndicesMap;ct(e,(function(n,i){var r=t._dimInfos[i],o=r.ordinalMeta,a=t._store;if(o){n=e[i]=new bx(o.categories.length);for(var s=0;s1&&(s+="__ec__"+u),i[e]=s}})),t}();const Cx=Mx;function Lx(t,e){return Ax(t,e).dimensions}function Ax(t,e){ef(t)||(t=rf(t));var n=(e=e||{}).coordDimensions||[],i=e.dimensionsDefine||t.dimensionsDefine||[],r=jt(),o=[],a=function(t,e,n,i){var r=Math.max(t.dimensionsDetectedCount||1,e.length,n.length,i||0);return ct(e,(function(t){var e;St(t)&&(e=t.dimsDef)&&(r=Math.max(r,e.length))})),r}(t,n,i,e.dimensionsCount),s=e.canOmitUnusedDimensions&&cx(a),l=i===t.dimensionsDefine,u=l?hx(t):ux(i),h=e.encodeDefine;!h&&e.encodeDefaulter&&(h=e.encodeDefaulter(t,a));for(var c=jt(h),d=new Wf(a),f=0;f0&&(i.name=r+(o-1)),o++,e.set(r,o)}}(o),new sx({source:t,dimensions:o,fullDimensionCount:a,dimensionOmitted:s})}function Dx(t,e,n){if(n||e.hasKey(t)){for(var i=0;e.hasKey(t+i);)i++;t+=i}return e.set(t,!0),t}var Ix=function(t){this.coordSysDims=[],this.axisMap=jt(),this.categoryAxisMap=jt(),this.coordSysName=t};var Px={cartesian2d:function(t,e,n,i){var r=t.getReferringComponents("xAxis",ka).models[0],o=t.getReferringComponents("yAxis",ka).models[0];e.coordSysDims=["x","y"],n.set("x",r),n.set("y",o),Ex(r)&&(i.set("x",r),e.firstCategoryDimIndex=0),Ex(o)&&(i.set("y",o),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,n,i){var r=t.getReferringComponents("singleAxis",ka).models[0];e.coordSysDims=["single"],n.set("single",r),Ex(r)&&(i.set("single",r),e.firstCategoryDimIndex=0)},polar:function(t,e,n,i){var r=t.getReferringComponents("polar",ka).models[0],o=r.findAxisModel("radiusAxis"),a=r.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],n.set("radius",o),n.set("angle",a),Ex(o)&&(i.set("radius",o),e.firstCategoryDimIndex=0),Ex(a)&&(i.set("angle",a),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},geo:function(t,e,n,i){e.coordSysDims=["lng","lat"]},parallel:function(t,e,n,i){var r=t.ecModel,o=r.getComponent("parallel",t.get("parallelIndex")),a=e.coordSysDims=o.dimensions.slice();ct(o.parallelAxisIndex,(function(t,o){var s=r.getComponent("parallelAxis",t),l=a[o];n.set(l,s),Ex(s)&&(i.set(l,s),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=o))}))}};function Ex(t){return"category"===t.get("type")}function Ox(t,e,n){var i,r,o,a=(n=n||{}).byIndex,s=n.stackedCoordDimension;!function(t){return!lx(t.schema)}(e)?(r=e.schema,i=r.dimensions,o=e.store):i=e;var l,u,h,c,d=!(!t||!t.get("stack"));if(ct(i,(function(t,e){wt(t)&&(i[e]=t={name:t}),d&&!t.isExtraCoord&&(a||l||!t.ordinalMeta||(l=t),u||"ordinal"===t.type||"time"===t.type||s&&s!==t.coordDim||(u=t))})),!u||a||l||(a=!0),u){h="__\0ecstackresult_"+t.id,c="__\0ecstackedover_"+t.id,l&&(l.createInvertedIndices=!0);var f=u.coordDim,p=u.type,g=0;ct(i,(function(t){t.coordDim===f&&g++}));var m={name:h,coordDim:f,coordDimIndex:g,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length},v={name:c,coordDim:c,coordDimIndex:g+1,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length+1};r?(o&&(m.storeDimIndex=o.ensureCalculationDimension(c,p),v.storeDimIndex=o.ensureCalculationDimension(h,p)),r.appendCalculationDimension(m),r.appendCalculationDimension(v)):(i.push(m),i.push(v))}return{stackedDimension:u&&u.name,stackedByDimension:l&&l.name,isStackedByIndex:a,stackedOverDimension:c,stackResultDimension:h}}function Nx(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function Rx(t,e){return Nx(t,e)?t.getCalculationInfo("stackResultDimension"):e}const kx=function(t,e,n){n=n||{};var i,r=e.getSourceManager(),o=!1;t?(o=!0,i=rf(t)):o=(i=r.getSource()).sourceFormat===Zc;var a=function(t){var e=t.get("coordinateSystem"),n=new Ix(e),i=Px[e];if(i)return i(t,n,n.axisMap,n.categoryAxisMap),n}(e),s=function(t,e){var n,i=t.get("coordinateSystem"),r=Td.get(i);return e&&e.coordSysDims&&(n=dt(e.coordSysDims,(function(t){var n={name:t},i=e.axisMap.get(t);if(i){var r=i.get("type");n.type=function(t){return"category"===t?"ordinal":"time"===t?"time":"float"}(r)}return n}))),n||(n=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||["x","y"]),n}(e,a),l=n.useEncodeDefaulter,u=xt(l)?l:l?_t(nd,s,e):null,h=Ax(i,{coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!o}),c=function(t,e,n){var i,r;return n&&ct(t,(function(t,o){var a=t.coordDim,s=n.categoryAxisMap.get(a);s&&(null==i&&(i=o),t.ordinalMeta=s.getOrdinalMeta(),e&&(t.createInvertedIndices=!0)),null!=t.otherDims.itemName&&(r=!0)})),r||null==i||(t[i].otherDims.itemName=0),i}(h.dimensions,n.createInvertedIndices,a),d=o?null:r.getSharedDataStore(h),f=Ox(e,{schema:h,store:d}),p=new Cx(h,e);p.setCalculationInfo(f);var g=null!=c&&function(t){if(t.sourceFormat===Zc){return!yt(Ta(function(t){var e=0;for(;ee[1]&&(e[1]=t[1])},t.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e)},t.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(t){this._isBlank=t},t}();qa(zx);const Bx=zx;var Fx=0;function Vx(t){return St(t)&&null!=t.value?t.value:t+""}const Gx=function(){function t(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++Fx}return t.createByAxisModel=function(e){var n=e.option,i=n.data,r=i&&dt(i,Vx);return new t({categories:r,needCollect:!r,deduplication:!1!==n.dedplication})},t.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},t.prototype.parseAndCollect=function(t){var e,n=this._needCollect;if(!wt(t)&&!n)return t;if(n&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var i=this._getOrCreateMap();return null==(e=i.get(t))&&(n?(e=this.categories.length,this.categories[e]=t,i.set(t,e)):e=NaN),e},t.prototype._getOrCreateMap=function(){return this._map||(this._map=jt(this.categories))},t}();function Hx(t){return"interval"===t.type||"log"===t.type}function Ux(t,e,n,i){var r={},o=t[1]-t[0],a=r.interval=ua(o/e,!0);null!=n&&ai&&(a=r.interval=i);var s=r.intervalPrecision=jx(a);return function(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),Zx(t,0,e),Zx(t,1,e),t[0]>t[1]&&(t[0]=t[1])}(r.niceTickExtent=[Yo(Math.ceil(t[0]/a)*a,s),Yo(Math.floor(t[1]/a)*a,s)],t),r}function Wx(t){var e=Math.pow(10,la(t)),n=t/e;return n?2===n?n=3:3===n?n=5:n*=2:n=1,Yo(n*e)}function jx(t){return Jo(t)+2}function Zx(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function Xx(t,e){return t>=e[0]&&t<=e[1]}function qx(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function Yx(t,e){return t*(e[1]-e[0])+e[0]}var Kx=function(t){function e(e){var n=t.call(this,e)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new Gx({})),yt(i)&&(i=new Gx({categories:dt(i,(function(t){return St(t)?t.value:t}))})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return I(e,t),e.prototype.parse=function(t){return null==t?NaN:wt(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},e.prototype.contain=function(t){return Xx(t=this.parse(t),this._extent)&&null!=this._ordinalMeta.categories[t]},e.prototype.normalize=function(t){return qx(t=this._getTickNumber(this.parse(t)),this._extent)},e.prototype.scale=function(t){return t=Math.round(Yx(t,this._extent)),this.getRawOrdinalNumber(t)},e.prototype.getTicks=function(){for(var t=[],e=this._extent,n=e[0];n<=e[1];)t.push({value:n}),n++;return t},e.prototype.getMinorTicks=function(t){},e.prototype.setSortInfo=function(t){if(null!=t){for(var e=t.ordinalNumbers,n=this._ordinalNumbersByTick=[],i=this._ticksByOrdinalNumber=[],r=0,o=this._ordinalMeta.categories.length,a=Math.min(o,e.length);r=0&&t=0&&t=t},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e}(Bx);Bx.registerClass(Kx);const Jx=Kx;var $x=Yo,Qx=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="interval",e._interval=0,e._intervalPrecision=2,e}return I(e,t),e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return Xx(t,this._extent)},e.prototype.normalize=function(t){return qx(t,this._extent)},e.prototype.scale=function(t){return Yx(t,this._extent)},e.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=parseFloat(t)),isNaN(e)||(n[1]=parseFloat(e))},e.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1]),this.setExtent(e[0],e[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=jx(t)},e.prototype.getTicks=function(t){var e=this._interval,n=this._extent,i=this._niceExtent,r=this._intervalPrecision,o=[];if(!e)return o;n[0]1e4)return[];var s=o.length?o[o.length-1].value:i[1];return n[1]>s&&(t?o.push({value:$x(s+e,r)}):o.push({value:n[1]})),o},e.prototype.getMinorTicks=function(t){for(var e=this.getTicks(!0),n=[],i=this.getExtent(),r=1;ri[0]&&h0&&(o=null===o?s:Math.min(o,s))}n[i]=o}}return n}(t),n=[];return ct(t,(function(t){var i,r=t.coordinateSystem.getBaseAxis(),o=r.getExtent();if("category"===r.type)i=r.getBandWidth();else if("value"===r.type||"time"===r.type){var a=r.dim+"_"+r.index,s=e[a],l=Math.abs(o[1]-o[0]),u=r.scale.getExtent(),h=Math.abs(u[1]-u[0]);i=s?l/h*s:l}else{var c=t.getData();i=Math.abs(o[1]-o[0])/c.count()}var d=qo(t.get("barWidth"),i),f=qo(t.get("barMaxWidth"),i),p=qo(t.get("barMinWidth")||(lw(t)?.5:1),i),g=t.get("barGap"),m=t.get("barCategoryGap");n.push({bandWidth:i,barWidth:d,barMaxWidth:f,barMinWidth:p,barGap:g,barCategoryGap:m,axisKey:iw(r),stackId:nw(t)})})),aw(n)}function aw(t){var e={};ct(t,(function(t,n){var i=t.axisKey,r=t.bandWidth,o=e[i]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},a=o.stacks;e[i]=o;var s=t.stackId;a[s]||o.autoWidthCount++,a[s]=a[s]||{width:0,maxWidth:0};var l=t.barWidth;l&&!a[s].width&&(a[s].width=l,l=Math.min(o.remainedWidth,l),o.remainedWidth-=l);var u=t.barMaxWidth;u&&(a[s].maxWidth=u);var h=t.barMinWidth;h&&(a[s].minWidth=h);var c=t.barGap;null!=c&&(o.gap=c);var d=t.barCategoryGap;null!=d&&(o.categoryGap=d)}));var n={};return ct(e,(function(t,e){n[e]={};var i=t.stacks,r=t.bandWidth,o=t.categoryGap;if(null==o){var a=mt(i).length;o=Math.max(35-4*a,15)+"%"}var s=qo(o,r),l=qo(t.gap,1),u=t.remainedWidth,h=t.autoWidthCount,c=(u-s)/(h+(h-1)*l);c=Math.max(c,0),ct(i,(function(t){var e=t.maxWidth,n=t.minWidth;if(t.width){i=t.width;e&&(i=Math.min(i,e)),n&&(i=Math.max(i,n)),t.width=i,u-=i+l*i,h--}else{var i=c;e&&ei&&(i=n),i!==c&&(t.width=i,u-=i+l*i,h--)}})),c=(u-s)/(h+(h-1)*l),c=Math.max(c,0);var d,f=0;ct(i,(function(t,e){t.width||(t.width=c),d=t,f+=t.width*(1+l)})),d&&(f-=d.width*l);var p=-f/2;ct(i,(function(t,i){n[e][i]=n[e][i]||{bandWidth:r,offset:p,width:t.width},p+=t.width*(1+l)}))})),n}function sw(t){return t.coordinateSystem&&"cartesian2d"===t.coordinateSystem.type}function lw(t){return t.pipelineContext&&t.pipelineContext.large}var uw=function(t){function e(e){var n=t.call(this,e)||this;return n.type="time",n}return I(e,t),e.prototype.getLabel=function(t){var e=this.getSetting("useUTC");return Qh(t.value,Xh[function(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}(Jh(this._minLevelUnit))]||Xh.second,e,this.getSetting("locale"))},e.prototype.getFormattedLabel=function(t,e,n){var i=this.getSetting("useUTC");return function(t,e,n,i,r){var o=null;if(wt(n))o=n;else if(xt(n))o=n(t.value,e,{level:t.level});else{var a=rt({},jh);if(t.level>0)for(var s=0;s=0;--s)if(l[u]){o=l[u];break}o=o||a.none}if(yt(o)){var h=null==t.level?0:t.level>=0?t.level:o.length+t.level;o=o[h=Math.min(h,o.length-1)]}}return Qh(new Date(t.value),o,r,i)}(t,e,n,this.getSetting("locale"),i)},e.prototype.getTicks=function(){var t=this._interval,e=this._extent,n=[];if(!t)return n;n.push({value:e[0],level:0});var i=this.getSetting("useUTC"),r=function(t,e,n,i){var r=1e4,o=Yh,a=0;function s(t,e,n,r,o,a,s){for(var l=new Date(e),u=e,h=l[r]();u1&&0===u&&o.unshift({value:o[0].value-d})}}for(u=0;u=i[0]&&v<=i[1]&&c++)}var _=(i[1]-i[0])/e;if(c>1.5*_&&d>_/1.5)break;if(u.push(g),c>_||t===o[f])break}h=[]}}0;var y=pt(dt(u,(function(t){return pt(t,(function(t){return t.value>=i[0]&&t.value<=i[1]&&!t.notAdd}))})),(function(t){return t.length>0})),x=[],w=y.length-1;for(f=0;fn&&(this._approxInterval=n);var o=hw.length,a=Math.min(function(t,e,n,i){for(;n>>1;t[r][1]16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function dw(t){return(t/=2592e6)>6?6:t>3?3:t>2?2:1}function fw(t){return(t/=Hh)>12?12:t>6?6:t>3.5?4:t>2?2:1}function pw(t,e){return(t/=e?Gh:Vh)>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function gw(t){return ua(t,!0)}function mw(t,e,n){var i=new Date(t);switch(Jh(e)){case"year":case"month":i[hc(n)](0);case"day":i[cc(n)](1);case"hour":i[dc(n)](0);case"minute":i[fc(n)](0);case"second":i[pc(n)](0),i[gc(n)](0)}return i.getTime()}Bx.registerClass(uw);const vw=uw;var _w=Bx.prototype,yw=tw.prototype,xw=Yo,ww=Math.floor,bw=Math.ceil,Tw=Math.pow,Sw=Math.log,Mw=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="log",e.base=10,e._originalScale=new tw,e._interval=0,e}return I(e,t),e.prototype.getTicks=function(t){var e=this._originalScale,n=this._extent,i=e.getExtent();return dt(yw.getTicks.call(this,t),(function(t){var e=t.value,r=Yo(Tw(this.base,e));return r=e===n[0]&&this._fixMin?Lw(r,i[0]):r,{value:r=e===n[1]&&this._fixMax?Lw(r,i[1]):r}}),this)},e.prototype.setExtent=function(t,e){var n=Sw(this.base);t=Sw(Math.max(0,t))/n,e=Sw(Math.max(0,e))/n,yw.setExtent.call(this,t,e)},e.prototype.getExtent=function(){var t=this.base,e=_w.getExtent.call(this);e[0]=Tw(t,e[0]),e[1]=Tw(t,e[1]);var n=this._originalScale.getExtent();return this._fixMin&&(e[0]=Lw(e[0],n[0])),this._fixMax&&(e[1]=Lw(e[1],n[1])),e},e.prototype.unionExtent=function(t){this._originalScale.unionExtent(t);var e=this.base;t[0]=Sw(t[0])/Sw(e),t[1]=Sw(t[1])/Sw(e),_w.unionExtent.call(this,t)},e.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},e.prototype.calcNiceTicks=function(t){t=t||10;var e=this._extent,n=e[1]-e[0];if(!(n===1/0||n<=0)){var i=sa(n);for(t/n*i<=.5&&(i*=10);!isNaN(i)&&Math.abs(i)<1&&Math.abs(i)>0;)i*=10;var r=[Yo(bw(e[0]/i)*i),Yo(ww(e[1]/i)*i)];this._interval=i,this._niceExtent=r}},e.prototype.calcNiceExtent=function(t){yw.calcNiceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return Xx(t=Sw(t)/Sw(this.base),this._extent)},e.prototype.normalize=function(t){return qx(t=Sw(t)/Sw(this.base),this._extent)},e.prototype.scale=function(t){return t=Yx(t,this._extent),Tw(this.base,t)},e.type="log",e}(Bx),Cw=Mw.prototype;function Lw(t,e){return xw(t,Jo(e))}Cw.getMinorTicks=yw.getMinorTicks,Cw.getLabel=yw.getLabel,Bx.registerClass(Mw);const Aw=Mw;var Dw=function(){function t(t,e,n){this._prepareParams(t,e,n)}return t.prototype._prepareParams=function(t,e,n){n[1]0&&s>0&&!l&&(a=0),a<0&&s<0&&!u&&(s=0));var c=this._determinedMin,d=this._determinedMax;return null!=c&&(a=c,l=!0),null!=d&&(s=d,u=!0),{min:a,max:s,minFixed:l,maxFixed:u,isBlank:h}},t.prototype.modifyDataMinMax=function(t,e){this[Pw[t]]=e},t.prototype.setDeterminedMinMax=function(t,e){this[Iw[t]]=e},t.prototype.freeze=function(){this.frozen=!0},t}(),Iw={min:"_determinedMin",max:"_determinedMax"},Pw={min:"_dataMin",max:"_dataMax"};function Ew(t,e,n){var i=t.rawExtentInfo;return i||(i=new Dw(t,e,n),t.rawExtentInfo=i,i)}function Ow(t,e){return null==e?null:Pt(e)?NaN:t.parse(e)}function Nw(t,e){var n=t.type,i=Ew(t,e,t.getExtent()).calculate();t.setBlank(i.isBlank);var r=i.min,o=i.max,a=e.ecModel;if(a&&"time"===n){var s=rw("bar",a),l=!1;if(ct(s,(function(t){l=l||t.getBaseAxis()===e.axis})),l){var u=ow(s),h=function(t,e,n,i){var r=n.axis.getExtent(),o=Math.abs(r[1]-r[0]),a=function(t,e,n){if(t&&e){var i=t[iw(e)];return null!=i&&null!=n?i[nw(n)]:i}}(i,n.axis);if(void 0===a)return{min:t,max:e};var s=1/0;ct(a,(function(t){s=Math.min(t.offset,s)}));var l=-1/0;ct(a,(function(t){l=Math.max(t.offset+t.width,l)})),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=e-t,c=h/(1-(s+l)/o)-h;return e+=c*(l/u),t-=c*(s/u),{min:t,max:e}}(r,o,e,u);r=h.min,o=h.max}}return{extent:[r,o],fixMin:i.minFixed,fixMax:i.maxFixed}}function Rw(t,e){var n=e,i=Nw(t,n),r=i.extent,o=n.get("splitNumber");t instanceof Aw&&(t.base=n.get("logBase"));var a=t.type,s=n.get("interval"),l="interval"===a||"time"===a;t.setExtent(r[0],r[1]),t.calcNiceExtent({splitNumber:o,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?n.get("minInterval"):null,maxInterval:l?n.get("maxInterval"):null}),null!=s&&t.setInterval&&t.setInterval(s)}function kw(t,e){if(e=e||t.get("type"))switch(e){case"category":return new Jx({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:[1/0,-1/0]});case"time":return new vw({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:return new(Bx.getClass(e)||tw)}}function zw(t){var e,n,i=t.getLabelModel().get("formatter"),r="category"===t.type?t.scale.getExtent()[0]:null;return"time"===t.scale.type?(n=i,function(e,i){return t.scale.getFormattedLabel(e,i,n)}):wt(i)?function(e){return function(n){var i=t.scale.getLabel(n);return e.replace("{value}",null!=i?i:"")}}(i):xt(i)?(e=i,function(n,i){return null!=r&&(i=n.value-r),e(Bw(t,n),i,null!=n.level?{level:n.level}:null)}):function(e){return t.scale.getLabel(e)}}function Bw(t,e){return"category"===t.type?t.scale.getLabel(e):e.value}function Fw(t,e){var n=e*Math.PI/180,i=t.width,r=t.height,o=i*Math.abs(Math.cos(n))+Math.abs(r*Math.sin(n)),a=i*Math.abs(Math.sin(n))+Math.abs(r*Math.cos(n));return new _n(t.x,t.y,o,a)}function Vw(t){var e=t.get("interval");return null==e?"auto":e}function Gw(t){return"category"===t.type&&0===Vw(t.getLabelModel())}function Hw(t,e){var n={};return ct(t.mapDimensionsAll(e),(function(e){n[Rx(t,e)]=!0})),mt(n)}var Uw=function(){function t(){}return t.prototype.getNeedCrossZero=function(){return!this.option.scale},t.prototype.getCoordSysModel=function(){},t}();function Ww(t){return kx(null,t)}var jw={isDimensionStacked:Nx,enableDataStack:Ox,getStackedDimension:Rx};function Zw(t,e){var n=e;e instanceof Ih||(n=new Ih(e));var i=kw(n);return i.setExtent(t[0],t[1]),Rw(i,n),i}function Xw(t){ut(t,Uw)}function qw(t,e){return lh(t,null,null,"normal"!==(e=e||{}).state)}var Yw=[],Kw={registerPreprocessor:Ry,registerProcessor:ky,registerPostInit:zy,registerPostUpdate:By,registerUpdateLifecycle:Fy,registerAction:Vy,registerCoordinateSystem:Gy,registerLayout:Uy,registerVisual:Wy,registerTransform:Jy,registerLoading:Xy,registerMap:Yy,registerImpl:function(t,e){L_[t]=e},PRIORITY:k_,ComponentModel:Gc,ComponentView:Dp,SeriesModel:Lp,ChartView:Fm,registerComponentModel:function(t){Gc.registerClass(t)},registerComponentView:function(t){Dp.registerClass(t)},registerSeriesModel:function(t){Lp.registerClass(t)},registerChartView:function(t){Fm.registerClass(t)},registerSubTypeDefaulter:function(t,e){Gc.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){Go(t,e)}};function Jw(t){yt(t)?ct(t,(function(t){Jw(t)})):st(Yw,t)>=0||(Yw.push(t),xt(t)&&(t={install:t}),t.install(Kw))}function $w(t,e){return Math.abs(t-e)<1e-8}function Qw(t,e,n){var i=0,r=t[0];if(!r)return!1;for(var o=1;on&&(t=r,n=a)}if(t)return function(t){for(var e=0,n=0,i=0,r=t.length,o=t[r-1][0],a=t[r-1][1],s=0;s>1^-(1&s),l=l>>1^-(1&l),r=s+=r,o=l+=o,i.push([s/n,l/n])}return i}function ub(t,e){return dt(pt((t=function(t){if(!t.UTF8Encoding)return t;var e=t,n=e.UTF8Scale;return null==n&&(n=1024),ct(e.features,(function(t){var e=t.geometry,i=e.encodeOffsets,r=e.coordinates;if(i)switch(e.type){case"LineString":e.coordinates=lb(r,i,n);break;case"Polygon":case"MultiLineString":sb(r,i,n);break;case"MultiPolygon":ct(r,(function(t,e){return sb(t,i[e],n)}))}})),e.UTF8Encoding=!1,e}(t)).features,(function(t){return t.geometry&&t.properties&&t.geometry.coordinates.length>0})),(function(t){var n=t.properties,i=t.geometry,r=[];switch(i.type){case"Polygon":var o=i.coordinates;r.push(new rb(o[0],o.slice(1)));break;case"MultiPolygon":ct(i.coordinates,(function(t){t[0]&&r.push(new rb(t[0],t.slice(1)))}));break;case"LineString":r.push(new ob([i.coordinates]));break;case"MultiLineString":r.push(new ob(i.coordinates))}var a=new ab(n[e||"name"],r,n.cp);return a.properties=n,a}))}function hb(t,e,n,i,r,o,a,s){return new eu({style:{text:t,font:e,align:n,verticalAlign:i,padding:r,rich:o,overflow:a?"truncate":null,lineHeight:s}}).getBoundingRect()}var cb=Ea();function db(t,e){var n=dt(e,(function(e){return t.scale.parse(e)}));return"time"===t.type&&n.length>0&&(n.sort(),n.unshift(n[0]),n.push(n[n.length-1])),n}function fb(t){var e=t.getLabelModel().get("customValues");if(e){var n=zw(t),i=t.scale.getExtent();return{labels:dt(pt(db(t,e),(function(t){return t>=i[0]&&t<=i[1]})),(function(e){var i={value:e};return{formattedLabel:n(i),rawLabel:t.scale.getLabel(i),tickValue:e}}))}}return"category"===t.type?function(t){var e=t.getLabelModel(),n=gb(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n}(t):function(t){var e=t.scale.getTicks(),n=zw(t);return{labels:dt(e,(function(e,i){return{level:e.level,formattedLabel:n(e,i),rawLabel:t.scale.getLabel(e),tickValue:e.value}}))}}(t)}function pb(t,e){var n=t.getTickModel().get("customValues");if(n){var i=t.scale.getExtent();return{ticks:pt(db(t,n),(function(t){return t>=i[0]&&t<=i[1]}))}}return"category"===t.type?function(t,e){var n,i,r=mb(t,"ticks"),o=Vw(e),a=vb(r,o);if(a)return a;e.get("show")&&!t.scale.isBlank()||(n=[]);if(xt(o))n=xb(t,o,!0);else if("auto"===o){var s=gb(t,t.getLabelModel());i=s.labelCategoryInterval,n=dt(s.labels,(function(t){return t.tickValue}))}else n=yb(t,i=o,!0);return _b(r,o,{ticks:n,tickCategoryInterval:i})}(t,e):{ticks:dt(t.scale.getTicks(),(function(t){return t.value}))}}function gb(t,e){var n,i,r=mb(t,"labels"),o=Vw(e),a=vb(r,o);return a||(xt(o)?n=xb(t,o):(i="auto"===o?function(t){var e=cb(t).autoInterval;return null!=e?e:cb(t).autoInterval=t.calculateCategoryInterval()}(t):o,n=yb(t,i)),_b(r,o,{labels:n,labelCategoryInterval:i}))}function mb(t,e){return cb(t)[e]||(cb(t)[e]=[])}function vb(t,e){for(var n=0;n1&&h/l>2&&(u=Math.round(Math.ceil(u/l)*l));var c=Gw(t),d=a.get("showMinLabel")||c,f=a.get("showMaxLabel")||c;d&&u!==o[0]&&g(o[0]);for(var p=u;p<=o[1];p+=l)g(p);function g(t){var e={value:t};s.push(n?t:{formattedLabel:i(e),rawLabel:r.getLabel(e),tickValue:t})}return f&&p-l!==o[1]&&g(o[1]),s}function xb(t,e,n){var i=t.scale,r=zw(t),o=[];return ct(i.getTicks(),(function(t){var a=i.getLabel(t),s=t.value;e(t.value,a)&&o.push(n?s:{formattedLabel:r(t),rawLabel:a,tickValue:s})})),o}var wb=[0,1],bb=function(){function t(t,e,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=n||[0,0]}return t.prototype.contain=function(t){var e=this._extent,n=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return t>=n&&t<=i},t.prototype.containData=function(t){return this.scale.contain(t)},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(t){return Qo(t||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(t,e){var n=this._extent;n[0]=t,n[1]=e},t.prototype.dataToCoord=function(t,e){var n=this._extent,i=this.scale;return t=i.normalize(t),this.onBand&&"ordinal"===i.type&&Tb(n=n.slice(),i.count()),Xo(t,wb,n,e)},t.prototype.coordToData=function(t,e){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&Tb(n=n.slice(),i.count());var r=Xo(t,n,wb,e);return this.scale.scale(r)},t.prototype.pointToData=function(t,e){},t.prototype.getTicksCoords=function(t){var e=(t=t||{}).tickModel||this.getTickModel(),n=dt(pb(this,e).ticks,(function(t){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(t):t),tickValue:t}}),this);return function(t,e,n,i){var r=e.length;if(!t.onBand||n||!r)return;var o,a,s=t.getExtent();if(1===r)e[0].coord=s[0],o=e[1]={coord:s[1],tickValue:e[0].tickValue};else{var l=e[r-1].tickValue-e[0].tickValue,u=(e[r-1].coord-e[0].coord)/l;ct(e,(function(t){t.coord-=u/2}));var h=t.scale.getExtent();a=1+h[1]-e[r-1].tickValue,o={coord:e[r-1].coord+u*a,tickValue:h[1]+1},e.push(o)}var c=s[0]>s[1];d(e[0].coord,s[0])&&(i?e[0].coord=s[0]:e.shift());i&&d(s[0],e[0].coord)&&e.unshift({coord:s[0]});d(s[1],o.coord)&&(i?o.coord=s[1]:e.pop());i&&d(o.coord,s[1])&&e.push({coord:s[1]});function d(t,e){return t=Yo(t),e=Yo(e),c?t>e:t0&&t<100||(t=5),dt(this.scale.getMinorTicks(t),(function(t){return dt(t,(function(t){return{coord:this.dataToCoord(t),tickValue:t}}),this)}),this)},t.prototype.getViewLabels=function(){return fb(this).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),n=e[1]-e[0]+(this.onBand?1:0);0===n&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},t.prototype.calculateCategoryInterval=function(){return function(t){var e=function(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}(t),n=zw(t),i=(e.axisRotate-e.labelRotate)/180*Math.PI,r=t.scale,o=r.getExtent(),a=r.count();if(o[1]-o[0]<1)return 0;var s=1;a>40&&(s=Math.max(1,Math.floor(a/40)));for(var l=o[0],u=t.dataToCoord(l+1)-t.dataToCoord(l),h=Math.abs(u*Math.cos(i)),c=Math.abs(u*Math.sin(i)),d=0,f=0;l<=o[1];l+=s){var p,g,m=po(n({value:l}),e.font,"center","top");p=1.3*m.width,g=1.3*m.height,d=Math.max(d,p,7),f=Math.max(f,g,7)}var v=d/h,_=f/c;isNaN(v)&&(v=1/0),isNaN(_)&&(_=1/0);var y=Math.max(0,Math.floor(Math.min(v,_))),x=cb(t.model),w=t.getExtent(),b=x.lastAutoInterval,T=x.lastTickCount;return null!=b&&null!=T&&Math.abs(b-y)<=1&&Math.abs(T-a)<=1&&b>y&&x.axisExtent0===w[0]&&x.axisExtent1===w[1]?y=b:(x.lastTickCount=a,x.lastAutoInterval=y,x.axisExtent0=w[0],x.axisExtent1=w[1]),y}(this)},t}();function Tb(t,e){var n=(t[1]-t[0])/e/2;t[0]+=n,t[1]-=n}const Sb=bb;function Mb(t){var e=Gc.extend(t);return Gc.registerClass(e),e}function Cb(t){var e=Dp.extend(t);return Dp.registerClass(e),e}function Lb(t){var e=Lp.extend(t);return Lp.registerClass(e),e}function Ab(t){var e=Fm.extend(t);return Fm.registerClass(e),e}var Db=2*Math.PI,Ib=il.CMD,Pb=["top","right","bottom","left"];function Eb(t,e,n,i,r){var o=n.width,a=n.height;switch(t){case"top":i.set(n.x+o/2,n.y-e),r.set(0,-1);break;case"bottom":i.set(n.x+o/2,n.y+a+e),r.set(0,1);break;case"left":i.set(n.x-e,n.y+a/2),r.set(-1,0);break;case"right":i.set(n.x+o+e,n.y+a/2),r.set(1,0)}}function Ob(t,e,n,i,r,o,a,s,l){a-=t,s-=e;var u=Math.sqrt(a*a+s*s),h=(a/=u)*n+t,c=(s/=u)*n+e;if(Math.abs(i-r)%Db<1e-4)return l[0]=h,l[1]=c,u-n;if(o){var d=i;i=ll(r),r=ll(d)}else i=ll(i),r=ll(r);i>r&&(r+=Db);var f=Math.atan2(s,a);if(f<0&&(f+=Db),f>=i&&f<=r||f+Db>=i&&f+Db<=r)return l[0]=h,l[1]=c,u-n;var p=n*Math.cos(i)+t,g=n*Math.sin(i)+e,m=n*Math.cos(r)+t,v=n*Math.sin(r)+e,_=(p-a)*(p-a)+(g-s)*(g-s),y=(m-a)*(m-a)+(v-s)*(v-s);return _0))return;e=e/180*Math.PI,Fb.fromArray(t[0]),Vb.fromArray(t[1]),Gb.fromArray(t[2]),ln.sub(Hb,Fb,Vb),ln.sub(Ub,Gb,Vb);var n=Hb.len(),i=Ub.len();if(n<.001||i<.001)return;Hb.scale(1/n),Ub.scale(1/i);var r=Hb.dot(Ub);if(Math.cos(e)1&&ln.copy(Zb,Gb),Zb.toArray(t[1])}}(o,e.get("minTurnAngle")),n.setShape({points:o})}}}var jb=[],Zb=new ln;function Xb(t,e,n,i){var r="normal"===n,o=r?t:t.ensureState(n);o.ignore=e;var a=i.get("smooth");a&&!0===a&&(a=.3),o.shape=o.shape||{},a>0&&(o.shape.smooth=a);var s=i.getModel("lineStyle").getLineStyle();r?t.useStyle(s):o.style=s}function qb(t,e){var n=e.smooth,i=e.points;if(i)if(t.moveTo(i[0][0],i[0][1]),n>0&&i.length>=3){var r=ge(i[0],i[1]),o=ge(i[1],i[2]);if(!r||!o)return t.lineTo(i[1][0],i[1][1]),void t.lineTo(i[2][0],i[2][1]);var a=Math.min(r,o)*n,s=ye([],i[1],i[0],a/r),l=ye([],i[1],i[2],a/o),u=ye([],s,l,.5);t.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var h=1;h0&&o&&b(-c/a,0,a);var m,v,_=t[0],y=t[a-1];return x(),m<0&&T(-m,.8),v<0&&T(v,.8),x(),w(m,v,1),w(v,m,-1),x(),m<0&&S(-m),v<0&&S(v),u}function x(){m=_.rect[e]-i,v=r-y.rect[e]-y.rect[n]}function w(t,e,n){if(t<0){var i=Math.min(e,-t);if(i>0){b(i*n,0,a);var r=i+t;r<0&&T(-r*n,1)}else T(-t*n,1)}}function b(n,i,r){0!==n&&(u=!0);for(var o=i;o0)for(l=0;l0;l--){b(-(o[l-1]*c),l,a)}}}function S(t){var e=t<0?-1:1;t=Math.abs(t);for(var n=Math.ceil(t/(a-1)),i=0;i0?b(n,0,i+1):b(-n,a-i-1,a),(t-=n)<=0)return}}function Jb(t){var e=[];t.sort((function(t,e){return e.priority-t.priority}));var n=new _n(0,0,0,0);function i(t){if(!t.ignore){var e=t.ensureState("emphasis");null==e.ignore&&(e.ignore=!1)}t.ignore=!0}for(var r=0;r=0&&n.attr(f.oldLayoutSelect),st(u,"emphasis")>=0&&n.attr(f.oldLayoutEmphasis)),Ju(n,s,e,a)}else if(n.attr(s),!gh(n).valueAnimation){var h=Ot(n.style.opacity,1);n.style.opacity=0,$u(n,{style:{opacity:h}},e,a)}if(f.oldLayout=s,n.states.select){var c=f.oldLayoutSelect={};rT(c,s,oT),rT(c,n.states.select,oT)}if(n.states.emphasis){var d=f.oldLayoutEmphasis={};rT(d,s,oT),rT(d,n.states.emphasis,oT)}mh(n,a,l,e,e)}if(i&&!i.ignore&&!i.invisible){r=(f=iT(i)).oldLayout;var f,p={points:i.shape.points};r?(i.attr({shape:r}),Ju(i,{shape:p},e)):(i.setShape(p),i.style.strokePercent=0,$u(i,{style:{strokePercent:1}},e)),f.oldLayout=p}},t}();var sT=Ea();function lT(t){t.registerUpdateLifecycle("series:beforeupdate",(function(t,e,n){var i=sT(e).labelManager;i||(i=sT(e).labelManager=new aT),i.clearLabels()})),t.registerUpdateLifecycle("series:layoutlabels",(function(t,e,n){var i=sT(e).labelManager;n.updatedSeries.forEach((function(t){i.addLabelsOfSeries(e.getViewOfSeriesModel(t))})),i.updateLayoutConfig(e),i.layout(e),i.processLabelsOverall()}))}function uT(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.eachSeriesByType("graph",(function(t){var n=t.getCategoriesData(),i=t.getGraph().data,r=n.mapArray(n.getName);i.filterSelf((function(t){var n=i.getItemModel(t).getShallow("category");if(null!=n){Tt(n)&&(n=r[n]);for(var o=0;oi&&(i=e);var o=i%2?i+2:i+3;r=[];for(var a=0;a0?+d:1;C.scaleX=this._sizeX*L,C.scaleY=this._sizeY*L,this.setSymbolScale(1),Uu(this,l,u,h)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,e,n){var i=this.childAt(0),r=nu(this).dataIndex,o=n&&n.animation;if(this.silent=i.silent=!0,n&&n.fadeLabel){var a=i.getTextContent();a&&th(a,{style:{opacity:0}},e,{dataIndex:r,removeOpt:o,cb:function(){i.removeTextContent()}})}else i.removeTextContent();th(i,{style:{opacity:0},scaleX:0,scaleY:0},e,{dataIndex:r,cb:t,removeOpt:o})},e.getSymbolSize=function(t,e){return Zv(t.getItemVisual(e,"symbolSize"))},e}(Eo);function FT(t,e){this.parent.drift(t,e)}const VT=BT;function GT(t,e,n,i){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(i.isIgnore&&i.isIgnore(n))&&!(i.clipShape&&!i.clipShape.contain(e[0],e[1]))&&"none"!==t.getItemVisual(n,"symbol")}function HT(t){return null==t||St(t)||(t={isIgnore:t}),t||{}}function UT(t){var e=t.hostModel,n=e.getModel("emphasis");return{emphasisItemStyle:n.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:n.get("focus"),blurScope:n.get("blurScope"),emphasisDisabled:n.get("disabled"),hoverScale:n.get("scale"),labelStatesModels:sh(e),cursorStyle:e.get("cursor")}}var WT=function(){function t(t){this.group=new Eo,this._SymbolCtor=t||VT}return t.prototype.updateData=function(t,e){this._progressiveEls=null,e=HT(e);var n=this.group,i=t.hostModel,r=this._data,o=this._SymbolCtor,a=e.disableAnimation,s=UT(t),l={disableAnimation:a},u=e.getSymbolPoint||function(e){return t.getItemLayout(e)};r||n.removeAll(),t.diff(r).add((function(i){var r=u(i);if(GT(t,r,i,e)){var a=new o(t,i,s,l);a.setPosition(r),t.setItemGraphicEl(i,a),n.add(a)}})).update((function(h,c){var d=r.getItemGraphicEl(c),f=u(h);if(GT(t,f,h,e)){var p=t.getItemVisual(h,"symbol")||"circle",g=d&&d.getSymbolType&&d.getSymbolType();if(!d||g&&g!==p)n.remove(d),(d=new o(t,h,s,l)).setPosition(f);else{d.updateData(t,h,s,l);var m={x:f[0],y:f[1]};a?d.attr(m):Ju(d,m,i)}n.add(d),t.setItemGraphicEl(h,d)}else n.remove(d)})).remove((function(t){var e=r.getItemGraphicEl(t);e&&e.fadeOut((function(){n.remove(e)}),i)})).execute(),this._getSymbolPoint=u,this._data=t},t.prototype.updateLayout=function(){var t=this,e=this._data;e&&e.eachItemGraphicEl((function(e,n){var i=t._getSymbolPoint(n);e.setPosition(i),e.markRedraw()}))},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=UT(t),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e,n){function i(t){t.isGroup||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],n=HT(n);for(var r=t.start;r0&&(_[0]=-_[0],_[1]=-_[1]);var x=v[0]<0?-1:1;if("start"!==i.__position&&"end"!==i.__position){var w=-Math.atan2(v[1],v[0]);u[0].8?"left":h[0]<-.8?"right":"center",d=h[1]>.8?"top":h[1]<-.8?"bottom":"middle";break;case"start":i.x=-h[0]*p+l[0],i.y=-h[1]*g+l[1],c=h[0]>.8?"right":h[0]<-.8?"left":"center",d=h[1]>.8?"bottom":h[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":i.x=p*x+l[0],i.y=l[1]+b,c=v[0]<0?"right":"left",i.originX=-p*x,i.originY=-b;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":i.x=y[0],i.y=y[1]+b,c="center",i.originY=-b;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":i.x=-p*x+u[0],i.y=u[1]+b,c=v[0]>=0?"right":"left",i.originX=p*x,i.originY=-b}i.scaleX=i.scaleY=r,i.setStyle({verticalAlign:i.__verticalAlign||d,align:i.__align||c})}}}function T(t,e){var n=t.__specifiedRotation;if(null==n){var i=a.tangentAt(e);t.attr("rotation",(1===e?-1:1)*Math.PI/2-Math.atan2(i[1],i[0]))}else t.attr("rotation",n)}},e}(Eo);const iS=nS;function rS(t){var e=t.hostModel,n=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:n.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:n.get("disabled"),blurScope:n.get("blurScope"),focus:n.get("focus"),labelStatesModels:sh(e)}}function oS(t){return isNaN(t[0])||isNaN(t[1])}function aS(t){return t&&!oS(t[0])&&!oS(t[1])}const sS=function(){function t(t){this.group=new Eo,this._LineCtor=t||iS}return t.prototype.updateData=function(t){var e=this;this._progressiveEls=null;var n=this,i=n.group,r=n._lineData;n._lineData=t,r||i.removeAll();var o=rS(t);t.diff(r).add((function(n){e._doAdd(t,n,o)})).update((function(n,i){e._doUpdate(r,t,i,n,o)})).remove((function(t){i.remove(r.getItemGraphicEl(t))})).execute()},t.prototype.updateLayout=function(){var t=this._lineData;t&&t.eachItemGraphicEl((function(e,n){e.updateLayout(t,n)}),this)},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=rS(t),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e){function n(t){t.isGroup||function(t){return t.animators&&t.animators.length>0}(t)||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var i=t.start;i3?1.4:r>1?1.2:1.1;dS(this,"zoom","zoomOnMouseWheel",t,{scale:i>0?s:1/s,originX:o,originY:a,isAvailableBehavior:null})}if(n){var l=Math.abs(i);dS(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:(i>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:o,originY:a,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(t){uS(this._zr,"globalPan")||dS(this,"zoom",null,t,{scale:t.pinchScale>1?1.1:1/1.1,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})},e}(Le);function dS(t,e,n,i,r){t.pointerChecker&&t.pointerChecker(i,r.originX,r.originY)&&(Ze(i.event),fS(t,e,n,i,r))}function fS(t,e,n,i,r){r.isAvailableBehavior=vt(pS,null,n,i),t.trigger(e,r)}function pS(t,e,n){var i=n[t];return!t||i&&(!wt(i)||e.event[i+"Key"])}const gS=cS;var mS={axisPointer:1,tooltip:1,brush:1};function vS(t,e,n){var i=e.getComponentByElement(t.topTarget),r=i&&i.coordinateSystem;return i&&i!==n&&!mS.hasOwnProperty(i.mainType)&&r&&r.model!==n}var _S=[],yS=[],xS=[],wS=hi,bS=ve,TS=Math.abs;function SS(t,e,n){for(var i,r=t[0],o=t[1],a=t[2],s=1/0,l=n*n,u=.1,h=.1;h<=.9;h+=.1){_S[0]=wS(r[0],o[0],a[0],h),_S[1]=wS(r[1],o[1],a[1],h),(f=TS(bS(_S,e)-l))=0?i+=u:i-=u:p>=0?i-=u:i+=u}return i}function MS(t,e){var n=[],i=fi,r=[[],[],[]],o=[[],[]],a=[];e/=2,t.eachEdge((function(t,s){var l=t.getLayout(),u=t.getVisual("fromSymbol"),h=t.getVisual("toSymbol");l.__original||(l.__original=[te(l[0]),te(l[1])],l[2]&&l.__original.push(te(l[2])));var c=l.__original;if(null!=l[2]){if(Qt(r[0],c[0]),Qt(r[1],c[2]),Qt(r[2],c[1]),u&&"none"!==u){var d=ST(t.node1),f=SS(r,c[0],d*e);i(r[0][0],r[1][0],r[2][0],f,n),r[0][0]=n[3],r[1][0]=n[4],i(r[0][1],r[1][1],r[2][1],f,n),r[0][1]=n[3],r[1][1]=n[4]}if(h&&"none"!==h){d=ST(t.node2),f=SS(r,c[1],d*e);i(r[0][0],r[1][0],r[2][0],f,n),r[1][0]=n[1],r[2][0]=n[2],i(r[0][1],r[1][1],r[2][1],f,n),r[1][1]=n[1],r[2][1]=n[2]}Qt(l[0],r[0]),Qt(l[1],r[2]),Qt(l[2],r[1])}else{if(Qt(o[0],c[0]),Qt(o[1],c[1]),re(a,o[1],o[0]),fe(a,a),u&&"none"!==u){d=ST(t.node1);ie(o[0],o[0],a,d*e)}if(h&&"none"!==h){d=ST(t.node2);ie(o[1],o[1],a,-d*e)}Qt(l[0],o[0]),Qt(l[1],o[1])}}))}function CS(t){return"view"===t.type}var LS=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return I(e,t),e.prototype.init=function(t,e){var n=new jT,i=new sS,r=this.group;this._controller=new gS(e.getZr()),this._controllerHost={target:r},r.add(n.group),r.add(i.group),this._symbolDraw=n,this._lineDraw=i,this._firstRender=!0},e.prototype.render=function(t,e,n){var i=this,r=t.coordinateSystem;this._model=t;var o=this._symbolDraw,a=this._lineDraw,s=this.group;if(CS(r)){var l={x:r.x,y:r.y,scaleX:r.scaleX,scaleY:r.scaleY};this._firstRender?s.attr(l):Ju(s,l,t)}MS(t.getGraph(),TT(t));var u=t.getData();o.updateData(u);var h=t.getEdgeData();a.updateData(h),this._updateNodeAndLinkScale(),this._updateController(t,e,n),clearTimeout(this._layoutTimeout);var c=t.forceLayout,d=t.get(["force","layoutAnimation"]);c&&this._startForceLayoutIteration(c,d);var f=t.get("layout");u.graph.eachNode((function(e){var n=e.dataIndex,r=e.getGraphicEl(),o=e.getModel();if(r){r.off("drag").off("dragend");var a=o.get("draggable");a&&r.on("drag",(function(o){switch(f){case"force":c.warmUp(),!i._layouting&&i._startForceLayoutIteration(c,d),c.setFixed(n),u.setItemLayout(n,[r.x,r.y]);break;case"circular":u.setItemLayout(n,[r.x,r.y]),e.setLayout({fixed:!0},!0),LT(t,"symbolSize",e,[o.offsetX,o.offsetY]),i.updateLayout(t);break;default:u.setItemLayout(n,[r.x,r.y]),wT(t.getGraph(),t),i.updateLayout(t)}})).on("dragend",(function(){c&&c.setUnfixed(n)})),r.setDraggable(a,!!o.get("cursor")),"adjacency"===o.get(["emphasis","focus"])&&(nu(r).focus=e.getAdjacentDataIndices())}})),u.graph.eachEdge((function(t){var e=t.getGraphicEl(),n=t.getModel().get(["emphasis","focus"]);e&&"adjacency"===n&&(nu(e).focus={edge:[t.dataIndex],node:[t.node1.dataIndex,t.node2.dataIndex]})}));var p="circular"===t.get("layout")&&t.get(["circular","rotateLabel"]),g=u.getLayout("cx"),m=u.getLayout("cy");u.graph.eachNode((function(t){DT(t,p,g,m)})),this._firstRender=!1},e.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype._startForceLayoutIteration=function(t,e){var n=this;!function i(){t.step((function(t){n.updateLayout(n._model),(n._layouting=!t)&&(e?n._layoutTimeout=setTimeout(i,16):i())}))}()},e.prototype._updateController=function(t,e,n){var i=this,r=this._controller,o=this._controllerHost,a=this.group;r.setPointerChecker((function(e,i,r){var o=a.getBoundingRect();return o.applyTransform(a.transform),o.contain(i,r)&&!vS(e,n,t)})),CS(t.coordinateSystem)?(r.enable(t.get("roam")),o.zoomLimit=t.get("scaleLimit"),o.zoom=t.coordinateSystem.getZoom(),r.off("pan").off("zoom").on("pan",(function(e){!function(t,e,n){var i=t.target;i.x+=e,i.y+=n,i.dirty()}(o,e.dx,e.dy),n.dispatchAction({seriesId:t.id,type:"graphRoam",dx:e.dx,dy:e.dy})})).on("zoom",(function(e){!function(t,e,n,i){var r=t.target,o=t.zoomLimit,a=t.zoom=t.zoom||1;if(a*=e,o){var s=o.min||0,l=o.max||1/0;a=Math.max(Math.min(l,a),s)}var u=a/t.zoom;t.zoom=a,r.x-=(n-r.x)*(u-1),r.y-=(i-r.y)*(u-1),r.scaleX*=u,r.scaleY*=u,r.dirty()}(o,e.scale,e.originX,e.originY),n.dispatchAction({seriesId:t.id,type:"graphRoam",zoom:e.scale,originX:e.originX,originY:e.originY}),i._updateNodeAndLinkScale(),MS(t.getGraph(),TT(t)),i._lineDraw.updateLayout(),n.updateLabelLayout()}))):r.disable()},e.prototype._updateNodeAndLinkScale=function(){var t=this._model,e=t.getData(),n=TT(t);e.eachItemGraphicEl((function(t,e){t&&t.setSymbolScale(n)}))},e.prototype.updateLayout=function(t){MS(t.getGraph(),TT(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},e.prototype.remove=function(){clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},e.type="graph",e}(Fm);const AS=LS;function DS(t){return"_EC_"+t}var IS=function(){function t(t){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=t||!1}return t.prototype.isDirected=function(){return this._directed},t.prototype.addNode=function(t,e){t=null==t?""+e:""+t;var n=this._nodesMap;if(!n[DS(t)]){var i=new PS(t,e);return i.hostGraph=this,this.nodes.push(i),n[DS(t)]=i,i}},t.prototype.getNodeByIndex=function(t){var e=this.data.getRawIndex(t);return this.nodes[e]},t.prototype.getNodeById=function(t){return this._nodesMap[DS(t)]},t.prototype.addEdge=function(t,e,n){var i=this._nodesMap,r=this._edgesMap;if(Tt(t)&&(t=this.nodes[t]),Tt(e)&&(e=this.nodes[e]),t instanceof PS||(t=i[DS(t)]),e instanceof PS||(e=i[DS(e)]),t&&e){var o=t.id+"-"+e.id,a=new ES(t,e,n);return a.hostGraph=this,this._directed&&(t.outEdges.push(a),e.inEdges.push(a)),t.edges.push(a),t!==e&&e.edges.push(a),this.edges.push(a),r[o]=a,a}},t.prototype.getEdgeByIndex=function(t){var e=this.edgeData.getRawIndex(t);return this.edges[e]},t.prototype.getEdge=function(t,e){t instanceof PS&&(t=t.id),e instanceof PS&&(e=e.id);var n=this._edgesMap;return this._directed?n[t+"-"+e]:n[t+"-"+e]||n[e+"-"+t]},t.prototype.eachNode=function(t,e){for(var n=this.nodes,i=n.length,r=0;r=0&&t.call(e,n[r],r)},t.prototype.eachEdge=function(t,e){for(var n=this.edges,i=n.length,r=0;r=0&&n[r].node1.dataIndex>=0&&n[r].node2.dataIndex>=0&&t.call(e,n[r],r)},t.prototype.breadthFirstTraverse=function(t,e,n,i){if(e instanceof PS||(e=this._nodesMap[DS(e)]),e){for(var r="out"===n?"outEdges":"in"===n?"inEdges":"edges",o=0;o=0&&n.node2.dataIndex>=0}));for(r=0,o=i.length;r=0&&this[t][e].setItemVisual(this.dataIndex,n,i)},getVisual:function(n){return this[t][e].getItemVisual(this.dataIndex,n)},setLayout:function(n,i){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,n,i)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}}ut(PS,OS("hostGraph","data")),ut(ES,OS("hostGraph","edgeData"));const NS=IS;var RS=Ea();function kS(t,e){if(RS(i=this).mainData===i){var n=rt({},RS(this).datas);n[this.dataType]=e,GS(e,n,t)}else HS(e,this.dataType,RS(this).mainData,t);var i;return e}function zS(t,e){return t.struct&&t.struct.update(),e}function BS(t,e){return ct(RS(e).datas,(function(n,i){n!==e&&HS(n.cloneShallow(),i,e,t)})),e}function FS(t){var e=RS(this).mainData;return null==t||null==e?e:RS(e).datas[t]}function VS(){var t=RS(this).mainData;return null==t?[{data:t}]:dt(mt(RS(t).datas),(function(e){return{type:e,data:RS(t).datas[e]}}))}function GS(t,e,n){RS(t).datas={},ct(e,(function(e,i){HS(e,i,t,n)}))}function HS(t,e,n,i){RS(n).datas[e]=t,RS(t).mainData=n,t.dataType=e,i.struct&&(t[i.structAttr]=i.struct,i.struct[i.datasAttr[e]]=t),t.getLinkedData=FS,t.getLinkedDataAll=VS}const US=function(t){var e=t.mainData,n=t.datas;n||(n={main:e},t.datasAttr={main:"data"}),t.datas=t.mainData=null,GS(e,n,t),ct(n,(function(n){ct(e.TRANSFERABLE_METHODS,(function(e){n.wrapMethod(e,_t(kS,t))}))})),e.wrapMethod("cloneShallow",_t(BS,t)),ct(e.CHANGABLE_METHODS,(function(n){e.wrapMethod(n,_t(zS,t))})),zt(n[e.dataType]===e)};var WS=function(){function t(t,e){this._getDataWithEncodedVisual=t,this._getRawData=e}return t.prototype.getAllNames=function(){var t=this._getRawData();return t.mapArray(t.getName)},t.prototype.containName=function(t){return this._getRawData().indexOfName(t)>=0},t.prototype.indexOfName=function(t){return this._getDataWithEncodedVisual().indexOfName(t)},t.prototype.getItemVisual=function(t,e){return this._getDataWithEncodedVisual().getItemVisual(t,e)},t}();const jS=WS;var ZS=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return I(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments);var n=this;function i(){return n._categoriesData}this.legendVisualProvider=new jS(i,i),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},e.prototype.mergeDefaultAndTheme=function(e){t.prototype.mergeDefaultAndTheme.apply(this,arguments),wa(e,"edgeLabel",["show"])},e.prototype.getInitialData=function(t,e){var n,i=t.edges||t.links||[],r=t.data||t.nodes||[],o=this;if(r&&i){pT(n=this)&&(n.__curvenessList=[],n.__edgeMap={},gT(n));var a=function(t,e,n,i,r){for(var o=new NS(i),a=0;a "+d)),u++)}var f,p=n.get("coordinateSystem");if("cartesian2d"===p||"polar"===p)f=kx(t,n);else{var g=Td.get(p),m=g&&g.dimensions||[];st(m,"value")<0&&m.concat(["value"]);var v=Ax(t,{coordDimensions:m,encodeDefine:n.getEncode()}).dimensions;(f=new Cx(v,n)).initData(t)}var _=new Cx(["value"],n);return _.initData(l,s),r&&r(f,_),US({mainData:f,struct:o,structAttr:"graph",datas:{node:f,edge:_},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o}(r,i,this,!0,(function(t,e){t.wrapMethod("getItemModel",(function(t){var e=o._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t}));var n=Ih.prototype.getModel;function i(t,e){var i=n.call(this,t,e);return i.resolveParentPath=r,i}function r(t){if(t&&("label"===t[0]||"label"===t[1])){var e=t.slice();return"label"===t[0]?e[0]="edgeLabel":"label"===t[1]&&(e[1]="edgeLabel"),e}return t}e.wrapMethod("getItemModel",(function(t){return t.resolveParentPath=r,t.getModel=i,t}))}));return ct(a.edges,(function(t){!function(t,e,n,i){if(pT(n)){var r=mT(t,e,n),o=n.__edgeMap,a=o[vT(r)];o[r]&&!a?o[r].isForward=!0:a&&o[r]&&(a.isForward=!0,o[r].isForward=!1),o[r]=o[r]||[],o[r].push(i)}}(t.node1,t.node2,this,t.dataIndex)}),this),a.data}},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.getCategoriesData=function(){return this._categoriesData},e.prototype.formatTooltip=function(t,e,n){if("edge"===n){var i=this.getData(),r=this.getDataParams(t,n),o=i.graph.getEdgeByIndex(t),a=i.getName(o.node1.dataIndex),s=i.getName(o.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),op("nameValue",{name:l.join(" > "),value:r.value,noValue:null==r.value})}return mp({series:this,dataIndex:t,multipleSeries:e})},e.prototype._updateCategoriesData=function(){var t=dt(this.option.categories||[],(function(t){return null!=t.value?t:rt({value:0},t)})),e=new Cx(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray((function(t){return e.getItemModel(t)}))},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.isAnimationEnabled=function(){return t.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},e.type="series.graph",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.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:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(Lp);const XS=ZS;function qS(t,e){return t.pointToProjected?t.pointToProjected(e):t.pointToData(e)}var YS={type:"graphRoam",event:"graphRoam",update:"none"};function KS(t,e){var n=e.rippleEffectColor||e.color;t.eachChild((function(t){t.attr({z:e.z,zlevel:e.zlevel,style:{stroke:"stroke"===e.brushType?n:null,fill:"fill"===e.brushType?n:null}})}))}var JS=function(t){function e(e,n){var i=t.call(this)||this,r=new VT(e,n),o=new Eo;return i.add(r),i.add(o),i.updateData(e,n),i}return I(e,t),e.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},e.prototype.startEffectAnimation=function(t){for(var e=t.symbolType,n=t.color,i=t.rippleNumber,r=this.childAt(1),o=0;o0&&(o=this._getLineLength(i)/l*1e3),o!==this._period||a!==this._loop||s!==this._roundTrip){i.stopAnimation();var h=void 0;h=xt(u)?u(n):u,i.__t>0&&(h=-o*i.__t),this._animateSymbol(i,o,h,a,s)}this._period=o,this._loop=a,this._roundTrip=s}},e.prototype._animateSymbol=function(t,e,n,i,r){if(e>0){t.__t=0;var o=this,a=t.animate("",i).when(r?2*e:e,{__t:r?2:1}).delay(n).during((function(){o._updateSymbolPosition(t)}));i||a.done((function(){o.remove(t)})),a.start()}},e.prototype._getLineLength=function(t){return ge(t.__p1,t.__cp1)+ge(t.__cp1,t.__p2)},e.prototype._updateAnimationPoints=function(t,e){t.__p1=e[0],t.__p2=e[1],t.__cp1=e[2]||[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]},e.prototype.updateData=function(t,e,n){this.childAt(0).updateData(t,e,n),this._updateEffectSymbol(t,e)},e.prototype._updateSymbolPosition=function(t){var e=t.__p1,n=t.__p2,i=t.__cp1,r=t.__t<1?t.__t:2-t.__t,o=[t.x,t.y],a=o.slice(),s=hi,l=ci;o[0]=s(e[0],i[0],n[0],r),o[1]=s(e[1],i[1],n[1],r);var u=t.__t<1?l(e[0],i[0],n[0],r):l(n[0],i[0],e[0],1-r),h=t.__t<1?l(e[1],i[1],n[1],r):l(n[1],i[1],e[1],1-r);t.rotation=-Math.atan2(h,u)-Math.PI/2,"line"!==this._symbolType&&"rect"!==this._symbolType&&"roundRect"!==this._symbolType||(void 0!==t.__lastT&&t.__lastT=0&&!(i[o]<=e);o--);o=Math.min(o,r-2)}else{for(o=a;oe);o++);o=Math.min(o-1,r-2)}var s=(e-i[o])/(i[o+1]-i[o]),l=n[o],u=n[o+1];t.x=l[0]*(1-s)+s*u[0],t.y=l[1]*(1-s)+s*u[1];var h=t.__t<1?u[0]-l[0]:l[0]-u[0],c=t.__t<1?u[1]-l[1]:l[1]-u[1];t.rotation=-Math.atan2(c,h)-Math.PI/2,this._lastFrame=o,this._lastFramePercent=e,t.ignore=!1}},e}(oM);const uM=lM;var hM=function(){this.polyline=!1,this.curveness=0,this.segs=[]},cM=function(t){function e(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return I(e,t),e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new hM},e.prototype.buildPath=function(t,e){var n,i=e.segs,r=e.curveness;if(e.polyline)for(n=this._off;n0){t.moveTo(i[n++],i[n++]);for(var a=1;a0){var c=(s+u)/2-(l-h)*r,d=(l+h)/2-(u-s)*r;t.quadraticCurveTo(c,d,u,h)}else t.lineTo(u,h)}this.incremental&&(this._off=n,this.notClear=!0)},e.prototype.findDataIndex=function(t,e){var n=this.shape,i=n.segs,r=n.curveness,o=this.style.lineWidth;if(n.polyline)for(var a=0,s=0;s0)for(var u=i[s++],h=i[s++],c=1;c0){if(al(u,h,(u+d)/2-(h-f)*r,(h+f)/2-(d-u)*r,d,f,o,t,e))return a}else if(rl(u,h,d,f,o,t,e))return a;a++}return-1},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect();return t=n[0],e=n[1],i.contain(t,e)?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape.segs,n=1/0,i=1/0,r=-1/0,o=-1/0,a=0;a0&&(o.dataIndex=n+t.__startIndex)}))},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}();var fM={seriesType:"lines",plan:Ip(),reset:function(t){var e=t.coordinateSystem;if(e){var n=t.get("polyline"),i=t.pipelineContext.large;return{progress:function(r,o){var a=[];if(i){var s=void 0,l=r.end-r.start;if(n){for(var u=0,h=r.start;h0&&(l||s.configLayer(o,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(a/10+.9,1),0)})),r.updateData(i);var u=t.get("clip",!0)&&gM(t.coordinateSystem,!1,t);u?this.group.setClipPath(u):this.group.removeClipPath(),this._lastZlevel=o,this._finished=!0},e.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData();this._updateLineDraw(i,t).incrementalPrepareUpdate(i),this._clearLayer(n),this._finished=!1},e.prototype.incrementalRender=function(t,e,n){this._lineDraw.incrementalUpdate(t,e.getData()),this._finished=t.end===e.getData().count()},e.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},e.prototype.updateTransform=function(t,e,n){var i=t.getData(),r=t.pipelineContext;if(!this._finished||r.large||r.progressiveRender)return{update:!0};var o=pM.reset(t,e,n);o.progress&&o.progress({start:0,end:i.count(),count:i.count()},i),this._lineDraw.updateLayout(),this._clearLayer(n)},e.prototype._updateLineDraw=function(t,e){var n=this._lineDraw,i=this._showEffect(e),r=!!e.get("polyline"),o=e.pipelineContext.large;return n&&i===this._hasEffet&&r===this._isPolyline&&o===this._isLargeDraw||(n&&n.remove(),n=this._lineDraw=o?new dM:new sS(r?i?uM:sM:i?oM:iS),this._hasEffet=i,this._isPolyline=r,this._isLargeDraw=o),this.group.add(n.group),n},e.prototype._showEffect=function(t){return!!t.get(["effect","show"])},e.prototype._clearLayer=function(t){var e=t.getZr();"svg"===e.painter.getType()||null==this._lastZlevel||e.painter.getLayer(this._lastZlevel).clear(!0)},e.prototype.remove=function(t,e){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(e)},e.prototype.dispose=function(t,e){this.remove(t,e)},e.type="lines",e}(Fm);var vM="undefined"==typeof Uint32Array?Array:Uint32Array,_M="undefined"==typeof Float64Array?Array:Float64Array;function yM(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(t.data=dt(e,(function(t){var e={coords:[t[0].coord,t[1].coord]};return t[0].name&&(e.fromName=t[0].name),t[1].name&&(e.toName=t[1].name),it([e,t[0],t[1]])})))}var xM=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.visualStyleAccessPath="lineStyle",n.visualDrawType="stroke",n}return I(e,t),e.prototype.init=function(e){e.data=e.data||[],yM(e);var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count)),t.prototype.init.apply(this,arguments)},e.prototype.mergeOption=function(e){if(yM(e),e.data){var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count))}t.prototype.mergeOption.apply(this,arguments)},e.prototype.appendData=function(t){var e=this._processFlatCoordsArray(t.data);e.flatCoords&&(this._flatCoords?(this._flatCoords=Zt(this._flatCoords,e.flatCoords),this._flatCoordsOffset=Zt(this._flatCoordsOffset,e.flatCoordsOffset)):(this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset),t.data=new Float32Array(e.count)),this.getRawData().appendData(t.data)},e.prototype._getCoordsFromItemModel=function(t){var e=this.getData().getItemModel(t);return e.option instanceof Array?e.option:e.getShallow("coords")},e.prototype.getLineCoordsCount=function(t){return this._flatCoordsOffset?this._flatCoordsOffset[2*t+1]:this._getCoordsFromItemModel(t).length},e.prototype.getLineCoords=function(t,e){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*t],i=this._flatCoordsOffset[2*t+1],r=0;r ")})},e.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},e.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},e.prototype.getZLevelKey=function(){var t=this.getModel("effect"),e=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&e>0?e+"":""},e.type="series.lines",e.dependencies=["grid","polar","geo","calendar"],e.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}},e}(Lp);const wM=xM;function bM(t){return t instanceof Array||(t=[t,t]),t}const TM={seriesType:"lines",reset:function(t){var e=bM(t.get("symbol")),n=bM(t.get("symbolSize")),i=t.getData();return i.setVisual("fromSymbol",e&&e[0]),i.setVisual("toSymbol",e&&e[1]),i.setVisual("fromSymbolSize",n&&n[0]),i.setVisual("toSymbolSize",n&&n[1]),{dataEach:i.hasItemOption?function(t,e){var n=t.getItemModel(e),i=bM(n.getShallow("symbol",!0)),r=bM(n.getShallow("symbolSize",!0));i[0]&&t.setItemVisual(e,"fromSymbol",i[0]),i[1]&&t.setItemVisual(e,"toSymbol",i[1]),r[0]&&t.setItemVisual(e,"fromSymbolSize",r[0]),r[1]&&t.setItemVisual(e,"toSymbolSize",r[1])}:null}}};const SM=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return I(e,t),e.prototype.getInitialData=function(t,e){return kx(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?5e3:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?1e4:this.get("progressiveThreshold"):t},e.prototype.brushSelector=function(t,e,n){return n.point(e.getItemLayout(t))},e.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},e}(Lp);var MM=function(){},CM=function(t){function e(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return I(e,t),e.prototype.getDefaultShape=function(){return new MM},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(t,e){var n,i=e.points,r=e.size,o=this.symbolProxy,a=o.shape,s=t.getContext?t.getContext():t,l=s&&r[0]<4,u=this.softClipShape;if(l)this._ctx=s;else{for(this._ctx=null,n=this._off;n=0;s--){var l=2*s,u=i[l]-o/2,h=i[l+1]-a/2;if(t>=u&&e>=h&&t<=u+o&&e<=h+a)return s}return-1},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect();return t=n[0],e=n[1],i.contain(t,e)?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape,n=e.points,i=e.size,r=i[0],o=i[1],a=1/0,s=1/0,l=-1/0,u=-1/0,h=0;h=0&&(l.dataIndex=n+(t.startIndex||0))}))},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}();const AM=LM;const DM=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return I(e,t),e.prototype.render=function(t,e,n){var i=t.getData();this._updateSymbolDraw(i,t).updateData(i,{clipShape:this._getClipShape(t)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData();this._updateSymbolDraw(i,t).incrementalPrepareUpdate(i),this._finished=!1},e.prototype.incrementalRender=function(t,e,n){this._symbolDraw.incrementalUpdate(t,e.getData(),{clipShape:this._getClipShape(e)}),this._finished=t.end===e.getData().count()},e.prototype.updateTransform=function(t,e,n){var i=t.getData();if(this.group.dirty(),!this._finished||i.count()>1e4)return{update:!0};var r=eM("").reset(t,e,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout(i)},e.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},e.prototype._getClipShape=function(t){if(t.get("clip",!0)){var e=t.coordinateSystem;return e&&e.getArea&&e.getArea(.1)}},e.prototype._updateSymbolDraw=function(t,e){var n=this._symbolDraw,i=e.pipelineContext.large;return n&&i===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=i?new AM:new jT,this._isLargeDraw=i,this.group.removeAll()),this.group.add(n.group),n},e.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(Fm);const IM=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(Gc);var PM=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",ka).models[0]},e.type="cartesian2dAxis",e}(Gc);ut(PM,Uw);var EM={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:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},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},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},OM=nt({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},EM),NM=nt({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},EM);const RM={category:OM,value:NM,time:nt({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},NM),log:ot({logBase:10},NM)};var kM={value:1,category:1,time:1,log:1};function zM(t,e,n,i){ct(kM,(function(r,o){var a=nt(nt({},RM[o],!0),i,!0),s=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e+"Axis."+o,n}return I(n,t),n.prototype.mergeDefaultAndTheme=function(t,e){var n=Rc(this),i=n?zc(t):{};nt(t,e.getTheme().get(o+"Axis")),nt(t,this.getDefaultOption()),t.type=BM(t),n&&kc(t,i,n)},n.prototype.optionUpdated=function(){"category"===this.option.type&&(this.__ordinalMeta=Gx.createByAxisModel(this))},n.prototype.getCategories=function(t){var e=this.option;if("category"===e.type)return t?e.data:this.__ordinalMeta.categories},n.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},n.type=e+"Axis."+o,n.defaultOption=a,n}(n);t.registerComponentModel(s)})),t.registerSubTypeDefaulter(e+"Axis",BM)}function BM(t){return t.type||(t.data?"category":"value")}const FM=function(){function t(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return t.prototype.getAxis=function(t){return this._axes[t]},t.prototype.getAxes=function(){return dt(this._dimList,(function(t){return this._axes[t]}),this)},t.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),pt(this.getAxes(),(function(e){return e.scale.type===t}))},t.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},t}();var VM=["x","y"];function GM(t){return"interval"===t.type||"time"===t.type}var HM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cartesian2d",e.dimensions=VM,e}return I(e,t),e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,e=this.getAxis("y").scale;if(GM(t)&&GM(e)){var n=t.getExtent(),i=e.getExtent(),r=this.dataToPoint([n[0],i[0]]),o=this.dataToPoint([n[1],i[1]]),a=n[1]-n[0],s=i[1]-i[0];if(a&&s){var l=(o[0]-r[0])/a,u=(o[1]-r[1])/s,h=r[0]-n[0]*l,c=r[1]-i[0]*u,d=this._transform=[l,0,0,u,h,c];this._invTransform=on([],d)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var e=this.getAxis("x"),n=this.getAxis("y");return e.contain(e.toLocalCoord(t[0]))&&n.contain(n.toLocalCoord(t[1]))},e.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},e.prototype.containZone=function(t,e){var n=this.dataToPoint(t),i=this.dataToPoint(e),r=this.getArea(),o=new _n(n[0],n[1],i[0]-n[0],i[1]-n[1]);return r.intersect(o)},e.prototype.dataToPoint=function(t,e,n){n=n||[];var i=t[0],r=t[1];if(this._transform&&null!=i&&isFinite(i)&&null!=r&&isFinite(r))return xe(n,t,this._transform);var o=this.getAxis("x"),a=this.getAxis("y");return n[0]=o.toGlobalCoord(o.dataToCoord(i,e)),n[1]=a.toGlobalCoord(a.dataToCoord(r,e)),n},e.prototype.clampData=function(t,e){var n=this.getAxis("x").scale,i=this.getAxis("y").scale,r=n.getExtent(),o=i.getExtent(),a=n.parse(t[0]),s=i.parse(t[1]);return(e=e||[])[0]=Math.min(Math.max(Math.min(r[0],r[1]),a),Math.max(r[0],r[1])),e[1]=Math.min(Math.max(Math.min(o[0],o[1]),s),Math.max(o[0],o[1])),e},e.prototype.pointToData=function(t,e){var n=[];if(this._invTransform)return xe(n,t,this._invTransform);var i=this.getAxis("x"),r=this.getAxis("y");return n[0]=i.coordToData(i.toLocalCoord(t[0]),e),n[1]=r.coordToData(r.toLocalCoord(t[1]),e),n},e.prototype.getOtherAxis=function(t){return this.getAxis("x"===t.dim?"y":"x")},e.prototype.getArea=function(t){t=t||0;var e=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),i=Math.min(e[0],e[1])-t,r=Math.min(n[0],n[1])-t,o=Math.max(e[0],e[1])-i+t,a=Math.max(n[0],n[1])-r+t;return new _n(i,r,o,a)},e}(FM);const UM=HM;var WM=function(t){function e(e,n,i,r,o){var a=t.call(this,e,n,i)||this;return a.index=0,a.type=r||"value",a.position=o||"bottom",a}return I(e,t),e.prototype.isHorizontal=function(){var t=this.position;return"top"===t||"bottom"===t},e.prototype.getGlobalExtent=function(t){var e=this.getExtent();return e[0]=this.toGlobalCoord(e[0]),e[1]=this.toGlobalCoord(e[1]),t&&e[0]>e[1]&&e.reverse(),e},e.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},e.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(Sb);const jM=WM;function ZM(t,e,n){n=n||{};var i=t.coordinateSystem,r=e.axis,o={},a=r.getAxesOnZeroOf()[0],s=r.position,l=a?"onZero":s,u=r.dim,h=i.getRect(),c=[h.x,h.x+h.width,h.y,h.y+h.height],d={left:0,right:1,top:0,bottom:1,onZero:2},f=e.get("offset")||0,p="x"===u?[c[2]-f,c[3]+f]:[c[0]-f,c[1]+f];if(a){var g=a.toGlobalCoord(a.dataToCoord(0));p[d.onZero]=Math.max(Math.min(g,p[1]),p[0])}o.position=["y"===u?p[d[l]]:c[0],"x"===u?p[d[l]]:c[3]],o.rotation=Math.PI/2*("x"===u?0:1);o.labelDirection=o.tickDirection=o.nameDirection={top:-1,bottom:1,left:-1,right:1}[s],o.labelOffset=a?p[d[s]]-p[d.onZero]:0,e.get(["axisTick","inside"])&&(o.tickDirection=-o.tickDirection),Et(n.labelInside,e.get(["axisLabel","inside"]))&&(o.labelDirection=-o.labelDirection);var m=e.get(["axisLabel","rotate"]);return o.labelRotate="top"===l?-m:m,o.z2=1,o}function XM(t){return"cartesian2d"===t.get("coordinateSystem")}function qM(t){var e={xAxisModel:null,yAxisModel:null};return ct(e,(function(n,i){var r=i.replace(/Model$/,""),o=t.getReferringComponents(r,ka).models[0];e[i]=o})),e}var YM=Math.log;var KM=function(){function t(t,e,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=VM,this._initCartesian(t,e,n),this.model=t}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(t,e){var n=this._axesMap;function i(t){var e,n=mt(t),i=n.length;if(i){for(var r=[],o=i-1;o>=0;o--){var a=t[+n[o]],s=a.model,l=a.scale;Hx(l)&&s.get("alignTicks")&&null==s.get("interval")?r.push(a):(Rw(l,s),Hx(l)&&(e=a))}r.length&&(e||Rw((e=r.pop()).scale,e.model),ct(r,(function(t){!function(t,e,n){var i=tw.prototype,r=i.getTicks.call(n),o=i.getTicks.call(n,!0),a=r.length-1,s=i.getInterval.call(n),l=Nw(t,e),u=l.extent,h=l.fixMin,c=l.fixMax;if("log"===t.type){var d=YM(t.base);u=[YM(u[0])/d,YM(u[1])/d]}t.setExtent(u[0],u[1]),t.calcNiceExtent({splitNumber:a,fixMin:h,fixMax:c});var f=i.getExtent.call(t);h&&(u[0]=f[0]),c&&(u[1]=f[1]);var p=i.getInterval.call(t),g=u[0],m=u[1];if(h&&c)p=(m-g)/a;else if(h)for(m=u[0]+p*a;mu[0]&&isFinite(g)&&isFinite(u[0]);)p=Wx(p),g=u[1]-p*a;else{t.getTicks().length-1>a&&(p=Wx(p));var v=p*a;(g=Yo((m=Math.ceil(u[1]/p)*p)-v))<0&&u[0]>=0?(g=0,m=Yo(v)):m>0&&u[1]<=0&&(m=0,g=-Yo(v))}var _=(r[0].value-o[0].value)/s,y=(r[a].value-o[a].value)/s;i.setExtent.call(t,g+p*_,m+p*y),i.setInterval.call(t,p),(_||y)&&i.setNiceExtent.call(t,g+p,m-p)}(t.scale,t.model,e.scale)})))}}this._updateScale(t,this.model),i(n.x),i(n.y);var r={};ct(n.x,(function(t){$M(n,"y",t,r)})),ct(n.y,(function(t){$M(n,"x",t,r)})),this.resize(this.model,e)},t.prototype.resize=function(t,e,n){var i=t.getBoxLayoutParams(),r=!n&&t.get("containLabel"),o=Oc(i,{width:e.getWidth(),height:e.getHeight()});this._rect=o;var a=this._axesList;function s(){ct(a,(function(t){var e=t.isHorizontal(),n=e?[0,o.width]:[0,o.height],i=t.inverse?1:0;t.setExtent(n[i],n[1-i]),function(t,e){var n=t.getExtent(),i=n[0]+n[1];t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return i-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return i-t+e}}(t,e?o.x:o.y)}))}s(),r&&(ct(a,(function(t){if(!t.model.get(["axisLabel","inside"])){var e=function(t){var e=t.model,n=t.scale;if(e.get(["axisLabel","show"])&&!n.isBlank()){var i,r,o=n.getExtent();r=n instanceof Jx?n.count():(i=n.getTicks()).length;var a,s=t.getLabelModel(),l=zw(t),u=1;r>40&&(u=Math.ceil(r/40));for(var h=0;h0&&i>0||n<0&&i<0)}(t)}const tC=KM;var eC=Math.PI,nC=function(){function t(t,e){this.group=new Eo,this.opt=e,this.axisModel=t,ot(e,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var n=new Eo({x:e.position[0],y:e.position[1],rotation:e.rotation});n.updateTransform(),this._transformGroup=n}return t.prototype.hasBuilder=function(t){return!!iC[t]},t.prototype.add=function(t){iC[t](this.opt,this.axisModel,this.group,this._transformGroup)},t.prototype.getGroup=function(){return this.group},t.innerTextLayout=function(t,e,n){var i,r,o=ia(e-t);return ra(o)?(r=n>0?"top":"bottom",i="center"):ra(o-eC)?(r=n>0?"bottom":"top",i="center"):(r="middle",i=o>0&&o0?"right":"left":n>0?"left":"right"),{rotation:o,textAlign:i,textVerticalAlign:r}},t.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},t.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},t}(),iC={axisLine:function(t,e,n,i){var r=e.get(["axisLine","show"]);if("auto"===r&&t.handleAutoShown&&(r=t.handleAutoShown("axisLine")),r){var o=e.axis.getExtent(),a=i.transform,s=[o[0],0],l=[o[1],0],u=s[0]>l[0];a&&(xe(s,s,a),xe(l,l,a));var h=rt({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),c=new Dg({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:h,strokeContainThreshold:t.strokeContainThreshold||5,silent:!0,z2:1});pm(c.shape,c.style.lineWidth),c.anid="line",n.add(c);var d=e.get(["axisLine","symbol"]);if(null!=d){var f=e.get(["axisLine","symbolSize"]);wt(d)&&(d=[d,d]),(wt(f)||Tt(f))&&(f=[f,f]);var p=Xv(e.get(["axisLine","symbolOffset"])||0,f),g=f[0],m=f[1];ct([{rotate:t.rotation+Math.PI/2,offset:p[0],r:0},{rotate:t.rotation-Math.PI/2,offset:p[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],(function(e,i){if("none"!==d[i]&&null!=d[i]){var r=jv(d[i],-g/2,-m/2,g,m,h.stroke,!0),o=e.r+e.offset,a=u?l:s;r.attr({rotation:e.rotate,x:a[0]+o*Math.cos(t.rotation),y:a[1]-o*Math.sin(t.rotation),silent:!0,z2:11}),n.add(r)}}))}}},axisTickLabel:function(t,e,n,i){var r=function(t,e,n,i){var r=n.axis,o=n.getModel("axisTick"),a=o.get("show");"auto"===a&&i.handleAutoShown&&(a=i.handleAutoShown("axisTick"));if(!a||r.scale.isBlank())return;for(var s=o.getModel("lineStyle"),l=i.tickDirection*o.get("length"),u=sC(r.getTicksCoords(),e.transform,l,ot(s.getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])}),"ticks"),h=0;hc[1]?-1:1,f=["start"===s?c[0]-d*h:"end"===s?c[1]+d*h:(c[0]+c[1])/2,aC(s)?t.labelOffset+l*h:0],p=e.get("nameRotate");null!=p&&(p=p*eC/180),aC(s)?o=nC.innerTextLayout(t.rotation,null!=p?p:t.rotation,l):(o=function(t,e,n,i){var r,o,a=ia(n-t),s=i[0]>i[1],l="start"===e&&!s||"start"!==e&&s;ra(a-eC/2)?(o=l?"bottom":"top",r="center"):ra(a-1.5*eC)?(o=l?"top":"bottom",r="center"):(o="middle",r=a<1.5*eC&&a>eC/2?l?"left":"right":l?"right":"left");return{rotation:a,textAlign:r,textVerticalAlign:o}}(t.rotation,s,p||0,c),null!=(a=t.axisNameAvailableWidth)&&(a=Math.abs(a/Math.sin(o.rotation)),!isFinite(a)&&(a=null)));var g=u.getFont(),m=e.get("nameTruncate",!0)||{},v=m.ellipsis,_=Et(t.nameTruncateMaxWidth,m.maxWidth,a),y=new eu({x:f[0],y:f[1],rotation:o.rotation,silent:nC.isLabelSilent(e),style:lh(u,{text:r,font:g,overflow:"truncate",width:_,ellipsis:v,fill:u.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:u.get("align")||o.textAlign,verticalAlign:u.get("verticalAlign")||o.textVerticalAlign}),z2:1});if(Am({el:y,componentModel:e,itemName:r}),y.__fullText=r,y.anid="name",e.get("triggerEvent")){var x=nC.makeAxisEventDataBase(e);x.targetType="axisName",x.name=r,nu(y).eventData=x}i.add(y),y.updateTransform(),n.add(y),y.decomposeTransform()}}};function rC(t){t&&(t.ignore=!0)}function oC(t,e){var n=t&&t.getBoundingRect().clone(),i=e&&e.getBoundingRect().clone();if(n&&i){var r=$e([]);return nn(r,r,-t.rotation),n.applyTransform(tn([],r,t.getLocalTransform())),i.applyTransform(tn([],r,e.getLocalTransform())),n.intersect(i)}}function aC(t){return"middle"===t||"center"===t}function sC(t,e,n,i,r){for(var o=[],a=[],s=[],l=0;l=0||t===e}function cC(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[fC(t)]}function dC(t){return!!t.get(["handle","show"])}function fC(t){return t.type+"||"+t.id}var pC={},gC=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return I(e,t),e.prototype.render=function(e,n,i,r){this.axisPointerClass&&function(t){var e=cC(t);if(e){var n=e.axisPointerModel,i=e.axis.scale,r=n.option,o=n.get("status"),a=n.get("value");null!=a&&(a=i.parse(a));var s=dC(n);null==o&&(r.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==a||a>l[1])&&(a=l[1]),aa)return!0;if(o){var s=cC(t).seriesDataCount,l=i.getExtent();return Math.abs(l[0]-l[1])/s>a}return!1}return!0===n},t.prototype.makeElOption=function(t,e,n,i,r){},t.prototype.createPointerEl=function(t,e,n,i){var r=e.pointer;if(r){var o=LC(t).pointerEl=new a[r.type](AC(e.pointer));t.add(o)}},t.prototype.createLabelEl=function(t,e,n,i){if(e.label){var r=LC(t).labelEl=new eu(AC(e.label));t.add(r),OC(r,i)}},t.prototype.updatePointerEl=function(t,e,n){var i=LC(t).pointerEl;i&&e.pointer&&(i.setStyle(e.pointer.style),n(i,{shape:e.pointer.shape}))},t.prototype.updateLabelEl=function(t,e,n,i){var r=LC(t).labelEl;r&&(r.setStyle(e.label.style),n(r,{x:e.label.x,y:e.label.y}),OC(r,i))},t.prototype._renderHandle=function(t){if(!this._dragging&&this.updateHandleTransform){var e,n=this._axisPointerModel,i=this._api.getZr(),r=this._handle,o=n.getModel("handle"),a=n.get("status");if(!o.get("show")||!a||"hide"===a)return r&&i.remove(r),void(this._handle=null);this._handle||(e=!0,r=this._handle=Sm(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){Ze(t.event)},onmousedown:DC(this._onHandleDragMove,this,0,0),drift:DC(this._onHandleDragMove,this),ondragend:DC(this._onHandleDragEnd,this)}),i.add(r)),RC(r,n,!1),r.setStyle(o.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=o.get("size");yt(s)||(s=[s,s]),r.scaleX=s[0]/2,r.scaleY=s[1]/2,Wm(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},t.prototype._moveHandleToValue=function(t,e){PC(this._axisPointerModel,!e&&this._moveAnimation,this._handle,NC(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(t,e){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(NC(n),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(NC(i)),LC(n).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){if(this._handle){var t=this._payloadInfo,e=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),n=this._group,i=this._handle;e&&n&&(this._lastGraphicKey=null,n&&e.remove(n),i&&e.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),jm(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}},t}();function PC(t,e,n,i){EC(LC(n).lastProp,i)||(LC(n).lastProp=i,e?Ju(n,i,t):(n.stopAnimation(),n.attr(i)))}function EC(t,e){if(St(t)&&St(e)){var n=!0;return ct(e,(function(e,i){n=n&&EC(t[i],e)})),!!n}return t===e}function OC(t,e){t[e.get(["label","show"])?"show":"hide"]()}function NC(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function RC(t,e,n){var i=e.get("z"),r=e.get("zlevel");t&&t.traverse((function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=r&&(t.zlevel=r),t.silent=n)}))}function kC(t,e,n,i,r){var o=zC(n.get("value"),e.axis,e.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),a=n.getModel("label"),s=_c(a.get("padding")||0),l=a.getFont(),u=po(o,l),h=r.position,c=u.width+s[1]+s[3],d=u.height+s[0]+s[2],f=r.align;"right"===f&&(h[0]-=c),"center"===f&&(h[0]-=c/2);var p=r.verticalAlign;"bottom"===p&&(h[1]-=d),"middle"===p&&(h[1]-=d/2),function(t,e,n,i){var r=i.getWidth(),o=i.getHeight();t[0]=Math.min(t[0]+e,r)-e,t[1]=Math.min(t[1]+n,o)-n,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}(h,c,d,i);var g=a.get("backgroundColor");g&&"auto"!==g||(g=e.get(["axisLine","lineStyle","color"])),t.label={x:h[0],y:h[1],style:lh(a,{text:o,font:l,fill:a.getTextColor(),padding:s,backgroundColor:g}),z2:10}}function zC(t,e,n,i,r){t=e.scale.parse(t);var o=e.scale.getLabel({value:t},{precision:r.precision}),a=r.formatter;if(a){var s={value:Bw(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};ct(i,(function(t){var e=n.getSeriesByIndex(t.seriesIndex),i=t.dataIndexInside,r=e&&e.getDataParams(i);r&&s.seriesData.push(r)})),wt(a)?o=a.replace("{value}",o):xt(a)&&(o=a(s))}return o}function BC(t,e,n){var i=[1,0,0,1,0,0];return nn(i,i,n.rotation),en(i,i,n.position),_m([t.dataToCoord(e),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}var FC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.prototype.makeElOption=function(t,e,n,i,r){var o=n.axis,a=o.grid,s=i.get("type"),l=VC(a,o).getOtherAxis(o).getGlobalExtent(),u=o.toGlobalCoord(o.dataToCoord(e,!0));if(s&&"none"!==s){var h=function(t){var e,n=t.get("type"),i=t.getModel(n+"Style");return"line"===n?(e=i.getLineStyle()).fill=null:"shadow"===n&&((e=i.getAreaStyle()).stroke=null),e}(i),c=GC[s](o,u,l);c.style=h,t.graphicKey=c.type,t.pointer=c}!function(t,e,n,i,r,o){var a=lC.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=r.get(["label","margin"]),kC(e,i,r,o,{position:BC(i.axis,t,n),align:a.textAlign,verticalAlign:a.textVerticalAlign})}(e,t,ZM(a.model,n),n,i,r)},e.prototype.getHandleTransform=function(t,e,n){var i=ZM(e.axis.grid.model,e,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var r=BC(e.axis,t,i);return{x:r[0],y:r[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,e,n,i){var r=n.axis,o=r.grid,a=r.getGlobalExtent(!0),s=VC(o,r).getOtherAxis(r).getGlobalExtent(),l="x"===r.dim?0:1,u=[t.x,t.y];u[l]+=e[l],u[l]=Math.min(a[1],u[l]),u[l]=Math.max(a[0],u[l]);var h=(s[1]+s[0])/2,c=[h,h];c[l]=u[l];return{x:u[0],y:u[1],rotation:t.rotation,cursorPoint:c,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},e}(IC);function VC(t,e){var n={};return n[e.dim+"AxisIndex"]=e.index,t.getCartesian(n)}var GC={line:function(t,e,n){var i=function(t,e,n){return{x1:t[n=n||0],y1:t[1-n],x2:e[n],y2:e[1-n]}}([e,n[0]],[e,n[1]],HC(t));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(t,e,n){var i,r,o,a=Math.max(1,t.getBandWidth()),s=n[1]-n[0];return{type:"Rect",shape:(i=[e-a/2,n[0]],r=[a,s],o=HC(t),{x:i[o=o||0],y:i[1-o],width:r[o],height:r[1-o]})}}};function HC(t){return"x"===t.dim?0:1}const UC=FC;const WC=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return I(e,t),e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",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:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e}(Gc);var jC=Ea(),ZC=ct;function XC(t,e,n){if(!O.node){var i=e.getZr();jC(i).records||(jC(i).records={}),function(t,e){if(jC(t).initialized)return;function n(n,i){t.on(n,(function(n){var r=function(t){var e={showTip:[],hideTip:[]},n=function(i){var r=e[i.type];r?r.push(i):(i.dispatchAction=n,t.dispatchAction(i))};return{dispatchAction:n,pendings:e}}(e);ZC(jC(t).records,(function(t){t&&i(t,n,r.dispatchAction)})),function(t,e){var n,i=t.showTip.length,r=t.hideTip.length;i?n=t.showTip[i-1]:r&&(n=t.hideTip[r-1]);n&&(n.dispatchAction=null,e.dispatchAction(n))}(r.pendings,e)}))}jC(t).initialized=!0,n("click",_t(YC,"click")),n("mousemove",_t(YC,"mousemove")),n("globalout",qC)}(i,e),(jC(i).records[t]||(jC(i).records[t]={})).handler=n}}function qC(t,e,n){t.handler("leave",null,n)}function YC(t,e,n,i){e.handler(t,n,i)}function KC(t,e){if(!O.node){var n=e.getZr();(jC(n).records||{})[t]&&(jC(n).records[t]=null)}}var JC=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return I(e,t),e.prototype.render=function(t,e,n){var i=e.getComponent("tooltip"),r=t.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";XC("axisPointer",n,(function(t,e,n){"none"!==r&&("leave"===t||r.indexOf(t)>=0)&&n({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})}))},e.prototype.remove=function(t,e){KC("axisPointer",e)},e.prototype.dispose=function(t,e){KC("axisPointer",e)},e.type="axisPointer",e}(Dp);const $C=JC;function QC(t,e){var n,i=[],r=t.seriesIndex;if(null==r||!(n=e.getSeriesByIndex(r)))return{point:[]};var o=n.getData(),a=Pa(o,t);if(null==a||a<0||yt(a))return{point:[]};var s=o.getItemGraphicEl(a),l=n.coordinateSystem;if(n.getTooltipPosition)i=n.getTooltipPosition(a)||[];else if(l&&l.dataToPoint)if(t.isStacked){var u=l.getBaseAxis(),h=l.getOtherAxis(u).dim,c=u.dim,d="x"===h||"radius"===h?1:0,f=o.mapDimension(c),p=[];p[d]=o.get(f,a),p[1-d]=o.get(o.getCalculationInfo("stackResultDimension"),a),i=l.dataToPoint(p)||[]}else i=l.dataToPoint(o.getValues(dt(l.dimensions,(function(t){return o.mapDimension(t)})),a))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),i=[g.x+g.width/2,g.y+g.height/2]}return{point:i,el:s}}var tL=Ea();function eL(t,e,n){var i=t.currTrigger,r=[t.x,t.y],o=t,a=t.dispatchAction||vt(n.dispatchAction,n),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){aL(r)&&(r=QC({seriesIndex:o.seriesIndex,dataIndex:o.dataIndex},e).point);var l=aL(r),u=o.axesInfo,h=s.axesInfo,c="leave"===i||aL(r),d={},f={},p={list:[],map:{}},g={showPointer:_t(iL,f),showTooltip:_t(rL,p)};ct(s.coordSysMap,(function(t,e){var n=l||t.containPoint(r);ct(s.coordSysAxesInfo[e],(function(t,e){var i=t.axis,o=function(t,e){for(var n=0;n<(t||[]).length;n++){var i=t[n];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}(u,t);if(!c&&n&&(!u||o)){var a=o&&o.value;null!=a||l||(a=i.pointToData(r)),null!=a&&nL(t,a,g,!1,d)}}))}));var m={};return ct(h,(function(t,e){var n=t.linkGroup;n&&!f[e]&&ct(n.axesInfo,(function(e,i){var r=f[i];if(e!==t&&r){var o=r.value;n.mapper&&(o=t.axis.scale.parse(n.mapper(o,oL(e),oL(t)))),m[t.key]=o}}))})),ct(m,(function(t,e){nL(h[e],t,g,!0,d)})),function(t,e,n){var i=n.axesInfo=[];ct(e,(function(e,n){var r=e.axisPointerModel.option,o=t[n];o?(!e.useHandle&&(r.status="show"),r.value=o.value,r.seriesDataIndices=(o.payloadBatch||[]).slice()):!e.useHandle&&(r.status="hide"),"show"===r.status&&i.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:r.value})}))}(f,h,d),function(t,e,n,i){if(aL(e)||!t.list.length)return void i({type:"hideTip"});var r=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:r.dataIndexInside,dataIndex:r.dataIndex,seriesIndex:r.seriesIndex,dataByCoordSys:t.list})}(p,r,t,a),function(t,e,n){var i=n.getZr(),r="axisPointerLastHighlights",o=tL(i)[r]||{},a=tL(i)[r]={};ct(t,(function(t,e){var n=t.axisPointerModel.option;"show"===n.status&&t.triggerEmphasis&&ct(n.seriesDataIndices,(function(t){var e=t.seriesIndex+" | "+t.dataIndex;a[e]=t}))}));var s=[],l=[];ct(o,(function(t,e){!a[e]&&l.push(t)})),ct(a,(function(t,e){!o[e]&&s.push(t)})),l.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}(h,0,n),d}}function nL(t,e,n,i,r){var o=t.axis;if(!o.scale.isBlank()&&o.containData(e))if(t.involveSeries){var a=function(t,e){var n=e.axis,i=n.dim,r=t,o=[],a=Number.MAX_VALUE,s=-1;return ct(e.seriesModels,(function(e,l){var u,h,c=e.getData().mapDimensionsAll(i);if(e.getAxisTooltipData){var d=e.getAxisTooltipData(c,t,n);h=d.dataIndices,u=d.nestestValue}else{if(!(h=e.getData().indicesOfNearest(c[0],t,"category"===n.type?.5:null)).length)return;u=e.getData().get(c[0],h[0])}if(null!=u&&isFinite(u)){var f=t-u,p=Math.abs(f);p<=a&&((p=0&&s<0)&&(a=p,s=f,r=u,o.length=0),ct(h,(function(t){o.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})})))}})),{payloadBatch:o,snapToValue:r}}(e,t),s=a.payloadBatch,l=a.snapToValue;s[0]&&null==r.seriesIndex&&rt(r,s[0]),!i&&t.snap&&o.containData(l)&&null!=l&&(e=l),n.showPointer(t,e,s),n.showTooltip(t,a,l)}else n.showPointer(t,e)}function iL(t,e,n,i){t[e.key]={value:n,payloadBatch:i}}function rL(t,e,n,i){var r=n.payloadBatch,o=e.axis,a=o.model,s=e.axisPointerModel;if(e.triggerTooltip&&r.length){var l=e.coordSys.model,u=fC(l),h=t.map[u];h||(h=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(h)),h.dataByAxis.push({axisDim:o.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:r.slice()})}}function oL(t){var e=t.axis.model,n={},i=n.axisDim=t.axis.dim;return n.axisIndex=n[i+"AxisIndex"]=e.componentIndex,n.axisName=n[i+"AxisName"]=e.name,n.axisId=n[i+"AxisId"]=e.id,n}function aL(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function sL(t){mC.registerAxisPointerClass("CartesianAxisPointer",UC),t.registerComponentModel(WC),t.registerComponentView($C),t.registerPreprocessor((function(t){if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!yt(e)&&(t.axisPointer.link=[e])}})),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,(function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=uC(t,e)})),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},eL)}const lL=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return I(e,t),e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(Gc);function uL(t){var e=t.get("confine");return null!=e?!!e:"richText"===t.get("renderMode")}function hL(t){if(O.domSupported)for(var e=document.documentElement.style,n=0,i=t.length;n-1?(u+="top:50%",h+="translateY(-50%) rotate("+(a="left"===s?-225:-45)+"deg)"):(u+="left:50%",h+="translateX(-50%) rotate("+(a="top"===s?225:45)+"deg)");var c=a*Math.PI/180,d=l+r,f=d*Math.abs(Math.cos(c))+d*Math.abs(Math.sin(c)),p=e+" solid "+r+"px;";return'
'}(n,i,r)),wt(t))o.innerHTML=t+a;else if(t){o.innerHTML="",yt(t)||(t=[t]);for(var s=0;s=0?this._tryShow(n,i):"leave"===e&&this._hide(i))}),this))},e.prototype._keepShow=function(){var t=this._tooltipModel,e=this._ecModel,n=this._api,i=t.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==i&&"click"!==i){var r=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!n.isDisposed()&&r.manuallyShowTip(t,e,n,{x:r._lastX,y:r._lastY,dataByCoordSys:r._lastDataByCoordSys})}))}},e.prototype.manuallyShowTip=function(t,e,n,i){if(i.from!==this.uid&&!O.node&&n.getDom()){var r=DL(i,n);this._ticket="";var o=i.dataByCoordSys,a=function(t,e,n){var i=Ra(t).queryOptionMap,r=i.keys()[0];if(!r||"series"===r)return;var o=Ba(e,r,i.get(r),{useDefault:!1,enableAll:!1,enableNone:!1}),a=o.models[0];if(!a)return;var s,l=n.getViewOfComponentModel(a);if(l.group.traverse((function(e){var n=nu(e).tooltipConfig;if(n&&n.name===t.name)return s=e,!0})),s)return{componentMainType:r,componentIndex:a.componentIndex,el:s}}(i,e,n);if(a){var s=a.el.getBoundingRect().clone();s.applyTransform(a.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:a.el,position:i.position,positionDefault:"bottom"},r)}else if(i.tooltip&&null!=i.x&&null!=i.y){var l=CL;l.x=i.x,l.y=i.y,l.update(),nu(l).tooltipConfig={name:null,option:i.tooltip},this._tryShow({offsetX:i.x,offsetY:i.y,target:l},r)}else if(o)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:o,tooltipOption:i.tooltipOption},r);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(t,e,n,i))return;var u=QC(i,e),h=u.point[0],c=u.point[1];null!=h&&null!=c&&this._tryShow({offsetX:h,offsetY:c,target:u.el,position:i.position,positionDefault:"bottom"},r)}else null!=i.x&&null!=i.y&&(n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},r))}},e.prototype.manuallyHideTip=function(t,e,n,i){var r=this._tooltipContent;this._tooltipModel&&r.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(DL(i,n))},e.prototype._manuallyAxisShowTip=function(t,e,n,i){var r=i.seriesIndex,o=i.dataIndex,a=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=r&&null!=o&&null!=a){var s=e.getSeriesByIndex(r);if(s)if("axis"===AL([s.getData().getItemModel(o),s,(s.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:r,dataIndex:o,position:i.position}),!0}},e.prototype._tryShow=function(t,e){var n=t.target;if(this._tooltipModel){this._lastX=t.offsetX,this._lastY=t.offsetY;var i=t.dataByCoordSys;if(i&&i.length)this._showAxisTooltip(i,t);else if(n){var r,o;if("legend"===nu(n).ssrType)return;this._lastDataByCoordSys=null,Ev(n,(function(t){return null!=nu(t).dataIndex?(r=t,!0):null!=nu(t).tooltipConfig?(o=t,!0):void 0}),!0),r?this._showSeriesItemTooltip(t,r,e):o?this._showComponentItemTooltip(t,o,e):this._hide(e)}else this._lastDataByCoordSys=null,this._hide(e)}},e.prototype._showOrMove=function(t,e){var n=t.get("showDelay");e=vt(e,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(e,n):e()},e.prototype._showAxisTooltip=function(t,e){var n=this._ecModel,i=this._tooltipModel,r=[e.offsetX,e.offsetY],o=AL([e.tooltipOption],i),a=this._renderMode,s=[],l=op("section",{blocks:[],noHeader:!0}),u=[],h=new gp;ct(t,(function(t){ct(t.dataByAxis,(function(t){var e=n.getComponent(t.axisDim+"Axis",t.axisIndex),r=t.value;if(e&&null!=r){var o=zC(r,e.axis,n,t.seriesDataIndices,t.valueLabelOpt),c=op("section",{header:o,noHeader:!Bt(o),sortBlocks:!0,blocks:[]});l.blocks.push(c),ct(t.seriesDataIndices,(function(l){var d=n.getSeriesByIndex(l.seriesIndex),f=l.dataIndexInside,p=d.getDataParams(f);if(!(p.dataIndex<0)){p.axisDim=t.axisDim,p.axisIndex=t.axisIndex,p.axisType=t.axisType,p.axisId=t.axisId,p.axisValue=Bw(e.axis,{value:r}),p.axisValueLabel=o,p.marker=h.makeTooltipMarker("item",Cc(p.color),a);var g=Tf(d.formatTooltip(f,!0,null)),m=g.frag;if(m){var v=AL([d],i).get("valueFormatter");c.blocks.push(v?rt({valueFormatter:v},m):m)}g.text&&u.push(g.text),s.push(p)}}))}}))})),l.blocks.reverse(),u.reverse();var c=e.position,d=o.get("order"),f=cp(l,h,a,d,n.get("useUTC"),o.get("textStyle"));f&&u.unshift(f);var p="richText"===a?"\n\n":"
",g=u.join(p);this._showOrMove(o,(function(){this._updateContentNotChangedOnAxis(t,s)?this._updatePosition(o,c,r[0],r[1],this._tooltipContent,s):this._showTooltipContent(o,g,s,Math.random()+"",r[0],r[1],c,null,h)}))},e.prototype._showSeriesItemTooltip=function(t,e,n){var i=this._ecModel,r=nu(e),o=r.seriesIndex,a=i.getSeriesByIndex(o),s=r.dataModel||a,l=r.dataIndex,u=r.dataType,h=s.getData(u),c=this._renderMode,d=t.positionDefault,f=AL([h.getItemModel(l),s,a&&(a.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),p=f.get("trigger");if(null==p||"item"===p){var g=s.getDataParams(l,u),m=new gp;g.marker=m.makeTooltipMarker("item",Cc(g.color),c);var v=Tf(s.formatTooltip(l,!1,u)),_=f.get("order"),y=f.get("valueFormatter"),x=v.frag,w=x?cp(y?rt({valueFormatter:y},x):x,m,c,_,i.get("useUTC"),f.get("textStyle")):v.text,b="item_"+s.name+"_"+l;this._showOrMove(f,(function(){this._showTooltipContent(f,w,g,b,t.offsetX,t.offsetY,t.position,t.target,m)})),n({type:"showTip",dataIndexInside:l,dataIndex:h.getRawIndex(l),seriesIndex:o,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,e,n){var i="html"===this._renderMode,r=nu(e),o=r.tooltipConfig.option||{},a=o.encodeHTMLContent;if(wt(o)){o={content:o,formatter:o},a=!0}a&&i&&o.content&&((o=et(o)).content=ze(o.content));var s=[o],l=this._ecModel.getComponent(r.componentMainType,r.componentIndex);l&&s.push(l),s.push({formatter:o.content});var u=t.positionDefault,h=AL(s,this._tooltipModel,u?{position:u}:null),c=h.get("content"),d=Math.random()+"",f=new gp;this._showOrMove(h,(function(){var n=et(h.get("formatterParams")||{});this._showTooltipContent(h,c,n,d,t.offsetX,t.offsetY,t.position,e,f)})),n({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,e,n,i,r,o,a,s,l){if(this._ticket="",t.get("showContent")&&t.get("show")){var u=this._tooltipContent;u.setEnterable(t.get("enterable"));var h=t.get("formatter");a=a||t.get("position");var c=e,d=this._getNearestPoint([r,o],n,t.get("trigger"),t.get("borderColor")).color;if(h)if(wt(h)){var f=t.ecModel.get("useUTC"),p=yt(n)?n[0]:n;c=h,p&&p.axisType&&p.axisType.indexOf("time")>=0&&(c=Qh(p.axisValue,c,f)),c=bc(c,n,!0)}else if(xt(h)){var g=vt((function(e,i){e===this._ticket&&(u.setContent(i,l,t,d,a),this._updatePosition(t,a,r,o,u,n,s))}),this);this._ticket=i,c=h(n,i,g)}else c=h;u.setContent(c,l,t,d,a),u.show(t,d),this._updatePosition(t,a,r,o,u,n,s)}},e.prototype._getNearestPoint=function(t,e,n,i){return"axis"===n||yt(e)?{color:i||("html"===this._renderMode?"#fff":"none")}:yt(e)?void 0:{color:i||e.color||e.borderColor}},e.prototype._updatePosition=function(t,e,n,i,r,o,a){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u=r.getSize(),h=t.get("align"),c=t.get("verticalAlign"),d=a&&a.getBoundingRect().clone();if(a&&d.applyTransform(a.transform),xt(e)&&(e=e([n,i],o,r.el,d,{viewSize:[s,l],contentSize:u.slice()})),yt(e))n=qo(e[0],s),i=qo(e[1],l);else if(St(e)){var f=e;f.width=u[0],f.height=u[1];var p=Oc(f,{width:s,height:l});n=p.x,i=p.y,h=null,c=null}else if(wt(e)&&a){var g=function(t,e,n,i){var r=n[0],o=n[1],a=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=e.width,h=e.height;switch(t){case"inside":s=e.x+u/2-r/2,l=e.y+h/2-o/2;break;case"top":s=e.x+u/2-r/2,l=e.y-o-a;break;case"bottom":s=e.x+u/2-r/2,l=e.y+h+a;break;case"left":s=e.x-r-a,l=e.y+h/2-o/2;break;case"right":s=e.x+u+a,l=e.y+h/2-o/2}return[s,l]}(e,d,u,t.get("borderWidth"));n=g[0],i=g[1]}else{g=function(t,e,n,i,r,o,a){var s=n.getSize(),l=s[0],u=s[1];null!=o&&(t+l+o+2>i?t-=l+o:t+=o);null!=a&&(e+u+a>r?e-=u+a:e+=a);return[t,e]}(n,i,r,s,l,h?null:20,c?null:20);n=g[0],i=g[1]}if(h&&(n-=IL(h)?u[0]/2:"right"===h?u[0]:0),c&&(i-=IL(c)?u[1]/2:"bottom"===c?u[1]:0),uL(t)){g=function(t,e,n,i,r){var o=n.getSize(),a=o[0],s=o[1];return t=Math.min(t+a,i)-a,e=Math.min(e+s,r)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}(n,i,r,s,l);n=g[0],i=g[1]}r.moveTo(n,i)},e.prototype._updateContentNotChangedOnAxis=function(t,e){var n=this._lastDataByCoordSys,i=this._cbParamsList,r=!!n&&n.length===t.length;return r&&ct(n,(function(n,o){var a=n.dataByAxis||[],s=(t[o]||{}).dataByAxis||[];(r=r&&a.length===s.length)&&ct(a,(function(t,n){var o=s[n]||{},a=t.seriesDataIndices||[],l=o.seriesDataIndices||[];(r=r&&t.value===o.value&&t.axisType===o.axisType&&t.axisId===o.axisId&&a.length===l.length)&&ct(a,(function(t,e){var n=l[e];r=r&&t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex})),i&&ct(t.seriesDataIndices,(function(t){var n=t.seriesIndex,o=e[n],a=i[n];o&&a&&a.data!==o.data&&(r=!1)}))}))})),this._lastDataByCoordSys=t,this._cbParamsList=e,!!r},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,e){!O.node&&e.getDom()&&(jm(this,"_updatePosition"),this._tooltipContent.dispose(),KC("itemTooltip",e))},e.type="tooltip",e}(Dp);function AL(t,e,n){var i,r=e.ecModel;n?(i=new Ih(n,r,r),i=new Ih(e.option,i,r)):i=e;for(var o=t.length-1;o>=0;o--){var a=t[o];a&&(a instanceof Ih&&(a=a.get("tooltip",!0)),wt(a)&&(a={formatter:a}),a&&(i=new Ih(a,i,r)))}return i}function DL(t,e){return t.dispatchAction||vt(e.dispatchAction,e)}function IL(t){return"center"===t||"middle"===t}const PL=LL;var EL=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.layoutMode={type:"box",ignoreSize:!0},n}return I(e,t),e.type="title",e.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},e}(Gc),OL=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return I(e,t),e.prototype.render=function(t,e,n){if(this.group.removeAll(),t.get("show")){var i=this.group,r=t.getModel("textStyle"),o=t.getModel("subtextStyle"),a=t.get("textAlign"),s=Ot(t.get("textBaseline"),t.get("textVerticalAlign")),l=new eu({style:lh(r,{text:t.get("text"),fill:r.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),h=t.get("subtext"),c=new eu({style:lh(o,{text:h,fill:o.getTextColor(),y:u.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),d=t.get("link"),f=t.get("sublink"),p=t.get("triggerEvent",!0);l.silent=!d&&!p,c.silent=!f&&!p,d&&l.on("click",(function(){Lc(d,"_"+t.get("target"))})),f&&c.on("click",(function(){Lc(f,"_"+t.get("subtarget"))})),nu(l).eventData=nu(c).eventData=p?{componentType:"title",componentIndex:t.componentIndex}:null,i.add(l),h&&i.add(c);var g=i.getBoundingRect(),m=t.getBoxLayoutParams();m.width=g.width,m.height=g.height;var v=Oc(m,{width:n.getWidth(),height:n.getHeight()},t.get("padding"));a||("middle"===(a=t.get("left")||t.get("right"))&&(a="center"),"right"===a?v.x+=v.width:"center"===a&&(v.x+=v.width/2)),s||("center"===(s=t.get("top")||t.get("bottom"))&&(s="middle"),"bottom"===s?v.y+=v.height:"middle"===s&&(v.y+=v.height/2),s=s||"top"),i.x=v.x,i.y=v.y,i.markRedraw();var _={align:a,verticalAlign:s};l.setStyle(_),c.setStyle(_),g=i.getBoundingRect();var y=v.margin,x=t.getItemStyle(["color","opacity"]);x.fill=t.get("backgroundColor");var w=new Fl({shape:{x:g.x-y[3],y:g.y-y[0],width:g.width+y[1]+y[3],height:g.height+y[0]+y[2],r:t.get("borderRadius")},style:x,subPixelOptimize:!0,silent:!0});i.add(w)}},e.type="title",e}(Dp);var NL=["x","y","radius","angle","single"],RL=["cartesian2d","polar","singleAxis"];function kL(t){return t+"Axis"}function zL(t,e){var n,i=jt(),r=[],o=jt();t.eachComponent({mainType:"dataZoom",query:e},(function(t){o.get(t.uid)||s(t)}));do{n=!1,t.eachComponent("dataZoom",a)}while(n);function a(t){!o.get(t.uid)&&function(t){var e=!1;return t.eachTargetAxis((function(t,n){var r=i.get(t);r&&r[n]&&(e=!0)})),e}(t)&&(s(t),n=!0)}function s(t){o.set(t.uid,!0),r.push(t),t.eachTargetAxis((function(t,e){(i.get(t)||i.set(t,[]))[e]=!0}))}return r}var BL=function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(t){this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},t}();function FL(t){var e={};return ct(["start","end","startValue","endValue","throttle"],(function(n){t.hasOwnProperty(n)&&(e[n]=t[n])})),e}const VL=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return I(e,t),e.type="dataZoom.select",e}(function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._autoThrottle=!0,n._noTarget=!0,n._rangePropMode=["percent","percent"],n}return I(e,t),e.prototype.init=function(t,e,n){var i=FL(t);this.settledOption=i,this.mergeDefaultAndTheme(t,n),this._doInit(i)},e.prototype.mergeOption=function(t){var e=FL(t);nt(this.option,t,!0),nt(this.settledOption,e,!0),this._doInit(e)},e.prototype._doInit=function(t){var e=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var n=this.settledOption;ct([["start","startValue"],["end","endValue"]],(function(t,i){"value"===this._rangePropMode[i]&&(e[t[0]]=n[t[0]]=null)}),this),this._resetTarget()},e.prototype._resetTarget=function(){var t=this.get("orient",!0),e=this._targetAxisInfoMap=jt();this._fillSpecifiedTargetAxis(e)?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(e,this._orient)),this._noTarget=!0,e.each((function(t){t.indexList.length&&(this._noTarget=!1)}),this)},e.prototype._fillSpecifiedTargetAxis=function(t){var e=!1;return ct(NL,(function(n){var i=this.getReferringComponents(kL(n),za);if(i.specified){e=!0;var r=new BL;ct(i.models,(function(t){r.add(t.componentIndex)})),t.set(n,r)}}),this),e},e.prototype._fillAutoTargetAxisByOrient=function(t,e){var n=this.ecModel,i=!0;if(i){var r="vertical"===e?"y":"x";o(n.findComponents({mainType:r+"Axis"}),r)}i&&o(n.findComponents({mainType:"singleAxis",filter:function(t){return t.get("orient",!0)===e}}),"single");function o(e,n){var r=e[0];if(r){var o=new BL;if(o.add(r.componentIndex),t.set(n,o),i=!1,"x"===n||"y"===n){var a=r.getReferringComponents("grid",ka).models[0];a&&ct(e,(function(t){r.componentIndex!==t.componentIndex&&a===t.getReferringComponents("grid",ka).models[0]&&o.add(t.componentIndex)}))}}}i&&ct(NL,(function(e){if(i){var r=n.findComponents({mainType:kL(e),filter:function(t){return"category"===t.get("type",!0)}});if(r[0]){var o=new BL;o.add(r[0].componentIndex),t.set(e,o),i=!1}}}),this)},e.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis((function(e){!t&&(t=e)}),this),"y"===t?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var e=this.ecModel.option;this.option.throttle=e.animation&&e.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(t){var e=this._rangePropMode,n=this.get("rangeMode");ct([["start","startValue"],["end","endValue"]],(function(i,r){var o=null!=t[i[0]],a=null!=t[i[1]];o&&!a?e[r]="percent":!o&&a?e[r]="value":n?e[r]=n[r]:o&&(e[r]="percent")}))},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis((function(e,n){null==t&&(t=this.ecModel.getComponent(kL(e),n))}),this),t},e.prototype.eachTargetAxis=function(t,e){this._targetAxisInfoMap.each((function(n,i){ct(n.indexList,(function(n){t.call(e,i,n)}))}))},e.prototype.getAxisProxy=function(t,e){var n=this.getAxisModel(t,e);if(n)return n.__dzAxisProxy},e.prototype.getAxisModel=function(t,e){var n=this._targetAxisInfoMap.get(t);if(n&&n.indexMap[e])return this.ecModel.getComponent(kL(t),e)},e.prototype.setRawRange=function(t){var e=this.option,n=this.settledOption;ct([["start","startValue"],["end","endValue"]],(function(i){null==t[i[0]]&&null==t[i[1]]||(e[i[0]]=n[i[0]]=t[i[0]],e[i[1]]=n[i[1]]=t[i[1]])}),this),this._updateRangeUse(t)},e.prototype.setCalculatedRange=function(t){var e=this.option;ct(["start","startValue","end","endValue"],(function(n){e[n]=t[n]}))},e.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},e.prototype.getValueRange=function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var n=this.findRepresentativeAxisProxy();return n?n.getDataValueWindow():void 0},e.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var e,n=this._targetAxisInfoMap.keys(),i=0;io&&(e[1-i]=e[i]+u.sign*o),e}function UL(t,e){var n=t[e]-t[1-e];return{span:Math.abs(n),sign:n>0?-1:n<0?1:e?-1:1}}function WL(t,e){return Math.min(null!=e[1]?e[1]:1/0,Math.max(null!=e[0]?e[0]:-1/0,t))}var jL=ct,ZL=Ko,XL=function(){function t(t,e,n,i){this._dimName=t,this._axisIndex=e,this.ecModel=i,this._dataZoomModel=n}return t.prototype.hostedBy=function(t){return this._dataZoomModel===t},t.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},t.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},t.prototype.getTargetSeriesModels=function(){var t=[];return this.ecModel.eachSeries((function(e){if(function(t){var e=t.get("coordinateSystem");return st(RL,e)>=0}(e)){var n=kL(this._dimName),i=e.getReferringComponents(n,ka).models[0];i&&this._axisIndex===i.componentIndex&&t.push(e)}}),this),t},t.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},t.prototype.getMinMaxSpan=function(){return et(this._minMaxSpan)},t.prototype.calculateDataWindow=function(t){var e,n=this._dataExtent,i=this.getAxisModel().axis.scale,r=this._dataZoomModel.getRangePropMode(),o=[0,100],a=[],s=[];jL(["start","end"],(function(l,u){var h=t[l],c=t[l+"Value"];"percent"===r[u]?(null==h&&(h=o[u]),c=i.parse(Xo(h,o,n))):(e=!0,h=Xo(c=null==c?n[u]:i.parse(c),n,o)),s[u]=null==c||isNaN(c)?n[u]:c,a[u]=null==h||isNaN(h)?o[u]:h})),ZL(s),ZL(a);var l=this._minMaxSpan;function u(t,e,n,r,o){var a=o?"Span":"ValueSpan";HL(0,t,n,"all",l["min"+a],l["max"+a]);for(var s=0;s<2;s++)e[s]=Xo(t[s],n,r,!0),o&&(e[s]=i.parse(e[s]))}return e?u(s,a,n,o,!1):u(a,s,o,n,!0),{valueWindow:s,percentWindow:a}},t.prototype.reset=function(t){if(t===this._dataZoomModel){var e=this.getTargetSeriesModels();this._dataExtent=function(t,e,n){var i=[1/0,-1/0];jL(n,(function(t){!function(t,e,n){e&&ct(Hw(e,n),(function(n){var i=e.getApproximateExtent(n);i[0]t[1]&&(t[1]=i[1])}))}(i,t.getData(),e)}));var r=t.getAxisModel(),o=Ew(r.axis.scale,r,i).calculate();return[o.min,o.max]}(this,this._dimName,e),this._updateMinMaxSpan();var n=this.calculateDataWindow(t.settledOption);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,this._setAxisModel()}},t.prototype.filterData=function(t,e){if(t===this._dataZoomModel){var n=this._dimName,i=this.getTargetSeriesModels(),r=t.get("filterMode"),o=this._valueWindow;"none"!==r&&jL(i,(function(t){var e=t.getData(),i=e.mapDimensionsAll(n);if(i.length){if("weakFilter"===r){var a=e.getStore(),s=dt(i,(function(t){return e.getDimensionIndex(t)}),e);e.filterSelf((function(t){for(var e,n,r,l=0;lo[1];if(h&&!c&&!d)return!0;h&&(r=!0),c&&(e=!0),d&&(n=!0)}return r&&e&&n}))}else jL(i,(function(n){if("empty"===r)t.setData(e=e.map(n,(function(t){return function(t){return t>=o[0]&&t<=o[1]}(t)?t:NaN})));else{var i={};i[n]=o,e.selectRange(i)}}));jL(i,(function(t){e.setApproximateExtent(o,t)}))}}))}},t.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},e=this._dataZoomModel,n=this._dataExtent;jL(["min","max"],(function(i){var r=e.get(i+"Span"),o=e.get(i+"ValueSpan");null!=o&&(o=this.getAxisModel().axis.scale.parse(o)),null!=o?r=Xo(n[0]+o,n,[0,100],!0):null!=r&&(o=Xo(r,[0,100],n,!0)-n[0]),t[i+"Span"]=r,t[i+"ValueSpan"]=o}),this)},t.prototype._setAxisModel=function(){var t=this.getAxisModel(),e=this._percentWindow,n=this._valueWindow;if(e){var i=Qo(n,[0,500]);i=Math.min(i,20);var r=t.axis.scale.rawExtentInfo;0!==e[0]&&r.setDeterminedMinMax("min",+n[0].toFixed(i)),100!==e[1]&&r.setDeterminedMinMax("max",+n[1].toFixed(i)),r.freeze()}},t}();const qL=XL;const YL={getTargetSeries:function(t){function e(e){t.eachComponent("dataZoom",(function(n){n.eachTargetAxis((function(i,r){var o=t.getComponent(kL(i),r);e(i,r,o,n)}))}))}e((function(t,e,n,i){n.__dzAxisProxy=null}));var n=[];e((function(e,i,r,o){r.__dzAxisProxy||(r.__dzAxisProxy=new qL(e,i,o,t),n.push(r.__dzAxisProxy))}));var i=jt();return ct(n,(function(t){ct(t.getTargetSeriesModels(),(function(t){i.set(t.uid,t)}))})),i},overallReset:function(t,e){t.eachComponent("dataZoom",(function(t){t.eachTargetAxis((function(e,n){t.getAxisProxy(e,n).reset(t)})),t.eachTargetAxis((function(n,i){t.getAxisProxy(n,i).filterData(t,e)}))})),t.eachComponent("dataZoom",(function(t){var e=t.findRepresentativeAxisProxy();if(e){var n=e.getDataPercentWindow(),i=e.getDataValueWindow();t.setCalculatedRange({start:n[0],end:n[1],startValue:i[0],endValue:i[1]})}}))}};var KL=!1;function JL(t){KL||(KL=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,YL),function(t){t.registerAction("dataZoom",(function(t,e){ct(zL(e,t),(function(e){e.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})}))}))}(t),t.registerSubTypeDefaulter("dataZoom",(function(){return"slider"})))}function $L(t){t.registerComponentModel(VL),t.registerComponentView(GL),JL(t)}var QL=function(){},tA={};function eA(t,e){tA[t]=e}function nA(t){return tA[t]}const iA=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return I(e,t),e.prototype.optionUpdated=function(){t.prototype.optionUpdated.apply(this,arguments);var e=this.ecModel;ct(this.option.feature,(function(t,n){var i=nA(n);i&&(i.getDefaultOption&&(i.defaultOption=i.getDefaultOption(e)),nt(t,i.defaultOption))}))},e.type="toolbox",e.layoutMode={type:"box",ignoreSize:!0},e.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},e}(Gc);function rA(t,e){var n=_c(e.get("padding")),i=e.getItemStyle(["color","opacity"]);return i.fill=e.get("backgroundColor"),t=new Fl({shape:{x:t.x-n[3],y:t.y-n[0],width:t.width+n[1]+n[3],height:t.height+n[0]+n[2],r:e.get("borderRadius")},style:i,silent:!0,z2:-1})}var oA=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.prototype.render=function(t,e,n,i){var r=this.group;if(r.removeAll(),t.get("show")){var o=+t.get("itemSize"),a="vertical"===t.get("orient"),s=t.get("feature")||{},l=this._features||(this._features={}),u=[];ct(s,(function(t,e){u.push(e)})),new ex(this._featureNames||[],u).add(h).update(h).remove(_t(h,null)).execute(),this._featureNames=u,function(t,e,n){var i=e.getBoxLayoutParams(),r=e.get("padding"),o={width:n.getWidth(),height:n.getHeight()},a=Oc(i,o,r);Ec(e.get("orient"),t,e.get("itemGap"),a.width,a.height),Nc(t,i,o,r)}(r,t,n),r.add(rA(r.getBoundingRect(),t)),a||r.eachChild((function(t){var e=t.__title,i=t.ensureState("emphasis"),a=i.textConfig||(i.textConfig={}),s=t.getTextContent(),l=s&&s.ensureState("emphasis");if(l&&!xt(l)&&e){var u=l.style||(l.style={}),h=po(e,eu.makeFont(u)),c=t.x+r.x,d=!1;t.y+r.y+o+h.height>n.getHeight()&&(a.position="top",d=!0);var f=d?-5-h.height:o+10;c+h.width/2>n.getWidth()?(a.position=["100%",f],u.align="right"):c-h.width/2<0&&(a.position=[0,f],u.align="left")}}))}function h(h,c){var d,f=u[h],p=u[c],g=s[f],m=new Ih(g,t,t.ecModel);if(i&&null!=i.newTitle&&i.featureName===f&&(g.title=i.newTitle),f&&!p){if(function(t){return 0===t.indexOf("my")}(f))d={onclick:m.option.onclick,featureName:f};else{var v=nA(f);if(!v)return;d=new v}l[f]=d}else if(!(d=l[p]))return;d.uid=Eh("toolbox-feature"),d.model=m,d.ecModel=e,d.api=n;var _=d instanceof QL;f||!p?!m.get("show")||_&&d.unusable?_&&d.remove&&d.remove(e,n):(!function(i,s,l){var u,h,c=i.getModel("iconStyle"),d=i.getModel(["emphasis","iconStyle"]),f=s instanceof QL&&s.getIcons?s.getIcons():i.get("icon"),p=i.get("title")||{};wt(f)?(u={})[l]=f:u=f;wt(p)?(h={})[l]=p:h=p;var g=i.iconPaths={};ct(u,(function(l,u){var f=Sm(l,{},{x:-o/2,y:-o/2,width:o,height:o});f.setStyle(c.getItemStyle()),f.ensureState("emphasis").style=d.getItemStyle();var p=new eu({style:{text:h[u],align:d.get("textAlign"),borderRadius:d.get("textBorderRadius"),padding:d.get("textPadding"),fill:null,font:ph({fontStyle:d.get("textFontStyle"),fontFamily:d.get("textFontFamily"),fontSize:d.get("textFontSize"),fontWeight:d.get("textFontWeight")},e)},ignore:!0});f.setTextContent(p),Am({el:f,componentModel:t,itemName:u,formatterParamsExtra:{title:h[u]}}),f.__title=h[u],f.on("mouseover",(function(){var e=d.getItemStyle(),i=a?null==t.get("right")&&"right"!==t.get("left")?"right":"left":null==t.get("bottom")&&"bottom"!==t.get("top")?"bottom":"top";p.setStyle({fill:d.get("textFill")||e.fill||e.stroke||"#000",backgroundColor:d.get("textBackgroundColor")}),f.setTextConfig({position:d.get("textPosition")||i}),p.ignore=!t.get("showTitle"),n.enterEmphasis(this)})).on("mouseout",(function(){"emphasis"!==i.get(["iconStatus",u])&&n.leaveEmphasis(this),p.hide()})),("emphasis"===i.get(["iconStatus",u])?Iu:Pu)(f),r.add(f),f.on("click",vt(s.onclick,s,e,n,u)),g[u]=f}))}(m,d,f),m.setIconStatus=function(t,e){var n=this.option,i=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[t]=e,i[t]&&("emphasis"===e?Iu:Pu)(i[t])},d instanceof QL&&d.render&&d.render(m,e,n,i)):_&&d.dispose&&d.dispose(e,n)}},e.prototype.updateView=function(t,e,n,i){ct(this._features,(function(t){t instanceof QL&&t.updateView&&t.updateView(t.model,e,n,i)}))},e.prototype.remove=function(t,e){ct(this._features,(function(n){n instanceof QL&&n.remove&&n.remove(t,e)})),this.group.removeAll()},e.prototype.dispose=function(t,e){ct(this._features,(function(n){n instanceof QL&&n.dispose&&n.dispose(t,e)}))},e.type="toolbox",e}(Dp);const aA=oA;const sA=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.prototype.onclick=function(t,e){var n=this.model,i=n.get("name")||t.get("title.0.text")||"echarts",r="svg"===e.getZr().painter.getType(),o=r?"svg":n.get("type",!0)||"png",a=e.getConnectedDataURL({type:o,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),s=O.browser;if("function"!=typeof MouseEvent||!s.newEdge&&(s.ie||s.edge))if(window.navigator.msSaveOrOpenBlob||r){var l=a.split(","),u=l[0].indexOf("base64")>-1,h=r?decodeURIComponent(l[1]):l[1];u&&(h=window.atob(h));var c=i+"."+o;if(window.navigator.msSaveOrOpenBlob){for(var d=h.length,f=new Uint8Array(d);d--;)f[d]=h.charCodeAt(d);var p=new Blob([f]);window.navigator.msSaveOrOpenBlob(p,c)}else{var g=document.createElement("iframe");document.body.appendChild(g);var m=g.contentWindow,v=m.document;v.open("image/svg+xml","replace"),v.write(h),v.close(),m.focus(),v.execCommand("SaveAs",!0,c),document.body.removeChild(g)}}else{var _=n.get("lang"),y='',x=window.open();x.document.write(y),x.document.title=i}else{var w=document.createElement("a");w.download=i+"."+o,w.target="_blank",w.href=a;var b=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});w.dispatchEvent(b)}},e.getDefaultOption=function(t){return{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:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])}},e}(QL);var lA="__ec_magicType_stack__",uA=[["line","bar"],["stack"]],hA=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.prototype.getIcons=function(){var t=this.model,e=t.get("icon"),n={};return ct(t.get("type"),(function(t){e[t]&&(n[t]=e[t])})),n},e.getDefaultOption=function(t){return{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:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},e.prototype.onclick=function(t,e,n){var i=this.model,r=i.get(["seriesIndex",n]);if(cA[n]){var o,a={series:[]};ct(uA,(function(t){st(t,n)>=0&&ct(t,(function(t){i.setIconStatus(t,"normal")}))})),i.setIconStatus(n,"emphasis"),t.eachComponent({mainType:"series",query:null==r?null:{seriesIndex:r}},(function(t){var e=t.subType,r=t.id,o=cA[n](e,r,t,i);o&&(ot(o,t.option),a.series.push(o));var s=t.coordinateSystem;if(s&&"cartesian2d"===s.type&&("line"===n||"bar"===n)){var l=s.getAxesByScale("ordinal")[0];if(l){var u=l.dim+"Axis",h=t.getReferringComponents(u,ka).models[0].componentIndex;a[u]=a[u]||[];for(var c=0;c<=h;c++)a[u][h]=a[u][h]||{};a[u][h].boundaryGap="bar"===n}}}));var s=n;"stack"===n&&(o=nt({stack:i.option.title.tiled,tiled:i.option.title.stack},i.option.title),"emphasis"!==i.get(["iconStatus",n])&&(s="tiled")),e.dispatchAction({type:"changeMagicType",currentType:s,newOption:a,newTitle:o,featureName:"magicType"})}},e}(QL),cA={line:function(t,e,n,i){if("bar"===t)return nt({id:e,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(t,e,n,i){if("line"===t)return nt({id:e,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(t,e,n,i){var r=n.get("stack")===lA;if("line"===t||"bar"===t)return i.setIconStatus("stack",r?"normal":"emphasis"),nt({id:e,stack:r?"":lA},i.get(["option","stack"])||{},!0)}};Vy({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(t,e){e.mergeOption(t.newOption)}));const dA=hA;var fA=new Array(60).join("-"),pA="\t";function gA(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var mA=new RegExp("[\t]+","g");function vA(t,e){var n=t.split(new RegExp("\n*"+fA+"\n*","g")),i={series:[]};return ct(n,(function(t,n){if(function(t){if(t.slice(0,t.indexOf("\n")).indexOf(pA)>=0)return!0}(t)){var r=function(t){for(var e=t.split(/\n+/g),n=[],i=dt(gA(e.shift()).split(mA),(function(t){return{name:t,data:[]}})),r=0;r6}(t)||o){if(a&&!o){"single"===s.brushMode&&WA(t);var l=et(s);l.brushType=sD(l.brushType,a),l.panelId=a===CA?null:a.panelId,o=t._creatingCover=kA(t,l),t._covers.push(o)}if(o){var u=hD[sD(t._brushType,a)];o.__brushOption.range=u.getCreatingRange(iD(t,o,t._track)),i&&(zA(t,o),u.updateCommon(t,o)),BA(t,o),r={isEnd:i}}}else i&&"single"===s.brushMode&&s.removeOnClick&&HA(t,e,n)&&WA(t)&&(r={isEnd:i,removeOnClick:!0});return r}function sD(t,e){return"auto"===t?e.defaultBrushType:t}var lD={mousedown:function(t){if(this._dragging)uD(this,t);else if(!t.target||!t.target.draggable){rD(t);var e=this.group.transformCoordToLocal(t.offsetX,t.offsetY);this._creatingCover=null,(this._creatingPanel=HA(this,t,e))&&(this._dragging=!0,this._track=[e.slice()])}},mousemove:function(t){var e=t.offsetX,n=t.offsetY,i=this.group.transformCoordToLocal(e,n);if(function(t,e,n){if(t._brushType&&!function(t,e,n){var i=t._zr;return e<0||e>i.getWidth()||n<0||n>i.getHeight()}(t,e.offsetX,e.offsetY)){var i=t._zr,r=t._covers,o=HA(t,e,n);if(!t._dragging)for(var a=0;a=0)&&t(r,i._targetInfoList)}))}return t.prototype.setOutputRanges=function(t,e){return this.matchOutputRanges(t,e,(function(t,e,n){if((t.coordRanges||(t.coordRanges=[])).push(e),!t.coordRange){t.coordRange=e;var i=SD[t.brushType](0,n,e);t.__rangeOffset={offset:CD[t.brushType](i.values,t.range,[1,1]),xyMinMax:i.xyMinMax}}})),t},t.prototype.matchOutputRanges=function(t,e,n){ct(t,(function(t){var i=this.findTargetInfo(t,e);i&&!0!==i&&ct(i.coordSyses,(function(i){var r=SD[t.brushType](1,i,t.range,!0);n(t,r.values,i,e)}))}),this)},t.prototype.setInputRanges=function(t,e){ct(t,(function(t){var n,i,r,o,a,s=this.findTargetInfo(t,e);if(t.range=t.range||[],s&&!0!==s){t.panelId=s.panelId;var l=SD[t.brushType](0,s.coordSys,t.coordRange),u=t.__rangeOffset;t.range=u?CD[t.brushType](l.values,u.offset,(n=l.xyMinMax,i=u.xyMinMax,r=AD(n),o=AD(i),a=[r[0]/o[0],r[1]/o[1]],isNaN(a[0])&&(a[0]=1),isNaN(a[1])&&(a[1]=1),a)):l.values}}),this)},t.prototype.makePanelOpts=function(t,e){return dt(this._targetInfoList,(function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:e?e(n):null,clipPath:fD(i),isTargetByCursor:gD(i,t,n.coordSysModel),getLinearBrushOtherExtent:pD(i)}}))},t.prototype.controlSeries=function(t,e,n){var i=this.findTargetInfo(t,n);return!0===i||i&&st(i.coordSyses,e.coordinateSystem)>=0},t.prototype.findTargetInfo=function(t,e){for(var n=this._targetInfoList,i=xD(e,t),r=0;rt[1]&&t.reverse(),t}function xD(t,e){return Na(t,e,{includeMainTypes:vD})}var wD={grid:function(t,e){var n=t.xAxisModels,i=t.yAxisModels,r=t.gridModels,o=jt(),a={},s={};(n||i||r)&&(ct(n,(function(t){var e=t.axis.grid.model;o.set(e.id,e),a[e.id]=!0})),ct(i,(function(t){var e=t.axis.grid.model;o.set(e.id,e),s[e.id]=!0})),ct(r,(function(t){o.set(t.id,t),a[t.id]=!0,s[t.id]=!0})),o.each((function(t){var r=t.coordinateSystem,o=[];ct(r.getCartesians(),(function(t,e){(st(n,t.getAxis("x").model)>=0||st(i,t.getAxis("y").model)>=0)&&o.push(t)})),e.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:o[0],coordSyses:o,getPanelRect:TD.grid,xAxisDeclared:a[t.id],yAxisDeclared:s[t.id]})})))},geo:function(t,e){ct(t.geoModels,(function(t){var n=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:n,coordSyses:[n],getPanelRect:TD.geo})}))}},bD=[function(t,e){var n=t.xAxisModel,i=t.yAxisModel,r=t.gridModel;return!r&&n&&(r=n.axis.grid.model),!r&&i&&(r=i.axis.grid.model),r&&r===e.gridModel},function(t,e){var n=t.geoModel;return n&&n===e.geoModel}],TD={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(vm(t)),e}},SD={lineX:_t(MD,0),lineY:_t(MD,1),rect:function(t,e,n,i){var r=t?e.pointToData([n[0][0],n[1][0]],i):e.dataToPoint([n[0][0],n[1][0]],i),o=t?e.pointToData([n[0][1],n[1][1]],i):e.dataToPoint([n[0][1],n[1][1]],i),a=[yD([r[0],o[0]]),yD([r[1],o[1]])];return{values:a,xyMinMax:a}},polygon:function(t,e,n,i){var r=[[1/0,-1/0],[1/0,-1/0]];return{values:dt(n,(function(n){var o=t?e.pointToData(n,i):e.dataToPoint(n,i);return r[0][0]=Math.min(r[0][0],o[0]),r[1][0]=Math.min(r[1][0],o[1]),r[0][1]=Math.max(r[0][1],o[0]),r[1][1]=Math.max(r[1][1],o[1]),o})),xyMinMax:r}}};function MD(t,e,n,i){var r=n.getAxis(["x","y"][t]),o=yD(dt([0,1],(function(t){return e?r.coordToData(r.toLocalCoord(i[t]),!0):r.toGlobalCoord(r.dataToCoord(i[t]))}))),a=[];return a[t]=o,a[1-t]=[NaN,NaN],{values:o,xyMinMax:a}}var CD={lineX:_t(LD,0),lineY:_t(LD,1),rect:function(t,e,n){return[[t[0][0]-n[0]*e[0][0],t[0][1]-n[0]*e[0][1]],[t[1][0]-n[1]*e[1][0],t[1][1]-n[1]*e[1][1]]]},polygon:function(t,e,n){return dt(t,(function(t,i){return[t[0]-n[0]*e[i][0],t[1]-n[1]*e[i][1]]}))}};function LD(t,e,n,i){return[e[0]-i[t]*n[0],e[1]-i[t]*n[1]]}function AD(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}const DD=_D;var ID,PD,ED=ct,OD=ya+"toolbox-dataZoom_",ND=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.prototype.render=function(t,e,n,i){this._brushController||(this._brushController=new dD(n.getZr()),this._brushController.on("brush",vt(this._onBrush,this)).mount()),function(t,e,n,i,r){var o=n._isZoomActive;i&&"takeGlobalCursor"===i.type&&(o="dataZoomSelect"===i.key&&i.dataZoomSelectActive);n._isZoomActive=o,t.setIconStatus("zoom",o?"emphasis":"normal");var a=new DD(kD(t),e,{include:["grid"]}),s=a.makePanelOpts(r,(function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"}));n._brushController.setPanels(s).enableBrush(!(!o||!s.length)&&{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()})}(t,e,this,i,n),function(t,e){t.setIconStatus("back",function(t){return TA(t).length}(e)>1?"emphasis":"normal")}(t,e)},e.prototype.onclick=function(t,e,n){RD[n].call(this)},e.prototype.remove=function(t,e){this._brushController&&this._brushController.unmount()},e.prototype.dispose=function(t,e){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(t){var e=t.areas;if(t.isEnd&&e.length){var n={},i=this.ecModel;this._brushController.updateCovers([]),new DD(kD(this.model),i,{include:["grid"]}).matchOutputRanges(e,i,(function(t,e,n){if("cartesian2d"===n.type){var i=t.brushType;"rect"===i?(r("x",n,e[0]),r("y",n,e[1])):r({lineX:"x",lineY:"y"}[i],n,e)}})),function(t,e){var n=TA(t);wA(e,(function(e,i){for(var r=n.length-1;r>=0&&!n[r][i];r--);if(r<0){var o=t.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(o){var a=o.getPercentRange();n[0][i]={dataZoomId:i,start:a[0],end:a[1]}}}})),n.push(e)}(i,n),this._dispatchZoomAction(n)}function r(t,e,r){var o=e.getAxis(t),a=o.model,s=function(t,e,n){var i;return n.eachComponent({mainType:"dataZoom",subType:"select"},(function(n){n.getAxisModel(t,e.componentIndex)&&(i=n)})),i}(t,a,i),l=s.findRepresentativeAxisProxy(a).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(r=HL(0,r.slice(),o.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(n[s.id]={dataZoomId:s.id,startValue:r[0],endValue:r[1]})}},e.prototype._dispatchZoomAction=function(t){var e=[];ED(t,(function(t,n){e.push(et(t))})),e.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:e})},e.getDefaultOption=function(t){return{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:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}}},e}(QL),RD={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(function(t){var e=TA(t),n=e[e.length-1];e.length>1&&e.pop();var i={};return wA(n,(function(t,n){for(var r=e.length-1;r>=0;r--)if(t=e[r][n]){i[n]=t;break}})),i}(this.ecModel))}};function kD(t){var e={xAxisIndex:t.get("xAxisIndex",!0),yAxisIndex:t.get("yAxisIndex",!0),xAxisId:t.get("xAxisId",!0),yAxisId:t.get("yAxisId",!0)};return null==e.xAxisIndex&&null==e.xAxisId&&(e.xAxisIndex="all"),null==e.yAxisIndex&&null==e.yAxisId&&(e.yAxisIndex="all"),e}ID="dataZoom",PD=function(t){var e=t.getComponent("toolbox",0),n=["feature","dataZoom"];if(e&&null!=e.get(n)){var i=e.getModel(n),r=[],o=Na(t,kD(i));return ED(o.xAxisModels,(function(t){return a(t,"xAxis","xAxisIndex")})),ED(o.yAxisModels,(function(t){return a(t,"yAxis","yAxisIndex")})),r}function a(t,e,n){var o=t.componentIndex,a={type:"select",$fromToolbox:!0,filterMode:i.get("filterMode",!0)||"filter",id:OD+e+o};a[n]=o,r.push(a)}},zt(null==ad.get(ID)&&PD),ad.set(ID,PD);const zD=ND;const BD=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.layoutMode={type:"box",ignoreSize:!0},n}return I(e,t),e.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),t.selected=t.selected||{},this._updateSelector(t)},e.prototype.mergeOption=function(e,n){t.prototype.mergeOption.call(this,e,n),this._updateSelector(e)},e.prototype._updateSelector=function(t){var e=t.selector,n=this.ecModel;!0===e&&(e=t.selector=["all","inverse"]),yt(e)&&ct(e,(function(t,i){wt(t)&&(t={type:t}),e[i]=nt(t,function(t,e){return"all"===e?{type:"all",title:t.getLocaleModel().get(["legend","selector","all"])}:"inverse"===e?{type:"inverse",title:t.getLocaleModel().get(["legend","selector","inverse"])}:void 0}(n,t.type))}))},e.prototype.optionUpdated=function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&"single"===this.get("selectedMode")){for(var e=!1,n=0;n=0},e.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",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:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(Gc);var FD=_t,VD=ct,GD=Eo,HD=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.newlineDisabled=!1,n}return I(e,t),e.prototype.init=function(){this.group.add(this._contentGroup=new GD),this.group.add(this._selectorGroup=new GD),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,e,n){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var r=t.get("align"),o=t.get("orient");r&&"auto"!==r||(r="right"===t.get("left")&&"vertical"===o?"right":"left");var a=t.get("selector",!0),s=t.get("selectorPosition",!0);!a||s&&"auto"!==s||(s="horizontal"===o?"end":"start"),this.renderInner(r,t,e,n,a,o,s);var l=t.getBoxLayoutParams(),u={width:n.getWidth(),height:n.getHeight()},h=t.get("padding"),c=Oc(l,u,h),d=this.layoutInner(t,r,c,i,a,s),f=Oc(ot({width:d.width,height:d.height},l),u,h);this.group.x=f.x-d.x,this.group.y=f.y-d.y,this.group.markRedraw(),this.group.add(this._backgroundEl=rA(d,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,e,n,i,r,o,a){var s=this.getContentGroup(),l=jt(),u=e.get("selectedMode"),h=[];n.eachRawSeries((function(t){!t.get("legendHoverLink")&&h.push(t.id)})),VD(e.getData(),(function(r,o){var a=r.get("name");if(!this.newlineDisabled&&(""===a||"\n"===a)){var c=new GD;return c.newline=!0,void s.add(c)}var d=n.getSeriesByName(a)[0];if(!l.get(a)){if(d){var f=d.getData(),p=f.getVisual("legendLineStyle")||{},g=f.getVisual("legendIcon"),m=f.getVisual("style"),v=this._createItem(d,a,o,r,e,t,p,m,g,u,i);v.on("click",FD(UD,a,null,i,h)).on("mouseover",FD(jD,d.name,null,i,h)).on("mouseout",FD(ZD,d.name,null,i,h)),n.ssr&&v.eachChild((function(t){var e=nu(t);e.seriesIndex=d.seriesIndex,e.dataIndex=o,e.ssrType="legend"})),l.set(a,!0)}else n.eachRawSeries((function(s){if(!l.get(a)&&s.legendVisualProvider){var c=s.legendVisualProvider;if(!c.containName(a))return;var d=c.indexOfName(a),f=c.getItemVisual(d,"style"),p=c.getItemVisual(d,"legendIcon"),g=Ri(f.fill);g&&0===g[3]&&(g[3]=.2,f=rt(rt({},f),{fill:ji(g,"rgba")}));var m=this._createItem(s,a,o,r,e,t,{},f,p,u,i);m.on("click",FD(UD,null,a,i,h)).on("mouseover",FD(jD,null,a,i,h)).on("mouseout",FD(ZD,null,a,i,h)),n.ssr&&m.eachChild((function(t){var e=nu(t);e.seriesIndex=s.seriesIndex,e.dataIndex=o,e.ssrType="legend"})),l.set(a,!0)}}),this);0}}),this),r&&this._createSelector(r,e,i,o,a)},e.prototype._createSelector=function(t,e,n,i,r){var o=this.getSelectorGroup();VD(t,(function(t){var i=t.type,r=new eu({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect",legendId:e.id})}});o.add(r),ah(r,{normal:e.getModel("selectorLabel"),emphasis:e.getModel(["emphasis","selectorLabel"])},{defaultText:t.title}),Hu(r)}))},e.prototype._createItem=function(t,e,n,i,r,o,a,s,l,u,h){var c=t.visualDrawType,d=r.get("itemWidth"),f=r.get("itemHeight"),p=r.isSelected(e),g=i.get("symbolRotate"),m=i.get("symbolKeepAspect"),v=i.get("icon"),_=function(t,e,n,i,r,o,a){function s(t,e){"auto"===t.lineWidth&&(t.lineWidth=e.lineWidth>0?2:0),VD(t,(function(n,i){"inherit"===t[i]&&(t[i]=e[i])}))}var l=e.getModel("itemStyle"),u=l.getItemStyle(),h=0===t.lastIndexOf("empty",0)?"fill":"stroke",c=l.getShallow("decal");u.decal=c&&"inherit"!==c?b_(c,a):i.decal,"inherit"===u.fill&&(u.fill=i[r]);"inherit"===u.stroke&&(u.stroke=i[h]);"inherit"===u.opacity&&(u.opacity=("fill"===r?i:n).opacity);s(u,i);var d=e.getModel("lineStyle"),f=d.getLineStyle();if(s(f,n),"auto"===u.fill&&(u.fill=i.fill),"auto"===u.stroke&&(u.stroke=i.fill),"auto"===f.stroke&&(f.stroke=i.fill),!o){var p=e.get("inactiveBorderWidth"),g=u[h];u.lineWidth="auto"===p?i.lineWidth>0&&g?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),f.stroke=d.get("inactiveColor"),f.lineWidth=d.get("inactiveWidth")}return{itemStyle:u,lineStyle:f}}(l=v||l||"roundRect",i,a,s,c,p,h),y=new GD,x=i.getModel("textStyle");if(!xt(t.getLegendIcon)||v&&"inherit"!==v){var w="inherit"===v&&t.getData().getVisual("symbol")?"inherit"===g?t.getData().getVisual("symbolRotate"):g:0;y.add(function(t){var e=t.icon||"roundRect",n=jv(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill,t.symbolKeepAspect);n.setStyle(t.itemStyle),n.rotation=(t.iconRotate||0)*Math.PI/180,n.setOrigin([t.itemWidth/2,t.itemHeight/2]),e.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2);return n}({itemWidth:d,itemHeight:f,icon:l,iconRotate:w,itemStyle:_.itemStyle,lineStyle:_.lineStyle,symbolKeepAspect:m}))}else y.add(t.getLegendIcon({itemWidth:d,itemHeight:f,icon:l,iconRotate:g,itemStyle:_.itemStyle,lineStyle:_.lineStyle,symbolKeepAspect:m}));var b="left"===o?d+5:-5,T=o,S=r.get("formatter"),M=e;wt(S)&&S?M=S.replace("{name}",null!=e?e:""):xt(S)&&(M=S(e));var C=p?x.getTextColor():i.get("inactiveColor");y.add(new eu({style:lh(x,{text:M,x:b,y:f/2,fill:C,align:T,verticalAlign:"middle"},{inheritColor:C})}));var L=new Fl({shape:y.getBoundingRect(),style:{fill:"transparent"}}),A=i.getModel("tooltip");return A.get("show")&&Am({el:L,componentModel:r,itemName:e,itemTooltipOption:A.option}),y.add(L),y.eachChild((function(t){t.silent=!0})),L.silent=!u,this.getContentGroup().add(y),Hu(y),y.__legendDataIndex=n,y},e.prototype.layoutInner=function(t,e,n,i,r,o){var a=this.getContentGroup(),s=this.getSelectorGroup();Ec(t.get("orient"),a,t.get("itemGap"),n.width,n.height);var l=a.getBoundingRect(),u=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),r){Ec("horizontal",s,t.get("selectorItemGap",!0));var h=s.getBoundingRect(),c=[-h.x,-h.y],d=t.get("selectorButtonGap",!0),f=t.getOrient().index,p=0===f?"width":"height",g=0===f?"height":"width",m=0===f?"y":"x";"end"===o?c[f]+=l[p]+d:u[f]+=h[p]+d,c[1-f]+=l[g]/2-h[g]/2,s.x=c[0],s.y=c[1],a.x=u[0],a.y=u[1];var v={x:0,y:0};return v[p]=l[p]+d+h[p],v[g]=Math.max(l[g],h[g]),v[m]=Math.min(0,h[m]+c[1-f]),v}return a.x=u[0],a.y=u[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(Dp);function UD(t,e,n,i){ZD(t,e,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=t?t:e}),jD(t,e,n,i)}function WD(t){for(var e,n=t.getZr().storage.getDisplayList(),i=0,r=n.length;in[r],p=[-c.x,-c.y];e||(p[i]=l[s]);var g=[0,0],m=[-d.x,-d.y],v=Ot(t.get("pageButtonGap",!0),t.get("itemGap",!0));f&&("end"===t.get("pageButtonPosition",!0)?m[i]+=n[r]-d[r]:g[i]+=d[r]+v);m[1-i]+=c[o]/2-d[o]/2,l.setPosition(p),u.setPosition(g),h.setPosition(m);var _={x:0,y:0};if(_[r]=f?n[r]:c[r],_[o]=Math.max(c[o],d[o]),_[a]=Math.min(0,d[a]+m[1-i]),u.__rectSize=n[r],f){var y={x:0,y:0};y[r]=Math.max(n[r]-d[r]-v,0),y[o]=_[o],u.setClipPath(new Fl({shape:y})),u.__rectSize=y[r]}else h.eachChild((function(t){t.attr({invisible:!0,silent:!0})}));var x=this._getPageInfo(t);return null!=x.pageIndex&&Ju(l,{x:x.contentPosition[0],y:x.contentPosition[1]},f?t:null),this._updatePageInfoView(t,x),_},e.prototype._pageGo=function(t,e,n){var i=this._getPageInfo(e)[t];null!=i&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:e.id})},e.prototype._updatePageInfoView=function(t,e){var n=this._controllerGroup;ct(["pagePrev","pageNext"],(function(i){var r=null!=e[i+"DataIndex"],o=n.childOfName(i);o&&(o.setStyle("fill",r?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),o.cursor=r?"pointer":"default")}));var i=n.childOfName("pageText"),r=t.get("pageFormatter"),o=e.pageIndex,a=null!=o?o+1:0,s=e.pageCount;i&&r&&i.setStyle("text",wt(r)?r.replace("{current}",null==a?"":a+"").replace("{total}",null==s?"":s+""):r({current:a,total:s}))},e.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,r=t.getOrient().index,o=eI[r],a=nI[r],s=this._findTargetItemIndex(e),l=n.children(),u=l[s],h=l.length,c=h?1:0,d={contentPosition:[n.x,n.y],pageCount:c,pageIndex:c-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return d;var f=_(u);d.contentPosition[r]=-f.s;for(var p=s+1,g=f,m=f,v=null;p<=h;++p)(!(v=_(l[p]))&&m.e>g.s+i||v&&!y(v,g.s))&&(g=m.i>g.i?m:v)&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=g.i),++d.pageCount),m=v;for(p=s-1,g=f,m=f,v=null;p>=-1;--p)(v=_(l[p]))&&y(m,v.s)||!(g.i=e&&t.s<=e+i}},e.prototype._findTargetItemIndex=function(t){return this._showController?(this.getContentGroup().eachChild((function(i,r){var o=i.__legendDataIndex;null==n&&null!=o&&(n=r),o===t&&(e=r)})),null!=e?e:n):0;var e,n},e.type="legend.scroll",e}(XD);const rI=iI;function oI(t){Jw(JD),t.registerComponentModel(QD),t.registerComponentView(rI),function(t){t.registerAction("legendScroll","legendscroll",(function(t,e){var n=t.scrollDataIndex;null!=n&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},(function(t){t.setScrollDataIndex(n)}))}))}(t)}function aI(t,e){var n;return ct(e,(function(e){null!=t[e]&&"auto"!==t[e]&&(n=!0)})),n}var sI=["transition","enterFrom","leaveTo"],lI=sI.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function uI(t,e,n){if(n&&(!t[n]&&e[n]&&(t[n]={}),t=t[n],e=e[n]),t&&e)for(var i=n?sI:lI,r=0;r0&&(a.during=s?vt(bI,{el:e,userDuring:s}):null,a.setToFinal=!0,a.scope=t),rt(a,n[o]),a}function vI(t,e,n,i){var r=(i=i||{}).dataIndex,o=i.isInit,a=i.clearStyle,s=n.isAnimationEnabled(),l=gI(t),u=e.style;l.userDuring=e.during;var h={},c={};if(function(t,e,n){for(var i=0;i=0)){var c=t.getAnimationStyleProps(),d=c?c.style:null;if(d){!r&&(r=i.style={});var f=mt(n);for(u=0;u0&&t.animateFrom(d,f)}else!function(t,e,n,i,r){if(r){var o=mI("update",t,e,i,n);o.duration>0&&t.animateFrom(r,o)}}(t,e,r||0,n,h);_I(t,e),u?t.dirty():t.markRedraw()}function _I(t,e){for(var n=gI(t).leaveToProps,i=0;i=0){!o&&(o=i[t]={});var d=mt(a);for(h=0;h=0;l--){var d,f,p;if(p=null!=(f=Aa((d=n[l]).id,null))?r.get(f):null){var g=p.parent,m=(c=II(g),{}),v=Nc(p,d,g===i?{width:o,height:a}:{width:c.width,height:c.height},null,{hv:d.hv,boundingMode:d.bounding},m);if(!II(p).isNew&&v){for(var _=d.transition,y={},x=0;x=0)?y[w]=b:p[w]=b}Ju(p,y,t,0)}else p.attr(m)}}},e.prototype._clear=function(){var t=this,e=this._elMap;e.each((function(n){NI(n,II(n).option,e,t._lastGraphicModel)})),this._elMap=jt()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(Dp);function EI(t){var e=new(Yt(DI,t)?DI[t]:lm(t))({});return II(e).type=t,e}function OI(t,e,n,i){var r=EI(n);return e.add(r),i.set(t,r),II(r).id=t,II(r).isNew=!0,r}function NI(t,e,n,i){t&&t.parent&&("group"===t.type&&t.traverse((function(t){NI(t,e,n,i)})),function(t,e,n,i){if(t){var r=t.parent,o=gI(t).leaveToProps;if(o){var a=mI("update",t,e,n,0);a.done=function(){r.remove(t),i&&i()},t.animateTo(o,a)}else r.remove(t),i&&i()}}(t,e,i),n.removeKey(II(t).id))}function RI(t,e,n,i){t.isGroup||ct([["cursor",Ss.prototype.cursor],["zlevel",i||0],["z",n||0],["z2",0]],(function(n){var i=n[0];Yt(e,i)?t[i]=Ot(e[i],n[1]):null==t[i]&&(t[i]=n[1])})),ct(mt(e),(function(n){if(0===n.indexOf("on")){var i=e[n];t[n]=xt(i)?i:null}})),Yt(e,"draggable")&&(t.draggable=e.draggable),null!=e.name&&(t.name=e.name),null!=e.id&&(t.id=e.id)}var kI=Math.sin,zI=Math.cos,BI=Math.PI,FI=2*Math.PI,VI=180/BI,GI=function(){function t(){}return t.prototype.reset=function(t){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,t||4)},t.prototype.moveTo=function(t,e){this._add("M",t,e)},t.prototype.lineTo=function(t,e){this._add("L",t,e)},t.prototype.bezierCurveTo=function(t,e,n,i,r,o){this._add("C",t,e,n,i,r,o)},t.prototype.quadraticCurveTo=function(t,e,n,i){this._add("Q",t,e,n,i)},t.prototype.arc=function(t,e,n,i,r,o){this.ellipse(t,e,n,n,0,i,r,o)},t.prototype.ellipse=function(t,e,n,i,r,o,a,s){var l=a-o,u=!s,h=Math.abs(l),c=Qi(h-FI)||(u?l>=FI:-l>=FI),d=l>0?l%FI:l%FI+FI,f=!1;f=!!c||!Qi(h)&&d>=BI==!!u;var p=t+n*zI(o),g=e+i*kI(o);this._start&&this._add("M",p,g);var m=Math.round(r*VI);if(c){var v=1/this._p,_=(u?1:-1)*(FI-v);this._add("A",n,i,m,1,+u,t+n*zI(o+_),e+i*kI(o+_)),v>.01&&this._add("A",n,i,m,0,+u,p,g)}else{var y=t+n*zI(a),x=e+i*kI(a);this._add("A",n,i,m,+f,+u,y,x)}},t.prototype.rect=function(t,e,n,i){this._add("M",t,e),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},t.prototype.closePath=function(){this._d.length>0&&this._add("Z")},t.prototype._add=function(t,e,n,i,r,o,a,s,l){for(var u=[],h=this._p,c=1;c"}(r,o)+("style"!==r?ze(a):a||"")+(i?""+n+dt(i,(function(e){return t(e)})).join(n)+n:"")+("")}(t)}function tP(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function eP(t,e,n,i){return $I("svg","root",{width:t,height:e,xmlns:qI,"xmlns:xlink":YI,version:"1.1",baseProfile:"full",viewBox:!!i&&"0 0 "+t+" "+e},n)}var nP=0;function iP(){return nP++}var rP={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"},oP="transform-origin";function aP(t,e,n){var i=rt({},t.shape);rt(i,e),t.buildPath(n,i);var r=new HI;return r.reset(ur(t)),n.rebuildPath(r,1),r.generateStr(),r.getStr()}function sP(t,e){var n=e.originX,i=e.originY;(n||i)&&(t[oP]=n+"px "+i+"px")}var lP={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function uP(t,e){var n=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[n]=t,n}function hP(t){return wt(t)?rP[t]?"cubic-bezier("+rP[t]+")":vi(t)?t:"":""}function cP(t,e,n,i){var r=t.animators,o=r.length,a=[];if(t instanceof Fg){var s=function(t,e,n){var i,r,o=t.shape.paths,a={};if(ct(o,(function(t){var e=tP(n.zrId);e.animation=!0,cP(t,{},e,!0);var o=e.cssAnims,s=e.cssNodes,l=mt(o),u=l.length;if(u){var h=o[r=l[u-1]];for(var c in h){var d=h[c];a[c]=a[c]||{d:""},a[c].d+=d.d||""}for(var f in s){var p=s[f].animation;p.indexOf(r)>=0&&(i=p)}}})),i){e.d=!1;var s=uP(a,n);return i.replace(r,s)}}(t,e,n);if(s)a.push(s);else if(!o)return}else if(!o)return;for(var l={},u=0;u0})).length)return uP(h,n)+" "+r[0]+" both"}for(var m in l){(s=g(l[m]))&&a.push(s)}if(a.length){var v=n.zrId+"-cls-"+iP();n.cssNodes["."+v]={animation:a.join(",")},e.class=v}}function dP(t,e,n,i){var r=JSON.stringify(t),o=n.cssStyleCache[r];o||(o=n.zrId+"-cls-"+iP(),n.cssStyleCache[r]=o,n.cssNodes["."+o+(i?":hover":"")]=t),e.class=e.class?e.class+" "+o:o}var fP=Math.round;function pP(t){return t&&wt(t.src)}function gP(t){return t&&xt(t.toDataURL)}function mP(t,e,n,i){XI((function(r,o){var a="fill"===r||"stroke"===r;a&&sr(o)?LP(e,t,r,i):a&&rr(o)?AP(n,t,r,i):t[r]=o,a&&i.ssr&&"none"===o&&(t["pointer-events"]="visible")}),e,n,!1),function(t,e,n){var i=t.style;if(function(t){return t&&(t.shadowBlur||t.shadowOffsetX||t.shadowOffsetY)}(i)){var r=function(t){var e=t.style,n=t.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),n[0],n[1]].join(",")}(t),o=n.shadowCache,a=o[r];if(!a){var s=t.getGlobalScale(),l=s[0],u=s[1];if(!l||!u)return;var h=i.shadowOffsetX||0,c=i.shadowOffsetY||0,d=i.shadowBlur,f=Ji(i.shadowColor),p=f.opacity,g=f.color,m=d/2/l+" "+d/2/u;a=n.zrId+"-s"+n.shadowIdx++,n.defs[a]=$I("filter",a,{id:a,x:"-100%",y:"-100%",width:"300%",height:"300%"},[$I("feDropShadow","",{dx:h/l,dy:c/u,stdDeviation:m,"flood-color":g,"flood-opacity":p})]),o[r]=a}e.filter=lr(a)}}(n,t,i)}function vP(t,e){var n=Ho(e);n&&(n.each((function(e,n){null!=e&&(t[(KI+n).toLowerCase()]=e+"")})),e.isSilent()&&(t[KI+"silent"]="true"))}function _P(t){return Qi(t[0]-1)&&Qi(t[1])&&Qi(t[2])&&Qi(t[3]-1)}function yP(t,e,n){if(e&&(!function(t){return Qi(t[4])&&Qi(t[5])}(e)||!_P(e))){var i=n?10:1e4;t.transform=_P(e)?"translate("+fP(e[4]*i)/i+" "+fP(e[5]*i)/i+")":function(t){return"matrix("+tr(t[0])+","+tr(t[1])+","+tr(t[2])+","+tr(t[3])+","+er(t[4])+","+er(t[5])+")"}(e)}}function xP(t,e,n){for(var i=t.points,r=[],o=0;o=0&&a||o;s&&(r=Yi(s))}var l=i.lineWidth;l&&(l/=!i.strokeNoScale&&t.transform?t.transform[0]:1);var u={cursor:"pointer"};r&&(u.fill=r),i.stroke&&(u.stroke=i.stroke),l&&(u["stroke-width"]=l),dP(u,e,n,!0)}}(t,o,e),$I(s,t.id+"",o)}function CP(t,e){return t instanceof Sl?MP(t,e):t instanceof Pl?function(t,e){var n=t.style,i=n.image;if(i&&!wt(i)&&(pP(i)?i=i.src:gP(i)&&(i=i.toDataURL())),i){var r=n.x||0,o=n.y||0,a={href:i,width:n.width,height:n.height};return r&&(a.x=r),o&&(a.y=o),yP(a,t.transform),mP(a,n,t,e),vP(a,t),e.animation&&cP(t,a,e),$I("image",t.id+"",a)}}(t,e):t instanceof Ll?function(t,e){var n=t.style,i=n.text;if(null!=i&&(i+=""),i&&!isNaN(n.x)&&!isNaN(n.y)){var r=n.font||R,o=n.x||0,a=function(t,e,n){return"top"===n?t+=e/2:"bottom"===n&&(t-=e/2),t}(n.y||0,vo(r),n.textBaseline),s={"dominant-baseline":"central","text-anchor":nr[n.textAlign]||n.textAlign};if(ql(n)){var l="",u=n.fontStyle,h=Zl(n.fontSize);if(!parseFloat(h))return;var c=n.fontFamily||N,d=n.fontWeight;l+="font-size:"+h+";font-family:"+c+";",u&&"normal"!==u&&(l+="font-style:"+u+";"),d&&"normal"!==d&&(l+="font-weight:"+d+";"),s.style=l}else s.style="font: "+r;return i.match(/\s/)&&(s["xml:space"]="preserve"),o&&(s.x=o),a&&(s.y=a),yP(s,t.transform),mP(s,n,t,e),vP(s,t),e.animation&&cP(t,s,e),$I("text",t.id+"",s,void 0,i)}}(t,e):void 0}function LP(t,e,n,i){var r,o=t[n],a={gradientUnits:o.global?"userSpaceOnUse":"objectBoundingBox"};if(or(o))r="linearGradient",a.x1=o.x,a.y1=o.y,a.x2=o.x2,a.y2=o.y2;else{if(!ar(o))return void 0;r="radialGradient",a.cx=Ot(o.x,.5),a.cy=Ot(o.y,.5),a.r=Ot(o.r,.5)}for(var s=o.colorStops,l=[],u=0,h=s.length;ul?UP(t,null==n[c+1]?null:n[c+1].elm,n,s,c):WP(t,e,a,l))}(n,i,r):FP(r)?(FP(t.text)&&kP(n,""),UP(n,null,r,0,r.length-1)):FP(i)?WP(n,i,0,i.length-1):FP(t.text)&&kP(n,""):t.text!==e.text&&(FP(i)&&WP(n,i,0,i.length-1),kP(n,e.text)))}var XP=0,qP=function(){function t(t,e,n){if(this.type="svg",this.refreshHover=function(){0},this.configLayer=function(){0},this.storage=e,this._opts=n=rt({},n),this.root=t,this._id="zr"+XP++,this._oldVNode=eP(n.width,n.height),t&&!n.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var r=this._svgDom=this._oldVNode.elm=JI("svg");jP(null,this._oldVNode),i.appendChild(r),t.appendChild(i)}this.resize(n.width,n.height)}return t.prototype.getType=function(){return this.type},t.prototype.getViewportRoot=function(){return this._viewport},t.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},t.prototype.getSvgDom=function(){return this._svgDom},t.prototype.refresh=function(){if(this.root){var t=this.renderToVNode({willUpdate:!0});t.attrs.style="position:absolute;left:0;top:0;user-select:none",function(t,e){if(GP(t,e))ZP(t,e);else{var n=t.elm,i=NP(n);HP(e),null!==i&&(PP(i,e.elm,RP(n)),WP(i,[t],0,0))}}(this._oldVNode,t),this._oldVNode=t}},t.prototype.renderOneToVNode=function(t){return CP(t,tP(this._id))},t.prototype.renderToVNode=function(t){t=t||{};var e=this.storage.getDisplayList(!0),n=this._width,i=this._height,r=tP(this._id);r.animation=t.animation,r.willUpdate=t.willUpdate,r.compress=t.compress,r.emphasis=t.emphasis,r.ssr=this._opts.ssr;var o=[],a=this._bgVNode=function(t,e,n,i){var r;if(n&&"none"!==n)if(r=$I("rect","bg",{width:t,height:e,x:"0",y:"0"}),sr(n))LP({fill:n},r.attrs,"fill",i);else if(rr(n))AP({style:{fill:n},dirty:Kt,getBoundingRect:function(){return{width:t,height:e}}},r.attrs,"fill",i);else{var o=Ji(n),a=o.color,s=o.opacity;r.attrs.fill=a,s<1&&(r.attrs["fill-opacity"]=s)}return r}(n,i,this._backgroundColor,r);a&&o.push(a);var s=t.compress?null:this._mainVNode=$I("g","main",{},[]);this._paintList(e,r,s?s.children:o),s&&o.push(s);var l=dt(mt(r.defs),(function(t){return r.defs[t]}));if(l.length&&o.push($I("defs","defs",{},l)),t.animation){var u=function(t,e,n){var i=(n=n||{}).newline?"\n":"",r=" {"+i,o=i+"}",a=dt(mt(t),(function(e){return e+r+dt(mt(t[e]),(function(n){return n+":"+t[e][n]+";"})).join(i)+o})).join(i),s=dt(mt(e),(function(t){return"@keyframes "+t+r+dt(mt(e[t]),(function(n){return n+r+dt(mt(e[t][n]),(function(i){var r=e[t][n][i];return"d"===i&&(r='path("'+r+'")'),i+":"+r+";"})).join(i)+o})).join(i)+o})).join(i);return a||s?[""].join(i):""}(r.cssNodes,r.cssAnims,{newline:!0});if(u){var h=$I("style","stl",{},[],u);o.push(h)}}return eP(n,i,o,t.useViewBox)},t.prototype.renderToString=function(t){return t=t||{},QI(this.renderToVNode({animation:Ot(t.cssAnimation,!0),emphasis:Ot(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:Ot(t.useViewBox,!0)}),{newline:!0})},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t},t.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},t.prototype._paintList=function(t,e,n){for(var i,r,o=t.length,a=[],s=0,l=0,u=0;u=0&&(!c||!r||c[p]!==r[p]);p--);for(var g=f-1;g>p;g--)i=a[--s-1];for(var m=p+1;m=a)}}for(var h=this.__startIndex;h15)break}n.prevElClipPaths&&c.restore()};if(f)if(0===f.length)s=l.__endIndex;else for(var x=d.dpr,w=0;w0&&t>i[0]){for(s=0;st);s++);a=n[i[s]]}if(i.splice(s+1,0,t),n[t]=e,!e.virtual)if(a){var l=a.dom;l.nextSibling?o.insertBefore(e.dom,l.nextSibling):o.appendChild(e.dom)}else o.firstChild?o.insertBefore(e.dom,o.firstChild):o.appendChild(e.dom);e.painter||(e.painter=this)}},t.prototype.eachLayer=function(t,e){for(var n=this._zlevelList,i=0;i0?eE:0),this._needsManuallyCompositing),u.__builtin__||tt("ZLevel "+l+" has been used by unkown layer "+u.id),u!==o&&(u.__used=!0,u.__startIndex!==r&&(u.__dirty=!0),u.__startIndex=r,u.incremental?u.__drawIndex=-1:u.__drawIndex=r,e(r),o=u),s.__dirty&kn&&!s.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=r))}e(r),this.eachBuiltinLayer((function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)}))},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(t){t.clear()},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t,ct(this._layers,(function(t){t.setUnpainted()}))},t.prototype.configLayer=function(t,e){if(e){var n=this._layerConfig;n[t]?nt(n[t],e,!0):n[t]=e;for(var i=0;i=400?t.onerror&&t.onerror():t.onload&&t.onload(e.response)},t.onerror&&(e.onerror=t.onerror),e.send(null)}};var vO,_O={supportWebGL:function(){if(null==vO)try{var t=document.createElement("canvas");if(!(t.getContext("webgl")||t.getContext("experimental-webgl")))throw new Error}catch(t){vO=!1}return vO}};_O.Int8Array="undefined"==typeof Int8Array?Array:Int8Array,_O.Uint8Array="undefined"==typeof Uint8Array?Array:Uint8Array,_O.Uint16Array="undefined"==typeof Uint16Array?Array:Uint16Array,_O.Uint32Array="undefined"==typeof Uint32Array?Array:Uint32Array,_O.Int16Array="undefined"==typeof Int16Array?Array:Int16Array,_O.Float32Array="undefined"==typeof Float32Array?Array:Float32Array,_O.Float64Array="undefined"==typeof Float64Array?Array:Float64Array;var yO={};"undefined"!=typeof window?yO=window:void 0!==n.g&&(yO=n.g),_O.requestAnimationFrame=yO.requestAnimationFrame||yO.msRequestAnimationFrame||yO.mozRequestAnimationFrame||yO.webkitRequestAnimationFrame||function(t){setTimeout(t,16)},_O.createCanvas=function(){return document.createElement("canvas")},_O.createImage=function(){return new yO.Image},_O.request={get:mO.get},_O.addEventListener=function(t,e,n,i){t.addEventListener(e,n,i)},_O.removeEventListener=function(t,e,n){t.removeEventListener(e,n)};const xO=_O;var wO=function(){this.head=null,this.tail=null,this._length=0};wO.prototype.insert=function(t){var e=new wO.Entry(t);return this.insertEntry(e),e},wO.prototype.insertAt=function(t,e){if(!(t<0)){for(var n=this.head,i=0;n&&i!=t;)n=n.next,i++;if(n){var r=new wO.Entry(e),o=n.prev;o?(o.next=r,r.prev=o):this.head=r,r.next=n,n.prev=r}else this.insert(e)}},wO.prototype.insertBeforeEntry=function(t,e){var n=new wO.Entry(t),i=e.prev;i?(i.next=n,n.prev=i):this.head=n,n.next=e,e.prev=n,this._length++},wO.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,this.tail=t):this.head=this.tail=t,this._length++},wO.prototype.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._length--},wO.prototype.removeAt=function(t){if(!(t<0)){for(var e=this.head,n=0;e&&n!=t;)e=e.next,n++;return e?(this.remove(e),e.value):void 0}},wO.prototype.getHead=function(){if(this.head)return this.head.value},wO.prototype.getTail=function(){if(this.tail)return this.tail.value},wO.prototype.getAt=function(t){if(!(t<0)){for(var e=this.head,n=0;e&&n!=t;)e=e.next,n++;return e.value}},wO.prototype.indexOf=function(t){for(var e=this.head,n=0;e;){if(e.value===t)return n;e=e.next,n++}},wO.prototype.length=function(){return this._length},wO.prototype.isEmpty=function(){return 0===this._length},wO.prototype.forEach=function(t,e){for(var n=this.head,i=0,r=void 0!==e;n;)r?t.call(e,n.value,i):t(n.value,i),n=n.next,i++},wO.prototype.clear=function(){this.tail=this.head=null,this._length=0},wO.Entry=function(t){this.value=t,this.next=null,this.prev=null};const bO=wO;var TO=function(t){this._list=new bO,this._map={},this._maxSize=t||10};TO.prototype.setMaxSize=function(t){this._maxSize=t},TO.prototype.put=function(t,e){if(!this._map.hasOwnProperty(t)){var n=this._list.length();if(n>=this._maxSize&&n>0){var i=this._list.head;this._list.remove(i),delete this._map[i.key]}var r=this._list.insert(e);r.key=t,this._map[t]=r}},TO.prototype.get=function(t){var e=this._map[t];if(this._map.hasOwnProperty(t))return e!==this._list.tail&&(this._list.remove(e),this._list.insertEntry(e)),e.value},TO.prototype.remove=function(t){var e=this._map[t];void 0!==e&&(delete this._map[t],this._list.remove(e))},TO.prototype.clear=function(){this._list.clear(),this._map={}};const SO=TO;var MO={},CO={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 LO(t){return(t=Math.round(t))<0?0:t>255?255:t}function AO(t){return t<0?0:t>1?1:t}function DO(t){return t.length&&"%"===t.charAt(t.length-1)?LO(parseFloat(t)/100*255):LO(parseInt(t,10))}function IO(t){return t.length&&"%"===t.charAt(t.length-1)?AO(parseFloat(t)/100):AO(parseFloat(t))}function PO(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function EO(t,e,n){return t+(e-t)*n}function OO(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function NO(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var RO=new SO(20),kO=null;function zO(t,e){kO&&NO(kO,e),kO=RO.put(t,kO||e.slice())}function BO(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=IO(t[1]),r=IO(t[2]),o=r<=.5?r*(i+1):r+i-r*i,a=2*r-o;return OO(e=e||[],LO(255*PO(a,o,n+1/3)),LO(255*PO(a,o,n)),LO(255*PO(a,o,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}MO.parse=function(t,e){if(t){e=e||[];var n=RO.get(t);if(n)return NO(e,n);var i,r=(t+="").replace(/ /g,"").toLowerCase();if(r in CO)return NO(e,CO[r]),zO(t,e),e;if("#"===r.charAt(0))return 4===r.length?(i=parseInt(r.substr(1),16))>=0&&i<=4095?(OO(e,(3840&i)>>4|(3840&i)>>8,240&i|(240&i)>>4,15&i|(15&i)<<4,1),zO(t,e),e):void OO(e,0,0,0,1):7===r.length?(i=parseInt(r.substr(1),16))>=0&&i<=16777215?(OO(e,(16711680&i)>>16,(65280&i)>>8,255&i,1),zO(t,e),e):void OO(e,0,0,0,1):void 0;var o=r.indexOf("("),a=r.indexOf(")");if(-1!==o&&a+1===r.length){var s=r.substr(0,o),l=r.substr(o+1,a-(o+1)).split(","),u=1;switch(s){case"rgba":if(4!==l.length)return void OO(e,0,0,0,1);u=IO(l.pop());case"rgb":return 3!==l.length?void OO(e,0,0,0,1):(OO(e,DO(l[0]),DO(l[1]),DO(l[2]),u),zO(t,e),e);case"hsla":return 4!==l.length?void OO(e,0,0,0,1):(l[3]=IO(l[3]),BO(l,e),zO(t,e),e);case"hsl":return 3!==l.length?void OO(e,0,0,0,1):(BO(l,e),zO(t,e),e);default:return}}OO(e,0,0,0,1)}},MO.parseToFloat=function(t,e){if(e=MO.parse(t,e))return e[0]/=255,e[1]/=255,e[2]/=255,e},MO.lift=function(t,e){var n=MO.parse(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0;return MO.stringify(n,4===n.length?"rgba":"rgb")}},MO.toHex=function(t){var e=MO.parse(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)},MO.fastLerp=function(t,e,n){if(e&&e.length&&t>=0&&t<=1){n=n||[];var i=t*(e.length-1),r=Math.floor(i),o=Math.ceil(i),a=e[r],s=e[o],l=i-r;return n[0]=LO(EO(a[0],s[0],l)),n[1]=LO(EO(a[1],s[1],l)),n[2]=LO(EO(a[2],s[2],l)),n[3]=AO(EO(a[3],s[3],l)),n}},MO.fastMapToColor=MO.fastLerp,MO.lerp=function(t,e,n){if(e&&e.length&&t>=0&&t<=1){var i=t*(e.length-1),r=Math.floor(i),o=Math.ceil(i),a=MO.parse(e[r]),s=MO.parse(e[o]),l=i-r,u=MO.stringify([LO(EO(a[0],s[0],l)),LO(EO(a[1],s[1],l)),LO(EO(a[2],s[2],l)),AO(EO(a[3],s[3],l))],"rgba");return n?{color:u,leftIndex:r,rightIndex:o,value:i}:u}},MO.mapToColor=MO.lerp,MO.modifyHSL=function(t,e,n,i){if(t=MO.parse(t))return t=function(t){if(t){var e,n,i=t[0]/255,r=t[1]/255,o=t[2]/255,a=Math.min(i,r,o),s=Math.max(i,r,o),l=s-a,u=(s+a)/2;if(0===l)e=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var h=((s-i)/6+l/2)/l,c=((s-r)/6+l/2)/l,d=((s-o)/6+l/2)/l;i===s?e=d-c:r===s?e=1/3+h-d:o===s&&(e=2/3+c-h),e<0&&(e+=1),e>1&&(e-=1)}var f=[360*e,n,u];return null!=t[3]&&f.push(t[3]),f}}(t),null!=e&&(t[0]=(r=e,(r=Math.round(r))<0?0:r>360?360:r)),null!=n&&(t[1]=IO(n)),null!=i&&(t[2]=IO(i)),MO.stringify(BO(t),"rgba");var r},MO.modifyAlpha=function(t,e){if((t=MO.parse(t))&&null!=e)return t[3]=AO(e),MO.stringify(t,"rgba")},MO.stringify=function(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}};var FO=MO.parseToFloat,VO={};function GO(t){var e=Object.keys(t);e.sort();for(var n=[],i=0;i=0},getEnabledUniforms:function(){return this._enabledUniforms},getTextureUniforms:function(){return this._textureUniforms},set:function(t,e){if("object"==typeof t)for(var n in t){var i=t[n];this.setUniform(n,i)}else this.setUniform(t,e)},get:function(t){var e=this.uniforms[t];if(e)return e.value},attachShader:function(t,e){var n=this.uniforms;this.uniforms=t.createUniforms(),this.shader=t;var i=this.uniforms;this._enabledUniforms=Object.keys(i),this._enabledUniforms.sort(),this._textureUniforms=this._enabledUniforms.filter((function(t){var e=this.uniforms[t].type;return"t"===e||"tv"===e}),this);var r=this.vertexDefines,o=this.fragmentDefines;if(this.vertexDefines=gE.clone(t.vertexDefines),this.fragmentDefines=gE.clone(t.fragmentDefines),e){for(var a in n)i[a]&&(i[a].value=n[a].value);gE.defaults(this.vertexDefines,r),gE.defaults(this.fragmentDefines,o)}var s={};for(var l in t.textures)s[l]={shaderType:t.textures[l].shaderType,type:t.textures[l].type,enabled:!(!e||!this._textureStatus[l])&&this._textureStatus[l].enabled};this._textureStatus=s,this._programKey=""},clone:function(){var t=new this.constructor({name:this.name,shader:this.shader});for(var e in this.uniforms)t.uniforms[e].value=this.uniforms[e].value;return t.depthTest=this.depthTest,t.depthMask=this.depthMask,t.transparent=this.transparent,t.blend=this.blend,t.vertexDefines=gE.clone(this.vertexDefines),t.fragmentDefines=gE.clone(this.fragmentDefines),t.enableTexture(this.getEnabledTextures()),t.precision=this.precision,t},define:function(t,e,n){var i=this.vertexDefines,r=this.fragmentDefines;"vertex"!==t&&"fragment"!==t&&"both"!==t&&arguments.length<3&&(n=e,e=t,t="both"),n=null!=n?n:null,"vertex"!==t&&"both"!==t||i[e]!==n&&(i[e]=n,this._programKey=""),"fragment"!==t&&"both"!==t||r[e]!==n&&(r[e]=n,"both"!==t&&(this._programKey=""))},undefine:function(t,e){"vertex"!==t&&"fragment"!==t&&"both"!==t&&arguments.length<2&&(e=t,t="both"),"vertex"!==t&&"both"!==t||this.isDefined("vertex",e)&&(delete this.vertexDefines[e],this._programKey=""),"fragment"!==t&&"both"!==t||this.isDefined("fragment",e)&&(delete this.fragmentDefines[e],"both"!==t&&(this._programKey=""))},isDefined:function(t,e){switch(t){case"vertex":return void 0!==this.vertexDefines[e];case"fragment":return void 0!==this.fragmentDefines[e]}},getDefine:function(t,e){switch(t){case"vertex":return this.vertexDefines[e];case"fragment":return this.fragmentDefines[e]}},enableTexture:function(t){if(Array.isArray(t))for(var e=0;e0&&(r=1/Math.sqrt(r),t[0]=e[0]*r,t[1]=e[1]*r),t},XO.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},XO.cross=function(t,e,n){var i=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=i,t},XO.lerp=function(t,e,n,i){var r=e[0],o=e[1];return t[0]=r+i*(n[0]-r),t[1]=o+i*(n[1]-o),t},XO.random=function(t,e){e=e||1;var n=2*GLMAT_RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},XO.transformMat2=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r,t[1]=n[1]*i+n[3]*r,t},XO.transformMat2d=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r+n[4],t[1]=n[1]*i+n[3]*r+n[5],t},XO.transformMat3=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[3]*r+n[6],t[1]=n[1]*i+n[4]*r+n[7],t},XO.transformMat4=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[4]*r+n[12],t[1]=n[1]*i+n[5]*r+n[13],t},XO.forEach=(UO=XO.create(),function(t,e,n,i,r,o){var a,s;for(e||(e=2),n||(n=0),s=i?Math.min(i*e+n,t.length):t.length,a=n;a0&&i.push("#define "+r.toUpperCase()+"_COUNT "+o)}if(n)for(var a=0;al.getMaxJointNumber()&&(d.USE_SKIN_MATRICES_TEXTURE=null),c+="\n"+aN(d)+"\n"}o&&(c+="\n#define INSTANCING\n");var f=c+aN(e.vertexDefines,s,h),p=c+aN(e.fragmentDefines,s,h),g=f+"\n"+e.shader.vertex,m=["OES_standard_derivatives","EXT_shader_texture_lod"].filter((function(t){return null!=l.getGLExtension(t)}));m.indexOf("EXT_shader_texture_lod")>=0&&(p+="\n#define SUPPORT_TEXTURE_LOD"),m.indexOf("OES_standard_derivatives")>=0&&(p+="\n#define SUPPORT_STANDARD_DERIVATIVES");var v,_,y=function(t){for(var e=[],n=0;n=0){if(1!==s&&4!==s){bN();break}s=2,u=[]}else if(1!==s)if(4!==s)h(c),s=0;else{var d=c;gN.indexOf(d)>=0||mN.indexOf(d)>=0||vN.indexOf(d)>=0?l[a].semantic=d:"ignore"===d||"unconfigurable"===d?l[a].ignore=!0:l[a].value="bool"===t?"true"===d:parseFloat(d)}else l[a].value="bool"===t?"true"===c:parseFloat(c),u=null;else{if(2!==s){bN();break}if(!(u instanceof Array)){bN();break}u.push(+i[++o])}else l[a].value=new xO.Float32Array(u),u=null,s=5;else if(2===s){if(!(u instanceof Array)){bN();break}u.push(+i[++o])}else s=5;else s=4;else{if(0!==s&&3!==s){bN();break}s=1}}return l}function SN(t,e){"object"==typeof t&&(e=t.fragment,t=t.vertex),t=wN(t),e=wN(e),this._shaderID=function(t,e){var n="vertex:"+t+"fragment:"+e;if(yN[n])return yN[n];var i=gE.genGUID();return yN[n]=i,xN[i]={vertex:t,fragment:e},i}(t,e),this._vertexCode=SN.parseImport(t),this._fragmentCode=SN.parseImport(e),this.attributeSemantics={},this.matrixSemantics={},this.uniformSemantics={},this.matrixSemanticKeys=[],this.uniformTemplates={},this.attributes={},this.textures={},this.vertexDefines={},this.fragmentDefines={},this._parseAttributes(),this._parseUniforms(),this._parseDefines()}SN.prototype={constructor:SN,createUniforms:function(){var t={};for(var e in this.uniformTemplates){var n=this.uniformTemplates[e];t[e]={type:n.type,value:n.value()}}return t},_parseImport:function(){this._vertexCode=SN.parseImport(this.vertex),this._fragmentCode=SN.parseImport(this.fragment)},_addSemanticUniform:function(t,e,n){if(gN.indexOf(n)>=0)this.attributeSemantics[n]={symbol:t,type:e};else if(vN.indexOf(n)>=0){var i=!1,r=n;n.match(/TRANSPOSE$/)&&(i=!0,r=n.slice(0,-9)),this.matrixSemantics[n]={symbol:t,type:e,isTranspose:i,semanticNoTranspose:r}}else mN.indexOf(n)>=0&&(this.uniformSemantics[n]={symbol:t,type:e})},_addMaterialUniform:function(t,e,n,i,r,o){o[t]={type:n,value:r?pN.array:i||pN[e],semantic:null}},_parseUniforms:function(){var t={},e=this,n="vertex";function i(t){return null!=t?function(){return t}:null}function r(r,o,a){var s=TN(o,a),l=[];for(var u in s){var h=s[u],c=h.semantic,d=u,f=dN[o],p=i(s[u].value);s[u].isArray&&(d+="["+s[u].arraySize+"]",f+="v"),l.push(d),e._uniformList.push(u),h.ignore||("sampler2D"!==o&&"samplerCube"!==o||(e.textures[u]={shaderType:n,type:o}),c?e._addSemanticUniform(u,f,c):e._addMaterialUniform(u,o,f,p,s[u].isArray,t))}return l.length>0?"uniform "+o+" "+l.join(",")+";\n":""}this._uniformList=[],this._vertexCode=this._vertexCode.replace(uN,r),n="fragment",this._fragmentCode=this._fragmentCode.replace(uN,r),e.matrixSemanticKeys=Object.keys(this.matrixSemantics),this.uniformTemplates=t},_parseAttributes:function(){var t={},e=this;this._vertexCode=this._vertexCode.replace(hN,(function(n,i,r){var o=TN(i,r),a=_N[i]||1,s=[];for(var l in o){var u=o[l].semantic;if(t[l]={type:"float",size:a,semantic:u||null},u){if(gN.indexOf(u)<0)throw new Error('Unkown semantic "'+u+'"');e.attributeSemantics[u]={symbol:l,type:i}}s.push(l)}return"attribute "+i+" "+s.join(",")+";\n"})),this.attributes=t},_parseDefines:function(){var t=this,e="vertex";function n(n,i,r){var o="vertex"===e?t.vertexDefines:t.fragmentDefines;return o[i]||(o[i]="false"!==r&&("true"===r||(r?isNaN(parseFloat(r))?r.trim():parseFloat(r):null))),""}this._vertexCode=this._vertexCode.replace(cN,n),e="fragment",this._fragmentCode=this._fragmentCode.replace(cN,n)},clone:function(){var t=xN[this._shaderID];return new SN(t.vertex,t.fragment)}},Object.defineProperty&&(Object.defineProperty(SN.prototype,"shaderID",{get:function(){return this._shaderID}}),Object.defineProperty(SN.prototype,"vertex",{get:function(){return this._vertexCode}}),Object.defineProperty(SN.prototype,"fragment",{get:function(){return this._fragmentCode}}),Object.defineProperty(SN.prototype,"uniforms",{get:function(){return this._uniformList}}));var MN=/(@import)\s*([0-9a-zA-Z_\-\.]*)/g;SN.parseImport=function(t){return t=t.replace(MN,(function(t,e,n){return(t=SN.source(n))?SN.parseImport(t):(console.error('Shader chunk "'+n+'" not existed in library'),"")}))};var CN=/(@export)\s*([0-9a-zA-Z_\-\.]*)\s*\n([\s\S]*?)@end/g;SN.import=function(t){t.replace(CN,(function(t,e,n,i){if(i=i.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+\x24)/g,"")){for(var r,o=n.split("."),a=SN.codes,s=0;s 0.0) {\n if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {\n discard;\n }\n }\n gl_FragColor = vec4(0.0,0.0,0.0,1.0);\n}\n@end";var DN={create:function(){var t=new jO(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},clone:function(t){var e=new jO(16);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[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},transpose:function(t,e){if(t===e){var n=e[1],i=e[2],r=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=o,t[11]=e[14],t[12]=r,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},invert:function(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],h=e[8],c=e[9],d=e[10],f=e[11],p=e[12],g=e[13],m=e[14],v=e[15],_=n*s-i*a,y=n*l-r*a,x=n*u-o*a,w=i*l-r*s,b=i*u-o*s,T=r*u-o*l,S=h*g-c*p,M=h*m-d*p,C=h*v-f*p,L=c*m-d*g,A=c*v-f*g,D=d*v-f*m,I=_*D-y*A+x*L+w*C-b*M+T*S;return I?(I=1/I,t[0]=(s*D-l*A+u*L)*I,t[1]=(r*A-i*D-o*L)*I,t[2]=(g*T-m*b+v*w)*I,t[3]=(d*b-c*T-f*w)*I,t[4]=(l*C-a*D-u*M)*I,t[5]=(n*D-r*C+o*M)*I,t[6]=(m*x-p*T-v*y)*I,t[7]=(h*T-d*x+f*y)*I,t[8]=(a*A-s*C+u*S)*I,t[9]=(i*C-n*A-o*S)*I,t[10]=(p*b-g*x+v*_)*I,t[11]=(c*x-h*b-f*_)*I,t[12]=(s*M-a*L-l*S)*I,t[13]=(n*L-i*M+r*S)*I,t[14]=(g*y-p*w-m*_)*I,t[15]=(h*w-c*y+d*_)*I,t):null},adjoint:function(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],h=e[8],c=e[9],d=e[10],f=e[11],p=e[12],g=e[13],m=e[14],v=e[15];return t[0]=s*(d*v-f*m)-c*(l*v-u*m)+g*(l*f-u*d),t[1]=-(i*(d*v-f*m)-c*(r*v-o*m)+g*(r*f-o*d)),t[2]=i*(l*v-u*m)-s*(r*v-o*m)+g*(r*u-o*l),t[3]=-(i*(l*f-u*d)-s*(r*f-o*d)+c*(r*u-o*l)),t[4]=-(a*(d*v-f*m)-h*(l*v-u*m)+p*(l*f-u*d)),t[5]=n*(d*v-f*m)-h*(r*v-o*m)+p*(r*f-o*d),t[6]=-(n*(l*v-u*m)-a*(r*v-o*m)+p*(r*u-o*l)),t[7]=n*(l*f-u*d)-a*(r*f-o*d)+h*(r*u-o*l),t[8]=a*(c*v-f*g)-h*(s*v-u*g)+p*(s*f-u*c),t[9]=-(n*(c*v-f*g)-h*(i*v-o*g)+p*(i*f-o*c)),t[10]=n*(s*v-u*g)-a*(i*v-o*g)+p*(i*u-o*s),t[11]=-(n*(s*f-u*c)-a*(i*f-o*c)+h*(i*u-o*s)),t[12]=-(a*(c*m-d*g)-h*(s*m-l*g)+p*(s*d-l*c)),t[13]=n*(c*m-d*g)-h*(i*m-r*g)+p*(i*d-r*c),t[14]=-(n*(s*m-l*g)-a*(i*m-r*g)+p*(i*l-r*s)),t[15]=n*(s*d-l*c)-a*(i*d-r*c)+h*(i*l-r*s),t},determinant:function(t){var e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],s=t[6],l=t[7],u=t[8],h=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],m=t[15];return(e*a-n*o)*(c*m-d*g)-(e*s-i*o)*(h*m-d*p)+(e*l-r*o)*(h*g-c*p)+(n*s-i*a)*(u*m-d*f)-(n*l-r*a)*(u*g-c*f)+(i*l-r*s)*(u*p-h*f)},multiply:function(t,e,n){var i=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],m=e[13],v=e[14],_=e[15],y=n[0],x=n[1],w=n[2],b=n[3];return t[0]=y*i+x*s+w*c+b*g,t[1]=y*r+x*l+w*d+b*m,t[2]=y*o+x*u+w*f+b*v,t[3]=y*a+x*h+w*p+b*_,y=n[4],x=n[5],w=n[6],b=n[7],t[4]=y*i+x*s+w*c+b*g,t[5]=y*r+x*l+w*d+b*m,t[6]=y*o+x*u+w*f+b*v,t[7]=y*a+x*h+w*p+b*_,y=n[8],x=n[9],w=n[10],b=n[11],t[8]=y*i+x*s+w*c+b*g,t[9]=y*r+x*l+w*d+b*m,t[10]=y*o+x*u+w*f+b*v,t[11]=y*a+x*h+w*p+b*_,y=n[12],x=n[13],w=n[14],b=n[15],t[12]=y*i+x*s+w*c+b*g,t[13]=y*r+x*l+w*d+b*m,t[14]=y*o+x*u+w*f+b*v,t[15]=y*a+x*h+w*p+b*_,t},multiplyAffine:function(t,e,n){var i=e[0],r=e[1],o=e[2],a=e[4],s=e[5],l=e[6],u=e[8],h=e[9],c=e[10],d=e[12],f=e[13],p=e[14],g=n[0],m=n[1],v=n[2];return t[0]=g*i+m*a+v*u,t[1]=g*r+m*s+v*h,t[2]=g*o+m*l+v*c,g=n[4],m=n[5],v=n[6],t[4]=g*i+m*a+v*u,t[5]=g*r+m*s+v*h,t[6]=g*o+m*l+v*c,g=n[8],m=n[9],v=n[10],t[8]=g*i+m*a+v*u,t[9]=g*r+m*s+v*h,t[10]=g*o+m*l+v*c,g=n[12],m=n[13],v=n[14],t[12]=g*i+m*a+v*u+d,t[13]=g*r+m*s+v*h+f,t[14]=g*o+m*l+v*c+p,t}};DN.mul=DN.multiply,DN.mulAffine=DN.multiplyAffine,DN.translate=function(t,e,n){var i,r,o,a,s,l,u,h,c,d,f,p,g=n[0],m=n[1],v=n[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*v+e[12],t[13]=e[1]*g+e[5]*m+e[9]*v+e[13],t[14]=e[2]*g+e[6]*m+e[10]*v+e[14],t[15]=e[3]*g+e[7]*m+e[11]*v+e[15]):(i=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=e[8],d=e[9],f=e[10],p=e[11],t[0]=i,t[1]=r,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=u,t[7]=h,t[8]=c,t[9]=d,t[10]=f,t[11]=p,t[12]=i*g+s*m+c*v+e[12],t[13]=r*g+l*m+d*v+e[13],t[14]=o*g+u*m+f*v+e[14],t[15]=a*g+h*m+p*v+e[15]),t},DN.scale=function(t,e,n){var i=n[0],r=n[1],o=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},DN.rotate=function(t,e,n,i){var r,o,a,s,l,u,h,c,d,f,p,g,m,v,_,y,x,w,b,T,S,M,C,L,A=i[0],D=i[1],I=i[2],P=Math.sqrt(A*A+D*D+I*I);return Math.abs(P)0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t},PN.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},PN.cross=function(t,e,n){var i=e[0],r=e[1],o=e[2],a=n[0],s=n[1],l=n[2];return t[0]=r*l-o*s,t[1]=o*a-i*l,t[2]=i*s-r*a,t},PN.lerp=function(t,e,n,i){var r=e[0],o=e[1],a=e[2];return t[0]=r+i*(n[0]-r),t[1]=o+i*(n[1]-o),t[2]=a+i*(n[2]-a),t},PN.random=function(t,e){e=e||1;var n=2*ZO()*Math.PI,i=2*ZO()-1,r=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(n)*r,t[1]=Math.sin(n)*r,t[2]=i*e,t},PN.transformMat4=function(t,e,n){var i=e[0],r=e[1],o=e[2],a=n[3]*i+n[7]*r+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*i+n[4]*r+n[8]*o+n[12])/a,t[1]=(n[1]*i+n[5]*r+n[9]*o+n[13])/a,t[2]=(n[2]*i+n[6]*r+n[10]*o+n[14])/a,t},PN.transformMat3=function(t,e,n){var i=e[0],r=e[1],o=e[2];return t[0]=i*n[0]+r*n[3]+o*n[6],t[1]=i*n[1]+r*n[4]+o*n[7],t[2]=i*n[2]+r*n[5]+o*n[8],t},PN.transformQuat=function(t,e,n){var i=e[0],r=e[1],o=e[2],a=n[0],s=n[1],l=n[2],u=n[3],h=u*i+s*o-l*r,c=u*r+l*i-a*o,d=u*o+a*r-s*i,f=-a*i-s*r-l*o;return t[0]=h*u+f*-a+c*-l-d*-s,t[1]=c*u+f*-s+d*-a-h*-l,t[2]=d*u+f*-l+h*-s-c*-a,t},PN.rotateX=function(t,e,n,i){var r=[],o=[];return r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],o[0]=r[0],o[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),o[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},PN.rotateY=function(t,e,n,i){var r=[],o=[];return r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],o[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),o[1]=r[1],o[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},PN.rotateZ=function(t,e,n,i){var r=[],o=[];return r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],o[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),o[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),o[2]=r[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},PN.forEach=function(){var t=PN.create();return function(e,n,i,r,o,a){var s,l;for(n||(n=3),i||(i=0),l=r?Math.min(r*n+i,e.length):e.length,s=i;s1?0:Math.acos(r)};const EN=PN;LN.import(AN);var ON=IN.create,NN={};function RN(t){return t.material}function kN(t,e,n){return e.uniforms[n].value}function zN(t,e,n,i){return n!==i}function BN(t){return!0}function FN(){}var VN={float:jE,byte:FE,ubyte:VE,short:GE,ushort:HE};function GN(t,e,n){this.availableAttributes=t,this.availableAttributeSymbols=e,this.indicesBuffer=n,this.vao=null}function HN(t){var e,n;this.bind=function(t){e||((e=xO.createCanvas()).width=e.height=1,e.getContext("2d"));var i=t.gl,r=!n;r&&(n=i.createTexture()),i.bindTexture(i.TEXTURE_2D,n),r&&i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e)},this.unbind=function(t){t.gl.bindTexture(t.gl.TEXTURE_2D,null)},this.isRenderable=function(){return!0}}var UN=vE.extend((function(){return{canvas:null,_width:100,_height:100,devicePixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1,clearColor:[0,0,0,0],clearBit:17664,alpha:!0,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,throwError:!0,gl:null,viewport:{},maxJointNumber:20,__currentFrameBuffer:null,_viewportStack:[],_clearStack:[],_sceneRendering:null}}),(function(){this.canvas||(this.canvas=xO.createCanvas());var t=this.canvas;try{var e={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,preserveDrawingBuffer:this.preserveDrawingBuffer};if(this.gl=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),!this.gl)throw new Error;this._glinfo=new xE(this.gl),this.gl.targetRenderer&&console.error("Already created a renderer"),this.gl.targetRenderer=this,this.resize()}catch(t){throw"Error creating WebGL Context "+t}this._programMgr=new lN(this),this._placeholderTexture=new HN(this)}),{resize:function(t,e){var n=this.canvas,i=this.devicePixelRatio;null!=t?(n.style&&(n.style.width=t+"px",n.style.height=e+"px"),n.width=t*i,n.height=e*i,this._width=t,this._height=e):(this._width=n.width/i,this._height=n.height/i),this.setViewport(0,0,this._width,this._height)},getWidth:function(){return this._width},getHeight:function(){return this._height},getViewportAspect:function(){var t=this.viewport;return t.width/t.height},setDevicePixelRatio:function(t){this.devicePixelRatio=t,this.resize(this._width,this._height)},getDevicePixelRatio:function(){return this.devicePixelRatio},getGLExtension:function(t){return this._glinfo.getExtension(t)},getGLParameter:function(t){return this._glinfo.getParameter(t)},setViewport:function(t,e,n,i,r){if("object"==typeof t){var o=t;t=o.x,e=o.y,n=o.width,i=o.height,r=o.devicePixelRatio}r=r||this.devicePixelRatio,this.gl.viewport(t*r,e*r,n*r,i*r),this.viewport={x:t,y:e,width:n,height:i,devicePixelRatio:r}},saveViewport:function(){this._viewportStack.push(this.viewport)},restoreViewport:function(){this._viewportStack.length>0&&this.setViewport(this._viewportStack.pop())},saveClear:function(){this._clearStack.push({clearBit:this.clearBit,clearColor:this.clearColor})},restoreClear:function(){if(this._clearStack.length>0){var t=this._clearStack.pop();this.clearColor=t.clearColor,this.clearBit=t.clearBit}},bindSceneRendering:function(t){this._sceneRendering=t},render:function(t,e,n,i){var r=this.gl,o=this.clearColor;if(this.clearBit){r.colorMask(!0,!0,!0,!0),r.depthMask(!0);var a=this.viewport,s=!1,l=a.devicePixelRatio;(a.width!==this._width||a.height!==this._height||l&&l!==this.devicePixelRatio||a.x||a.y)&&(s=!0,r.enable(r.SCISSOR_TEST),r.scissor(a.x*l,a.y*l,a.width*l,a.height*l)),r.clearColor(o[0],o[1],o[2],o[3]),r.clear(this.clearBit),s&&r.disable(r.SCISSOR_TEST)}if(n||t.update(!1),t.updateLights(),e=e||t.getMainCamera()){e.update();var u=t.updateRenderList(e,!0);this._sceneRendering=t;var h=u.opaque,c=u.transparent,d=t.material;t.trigger("beforerender",this,t,e,u),i?(this.renderPreZ(h,t,e),r.depthFunc(r.LEQUAL)):r.depthFunc(r.LESS);for(var f=ON(),p=EN.create(),g=0;g0){var s=t[r-1],l=s.joints?s.joints.length:0;if((o.joints?o.joints.length:0)===l&&o.material===s.material&&o.lightGroup===s.lightGroup){o.__program=s.__program;continue}}var u=this._programMgr.getProgram(o,a,e);this.validateProgram(u),o.__program=u}},renderPass:function(t,e,n){this.trigger("beforerenderpass",this,t,e,n),(n=n||{}).getMaterial=n.getMaterial||RN,n.getUniform=n.getUniform||kN,n.isMaterialChanged=n.isMaterialChanged||zN,n.beforeRender=n.beforeRender||FN,n.afterRender=n.afterRender||FN;var i=n.ifRender||BN;this.updatePrograms(t,this._sceneRendering,n),n.sortCompare&&t.sort(n.sortCompare);var r=this.viewport,o=r.devicePixelRatio,a=[r.x*o,r.y*o,r.width*o,r.height*o],s=this.devicePixelRatio,l=this.__currentFrameBuffer?[this.__currentFrameBuffer.getTextureWidth(),this.__currentFrameBuffer.getTextureHeight()]:[this._width*s,this._height*s],u=[a[2],a[3]],h=Date.now();e?(IN.copy(WN.VIEW,e.viewMatrix.array),IN.copy(WN.PROJECTION,e.projectionMatrix.array),IN.copy(WN.VIEWINVERSE,e.worldTransform.array)):(IN.identity(WN.VIEW),IN.identity(WN.PROJECTION),IN.identity(WN.VIEWINVERSE)),IN.multiply(WN.VIEWPROJECTION,WN.PROJECTION,WN.VIEW),IN.invert(WN.PROJECTIONINVERSE,WN.PROJECTION),IN.invert(WN.VIEWPROJECTIONINVERSE,WN.VIEWPROJECTION);for(var c,d,f,p,g,m,v,_,y,x,w,b,T=this.gl,S=this._sceneRendering,M=null,C=0;Cthis.getMaxJointNumber()){var o=r.getSubSkinMatricesTexture(t.__uid__,t.joints);e.useTextureSlot(this,o,n),e.setUniform(i,"1i","skinMatricesTexture",n),e.setUniform(i,"1f","skinMatricesTextureSize",o.width)}else{var a=r.getSubSkinMatrices(t.__uid__,t.joints);e.setUniformOfSemantic(i,"SKIN_MATRIX",a)}},_renderObject:function(t,e,n){var i=this.gl,r=t.geometry,o=t.mode;null==o&&(o=4);var a=null,s=t.isInstancedMesh&&t.isInstancedMesh();if(!s||(a=this.getGLExtension("ANGLE_instanced_arrays"))){var l;if(s&&(l=this._bindInstancedAttributes(t,n,a)),e.indicesBuffer){var u=this.getGLExtension("OES_element_index_uint")&&r.indices instanceof Uint32Array?i.UNSIGNED_INT:i.UNSIGNED_SHORT;s?a.drawElementsInstancedANGLE(o,e.indicesBuffer.count,u,0,t.getInstanceCount()):i.drawElements(o,e.indicesBuffer.count,u,0)}else s?a.drawArraysInstancedANGLE(o,0,r.vertexCount,t.getInstanceCount()):i.drawArrays(o,0,r.vertexCount);if(s)for(var h=0;hn?n:t}ZN.add=function(t,e,n){return EN.add(t.array,e.array,n.array),t._dirty=!0,t},ZN.set=function(t,e,n,i){EN.set(t.array,e,n,i),t._dirty=!0},ZN.copy=function(t,e){return EN.copy(t.array,e.array),t._dirty=!0,t},ZN.cross=function(t,e,n){return EN.cross(t.array,e.array,n.array),t._dirty=!0,t},ZN.distance=ZN.dist=function(t,e){return EN.distance(t.array,e.array)},ZN.div=function(t,e,n){return EN.divide(t.array,e.array,n.array),t._dirty=!0,t},ZN.divide=ZN.div,ZN.dot=function(t,e){return EN.dot(t.array,e.array)},ZN.len=function(t){return EN.length(t.array)},ZN.lerp=function(t,e,n,i){return EN.lerp(t.array,e.array,n.array,i),t._dirty=!0,t},ZN.min=function(t,e,n){return EN.min(t.array,e.array,n.array),t._dirty=!0,t},ZN.max=function(t,e,n){return EN.max(t.array,e.array,n.array),t._dirty=!0,t},ZN.mul=function(t,e,n){return EN.multiply(t.array,e.array,n.array),t._dirty=!0,t},ZN.multiply=ZN.mul,ZN.negate=function(t,e){return EN.negate(t.array,e.array),t._dirty=!0,t},ZN.normalize=function(t,e){return EN.normalize(t.array,e.array),t._dirty=!0,t},ZN.random=function(t,e){return EN.random(t.array,e),t._dirty=!0,t},ZN.scale=function(t,e,n){return EN.scale(t.array,e.array,n),t._dirty=!0,t},ZN.scaleAndAdd=function(t,e,n,i){return EN.scaleAndAdd(t.array,e.array,n.array,i),t._dirty=!0,t},ZN.squaredDistance=ZN.sqrDist=function(t,e){return EN.sqrDist(t.array,e.array)},ZN.squaredLength=ZN.sqrLen=function(t){return EN.sqrLen(t.array)},ZN.sub=function(t,e,n){return EN.subtract(t.array,e.array,n.array),t._dirty=!0,t},ZN.subtract=ZN.sub,ZN.transformMat3=function(t,e,n){return EN.transformMat3(t.array,e.array,n.array),t._dirty=!0,t},ZN.transformMat4=function(t,e,n){return EN.transformMat4(t.array,e.array,n.array),t._dirty=!0,t},ZN.transformQuat=function(t,e,n){return EN.transformQuat(t.array,e.array,n.array),t._dirty=!0,t};var KN=Math.atan2,JN=Math.asin,$N=Math.abs;ZN.eulerFromQuat=function(t,e,n){t._dirty=!0,e=e.array;var i=t.array,r=e[0],o=e[1],a=e[2],s=e[3],l=r*r,u=o*o,h=a*a,c=s*s;switch(n=(n||"XYZ").toUpperCase()){case"XYZ":i[0]=KN(2*(r*s-o*a),c-l-u+h),i[1]=JN(YN(2*(r*a+o*s),-1,1)),i[2]=KN(2*(a*s-r*o),c+l-u-h);break;case"YXZ":i[0]=JN(YN(2*(r*s-o*a),-1,1)),i[1]=KN(2*(r*a+o*s),c-l-u+h),i[2]=KN(2*(r*o+a*s),c-l+u-h);break;case"ZXY":i[0]=JN(YN(2*(r*s+o*a),-1,1)),i[1]=KN(2*(o*s-a*r),c-l-u+h),i[2]=KN(2*(a*s-r*o),c-l+u-h);break;case"ZYX":i[0]=KN(2*(r*s+a*o),c-l-u+h),i[1]=JN(YN(2*(o*s-r*a),-1,1)),i[2]=KN(2*(r*o+a*s),c+l-u-h);break;case"YZX":i[0]=KN(2*(r*s-a*o),c-l+u-h),i[1]=KN(2*(o*s-r*a),c+l-u-h),i[2]=JN(YN(2*(r*o+a*s),-1,1));break;case"XZY":i[0]=KN(2*(r*s+o*a),c-l+u-h),i[1]=KN(2*(r*a+o*s),c+l-u-h),i[2]=JN(YN(2*(a*s-r*o),-1,1));break;default:console.warn("Unkown order: "+n)}return t},ZN.eulerFromMat3=function(t,e,n){var i=e.array,r=i[0],o=i[3],a=i[6],s=i[1],l=i[4],u=i[7],h=i[2],c=i[5],d=i[8],f=t.array;switch(n=(n||"XYZ").toUpperCase()){case"XYZ":f[1]=JN(YN(a,-1,1)),$N(a)<.99999?(f[0]=KN(-u,d),f[2]=KN(-o,r)):(f[0]=KN(c,l),f[2]=0);break;case"YXZ":f[0]=JN(-YN(u,-1,1)),$N(u)<.99999?(f[1]=KN(a,d),f[2]=KN(s,l)):(f[1]=KN(-h,r),f[2]=0);break;case"ZXY":f[0]=JN(YN(c,-1,1)),$N(c)<.99999?(f[1]=KN(-h,d),f[2]=KN(-o,l)):(f[1]=0,f[2]=KN(s,r));break;case"ZYX":f[1]=JN(-YN(h,-1,1)),$N(h)<.99999?(f[0]=KN(c,d),f[2]=KN(s,r)):(f[0]=0,f[2]=KN(-o,l));break;case"YZX":f[2]=JN(YN(s,-1,1)),$N(s)<.99999?(f[0]=KN(-u,l),f[1]=KN(-h,r)):(f[0]=0,f[1]=KN(a,d));break;case"XZY":f[2]=JN(-YN(o,-1,1)),$N(o)<.99999?(f[0]=KN(c,l),f[1]=KN(a,r)):(f[0]=KN(-u,d),f[1]=0);break;default:console.warn("Unkown order: "+n)}return t._dirty=!0,t},Object.defineProperties(ZN,{POSITIVE_X:{get:function(){return new ZN(1,0,0)}},NEGATIVE_X:{get:function(){return new ZN(-1,0,0)}},POSITIVE_Y:{get:function(){return new ZN(0,1,0)}},NEGATIVE_Y:{get:function(){return new ZN(0,-1,0)}},POSITIVE_Z:{get:function(){return new ZN(0,0,1)}},NEGATIVE_Z:{get:function(){return new ZN(0,0,-1)}},UP:{get:function(){return new ZN(0,1,0)}},ZERO:{get:function(){return new ZN}}});const QN=ZN;var tR,eR,nR,iR,rR,oR=1e-5,aR=function(t,e){this.origin=t||new QN,this.direction=e||new QN};aR.prototype={constructor:aR,intersectPlane:function(t,e){var n=t.normal.array,i=t.distance,r=this.origin.array,o=this.direction.array,a=EN.dot(n,o);if(0===a)return null;e||(e=new QN);var s=(EN.dot(n,r)-i)/a;return EN.scaleAndAdd(e.array,r,o,-s),e._dirty=!0,e},mirrorAgainstPlane:function(t){var e=EN.dot(t.normal.array,this.direction.array);EN.scaleAndAdd(this.direction.array,this.direction.array,t.normal.array,2*-e),this.direction._dirty=!0},distanceToPoint:(rR=EN.create(),function(t){EN.sub(rR,t,this.origin.array);var e=EN.dot(rR,this.direction.array);if(e<0)return EN.distance(this.origin.array,t);var n=EN.lenSquared(rR);return Math.sqrt(n-e*e)}),intersectSphere:function(){var t=EN.create();return function(e,n,i){var r=this.origin.array,o=this.direction.array;e=e.array,EN.sub(t,e,r);var a=EN.dot(t,o),s=EN.squaredLength(t)-a*a,l=n*n;if(!(s>l)){var u=Math.sqrt(l-s),h=a-u,c=a+u;return i||(i=new QN),h<0?c<0?null:(EN.scaleAndAdd(i.array,r,o,c),i):(EN.scaleAndAdd(i.array,r,o,h),i)}}}(),intersectBoundingBox:function(t,e){var n,i,r,o,a,s,l=this.direction.array,u=this.origin.array,h=t.min.array,c=t.max.array,d=1/l[0],f=1/l[1],p=1/l[2];if(d>=0?(n=(h[0]-u[0])*d,i=(c[0]-u[0])*d):(i=(h[0]-u[0])*d,n=(c[0]-u[0])*d),f>=0?(r=(h[1]-u[1])*f,o=(c[1]-u[1])*f):(o=(h[1]-u[1])*f,r=(c[1]-u[1])*f),n>o||r>i)return null;if((r>n||n!=n)&&(n=r),(o=0?(a=(h[2]-u[2])*p,s=(c[2]-u[2])*p):(s=(h[2]-u[2])*p,a=(c[2]-u[2])*p),n>s||a>i)return null;if((a>n||n!=n)&&(n=a),(s=0?n:i;return e||(e=new QN),EN.scaleAndAdd(e.array,u,l,g),e},intersectTriangle:(tR=EN.create(),eR=EN.create(),nR=EN.create(),iR=EN.create(),function(t,e,n,i,r,o){var a=this.direction.array,s=this.origin.array;t=t.array,e=e.array,n=n.array,EN.sub(tR,e,t),EN.sub(eR,n,t),EN.cross(iR,eR,a);var l=EN.dot(tR,iR);if(i){if(l>-1e-5)return null}else if(l>-1e-5&&l1)return null;EN.cross(iR,tR,nR);var h=EN.dot(a,iR)/l;if(h<0||h>1||u+h>1)return null;EN.cross(iR,tR,eR);var c=-EN.dot(nR,iR)/l;return c<0?null:(r||(r=new QN),o&&QN.set(o,1-u-h,u,h),EN.scaleAndAdd(r.array,s,a,c),r)}),applyTransform:function(t){QN.add(this.direction,this.direction,this.origin),QN.transformMat4(this.origin,this.origin,t),QN.transformMat4(this.direction,this.direction,t),QN.sub(this.direction,this.direction,this.origin),QN.normalize(this.direction,this.direction)},copy:function(t){QN.copy(this.origin,t.origin),QN.copy(this.direction,t.direction)},clone:function(){var t=new aR;return t.copy(this),t}};const sR=aR;var lR={create:function(){var t=new jO(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},clone:function(t){var e=new jO(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},fromValues:function(t,e,n,i){var r=new jO(4);return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},set:function(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},subtract:function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}};lR.sub=lR.subtract,lR.multiply=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t},lR.mul=lR.multiply,lR.divide=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t},lR.div=lR.divide,lR.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t},lR.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t},lR.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},lR.scaleAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t},lR.distance=function(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2],o=e[3]-t[3];return Math.sqrt(n*n+i*i+r*r+o*o)},lR.dist=lR.distance,lR.squaredDistance=function(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2],o=e[3]-t[3];return n*n+i*i+r*r+o*o},lR.sqrDist=lR.squaredDistance,lR.length=function(t){var e=t[0],n=t[1],i=t[2],r=t[3];return Math.sqrt(e*e+n*n+i*i+r*r)},lR.len=lR.length,lR.squaredLength=function(t){var e=t[0],n=t[1],i=t[2],r=t[3];return e*e+n*n+i*i+r*r},lR.sqrLen=lR.squaredLength,lR.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},lR.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},lR.normalize=function(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],a=n*n+i*i+r*r+o*o;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t[3]=e[3]*a),t},lR.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},lR.lerp=function(t,e,n,i){var r=e[0],o=e[1],a=e[2],s=e[3];return t[0]=r+i*(n[0]-r),t[1]=o+i*(n[1]-o),t[2]=a+i*(n[2]-a),t[3]=s+i*(n[3]-s),t},lR.random=function(t,e){return e=e||1,t[0]=ZO(),t[1]=ZO(),t[2]=ZO(),t[3]=ZO(),lR.normalize(t,t),lR.scale(t,t,e),t},lR.transformMat4=function(t,e,n){var i=e[0],r=e[1],o=e[2],a=e[3];return t[0]=n[0]*i+n[4]*r+n[8]*o+n[12]*a,t[1]=n[1]*i+n[5]*r+n[9]*o+n[13]*a,t[2]=n[2]*i+n[6]*r+n[10]*o+n[14]*a,t[3]=n[3]*i+n[7]*r+n[11]*o+n[15]*a,t},lR.transformQuat=function(t,e,n){var i=e[0],r=e[1],o=e[2],a=n[0],s=n[1],l=n[2],u=n[3],h=u*i+s*o-l*r,c=u*r+l*i-a*o,d=u*o+a*r-s*i,f=-a*i-s*r-l*o;return t[0]=h*u+f*-a+c*-l-d*-s,t[1]=c*u+f*-s+d*-a-h*-l,t[2]=d*u+f*-l+h*-s-c*-a,t},lR.forEach=function(){var t=lR.create();return function(e,n,i,r,o,a){var s,l;for(n||(n=4),i||(i=0),l=r?Math.min(r*n+i,e.length):e.length,s=i;s.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(EN.cross(dR,e,n),t[0]=dR[0],t[1]=dR[1],t[2]=dR[2],t[3]=1+i,mR.normalize(t,t))}),mR.setAxes=(gR=cR.create(),function(t,e,n,i){return gR[0]=n[0],gR[3]=n[1],gR[6]=n[2],gR[1]=i[0],gR[4]=i[1],gR[7]=i[2],gR[2]=-e[0],gR[5]=-e[1],gR[8]=-e[2],mR.normalize(t,mR.fromMat3(t,gR))}),mR.clone=uR.clone,mR.fromValues=uR.fromValues,mR.copy=uR.copy,mR.set=uR.set,mR.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},mR.setAxisAngle=function(t,e,n){n*=.5;var i=Math.sin(n);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(n),t},mR.add=uR.add,mR.multiply=function(t,e,n){var i=e[0],r=e[1],o=e[2],a=e[3],s=n[0],l=n[1],u=n[2],h=n[3];return t[0]=i*h+a*s+r*u-o*l,t[1]=r*h+a*l+o*s-i*u,t[2]=o*h+a*u+i*l-r*s,t[3]=a*h-i*s-r*l-o*u,t},mR.mul=mR.multiply,mR.scale=uR.scale,mR.rotateX=function(t,e,n){n*=.5;var i=e[0],r=e[1],o=e[2],a=e[3],s=Math.sin(n),l=Math.cos(n);return t[0]=i*l+a*s,t[1]=r*l+o*s,t[2]=o*l-r*s,t[3]=a*l-i*s,t},mR.rotateY=function(t,e,n){n*=.5;var i=e[0],r=e[1],o=e[2],a=e[3],s=Math.sin(n),l=Math.cos(n);return t[0]=i*l-o*s,t[1]=r*l+a*s,t[2]=o*l+i*s,t[3]=a*l-r*s,t},mR.rotateZ=function(t,e,n){n*=.5;var i=e[0],r=e[1],o=e[2],a=e[3],s=Math.sin(n),l=Math.cos(n);return t[0]=i*l+r*s,t[1]=r*l-i*s,t[2]=o*l+a*s,t[3]=a*l-o*s,t},mR.calculateW=function(t,e){var n=e[0],i=e[1],r=e[2];return t[0]=n,t[1]=i,t[2]=r,t[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r)),t},mR.dot=uR.dot,mR.lerp=uR.lerp,mR.slerp=function(t,e,n,i){var r,o,a,s,l,u=e[0],h=e[1],c=e[2],d=e[3],f=n[0],p=n[1],g=n[2],m=n[3];return(o=u*f+h*p+c*g+d*m)<0&&(o=-o,f=-f,p=-p,g=-g,m=-m),1-o>1e-6?(r=Math.acos(o),a=Math.sin(r),s=Math.sin((1-i)*r)/a,l=Math.sin(i*r)/a):(s=1-i,l=i),t[0]=s*u+l*f,t[1]=s*h+l*p,t[2]=s*c+l*g,t[3]=s*d+l*m,t},mR.invert=function(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],a=n*n+i*i+r*r+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-i*s,t[2]=-r*s,t[3]=o*s,t},mR.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},mR.length=uR.length,mR.len=mR.length,mR.squaredLength=uR.squaredLength,mR.sqrLen=mR.squaredLength,mR.normalize=uR.normalize,mR.fromMat3=function(t,e){var n,i=e[0]+e[4]+e[8];if(i>0)n=Math.sqrt(i+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var o=(r+1)%3,a=(r+2)%3;n=Math.sqrt(e[3*r+r]-e[3*o+o]-e[3*a+a]+1),t[r]=.5*n,n=.5/n,t[3]=(e[3*o+a]-e[3*a+o])*n,t[o]=(e[3*o+r]+e[3*r+o])*n,t[a]=(e[3*a+r]+e[3*r+a])*n}return t};const vR=mR;var _R,yR,xR,wR,bR=function(){this._axisX=new QN,this._axisY=new QN,this._axisZ=new QN,this.array=IN.create(),this._dirty=!0};bR.prototype={constructor:bR,setArray:function(t){for(var e=0;e0){var e=this.min,n=this.max,i=e.array,r=n.array;zR(i,t[0]),zR(r,t[0]);for(var o=1;or[0]&&(r[0]=a[0]),a[1]>r[1]&&(r[1]=a[1]),a[2]>r[2]&&(r[2]=a[2])}e._dirty=!0,n._dirty=!0}},union:function(t){var e=this.min,n=this.max;return EN.min(e.array,e.array,t.min.array),EN.max(n.array,n.array,t.max.array),e._dirty=!0,n._dirty=!0,this},intersection:function(t){var e=this.min,n=this.max;return EN.max(e.array,e.array,t.min.array),EN.min(n.array,n.array,t.max.array),e._dirty=!0,n._dirty=!0,this},intersectBoundingBox:function(t){var e=this.min.array,n=this.max.array,i=t.min.array,r=t.max.array;return!(e[0]>r[0]||e[1]>r[1]||e[2]>r[2]||n[0]=r[0]&&n[1]>=r[1]&&n[2]>=r[2]},containPoint:function(t){var e=this.min.array,n=this.max.array,i=t.array;return e[0]<=i[0]&&e[1]<=i[1]&&e[2]<=i[2]&&n[0]>=i[0]&&n[1]>=i[1]&&n[2]>=i[2]},isFinite:function(){var t=this.min.array,e=this.max.array;return isFinite(t[0])&&isFinite(t[1])&&isFinite(t[2])&&isFinite(e[0])&&isFinite(e[1])&&isFinite(e[2])},applyTransform:function(t){this.transformFrom(this,t)},transformFrom:(IR=EN.create(),PR=EN.create(),ER=EN.create(),OR=EN.create(),NR=EN.create(),RR=EN.create(),function(t,e){var n=t.min.array,i=t.max.array,r=e.array;return IR[0]=r[0]*n[0],IR[1]=r[1]*n[0],IR[2]=r[2]*n[0],PR[0]=r[0]*i[0],PR[1]=r[1]*i[0],PR[2]=r[2]*i[0],ER[0]=r[4]*n[1],ER[1]=r[5]*n[1],ER[2]=r[6]*n[1],OR[0]=r[4]*i[1],OR[1]=r[5]*i[1],OR[2]=r[6]*i[1],NR[0]=r[8]*n[2],NR[1]=r[9]*n[2],NR[2]=r[10]*n[2],RR[0]=r[8]*i[2],RR[1]=r[9]*i[2],RR[2]=r[10]*i[2],n=this.min.array,i=this.max.array,n[0]=Math.min(IR[0],PR[0])+Math.min(ER[0],OR[0])+Math.min(NR[0],RR[0])+r[12],n[1]=Math.min(IR[1],PR[1])+Math.min(ER[1],OR[1])+Math.min(NR[1],RR[1])+r[13],n[2]=Math.min(IR[2],PR[2])+Math.min(ER[2],OR[2])+Math.min(NR[2],RR[2])+r[14],i[0]=Math.max(IR[0],PR[0])+Math.max(ER[0],OR[0])+Math.max(NR[0],RR[0])+r[12],i[1]=Math.max(IR[1],PR[1])+Math.max(ER[1],OR[1])+Math.max(NR[1],RR[1])+r[13],i[2]=Math.max(IR[2],PR[2])+Math.max(ER[2],OR[2])+Math.max(NR[2],RR[2])+r[14],this.min._dirty=!0,this.max._dirty=!0,this}),applyProjection:function(t){var e=this.min.array,n=this.max.array,i=t.array,r=e[0],o=e[1],a=e[2],s=n[0],l=n[1],u=e[2],h=n[0],c=n[1],d=n[2];if(1===i[15])e[0]=i[0]*r+i[12],e[1]=i[5]*o+i[13],n[2]=i[10]*a+i[14],n[0]=i[0]*h+i[12],n[1]=i[5]*c+i[13],e[2]=i[10]*d+i[14];else{var f=-1/a;e[0]=i[0]*r*f,e[1]=i[5]*o*f,n[2]=(i[10]*a+i[14])*f,f=-1/u,n[0]=i[0]*s*f,n[1]=i[5]*l*f,f=-1/d,e[2]=(i[10]*d+i[14])*f}return this.min._dirty=!0,this.max._dirty=!0,this},updateVertices:function(){var t=this.vertices;if(!t){t=[];for(var e=0;e<8;e++)t[e]=EN.fromValues(0,0,0);this.vertices=t}var n=this.min.array,i=this.max.array;return kR(t[0],n[0],n[1],n[2]),kR(t[1],n[0],i[1],n[2]),kR(t[2],i[0],n[1],n[2]),kR(t[3],i[0],i[1],n[2]),kR(t[4],n[0],n[1],i[2]),kR(t[5],n[0],i[1],i[2]),kR(t[6],i[0],n[1],i[2]),kR(t[7],i[0],i[1],i[2]),this},copy:function(t){var e=this.min,n=this.max;return zR(e.array,t.min.array),zR(n.array,t.max.array),e._dirty=!0,n._dirty=!0,this},clone:function(){var t=new BR;return t.copy(this),t}};const FR=BR;var VR,GR=0,HR=vE.extend({name:"",position:null,rotation:null,scale:null,worldTransform:null,localTransform:null,autoUpdateLocalTransform:!0,_parent:null,_scene:null,_needsUpdateWorldTransform:!0,_inIterating:!1,__depth:0},(function(){this.name||(this.name=(this.type||"NODE")+"_"+GR++),this.position||(this.position=new QN),this.rotation||(this.rotation=new DR),this.scale||(this.scale=new QN(1,1,1)),this.worldTransform=new MR,this.localTransform=new MR,this._children=[]}),{target:null,invisible:!1,isSkinnedMesh:function(){return!1},isRenderable:function(){return!1},setName:function(t){var e=this._scene;if(e){var n=e._nodeRepository;delete n[this.name],n[t]=this}this.name=t},add:function(t){var e=t._parent;if(e!==this){e&&e.remove(t),t._parent=this,this._children.push(t);var n=this._scene;n&&n!==t.scene&&t.traverse(this._addSelfToScene,this),t._needsUpdateWorldTransform=!0}},remove:function(t){var e=this._children,n=e.indexOf(t);n<0||(e.splice(n,1),t._parent=null,this._scene&&t.traverse(this._removeSelfFromScene,this))},removeAll:function(){for(var t=this._children,e=0;e0},beforeRender:function(t){},afterRender:function(t,e){},getBoundingBox:function(t,e){return e=UR.prototype.getBoundingBox.call(this,t,e),this.geometry&&this.geometry.boundingBox&&e.union(this.geometry.boundingBox),e},clone:(WR=["castShadow","receiveShadow","mode","culling","cullFace","frontFace","frustumCulling","renderOrder","lineWidth","ignorePicking","ignorePreZ","ignoreGBuffer"],function(){var t=UR.prototype.clone.call(this);t.geometry=this.geometry,t.material=this.material;for(var e=0;e=0&&w[y]>1e-4&&(EN.transformMat4(S,x,v[b[y]]),EN.scaleAndAdd(T,T,S,w[y]));M.set(_,T)}}for(_=0;_>e;return t+1},dispose:function(t){var e=this._cache;e.use(t.__uid__);var n=e.get("webgl_texture");n&&t.gl.deleteTexture(n),e.deleteContext(t.__uid__)},isRenderable:function(){},isPowerOfTwo:function(){}});Object.defineProperty($R.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t}}),Object.defineProperty($R.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t}}),$R.BYTE=FE,$R.UNSIGNED_BYTE=VE,$R.SHORT=GE,$R.UNSIGNED_SHORT=HE,$R.INT=UE,$R.UNSIGNED_INT=WE,$R.FLOAT=jE,$R.HALF_FLOAT=36193,$R.UNSIGNED_INT_24_8_WEBGL=34042,$R.DEPTH_COMPONENT=ZE,$R.DEPTH_STENCIL=cO,$R.ALPHA=XE,$R.RGB=qE,$R.RGBA=YE,$R.LUMINANCE=KE,$R.LUMINANCE_ALPHA=JE,$R.SRGB=35904,$R.SRGB_ALPHA=35906,$R.COMPRESSED_RGB_S3TC_DXT1_EXT=33776,$R.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777,$R.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778,$R.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779,$R.NEAREST=$E,$R.LINEAR=QE,$R.NEAREST_MIPMAP_NEAREST=tO,$R.LINEAR_MIPMAP_NEAREST=eO,$R.NEAREST_MIPMAP_LINEAR=nO,$R.LINEAR_MIPMAP_LINEAR=iO,$R.REPEAT=aO,$R.CLAMP_TO_EDGE=sO,$R.MIRRORED_REPEAT=lO;const QR=$R;var tk=ZR.extend({skeleton:null,joints:null},(function(){this.joints||(this.joints=[])}),{offsetMatrix:null,isInstancedMesh:function(){return!1},isSkinnedMesh:function(){return!!(this.skeleton&&this.joints&&this.joints.length>0)},clone:function(){var t=ZR.prototype.clone.call(this);return t.skeleton=this.skeleton,this.joints&&(t.joints=this.joints.slice()),t}});tk.POINTS=SE,tk.LINES=ME,tk.LINE_LOOP=CE,tk.LINE_STRIP=LE,tk.TRIANGLES=AE,tk.TRIANGLE_STRIP=DE,tk.TRIANGLE_FAN=IE,tk.BACK=RE,tk.FRONT=NE,tk.FRONT_AND_BACK=kE,tk.CW=zE,tk.CCW=BE;const ek=tk;var nk={isPowerOfTwo:function(t){return!(t&t-1)},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))}};const ik=nk;var rk=ik.isPowerOfTwo;function ok(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))}var ak=QR.extend((function(){return{image:null,pixels:null,mipmaps:[],convertToPOT:!1}}),{textureType:"texture2D",update:function(t){var e=t.gl;e.bindTexture(e.TEXTURE_2D,this._cache.get("webgl_texture")),this.updateCommon(t);var n=this.format,i=this.type,r=!(!this.convertToPOT||this.mipmaps.length||!this.image||this.wrapS!==QR.REPEAT&&this.wrapT!==QR.REPEAT||!this.NPOT);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,r?this.wrapS:this.getAvailableWrapS()),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,r?this.wrapT:this.getAvailableWrapT()),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,r?this.magFilter:this.getAvailableMagFilter()),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,r?this.minFilter:this.getAvailableMinFilter());var o=t.getGLExtension("EXT_texture_filter_anisotropic");(o&&this.anisotropic>1&&e.texParameterf(e.TEXTURE_2D,o.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===i)&&(t.getGLExtension("OES_texture_half_float")||(i=jE));if(this.mipmaps.length)for(var a=this.width,s=this.height,l=0;l=QR.COMPRESSED_RGB_S3TC_DXT1_EXT?t.compressedTexImage2D(t.TEXTURE_2D,n,o,i,r,0,e.pixels):t.texImage2D(t.TEXTURE_2D,n,o,i,r,0,o,a,e.pixels)},generateMipmap:function(t){var e=t.gl;this.useMipmap&&!this.NPOT&&(e.bindTexture(e.TEXTURE_2D,this._cache.get("webgl_texture")),e.generateMipmap(e.TEXTURE_2D))},isPowerOfTwo:function(){return rk(this.width)&&rk(this.height)},isRenderable:function(){return this.image?this.image.width>0&&this.image.height>0:!(!this.width||!this.height)},bind:function(t){t.gl.bindTexture(t.gl.TEXTURE_2D,this.getWebGLTexture(t))},unbind:function(t){t.gl.bindTexture(t.gl.TEXTURE_2D,null)},load:function(t,e){var n=xO.createImage();e&&(n.crossOrigin=e);var i=this;return n.onload=function(){i.dirty(),i.trigger("success",i)},n.onerror=function(){i.trigger("error",i)},n.src=t,this.image=n,this}});Object.defineProperty(ak.prototype,"width",{get:function(){return this.image?this.image.width:this._width},set:function(t){this.image?console.warn("Texture from image can't set width"):(this._width!==t&&this.dirty(),this._width=t)}}),Object.defineProperty(ak.prototype,"height",{get:function(){return this.image?this.image.height:this._height},set:function(t){this.image?console.warn("Texture from image can't set height"):(this._height!==t&&this.dirty(),this._height=t)}});const sk=ak;function lk(t){return{byte:xO.Int8Array,ubyte:xO.Uint8Array,short:xO.Int16Array,ushort:xO.Uint16Array}[t]||xO.Float32Array}function uk(t){return"attr_"+t}function hk(t,e,n,i){switch(this.name=t,this.type=e,this.size=n,this.semantic=i||"",this.value=null,n){case 1:this.get=function(t){return this.value[t]},this.set=function(t,e){this.value[t]=e},this.copy=function(t,e){this.value[t]=this.value[t]};break;case 2:this.get=function(t,e){var n=this.value;return e[0]=n[2*t],e[1]=n[2*t+1],e},this.set=function(t,e){var n=this.value;n[2*t]=e[0],n[2*t+1]=e[1]},this.copy=function(t,e){var n=this.value;e*=2,n[t*=2]=n[e],n[t+1]=n[e+1]};break;case 3:this.get=function(t,e){var n=3*t,i=this.value;return e[0]=i[n],e[1]=i[n+1],e[2]=i[n+2],e},this.set=function(t,e){var n=3*t,i=this.value;i[n]=e[0],i[n+1]=e[1],i[n+2]=e[2]},this.copy=function(t,e){var n=this.value;e*=3,n[t*=3]=n[e],n[t+1]=n[e+1],n[t+2]=n[e+2]};break;case 4:this.get=function(t,e){var n=this.value,i=4*t;return e[0]=n[i],e[1]=n[i+1],e[2]=n[i+2],e[3]=n[i+3],e},this.set=function(t,e){var n=this.value,i=4*t;n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3]},this.copy=function(t,e){var n=this.value;e*=4,n[t*=4]=n[e],n[t+1]=n[e+1],n[t+2]=n[e+2],n[t+3]=n[e+3]}}}function ck(t,e,n,i,r){this.name=t,this.type=e,this.buffer=n,this.size=i,this.semantic=r,this.symbol="",this.needsRemove=!1}function dk(t){this.buffer=t,this.count=0}hk.prototype.init=function(t){if(!this.value||this.value.length!==t*this.size){var e=lk(this.type);this.value=new e(t*this.size)}},hk.prototype.fromArray=function(t){var e,n=lk(this.type);if(t[0]&&t[0].length){var i=0,r=this.size;e=new n(t.length*r);for(var o=0;o=0){e||(e=[]);var n=this.indices;return e[0]=n[3*t],e[1]=n[3*t+1],e[2]=n[3*t+2],e}},setTriangleIndices:function(t,e){var n=this.indices;n[3*t]=e[0],n[3*t+1]=e[1],n[3*t+2]=e[2]},isUseIndices:function(){return!!this.indices},initIndicesFromArray:function(t){var e,n=this.vertexCount>65535?xO.Uint32Array:xO.Uint16Array;if(t[0]&&t[0].length){var i=0;e=new n(3*t.length);for(var r=0;r=0&&(e.splice(n,1),delete this.attributes[t],!0)},getAttribute:function(t){return this.attributes[t]},getEnabledAttributes:function(){var t=this._enabledAttributes,e=this._attributeList;if(t)return t;for(var n=[],i=this.vertexCount,r=0;ro[0]&&(o[0]=s),l>o[1]&&(o[1]=l),u>o[2]&&(o[2]=u)}n._dirty=!0,i._dirty=!0}},generateVertexNormals:function(){if(this.vertexCount){var t=this.indices,e=this.attributes,n=e.position.value,i=e.normal.value;if(i&&i.length===n.length)for(var r=0;r65535&&(this.indices=new xO.Uint32Array(this.indices));for(var t=this.attributes,e=this.indices,n=this.getEnabledAttributes(),i={},r=0;rthis.distance,r=1;r<8;r++)if(EN.dot(e[r].array,n)>this.distance!=i)return!0},intersectLine:(Ek=EN.create(),function(t,e,n){var i=this.distanceToPoint(t),r=this.distanceToPoint(e);if(i>0&&r>0||i<0&&r<0)return null;var o=this.normal.array,a=this.distance,s=t.array;EN.sub(Ek,e.array,t.array),EN.normalize(Ek,Ek);var l=EN.dot(o,Ek);if(0===l)return null;n||(n=new QN);var u=(EN.dot(o,s)-a)/l;return EN.scaleAndAdd(n.array,s,Ek,-u),n._dirty=!0,n}),applyTransform:(Dk=IN.create(),Ik=uR.create(),Pk=uR.create(),Pk[3]=1,function(t){t=t.array,EN.scale(Pk,this.normal.array,this.distance),uR.transformMat4(Pk,Pk,t),this.distance=EN.dot(Pk,this.normal.array),IN.invert(Dk,t),IN.transpose(Dk,Dk),Ik[3]=0,EN.copy(Ik,this.normal.array),uR.transformMat4(Ik,Ik,Dk),EN.copy(this.normal.array,Ik)}),copy:function(t){EN.copy(this.normal.array,t.normal.array),this.normal._dirty=!0,this.distance=t.distance},clone:function(){var t=new Ok;return t.copy(this),t}};const Nk=Ok;var Rk,kk=EN.set,zk=EN.copy,Bk=EN.transformMat4,Fk=Math.min,Vk=Math.max,Gk=function(){this.planes=[];for(var t=0;t<6;t++)this.planes.push(new Nk);this.boundingBox=new FR,this.vertices=[];for(t=0;t<8;t++)this.vertices[t]=EN.fromValues(0,0,0)};Gk.prototype={setFromProjection:function(t){var e=this.planes,n=t.array,i=n[0],r=n[1],o=n[2],a=n[3],s=n[4],l=n[5],u=n[6],h=n[7],c=n[8],d=n[9],f=n[10],p=n[11],g=n[12],m=n[13],v=n[14],_=n[15];kk(e[0].normal.array,a-i,h-s,p-c),e[0].distance=-(_-g),e[0].normalize(),kk(e[1].normal.array,a+i,h+s,p+c),e[1].distance=-(_+g),e[1].normalize(),kk(e[2].normal.array,a+r,h+l,p+d),e[2].distance=-(_+m),e[2].normalize(),kk(e[3].normal.array,a-r,h-l,p-d),e[3].distance=-(_-m),e[3].normalize(),kk(e[4].normal.array,a-o,h-u,p-f),e[4].distance=-(_-v),e[4].normalize(),kk(e[5].normal.array,a+o,h+u,p+f),e[5].distance=-(_+v),e[5].normalize();var y=this.boundingBox,x=this.vertices;if(0===_){var w=l/i,b=-v/(f-1),T=-v/(f+1),S=-T/l,M=-b/l;y.min.set(-S*w,-S,T),y.max.set(S*w,S,b),kk(x[0],-S*w,-S,T),kk(x[1],-S*w,S,T),kk(x[2],S*w,-S,T),kk(x[3],S*w,S,T),kk(x[4],-M*w,-M,b),kk(x[5],-M*w,M,b),kk(x[6],M*w,-M,b),kk(x[7],M*w,M,b)}else{var C=(-1-g)/i,L=(1-g)/i,A=(1-m)/l,D=(-1-m)/l,I=(-1-v)/f,P=(1-v)/f;y.min.set(Math.min(C,L),Math.min(D,A),Math.min(P,I)),y.max.set(Math.max(L,C),Math.max(A,D),Math.max(I,P));var E=y.min.array,O=y.max.array;kk(x[0],E[0],E[1],E[2]),kk(x[1],E[0],O[1],E[2]),kk(x[2],O[0],E[1],E[2]),kk(x[3],O[0],O[1],E[2]),kk(x[4],E[0],E[1],O[2]),kk(x[5],E[0],O[1],O[2]),kk(x[6],O[0],E[1],O[2]),kk(x[7],O[0],O[1],O[2])}},getTransformedBoundingBox:(Rk=EN.create(),function(t,e){var n=this.vertices,i=e.array,r=t.min,o=t.max,a=r.array,s=o.array,l=n[0];Bk(Rk,l,i),zk(a,Rk),zk(s,Rk);for(var u=1;u<8;u++)l=n[u],Bk(Rk,l,i),a[0]=Fk(Rk[0],a[0]),a[1]=Fk(Rk[1],a[1]),a[2]=Fk(Rk[2],a[2]),s[0]=Vk(Rk[0],s[0]),s[1]=Vk(Rk[1],s[1]),s[2]=Vk(Rk[2],s[2]);return r._dirty=!0,o._dirty=!0,t})};const Hk=Gk;var Uk,Wk=UR.extend((function(){return{projectionMatrix:new MR,invProjectionMatrix:new MR,viewMatrix:new MR,frustum:new Hk}}),(function(){this.update(!0)}),{update:function(t){UR.prototype.update.call(this,t),MR.invert(this.viewMatrix,this.worldTransform),this.updateProjectionMatrix(),MR.invert(this.invProjectionMatrix,this.projectionMatrix),this.frustum.setFromProjection(this.projectionMatrix)},setViewMatrix:function(t){MR.copy(this.viewMatrix,t),MR.invert(this.worldTransform,t),this.decomposeWorldTransform()},decomposeProjectionMatrix:function(){},setProjectionMatrix:function(t){MR.copy(this.projectionMatrix,t),MR.invert(this.invProjectionMatrix,t),this.decomposeProjectionMatrix()},updateProjectionMatrix:function(){},castRay:(Uk=uR.create(),function(t,e){var n=void 0!==e?e:new sR,i=t.array[0],r=t.array[1];return uR.set(Uk,i,r,-1,1),uR.transformMat4(Uk,Uk,this.invProjectionMatrix.array),uR.transformMat4(Uk,Uk,this.worldTransform.array),EN.scale(n.origin.array,Uk,1/Uk[3]),uR.set(Uk,i,r,1,1),uR.transformMat4(Uk,Uk,this.invProjectionMatrix.array),uR.transformMat4(Uk,Uk,this.worldTransform.array),EN.scale(Uk,Uk,1/Uk[3]),EN.sub(n.direction.array,Uk,n.origin.array),EN.normalize(n.direction.array,n.direction.array),n.direction._dirty=!0,n.origin._dirty=!0,n})});const jk=Wk;var Zk=IN.create(),Xk=IN.create(),qk={};function Yk(t){var e=[],n=Object.keys(t);n.sort();for(var i=0;i0&&console.warn("Found multiple camera in one scene. Use the fist one."),this._cameraList.push(t)):t instanceof Ak&&this.lights.push(t),t.name&&(this._nodeRepository[t.name]=t)},removeFromScene:function(t){var e;t instanceof jk?(e=this._cameraList.indexOf(t))>=0&&this._cameraList.splice(e,1):t instanceof Ak&&(e=this.lights.indexOf(t))>=0&&this.lights.splice(e,1),t.name&&delete this._nodeRepository[t.name]},getNode:function(t){return this._nodeRepository[t]},setMainCamera:function(t){var e=this._cameraList.indexOf(t);e>=0&&this._cameraList.splice(e,1),this._cameraList.unshift(t)},getMainCamera:function(){return this._cameraList[0]},getLights:function(){return this.lights},updateLights:function(){var t=this.lights;this._previousLightNumber=this._lightNumber;for(var e={},n=0;n0&&this._doUpdateRenderList(a,e,n,i,r)}},isFrustumCulled:(Jk=new FR,$k=new MR,function(t,e,n){var i=t.boundingBox;if(i||(i=t.skeleton&&t.skeleton.boundingBox?t.skeleton.boundingBox:t.geometry.boundingBox),!i)return!1;if($k.array=n,Jk.transformFrom(i,$k),t.castShadow&&this.viewBoundingBoxLastFrame.union(Jk),t.frustumCulling){if(!Jk.intersectBoundingBox(e.frustum.boundingBox))return!0;$k.array=e.projectionMatrix.array,Jk.max.array[2]>0&&Jk.min.array[2]<0&&(Jk.max.array[2]=-1e-20),Jk.applyProjection($k);var r=Jk.min.array,o=Jk.max.array;if(o[0]<-1||r[0]>1||o[1]<-1||r[1]>1||o[2]<-1||r[2]>1)return!0}return!1}),_updateLightUniforms:function(){var t=this.lights;t.sort(tz);var e=this._lightUniforms;for(var n in e)for(var i in e[n])e[n][i].value.length=0;for(var r=0;r=this._maxSize&&o>0){var s=n.head;n.remove(s),delete i[s.key],r=s.value,this._lastRemovedEntry=s}a?a.value=e:a=new nz(e),a.key=t,n.insertEntry(a),i[t]=a}return r},t.prototype.get=function(t){var e=this._map[t],n=this._list;if(null!=e)return e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}();const oz=rz;var az=ik.isPowerOfTwo,sz=["px","nx","py","ny","pz","nz"],lz=QR.extend((function(){return{image:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},pixels:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},mipmaps:[]}}),{textureType:"textureCube",update:function(t){var e=t.gl;e.bindTexture(e.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),this.updateCommon(t);var n=this.format,i=this.type;e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_WRAP_S,this.getAvailableWrapS()),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_WRAP_T,this.getAvailableWrapT()),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,this.getAvailableMagFilter()),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,this.getAvailableMinFilter());var r=t.getGLExtension("EXT_texture_filter_anisotropic");(r&&this.anisotropic>1&&e.texParameterf(e.TEXTURE_CUBE_MAP,r.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===i)&&(t.getGLExtension("OES_texture_half_float")||(i=jE));if(this.mipmaps.length)for(var o=this.width,a=this.height,s=0;s0&&t.height>0}Object.defineProperty(lz.prototype,"width",{get:function(){return this.image&&this.image.px?this.image.px.width:this._width},set:function(t){this.image&&this.image.px?console.warn("Texture from image can't set width"):(this._width!==t&&this.dirty(),this._width=t)}}),Object.defineProperty(lz.prototype,"height",{get:function(){return this.image&&this.image.px?this.image.px.height:this._height},set:function(t){this.image&&this.image.px?console.warn("Texture from image can't set height"):(this._height!==t&&this.dirty(),this._height=t)}});const hz=lz;var cz=jk.extend({fov:50,aspect:1,near:.1,far:2e3},{updateProjectionMatrix:function(){var t=this.fov/180*Math.PI;this.projectionMatrix.perspective(t,this.aspect,this.near,this.far)},decomposeProjectionMatrix:function(){var t=this.projectionMatrix.array,e=2*Math.atan(1/t[5]);this.fov=e/Math.PI*180,this.aspect=t[5]/t[0],this.near=t[14]/(t[10]-1),this.far=t[14]/(t[10]+1)},clone:function(){var t=jk.prototype.clone.call(this);return t.fov=this.fov,t.aspect=this.aspect,t.near=this.near,t.far=this.far,t}});const dz=cz;var fz="framebuffer",pz="renderbuffer",gz=pz+"_width",mz=pz+"_height",vz=pz+"_attached",_z="depthtexture_attached",yz=uO,xz=hO,wz=fO,bz=dO,Tz=vE.extend({depthBuffer:!0,viewport:null,_width:0,_height:0,_textures:null,_boundRenderer:null},(function(){this._cache=new JR,this._textures={}}),{getTextureWidth:function(){return this._width},getTextureHeight:function(){return this._height},bind:function(t){if(t.__currentFrameBuffer){if(t.__currentFrameBuffer===this)return;console.warn("Renderer already bound with another framebuffer. Unbind it first")}t.__currentFrameBuffer=this;var e=t.gl;e.bindFramebuffer(yz,this._getFrameBufferGL(t)),this._boundRenderer=t;var n=this._cache;n.put("viewport",t.viewport);var i,r,o=!1;for(var a in this._textures){o=!0;var s=this._textures[a];s&&(i=s.texture.width,r=s.texture.height,this._doAttach(t,s.texture,a,s.target))}this._width=i,this._height=r,!o&&this.depthBuffer&&console.error("Must attach texture before bind, or renderbuffer may have incorrect width and height."),this.viewport?t.setViewport(this.viewport):t.setViewport(0,0,i,r,1);var l=n.get("attached_textures");if(l)for(var a in l)if(!this._textures[a]){var u=l[a];this._doDetach(e,a,u)}if(!n.get(_z)&&this.depthBuffer){n.miss(pz)&&n.put(pz,e.createRenderbuffer());var h=n.get(pz);i===n.get(gz)&&r===n.get(mz)||(e.bindRenderbuffer(xz,h),e.renderbufferStorage(xz,e.DEPTH_COMPONENT16,i,r),n.put(gz,i),n.put(mz,r),e.bindRenderbuffer(xz,null)),n.get(vz)||(e.framebufferRenderbuffer(yz,wz,xz,h),n.put(vz,!0))}},unbind:function(t){t.__currentFrameBuffer=null,t.gl.bindFramebuffer(yz,null),this._boundRenderer=null,this._cache.use(t.__uid__);var e=this._cache.get("viewport");e&&t.setViewport(e),this.updateMipmap(t)},updateMipmap:function(t){var e=t.gl;for(var n in this._textures){var i=this._textures[n];if(i){var r=i.texture;if(!r.NPOT&&r.useMipmap&&r.minFilter===QR.LINEAR_MIPMAP_LINEAR){var o="textureCube"===r.textureType?oO:rO;e.bindTexture(o,r.getWebGLTexture(t)),e.generateMipmap(o),e.bindTexture(o,null)}}}},checkStatus:function(t){return t.checkFramebufferStatus(yz)},_getFrameBufferGL:function(t){var e=this._cache;return e.use(t.__uid__),e.miss(fz)&&e.put(fz,t.gl.createFramebuffer()),e.get(fz)},attach:function(t,e,n){if(!t.width)throw new Error("The texture attached to color buffer is not a valid.");e=e||bz,n=n||rO;var i,r=this._boundRenderer;if(r&&r.gl){var o=this._cache;o.use(r.__uid__),i=o.get("attached_textures")}var a=this._textures[e];if(!a||a.target!==n||a.texture!==t||!i||null==i[e]){var s=!0;r&&(s=this._doAttach(r,t,e,n),this.viewport||r.setViewport(0,0,t.width,t.height,1)),s&&(this._textures[e]=this._textures[e]||{},this._textures[e].texture=t,this._textures[e].target=n)}},_doAttach:function(t,e,n,i){var r=t.gl,o=e.getWebGLTexture(t),a=this._cache.get("attached_textures");if(a&&a[n]){var s=a[n];if(s.texture===e&&s.target===i)return}var l=!0;if(((n=+n)===wz||n===gO)&&(t.getGLExtension("WEBGL_depth_texture")||(console.error("Depth texture is not supported by the browser"),l=!1),e.format!==ZE&&e.format!==cO&&(console.error("The texture attached to depth buffer is not a valid."),l=!1),l)){var u=this._cache.get(pz);u&&(r.framebufferRenderbuffer(yz,wz,xz,null),r.deleteRenderbuffer(u),this._cache.put(pz,!1)),this._cache.put(vz,!1),this._cache.put(_z,!0)}return r.framebufferTexture2D(yz,n,i,o,0),a||(a={},this._cache.put("attached_textures",a)),a[n]=a[n]||{},a[n].texture=e,a[n].target=i,l},_doDetach:function(t,e,n){t.framebufferTexture2D(yz,e,n,null,0);var i=this._cache.get("attached_textures");i&&i[e]&&(i[e]=null),e!==wz&&e!==gO||this._cache.put(_z,!1)},detach:function(t,e){(this._textures[t]=null,this._boundRenderer)&&(this._cache.use(this._boundRenderer.__uid__),this._doDetach(this._boundRenderer.gl,t,e))},dispose:function(t){var e=t.gl,n=this._cache;n.use(t.__uid__);var i=n.get(pz);i&&e.deleteRenderbuffer(i);var r=n.get(fz);r&&e.deleteFramebuffer(r),n.deleteContext(t.__uid__),this._textures={}}});Tz.DEPTH_ATTACHMENT=wz,Tz.COLOR_ATTACHMENT0=bz,Tz.STENCIL_ATTACHMENT=pO,Tz.DEPTH_STENCIL_ATTACHMENT=gO;const Sz=Tz;var Mz=["px","nx","py","ny","pz","nz"],Cz=vE.extend((function(){var t={position:new QN,far:1e3,near:.1,texture:null,shadowMapPass:null},e=t._cameras={px:new dz({fov:90}),nx:new dz({fov:90}),py:new dz({fov:90}),ny:new dz({fov:90}),pz:new dz({fov:90}),nz:new dz({fov:90})};return e.px.lookAt(QN.POSITIVE_X,QN.NEGATIVE_Y),e.nx.lookAt(QN.NEGATIVE_X,QN.NEGATIVE_Y),e.py.lookAt(QN.POSITIVE_Y,QN.POSITIVE_Z),e.ny.lookAt(QN.NEGATIVE_Y,QN.NEGATIVE_Z),e.pz.lookAt(QN.POSITIVE_Z,QN.NEGATIVE_Y),e.nz.lookAt(QN.NEGATIVE_Z,QN.NEGATIVE_Y),t._frameBuffer=new Sz,t}),{getCamera:function(t){return this._cameras[t]},render:function(t,e,n){var i=t.gl;n||e.update();for(var r=this.texture.width,o=2*Math.atan(r/(r-.5))/Math.PI*180,a=0;a<6;a++){var s=Mz[a],l=this._cameras[s];if(QN.copy(l.position,this.position),l.far=this.far,l.near=this.near,l.fov=o,this.shadowMapPass){l.update();var u=e.getBoundingBox();u.applyTransform(l.viewMatrix),e.viewBoundingBoxLastFrame.copy(u),this.shadowMapPass.render(t,e,l,!0)}this._frameBuffer.attach(this.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+a),this._frameBuffer.bind(t),t.render(e,l,!0),this._frameBuffer.unbind(t)}},dispose:function(t){this._frameBuffer.dispose(t)}});const Lz=Cz;var Az=xk.extend({dynamic:!1,widthSegments:1,heightSegments:1},(function(){this.build()}),{build:function(){for(var t=this.heightSegments,e=this.widthSegments,n=this.attributes,i=[],r=[],o=[],a=[],s=0;s<=t;s++)for(var l=s/t,u=0;u<=e;u++){var h=u/e;if(i.push([2*h-1,2*l-1,0]),r&&r.push([h,l]),o&&o.push([0,0,1]),u0?this.material.define("fragment","LOD"):this.material.undefine("fragment","LOD"),t.renderPass([this],n)}});const Rz=Nz,kz=Rz;function zz(t){return t.charCodeAt(0)+(t.charCodeAt(1)<<8)+(t.charCodeAt(2)<<16)+(t.charCodeAt(3)<<24)}var Bz=zz("DXT1"),Fz=zz("DXT3"),Vz=zz("DXT5"),Gz={parse:function(t,e){var n=new Int32Array(t,0,31);if(542327876!==n[0])return null;if(4&!n(20))return null;var i,r,o=n(21),a=n[4],s=n[3],l=512&n[28],u=131072&n[2];switch(o){case Bz:i=8,r=QR.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case Fz:i=16,r=QR.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Vz:i=16,r=QR.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return null}var h=n[1]+4,c=l?6:1,d=1;u&&(d=Math.max(1,n[7]));for(var f=[],p=0;p0){var r=Math.pow(2,t[3]-128-8+i);e[n+0]=t[0]*r,e[n+1]=t[1]*r,e[n+2]=t[2]*r}else e[n+0]=0,e[n+1]=0,e[n+2]=0;return e[n+3]=1,e}function jz(t,e,n,i){for(var r,o,a=0,s=0,l=i;l>0;)if(t[s][0]=e[n++],t[s][1]=e[n++],t[s][2]=e[n++],t[s][3]=e[n++],1===t[s][0]&&1===t[s][1]&&1===t[s][2]){for(var u=t[s][3]<>>0;u>0;u--)r=t[s-1],(o=t[s])[0]=r[0],o[1]=r[1],o[2]=r[2],o[3]=r[3],s++,l--;a+=8}else s++,l--,a=0;return n}function Zz(t,e,n,i){if(i<8|i>32767)return jz(t,e,n,i);if(2!=(r=e[n++]))return jz(t,e,n-1,i);if(t[0][1]=e[n++],t[0][2]=e[n++],r=e[n++],(t[0][2]<<8>>>0|r)>>>0!==i)return null;for(var r=0;r<4;r++)for(var o=0;o128){a=(127&a)>>>0;for(var s=e[n++];a--;)t[o++][r]=s}else for(;a--;)t[o++][r]=e[n++]}return n}var Xz={parseRGBE:function(t,e,n){null==n&&(n=0);var i=new Uint8Array(t),r=i.length;if("#?"===function(t,e,n){for(var i="",r=e;r=r)){o+=2;for(var a="";o20)return console.warn("Given image is not a height map"),t}var d,f,p,g;l%(4*i)==0?(d=a.data[l],p=a.data[l+4]):l%(4*i)==4*(i-1)?(d=a.data[l-4],p=a.data[l]):(d=a.data[l-4],p=a.data[l+4]),l<4*i?(f=a.data[l],g=a.data[l+4*i]):l>i*(r-1)*4?(f=a.data[l-4*i],g=a.data[l]):(f=a.data[l-4*i],g=a.data[l+4*i]),s.data[l]=d-p+127,s.data[l+1]=f-g+127,s.data[l+2]=255,s.data[l+3]=255}return o.putImageData(s,0,0),n},isHeightImage:function(t,e,n){if(!t||!t.width||!t.height)return!1;var i=document.createElement("canvas"),r=i.getContext("2d"),o=e||32;n=n||20,i.width=i.height=o,r.drawImage(t,0,0,o,o);for(var a=r.getImageData(0,0,o,o),s=0;sn)return!1}return!0},_fetchTexture:function(t,e,n){xO.request.get({url:t,responseType:"arraybuffer",onload:e,onerror:n})},createChessboard:function(t,e,n,i){t=t||512,e=e||64,n=n||"black",i=i||"white";var r=Math.ceil(t/e),o=document.createElement("canvas");o.width=t,o.height=t;var a=o.getContext("2d");a.fillStyle=i,a.fillRect(0,0,t,t),a.fillStyle=n;for(var s=0;s=0||(Jz.forEach((function(e){t.on(e,this[$z(e)],this)}),this),this._meshes.push(t))},detachFromMesh:function(t){var e=this._meshes.indexOf(t);e>=0&&this._meshes.splice(e,1),Jz.forEach((function(e){t.off(e,this[$z(e)])}),this)},dispose:function(){this._meshes.forEach((function(t){this.detachFromMesh(t)}),this)}};const tB=Qz;var eB=jk.extend({left:-1,right:1,near:-1,far:1,top:1,bottom:-1},{updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},decomposeProjectionMatrix:function(){var t=this.projectionMatrix.array;this.left=(-1-t[12])/t[0],this.right=(1-t[12])/t[0],this.top=(1-t[13])/t[5],this.bottom=(-1-t[13])/t[5],this.near=-(-1-t[14])/t[10],this.far=-(1-t[14])/t[10]},clone:function(){var t=jk.prototype.clone.call(this);return t.left=this.left,t.right=this.right,t.near=this.near,t.far=this.far,t.top=this.top,t.bottom=this.bottom,t}});const nB=eB;LN.import("\n@export clay.compositor.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nvarying vec2 v_Texcoord;\nvoid main()\n{\n v_Texcoord = texcoord;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end");var iB=new Dz,rB=new ek({geometry:iB,frustumCulling:!1}),oB=new nB;const aB=vE.extend((function(){return{fragment:"",outputs:null,material:null,blendWithPrevious:!1,clearColor:!1,clearDepth:!0}}),(function(){var t=new LN(LN.source("clay.compositor.vertex"),this.fragment),e=new HO({shader:t});e.enableTexturesAll(),this.material=e}),{setUniform:function(t,e){this.material.setUniform(t,e)},getUniform:function(t){var e=this.material.uniforms[t];if(e)return e.value},attachOutput:function(t,e){this.outputs||(this.outputs={}),e=e||dO,this.outputs[e]=t},detachOutput:function(t){for(var e in this.outputs)this.outputs[e]===t&&(this.outputs[e]=null)},bind:function(t,e){if(this.outputs)for(var n in this.outputs){var i=this.outputs[n];i&&e.attach(i,n)}e&&e.bind(t)},unbind:function(t,e){e.unbind(t)},render:function(t,e){var n=t.gl;if(e){this.bind(t,e);var i=t.getGLExtension("EXT_draw_buffers");if(i&&this.outputs){var r=[];for(var o in this.outputs)(o=+o)>=n.COLOR_ATTACHMENT0&&o<=n.COLOR_ATTACHMENT0+8&&r.push(o);i.drawBuffersEXT(r)}}this.trigger("beforerender",this,t);var a=this.clearDepth?n.DEPTH_BUFFER_BIT:0;if(n.depthMask(!0),this.clearColor){a|=n.COLOR_BUFFER_BIT,n.colorMask(!0,!0,!0,!0);var s=this.clearColor;Array.isArray(s)&&n.clearColor(s[0],s[1],s[2],s[3])}n.clear(a),this.blendWithPrevious?(n.enable(n.BLEND),this.material.transparent=!0):(n.disable(n.BLEND),this.material.transparent=!1),this.renderQuad(t),this.trigger("afterrender",this,t),e&&this.unbind(t,e)},renderQuad:function(t){rB.material=this.material,t.renderPass([rB],oB)},dispose:function(t){}});var sB={},lB=["px","nx","py","ny","pz","nz"];sB.prefilterEnvironmentMap=function(t,e,n,i,r){r&&i||(i=sB.generateNormalDistribution(),r=sB.integrateBRDF(t,i));var o=(n=n||{}).width||64,a=n.height||64,s=n.type||e.type,l=new hz({width:o,height:a,type:s,flipY:!1,mipmaps:[]});l.isPowerOfTwo()||console.warn("Width and height must be power of two to enable mipmap.");var u=Math.min(o,a),h=Math.log(u)/Math.log(2)+1,c=new HO({shader:new LN({vertex:LN.source("clay.skybox.vertex"),fragment:"#define SHADER_NAME prefilter\n#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform mat4 viewInverse : VIEWINVERSE;\nuniform samplerCube environmentMap;\nuniform sampler2D normalDistribution;\nuniform float roughness : 0.5;\nvarying vec2 v_Texcoord;\nvarying vec3 v_WorldPosition;\n@import clay.util.rgbm\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nvoid main() {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(v_WorldPosition - eyePos);\n vec3 N = V;\n vec3 prefilteredColor = vec3(0.0);\n float totalWeight = 0.0;\n float fMaxSampleNumber = float(SAMPLE_NUMBER);\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fMaxSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(dot(N, L), 0.0, 1.0);\n if (NoL > 0.0) {\n prefilteredColor += decodeHDR(textureCube(environmentMap, L)).rgb * NoL;\n totalWeight += NoL;\n }\n }\n gl_FragColor = encodeHDR(vec4(prefilteredColor / totalWeight, 1.0));\n}\n"})});c.set("normalDistribution",i),n.encodeRGBM&&c.define("fragment","RGBM_ENCODE"),n.decodeRGBM&&c.define("fragment","RGBM_DECODE");var d,f=new ez;if("texture2D"===e.textureType){var p=new hz({width:o,height:a,type:s===QR.FLOAT?QR.HALF_FLOAT:s});Kz.panoramaToCubeMap(t,e,p,{encodeRGBM:n.decodeRGBM}),e=p}(d=new Rz({scene:f,material:c})).material.set("environmentMap",e);var g=new Lz({texture:l});n.encodeRGBM&&(s=l.type=QR.UNSIGNED_BYTE);for(var m=new sk({width:o,height:a,type:s}),v=new Sz({depthBuffer:!1}),_=xO[s===QR.UNSIGNED_BYTE?"Uint8Array":"Float32Array"],y=0;y 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nfloat G_Smith(float roughness, float NoV, float NoL) {\n float k = roughness * roughness / 2.0;\n float G1V = NoV / (NoV * (1.0 - k) + k);\n float G1L = NoL / (NoL * (1.0 - k) + k);\n return G1L * G1V;\n}\nvoid main() {\n vec2 uv = gl_FragCoord.xy / viewportSize;\n float NoV = uv.x;\n float roughness = uv.y;\n vec3 V;\n V.x = sqrt(1.0 - NoV * NoV);\n V.y = 0.0;\n V.z = NoV;\n float A = 0.0;\n float B = 0.0;\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(L.z, 0.0, 1.0);\n float NoH = clamp(H.z, 0.0, 1.0);\n float VoH = clamp(dot(V, H), 0.0, 1.0);\n if (NoL > 0.0) {\n float G = G_Smith(roughness, NoV, NoL);\n float G_Vis = G * VoH / (NoH * NoV);\n float Fc = pow(1.0 - VoH, 5.0);\n A += (1.0 - Fc) * G_Vis;\n B += Fc * G_Vis;\n }\n }\n gl_FragColor = vec4(vec2(A, B) / fSampleNumber, 0.0, 1.0);\n}\n"}),r=new sk({width:512,height:256,type:QR.HALF_FLOAT,wrapS:QR.CLAMP_TO_EDGE,wrapT:QR.CLAMP_TO_EDGE,minFilter:QR.NEAREST,magFilter:QR.NEAREST,useMipmap:!1});return i.setUniform("normalDistribution",e),i.setUniform("viewportSize",[512,256]),i.attachOutput(r),i.render(t,n),n.dispose(t),r},sB.generateNormalDistribution=function(t,e){for(var n=new sk({width:t=t||256,height:e=e||1024,type:QR.FLOAT,minFilter:QR.NEAREST,magFilter:QR.NEAREST,wrapS:QR.CLAMP_TO_EDGE,wrapT:QR.CLAMP_TO_EDGE,useMipmap:!1}),i=new Float32Array(e*t*4),r=[],o=0;o>>16)>>>0;u=(((16711935&(u=((252645135&(u=((858993459&(u=((1431655765&u)<<1|(2863311530&u)>>>1)>>>0))<<2|(3435973836&u)>>>2)>>>0))<<4|(4042322160&u)>>>4)>>>0))<<8|(4278255360&u)>>>8)>>>0)/4294967296;var h=Math.sqrt((1-u)/(1+(s*s-1)*u));r[l]=h}for(l=0;l65535?Uint32Array:Uint16Array,_=this.indices=new v(e*t*6),y=this.radius,x=this.phiStart,w=this.phiLength,b=this.thetaStart,T=this.thetaLength,S=[],M=[],C=0,L=1/(y=this.radius);for(d=0;d<=t;d++)for(c=0;c<=e;c++)u=c/e,h=d/t,a=-y*Math.cos(x+u*w)*Math.sin(b+h*T),s=y*Math.cos(b+h*T),l=y*Math.sin(x+u*w)*Math.sin(b+h*T),S[0]=a,S[1]=s,S[2]=l,M[0]=u,M[1]=h,n.set(C,S),i.set(C,M),S[0]*=L,S[1]*=L,S[2]*=L,r.set(C,S),C++;var A=e+1,D=0;for(d=0;d=0)s=a*n.length;else for(var l=0;l-1e-8&&t=1?1:function(t,e,n,i,r,o){var a=i+3*(e-n)-t,s=3*(n-2*e+t),l=3*(e-t),u=t-r,h=s*s-3*a*l,c=s*l-9*a*u,d=l*l-3*s*u,f=0;if(MF(h)&&MF(c))MF(s)?o[0]=0:(S=-l/s)>=0&&S<=1&&(o[f++]=S);else{var p=c*c-4*h*d;if(MF(p)){var g=c/h,m=-g/2;(S=-s/a+g)>=0&&S<=1&&(o[f++]=S),m>=0&&m<=1&&(o[f++]=m)}else if(p>0){var v=wF(p),_=h*s+1.5*a*(-c+v),y=h*s+1.5*a*(-c-v);(S=(-s-((_=_<0?-xF(-_,SF):xF(_,SF))+(y=y<0?-xF(-y,SF):xF(y,SF))))/(3*a))>=0&&S<=1&&(o[f++]=S)}else{var x=(2*h*s-3*a*c)/(2*wF(h*h*h)),w=Math.acos(x)/3,b=wF(h),T=Math.cos(w),S=(-s-2*b*T)/(3*a),M=(m=(-s+b*(T+TF*Math.sin(w)))/(3*a),(-s+b*(T-TF*Math.sin(w)))/(3*a));S>=0&&S<=1&&(o[f++]=S),m>=0&&m<=1&&(o[f++]=m),M>=0&&M<=1&&(o[f++]=M)}}return f}(0,i,o,1,t,s)&&CF(0,r,a,1,s[0])}}}var DF=function(){function t(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||vF,this.ondestroy=t.ondestroy||vF,this.onrestart=t.onrestart||vF,t.easing&&this.setEasing(t.easing)}return t.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),!this._paused){var n=this._life,i=t-this._startTime-this._pausedTime,r=i/n;r<0&&(r=0),r=Math.min(r,1);var o=this.easingFunc,a=o?o(r):r;if(this.onframe(a),1===r){if(!this.loop)return!0;var s=i%n;this._startTime=t-s,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=e},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(t){this.easing=t,this.easingFunc=hF(t)?t:ZB[t]||AF(t)},t}();const IF=DF;var PF={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function EF(t){return(t=Math.round(t))<0?0:t>255?255:t}function OF(t){return t<0?0:t>1?1:t}function NF(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?EF(parseFloat(e)/100*255):EF(parseInt(e,10))}function RF(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?OF(parseFloat(e)/100):OF(parseFloat(e))}function kF(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function zF(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function BF(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var FF=new oz(20),VF=null;function GF(t,e){VF&&BF(VF,e),VF=FF.put(t,VF||e.slice())}function HF(t,e){if(t){e=e||[];var n=FF.get(t);if(n)return BF(e,n);var i=(t+="").replace(/ /g,"").toLowerCase();if(i in PF)return BF(e,PF[i]),GF(t,e),e;var r,o=i.length;if("#"===i.charAt(0))return 4===o||5===o?(r=parseInt(i.slice(1,4),16))>=0&&r<=4095?(zF(e,(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,5===o?parseInt(i.slice(4),16)/15:1),GF(t,e),e):void zF(e,0,0,0,1):7===o||9===o?(r=parseInt(i.slice(1,7),16))>=0&&r<=16777215?(zF(e,(16711680&r)>>16,(65280&r)>>8,255&r,9===o?parseInt(i.slice(7),16)/255:1),GF(t,e),e):void zF(e,0,0,0,1):void 0;var a=i.indexOf("("),s=i.indexOf(")");if(-1!==a&&s+1===o){var l=i.substr(0,a),u=i.substr(a+1,s-(a+1)).split(","),h=1;switch(l){case"rgba":if(4!==u.length)return 3===u.length?zF(e,+u[0],+u[1],+u[2],1):zF(e,0,0,0,1);h=RF(u.pop());case"rgb":return u.length>=3?(zF(e,NF(u[0]),NF(u[1]),NF(u[2]),3===u.length?h:RF(u[3])),GF(t,e),e):void zF(e,0,0,0,1);case"hsla":return 4!==u.length?void zF(e,0,0,0,1):(u[3]=RF(u[3]),UF(u,e),GF(t,e),e);case"hsl":return 3!==u.length?void zF(e,0,0,0,1):(UF(u,e),GF(t,e),e);default:return}}zF(e,0,0,0,1)}}function UF(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=RF(t[1]),r=RF(t[2]),o=r<=.5?r*(i+1):r+i-r*i,a=2*r-o;return zF(e=e||[],EF(255*kF(a,o,n+1/3)),EF(255*kF(a,o,n)),EF(255*kF(a,o,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}new oz(100);var WF=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},jF=new function(){this.browser=new WF,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(jF.wxa=!0,jF.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?jF.worker=!0:!jF.hasGlobalWindow||"Deno"in window?(jF.node=!0,jF.svgSupported=!0):function(t,e){var n=e.browser,i=t.match(/Firefox\/([\d.]+)/),r=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),o=t.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(t);i&&(n.firefox=!0,n.version=i[1]);r&&(n.ie=!0,n.version=r[1]);o&&(n.edge=!0,n.version=o[1],n.newEdge=+o[1].split(".")[0]>18);a&&(n.weChat=!0);e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,e.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11),e.domSupported="undefined"!=typeof document;var s=document.documentElement.style;e.transform3dSupported=(n.ie&&"transition"in s||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||n.ie&&+n.version>=9}(navigator.userAgent,jF);const ZF=jF;Math.round;ZF.hasGlobalWindow&&hF(window.btoa);var XF=Array.prototype.slice;function qF(t,e,n){return(e-t)*n+t}function YF(t,e,n,i){for(var r=e.length,o=0;oi?e:t,o=Math.min(n,i),a=r[o-1]||{color:[0,0,0,0],offset:0},s=o;sa)i.length=a;else for(var s=o;s=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(t,e,n){this._needsSort=!0;var i=this.keyframes,r=i.length,o=!1,a=6,s=e;if(oF(e)){var l=function(t){return oF(t&&t[0])?2:1}(e);a=l,(1===l&&!cF(e[0])||2===l&&!cF(e[0][0]))&&(o=!0)}else if(cF(e)&&!function(t){return t!=t}(e))a=0;else if(function(t){return"string"==typeof t}(e))if(isNaN(+e)){var u=HF(e);u&&(s=u,a=3)}else a=0;else if(function(t){return null!=t.colorStops}(e)){var h=rF({},s);h.colorStops=aF(e.colorStops,(function(t){return{offset:t.offset,color:HF(t.color)}})),"linear"===e.type?a=4:function(t){return"radial"===t.type}(e)&&(a=5),s=h}0===r?this.valType=a:a===this.valType&&6!==a||(o=!0),this.discrete=this.discrete||o;var c={time:t,value:s,rawValue:e,percent:0};return n&&(c.easing=n,c.easingFunc=hF(n)?n:ZB[n]||AF(n)),i.push(c),c},t.prototype.prepare=function(t,e){var n=this.keyframes;this._needsSort&&n.sort((function(t,e){return t.time-e.time}));for(var i=this.valType,r=n.length,o=n[r-1],a=this.discrete,s=iV(i),l=nV(i),u=0;u=0&&!(l[n].percent<=e);n--);n=f(n,u-2)}else{for(n=d;ne);n++);n=f(n-1,u-2)}r=l[n+1],i=l[n]}if(i&&r){this._lastFr=n,this._lastFrP=e;var p=r.percent-i.percent,g=0===p?1:f((e-i.percent)/p,1);r.easingFunc&&(g=r.easingFunc(g));var m=o?this._additiveValue:c?rV:t[h];if(!iV(s)&&!c||m||(m=this._additiveValue=[]),this.discrete)t[h]=g<1?i.rawValue:r.rawValue;else if(iV(s))1===s?YF(m,i[a],r[a],g):function(t,e,n,i){for(var r=e.length,o=r&&e[0].length,a=0;a0&&s.addKeyframe(0,tV(l),i),this._trackKeys.push(a)}s.addKeyframe(t,tV(e[a]),i)}return this._maxTime=Math.max(this._maxTime,t),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,n=0;n0)){this._started=1;for(var e=this,n=[],i=this._maxTime||0,r=0;r1){var a=o.pop();r.addKeyframe(a.time,t[i]),r.prepare(this._maxTime,r.getAdditiveTrack())}}}},t}();const sV=aV;var lV={_animators:null,getAnimators:function(){return this._animators=this._animators||[],this._animators},animate:function(t,e){this._animators=this._animators||[];var n;if(t){for(var i=t.split("."),r=this,o=0,a=i.length;o=0&&s.splice(t,1)})),s.push(l),this.__zr&&this.__zr.animation.addAnimator(l),l},stopAnimation:function(t){this._animators=this._animators||[];for(var e=this._animators,n=e.length,i=0;i 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.y) * weight.y;\n}\nif (weight.z > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.z) * weight.z;\n}\nfloat weightW = 1.0-weight.x-weight.y-weight.z;\nif (weightW > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.w) * weightW;\n}\n@end\n@export clay.chunk.instancing_header\n#ifdef INSTANCING\nattribute vec4 instanceMat1;\nattribute vec4 instanceMat2;\nattribute vec4 instanceMat3;\n#endif\n@end\n@export clay.chunk.instancing_matrix\nmat4 instanceMat = mat4(\n vec4(instanceMat1.xyz, 0.0),\n vec4(instanceMat2.xyz, 0.0),\n vec4(instanceMat3.xyz, 0.0),\n vec4(instanceMat1.w, instanceMat2.w, instanceMat3.w, 1.0)\n);\n@end\n@export clay.util.parallax_correct\nvec3 parallaxCorrect(in vec3 dir, in vec3 pos, in vec3 boxMin, in vec3 boxMax) {\n vec3 first = (boxMax - pos) / dir;\n vec3 second = (boxMin - pos) / dir;\n vec3 further = max(first, second);\n float dist = min(further.x, min(further.y, further.z));\n vec3 fixedPos = pos + dir * dist;\n vec3 boxCenter = (boxMax + boxMin) * 0.5;\n return normalize(fixedPos - boxCenter);\n}\n@end\n@export clay.util.clamp_sample\nvec4 clampSample(const in sampler2D texture, const in vec2 coord)\n{\n#ifdef STEREO\n float eye = step(0.5, coord.x) * 0.5;\n vec2 coordClamped = clamp(coord, vec2(eye, 0.0), vec2(0.5 + eye, 1.0));\n#else\n vec2 coordClamped = clamp(coord, vec2(0.0), vec2(1.0));\n#endif\n return texture2D(texture, coordClamped);\n}\n@end\n@export clay.util.ACES\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\n@end";function cV(t){return t instanceof HTMLCanvasElement||t instanceof HTMLImageElement||t instanceof Image}Object.assign(UR.prototype,uV),LN.import(hV),LN.import(AN),LN.import("\n@export ecgl.common.transformUniforms\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;\nuniform mat4 world : WORLD;\n@end\n\n@export ecgl.common.attributes\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 normal : NORMAL;\n@end\n\n@export ecgl.common.uv.header\nuniform vec2 uvRepeat : [1.0, 1.0];\nuniform vec2 uvOffset : [0.0, 0.0];\nuniform vec2 detailUvRepeat : [1.0, 1.0];\nuniform vec2 detailUvOffset : [0.0, 0.0];\n\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n@export ecgl.common.uv.main\nv_Texcoord = texcoord * uvRepeat + uvOffset;\nv_DetailTexcoord = texcoord * detailUvRepeat + detailUvOffset;\n@end\n\n@export ecgl.common.uv.fragmentHeader\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n\n@export ecgl.common.albedo.main\n\n vec4 albedoTexel = vec4(1.0);\n#ifdef DIFFUSEMAP_ENABLED\n albedoTexel = texture2D(diffuseMap, v_Texcoord);\n #ifdef SRGB_DECODE\n albedoTexel = sRGBToLinear(albedoTexel);\n #endif\n#endif\n\n#ifdef DETAILMAP_ENABLED\n vec4 detailTexel = texture2D(detailMap, v_DetailTexcoord);\n #ifdef SRGB_DECODE\n detailTexel = sRGBToLinear(detailTexel);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, detailTexel.rgb, detailTexel.a);\n albedoTexel.a = detailTexel.a + (1.0 - detailTexel.a) * albedoTexel.a;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexHeader\n\n#ifdef WIREFRAME_QUAD\nattribute vec4 barycentric;\nvarying vec4 v_Barycentric;\n#elif defined(WIREFRAME_TRIANGLE)\nattribute vec3 barycentric;\nvarying vec3 v_Barycentric;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n v_Barycentric = barycentric;\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentHeader\n\nuniform float wireframeLineWidth : 1;\nuniform vec4 wireframeLineColor: [0, 0, 0, 0.5];\n\n#ifdef WIREFRAME_QUAD\nvarying vec4 v_Barycentric;\nfloat edgeFactor () {\n vec4 d = fwidth(v_Barycentric);\n vec4 a4 = smoothstep(vec4(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(min(a4.x, a4.y), a4.z), a4.w);\n}\n#elif defined(WIREFRAME_TRIANGLE)\nvarying vec3 v_Barycentric;\nfloat edgeFactor () {\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n}\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n if (wireframeLineWidth > 0.) {\n vec4 lineColor = wireframeLineColor;\n#ifdef SRGB_DECODE\n lineColor = sRGBToLinear(lineColor);\n#endif\n\n gl_FragColor.rgb = mix(gl_FragColor.rgb, lineColor.rgb, (1.0 - edgeFactor()) * lineColor.a);\n }\n#endif\n@end\n\n\n\n\n@export ecgl.common.bumpMap.header\n\n#ifdef BUMPMAP_ENABLED\nuniform sampler2D bumpMap;\nuniform float bumpScale : 1.0;\n\n\nvec3 bumpNormal(vec3 surfPos, vec3 surfNormal, vec3 baseNormal)\n{\n vec2 dSTdx = dFdx(v_Texcoord);\n vec2 dSTdy = dFdy(v_Texcoord);\n\n float Hll = bumpScale * texture2D(bumpMap, v_Texcoord).x;\n float dHx = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdx).x - Hll;\n float dHy = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdy).x - Hll;\n\n vec3 vSigmaX = dFdx(surfPos);\n vec3 vSigmaY = dFdy(surfPos);\n vec3 vN = surfNormal;\n\n vec3 R1 = cross(vSigmaY, vN);\n vec3 R2 = cross(vN, vSigmaX);\n\n float fDet = dot(vSigmaX, R1);\n\n vec3 vGrad = sign(fDet) * (dHx * R1 + dHy * R2);\n return normalize(abs(fDet) * baseNormal - vGrad);\n\n}\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexHeader\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexMain\n\n#ifdef NORMALMAP_ENABLED\n if (dot(tangent, tangent) > 0.0) {\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n }\n#endif\n\n@end\n\n\n@export ecgl.common.normalMap.fragmentHeader\n\n#ifdef NORMALMAP_ENABLED\nuniform sampler2D normalMap;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.fragmentMain\n#ifdef NORMALMAP_ENABLED\n if (dot(v_Tangent, v_Tangent) > 0.0) {\n vec3 normalTexel = texture2D(normalMap, v_DetailTexcoord).xyz;\n if (dot(normalTexel, normalTexel) > 0.0) { N = normalTexel * 2.0 - 1.0;\n mat3 tbn = mat3(v_Tangent, v_Bitangent, v_Normal);\n N = normalize(tbn * N);\n }\n }\n#endif\n@end\n\n\n\n@export ecgl.common.vertexAnimation.header\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevNormal;\nuniform float percent;\n#endif\n\n@end\n\n@export ecgl.common.vertexAnimation.main\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n vec3 norm = mix(prevNormal, normal, percent);\n#else\n vec3 pos = position;\n vec3 norm = normal;\n#endif\n\n@end\n\n\n@export ecgl.common.ssaoMap.header\n#ifdef SSAOMAP_ENABLED\nuniform sampler2D ssaoMap;\nuniform vec4 viewport : VIEWPORT;\n#endif\n@end\n\n@export ecgl.common.ssaoMap.main\n float ao = 1.0;\n#ifdef SSAOMAP_ENABLED\n ao = texture2D(ssaoMap, (gl_FragCoord.xy - viewport.xy) / viewport.zw).r;\n#endif\n@end\n\n\n\n\n@export ecgl.common.diffuseLayer.header\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\nuniform float layerDiffuseIntensity[LAYER_DIFFUSEMAP_COUNT];\nuniform sampler2D layerDiffuseMap[LAYER_DIFFUSEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.header\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\nuniform float layerEmissionIntensity[LAYER_EMISSIVEMAP_COUNT];\nuniform sampler2D layerEmissiveMap[LAYER_EMISSIVEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.layers.header\n@import ecgl.common.diffuseLayer.header\n@import ecgl.common.emissiveLayer.header\n@end\n\n@export ecgl.common.diffuseLayer.main\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_DIFFUSEMAP_COUNT; _idx_++) {{\n float intensity = layerDiffuseIntensity[_idx_];\n vec4 texel2 = texture2D(layerDiffuseMap[_idx_], v_Texcoord);\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, texel2.rgb * intensity, texel2.a);\n albedoTexel.a = texel2.a + (1.0 - texel2.a) * albedoTexel.a;\n }}\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.main\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_EMISSIVEMAP_COUNT; _idx_++)\n {{\n vec4 texel2 = texture2D(layerEmissiveMap[_idx_], v_Texcoord) * layerEmissionIntensity[_idx_];\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n float intensity = layerEmissionIntensity[_idx_];\n gl_FragColor.rgb += texel2.rgb * texel2.a * intensity;\n }}\n#endif\n\n@end\n"),LN.import("@export ecgl.color.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\n@import ecgl.common.uv.header\n\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 position: POSITION;\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\n#ifdef ATMOSPHERE_ENABLED\nattribute vec3 normal: NORMAL;\nuniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;\nvarying vec3 v_Normal;\n#endif\n\nvoid main()\n{\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n @import ecgl.common.uv.main\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n#ifdef ATMOSPHERE_ENABLED\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n@export ecgl.color.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\n#ifdef ATMOSPHERE_ENABLED\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform vec3 glowColor;\nuniform float glowPower;\nvarying vec3 v_Normal;\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.layers.header\n\n@import ecgl.common.uv.fragmentHeader\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n#ifdef ATMOSPHERE_ENABLED\n float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor.rgb += glowColor * atmoIntensity;\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n\n}\n@end"),LN.import("/**\n * http: */\n\n@export ecgl.lambert.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n\n@import ecgl.common.attributes\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.vertexAnimation.header\n\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n}\n\n@end\n\n\n@export ecgl.lambert.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef ATMOSPHERE_ENABLED\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform vec3 glowColor;\nuniform float glowPower;\n#endif\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n gl_FragColor *= sRGBToLinear(v_Color);\n #else\n gl_FragColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n diffuseColor += ambientLightColor[i] * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseColor += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n vec3 lightColor = directionalLightColor[i];\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n diffuseColor += lightColor * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor.rgb *= diffuseColor;\n\n#ifdef ATMOSPHERE_ENABLED\n float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor.rgb += glowColor * atmoIntensity;\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"),LN.import("@export ecgl.realistic.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@import ecgl.common.vertexAnimation.header\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n\n\n@export ecgl.realistic.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n#define PI 3.14159265358979\n#define ROUGHNESS_CHANEL 0\n#define METALNESS_CHANEL 1\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\n\nuniform sampler2D detailMap;\nuniform sampler2D metalnessMap;\nuniform sampler2D roughnessMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform float metalness : 0.0;\nuniform float roughness : 0.5;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef ATMOSPHERE_ENABLED\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform vec3 glowColor;\nuniform float glowPower;\n#endif\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n@import clay.header.ambient_cubemap_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n@import ecgl.common.normalMap.fragmentHeader\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import clay.util.rgbm\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvec3 F_Schlick(float ndv, vec3 spec) {\n return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);\n}\n\nfloat D_Phong(float g, float ndh) {\n float a = pow(8192.0, g);\n return (a + 2.0) / 8.0 * pow(ndh, a);\n}\n\nvoid main()\n{\n vec4 albedoColor = color;\n\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n albedoColor *= sRGBToLinear(v_Color);\n #else\n albedoColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n albedoColor *= albedoTexel;\n\n float m = metalness;\n\n#ifdef METALNESSMAP_ENABLED\n float m2 = texture2D(metalnessMap, v_DetailTexcoord)[METALNESS_CHANEL];\n m = clamp(m2 + (m - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 baseColor = albedoColor.rgb;\n albedoColor.rgb = baseColor * (1.0 - m);\n vec3 specFactor = mix(vec3(0.04), baseColor, m);\n\n float g = 1.0 - roughness;\n\n#ifdef ROUGHNESSMAP_ENABLED\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 N = v_Normal;\n\n#ifdef DOUBLE_SIDED\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n@import ecgl.common.normalMap.fragmentMain\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseTerm = vec3(0.0);\n vec3 specularTerm = vec3(0.0);\n\n float ndv = clamp(dot(N, V), 0.0, 1.0);\n vec3 fresnelTerm = F_Schlick(ndv, specFactor);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += ambientLightColor[_idx_] * ambientFactor * ao;\n }}\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++)\n {{\n vec3 L = -directionalLightDirection[_idx_];\n vec3 lc = directionalLightColor[_idx_];\n\n vec3 H = normalize(L + V);\n float ndl = clamp(dot(N, normalize(L)), 0.0, 1.0);\n float ndh = clamp(dot(N, H), 0.0, 1.0);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[_idx_];\n }\n#endif\n\n vec3 li = lc * ndl * shadowContrib;\n\n diffuseTerm += li;\n specularTerm += li * fresnelTerm * D_Phong(g, ndh);\n }}\n#endif\n\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n vec3 L = reflect(-V, N);\n L = vec3(L.x, L[NORMAL_UP_AXIS], L[NORMAL_FRONT_AXIS]);\n float rough2 = clamp(1.0 - g, 0.0, 1.0);\n float bias2 = rough2 * 5.0;\n vec2 brdfParam2 = texture2D(ambientCubemapLightBRDFLookup[0], vec2(rough2, ndv)).xy;\n vec3 envWeight2 = specFactor * brdfParam2.x + brdfParam2.y;\n vec3 envTexel2;\n for(int _idx_ = 0; _idx_ < AMBIENT_CUBEMAP_LIGHT_COUNT; _idx_++)\n {{\n envTexel2 = RGBMDecode(textureCubeLodEXT(ambientCubemapLightCubemap[_idx_], L, bias2), 8.12);\n specularTerm += ambientCubemapLightColor[_idx_] * envTexel2 * envWeight2 * ao;\n }}\n#endif\n\n gl_FragColor.rgb = albedoColor.rgb * diffuseTerm + specularTerm;\n gl_FragColor.a = albedoColor.a;\n\n#ifdef ATMOSPHERE_ENABLED\n float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor.rgb += glowColor * atmoIntensity;\n#endif\n\n#ifdef SRGB_ENCODE\n gl_FragColor = linearTosRGB(gl_FragColor);\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"),LN.import("@export ecgl.hatching.vertex\n\n@import ecgl.realistic.vertex\n\n@end\n\n\n@export ecgl.hatching.fragment\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform vec4 color : [0.0, 0.0, 0.0, 1.0];\nuniform vec4 paperColor : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nuniform sampler2D hatch1;\nuniform sampler2D hatch2;\nuniform sampler2D hatch3;\nuniform sampler2D hatch4;\nuniform sampler2D hatch5;\nuniform sampler2D hatch6;\n\nfloat shade(in float tone) {\n vec4 c = vec4(1. ,1., 1., 1.);\n float step = 1. / 6.;\n vec2 uv = v_DetailTexcoord;\n if (tone <= step / 2.0) {\n c = mix(vec4(0.), texture2D(hatch6, uv), 12. * tone);\n }\n else if (tone <= step) {\n c = mix(texture2D(hatch6, uv), texture2D(hatch5, uv), 6. * tone);\n }\n if(tone > step && tone <= 2. * step){\n c = mix(texture2D(hatch5, uv), texture2D(hatch4, uv) , 6. * (tone - step));\n }\n if(tone > 2. * step && tone <= 3. * step){\n c = mix(texture2D(hatch4, uv), texture2D(hatch3, uv), 6. * (tone - 2. * step));\n }\n if(tone > 3. * step && tone <= 4. * step){\n c = mix(texture2D(hatch3, uv), texture2D(hatch2, uv), 6. * (tone - 3. * step));\n }\n if(tone > 4. * step && tone <= 5. * step){\n c = mix(texture2D(hatch2, uv), texture2D(hatch1, uv), 6. * (tone - 4. * step));\n }\n if(tone > 5. * step){\n c = mix(texture2D(hatch1, uv), vec4(1.), 6. * (tone - 5. * step));\n }\n\n return c.r;\n}\n\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n vec4 inkColor = sRGBToLinear(color);\n#else\n vec4 inkColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n inkColor *= sRGBToLinear(v_Color);\n #else\n inkColor *= v_Color;\n #endif\n#endif\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float tone = 0.0;\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n tone += dot(ambientLightColor[i], w) * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n tone += dot(calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_], w) * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n float lightTone = dot(directionalLightColor[i], w);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n tone += lightTone * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor = mix(inkColor, paperColor, shade(clamp(tone, 0.0, 1.0)));\n }\n@end\n"),LN.import("@export ecgl.sm.depth.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\n\nvoid main(){\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n v_ViewPosition = worldViewProjection * vec4(pos, 1.0);\n gl_Position = v_ViewPosition;\n\n v_Texcoord = texcoord;\n\n}\n@end\n\n\n\n@export ecgl.sm.depth.fragment\n\n@import clay.sm.depth.fragment\n\n@end");var dV=ez.prototype.addToScene,fV=ez.prototype.removeFromScene;ez.prototype.addToScene=function(t){if(dV.call(this,t),this.__zr){var e=this.__zr;t.traverse((function(t){t.__zr=e,t.addAnimatorsToZr&&t.addAnimatorsToZr(e)}))}},ez.prototype.removeFromScene=function(t){fV.call(this,t),t.traverse((function(t){var e=t.__zr;t.__zr=null,e&&t.removeAnimatorsFromZr&&t.removeAnimatorsFromZr(e)}))},HO.prototype.setTextureImage=function(t,e,n,i){if(this.shader){var r,o,a=n.getZr(),s=this;return s.autoUpdateTextureStatus=!1,s.disableTexture(t),(o=e)&&"none"!==o&&(r=pV.loadTexture(e,n,i,(function(e){s.enableTexture(t),a&&a.refresh()})),s.set(t,r)),r}};var pV={};pV.Renderer=jN,pV.Node=UR,pV.Mesh=ek,pV.Shader=LN,pV.Material=HO,pV.Texture=QR,pV.Texture2D=sk,pV.Geometry=xk,pV.SphereGeometry=bB,pV.PlaneGeometry=Dz,pV.CubeGeometry=Oz,pV.AmbientLight=SB,pV.DirectionalLight=CB,pV.PointLight=AB,pV.SpotLight=IB,pV.PerspectiveCamera=dz,pV.OrthographicCamera=nB,pV.Vector2=JO,pV.Vector3=QN,pV.Vector4=NB,pV.Quaternion=DR,pV.Matrix2=BB,pV.Matrix2d=HB,pV.Matrix3=WB,pV.Matrix4=MR,pV.Plane=Nk,pV.Ray=sR,pV.BoundingBox=FR,pV.Frustum=Hk;var gV=null;function mV(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))}function vV(t){if((t.wrapS===QR.REPEAT||t.wrapT===QR.REPEAT)&&t.image){var e=mV(t.width),n=mV(t.height);if(e!==t.width||n!==t.height){var i=document.createElement("canvas");i.width=e,i.height=n,i.getContext("2d").drawImage(t.image,0,0,e,n),t.image=i}}}pV.loadTexture=function(t,e,n,i){"function"==typeof n&&(i=n,n={}),n=n||{};for(var r=Object.keys(n).sort(),o="",a=0;a3?e[3]=t[3]:e[3]=1,e):((e=Ri(t||"#000",e)||[0,0,0,0])[0]/=255,e[1]/=255,e[2]/=255,e)},pV.directionFromAlphaBeta=function(t,e){var n=t/180*Math.PI+Math.PI/2,i=-e/180*Math.PI+Math.PI/2,r=[],o=Math.sin(n);return r[0]=o*Math.cos(i),r[1]=-Math.cos(n),r[2]=o*Math.sin(i),r},pV.getShadowResolution=function(t){var e=1024;switch(t){case"low":e=512;break;case"medium":break;case"high":e=2048;break;case"ultra":e=4096}return e},pV.COMMON_SHADERS=["lambert","color","realistic","hatching","shadow"],pV.createShader=function(t){"ecgl.shadow"===t&&(t="ecgl.displayShadow");var e=LN.source(t+".vertex"),n=LN.source(t+".fragment");e||console.error("Vertex shader of '%s' not exits",t),n||console.error("Fragment shader of '%s' not exits",t);var i=new LN(e,n);return i.name=t,i},pV.createMaterial=function(t,e){e instanceof Array||(e=[e]);var n=pV.createShader(t),i=new HO({shader:n});return e.forEach((function(t){"string"==typeof t&&i.define(t)})),i},pV.setMaterialFromModel=function(t,e,n,i){e.autoUpdateTextureStatus=!1;var r=n.getModel(t+"Material"),o=r.get("detailTexture"),a=xB.firstNotNull(r.get("textureTiling"),1),s=xB.firstNotNull(r.get("textureOffset"),0);"number"==typeof a&&(a=[a,a]),"number"==typeof s&&(s=[s,s]);var l=a[0]>1||a[1]>1?pV.Texture.REPEAT:pV.Texture.CLAMP_TO_EDGE,u={anisotropic:8,wrapS:l,wrapT:l};if("realistic"===t){var h=r.get("roughness"),c=r.get("metalness");null!=c?isNaN(c)&&(e.setTextureImage("metalnessMap",c,i,u),c=xB.firstNotNull(r.get("metalnessAdjust"),.5)):c=0,null!=h?isNaN(h)&&(e.setTextureImage("roughnessMap",h,i,u),h=xB.firstNotNull(r.get("roughnessAdjust"),.5)):h=.5;var d=r.get("normalTexture");e.setTextureImage("detailMap",o,i,u),e.setTextureImage("normalMap",d,i,u),e.set({roughness:h,metalness:c,detailUvRepeat:a,detailUvOffset:s})}else if("lambert"===t)e.setTextureImage("detailMap",o,i,u),e.set({detailUvRepeat:a,detailUvOffset:s});else if("color"===t)e.setTextureImage("detailMap",o,i,u),e.set({detailUvRepeat:a,detailUvOffset:s});else if("hatching"===t){var f=r.get("hatchingTextures")||[];f.length;for(var p=0;p<6;p++)e.setTextureImage("hatch"+(p+1),f[p],i,{anisotropic:8,wrapS:pV.Texture.REPEAT,wrapT:pV.Texture.REPEAT});e.set({detailUvRepeat:a,detailUvOffset:s})}},pV.updateVertexAnimation=function(t,e,n,i){var r=i.get("animation"),o=i.get("animationDurationUpdate"),a=i.get("animationEasingUpdate"),s=n.shadowDepthMaterial;if(r&&e&&o>0&&e.geometry.vertexCount===n.geometry.vertexCount){n.material.define("vertex","VERTEX_ANIMATION"),n.ignorePreZ=!0,s&&s.define("vertex","VERTEX_ANIMATION");for(var l=0;l=0&&this._viewsToDispose.splice(e,1),this.views.push(t),t.layer=this;var n=this.zr;t.scene.traverse((function(t){t.__zr=n,t.addAnimatorsToZr&&t.addAnimatorsToZr(n)}))}},xV.prototype.removeView=function(t){if(t.layer===this){var e=this.views.indexOf(t);e>=0&&(this.views.splice(e,1),t.scene.traverse(wV,this),t.layer=null,this._viewsToDispose.push(t))}},xV.prototype.removeViewsAll=function(){this.views.forEach((function(t){t.scene.traverse(wV,this),t.layer=null,this._viewsToDispose.push(t)}),this),this.views.length=0},xV.prototype.resize=function(t,e){this.renderer.resize(t,e)},xV.prototype.clear=function(){var t=this.renderer.gl,e=this._backgroundColor||[0,0,0,0];t.clearColor(e[0],e[1],e[2],e[3]),t.depthMask(!0),t.colorMask(!0,!0,!0,!0),t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT)},xV.prototype.clearDepth=function(){var t=this.renderer.gl;t.clear(t.DEPTH_BUFFER_BIT)},xV.prototype.clearColor=function(){var t=this.renderer.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT)},xV.prototype.needsRefresh=function(){this.zr.refresh()},xV.prototype.refresh=function(t){this._backgroundColor=t?_V.parseColor(t):[0,0,0,0],this.renderer.clearColor=this._backgroundColor;for(var e=0;e20)){t=t.event;var i=this.pickObject(t.offsetX,t.offsetY);i&&(this._dispatchEvent(t.type,t,i),this._dispatchDataEvent(t.type,t,i));var r=this._clickToSetFocusPoint(t);if(r)r.view.setDOFFocusOnPoint(r.distance)&&this.zr.refresh()}}},xV.prototype._clickToSetFocusPoint=function(t){for(var e=this.renderer,n=e.viewport,i=this.views.length-1;i>=0;i--){var r=this.views[i];if(r.hasDOF()&&r.containPoint(t.offsetX,t.offsetY)){this._picking.scene=r.scene,this._picking.camera=r.camera,e.viewport=r.viewport;var o=this._picking.pick(t.offsetX,t.offsetY,!0);if(o)return o.view=r,o}}e.viewport=n},xV.prototype.onglobalout=function(t){var e=this._hovered;e&&this._dispatchEvent("mouseout",t,{target:e.target})},xV.prototype.pickObject=function(t,e){for(var n=[],i=this.renderer,r=i.viewport,o=0;o=0&&(h.dataIndex=this._lastDataIndex,h.seriesIndex=this._lastSeriesIndex,this.zr.handler.dispatchToElement(u,"mouseout",e)),s=!0):null!=a&&a!==this._lastEventData&&(null!=this._lastEventData&&(h.eventData=this._lastEventData,this.zr.handler.dispatchToElement(u,"mouseout",e)),s=!0),this._lastEventData=a,this._lastDataIndex=r,this._lastSeriesIndex=o),h.eventData=a,h.dataIndex=r,h.seriesIndex=o,(null!=a||parseInt(r,10)>=0&&parseInt(o,10)>=0)&&(this.zr.handler.dispatchToElement(u,t,e),s&&this.zr.handler.dispatchToElement(u,"mouseover",e))},xV.prototype._dispatchToView=function(t,e){for(var n=0;nt&&a=0&&(!function(t){DV(t,"itemStyle"),DV(t,"lineStyle"),DV(t,"areaStyle"),DV(t,"label")}(e),"mapbox"===e.coordinateSystem&&(e.coordinateSystem="mapbox3D",t.mapbox3D=t.mapbox))})),IV(t.xAxis3D),IV(t.yAxis3D),IV(t.zAxis3D),IV(t.grid3D),DV(t.geo3D)}));const EV={defaultOption:{viewControl:{projection:"perspective",autoRotate:!1,autoRotateDirection:"cw",autoRotateSpeed:10,autoRotateAfterStill:3,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",distance:150,minDistance:40,maxDistance:400,orthographicSize:150,maxOrthographicSize:400,minOrthographicSize:20,center:[0,0,0],alpha:0,beta:0,minAlpha:-90,maxAlpha:90}},setView:function(t){t=t||{},this.option.viewControl=this.option.viewControl||{},null!=t.alpha&&(this.option.viewControl.alpha=t.alpha),null!=t.beta&&(this.option.viewControl.beta=t.beta),null!=t.distance&&(this.option.viewControl.distance=t.distance),null!=t.center&&(this.option.viewControl.center=t.center)}},OV={defaultOption:{postEffect:{enable:!1,bloom:{enable:!0,intensity:.1},depthOfField:{enable:!1,focalRange:20,focalDistance:50,blurRadius:10,fstop:2.8,quality:"medium"},screenSpaceAmbientOcclusion:{enable:!1,radius:2,quality:"medium",intensity:1},screenSpaceReflection:{enable:!1,quality:"medium",maxRoughness:.8},colorCorrection:{enable:!0,exposure:0,brightness:0,contrast:1,saturation:1,lookupTexture:""},edge:{enable:!1},FXAA:{enable:!1}},temporalSuperSampling:{enable:"auto"}}},NV={defaultOption:{light:{main:{shadow:!1,shadowQuality:"high",color:"#fff",intensity:1,alpha:0,beta:0},ambient:{color:"#fff",intensity:.2},ambientCubemap:{texture:null,exposure:1,diffuseIntensity:.5,specularIntensity:.5}}}};var RV=Gc.extend({type:"grid3D",dependencies:["xAxis3D","yAxis3D","zAxis3D"],defaultOption:{show:!0,zlevel:-10,left:0,top:0,width:"100%",height:"100%",environment:"auto",boxWidth:100,boxHeight:100,boxDepth:100,axisPointer:{show:!0,lineStyle:{color:"rgba(0, 0, 0, 0.8)",width:1},label:{show:!0,formatter:null,margin:8,textStyle:{fontSize:14,color:"#fff",backgroundColor:"rgba(0,0,0,0.5)",padding:3,borderRadius:3}}},axisLine:{show:!0,lineStyle:{color:"#333",width:2,type:"solid"}},axisTick:{show:!0,inside:!1,length:3,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,margin:8,textStyle:{fontSize:12}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},light:{main:{alpha:30,beta:40},ambient:{intensity:.4}},viewControl:{alpha:20,beta:40,autoRotate:!1,distance:200,minDistance:40,maxDistance:400}}});nt(RV.prototype,EV),nt(RV.prototype,OV),nt(RV.prototype,NV);const kV=RV;var zV=xB.firstNotNull,BV={left:0,middle:1,right:2};function FV(t){return t instanceof Array||(t=[t,t]),t}var VV=vE.extend((function(){return{zr:null,viewGL:null,_center:new QN,minDistance:.5,maxDistance:1.5,maxOrthographicSize:300,minOrthographicSize:30,minAlpha:-90,maxAlpha:90,minBeta:-1/0,maxBeta:1/0,autoRotateAfterStill:0,autoRotateDirection:"cw",autoRotateSpeed:60,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",_mode:"rotate",_camera:null,_needsUpdate:!1,_rotating:!1,_phi:0,_theta:0,_mouseX:0,_mouseY:0,_rotateVelocity:new JO,_panVelocity:new JO,_distance:500,_zoomSpeed:0,_stillTimeout:0,_animators:[]}}),(function(){["_mouseDownHandler","_mouseWheelHandler","_mouseMoveHandler","_mouseUpHandler","_pinchHandler","_contextMenuHandler","_update"].forEach((function(t){this[t]=this[t].bind(this)}),this)}),{init:function(){var t=this.zr;t&&(t.on("mousedown",this._mouseDownHandler),t.on("globalout",this._mouseUpHandler),t.on("mousewheel",this._mouseWheelHandler),t.on("pinch",this._pinchHandler),t.animation.on("frame",this._update),t.dom.addEventListener("contextmenu",this._contextMenuHandler))},dispose:function(){var t=this.zr;t&&(t.off("mousedown",this._mouseDownHandler),t.off("mousemove",this._mouseMoveHandler),t.off("mouseup",this._mouseUpHandler),t.off("mousewheel",this._mouseWheelHandler),t.off("pinch",this._pinchHandler),t.off("globalout",this._mouseUpHandler),t.dom.removeEventListener("contextmenu",this._contextMenuHandler),t.animation.off("frame",this._update)),this.stopAllAnimation()},getDistance:function(){return this._distance},setDistance:function(t){this._distance=t,this._needsUpdate=!0},getOrthographicSize:function(){return this._orthoSize},setOrthographicSize:function(t){this._orthoSize=t,this._needsUpdate=!0},getAlpha:function(){return this._theta/Math.PI*180},getBeta:function(){return-this._phi/Math.PI*180},getCenter:function(){return this._center.toArray()},setAlpha:function(t){t=Math.max(Math.min(this.maxAlpha,t),this.minAlpha),this._theta=t/180*Math.PI,this._needsUpdate=!0},setBeta:function(t){t=Math.max(Math.min(this.maxBeta,t),this.minBeta),this._phi=-t/180*Math.PI,this._needsUpdate=!0},setCenter:function(t){this._center.setArray(t)},setViewGL:function(t){this.viewGL=t},getCamera:function(){return this.viewGL.camera},setFromViewControlModel:function(t,e){var n=(e=e||{}).baseDistance||0,i=e.baseOrthoSize||1,r=t.get("projection");"perspective"!==r&&"orthographic"!==r&&"isometric"!==r&&(r="perspective"),this._projection=r,this.viewGL.setProjection(r);var o=t.get("distance")+n,a=t.get("orthographicSize")+i;[["damping",.8],["autoRotate",!1],["autoRotateAfterStill",3],["autoRotateDirection","cw"],["autoRotateSpeed",10],["minDistance",30],["maxDistance",400],["minOrthographicSize",30],["maxOrthographicSize",300],["minAlpha",-90],["maxAlpha",90],["minBeta",-1/0],["maxBeta",1/0],["rotateSensitivity",1],["zoomSensitivity",1],["panSensitivity",1],["panMouseButton","left"],["rotateMouseButton","middle"]].forEach((function(e){this[e[0]]=zV(t.get(e[0]),e[1])}),this),this.minDistance+=n,this.maxDistance+=n,this.minOrthographicSize+=i,this.maxOrthographicSize+=i;var s=t.ecModel,l={};["animation","animationDurationUpdate","animationEasingUpdate"].forEach((function(e){l[e]=zV(t.get(e),s&&s.get(e))}));var u=zV(e.alpha,t.get("alpha"))||0,h=zV(e.beta,t.get("beta"))||0,c=zV(e.center,t.get("center"))||[0,0,0];l.animation&&l.animationDurationUpdate>0&&this._notFirst?this.animateTo({alpha:u,beta:h,center:c,distance:o,orthographicSize:a,easing:l.animationEasingUpdate,duration:l.animationDurationUpdate}):(this.setDistance(o),this.setAlpha(u),this.setBeta(h),this.setCenter(c),this.setOrthographicSize(a)),this._notFirst=!0,this._validateProperties()},_validateProperties:function(){0},animateTo:function(t){var e=this.zr,n=this,i={},r={};return null!=t.distance&&(i.distance=this.getDistance(),r.distance=t.distance),null!=t.orthographicSize&&(i.orthographicSize=this.getOrthographicSize(),r.orthographicSize=t.orthographicSize),null!=t.alpha&&(i.alpha=this.getAlpha(),r.alpha=t.alpha),null!=t.beta&&(i.beta=this.getBeta(),r.beta=t.beta),null!=t.center&&(i.center=this.getCenter(),r.center=t.center),this._addAnimator(e.animation.animate(i).when(t.duration||1e3,r).during((function(){null!=i.alpha&&n.setAlpha(i.alpha),null!=i.beta&&n.setBeta(i.beta),null!=i.distance&&n.setDistance(i.distance),null!=i.center&&n.setCenter(i.center),null!=i.orthographicSize&&n.setOrthographicSize(i.orthographicSize),n._needsUpdate=!0}))).start(t.easing||"linear")},stopAllAnimation:function(){for(var t=0;t0},_update:function(t){if(this._rotating){var e=("cw"===this.autoRotateDirection?1:-1)*this.autoRotateSpeed/180*Math.PI;this._phi-=e*t/1e3,this._needsUpdate=!0}else this._rotateVelocity.len()>0&&(this._needsUpdate=!0);(Math.abs(this._zoomSpeed)>.1||this._panVelocity.len()>0)&&(this._needsUpdate=!0),this._needsUpdate&&(t=Math.min(t,50),this._updateDistanceOrSize(t),this._updatePan(t),this._updateRotate(t),this._updateTransform(),this.getCamera().update(),this.zr&&this.zr.refresh(),this.trigger("update"),this._needsUpdate=!1)},_updateRotate:function(t){var e=this._rotateVelocity;this._phi=e.y*t/20+this._phi,this._theta=e.x*t/20+this._theta,this.setAlpha(this.getAlpha()),this.setBeta(this.getBeta()),this._vectorDamping(e,Math.pow(this.damping,t/16))},_updateDistanceOrSize:function(t){"perspective"===this._projection?this._setDistance(this._distance+this._zoomSpeed*t/20):this._setOrthoSize(this._orthoSize+this._zoomSpeed*t/20),this._zoomSpeed*=Math.pow(this.damping,t/16)},_setDistance:function(t){this._distance=Math.max(Math.min(t,this.maxDistance),this.minDistance)},_setOrthoSize:function(t){this._orthoSize=Math.max(Math.min(t,this.maxOrthographicSize),this.minOrthographicSize);var e=this.getCamera(),n=this._orthoSize,i=n/this.viewGL.viewport.height*this.viewGL.viewport.width;e.left=-i/2,e.right=i/2,e.top=n/2,e.bottom=-n/2},_updatePan:function(t){var e=this._panVelocity,n=this._distance,i=this.getCamera(),r=i.worldTransform.y,o=i.worldTransform.x;this._center.scaleAndAdd(o,-e.x*n/200).scaleAndAdd(r,-e.y*n/200),this._vectorDamping(e,0)},_updateTransform:function(){var t=this.getCamera(),e=new QN,n=this._theta+Math.PI/2,i=this._phi+Math.PI/2,r=Math.sin(n);e.x=r*Math.cos(i),e.y=-Math.cos(n),e.z=r*Math.sin(i),t.position.copy(this._center).scaleAndAdd(e,this._distance),t.rotation.identity().rotateY(-this._phi).rotateX(-this._theta)},_startCountingStill:function(){clearTimeout(this._stillTimeout);var t=this.autoRotateAfterStill,e=this;!isNaN(t)&&t>0&&(this._stillTimeout=setTimeout((function(){e._rotating=!0}),1e3*t))},_vectorDamping:function(t,e){var n=t.len();(n*=e)<1e-4&&(n=0),t.normalize().scale(n)},_decomposeTransform:function(){if(this.getCamera()){this.getCamera().updateWorldTransform();var t=this.getCamera().worldTransform.z,e=Math.asin(t.y),n=Math.atan2(t.x,t.z);this._theta=e,this._phi=-n,this.setBeta(this.getBeta()),this.setAlpha(this.getAlpha()),this.getCamera().aspect?this._setDistance(this.getCamera().position.dist(this._center)):this._setOrthoSize(this.getCamera().top-this.getCamera().bottom)}},_mouseDownHandler:function(t){if(!t.target&&!this._isAnimating()){var e=t.offsetX,n=t.offsetY;this.viewGL&&!this.viewGL.containPoint(e,n)||(this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler),t.event.targetTouches?1===t.event.targetTouches.length&&(this._mode="rotate"):t.event.button===BV[this.rotateMouseButton]?this._mode="rotate":t.event.button===BV[this.panMouseButton]?this._mode="pan":this._mode="",this._rotateVelocity.set(0,0),this._rotating=!1,this.autoRotate&&this._startCountingStill(),this._mouseX=t.offsetX,this._mouseY=t.offsetY)}},_mouseMoveHandler:function(t){if(!(t.target&&t.target.__isGLToZRProxy||this._isAnimating())){var e=FV(this.panSensitivity),n=FV(this.rotateSensitivity);"rotate"===this._mode?(this._rotateVelocity.y=(t.offsetX-this._mouseX)/this.zr.getHeight()*2*n[0],this._rotateVelocity.x=(t.offsetY-this._mouseY)/this.zr.getWidth()*2*n[1]):"pan"===this._mode&&(this._panVelocity.x=(t.offsetX-this._mouseX)/this.zr.getWidth()*e[0]*400,this._panVelocity.y=(-t.offsetY+this._mouseY)/this.zr.getHeight()*e[1]*400),this._mouseX=t.offsetX,this._mouseY=t.offsetY,t.event.preventDefault()}},_mouseWheelHandler:function(t){if(!this._isAnimating()){var e=t.event.wheelDelta||-t.event.detail;this._zoomHandler(t,e)}},_pinchHandler:function(t){this._isAnimating()||(this._zoomHandler(t,t.pinchScale>1?1:-1),this._mode="")},_zoomHandler:function(t,e){if(0!==e){var n,i=t.offsetX,r=t.offsetY;if(!this.viewGL||this.viewGL.containPoint(i,r))n="perspective"===this._projection?Math.max(Math.max(Math.min(this._distance-this.minDistance,this.maxDistance-this._distance))/20,.5):Math.max(Math.max(Math.min(this._orthoSize-this.minOrthographicSize,this.maxOrthographicSize-this._orthoSize))/20,.5),this._zoomSpeed=(e>0?-1:1)*n*this.zoomSensitivity,this._rotating=!1,this.autoRotate&&"rotate"===this._mode&&this._startCountingStill(),t.event.preventDefault()}},_mouseUpHandler:function(){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_isRightMouseButtonUsed:function(){return"right"===this.rotateMouseButton||"right"===this.panMouseButton},_contextMenuHandler:function(t){this._isRightMouseButtonUsed()&&t.preventDefault()},_addAnimator:function(t){var e=this._animators;return e.push(t),t.done((function(){var n=e.indexOf(t);n>=0&&e.splice(n,1)})),t}});Object.defineProperty(VV.prototype,"autoRotate",{get:function(t){return this._autoRotate},set:function(t){this._autoRotate=t,this._rotating=t}});const GV=VV,HV={convertToDynamicArray:function(t){t&&this.resetOffset();var e=this.attributes;for(var n in e)t||!e[n].value?e[n].value=[]:e[n].value=Array.prototype.slice.call(e[n].value);t||!this.indices?this.indices=[]:this.indices=Array.prototype.slice.call(this.indices)},convertToTypedArray:function(){var t=this.attributes;for(var e in t)t[e].value&&t[e].value.length>0?t[e].value=new Float32Array(t[e].value):t[e].value=null;this.indices&&this.indices.length>0&&(this.indices=this.vertexCount>65535?new Uint32Array(this.indices):new Uint16Array(this.indices)),this.dirty()}},UV={vec2:qO,vec3:EN,vec4:uR,mat2:kB,mat2d:VB,mat3:cR,mat4:IN,quat:vR};var WV=UV.vec3,jV=[[0,0],[1,1]],ZV=xk.extend((function(){return{segmentScale:1,dynamic:!0,useNativeLine:!0,attributes:{position:new xk.Attribute("position","float",3,"POSITION"),positionPrev:new xk.Attribute("positionPrev","float",3),positionNext:new xk.Attribute("positionNext","float",3),prevPositionPrev:new xk.Attribute("prevPositionPrev","float",3),prevPosition:new xk.Attribute("prevPosition","float",3),prevPositionNext:new xk.Attribute("prevPositionNext","float",3),offset:new xk.Attribute("offset","float",1),color:new xk.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(t){var e=this.attributes;this.vertexCount!==t&&(e.position.init(t),e.color.init(t),this.useNativeLine||(e.positionPrev.init(t),e.positionNext.init(t),e.offset.init(t)),t>65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(t){this.triangleCount!==t&&(this.indices=0===t?null:this.vertexCount>65535?new Uint32Array(3*t):new Uint16Array(3*t))},_getCubicCurveApproxStep:function(t,e,n,i){return 1/(WV.dist(t,e)+WV.dist(n,e)+WV.dist(i,n)+1)*this.segmentScale},getCubicCurveVertexCount:function(t,e,n,i){var r=this._getCubicCurveApproxStep(t,e,n,i),o=Math.ceil(1/r);return this.useNativeLine?2*o:2*o+2},getCubicCurveTriangleCount:function(t,e,n,i){var r=this._getCubicCurveApproxStep(t,e,n,i),o=Math.ceil(1/r);return this.useNativeLine?0:2*o},getLineVertexCount:function(){return this.getPolylineVertexCount(jV)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(jV)},getPolylineVertexCount:function(t){var e;"number"==typeof t?e=t:e="number"!=typeof t[0]?t.length:t.length/3;return this.useNativeLine?2*(e-1):2*(e-1)+2},getPolylineTriangleCount:function(t){var e;"number"==typeof t?e=t:e="number"!=typeof t[0]?t.length:t.length/3;return this.useNativeLine?0:2*Math.max(e-1,0)},addCubicCurve:function(t,e,n,i,r,o){null==o&&(o=1);var a=t[0],s=t[1],l=t[2],u=e[0],h=e[1],c=e[2],d=n[0],f=n[1],p=n[2],g=i[0],m=i[1],v=i[2],_=this._getCubicCurveApproxStep(t,e,n,i),y=_*_,x=y*_,w=3*_,b=3*y,T=6*y,S=6*x,M=a-2*u+d,C=s-2*h+f,L=l-2*c+p,A=3*(u-d)-a+g,D=3*(h-f)-s+m,I=3*(c-p)-l+v,P=a,E=s,O=l,N=(u-a)*w+M*b+A*x,R=(h-s)*w+C*b+D*x,k=(c-l)*w+L*b+I*x,z=M*T+A*S,B=C*T+D*S,F=L*T+I*S,V=A*S,G=D*S,H=I*S,U=0,W=0,j=Math.ceil(1/_),Z=new Float32Array(3*(j+1)),X=(Z=[],0);for(W=0;W1&&(P=N>0?Math.min(P,g):Math.max(P,g),E=R>0?Math.min(E,m):Math.max(E,m),O=k>0?Math.min(O,v):Math.max(O,v));return this.addPolyline(Z,r,o)},addLine:function(t,e,n,i){return this.addPolyline([t,e],n,i)},addPolyline:function(t,e,n,i,r){if(t.length){var o="number"!=typeof t[0];if(null==r&&(r=o?t.length:t.length/3),!(r<2)){null==i&&(i=0),null==n&&(n=1),this._itemVertexOffsets.push(this._vertexOffset);var a,s,l=(o="number"!=typeof t[0])?"number"!=typeof e[0]:e.length/4===r,u=this.attributes.position,h=this.attributes.positionPrev,c=this.attributes.positionNext,d=this.attributes.color,f=this.attributes.offset,p=this.indices,g=this._vertexOffset;n=Math.max(n,.01);for(var m=i;m1&&(u.copy(g,g-1),d.copy(g,g-1),g++):(m0&&(c.set(g-2,a),c.set(g-1,a)),u.set(g,a),u.set(g+1,a),d.set(g,s),d.set(g+1,s),f.set(g,n/2),f.set(g+1,-n/2),g+=2),this.useNativeLine)d.set(g,s),u.set(g,a),g++;else if(m>0){var y=3*this._triangleOffset;(p=this.indices)[y]=g-4,p[y+1]=g-3,p[y+2]=g-2,p[y+3]=g-3,p[y+4]=g-1,p[y+5]=g-2,this._triangleOffset+=2}}if(!this.useNativeLine){var x=this._vertexOffset,w=this._vertexOffset+2*r;h.copy(x,x+2),h.copy(x+1,x+3),c.copy(w-1,w-3),c.copy(w-2,w-4)}return this._vertexOffset=g,this._vertexOffset}}},setItemColor:function(t,e){for(var n=this._itemVertexOffsets[t],i=ta&&(r=this._x=0,o+=this._rowHeight+l,this._y=o,this._rowHeight=0),this._x+=e+l,this._rowHeight=Math.max(this._rowHeight,n),o+n+l>s)return null;t.x+=this.offsetX*this.dpr+r,t.y+=this.offsetY*this.dpr+o,this._zr.add(t);var u=[this.offsetX/this.width,this.offsetY/this.height];return[[r/a+u[0],o/s+u[1]],[(r+e)/a+u[0],(o+n)/s+u[1]]]},_fitElement:function(t,e,n){var i=t.getBoundingRect(),r=e/i.width,o=n/i.height;t.x=-i.x*r,t.y=-i.y*o,t.scaleX=r,t.scaleY=o,t.update()}},YV.prototype={clear:function(){for(var t=0;t=t)){var r=(n+this._nodeWidth)*this._dpr,o=(i+this._nodeHeight)*this._dpr;try{this._zr.resize({width:r,height:o})}catch(t){this._canvas.width=r,this._canvas.height=o}var a=new qV(this._zr,n,i,this._nodeWidth,this._nodeHeight,this._gap,this._dpr);return this._textureAtlasNodes.push(a),a}},add:function(t,e,n){if(this._coords[t.id])return this._coords[t.id];var i=this._getCurrentNode().add(t,e,n);if(!i){var r=this._expand();if(!r)return;i=r.add(t,e,n)}return this._coords[t.id]=i,i},getCoordsScale:function(){var t=this._dpr;return[this._nodeWidth/this._canvas.width*t,this._nodeHeight/this._canvas.height*t]},getCoords:function(t){return this._coords[t]},dispose:function(){this._zr.dispose()}};const KV=YV;function JV(){}JV.prototype={constructor:JV,setScene:function(t){this._scene=t,this._skybox&&this._skybox.attachScene(this._scene)},initLight:function(t){this._lightRoot=t,this.mainLight=new _V.DirectionalLight({shadowBias:.005}),this.ambientLight=new _V.AmbientLight,t.add(this.mainLight),t.add(this.ambientLight)},dispose:function(){this._lightRoot&&(this._lightRoot.remove(this.mainLight),this._lightRoot.remove(this.ambientLight))},updateLight:function(t){var e=this.mainLight,n=this.ambientLight,i=t.getModel("light"),r=i.getModel("main"),o=i.getModel("ambient");e.intensity=r.get("intensity"),n.intensity=o.get("intensity"),e.color=_V.parseColor(r.get("color")).slice(0,3),n.color=_V.parseColor(o.get("color")).slice(0,3);var a=r.get("alpha")||0,s=r.get("beta")||0;e.position.setArray(_V.directionFromAlphaBeta(a,s)),e.lookAt(_V.Vector3.ZERO),e.castShadow=r.get("shadow"),e.shadowResolution=_V.getShadowResolution(r.get("shadowQuality"))},updateAmbientCubemap:function(t,e,n){var i=e.getModel("light.ambientCubemap"),r=i.get("texture");if(r){this._cubemapLightsCache=this._cubemapLightsCache||{};var o=this._cubemapLightsCache[r];if(!o){var a=this;o=this._cubemapLightsCache[r]=_V.createAmbientCubemap(i.option,t,n,(function(){a._isSkyboxFromAmbientCubemap&&a._skybox.setEnvironmentMap(o.specular.cubemap),n.getZr().refresh()}))}this._lightRoot.add(o.diffuse),this._lightRoot.add(o.specular),this._currentCubemapLights=o}else this._currentCubemapLights&&(this._lightRoot.remove(this._currentCubemapLights.diffuse),this._lightRoot.remove(this._currentCubemapLights.specular),this._currentCubemapLights=null)},updateSkybox:function(t,e,n){var i=e.get("environment"),r=this;var o=(r._skybox=r._skybox||new Rz,r._skybox);if(i&&"none"!==i)if("auto"===i)if(this._isSkyboxFromAmbientCubemap=!0,this._currentCubemapLights){var a=this._currentCubemapLights.specular.cubemap;o.setEnvironmentMap(a),this._scene&&o.attachScene(this._scene),o.material.set("lod",3)}else this._skybox&&this._skybox.detachScene();else if("object"==typeof i&&i.colorStops||"string"==typeof i&&Ri(i)){this._isSkyboxFromAmbientCubemap=!1;var s=new _V.Texture2D({anisotropic:8,flipY:!1});o.setEnvironmentMap(s);var l=s.image=document.createElement("canvas");l.width=l.height=16,v_(l.getContext("2d"),new Fl({shape:{x:0,y:0,width:16,height:16},style:{fill:i}})),o.attachScene(this._scene)}else{this._isSkyboxFromAmbientCubemap=!1;s=_V.loadTexture(i,n,{anisotropic:8,flipY:!1});o.setEnvironmentMap(s),o.attachScene(this._scene)}else this._skybox&&this._skybox.detachScene(this._scene),this._skybox=null;var u=e.coordinateSystem;if(this._skybox)if(!u||!u.viewGL||"auto"===i||i.match&&i.match(/.hdr$/))this._skybox.material.undefine("fragment","SRGB_DECODE");else{var h=u.viewGL.isLinearSpace()?"define":"undefine";this._skybox.material[h]("fragment","SRGB_DECODE")}}};const $V=JV;var QV=UV.vec3,tG=xk.extend((function(){return{segmentScale:1,useNativeLine:!0,attributes:{position:new xk.Attribute("position","float",3,"POSITION"),normal:new xk.Attribute("normal","float",3,"NORMAL"),color:new xk.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setQuadCount:function(t){var e=this.attributes,n=this.getQuadVertexCount()*t,i=this.getQuadTriangleCount()*t;this.vertexCount!==n&&(e.position.init(n),e.normal.init(n),e.color.init(n)),this.triangleCount!==i&&(this.indices=n>65535?new Uint32Array(3*i):new Uint16Array(3*i))},getQuadVertexCount:function(){return 4},getQuadTriangleCount:function(){return 2},addQuad:function(){var t=QV.create(),e=QV.create(),n=QV.create(),i=[0,3,1,3,2,1];return function(r,o){var a=this.attributes.position,s=this.attributes.normal,l=this.attributes.color;QV.sub(t,r[1],r[0]),QV.sub(e,r[2],r[1]),QV.cross(n,t,e),QV.normalize(n,n);for(var u=0;u<4;u++)a.set(this._vertexOffset+u,r[u]),l.set(this._vertexOffset+u,o),s.set(this._vertexOffset+u,n);var h=3*this._faceOffset;for(u=0;u<6;u++)this.indices[h+u]=i[u]+this._vertexOffset;this._vertexOffset+=4,this._faceOffset+=2}}()});ot(tG.prototype,HV);const eG=tG;var nG=xB.firstNotNull,iG={x:0,y:2,z:1};function rG(t,e,n){this.rootNode=new _V.Node;var i=new _V.Mesh({geometry:new XV({useNativeLine:!1}),material:e,castShadow:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:1}),r=new _V.Mesh({geometry:new eG,material:n,castShadow:!1,culling:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:0});this.rootNode.add(r),this.rootNode.add(i),this.faceInfo=t,this.plane=new _V.Plane,this.linesMesh=i,this.quadsMesh=r}rG.prototype.update=function(t,e,n){var i=t.coordinateSystem,r=[i.getAxis(this.faceInfo[0]),i.getAxis(this.faceInfo[1])],o=this.linesMesh.geometry,a=this.quadsMesh.geometry;o.convertToDynamicArray(!0),a.convertToDynamicArray(!0),this._updateSplitLines(o,r,t,n),this._udpateSplitAreas(a,r,t,n),o.convertToTypedArray(),a.convertToTypedArray();var s=i.getAxis(this.faceInfo[2]);!function(t,e,n,i){var r=[0,0,0],o=i<0?n.getExtentMin():n.getExtentMax();r[iG[n.dim]]=o,t.position.setArray(r),t.rotation.identity(),e.distance=-Math.abs(o),e.normal.set(0,0,0),"x"===n.dim?(t.rotation.rotateY(i*Math.PI/2),e.normal.x=-i):"z"===n.dim?(t.rotation.rotateX(-i*Math.PI/2),e.normal.y=-i):(i>0&&t.rotation.rotateY(Math.PI),e.normal.z=-i)}(this.rootNode,this.plane,s,this.faceInfo[3])},rG.prototype._updateSplitLines=function(t,e,n,i){var r=i.getDevicePixelRatio();e.forEach((function(i,o){var a=i.model,s=e[1-o].getExtent();if(!i.scale.isBlank()){var l=a.getModel("splitLine",n.getModel("splitLine"));if(l.get("show")){var u=l.getModel("lineStyle"),h=u.get("color"),c=nG(u.get("opacity"),1),d=nG(u.get("width"),1);h=yt(h)?h:[h];for(var f=i.getTicksCoords({tickModel:l}),p=0,g=0;g65535?new Uint32Array(3*n):new Uint16Array(3*n))},setSpriteAlign:function(t,e,n,i,r){var o,a,s,l;switch(null==n&&(n="left"),null==i&&(i="top"),r=r||0,n){case"left":o=r,s=e[0]+r;break;case"center":case"middle":o=-e[0]/2,s=e[0]/2;break;case"right":o=-e[0]-r,s=-r}switch(i){case"bottom":a=r,l=e[1]+r;break;case"middle":a=-e[1]/2,l=e[1]/2;break;case"top":a=-e[1]-r,l=-r}var u=4*t,h=this.attributes.offset;h.set(u,[o,l]),h.set(u+1,[s,l]),h.set(u+2,[s,a]),h.set(u+3,[o,a])},addSprite:function(t,e,n,i,r,o){var a=this._vertexOffset;this.setSprite(this._vertexOffset/4,t,e,n,i,r,o);for(var s=0;s 0.0) {\n currProj = clipNear(currProj, nextProj);\n }\n else if (prevProj.w > 0.0) {\n currProj = clipNear(currProj, prevProj);\n }\n }\n\n vec2 prevScreen = (prevProj.xy / abs(prevProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 currScreen = (currProj.xy / abs(currProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 nextScreen = (nextProj.xy / abs(nextProj.w) + 1.0) * 0.5 * viewport.zw;\n\n vec2 dir;\n float len = offset;\n if (position == positionPrev) {\n dir = normalize(nextScreen - currScreen);\n }\n else if (position == positionNext) {\n dir = normalize(currScreen - prevScreen);\n }\n else {\n vec2 dirA = normalize(currScreen - prevScreen);\n vec2 dirB = normalize(nextScreen - currScreen);\n\n vec2 tanget = normalize(dirA + dirB);\n\n float miter = 1.0 / max(dot(tanget, dirA), 0.5);\n len *= miter;\n dir = tanget;\n }\n\n dir = vec2(-dir.y, dir.x) * len;\n currScreen += dir;\n\n currProj.xy = (currScreen / viewport.zw - 0.5) * 2.0 * abs(currProj.w);\n@end\n\n\n@export ecgl.meshLines3D.vertex\n\nattribute vec3 position: POSITION;\nattribute vec3 positionPrev;\nattribute vec3 positionNext;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevPositionPrev;\nattribute vec3 prevPositionNext;\nuniform float percent : 1.0;\n#endif\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\nuniform float near : NEAR;\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.vertexHeader\n\n@import ecgl.lines3D.clipNear\n\nvoid main()\n{\n @import ecgl.lines3D.expandLine\n\n gl_Position = currProj;\n\n v_Color = a_Color;\n\n @import ecgl.common.wireframe.vertexMain\n}\n@end\n\n\n@export ecgl.meshLines3D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end";var mG=xB.firstNotNull;_V.Shader.import(gG);var vG={x:0,y:2,z:1};const _G=Dp.extend({type:"grid3D",__ecgl__:!0,init:function(t,e){var n=new _V.Material({shader:_V.createShader("ecgl.color"),depthMask:!1,transparent:!0}),i=new _V.Material({shader:_V.createShader("ecgl.meshLines3D"),depthMask:!1,transparent:!0});n.define("fragment","DOUBLE_SIDED"),n.define("both","VERTEX_COLOR"),this.groupGL=new _V.Node,this._control=new GV({zr:e.getZr()}),this._control.init(),this._faces=[["y","z","x",-1,"left"],["y","z","x",1,"right"],["x","y","z",-1,"bottom"],["x","y","z",1,"top"],["x","z","y",-1,"far"],["x","z","y",1,"near"]].map((function(t){var e=new oG(t,i,n);return this.groupGL.add(e.rootNode),e}),this),this._axes=["x","y","z"].map((function(t){var e=new pG(t,i);return this.groupGL.add(e.rootNode),e}),this);var r=e.getDevicePixelRatio();this._axisLabelSurface=new KV({width:256,height:256,devicePixelRatio:r}),this._axisLabelSurface.onupdate=function(){e.getZr().refresh()},this._axisPointerLineMesh=new _V.Mesh({geometry:new XV({useNativeLine:!1}),material:i,castShadow:!1,ignorePicking:!0,renderOrder:3}),this.groupGL.add(this._axisPointerLineMesh),this._axisPointerLabelsSurface=new KV({width:128,height:128,devicePixelRatio:r}),this._axisPointerLabelsMesh=new uG({ignorePicking:!0,renderOrder:4,castShadow:!1}),this._axisPointerLabelsMesh.material.set("textureAtlas",this._axisPointerLabelsSurface.getTexture()),this.groupGL.add(this._axisPointerLabelsMesh),this._lightRoot=new _V.Node,this._sceneHelper=new $V,this._sceneHelper.initLight(this._lightRoot)},render:function(t,e,n){this._model=t,this._api=n;var i=t.coordinateSystem;i.viewGL.add(this._lightRoot),t.get("show")?i.viewGL.add(this.groupGL):i.viewGL.remove(this.groupGL);var r=this._control;r.setViewGL(i.viewGL);var o=t.getModel("viewControl");r.setFromViewControlModel(o,0),this._axisLabelSurface.clear(),r.off("update"),t.get("show")&&(this._faces.forEach((function(i){i.update(t,e,n)}),this),this._axes.forEach((function(e){e.update(t,this._axisLabelSurface,n)}),this)),r.on("update",this._onCameraChange.bind(this,t,n),this),this._sceneHelper.setScene(i.viewGL.scene),this._sceneHelper.updateLight(t),i.viewGL.setPostEffect(t.getModel("postEffect"),n),i.viewGL.setTemporalSuperSampling(t.getModel("temporalSuperSampling")),this._initMouseHandler(t)},afterRender:function(t,e,n,i){var r=i.renderer;this._sceneHelper.updateAmbientCubemap(r,t,n),this._sceneHelper.updateSkybox(r,t,n)},showAxisPointer:function(t,e,n,i){this._doShowAxisPointer(),this._updateAxisPointer(i.value)},hideAxisPointer:function(t,e,n,i){this._doHideAxisPointer()},_initMouseHandler:function(t){var e=t.coordinateSystem.viewGL;t.get("show")&&t.get("axisPointer.show")?e.on("mousemove",this._updateAxisPointerOnMousePosition,this):e.off("mousemove",this._updateAxisPointerOnMousePosition)},_updateAxisPointerOnMousePosition:function(t){if(!t.target){for(var e,n=this._model.coordinateSystem,i=n.viewGL,r=i.castRay(t.offsetX,t.offsetY,new _V.Ray),o=0;oi[1]?0:1,a=this._faces[2*n+o],s=this._faces[2*n+1-o];a.rootNode.invisible=!0,s.rootNode.invisible=!1}},_updateAxisLinePosition:function(){var t=this._model.coordinateSystem,e=t.getAxis("x"),n=t.getAxis("y"),i=t.getAxis("z"),r=i.getExtentMax(),o=i.getExtentMin(),a=e.getExtentMin(),s=e.getExtentMax(),l=n.getExtentMax(),u=n.getExtentMin(),h=this._axes[0].rootNode,c=this._axes[1].rootNode,d=this._axes[2].rootNode,f=this._faces,p=f[4].rootNode.invisible?u:l,g=f[2].rootNode.invisible?r:o,m=f[0].rootNode.invisible?a:s,v=f[2].rootNode.invisible?r:o,_=f[0].rootNode.invisible?s:a,y=f[4].rootNode.invisible?u:l;h.rotation.identity(),c.rotation.identity(),d.rotation.identity(),f[4].rootNode.invisible&&(this._axes[0].flipped=!0,h.rotation.rotateX(Math.PI)),f[0].rootNode.invisible&&(this._axes[1].flipped=!0,c.rotation.rotateZ(Math.PI)),f[4].rootNode.invisible&&(this._axes[2].flipped=!0,d.rotation.rotateY(Math.PI)),h.position.set(0,g,p),c.position.set(m,v,0),d.position.set(_,0,y),h.update(),c.update(),d.update(),this._updateAxisLabelAlign()},_updateAxisLabelAlign:function(){var t=this._control.getCamera(),e=[new _V.Vector4,new _V.Vector4],n=new _V.Vector4;this.groupGL.getWorldPosition(n),n.w=1,n.transformMat4(t.viewMatrix).transformMat4(t.projectionMatrix),n.x/=n.w,n.y/=n.w,this._axes.forEach((function(i){for(var r=i.axisLineCoords,o=(i.labelsMesh.geometry,0);on.y?"bottom":"top"):(s="middle",a=h>n.x?"left":"right"),i.setSpriteAlign(a,s,this._api)}),this)},_doShowAxisPointer:function(){this._axisPointerLineMesh.invisible&&(this._axisPointerLineMesh.invisible=!1,this._axisPointerLabelsMesh.invisible=!1,this._api.getZr().refresh())},_doHideAxisPointer:function(){this._axisPointerLineMesh.invisible||(this._axisPointerLineMesh.invisible=!0,this._axisPointerLabelsMesh.invisible=!0,this._api.getZr().refresh())},_updateAxisPointer:function(t){var e=this._model.coordinateSystem,n=e.dataToPoint(t),i=this._axisPointerLineMesh.geometry,r=this._model.getModel("axisPointer"),o=this._api.getDevicePixelRatio();function a(t){return xB.firstNotNull(t.model.get("axisPointer.show"),r.get("show"))}function s(t){var e=t.model.getModel("axisPointer",r).getModel("lineStyle"),n=_V.parseColor(e.get("color")),i=mG(e.get("width"),1),o=mG(e.get("opacity"),1);return n[3]*=o,{color:n,lineWidth:i}}i.convertToDynamicArray(!0);for(var l=0;l 0.0) {\n if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {\n discard;\n }\n }\n#ifdef USE_VSM\n depth = depth * 0.5 + 0.5;\n float moment1 = depth;\n float moment2 = depth * depth;\n #ifdef SUPPORT_STANDARD_DERIVATIVES\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n moment2 += 0.25*(dx*dx+dy*dy);\n #endif\n gl_FragColor = vec4(moment1, moment2, 0.0, 1.0);\n#else\n #ifdef SUPPORT_STANDARD_DERIVATIVES\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n depth += sqrt(dx*dx + dy*dy) * slopeScale + bias;\n #else\n depth += bias;\n #endif\n gl_FragColor = encodeFloat(depth * 0.5 + 0.5);\n#endif\n}\n@end\n@export clay.sm.debug_depth\nuniform sampler2D depthMap;\nvarying vec2 v_Texcoord;\n@import clay.util.decode_float\nvoid main() {\n vec4 tex = texture2D(depthMap, v_Texcoord);\n#ifdef USE_VSM\n gl_FragColor = vec4(tex.rgb, 1.0);\n#else\n float depth = decodeFloat(tex);\n gl_FragColor = vec4(depth, depth, depth, 1.0);\n#endif\n}\n@end\n@export clay.sm.distance.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 world : WORLD;\nattribute vec3 position : POSITION;\n@import clay.chunk.skinning_header\nvarying vec3 v_WorldPosition;\nvoid main (){\n vec4 P = vec4(position, 1.0);\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n P = skinMatrixWS * P;\n#endif\n#ifdef INSTANCING\n @import clay.chunk.instancing_matrix\n P = instanceMat * P;\n#endif\n gl_Position = worldViewProjection * P;\n v_WorldPosition = (world * P).xyz;\n}\n@end\n@export clay.sm.distance.fragment\nuniform vec3 lightPosition;\nuniform float range : 100;\nvarying vec3 v_WorldPosition;\n@import clay.util.encode_float\nvoid main(){\n float dist = distance(lightPosition, v_WorldPosition);\n#ifdef USE_VSM\n gl_FragColor = vec4(dist, dist * dist, 0.0, 0.0);\n#else\n dist = dist / range;\n gl_FragColor = encodeFloat(dist);\n#endif\n}\n@end\n@export clay.plugin.shadow_map_common\n@import clay.util.decode_float\nfloat tapShadowMap(sampler2D map, vec2 uv, float z){\n vec4 tex = texture2D(map, uv);\n return step(z, decodeFloat(tex) * 2.0 - 1.0);\n}\nfloat pcf(sampler2D map, vec2 uv, float z, float textureSize, vec2 scale) {\n float shadowContrib = tapShadowMap(map, uv, z);\n vec2 offset = vec2(1.0 / textureSize) * scale;\n#ifdef PCF_KERNEL_SIZE\n for (int _idx_ = 0; _idx_ < PCF_KERNEL_SIZE; _idx_++) {{\n shadowContrib += tapShadowMap(map, uv + offset * pcfKernel[_idx_], z);\n }}\n return shadowContrib / float(PCF_KERNEL_SIZE + 1);\n#else\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, 0.0), z);\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(0.0, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, 0.0), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, -offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, -offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(0.0, -offset.y), z);\n return shadowContrib / 9.0;\n#endif\n}\nfloat pcf(sampler2D map, vec2 uv, float z, float textureSize) {\n return pcf(map, uv, z, textureSize, vec2(1.0));\n}\nfloat chebyshevUpperBound(vec2 moments, float z){\n float p = 0.0;\n z = z * 0.5 + 0.5;\n if (z <= moments.x) {\n p = 1.0;\n }\n float variance = moments.y - moments.x * moments.x;\n variance = max(variance, 0.0000001);\n float mD = moments.x - z;\n float pMax = variance / (variance + mD * mD);\n pMax = clamp((pMax-0.4)/(1.0-0.4), 0.0, 1.0);\n return max(p, pMax);\n}\nfloat computeShadowContrib(\n sampler2D map, mat4 lightVPM, vec3 position, float textureSize, vec2 scale, vec2 offset\n) {\n vec4 posInLightSpace = lightVPM * vec4(position, 1.0);\n posInLightSpace.xyz /= posInLightSpace.w;\n float z = posInLightSpace.z;\n if(all(greaterThan(posInLightSpace.xyz, vec3(-0.99, -0.99, -1.0))) &&\n all(lessThan(posInLightSpace.xyz, vec3(0.99, 0.99, 1.0)))){\n vec2 uv = (posInLightSpace.xy+1.0) / 2.0;\n #ifdef USE_VSM\n vec2 moments = texture2D(map, uv * scale + offset).xy;\n return chebyshevUpperBound(moments, z);\n #else\n return pcf(map, uv * scale + offset, z, textureSize, scale);\n #endif\n }\n return 1.0;\n}\nfloat computeShadowContrib(sampler2D map, mat4 lightVPM, vec3 position, float textureSize) {\n return computeShadowContrib(map, lightVPM, position, textureSize, vec2(1.0), vec2(0.0));\n}\nfloat computeShadowContribOmni(samplerCube map, vec3 direction, float range)\n{\n float dist = length(direction);\n vec4 shadowTex = textureCube(map, direction);\n#ifdef USE_VSM\n vec2 moments = shadowTex.xy;\n float variance = moments.y - moments.x * moments.x;\n float mD = moments.x - dist;\n float p = variance / (variance + mD * mD);\n if(moments.x + 0.001 < dist){\n return clamp(p, 0.0, 1.0);\n }else{\n return 1.0;\n }\n#else\n return step(dist, (decodeFloat(shadowTex) + 0.0002) * range);\n#endif\n}\n@end\n@export clay.plugin.compute_shadow_map\n#if defined(SPOT_LIGHT_SHADOWMAP_COUNT) || defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT) || defined(POINT_LIGHT_SHADOWMAP_COUNT)\n#ifdef SPOT_LIGHT_SHADOWMAP_COUNT\nuniform sampler2D spotLightShadowMaps[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform mat4 spotLightMatrices[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform float spotLightShadowMapSizes[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\n#ifdef DIRECTIONAL_LIGHT_SHADOWMAP_COUNT\n#if defined(SHADOW_CASCADE)\nuniform sampler2D directionalLightShadowMaps[1]:unconfigurable;\nuniform mat4 directionalLightMatrices[SHADOW_CASCADE]:unconfigurable;\nuniform float directionalLightShadowMapSizes[1]:unconfigurable;\nuniform float shadowCascadeClipsNear[SHADOW_CASCADE]:unconfigurable;\nuniform float shadowCascadeClipsFar[SHADOW_CASCADE]:unconfigurable;\n#else\nuniform sampler2D directionalLightShadowMaps[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform mat4 directionalLightMatrices[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform float directionalLightShadowMapSizes[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\n#endif\n#ifdef POINT_LIGHT_SHADOWMAP_COUNT\nuniform samplerCube pointLightShadowMaps[POINT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\nuniform bool shadowEnabled : true;\n#ifdef PCF_KERNEL_SIZE\nuniform vec2 pcfKernel[PCF_KERNEL_SIZE];\n#endif\n@import clay.plugin.shadow_map_common\n#if defined(SPOT_LIGHT_SHADOWMAP_COUNT)\nvoid computeShadowOfSpotLights(vec3 position, inout float shadowContribs[SPOT_LIGHT_COUNT] ) {\n float shadowContrib;\n for(int _idx_ = 0; _idx_ < SPOT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n shadowContrib = computeShadowContrib(\n spotLightShadowMaps[_idx_], spotLightMatrices[_idx_], position,\n spotLightShadowMapSizes[_idx_]\n );\n shadowContribs[_idx_] = shadowContrib;\n }}\n for(int _idx_ = SPOT_LIGHT_SHADOWMAP_COUNT; _idx_ < SPOT_LIGHT_COUNT; _idx_++){{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n#ifdef SHADOW_CASCADE\nvoid computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){\n float depth = (2.0 * gl_FragCoord.z - gl_DepthRange.near - gl_DepthRange.far)\n / (gl_DepthRange.far - gl_DepthRange.near);\n float shadowContrib;\n shadowContribs[0] = 1.0;\n for (int _idx_ = 0; _idx_ < SHADOW_CASCADE; _idx_++) {{\n if (\n depth >= shadowCascadeClipsNear[_idx_] &&\n depth <= shadowCascadeClipsFar[_idx_]\n ) {\n shadowContrib = computeShadowContrib(\n directionalLightShadowMaps[0], directionalLightMatrices[_idx_], position,\n directionalLightShadowMapSizes[0],\n vec2(1.0 / float(SHADOW_CASCADE), 1.0),\n vec2(float(_idx_) / float(SHADOW_CASCADE), 0.0)\n );\n shadowContribs[0] = shadowContrib;\n }\n }}\n for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#else\nvoid computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){\n float shadowContrib;\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n shadowContrib = computeShadowContrib(\n directionalLightShadowMaps[_idx_], directionalLightMatrices[_idx_], position,\n directionalLightShadowMapSizes[_idx_]\n );\n shadowContribs[_idx_] = shadowContrib;\n }}\n for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#endif\n#if defined(POINT_LIGHT_SHADOWMAP_COUNT)\nvoid computeShadowOfPointLights(vec3 position, inout float shadowContribs[POINT_LIGHT_COUNT] ){\n vec3 lightPosition;\n vec3 direction;\n for(int _idx_ = 0; _idx_ < POINT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n lightPosition = pointLightPosition[_idx_];\n direction = position - lightPosition;\n shadowContribs[_idx_] = computeShadowContribOmni(pointLightShadowMaps[_idx_], direction, pointLightRange[_idx_]);\n }}\n for(int _idx_ = POINT_LIGHT_SHADOWMAP_COUNT; _idx_ < POINT_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#endif\n@end");var PG,EG,OG,NG,RG,kG,zG,BG=vE.extend((function(){return{softShadow:BG.PCF,shadowBlur:1,lightFrustumBias:"auto",kernelPCF:new Float32Array([1,0,1,1,-1,1,0,1,-1,0,-1,-1,1,-1,0,-1]),precision:"highp",_lastRenderNotCastShadow:!1,_frameBuffer:new Sz,_textures:{},_shadowMapNumber:{POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},_depthMaterials:{},_distanceMaterials:{},_receivers:[],_lightsCastShadow:[],_lightCameras:{},_lightMaterials:{},_texturePool:new LG}}),(function(){this._gaussianPassH=new aB({fragment:LN.source("clay.compositor.gaussian_blur")}),this._gaussianPassV=new aB({fragment:LN.source("clay.compositor.gaussian_blur")}),this._gaussianPassH.setUniform("blurSize",this.shadowBlur),this._gaussianPassH.setUniform("blurDir",0),this._gaussianPassV.setUniform("blurSize",this.shadowBlur),this._gaussianPassV.setUniform("blurDir",1),this._outputDepthPass=new aB({fragment:LN.source("clay.sm.debug_depth")})}),{render:function(t,e,n,i){n||(n=e.getMainCamera()),this.trigger("beforerender",this,t,e,n),this._renderShadowPass(t,e,n,i),this.trigger("afterrender",this,t,e,n)},renderDebug:function(t,e){t.saveClear();var n=t.viewport,i=0,r=e||n.width/4,o=r;for(var a in this.softShadow===BG.VSM?this._outputDepthPass.material.define("fragment","USE_VSM"):this._outputDepthPass.material.undefine("fragment","USE_VSM"),this._textures){var s=this._textures[a];t.setViewport(i,0,r*s.width/s.height,o),this._outputDepthPass.setUniform("depthMap",s),this._outputDepthPass.render(t),i+=r*s.width/s.height}t.setViewport(n),t.restoreClear()},_updateReceivers:function(t,e){if(e.receiveShadow?(this._receivers.push(e),e.material.set("shadowEnabled",1),e.material.set("pcfKernel",this.kernelPCF)):e.material.set("shadowEnabled",0),this.softShadow===BG.VSM)e.material.define("fragment","USE_VSM"),e.material.undefine("fragment","PCF_KERNEL_SIZE");else{e.material.undefine("fragment","USE_VSM");var n=this.kernelPCF;n&&n.length?e.material.define("fragment","PCF_KERNEL_SIZE",n.length/2):e.material.undefine("fragment","PCF_KERNEL_SIZE")}},_update:function(t,e){var n=this;e.traverse((function(e){e.isRenderable()&&n._updateReceivers(t,e)}));for(var i=0;i4){console.warn("Support at most 4 cascade");continue}p.shadowCascade>1&&(a=p),this.renderDirectionalLightShadow(t,e,n,p,c,h,u)}else"SPOT_LIGHT"===p.type?this.renderSpotLightShadow(t,e,p,l,s):"POINT_LIGHT"===p.type&&this.renderPointLightShadow(t,e,p,d);this._shadowMapNumber[p.type]++}for(var g in this._shadowMapNumber){var m=this._shadowMapNumber[g],v=g+"_SHADOWMAP_COUNT";for(f=0;f0?_.define("fragment",v,m):_.isDefined("fragment",v)&&_.undefine("fragment",v))}}for(f=0;f0){var x=u.map(S);if(y.directionalLightShadowMaps={value:u,type:"tv"},y.directionalLightMatrices={value:h,type:"m4v"},y.directionalLightShadowMapSizes={value:x,type:"1fv"},a){var w=c.slice(),b=c.slice();w.pop(),b.shift(),w.reverse(),b.reverse(),h.reverse(),y.shadowCascadeClipsNear={value:w,type:"1fv"},y.shadowCascadeClipsFar={value:b,type:"1fv"}}}if(s.length>0){var T=s.map(S);(y=e.shadowUniforms).spotLightShadowMaps={value:s,type:"tv"},y.spotLightMatrices={value:l,type:"m4v"},y.spotLightShadowMapSizes={value:T,type:"1fv"}}d.length>0&&(y.pointLightShadowMaps={value:d,type:"tv"})}function S(t){return t.height}},renderDirectionalLightShadow:(PG=new Hk,EG=new MR,OG=new FR,NG=new MR,RG=new MR,kG=new MR,zG=new MR,function(t,e,n,i,r,o,a){var s=this._getDepthMaterial(i),l={getMaterial:function(t){return t.shadowDepthMaterial||s},isMaterialChanged:IG,getUniform:DG,ifRender:function(t){return t.castShadow},sortCompare:jN.opaqueSortCompare};if(!e.viewBoundingBoxLastFrame.isFinite()){var u=e.getBoundingBox();e.viewBoundingBoxLastFrame.copy(u).applyTransform(n.viewMatrix)}var h=Math.min(-e.viewBoundingBoxLastFrame.min.z,n.far),c=Math.max(-e.viewBoundingBoxLastFrame.max.z,n.near),d=this._getDirectionalLightCamera(i,e,n),f=kG.array;zG.copy(d.projectionMatrix),IN.invert(RG.array,d.worldTransform.array),IN.multiply(RG.array,RG.array,n.worldTransform.array),IN.multiply(f,zG.array,RG.array);for(var p=[],g=n instanceof dz,m=(n.near+n.far)/(n.near-n.far),v=2*n.near*n.far/(n.near-n.far),_=0;_<=i.shadowCascade;_++){var y=c*Math.pow(h/c,_/i.shadowCascade),x=c+(h-c)*_/i.shadowCascade,w=y*i.cascadeSplitLogFactor+x*(1-i.cascadeSplitLogFactor);p.push(w),r.push(-(-w*m+v)/-w)}var b=this._getTexture(i,i.shadowCascade);a.push(b);var T=t.viewport,S=t.gl;for(this._frameBuffer.attach(b),this._frameBuffer.bind(t),S.clear(S.COLOR_BUFFER_BIT|S.DEPTH_BUFFER_BIT),_=0;_d?s>f?p[r>0?"px":"nx"]=!0:p[a>0?"pz":"nz"]=!0:d>f?p[o>0?"py":"ny"]=!0:p[a>0?"pz":"nz"]=!0}for(n=0;n0)this.outputs[t].keepLastFrame?(this._prevOutputTextures[t]&&this._compositor.releaseTexture(this._prevOutputTextures[t]),this._prevOutputTextures[t]=this._outputTextures[t]):this._compositor.releaseTexture(this._outputTextures[t])}}});var GG=vE.extend((function(){return{nodes:[]}}),{dirty:function(){this._dirty=!0},addNode:function(t){this.nodes.indexOf(t)>=0||(this.nodes.push(t),this._dirty=!0)},removeNode:function(t){"string"==typeof t&&(t=this.getNodeByName(t));var e=this.nodes.indexOf(t);e>=0&&(this.nodes.splice(e,1),this._dirty=!0)},getNodeByName:function(t){for(var e=0;e=n.COLOR_ATTACHMENT0&&h<=n.COLOR_ATTACHMENT0+8&&u.push(h);l.drawBuffersEXT(u)}t.saveClear(),t.clearBit=wE|TE,e=t.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ),t.restoreClear(),i.unbind(t)}else e=t.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ);this.trigger("afterrender",e),this._rendering=!1,this._rendered=!0}});const jG=VG.extend((function(){return{texture:null,outputs:{color:{}}}}),(function(){}),{getOutput:function(t,e){return this.texture},beforeFrame:function(){},afterFrame:function(){}});const ZG=VG.extend((function(){return{name:"",inputs:{},outputs:null,shader:"",inputLinks:{},outputLinks:{},pass:null,_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}}),(function(){var t=new aB({fragment:this.shader});this.pass=t}),{render:function(t,e){this.trigger("beforerender",t),this._rendering=!0;var n=t.gl;for(var i in this.inputLinks){var r=(c=this.inputLinks[i]).node.getOutput(t,c.pin);this.pass.setUniform(i,r)}if(this.outputs){this.pass.outputs={};var o={};for(var a in this.outputs){var s=this.updateParameter(a,t);isNaN(s.width)&&this.updateParameter(a,t);var l=this.outputs[a],u=this._compositor.allocateTexture(s);this._outputTextures[a]=u,"string"==typeof(h=l.attachment||n.COLOR_ATTACHMENT0)&&(h=n[h]),o[h]=u}for(var h in this._compositor.getFrameBuffer().bind(t),o)this._compositor.getFrameBuffer().attach(o[h],h);this.pass.render(t),this._compositor.getFrameBuffer().updateMipmap(t)}else this.pass.outputs=null,this._compositor.getFrameBuffer().unbind(t),this.pass.render(t,e);for(var i in this.inputLinks){var c;(c=this.inputLinks[i]).node.removeReference(c.pin)}this._rendering=!1,this._rendered=!0,this.trigger("afterrender",t)},updateParameter:function(t,e){var n,i,r=this.outputs[t],o=r.parameters,a=r._parametersCopy;if(a||(a=r._parametersCopy={}),o)for(var s in o)"width"!==s&&"height"!==s&&(a[s]=o[s]);return n="function"==typeof o.width?o.width.call(this,e):o.width,i="function"==typeof o.height?o.height.call(this,e):o.height,n=Math.ceil(n),i=Math.ceil(i),a.width===n&&a.height===i||this._outputTextures[t]&&this._outputTextures[t].dispose(e),a.width=n,a.height=i,a},setParameter:function(t,e){this.pass.setUniform(t,e)},getParameter:function(t){return this.pass.getUniform(t)},setParameters:function(t){for(var e in t)this.setParameter(e,t[e])},define:function(t,e){this.pass.material.define("fragment",t,e)},undefine:function(t){this.pass.material.undefine("fragment",t)},removeReference:function(t){(this._outputReferences[t]--,0===this._outputReferences[t])&&(this.outputs[t].keepLastFrame?(this._prevOutputTextures[t]&&this._compositor.releaseTexture(this._prevOutputTextures[t]),this._prevOutputTextures[t]=this._outputTextures[t]):this._compositor.releaseTexture(this._outputTextures[t]))},clear:function(){VG.prototype.clear.call(this),this.pass.material.disableTexturesAll()}}),XG="@export clay.compositor.kernel.gaussian_9\nfloat gaussianKernel[9];\ngaussianKernel[0] = 0.07;\ngaussianKernel[1] = 0.09;\ngaussianKernel[2] = 0.12;\ngaussianKernel[3] = 0.14;\ngaussianKernel[4] = 0.16;\ngaussianKernel[5] = 0.14;\ngaussianKernel[6] = 0.12;\ngaussianKernel[7] = 0.09;\ngaussianKernel[8] = 0.07;\n@end\n@export clay.compositor.kernel.gaussian_13\nfloat gaussianKernel[13];\ngaussianKernel[0] = 0.02;\ngaussianKernel[1] = 0.03;\ngaussianKernel[2] = 0.06;\ngaussianKernel[3] = 0.08;\ngaussianKernel[4] = 0.11;\ngaussianKernel[5] = 0.13;\ngaussianKernel[6] = 0.14;\ngaussianKernel[7] = 0.13;\ngaussianKernel[8] = 0.11;\ngaussianKernel[9] = 0.08;\ngaussianKernel[10] = 0.06;\ngaussianKernel[11] = 0.03;\ngaussianKernel[12] = 0.02;\n@end\n@export clay.compositor.gaussian_blur\n#define SHADER_NAME gaussian_blur\nuniform sampler2D texture;varying vec2 v_Texcoord;\nuniform float blurSize : 2.0;\nuniform vec2 textureSize : [512.0, 512.0];\nuniform float blurDir : 0.0;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main (void)\n{\n @import clay.compositor.kernel.gaussian_9\n vec2 off = blurSize / textureSize;\n off *= vec2(1.0 - blurDir, blurDir);\n vec4 sum = vec4(0.0);\n float weightAll = 0.0;\n for (int i = 0; i < 9; i++) {\n float w = gaussianKernel[i];\n vec4 texel = decodeHDR(clampSample(texture, v_Texcoord + float(i - 4) * off));\n sum += texel * w;\n weightAll += w;\n }\n gl_FragColor = encodeHDR(sum / max(weightAll, 0.01));\n}\n@end\n",qG="\n@export clay.compositor.lut\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform sampler2D lookup;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n float blueColor = tex.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec4 newColor1 = texture2D(lookup, texPos1);\n vec4 newColor2 = texture2D(lookup, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n gl_FragColor = vec4(newColor.rgb, tex.w);\n}\n@end",YG="@export clay.compositor.output\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = tex.rgb;\n#ifdef OUTPUT_ALPHA\n gl_FragColor.a = tex.a;\n#else\n gl_FragColor.a = 1.0;\n#endif\n gl_FragColor = encodeHDR(gl_FragColor);\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end",KG="@export clay.compositor.bright\nuniform sampler2D texture;\nuniform float threshold : 1;\nuniform float scale : 1.0;\nuniform vec2 textureSize: [512, 512];\nvarying vec2 v_Texcoord;\nconst vec3 lumWeight = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvec4 median(vec4 a, vec4 b, vec4 c)\n{\n return a + b + c - min(min(a, b), c) - max(max(a, b), c);\n}\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n#ifdef ANTI_FLICKER\n vec3 d = 1.0 / textureSize.xyx * vec3(1.0, 1.0, 0.0);\n vec4 s1 = decodeHDR(texture2D(texture, v_Texcoord - d.xz));\n vec4 s2 = decodeHDR(texture2D(texture, v_Texcoord + d.xz));\n vec4 s3 = decodeHDR(texture2D(texture, v_Texcoord - d.zy));\n vec4 s4 = decodeHDR(texture2D(texture, v_Texcoord + d.zy));\n texel = median(median(texel, s1, s2), s3, s4);\n#endif\n float lum = dot(texel.rgb , lumWeight);\n vec4 color;\n if (lum > threshold && texel.a > 0.0)\n {\n color = vec4(texel.rgb * scale, texel.a * scale);\n }\n else\n {\n color = vec4(0.0);\n }\n gl_FragColor = encodeHDR(color);\n}\n@end\n",JG="@export clay.compositor.downsample\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nfloat brightness(vec3 c)\n{\n return max(max(c.r, c.g), c.b);\n}\n@import clay.util.clamp_sample\nvoid main()\n{\n vec4 d = vec4(-1.0, -1.0, 1.0, 1.0) / textureSize.xyxy;\n#ifdef ANTI_FLICKER\n vec3 s1 = decodeHDR(clampSample(texture, v_Texcoord + d.xy)).rgb;\n vec3 s2 = decodeHDR(clampSample(texture, v_Texcoord + d.zy)).rgb;\n vec3 s3 = decodeHDR(clampSample(texture, v_Texcoord + d.xw)).rgb;\n vec3 s4 = decodeHDR(clampSample(texture, v_Texcoord + d.zw)).rgb;\n float s1w = 1.0 / (brightness(s1) + 1.0);\n float s2w = 1.0 / (brightness(s2) + 1.0);\n float s3w = 1.0 / (brightness(s3) + 1.0);\n float s4w = 1.0 / (brightness(s4) + 1.0);\n float oneDivideSum = 1.0 / (s1w + s2w + s3w + s4w);\n vec4 color = vec4(\n (s1 * s1w + s2 * s2w + s3 * s3w + s4 * s4w) * oneDivideSum,\n 1.0\n );\n#else\n vec4 color = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n color *= 0.25;\n#endif\n gl_FragColor = encodeHDR(color);\n}\n@end",$G="\n@export clay.compositor.upsample\n#define HIGH_QUALITY\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nuniform float sampleScale: 0.5;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main()\n{\n#ifdef HIGH_QUALITY\n vec4 d = vec4(1.0, 1.0, -1.0, 0.0) / textureSize.xyxy * sampleScale;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord - d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord - d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord - d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord )) * 4.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n gl_FragColor = encodeHDR(s / 16.0);\n#else\n vec4 d = vec4(-1.0, -1.0, +1.0, +1.0) / textureSize.xyxy;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n gl_FragColor = encodeHDR(s / 4.0);\n#endif\n}\n@end",QG="@export clay.compositor.hdr.composite\n#define TONEMAPPING\nuniform sampler2D texture;\n#ifdef BLOOM_ENABLED\nuniform sampler2D bloom;\n#endif\n#ifdef LENSFLARE_ENABLED\nuniform sampler2D lensflare;\nuniform sampler2D lensdirt;\n#endif\n#ifdef LUM_ENABLED\nuniform sampler2D lum;\n#endif\n#ifdef LUT_ENABLED\nuniform sampler2D lut;\n#endif\n#ifdef COLOR_CORRECTION\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float saturation : 1.0;\n#endif\n#ifdef VIGNETTE\nuniform float vignetteDarkness: 1.0;\nuniform float vignetteOffset: 1.0;\n#endif\nuniform float exposure : 1.0;\nuniform float bloomIntensity : 0.25;\nuniform float lensflareIntensity : 1;\nvarying vec2 v_Texcoord;\n@import clay.util.srgb\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\nfloat eyeAdaption(float fLum)\n{\n return mix(0.2, fLum, 0.5);\n}\n#ifdef LUT_ENABLED\nvec3 lutTransform(vec3 color) {\n float blueColor = color.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec4 newColor1 = texture2D(lut, texPos1);\n vec4 newColor2 = texture2D(lut, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n return newColor.rgb;\n}\n#endif\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = vec4(0.0);\n vec4 originalTexel = vec4(0.0);\n#ifdef TEXTURE_ENABLED\n texel = decodeHDR(texture2D(texture, v_Texcoord));\n originalTexel = texel;\n#endif\n#ifdef BLOOM_ENABLED\n vec4 bloomTexel = decodeHDR(texture2D(bloom, v_Texcoord));\n texel.rgb += bloomTexel.rgb * bloomIntensity;\n texel.a += bloomTexel.a * bloomIntensity;\n#endif\n#ifdef LENSFLARE_ENABLED\n texel += decodeHDR(texture2D(lensflare, v_Texcoord)) * texture2D(lensdirt, v_Texcoord) * lensflareIntensity;\n#endif\n texel.a = min(texel.a, 1.0);\n#ifdef LUM_ENABLED\n float fLum = texture2D(lum, vec2(0.5, 0.5)).r;\n float adaptedLumDest = 3.0 / (max(0.1, 1.0 + 10.0*eyeAdaption(fLum)));\n float exposureBias = adaptedLumDest * exposure;\n#else\n float exposureBias = exposure;\n#endif\n#ifdef TONEMAPPING\n texel.rgb *= exposureBias;\n texel.rgb = ACESToneMapping(texel.rgb);\n#endif\n texel = linearTosRGB(texel);\n#ifdef LUT_ENABLED\n texel.rgb = lutTransform(clamp(texel.rgb,vec3(0.0),vec3(1.0)));\n#endif\n#ifdef COLOR_CORRECTION\n texel.rgb = clamp(texel.rgb + vec3(brightness), 0.0, 1.0);\n texel.rgb = clamp((texel.rgb - vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n float lum = dot(texel.rgb, vec3(0.2125, 0.7154, 0.0721));\n texel.rgb = mix(vec3(lum), texel.rgb, saturation);\n#endif\n#ifdef VIGNETTE\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(vignetteOffset);\n texel.rgb = mix(texel.rgb, vec3(1.0 - vignetteDarkness), dot(uv, uv));\n#endif\n gl_FragColor = encodeHDR(texel);\n#ifdef DEBUG\n #if DEBUG == 1\n gl_FragColor = encodeHDR(decodeHDR(texture2D(texture, v_Texcoord)));\n #elif DEBUG == 2\n gl_FragColor = encodeHDR(decodeHDR(texture2D(bloom, v_Texcoord)) * bloomIntensity);\n #elif DEBUG == 3\n gl_FragColor = encodeHDR(decodeHDR(texture2D(lensflare, v_Texcoord) * lensflareIntensity));\n #endif\n#endif\n if (originalTexel.a <= 0.01 && gl_FragColor.a > 1e-5) {\n gl_FragColor.a = dot(gl_FragColor.rgb, vec3(0.2125, 0.7154, 0.0721));\n }\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end",tH="@export clay.compositor.blend\n#define SHADER_NAME blend\n#ifdef TEXTURE1_ENABLED\nuniform sampler2D texture1;\nuniform float weight1 : 1.0;\n#endif\n#ifdef TEXTURE2_ENABLED\nuniform sampler2D texture2;\nuniform float weight2 : 1.0;\n#endif\n#ifdef TEXTURE3_ENABLED\nuniform sampler2D texture3;\nuniform float weight3 : 1.0;\n#endif\n#ifdef TEXTURE4_ENABLED\nuniform sampler2D texture4;\nuniform float weight4 : 1.0;\n#endif\n#ifdef TEXTURE5_ENABLED\nuniform sampler2D texture5;\nuniform float weight5 : 1.0;\n#endif\n#ifdef TEXTURE6_ENABLED\nuniform sampler2D texture6;\nuniform float weight6 : 1.0;\n#endif\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = vec4(0.0);\n#ifdef TEXTURE1_ENABLED\n tex += decodeHDR(texture2D(texture1, v_Texcoord)) * weight1;\n#endif\n#ifdef TEXTURE2_ENABLED\n tex += decodeHDR(texture2D(texture2, v_Texcoord)) * weight2;\n#endif\n#ifdef TEXTURE3_ENABLED\n tex += decodeHDR(texture2D(texture3, v_Texcoord)) * weight3;\n#endif\n#ifdef TEXTURE4_ENABLED\n tex += decodeHDR(texture2D(texture4, v_Texcoord)) * weight4;\n#endif\n#ifdef TEXTURE5_ENABLED\n tex += decodeHDR(texture2D(texture5, v_Texcoord)) * weight5;\n#endif\n#ifdef TEXTURE6_ENABLED\n tex += decodeHDR(texture2D(texture6, v_Texcoord)) * weight6;\n#endif\n gl_FragColor = encodeHDR(tex);\n}\n@end",eH="@export clay.compositor.fxaa\nuniform sampler2D texture;\nuniform vec4 viewport : VIEWPORT;\nvarying vec2 v_Texcoord;\n#define FXAA_REDUCE_MIN (1.0/128.0)\n#define FXAA_REDUCE_MUL (1.0/8.0)\n#define FXAA_SPAN_MAX 8.0\n@import clay.util.rgbm\nvoid main()\n{\n vec2 resolution = 1.0 / viewport.zw;\n vec3 rgbNW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbNE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ) ).xyz;\n vec4 rgbaM = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution ) );\n vec3 rgbM = rgbaM.xyz;\n float opacity = rgbaM.w;\n vec3 luma = vec3( 0.299, 0.587, 0.114 );\n float lumaNW = dot( rgbNW, luma );\n float lumaNE = dot( rgbNE, luma );\n float lumaSW = dot( rgbSW, luma );\n float lumaSE = dot( rgbSE, luma );\n float lumaM = dot( rgbM, luma );\n float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );\n float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );\n vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );\n float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );\n dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * resolution;\n vec3 rgbA = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA *= 0.5;\n vec3 rgbB = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * -0.5 ) ).xyz;\n rgbB += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * 0.5 ) ).xyz;\n rgbB *= 0.25;\n rgbB += rgbA * 0.5;\n float lumaB = dot( rgbB, luma );\n if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) )\n {\n gl_FragColor = vec4( rgbA, opacity );\n }\n else {\n gl_FragColor = vec4( rgbB, opacity );\n }\n}\n@end";!function(t){t.import("@export clay.compositor.coloradjust\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float exposure : 0.0;\nuniform float gamma : 1.0;\nuniform float saturation : 1.0;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = clamp(tex.rgb + vec3(brightness), 0.0, 1.0);\n color = clamp( (color-vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n color = clamp( color * pow(2.0, exposure), 0.0, 1.0);\n color = clamp( pow(color, vec3(gamma)), 0.0, 1.0);\n float luminance = dot( color, w );\n color = mix(vec3(luminance), color, saturation);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.brightness\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float brightness : 0.0;\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = tex.rgb + vec3(brightness);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.contrast\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float contrast : 1.0;\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = (tex.rgb-vec3(0.5))*contrast+vec3(0.5);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.exposure\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float exposure : 0.0;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = tex.rgb * pow(2.0, exposure);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.gamma\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float gamma : 1.0;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = pow(tex.rgb, vec3(gamma));\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.saturation\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float saturation : 1.0;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = tex.rgb;\n float luminance = dot(color, w);\n color = mix(vec3(luminance), color, saturation);\n gl_FragColor = vec4(color, tex.a);\n}\n@end"),t.import(XG),t.import("@export clay.compositor.hdr.log_lum\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n float luminance = dot(tex.rgb, w);\n luminance = log(luminance + 0.001);\n gl_FragColor = encodeHDR(vec4(vec3(luminance), 1.0));\n}\n@end\n@export clay.compositor.hdr.lum_adaption\nvarying vec2 v_Texcoord;\nuniform sampler2D adaptedLum;\nuniform sampler2D currentLum;\nuniform float frameTime : 0.02;\n@import clay.util.rgbm\nvoid main()\n{\n float fAdaptedLum = decodeHDR(texture2D(adaptedLum, vec2(0.5, 0.5))).r;\n float fCurrentLum = exp(encodeHDR(texture2D(currentLum, vec2(0.5, 0.5))).r);\n fAdaptedLum += (fCurrentLum - fAdaptedLum) * (1.0 - pow(0.98, 30.0 * frameTime));\n gl_FragColor = encodeHDR(vec4(vec3(fAdaptedLum), 1.0));\n}\n@end\n@export clay.compositor.lum\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord );\n float luminance = dot(tex.rgb, w);\n gl_FragColor = vec4(vec3(luminance), 1.0);\n}\n@end"),t.import(qG),t.import("@export clay.compositor.vignette\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float darkness: 1;\nuniform float offset: 1;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = texel.rgb;\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(offset);\n gl_FragColor = encodeHDR(vec4(mix(texel.rgb, vec3(1.0 - darkness), dot(uv, uv)), texel.a));\n}\n@end"),t.import(YG),t.import(KG),t.import(JG),t.import($G),t.import(QG),t.import("@export clay.compositor.lensflare\n#define SAMPLE_NUMBER 8\nuniform sampler2D texture;\nuniform sampler2D lenscolor;\nuniform vec2 textureSize : [512, 512];\nuniform float dispersal : 0.3;\nuniform float haloWidth : 0.4;\nuniform float distortion : 1.0;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvec4 textureDistorted(\n in vec2 texcoord,\n in vec2 direction,\n in vec3 distortion\n) {\n return vec4(\n decodeHDR(texture2D(texture, texcoord + direction * distortion.r)).r,\n decodeHDR(texture2D(texture, texcoord + direction * distortion.g)).g,\n decodeHDR(texture2D(texture, texcoord + direction * distortion.b)).b,\n 1.0\n );\n}\nvoid main()\n{\n vec2 texcoord = -v_Texcoord + vec2(1.0); vec2 textureOffset = 1.0 / textureSize;\n vec2 ghostVec = (vec2(0.5) - texcoord) * dispersal;\n vec2 haloVec = normalize(ghostVec) * haloWidth;\n vec3 distortion = vec3(-textureOffset.x * distortion, 0.0, textureOffset.x * distortion);\n vec4 result = vec4(0.0);\n for (int i = 0; i < SAMPLE_NUMBER; i++)\n {\n vec2 offset = fract(texcoord + ghostVec * float(i));\n float weight = length(vec2(0.5) - offset) / length(vec2(0.5));\n weight = pow(1.0 - weight, 10.0);\n result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;\n }\n result *= texture2D(lenscolor, vec2(length(vec2(0.5) - texcoord)) / length(vec2(0.5)));\n float weight = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));\n weight = pow(1.0 - weight, 10.0);\n vec2 offset = fract(texcoord + haloVec);\n result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;\n gl_FragColor = result;\n}\n@end"),t.import(tH),t.import(eH)}(LN);var nH=/^#source\((.*?)\)/;function iH(t,e,n){var i,r,o,a,s=t.type||"filter";if("filter"===s){var l=t.shader.trim(),u=nH.exec(l);if(u?i=LN.source(u[1].trim()):"#"===l.charAt(0)&&(i=e.shaders[l.substr(1)]),i||(i=l),!i)return}if(t.inputs)for(var h in r={},t.inputs)"string"==typeof t.inputs[h]?r[h]=t.inputs[h]:r[h]={node:t.inputs[h].node,pin:t.inputs[h].pin};if(t.outputs)for(var h in o={},t.outputs){var c=t.outputs[h];o[h]={},null!=c.attachment&&(o[h].attachment=c.attachment),null!=c.keepLastFrame&&(o[h].keepLastFrame=c.keepLastFrame),null!=c.outputLastFrame&&(o[h].outputLastFrame=c.outputLastFrame),c.parameters&&(o[h].parameters=aH(c.parameters))}if(a="scene"===s?new WG({name:t.name,scene:n.scene,camera:n.camera,outputs:o}):"texture"===s?new jG({name:t.name,outputs:o}):new ZG({name:t.name,shader:i,inputs:r,outputs:o})){if(t.parameters)for(var h in t.parameters){"string"==typeof(d=t.parameters[h])?"#"===(d=d.trim()).charAt(0)?d=e.textures[d.substr(1)]:a.on("beforerender",sH(h,lH(d))):"function"==typeof d&&a.on("beforerender",d),a.setParameter(h,d)}if(t.defines&&a.pass)for(var h in t.defines){var d=t.defines[h];a.pass.material.define("fragment",h,d)}}return a}function rH(t,e){return t}function oH(t,e){return e}function aH(t){var e={};if(!t)return e;["type","minFilter","magFilter","wrapS","wrapT","flipY","useMipmap"].forEach((function(n){var i=t[n];null!=i&&("string"==typeof i&&(i=QR[i]),e[n]=i)}));var n=t.scale||1;return["width","height"].forEach((function(i){if(null!=t[i]){var r=t[i];"string"==typeof r?(r=r.trim(),e[i]=function(t,e,n){return n=n||1,function(t){var i=t.getDevicePixelRatio(),r=t.getWidth()*n,o=t.getHeight()*n;return e(r,o,i)}}(0,lH(r),n)):e[i]=r}})),e.width||(e.width=rH),e.height||(e.height=oH),null!=t.useMipmap&&(e.useMipmap=t.useMipmap),e}function sH(t,e){return function(n){var i=n.getDevicePixelRatio(),r=n.getWidth(),o=n.getHeight(),a=e(r,o,i);this.setParameter(t,a)}}function lH(t){var e=/^expr\((.*)\)$/.exec(t);if(e)try{var n=new Function("width","height","dpr","return "+e[1]);return n(1,1),n}catch(t){throw new Error("Invalid expression.")}}const uH=function(t,e){var n=new UG;e=e||{};var i={textures:{},parameters:{}};for(var r in t.parameters){var o=t.parameters[r];i.parameters[r]=aH(o)}return function(t,e,n,i){if(!t.textures)return void i({});var r={},o=0,a=!1,s=n.textureRootPath;gE.each(t.textures,(function(t,e){var n,l=t.path,u=aH(t.parameters);if(Array.isArray(l)&&6===l.length)s&&(l=l.map((function(t){return gE.relative2absolute(t,s)}))),n=new hz(u);else{if("string"!=typeof l)return;s&&(l=gE.relative2absolute(l,s)),n=new sk(u)}n.load(l),o++,n.once("success",(function(){r[e]=n,0===--o&&(i(r),a=!0)}))})),0!==o||a||i(r)}(t,0,e,(function(r){i.textures=r,function(){for(var r=0;r0;)n+=i*(r%e),r=Math.floor(r/e),i/=e;return n};function cH(t){for(var e=new Uint8Array(t*t*4),n=0,i=new QN,r=0;r 0.99999) {\n gl_FragColor = vec4(1.0);\n return;\n }\n mat3 kernelBasis;\n#endif\n\n float z = depthTexel.r * 2.0 - 1.0;\n\n vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * projectedPos;\n\n vec3 position = p4.xyz / p4.w;\n\n float ao = ssaoEstimator(position, kernelBasis);\n ao = clamp(1.0 - (1.0 - ao) * intensity, 0.0, 1.0);\n gl_FragColor = vec4(vec3(ao), 1.0);\n}\n\n@end\n\n\n@export ecgl.ssao.blur\n#define SHADER_NAME SSAO_BLUR\n\nuniform sampler2D ssaoTexture;\n\n#ifdef NORMALTEX_ENABLED\nuniform sampler2D normalTex;\n#endif\n\nvarying vec2 v_Texcoord;\n\nuniform vec2 textureSize;\nuniform float blurSize : 1.0;\n\nuniform int direction: 0.0;\n\n#ifdef DEPTHTEX_ENABLED\nuniform sampler2D depthTex;\nuniform mat4 projection;\nuniform float depthRange : 0.5;\n\nfloat getLinearDepth(vec2 coord)\n{\n float depth = texture2D(depthTex, coord).r * 2.0 - 1.0;\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n}\n#endif\n\nvoid main()\n{\n float kernel[5];\n kernel[0] = 0.122581;\n kernel[1] = 0.233062;\n kernel[2] = 0.288713;\n kernel[3] = 0.233062;\n kernel[4] = 0.122581;\n\n vec2 off = vec2(0.0);\n if (direction == 0) {\n off[0] = blurSize / textureSize.x;\n }\n else {\n off[1] = blurSize / textureSize.y;\n }\n\n vec2 coord = v_Texcoord;\n\n float sum = 0.0;\n float weightAll = 0.0;\n\n#ifdef NORMALTEX_ENABLED\n vec3 centerNormal = texture2D(normalTex, v_Texcoord).rgb * 2.0 - 1.0;\n#endif\n#if defined(DEPTHTEX_ENABLED)\n float centerDepth = getLinearDepth(v_Texcoord);\n#endif\n\n for (int i = 0; i < 5; i++) {\n vec2 coord = clamp(v_Texcoord + vec2(float(i) - 2.0) * off, vec2(0.0), vec2(1.0));\n\n float w = kernel[i];\n#ifdef NORMALTEX_ENABLED\n vec3 normal = texture2D(normalTex, coord).rgb * 2.0 - 1.0;\n w *= clamp(dot(normal, centerNormal), 0.0, 1.0);\n#endif\n#ifdef DEPTHTEX_ENABLED\n float d = getLinearDepth(coord);\n w *= (1.0 - smoothstep(abs(centerDepth - d) / depthRange, 0.0, 1.0));\n#endif\n\n weightAll += w;\n sum += texture2D(ssaoTexture, coord).r * w;\n }\n\n gl_FragColor = vec4(vec3(sum / weightAll), 1.0);\n}\n\n@end\n"),pH.prototype.setDepthTexture=function(t){this._depthTex=t},pH.prototype.setNormalTexture=function(t){this._normalTex=t,this._ssaoPass.material[t?"enableTexture":"disableTexture"]("normalTex"),this.setKernelSize(this._kernelSize)},pH.prototype.update=function(t,e,n){var i=t.getWidth(),r=t.getHeight(),o=this._ssaoPass,a=this._blurPass;o.setUniform("kernel",this._kernels[n%this._kernels.length]),o.setUniform("depthTex",this._depthTex),null!=this._normalTex&&o.setUniform("normalTex",this._normalTex),o.setUniform("depthTexSize",[this._depthTex.width,this._depthTex.height]);var s=new MR;MR.transpose(s,e.worldTransform),o.setUniform("projection",e.projectionMatrix.array),o.setUniform("projectionInv",e.invProjectionMatrix.array),o.setUniform("viewInverseTranspose",s.array);var l=this._ssaoTexture,u=this._blurTexture,h=this._blurTexture2;l.width=i/2,l.height=r/2,u.width=i,u.height=r,h.width=i,h.height=r,this._framebuffer.attach(l),this._framebuffer.bind(t),t.gl.clearColor(1,1,1,1),t.gl.clear(t.gl.COLOR_BUFFER_BIT),o.render(t),a.setUniform("textureSize",[i/2,r/2]),a.setUniform("projection",e.projectionMatrix.array),this._framebuffer.attach(u),a.setUniform("direction",0),a.setUniform("ssaoTexture",l),a.render(t),this._framebuffer.attach(h),a.setUniform("textureSize",[i,r]),a.setUniform("direction",1),a.setUniform("ssaoTexture",u),a.render(t),this._framebuffer.unbind(t);var c=t.clearColor;t.gl.clearColor(c[0],c[1],c[2],c[3])},pH.prototype.getTargetTexture=function(){return this._blurTexture2},pH.prototype.setParameter=function(t,e){"noiseTexSize"===t?this.setNoiseSize(e):"kernelSize"===t?this.setKernelSize(e):"intensity"===t?this._ssaoPass.material.set("intensity",e):this._ssaoPass.setUniform(t,e)},pH.prototype.setKernelSize=function(t){this._kernelSize=t,this._ssaoPass.material.define("fragment","KERNEL_SIZE",t),this._kernels=this._kernels||[];for(var e=0;e<30;e++)this._kernels[e]=fH(t,e*t,!!this._normalTex)},pH.prototype.setNoiseSize=function(t){var e=this._ssaoPass.getUniform("noiseTex");e?(e.data=cH(t),e.width=e.height=t,e.dirty()):(e=dH(t),this._ssaoPass.setUniform("noiseTex",dH(t))),this._ssaoPass.setUniform("noiseTexSize",[t,t])},pH.prototype.dispose=function(t){this._blurTexture.dispose(t),this._ssaoTexture.dispose(t),this._blurTexture2.dispose(t)};const gH=pH;function mH(t){t=t||{},this._ssrPass=new aB({fragment:LN.source("ecgl.ssr.main"),clearColor:[0,0,0,0]}),this._blurPass1=new aB({fragment:LN.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blurPass2=new aB({fragment:LN.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blendPass=new aB({fragment:LN.source("clay.compositor.blend")}),this._blendPass.material.disableTexturesAll(),this._blendPass.material.enableTexture(["texture1","texture2"]),this._ssrPass.setUniform("gBufferTexture1",t.normalTexture),this._ssrPass.setUniform("gBufferTexture2",t.depthTexture),this._blurPass1.setUniform("gBufferTexture1",t.normalTexture),this._blurPass1.setUniform("gBufferTexture2",t.depthTexture),this._blurPass2.setUniform("gBufferTexture1",t.normalTexture),this._blurPass2.setUniform("gBufferTexture2",t.depthTexture),this._blurPass2.material.define("fragment","VERTICAL"),this._blurPass2.material.define("fragment","BLEND"),this._ssrTexture=new sk({type:QR.HALF_FLOAT}),this._texture2=new sk({type:QR.HALF_FLOAT}),this._texture3=new sk({type:QR.HALF_FLOAT}),this._prevTexture=new sk({type:QR.HALF_FLOAT}),this._currentTexture=new sk({type:QR.HALF_FLOAT}),this._frameBuffer=new Sz({depthBuffer:!1}),this._normalDistribution=null,this._totalSamples=256,this._samplePerFrame=4,this._ssrPass.material.define("fragment","SAMPLE_PER_FRAME",this._samplePerFrame),this._ssrPass.material.define("fragment","TOTAL_SAMPLES",this._totalSamples),this._downScale=1}LN.import("@export ecgl.ssr.main\n\n#define SHADER_NAME SSR\n#define MAX_ITERATION 20;\n#define SAMPLE_PER_FRAME 5;\n#define TOTAL_SAMPLES 128;\n\nuniform sampler2D sourceTexture;\nuniform sampler2D gBufferTexture1;\nuniform sampler2D gBufferTexture2;\nuniform sampler2D gBufferTexture3;\nuniform samplerCube specularCubemap;\nuniform float specularIntensity: 1;\n\nuniform mat4 projection;\nuniform mat4 projectionInv;\nuniform mat4 toViewSpace;\nuniform mat4 toWorldSpace;\n\nuniform float maxRayDistance: 200;\n\nuniform float pixelStride: 16;\nuniform float pixelStrideZCutoff: 50; \nuniform float screenEdgeFadeStart: 0.9; \nuniform float eyeFadeStart : 0.2; uniform float eyeFadeEnd: 0.8; \nuniform float minGlossiness: 0.2; uniform float zThicknessThreshold: 1;\n\nuniform float nearZ;\nuniform vec2 viewportSize : VIEWPORT_SIZE;\n\nuniform float jitterOffset: 0;\n\nvarying vec2 v_Texcoord;\n\n#ifdef DEPTH_DECODE\n@import clay.util.decode_float\n#endif\n\n#ifdef PHYSICALLY_CORRECT\nuniform sampler2D normalDistribution;\nuniform float sampleOffset: 0;\nuniform vec2 normalDistributionSize;\n\nvec3 transformNormal(vec3 H, vec3 N) {\n vec3 upVector = N.y > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nvec3 importanceSampleNormalGGX(float i, float roughness, vec3 N) {\n float p = fract((i + sampleOffset) / float(TOTAL_SAMPLES));\n vec3 H = texture2D(normalDistribution,vec2(roughness, p)).rgb;\n return transformNormal(H, N);\n}\nfloat G_Smith(float g, float ndv, float ndl) {\n float roughness = 1.0 - g;\n float k = roughness * roughness / 2.0;\n float G1V = ndv / (ndv * (1.0 - k) + k);\n float G1L = ndl / (ndl * (1.0 - k) + k);\n return G1L * G1V;\n}\nvec3 F_Schlick(float ndv, vec3 spec) {\n return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);\n}\n#endif\n\nfloat fetchDepth(sampler2D depthTexture, vec2 uv)\n{\n vec4 depthTexel = texture2D(depthTexture, uv);\n return depthTexel.r * 2.0 - 1.0;\n}\n\nfloat linearDepth(float depth)\n{\n if (projection[3][3] == 0.0) {\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n }\n else {\n return (depth - projection[3][2]) / projection[2][2];\n }\n}\n\nbool rayIntersectDepth(float rayZNear, float rayZFar, vec2 hitPixel)\n{\n if (rayZFar > rayZNear)\n {\n float t = rayZFar; rayZFar = rayZNear; rayZNear = t;\n }\n float cameraZ = linearDepth(fetchDepth(gBufferTexture2, hitPixel));\n return rayZFar <= cameraZ && rayZNear >= cameraZ - zThicknessThreshold;\n}\n\n\nbool traceScreenSpaceRay(\n vec3 rayOrigin, vec3 rayDir, float jitter,\n out vec2 hitPixel, out vec3 hitPoint, out float iterationCount\n)\n{\n float rayLength = ((rayOrigin.z + rayDir.z * maxRayDistance) > -nearZ)\n ? (-nearZ - rayOrigin.z) / rayDir.z : maxRayDistance;\n\n vec3 rayEnd = rayOrigin + rayDir * rayLength;\n\n vec4 H0 = projection * vec4(rayOrigin, 1.0);\n vec4 H1 = projection * vec4(rayEnd, 1.0);\n\n float k0 = 1.0 / H0.w, k1 = 1.0 / H1.w;\n\n vec3 Q0 = rayOrigin * k0, Q1 = rayEnd * k1;\n\n vec2 P0 = (H0.xy * k0 * 0.5 + 0.5) * viewportSize;\n vec2 P1 = (H1.xy * k1 * 0.5 + 0.5) * viewportSize;\n\n P1 += dot(P1 - P0, P1 - P0) < 0.0001 ? 0.01 : 0.0;\n vec2 delta = P1 - P0;\n\n bool permute = false;\n if (abs(delta.x) < abs(delta.y)) {\n permute = true;\n delta = delta.yx;\n P0 = P0.yx;\n P1 = P1.yx;\n }\n float stepDir = sign(delta.x);\n float invdx = stepDir / delta.x;\n\n vec3 dQ = (Q1 - Q0) * invdx;\n float dk = (k1 - k0) * invdx;\n\n vec2 dP = vec2(stepDir, delta.y * invdx);\n\n float strideScaler = 1.0 - min(1.0, -rayOrigin.z / pixelStrideZCutoff);\n float pixStride = 1.0 + strideScaler * pixelStride;\n\n dP *= pixStride; dQ *= pixStride; dk *= pixStride;\n\n vec4 pqk = vec4(P0, Q0.z, k0);\n vec4 dPQK = vec4(dP, dQ.z, dk);\n\n pqk += dPQK * jitter;\n float rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);\n float rayZNear;\n\n bool intersect = false;\n\n vec2 texelSize = 1.0 / viewportSize;\n\n iterationCount = 0.0;\n\n for (int i = 0; i < MAX_ITERATION; i++)\n {\n pqk += dPQK;\n\n rayZNear = rayZFar;\n rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);\n\n hitPixel = permute ? pqk.yx : pqk.xy;\n hitPixel *= texelSize;\n\n intersect = rayIntersectDepth(rayZNear, rayZFar, hitPixel);\n\n iterationCount += 1.0;\n\n dPQK *= 1.2;\n\n if (intersect) {\n break;\n }\n }\n\n Q0.xy += dQ.xy * iterationCount;\n Q0.z = pqk.z;\n hitPoint = Q0 / pqk.w;\n\n return intersect;\n}\n\nfloat calculateAlpha(\n float iterationCount, float reflectivity,\n vec2 hitPixel, vec3 hitPoint, float dist, vec3 rayDir\n)\n{\n float alpha = clamp(reflectivity, 0.0, 1.0);\n alpha *= 1.0 - (iterationCount / float(MAX_ITERATION));\n vec2 hitPixelNDC = hitPixel * 2.0 - 1.0;\n float maxDimension = min(1.0, max(abs(hitPixelNDC.x), abs(hitPixelNDC.y)));\n alpha *= 1.0 - max(0.0, maxDimension - screenEdgeFadeStart) / (1.0 - screenEdgeFadeStart);\n\n float _eyeFadeStart = eyeFadeStart;\n float _eyeFadeEnd = eyeFadeEnd;\n if (_eyeFadeStart > _eyeFadeEnd) {\n float tmp = _eyeFadeEnd;\n _eyeFadeEnd = _eyeFadeStart;\n _eyeFadeStart = tmp;\n }\n\n float eyeDir = clamp(rayDir.z, _eyeFadeStart, _eyeFadeEnd);\n alpha *= 1.0 - (eyeDir - _eyeFadeStart) / (_eyeFadeEnd - _eyeFadeStart);\n\n alpha *= 1.0 - clamp(dist / maxRayDistance, 0.0, 1.0);\n\n return alpha;\n}\n\n@import clay.util.rand\n\n@import clay.util.rgbm\n\nvoid main()\n{\n vec4 normalAndGloss = texture2D(gBufferTexture1, v_Texcoord);\n\n if (dot(normalAndGloss.rgb, vec3(1.0)) == 0.0) {\n discard;\n }\n\n float g = normalAndGloss.a;\n#if !defined(PHYSICALLY_CORRECT)\n if (g <= minGlossiness) {\n discard;\n }\n#endif\n\n float reflectivity = (g - minGlossiness) / (1.0 - minGlossiness);\n\n vec3 N = normalize(normalAndGloss.rgb * 2.0 - 1.0);\n N = normalize((toViewSpace * vec4(N, 0.0)).xyz);\n\n vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, fetchDepth(gBufferTexture2, v_Texcoord), 1.0);\n vec4 pos = projectionInv * projectedPos;\n vec3 rayOrigin = pos.xyz / pos.w;\n vec3 V = -normalize(rayOrigin);\n\n float ndv = clamp(dot(N, V), 0.0, 1.0);\n float iterationCount;\n float jitter = rand(fract(v_Texcoord + jitterOffset));\n\n#ifdef PHYSICALLY_CORRECT\n vec4 color = vec4(vec3(0.0), 1.0);\n vec4 albedoMetalness = texture2D(gBufferTexture3, v_Texcoord);\n vec3 albedo = albedoMetalness.rgb;\n float m = albedoMetalness.a;\n vec3 diffuseColor = albedo * (1.0 - m);\n vec3 spec = mix(vec3(0.04), albedo, m);\n\n float jitter2 = rand(fract(v_Texcoord)) * float(TOTAL_SAMPLES);\n\n for (int i = 0; i < SAMPLE_PER_FRAME; i++) {\n vec3 H = importanceSampleNormalGGX(float(i) + jitter2, 1.0 - g, N);\n vec3 rayDir = normalize(reflect(-V, H));\n#else\n vec3 rayDir = normalize(reflect(-V, N));\n#endif\n vec2 hitPixel;\n vec3 hitPoint;\n\n bool intersect = traceScreenSpaceRay(rayOrigin, rayDir, jitter, hitPixel, hitPoint, iterationCount);\n\n float dist = distance(rayOrigin, hitPoint);\n\n vec3 hitNormal = texture2D(gBufferTexture1, hitPixel).rgb * 2.0 - 1.0;\n hitNormal = normalize((toViewSpace * vec4(hitNormal, 0.0)).xyz);\n#ifdef PHYSICALLY_CORRECT\n float ndl = clamp(dot(N, rayDir), 0.0, 1.0);\n float vdh = clamp(dot(V, H), 0.0, 1.0);\n float ndh = clamp(dot(N, H), 0.0, 1.0);\n vec3 litTexel = vec3(0.0);\n if (dot(hitNormal, rayDir) < 0.0 && intersect) {\n litTexel = texture2D(sourceTexture, hitPixel).rgb;\n litTexel *= pow(clamp(1.0 - dist / 200.0, 0.0, 1.0), 3.0);\n\n }\n else {\n #ifdef SPECULARCUBEMAP_ENABLED\n vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;\n litTexel = RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, 0.0), 8.12).rgb * specularIntensity;\n#endif\n }\n color.rgb += ndl * litTexel * (\n F_Schlick(ndl, spec) * G_Smith(g, ndv, ndl) * vdh / (ndh * ndv + 0.001)\n );\n }\n color.rgb /= float(SAMPLE_PER_FRAME);\n#else\n #if !defined(SPECULARCUBEMAP_ENABLED)\n if (dot(hitNormal, rayDir) >= 0.0) {\n discard;\n }\n if (!intersect) {\n discard;\n }\n#endif\n float alpha = clamp(calculateAlpha(iterationCount, reflectivity, hitPixel, hitPoint, dist, rayDir), 0.0, 1.0);\n vec4 color = texture2D(sourceTexture, hitPixel);\n color.rgb *= alpha;\n\n#ifdef SPECULARCUBEMAP_ENABLED\n vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;\n alpha = alpha * (intersect ? 1.0 : 0.0);\n float bias = (1.0 -g) * 5.0;\n color.rgb += (1.0 - alpha)\n * RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, bias), 8.12).rgb\n * specularIntensity;\n#endif\n\n#endif\n\n gl_FragColor = encodeHDR(color);\n}\n@end\n\n@export ecgl.ssr.blur\n\nuniform sampler2D texture;\nuniform sampler2D gBufferTexture1;\nuniform sampler2D gBufferTexture2;\nuniform mat4 projection;\nuniform float depthRange : 0.05;\n\nvarying vec2 v_Texcoord;\n\nuniform vec2 textureSize;\nuniform float blurSize : 1.0;\n\n#ifdef BLEND\n #ifdef SSAOTEX_ENABLED\nuniform sampler2D ssaoTex;\n #endif\nuniform sampler2D sourceTexture;\n#endif\n\nfloat getLinearDepth(vec2 coord)\n{\n float depth = texture2D(gBufferTexture2, coord).r * 2.0 - 1.0;\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n}\n\n@import clay.util.rgbm\n\n\nvoid main()\n{\n @import clay.compositor.kernel.gaussian_9\n\n vec4 centerNTexel = texture2D(gBufferTexture1, v_Texcoord);\n float g = centerNTexel.a;\n float maxBlurSize = clamp(1.0 - g, 0.0, 1.0) * blurSize;\n#ifdef VERTICAL\n vec2 off = vec2(0.0, maxBlurSize / textureSize.y);\n#else\n vec2 off = vec2(maxBlurSize / textureSize.x, 0.0);\n#endif\n\n vec2 coord = v_Texcoord;\n\n vec4 sum = vec4(0.0);\n float weightAll = 0.0;\n\n vec3 cN = centerNTexel.rgb * 2.0 - 1.0;\n float cD = getLinearDepth(v_Texcoord);\n for (int i = 0; i < 9; i++) {\n vec2 coord = clamp((float(i) - 4.0) * off + v_Texcoord, vec2(0.0), vec2(1.0));\n float w = gaussianKernel[i]\n * clamp(dot(cN, texture2D(gBufferTexture1, coord).rgb * 2.0 - 1.0), 0.0, 1.0);\n float d = getLinearDepth(coord);\n w *= (1.0 - smoothstep(abs(cD - d) / depthRange, 0.0, 1.0));\n\n weightAll += w;\n sum += decodeHDR(texture2D(texture, coord)) * w;\n }\n\n#ifdef BLEND\n float aoFactor = 1.0;\n #ifdef SSAOTEX_ENABLED\n aoFactor = texture2D(ssaoTex, v_Texcoord).r;\n #endif\n gl_FragColor = encodeHDR(\n sum / weightAll * aoFactor + decodeHDR(texture2D(sourceTexture, v_Texcoord))\n );\n#else\n gl_FragColor = encodeHDR(sum / weightAll);\n#endif\n}\n\n@end"),mH.prototype.setAmbientCubemap=function(t,e){this._ssrPass.material.set("specularCubemap",t),this._ssrPass.material.set("specularIntensity",e);var n=t&&e;this._ssrPass.material[n?"enableTexture":"disableTexture"]("specularCubemap")},mH.prototype.update=function(t,e,n,i){var r=t.getWidth(),o=t.getHeight(),a=this._ssrTexture,s=this._texture2,l=this._texture3;a.width=this._prevTexture.width=this._currentTexture.width=r/this._downScale,a.height=this._prevTexture.height=this._currentTexture.height=o/this._downScale,s.width=l.width=r,s.height=l.height=o;var u=this._frameBuffer,h=this._ssrPass,c=this._blurPass1,d=this._blurPass2,f=this._blendPass,p=new MR,g=new MR;MR.transpose(p,e.worldTransform),MR.transpose(g,e.viewMatrix),h.setUniform("sourceTexture",n),h.setUniform("projection",e.projectionMatrix.array),h.setUniform("projectionInv",e.invProjectionMatrix.array),h.setUniform("toViewSpace",p.array),h.setUniform("toWorldSpace",g.array),h.setUniform("nearZ",e.near);var m=i/this._totalSamples*this._samplePerFrame;if(h.setUniform("jitterOffset",m),h.setUniform("sampleOffset",i*this._samplePerFrame),c.setUniform("textureSize",[a.width,a.height]),d.setUniform("textureSize",[r,o]),d.setUniform("sourceTexture",n),c.setUniform("projection",e.projectionMatrix.array),d.setUniform("projection",e.projectionMatrix.array),u.attach(a),u.bind(t),h.render(t),this._physicallyCorrect&&(u.attach(this._currentTexture),f.setUniform("texture1",this._prevTexture),f.setUniform("texture2",a),f.material.set({weight1:i>=1?.95:0,weight2:i>=1?.05:1}),f.render(t)),u.attach(s),c.setUniform("texture",this._physicallyCorrect?this._currentTexture:a),c.render(t),u.attach(l),d.setUniform("texture",s),d.render(t),u.unbind(t),this._physicallyCorrect){var v=this._prevTexture;this._prevTexture=this._currentTexture,this._currentTexture=v}},mH.prototype.getTargetTexture=function(){return this._texture3},mH.prototype.setParameter=function(t,e){"maxIteration"===t?this._ssrPass.material.define("fragment","MAX_ITERATION",e):this._ssrPass.setUniform(t,e)},mH.prototype.setPhysicallyCorrect=function(t){t?(this._normalDistribution||(this._normalDistribution=uB.generateNormalDistribution(64,this._totalSamples)),this._ssrPass.material.define("fragment","PHYSICALLY_CORRECT"),this._ssrPass.material.set("normalDistribution",this._normalDistribution),this._ssrPass.material.set("normalDistributionSize",[64,this._totalSamples])):this._ssrPass.material.undefine("fragment","PHYSICALLY_CORRECT"),this._physicallyCorrect=t},mH.prototype.setSSAOTexture=function(t){var e=this._blurPass2;t?(e.material.enableTexture("ssaoTex"),e.material.set("ssaoTex",t)):e.material.disableTexture("ssaoTex")},mH.prototype.isFinished=function(t){return!this._physicallyCorrect||t>this._totalSamples/this._samplePerFrame},mH.prototype.dispose=function(t){this._ssrTexture.dispose(t),this._texture2.dispose(t),this._texture3.dispose(t),this._prevTexture.dispose(t),this._currentTexture.dispose(t),this._frameBuffer.dispose(t)};const vH=mH,_H=[0,0,-.321585265978,-.154972575841,.458126042375,.188473391593,.842080129861,.527766490688,.147304551086,-.659453822776,-.331943915203,-.940619700594,.0479226680259,.54812163202,.701581552186,-.709825561388,-.295436780218,.940589268233,-.901489676764,.237713156085,.973570876096,-.109899459384,-.866792314779,-.451805525005,.330975007087,.800048655954,-.344275183665,.381779221166,-.386139432542,-.437418421534,-.576478634965,-.0148463392551,.385798197415,-.262426961053,-.666302061145,.682427250835,-.628010632582,-.732836215494,.10163141741,-.987658134403,.711995289051,-.320024291314,.0296005138058,.950296523438,.0130612307608,-.351024443122,-.879596633704,-.10478487883,.435712737232,.504254490347,.779203817497,.206477676721,.388264289969,-.896736162545,-.153106280781,-.629203242522,-.245517550697,.657969239148,.126830499058,.26862328493,-.634888119007,-.302301223431,.617074219636,.779817204925];function yH(t,e,n,i,r){var o=t.gl;e.setUniform(o,"1i",n,r),o.activeTexture(o.TEXTURE0+r),i.isRenderable()?i.bind(t):i.unbind(t)}function xH(t,e,n,i,r){var o,a,s,l,u=t.gl;return function(r,h,c){if(!l||l.material!==r.material){var d=r.material,f=r.__program,p=d.get("roughness");null==p&&(p=1);var g=d.get("normalMap")||e,m=d.get("roughnessMap"),v=d.get("bumpMap"),_=d.get("uvRepeat"),y=d.get("uvOffset"),x=d.get("detailUvRepeat"),w=d.get("detailUvOffset"),b=!!v&&d.isTextureEnabled("bumpMap"),T=!!m&&d.isTextureEnabled("roughnessMap"),S=d.isDefined("fragment","DOUBLE_SIDED");v=v||n,m=m||i,c!==h?(h.set("normalMap",g),h.set("bumpMap",v),h.set("roughnessMap",m),h.set("useBumpMap",b),h.set("useRoughnessMap",T),h.set("doubleSide",S),null!=_&&h.set("uvRepeat",_),null!=y&&h.set("uvOffset",y),null!=x&&h.set("detailUvRepeat",x),null!=w&&h.set("detailUvOffset",w),h.set("roughness",p)):(f.setUniform(u,"1f","roughness",p),o!==g&&yH(t,f,"normalMap",g,0),a!==v&&v&&yH(t,f,"bumpMap",v,1),s!==m&&m&&yH(t,f,"roughnessMap",m,2),null!=_&&f.setUniform(u,"2f","uvRepeat",_),null!=y&&f.setUniform(u,"2f","uvOffset",y),null!=x&&f.setUniform(u,"2f","detailUvRepeat",x),null!=w&&f.setUniform(u,"2f","detailUvOffset",w),f.setUniform(u,"1i","useBumpMap",+b),f.setUniform(u,"1i","useRoughnessMap",+T),f.setUniform(u,"1i","doubleSide",+S)),o=g,a=v,s=m,l=r}}}function wH(t){t=t||{},this._depthTex=new sk({format:QR.DEPTH_COMPONENT,type:QR.UNSIGNED_INT}),this._normalTex=new sk({type:QR.HALF_FLOAT}),this._framebuffer=new Sz,this._framebuffer.attach(this._normalTex),this._framebuffer.attach(this._depthTex,Sz.DEPTH_ATTACHMENT),this._normalMaterial=new HO({shader:new LN(LN.source("ecgl.normal.vertex"),LN.source("ecgl.normal.fragment"))}),this._normalMaterial.enableTexture(["normalMap","bumpMap","roughnessMap"]),this._defaultNormalMap=Kz.createBlank("#000"),this._defaultBumpMap=Kz.createBlank("#000"),this._defaultRoughessMap=Kz.createBlank("#000"),this._debugPass=new aB({fragment:LN.source("clay.compositor.output")}),this._debugPass.setUniform("texture",this._normalTex),this._debugPass.material.undefine("fragment","OUTPUT_ALPHA")}LN.import("@export ecgl.normal.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\n@import ecgl.common.normalMap.vertexHeader\n\n@import ecgl.common.vertexAnimation.header\n\nvoid main()\n{\n\n @import ecgl.common.vertexAnimation.main\n\n @import ecgl.common.uv.main\n\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n @import ecgl.common.normalMap.vertexMain\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n}\n\n\n@end\n\n\n@export ecgl.normal.fragment\n\n#define ROUGHNESS_CHANEL 0\n\nuniform bool useBumpMap;\nuniform bool useRoughnessMap;\nuniform bool doubleSide;\nuniform float roughness;\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n@import ecgl.common.normalMap.fragmentHeader\n@import ecgl.common.bumpMap.header\n\nuniform sampler2D roughnessMap;\n\nvoid main()\n{\n vec3 N = v_Normal;\n \n bool flipNormal = false;\n if (doubleSide) {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n flipNormal = true;\n }\n }\n\n @import ecgl.common.normalMap.fragmentMain\n\n if (useBumpMap) {\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n }\n\n float g = 1.0 - roughness;\n\n if (useRoughnessMap) {\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n }\n\n if (flipNormal) {\n N = -N;\n }\n\n gl_FragColor.rgb = (N.xyz + 1.0) * 0.5;\n gl_FragColor.a = g;\n}\n@end"),wH.prototype.getDepthTexture=function(){return this._depthTex},wH.prototype.getNormalTexture=function(){return this._normalTex},wH.prototype.update=function(t,e,n){var i=t.getWidth(),r=t.getHeight(),o=this._depthTex,a=this._normalTex,s=this._normalMaterial;o.width=i,o.height=r,a.width=i,a.height=r;var l=e.getRenderList(n).opaque;this._framebuffer.bind(t),t.gl.clearColor(0,0,0,0),t.gl.clear(t.gl.COLOR_BUFFER_BIT|t.gl.DEPTH_BUFFER_BIT),t.gl.disable(t.gl.BLEND),t.renderPass(l,n,{getMaterial:function(){return s},ifRender:function(t){return t.renderNormal},beforeRender:xH(t,this._defaultNormalMap,this._defaultBumpMap,this._defaultRoughessMap,this._normalMaterial),sort:t.opaqueSortCompare}),this._framebuffer.unbind(t)},wH.prototype.renderDebug=function(t){this._debugPass.render(t)},wH.prototype.dispose=function(t){this._depthTex.dispose(t),this._normalTex.dispose(t)};const bH=wH;function TH(t){t=t||{},this._edgePass=new aB({fragment:LN.source("ecgl.edge")}),this._edgePass.setUniform("normalTexture",t.normalTexture),this._edgePass.setUniform("depthTexture",t.depthTexture),this._targetTexture=new sk({type:QR.HALF_FLOAT}),this._frameBuffer=new Sz,this._frameBuffer.attach(this._targetTexture)}TH.prototype.update=function(t,e,n,i){var r=t.getWidth(),o=t.getHeight(),a=this._targetTexture;a.width=r,a.height=o;var s=this._frameBuffer;s.bind(t),this._edgePass.setUniform("projectionInv",e.invProjectionMatrix.array),this._edgePass.setUniform("textureSize",[r,o]),this._edgePass.setUniform("texture",n),this._edgePass.render(t),s.unbind(t)},TH.prototype.getTargetTexture=function(){return this._targetTexture},TH.prototype.setParameter=function(t,e){this._edgePass.setUniform(t,e)},TH.prototype.dispose=function(t){this._targetTexture.dispose(t),this._frameBuffer.dispose(t)};const SH=TH,MH={type:"compositor",nodes:[{name:"source",type:"texture",outputs:{color:{}}},{name:"source_half",shader:"#source(clay.compositor.downsample)",inputs:{texture:"source"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bright",shader:"#source(clay.compositor.bright)",inputs:{texture:"source_half"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{threshold:2,scale:4,textureSize:"expr([width * 1.0 / 2, height / 2])"}},{name:"bright_downsample_4",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 2, height / 2] )"}},{name:"bright_downsample_8",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 4, height / 4] )"}},{name:"bright_downsample_16",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 8, height / 8] )"}},{name:"bright_downsample_32",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 32)",height:"expr(height * 1.0 / 32)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 16, height / 16] )"}},{name:"bright_upsample_16_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_32"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 32, height / 32] )"}},{name:"bright_upsample_16_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_16_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_8_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_8_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_8_blur_v",texture2:"bright_upsample_16_blur_v"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_4_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_4_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_4_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_4_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_4_blur_v",texture2:"bright_upsample_8_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_2_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_2_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_2_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_2_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_2_blur_v",texture2:"bright_upsample_4_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_full_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_full_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_full_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bloom_composite",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_full_blur_v",texture2:"bright_upsample_2_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"coc",shader:"#source(ecgl.dof.coc)",outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{focalDist:50,focalRange:30}},{name:"dof_far_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"dof_near_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_NEARFIELD:null}},{name:"dof_coc_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"coc"},outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_COC:null}},{name:"dof_composite",shader:"#source(ecgl.dof.composite)",inputs:{original:"source",blurred:"dof_far_blur",nearfield:"dof_near_blur",coc:"coc",nearcoc:"dof_coc_blur"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}}},{name:"composite",shader:"#source(clay.compositor.hdr.composite)",inputs:{texture:"source",bloom:"bloom_composite"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},defines:{}},{name:"FXAA",shader:"#source(clay.compositor.fxaa)",inputs:{texture:"composite"}}]};function CH(t,e){return{color:{parameters:{width:t,height:e}}}}LN.import(XG),LN.import(qG),LN.import(YG),LN.import(KG),LN.import(JG),LN.import($G),LN.import(QG),LN.import(tH),LN.import(eH),LN.import("@export ecgl.dof.coc\n\nuniform sampler2D depth;\n\nuniform float zNear: 0.1;\nuniform float zFar: 2000;\n\nuniform float focalDistance: 3;\nuniform float focalRange: 1;\nuniform float focalLength: 30;\nuniform float fstop: 2.8;\n\nvarying vec2 v_Texcoord;\n\n@import clay.util.encode_float\n\nvoid main()\n{\n float z = texture2D(depth, v_Texcoord).r * 2.0 - 1.0;\n\n float dist = 2.0 * zNear * zFar / (zFar + zNear - z * (zFar - zNear));\n\n float aperture = focalLength / fstop;\n\n float coc;\n\n float uppper = focalDistance + focalRange;\n float lower = focalDistance - focalRange;\n if (dist <= uppper && dist >= lower) {\n coc = 0.5;\n }\n else {\n float focalAdjusted = dist > uppper ? uppper : lower;\n\n coc = abs(aperture * (focalLength * (dist - focalAdjusted)) / (dist * (focalAdjusted - focalLength)));\n coc = clamp(coc, 0.0, 2.0) / 2.00001;\n\n if (dist < lower) {\n coc = -coc;\n }\n coc = coc * 0.5 + 0.5;\n }\n\n gl_FragColor = encodeFloat(coc);\n}\n@end\n\n\n@export ecgl.dof.composite\n\n#define DEBUG 0\n\nuniform sampler2D original;\nuniform sampler2D blurred;\nuniform sampler2D nearfield;\nuniform sampler2D coc;\nuniform sampler2D nearcoc;\nvarying vec2 v_Texcoord;\n\n@import clay.util.rgbm\n@import clay.util.float\n\nvoid main()\n{\n vec4 blurredColor = texture2D(blurred, v_Texcoord);\n vec4 originalColor = texture2D(original, v_Texcoord);\n\n float fCoc = decodeFloat(texture2D(coc, v_Texcoord));\n\n fCoc = abs(fCoc * 2.0 - 1.0);\n\n float weight = smoothstep(0.0, 1.0, fCoc);\n \n#ifdef NEARFIELD_ENABLED\n vec4 nearfieldColor = texture2D(nearfield, v_Texcoord);\n float fNearCoc = decodeFloat(texture2D(nearcoc, v_Texcoord));\n fNearCoc = abs(fNearCoc * 2.0 - 1.0);\n\n gl_FragColor = encodeHDR(\n mix(\n nearfieldColor, mix(originalColor, blurredColor, weight),\n pow(1.0 - fNearCoc, 4.0)\n )\n );\n#else\n gl_FragColor = encodeHDR(mix(originalColor, blurredColor, weight));\n#endif\n\n}\n\n@end\n\n\n\n@export ecgl.dof.diskBlur\n\n#define POISSON_KERNEL_SIZE 16;\n\nuniform sampler2D texture;\nuniform sampler2D coc;\nvarying vec2 v_Texcoord;\n\nuniform float blurRadius : 10.0;\nuniform vec2 textureSize : [512.0, 512.0];\n\nuniform vec2 poissonKernel[POISSON_KERNEL_SIZE];\n\nuniform float percent;\n\nfloat nrand(const in vec2 n) {\n return fract(sin(dot(n.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\n@import clay.util.rgbm\n@import clay.util.float\n\n\nvoid main()\n{\n vec2 offset = blurRadius / textureSize;\n\n float rnd = 6.28318 * nrand(v_Texcoord + 0.07 * percent );\n float cosa = cos(rnd);\n float sina = sin(rnd);\n vec4 basis = vec4(cosa, -sina, sina, cosa);\n\n#if !defined(BLUR_NEARFIELD) && !defined(BLUR_COC)\n offset *= abs(decodeFloat(texture2D(coc, v_Texcoord)) * 2.0 - 1.0);\n#endif\n\n#ifdef BLUR_COC\n float cocSum = 0.0;\n#else\n vec4 color = vec4(0.0);\n#endif\n\n\n float weightSum = 0.0;\n\n for (int i = 0; i < POISSON_KERNEL_SIZE; i++) {\n vec2 ofs = poissonKernel[i];\n\n ofs = vec2(dot(ofs, basis.xy), dot(ofs, basis.zw));\n\n vec2 uv = v_Texcoord + ofs * offset;\n vec4 texel = texture2D(texture, uv);\n\n float w = 1.0;\n#ifdef BLUR_COC\n float fCoc = decodeFloat(texel) * 2.0 - 1.0;\n cocSum += clamp(fCoc, -1.0, 0.0) * w;\n#else\n texel = texel;\n #if !defined(BLUR_NEARFIELD)\n float fCoc = decodeFloat(texture2D(coc, uv)) * 2.0 - 1.0;\n w *= abs(fCoc);\n #endif\n texel.rgb *= texel.a;\n color += texel * w;\n#endif\n\n weightSum += w;\n }\n\n#ifdef BLUR_COC\n gl_FragColor = encodeFloat(clamp(cocSum / weightSum, -1.0, 0.0) * 0.5 + 0.5);\n#else\n color /= weightSum;\n color.rgb /= (color.a + 0.0001);\n gl_FragColor = color;\n#endif\n}\n\n@end"),LN.import("@export ecgl.edge\n\nuniform sampler2D texture;\n\nuniform sampler2D normalTexture;\nuniform sampler2D depthTexture;\n\nuniform mat4 projectionInv;\n\nuniform vec2 textureSize;\n\nuniform vec4 edgeColor: [0,0,0,0.8];\n\nvarying vec2 v_Texcoord;\n\nvec3 packColor(vec2 coord) {\n float z = texture2D(depthTexture, coord).r * 2.0 - 1.0;\n vec4 p = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * p;\n\n return vec3(\n texture2D(normalTexture, coord).rg,\n -p4.z / p4.w / 5.0\n );\n}\n\nvoid main() {\n vec2 cc = v_Texcoord;\n vec3 center = packColor(cc);\n\n float size = clamp(1.0 - (center.z - 10.0) / 100.0, 0.0, 1.0) * 0.5;\n float dx = size / textureSize.x;\n float dy = size / textureSize.y;\n\n vec2 coord;\n vec3 topLeft = packColor(cc+vec2(-dx, -dy));\n vec3 top = packColor(cc+vec2(0.0, -dy));\n vec3 topRight = packColor(cc+vec2(dx, -dy));\n vec3 left = packColor(cc+vec2(-dx, 0.0));\n vec3 right = packColor(cc+vec2(dx, 0.0));\n vec3 bottomLeft = packColor(cc+vec2(-dx, dy));\n vec3 bottom = packColor(cc+vec2(0.0, dy));\n vec3 bottomRight = packColor(cc+vec2(dx, dy));\n\n vec3 v = -topLeft-2.0*top-topRight+bottomLeft+2.0*bottom+bottomRight;\n vec3 h = -bottomLeft-2.0*left-topLeft+bottomRight+2.0*right+topRight;\n\n float edge = sqrt(dot(h, h) + dot(v, v));\n\n edge = smoothstep(0.8, 1.0, edge);\n\n gl_FragColor = mix(texture2D(texture, v_Texcoord), vec4(edgeColor.rgb, 1.0), edgeColor.a * edge);\n}\n@end");var LH=["composite","FXAA"];function AH(){this._width,this._height,this._dpr,this._sourceTexture=new sk({type:QR.HALF_FLOAT}),this._depthTexture=new sk({format:QR.DEPTH_COMPONENT,type:QR.UNSIGNED_INT}),this._framebuffer=new Sz,this._framebuffer.attach(this._sourceTexture),this._framebuffer.attach(this._depthTexture,Sz.DEPTH_ATTACHMENT),this._normalPass=new bH,this._compositor=uH(MH);var t=this._compositor.getNodeByName("source");t.texture=this._sourceTexture;var e=this._compositor.getNodeByName("coc");this._sourceNode=t,this._cocNode=e,this._compositeNode=this._compositor.getNodeByName("composite"),this._fxaaNode=this._compositor.getNodeByName("FXAA"),this._dofBlurNodes=["dof_far_blur","dof_near_blur","dof_coc_blur"].map((function(t){return this._compositor.getNodeByName(t)}),this),this._dofBlurKernel=0,this._dofBlurKernelSize=new Float32Array(0),this._finalNodesChain=LH.map((function(t){return this._compositor.getNodeByName(t)}),this);var n={normalTexture:this._normalPass.getNormalTexture(),depthTexture:this._normalPass.getDepthTexture()};this._ssaoPass=new gH(n),this._ssrPass=new vH(n),this._edgePass=new SH(n)}AH.prototype.resize=function(t,e,n){t*=n=n||1,e*=n;var i=this._sourceTexture,r=this._depthTexture;i.width=t,i.height=e,r.width=t,r.height=e;var o={getWidth:function(){return t},getHeight:function(){return e},getDevicePixelRatio:function(){return n}};function a(t,e){if("function"==typeof t[e]){var n=t[e].__original||t[e];t[e]=function(t){return n.call(this,o)},t[e].__original=n}}this._compositor.nodes.forEach((function(t){for(var e in t.outputs){var n=t.outputs[e].parameters;n&&(a(n,"width"),a(n,"height"))}for(var i in t.parameters)a(t.parameters,i)})),this._width=t,this._height=e,this._dpr=n},AH.prototype.getWidth=function(){return this._width},AH.prototype.getHeight=function(){return this._height},AH.prototype._ifRenderNormalPass=function(){return this._enableSSAO||this._enableEdge||this._enableSSR},AH.prototype._getPrevNode=function(t){for(var e=LH.indexOf(t.name)-1,n=this._finalNodesChain[e];n&&!this._compositor.getNodeByName(n.name);)e-=1,n=this._finalNodesChain[e];return n},AH.prototype._getNextNode=function(t){for(var e=LH.indexOf(t.name)+1,n=this._finalNodesChain[e];n&&!this._compositor.getNodeByName(n.name);)e+=1,n=this._finalNodesChain[e];return n},AH.prototype._addChainNode=function(t){var e=this._getPrevNode(t),n=this._getNextNode(t);e&&(t.inputs.texture=e.name,n?(t.outputs=CH(this.getWidth.bind(this),this.getHeight.bind(this)),n.inputs.texture=t.name):t.outputs=null,this._compositor.addNode(t))},AH.prototype._removeChainNode=function(t){var e=this._getPrevNode(t),n=this._getNextNode(t);e&&(n?(e.outputs=CH(this.getWidth.bind(this),this.getHeight.bind(this)),n.inputs.texture=e.name):e.outputs=null,this._compositor.removeNode(t))},AH.prototype.updateNormal=function(t,e,n,i){this._ifRenderNormalPass()&&this._normalPass.update(t,e,n)},AH.prototype.updateSSAO=function(t,e,n,i){this._ssaoPass.update(t,n,i)},AH.prototype.enableSSAO=function(){this._enableSSAO=!0},AH.prototype.disableSSAO=function(){this._enableSSAO=!1},AH.prototype.enableSSR=function(){this._enableSSR=!0},AH.prototype.disableSSR=function(){this._enableSSR=!1},AH.prototype.getSSAOTexture=function(){return this._ssaoPass.getTargetTexture()},AH.prototype.getSourceFrameBuffer=function(){return this._framebuffer},AH.prototype.getSourceTexture=function(){return this._sourceTexture},AH.prototype.disableFXAA=function(){this._removeChainNode(this._fxaaNode)},AH.prototype.enableFXAA=function(){this._addChainNode(this._fxaaNode)},AH.prototype.enableBloom=function(){this._compositeNode.inputs.bloom="bloom_composite",this._compositor.dirty()},AH.prototype.disableBloom=function(){this._compositeNode.inputs.bloom=null,this._compositor.dirty()},AH.prototype.enableDOF=function(){this._compositeNode.inputs.texture="dof_composite",this._compositor.dirty()},AH.prototype.disableDOF=function(){this._compositeNode.inputs.texture="source",this._compositor.dirty()},AH.prototype.enableColorCorrection=function(){this._compositeNode.define("COLOR_CORRECTION"),this._enableColorCorrection=!0},AH.prototype.disableColorCorrection=function(){this._compositeNode.undefine("COLOR_CORRECTION"),this._enableColorCorrection=!1},AH.prototype.enableEdge=function(){this._enableEdge=!0},AH.prototype.disableEdge=function(){this._enableEdge=!1},AH.prototype.setBloomIntensity=function(t){this._compositeNode.setParameter("bloomIntensity",t)},AH.prototype.setSSAOParameter=function(t,e){switch(t){case"quality":var n={low:6,medium:12,high:32,ultra:62}[e]||12;this._ssaoPass.setParameter("kernelSize",n);break;case"radius":this._ssaoPass.setParameter(t,e),this._ssaoPass.setParameter("bias",e/200);break;case"intensity":this._ssaoPass.setParameter(t,e)}},AH.prototype.setDOFParameter=function(t,e){switch(t){case"focalDistance":case"focalRange":case"fstop":this._cocNode.setParameter(t,e);break;case"blurRadius":for(var n=0;n=this._haltonSequence.length},render:function(t,e,n){var i=this._blendPass;0===this._frame?(i.setUniform("weight1",0),i.setUniform("weight2",1)):(i.setUniform("weight1",.9),i.setUniform("weight2",.1)),i.setUniform("texture1",this._prevFrameTex),i.setUniform("texture2",e||this._sourceTex),this._blendFb.attach(this._outputTex),this._blendFb.bind(t),i.render(t),this._blendFb.unbind(t),n||(this._outputPass.setUniform("texture",this._outputTex),this._outputPass.render(t));var r=this._prevFrameTex;this._prevFrameTex=this._outputTex,this._outputTex=r,this._frame++},dispose:function(t){this._sourceFb.dispose(t),this._blendFb.dispose(t),this._prevFrameTex.dispose(t),this._outputTex.dispose(t),this._sourceTex.dispose(t),this._outputPass.dispose(t),this._blendPass.dispose(t)}};const PH=IH;function EH(t){t=t||"perspective",this.layer=null,this.scene=new ez,this.rootNode=this.scene,this.viewport={x:0,y:0,width:0,height:0},this.setProjection(t),this._compositor=new DH,this._temporalSS=new PH,this._shadowMapPass=new FG;for(var e=[],n=0,i=0;i<30;i++){for(var r=[],o=0;o<6;o++)r.push(4*hH(n,2)-2),r.push(4*hH(n,3)-2),n++;e.push(r)}this._pcfKernels=e,this.scene.on("beforerender",(function(t,e,n){this.needsTemporalSS()&&this._temporalSS.jitterProjection(t,n)}),this)}EH.prototype.setProjection=function(t){var e=this.camera;e&&e.update(),"perspective"===t?this.camera instanceof dz||(this.camera=new dz,e&&this.camera.setLocalTransform(e.localTransform)):this.camera instanceof nB||(this.camera=new nB,e&&this.camera.setLocalTransform(e.localTransform)),this.camera.near=.1,this.camera.far=2e3},EH.prototype.setViewport=function(t,e,n,i,r){this.camera instanceof dz&&(this.camera.aspect=n/i),r=r||1,this.viewport.x=t,this.viewport.y=e,this.viewport.width=n,this.viewport.height=i,this.viewport.devicePixelRatio=r,this._compositor.resize(n*r,i*r),this._temporalSS.resize(n*r,i*r)},EH.prototype.containPoint=function(t,e){var n=this.viewport;return e=this.layer.renderer.getHeight()-e,t>=n.x&&e>=n.y&&t<=n.x+n.width&&e<=n.y+n.height};var OH=new JO;EH.prototype.castRay=function(t,e,n){var i=this.layer.renderer,r=i.viewport;return i.viewport=this.viewport,i.screenToNDC(t,e,OH),this.camera.castRay(OH,n),i.viewport=r,n},EH.prototype.prepareRender=function(){this.scene.update(),this.camera.update(),this.scene.updateLights();var t=this.scene.updateRenderList(this.camera);this._needsSortProgressively=!1;for(var e=0;e30},EH.prototype._doRender=function(t,e,n){var i=this.scene,r=this.camera;n=n||0,this._updateTransparent(t,i,r,n),e||(this._shadowMapPass.kernelPCF=this._pcfKernels[0],this._shadowMapPass.render(t,i,r,!0)),this._updateShadowPCFKernel(n);var o,a=t.clearColor;(t.gl.clearColor(a[0],a[1],a[2],a[3]),this._enablePostEffect&&(this.needsTemporalSS()&&this._temporalSS.jitterProjection(t,r),this._compositor.updateNormal(t,i,r,this._temporalSS.getFrame())),this._updateSSAO(t,i,r,this._temporalSS.getFrame()),this._enablePostEffect)?((o=this._compositor.getSourceFrameBuffer()).bind(t),t.gl.clear(t.gl.DEPTH_BUFFER_BIT|t.gl.COLOR_BUFFER_BIT),t.render(i,r,!0,!0),o.unbind(t),this.needsTemporalSS()&&e?(this._compositor.composite(t,i,r,this._temporalSS.getSourceFrameBuffer(),this._temporalSS.getFrame()),t.setViewport(this.viewport),this._temporalSS.render(t)):(t.setViewport(this.viewport),this._compositor.composite(t,i,r,null,0))):this.needsTemporalSS()&&e?((o=this._temporalSS.getSourceFrameBuffer()).bind(t),t.saveClear(),t.clearBit=t.gl.DEPTH_BUFFER_BIT|t.gl.COLOR_BUFFER_BIT,t.render(i,r,!0,!0),t.restoreClear(),o.unbind(t),t.setViewport(this.viewport),this._temporalSS.render(t)):(t.setViewport(this.viewport),t.render(i,r,!0,!0))},EH.prototype._updateTransparent=function(t,e,n,i){for(var r=new QN,o=new MR,a=n.getWorldPosition(),s=e.getRenderList(n).transparent,l=0;lthis.camera.far||t80*n){i=o=t[0],r=a=t[1];for(var p=n;po&&(o=s),l>a&&(a=l);u=Math.max(o-i,a-r)}return nU(d,f,n,i,r,u),f}function tU(t,e,n,i,r){var o,a;if(r===wU(t,e,n,i)>0)for(o=e;o=e;o-=i)a=_U(o,t[o],t[o+1],a);return a&&pU(a,a.next)&&(yU(a),a=a.next),a}function eU(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=!1,i.steiner||!pU(i,i.next)&&0!==fU(i.prev,i,i.next))i=i.next;else{if(yU(i),(i=e=i.prev)===i.next)return null;n=!0}}while(n||i!==e);return e}function nU(t,e,n,i,r,o,a){if(t){!a&&o&&function(t,e,n,i){var r=t;do{null===r.z&&(r.z=uU(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,n,i,r,o,a,s,l,u=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,i=n,s=0,e=0;e0||l>0&&i;)0!==s&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}o.nextZ=null,u*=2}while(a>1)}(r)}(t,i,r,o);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,o?rU(t,i,r,o):iU(t))e.push(s.i/n),e.push(t.i/n),e.push(l.i/n),yU(t),t=l.next,u=l.next;else if((t=l)===u){a?1===a?nU(t=oU(t,e,n),e,n,i,r,o,2):2===a&&aU(t,e,n,i,r,o):nU(eU(t),e,n,i,r,o,1);break}}}function iU(t){var e=t.prev,n=t,i=t.next;if(fU(e,n,i)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(cU(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&fU(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function rU(t,e,n,i){var r=t.prev,o=t,a=t.next;if(fU(r,o,a)>=0)return!1;for(var s=r.xo.x?r.x>a.x?r.x:a.x:o.x>a.x?o.x:a.x,h=r.y>o.y?r.y>a.y?r.y:a.y:o.y>a.y?o.y:a.y,c=uU(s,l,e,n,i),d=uU(u,h,e,n,i),f=t.nextZ;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&cU(r.x,r.y,o.x,o.y,a.x,a.y,f.x,f.y)&&fU(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=c;){if(f!==t.prev&&f!==t.next&&cU(r.x,r.y,o.x,o.y,a.x,a.y,f.x,f.y)&&fU(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}function oU(t,e,n){var i=t;do{var r=i.prev,o=i.next.next;!pU(r,o)&&gU(r,i,i.next,o)&&mU(r,o)&&mU(o,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(o.i/n),yU(i),yU(i.next),i=t=o),i=i.next}while(i!==t);return i}function aU(t,e,n,i,r,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&dU(a,s)){var l=vU(a,s);return a=eU(a,a.next),l=eU(l,l.next),nU(a,e,n,i,r,o),void nU(l,e,n,i,r,o)}s=s.next}a=a.next}while(a!==t)}function sU(t,e){return t.x-e.x}function lU(t,e){if(e=function(t,e){var n,i=e,r=t.x,o=t.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>a){if(a=s,s===r){if(o===i.y)return i;if(o===i.next.y)return i.next}n=i.x=i.x&&i.x>=h&&r!==i.x&&cU(on.x)&&mU(i,t)&&(n=i,d=l),i=i.next;return n}(t,e),e){var n=vU(e,t);eU(n,n.next)}}function uU(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)/r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)/r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function hU(t){var e=t,n=t;do{e.x=0&&(t-a)*(i-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(r-a)*(i-s)>=0}function dU(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&gU(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&mU(t,e)&&mU(e,t)&&function(t,e){var n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)}function fU(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function pU(t,e){return t.x===e.x&&t.y===e.y}function gU(t,e,n,i){return!!(pU(t,e)&&pU(n,i)||pU(t,i)&&pU(n,e))||fU(t,e,n)>0!=fU(t,e,i)>0&&fU(n,i,t)>0!=fU(n,i,e)>0}function mU(t,e){return fU(t.prev,t,t.next)<0?fU(t,e,t.next)>=0&&fU(t,t.prev,e)>=0:fU(t,e,t.prev)<0||fU(t,t.next,e)<0}function vU(t,e){var n=new xU(t.i,t.x,t.y),i=new xU(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function _U(t,e,n,i){var r=new xU(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function yU(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function xU(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function wU(t,e,n,i){for(var r=0,o=e,a=n-i;ol&&s.push({pivot:Math.floor((u+l)/2),left:l,right:u});var u;l=o[a].pivot+1;(u=o[a].right)>l&&s.push({pivot:Math.floor((u+l)/2),left:l,right:u})}o=this._parts=s}else for(a=0;a=2e4},doSortTriangles:function(t,e){var n=this.indices;if(0===e){var i=this.attributes.position;t=t.array;this._triangleZList&&this._triangleZList.length===this.triangleCount||(this._triangleZList=new Float32Array(this.triangleCount),this._sortedTriangleIndices=new Uint32Array(this.triangleCount),this._indicesTmp=new n.constructor(n.length),this._triangleZListTmp=new Float32Array(this.triangleCount));for(var r,o=0,a=0;a0,n={},i=0;i65535?new Uint32Array(3*a):new Uint16Array(3*a),d.material.shader!==e&&d.material.attachShader(e,!0),_V.setMaterialFromModel(e.__shading,d.material,t,n),s>0&&(this._linesMesh.geometry.resetOffset(),this._linesMesh.geometry.setVertexCount(s),this._linesMesh.geometry.setTriangleCount(l)),this._dataIndexOfVertex=new Uint32Array(o),this._vertexRangeOfDataIndex=new Uint32Array(2*(r-i))},_updateRegionMesh:function(t,e,n,i){for(var r=t.getData(),o=0,a=0,s=!1,l=this._polygonMesh,u=this._linesMesh,h=n;h0;b&&(w*=e.getDevicePixelRatio(),this._updateLinesGeometry(u.geometry,t,h,_,w,t.coordinateSystem.transform)),u.invisible=!b,u.material.set({color:m})}(l=this._polygonMesh).material.transparent=s,l.material.depthMask=!s,l.geometry.updateBoundingBox(),l.frontFace=this.extrudeY?_V.Mesh.CCW:_V.Mesh.CW,l.material.get("normalMap")&&l.geometry.generateTangents(),l.seriesIndex=t.seriesIndex,l.on("mousemove",this._onmousemove,this),l.on("mouseout",this._onmouseout,this)},_updateDebugWireframe:function(t){var e=t.getModel("debug.wireframe");if(e.get("show")){var n=_V.parseColor(e.get("lineStyle.color")||"rgba(0,0,0,0.5)"),i=xB.firstNotNull(e.get("lineStyle.width"),1),r=this._polygonMesh;r.geometry.generateBarycentric(),r.material.define("both","WIREFRAME_TRIANGLE"),r.material.set("wireframeLineColor",n),r.material.set("wireframeLineWidth",i)}},_onmousemove:function(t){var e=this._dataIndexOfVertex[t.triangle[0]];null==e&&(e=-1),e!==this._lastHoverDataIndex&&(this.downplay(this._lastHoverDataIndex),this.highlight(e),this._labelsBuilder.updateLabels([e])),this._lastHoverDataIndex=e,this._polygonMesh.dataIndex=e},_onmouseout:function(t){t.target&&(this.downplay(this._lastHoverDataIndex),this._lastHoverDataIndex=-1,this._polygonMesh.dataIndex=-1),this._labelsBuilder.updateLabels([])},_updateGroundPlane:function(t,e,n){var i=t.getModel("groundPlane",t);if(this._groundMesh.invisible=!i.get("show",!0),!this._groundMesh.invisible){var r=t.get("shading"),o=this._groundMaterials[r];o||(o=this._groundMaterials.lambert),_V.setMaterialFromModel(r,o,i,n),o.get("normalMap")&&this._groundMesh.geometry.generateTangents(),this._groundMesh.material=o,this._groundMesh.material.set("color",_V.parseColor(i.get("color"))),this._groundMesh.scale.set(e.size[0],e.size[2],1)}},_triangulation:function(t,e,n){this._triangulationResults=[];for(var i=[1/0,1/0,1/0],r=[-1/0,-1/0,-1/0],o=t.coordinateSystem,a=e;a1?i:0,I[V][m]=C.points[H+2],l.set(r+V,I[V]),s?(N[0]=(C.points[H]*v[0]-_[0])/x,N[1]=(C.points[H+2]*v[m]-_[m])/x):(N[0]=(G?R:R+F)/x,N[1]=(I[V][g]*v[g]-_[g])/x),h.set(r+V,N)}kU.sub(P,I[1],I[0]),kU.sub(E,I[3],I[0]),kU.cross(O,P,E),kU.normalize(O,O);for(V=0;V<4;V++)u.set(r+V,O),f&&c.set(r+V,a);for(V=0;V<6;V++)p[3*o+V]=D[V]+r;r+=4,o+=2,R+=F}}return e.dirty(),{vertexOffset:r,triangleOffset:o}},_getRegionLinesInfo:function(t,e,n){var i=0,r=0;e.getRegionModel(t).getModel("itemStyle").get("borderWidth")>0&&e.getRegionPolygonCoords(t).forEach((function(t){var e=t.exterior,o=t.interiors;i+=n.getPolylineVertexCount(e),r+=n.getPolylineTriangleCount(e);for(var a=0;athis._endIndex)){e-=this._startIndex;for(var i=this._vertexRangeOfDataIndex[2*e];i0},_displacementChanged:!0,_displacementScale:0,updateDisplacementHash:function(){var t=this.getDisplacementTexture(),e=this.getDisplacemenScale();this._displacementChanged=this._displacementTexture!==t||this._displacementScale!==e,this._displacementTexture=t,this._displacementScale=e},isDisplacementChanged:function(){return this._displacementChanged}});nt(tW.prototype,EV),nt(tW.prototype,OV),nt(tW.prototype,NV),nt(tW.prototype,qH);const eW=tW;var nW=Math.PI,iW=Math.sin,rW=Math.cos,oW=Math.tan,aW=Math.asin,sW=Math.atan2,lW=nW/180;var uW=23.4397*lW;function hW(t,e){return sW(iW(t)*rW(uW)-oW(e)*iW(uW),rW(t))}function cW(t,e,n){return sW(iW(t),rW(t)*iW(e)-oW(n)*rW(e))}function dW(t,e,n){return aW(iW(e)*iW(n)+rW(e)*rW(n)*rW(t))}function fW(t){var e,n,i=function(t){return lW*(357.5291+.98560028*t)}(t),r=function(t){return t+lW*(1.9148*iW(t)+.02*iW(2*t)+3e-4*iW(3*t))+102.9372*lW+nW}(i);return{dec:(e=r,n=0,aW(iW(n)*rW(uW)+rW(n)*iW(uW)*iW(e))),ra:hW(r,0)}}var pW={};pW.getPosition=function(t,e,n){var i=lW*-n,r=lW*e,o=function(t){return function(t){return t.valueOf()/864e5-.5+2440588}(t)-2451545}(t),a=fW(o),s=function(t,e){return lW*(280.16+360.9856235*t)-e}(o,i)-a.ra;return{azimuth:cW(s,r,a.dec),altitude:dW(s,r,a.dec)}};const gW=pW;_V.Shader.import(hV),_V.Shader.import("@export ecgl.atmosphere.vertex\nattribute vec3 position: POSITION;\nattribute vec3 normal : NORMAL;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 normalMatrix : WORLDINVERSETRANSPOSE;\n\nvarying vec3 v_Normal;\n\nvoid main() {\n v_Normal = normalize((normalMatrix * vec4(normal, 0.0)).xyz);\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end\n\n\n@export ecgl.atmosphere.fragment\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform float glowPower;\nuniform vec3 glowColor;\n\nvarying vec3 v_Normal;\n\nvoid main() {\n float intensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor = vec4(glowColor, intensity * intensity);\n}\n@end");const mW=Dp.extend({type:"globe",__ecgl__:!0,_displacementScale:0,init:function(t,e){this.groupGL=new _V.Node,this._sphereGeometry=new _V.SphereGeometry({widthSegments:200,heightSegments:100,dynamic:!0}),this._overlayGeometry=new _V.SphereGeometry({widthSegments:80,heightSegments:40}),this._planeGeometry=new _V.PlaneGeometry,this._earthMesh=new _V.Mesh({renderNormal:!0}),this._atmosphereMesh=new _V.Mesh,this._atmosphereGeometry=new _V.SphereGeometry({widthSegments:80,heightSegments:40}),this._atmosphereMaterial=new _V.Material({shader:new _V.Shader(_V.Shader.source("ecgl.atmosphere.vertex"),_V.Shader.source("ecgl.atmosphere.fragment")),transparent:!0}),this._atmosphereMesh.geometry=this._atmosphereGeometry,this._atmosphereMesh.material=this._atmosphereMaterial,this._atmosphereMesh.frontFace=_V.Mesh.CW,this._lightRoot=new _V.Node,this._sceneHelper=new $V,this._sceneHelper.initLight(this._lightRoot),this.groupGL.add(this._atmosphereMesh),this.groupGL.add(this._earthMesh),this._control=new GV({zr:e.getZr()}),this._control.init(),this._layerMeshes={}},render:function(t,e,n){var i=t.coordinateSystem,r=t.get("shading");i.viewGL.add(this._lightRoot),t.get("show")?i.viewGL.add(this.groupGL):i.viewGL.remove(this.groupGL),this._sceneHelper.setScene(i.viewGL.scene),i.viewGL.setPostEffect(t.getModel("postEffect"),n),i.viewGL.setTemporalSuperSampling(t.getModel("temporalSuperSampling"));var o=this._earthMesh;o.geometry=this._sphereGeometry;var a="ecgl."+r;o.material&&o.material.shader.name===a||(o.material=_V.createMaterial(a)),_V.setMaterialFromModel(r,o.material,t,n),["roughnessMap","metalnessMap","detailMap","normalMap"].forEach((function(t){var e=o.material.get(t);e&&(e.flipY=!1)})),o.material.set("color",_V.parseColor(t.get("baseColor")));var s=.99*i.radius;if(o.scale.set(s,s,s),t.get("atmosphere.show")){o.material.define("both","ATMOSPHERE_ENABLED"),this._atmosphereMesh.invisible=!1,this._atmosphereMaterial.setUniforms({glowPower:t.get("atmosphere.glowPower")||6,glowColor:t.get("atmosphere.color")||"#ffffff"}),o.material.setUniforms({glowPower:t.get("atmosphere.innerGlowPower")||2,glowColor:t.get("atmosphere.color")||"#ffffff"});var l=t.get("atmosphere.offset")||5;this._atmosphereMesh.scale.set(s+l,s+l,s+l)}else o.material.undefine("both","ATMOSPHERE_ENABLED"),this._atmosphereMesh.invisible=!0;var u=o.material.setTextureImage("diffuseMap",t.get("baseTexture"),n,{flipY:!1,anisotropic:8});u&&u.surface&&u.surface.attachToMesh(o);var h=o.material.setTextureImage("bumpMap",t.get("heightTexture"),n,{flipY:!1,anisotropic:8});h&&h.surface&&h.surface.attachToMesh(o),o.material[t.get("postEffect.enable")?"define":"undefine"]("fragment","SRGB_DECODE"),this._updateLight(t,n),this._displaceVertices(t,n),this._updateViewControl(t,n),this._updateLayers(t,n)},afterRender:function(t,e,n,i){var r=i.renderer;this._sceneHelper.updateAmbientCubemap(r,t,n),this._sceneHelper.updateSkybox(r,t,n)},_updateLayers:function(t,e){var n=t.coordinateSystem,i=t.get("layers"),r=n.radius,o=[],a=[],s=[],l=[];ct(i,(function(t){var i=new Ih(t),u=i.get("type"),h=_V.loadTexture(i.get("texture"),e,{flipY:!1,anisotropic:8});if(h.surface&&h.surface.attachToMesh(this._earthMesh),"blend"===u){var c=i.get("blendTo"),d=xB.firstNotNull(i.get("intensity"),1);"emission"===c?(s.push(h),l.push(d)):(o.push(h),a.push(d))}else{var f=i.get("id"),p=this._layerMeshes[f];p||(p=this._layerMeshes[f]=new _V.Mesh({geometry:this._overlayGeometry,castShadow:!1,ignorePicking:!0})),"lambert"===i.get("shading")?(p.material=p.__lambertMaterial||new _V.Material({autoUpdateTextureStatus:!1,shader:_V.createShader("ecgl.lambert"),transparent:!0,depthMask:!1}),p.__lambertMaterial=p.material):(p.material=p.__colorMaterial||new _V.Material({autoUpdateTextureStatus:!1,shader:_V.createShader("ecgl.color"),transparent:!0,depthMask:!1}),p.__colorMaterial=p.material),p.material.enableTexture("diffuseMap");var g=i.get("distance"),m=r+(null==g?n.radius/100:g);p.scale.set(m,m,m),r=m;var v=this._blankTexture||(this._blankTexture=_V.createBlankTexture("rgba(255, 255, 255, 0)"));p.material.set("diffuseMap",v),_V.loadTexture(i.get("texture"),e,{flipY:!1,anisotropic:8},(function(t){t.surface&&t.surface.attachToMesh(p),p.material.set("diffuseMap",t),e.getZr().refresh()})),i.get("show")?this.groupGL.add(p):this.groupGL.remove(p)}}),this);var u=this._earthMesh.material;u.define("fragment","LAYER_DIFFUSEMAP_COUNT",o.length),u.define("fragment","LAYER_EMISSIVEMAP_COUNT",s.length),u.set("layerDiffuseMap",o),u.set("layerDiffuseIntensity",a),u.set("layerEmissiveMap",s),u.set("layerEmissionIntensity",l);var h=t.getModel("debug.wireframe");if(h.get("show")){u.define("both","WIREFRAME_TRIANGLE");var c=_V.parseColor(h.get("lineStyle.color")||"rgba(0,0,0,0.5)"),d=xB.firstNotNull(h.get("lineStyle.width"),1);u.set("wireframeLineWidth",d),u.set("wireframeLineColor",c)}else u.undefine("both","WIREFRAME_TRIANGLE")},_updateViewControl:function(t,e){var n=t.coordinateSystem,i=t.getModel("viewControl"),r=(n.viewGL.camera,this);var o=this._control;o.setViewGL(n.viewGL);var a,s,l=i.get("targetCoord");null!=l&&(s=l[0]+90,a=l[1]),o.setFromViewControlModel(i,{baseDistance:n.radius,alpha:a,beta:s}),o.off("update"),o.on("update",(function(){e.dispatchAction({type:"globeChangeCamera",alpha:o.getAlpha(),beta:o.getBeta(),distance:o.getDistance()-n.radius,center:o.getCenter(),from:r.uid,globeId:t.id})}))},_displaceVertices:function(t,e){var n=t.get("displacementQuality"),i=t.get("debug.wireframe.show"),r=t.coordinateSystem;if(t.isDisplacementChanged()||n!==this._displacementQuality||i!==this._showDebugWireframe){this._displacementQuality=n,this._showDebugWireframe=i;var o=this._sphereGeometry,a={low:100,medium:200,high:400,ultra:800}[n]||200,s=a/2;(o.widthSegments!==a||i)&&(o.widthSegments=a,o.heightSegments=s,o.build()),this._doDisplaceVertices(o,r),i&&o.generateBarycentric()}},_doDisplaceVertices:function(t,e){var n=t.attributes.position.value,i=t.attributes.texcoord0.value,r=t.__originalPosition;r&&r.length===n.length||((r=new Float32Array(n.length)).set(n),t.__originalPosition=r);for(var o=e.displacementWidth,a=e.displacementHeight,s=e.displacementData,l=0;l50&&(o=1e3);var a=[];EW.perspective(a,NW,this.width/this.height,1,o),this.viewGL.camera.projectionMatrix.setArray(a),this.viewGL.camera.decomposeProjectionMatrix();a=EW.identity([]);var s=this.dataToPoint(this.center);EW.scale(a,a,[1,-1,1]),EW.translate(a,a,[0,0,-t]),EW.rotateX(a,a,e),EW.rotateZ(a,a,-this.bearing/180*Math.PI),EW.translate(a,a,[-s[0]*this.getScale()*kW,-s[1]*this.getScale()*kW,0]),this.viewGL.camera.viewMatrix.array=a;var l=[];EW.invert(l,a),this.viewGL.camera.worldTransform.array=l,this.viewGL.camera.decomposeWorldTransform();var u,h=OW*this.getScale();if(this.altitudeExtent&&!isNaN(this.boxHeight)){var c=this.altitudeExtent[1]-this.altitudeExtent[0];u=this.boxHeight/c*this.getScale()/Math.pow(2,this._initialZoom-this.zoomOffset)}else u=h/(2*Math.PI*6378e3*Math.abs(Math.cos(this.center[1]*(Math.PI/180))))*this.altitudeScale*kW;this.viewGL.rootNode.scale.set(this.getScale()*kW,this.getScale()*kW,u)}},getScale:function(){return Math.pow(2,this.zoom-this.zoomOffset)},projectOnTile:function(t,e){return this.projectOnTileWithScale(t,this.getScale()*OW,e)},projectOnTileWithScale:function(t,e,n){var i=t[0],r=t[1]*RW/180,o=e*(i*RW/180+RW)/(2*RW),a=e*(RW-Math.log(Math.tan(RW/4+.5*r)))/(2*RW);return(n=n||[])[0]=o,n[1]=a,n},unprojectFromTile:function(t,e){return this.unprojectOnTileWithScale(t,this.getScale()*OW,e)},unprojectOnTileWithScale:function(t,e,n){var i=t[0],r=t[1],o=i/e*(2*RW)-RW,a=2*(Math.atan(Math.exp(RW-r/e*(2*RW)))-RW/4);return(n=n||[])[0]=180*o/RW,n[1]=180*a/RW,n},dataToPoint:function(t,e){return(e=this.projectOnTileWithScale(t,OW,e))[0]-=this._origin[0],e[1]-=this._origin[1],e[2]=isNaN(t[2])?0:t[2],isNaN(t[2])||(e[2]=t[2],this.altitudeExtent&&(e[2]-=this.altitudeExtent[0])),e}};const BW=zW;function FW(){BW.apply(this,arguments)}FW.prototype=new BW,FW.prototype.constructor=FW,FW.prototype.type="mapbox3D";function VW(t,e,n){function i(t,e){var n=e.getWidth(),i=e.getHeight(),r=e.getDevicePixelRatio();this.viewGL.setViewport(0,0,n,i,r),this.width=n,this.height=i,this.altitudeScale=t.get("altitudeScale"),this.boxHeight=t.get("boxHeight")}function r(t,e){if("auto"!==this.model.get("boxHeight")){var n=[1/0,-1/0];t.eachSeries((function(t){if(t.coordinateSystem===this){var e=t.getData(),i=t.coordDimToDataDim("alt")[0];if(i){var r=e.getDataExtent(i,!0);n[0]=Math.min(n[0],r[0]),n[1]=Math.max(n[1],r[1])}}}),this),n&&isFinite(n[1]-n[0])&&(this.altitudeExtent=n)}}return{dimensions:e.prototype.dimensions,create:function(o,a){var s=[];return o.eachComponent(t,(function(t){var n=t.__viewGL;n||(n=t.__viewGL=new NH).setRootNode(new _V.Node);var o=new e;o.viewGL=t.__viewGL,o.resize=i,o.resize(t,a),s.push(o),t.coordinateSystem=o,o.model=t,o.update=r})),o.eachSeries((function(e){if(e.get("coordinateSystem")===t){var n=e.getReferringComponents(t).models[0];if(n||(n=o.getComponent(t)),!n)throw new Error(t+' "'+xB.firstNotNull(e.get(t+"Index"),e.get(t+"Id"),0)+'" not found');e.coordinateSystem=n.coordinateSystem}})),n&&n(s,o,a),s}}}const GW=VW("mapbox3D",FW,(function(t){t.forEach((function(t){t.setCameraOption(t.model.getMapboxCameraOption())}))}));Jw((function(t){t.registerComponentModel(CW),t.registerComponentView(PW),t.registerCoordinateSystem("mapbox3D",GW),t.registerAction({type:"mapbox3DChangeCamera",event:"mapbox3dcamerachanged",update:"mapbox3D:updateCamera"},(function(t,e){e.eachComponent({mainType:"mapbox3D",query:t},(function(e){e.setMapboxCameraOption(t)}))}))}));var HW=["zoom","center","pitch","bearing"],UW=Gc.extend({type:"maptalks3D",layoutMode:"box",coordinateSystem:null,defaultOption:{zlevel:-10,urlTemplate:"http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",attribution:'© OpenStreetMap contributors, © CARTO',center:[0,0],zoom:0,pitch:0,bearing:0,light:{main:{alpha:20,beta:30}},altitudeScale:1,boxHeight:"auto"},getMaptalksCameraOption:function(){var t=this;return HW.reduce((function(e,n){return e[n]=t.get(n),e}),{})},setMaptalksCameraOption:function(t){null!=t&&HW.forEach((function(e){null!=t[e]&&(this.option[e]=t[e])}),this)},getMaptalks:function(){return this._maptalks},setMaptalks:function(t){this._maptalks=t}});nt(UW.prototype,OV),nt(UW.prototype,NV);const WW=UW;function jW(t,e,n,i){if(this.id=t,this.zr=e,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute;left:0;right:0;top:0;bottom:0;",!maptalks)throw new Error("Maptalks library must be included. See https://maptalks.org");this._maptalks=new maptalks.Map(this.dom,{center:n,zoom:i,doubleClickZoom:!1,fog:!1}),this._initEvents()}jW.prototype.setUnpainted=function(){},jW.prototype.resize=function(){this._maptalks.checkSize()},jW.prototype.getMaptalks=function(){return this._maptalks},jW.prototype.clear=function(){},jW.prototype.refresh=function(){this._maptalks.checkSize()};var ZW=["mousedown","mouseup","click","dblclick","mousemove","mousewheel","DOMMouseScroll","touchstart","touchend","touchmove","touchcancel"];jW.prototype._initEvents=function(){var t=this.dom;this._handlers=this._handlers||{contextmenu:function(t){return t.preventDefault(),!1}},ZW.forEach((function(e){this._handlers[e]=function(n){var i={};for(var r in n)i[r]=n[r];i.bubbles=!1;var o=new n.constructor(n.type,i);"mousewheel"===e||"DOMMouseScroll"===e?t.dispatchEvent(o):t.firstElementChild.dispatchEvent(o)},this.zr.dom.addEventListener(e,this._handlers[e])}),this),this.zr.dom.addEventListener("contextmenu",this._handlers.contextmenu)},jW.prototype.dispose=function(){ZW.forEach((function(t){this.zr.dom.removeEventListener(t,this._handlers[t])}),this),this._maptalks.remove()};const XW=jW;_V.Shader.import(IW);const qW=Dp.extend({type:"maptalks3D",__ecgl__:!0,init:function(t,e){this._groundMesh=new _V.Mesh({geometry:new _V.PlaneGeometry,material:new _V.Material({shader:new _V.Shader({vertex:_V.Shader.source("ecgl.displayShadow.vertex"),fragment:_V.Shader.source("ecgl.displayShadow.fragment")}),depthMask:!1}),renderOrder:-100,culling:!1,castShadow:!1,$ignorePicking:!0,renderNormal:!0})},_initMaptalksLayer:function(t,e){var n=e.getZr();this._zrLayer=new XW("maptalks3D",n,t.get("center"),t.get("zoom")),n.painter.insertLayer(-1e3,this._zrLayer),this._lightRoot=new _V.Node,this._sceneHelper=new $V(this._lightRoot),this._sceneHelper.initLight(this._lightRoot);var i=this._zrLayer.getMaptalks(),r=this._dispatchInteractAction.bind(this,e,i);["zoomend","zooming","zoomstart","dragrotating","pitch","pitchend","movestart","moving","moveend","resize","touchstart","touchmove","touchend","animating"].forEach((function(t){i.on(t,r)}))},render:function(t,e,n){this._zrLayer||this._initMaptalksLayer(t,n);var i=this._zrLayer.getMaptalks(),r=t.get("urlTemplate"),o=i.getBaseLayer();r!==this._oldUrlTemplate&&(o?o.setOptions({urlTemplate:r,attribution:t.get("attribution")}):(o=new maptalks.TileLayer("maptalks-echarts-gl-baselayer",{urlTemplate:r,subdomains:["a","b","c"],attribution:t.get("attribution")}),i.setBaseLayer(o))),this._oldUrlTemplate=r,i.setCenter(t.get("center")),i.setZoom(t.get("zoom"),{animation:!1}),i.setPitch(t.get("pitch")),i.setBearing(t.get("bearing")),t.setMaptalks(i);var a=t.coordinateSystem;a.viewGL.scene.add(this._lightRoot),a.viewGL.add(this._groundMesh),this._updateGroundMesh(),this._sceneHelper.setScene(a.viewGL.scene),this._sceneHelper.updateLight(t),a.viewGL.setPostEffect(t.getModel("postEffect"),n),a.viewGL.setTemporalSuperSampling(t.getModel("temporalSuperSampling")),this._maptalks3DModel=t},afterRender:function(t,e,n,i){var r=i.renderer;this._sceneHelper.updateAmbientCubemap(r,t,n),this._sceneHelper.updateSkybox(r,t,n),t.coordinateSystem.viewGL.scene.traverse((function(t){t.material&&(t.material.define("fragment","NORMAL_UP_AXIS",2),t.material.define("fragment","NORMAL_FRONT_AXIS",1))}))},updateCamera:function(t,e,n,i){t.coordinateSystem.setCameraOption(i),this._updateGroundMesh(),n.getZr().refresh()},_dispatchInteractAction:function(t,e,n){var i;t.dispatchAction({type:"maptalks3DChangeCamera",pitch:e.getPitch(),zoom:(i=e.getResolution(),19-Math.log(i/YW)/Math.LN2+1),center:e.getCenter().toArray(),bearing:e.getBearing(),maptalks3DId:this._maptalks3DModel&&this._maptalks3DModel.id})},_updateGroundMesh:function(){if(this._maptalks3DModel){var t=this._maptalks3DModel.coordinateSystem,e=t.dataToPoint(t.center);this._groundMesh.position.set(e[0],e[1],-.001);var n=new _V.Plane(new _V.Vector3(0,0,1),0),i=t.viewGL.camera.castRay(new _V.Vector2(-1,-1)),r=t.viewGL.camera.castRay(new _V.Vector2(1,1)),o=i.intersectPlane(n),a=r.intersectPlane(n),s=o.dist(a)/t.viewGL.rootNode.scale.x;this._groundMesh.scale.set(s,s,1)}},dispose:function(t,e){this._zrLayer&&this._zrLayer.dispose(),e.getZr().painter.delLayer(-1e3)}}),YW=12756274*Math.PI/(256*Math.pow(2,20));function KW(){BW.apply(this,arguments),this.maxPitch=85,this.zoomOffset=1}KW.prototype=new BW,KW.prototype.constructor=KW,KW.prototype.type="maptalks3D";const JW=VW("maptalks3D",KW,(function(t){t.forEach((function(t){t.setCameraOption(t.model.getMaptalksCameraOption())}))}));Jw((function(t){t.registerComponentModel(WW),t.registerComponentView(qW),t.registerCoordinateSystem("maptalks3D",JW),t.registerAction({type:"maptalks3DChangeCamera",event:"maptalks3dcamerachanged",update:"maptalks3D:updateCamera"},(function(t,e){e.eachComponent({mainType:"maptalks3D",query:t},(function(e){e.setMaptalksCameraOption(t)}))}))}));var $W=UV.vec3,QW=jw.isDimensionStacked;const tj=function(t,e){var n=t.getData(),i=t.get("barSize");if(null==i){var r,o,a=e.size,s=e.getAxis("x"),l=e.getAxis("y");r="category"===s.type?.7*s.getBandWidth():.6*Math.round(a[0]/Math.sqrt(n.count())),o="category"===l.type?.7*l.getBandWidth():.6*Math.round(a[1]/Math.sqrt(n.count())),i=[r,o]}else yt(i)||(i=[i,i]);var u=e.getAxis("z").scale.getExtent(),h=function(t){var e=t[0],n=t[1];return!(e>0&&n>0||e<0&&n<0)}(u),c=["x","y","z"].map((function(e){return t.coordDimToDataDim(e)[0]})),d=QW(n,c[2]),f=d?n.getCalculationInfo("stackResultDimension"):c[2];n.each(c,(function(t,r,o,a){var s=n.get(f,a),l=d?s-o:h?0:u[0],c=e.dataToPoint([t,r,l]),p=e.dataToPoint([t,r,s]),g=$W.dist(c,p),m=[0,p[1]"+r.join("
")}(r):ze(mc(r)),a=i.getName(e),s=EU(i,e);St(s)&&s.colorStops&&(s=(s.colorStops[0]||{}).color);var l=Tc(s=s||"transparent"),u=t.name;return"\0-"===u&&(u=""),u=u?ze(u)+(n?": ":"
"):"",n?l+u+o:u+l+(a?ze(a)+": "+o:o)}function uj(t,e,n){n=n||t.getSource();var i=e||Hy(t.get("coordinateSystem"))||["x","y","z"],r=Lx(n,{dimensionsDefine:n.dimensionsDefine||t.get("dimensions"),encodeDefine:n.encodeDefine||t.get("encode"),coordDimensions:i.map((function(e){var n=t.getReferringComponents(e+"Axis3D").models[0];return{type:n&&"category"===n.get("type")?"ordinal":"float",name:e}}))});"cartesian3D"===t.get("coordinateSystem")&&r.forEach((function(e){if(i.indexOf(e.coordDim)>=0){var n=t.getReferringComponents(e.coordDim+"Axis3D").models[0];n&&"category"===n.get("type")&&(e.ordinalMeta=n.getOrdinalMeta())}}));var o=jw.enableDataStack(t,r,{byIndex:!0,stackedCoordDimension:"z"}),a=new Cx(r,t);return a.setCalculationInfo(o),a.initData(n),a}var hj=Lp.extend({type:"series.bar3D",dependencies:["globe"],visualStyleAccessPathvisu:"itemStyle",getInitialData:function(t,e){return uj(this)},getFormattedLabel:function(t,e,n,i){var r=sj.getFormattedLabel(this,t,e,n,i);return null==r&&(r=this.getData().get("z",t)),r},formatTooltip:function(t){return lj(this,t)},defaultOption:{coordinateSystem:"cartesian3D",globeIndex:0,grid3DIndex:0,zlevel:-10,bevelSize:0,bevelSmoothness:2,onGridPlane:"xy",shading:"color",minHeight:0,itemStyle:{opacity:1},label:{show:!1,distance:2,textStyle:{fontSize:14,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:3}},emphasis:{label:{show:!0}},animationDurationUpdate:500}});nt(hj.prototype,qH);const cj=hj;var dj,fj,pj,gj,mj,vj,_j,yj,xj=UV.vec3,wj=UV.mat3,bj=xk.extend((function(){return{attributes:{position:new xk.Attribute("position","float",3,"POSITION"),normal:new xk.Attribute("normal","float",3,"NORMAL"),color:new xk.Attribute("color","float",4,"COLOR"),prevPosition:new xk.Attribute("prevPosition","float",3),prevNormal:new xk.Attribute("prevNormal","float",3)},dynamic:!0,enableNormal:!1,bevelSize:1,bevelSegments:0,_dataIndices:null,_vertexOffset:0,_triangleOffset:0}}),{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0},setBarCount:function(t){var e=this.enableNormal,n=this.getBarVertexCount()*t,i=this.getBarTriangleCount()*t;this.vertexCount!==n&&(this.attributes.position.init(n),e?this.attributes.normal.init(n):this.attributes.normal.value=null,this.attributes.color.init(n)),this.triangleCount!==i&&(this.indices=n>65535?new Uint32Array(3*i):new Uint16Array(3*i),this._dataIndices=new Uint32Array(n))},getBarVertexCount:function(){var t=this.bevelSize>0?this.bevelSegments:0;return t>0?this._getBevelBarVertexCount(t):this.enableNormal?24:8},getBarTriangleCount:function(){var t=this.bevelSize>0?this.bevelSegments:0;return t>0?this._getBevelBarTriangleCount(t):12},_getBevelBarVertexCount:function(t){return 4*(t+1)*(t+1)*2},_getBevelBarTriangleCount:function(t){return(4*t+3+1)*(2*t+1)*2+4},setColor:function(t,e){for(var n=this.getBarVertexCount(),i=n*(t+1),r=n*t;r0&&this.bevelSegments>0)this._addBevelBar(t,c,g,m,this.bevelSize,this.bevelSegments,v);else{xj.copy(r,c),xj.normalize(r,r),xj.cross(o,g,r),xj.normalize(o,o),xj.cross(i,r,o),xj.normalize(o,o),xj.negate(a,i),xj.negate(s,r),xj.negate(l,o),e(u[0],t,i,m[0]/2),e(u[0],u[0],o,m[2]/2),e(u[1],t,i,m[0]/2),e(u[1],u[1],l,m[2]/2),e(u[2],t,a,m[0]/2),e(u[2],u[2],l,m[2]/2),e(u[3],t,a,m[0]/2),e(u[3],u[3],o,m[2]/2),e(n,t,r,m[1]),e(u[4],n,i,m[0]/2),e(u[4],u[4],o,m[2]/2),e(u[5],n,i,m[0]/2),e(u[5],u[5],l,m[2]/2),e(u[6],n,a,m[0]/2),e(u[6],u[6],l,m[2]/2),e(u[7],n,a,m[0]/2),e(u[7],u[7],o,m[2]/2);var x=this.attributes;if(this.enableNormal){h[0]=i,h[1]=a,h[2]=r,h[3]=s,h[4]=o,h[5]=l;for(var w=this._vertexOffset,b=0;b0&&(f++,h[3]<.99&&(p=!0))}})),a.geometry.setBarCount(f);var g=n.getLayout("orient"),m=this._barIndexOfData=new Int32Array(n.count());f=0;n.each((function(t){if(n.hasValue(t)){var e=n.getItemLayout(t),i=e[0],r=e[1],a=e[2],s=4*t;h[0]=c[s++],h[1]=c[s++],h[2]=c[s++],h[3]=c[s++],h[3]>0&&(o._barMesh.geometry.addBar(i,r,g,a,h,t),m[t]=f++)}else m[t]=-1})),a.geometry.dirty(),a.geometry.updateBoundingBox();var v=a.material;v.transparent=p,v.depthMask=!p,a.geometry.sortTriangles=p,this._initHandler(t,e)},_initHandler:function(t,e){var n=t.getData(),i=this._barMesh,r="cartesian3D"===t.coordinateSystem.type;i.seriesIndex=t.seriesIndex;var o=-1;i.off("mousemove"),i.off("mouseout"),i.on("mousemove",(function(t){var a=i.geometry.getDataIndexOfVertex(t.triangle[0]);a!==o&&(this._downplay(o),this._highlight(a),this._labelsBuilder.updateLabels([a]),r&&e.dispatchAction({type:"grid3DShowAxisPointer",value:[n.get("x",a),n.get("y",a),n.get("z",a,!0)]})),o=a,i.dataIndex=a}),this),i.on("mouseout",(function(t){this._downplay(o),this._labelsBuilder.updateLabels(),o=-1,i.dataIndex=-1,r&&e.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_highlight:function(t){var e=this._data;if(e){var n=this._barIndexOfData[t];if(!(n<0)){var i=e.getItemModel(t).getModel("emphasis.itemStyle"),r=i.get("color"),o=i.get("opacity");if(null==r)r=zi(EU(e,t),-.4);null==o&&(o=OU(e,t));var a=_V.parseColor(r);a[3]*=o,this._barMesh.geometry.setColor(n,a),this._api.getZr().refresh()}}},_downplay:function(t){var e=this._data;if(e){var n=this._barIndexOfData[t];if(!(n<0)){var i=EU(e,t),r=OU(e,t),o=_V.parseColor(i);o[3]*=r,this._barMesh.geometry.setColor(n,o),this._api.getZr().refresh()}}},highlight:function(t,e,n,i){this._toggleStatus("highlight",t,e,n,i)},downplay:function(t,e,n,i){this._toggleStatus("downplay",t,e,n,i)},_toggleStatus:function(t,e,n,i,r){var o=e.getData(),a=xB.queryDataIndex(o,r),s=this;null!=a?ct(sj.normalizeToArray(a),(function(e){"highlight"===t?this._highlight(e):this._downplay(e)}),this):o.each((function(e){"highlight"===t?s._highlight(e):s._downplay(e)}))},remove:function(){this.groupGL.removeAll()},dispose:function(){this._labelsBuilder.dispose(),this.groupGL.removeAll()}});Jw((function(t){t.registerChartView(Mj),t.registerSeriesModel(cj),oj(t),t.registerProcessor((function(t,e){t.eachSeriesByType("bar3d",(function(t){var e=t.getData();e.filterSelf((function(t){return e.hasValue(t)}))}))}))}));const Cj=Lp.extend({type:"series.line3D",dependencies:["grid3D"],visualStyleAccessPath:"lineStyle",visualDrawType:"stroke",getInitialData:function(t,e){return uj(this)},formatTooltip:function(t){return lj(this,t)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,lineStyle:{width:2},animationDurationUpdate:500}});function Lj(t,e,n,i,r,o,a){if(0===r)return!1;var s=r,l=0;if(a>e+s&&a>i+s||at+s&&o>n+s||o=0){var m=3*l,v=new QN(this._points[m],this._points[m+1],this._points[m+2]);o.push({dataIndex:l,point:v,pointWorld:v.clone(),target:this._line3DMesh,distance:this._camera.getWorldPosition().dist(v)})}},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}});Jw((function(t){t.registerChartView(Dj),t.registerSeriesModel(Cj),t.registerLayout((function(t,e){t.eachSeriesByType("line3D",(function(t){var e=t.getData(),n=t.coordinateSystem;if(n){if("cartesian3D"!==n.type)return void 0;var i=new Float32Array(3*e.count()),r=[],o=[],a=n.dimensions.map((function(e){return t.coordDimToDataDim(e)[0]}));n&&e.each(a,(function(t,e,a,s){r[0]=t,r[1]=e,r[2]=a,n.dataToPoint(r,o),i[3*s]=o[0],i[3*s+1]=o[1],i[3*s+2]=o[2]})),e.setLayout("points",i)}}))}))}));const Ij=Lp.extend({type:"series.scatter3D",dependencies:["globe","grid3D","geo3D"],visualStyleAccessPath:"itemStyle",hasSymbolVisual:!0,getInitialData:function(t,e){return uj(this)},getFormattedLabel:function(t,e,n,i){var r=sj.getFormattedLabel(this,t,e,n,i);if(null==r){var o=this.getData(),a=o.dimensions[o.dimensions.length-1];r=o.get(a,t)}return r},formatTooltip:function(t){return lj(this,t)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,progressive:1e5,progressiveThreshold:1e5,grid3DIndex:0,globeIndex:0,symbol:"circle",symbolSize:10,blendMode:"source-over",label:{show:!1,position:"right",distance:5,textStyle:{fontSize:14,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:3}},itemStyle:{opacity:.8},emphasis:{label:{show:!0}},animationDurationUpdate:500}});function Pj(t,e,n){(e=e||document.createElement("canvas")).width=t,e.height=t;var i=e.getContext("2d");return n&&n(i),e}var Ej={getMarginByStyle:function(t){var e=t.minMargin||0,n=0;t.stroke&&"none"!==t.stroke&&(n=null==t.lineWidth?1:t.lineWidth);var i=t.shadowBlur||0,r=t.shadowOffsetX||0,o=t.shadowOffsetY||0,a={};return a.left=Math.max(n/2,-r+i,e),a.right=Math.max(n/2,r+i,e),a.top=Math.max(n/2,-o+i,e),a.bottom=Math.max(n/2,o+i,e),a},createSymbolSprite:function(t,e,n,i){var r=function(t,e,n,i){yt(e)||(e=[e,e]);var r=Ej.getMarginByStyle(n,i),o=e[0]+r.left+r.right,a=e[1]+r.top+r.bottom,s=jv(t,0,0,e[0],e[1]),l=Math.max(o,a);s.x=r.left,s.y=r.top,o>a?s.y+=(l-a)/2:s.x+=(l-o)/2;var u=s.getBoundingRect();return s.x-=u.x,s.y-=u.y,s.setStyle(n),s.update(),s.__size=l,s}(t,e,n),o=Ej.getMarginByStyle(n);return{image:Pj(r.__size,i,(function(t){v_(t,r)})),margin:o}},createSDFFromCanvas:function(t,e,n,i){return Pj(e,i,(function(e){var i=t.getContext("2d").getImageData(0,0,t.width,t.height);e.putImageData(function(t,e,n){var i=e.width,r=e.height,o=t.canvas.width,a=t.canvas.height,s=i/o,l=r/a;function u(t){return t<128?1:-1}function h(t,o){var a=1/0;t=Math.floor(t*s);for(var h=(o=Math.floor(o*l))*i+t,c=u(e.data[4*h]),d=Math.max(o-n,0);d=2e4},doSortVertices:function(t,e){var n=this.indices,i=Nj.create();if(!n){n=this.indices=this.vertexCount>65535?new Uint32Array(this.vertexCount):new Uint16Array(this.vertexCount);for(var r=0;r.05);else for(r=0;r<3;r++)this._progressiveQuickSort(3*e+r);this.dirtyIndices()},_simpleSort:function(t){var e=this._zList,n=this.indices;function i(t,n){return e[n]-e[t]}t?Array.prototype.sort.call(n,i):CU.sort(n,i,0,n.length-1)},_progressiveQuickSort:function(t){var e=this._zList,n=this.indices;this._quickSort=this._quickSort||new CU,this._quickSort.step(n,(function(t,n){return e[n]-e[t]}),t)}};var kj=UV.vec4;_V.Shader.import("@export ecgl.sdfSprite.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform float elapsedTime : 0;\n\nattribute vec3 position : POSITION;\n\n#ifdef VERTEX_SIZE\nattribute float size;\n#else\nuniform float u_Size;\n#endif\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_FillColor: COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute float prevSize;\nuniform float percent : 1.0;\n#endif\n\n\n#ifdef POSITIONTEXTURE_ENABLED\nuniform sampler2D positionTexture;\n#endif\n\nvarying float v_Size;\n\nvoid main()\n{\n\n#ifdef POSITIONTEXTURE_ENABLED\n gl_Position = worldViewProjection * vec4(texture2D(positionTexture, position.xy).xy, -10.0, 1.0);\n#else\n\n #ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n #else\n vec3 pos = position;\n #endif\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n#endif\n\n#ifdef VERTEX_SIZE\n#ifdef VERTEX_ANIMATION\n v_Size = mix(prevSize, size, percent);\n#else\n v_Size = size;\n#endif\n#else\n v_Size = u_Size;\n#endif\n\n#ifdef VERTEX_COLOR\n v_Color = a_FillColor;\n #endif\n\n gl_PointSize = v_Size;\n}\n\n@end\n\n@export ecgl.sdfSprite.fragment\n\nuniform vec4 color: [1, 1, 1, 1];\nuniform vec4 strokeColor: [1, 1, 1, 1];\nuniform float smoothing: 0.07;\n\nuniform float lineWidth: 0.0;\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\nvarying float v_Size;\n\nuniform sampler2D sprite;\n\n@import clay.util.srgb\n\nvoid main()\n{\n gl_FragColor = color;\n\n vec4 _strokeColor = strokeColor;\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n #endif\n\n#ifdef SPRITE_ENABLED\n float d = texture2D(sprite, gl_PointCoord).r;\n gl_FragColor.a *= smoothstep(0.5 - smoothing, 0.5 + smoothing, d);\n\n if (lineWidth > 0.0) {\n float sLineWidth = lineWidth / 2.0;\n\n float outlineMaxValue0 = 0.5 + sLineWidth;\n float outlineMaxValue1 = 0.5 + sLineWidth + smoothing;\n float outlineMinValue0 = 0.5 - sLineWidth - smoothing;\n float outlineMinValue1 = 0.5 - sLineWidth;\n\n if (d <= outlineMaxValue1 && d >= outlineMinValue0) {\n float a = _strokeColor.a;\n if (d <= outlineMinValue1) {\n a = a * smoothstep(outlineMinValue0, outlineMinValue1, d);\n }\n else {\n a = a * smoothstep(outlineMaxValue1, outlineMaxValue0, d);\n }\n gl_FragColor.rgb = mix(gl_FragColor.rgb * gl_FragColor.a, _strokeColor.rgb, a);\n gl_FragColor.a = gl_FragColor.a * (1.0 - a) + a;\n }\n }\n#endif\n\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(gl_FragColor);\n#endif\n}\n@end");var zj=_V.Mesh.extend((function(){var t=new _V.Geometry({dynamic:!0,attributes:{color:new _V.Geometry.Attribute("color","float",4,"COLOR"),position:new _V.Geometry.Attribute("position","float",3,"POSITION"),size:new _V.Geometry.Attribute("size","float",1),prevPosition:new _V.Geometry.Attribute("prevPosition","float",3),prevSize:new _V.Geometry.Attribute("prevSize","float",1)}});Object.assign(t,Rj);var e=new _V.Material({shader:_V.createShader("ecgl.sdfSprite"),transparent:!0,depthMask:!1});e.enableTexture("sprite"),e.define("both","VERTEX_COLOR"),e.define("both","VERTEX_SIZE");var n=new _V.Texture2D({image:document.createElement("canvas"),flipY:!1});return e.set("sprite",n),t.pick=this._pick.bind(this),{geometry:t,material:e,mode:_V.Mesh.POINTS,sizeScale:1}}),{_pick:function(t,e,n,i,r,o){var a=this._positionNDC;if(a)for(var s=n.viewport,l=2/s.width,u=2/s.height,h=this.geometry.vertexCount-1;h>=0;h--){var c,d=a[2*(c=this.geometry.indices?this.geometry.indices[h]:h)],f=a[2*c+1],p=this.geometry.attributes.size.get(c)/this.sizeScale/2;if(t>d-p*l&&tf-p*u&&e2?(p=this._updateSymbolSprite(t,d,h,c),s.enableTexture("sprite")):s.disableTexture("sprite"),u.position.init(r-i);var g=[];if(f){s.undefine("VERTEX_SIZE"),s.undefine("VERTEX_COLOR");var m=function(t){const e=t.getVisual("style");if(e)return e[t.getVisual("drawType")]}(a),v=function(t){return t.getVisual("style").opacity}(a);_V.parseColor(m,g),g[3]*=v,s.set({color:g,u_Size:h.maxSize*this._sizeScale})}else s.set({color:[1,1,1,1]}),s.define("VERTEX_SIZE"),s.define("VERTEX_COLOR"),u.size.init(r-i),u.color.init(r-i),this._originalOpacity=new Float32Array(r-i);for(var _=a.getLayout("points"),y=u.position.value,x=0;x1?(a[0]=n.maxSize,a[1]=n.maxSize/n.aspect):(a[1]=n.maxSize,a[0]=n.maxSize*n.aspect),a[0]=a[0]||1,a[1]=a[1]||1,this._symbolType===n.type&&(r=this._symbolSize,o=a,r&&o&&r[0]===o[0]&&r[1]===o[1])&&this._lineWidth===e.lineWidth||(Oj.createSymbolSprite(n.type,a,{fill:"#fff",lineWidth:e.lineWidth,stroke:"transparent",shadowColor:"transparent",minMargin:Math.min(a[0]/2,10)},this._spriteImageCanvas),Oj.createSDFFromCanvas(this._spriteImageCanvas,Math.min(this._spriteImageCanvas.width,32),20,this._mesh.material.get("sprite").image),this._symbolType=n.type,this._symbolSize=a,this._lineWidth=e.lineWidth),this._spriteImageCanvas.width/n.maxSize*i},_updateMaterial:function(t,e){var n="lighter"===t.get("blendMode")?_V.additiveBlend:null,i=this._mesh.material;i.blend=n,i.set("lineWidth",e.lineWidth/20);var r=_V.parseColor(e.stroke);i.set("strokeColor",r),i.transparent=!0,i.depthMask=!1,i.depthTest=!this.is2D,i.sortVertices=!this.is2D},_updateLabelBuilder:function(t,e,n){var i=t.getData(),r=this._mesh.geometry,o=r.attributes.position.value,a=(e=this._startDataIndex,this._mesh.sizeScale);this._labelsBuilder.updateData(i,e,n),this._labelsBuilder.getLabelPosition=function(t,n,i){var r=3*(t-e);return[o[r],o[r+1],o[r+2]]},this._labelsBuilder.getLabelDistance=function(t,n,i){return r.attributes.size.get(t-e)/a/2+i},this._labelsBuilder.updateLabels()},_updateAnimation:function(t){_V.updateVertexAnimation([["prevPosition","position"],["prevSize","size"]],this._prevMesh,this._mesh,t)},_updateHandler:function(t,e,n){var i,r=t.getData(),o=this._mesh,a=this,s=-1,l=t.coordinateSystem&&"cartesian3D"===t.coordinateSystem.type;l&&(i=t.coordinateSystem.model),o.seriesIndex=t.seriesIndex,o.off("mousemove"),o.off("mouseout"),o.on("mousemove",(function(e){var u=e.vertexIndex+a._startDataIndex;u!==s&&(this.highlightOnMouseover&&(this.downplay(r,s),this.highlight(r,u),this._labelsBuilder.updateLabels([u])),l&&n.dispatchAction({type:"grid3DShowAxisPointer",value:[r.get(t.coordDimToDataDim("x")[0],u),r.get(t.coordDimToDataDim("y")[0],u),r.get(t.coordDimToDataDim("z")[0],u)],grid3DIndex:i.componentIndex})),o.dataIndex=u,s=u}),this),o.on("mouseout",(function(t){var e=t.vertexIndex+a._startDataIndex;this.highlightOnMouseover&&(this.downplay(r,e),this._labelsBuilder.updateLabels()),s=-1,o.dataIndex=-1,l&&n.dispatchAction({type:"grid3DHideAxisPointer",grid3DIndex:i.componentIndex})}),this)},updateLayout:function(t,e,n){var i=t.getData();if(this._mesh){var r=this._mesh.geometry.attributes.position.value,o=i.getLayout("points");if(this.is2D)for(var a=0;athis._endDataIndex||ethis._endDataIndex||e 1.0 || v_Percent < 0.0) {\n discard;\n }\n\n float fade = v_Percent;\n\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n\n @import ecgl.common.wireframe.fragmentMain\n\n if (v_Percent > (1.0 - v_SpotPercent)) {\n gl_FragColor.rgb *= spotIntensity;\n }\n\n gl_FragColor.a *= fade;\n}\n\n@end");const lZ=_V.Mesh.extend((function(){var t=new _V.Material({shader:new _V.Shader(_V.Shader.source("ecgl.trail2.vertex"),_V.Shader.source("ecgl.trail2.fragment")),transparent:!0,depthMask:!1}),e=new XV({dynamic:!0});return e.createAttribute("dist","float",1),e.createAttribute("distAll","float",1),e.createAttribute("start","float",1),{geometry:e,material:t,culling:!1,$ignorePicking:!0}}),{updateData:function(t,e,n){var i=t.hostModel,r=this.geometry,o=i.getModel("effect"),a=o.get("trailWidth")*e.getDevicePixelRatio(),s=o.get("trailLength"),l=i.get("effect.constantSpeed"),u=1e3*i.get("effect.period"),h=null!=l;h?this.material.set("speed",l/1e3):this.material.set("period",u),this.material[h?"define":"undefine"]("vertex","CONSTANT_SPEED");var c=i.get("polyline");r.trailLength=s,this.material.set("trailLength",s),r.resetOffset(),["position","positionPrev","positionNext"].forEach((function(t){r.attributes[t].value=n.attributes[t].value}));["dist","distAll","start","offset","color"].forEach((function(t){r.attributes[t].init(r.vertexCount)})),r.indices=n.indices;var d=[],f=o.get("trailColor"),p=o.get("trailOpacity"),g=null!=f,m=null!=p;this.updateWorldTransform();var v=this.worldTransform.x.len(),_=this.worldTransform.y.len(),y=this.worldTransform.z.len(),x=0,w=0;t.each((function(e){var i=t.getItemLayout(e),o=m?p:OU(t,e),s=EU(t,e);null==o&&(o=1),(d=_V.parseColor(g?f:s,d))[3]*=o;for(var l=c?n.getPolylineVertexCount(i):n.getCubicCurveVertexCount(i[0],i[1],i[2],i[3]),b=0,T=[],S=[],M=x;Mx&&(b+=sZ.dist(T,S)),r.attributes.dist.set(M,b),sZ.copy(S,T);w=Math.max(w,b);var C=Math.random()*(h?b:u);for(M=x;M0?1:-1)*a/2),r.attributes.color.set(M,d);x+=l})),this.material.set("spotSize",.1*w*s),this.material.set("spotIntensity",o.get("spotIntensity")),r.dirty()},setAnimationTime:function(t){this.material.set("time",t)}});_V.Shader.import(gG);const uZ=Fm.extend({type:"lines3D",__ecgl__:!0,init:function(t,e){this.groupGL=new _V.Node,this._meshLinesMaterial=new _V.Material({shader:_V.createShader("ecgl.meshLines3D"),transparent:!0,depthMask:!1}),this._linesMesh=new _V.Mesh({geometry:new XV,material:this._meshLinesMaterial,$ignorePicking:!0}),this._trailMesh=new lZ},render:function(t,e,n){this.groupGL.add(this._linesMesh);var i=t.coordinateSystem,r=t.getData();if(i&&i.viewGL){i.viewGL.add(this.groupGL),this._updateLines(t,e,n);var o=i.viewGL.isLinearSpace()?"define":"undefine";this._linesMesh.material[o]("fragment","SRGB_DECODE"),this._trailMesh.material[o]("fragment","SRGB_DECODE")}var a=this._trailMesh;if(a.stopAnimation(),t.get("effect.show")){this.groupGL.add(a),a.updateData(r,n,this._linesMesh.geometry),a.__time=a.__time||0;var s=36e5;this._curveEffectsAnimator=a.animate("",{loop:!0}).when(s,{__time:s}).during((function(){a.setAnimationTime(a.__time)})).start()}else this.groupGL.remove(a),this._curveEffectsAnimator=null;this._linesMesh.material.blend=this._trailMesh.material.blend="lighter"===t.get("blendMode")?_V.additiveBlend:null},pauseEffect:function(){this._curveEffectsAnimator&&this._curveEffectsAnimator.pause()},resumeEffect:function(){this._curveEffectsAnimator&&this._curveEffectsAnimator.resume()},toggleEffect:function(){var t=this._curveEffectsAnimator;t&&(t.isPaused()?t.resume():t.pause())},_updateLines:function(t,e,n){var i=t.getData(),r=t.coordinateSystem,o=this._linesMesh.geometry,a=t.get("polyline");o.expandLine=!0;var s=function(t){return null!=t.radius?t.radius:null!=t.size?Math.max(t.size[0],t.size[1],t.size[2]):100}(r);o.segmentScale=s/20;var l="lineStyle.width".split("."),u=n.getDevicePixelRatio(),h=0;i.each((function(t){var e=i.getItemModel(t).get(l);null==e&&(e=1),i.setItemVisual(t,"lineWidth",e),h=Math.max(e,h)})),o.useNativeLine=!1;var c=0,d=0;i.each((function(t){var e=i.getItemLayout(t);a?(c+=o.getPolylineVertexCount(e),d+=o.getPolylineTriangleCount(e)):(c+=o.getCubicCurveVertexCount(e[0],e[1],e[2],e[3]),d+=o.getCubicCurveTriangleCount(e[0],e[1],e[2],e[3]))})),o.setVertexCount(c),o.setTriangleCount(d),o.resetOffset();var f=[];i.each((function(t){var e=i.getItemLayout(t),n=EU(i,t),r=OU(i,t),s=i.getItemVisual(t,"lineWidth")*u;null==r&&(r=1),(f=_V.parseColor(n,f))[3]*=r,a?o.addPolyline(e,f,s):o.addCubicCurve(e[0],e[1],e[2],e[3],f,s)})),o.dirty()},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}});function hZ(t,e){for(var n=[],i=0;i0;this._updateSurfaceMesh(this._surfaceMesh,t,h,f);var p=this._surfaceMesh.material;f?(p.define("WIREFRAME_QUAD"),p.set("wireframeLineWidth",d),p.set("wireframeLineColor",_V.parseColor(c.get("lineStyle.color")))):p.undefine("WIREFRAME_QUAD"),this._initHandler(t,n),this._updateAnimation(t)},_updateAnimation:function(t){_V.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevSurfaceMesh,this._surfaceMesh,t)},_createSurfaceMesh:function(){var t=new _V.Mesh({geometry:new _V.Geometry({dynamic:!0,sortTriangles:!0}),shadowDepthMaterial:new _V.Material({shader:new _V.Shader(_V.Shader.source("ecgl.sm.depth.vertex"),_V.Shader.source("ecgl.sm.depth.fragment"))}),culling:!1,renderOrder:10,renderNormal:!0});return t.geometry.createAttribute("barycentric","float",4),t.geometry.createAttribute("prevPosition","float",3),t.geometry.createAttribute("prevNormal","float",3),Object.assign(t.geometry,PU),t},_initHandler:function(t,e){var n=t.getData(),i=this._surfaceMesh,r=t.coordinateSystem;i.seriesIndex=t.seriesIndex;var o=-1;i.off("mousemove"),i.off("mouseout"),i.on("mousemove",(function(t){var a=function(t,e){for(var n=1/0,r=-1,o=[],a=0;a=0){var s=[];i.geometry.attributes.position.get(a,s);for(var l=r.pointToData(s),u=1/0,h=-1,c=[],d=0;d65535?Uint32Array:Uint16Array)((p-1)*(g-1)*6),b=function(t,e,n){n[1]=t*g+e,n[0]=t*g+e+1,n[3]=(t+1)*g+e+1,n[2]=(t+1)*g+e},T=!1;if(l){var S=[],M=[],C=0;m?h.init(r.vertexCount):h.value=null;for(var L=[[],[],[]],A=[],D=[],I=mZ.create(),P=function(t,e,n){var i=3*e;return n[0]=t[i],n[1]=t[i+1],n[2]=t[i+2],n},E=new Float32Array(a.length),O=new Float32Array(a.length/3*4),N=0;N0;){if(Math.floor(s/h)===s/h)return[h,s/h];h--}return[h=Math.floor(Math.sqrt(s)),h]},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}});function _Z(t,e){for(var n=[],i=0;i "+f)),h++)}var p=Lx(t,{coordDimensions:["value"]});(s=new Cx(p,n)).initData(t);var g=new Cx(["value"],n);return g.initData(u,l),r&&r(s,g),CZ({mainData:s,struct:o,structAttr:"graph",datas:{node:s,edge:g},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o}(i,n,this,!0,(function(t,n){t.wrapMethod("getItemModel",(function(t){const e=r._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t}));const i=e.getModel([]).getModel;function o(t,e){const n=i.call(this,t,e);return n.resolveParentPath=a,n}function a(t){if(t&&("label"===t[0]||"label"===t[1])){const e=t.slice();return"label"===t[0]?e[0]="edgeLabel":"label"===t[1]&&(e[1]="edgeLabel"),e}return t}n.wrapMethod("getItemModel",(function(t){return t.resolveParentPath=a,t.getModel=o,t}))})).data},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(t,e,n){if("edge"===n){var i=this.getData(),r=this.getDataParams(t,n),o=i.graph.getEdgeByIndex(t),a=i.getName(o.node1.dataIndex),s=i.getName(o.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),l=ze(l.join(" > ")),r.value&&(l+=" : "+ze(r.value)),l}return LZ.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var t=(this.option.categories||[]).map((function(t){return null!=t.value?t:Object.assign({value:0},t)})),e=new Cx(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray((function(t){return e.getItemModel(t,!0)}))},setView:function(t){null!=t.zoom&&(this.option.zoom=t.zoom),null!=t.offset&&(this.option.offset=t.offset)},setNodePosition:function(t){for(var e=0;e65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(t){this.triangleCount!==t&&(this.indices=0===t?null:this.vertexCount>65535?new Uint32Array(3*t):new Uint16Array(3*t))},_getCubicCurveApproxStep:function(t,e,n,i){return 1/(DZ.dist(t,e)+DZ.dist(n,e)+DZ.dist(i,n)+1)*this.segmentScale},getCubicCurveVertexCount:function(t,e,n,i){var r=this._getCubicCurveApproxStep(t,e,n,i),o=Math.ceil(1/r);return this.useNativeLine?2*o:2*o+2},getCubicCurveTriangleCount:function(t,e,n,i){var r=this._getCubicCurveApproxStep(t,e,n,i),o=Math.ceil(1/r);return this.useNativeLine?0:2*o},getLineVertexCount:function(){return this.getPolylineVertexCount(IZ)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(IZ)},getPolylineVertexCount:function(t){var e;"number"==typeof t?e=t:e="number"!=typeof t[0]?t.length:t.length/2;return this.useNativeLine?2*(e-1):2*(e-1)+2},getPolylineTriangleCount:function(t){var e;"number"==typeof t?e=t:e="number"!=typeof t[0]?t.length:t.length/2;return this.useNativeLine?0:2*(e-1)},addCubicCurve:function(t,e,n,i,r,o){null==o&&(o=1);var a=t[0],s=t[1],l=e[0],u=e[1],h=n[0],c=n[1],d=i[0],f=i[1],p=this._getCubicCurveApproxStep(t,e,n,i),g=p*p,m=g*p,v=3*p,_=3*g,y=6*g,x=6*m,w=a-2*l+h,b=s-2*u+c,T=3*(l-h)-a+d,S=3*(u-c)-s+f,M=a,C=s,L=(l-a)*v+w*_+T*m,A=(u-s)*v+b*_+S*m,D=w*y+T*x,I=b*y+S*x,P=T*x,E=S*x,O=0,N=0,R=Math.ceil(1/p),k=new Float32Array(3*(R+1)),z=(k=[],0);for(N=0;N1&&(M=L>0?Math.min(M,d):Math.max(M,d),C=A>0?Math.min(C,f):Math.max(C,f));this.addPolyline(k,r,o)},addLine:function(t,e,n,i){this.addPolyline([t,e],n,i)},addPolyline:function(){var t=DZ.create(),e=DZ.create(),n=DZ.create(),i=DZ.create(),r=[],o=[],a=[];return function(s,l,u,h,c){if(s.length){var d="number"!=typeof s[0];if(null==c&&(c=d?s.length:s.length/2),!(c<2)){null==h&&(h=0),null==u&&(u=1),this._itemVertexOffsets.push(this._vertexOffset);for(var f,p=d?"number"!=typeof l[0]:l.length/4===c,g=this.attributes.position,m=this.attributes.color,v=this.attributes.offset,_=this.attributes.normal,y=this.indices,x=this._vertexOffset,w=0;w1&&(g.copy(x,x-1),m.copy(x,x-1),x++);else{var S;if(w0){DZ.sub(t,r,a),DZ.sub(e,o,r),DZ.normalize(t,t),DZ.normalize(e,e),DZ.add(i,t,e),DZ.normalize(i,i);var M=u/2*Math.min(1/DZ.dot(t,i),2);n[0]=-i[1],n[1]=i[0],S=M}else DZ.sub(t,o,r),DZ.normalize(t,t),n[0]=-t[1],n[1]=t[0],S=u/2}else DZ.sub(t,r,a),DZ.normalize(t,t),n[0]=-t[1],n[1]=t[0],S=u/2;_.set(x,n),_.set(x+1,n),v.set(x,S),v.set(x+1,-S),DZ.copy(a,r),g.set(x,r),g.set(x+1,r),m.set(x,f),m.set(x+1,f),x+=2}if(this.useNativeLine)m.set(x,f),g.set(x,r),x++;else if(w>0){var C=3*this._faceOffset;(y=this.indices)[C]=x-4,y[C+1]=x-3,y[C+2]=x-2,y[C+3]=x-3,y[C+4]=x-1,y[C+5]=x-2,this._faceOffset+=2}}this._vertexOffset=x}}}}(),setItemColor:function(t,e){for(var n=this._itemVertexOffsets[t],i=t 0.0) {\n float factor = 0.0;\n if (preventOverlap) {\n float d = sqrt(d2);\n d = d - n0.w - n1.w;\n if (d > 0.0) {\n factor = scaling * n0.z * n1.z / (d * d);\n }\n else if (d < 0.0) {\n factor = scaling * 100.0 * n0.z * n1.z;\n }\n }\n else {\n factor = scaling * n0.z * n1.z / d2;\n }\n force += dir * factor;\n }\n }\n\n vec2 dir = gravityCenter - n0.xy;\n float d = 1.0;\n if (!strongGravityMode) {\n d = length(dir);\n }\n\n force += dir * n0.z * gravity / (d + 1.0);\n\n gl_FragColor = vec4(force, 0.0, 1.0);\n}\n@end\n\n@export ecgl.forceAtlas2.updateEdgeAttraction.vertex\n\nattribute vec2 node1;\nattribute vec2 node2;\nattribute float weight;\n\nuniform sampler2D positionTex;\nuniform float edgeWeightInfluence;\nuniform bool preventOverlap;\nuniform bool linLogMode;\n\nuniform vec2 windowSize: WINDOW_SIZE;\n\nvarying vec2 v_Force;\n\nvoid main() {\n\n vec4 n0 = texture2D(positionTex, node1);\n vec4 n1 = texture2D(positionTex, node2);\n\n vec2 dir = n1.xy - n0.xy;\n float d = length(dir);\n float w;\n if (edgeWeightInfluence == 0.0) {\n w = 1.0;\n }\n else if (edgeWeightInfluence == 1.0) {\n w = weight;\n }\n else {\n w = pow(weight, edgeWeightInfluence);\n }\n vec2 offset = vec2(1.0 / windowSize.x, 1.0 / windowSize.y);\n vec2 scale = vec2((windowSize.x - 1.0) / windowSize.x, (windowSize.y - 1.0) / windowSize.y);\n vec2 pos = node1 * scale * 2.0 - 1.0;\n gl_Position = vec4(pos + offset, 0.0, 1.0);\n gl_PointSize = 1.0;\n\n float factor;\n if (preventOverlap) {\n d = d - n1.w - n0.w;\n }\n if (d <= 0.0) {\n v_Force = vec2(0.0);\n return;\n }\n\n if (linLogMode) {\n factor = w * log(d) / d;\n }\n else {\n factor = w;\n }\n v_Force = dir * factor;\n}\n@end\n\n@export ecgl.forceAtlas2.updateEdgeAttraction.fragment\n\nvarying vec2 v_Force;\n\nvoid main() {\n gl_FragColor = vec4(v_Force, 0.0, 0.0);\n}\n@end\n\n@export ecgl.forceAtlas2.calcWeightedSum.vertex\n\nattribute vec2 node;\n\nvarying vec2 v_NodeUv;\n\nvoid main() {\n\n v_NodeUv = node;\n gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n gl_PointSize = 1.0;\n}\n@end\n\n@export ecgl.forceAtlas2.calcWeightedSum.fragment\n\nvarying vec2 v_NodeUv;\n\nuniform sampler2D positionTex;\nuniform sampler2D forceTex;\nuniform sampler2D forcePrevTex;\n\nvoid main() {\n vec2 force = texture2D(forceTex, v_NodeUv).rg;\n vec2 forcePrev = texture2D(forcePrevTex, v_NodeUv).rg;\n\n float mass = texture2D(positionTex, v_NodeUv).z;\n float swing = length(force - forcePrev) * mass;\n float traction = length(force + forcePrev) * 0.5 * mass;\n\n gl_FragColor = vec4(swing, traction, 0.0, 0.0);\n}\n@end\n\n@export ecgl.forceAtlas2.calcGlobalSpeed\n\nuniform sampler2D globalSpeedPrevTex;\nuniform sampler2D weightedSumTex;\nuniform float jitterTolerence;\n\nvoid main() {\n vec2 weightedSum = texture2D(weightedSumTex, vec2(0.5)).xy;\n float prevGlobalSpeed = texture2D(globalSpeedPrevTex, vec2(0.5)).x;\n float globalSpeed = jitterTolerence * jitterTolerence\n * weightedSum.y / weightedSum.x;\n if (prevGlobalSpeed > 0.0) {\n globalSpeed = min(globalSpeed / prevGlobalSpeed, 1.5) * prevGlobalSpeed;\n }\n gl_FragColor = vec4(globalSpeed, 0.0, 0.0, 1.0);\n}\n@end\n\n@export ecgl.forceAtlas2.updatePosition\n\nuniform sampler2D forceTex;\nuniform sampler2D forcePrevTex;\nuniform sampler2D positionTex;\nuniform sampler2D globalSpeedTex;\n\nvarying vec2 v_Texcoord;\n\nvoid main() {\n vec2 force = texture2D(forceTex, v_Texcoord).xy;\n vec2 forcePrev = texture2D(forcePrevTex, v_Texcoord).xy;\n vec4 node = texture2D(positionTex, v_Texcoord);\n\n float globalSpeed = texture2D(globalSpeedTex, vec2(0.5)).r;\n float swing = length(force - forcePrev);\n float speed = 0.1 * globalSpeed / (0.1 + globalSpeed * sqrt(swing));\n\n float df = length(force);\n if (df > 0.0) {\n speed = min(df * speed, 10.0) / df;\n\n gl_FragColor = vec4(node.xy + speed * force, node.zw);\n }\n else {\n gl_FragColor = node;\n }\n}\n@end\n\n@export ecgl.forceAtlas2.edges.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec2 node;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\nuniform sampler2D positionTex;\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(\n texture2D(positionTex, node).xy, -10.0, 1.0\n );\n v_Color = a_Color;\n}\n@end\n\n@export ecgl.forceAtlas2.edges.fragment\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nvarying vec4 v_Color;\nvoid main() {\n gl_FragColor = color * v_Color;\n}\n@end");var OZ={repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null};function NZ(t){var e={type:_V.Texture.FLOAT,minFilter:_V.Texture.NEAREST,magFilter:_V.Texture.NEAREST};this._positionSourceTex=new _V.Texture2D(e),this._positionSourceTex.flipY=!1,this._positionTex=new _V.Texture2D(e),this._positionPrevTex=new _V.Texture2D(e),this._forceTex=new _V.Texture2D(e),this._forcePrevTex=new _V.Texture2D(e),this._weightedSumTex=new _V.Texture2D(e),this._weightedSumTex.width=this._weightedSumTex.height=1,this._globalSpeedTex=new _V.Texture2D(e),this._globalSpeedPrevTex=new _V.Texture2D(e),this._globalSpeedTex.width=this._globalSpeedTex.height=1,this._globalSpeedPrevTex.width=this._globalSpeedPrevTex.height=1,this._nodeRepulsionPass=new aB({fragment:_V.Shader.source("ecgl.forceAtlas2.updateNodeRepulsion")}),this._positionPass=new aB({fragment:_V.Shader.source("ecgl.forceAtlas2.updatePosition")}),this._globalSpeedPass=new aB({fragment:_V.Shader.source("ecgl.forceAtlas2.calcGlobalSpeed")}),this._copyPass=new aB({fragment:_V.Shader.source("clay.compositor.output")});var n=function(t){t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE)};this._edgeForceMesh=new _V.Mesh({geometry:new _V.Geometry({attributes:{node1:new _V.Geometry.Attribute("node1","float",2),node2:new _V.Geometry.Attribute("node2","float",2),weight:new _V.Geometry.Attribute("weight","float",1)},dynamic:!0,mainAttribute:"node1"}),material:new _V.Material({transparent:!0,shader:_V.createShader("ecgl.forceAtlas2.updateEdgeAttraction"),blend:n,depthMask:!1,depthText:!1}),mode:_V.Mesh.POINTS}),this._weightedSumMesh=new _V.Mesh({geometry:new _V.Geometry({attributes:{node:new _V.Geometry.Attribute("node","float",2)},dynamic:!0,mainAttribute:"node"}),material:new _V.Material({transparent:!0,shader:_V.createShader("ecgl.forceAtlas2.calcWeightedSum"),blend:n,depthMask:!1,depthText:!1}),mode:_V.Mesh.POINTS}),this._framebuffer=new Sz({depthBuffer:!1}),this._dummyCamera=new _V.OrthographicCamera({left:-1,right:1,top:1,bottom:-1,near:0,far:100}),this._globalSpeed=0}NZ.prototype.updateOption=function(t){for(var e in OZ)this[e]=OZ[e];var n=this._nodes.length;if(this.jitterTolerence=n>5e4?10:n>5e3?1:.1,this.scaling=n>100?2:10,t)for(var e in OZ)null!=t[e]&&(this[e]=t[e]);if(this.repulsionByDegree)for(var i=this._positionSourceTex.pixels,r=0;rt},NZ.prototype._swapTexture=function(){var t=this._positionPrevTex;this._positionPrevTex=this._positionTex,this._positionTex=t;t=this._forcePrevTex;this._forcePrevTex=this._forceTex,this._forceTex=t;t=this._globalSpeedPrevTex;this._globalSpeedPrevTex=this._globalSpeedTex,this._globalSpeedTex=t},NZ.prototype._initFromSource=function(t){this._framebuffer.attach(this._positionPrevTex),this._framebuffer.bind(t),this._copyPass.setUniform("texture",this._positionSourceTex),this._copyPass.render(t),t.gl.clearColor(0,0,0,0),this._framebuffer.attach(this._forcePrevTex),t.gl.clear(t.gl.COLOR_BUFFER_BIT),this._framebuffer.attach(this._globalSpeedPrevTex),t.gl.clear(t.gl.COLOR_BUFFER_BIT),this._framebuffer.unbind(t)},NZ.prototype._resize=function(t,e){["_positionSourceTex","_positionTex","_positionPrevTex","_forceTex","_forcePrevTex"].forEach((function(n){this[n].width=t,this[n].height=e,this[n].dirty()}),this)},NZ.prototype.dispose=function(t){this._framebuffer.dispose(t),this._copyPass.dispose(t),this._nodeRepulsionPass.dispose(t),this._positionPass.dispose(t),this._globalSpeedPass.dispose(t),this._edgeForceMesh.geometry.dispose(t),this._weightedSumMesh.geometry.dispose(t),this._positionSourceTex.dispose(t),this._positionTex.dispose(t),this._positionPrevTex.dispose(t),this._forceTex.dispose(t),this._forcePrevTex.dispose(t),this._weightedSumTex.dispose(t),this._globalSpeedTex.dispose(t),this._globalSpeedPrevTex.dispose(t)};const RZ=NZ;const kZ=function(){var t=function(){return new Float32Array(2)},e=function(t,e){var n=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(n*n+i*i)},n=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)},i=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t},r=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},o=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t},a=function(t,e){return t[0]=e[0],t[1]=e[1],t},s=function(t,e,n){return t[0]=e,t[1]=n,t};function l(){this.subRegions=[],this.nSubRegions=0,this.node=null,this.mass=0,this.centerOfMass=null,this.bbox=new Float32Array(4),this.size=0}var u=l.prototype;function h(){this.position=new Float32Array(2),this.force=t(),this.forcePrev=t(),this.mass=1,this.inDegree=0,this.outDegree=0}function c(t,e){this.source=t,this.target=e,this.weight=1}function d(){this.autoSettings=!0,this.barnesHutOptimize=!0,this.barnesHutTheta=1.5,this.repulsionByDegree=!0,this.linLogMode=!1,this.strongGravityMode=!1,this.gravity=1,this.scaling=1,this.edgeWeightInfluence=1,this.jitterTolerence=.1,this.preventOverlap=!1,this.dissuadeHubs=!1,this.rootRegion=new l,this.rootRegion.centerOfMass=t(),this.nodes=[],this.edges=[],this.bbox=new Float32Array(4),this.gravityCenter=null,this._massArr=null,this._swingingArr=null,this._sizeArr=null,this._globalSpeed=0}u.beforeUpdate=function(){for(var t=0;t=t&&this.bbox[1]<=e&&this.bbox[3]>=e},u.setBBox=function(t,e,n,i){this.bbox[0]=t,this.bbox[1]=e,this.bbox[2]=n,this.bbox[3]=i,this.size=(n-t+i-e)/2},u._newSubRegion=function(){var t=this.subRegions[this.nSubRegions];return t||(t=new l,this.subRegions[this.nSubRegions]=t),this.nSubRegions++,t},u._addNodeToSubRegion=function(t){var e=this.findSubRegion(t.position[0],t.position[1]),n=this.bbox;if(!e){var i=(n[0]+n[2])/2,r=(n[1]+n[3])/2,o=(n[2]-n[0])/2,a=(n[3]-n[1])/2,s=t.position[0]>=i?1:0,l=t.position[1]>=r?1:0;(e=this._newSubRegion()).setBBox(s*o+n[0],l*a+n[1],(s+1)*o+n[0],(l+1)*a+n[1])}e.addNode(t)},u._updateCenterOfMass=function(t){null==this.centerOfMass&&(this.centerOfMass=new Float32Array(2));var e=this.centerOfMass[0]*this.mass,n=this.centerOfMass[1]*this.mass;e+=t.position[0]*t.mass,n+=t.position[1]*t.mass,this.mass+=t.mass,this.centerOfMass[0]=e/this.mass,this.centerOfMass[1]=n/this.mass};var f=d.prototype;f.initNodes=function(t,e,n){var i=e.length;this.nodes.length=0;for(var r=void 0!==n,o=0;o0&&(this.strongGravityMode?this.applyNodeStrongGravity(h):this.applyNodeGravity(h))}for(l=0;l0&&(m=Math.min(m/this._globalSpeed,1.5)*this._globalSpeed),this._globalSpeed=m;for(l=0;l0&&(_=Math.min(y*_,10)/y,i(u.position,u.position,u.force,_))}},f.applyRegionToNodeRepulsion=function(){var e=t();return function(t,n){if(t.node)this.applyNodeToNodeRepulsion(t.node,n,!0);else{o(e,n.position,t.centerOfMass);var r=e[0]*e[0]+e[1]*e[1];if(r>this.barnesHutTheta*t.size*t.size){var a=this.scaling*n.mass*t.mass/r;i(n.force,n.force,e,a)}else for(var s=0;s0)s=this.scaling*t.mass*n.mass/(l*l);else{if(!(l<0))return;s=100*this.scaling*t.mass*n.mass}}else s=this.scaling*t.mass*n.mass/a;i(t.force,t.force,e,s),i(n.force,n.force,e,-s)}}}}(),f.applyEdgeAttraction=function(){var e=t();return function(t){var r=t.source,a=t.target;o(e,r.position,a.position);var s,l,u=n(e);s=0===this.edgeWeightInfluence?1:1===this.edgeWeightInfluence?t.weight:Math.pow(t.weight,this.edgeWeightInfluence),this.preventOverlap&&(u=u-r.size-a.size)<=0||(l=this.linLogMode?-s*Math.log(u+1)/(u+1):-s,i(r.force,r.force,e,l),i(a.force,a.force,e,-l))}}(),f.applyNodeGravity=function(){var e=t();return function(t){o(e,this.gravityCenter,t.position);var r=n(e);i(t.force,t.force,e,this.gravity*t.mass/(r+1))}}(),f.applyNodeStrongGravity=function(){var e=t();return function(t){o(e,this.gravityCenter,t.position),i(t.force,t.force,e,this.gravity*t.mass)}}(),f.updateBBox=function(){for(var t=1/0,e=1/0,n=-1/0,i=-1/0,r=0;r5e4?10:o>5e3?1:.1,e.scaling=o>100?2:10,e.barnesHutOptimize=o>1e3,t)for(var n in BZ)null!=t[n]&&(e[n]=t[n]);if(!e.gravityCenter){for(var a=[1/0,1/0],s=[-1/0,-1/0],l=0;lt},FZ.prototype.getNodePosition=function(t,e){if(e||(e=new Float32Array(2*this._nodes.length)),this._positionArr)for(var n=0;n0?1.1:.9,o=Math.max(Math.min(this._zoom*r,this.maxZoom),this.minZoom);r=o/this._zoom;var a=this._convertPos(n,i),s=(a.x-this._dx)*(r-1),l=(a.y-this._dy)*(r-1);this._dx-=s,this._dy-=l,this._zoom=o,this._needsUpdate=!0}}},dispose:function(){var t=this.zr;t.off("mousedown",this._mouseDownHandler),t.off("mousemove",this._mouseMoveHandler),t.off("mouseup",this._mouseUpHandler),t.off("mousewheel",this._mouseWheelHandler),t.off("globalout",this._mouseUpHandler),t.animation.off("frame",this._update)}});const HZ=GZ;var UZ=UV.vec2;_V.Shader.import("@export ecgl.lines2D.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec2 position: POSITION;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\n#ifdef POSITIONTEXTURE_ENABLED\nuniform sampler2D positionTexture;\n#endif\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);\n\n v_Color = a_Color;\n}\n\n@end\n\n@export ecgl.lines2D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\nvoid main()\n{\n gl_FragColor = color * v_Color;\n}\n@end\n\n\n@export ecgl.meshLines2D.vertex\n\nattribute vec2 position: POSITION;\nattribute vec2 normal;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\n\nvarying vec4 v_Color;\nvarying float v_Miter;\n\nvoid main()\n{\n vec4 p2 = worldViewProjection * vec4(position + normal, -10.0, 1.0);\n gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);\n\n p2.xy /= p2.w;\n gl_Position.xy /= gl_Position.w;\n\n vec2 N = normalize(p2.xy - gl_Position.xy);\n gl_Position.xy += N * offset / viewport.zw * 2.0;\n\n gl_Position.xy *= gl_Position.w;\n\n v_Color = a_Color;\n}\n@end\n\n\n@export ecgl.meshLines2D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\nvarying float v_Miter;\n\nvoid main()\n{\n gl_FragColor = color * v_Color;\n}\n\n@end");var WZ=1;const jZ=Fm.extend({type:"graphGL",__ecgl__:!0,init:function(t,e){this.groupGL=new _V.Node,this.viewGL=new NH("orthographic"),this.viewGL.camera.left=this.viewGL.camera.right=0,this.viewGL.add(this.groupGL),this._pointsBuilder=new Vj(!0,e),this._forceEdgesMesh=new _V.Mesh({material:new _V.Material({shader:_V.createShader("ecgl.forceAtlas2.edges"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new _V.Geometry({attributes:{node:new _V.Geometry.Attribute("node","float",2),color:new _V.Geometry.Attribute("color","float",4,"COLOR")},dynamic:!0,mainAttribute:"node"}),renderOrder:-1,mode:_V.Mesh.LINES}),this._edgesMesh=new _V.Mesh({material:new _V.Material({shader:_V.createShader("ecgl.meshLines2D"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new EZ({useNativeLine:!1,dynamic:!0}),renderOrder:-1,culling:!1}),this._layoutId=0,this._control=new HZ({zr:e.getZr(),viewGL:this.viewGL}),this._control.setTarget(this.groupGL),this._control.init(),this._clickHandler=this._clickHandler.bind(this)},render:function(t,e,n){this.groupGL.add(this._pointsBuilder.rootNode),this._model=t,this._api=n,this._initLayout(t,e,n),this._pointsBuilder.update(t,e,n),this._forceLayoutInstance instanceof RZ||this.groupGL.remove(this._forceEdgesMesh),this._updateCamera(t,n),this._control.off("update"),this._control.on("update",(function(){n.dispatchAction({type:"graphGLRoam",seriesId:t.id,zoom:this._control.getZoom(),offset:this._control.getOffset()}),this._pointsBuilder.updateView(this.viewGL.camera)}),this),this._control.setZoom(xB.firstNotNull(t.get("zoom"),1)),this._control.setOffset(t.get("offset")||[0,0]);var i=this._pointsBuilder.getPointsMesh();if(i.off("mousemove",this._mousemoveHandler),i.off("mouseout",this._mouseOutHandler,this),n.getZr().off("click",this._clickHandler),this._pointsBuilder.highlightOnMouseover=!0,t.get("focusNodeAdjacency")){var r=t.get("focusNodeAdjacencyOn");"click"===r?n.getZr().on("click",this._clickHandler):"mouseover"===r&&(i.on("mousemove",this._mousemoveHandler,this),i.on("mouseout",this._mouseOutHandler,this),this._pointsBuilder.highlightOnMouseover=!1)}this._lastMouseOverDataIndex=-1},_clickHandler:function(t){if(!this._layouting){var e=this._pointsBuilder.getPointsMesh().dataIndex;e>=0?this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:e}):this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id})}},_mousemoveHandler:function(t){if(!this._layouting){var e=this._pointsBuilder.getPointsMesh().dataIndex;e>=0?e!==this._lastMouseOverDataIndex&&this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:e}):this._mouseOutHandler(t),this._lastMouseOverDataIndex=e}},_mouseOutHandler:function(t){this._layouting||(this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id}),this._lastMouseOverDataIndex=-1)},_updateForceEdgesGeometry:function(t,e){var n=this._forceEdgesMesh.geometry,i=e.getEdgeData(),r=0,o=this._forceLayoutInstance,a=2*i.count();n.attributes.node.init(a),n.attributes.color.init(a),i.each((function(e){var a=t[e];n.attributes.node.set(r,o.getNodeUV(a.node1)),n.attributes.node.set(r+1,o.getNodeUV(a.node2));var s=EU(i,a.dataIndex),l=_V.parseColor(s);l[3]*=xB.firstNotNull(OU(i,a.dataIndex),1),n.attributes.color.set(r,l),n.attributes.color.set(r+1,l),r+=2})),n.dirty()},_updateMeshLinesGeometry:function(){var t=this._model.getEdgeData(),e=this._edgesMesh.geometry,n=(t=this._model.getEdgeData(),this._model.getData().getLayout("points"));e.resetOffset(),e.setVertexCount(t.count()*e.getLineVertexCount()),e.setTriangleCount(t.count()*e.getLineTriangleCount());var i=[],r=[],o=["lineStyle","width"];this._originalEdgeColors=new Float32Array(4*t.count()),this._edgeIndicesMap=new Float32Array(t.count()),t.each((function(a){var s=t.graph.getEdgeByIndex(a),l=2*s.node1.dataIndex,u=2*s.node2.dataIndex;i[0]=n[l],i[1]=n[l+1],r[0]=n[u],r[1]=n[u+1];var h=EU(t,s.dataIndex),c=_V.parseColor(h);c[3]*=xB.firstNotNull(OU(t,s.dataIndex),1);var d=t.getItemModel(s.dataIndex),f=xB.firstNotNull(d.get(o),1)*this._api.getDevicePixelRatio();e.addLine(i,r,c,f);for(var p=0;p<4;p++)this._originalEdgeColors[4*s.dataIndex+p]=c[p];this._edgeIndicesMap[s.dataIndex]=a}),this),e.dirty()},_updateForceNodesGeometry:function(t){for(var e=this._pointsBuilder.getPointsMesh(),n=[],i=0;i=f&&(l._syncNodePosition(t),d=0),n.getZr().refresh(),yV((function(){p(e)}))}))};yV((function(){l._forceLayoutInstanceToDispose&&(l._forceLayoutInstanceToDispose.dispose(r.layer.renderer),l._forceLayoutInstanceToDispose=null),p(u)})),this._layouting=!0}}},stopLayout:function(t,e,n,i){i&&null!=i.from&&i.from!==this.uid||(this._layoutId=0,this.groupGL.remove(this._forceEdgesMesh),this.groupGL.add(this._edgesMesh),this._forceLayoutInstance&&this.viewGL.layer&&(i&&i.beforeLayout||(this._syncNodePosition(t),this._updateAfterLayout(t,e,n)),this._api.getZr().refresh(),this._layouting=!1))},_syncNodePosition:function(t){var e=this._forceLayoutInstance.getNodePosition(this.viewGL.layer.renderer);t.getData().setLayout("points",e),t.setNodePosition(e)},_updateAfterLayout:function(t,e,n){this._updateMeshLinesGeometry(),this._pointsBuilder.removePositionTexture(),this._pointsBuilder.updateLayout(t,e,n),this._pointsBuilder.updateView(this.viewGL.camera),this._pointsBuilder.updateLabels(),this._pointsBuilder.showLabels()},focusNodeAdjacency:function(t,e,n,i){var r=this._model.getData();this._downplayAll();var o=i.dataIndex,a=r.graph,s=[],l=a.getNodeByIndex(o);s.push(l),l.edges.forEach((function(t){t.dataIndex<0||(t.node1!==l&&s.push(t.node1),t.node2!==l&&s.push(t.node2))}),this),this._pointsBuilder.fadeOutAll(.05),this._fadeOutEdgesAll(.05),s.forEach((function(t){this._pointsBuilder.highlight(r,t.dataIndex)}),this),this._pointsBuilder.updateLabels(s.map((function(t){return t.dataIndex})));var u=[];l.edges.forEach((function(t){t.dataIndex>=0&&(this._highlightEdge(t.dataIndex),u.push(t))}),this),this._focusNodes=s,this._focusEdges=u},unfocusNodeAdjacency:function(t,e,n,i){this._downplayAll(),this._pointsBuilder.fadeInAll(),this._fadeInEdgesAll(),this._pointsBuilder.updateLabels()},_highlightEdge:function(t){var e=this._model.getEdgeData().getItemModel(t),n=_V.parseColor(e.get("emphasis.lineStyle.color")||e.get("lineStyle.color")),i=xB.firstNotNull(e.get("emphasis.lineStyle.opacity"),e.get("lineStyle.opacity"),1);n[3]*=i,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[t],n)},_downplayAll:function(){this._focusNodes&&this._focusNodes.forEach((function(t){this._pointsBuilder.downplay(this._model.getData(),t.dataIndex)}),this),this._focusEdges&&this._focusEdges.forEach((function(t){this._downplayEdge(t.dataIndex)}),this)},_downplayEdge:function(t){var e=this._getColor(t,[]);this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[t],e)},_setEdgeFade:function(){var t=[];return function(e,n){this._getColor(e,t),t[3]*=n,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e],t)}}(),_getColor:function(t,e){for(var n=0;n<4;n++)e[n]=this._originalEdgeColors[4*t+n];return e},_fadeOutEdgesAll:function(t){this._model.getData().graph.eachEdge((function(e){this._setEdgeFade(e.dataIndex,t)}),this)},_fadeInEdgesAll:function(){this._fadeOutEdgesAll(1)},_updateCamera:function(t,e){this.viewGL.setViewport(0,0,e.getWidth(),e.getHeight(),e.getDevicePixelRatio());for(var n=this.viewGL.camera,i=t.getData().getLayout("points"),r=UZ.create(1/0,1/0),o=UZ.create(-1/0,-1/0),a=[],s=0;sn.left&&un.top)){var h=Math.max(o[0]-r[0],10),c=h/e.getWidth()*e.getHeight();h*=1.4,c*=1.4,r[0]-=.2*h,n.left=r[0],n.top=l-c/2,n.bottom=l+c/2,n.right=h+r[0],n.near=0,n.far=100}},dispose:function(){var t=this.viewGL.layer.renderer;this._forceLayoutInstance&&this._forceLayoutInstance.dispose(t),this.groupGL.removeAll(),this._layoutId=-1,this._pointsBuilder.dispose()},remove:function(){this.groupGL.removeAll(),this._control.dispose()}});function ZZ(t){return t instanceof Array||(t=[t,t]),t}Jw((function(t){function e(){}t.registerChartView(jZ),t.registerSeriesModel(AZ),t.registerVisual((function(t){const e={};t.eachSeriesByType("graphGL",(function(t){var n=t.getCategoriesData(),i=t.getData(),r={};n.each((function(i){var o=n.getName(i);r["ec-"+o]=i;var a=n.getItemModel(i),s=a.getModel("itemStyle").getItemStyle();s.fill||(s.fill=t.getColorFromPalette(o,e)),n.setItemVisual(i,"style",s);var l=["symbol","symbolSize","symbolKeepAspect"];for(let t=0;t65535?new Uint32Array(3*i):new Uint16Array(3*i))},addLine:function(t){var e=this._vertexOffset;this.attributes.position.set(e,[t[0],t[1],1]),this.attributes.position.set(e+1,[t[0],t[1],-1]),this.attributes.position.set(e+2,[t[0],t[1],2]),this.attributes.position.set(e+3,[t[0],t[1],-2]),this.setTriangleIndices(this._faceOffset++,[e,e+1,e+2]),this.setTriangleIndices(this._faceOffset++,[e+1,e+2,e+3]),this._vertexOffset+=4}});LN.import("@export ecgl.vfParticle.particle.fragment\n\nuniform sampler2D particleTexture;\nuniform sampler2D spawnTexture;\nuniform sampler2D velocityTexture;\n\nuniform float deltaTime;\nuniform float elapsedTime;\n\nuniform float speedScaling : 1.0;\n\nuniform vec2 textureSize;\nuniform vec4 region : [0, 0, 1, 1];\nuniform float firstFrameTime;\n\nvarying vec2 v_Texcoord;\n\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, v_Texcoord);\n bool spawn = false;\n if (p.w <= 0.0) {\n p = texture2D(spawnTexture, fract(v_Texcoord + elapsedTime / 10.0));\n p.w -= firstFrameTime;\n spawn = true;\n }\n vec2 v = texture2D(velocityTexture, fract(p.xy * region.zw + region.xy)).xy;\n v = (v - 0.5) * 2.0;\n p.z = length(v);\n p.xy += v * deltaTime / 10.0 * speedScaling;\n p.w -= deltaTime;\n\n if (spawn || p.xy != fract(p.xy)) {\n p.z = 0.0;\n }\n p.xy = fract(p.xy);\n\n gl_FragColor = p;\n}\n@end\n\n@export ecgl.vfParticle.renderPoints.vertex\n\n#define PI 3.1415926\n\nattribute vec2 texcoord : TEXCOORD_0;\n\nuniform sampler2D particleTexture;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nuniform float size : 1.0;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, texcoord);\n\n if (p.w > 0.0 && p.z > 1e-5) {\n gl_Position = worldViewProjection * vec4(p.xy * 2.0 - 1.0, 0.0, 1.0);\n }\n else {\n gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);\n }\n\n v_Mag = p.z;\n v_Uv = p.xy;\n\n gl_PointSize = size;\n}\n\n@end\n\n@export ecgl.vfParticle.renderPoints.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform sampler2D gradientTexture;\nuniform sampler2D colorTexture;\nuniform sampler2D spriteTexture;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n gl_FragColor = color;\n#ifdef SPRITETEXTURE_ENABLED\n gl_FragColor *= texture2D(spriteTexture, gl_PointCoord);\n if (color.a == 0.0) {\n discard;\n }\n#endif\n#ifdef GRADIENTTEXTURE_ENABLED\n gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));\n#endif\n#ifdef COLORTEXTURE_ENABLED\n gl_FragColor *= texture2D(colorTexture, v_Uv);\n#endif\n}\n\n@end\n\n@export ecgl.vfParticle.renderLines.vertex\n\n#define PI 3.1415926\n\nattribute vec3 position : POSITION;\n\nuniform sampler2D particleTexture;\nuniform sampler2D prevParticleTexture;\n\nuniform float size : 1.0;\nuniform vec4 vp: VIEWPORT;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\n@import clay.util.rand\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, position.xy);\n vec4 p2 = texture2D(prevParticleTexture, position.xy);\n\n p.xy = p.xy * 2.0 - 1.0;\n p2.xy = p2.xy * 2.0 - 1.0;\n\n if (p.w > 0.0 && p.z > 1e-5) {\n vec2 dir = normalize(p.xy - p2.xy);\n vec2 norm = vec2(dir.y / vp.z, -dir.x / vp.w) * sign(position.z) * size;\n if (abs(position.z) == 2.0) {\n gl_Position = vec4(p.xy + norm, 0.0, 1.0);\n v_Uv = p.xy;\n v_Mag = p.z;\n }\n else {\n gl_Position = vec4(p2.xy + norm, 0.0, 1.0);\n v_Mag = p2.z;\n v_Uv = p2.xy;\n }\n gl_Position = worldViewProjection * gl_Position;\n }\n else {\n gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);\n }\n}\n\n@end\n\n@export ecgl.vfParticle.renderLines.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform sampler2D gradientTexture;\nuniform sampler2D colorTexture;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n gl_FragColor = color;\n #ifdef GRADIENTTEXTURE_ENABLED\n gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));\n#endif\n#ifdef COLORTEXTURE_ENABLED\n gl_FragColor *= texture2D(colorTexture, v_Uv);\n#endif\n}\n\n@end\n");var YZ=function(){this.motionBlurFactor=.99,this.vectorFieldTexture=new sk({type:QR.FLOAT,flipY:!1}),this.particleLife=[5,20],this._particleType="point",this._particleSize=1,this.particleColor=[1,1,1,1],this.particleSpeedScaling=1,this._thisFrameTexture=null,this._particlePass=null,this._spawnTexture=null,this._particleTexture0=null,this._particleTexture1=null,this._particlePointsMesh=null,this._surfaceFrameBuffer=null,this._elapsedTime=0,this._scene=null,this._camera=null,this._lastFrameTexture=null,this._supersampling=1,this._downsampleTextures=[],this._width=512,this._height=512,this.init()};YZ.prototype={constructor:YZ,init:function(){var t={type:QR.FLOAT,minFilter:QR.NEAREST,magFilter:QR.NEAREST,useMipmap:!1};this._spawnTexture=new sk(t),this._particleTexture0=new sk(t),this._particleTexture1=new sk(t),this._frameBuffer=new Sz({depthBuffer:!1}),this._particlePass=new aB({fragment:LN.source("ecgl.vfParticle.particle.fragment")}),this._particlePass.setUniform("velocityTexture",this.vectorFieldTexture),this._particlePass.setUniform("spawnTexture",this._spawnTexture),this._downsamplePass=new aB({fragment:LN.source("clay.compositor.downsample")});var e=new ek({renderOrder:10,material:new HO({shader:new LN(LN.source("ecgl.vfParticle.renderPoints.vertex"),LN.source("ecgl.vfParticle.renderPoints.fragment"))}),mode:ek.POINTS,geometry:new xk({dynamic:!0,mainAttribute:"texcoord0"})}),n=new ek({renderOrder:10,material:new HO({shader:new LN(LN.source("ecgl.vfParticle.renderLines.vertex"),LN.source("ecgl.vfParticle.renderLines.fragment"))}),geometry:new qZ,culling:!1}),i=new ek({material:new HO({shader:new LN(LN.source("ecgl.color.vertex"),LN.source("ecgl.color.fragment"))}),geometry:new Dz});i.material.enableTexture("diffuseMap"),this._particlePointsMesh=e,this._particleLinesMesh=n,this._lastFrameFullQuadMesh=i,this._camera=new nB,this._thisFrameTexture=new sk,this._lastFrameTexture=new sk},setParticleDensity:function(t,e){for(var n=new Float32Array(4*(t*e)),i=0,r=this.particleLife,o=0;o0?t[t.length-1]:this._lastFrameTexture},setRegion:function(t){this._particlePass.setUniform("region",t)},resize:function(t,e){this._lastFrameTexture.width=t*this._supersampling,this._lastFrameTexture.height=e*this._supersampling,this._thisFrameTexture.width=t*this._supersampling,this._thisFrameTexture.height=e*this._supersampling,this._width=t,this._height=e},setParticleSize:function(t){var e=this._getParticleMesh();if(t<=2)return e.material.disableTexture("spriteTexture"),void(e.material.transparent=!1);this._spriteTexture||(this._spriteTexture=new sk),this._spriteTexture.image&&this._spriteTexture.image.width===t||(this._spriteTexture.image=function(t){var e=document.createElement("canvas");e.width=e.height=t;var n=e.getContext("2d");return n.fillStyle="#fff",n.arc(t/2,t/2,t/2,0,2*Math.PI),n.fill(),e}(t),this._spriteTexture.dirty()),e.material.transparent=!0,e.material.enableTexture("spriteTexture"),e.material.set("spriteTexture",this._spriteTexture),this._particleSize=t},setGradientTexture:function(t){var e=this._getParticleMesh().material;e[t?"enableTexture":"disableTexture"]("gradientTexture"),e.setUniform("gradientTexture",t)},setColorTextureImage:function(t,e){this._getParticleMesh().material.setTextureImage("colorTexture",t,e,{flipY:!0})},setParticleType:function(t){this._particleType=t},clearFrame:function(t){var e=this._frameBuffer;e.attach(this._lastFrameTexture),e.bind(t),t.gl.clear(t.gl.DEPTH_BUFFER_BIT|t.gl.COLOR_BUFFER_BIT),e.unbind(t)},setSupersampling:function(t){this._supersampling=t,this.resize(this._width,this._height)},_updateDownsampleTextures:function(t,e){for(var n=this._downsampleTextures,i=Math.max(Math.floor(Math.log(this._supersampling/e.getDevicePixelRatio())/Math.log(2)),0),r=2,o=this._width*this._supersampling,a=this._height*this._supersampling,s=0;s=359&&(r[0]>0&&(r[0]=0),o[0]1?(e.material.shader!==this._meshLinesShader&&e.material.attachShader(this._meshLinesShader),e.mode=_V.Mesh.TRIANGLES):(e.material.shader!==this._nativeLinesShader&&e.material.attachShader(this._nativeLinesShader),e.mode=_V.Mesh.LINES),n=n||0,i=i||r.count(),s.resetOffset();var h=0,c=0,d=[],f=[],p=[],g=[],m=[],v=.3,_=.7;function y(){f[0]=d[0]*_+g[0]*v-(d[1]-g[1])*o,f[1]=d[1]*_+g[1]*v-(g[0]-d[0])*o,p[0]=d[0]*v+g[0]*_-(d[1]-g[1])*o,p[1]=d[1]*v+g[1]*_-(g[0]-d[0])*o}if(a||0!==o)for(var x=n;x{let o="right";return r.viewSize[0]-t[0]"graph"===t.componentSubType?"edge"===t.dataType?e.utils.getLinkTooltipInfo(t.data):e.utils.getNodeTooltipInfo(t.data):"graphGL"===t.componentSubType?e.utils.getNodeTooltipInfo(t.data):"lines"===t.componentSubType?e.utils.getLinkTooltipInfo(t.data.link):e.utils.getNodeTooltipInfo(t.data.node)}},n.echartsOption);return i.setOption(e.utils.deepMergeObj(r,t)),i.on("click",(t=>{const i=n.onClickElement.bind(e);return e.utils.addActionToUrl(e,t),"graph"===t.componentSubType?i("edge"===t.dataType?"link":"node",t.data):"graphGL"===t.componentSubType?i("node",t.data):"lines"===t.componentSubType?i("link",t.data.link):!t.data.cluster&&i("node",t.data.node)}),{passive:!0}),i}generateGraphOption(t,e){const n=[],i=e.config,r=t.nodes.map((t=>{const n=e.utils.fastDeepCopy(t),{nodeStyleConfig:r,nodeSizeConfig:o,nodeEmphasisConfig:a}=e.utils.getNodeStyle(t,i,"graph");n.itemStyle=r,n.symbolSize=o,n.emphasis={itemStyle:a.nodeStyle,symbolSize:a.nodeSize};let s="";return"string"==typeof t.label?s=t.label:"string"==typeof t.name?s=t.name:void 0!==t.id&&null!==t.id&&(s=String(t.id)),n.name=s,n._source=e.utils.fastDeepCopy(t),n})),o=t.links.map((t=>{const n=e.utils.fastDeepCopy(t),{linkStyleConfig:r,linkEmphasisConfig:o}=e.utils.getLinkStyle(t,i,"graph");return n.lineStyle=r,n.emphasis={lineStyle:o.linkStyle},n})),a={...i.graphConfig.series},s={...a.label||{}};if("number"==typeof e.config.showGraphLabelsAtZoom&&e.config.showGraphLabelsAtZoom>0){const t=e.config.showGraphLabelsAtZoom;s.formatter=n=>(()=>{try{const t=e.echarts.getOption(),n=(Array.isArray(t.series)?t.series:[]).find((t=>t&&"network-graph"===t.id));return n&&"number"==typeof n.zoom?n.zoom:1}catch(t){return 1}})()>=t&&n&&n.data&&n.data.name||""}a.label=s;const l=[{...a,id:"network-graph",type:"graphGL"===i.graphConfig.series.type?"graphGL":"graph",layout:"graphGL"===i.graphConfig.series.type?"forceAtlas2":i.graphConfig.series.layout,nodes:r,links:o}];return{legend:n.length?{data:n}:void 0,series:l,...i.graphConfig.baseOptions}}generateMapOption(t,e,n=[]){const i=e.config,{nodes:r,links:o}=t,a=t.flatNodes||{},s=[];let l=[];r.forEach((n=>{if(n.properties&&(t.flatNodes||(a[n.id]=e.utils.fastDeepCopy(n))),!n.properties||!n.properties._featureType||"Point"===n.properties._featureType)if(n.properties){const{location:t}=n.properties;if(t&&t.lng&&t.lat){const{nodeEmphasisConfig:r}=e.utils.getNodeStyle(n,i,"map");let o="";"string"==typeof n.label?o=n.label:"string"==typeof n.name?o=n.name:void 0!==n.id&&null!==n.id&&(o=String(n.id)),l.push({name:o,value:[t.lng,t.lat],emphasis:{itemStyle:r.nodeStyle,symbolSize:r.nodeSize},node:n,_source:e.utils.fastDeepCopy(n)})}else console.error(`Node ${n.id} position is undefined!`)}else console.error(`Node ${n.id} position is undefined!`)})),o.forEach((t=>{if(a[t.source])if(a[t.target]){const{linkStyleConfig:n,linkEmphasisConfig:r}=e.utils.getLinkStyle(t,i,"map");s.push({coords:[[a[t.source].properties.location.lng,a[t.source].properties.location.lat],[a[t.target].properties.location.lng,a[t.target].properties.location.lat]],lineStyle:n,emphasis:{lineStyle:r.linkStyle},link:t})}else console.warn(`Node ${t.target} does not exist!`);else console.warn(`Node ${t.source} does not exist!`)})),l=l.concat(n);const u=[{id:"geo-map",type:"effectScatter"===i.mapOptions.nodeConfig.type?"effectScatter":"scatter",name:"nodes",coordinateSystem:"leaflet",data:l,animationDuration:1e3,label:i.mapOptions.nodeConfig.label,itemStyle:{color:t=>{if(t.data&&t.data.cluster&&t.data.itemStyle&&t.data.itemStyle.color)return t.data.itemStyle.color;if(t.data&&t.data.node&&t.data.node.category){const e=i.nodeCategories.find((e=>e.name===t.data.node.category));return e&&e.nodeStyle&&e.nodeStyle.color||i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeStyle&&i.mapOptions.nodeConfig.nodeStyle.color||"#6c757d"}return i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeStyle&&i.mapOptions.nodeConfig.nodeStyle.color||"#6c757d"}},symbolSize:(t,n)=>{if(n.data&&n.data.cluster)return i.mapOptions.clusterConfig&&i.mapOptions.clusterConfig.symbolSize||30;if(n.data&&n.data.node){const{nodeSizeConfig:t}=e.utils.getNodeStyle(n.data.node,i,"map");return"object"==typeof t?i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeSize||17:t}return i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeSize||17},emphasis:i.mapOptions.nodeConfig.emphasis},Object.assign(i.mapOptions.linkConfig,{id:"map-links",type:"lines",coordinateSystem:"leaflet",data:s})];return{leaflet:{tiles:i.mapTileConfig,mapOptions:i.mapOptions},series:u,...i.mapOptions.baseOptions}}_propagateGraphZoom(t){const e=t.echarts.getDom&&t.echarts.getDom();if(!e)return;const n=e.querySelector("canvas");e.addEventListener("wheel",(t=>{if(!n)return;const i=e.getBoundingClientRect();if(t.clientXi.right||t.clientYi.bottom)return;t.preventDefault();const r=n.getBoundingClientRect();n.dispatchEvent(new WheelEvent("wheel",{bubbles:!0,cancelable:!0,view:window,clientX:r.left+r.width/2,clientY:r.top+r.height/2,deltaY:-t.deltaY,deltaMode:t.deltaMode}))}),{passive:!1})}graphRender(t,e){e.utils.echartsSetOption(e.utils.generateGraphOption(t,e),e),window.onresize=()=>{e.echarts.resize()},e.utils._propagateGraphZoom(e),e.config.showGraphLabelsAtZoom>0&&e.echarts.on("graphRoam",(t=>{if(!t||!t.zoom)return;const n=e.echarts.getOption(),i=n&&n.series&&n.series[0]&&n.series[0].zoom>=e.config.showGraphLabelsAtZoom;i!==e._labelsVisible&&(e.echarts.resize({animation:!1,silent:!0}),e._labelsVisible=i)})),e.utils.setupHashChangeHandler(e),e.event.emit("onLoad"),e.event.emit("onReady"),e.event.emit("renderArray"),e.event.emit("applyUrlFragmentState")}mapRender(t,e){if(!e.config.mapTileConfig[0])throw new Error('You must add the tiles via the "mapTileConfig" param!');e.utils.isGeoJSON(t)&&(e.originalGeoJSON=e.utils.fastDeepCopy(t),t=e.utils.geojsonToNetjson(t));const n=e.utils.generateMapOption(t,e);if(e.utils.echartsSetOption(n,e),e.bboxData={nodes:[],links:[]},e.leaflet=e.echarts._api.getCoordinateSystems()[0].getLeaflet(),e.leaflet._zoomAnimated=!1,e.config.geoOptions=e.utils.deepMergeObj({pointToLayer:(t,n)=>g().circleMarker(n,e.config.geoOptions.style),onEachFeature:(t,n)=>{n.on("click",(()=>{const n={...t.properties};e.config.onClickElement.call(e,"Feature",n)}))}},e.config.geoOptions),e.originalGeoJSON){!function(t){if(!t.originalGeoJSON||!Array.isArray(t.originalGeoJSON.features))return;const e=t.leaflet,n=t.originalGeoJSON.features.filter((t=>t&&t.geometry&&("Polygon"===t.geometry.type||"MultiPolygon"===t.geometry.type)));if(!n.length)return;let i=e.getPane("njg-polygons");i||(i=e.createPane("njg-polygons"),i.style.zIndex=410);const r={fillColor:"#1566a9",color:"#1566a9",weight:0,fillOpacity:.6},o=g().geoJSON({type:"FeatureCollection",features:n},{pane:"njg-polygons",style:e=>{const n=e.properties&&e.properties.echartsStyle||{},i={...r,...t.config.geoOptions&&t.config.geoOptions.style};return n.areaColor&&(i.fillColor=n.areaColor),n.color&&(i.color=n.color),void 0!==n.opacity&&(i.fillOpacity=n.opacity),void 0!==n.borderWidth&&(i.weight=n.borderWidth),i},onEachFeature:(e,n)=>{n.on("click",(()=>{const n=e.properties||{};t.config.onClickElement.call(t,"Feature",n)}))},...t.config.geoOptions}).addTo(e);t.leaflet.polygonGeoJSON=o}(e);let n=null;if(e.leaflet.polygonGeoJSON&&"function"==typeof e.leaflet.polygonGeoJSON.getBounds&&(n=e.leaflet.polygonGeoJSON.getBounds()),t.nodes&&t.nodes.length){const e=t.nodes.map((t=>t.properties.location)).map((t=>[t.lat,t.lng]));n?e.forEach((t=>n.extend(t))):n=g().latLngBounds(e)}n&&n.isValid()&&e.leaflet.fitBounds(n,{padding:[20,20]})}if(e.leaflet.getZoom(){const t=e.leaflet.getZoom(),n=t>=e.config.showLabelsAtZoomLevel;e.echarts.setOption({series:[{id:"geo-map",label:{show:n},emphasis:{label:{show:n}}}]});const i=e.leaflet.getMinZoom(),r=e.leaflet.getMaxZoom(),o=document.querySelector(".leaflet-control-zoom-in"),a=document.querySelector(".leaflet-control-zoom-out");o&&a&&(Math.round(t)>=r?o.classList.add("leaflet-disabled"):o.classList.remove("leaflet-disabled"),Math.round(t)<=i?a.classList.add("leaflet-disabled"):a.classList.remove("leaflet-disabled"))})),e.leaflet.on("moveend",(async()=>{const n=e.leaflet.getBounds();if(e.leaflet.getZoom()>=e.config.loadMoreAtZoomLevel&&e.hasMoreData){const i=await e.utils.getBBoxData.call(e,e.JSONParam,n);e.config.prepareData.call(e,i);const r=new Set(e.data.nodes.map((t=>t.id))),o=new Set(e.data.links.map((t=>t.source))),a=new Set(e.data.links.map((t=>t.target))),s=i.nodes.filter((t=>!r.has(t.id))),l=i.links.filter((t=>!o.has(t.source)&&!a.has(t.target))),u=new Set(i.nodes.map((t=>t.id))),h=e.bboxData.nodes.filter((t=>!u.has(t.id))),c=new Set(h.map((t=>t.id)));t.nodes=t.nodes.filter((t=>!c.has(t.id))),e.bboxData.nodes=e.bboxData.nodes.concat(s),e.bboxData.links=e.bboxData.links.concat(l),t={...t,nodes:t.nodes.concat(s),links:t.links.concat(l)},e.echarts.setOption(e.utils.generateMapOption(t,e)),e.data=t}else e.hasMoreData&&e.bboxData.nodes.length>0&&(()=>{const n=new Set(e.bboxData.nodes),i=new Set(e.bboxData.links);t={...t,nodes:t.nodes.filter((t=>!n.has(t))),links:t.links.filter((t=>!i.has(t)))},e.data=t,e.echarts.setOption(e.utils.generateMapOption(t,e)),e.bboxData.nodes=[],e.bboxData.links=[]})()})),e.config.clustering&&e.config.clusteringThresholde.config.disableClusteringAtLevel&&(n=[],i=t.nodes,r=t.links),e.echarts.setOption(e.utils.generateMapOption({...t,nodes:i,links:r},e,n)),e.echarts.on("click",(t=>{if(("scatter"===t.componentSubType||"effectScatter"===t.componentSubType)&&t.data.cluster){const n=e.leaflet.getZoom(),i=Math.min(n+2,e.leaflet.getMaxZoom());e.leaflet.setView([t.data.value[1],t.data.value[0]],i)}})),e.leaflet.on("zoomend",(()=>{if(e.leaflet.getZoom(){e.echarts.appendData({seriesIndex:n,data:t.data})})),e.utils.mergeData(t,e)}e.config.afterUpdate.call(e)}addData(t,e){e.utils.mergeData(t,e),e.data.nodes&&e.data.nodes.length>0&&(e.data.nodes=e.utils.deduplicateNodesById(e.data.nodes)),e.utils.render(),e.config.afterUpdate.call(e)}mergeData(t,e){t.nodes||(t.nodes=[]);const n=new Set;e.data.nodes.forEach((t=>{t.id&&n.add(t.id)}));const i=t.nodes.filter((t=>!t.id||(!n.has(t.id)||(console.warn(`Duplicate node ID ${t.id} detected during merge and skipped.`),!1)))),r=e.data.nodes.concat(i),o=t.links||[],a=e.data.links.concat(o);Object.assign(e.data,t,{nodes:r,links:a})}}const nX=function(t,e){const{util:n,graphic:i,matrix:r}=t,o=e.Layer.extend({initialize(t){this._container=t},onAdd(t){t.getPane(this.options.pane).appendChild(this._container),t.zoomControl.setPosition("topright")},onRemove(){e.DomUtil.remove(this._container)},_update(){}});function a(t,n){this._map=t,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=n,this._projection=e.Projection.Mercator}function s(t,e,n,i){const{leafletModel:r,seriesModel:o}=n,a=r?r.coordinateSystem:o?o.coordinateSystem||(o.getReferringComponents("leaflet")[0]||{}).coordinateSystem:null;return a===this?a[t](i):null}return a.dimensions=["lng","lat"],a.prototype.dimensions=["lng","lat"],a.prototype.setZoom=function(t){this._zoom=t},a.prototype.setCenter=function(t){this._center=this._projection.project(new e.LatLng(t[1],t[0]))},a.prototype.setMapOffset=function(t){this._mapOffset=t},a.prototype.getLeaflet=function(){return this._map},a.prototype.getViewRect=function(){const t=this._api;return new i.BoundingRect(0,0,t.getWidth(),t.getHeight())},a.prototype.getRoamTransform=function(){return r.create()},a.prototype.dataToPoint=function(t){const n=new e.LatLng(t[1],t[0]),i=this._map.latLngToLayerPoint(n),r=this._mapOffset;return[i.x-r[0],i.y-r[1]]},a.prototype.pointToData=function(t){const e=this._mapOffset,n=this._map.layerPointToLatLng({x:t[0]+e[0],y:t[1]+e[1]});return[n.lng,n.lat]},a.prototype.convertToPixel=n.curry(s,"dataToPoint"),a.prototype.convertFromPixel=n.curry(s,"pointToData"),a.create=function(t,n){let i;const r=[],s=n.getDom();return t.eachComponent("leaflet",(t=>{const l=n.getZr().painter.getViewportRoot();if(void 0===e)throw new Error("Leaflet api is not loaded");if(i)throw new Error("Only one leaflet component can exist");if(!t.__map){let n=s.querySelector(".ec-extension-leaflet");n&&(l.style.left="0px",l.style.top="0px",s.removeChild(n)),n=document.createElement("div"),n.style.cssText="width:100%;height:100%",n.classList.add("ec-extension-leaflet"),s.appendChild(n),t.__map=e.map(n,t.get("mapOptions"));const i=t.__map,r=t.get("tiles"),a={};let u=!1;if(r.forEach((t=>{const n=e.tileLayer(t.urlTemplate,t.options);t.label?(u||(n.addTo(i),u=!0),a[t.label]=n):n.addTo(i)})),r.length>1){const n=t.get("layerControl");e.control.layers(a,{},n).addTo(i)}const h=document.createElement("div");h.style="position: absolute;left: 0;top: 0;z-index: 100",h.appendChild(l),new o(h).addTo(i)}const u=t.__map;i=new a(u,n),r.push(i),i.setMapOffset(t.__mapOffset||[0,0]);const{center:h,zoom:c}=t.get("mapOptions");h&&c&&(i.setZoom(c),i.setCenter(h)),t.coordinateSystem=i})),t.eachSeries((t=>{"leaflet"===t.get("coordinateSystem")&&(t.coordinateSystem=i)})),r},a};function iX(t,e,n){!function(t){t.extendComponentModel({type:"leaflet",getLeaflet(){return this.__map},setCenterAndZoom(t,e){this.option.center=t,this.option.zoom=e},centerOrZoomChanged(t,e){const{option:n}=this;return i=t,r=n.center,!(i&&r&&i[0]===r[0]&&i[1]===r[1]&&e===n.zoom);var i,r},defaultOption:{mapOptions:{},tiles:[{urlTemplate:"http://{s}.tile.osm.org/{z}/{x}/{y}.png",options:{attribution:'© OpenStreetMap contributors'}}],layerControl:{}}})}(t),function(t){t.extendComponentView({type:"leaflet",render(e,n,i){let r=!0;const o=e.getLeaflet(),a=i.getZr().painter.getViewportRoot().parentNode,s=e.coordinateSystem,{roam:l}=e.get("mapOptions");function u(t){if(r)return;const n=o._mapPane;let l=n.style.transform,u=0,h=0;if(l){l=l.replace("translate3d(","");let t=l.split(",");u=-parseInt(t[0],10),h=-parseInt(t[1],10)}else u=-parseInt(n.style.left,10),h=-parseInt(n.style.top,10);let c=[u,h];a.style.left=`${c[0]}px`,a.style.top=`${c[1]}px`,s.setMapOffset(c),e.__mapOffset=c,i.dispatchAction({type:"leafletRoam",animation:{duration:0}})}function h(){r||i.dispatchAction({type:"leafletRoam"})}function c(){u()}function d(){t.getInstanceByDom(i.getDom()).resize()}l&&"scale"!==l?o.dragging.enable():o.dragging.disable(),l&&"move"!==l?(o.scrollWheelZoom.enable(),o.doubleClickZoom.enable(),o.touchZoom.enable()):(o.scrollWheelZoom.disable(),o.doubleClickZoom.disable(),o.touchZoom.disable()),this._oldMoveHandler&&o.off("move",this._oldMoveHandler),this._oldZoomHandler&&o.off("zoom",this._oldZoomHandler),this._oldZoomEndHandler&&o.off("zoomend",this._oldZoomEndHandler),this._oldResizeHandler&&o.off("resize",this._oldResizeHandler),o.on("move",u),o.on("zoom",c),o.on("zoomend",h),o.on("resize",d),this._oldMoveHandler=u,this._oldZoomHandler=c,this._oldZoomEndHandler=h,this._oldResizeHandler=d,r=!1}})}(t),t.registerCoordinateSystem("leaflet",nX(t,e)),t.registerAction({type:"leafletRoam",event:"leafletRoam",update:"updateLayout"},((t,e)=>{e.eachComponent("leaflet",(t=>{const e=t.getLeaflet(),n=e.getCenter();t.setCenterAndZoom([n.lng,n.lat],e.getZoom())}))}))}iX.version="1.0.0";const rX=iX;const oX=class{constructor(t){this.self=t,this.renderModeSelector=null,this.controls=null,this.sideBar=null,this.metaInfoContainer=null,this.nodeLinkInfoContainer=null}createControls(){const t=document.createElement("div");return t.setAttribute("class","njg-controls"),this.self.el.appendChild(t),t}createRenderModeSelector(){const t=document.createElement("div"),e=document.createElement("span");return e.setAttribute("class","iconfont icon-eye"),t.setAttribute("class","njg-selectIcon"),t.appendChild(e),this.controls.appendChild(t),t}createSideBar(){const t=document.createElement("div");t.setAttribute("class","njg-sideBar"),t.classList.add("hidden");const e=document.createElement("button");return t.appendChild(e),e.classList.add("sideBarHandle"),e.onclick=()=>{t.classList.toggle("hidden");const e=document.querySelector(".njg-metaInfoContainer");(this.self.config.showMetaOnNarrowScreens||this.self.el.clientWidth>850)&&e&&(e.style.display="flex")},this.self.el.appendChild(t),t}hideInfoOnNarrowScreen(){!this.self.config.showMetaOnNarrowScreens&&this.self.el.clientWidth<850&&(this.metaInfoContainer.style.display="none"),"none"===this.metaInfoContainer.style.display&&"none"===this.nodeLinkInfoContainer.style.display&&this.sideBar.classList.add("hidden")}createMetaInfoContainer(){const t=document.createElement("div"),e=document.createElement("h2"),n=document.createElement("div");n.classList.add("njg-metaData"),t.classList.add("njg-metaInfoContainer");const i=document.createElement("span");return i.classList.add("njg-closeButton"),e.innerHTML="Info",i.innerHTML=" ✕",e.appendChild(i),t.appendChild(e),t.appendChild(n),this.metaInfoContainer=t,this.sideBar.appendChild(t),this.nodeLinkInfoContainer=this.createNodeLinkInfoContainer(),this.hideInfoOnNarrowScreen(),window.addEventListener("resize",this.hideInfoOnNarrowScreen.bind(this)),i.onclick=()=>{this.metaInfoContainer.style.display="none","none"===this.nodeLinkInfoContainer.style.display&&this.sideBar.classList.add("hidden")},t}createNodeLinkInfoContainer(){const t=document.createElement("div");return t.classList.add("njg-nodeLinkInfoContainer"),t.style.display="none",this.sideBar.appendChild(t),t}getNodeLinkInfo(t,e){const n=document.querySelectorAll(".njg-infoContainer"),i=document.querySelectorAll(".njg-headerContainer");for(let t=0;t"clients"===t?"Clients":/^clients\s*\[\d+\]$/i.test(t)?t.replace(/^clients/i,"Client"):"localAddresses"===t?"Local Addresses":t.replace(/_/g," "),u=(t,e,n,i=0)=>{if(null==n||"string"==typeof n&&(""===n.trim()||/^(undefined|null)$/i.test(n.trim()))&&"0"!==n)return;if(Array.isArray(n)){if(0===n.length){const n=document.createElement("div");n.classList.add("njg-infoItems"),n.style.paddingLeft=12*i+"px";const r=document.createElement("span");r.setAttribute("class","njg-keyLabel");const o=document.createElement("span");return o.setAttribute("class","njg-valueLabel"),r.innerHTML=l(e),o.innerHTML="[]",n.appendChild(r),n.appendChild(o),void t.appendChild(n)}if(n.every((t=>"object"!=typeof t||null===t))){const r=document.createElement("div");r.classList.add("njg-infoItems"),r.style.paddingLeft=12*i+"px";const o=document.createElement("span");o.setAttribute("class","njg-keyLabel");const a=document.createElement("span");return a.setAttribute("class","njg-valueLabel"),o.innerHTML=l(e),a.innerHTML=n.map((t=>"string"==typeof t?t.replace(/\n/g,"
"):String(t))).join("
"),r.appendChild(o),r.appendChild(a),void t.appendChild(r)}return void n.forEach(((n,r)=>{u(t,`${e} [${r+1}]`,n,i)}))}if("object"==typeof n){if("location"===e&&"number"==typeof n.lat&&"number"==typeof n.lng){const e=document.createElement("div");e.classList.add("njg-infoItems"),e.style.paddingLeft=12*i+"px";const r=document.createElement("span");r.setAttribute("class","njg-keyLabel");const o=document.createElement("span");return o.setAttribute("class","njg-valueLabel"),r.innerHTML="Location",o.innerHTML=`${Math.round(1e3*n.lat)/1e3}, ${Math.round(1e3*n.lng)/1e3}`,e.appendChild(r),e.appendChild(o),void t.appendChild(e)}const r=document.createElement("div");r.classList.add("njg-infoItems"),r.style.paddingLeft=12*i+"px";const o=document.createElement("span");o.setAttribute("class","njg-keyLabel");const a=document.createElement("span");return a.setAttribute("class","njg-valueLabel"),o.innerHTML=l(e),a.innerHTML="",r.appendChild(o),r.appendChild(a),t.appendChild(r),void Object.keys(n).forEach((e=>{u(t,e,n[e],i+1)}))}const r=document.createElement("div");r.classList.add("njg-infoItems"),r.style.paddingLeft=12*i+"px";const o=document.createElement("span");o.setAttribute("class","njg-keyLabel");const a=document.createElement("span");a.setAttribute("class","njg-valueLabel"),o.innerHTML=l(e);const s="string"==typeof n?n.replace(/\n/g,"
"):String(n);a.innerHTML=s,r.appendChild(o),r.appendChild(a),t.appendChild(r)};Object.keys(e).forEach((t=>u(o,t,e[t],0))),r.appendChild(a),r.appendChild(s),this.nodeLinkInfoContainer.appendChild(r),this.nodeLinkInfoContainer.appendChild(o),s.onclick=()=>{this.nodeLinkInfoContainer.style.display="none",null!==this.metaInfoContainer&&"none"!==this.metaInfoContainer.style.display||this.sideBar.classList.add("hidden")}}init(){this.sideBar=this.createSideBar(),this.self.config.switchMode&&(this.controls=this.createControls(),this.renderModeSelector=this.createRenderModeSelector())}};const aX=function(t,e={}){const n=t.echarts,i=echarts.graphic,r={wifi:e.colors&&e.colors.wifi||"#d35454"},o=e.radius||3,a=e.gap||8;let s=e.minZoomLevel||1.5,l=1;const u=t=>t?"number"==typeof t.clients?t.clients:Array.isArray(t.clients)?t.clients.length:0:0,h=function(){const t=n.getModel().getSeriesByIndex(0);if(!t)return null;const e=(n._chartsViews||[]).find((e=>e&&e.__model&&e.__model.uid===t.uid));return e?e.group:null}();if(!h)return{destroy(){}};const c=new i.Group({silent:!0,z:100,zlevel:1});h.add(c);const d=t&&t.config&&t.config.graphConfig&&t.config.graphConfig.series||{},f=("number"==typeof d.nodeSize?d.nodeSize:18)/2;function p(){l=function(){const t=n.getOption();return t&&t.series&&t.series[0]&&t.series[0].zoom?t.series[0].zoom:1}();const t=l>=s;c.attr("invisible",!t)}function g(){const t=n.getModel().getSeriesByIndex(0);if(!t)return;const e=t.getData();if(!e)return;if(p(),c.removeAll(),l{let s=0;if(0!==n)for(let l=0;s{p(),g()}]];return m.forEach((([t,e])=>n.on(t,e))),g(),{destroy(){m.forEach((([t,e])=>{n&&n.off&&n.off(t,e)})),c&&c.parent&&c.parent.remove(c)},setMinZoomLevel(t){s=t,g()},getMinZoomLevel:()=>s}},sX=n(936),{each:lX}=n(627),uX=n(123);rX(f,g(),{colorTool:sX,each:lX,env:uX}),window.NetJSONGraph=class{constructor(t,e={}){return this.graph=new A(t),this.config=this.initializeConfig(e),this.graph.setConfig(this.config),this.setupGraph(),this.config.onInit.call(this.graph),this.initializeECharts(),this.graph}initializeConfig(t={}){return{...t,render:"map"===t.render?eX.prototype.mapRender:eX.prototype.graphRender,onInit:this.onInit,onRender:this.onRender,onUpdate:this.onUpdate,afterUpdate:this.afterUpdate,onLoad:this.onLoad}}setupGraph(){Object.setPrototypeOf(eX.prototype,this.graph.utils),this.graph.gui=new oX(this.graph),this.graph.utils=new eX,this.graph.setUtils(),this.graph.event=this.graph.utils.createEvent()}initializeECharts(){this.graph.echarts=Ly(this.graph.el,null,{renderer:this.graph.config.svgRender?"svg":"canvas"})}onInit(){return this.config}onRender(){return this.utils.showLoading.call(this),this.gui.init(),this.config}onUpdate(){return this.config}afterUpdate(){return this.config}onLoad(){return this.config.metadata&&this.utils.isNetJSON(this.data)?(this.gui.createMetaInfoContainer(this.graph),this.utils.updateMetadata.call(this)):this.gui.nodeLinkInfoContainer=this.gui.createNodeLinkInfoContainer(),this.config.switchMode&&this.utils.isNetJSON(this.data)&&(this.gui.renderModeSelector.onclick=()=>{if(this.config.render===this.utils.mapRender){this.config.render=this.utils.graphRender;const t=this.echarts.getZr().painter.getViewportRoot().parentNode;this.echarts.clear(),this.utils.graphRender(this.data,this),t.style.background=this.echarts.getZr()._backgroundColor,document.querySelector(".leaflet-control-attribution").style.display="none",document.querySelector(".leaflet-control-zoom").style.display="none"}else this.echarts.clear(),this.config.render=this.utils.mapRender,this.utils.mapRender(this.data,this),document.querySelector(".leaflet-control-attribution").style.display="block",document.querySelector(".leaflet-control-zoom").style.display="block"}),this.utils.hideLoading.call(this),this.attachClientsOverlay=t=>aX(this,t),this.config}},window.echarts=f,window.L=g()})()})(); +(()=>{function t(i){var o=n[i];if(void 0!==o)return o.exports;var r=n[i]={exports:{}};return e[i].call(r.exports,r,r.exports,t),r.exports}var e={481(t,e){!function(t){"use strict";function e(t){var e,n,i,o;for(n=1,i=arguments.length;n=0}function O(t){sn[t.pointerId]=t}function z(t){sn[t.pointerId]&&(sn[t.pointerId]=t)}function E(t){delete sn[t.pointerId]}function R(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var n in e.touches=[],sn)e.touches.push(sn[n]);e.changedTouches=[e],t(e)}}function B(t){return"string"==typeof t?document.getElementById(t):t}function N(t,e){var n=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!n||"auto"===n)&&document.defaultView){var i=document.defaultView.getComputedStyle(t,null);n=i?i[e]:null}return"auto"===n?null:n}function F(t,e,n){var i=document.createElement(t);return i.className=e||"",n&&n.appendChild(i),i}function V(t){var e=t.parentNode;e&&e.removeChild(t)}function Z(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function H(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function W(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function j(t,e){if(void 0!==t.classList)return t.classList.contains(e);var n=X(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)}function G(t,e){if(void 0!==t.classList)for(var n=u(e),i=0,o=n.length;ie&&(n.push(t[i]),o=i);return ol&&(r=a,l=s);l>n&&(e[r]=1,Mt(t,e,n,i,r),Mt(t,e,n,r,o))}function Ct(t,e,n,i,o){var r,a,s,l=i?In:It(t,n),u=It(e,n);for(In=u;;){if(!(l|u))return[t,e];if(l&u)return!1;s=It(a=kt(t,e,r=l||u,n,o),n),r===l?(t=a,l=s):(e=a,u=s)}}function kt(t,e,n,i,o){var r,a,s=e.x-t.x,l=e.y-t.y,u=i.min,h=i.max;return 8&n?(r=t.x+s*(h.y-t.y)/l,a=h.y):4&n?(r=t.x+s*(u.y-t.y)/l,a=u.y):2&n?(r=h.x,a=t.y+l*(h.x-t.x)/s):1&n&&(r=u.x,a=t.y+l*(u.x-t.x)/s),new _(r,a,o)}function It(t,e){var n=0;return t.xe.max.x&&(n|=2),t.ye.max.y&&(n|=8),n}function Lt(t,e){var n=e.x-t.x,i=e.y-t.y;return n*n+i*i}function Pt(t,e,n,i){var o,r=e.x,a=e.y,s=n.x-r,l=n.y-a,u=s*s+l*l;return u>0&&((o=((t.x-r)*s+(t.y-a)*l)/u)>1?(r=n.x,a=n.y):o>0&&(r+=s*o,a+=l*o)),s=t.x-r,l=t.y-a,i?s*s+l*l:new _(r,a)}function Dt(t){return!qt(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function At(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Dt(t)}function Ot(t,e){var n,i,o,r,a,s,l,u;if(!t||0===t.length)throw new Error("latlngs not passed");Dt(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var h=C([0,0]),c=T(t);c.getNorthWest().distanceTo(c.getSouthWest())*c.getNorthEast().distanceTo(c.getNorthWest())<1700&&(h=bt(t));var d=t.length,p=[];for(n=0;ni){u=[s.x-(l=(r-i)/o)*(s.x-a.x),s.y-l*(s.y-a.y)];break}var g=e.unproject(x(u));return C([g.lat+h.lat,g.lng+h.lng])}function zt(t,e){var n,i,o,r,a="Feature"===t.type?t.geometry:t,s=a?a.coordinates:null,l=[],u=e&&e.pointToLayer,h=e&&e.coordsToLatLng||Rt;if(!s&&!a)return null;switch(a.type){case"Point":return Et(u,t,n=h(s),e);case"MultiPoint":for(o=0,r=s.length;o0&&o.push(o[0].slice()),o}function Vt(t,n){return t.feature?e({},t.feature,{geometry:n}):Zt(n)}function Zt(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}function Ht(t,e){return new Jn(t,e)}function Wt(t,e){return new ui(t,e)}function jt(t){return Qe.canvas?new di(t):null}function Gt(t){return Qe.svg||Qe.vml?new mi(t):null}var Ut=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}(),Yt=0,Xt=/\{ *([\w_ -]+) *\}/g,qt=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Kt="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",$t=0,Jt=window.requestAnimationFrame||f("RequestAnimationFrame")||g,Qt=window.cancelAnimationFrame||f("CancelAnimationFrame")||f("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)},te={__proto__:null,extend:e,create:Ut,bind:n,get lastId(){return Yt},stamp:i,throttle:o,wrapNum:r,falseFn:a,formatNum:s,trim:l,splitWords:u,setOptions:h,getParamString:c,template:d,isArray:qt,indexOf:p,emptyImageUrl:Kt,requestFn:Jt,cancelFn:Qt,requestAnimFrame:m,cancelAnimFrame:y};v.extend=function(t){var n=function(){h(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=n.__super__=this.prototype,o=Ut(i);for(var r in o.constructor=n,n.prototype=o,this)Object.prototype.hasOwnProperty.call(this,r)&&"prototype"!==r&&"__super__"!==r&&(n[r]=this[r]);return t.statics&&e(n,t.statics),t.includes&&(function(t){if("undefined"!=typeof L&&L&&L.Mixin){t=qt(t)?t:[t];for(var e=0;e0?Math.floor(t):Math.ceil(t)};_.prototype={clone:function(){return new _(this.x,this.y)},add:function(t){return this.clone()._add(x(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(x(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new _(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new _(this.x/t.x,this.y/t.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=ie(this.x),this.y=ie(this.y),this},distanceTo:function(t){var e=(t=x(t)).x-this.x,n=t.y-this.y;return Math.sqrt(e*e+n*n)},equals:function(t){return(t=x(t)).x===this.x&&t.y===this.y},contains:function(t){return t=x(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+s(this.x)+", "+s(this.y)+")"}},w.prototype={extend:function(t){var e,n;if(!t)return this;if(t instanceof _||"number"==typeof t[0]||"x"in t)e=n=x(t);else if(n=(t=b(t)).max,!(e=t.min)||!n)return this;return this.min||this.max?(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(n.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(n.y,this.max.y)):(this.min=e.clone(),this.max=n.clone()),this},getCenter:function(t){return x((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return x(this.min.x,this.max.y)},getTopRight:function(){return x(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,n;return(t="number"==typeof t[0]||t instanceof _?x(t):b(t))instanceof w?(e=t.min,n=t.max):e=n=t,e.x>=this.min.x&&n.x<=this.max.x&&e.y>=this.min.y&&n.y<=this.max.y},intersects:function(t){t=b(t);var e=this.min,n=this.max,i=t.min,o=t.max;return o.x>=e.x&&i.x<=n.x&&o.y>=e.y&&i.y<=n.y},overlaps:function(t){t=b(t);var e=this.min,n=this.max,i=t.min,o=t.max;return o.x>e.x&&i.xe.y&&i.y=i.lat&&n.lat<=o.lat&&e.lng>=i.lng&&n.lng<=o.lng},intersects:function(t){t=T(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),o=t.getNorthEast();return o.lat>=e.lat&&i.lat<=n.lat&&o.lng>=e.lng&&i.lng<=n.lng},overlaps:function(t){t=T(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),o=t.getNorthEast();return o.lat>e.lat&&i.late.lng&&i.lng1,Xe=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",a,e),window.removeEventListener("testPassiveEventSupport",a,e)}catch(t){}return t}(),qe=!!document.createElement("canvas").getContext,Ke=!(!document.createElementNS||!P("svg").createSVGRect),$e=!!Ke&&((ue=document.createElement("div")).innerHTML="","http://www.w3.org/2000/svg"===(ue.firstChild&&ue.firstChild.namespaceURI)),Je=!Ke&&function(){try{var t=document.createElement("div");t.innerHTML='';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),Qe={ie:_e,ielt9:xe,edge:we,webkit:be,android:Se,android23:Te,androidStock:Ce,opera:ke,chrome:Ie,gecko:Le,safari:Pe,phantom:De,opera12:Ae,win:Oe,ie3d:ze,webkit3d:Ee,gecko3d:Re,any3d:Be,mobile:Ne,mobileWebkit:Fe,mobileWebkit3d:Ve,msPointer:Ze,pointer:He,touch:je,touchNative:We,mobileOpera:Ge,mobileGecko:Ue,retina:Ye,passiveEvents:Xe,canvas:qe,svg:Ke,vml:Je,inlineSvg:$e,mac:0===navigator.platform.indexOf("Mac"),linux:0===navigator.platform.indexOf("Linux")},tn=Qe.msPointer?"MSPointerDown":"pointerdown",en=Qe.msPointer?"MSPointerMove":"pointermove",nn=Qe.msPointer?"MSPointerUp":"pointerup",on=Qe.msPointer?"MSPointerCancel":"pointercancel",rn={touchstart:tn,touchmove:en,touchend:nn,touchcancel:on},an={touchstart:function(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&ft(e),R(t,e)},touchmove:R,touchend:R,touchcancel:R},sn={},ln=!1,un=200,hn=K(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),cn=K(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),dn="webkitTransition"===cn||"OTransition"===cn?cn+"End":"transitionend";if("onselectstart"in document)he=function(){at(window,"selectstart",ft)},ce=function(){st(window,"selectstart",ft)};else{var pn=K(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);he=function(){if(pn){var t=document.documentElement.style;de=t[pn],t[pn]="none"}},ce=function(){pn&&(document.documentElement.style[pn]=de,de=void 0)}}var fn={__proto__:null,TRANSFORM:hn,TRANSITION:cn,TRANSITION_END:dn,get:B,getStyle:N,create:F,remove:V,empty:Z,toFront:H,toBack:W,hasClass:j,addClass:G,removeClass:U,setClass:Y,getClass:X,setOpacity:q,testProp:K,setTransform:$,setPosition:J,getPosition:Q,get disableTextSelection(){return he},get enableTextSelection(){return ce},disableImageDrag:tt,enableImageDrag:et,preventOutline:nt,restoreOutline:it,getSizedParentNode:ot,getScale:rt},gn="_leaflet_events",mn={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"},yn=Qe.linux&&Qe.chrome?window.devicePixelRatio:Qe.mac?3*window.devicePixelRatio:window.devicePixelRatio>0?2*window.devicePixelRatio:1,vn={__proto__:null,on:at,off:st,stopPropagation:ct,disableScrollPropagation:dt,disableClickPropagation:pt,preventDefault:ft,stop:gt,getPropagationPath:mt,getMousePosition:yt,getWheelDelta:vt,isExternalTarget:_t,addListener:at,removeListener:st},_n=ne.extend({run:function(t,e,n,i){this.stop(),this._el=t,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(i||.5,.2),this._startPos=Q(t),this._offset=e.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=m(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,n=1e3*this._duration;ethis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var n=this.getCenter(),i=this._limitCenter(n,this._zoom,T(t));return n.equals(i)||this.panTo(i,e),this._enforcingBounds=!1,this},panInside:function(t,e){var n=x((e=e||{}).paddingTopLeft||e.padding||[0,0]),i=x(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),r=this.project(t),a=this.getPixelBounds(),s=b([a.min.add(n),a.max.subtract(i)]),l=s.getSize();if(!s.contains(r)){this._enforcingBounds=!0;var u=r.subtract(s.getCenter()),h=s.extend(r).getSize().subtract(l);o.x+=u.x<0?-h.x:h.x,o.y+=u.y<0?-h.y:h.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=e({animate:!1,pan:!0},!0===t?{animate:!0}:t);var i=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),r=i.divideBy(2).round(),a=o.divideBy(2).round(),s=r.subtract(a);return s.x||s.y?(t.animate&&t.pan?this.panBy(s):(t.pan&&this._rawPanBy(s),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(n(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:i,newSize:o})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=e({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var i=n(this._handleGeolocationResponse,this),o=n(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(i,o,t):navigator.geolocation.getCurrentPosition(i,o,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,n=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+n+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=new M(t.coords.latitude,t.coords.longitude),n=e.toBounds(2*t.coords.accuracy),i=this._locateOptions;if(i.setView){var o=this.getBoundsZoom(n);this.setView(e,i.maxZoom?Math.min(o,i.maxZoom):o)}var r={latlng:e,bounds:n,timestamp:t.timestamp};for(var a in t.coords)"number"==typeof t.coords[a]&&(r[a]=t.coords[a]);this.fire("locationfound",r)}},addHandler:function(t,e){if(!e)return this;var n=this[t]=new e(this);return this._handlers.push(n),this.options[t]&&n.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(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),V(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(y(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)V(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var n=F("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new S(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,n){t=T(t),n=x(n||[0,0]);var i=this.getZoom()||0,o=this.getMinZoom(),r=this.getMaxZoom(),a=t.getNorthWest(),s=t.getSouthEast(),l=this.getSize().subtract(n),u=b(this.project(s,i),this.project(a,i)).getSize(),h=Qe.any3d?this.options.zoomSnap:1,c=l.x/u.x,d=l.y/u.y,p=e?Math.max(c,d):Math.min(c,d);return i=this.getScaleZoom(p,i),h&&(i=Math.round(i/(h/100))*(h/100),i=e?Math.ceil(i/h)*h:Math.floor(i/h)*h),Math.max(o,Math.min(r,i))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new _(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var n=this._getTopLeftPoint(t,e);return new w(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var n=this.options.crs;return e=void 0===e?this._zoom:e,n.scale(t)/n.scale(e)},getScaleZoom:function(t,e){var n=this.options.crs,i=n.zoom(t*n.scale(e=void 0===e?this._zoom:e));return isNaN(i)?1/0:i},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(C(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(x(t),e)},layerPointToLatLng:function(t){var e=x(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(C(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(C(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(T(t))},distance:function(t,e){return this.options.crs.distance(C(t),C(e))},containerPointToLayerPoint:function(t){return x(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return x(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(x(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(C(t)))},mouseEventToContainerPoint:function(t){return yt(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=B(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");at(e,"scroll",this._onScroll,this),this._containerId=i(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&Qe.any3d,G(t,"leaflet-container"+(Qe.touch?" leaflet-touch":"")+(Qe.retina?" leaflet-retina":"")+(Qe.ielt9?" leaflet-oldie":"")+(Qe.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=N(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),J(this._mapPane,new _(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(G(t.markerPane,"leaflet-zoom-hide"),G(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,n){J(this._mapPane,new _(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,n)._move(t,e)._moveEnd(o),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,n,i){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),i?n&&n.pinch&&this.fire("zoom",n):((o||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return y(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){J(this._mapPane,this._getMapPanePos().subtract(t))},_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(t){this._targets={},this._targets[i(this._container)]=this;var e=t?st:at;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),Qe.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){y(this._resizeRequest),this._resizeRequest=m(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var n,o=[],r="mouseout"===e||"mouseover"===e,a=t.target||t.srcElement,s=!1;a;){if((n=this._targets[i(a)])&&("click"===e||"preclick"===e)&&this._draggableMoved(n)){s=!0;break}if(n&&n.listens(e,!0)){if(r&&!_t(a,t))break;if(o.push(n),r)break}if(a===this._container)break;a=a.parentNode}return o.length||s||r||!this.listens(e,!0)||(o=[this]),o},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(e))){var n=t.type;"mousedown"===n&&nt(e),this._fireDOMEvent(t,n)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,n,i){if("click"===t.type){var o=e({},t);o.type="preclick",this._fireDOMEvent(o,o.type,i)}var r=this._findEventTargets(t,n);if(i){for(var a=[],s=0;s0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),n=this.getMaxZoom(),i=Qe.any3d?this.options.zoomSnap:1;return i&&(t=Math.round(t/i)*i),Math.max(e,Math.min(n,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){U(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var n=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(n)||(this.panBy(n,e),0))},_createAnimProxy:function(){var t=this._proxy=F("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(t){var e=hn,n=this._proxy.style[e];$(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),n===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){V(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();$(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,n){if(this._animatingZoom)return!0;if(n=n||{},!this._zoomAnimated||!1===n.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var i=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/i);return!(!0!==n.animate&&!this.getSize().contains(o)||(m(function(){this._moveStart(!0,n.noMoveStart||!1)._animateZoom(t,e,!0)},this),0))},_animateZoom:function(t,e,i,o){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,G(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:o}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(n(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&U(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))}}),wn=v.extend({options:{position:"topright"},initialize:function(t){h(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),n=this.getPosition(),i=t._controlCorners[n];return G(e,"leaflet-control"),-1!==n.indexOf("bottom")?i.insertBefore(e,i.firstChild):i.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(V(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),bn=function(t){return new wn(t)};xn.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){function t(t,o){e[t+o]=F("div",n+t+" "+n+o,i)}var e=this._controlCorners={},n="leaflet-",i=this._controlContainer=F("div",n+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)V(this._controlCorners[t]);V(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Sn=wn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,n,i){return n1)?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(i(t.target)),n=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;n&&this._map.fire(n,e)},_createRadioElement:function(t,e){var n='",i=document.createElement("div");return i.innerHTML=n,i.firstChild},_addItem:function(t){var e,n=document.createElement("label"),o=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=o):e=this._createRadioElement("leaflet-base-layers_"+i(this),o),this._layerControlInputs.push(e),e.layerId=i(t.layer),at(e,"click",this._onInputClick,this);var r=document.createElement("span");r.innerHTML=" "+t.name;var a=document.createElement("span");return n.appendChild(a),a.appendChild(e),a.appendChild(r),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var t,e,n=this._layerControlInputs,i=[],o=[];this._handlingClick=!0;for(var r=n.length-1;r>=0;r--)e=this._getLayer((t=n[r]).layerId).layer,t.checked?i.push(e):t.checked||o.push(e);for(r=0;r=0;o--)e=this._getLayer((t=n[o]).layerId).layer,t.disabled=void 0!==e.options.minZoom&&ie.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,at(t,"click",ft),this.expand();var e=this;setTimeout(function(){st(t,"click",ft),e._preventClick=!1})}}),Tn=wn.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",n=F("div",e+" leaflet-bar"),i=this.options;return this._zoomInButton=this._createButton(i.zoomInText,i.zoomInTitle,e+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(i.zoomOutText,i.zoomOutTitle,e+"-out",n,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(t){t.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(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,n,i,o){var r=F("a",n,i);return r.innerHTML=t,r.href="#",r.title=e,r.setAttribute("role","button"),r.setAttribute("aria-label",e),pt(r),at(r,"click",gt),at(r,"click",o,this),at(r,"click",this._refocusOnMap,this),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";U(this._zoomInButton,e),U(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(G(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(G(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});xn.mergeOptions({zoomControl:!0}),xn.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Tn,this.addControl(this.zoomControl))});var Mn=wn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",n=F("div",e),i=this.options;return this._addScales(i,e+"-line",n),t.on(i.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),n},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,n){t.metric&&(this._mScale=F("div",e,n)),t.imperial&&(this._iScale=F("div",e,n))},_update:function(){var t=this._map,e=t.getSize().y/2,n=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(n)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,n,i,o=3.2808399*t;o>5280?(n=this._getRoundNum(e=o/5280),this._updateScale(this._iScale,n+" mi",n/e)):(i=this._getRoundNum(o),this._updateScale(this._iScale,i+" ft",i/o))},_updateScale:function(t,e,n){t.style.width=Math.round(this.options.maxWidth*n)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),n=t/e;return e*(n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}}),Cn=wn.extend({options:{position:"bottomright",prefix:''+(Qe.inlineSvg?' ':"")+"Leaflet"},initialize:function(t){h(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=F("div","leaflet-control-attribution"),pt(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var n=[];this.options.prefix&&n.push(this.options.prefix),t.length&&n.push(t.join(", ")),this._container.innerHTML=n.join(' ')}}});xn.mergeOptions({attributionControl:!0}),xn.addInitHook(function(){this.options.attributionControl&&(new Cn).addTo(this)}),wn.Layers=Sn,wn.Zoom=Tn,wn.Scale=Mn,wn.Attribution=Cn,bn.layers=function(t,e,n){return new Sn(t,e,n)},bn.zoom=function(t){return new Tn(t)},bn.scale=function(t){return new Mn(t)},bn.attribution=function(t){return new Cn(t)};var kn=v.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});kn.addTo=function(t,e){return t.addHandler(e,this),this};var In,Ln={Events:ee},Pn=Qe.touch?"touchstart mousedown":"mousedown",Dn=ne.extend({options:{clickTolerance:3},initialize:function(t,e,n,i){h(this,i),this._element=t,this._dragStartTarget=e||t,this._preventOutline=n},enable:function(){this._enabled||(at(this._dragStartTarget,Pn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Dn._dragging===this&&this.finishDrag(!0),st(this._dragStartTarget,Pn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!j(this._element,"leaflet-zoom-anim")))if(t.touches&&1!==t.touches.length)Dn._dragging===this&&this.finishDrag();else if(!(Dn._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(Dn._dragging=this,this._preventOutline&&nt(this._element),tt(),he(),this._moving))){this.fire("down");var e=t.touches?t.touches[0]:t,n=ot(this._element);this._startPoint=new _(e.clientX,e.clientY),this._startPos=Q(this._element),this._parentScale=rt(n);var i="mousedown"===t.type;at(document,i?"mousemove":"touchmove",this._onMove,this),at(document,i?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(t){if(this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,n=new _(e.clientX,e.clientY)._subtract(this._startPoint);(n.x||n.y)&&(Math.abs(n.x)+Math.abs(n.y)1e-7;l++)e=r*Math.sin(s),e=Math.pow((1-e)/(1+e),r/2),s+=u=Math.PI/2-2*Math.atan(a*e)-s;return new M(s*n,t.x*n/i)}},Rn={__proto__:null,LonLat:zn,Mercator:En,SphericalMercator:le},Bn=e({},ae,{code:"EPSG:3395",projection:En,transformation:function(){var t=.5/(Math.PI*En.R);return I(t,.5,-t,.5)}()}),Nn=e({},ae,{code:"EPSG:4326",projection:zn,transformation:I(1/180,1,-1/180,.5)}),Fn=e({},re,{projection:zn,transformation:I(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var n=e.lng-t.lng,i=e.lat-t.lat;return Math.sqrt(n*n+i*i)},infinite:!0});re.Earth=ae,re.EPSG3395=Bn,re.EPSG3857=me,re.EPSG900913=ye,re.EPSG4326=Nn,re.Simple=Fn;var Vn=ne.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[i(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[i(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var n=this.getEvents();e.on(n,this),this.once("remove",function(){e.off(n,this)},this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});xn.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=i(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=i(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return i(t)in this._layers},eachLayer:function(t,e){for(var n in this._layers)t.call(e,this._layers[n]);return this},_addLayers:function(t){for(var e=0,n=(t=t?qt(t)?t:[t]:[]).length;ethis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()=2&&e[0]instanceof M&&e[0].equals(e[n-1])&&e.pop(),e},_setLatLngs:function(t){Kn.prototype._setLatLngs.call(this,t),Dt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Dt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,n=new _(e,e);if(t=new w(t.min.subtract(n),t.max.add(n)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var i,o=0,r=this._rings.length;ot.y!=(i=e[a]).y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(u=!u);return u||Kn.prototype._containsPoint.call(this,t,!0)}}),Jn=Hn.extend({initialize:function(t,e){h(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,n,i,o=qt(t)?t:t.features;if(o){for(e=0,n=o.length;e0?o:[e.src]}else{qt(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var s=0;si?(e.height=i+"px",G(t,o)):U(t,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),n=this._getAnchor();J(this._container,e.add(n))},_adjustPan:function(){if(this.options.autoPan)if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)this._autopanning=!1;else{var t=this._map,e=parseInt(N(this._container,"marginBottom"),10)||0,n=this._container.offsetHeight+e,i=this._containerWidth,o=new _(this._containerLeft,-n-this._containerBottom);o._add(Q(this._container));var r=t.layerPointToContainerPoint(o),a=x(this.options.autoPanPadding),s=x(this.options.autoPanPaddingTopLeft||a),l=x(this.options.autoPanPaddingBottomRight||a),u=t.getSize(),h=0,c=0;r.x+i+l.x>u.x&&(h=r.x+i-u.x+l.x),r.x-h-s.x<0&&(h=r.x-s.x),r.y+n+l.y>u.y&&(c=r.y+n-u.y+l.y),r.y-c-s.y<0&&(c=r.y-s.y),(h||c)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([h,c]))}},_getAnchor:function(){return x(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});xn.mergeOptions({closePopupOnClick:!0}),xn.include({openPopup:function(t,e,n){return this._initOverlay(ri,t,e,n).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),Vn.include({bindPopup:function(t,e){return this._popup=this._initOverlay(ri,this._popup,t,e),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(t){return this._popup&&(this instanceof Hn||(this._popup._source=this),this._popup._prepareOpen(t||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()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(this._popup&&this._map){gt(t);var e=t.layer||t.target;this._popup._source!==e||e instanceof Yn?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var ai=oi.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){oi.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){oi.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=oi.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){this._contentNode=this._container=F("div","leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide")),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+i(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,n,i=this._map,o=this._container,r=i.latLngToContainerPoint(i.getCenter()),a=i.layerPointToContainerPoint(t),s=this.options.direction,l=o.offsetWidth,u=o.offsetHeight,h=x(this.options.offset),c=this._getAnchor();"top"===s?(e=l/2,n=u):"bottom"===s?(e=l/2,n=0):"center"===s?(e=l/2,n=u/2):"right"===s?(e=0,n=u/2):"left"===s?(e=l,n=u/2):a.xthis.options.maxZoom||ni&&this._retainParent(o,r,a,i))},_retainChildren:function(t,e,n,i){for(var o=2*t;o<2*t+2;o++)for(var r=2*e;r<2*e+2;r++){var a=new _(o,r);a.z=n+1;var s=this._tileCoordsToKey(a),l=this._tiles[s];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),n+1this.options.maxZoom||void 0!==this.options.minZoom&&o1)this._setView(t,n);else{for(var c=o.min.y;c<=o.max.y;c++)for(var d=o.min.x;d<=o.max.x;d++){var p=new _(d,c);if(p.z=this._tileZoom,this._isValidTile(p)){var f=this._tiles[this._tileCoordsToKey(p)];f?f.current=!0:a.push(p)}}if(a.sort(function(t,e){return t.distanceTo(r)-e.distanceTo(r)}),0!==a.length){this._loading||(this._loading=!0,this.fire("loading"));var g=document.createDocumentFragment();for(d=0;dn.max.x)||!e.wrapLat&&(t.yn.max.y))return!1}if(!this.options.bounds)return!0;var i=this._tileCoordsToBounds(t);return T(this.options.bounds).overlaps(i)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,n=this.getTileSize(),i=t.scaleBy(n),o=i.add(n);return[e.unproject(i,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),n=new S(e[0],e[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),n=new _(+e[0],+e[1]);return n.z=+e[2],n},_removeTile:function(t){var e=this._tiles[t];e&&(V(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){G(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=a,t.onmousemove=a,Qe.ielt9&&this.options.opacity<1&&q(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),o=this._tileCoordsToKey(t),r=this.createTile(this._wrapCoords(t),n(this._tileReady,this,t));this._initTile(r),this.createTile.length<2&&m(n(this._tileReady,this,t,null,r)),J(r,i),this._tiles[o]={el:r,coords:t,current:!0},e.appendChild(r),this.fire("tileloadstart",{tile:r,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var o=this._tileCoordsToKey(t);(i=this._tiles[o])&&(i.loaded=+new Date,this._map._fadeAnimated?(q(i.el,0),y(this._fadeFrame),this._fadeFrame=m(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(G(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Qe.ielt9||!this._map._fadeAnimated?m(this._pruneTiles,this):setTimeout(n(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new _(this._wrapX?r(t.x,this._wrapX):t.x,this._wrapY?r(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new w(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}}),ui=li.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=h(this,e)).detectRetina&&Qe.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return at(i,"load",n(this._tileOnLoad,this,e,i)),at(i,"error",n(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var n={r:Qe.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(n.y=i),n["-y"]=i}return d(this._url,e(n,this.options))},_tileOnLoad:function(t,e){Qe.ielt9?setTimeout(n(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,n){var i=this.options.errorTileUrl;i&&e.getAttribute("src")!==i&&(e.src=i),t(n,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom;return this.options.zoomReverse&&(t=this.options.maxZoom-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=a,e.onerror=a,!e.complete)){e.src=Kt;var n=this._tiles[t].coords;V(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:n})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",Kt),li.prototype._removeTile.call(this,t)},_tileReady:function(t,e,n){if(this._map&&(!n||n.getAttribute("src")!==Kt))return li.prototype._tileReady.call(this,t,e,n)}}),hi=ui.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,n){this._url=t;var i=e({},this.defaultWmsParams);for(var o in n)o in this.options||(i[o]=n[o]);var r=(n=h(this,n)).detectRetina&&Qe.retina?2:1,a=this.getTileSize();i.width=a.x*r,i.height=a.y*r,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version),this.wmsParams[this._wmsVersion>=1.3?"crs":"srs"]=this._crs.code,ui.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),n=this._crs,i=b(n.project(e[0]),n.project(e[1])),o=i.min,r=i.max,a=(this._wmsVersion>=1.3&&this._crs===Nn?[o.y,o.x,r.y,r.x]:[o.x,o.y,r.x,r.y]).join(","),s=ui.prototype.getTileUrl.call(this,t);return s+c(this.wmsParams,s,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+a},setParams:function(t,n){return e(this.wmsParams,t),n||this.redraw(),this}});ui.WMS=hi,Wt.wms=function(t,e){return new hi(t,e)};var ci=Vn.extend({options:{padding:.1},initialize:function(t){h(this,t),i(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),G(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 t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var n=this._map.getZoomScale(e,this._zoom),i=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),r=i.multiplyBy(-n).add(o).subtract(this._map._getNewPixelOrigin(t,e));Qe.any3d?$(this._container,r,n):J(this._container,r)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),n=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new w(n,n.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),di=ci.extend({options:{tolerance:0},getEvents:function(){var t=ci.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ci.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");at(t,"mousemove",this._onMouseMove,this),at(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),at(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){y(this._redrawRequest),delete this._ctx,V(this._container),st(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){ci.prototype._update.call(this);var t=this._bounds,e=this._container,n=t.getSize(),i=Qe.retina?2:1;J(e,t.min),e.width=i*n.x,e.height=i*n.y,e.style.width=n.x+"px",e.style.height=n.y+"px",Qe.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){ci.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[i(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,n=e.next,o=e.prev;n?n.prev=o:this._drawLast=o,o?o.next=n:this._drawFirst=n,delete t._order,delete this._layers[i(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,n,i=t.options.dashArray.split(/[, ]+/),o=[];for(n=0;n')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),fi={_initContainer:function(){this._container=F("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ci.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=pi("shape");G(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=pi("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[i(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;V(e),t.removeInteractiveTarget(e),delete this._layers[i(t)]},_updateStyle:function(t){var e=t._stroke,n=t._fill,i=t.options,o=t._container;o.stroked=!!i.stroke,o.filled=!!i.fill,i.stroke?(e||(e=t._stroke=pi("stroke")),o.appendChild(e),e.weight=i.weight+"px",e.color=i.color,e.opacity=i.opacity,e.dashStyle=i.dashArray?qt(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):"",e.endcap=i.lineCap.replace("butt","flat"),e.joinstyle=i.lineJoin):e&&(o.removeChild(e),t._stroke=null),i.fill?(n||(n=t._fill=pi("fill")),o.appendChild(n),n.color=i.fillColor||i.color,n.opacity=i.fillOpacity):n&&(o.removeChild(n),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),n=Math.round(t._radius),i=Math.round(t._radiusY||n);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+n+","+i+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){H(t._container)},_bringToBack:function(t){W(t._container)}},gi=Qe.vml?pi:P,mi=ci.extend({_initContainer:function(){this._container=gi("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=gi("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){V(this._container),st(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){ci.prototype._update.call(this);var t=this._bounds,e=t.getSize(),n=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,n.setAttribute("width",e.x),n.setAttribute("height",e.y)),J(n,t.min),n.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=gi("path");t.options.className&&G(e,t.options.className),t.options.interactive&&G(e,"leaflet-interactive"),this._updateStyle(t),this._layers[i(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){V(t._path),t.removeInteractiveTarget(t._path),delete this._layers[i(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,n=t.options;e&&(n.stroke?(e.setAttribute("stroke",n.color),e.setAttribute("stroke-opacity",n.opacity),e.setAttribute("stroke-width",n.weight),e.setAttribute("stroke-linecap",n.lineCap),e.setAttribute("stroke-linejoin",n.lineJoin),n.dashArray?e.setAttribute("stroke-dasharray",n.dashArray):e.removeAttribute("stroke-dasharray"),n.dashOffset?e.setAttribute("stroke-dashoffset",n.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),n.fill?(e.setAttribute("fill",n.fillColor||n.color),e.setAttribute("fill-opacity",n.fillOpacity),e.setAttribute("fill-rule",n.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,D(t._parts,e))},_updateCircle:function(t){var e=t._point,n=Math.max(Math.round(t._radius),1),i="a"+n+","+(Math.max(Math.round(t._radiusY),1)||n)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-n)+","+e.y+i+2*n+",0 "+i+2*-n+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){H(t._path)},_bringToBack:function(t){W(t._path)}});Qe.vml&&mi.include(fi),xn.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&jt(t)||Gt(t)}});var yi=$n.extend({initialize:function(t,e){$n.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=T(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});mi.create=gi,mi.pointsToPath=D,Jn.geometryToLayer=zt,Jn.coordsToLatLng=Rt,Jn.coordsToLatLngs=Bt,Jn.latLngToCoords=Nt,Jn.latLngsToCoords=Ft,Jn.getFeature=Vt,Jn.asFeature=Zt,xn.mergeOptions({boxZoom:!0});var vi=kn.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){at(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){st(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){V(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),he(),tt(),this._startPoint=this._map.mouseEventToContainerPoint(t),at(document,{contextmenu:gt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=F("div","leaflet-zoom-box",this._container),G(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new w(this._point,this._startPoint),n=e.getSize();J(this._box,e.min),this._box.style.width=n.x+"px",this._box.style.height=n.y+"px"},_finish:function(){this._moved&&(V(this._box),U(this._container,"leaflet-crosshair")),ce(),et(),st(document,{contextmenu:gt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(n(this._resetState,this),0);var e=new S(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});xn.addInitHook("addHandler","boxZoom",vi),xn.mergeOptions({doubleClickZoom:!0});var _i=kn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,n=e.getZoom(),i=e.options.zoomDelta,o=t.originalEvent.shiftKey?n-i:n+i;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});xn.addInitHook("addHandler","doubleClickZoom",_i),xn.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var xi=kn.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new Dn(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}G(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){U(this._map._container,"leaflet-grab"),U(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 t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=T(this._map.options.maxBounds);this._offsetLimit=b(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.xe.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),n=this._initialWorldOffset,i=this._draggable._newPos.x,o=(i-e+n)%t+e-n,r=(i+e+n)%t-e-n,a=Math.abs(o+n)0?o:-o))-e;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}});xn.addInitHook("addHandler","scrollWheelZoom",bi),xn.mergeOptions({tapHold:Qe.touchNative&&Qe.safari&&Qe.mobile,tapTolerance:15});var Si=kn.extend({addHooks:function(){at(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){st(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),1===t.touches.length){var e=t.touches[0];this._startPos=this._newPos=new _(e.clientX,e.clientY),this._holdTimeout=setTimeout(n(function(){this._cancel(),this._isTapValid()&&(at(document,"touchend",ft),at(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),600),at(document,"touchend touchcancel contextmenu",this._cancel,this),at(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){st(document,"touchend",ft),st(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),st(document,"touchend touchcancel contextmenu",this._cancel,this),st(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new _(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var n=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});n._simulated=!0,e.target.dispatchEvent(n)}});xn.addInitHook("addHandler","tapHold",Si),xn.mergeOptions({touchZoom:Qe.touch,bounceAtZoomLimits:!0});var Ti=kn.extend({addHooks:function(){G(this._map._container,"leaflet-touch-zoom"),at(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){U(this._map._container,"leaflet-touch-zoom"),st(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var n=e.mouseEventToContainerPoint(t.touches[0]),i=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(n.add(i)._divideBy(2))),this._startDist=n.distanceTo(i),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),at(document,"touchmove",this._onTouchMove,this),at(document,"touchend touchcancel",this._onTouchEnd,this),ft(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),o=e.mouseEventToContainerPoint(t.touches[1]),r=i.distanceTo(o)/this._startDist;if(this._zoom=e.getScaleZoom(r,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoome.getMaxZoom()&&r>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===r)return}else{var a=i._add(o)._divideBy(2)._subtract(this._centerPoint);if(1===r&&0===a.x&&0===a.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(a),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),y(this._animRequest);var s=n(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=m(s,this,!0),ft(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,y(this._animRequest),st(document,"touchmove",this._onTouchMove,this),st(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))):this._zooming=!1}});xn.addInitHook("addHandler","touchZoom",Ti),xn.BoxZoom=vi,xn.DoubleClickZoom=_i,xn.Drag=xi,xn.Keyboard=wi,xn.ScrollWheelZoom=bi,xn.TapHold=Si,xn.TouchZoom=Ti,t.Bounds=w,t.Browser=Qe,t.CRS=re,t.Canvas=di,t.Circle=qn,t.CircleMarker=Xn,t.Class=v,t.Control=wn,t.DivIcon=si,t.DivOverlay=oi,t.DomEvent=vn,t.DomUtil=fn,t.Draggable=Dn,t.Evented=ne,t.FeatureGroup=Hn,t.GeoJSON=Jn,t.GridLayer=li,t.Handler=kn,t.Icon=Wn,t.ImageOverlay=ei,t.LatLng=M,t.LatLngBounds=S,t.Layer=Vn,t.LayerGroup=Zn,t.LineUtil=On,t.Map=xn,t.Marker=Un,t.Mixin=Ln,t.Path=Yn,t.Point=_,t.PolyUtil=An,t.Polygon=$n,t.Polyline=Kn,t.Popup=ri,t.PosAnimation=_n,t.Projection=Rn,t.Rectangle=yi,t.Renderer=ci,t.SVG=mi,t.SVGOverlay=ii,t.TileLayer=ui,t.Tooltip=ai,t.Transformation=k,t.Util=te,t.VideoOverlay=ni,t.bind=n,t.bounds=b,t.canvas=jt,t.circle=function(t,e,n){return new qn(t,e,n)},t.circleMarker=function(t,e){return new Xn(t,e)},t.control=bn,t.divIcon=function(t){return new si(t)},t.extend=e,t.featureGroup=function(t,e){return new Hn(t,e)},t.geoJSON=Ht,t.geoJson=ti,t.gridLayer=function(t){return new li(t)},t.icon=function(t){return new Wn(t)},t.imageOverlay=function(t,e,n){return new ei(t,e,n)},t.latLng=C,t.latLngBounds=T,t.layerGroup=function(t,e){return new Zn(t,e)},t.map=function(t,e){return new xn(t,e)},t.marker=function(t,e){return new Un(t,e)},t.point=x,t.polygon=function(t,e){return new $n(t,e)},t.polyline=function(t,e){return new Kn(t,e)},t.popup=function(t,e){return new ri(t,e)},t.rectangle=function(t,e){return new yi(t,e)},t.setOptions=h,t.stamp=i,t.svg=Gt,t.svgOverlay=function(t,e,n){return new ii(t,e,n)},t.tileLayer=Wt,t.tooltip=function(t,e){return new ai(t,e)},t.transformation=I,t.version="1.9.4",t.videoOverlay=function(t,e,n){return new ni(t,e,n)};var Mi=window.L;t.noConflict=function(){return window.L=Mi,this},window.L=t}(e)}},n={};t.d=(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";function e(t,e){function n(){this.constructor=t}if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Kp(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function n(){return vf++}function i(){for(var t=[],e=0;e>1)%2;a.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[s]+":0",o[l]+":0",i[1-s]+":auto",o[1-l]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}return e.clearMarkers=function(){c(n,function(t){t.parentNode&&t.parentNode.removeChild(t)})},n}(e,r),s=function(t,e,n){for(var i=n?"invTrans":"trans",o=e[i],r=e.srcCoords,a=[],s=[],l=!0,u=0;u<4;u++){var h=t[u].getBoundingClientRect(),c=2*u,d=h.left,p=h.top;a.push(d,p),l=l&&r&&d===r[c]&&p===r[c+1],s.push(t[u].offsetLeft,t[u].offsetTop)}return l&&o?o:(e.srcCoords=a,e[i]=n?rt(s,a):rt(a,s))}(a,r,o);if(s)return s(t,n,i),!0}return!1}function st(t){return"CANVAS"===t.nodeName.toUpperCase()}function lt(t){return null==t?"":(t+"").replace(Rf,function(t,e){return Bf[e]})}function ut(t,e,n,i){return n=n||{},i?ht(t,e,n):Vf&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):ht(t,e,n),n}function ht(t,e,n){if(Qp.domSupported&&t.getBoundingClientRect){var i=e.clientX,o=e.clientY;if(st(t)){var r=t.getBoundingClientRect();return n.zrX=i-r.left,void(n.zrY=o-r.top)}if(at(Ff,t,i,o))return n.zrX=Ff[0],void(n.zrY=Ff[1])}n.zrX=n.zrY=0}function ct(t){return t||window.event}function dt(t,e,n){if(null!=(e=ct(e)).zrX)return e;var i=e.type;if(i&&i.indexOf("touch")>=0){var o="touchend"!==i?e.targetTouches[0]:e.changedTouches[0];o&&ut(t,o,e,n)}else{ut(t,e,e,n);var r=function(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,i=t.deltaY;return null==n||null==i?e:3*(0!==i?Math.abs(i):Math.abs(n))*(i>0?-1:i<0?1:n>0?-1:1)}(e);e.zrDelta=r?r/120:-(e.detail||0)/3}var a=e.button;return null==e.which&&void 0!==a&&Nf.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function pt(t,e,n,i){t.addEventListener(e,n,i)}function ft(t,e,n,i){t.removeEventListener(e,n,i)}function gt(t){return 2===t.which||3===t.which}function mt(t){var e=t[1][0]-t[0][0],n=t[1][1]-t[0][1];return Math.sqrt(e*e+n*n)}function yt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function vt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function _t(t,e,n){var i=e[1]*n[0]+e[3]*n[1],o=e[0]*n[2]+e[2]*n[3],r=e[1]*n[2]+e[3]*n[3],a=e[0]*n[4]+e[2]*n[5]+e[4],s=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=e[0]*n[0]+e[2]*n[1],t[1]=i,t[2]=o,t[3]=r,t[4]=a,t[5]=s,t}function xt(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function wt(t,e,n,i){void 0===i&&(i=[0,0]);var o=e[0],r=e[2],a=e[4],s=e[1],l=e[3],u=e[5],h=Math.sin(n),c=Math.cos(n);return t[0]=o*c+s*h,t[1]=-o*h+s*c,t[2]=r*c+l*h,t[3]=-r*h+c*l,t[4]=c*(a-i[0])+h*(u-i[1])+i[0],t[5]=c*(u-i[1])-h*(a-i[0])+i[1],t}function bt(t,e){var n=e[0],i=e[2],o=e[4],r=e[1],a=e[3],s=e[5],l=n*a-r*i;return l?(t[0]=a*(l=1/l),t[1]=-r*l,t[2]=-i*l,t[3]=n*l,t[4]=(i*s-a*o)*l,t[5]=(r*o-n*s)*l,t):null}function St(t,e,n,i,o,r,a,s){var l=Xf(e-n),u=Xf(i-t),h=Uf(l,u),c=qf[o],d=qf[1-o],p=Kf[o];e=u||!eg.bidirectional)&&(ng[c]=-u,ng[d]=0,eg.useDir&&eg.calcDirMTV())))}function Tt(){function t(t){return Xf(t)<1e-10}var e=0,n=new Gf,i=new Gf,o={minTv:new Gf,maxTv:new Gf,useDir:!1,dirMinTv:new Gf,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(t,r){o.touchThreshold=0,t&&null!=t.touchThreshold&&(o.touchThreshold=Yf(0,t.touchThreshold)),o.negativeSize=!1,r&&(o.minTv.set(1/0,1/0),o.maxTv.set(0,0),o.useDir=!1,t&&null!=t.direction&&(o.useDir=!0,o.dirMinTv.copy(o.minTv),i.copy(o.minTv),e=t.direction,o.bidirectional=null==t.bidirectional||!!t.bidirectional,o.bidirectional||n.set(Math.cos(e),Math.sin(e))))},calcDirMTV:function(){var r=o.minTv,a=o.dirMinTv,s=r.y*r.y+r.x*r.x,l=Math.sin(e),u=Math.cos(e),h=l*r.y+u*r.x;t(h)?t(r.x)&&t(r.y)&&a.set(0,0):(i.x=s*u/h,i.y=s*l/h,t(i.x)&&t(i.y)?a.set(0,0):(o.bidirectional||n.dot(i)>0)&&i.len()=0;r--){var a=t[r],s=void 0;if(a!==o&&!a.ignore&&(s=Ct(a,n,i))&&(!e.topTarget&&(e.topTarget=a),s!==ug)){e.target=a;break}}}function It(t,e,n){var i=t.painter;return e<0||e>i.getWidth()||n<0||n>i.getHeight()}function Lt(t,e,n,i){var o=e+1;if(o===n)return 1;if(i(t[o++],t[e])<0){for(;o=0;)o++;return o-e}function Pt(t,e,n,i,o){for(i===e&&i++;i>>1])<0?l=r:s=r+1;var u=i-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;u>0;)t[s+u]=t[s+u-1],u--}t[s]=a}}function Dt(t,e,n,i,o,r){var a=0,s=0,l=1;if(r(t,e[n+o])>0){for(s=i-o;l0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=o,l+=o}else{for(s=o+1;ls&&(l=s);var u=a;a=o-l,l=o-u}for(a++;a>>1);r(t,e[n+h])>0?a=h+1:l=h}return l}function At(t,e,n,i,o,r){var a=0,s=0,l=1;if(r(t,e[n+o])<0){for(s=o+1;ls&&(l=s);var u=a;a=o-l,l=o-u}else{for(s=i-o;l=0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=o,l+=o}for(a++;a>>1);r(t,e[n+h])<0?l=h:a=h+1}return l}function Ot(t,e,n,i){n||(n=0),i||(i=t.length);var o=i-n;if(!(o<2)){var r=0;if(o<32)Pt(t,n,i,n+(r=Lt(t,n,i,e)),e);else{var a=function(t,e){function n(n){var l=i[n],u=o[n],h=i[n+1],c=o[n+1];o[n]=u+c,n===a-3&&(i[n+1]=i[n+2],o[n+1]=o[n+2]),a--;var d=At(t[h],t,l,u,0,e);l+=d,0!==(u-=d)&&0!==(c=Dt(t[l+u-1],t,h,c,c-1,e))&&(u<=c?function(n,i,o,a){var l=0;for(l=0;l=7||p>=7);if(f)break;g<0&&(g=0),g+=2}if((r=g)<1&&(r=1),1===i){for(l=0;l=0;l--)t[p+l]=t[d+l];if(0===i){y=!0;break}}if(t[c--]=s[h--],1===--a){y=!0;break}if(0!==(m=a-Dt(t[u],s,0,a,a-1,e))){for(a-=m,p=1+(c-=m),d=1+(h-=m),l=0;l=7||m>=7);if(y)break;f<0&&(f=0),f+=2}if((r=f)<1&&(r=1),1===a){for(p=1+(c-=i),d=1+(u-=i),l=i-1;l>=0;l--)t[p+l]=t[d+l];t[c]=s[h]}else{if(0===a)throw new Error;for(d=c-(a-1),l=0;l=0;l--)t[p+l]=t[d+l];t[c]=s[h]}else for(d=c-(a-1),l=0;l1;){var t=a-2;if(t>=1&&o[t-1]<=o[t]+o[t+1]||t>=2&&o[t-2]<=o[t]+o[t-1])o[t-1]o[t+1])break;n(t)}},forceMergeRuns:function(){for(;a>1;){var t=a-2;t>0&&o[t-1]=32;)e|=1&t,t>>=1;return t+e}(o);do{if((r=Lt(t,n,i,e))s&&(l=s),Pt(t,n,n+l,n+r,e),r=l}a.pushRun(n,r),a.mergeRuns(),o-=r,n+=r}while(0!==o);a.forceMergeRuns()}}}function zt(){mg||(mg=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Et(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}function Rt(t){return t>-1e-8&&tTg||t<-1e-8}function Nt(t,e,n,i,o){var r=1-o;return r*r*(r*t+3*o*e)+o*o*(o*i+3*r*n)}function Ft(t,e,n,i,o){var r=1-o;return 3*(((e-t)*r+2*(n-e)*o)*r+(i-n)*o*o)}function Vt(t,e,n,i,o,r){var a=i+3*(e-n)-t,s=3*(n-2*e+t),l=3*(e-t),u=t-o,h=s*s-3*a*l,c=s*l-9*a*u,d=l*l-3*s*u,p=0;if(Rt(h)&&Rt(c))Rt(s)?r[0]=0:(T=-l/s)>=0&&T<=1&&(r[p++]=T);else{var f=c*c-4*h*d;if(Rt(f)){var g=c/h,m=-g/2;(T=-s/a+g)>=0&&T<=1&&(r[p++]=T),m>=0&&m<=1&&(r[p++]=m)}else if(f>0){var y=Sg(f),v=h*s+1.5*a*(-c+y),_=h*s+1.5*a*(-c-y);(T=(-s-((v=v<0?-bg(-v,kg):bg(v,kg))+(_=_<0?-bg(-_,kg):bg(_,kg))))/(3*a))>=0&&T<=1&&(r[p++]=T)}else{var x=(2*h*s-3*a*c)/(2*Sg(h*h*h)),w=Math.acos(x)/3,b=Sg(h),S=Math.cos(w),T=(-s-2*b*S)/(3*a),M=(m=(-s+b*(S+Cg*Math.sin(w)))/(3*a),(-s+b*(S-Cg*Math.sin(w)))/(3*a));T>=0&&T<=1&&(r[p++]=T),m>=0&&m<=1&&(r[p++]=m),M>=0&&M<=1&&(r[p++]=M)}}return p}function Zt(t,e,n,i,o){var r=6*n-12*e+6*t,a=9*e+3*i-3*t-9*n,s=3*e-3*t,l=0;if(Rt(a))Bt(r)&&(h=-s/r)>=0&&h<=1&&(o[l++]=h);else{var u=r*r-4*a*s;if(Rt(u))o[0]=-r/(2*a);else if(u>0){var h,c=Sg(u),d=(-r-c)/(2*a);(h=(-r+c)/(2*a))>=0&&h<=1&&(o[l++]=h),d>=0&&d<=1&&(o[l++]=d)}}return l}function Ht(t,e,n,i,o,r){var a=(e-t)*o+t,s=(n-e)*o+e,l=(i-n)*o+n,u=(s-a)*o+a,h=(l-s)*o+s,c=(h-u)*o+u;r[0]=t,r[1]=a,r[2]=u,r[3]=c,r[4]=c,r[5]=h,r[6]=l,r[7]=i}function Wt(t,e,n,i,o,r,a,s,l){for(var u=t,h=e,c=0,d=1/l,p=1;p<=l;p++){var f=p*d,g=Nt(t,n,o,a,f),m=Nt(e,i,r,s,f),y=g-u,v=m-h;c+=Math.sqrt(y*y+v*v),u=g,h=m}return c}function jt(t,e,n,i){var o=1-i;return o*(o*t+2*i*e)+i*i*n}function Gt(t,e,n,i){return 2*((1-i)*(e-t)+i*(n-e))}function Ut(t,e,n){var i=t+n-2*e;return 0===i?.5:(t-e)/i}function Yt(t,e,n,i,o){var r=(e-t)*i+t,a=(n-e)*i+e,s=(a-r)*i+r;o[0]=t,o[1]=r,o[2]=s,o[3]=s,o[4]=a,o[5]=n}function Xt(t,e,n,i,o,r,a){for(var s=t,l=e,u=0,h=1/a,c=1;c<=a;c++){var d=c*h,p=jt(t,n,o,d),f=jt(e,i,r,d),g=p-s,m=f-l;u+=Math.sqrt(g*g+m*m),s=p,l=f}return u}function qt(t){var e=t&&Dg.exec(t);if(e){var n=e[1].split(","),i=+z(n[0]),o=+z(n[1]),r=+z(n[2]),a=+z(n[3]);if(isNaN(i+o+r+a))return;var s=[];return function(t){return t<=0?0:t>=1?1:Vt(0,i,r,1,t,s)&&Nt(0,o,a,1,s[0])}}}function Kt(t){return(t=Math.round(t))<0?0:t>255?255:t}function $t(t){return t<0?0:t>1?1:t}function Jt(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?Kt(parseFloat(e)/100*255):Kt(parseInt(e,10))}function Qt(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?$t(parseFloat(e)/100):$t(parseFloat(e))}function te(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function ee(t,e,n,i,o){return t[0]=e,t[1]=n,t[2]=i,t[3]=o,t}function ne(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function ie(t,e){Fg&&ne(Fg,e),Fg=Ng.put(t,Fg||e.slice())}function oe(t,e){if(t){e=e||[];var n=Ng.get(t);if(n)return ne(e,n);var i=(t+="").replace(/ /g,"").toLowerCase();if(i in Bg)return ne(e,Bg[i]),ie(t,e),e;var o,r=i.length;if("#"===i.charAt(0))return 4===r||5===r?(o=parseInt(i.slice(1,4),16))>=0&&o<=4095?(ee(e,(3840&o)>>4|(3840&o)>>8,240&o|(240&o)>>4,15&o|(15&o)<<4,5===r?parseInt(i.slice(4),16)/15:1),ie(t,e),e):void ee(e,0,0,0,1):7===r||9===r?(o=parseInt(i.slice(1,7),16))>=0&&o<=16777215?(ee(e,(16711680&o)>>16,(65280&o)>>8,255&o,9===r?parseInt(i.slice(7),16)/255:1),ie(t,e),e):void ee(e,0,0,0,1):void 0;var a=i.indexOf("("),s=i.indexOf(")");if(-1!==a&&s+1===r){var l=i.substr(0,a),u=i.substr(a+1,s-(a+1)).split(","),h=1;switch(l){case"rgba":if(4!==u.length)return 3===u.length?ee(e,+u[0],+u[1],+u[2],1):ee(e,0,0,0,1);h=Qt(u.pop());case"rgb":return u.length>=3?(ee(e,Jt(u[0]),Jt(u[1]),Jt(u[2]),3===u.length?h:Qt(u[3])),ie(t,e),e):void ee(e,0,0,0,1);case"hsla":return 4!==u.length?void ee(e,0,0,0,1):(u[3]=Qt(u[3]),re(u,e),ie(t,e),e);case"hsl":return 3!==u.length?void ee(e,0,0,0,1):(re(u,e),ie(t,e),e);default:return}}ee(e,0,0,0,1)}}function re(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=Qt(t[1]),o=Qt(t[2]),r=o<=.5?o*(i+1):o+i-o*i,a=2*o-r;return ee(e=e||[],Kt(255*te(a,r,n+1/3)),Kt(255*te(a,r,n)),Kt(255*te(a,r,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function ae(t,e){var n=oe(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,n[i]>255?n[i]=255:n[i]<0&&(n[i]=0);return le(n,4===n.length?"rgba":"rgb")}}function se(t,e,n,i){var o,r=oe(t);if(t)return r=function(t){if(t){var e,n,i=t[0]/255,o=t[1]/255,r=t[2]/255,a=Math.min(i,o,r),s=Math.max(i,o,r),l=s-a,u=(s+a)/2;if(0===l)e=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var h=((s-i)/6+l/2)/l,c=((s-o)/6+l/2)/l,d=((s-r)/6+l/2)/l;i===s?e=d-c:o===s?e=1/3+h-d:r===s&&(e=2/3+c-h),e<0&&(e+=1),e>1&&(e-=1)}var p=[360*e,n,u];return null!=t[3]&&p.push(t[3]),p}}(r),null!=e&&(r[0]=(o=v(e)?e(r[0]):e,(o=Math.round(o))<0?0:o>360?360:o)),null!=n&&(r[1]=Qt(v(n)?n(r[1]):n)),null!=i&&(r[2]=Qt(v(i)?i(r[2]):i)),le(re(r),"rgba")}function le(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}function ue(t,e){var n=oe(t);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*e:0}function he(t){if(_(t)){var e=Vg.get(t);return e||(e=ae(t,-.1),Vg.put(t,e)),e}if(C(t)){var n=a({},t);return n.colorStops=d(t.colorStops,function(t){return{offset:t.offset,color:ae(t.color,-.1)}}),n}return t}function ce(t){var e;if(t&&"transparent"!==t){if("string"==typeof t&&t.indexOf("rgba")>-1){var n=oe(t);n&&(t="rgb("+n[0]+","+n[1]+","+n[2]+")",e=n[3])}}else t="none";return{color:t,opacity:null==e?1:e}}function de(t){return t-1e-4}function pe(t){return Zg(1e3*t)/1e3}function fe(t){return Zg(1e4*t)/1e4}function ge(t){return t&&!!t.image}function me(t){return ge(t)||function(t){return t&&!!t.svgElement}(t)}function ye(t){return"linear"===t.type}function ve(t){return"radial"===t.type}function _e(t){return t&&("linear"===t.type||"radial"===t.type)}function xe(t){return"url(#"+t+")"}function we(t){var e=t.getGlobalScale(),n=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(n)/Math.log(10)),1)}function be(t){var e=t.x||0,n=t.y||0,i=(t.rotation||0)*Tf,o=L(t.scaleX,1),r=L(t.scaleY,1),a=t.skewX||0,s=t.skewY||0,l=[];return(e||n)&&l.push("translate("+e+"px,"+n+"px)"),i&&l.push("rotate("+i+")"),1===o&&1===r||l.push("scale("+o+","+r+")"),(a||s)&&l.push("skew("+Zg(a*Tf)+"deg, "+Zg(s*Tf)+"deg)"),l.join(" ")}function Se(t,e,n){return(e-t)*n+t}function Te(t,e,n,i){for(var o=e.length,r=0;ri?e:t,r=Math.min(n,i),a=o[r-1]||{color:[0,0,0,0],offset:0},s=r;sa)i.length=a;else for(var s=r;sgm||t<-5e-5}function Ve(t,e){for(var n=0;n=Mm)){t=t||of;for(var e=[],n=+new Date,i=0;i<=127;i++)e[i]=af.measureText(String.fromCharCode(i),t).width;var o=+new Date-n;return o>16?Tm=Mm:o>2&&Tm++,e}}(t.font),t.asciiWidthMapTried=!0),0<=e&&e<=127?null!=t.asciiWidthMap?t.asciiWidthMap[e]:t.asciiCharWidth:t.stWideCharWidth}function We(t,e){var n=t.strWidthCache,i=n.get(e);return null==i&&(i=af.measureText(e,t.font).width,n.put(e,i)),i}function je(t,e,n,i){var o=We(Ze(e),t),r=Xe(e),a=Ue(0,o,n),s=Ye(0,r,i);return new lg(a,s,o,r)}function Ge(t,e,n,i){var o=((t||"")+"").split("\n");if(1===o.length)return je(o[0],e,n,i);for(var r=new lg(0,0,0,0),a=0;a=0?parseFloat(t)/100*e:parseFloat(t):t}function Ke(t,e,n){var i=e.position||"inside",o=null!=e.distance?e.distance:5,r=n.height,a=n.width,s=r/2,l=n.x,u=n.y,h="left",c="top";if(i instanceof Array)l+=qe(i[0],n.width),u+=qe(i[1],n.height),h=null,c=null;else switch(i){case"left":l-=o,u+=s,h="right",c="middle";break;case"right":l+=o+a,u+=s,c="middle";break;case"top":l+=a/2,u-=o,h="center",c="bottom";break;case"bottom":l+=a/2,u+=r+o,h="center";break;case"inside":l+=a/2,u+=s,h="center",c="middle";break;case"insideLeft":l+=o,u+=s,c="middle";break;case"insideRight":l+=a-o,u+=s,h="right",c="middle";break;case"insideTop":l+=a/2,u+=o,h="center";break;case"insideBottom":l+=a/2,u+=r-o,h="center",c="bottom";break;case"insideTopLeft":l+=o,u+=o;break;case"insideTopRight":l+=a-o,u+=o,h="right";break;case"insideBottomLeft":l+=o,u+=r-o,c="bottom";break;case"insideBottomRight":l+=a-o,u+=r-o,h="right",c="bottom"}return(t=t||{}).x=l,t.y=u,t.align=h,t.verticalAlign=c,t}function $e(t,e,n,i,o){var r=[];tn(t,"",t,e,n=n||{},i,r,o);var a=r.length,s=!1,l=n.done,u=n.aborted,h=function(){s=!0,--a<=0&&(s?l&&l():u&&u())},c=function(){--a<=0&&(s?l&&l():u&&u())};a||l&&l(),r.length>0&&n.during&&r[0].during(function(t,e){n.during(e)});for(var d=0;d0||o.force&&!a.length){var k,I=void 0,L=void 0,P=void 0;if(s)for(L={},m&&(I={}),T=0;T0){if(t<=o)return a;if(t>=r)return s}else{if(t>=o)return a;if(t<=r)return s}else{if(t===o)return a;if(t===r)return s}return(t-o)/l*u+a}function on(t,e,n){return _(t)?(i=t,i.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(t)/100*e+(n||0):parseFloat(t):null==t?NaN:+t;var i}function rn(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),n?t:+t}function an(t){if(t=+t,isNaN(t))return 0;if(t>1e-14)for(var e=1,n=0;n<15;n++,e*=10)if(Math.round(t*e)/e===t)return n;return function(t){var e=t.toString().toLowerCase(),n=e.indexOf("e"),i=n>0?+e.slice(n+1):0,o=n>0?n:e.length,r=e.indexOf(".");return Math.max(0,(r<0?0:o-1-r)-i)}(t)}function sn(t,e){var n=Math.log,i=Math.LN10,o=Math.floor(n(t[1]-t[0])/i),r=Math.round(n(Wm(e[1]-e[0]))/i),a=Math.min(Math.max(-o+r,0),20);return isFinite(a)?a:20}function ln(t,e){var n=Math.max(an(t),an(e)),i=t+e;return n>20?i:rn(i,n)}function un(t){var e=2*Math.PI;return(t%e+e)%e}function hn(t){return t>-1e-4&&t=10&&e++,e}function pn(t,e){var n=dn(t),i=Math.pow(10,n),o=t/i;return t=(e?o<1.5?1:o<2.5?2:o<4?3:o<7?5:10:o<1?1:o<2?2:o<3?3:o<5?5:10)*i,n>=-20?+t.toFixed(n<0?-n:0):t}function fn(t){var e=parseFloat(t);return e==t&&(0!==e||!_(t)||t.indexOf("x")<=0)?e:NaN}function gn(){return Math.round(9*Math.random())}function mn(t,e){return 0===e?t:mn(e,t%e)}function yn(t,e){return null==t?e:null==e?t:t*e/mn(t,e)}function vn(t){return t instanceof Array?t:null==t?[]:[t]}function _n(t,e,n){if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};for(var i=0,o=n.length;i=0||o&&l(o,s)<0)){var u=n.getShallow(s,e);null!=u&&(r[t[a][0]]=u)}}return r}}function Zn(t){if("string"==typeof t){var e=iy.get(t);return e&&e.image}return t}function Hn(t,e,n,i,o){if(t){if("string"==typeof t){if(e&&e.__zrImageSrc===t||!n)return e;var r=iy.get(t),a={hostEl:n,cb:i,cbPayload:o};return r?!jn(e=r.image)&&r.pending.push(a):((e=af.loadImage(t,Wn,Wn)).__zrImageSrc=t,iy.put(t,e.__cachedImgObj={image:e,pending:[a]})),e}return t}return e}function Wn(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=l;h++)u-=l;var c=We(s,n);return c>u&&(n="",c=0),u=t-c,o.ellipsis=n,o.ellipsisWidth=c,o.contentWidth=u,o.containerWidth=t,o}function Yn(t,e,n){var i=n.containerWidth,o=n.contentWidth,r=n.fontMeasureInfo;if(!i)return t.textLine="",void(t.isTruncated=!1);var a=We(r,e);if(a<=i)return t.textLine=e,void(t.isTruncated=!1);for(var s=0;;s++){if(a<=o||s>=n.maxIterations){e+=n.ellipsis;break}var l=0===s?Xn(e,o,r):a>0?Math.floor(e.length*o/a):0;a=We(r,e=e.substr(0,l))}""===e&&(e=n.placeholder),t.textLine=e,t.isTruncated=!0}function Xn(t,e,n){for(var i=0,o=0,r=t.length;o0&&f+i.accumWidth>i.width&&(r=e.split("\n"),c=!0),i.accumWidth=f}else{var g=$n(e,h,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+p,a=g.linesWidths,r=g.lines}}r||(r=e.split("\n"));for(var m=Ze(h),y=0;y=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}(t)||!!ly[t]}function $n(t,e,n,i,o){for(var r=[],a=[],s="",l="",u=0,h=0,c=Ze(e),d=0;dn:o+h+f>n)?h?(s||l)&&(g?(s||(s=l,l="",h=u=0),r.push(s),a.push(h-u),l+=p,s="",h=u+=f):(l&&(s+=l,l="",u=0),r.push(s),a.push(h),s=p,h=f)):g?(r.push(l),a.push(u),l=p,u=f):(r.push(p),a.push(f)):(h+=f,g?(l+=p,u+=f):(l&&(s+=l,l="",u=0),s+=p))}else l&&(s+=l,h+=u),r.push(s),a.push(h),s="",l="",u=0,h=0}return l&&(s+=l),s&&(r.push(s),a.push(h)),1===r.length&&(h+=o),{accumWidth:h,lines:r,linesWidths:a}}function Jn(t,e,n,i,o,r){if(t.baseX=n,t.baseY=i,t.outerWidth=t.outerHeight=null,e){var a=2*e.width,s=2*e.height;lg.set(uy,Ue(n,a,o),Ye(i,s,r),a,s),lg.intersect(e,uy,null,hy);var l=hy.outIntersectRect;t.outerWidth=l.width,t.outerHeight=l.height,t.baseX=Ue(l.x,l.width,o,!0),t.baseY=Ye(l.y,l.height,r,!0)}}function Qn(t){return null!=t?t+="":t=""}function ti(t,e,n,i){var o=new lg(Ue(t.x||0,e,t.textAlign),Ye(t.y||0,n,t.textBaseline),e,n),r=null!=i?i:ei(t)?t.lineWidth:0;return r>0&&(o.x-=r/2,o.y-=r/2,o.width+=r,o.height+=r),o}function ei(t){var e=t.stroke;return null!=e&&"none"!==e&&t.lineWidth>0}function ni(t,e,n,i,o,r){o[0]=xy(t,n),o[1]=xy(e,i),r[0]=wy(t,n),r[1]=wy(e,i)}function ii(t,e,n,i,o,r,a,s,l,u){var h=Zt,c=Nt,d=h(t,n,o,a,Iy);l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0;for(var p=0;p1e-4)return s[0]=t-n,s[1]=e-i,l[0]=t+n,void(l[1]=e+i);if(My[0]=Sy(o)*n+t,My[1]=by(o)*i+e,Cy[0]=Sy(r)*n+t,Cy[1]=by(r)*i+e,u(s,My,Cy),h(l,My,Cy),(o%=Ty)<0&&(o+=Ty),(r%=Ty)<0&&(r+=Ty),o>r&&!a?r+=Ty:oo&&(ky[0]=Sy(p)*n+t,ky[1]=by(p)*i+e,u(s,ky,s),h(l,ky,l))}function ai(t){return Math.round(t/Hy*1e8)/1e8%2*Hy}function si(t,e,n,i,o,r,a){if(0===o)return!1;var s,l=o;if(a>e+l&&a>i+l||at+l&&r>n+l||re+c&&h>i+c&&h>r+c&&h>s+c||ht+c&&u>n+c&&u>o+c&&u>a+c||u=0&&pe+u&&l>i+u&&l>r+u||lt+u&&s>n+u&&s>o+u||s=0&&gn||h+uo&&(o+=qy);var d=Math.atan2(l,s);return d<0&&(d+=qy),d>=i&&d<=o||d+qy>=i&&d+qy<=o}function di(t,e,n,i,o,r){if(r>e&&r>i||ro?s:0}function pi(){var t=Qy[0];Qy[0]=Qy[1],Qy[1]=t}function fi(t,e,n,i,o,r,a,s,l,u){if(u>e&&u>i&&u>r&&u>s||u1&&pi(),p=Nt(e,i,r,s,Qy[0]),d>1&&(f=Nt(e,i,r,s,Qy[1]))),c+=2===d?me&&s>i&&s>r||s=0&&h<=1&&(o[l++]=h);else{var u=a*a-4*r*s;if(Rt(u))(h=-a/(2*r))>=0&&h<=1&&(o[l++]=h);else if(u>0){var h,c=Sg(u),d=(-a-c)/(2*r);(h=(-a+c)/(2*r))>=0&&h<=1&&(o[l++]=h),d>=0&&d<=1&&(o[l++]=d)}}return l}(e,i,r,s,Jy);if(0===l)return 0;var u=Ut(e,i,r);if(u>=0&&u<=1){for(var h=0,c=jt(e,i,r,u),d=0;dn||s<-n)return 0;var l=Math.sqrt(n*n-s*s);Jy[0]=-l,Jy[1]=l;var u=Math.abs(i-o);if(u<1e-4)return 0;if(u>=$y-1e-4){i=0,o=$y;var h=r?1:-1;return a>=Jy[0]+t&&a<=Jy[1]+t?h:0}if(i>o){var c=i;i=o,o=c}i<0&&(i+=$y,o+=$y);for(var d=0,p=0;p<2;p++){var f=Jy[p];if(f+t>a){var g=Math.atan2(s,f);h=r?1:-1,g<0&&(g=$y+g),(g>=i&&g<=o||g+$y>=i&&g+$y<=o)&&(g>Math.PI/2&&g<1.5*Math.PI&&(h=-h),d+=h)}}return d}function yi(t,e,n,i,o){for(var r,a,s=t.data,l=t.len(),u=0,h=0,c=0,d=0,p=0,f=0;f1&&(n||(u+=di(h,c,d,p,i,o))),m&&(d=h=s[f],p=c=s[f+1]),g){case Ky.M:h=d=s[f++],c=p=s[f++];break;case Ky.L:if(n){if(si(h,c,s[f],s[f+1],e,i,o))return!0}else u+=di(h,c,s[f],s[f+1],i,o)||0;h=s[f++],c=s[f++];break;case Ky.C:if(n){if(li(h,c,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],e,i,o))return!0}else u+=fi(h,c,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],i,o)||0;h=s[f++],c=s[f++];break;case Ky.Q:if(n){if(ui(h,c,s[f++],s[f++],s[f],s[f+1],e,i,o))return!0}else u+=gi(h,c,s[f++],s[f++],s[f],s[f+1],i,o)||0;h=s[f++],c=s[f++];break;case Ky.A:var y=s[f++],v=s[f++],_=s[f++],x=s[f++],w=s[f++],b=s[f++];f+=1;var S=!!(1-s[f++]);r=Math.cos(w)*_+y,a=Math.sin(w)*x+v,m?(d=r,p=a):u+=di(h,c,r,a,i,o);var T=(i-y)*x/_+y;if(n){if(ci(y,v,x,w,w+b,S,e,T,o))return!0}else u+=mi(y,v,x,w,w+b,S,T,o);h=Math.cos(w+b)*_+y,c=Math.sin(w+b)*x+v;break;case Ky.R:if(d=h=s[f++],p=c=s[f++],r=d+s[f++],a=p+s[f++],n){if(si(d,p,r,p,e,i,o)||si(r,p,r,a,e,i,o)||si(r,a,d,a,e,i,o)||si(d,a,d,p,e,i,o))return!0}else u+=di(r,p,r,a,i,o),u+=di(d,a,d,p,i,o);break;case Ky.Z:if(n){if(si(h,c,d,p,e,i,o))return!0}else u+=di(h,c,d,p,i,o);h=d,c=p}}return n||Math.abs(c-p)<1e-4||(u+=di(h,c,d,p,i,o)||0),0!==u}function vi(t,e,n){if(e){var i=e.x1,o=e.x2,r=e.y1,a=e.y2;t.x1=i,t.x2=o,t.y1=r,t.y2=a;var s=n&&n.lineWidth;return s?(dv(2*i)===dv(2*o)&&(t.x1=t.x2=xi(i,s,!0)),dv(2*r)===dv(2*a)&&(t.y1=t.y2=xi(r,s,!0)),t):t}}function _i(t,e,n){if(e){var i=e.x,o=e.y,r=e.width,a=e.height;t.x=i,t.y=o,t.width=r,t.height=a;var s=n&&n.lineWidth;return s?(t.x=xi(i,s,!0),t.y=xi(o,s,!0),t.width=Math.max(xi(i+r,s,!1)-t.x,0===r?0:1),t.height=Math.max(xi(o+a,s,!1)-t.y,0===a?0:1),t):t}}function xi(t,e,n){if(!e)return t;var i=dv(2*t);return(i+dv(e))%2==0?i/2:(i+(n?1:-1))/2}function wi(t){return"string"!=typeof t||-1===t.indexOf("px")&&-1===t.indexOf("rem")&&-1===t.indexOf("em")?isNaN(+t)?"12px":t+"px":t}function bi(t,e){for(var n=0;n=0,r=!1;if(t instanceof ov){var s=Iv(t),u=o&&s.selectFill||s.normalFill,h=o&&s.selectStroke||s.normalStroke;if(Pi(u)||Pi(h)){var c=(i=i||{}).style||{};"inherit"===c.fill?(r=!0,i=a({},i),(c=a({},c)).fill=u):!Pi(c.fill)&&Pi(u)?(r=!0,i=a({},i),(c=a({},c)).fill=he(u)):!Pi(c.stroke)&&Pi(h)&&(r||(i=a({},i),c=a({},c)),c.stroke=he(h)),i.style=c}}if(i&&null==i.z2){r||(i=a({},i));var d=t.z2EmphasisLift;i.z2=t.z2+(null!=d?d:10)}return i}(this,0,e,n);if("blur"===t)return function(t,e,n){var i=l(t.currentStates,e)>=0,o=t.style.opacity,r=i?null:function(t,e,n,i){for(var o=t.style,r={},a=0;a0){var r={dataIndex:o,seriesIndex:t.seriesIndex};null!=i&&(r.dataType=i),e.push(r)}})}),e}function no(t,e,n){oo(t,!0),Fi(t,Zi),function(t,e,n){var i=Mv(t);null!=e?(i.focus=e,i.blurScope=n):i.focus&&(i.focus=null)}(t,e,n)}function io(t,e,n,i){i?function(t){oo(t,!1)}(t):no(t,e,n)}function oo(t,e){var n=!1===e,i=t;t.highDownSilentOnTouch&&(i.__highDownSilentOnTouch=t.highDownSilentOnTouch),n&&!i.__highDownDispatcher||(i.__highByOuter=i.__highByOuter||0,i.__highDownDispatcher=!n)}function ro(t){return!(!t||!t.__highDownDispatcher)}function ao(t){var e=t.type;return e===zv||e===Ev||e===Rv}function so(t){var e=t.type;return e===Av||e===Ov}function lo(t,e,n){var i,o=t.labelFetcher,r=t.labelDataIndex,a=t.labelDimIndex,s=e.normal;o&&(i=o.getFormattedLabel(r,"normal",null,a,s&&s.get("formatter"),null!=n?{interpolatedValue:n}:null)),null==i&&(i=v(t.defaultText)?t.defaultText(r,t,n):t.defaultText);for(var l={normal:i},u=0;u=12?"pm":"am",m=g.toUpperCase(),y=i instanceof i_?i:function(t){return u_[t]}(i||h_)||u_[s_],v=y.getModel("time"),_=v.get("month"),x=v.get("monthAbbr"),w=v.get("dayOfWeek"),b=v.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,g+"").replace(/{A}/g,m+"").replace(/{yyyy}/g,r+"").replace(/{yy}/g,_o(r%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,_[a-1]).replace(/{MMM}/g,x[a-1]).replace(/{MM}/g,_o(a,2)).replace(/{M}/g,a+"").replace(/{dd}/g,_o(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,w[u]).replace(/{ee}/g,b[u]).replace(/{e}/g,u+"").replace(/{HH}/g,_o(h,2)).replace(/{H}/g,h+"").replace(/{hh}/g,_o(c+"",2)).replace(/{h}/g,c+"").replace(/{mm}/g,_o(d,2)).replace(/{m}/g,d+"").replace(/{ss}/g,_o(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,_o(f,3)).replace(/{S}/g,f+"")}function So(t,e){var n=cn(t),i=n[Co(e)]()+1,o=n[ko(e)](),r=n[Io(e)](),a=n[Lo(e)](),s=n[Po(e)](),l=0===n[Do(e)](),u=l&&0===s,h=u&&0===a,c=h&&0===r,d=c&&1===o;return d&&1===i?"year":d?"month":c?"day":h?"hour":u?"minute":l?"second":"millisecond"}function To(t,e,n){switch(e){case"year":t[Oo(n)](0);case"month":t[zo(n)](1);case"day":t[Eo(n)](0);case"hour":t[Ro(n)](0);case"minute":t[Bo(n)](0);case"second":t[No(n)](0)}return t}function Mo(t){return t?"getUTCFullYear":"getFullYear"}function Co(t){return t?"getUTCMonth":"getMonth"}function ko(t){return t?"getUTCDate":"getDate"}function Io(t){return t?"getUTCHours":"getHours"}function Lo(t){return t?"getUTCMinutes":"getMinutes"}function Po(t){return t?"getUTCSeconds":"getSeconds"}function Do(t){return t?"getUTCMilliseconds":"getMilliseconds"}function Ao(t){return t?"setUTCFullYear":"setFullYear"}function Oo(t){return t?"setUTCMonth":"setMonth"}function zo(t){return t?"setUTCDate":"setDate"}function Eo(t){return t?"setUTCHours":"setHours"}function Ro(t){return t?"setUTCMinutes":"setMinutes"}function Bo(t){return t?"setUTCSeconds":"setSeconds"}function No(t){return t?"setUTCMilliseconds":"setMilliseconds"}function Fo(t){if(isNaN(fn(t)))return _(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function Vo(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}function Zo(t,e,n){function i(t){return t&&z(t)?t:"-"}function o(t){return!(null==t||isNaN(t)||!isFinite(t))}var r="time"===e,a=t instanceof Date;if(r||a){var s=r?cn(t):t;if(!isNaN(+s))return bo(s,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",n);if(a)return"-"}if("ordinal"===e)return x(t)?i(t):w(t)&&o(t)?t+"":"-";var l=fn(t);return o(l)?Fo(l):x(t)?i(t):"boolean"==typeof t?t+"":"-"}function Ho(t,e,n){y(e)||(e=[e]);var i=e.length;if(!i)return"";for(var o=e[0].$vars||[],r=0;ri||l.newline?(r=0,h=g,a+=s+n,s=d.height):s=Math.max(s,d.height)}else{var m=d.height+(f?-f.y+d.y:0);(c=a+m)>o||l.newline?(r+=s+n,a=0,c=m,s=d.width):s=Math.max(s,d.width)}l.newline||(l.x=r,l.y=a,l.markRedraw(),"horizontal"===t?r=h+n:a=c+n)})}function Yo(t,e,n){n=S_(n||0);var i=e.width,o=e.height,r=jm(t.left,i),a=jm(t.top,o),s=jm(t.right,i),l=jm(t.bottom,o),u=jm(t.width,i),h=jm(t.height,o),c=n[2]+n[0],d=n[1]+n[3],p=t.aspect;switch(isNaN(u)&&(u=i-s-d-r),isNaN(h)&&(h=o-l-c-a),null!=p&&(isNaN(u)&&isNaN(h)&&(p>i/o?u=.8*i:h=.8*o),isNaN(u)&&(u=p*h),isNaN(h)&&(h=u/p)),isNaN(r)&&(r=i-s-u-d),isNaN(a)&&(a=o-l-h-c),t.left||t.right){case"center":r=i/2-u/2-n[3];break;case"right":r=i-u-d}switch(t.top||t.bottom){case"middle":case"center":a=o/2-h/2-n[0];break;case"bottom":a=o-h-c}r=r||0,a=a||0,isNaN(u)&&(u=i-d-r-(s||0)),isNaN(h)&&(h=o-c-a-(l||0));var f=new lg((e.x||0)+r+n[3],(e.y||0)+a+n[0],u,h);return f.margin=n,f}function Xo(t,e,n){var i,o,r,a,s=t.boxCoordinateSystem;if(s){var l=function(t){var e=t.getShallow("coord",!0),n=L_;if(null==e){var i=D_.get(t.type);i&&i.getCoord2&&(n=P_,e=i.getCoord2(t))}return{coord:e,from:n}}(t),u=l.coord,h=l.from;if(s.dataToLayout){r=V_.rect,a=h;var c=s.dataToLayout(u);i=c.contentRect||c.rect}else n&&n.enableLayoutOnlyByCenter&&s.dataToPoint&&(r=V_.point,a=h,o=s.dataToPoint(u))}return null==r&&(r=V_.rect),r===V_.rect&&(i||(i={x:0,y:0,width:e.getWidth(),height:e.getHeight()}),o=[i.x+i.width/2,i.y+i.height/2]),{type:r,refContainer:i,refPoint:o,boxCoordFrom:a}}function qo(t,e,n,i,o,r){var a,l=!o||!o.hv||o.hv[0],u=!o||!o.hv||o.hv[1],h=o&&o.boundingMode||"all";if((r=r||t).x=t.x,r.y=t.y,!l&&!u)return!1;if("raw"===h)a="group"===t.type?new lg(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(a=t.getBoundingRect(),t.needLocalTransform()){var c=t.getLocalTransform();(a=a.clone()).applyTransform(c)}var d=Yo(s({width:a.width,height:a.height},e),n,i),p=l?d.x-a.x:0,f=u?d.y-a.y:0;return"raw"===h?(r.x=p,r.y=f):(r.x+=p,r.y+=f),r===t&&t.markRedraw(),!0}function Ko(t){var e=t.layoutMode||t.constructor.layoutMode;return b(e)?e:e?{type:e}:null}function $o(t,e,n){function i(n,i){var r={},s=0,l={},u=0;if(R_(n,function(e){l[e]=t[e]}),R_(n,function(t){Z(e,t)&&(r[t]=l[t]=e[t]),o(r,t)&&s++,o(l,t)&&u++}),a[i])return o(e,n[1])?l[n[2]]=null:o(e,n[2])&&(l[n[1]]=null),l;if(2!==u&&s){if(s>=2)return r;for(var h=0;h=e:"max"===n?t<=e:t===e})(i[a],t,r)||(o=!1)}}),o}function sr(t){var e=t&&t.itemStyle;if(e)for(var n=0,i=Bx.length;n65535?aw:sw}function jr(){return[1/0,-1/0]}function Gr(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function Ur(t,e,n,i,o){var r=hw[n||"float"];if(o){var a=t[e],s=a&&a.length;if(s!==i){for(var l=new r(i),u=0;u1||n>0&&!t.noHeader;return c(t.blocks,function(t){var n=ta(t);n>=e&&(e=n+ +(i&&(!n||Jr(t)&&!t.noHeader)))}),e}return 0}function ea(t,e,n,i){var o,r=e.noHeader,s=(o=ta(e),{html:fw[o],richText:gw[o]}),l=[],u=e.blocks||[];O(!u||y(u)),u=u||[];var h=t.orderMode;if(e.sortBlocks&&h){u=u.slice();var d={valueAsc:"asc",valueDesc:"desc"};if(Z(d,h)){var p=new nw(d[h],null);u.sort(function(t,e){return p.evaluate(t.sortParam,e.sortParam)})}else"seriesDesc"===h&&u.reverse()}c(u,function(n,o){var r=e.valueFormatter,u=Qr(n)(r?a(a({},t),{valueFormatter:r}):t,n,o>0?s.html:0,i);null!=u&&l.push(u)});var f="richText"===t.renderMode?l.join(s.richText):oa(i,l.join(""),r?n:s.html);if(r)return f;var g=Zo(e.header,"ordinal",t.useUTC),m=Kr(i,t.renderMode).nameStyle,v=qr(i);return"richText"===t.renderMode?ra(t,g,m)+s.richText+f:oa(i,'
'+lt(g)+"
"+f,n)}function na(t,e,n,i){var o=t.renderMode,r=e.noName,a=e.noValue,s=!e.markerType,l=e.name,u=t.useUTC,h=e.valueFormatter||t.valueFormatter||function(t){return d(t=y(t)?t:[t],function(t,e){return Zo(t,y(f)?f[e]:f,u)})};if(!r||!a){var c=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||X_.color.secondary,o),p=r?"":Zo(l,"ordinal",u),f=e.valueType,g=a?[]:h(e.value,e.dataIndex),m=!s||!r,v=!s&&r,_=Kr(i,o),x=_.nameStyle,w=_.valueStyle;return"richText"===o?(s?"":c)+(r?"":ra(t,p,x))+(a?"":function(t,e,n,i,o){var r=[o];return n&&r.push({padding:[0,0,0,i?10:20],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(y(e)?e.join(" "):e,r)}(t,g,m,v,w)):oa(i,(s?"":c)+(r?"":function(t,e,n){return''+lt(t)+""}(p,!s,x))+(a?"":function(t,e,n,i){return''+d(t=y(t)?t:[t],function(t){return lt(t)}).join("  ")+""}(g,m,v,w)),n)}}function ia(t,e,n,i,o,r){if(t)return Qr(t)({useUTC:o,renderMode:n,orderMode:i,markupStyleCreator:e,valueFormatter:t.valueFormatter},t,0,r)}function oa(t,e,n){return'
'+e+'
'}function ra(t,e,n){return t.markupStyleCreator.wrapRichTextStyle(e,n)}function aa(t,e){var n=t.get("padding");return null!=n?n:"richText"===e?[8,10]:10}function sa(t){var e,n,i,o,r=t.series,a=t.dataIndex,s=t.multipleSeries,l=r.getData(),u=l.mapDimensionsAll("defaultedTooltip"),h=u.length,d=r.getRawValue(a),f=y(d),g=function(t,e){return Wo(t.getData().getItemVisual(e,"style")[t.visualDrawType])}(r,a);if(h>1||f&&!h){var m=function(t,e,n,i,o){function r(t,e){var n=a.getDimensionInfo(e);n&&!1!==n.otherDims.tooltip&&(s?h.push($r("nameValue",{markerType:"subItem",markerColor:o,name:n.displayName,value:t,valueType:n.type})):(l.push(t),u.push(n.type)))}var a=e.getData(),s=p(t,function(t,e,n){var i=a.getDimensionInfo(n);return t||i&&!1!==i.tooltip&&null!=i.displayName},!1),l=[],u=[],h=[];return i.length?c(i,function(t){r(Or(a,n,t),t)}):c(t,r),{inlineValues:l,inlineValueTypes:u,blocks:h}}(d,r,a,u,g);e=m.inlineValues,n=m.inlineValueTypes,i=m.blocks,o=m.inlineValues[0]}else if(h){var v=l.getDimensionInfo(u[0]);o=e=Or(l,a,u[0]),n=v.type}else o=e=f?d[0]:d;var _=Cn(r),x=_&&r.name||"",w=l.getName(a),b=s?x:w;return $r("section",{header:x,noHeader:s||!_,sortParam:o,blocks:[$r("nameValue",{markerType:"item",markerColor:g,name:b,noName:!z(b),value:e,valueType:n,dataIndex:a})].concat(i||[])})}function la(t,e){return t.getName(e)||t.getId(e)}function ua(t){var e=t.name;Cn(t)||(t.name=function(t){var e=t.getRawData(),n=e.mapDimensionsAll("seriesName"),i=[];return c(n,function(t){var n=e.getDimensionInfo(t);n.displayName&&i.push(n.displayName)}),i.join(" ")}(t)||e)}function ha(t){return t.model.getRawData().count()}function ca(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),da}function da(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function pa(t,e){c(N(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(n){t.wrapMethod(n,m(fa,e))})}function fa(t,e){var n=ga(t);return n&&n.setOutputEnd((e||this).count()),e}function ga(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){var i=n.currentTask;if(i){var o=i.agentStubMap;o&&(i=o.get(t.uid))}return i}}function ma(){var t=Ln();return function(e){var n=t(e),i=e.pipelineContext,o=!!n.large,r=!!n.progressiveRender,a=n.large=!(!i||!i.large),s=n.progressiveRender=!(!i||!i.progressiveRender);return!(o===a&&r===s)&&"reset"}}function ya(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function va(t,e){return(t[0]*e[0]+t[1]*e[1])/(ya(t)*ya(e))}function _a(t,e){return(t[0]*e[1]1&&(a*=Cw(f),s*=Cw(f));var g=(o===r?-1:1)*Cw((a*a*(s*s)-a*a*(p*p)-s*s*(d*d))/(a*a*(p*p)+s*s*(d*d)))||0,m=g*a*p/s,y=g*-s*d/a,v=(t+n)/2+Iw(c)*m-kw(c)*y,_=(e+i)/2+kw(c)*m+Iw(c)*y,x=_a([1,0],[(d-m)/a,(p-y)/s]),w=[(d-m)/a,(p-y)/s],b=[(-1*d-m)/a,(-1*p-y)/s],S=_a(w,b);if(va(w,b)<=-1&&(S=Lw),va(w,b)>=1&&(S=0),S<0){var T=Math.round(S/Lw*1e6)/1e6;S=2*Lw+T%2*Lw}h.addData(u,v,_,a,s,x,S,c,r)}function wa(t){return null!=t.setData}function ba(t,e){var n=function(t){var e=new Yy;if(!t)return e;var n,i=0,o=0,r=i,a=o,s=Yy.CMD,l=t.match(Pw);if(!l)return e;for(var u=0;uP*P+D*D&&(T=C,M=k),{cx:T,cy:M,x0:-h,y0:-c,x1:T*(o/w-1),y1:M*(o/w-1)}}function Ta(t,e,n){var i=e.smooth,o=e.points;if(o&&o.length>=2){if(i){var r=function(t,e,n,i){var o,r,a,s,l=[],u=[],h=[],c=[];if(i){a=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,p=t.length;d0){var c={duration:h.duration,delay:h.delay||0,easing:h.easing,done:r,force:!!r||!!a,setToFinal:!u,scope:t,during:a};l?e.animateFrom(n,c):e.animateTo(n,c)}else e.stopAnimation(),!l&&e.attr(n),a&&a(1),r&&r()}function Ia(t,e,n,i,o,r){ka("update",t,e,n,i,o,r)}function La(t,e,n,i,o,r){ka("enter",t,e,n,i,o,r)}function Pa(t){if(!t.__zr)return!0;for(var e=0;eWm(r[1])?r[0]>0?"right":"left":r[1]>0?"bottom":"top"}function Ya(t){return!t.isGroup}function Xa(t,e,n){function i(t){var e={x:t.x,y:t.y,rotation:t.rotation};return function(t){return null!=t.shape}(t)&&(e.shape=o(t.shape)),e}if(t&&e){var r,a=(r={},t.traverse(function(t){Ya(t)&&t.anid&&(r[t.anid]=t)}),r);e.traverse(function(t){if(Ya(t)&&t.anid){var e=a[t.anid];if(e){var o=i(t);t.attr(i(e)),Ia(t,o,n,Mv(t).dataIndex)}}})}}function qa(t,e){return d(t,function(t){var n=t[0];n=Hm(n,e.x),n=Zm(n,e.x+e.width);var i=t[1];return i=Hm(i,e.y),[n,i=Zm(i,e.y+e.height)]})}function Ka(t,e){var n=Hm(t.x,e.x),i=Zm(t.x+t.width,e.x+e.width),o=Hm(t.y,e.y),r=Zm(t.y+t.height,e.y+e.height);if(i>=n&&r>=o)return{x:n,y:o,width:i-n,height:r-o}}function $a(t,e,n){var i=a({rectHover:!0},e),o=i.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(o.image=t.slice(8),s(o,n),new cv(i)):Na(t.replace("path://",""),i,n,"center")}function Ja(t,e,n,i,o){for(var r=0,a=o[o.length-1];r=-1e-6)return!1;var f=t-o,g=e-r,m=ts(f,g,u,h)/p;if(m<0||m>1)return!1;var y=ts(f,g,c,d)/p;return!(y<0||y>1)}function ts(t,e,n,i){return t*i-n*e}function es(t,e,n,i,o){return null==e||(w(e)?jb[0]=jb[1]=jb[2]=jb[3]=e:(jb[0]=e[0],jb[1]=e[1],jb[2]=e[2],jb[3]=e[3]),i&&(jb[0]=Hm(0,jb[0]),jb[1]=Hm(0,jb[1]),jb[2]=Hm(0,jb[2]),jb[3]=Hm(0,jb[3])),n&&(jb[0]=-jb[0],jb[1]=-jb[1],jb[2]=-jb[2],jb[3]=-jb[3]),ns(t,jb,"x","width",3,1,o&&o[0]||0),ns(t,jb,"y","height",0,2,o&&o[1]||0)),t}function ns(t,e,n,i,o,r,a){var s=e[r]+e[o],l=t[i];t[i]+=s,a=Hm(0,Zm(a,l)),t[i]=0?-e[o]:e[r]>=0?l+e[r]:Wm(s)>1e-8?(l-a)*e[o]/s:0):t[n]-=e[o]}function is(t){var e=t.itemTooltipOption,n=t.componentModel,i=t.itemName,o=_(e)?{formatter:e}:e,r=n.mainType,a=n.componentIndex,l={componentType:r,name:i,$vars:["name"]};l[r+"Index"]=a;var u=t.formatterParamsExtra;u&&c(g(u),function(t){Z(l,t)||(l[t]=u[t],l.$vars.push(t))});var h=Mv(t.el);h.componentMainType=r,h.componentIndex=a,h.tooltipConfig={name:i,option:s({content:i,encodeHTMLContent:!0,formatterParams:l},o)}}function os(t,e){var n;t.isGroup&&(n=e(t)),n||t.traverse(e)}function rs(t,e){if(t)if(y(t))for(var n=0;ni&&(i=e),ei&&(o=i=0),{min:o,max:i}}function cs(t,e,n){ds(t,e,n,-1/0)}function ds(t,e,n,i){if(t.ignoreModelZ)return i;var o=t.getTextContent(),r=t.getTextGuideLine();if(t.isGroup)for(var a=t.childrenRef(),s=0;s=0?i():c=setTimeout(i,-r),u=o};return d.clear=function(){c&&(clearTimeout(c),c=null)},d.debounceNextCall=function(t){l=t},d}function vs(t,e,n,i){var o=t[e];if(o){var r=o[Jb]||o;if(o[Qb]!==n||o[tS]!==i){if(null==n||!i)return t[e]=r;(o=t[e]=ys(r,n,"debounce"===i))[Jb]=r,o[tS]=i,o[Qb]=n}return o}}function _s(t,e){var n=t[e];n&&n[Jb]&&(n.clear&&n.clear(),t[e]=n[Jb])}function xs(t,e){return t.visualStyleMapper||nS[e]||(console.warn("Unknown style type '"+e+"'."),nS.itemStyle)}function ws(t,e){return t.visualDrawType||iS[e]||(console.warn("Unknown style type '"+e+"'."),"fill")}function bs(t){t.overallReset(t.ecModel,t.api,t.payload)}function Ss(t){return t.overallProgress&&Ts}function Ts(){this.agent.dirty(),this.getDownstream().dirty()}function Ms(){this.agent&&this.agent.dirty()}function Cs(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function ks(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=vn(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?d(e,function(t,e){return Is(e)}):hS}function Is(t){return function(e,n){var i=n.data,o=n.resetDefines[t];if(o&&o.dataEach)for(var r=e.start;r=0&&Ns(l)?l:.5,t.createRadialGradient(a,s,0,a,s,l)}(t,e,n):function(t,e,n){var i=null==e.x?0:e.x,o=null==e.x2?1:e.x2,r=null==e.y?0:e.y,a=null==e.y2?0:e.y2;return e.global||(i=i*n.width+n.x,o=o*n.width+n.x,r=r*n.height+n.y,a=a*n.height+n.y),i=Ns(i)?i:0,o=Ns(o)?o:1,r=Ns(r)?r:0,a=Ns(a)?a:0,t.createLinearGradient(i,r,o,a)}(t,e,n),o=e.colorStops,r=0;r0&&(n=i.lineWidth,(e=i.lineDash)&&"solid"!==e&&n>0?"dashed"===e?[4*n,2*n]:"dotted"===e?[n]:w(e)?[e]:y(e)?e:null:null),r=i.lineDashOffset;if(o){var a=i.strokeNoScale&&t.getLineScale?t.getLineScale():1;a&&1!==a&&(o=d(o,function(t){return t/a}),r/=a)}return[o,r]}function Ws(t){var e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))}function js(t){return"string"==typeof t&&"none"!==t}function Gs(t){var e=t.fill;return null!=e&&"none"!==e}function Us(t,e){if(null!=e.fillOpacity&&1!==e.fillOpacity){var n=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=n}else t.fill()}function Ys(t,e){if(null!=e.strokeOpacity&&1!==e.strokeOpacity){var n=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=n}else t.stroke()}function Xs(t,e,n){var i=Hn(e.image,e.__image,n);if(jn(i)){var o=t.createPattern(i,e.repeat||"repeat");if("function"==typeof DOMMatrix&&o&&o.setTransform){var r=new DOMMatrix;r.translateSelf(e.x||0,e.y||0),r.rotateSelf(0,0,(e.rotation||0)*Tf),r.scaleSelf(e.scaleX||1,e.scaleY||1),o.setTransform(r)}return o}}function qs(t,e,n,i,o){var r=!1;if(!i&&e===(n=n||{}))return!1;if(i||e.opacity!==n.opacity){Js(t,o),r=!0;var a=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(a)?dy.opacity:a}(i||e.blend!==n.blend)&&(r||(Js(t,o),r=!0),t.globalCompositeOperation=e.blend||dy.blend);for(var s=0;s=0)){ET.push(n);var r=pS.wrapStageHandler(n,o);r.__prio=e,r.__raw=n,t.push(r)}}function vl(t,e){PT[t]=e}function _l(t,e,n,i){return{eventContent:{selected:eo(n),isFromClick:e.isFromClick||!1}}}function xl(e=!1){return RT||(RT=t(481),RT)}function wl(t,e,n,i,o,r){if(o-i<=n)return;const a=i+o>>1;bl(t,e,a,i,o,r),wl(t,e,n,i,a-1,1-r),wl(t,e,n,a+1,o,1-r)}function bl(t,e,n,i,o,r){for(;o>i;){if(o-i>600){const a=o-i+1,s=n-i+1,l=Math.log(a),u=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*u*(a-u)/a)*(s-a/2<0?-1:1);bl(t,e,n,Math.max(i,Math.floor(n-s*u/a+h)),Math.min(o,Math.floor(n+(a-s)*u/a+h)),r)}const a=e[2*n+r];let s=i,l=o;for(Sl(t,e,i,n),e[2*o+r]>a&&Sl(t,e,i,o);sa;)l--}e[2*i+r]===a?Sl(t,e,i,l):(l++,Sl(t,e,l,o)),l<=n&&(i=l+1),n<=l&&(o=l-1)}}function Sl(t,e,n,i){Tl(t,n,i),Tl(e,2*n,2*i),Tl(e,2*n+1,2*i+1)}function Tl(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function Ml(t,e,n,i){const o=t-n,r=e-i;return o*o+r*r}function Cl(t){y(t)?c(t,function(t){Cl(t)}):l(UT,t)>=0||(UT.push(t),v(t)&&(t={install:t}),t.install(YT))}function kl(t){return isNaN(+t.cpx1)||isNaN(+t.cpy1)}function Il(t){return"_"+t+"Type"}function Ll(t,e,n){var i=e.getItemVisual(n,t);if(!i||"none"===i)return i;var o=e.getItemVisual(n,t+"Size"),r=e.getItemVisual(n,t+"Rotate"),a=e.getItemVisual(n,t+"Offset"),s=e.getItemVisual(n,t+"KeepAspect"),l=Rs(o);return i+l+Bs(a||0,l)+(r||"")+(s||"")}function Pl(t,e,n){var i=e.getItemVisual(n,t);if(i&&"none"!==i){var o=e.getItemVisual(n,t+"Size"),r=e.getItemVisual(n,t+"Rotate"),a=e.getItemVisual(n,t+"Offset"),s=e.getItemVisual(n,t+"KeepAspect"),l=Rs(o),u=Bs(a||0,l),h=Es(i,-l[0]/2+u[0],-l[1]/2+u[1],l[0],l[1],null,s);return h.__specifiedRotation=null==r||isNaN(r)?void 0:+r*Math.PI/180||0,h.name=t,h}}function Dl(t,e){t.x1=e[0][0],t.y1=e[0][1],t.x2=e[1][0],t.y2=e[1][1],t.percent=1;var n=e[2];n?(t.cpx1=n[0],t.cpy1=n[1]):(t.cpx1=NaN,t.cpy1=NaN)}function Al(t){var e=t.hostModel,n=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:n.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:n.get("disabled"),blurScope:n.get("blurScope"),focus:n.get("focus"),labelStatesModels:ho(e)}}function Ol(t){return isNaN(t[0])||isNaN(t[1])}function zl(t){return t&&!Ol(t[0])&&!Ol(t[1])}function El(t){return null==t?0:t.length||1}function Rl(t){return t}function Bl(t,e){return t.hasOwnProperty(e)||(t[e]=[]),t[e]}function Nl(t){return t instanceof kM}function Fl(t){for(var e=B(),n=0;n<(t||[]).length;n++){var i=t[n],o=b(i)?i.name:i;null!=o&&null==e.get(o)&&e.set(o,n)}return e}function Vl(t){var e=MM(t);return e.dimNameMap||(e.dimNameMap=Fl(t.dimensionsDefine))}function Zl(t){return t>30}function Hl(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(t.data=d(e,function(t){var e={coords:[t[0].coord,t[1].coord]};return t[0].name&&(e.fromName=t[0].name),t[1].name&&(e.toName=t[1].name),function(t){for(var e=t[0],n=1,i=t.length;nn&&!l||o=0?i+=u:i-=u:f>=0?i-=u:i+=u}return i}function Su(t,e){var n=[],i=Yt,o=[[],[],[]],r=[[],[]],a=[];e/=2,t.eachEdge(function(t,s){var l=t.getLayout(),u=t.getVisual("fromSymbol"),h=t.getVisual("toSymbol");l.__original||(l.__original=[U(l[0]),U(l[1])],l[2]&&l.__original.push(U(l[2])));var c=l.__original;if(null!=l[2]){if(G(o[0],c[0]),G(o[1],c[2]),G(o[2],c[1]),u&&"none"!==u){var d=Ql(t.node1),p=bu(o,c[0],d*e);i(o[0][0],o[1][0],o[2][0],p,n),o[0][0]=n[3],o[1][0]=n[4],i(o[0][1],o[1][1],o[2][1],p,n),o[0][1]=n[3],o[1][1]=n[4]}h&&"none"!==h&&(d=Ql(t.node2),p=bu(o,c[1],d*e),i(o[0][0],o[1][0],o[2][0],p,n),o[1][0]=n[1],o[2][0]=n[2],i(o[0][1],o[1][1],o[2][1],p,n),o[1][1]=n[1],o[2][1]=n[2]),G(l[0],o[0]),G(l[1],o[2]),G(l[2],o[1])}else G(r[0],c[0]),G(r[1],c[1]),K(a,r[1],r[0]),Q(a,a),u&&"none"!==u&&(d=Ql(t.node1),q(r[0],r[0],a,d*e)),h&&"none"!==h&&(d=Ql(t.node2),q(r[1],r[1],a,-d*e)),G(l[0],r[0]),G(l[1],r[1])})}function Tu(t){return"view"===t.type}function Mu(t){return"_EC_"+t}function Cu(t,e){return{getValue:function(n){var i=this[t][e];return i.getStore().get(i.getDimensionIndex(n||"value"),this.dataIndex)},setVisual:function(n,i){this.dataIndex>=0&&this[t][e].setItemVisual(this.dataIndex,n,i)},getVisual:function(n){return this[t][e].getItemVisual(this.dataIndex,n)},setLayout:function(n,i){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,n,i)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}}function ku(t,e){if(wC(this).mainData===this){var n=a({},wC(this).datas);n[this.dataType]=e,Au(e,n,t)}else Ou(e,this.dataType,wC(this).mainData,t);return e}function Iu(t,e){return t.struct&&t.struct.update(),e}function Lu(t,e){return c(wC(e).datas,function(n,i){n!==e&&Ou(n.cloneShallow(),i,e,t)}),e}function Pu(t){var e=wC(this).mainData;return null==t||null==e?e:wC(e).datas[t]}function Du(){var t=wC(this).mainData;return null==t?[{data:t}]:d(g(wC(t).datas),function(e){return{type:e,data:wC(t).datas[e]}})}function Au(t,e,n){wC(t).datas={},c(e,function(e,i){Ou(e,i,t,n)})}function Ou(t,e,n,i){wC(n).datas[e]=t,wC(t).mainData=n,t.dataType=e,i.struct&&(t[i.structAttr]=i.struct,i.struct[i.datasAttr[e]]=t),t.getLinkedData=Pu,t.getLinkedDataAll=Du}function zu(t,e){function n(t){var e=v[t];if(e<0){var n=l[t],i=b(n)?n:{name:n},o=new yM,r=i.name;return null!=r&&null!=g.get(r)&&(o.name=o.displayName=r),null!=i.type&&(o.type=i.type),null!=i.displayName&&(o.displayName=i.displayName),v[t]=h.length,o.storeDimIndex=t,h.push(o),o}return h[e]}function i(t,e,n){null!=ix.get(e)?t.otherDims[e]=n:(t.coordDim=e,t.coordDimIndex=n,u.set(e,!0))}function o(t){null==t.name&&(t.name=t.coordDim)}xr(t)||(t=br(t));var r=(e=e||{}).coordDimensions||[],l=e.dimensionsDefine||t.dimensionsDefine||[],u=B(),h=[],d=function(t,e,n,i){var o=Math.max(t.dimensionsDetectedCount||1,e.length,n.length,i||0);return c(e,function(t){var e;b(t)&&(e=t.dimsDef)&&(o=Math.max(o,e.length))}),o}(t,r,l,e.dimensionsCount),p=e.canOmitUnusedDimensions&&Zl(d),f=l===t.dimensionsDefine,g=f?Vl(t):Fl(l),m=e.encodeDefine;!m&&e.encodeDefaulter&&(m=e.encodeDefaulter(t,d));for(var y=B(m),v=new lw(d),x=0;x0&&(i.name=o+(r-1)),r++,e.set(o,r)}}(h),new kM({source:t,dimensions:h,fullDimensionCount:d,dimensionOmitted:p})}function Eu(t,e,n){if(n||e.hasKey(t)){for(var i=0;e.hasKey(t+i);)i++;t+=i}return e.set(t,!0),t}function Ru(t){return"category"===t.get("type")}function Bu(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function Nu(t,e){return{seriesType:t,plan:ma(),reset:function(t){var n=t.getData(),i=t.coordinateSystem,o=e||t.pipelineContext.large;if(i){var r=d(i.dimensions,function(t){return n.mapDimension(t)}).slice(0,2),a=r.length,s=n.getCalculationInfo("stackResultDimension");Bu(n,r[0])&&(r[0]=s),Bu(n,r[1])&&(r[1]=s);var l=n.getStore(),u=n.getDimensionIndex(r[0]),h=n.getDimensionIndex(r[1]);return a&&{progress:function(t,e){for(var n,r=o&&(y(n=(t.end-t.start)*a)?zC?new Float32Array(n):n:new EC(n)),s=[],c=[],d=t.start,p=0;d=e[0]&&t<=e[1]}function Xu(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function qu(t,e){return t*(e[1]-e[0])+e[0]}function Ku(t,e,n){var i=Math.log(t);return[Math.log(n?e[0]:Math.max(0,e[0]))/i,Math.log(n?e[1]:Math.max(0,e[1]))/i]}function $u(t){return t.get("stack")||ok+t.seriesIndex}function Ju(t){return t.dim+t.index}function Qu(t,e,n,i){return To(new Date(e),t,i).getTime()===To(new Date(n),t,i).getTime()}function th(t,e){return(t/=g_)>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function eh(t){return(t/=2592e6)>6?6:t>3?3:t>2?2:1}function nh(t){return(t/=f_)>12?12:t>6?6:t>3.5?4:t>2?2:1}function ih(t,e){return(t/=e?p_:d_)>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function oh(t){return pn(t,!0)}function rh(t,e,n){var i=Math.max(0,l(w_,e)-1);return To(new Date(t),w_[i],n).getTime()}function ah(t,e){return lk(t,an(e))}function sh(t,e,n){var i=t.rawExtentInfo;return i||(i=new gk(t,e,n),t.rawExtentInfo=i,i)}function lh(t,e){return null==e?null:k(e)?NaN:t.parse(e)}function uh(t,e){var n=t.type,i=sh(t,e,t.getExtent()).calculate();t.setBlank(i.isBlank);var o,r,a,s=i.min,l=i.max,u=e.ecModel;if(u&&"time"===n){var h=function(t,e){var n=[];return e.eachSeriesByType("bar",function(t){(function(t){return t.coordinateSystem&&"cartesian2d"===t.coordinateSystem.type})(t)&&n.push(t)}),n}(0,u),d=!1;if(c(h,function(t){d=d||t.getBaseAxis()===e.axis}),d){var p=(r=function(t){var e={};c(t,function(t){var n=t.coordinateSystem.getBaseAxis();if("time"===n.type||"value"===n.type)for(var i=t.getData(),o=n.dim+"_"+n.index,r=i.getDimensionIndex(i.mapDimension(n.dim)),a=i.getStore(),s=0,l=a.count();s0&&(r=null===r?s:Math.min(r,s))}n[i]=r}}return n}(o=h),a=[],c(o,function(t){var e,n=t.coordinateSystem.getBaseAxis(),i=n.getExtent();if("category"===n.type)e=n.getBandWidth();else if("value"===n.type||"time"===n.type){var o=r[n.dim+"_"+n.index],s=Math.abs(i[1]-i[0]),l=n.scale.getExtent(),u=Math.abs(l[1]-l[0]);e=o?s/u*o:s}else{var h=t.getData();e=Math.abs(i[1]-i[0])/h.count()}var c=jm(t.get("barWidth"),e),d=jm(t.get("barMaxWidth"),e),p=jm(t.get("barMinWidth")||(function(t){return t.pipelineContext&&t.pipelineContext.large}(t)?.5:1),e),f=t.get("barGap"),g=t.get("barCategoryGap"),m=t.get("defaultBarGap");a.push({bandWidth:e,barWidth:c,barMaxWidth:d,barMinWidth:p,barGap:f,barCategoryGap:g,defaultBarGap:m,axisKey:Ju(n),stackId:$u(t)})}),function(t){var e={};c(t,function(t,n){var i=t.axisKey,o=t.bandWidth,r=e[i]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:t.defaultBarGap||0,stacks:{}},a=r.stacks;e[i]=r;var s=t.stackId;a[s]||r.autoWidthCount++,a[s]=a[s]||{width:0,maxWidth:0};var l=t.barWidth;l&&!a[s].width&&(a[s].width=l,l=Math.min(r.remainedWidth,l),r.remainedWidth-=l);var u=t.barMaxWidth;u&&(a[s].maxWidth=u);var h=t.barMinWidth;h&&(a[s].minWidth=h);var c=t.barGap;null!=c&&(r.gap=c);var d=t.barCategoryGap;null!=d&&(r.categoryGap=d)});var n={};return c(e,function(t,e){n[e]={};var i=t.stacks,o=t.bandWidth,r=t.categoryGap;if(null==r){var a=g(i).length;r=Math.max(35-4*a,15)+"%"}var s=jm(r,o),l=jm(t.gap,1),u=t.remainedWidth,h=t.autoWidthCount,d=(u-s)/(h+(h-1)*l);d=Math.max(d,0),c(i,function(t){var e=t.maxWidth,n=t.minWidth;if(t.width)i=t.width,e&&(i=Math.min(i,e)),n&&(i=Math.max(i,n)),t.width=i,u-=i+l*i,h--;else{var i=d;e&&ei&&(i=n),i!==d&&(t.width=i,u-=i+l*i,h--)}}),d=(u-s)/(h+(h-1)*l),d=Math.max(d,0);var p,f=0;c(i,function(t,e){t.width||(t.width=d),p=t,f+=t.width*(1+l)}),p&&(f-=p.width*l);var m=-f/2;c(i,function(t,i){n[e][i]=n[e][i]||{bandWidth:o,offset:m,width:t.width},m+=t.width*(1+l)})}),n}(a)),f=function(t,e,n,i){var o=n.axis.getExtent(),r=Math.abs(o[1]-o[0]),a=function(t,e){if(t&&e)return t[Ju(e)]}(i,n.axis);if(void 0===a)return{min:t,max:e};var s=1/0;c(a,function(t){s=Math.min(t.offset,s)});var l=-1/0;c(a,function(t){l=Math.max(t.offset+t.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=e-t,d=h/(1-(s+l)/r)-h;return{min:t-=d*(s/u),max:e+=d*(l/u)}}(s,l,e,p);s=f.min,l=f.max}}return{extent:[s,l],fixMin:i.minFixed,fixMax:i.maxFixed}}function hh(t,e){var n=e,i=uh(t,n),o=i.extent,r=n.get("splitNumber");t instanceof fk&&(t.base=n.get("logBase"));var a=t.type,s=n.get("interval"),l="interval"===a||"time"===a;t.setBreaksFromOption(vh(n)),t.setExtent(o[0],o[1]),t.calcNiceExtent({splitNumber:r,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?n.get("minInterval"):null,maxInterval:l?n.get("maxInterval"):null}),null!=s&&t.setInterval&&t.setInterval(s)}function ch(t){var e,n=t.getLabelModel().get("formatter");if("time"===t.type){var i=_(e=n)||v(e)?e:function(t){t=t||{};var e={},n=!0;return c(w_,function(e){n&&(n=null==t[e])}),c(w_,function(i,o){var r=t[i];e[i]={};for(var a=null,s=o;s>=0;s--){var l=w_[s],u=b(r)&&!y(r)?r[l]:r,h=void 0;y(u)?a=(h=u.slice())[0]||"":_(u)?h=[a=u]:(null==a?a=v_[i]:y_[l].test(a)||(a=e[l][l][0]+" "+a),h=[a],n&&(h[1]="{primary|"+a+"}")),e[i][l]=h}}),e}(e);return function(e,n){return t.scale.getFormattedLabel(e,n,i)}}if(_(n))return function(e){var i=t.scale.getLabel(e);return n.replace("{value}",null!=i?i:"")};if(v(n)){if("category"===t.type)return function(e,i){return n(dh(t,e),e.value-t.scale.getExtent()[0],null)};var o=vo();return function(e,i){var r=null;return o&&(r=o.makeAxisLabelFormatterParamBreak(r,e.break)),n(dh(t,e),i,r)}}return function(e){return t.scale.getLabel(e)}}function dh(t,e){return"category"===t.type?t.scale.getLabel(e):e.value}function ph(t){var e=t.get("interval");return null==e?"auto":e}function fh(t){return"category"===t.type&&0===ph(t.getLabelModel())}function gh(t,e){var n={};return c(t.mapDimensionsAll(e),function(e){n[function(t,e){return Bu(t,e)?t.getCalculationInfo("stackResultDimension"):e}(t,e)]=!0}),g(n)}function mh(t){return"middle"===t||"center"===t}function yh(t){return t.getShallow("show")}function vh(t){var e,n=t.get("breaks",!0);if(null!=n)return vo()?"x"!==(e=t.axis).dim&&"y"!==e.dim&&"z"!==e.dim&&"single"!==e.dim||"category"===e.type?void 0:n:void 0}function _h(t){return("interval"===t.type||"time"===t.type)&&!t.hasBreaks()}function xh(t){return{out:{noPxChangeTryDetermine:[]},kind:t}}function wh(t,e){var n=d(e,function(e){return t.scale.parse(e)});return"time"===t.type&&n.length>0&&(n.sort(),n.unshift(n[0]),n.push(n[n.length-1])),n}function bh(t,e,n){var i,o,r=kk(t),a=ph(e),s=n.kind===Tk;if(!s){var l=Th(r,a);if(l)return l}v(a)?i=Lh(t,a):(o="auto"===a?function(t,e){if(e.kind===Tk){var n=t.calculateCategoryInterval(e);return e.out.noPxChangeTryDetermine.push(function(){return Sk(t).autoInterval=n,!0}),n}var i=Sk(t).autoInterval;return null!=i?i:Sk(t).autoInterval=t.calculateCategoryInterval(e)}(t,n):a,i=Ih(t,o));var u={labels:i,labelCategoryInterval:o};return s?n.out.noPxChangeTryDetermine.push(function(){return Mh(r,a,u),!0}):Mh(r,a,u),u}function Sh(t){return function(e){return Sk(e)[t]||(Sk(e)[t]={list:[]})}}function Th(t,e){for(var n=0;ne&&i.axisExtent0===o[0]&&i.axisExtent1===o[1])return r;i.lastTickCount=n,i.lastAutoInterval=e,i.axisExtent0=o[0],i.axisExtent1=o[1]}function Ih(t,e,n){function i(t){var e={value:t};l.push(n?t:{formattedLabel:o(e),rawLabel:r.getLabel(e),tickValue:t,time:void 0,break:void 0})}var o=ch(t),r=t.scale,a=r.getExtent(),s=t.getLabelModel(),l=[],u=Math.max((e||0)+1,1),h=a[0],c=r.count();0!==h&&u>1&&c/u>2&&(h=Math.round(Math.ceil(h/u)*u));var d=fh(t),p=s.get("showMinLabel")||d,f=s.get("showMaxLabel")||d;p&&h!==a[0]&&i(a[0]);for(var g=h;g<=a[1];g+=u)i(g);return f&&g-u!==a[1]&&i(a[1]),l}function Lh(t,e,n){var i=t.scale,o=ch(t),r=[];return c(i.getTicks(),function(t){var a=i.getLabel(t),s=t.value;e(t.value,a)&&r.push(n?s:{formattedLabel:o(t),rawLabel:a,tickValue:s,time:void 0,break:void 0})}),r}function Ph(t,e){var n=(t[1]-t[0])/e/2;t[0]+=n,t[1]-=n}function Dh(t,e,n){n=n||3,e?t.dirty|=n:t.dirty&=~n}function Ah(t,e){return e=e||3,null==t.dirty||!!(t.dirty&e)}function Oh(t){if(t)return Ah(t)&&function(t,e,n){var i=e.getComputedTransform();t.transform=ls(t.transform,i);var o=t.localRect=ss(t.localRect,e.getBoundingRect()),r=e.style,a=r.margin,s=n&&n.marginForce,l=n&&n.minMarginForce,u=n&&n.marginDefault,h=r.__marginType;null==h&&u&&(a=u,h=Wv.textMargin);for(var c=0;c<4;c++)Ok[c]=h===Wv.minMargin&&l&&null!=l[c]?l[c]:s&&null!=s[c]?s[c]:a?a[c]:0;h===Wv.textMargin&&es(o,Ok,!1,!1);var d=t.rect=ss(t.rect,o);i&&d.applyTransform(i),h===Wv.minMargin&&es(d,Ok,!1,!1),t.axisAligned=as(i),(t.label=t.label||{}).ignore=e.ignore,Dh(t,!1),Dh(t,!0,2)}(t,t.label,t),t}function zh(t,e){for(var n=0;n=0,r=0,a=t.length;r.1?"x":"y",h=a.transGroup[u];if(s.sort(function(t,e){return Math.abs(t.label[u]-h)-Math.abs(e.label[u]-h)}),l&&o){var d=r.getExtent(),p=Math.min(d[0],d[1]),f=Math.max(d[0],d[1])-p;o.union(new lg(p,0,f,1))}a.stOccupiedRect=o,a.labelInfoList=s}(t,n,i,l)}function Vh(t){t&&(t.ignore=!0)}function Zh(t,e,n,i,o){for(var r=[],a=[],s=[],l=0;l0&&i>0||n<0&&i<0)}(t)}function $h(t,e){c(t.x,function(t){return Jh(t,e.x,e.width)}),c(t.y,function(t){return Jh(t,e.y,e.height)})}function Jh(t,e,n){var i=[0,n],o=t.inverse?1:0;t.setExtent(i[o],i[1-o]),function(t,e){var n=t.getExtent(),i=n[0]+n[1];t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return i-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return i-t+e}}(t,e)}function Qh(t,e,n,i,o,r,a){function s(t){c(o[Fb[t]],function(e){if(yh(e.model)){var n=r.ensureRecord(e.model),i=n.labelInfoList;if(i)for(var o=0;o0&&!k(e)&&e>1e-4&&(t/=e),t}tc(i,o,Tk,e,!1,a);var h=[0,0,0,0];s(0),s(1),l(i,0,NaN),l(i,1,NaN);var d=null==function(t,e){if(t&&e)for(var n=0,i=t.length;n0});return es(i,h,!0,!0,n),$h(o,i),d}function tc(t,e,n,i,o,r){function a(e){l[Fb[1-e]]=t[Vb[e]]<=.5*r.refContainer[Vb[e]]?0:1-e==1?2:1}var s=n===Mk;c(e,function(e){return c(e,function(e){yh(e.model)&&(function(t,e,n){var i=Uh(e,n);t.updateCfg(i)}(e.axisBuilder,t,e.model),e.axisBuilder.build(s?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:o}))})});var l={x:0,y:0};a(0),a(1),c(e,function(t,e){return c(t,function(t){yh(t.model)&&(("all"===i||s)&&t.axisBuilder.build({axisName:!0},{nameMarginLevel:l[e]}),s&&t.axisBuilder.build({axisLine:!0}))})})}function ec(t,e){return"all"===t||y(t)&&l(t,e)>=0||t===e}function nc(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[oc(t)]}function ic(t){return!!t.get(["handle","show"])}function oc(t){return t.type+"||"+t.id}function rc(t){t.registerComponentView(uI),t.registerComponentModel(FC),t.registerCoordinateSystem("cartesian2d",Qk),Zu(t,"x",ZC,hI),Zu(t,"y",ZC,hI),t.registerComponentView(sI),t.registerComponentView(lI),t.registerPreprocessor(function(t){t.xAxis&&t.yAxis&&!t.grid&&(t.grid={})})}function ac(t,e,n,i){sc(cI(n).lastProp,i)||(cI(n).lastProp=i,e?Ia(n,i,t):(n.stopAnimation(),n.attr(i)))}function sc(t,e){if(b(t)&&b(e)){var n=!0;return c(e,function(e,i){n=n&&sc(t[i],e)}),!!n}return t===e}function lc(t,e){t[e.get(["label","show"])?"show":"hide"]()}function uc(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function hc(t,e,n){var i=e.get("z"),o=e.get("zlevel");t&&t.traverse(function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=o&&(t.zlevel=o),t.silent=n)})}function cc(t,e,n,i,o){t=e.scale.parse(t);var r=e.scale.getLabel({value:t},{precision:o.precision}),a=o.formatter;if(a){var s={value:dh(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};c(i,function(t){var e=n.getSeriesByIndex(t.seriesIndex),i=e&&e.getDataParams(t.dataIndexInside);i&&s.seriesData.push(i)}),_(a)?r=a.replace("{value}",r):v(a)&&(r=a(s))}return r}function dc(t,e,n){var i=[1,0,0,1,0,0];return wt(i,i,n.rotation),xt(i,i,n.position),Ga([t.dataToCoord(e),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}function pc(t,e){var n={};return n[e.dim+"AxisIndex"]=e.index,t.getCartesian(n)}function fc(t){return"x"===t.dim?0:1}function gc(t,e,n){if(!Qp.node){var i=e.getZr();_I(i).records||(_I(i).records={}),function(t,e){function n(n,i){t.on(n,function(n){var o=function(t){var e={showTip:[],hideTip:[]},n=function(i){var o=e[i.type];o?o.push(i):(i.dispatchAction=n,t.dispatchAction(i))};return{dispatchAction:n,pendings:e}}(e);xI(_I(t).records,function(t){t&&i(t,n,o.dispatchAction)}),function(t,e){var n,i=t.showTip.length,o=t.hideTip.length;i?n=t.showTip[i-1]:o&&(n=t.hideTip[o-1]),n&&(n.dispatchAction=null,e.dispatchAction(n))}(o.pendings,e)})}_I(t).initialized||(_I(t).initialized=!0,n("click",m(yc,"click")),n("mousemove",m(yc,"mousemove")),n("globalout",mc))}(i,e),(_I(i).records[t]||(_I(i).records[t]={})).handler=n}}function mc(t,e,n){t.handler("leave",null,n)}function yc(t,e,n,i){e.handler(t,n,i)}function vc(t,e){if(!Qp.node){var n=e.getZr();(_I(n).records||{})[t]&&(_I(n).records[t]=null)}}function _c(t,e){var n,i=[],o=t.seriesIndex;if(null==o||!(n=e.getSeriesByIndex(o)))return{point:[]};var r=n.getData(),a=In(r,t);if(null==a||a<0||y(a))return{point:[]};var s=r.getItemGraphicEl(a),l=n.coordinateSystem;if(n.getTooltipPosition)i=n.getTooltipPosition(a)||[];else if(l&&l.dataToPoint)if(t.isStacked){var u=l.getBaseAxis(),h=l.getOtherAxis(u).dim,c="x"===h||"radius"===h?1:0,p=r.mapDimension(u.dim),f=[];f[c]=r.get(p,a),f[1-c]=r.get(r.getCalculationInfo("stackResultDimension"),a),i=l.dataToPoint(f)||[]}else i=l.dataToPoint(r.getValues(d(l.dimensions,function(t){return r.mapDimension(t)}),a))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),i=[g.x+g.width/2,g.y+g.height/2]}return{point:i,el:s}}function xc(t,e,n){var i=t.currTrigger,o=[t.x,t.y],r=t,a=t.dispatchAction||_f(n.dispatchAction,n),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){Mc(o)&&(o=_c({seriesIndex:r.seriesIndex,dataIndex:r.dataIndex},e).point);var l=Mc(o),u=r.axesInfo,h=s.axesInfo,d="leave"===i||Mc(o),p={},f={},g={list:[],map:{}},y={showPointer:m(bc,f),showTooltip:m(Sc,g)};c(s.coordSysMap,function(t,e){var n=l||t.containPoint(o);c(s.coordSysAxesInfo[e],function(t,e){var i=t.axis,r=function(t,e){for(var n=0;n<(t||[]).length;n++){var i=t[n];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}(u,t);if(!d&&n&&(!u||r)){var a=r&&r.value;null!=a||l||(a=i.pointToData(o)),null!=a&&wc(t,a,y,!1,p)}})});var v={};return c(h,function(t,e){var n=t.linkGroup;n&&!f[e]&&c(n.axesInfo,function(e,i){var o=f[i];if(e!==t&&o){var r=o.value;n.mapper&&(r=t.axis.scale.parse(n.mapper(r,Tc(e),Tc(t)))),v[t.key]=r}})}),c(v,function(t,e){wc(h[e],t,y,!0,p)}),function(t,e,n){var i=n.axesInfo=[];c(e,function(e,n){var o=e.axisPointerModel.option,r=t[n];r?(!e.useHandle&&(o.status="show"),o.value=r.value,o.seriesDataIndices=(r.payloadBatch||[]).slice()):!e.useHandle&&(o.status="hide"),"show"===o.status&&i.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:o.value})})}(f,h,p),function(t,e,n,i){if(!Mc(e)&&t.list.length){var o=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:o.dataIndexInside,dataIndex:o.dataIndex,seriesIndex:o.seriesIndex,dataByCoordSys:t.list})}else i({type:"hideTip"})}(g,o,t,a),function(t,e,n){var i=n.getZr(),o="axisPointerLastHighlights",r=SI(i)[o]||{},a=SI(i)[o]={};c(t,function(t,e){var n=t.axisPointerModel.option;"show"===n.status&&t.triggerEmphasis&&c(n.seriesDataIndices,function(t){a[t.seriesIndex+" | "+t.dataIndex]=t})});var s=[],l=[];c(r,function(t,e){!a[e]&&l.push(t)}),c(a,function(t,e){!r[e]&&s.push(t)}),l.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}(h,0,n),p}}function wc(t,e,n,i,o){var r=t.axis;if(!r.scale.isBlank()&&r.containData(e))if(t.involveSeries){var s=function(t,e){var n=e.axis,i=n.dim,o=t,r=[],a=Number.MAX_VALUE,s=-1;return c(e.seriesModels,function(e,l){var u,h,d=e.getData().mapDimensionsAll(i);if(e.getAxisTooltipData){var p=e.getAxisTooltipData(d,t,n);h=p.dataIndices,u=p.nestestValue}else{if(!(h=e.indicesOfNearest(i,d[0],t,"category"===n.type?.5:null)).length)return;u=e.getData().get(d[0],h[0])}if(null!=u&&isFinite(u)){var f=t-u,g=Math.abs(f);g<=a&&((g=0&&s<0)&&(a=g,s=f,o=u,r.length=0),c(h,function(t){r.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})}))}}),{payloadBatch:r,snapToValue:o}}(e,t),l=s.payloadBatch,u=s.snapToValue;l[0]&&null==o.seriesIndex&&a(o,l[0]),!i&&t.snap&&r.containData(u)&&null!=u&&(e=u),n.showPointer(t,e,l),n.showTooltip(t,s,u)}else n.showPointer(t,e)}function bc(t,e,n,i){t[e.key]={value:n,payloadBatch:i}}function Sc(t,e,n,i){var o=n.payloadBatch,r=e.axis,a=r.model,s=e.axisPointerModel;if(e.triggerTooltip&&o.length){var l=e.coordSys.model,u=oc(l),h=t.map[u];h||(h=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(h)),h.dataByAxis.push({axisDim:r.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:o.slice()})}}function Tc(t){var e=t.axis.model,n={},i=n.axisDim=t.axis.dim;return n.axisIndex=n[i+"AxisIndex"]=e.componentIndex,n.axisName=n[i+"AxisName"]=e.name,n.axisId=n[i+"AxisId"]=e.id,n}function Mc(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function Cc(t){nI.registerAxisPointerClass("CartesianAxisPointer",yI),t.registerComponentModel(vI),t.registerComponentView(bI),t.registerPreprocessor(function(t){if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!y(e)&&(t.axisPointer.link=[e])}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=function(t,e){var n={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return function(t,e,n){var i=e.getComponent("tooltip"),r=e.getComponent("axisPointer"),a=r.get("link",!0)||[],l=[];c(n.getCoordinateSystems(),function(n){function u(i,u,h){var f=h.model.getModel("axisPointer",r),g=f.get("show");if(g&&("auto"!==g||i||ic(f))){null==u&&(u=f.get("triggerTooltip")),f=i?function(t,e,n,i,r,a){var l=e.getModel("axisPointer"),u={};c(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],function(t){u[t]=o(l.get(t))}),u.snap="category"!==t.type&&!!a,"cross"===l.get("type")&&(u.type="line");var h=u.label||(u.label={});if(null==h.show&&(h.show=!1),"cross"===r){var d=l.get(["label","show"]);if(h.show=null==d||d,!a){var p=u.lineStyle=l.get("crossStyle");p&&s(h,p.textStyle)}}return t.model.getModel("axisPointer",new i_(u,n,i))}(h,p,r,e,i,u):f;var m=f.get("snap"),y=f.get("triggerEmphasis"),v=oc(h.model),_=u||m||"category"===h.type,x=t.axesInfo[v]={key:v,axis:h,coordSys:n,axisPointerModel:f,triggerTooltip:u,triggerEmphasis:y,involveSeries:_,snap:m,useHandle:ic(f),seriesModels:[],linkGroup:null};d[v]=x,t.seriesInvolved=t.seriesInvolved||_;var w=function(t,e){for(var n=e.model,i=e.dim,o=0;o=0;r--){var a=t[r];a&&(a instanceof i_&&(a=a.get("tooltip",!0)),_(a)&&(a={formatter:a}),a&&(i=new i_(a,i,o)))}return i}function Rc(t,e){return t.dispatchAction||_f(e.dispatchAction,e)}function Bc(t){return"center"===t||"middle"===t}function Nc(t){return t+"Axis"}function Fc(t){var e={};return c(["start","end","startValue","endValue","throttle"],function(n){t.hasOwnProperty(n)&&(e[n]=t[n])}),e}function Vc(t,e,n,i,o,r){t=t||0;var a=n[1]-n[0];if(null!=o&&(o=Hc(o,[0,a])),null!=r&&(r=Math.max(r,null!=o?o:0)),"all"===i){var s=Math.abs(e[1]-e[0]);s=Hc(s,[0,a]),o=r=Hc(s,[o,r]),i=0}e[0]=Hc(e[0],n),e[1]=Hc(e[1],n);var l=Zc(e,i);e[i]+=t;var u,h=o||0,c=n.slice();return l.sign<0?c[0]+=h:c[1]-=h,e[i]=Hc(e[i],c),u=Zc(e,i),null!=o&&(u.sign!==l.sign||u.spanr&&(e[1-i]=e[i]+u.sign*r),e}function Zc(t,e){var n=t[e]-t[1-e];return{span:Math.abs(n),sign:n>0?-1:n<0?1:e?-1:1}}function Hc(t,e){return Math.min(null!=e[1]?e[1]:1/0,Math.max(null!=e[0]?e[0]:-1/0,t))}function Wc(t){t.registerComponentModel(VI),t.registerComponentView(ZI),function(t){YI||(YI=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,UI),function(t){t.registerAction("dataZoom",function(t,e){c(function(t,e){function n(t){!s.get(t.uid)&&function(t){var e=!1;return t.eachTargetAxis(function(t,n){var i=r.get(t);i&&i[n]&&(e=!0)}),e}(t)&&(i(t),o=!0)}function i(t){s.set(t.uid,!0),a.push(t),t.eachTargetAxis(function(t,e){(r.get(t)||r.set(t,[]))[e]=!0})}var o,r=B(),a=[],s=B();t.eachComponent({mainType:"dataZoom",query:e},function(t){s.get(t.uid)||i(t)});do{o=!1,t.eachComponent("dataZoom",n)}while(o);return a}(e,t),function(e){e.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})})}(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}(t)}function jc(t,e){qI[t]=e}function Gc(t){return qI[t]}function Uc(t,e){var n=S_(e.get("padding")),i=e.getItemStyle(["color","opacity"]);return i.fill=e.get("backgroundColor"),new mv({shape:{x:t.x-n[3],y:t.y-n[0],width:t.width+n[1]+n[3],height:t.height+n[0]+n[2],r:e.get("borderRadius")},style:i,silent:!0,z2:-1})}function Yc(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Xc(t,e){return d(t,function(t,n){var i=e&&e[n];if(b(i)&&!y(i)){b(t)&&!y(t)||(t={value:t});var o=null!=i.name&&null==t.name;return t=s(t,i),o&&delete t.name,t}return t})}function qc(t){var e=cL(t);return e.snapshots||(e.snapshots=[{}]),e.snapshots}function Kc(t,e){var n=ML[e.brushType].createCover(t,e);return n.__brushOption=e,Qc(n,e),t.group.add(n),n}function $c(t,e){var n=ed(e);return n.endCreating&&(n.endCreating(t,e),Qc(e,e.__brushOption)),e}function Jc(t,e){var n=e.__brushOption;ed(e).updateCoverShape(t,e,n.range,n)}function Qc(t,e){var n=e.z;null==n&&(n=1e4),t.traverse(function(t){t.z=n,t.z2=n})}function td(t,e){ed(e).updateCommon(t,e),Jc(t,e)}function ed(t){return ML[t.__brushOption.brushType]}function nd(t,e,n){var i,o=t._panels;if(!o)return fL;var r=t._transform;return c(o,function(t){t.isTargetByCursor(e,n,r)&&(i=t)}),i}function id(t,e){var n=t._panels;if(!n)return fL;var i=e.__brushOption.panelId;return null!=i?n[i]:fL}function od(t){var e=t._covers,n=e.length;return c(e,function(e){t.group.remove(e)},t),e.length=0,!!n}function rd(t,e){var n=d(t._covers,function(t){var e=t.__brushOption,n=o(e.range);return{brushType:e.brushType,panelId:e.panelId,range:n}});t.trigger("brush",{areas:n,isEnd:!!e.isEnd,removeOnClick:!!e.removeOnClick})}function ad(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function sd(t,e,n,i){var o=new Em;return o.add(new mv({name:"main",style:cd(n),silent:!0,draggable:!0,cursor:"move",drift:m(fd,t,e,o,["n","s","w","e"]),ondragend:m(rd,e,{isEnd:!0})})),c(i,function(n){o.add(new mv({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:m(fd,t,e,o,n),ondragend:m(rd,e,{isEnd:!0})}))}),o}function ld(t,e,n,i){var o=i.brushStyle.lineWidth||0,r=mL(o,6),a=n[0][0],s=n[1][0],l=a-o/2,u=s-o/2,h=n[0][1],c=n[1][1],d=h-r+o/2,p=c-r+o/2,f=h-a,g=c-s,m=f+o,y=g+o;hd(t,e,"main",a,s,f,g),i.transformable&&(hd(t,e,"w",l,u,r,y),hd(t,e,"e",d,u,r,y),hd(t,e,"n",l,u,m,r),hd(t,e,"s",l,p,m,r),hd(t,e,"nw",l,u,r,r),hd(t,e,"ne",d,u,r,r),hd(t,e,"sw",l,p,r,r),hd(t,e,"se",d,p,r,r))}function ud(t,e){var n=e.__brushOption,i=n.transformable,o=e.childAt(0);o.useStyle(cd(n)),o.attr({silent:!i,cursor:i?"move":"default"}),c([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(n){var o=e.childOfName(n.join("")),r=1===n.length?pd(t,n[0]):function(t,e){var n=[pd(t,e[0]),pd(t,e[1])];return("e"===n[0]||"w"===n[0])&&n.reverse(),n.join("")}(t,n);o&&o.attr({silent:!i,invisible:!i,cursor:i?xL[r]+"-resize":null})})}function hd(t,e,n,i,o,r,a){var s=e.childOfName(n);s&&s.setShape(function(t){var e=gL(t[0][0],t[1][0]),n=gL(t[0][1],t[1][1]);return{x:e,y:n,width:mL(t[0][0],t[1][0])-e,height:mL(t[0][1],t[1][1])-n}}(yd(t,e,[[i,o],[i+r,o+a]])))}function cd(t){return s({strokeNoScale:!0},t.brushStyle)}function dd(t,e,n,i){var o=[gL(t,n),gL(e,i)],r=[mL(t,n),mL(e,i)];return[[o[0],r[0]],[o[1],r[1]]]}function pd(t,e){var n=Ua({w:"left",e:"right",n:"top",s:"bottom"}[e],function(t){return ja(t.group)}(t));return{left:"w",right:"e",top:"n",bottom:"s"}[n]}function fd(t,e,n,i,o,r){var a=n.__brushOption,s=t.toRectRange(a.range),l=md(e,o,r);c(i,function(t){var e=_L[t];s[e[0]][e[1]]+=l[e[0]]}),a.range=t.fromRectRange(dd(s[0][0],s[1][0],s[0][1],s[1][1])),td(e,n),rd(e,{isEnd:!1})}function gd(t,e,n,i){var o=e.__brushOption.range,r=md(t,n,i);c(o,function(t){t[0]+=r[0],t[1]+=r[1]}),td(t,e),rd(t,{isEnd:!1})}function md(t,e,n){var i=t.group,o=i.transformCoordToLocal(e,n),r=i.transformCoordToLocal(0,0);return[o[0]-r[0],o[1]-r[1]]}function yd(t,e,n){var i=id(t,e);return i&&i!==fL?i.clipPath(n,t._transform):o(n)}function vd(t){var e=t.event;e.preventDefault&&e.preventDefault()}function _d(t,e,n){return t.childOfName("main").contain(e,n)}function xd(t,e,n,i){var r,a=t._creatingCover,s=t._creatingPanel,l=t._brushOption;if(t._track.push(n.slice()),function(t){var e=t._track;if(!e.length)return!1;var n=e[e.length-1],i=e[0],o=n[0]-i[0],r=n[1]-i[1];return yL(o*o+r*r,.5)>6}(t)||a){if(s&&!a){"single"===l.brushMode&&od(t);var u=o(l);u.brushType=wd(u.brushType,s),u.panelId=s===fL?null:s.panelId,a=t._creatingCover=Kc(t,u),t._covers.push(a)}if(a){var h=ML[wd(t._brushType,s)];a.__brushOption.range=h.getCreatingRange(yd(t,a,t._track)),i&&($c(t,a),h.updateCommon(t,a)),Jc(t,a),r={isEnd:i}}}else i&&"single"===l.brushMode&&l.removeOnClick&&nd(t,e,n)&&od(t)&&(r={isEnd:i,removeOnClick:!0});return r}function wd(t,e){return"auto"===t?e.defaultBrushType:t}function bd(t,e){if(t._dragging){vd(e);var n=t.group.transformCoordToLocal(e.offsetX,e.offsetY),i=xd(t,e,n,!0);t._dragging=!1,t._track=[],t._creatingCover=null,i&&rd(t,i)}}function Sd(t){return{createCover:function(e,n){return sd({toRectRange:function(e){var n=[e,[0,100]];return t&&n.reverse(),n},fromRectRange:function(e){return e[t]}},e,n,[[["w"],["e"]],[["n"],["s"]]][t])},getCreatingRange:function(e){var n=ad(e);return[gL(n[0][t],n[1][t]),mL(n[0][t],n[1][t])]},updateCoverShape:function(e,n,i,o){var r,a=id(e,n);if(a!==fL&&a.getLinearBrushOtherExtent)r=a.getLinearBrushOtherExtent(t);else{var s=e._zr;r=[0,[s.getWidth(),s.getHeight()][1-t]]}var l=[i,r];t&&l.reverse(),ld(e,n,l,o)},updateCommon:ud,contain:_d}}function Td(t){return t=kd(t),function(e){return qa(e,t)}}function Md(t,e){return t=kd(t),function(n){var i=null!=e?e:n,o=i?t.x:t.y;return[o,o+((i?t.width:t.height)||0)]}}function Cd(t,e,n){var i=kd(t);return function(t,o){return i.contain(o[0],o[1])&&!fu(t,e,n)}}function kd(t){return lg.create(t)}function Id(t){return t[0]>t[1]&&t.reverse(),t}function Ld(t,e){return Pn(t,e,{includeMainTypes:kL})}function Pd(t,e,n,i){var o=n.getAxis(["x","y"][t]),r=Id(d([0,1],function(t){return e?o.coordToData(o.toLocalCoord(i[t]),!0):o.toGlobalCoord(o.dataToCoord(i[t]))})),a=[];return a[t]=r,a[1-t]=[NaN,NaN],{values:r,xyMinMax:a}}function Dd(t,e,n,i){return[e[0]-i[t]*n[0],e[1]-i[t]*n[1]]}function Ad(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}function Od(t){var e={xAxisIndex:t.get("xAxisIndex",!0),yAxisIndex:t.get("yAxisIndex",!0),xAxisId:t.get("xAxisId",!0),yAxisId:t.get("yAxisId",!0)};return null==e.xAxisIndex&&null==e.xAxisId&&(e.xAxisIndex="all"),null==e.yAxisIndex&&null==e.yAxisId&&(e.yAxisIndex="all"),e}function zd(t,e,n,i){Bd(t,e,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=t?t:e}),Rd(t,e,n,i)}function Ed(t){for(var e,n=t.getZr().storage.getDisplayList(),i=0,o=n.length;i0&&(s.during=l?_f($d,{el:e,userDuring:l}):null,s.setToFinal=!0,s.scope=t),a(s,n[r]),s}function Xd(t,e,n,i){var o=(i=i||{}).dataIndex,r=i.isInit,s=i.clearStyle,u=n.isAnimationEnabled(),h=rP(t),d=e.style;h.userDuring=e.during;var p={},f={};if(function(t,e,n){for(var i=0;i=0)){var c=t.getAnimationStyleProps(),d=c?c.style:null;if(d){!o&&(o=i.style={});var p=g(n);for(h=0;h0&&t.animateFrom(_,x)}else!function(t,e,n,i,o){if(o){var r=Yd("update",t,e,i,n);r.duration>0&&t.animateFrom(o,r)}}(t,e,o||0,n,p);qd(t,e),d?t.dirty():t.markRedraw()}function qd(t,e){for(var n=rP(t).leaveToProps,i=0;i=0){!r&&(r=i[t]={});var p=g(s);for(d=0;d"}(o,e.attrs)+("style"!==o?lt(r):r||"")+(i?""+n+d(i,function(e){return t(e)}).join(n)+n:"")+""}(t)}function up(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function hp(t,e,n,i){return sp("svg","root",{width:t,height:e,xmlns:MP,"xmlns:xlink":CP,version:"1.1",baseProfile:"full",viewBox:!!i&&"0 0 "+t+" "+e},n)}function cp(){return IP++}function dp(t,e,n){var i=a({},t.shape);a(i,e),t.buildPath(n,i);var o=new vP;return o.reset(we(t)),n.rebuildPath(o,1),o.generateStr(),o.getStr()}function pp(t,e){var n=e.originX,i=e.originY;(n||i)&&(t[PP]=n+"px "+i+"px")}function fp(t,e){var n=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[n]=t,n}function gp(t){return _(t)?LP[t]?"cubic-bezier("+LP[t]+")":qt(t)?t:"":""}function mp(t,e,n,i){function o(o){function r(t,e,n){for(var i=t.getTracks(),o=t.getMaxTime(),r=0;r0}).length)return fp(d,n)+" "+o[0]+" both"}var r=t.animators,s=r.length,l=[];if(t instanceof xb){var u=function(t,e,n){var i,o,r={};if(c(t.shape.paths,function(t){var e=up(n.zrId);e.animation=!0,mp(t,{},e,!0);var a=e.cssAnims,s=e.cssNodes,l=g(a),u=l.length;if(u){var h=a[o=l[u-1]];for(var c in h){var d=h[c];r[c]=r[c]||{d:""},r[c].d+=d.d||""}for(var p in s){var f=s[p].animation;f.indexOf(o)>=0&&(i=f)}}}),i){e.d=!1;var a=fp(r,n);return i.replace(o,a)}}(t,e,n);if(u)l.push(u);else if(!s)return}else if(!s)return;for(var h={},d=0;d=0&&a||r;s&&(o=he(s))}var l=i.lineWidth;l&&(l/=!i.strokeNoScale&&t.transform?t.transform[0]:1);var u={cursor:"pointer"};o&&(u.fill=o),i.stroke&&(u.stroke=i.stroke),l&&(u["stroke-width"]=l),yp(u,e,n,!0)}}(t,r,e),sp(s,t.id+"",r)}function kp(t,e){return t instanceof ov?Cp(t,e):t instanceof cv?function(t,e){var n=t.style,i=n.image;if(i&&!_(i)&&(vp(i)?i=i.src:_p(i)&&(i=i.toDataURL())),i){var o=n.x||0,r=n.y||0,a={href:i,width:n.width,height:n.height};return o&&(a.x=o),r&&(a.y=r),Sp(a,t.transform),xp(a,n,t,e),wp(a,t),e.animation&&mp(t,a,e),sp("image",t.id+"",a)}}(t,e):t instanceof sv?function(t,e){var n=t.style,i=n.text;if(null!=i&&(i+=""),i&&!isNaN(n.x)&&!isNaN(n.y)){var o=n.font||of,r=n.x||0,a=function(t,e,n){return"top"===n?t+=e/2:"bottom"===n&&(t-=e/2),t}(n.y||0,Xe(o),n.textBaseline),s={"dominant-baseline":"central","text-anchor":Wg[n.textAlign]||n.textAlign};if(Si(n)){var l="",u=n.fontStyle,h=wi(n.fontSize);if(!parseFloat(h))return;var c=n.fontWeight;l+="font-size:"+h+";font-family:"+(n.fontFamily||nf)+";",u&&"normal"!==u&&(l+="font-style:"+u+";"),c&&"normal"!==c&&(l+="font-weight:"+c+";"),s.style=l}else s.style="font: "+o;return i.match(/\s/)&&(s["xml:space"]="preserve"),r&&(s.x=r),a&&(s.y=a),Sp(s,t.transform),xp(s,n,t,e),wp(s,t),e.animation&&mp(t,s,e),sp("text",t.id+"",s,void 0,i)}}(t,e):void 0}function Ip(t,e,n,i){var o,r=t[n],a={gradientUnits:r.global?"userSpaceOnUse":"objectBoundingBox"};if(ye(r))o="linearGradient",a.x1=r.x,a.y1=r.y,a.x2=r.x2,a.y2=r.y2;else{if(!ve(r))return;o="radialGradient",a.cx=L(r.x,.5),a.cy=L(r.y,.5),a.r=L(r.r,.5)}for(var s=r.colorStops,l=[],u=0,h=s.length;ul?Wp(t,null==n[c+1]?null:n[c+1].elm,n,s,c):jp(t,e,a,l))}(n,i,o):Fp(o)?(Fp(t.text)&&Bp(n,""),Wp(n,null,o,0,o.length-1)):Fp(i)?jp(n,i,0,i.length-1):Fp(t.text)&&Bp(n,""):t.text!==e.text&&(Fp(i)&&jp(n,i,0,i.length-1),Bp(n,e.text)))}function Yp(t,e,n){var i=af.createCanvas(),o=e.getWidth(),r=e.getHeight(),a=i.style;return a&&(a.position="absolute",a.left="0",a.top="0",a.width=o+"px",a.height=r+"px",i.setAttribute("data-zr-dom-id",t)),i.width=o*n,i.height=r*n,i}function Xp(){xl(!0)&&(function(t){var e=W_.extend(t);W_.registerClass(e)}({type:"leaflet",getLeaflet(){return this.__map},setCenterAndZoom(t,e){this.option.center=t,this.option.zoom=e},centerOrZoomChanged(t,e){const{option:n}=this;return o=n.center,!((i=t)&&o&&i[0]===o[0]&&i[1]===o[1]&&e===n.zoom);var i,o},defaultOption:{mapOptions:{},tiles:[{urlTemplate:"http://{s}.tile.osm.org/{z}/{x}/{y}.png",options:{attribution:'© OpenStreetMap contributors'}}],layerControl:{}}}),function(t){var e=ww.extend(t);ww.registerClass(e)}({type:"leaflet",render(t,e,n){function i(e){if(s)return;const i=l._mapPane;let o=i.style.transform,r=0,a=0;if(o){o=o.replace("translate3d(","");const t=o.split(",");r=-parseInt(t[0],10),a=-parseInt(t[1],10)}else r=-parseInt(i.style.left,10),a=-parseInt(i.style.top,10);const c=[r,a];u.style.left=`${c[0]}px`,u.style.top=`${c[1]}px`,h.setMapOffset(c),t.__mapOffset=c,n.dispatchAction({type:"leafletRoam",animation:{duration:0}})}function o(){s||n.dispatchAction({type:"leafletRoam"})}function r(){i()}function a(){ul(n.getDom()).resize()}let s=!0;const l=t.getLeaflet(),u=n.getZr().painter.getViewportRoot().parentNode,h=t.coordinateSystem,{roam:c}=t.get("mapOptions");c&&"scale"!==c?l.dragging.enable():l.dragging.disable(),c&&"move"!==c?(l.scrollWheelZoom.enable(),l.doubleClickZoom.enable(),l.touchZoom.enable()):(l.scrollWheelZoom.disable(),l.doubleClickZoom.disable(),l.touchZoom.disable()),this._oldMoveHandler&&l.off("move",this._oldMoveHandler),this._oldZoomHandler&&l.off("zoom",this._oldZoomHandler),this._oldZoomEndHandler&&l.off("zoomend",this._oldZoomEndHandler),this._oldResizeHandler&&l.off("resize",this._oldResizeHandler),l.on("move",i),l.on("zoom",r),l.on("zoomend",o),l.on("resize",a),this._oldMoveHandler=i,this._oldZoomHandler=r,this._oldZoomEndHandler=o,this._oldResizeHandler=a,s=!1}}),gl("leaflet",YP()),fl({type:"leafletRoam",event:"leafletRoam",update:"updateLayout"},(t,e)=>{e.eachComponent("leaflet",t=>{const e=t.getLeaflet(),n=e.getCenter();t.setCenterAndZoom([n.lng,n.lat],e.getZoom())})}))}var qp={};t.r(qp),t.d(qp,{Arc:()=>vb,BezierCurve:()=>gb,BoundingRect:()=>lg,Circle:()=>Ew,CompoundPath:()=>xb,Ellipse:()=>Nw,Group:()=>Em,Image:()=>cv,IncrementalDisplayable:()=>Rb,Line:()=>cb,LinearGradient:()=>Sb,OrientedBoundingRect:()=>zb,Path:()=>ov,Point:()=>Gf,Polygon:()=>ob,Polyline:()=>sb,RadialGradient:()=>Tb,Rect:()=>mv,Ring:()=>eb,Sector:()=>Jw,Text:()=>Tv,WH:()=>Vb,XY:()=>Fb,applyTransform:()=>Ga,calcZ2Range:()=>hs,clipPointsByRect:()=>qa,clipRectByRect:()=>Ka,createIcon:()=>$a,ensureCopyRect:()=>ss,ensureCopyTransform:()=>ls,expandOrShrinkRect:()=>es,extendPath:()=>Ea,extendShape:()=>za,getShapeClass:()=>Ba,getTransform:()=>ja,groupTransition:()=>Xa,initProps:()=>La,isBoundingRectAxisAligned:()=>as,isElementRemoved:()=>Pa,lineLineIntersect:()=>Qa,linePolygonIntersect:()=>Ja,makeImage:()=>Fa,makePath:()=>Na,mergePath:()=>Hb,registerShape:()=>Ra,removeElement:()=>Da,removeElementWithFadeOut:()=>Oa,resizePath:()=>Za,retrieveZInfo:()=>us,setTooltipConfig:()=>is,subPixelOptimize:()=>Wb,subPixelOptimizeLine:()=>Ha,subPixelOptimizeRect:()=>Wa,transformDirection:()=>Ua,traverseElements:()=>rs,traverseUpdateZ:()=>cs,updateProps:()=>Ia});var Kp=function(t,e){return Kp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Kp(t,e)},$p=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},Jp=new function(){this.browser=new $p,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(Jp.wxa=!0,Jp.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?Jp.worker=!0:!Jp.hasGlobalWindow||"Deno"in window||"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Node.js")>-1?(Jp.node=!0,Jp.svgSupported=!0):function(t,e){var n=e.browser,i=t.match(/Firefox\/([\d.]+)/),o=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),r=t.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(t);if(i&&(n.firefox=!0,n.version=i[1]),o&&(n.ie=!0,n.version=o[1]),r&&(n.edge=!0,n.version=r[1],n.newEdge=+r[1].split(".")[0]>18),a&&(n.weChat=!0),e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,e.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11),e.domSupported="undefined"!=typeof document){var s=document.documentElement.style;e.transform3dSupported=(n.ie&&"transition"in s||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||n.ie&&+n.version>=9}}(navigator.userAgent,Jp);const Qp=Jp;var tf,ef,nf="sans-serif",of="12px "+nf,rf=function(){var t={};if("undefined"==typeof JSON)return t;for(var e=0;e<95;e++){var n=String.fromCharCode(e+32),i=("007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N".charCodeAt(e)-20)/100;t[n]=i}return t}(),af={createCanvas:function(){return"undefined"!=typeof document&&document.createElement("canvas")},measureText:function(t,e){if(!tf){var n=af.createCanvas();tf=n&&n.getContext("2d")}if(tf)return ef!==e&&(ef=tf.font=e||of),tf.measureText(t);t=t||"";var i=/((?:\d+)?\.?\d*)px/.exec(e=e||of),o=i&&+i[1]||12,r=0;if(e.indexOf("mono")>=0)r=o*t.length;else for(var a=0;a"'])/g,Bf={"&":"&","<":"<",">":">",'"':""","'":"'"},Nf=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ff=[],Vf=Qp.browser.firefox&&+Qp.browser.version.split(".")[0]<39,Zf=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0},Hf=function(){function t(){this._track=[]}return t.prototype.recognize=function(t,e,n){return this._doTrack(t,e,n),this._recognize(t)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(t,e,n){var i=t.touches;if(i){for(var o={points:[],touches:[],target:e,event:t},r=0,a=i.length;r1&&o&&o.length>1){var a=mt(o)/mt(r);!isFinite(a)&&(a=1),e.pinchScale=a;var s=[((i=o)[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2];return e.pinchX=s[0],e.pinchY=s[1],{type:"pinch",target:t[0].target,event:e}}}}},jf=function(){function t(t,e){this.x=t||0,this.y=e||0}return t.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},t.prototype.scale=function(t){this.x*=t,this.y*=t},t.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},t.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},t.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},t.prototype.distanceSquare=function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(t){if(t){var e=this.x,n=this.y;return this.x=t[0]*e+t[2]*n+t[4],this.y=t[1]*e+t[3]*n+t[5],this}},t.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},t.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},t.set=function(t,e,n){t.x=e,t.y=n},t.copy=function(t,e){t.x=e.x,t.y=e.y},t.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},t.lenSquare=function(t){return t.x*t.x+t.y*t.y},t.dot=function(t,e){return t.x*e.x+t.y*e.y},t.add=function(t,e,n){t.x=e.x+n.x,t.y=e.y+n.y},t.sub=function(t,e,n){t.x=e.x-n.x,t.y=e.y-n.y},t.scale=function(t,e,n){t.x=e.x*n,t.y=e.y*n},t.scaleAndAdd=function(t,e,n,i){t.x=e.x+n.x*i,t.y=e.y+n.y*i},t.lerp=function(t,e,n,i){var o=1-i;t.x=o*e.x+i*n.x,t.y=o*e.y+i*n.y},t}();const Gf=jf;var Uf=Math.min,Yf=Math.max,Xf=Math.abs,qf=["x","y"],Kf=["width","height"],$f=new Gf,Jf=new Gf,Qf=new Gf,tg=new Gf,eg=Tt(),ng=eg.minTv,ig=eg.maxTv,og=[0,0],rg=function(){function t(e,n,i,o){t.set(this,e,n,i,o)}return t.set=function(t,e,n,i,o){return i<0&&(e+=i,i=-i),o<0&&(n+=o,o=-o),t.x=e,t.y=n,t.width=i,t.height=o,t},t.prototype.union=function(t){var e=Uf(t.x,this.x),n=Uf(t.y,this.y);this.width=isFinite(this.x)&&isFinite(this.width)?Yf(t.x+t.width,this.x+this.width)-e:t.width,this.height=isFinite(this.y)&&isFinite(this.height)?Yf(t.y+t.height,this.y+this.height)-n:t.height,this.x=e,this.y=n},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(t){var e=this,n=t.width/e.width,i=t.height/e.height,o=[1,0,0,1,0,0];return xt(o,o,[-e.x,-e.y]),function(t,e,n){var i=n[0],o=n[1];t[0]=e[0]*i,t[1]=e[1]*o,t[2]=e[2]*i,t[3]=e[3]*o,t[4]=e[4]*i,t[5]=e[5]*o}(o,o,[n,i]),xt(o,o,[t.x,t.y]),o},t.prototype.intersect=function(e,n,i){return t.intersect(this,e,n,i)},t.intersect=function(e,n,i,o){i&&Gf.set(i,0,0);var r=o&&o.outIntersectRect||null,a=o&&o.clamp;if(r&&(r.x=r.y=r.width=r.height=NaN),!e||!n)return!1;e instanceof t||(e=t.set(ag,e.x,e.y,e.width,e.height)),n instanceof t||(n=t.set(sg,n.x,n.y,n.width,n.height));var s=!!i;eg.reset(o,s);var l=eg.touchThreshold,u=e.x+l,h=e.x+e.width-l,c=e.y+l,d=e.y+e.height-l,p=n.x+l,f=n.x+n.width-l,g=n.y+l,m=n.y+n.height-l;if(u>h||c>d||p>f||g>m)return!1;var y=!(h=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},t.prototype.contain=function(e,n){return t.contain(this,e,n)},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return 0===this.width||0===this.height},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(t,e){return t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t},t.applyTransform=function(e,n,i){if(i){if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var o=i[0],r=i[3],a=i[5];return e.x=n.x*o+i[4],e.y=n.y*r+a,e.width=n.width*o,e.height=n.height*r,e.width<0&&(e.x+=e.width,e.width=-e.width),void(e.height<0&&(e.y+=e.height,e.height=-e.height))}$f.x=Qf.x=n.x,$f.y=tg.y=n.y,Jf.x=tg.x=n.x+n.width,Jf.y=Qf.y=n.y+n.height,$f.transform(i),tg.transform(i),Jf.transform(i),Qf.transform(i),e.x=Uf($f.x,Jf.x,Qf.x,tg.x),e.y=Uf($f.y,Jf.y,Qf.y,tg.y);var s=Yf($f.x,Jf.x,Qf.x,tg.x),l=Yf($f.y,Jf.y,Qf.y,tg.y);e.width=s-e.x,e.height=l-e.y}else e!==n&&t.copy(e,n)},t}(),ag=new rg(0,0,0,0),sg=new rg(0,0,0,0);const lg=rg;var ug="silent",hg=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.handler=null,e}return W(e,t),e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(Af),cg=function(t,e){this.x=t,this.y=e},dg=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],pg=new lg(0,0,0,0),fg=function(t){function e(e,n,i,o,r){var a=t.call(this)||this;return a._hovered=new cg(0,0),a.storage=e,a.painter=n,a.painterRoot=o,a._pointerSize=r,i=i||new hg,a.proxy=null,a.setHandlerProxy(i),a._draggingMgr=new Pf(a),a}return W(e,t),e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(c(dg,function(e){t.on&&t.on(e,this[e],this)},this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var e=t.zrX,n=t.zrY,i=It(this,e,n),o=this._hovered,r=o.target;r&&!r.__zr&&(r=(o=this.findHover(o.x,o.y)).target);var a=this._hovered=i?new cg(e,n):this.findHover(e,n),s=a.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),r&&s!==r&&this.dispatchToElement(o,"mouseout",t),this.dispatchToElement(a,"mousemove",t),s&&s!==r&&this.dispatchToElement(a,"mouseover",t)},e.prototype.mouseout=function(t){var e=t.zrEventControl;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new cg(0,0)},e.prototype.dispatch=function(t,e){var n=this[t];n&&n.call(this,e)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},e.prototype.dispatchToElement=function(t,e,n){var i=(t=t||{}).target;if(!i||!i.silent){for(var o="on"+e,r=function(t,e,n){return{type:t,event:n,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:Mt}}(e,t,n);i&&(i[o]&&(r.cancelBubble=!!i[o].call(i,r)),i.trigger(e,r),i=i.__hostTarget?i.__hostTarget:i.parent,!r.cancelBubble););r.cancelBubble||(this.trigger(e,r),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(t){"function"==typeof t[o]&&t[o].call(t,r),t.trigger&&t.trigger(e,r)}))}},e.prototype.findHover=function(t,e,n){var i=this.storage.getDisplayList(),o=new cg(t,e);if(kt(i,o,t,e,n),this._pointerSize&&!o.target){for(var r=[],a=this._pointerSize,s=a/2,l=new lg(t-s,e-s,a,a),u=i.length-1;u>=0;u--){var h=i[u];h===n||h.ignore||h.ignoreCoarsePointer||h.parent&&h.parent.ignoreCoarsePointer||(pg.copy(h.getBoundingRect()),h.transform&&pg.applyTransform(h.transform),pg.intersect(l)&&r.push(h))}if(r.length)for(var c=Math.PI/12,d=2*Math.PI,p=0;p4)return;this._downPoint=null}this.dispatchToElement(n,t,e)}});const gg=fg;var mg=!1,yg=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Et}return t.prototype.traverse=function(t,e){for(var n=0;n=0&&this._roots.splice(i,1)}},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}();const vg=yg,_g=Qp.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};var xg={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),(t*=2)<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-xg.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*xg.bounceIn(2*t):.5*xg.bounceOut(2*t-1)+.5}};const wg=xg;var bg=Math.pow,Sg=Math.sqrt,Tg=1e-8,Mg=1e-4,Cg=Sg(3),kg=1/3,Ig=j(),Lg=j(),Pg=j(),Dg=/cubic-bezier\(([0-9,\.e ]+)\)/;const Ag=function(){function t(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||H,this.ondestroy=t.ondestroy||H,this.onrestart=t.onrestart||H,t.easing&&this.setEasing(t.easing)}return t.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),!this._paused){var n=this._life,i=t-this._startTime-this._pausedTime,o=i/n;o<0&&(o=0),o=Math.min(o,1);var r=this.easingFunc,a=r?r(o):o;if(this.onframe(a),1===o){if(!this.loop)return!0;this._startTime=t-i%n,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=e},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(t){this.easing=t,this.easingFunc=v(t)?t:wg[t]||qt(t)},t}();var Og=function(t){this.value=t},zg=function(){function t(){this._len=0}return t.prototype.insert=function(t){var e=new Og(t);return this.insertEntry(e),e},t.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++},t.prototype.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),Eg=function(){function t(t){this._list=new zg,this._maxSize=10,this._map={},this._maxSize=t}return t.prototype.put=function(t,e){var n=this._list,i=this._map,o=null;if(null==i[t]){var r=n.len(),a=this._lastRemovedEntry;if(r>=this._maxSize&&r>0){var s=n.head;n.remove(s),delete i[s.key],o=s.value,this._lastRemovedEntry=s}a?a.value=e:a=new Og(e),a.key=t,n.insertEntry(a),i[t]=a}return o},t.prototype.get=function(t){var e=this._map[t],n=this._list;if(null!=e)return e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}();const Rg=Eg;var Bg={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]},Ng=new Rg(20),Fg=null,Vg=new Rg(100),Zg=Math.round,Hg=1e-4,Wg={left:"start",right:"end",center:"middle",middle:"middle"},jg=Qp.hasGlobalWindow&&v(window.btoa)?function(t){return window.btoa(unescape(encodeURIComponent(t)))}:"undefined"!=typeof Buffer?function(t){return Buffer.from(t).toString("base64")}:function(t){return null},Gg=Array.prototype.slice,Ug=[0,0,0,0],Yg=function(){function t(t){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=t}return t.prototype.isFinished=function(){return this._finished},t.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},t.prototype.needsAnimate=function(){return this.keyframes.length>=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(t,e,n){this._needsSort=!0;var i=this.keyframes,o=i.length,r=!1,s=6,l=e;if(h(e)){var u=function(t){return h(t&&t[0])?2:1}(e);s=u,(1===u&&!w(e[0])||2===u&&!w(e[0][0]))&&(r=!0)}else if(w(e)&&!k(e))s=0;else if(_(e))if(isNaN(+e)){var c=oe(e);c&&(l=c,s=3)}else s=0;else if(C(e)){var p=a({},l);p.colorStops=d(e.colorStops,function(t){return{offset:t.offset,color:oe(t.color)}}),ye(e)?s=4:ve(e)&&(s=5),l=p}0===o?this.valType=s:s===this.valType&&6!==s||(r=!0),this.discrete=this.discrete||r;var f={time:t,value:l,rawValue:e,percent:0};return n&&(f.easing=n,f.easingFunc=v(n)?n:wg[n]||qt(n)),i.push(f),f},t.prototype.prepare=function(t,e){var n=this.keyframes;this._needsSort&&n.sort(function(t,e){return t.time-e.time});for(var i=this.valType,o=n.length,r=n[o-1],a=this.discrete,s=Ae(i),l=De(i),u=0;u=0&&!(l[n].percent<=e);n--);n=f(n,u-2)}else{for(n=p;ne);n++);n=f(n-1,u-2)}o=l[n+1],i=l[n]}if(i&&o){this._lastFr=n,this._lastFrP=e;var g=o.percent-i.percent,m=0===g?1:f((e-i.percent)/g,1);o.easingFunc&&(m=o.easingFunc(m));var y=r?this._additiveValue:c?Ug:t[h];if(!Ae(s)&&!c||y||(y=this._additiveValue=[]),this.discrete)t[h]=m<1?i.rawValue:o.rawValue;else if(Ae(s))1===s?Te(y,i[a],o[a],m):function(t,e,n,i){for(var o=e.length,r=o&&e[0].length,a=0;a0&&s.addKeyframe(0,Le(l),i),this._trackKeys.push(a)}s.addKeyframe(t,Le(e[a]),i)}return this._maxTime=Math.max(this._maxTime,t),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,n=0;n0)){this._started=1;for(var e=this,n=[],i=this._maxTime||0,o=0;o1){var a=r.pop();o.addKeyframe(a.time,t[i]),o.prepare(this._maxTime,o.getAdditiveTrack())}}}},t}();const qg=Xg;var Kg=function(t){function e(e){var n=t.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,n.stage=(e=e||{}).stage||{},n}return W(e,t),e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var e=t.getClip();e&&this.addClip(e)},e.prototype.removeClip=function(t){if(t.animation){var e=t.prev,n=t.next;e?e.next=n:this._head=n,n?n.prev=e:this._tail=e,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var e=t.getClip();e&&this.removeClip(e),t.animation=null},e.prototype.update=function(t){for(var e=Oe()-this._pausedTime,n=e-this._time,i=this._head;i;){var o=i.next;i.step(e,n)?(i.ondestroy(),this.removeClip(i),i=o):i=o}this._time=e,t||(this.trigger("frame",n),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0,_g(function e(){t._running&&(_g(e),!t._paused&&t.update())})},e.prototype.start=function(){this._running||(this._time=Oe(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=Oe(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=Oe()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var e=t.next;t.prev=t.next=t.animation=null,t=e}this._head=this._tail=null},e.prototype.isFinished=function(){return null==this._head},e.prototype.animate=function(t,e){e=e||{},this.start();var n=new qg(t,e.loop);return this.addAnimator(n),n},e}(Af);const $g=Kg;var Jg,Qg,tm=Qp.domSupported,em=(Qg={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:Jg=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:d(Jg,function(t){var e=t.replace("mouse","pointer");return Qg.hasOwnProperty(e)?e:t})}),nm=["mousemove","mouseup"],im=["pointermove","pointerup"],om=!1,rm=function(t,e){this.stopPropagation=H,this.stopImmediatePropagation=H,this.preventDefault=H,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY},am={mousedown:function(t){t=dt(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=dt(this.dom,t);var e=this.__mayPointerCapture;!e||t.zrX===e[0]&&t.zrY===e[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=dt(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){Re(this,(t=dt(this.dom,t)).toElement||t.relatedTarget)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){om=!0,t=dt(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){om||(t=dt(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){Ee(t=dt(this.dom,t)),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),am.mousemove.call(this,t),am.mousedown.call(this,t)},touchmove:function(t){Ee(t=dt(this.dom,t)),this.handler.processGesture(t,"change"),am.mousemove.call(this,t)},touchend:function(t){Ee(t=dt(this.dom,t)),this.handler.processGesture(t,"end"),am.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<300&&am.click.call(this,t)},pointerdown:function(t){am.mousedown.call(this,t)},pointermove:function(t){ze(t)||am.mousemove.call(this,t)},pointerup:function(t){am.mouseup.call(this,t)},pointerout:function(t){ze(t)||am.mouseout.call(this,t)}};c(["click","dblclick","contextmenu"],function(t){am[t]=function(e){e=dt(this.dom,e),this.trigger(t,e)}});var sm={pointermove:function(t){ze(t)||sm.mousemove.call(this,t)},pointerup:function(t){sm.mouseup.call(this,t)},mousemove:function(t){this.trigger("mousemove",t)},mouseup:function(t){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",t),e&&(t.zrEventControl="only_globalout",this.trigger("mouseout",t))}},lm=function(t,e){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=t,this.domHandlers=e};const um=function(t){function e(e,n){var i,o,r,a=t.call(this)||this;return a.__pointerCapturing=!1,a.dom=e,a.painterRoot=n,a._localHandlerScope=new lm(e,am),tm&&(a._globalHandlerScope=new lm(document,sm)),i=a,r=(o=a._localHandlerScope).domHandlers,Qp.pointerEventsSupported?c(em.pointer,function(t){Be(o,t,function(e){r[t].call(i,e)})}):(Qp.touchEventsSupported&&c(em.touch,function(t){Be(o,t,function(e){r[t].call(i,e),function(t){t.touching=!0,null!=t.touchTimer&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout(function(){t.touching=!1,t.touchTimer=null},700)}(o)})}),c(em.mouse,function(t){Be(o,t,function(e){e=ct(e),o.touching||r[t].call(i,e)})})),a}return W(e,t),e.prototype.dispose=function(){Ne(this._localHandlerScope),tm&&Ne(this._globalHandlerScope)},e.prototype.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},e.prototype.__togglePointerCapture=function(t){if(this.__mayPointerCapture=null,tm&&+this.__pointerCapturing^+t){this.__pointerCapturing=t;var e=this._globalHandlerScope;t?function(t,e){function n(n){Be(e,n,function(i){i=ct(i),Re(t,i.target)||(i=function(t,e){return dt(t.dom,new rm(t,e),!0)}(t,i),e.domHandlers[n].call(t,i))},{capture:!0})}Qp.pointerEventsSupported?c(im,n):Qp.touchEventsSupported||c(nm,n)}(this,e):Ne(e)}},e}(Af);var hm=1;Qp.hasGlobalWindow&&(hm=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var cm=hm,dm="#333",pm="#ccc",fm=yt,gm=5e-5,mm=[],ym=[],vm=[1,0,0,1,0,0],_m=Math.abs,xm=function(){function t(){}var e;return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},t.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},t.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},t.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},t.prototype.needLocalTransform=function(){return Fe(this.rotation)||Fe(this.x)||Fe(this.y)||Fe(this.scaleX-1)||Fe(this.scaleY-1)||Fe(this.skewX)||Fe(this.skewY)},t.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),n=this.transform;e||t?(n=n||[1,0,0,1,0,0],e?this.getLocalTransform(n):fm(n),t&&(e?_t(n,t,n):vt(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)):n&&(fm(n),this.invTransform=null)},t.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(null!=e&&1!==e){this.getGlobalScale(mm);var n=mm[0]<0?-1:1,i=mm[1]<0?-1:1,o=((mm[0]-n)*e+n)/mm[0]||0,r=((mm[1]-i)*e+i)/mm[1]||0;t[0]*=o,t[1]*=o,t[2]*=r,t[3]*=r}this.invTransform=this.invTransform||[1,0,0,1,0,0],bt(this.invTransform,t)},t.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},t.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],n=t[2]*t[2]+t[3]*t[3],i=Math.atan2(t[1],t[0]),o=Math.PI/2+i-Math.atan2(t[3],t[2]);n=Math.sqrt(n)*Math.cos(o),e=Math.sqrt(e),this.skewX=o,this.skewY=0,this.rotation=-i,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||[1,0,0,1,0,0],_t(ym,t.invTransform,e),e=ym);var n=this.originX,i=this.originY;(n||i)&&(vm[4]=n,vm[5]=i,_t(ym,e,vm),ym[4]-=n,ym[5]-=i,e=ym),this.setLocalTransform(e)}},t.prototype.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},t.prototype.transformCoordToLocal=function(t,e){var n=[t,e],i=this.invTransform;return i&&et(n,n,i),n},t.prototype.transformCoordToGlobal=function(t,e){var n=[t,e],i=this.transform;return i&&et(n,n,i),n},t.prototype.getLineScale=function(){var t=this.transform;return t&&_m(t[0]-1)>1e-10&&_m(t[3]-1)>1e-10?Math.sqrt(_m(t[0]*t[3]-t[2]*t[1])):1},t.prototype.copyTransform=function(t){Ve(this,t)},t.getLocalTransform=function(t,e){e=e||[];var n=t.originX||0,i=t.originY||0,o=t.scaleX,r=t.scaleY,a=t.anchorX,s=t.anchorY,l=t.rotation||0,u=t.x,h=t.y,c=t.skewX?Math.tan(t.skewX):0,d=t.skewY?Math.tan(-t.skewY):0;if(n||i||a||s){var p=n+a,f=i+s;e[4]=-p*o-c*f*r,e[5]=-f*r-d*p*o}else e[4]=e[5]=0;return e[0]=o,e[3]=r,e[1]=d*o,e[2]=c*r,l&&wt(e,e,l),e[4]+=n+u,e[5]+=i+h,e},t.initDefaultProps=((e=t.prototype).scaleX=e.scaleY=e.globalScaleRatio=1,void(e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0)),t}(),wm=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];const bm=xm;var Sm,Tm=0,Mm=5,Cm="__zr_normal__",km=wm.concat(["ignore"]),Im=p(wm,function(t,e){return t[e]=!0,t},{ignore:!1}),Lm={},Pm=new lg(0,0,0,0),Dm=[],Am=function(){function t(t){this.id=n(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return t.prototype._init=function(t){this.attr(t)},t.prototype.drift=function(t,e,n){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=e,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,o=e.innerTransformable,r=void 0,a=void 0,s=!1;o.parent=i?this:null;var l=!1;o.copyTransform(e);var u=null!=n.position,h=n.autoOverflowArea,c=void 0;if((h||u)&&((c=Pm).copy(n.layoutRect?n.layoutRect:this.getBoundingRect()),i||c.applyTransform(this.transform)),u){this.calculateTextPosition?this.calculateTextPosition(Lm,n,c):Ke(Lm,n,c),o.x=Lm.x,o.y=Lm.y,r=Lm.align,a=Lm.verticalAlign;var d=n.origin;if(d&&null!=n.rotation){var p=void 0,f=void 0;"center"===d?(p=.5*c.width,f=.5*c.height):(p=qe(d[0],c.width),f=qe(d[1],c.height)),l=!0,o.originX=-o.x+p+(i?0:c.x),o.originY=-o.y+f+(i?0:c.y)}}null!=n.rotation&&(o.rotation=n.rotation);var g=n.offset;g&&(o.x+=g[0],o.y+=g[1],l||(o.originX=-g[0],o.originY=-g[1]));var m=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(h){var y=m.overflowRect=m.overflowRect||new lg(0,0,0,0);o.getLocalTransform(Dm),bt(Dm,Dm),lg.copy(y,c),y.applyTransform(Dm)}else m.overflowRect=null;var v=void 0,_=void 0,x=void 0;(null==n.inside?"string"==typeof n.position&&n.position.indexOf("inside")>=0:n.inside)&&this.canBeInsideText()?(_=n.insideStroke,null!=(v=n.insideFill)&&"auto"!==v||(v=this.getInsideTextFill()),null!=_&&"auto"!==_||(_=this.getInsideTextStroke(v),x=!0)):(_=n.outsideStroke,null!=(v=n.outsideFill)&&"auto"!==v||(v=this.getOutsideFill()),null!=_&&"auto"!==_||(_=this.getOutsideStroke(v),x=!0)),(v=v||"#000")===m.fill&&_===m.stroke&&x===m.autoStroke&&r===m.align&&a===m.verticalAlign||(s=!0,m.fill=v,m.stroke=_,m.autoStroke=x,m.align=r,m.verticalAlign=a,e.setDefaultTextStyle(m)),e.__dirty|=1,s&&e.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(t){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?pm:dm},t.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),n="string"==typeof e&&oe(e);n||(n=[255,255,255,1]);for(var i=n[3],o=this.__zr.isDarkMode(),r=0;r<3;r++)n[r]=n[r]*i+(o?0:255)*(1-i);return n[3]=1,le(n,"rgba")},t.prototype.traverse=function(t,e){},t.prototype.attrKV=function(t,e){"textConfig"===t?this.setTextConfig(e):"textContent"===t?this.setTextContent(e):"clipPath"===t?this.setClipPath(e):"extra"===t?(this.extra=this.extra||{},a(this.extra,e)):this[t]=e},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(b(t))for(var n=g(t),i=0;i0},t.prototype.getState=function(t){return this.states[t]},t.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},t.prototype.clearStates=function(t){this.useState(Cm,!1,t)},t.prototype.useState=function(t,e,n,o){var r=t===Cm;if(this.hasState()||!r){var a=this.currentStates,s=this.stateTransition;if(!(l(a,t)>=0)||!e&&1!==a.length){var u;if(this.stateProxy&&!r&&(u=this.stateProxy(t)),u||(u=this.states&&this.states[t]),u||r){r||this.saveCurrentToNormalState(u);var h=!!(u&&u.hoverLayer||o);h&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,u,this._normalState,e,!n&&!this.__inHover&&s&&s.duration>0,s);var c=this._textContent,d=this._textGuide;return c&&c.useState(t,e,n,h),d&&d.useState(t,e,n,h),r?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),u}i("State "+t+" not exists.")}}},t.prototype.useStates=function(t,e,n){if(t.length){var i=[],o=this.currentStates,r=t.length,a=r===o.length;if(a)for(var s=0;s0,p);var f=this._textContent,g=this._textGuide;f&&f.useStates(t,e,c),g&&g.useStates(t,e,c),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}else this.clearStates()},t.prototype.isSilent=function(){for(var t=this;t;){if(t.silent)return!0;var e=t.__hostTarget;t=e?t.ignoreHostSilent?null:e:t.parent}return!1},t.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var n=this.currentStates.slice();n.splice(e,1),this.useStates(n)}},t.prototype.replaceState=function(t,e,n){var i=this.currentStates.slice(),o=l(i,t),r=l(i,e)>=0;o>=0?r?i.splice(o,1):i[o]=e:n&&!r&&i.push(e),this.useStates(i)},t.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},t.prototype._mergeStates=function(t){for(var e,n={},i=0;i=0&&e.splice(n,1)}),this.animators.push(t),n&&n.animation.addAnimator(t),n&&n.wakeUp()},t.prototype.updateDuringAnimation=function(t){this.markRedraw()},t.prototype.stopAnimation=function(t,e){for(var n=this.animators,i=n.length,o=[],r=0;r=0&&(n.splice(i,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,e){var n=l(this._children,t);return n>=0&&this.replaceAt(e,n),this},e.prototype.replaceAt=function(t,e){var n=this._children,i=n[e];if(t&&t!==this&&t.parent!==this&&t!==i){n[e]=t,i.parent=null;var o=this.__zr;o&&i.removeSelfFromZr(o),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__zr;e&&e!==t.__zr&&t.addSelfToZr(e),e&&e.refresh()},e.prototype.remove=function(t){var e=this.__zr,n=this._children,i=l(n,t);return i<0||(n.splice(i,1),t.parent=null,e&&t.removeSelfFromZr(e),e&&e.refresh()),this},e.prototype.removeAll=function(){for(var t=this._children,e=this.__zr,n=0;n0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},t.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover())},t.prototype.resize=function(t){this._disposed||(this.painter.resize((t=t||{}).width,t.height),this.handler.resize())},t.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},t.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},t.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},t.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},t.prototype.findHover=function(t,e){if(!this._disposed)return this.handler.findHover(t,e)},t.prototype.on=function(t,e,n){return this._disposed||this.handler.on(t,e,n),this},t.prototype.off=function(t,e){this._disposed||this.handler.off(t,e)},t.prototype.trigger=function(t,e){this._disposed||this.handler.trigger(t,e)},t.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),e=0;e0?t.length:0,this.item=null,this.key=NaN,this},t.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)}}(),"___EC__COMPONENT__CONTAINER___"),Qm="___EC__EXTENDED_CLASS___",ty=Math.round(10*Math.random()),ey=Vn([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),ny=function(){function t(){}return t.prototype.getAreaStyle=function(t,e){return ey(this,t,e)},t}(),iy=new Rg(50),oy=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,ry=function(){},ay=function(t){this.tokens=[],t&&(this.tokens=t)},sy=function(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1},ly=p(",&?/;] ".split(""),function(t,e){return t[e]=!0,t},{}),uy=new lg(0,0,0,0),hy={outIntersectRect:{},clamp:!0},cy="__zr_style_"+Math.round(10*Math.random()),dy={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},py={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};dy[cy]=!0;var fy=["z","z2","invisible"],gy=["invisible"],my=function(t){function e(e){return t.call(this,e)||this}var n;return W(e,t),e.prototype._init=function(e){for(var n=g(e),i=0;i0&&(this._ux=Zy(n/cm/t)||0,this._uy=Zy(n/cm/e)||0)},t.prototype.setDPR=function(t){this.dpr=t},t.prototype.setContext=function(t){this._ctx=t},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(Py.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},t.prototype.lineTo=function(t,e){var n=Zy(t-this._xi),i=Zy(e-this._yi),o=n>this._ux||i>this._uy;if(this.addData(Py.L,t,e),this._ctx&&o&&this._ctx.lineTo(t,e),o)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var r=n*n+i*i;r>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=r)}return this},t.prototype.bezierCurveTo=function(t,e,n,i,o,r){return this._drawPendingPt(),this.addData(Py.C,t,e,n,i,o,r),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,o,r),this._xi=o,this._yi=r,this},t.prototype.quadraticCurveTo=function(t,e,n,i){return this._drawPendingPt(),this.addData(Py.Q,t,e,n,i),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this._xi=n,this._yi=i,this},t.prototype.arc=function(t,e,n,i,o,r){return this._drawPendingPt(),Gy[0]=i,Gy[1]=o,function(t,e){var n=ai(t[0]);n<0&&(n+=Wy);var i=t[1];i+=n-t[0],!e&&i-n>=Wy?i=n+Wy:e&&n-i>=Wy?i=n-Wy:!e&&n>i?i=n+(Wy-ai(n-i)):e&&n0&&r))for(var a=0;au.length&&(this._expandData(),u=this.data);for(var h=0;h0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e11&&(this.data=new Float32Array(t)))}},t.prototype.getBoundingRect=function(){Oy[0]=Oy[1]=Ey[0]=Ey[1]=Number.MAX_VALUE,zy[0]=zy[1]=Ry[0]=Ry[1]=-Number.MAX_VALUE;var t,e=this.data,n=0,i=0,o=0,r=0;for(t=0;tn||Zy(m)>i||c===e-1)&&(f=Math.sqrt(L*L+m*m),o=g,r=_);break;case Py.C:var y=t[c++],v=t[c++],_=(g=t[c++],t[c++]),x=t[c++],w=t[c++];f=Wt(o,r,y,v,g,_,x,w,10),o=x,r=w;break;case Py.Q:f=Xt(o,r,y=t[c++],v=t[c++],g=t[c++],_=t[c++],10),o=g,r=_;break;case Py.A:var b=t[c++],S=t[c++],T=t[c++],M=t[c++],C=t[c++],k=t[c++],I=k+C;c+=1,p&&(a=Fy(C)*T+b,s=Vy(C)*M+S),f=Ny(T,M)*By(Wy,Math.abs(k)),o=Fy(I)*T+b,r=Vy(I)*M+S;break;case Py.R:a=o=t[c++],s=r=t[c++],f=2*t[c++]+2*t[c++];break;case Py.Z:var L=a-o;m=s-r,f=Math.sqrt(L*L+m*m),o=a,r=s}f>=0&&(l[h++]=f,u+=f)}return this._pathLen=u,u},t.prototype.rebuildPath=function(t,e){var n,i,o,r,a,s,l,u,h,c,d=this.data,p=this._ux,f=this._uy,g=this._len,m=e<1,y=0,v=0,_=0;if(!m||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=e*this._pathLen))t:for(var x=0;x0&&(t.lineTo(h,c),_=0),w){case Py.M:n=o=d[x++],i=r=d[x++],t.moveTo(o,r);break;case Py.L:a=d[x++],s=d[x++];var S=Zy(a-o),T=Zy(s-r);if(S>p||T>f){if(m){if(y+(Y=l[v++])>u){t.lineTo(o*(1-(X=(u-y)/Y))+a*X,r*(1-X)+s*X);break t}y+=Y}t.lineTo(a,s),o=a,r=s,_=0}else{var M=S*S+T*T;M>_&&(h=a,c=s,_=M)}break;case Py.C:var C=d[x++],k=d[x++],I=d[x++],L=d[x++],P=d[x++],D=d[x++];if(m){if(y+(Y=l[v++])>u){Ht(o,C,I,P,X=(u-y)/Y,Dy),Ht(r,k,L,D,X,Ay),t.bezierCurveTo(Dy[1],Ay[1],Dy[2],Ay[2],Dy[3],Ay[3]);break t}y+=Y}t.bezierCurveTo(C,k,I,L,P,D),o=P,r=D;break;case Py.Q:if(C=d[x++],k=d[x++],I=d[x++],L=d[x++],m){if(y+(Y=l[v++])>u){Yt(o,C,I,X=(u-y)/Y,Dy),Yt(r,k,L,X,Ay),t.quadraticCurveTo(Dy[1],Ay[1],Dy[2],Ay[2]);break t}y+=Y}t.quadraticCurveTo(C,k,I,L),o=I,r=L;break;case Py.A:var A=d[x++],O=d[x++],z=d[x++],E=d[x++],R=d[x++],B=d[x++],N=d[x++],F=!d[x++],V=z>E?z:E,Z=Zy(z-E)>.001,H=R+B,W=!1;if(m&&(y+(Y=l[v++])>u&&(H=R+B*(u-y)/Y,W=!0),y+=Y),Z&&t.ellipse?t.ellipse(A,O,z,E,N,R,H,F):t.arc(A,O,V,R,H,F),W)break t;b&&(n=Fy(R)*z+A,i=Vy(R)*E+O),o=Fy(H)*z+A,r=Vy(H)*E+O;break;case Py.R:n=o=d[x],i=r=d[x+1],a=d[x++],s=d[x++];var j=d[x++],G=d[x++];if(m){if(y+(Y=l[v++])>u){var U=u-y;t.moveTo(a,s),t.lineTo(a+By(U,j),s),(U-=j)>0&&t.lineTo(a+j,s+By(U,G)),(U-=G)>0&&t.lineTo(a+Ny(j-U,0),s+G),(U-=j)>0&&t.lineTo(a,s+Ny(G-U,0));break t}y+=Y}t.rect(a,s,j,G);break;case Py.Z:if(m){var Y;if(y+(Y=l[v++])>u){var X;t.lineTo(o*(1-(X=(u-y)/Y))+n*X,r*(1-X)+i*X);break t}y+=Y}t.closePath(),o=n,r=i}}},t.prototype.clone=function(){var e=new t,n=this.data;return e.data=n.slice?n.slice():Array.prototype.slice.call(n),e._len=this._len,e},t.prototype.canSave=function(){return!!this._saveData},t.CMD=Py,t.initDefaultProps=((e=t.prototype)._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,void(e._version=0)),t}();const Yy=Uy;var Xy=2*Math.PI,qy=2*Math.PI,Ky=Yy.CMD,$y=2*Math.PI,Jy=[-1,-1,-1],Qy=[-1,-1],tv=s({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},dy),ev={style:s({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},py.style)},nv=wm.concat(["invisible","culling","z","z2","zlevel","parent"]),iv=function(t){function e(e){return t.call(this,e)||this}var n;return W(e,t),e.prototype.update=function(){var n=this;t.prototype.update.call(this);var i=this.style;if(i.decal){var o=this._decalEl=this._decalEl||new e;o.buildPath===e.prototype.buildPath&&(o.buildPath=function(t){n.buildPath(t,n.shape)}),o.silent=!0;var r=o.style;for(var a in i)r[a]!==i[a]&&(r[a]=i[a]);r.fill=i.fill?i.decal:null,r.decal=null,r.shadowColor=null,i.strokeFirst&&(r.stroke=null);for(var s=0;s.5?dm:e>.2?"#eee":pm}if(t)return pm}return dm},e.prototype.getInsideTextStroke=function(t){var e=this.style.fill;if(_(e)){var n=this.__zr;if(!(!n||!n.isDarkMode())==ue(t,0)<.4)return e}},e.prototype.buildPath=function(t,e,n){},e.prototype.pathUpdated=function(){this.__dirty&=-5},e.prototype.getUpdatedPathProxy=function(t){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,t),this.path},e.prototype.createPathProxy=function(){this.path=new Yy(!1)},e.prototype.hasStroke=function(){var t=this.style,e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))},e.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},e.prototype.getBoundingRect=function(){var t=this._rect,e=this.style,n=!t;if(n){var i=!1;this.path||(i=!0,this.createPathProxy());var o=this.path;(i||4&this.__dirty)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),t=o.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var r=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||n){r.copy(t);var a=e.strokeNoScale?this.getLineScale():1,s=e.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;s=Math.max(s,null==l?4:l)}a>1e-10&&(r.width+=s/a,r.height+=s/a,r.x-=s/a/2,r.y-=s/a/2)}return r}return t},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect(),o=this.style;if(i.contain(t=n[0],e=n[1])){var r=this.path;if(this.hasStroke()){var a=o.lineWidth,s=o.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),function(t,e,n,i){return yi(t,e,!0,n,i)}(r,a/s,t,e)))return!0}if(this.hasFill())return function(t,e,n){return yi(t,0,!1,e,n)}(r,t,e)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():"shape"===t?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(e,n){"shape"===e?this.setShape(n):t.prototype.attrKV.call(this,e,n)},e.prototype.setShape=function(t,e){var n=this.shape;return n||(n=this.shape={}),"string"==typeof t?n[t]=e:a(n,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(4&this.__dirty)},e.prototype.createStyle=function(t){return F(tv,t)},e.prototype._innerSaveToNormal=function(e){t.prototype._innerSaveToNormal.call(this,e);var n=this._normalState;e.shape&&!n.shape&&(n.shape=a({},this.shape))},e.prototype._applyStateObj=function(e,n,i,o,r,s){t.prototype._applyStateObj.call(this,e,n,i,o,r,s);var l,u=!(n&&o);if(n&&n.shape?r?o?l=n.shape:(l=a({},i.shape),a(l,n.shape)):(l=a({},o?this.shape:i.shape),a(l,n.shape)):u&&(l=i.shape),l)if(r){this.shape=a({},this.shape);for(var h={},c=g(l),d=0;du&&(n*=u/(a=n+i),i*=u/a),o+r>u&&(o*=u/(a=o+r),r*=u/a),i+o>h&&(i*=h/(a=i+o),o*=h/a),n+r>h&&(n*=h/(a=n+r),r*=h/a),t.moveTo(s+n,l),t.lineTo(s+u-i,l),0!==i&&t.arc(s+u-i,l+i,i,-Math.PI/2,0),t.lineTo(s+u,l+h-o),0!==o&&t.arc(s+u-o,l+h-o,o,0,Math.PI/2),t.lineTo(s+r,l+h),0!==r&&t.arc(s+r,l+h-r,r,Math.PI/2,Math.PI),t.lineTo(s,l+n),0!==n&&t.arc(s+n,l+n,n,Math.PI,1.5*Math.PI)}(t,e):t.rect(n,i,o,r)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(ov);gv.prototype.type="rect";const mv=gv;var yv={fill:"#000"},vv={},_v={style:s({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},py.style)},xv=function(t){function e(e){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=yv,n.attr(e),n}return W(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var e=0;ey&&p){var _=Math.floor(y/d);f=f||m.length>_,v=(m=m.slice(0,_)).length*d}if(o&&h&&null!=g)for(var x=Un(g,u,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),w={},b=0;b0,M=0;Mm&&qn(a,s.substring(m,y),e,g),qn(a,p[2],e,g,p[1]),m=oy.lastIndex}md){var R=a.lines.length;I>0?(M.tokens=M.tokens.slice(0,I),r(M,k,C),a.lines=a.lines.slice(0,T+1)):a.lines=a.lines.slice(0,T),a.isTruncated=a.isTruncated||a.lines.length=0&&"right"===(k=_[C]).align;)this._placeToken(k,t,w,f,M,"right",m),b-=k.width,M-=k.width,C--;for(T+=(s-(T-p)-(g-M)-b)/2;S<=C;)this._placeToken(k=_[S],t,w,f,T+k.width/2,"center",m),T+=k.width,S++;f+=w}},e.prototype._placeToken=function(t,e,n,i,o,r,a){var s=e.rich[t.styleName]||{};s.text=t.text;var l=t.verticalAlign,u=i+n/2;"top"===l?u=i+t.height/2:"bottom"===l&&(u=i+n-t.height/2),!t.isLineHolder&&Li(s)&&this._renderBackground(s,e,"right"===r?o-t.width:"center"===r?o-t.width/2:o,u-t.height/2,t.width,t.height);var h=!!s.backgroundColor,c=t.textPadding;c&&(o=ki(o,r,c),u-=t.height/2-c[0]-t.innerHeight/2);var d=this._getOrCreateChild(sv),p=d.createStyle();d.useStyle(p);var f=this._defaultStyle,g=!1,m=0,y=!1,v=Ci("fill"in s?s.fill:"fill"in e?e.fill:(g=!0,f.fill)),_=Mi("stroke"in s?s.stroke:"stroke"in e?e.stroke:h||a||f.autoStroke&&!g?null:(m=2,y=!0,f.stroke)),x=s.textShadowBlur>0||e.textShadowBlur>0;p.text=t.text,p.x=o,p.y=u,x&&(p.shadowBlur=s.textShadowBlur||e.textShadowBlur||0,p.shadowColor=s.textShadowColor||e.textShadowColor||"transparent",p.shadowOffsetX=s.textShadowOffsetX||e.textShadowOffsetX||0,p.shadowOffsetY=s.textShadowOffsetY||e.textShadowOffsetY||0),p.textAlign=r,p.textBaseline="middle",p.font=t.font||of,p.opacity=P(s.opacity,e.opacity,1),bi(p,s),_&&(p.lineWidth=P(s.lineWidth,e.lineWidth,m),p.lineDash=L(s.lineDash,e.lineDash),p.lineDashOffset=e.lineDashOffset||0,p.stroke=_),v&&(p.fill=v),d.setBoundingRect(ti(p,t.contentWidth,t.contentHeight,y?0:null))},e.prototype._renderBackground=function(t,e,n,i,o,r){var a,s,l,u=t.backgroundColor,h=t.borderWidth,c=t.borderColor,d=u&&u.image,p=u&&!d,f=t.borderRadius,g=this;if(p||t.lineHeight||h&&c){(a=this._getOrCreateChild(mv)).useStyle(a.createStyle()),a.style.fill=null;var m=a.shape;m.x=n,m.y=i,m.width=o,m.height=r,m.r=f,a.dirtyShape()}if(p)(l=a.style).fill=u||null,l.fillOpacity=L(t.fillOpacity,1);else if(d){(s=this._getOrCreateChild(cv)).onload=function(){g.dirtyStyle()};var y=s.style;y.image=u.image,y.x=n,y.y=i,y.width=o,y.height=r}h&&c&&((l=a.style).lineWidth=h,l.stroke=c,l.strokeOpacity=L(t.strokeOpacity,1),l.lineDash=t.borderDash,l.lineDashOffset=t.borderDashOffset||0,a.strokeContainThreshold=0,a.hasFill()&&a.hasStroke()&&(l.strokeFirst=!0,l.lineWidth*=2));var v=(a||s).style;v.shadowBlur=t.shadowBlur||0,v.shadowColor=t.shadowColor||"transparent",v.shadowOffsetX=t.shadowOffsetX||0,v.shadowOffsetY=t.shadowOffsetY||0,v.opacity=P(t.opacity,e.opacity,1)},e.makeFont=function(t){var e="";return Si(t)&&(e=[t.fontStyle,t.fontWeight,wi(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),e&&z(e)||t.textFont||t.font},e}(_y),wv={left:!0,right:1,center:1},bv={top:1,bottom:1,middle:1},Sv=["fontStyle","fontWeight","fontSize","fontFamily"];const Tv=xv;var Mv=Ln(),Cv=1,kv={},Iv=Ln(),Lv=Ln(),Pv=["emphasis","blur","select"],Dv=["normal","emphasis","blur","select"],Av="highlight",Ov="downplay",zv="select",Ev="unselect",Rv="toggleSelect",Bv="selectchanged",Nv={},Fv=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],Vv=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],Zv=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],Hv=Ln(),Wv={minMargin:1,textMargin:2},jv=["textStyle","color"],Gv=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],Uv=new Tv;const Yv=function(){function t(){}return t.prototype.getTextColor=function(t){var e=this.ecModel;return this.getShallow("color")||(!t&&e?e.get(jv):null)},t.prototype.getFont=function(){return go({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},t.prototype.getTextRect=function(t){for(var e={text:t,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},n=0;n-1?r_:s_;yo(a_,{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:". "}}}}),yo(r_,{time:{month:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"],monthAbbr:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],dayOfWeek:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],dayOfWeekAbbr:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"]},legend:{selector:{all:"\u5168\u9009",inverse:"\u53cd\u9009"}},toolbox:{brush:{title:{rect:"\u77e9\u5f62\u9009\u62e9",polygon:"\u5708\u9009",lineX:"\u6a2a\u5411\u9009\u62e9",lineY:"\u7eb5\u5411\u9009\u62e9",keep:"\u4fdd\u6301\u9009\u62e9",clear:"\u6e05\u9664\u9009\u62e9"}},dataView:{title:"\u6570\u636e\u89c6\u56fe",lang:["\u6570\u636e\u89c6\u56fe","\u5173\u95ed","\u5237\u65b0"]},dataZoom:{title:{zoom:"\u533a\u57df\u7f29\u653e",back:"\u533a\u57df\u7f29\u653e\u8fd8\u539f"}},magicType:{title:{line:"\u5207\u6362\u4e3a\u6298\u7ebf\u56fe",bar:"\u5207\u6362\u4e3a\u67f1\u72b6\u56fe",stack:"\u5207\u6362\u4e3a\u5806\u53e0",tiled:"\u5207\u6362\u4e3a\u5e73\u94fa"}},restore:{title:"\u8fd8\u539f"},saveAsImage:{title:"\u4fdd\u5b58\u4e3a\u56fe\u7247",lang:["\u53f3\u952e\u53e6\u5b58\u4e3a\u56fe\u7247"]}},series:{typeNames:{pie:"\u997c\u56fe",bar:"\u67f1\u72b6\u56fe",line:"\u6298\u7ebf\u56fe",scatter:"\u6563\u70b9\u56fe",effectScatter:"\u6d9f\u6f2a\u6563\u70b9\u56fe",radar:"\u96f7\u8fbe\u56fe",tree:"\u6811\u56fe",treemap:"\u77e9\u5f62\u6811\u56fe",boxplot:"\u7bb1\u578b\u56fe",candlestick:"K\u7ebf\u56fe",k:"K\u7ebf\u56fe",heatmap:"\u70ed\u529b\u56fe",map:"\u5730\u56fe",parallel:"\u5e73\u884c\u5750\u6807\u56fe",lines:"\u7ebf\u56fe",graph:"\u5173\u7cfb\u56fe",sankey:"\u6851\u57fa\u56fe",funnel:"\u6f0f\u6597\u56fe",gauge:"\u4eea\u8868\u76d8\u56fe",pictorialBar:"\u8c61\u5f62\u67f1\u56fe",themeRiver:"\u4e3b\u9898\u6cb3\u6d41\u56fe",sunburst:"\u65ed\u65e5\u56fe",custom:"\u81ea\u5b9a\u4e49\u56fe\u8868",chart:"\u56fe\u8868"}},aria:{general:{withTitle:"\u8fd9\u662f\u4e00\u4e2a\u5173\u4e8e\u201c{title}\u201d\u7684\u56fe\u8868\u3002",withoutTitle:"\u8fd9\u662f\u4e00\u4e2a\u56fe\u8868\uff0c"},series:{single:{prefix:"",withName:"\u56fe\u8868\u7c7b\u578b\u662f{seriesType}\uff0c\u8868\u793a{seriesName}\u3002",withoutName:"\u56fe\u8868\u7c7b\u578b\u662f{seriesType}\u3002"},multiple:{prefix:"\u5b83\u7531{seriesCount}\u4e2a\u56fe\u8868\u7cfb\u5217\u7ec4\u6210\u3002",withName:"\u7b2c{seriesId}\u4e2a\u7cfb\u5217\u662f\u4e00\u4e2a\u8868\u793a{seriesName}\u7684{seriesType}\uff0c",withoutName:"\u7b2c{seriesId}\u4e2a\u7cfb\u5217\u662f\u4e00\u4e2a{seriesType}\uff0c",separator:{middle:"\uff1b",end:"\u3002"}}},data:{allData:"\u5176\u6570\u636e\u662f\u2014\u2014",partialData:"\u5176\u4e2d\uff0c\u524d{displayCnt}\u9879\u662f\u2014\u2014",withName:"{name}\u7684\u6570\u636e\u662f{value}",withoutName:"{value}",separator:{middle:"\uff0c",end:""}}}});var c_=null,d_=1e3,p_=6e4,f_=36e5,g_=864e5,m_=31536e6,y_={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})/},v_={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},__="{yyyy}-{MM}-{dd}",x_={year:"{yyyy}",month:"{yyyy}-{MM}",day:__,hour:__+" "+v_.hour,minute:__+" "+v_.minute,second:__+" "+v_.second,millisecond:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},w_=["year","month","day","hour","minute","second","millisecond"],b_=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"],S_=A,T_=["a","b","c","d","e","f","g"],M_=function(t,e){return"{"+t+(null==e?"":e)+"}"},C_={},k_={},I_=function(){function t(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return t.prototype.create=function(t,e){function n(n,i){var o=[];return c(n,function(n,i){var r=n.create(t,e);o=o.concat(r||[])}),o}this._nonSeriesBoxMasterList=n(C_),this._normalMasterList=n(k_)},t.prototype.update=function(t,e){c(this._normalMasterList,function(n){n.update&&n.update(t,e)})},t.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},t.register=function(t,e){"matrix"!==t&&"calendar"!==t?k_[t]=e:C_[t]=e},t.get=function(t){return k_[t]||C_[t]},t}(),L_=1,P_=2,D_=B(),A_=0,O_=1,z_=2;const E_=I_;var R_=c,B_=["left","right","top","bottom","width","height"],N_=[["width","left","right"],["height","top","bottom"]],F_=Uo,V_=(m(Uo,"vertical"),m(Uo,"horizontal"),{rect:1,point:2}),Z_=Ln(),H_=function(t){function n(e,n,i){var o=t.call(this,e,n,i)||this;return o.uid=mo("ec_cpt_model"),o}var i;return e(n,t),n.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n)},n.prototype.mergeDefaultAndTheme=function(t,e){var n=Ko(this),i=n?Jo(t):{};r(t,e.getTheme().get(this.mainType)),r(t,this.getDefaultOption()),n&&$o(t,i,n)},n.prototype.mergeOption=function(t,e){r(this.option,t,!0);var n=Ko(this);n&&$o(this.option,t,n)},n.prototype.optionUpdated=function(t,e){},n.prototype.getDefaultOption=function(){var t=this.constructor;if(!function(t){return!(!t||!t[Qm])}(t))return t.defaultOption;var e=Z_(this);if(!e.defaultOption){for(var n=[],i=t;i;){var o=i.prototype.defaultOption;o&&n.push(o),i=i.superClass}for(var a={},s=n.length-1;s>=0;s--)a=r(a,n[s],!0);e.defaultOption=a}return e.defaultOption},n.prototype.getReferringComponents=function(t,e){var n=t+"Id";return An(this.ecModel,t,{index:this.get(t+"Index",!0),id:this.get(n,!0)},e)},n.prototype.getBoxLayoutParams=function(){return{left:(t=this).getShallow("left",e=!1),top:t.getShallow("top",e),right:t.getShallow("right",e),bottom:t.getShallow("bottom",e),width:t.getShallow("width",e),height:t.getShallow("height",e)};var t,e},n.prototype.getZLevelKey=function(){return""},n.prototype.setZLevel=function(t){this.option.zlevel=t},n.protoInitialize=((i=n.prototype).type="component",i.id="",i.name="",i.mainType="",i.subType="",void(i.componentIndex=0)),n}(i_);Rn(H_,i_),Fn(H_),function(t){var e={};t.registerSubTypeDefaulter=function(t,n){var i=zn(t);e[i.main]=n},t.determineSubType=function(n,i){var o=i.type;if(!o){var r=zn(n).main;t.hasSubTypes(n)&&e[r]&&(o=e[r](i))}return o}}(H_),function(t){function e(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}t.topologicalTravel=function(t,n,i,o){function r(t){u[t].entryCount--,0===u[t].entryCount&&h.push(t)}function a(t){p[t]=!0,r(t)}if(t.length){var s=function(t){var n={},i=[];return c(t,function(o){var r,a,s=e(n,o),u=function(t,e){var n=[];return c(t,function(t){l(e,t)>=0&&n.push(t)}),n}(s.originalDeps=(a=[],c(H_.getClassesByMainType(r=o),function(t){a=a.concat(t.dependencies||t.prototype.dependencies||[])}),a=d(a,function(t){return zn(t).main}),"dataset"!==r&&l(a,"dataset")<=0&&a.unshift("dataset"),a),t);s.entryCount=u.length,0===s.entryCount&&i.push(o),c(u,function(t){l(s.predecessor,t)<0&&s.predecessor.push(t);var i=e(n,t);l(i.successor,t)<0&&i.successor.push(o)})}),{graph:n,noEntryList:i}}(n),u=s.graph,h=s.noEntryList,p={};for(c(t,function(t){p[t]=!0});h.length;){var f=h.pop(),g=u[f],m=!!p[f];m&&(i.call(o,f,g.originalDeps.slice()),delete p[f]),c(g.successor,m?a:r)}c(p,function(){throw new Error("")})}}}(H_);const W_=H_;var j_={color:{},darkColor:{},size:{}},G_=j_.color={theme:["#5070dd","#b6d634","#505372","#ff994d","#0ca8df","#ffd10a","#fb628b","#785db0","#3fbe95"],neutral00:"#fff",neutral05:"#f4f7fd",neutral10:"#e8ebf0",neutral15:"#dbdee4",neutral20:"#cfd2d7",neutral25:"#c3c5cb",neutral30:"#b7b9be",neutral35:"#aaacb2",neutral40:"#9ea0a5",neutral45:"#929399",neutral50:"#86878c",neutral55:"#797b7f",neutral60:"#6d6e73",neutral65:"#616266",neutral70:"#54555a",neutral75:"#48494d",neutral80:"#3c3c41",neutral85:"#303034",neutral90:"#232328",neutral95:"#17171b",neutral99:"#000",accent05:"#eff1f9",accent10:"#e0e4f2",accent15:"#d0d6ec",accent20:"#c0c9e6",accent25:"#b1bbdf",accent30:"#a1aed9",accent35:"#91a0d3",accent40:"#8292cc",accent45:"#7285c6",accent50:"#6578ba",accent55:"#5c6da9",accent60:"#536298",accent65:"#4a5787",accent70:"#404c76",accent75:"#374165",accent80:"#2e3654",accent85:"#252b43",accent90:"#1b2032",accent95:"#121521",transparent:"rgba(0,0,0,0)",highlight:"rgba(255,231,130,0.8)"};for(var U_ in a(G_,{primary:G_.neutral80,secondary:G_.neutral70,tertiary:G_.neutral60,quaternary:G_.neutral50,disabled:G_.neutral20,border:G_.neutral30,borderTint:G_.neutral20,borderShade:G_.neutral40,background:G_.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:G_.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:G_.neutral70,axisLineTint:G_.neutral40,axisTick:G_.neutral70,axisTickMinor:G_.neutral60,axisLabel:G_.neutral70,axisSplitLine:G_.neutral15,axisMinorSplitLine:G_.neutral05}),G_)if(G_.hasOwnProperty(U_)){var Y_=G_[U_];"theme"===U_?j_.darkColor.theme=G_.theme.slice():"highlight"===U_?j_.darkColor.highlight="rgba(255,231,130,0.4)":j_.darkColor[U_]=0===U_.indexOf("accent")?se(Y_,null,function(t){return.5*t},function(t){return Math.min(1,1.3-t)}):se(Y_,null,function(t){return.9*t},function(t){return 1-Math.pow(t,1.5)})}j_.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};const X_=j_;var q_="";"undefined"!=typeof navigator&&(q_=navigator.platform||"");var K_="rgba(0, 0, 0, 0.2)",$_=X_.color.theme[0],J_=se($_,null,null,.9);const Q_={darkMode:"auto",colorBy:"series",color:X_.color.theme,gradientColor:[J_,$_],aria:{decal:{decals:[{color:K_,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:K_,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:K_,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:K_,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:K_,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:K_,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:q_.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 tx,ex,nx,ix=B(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),ox="original",rx="arrayRows",ax="objectRows",sx="keyedColumns",lx="typedArray",ux="unknown",hx="column",cx="row",dx=1,px=2,fx=3,gx=Ln(),mx=B(),yx=Ln(),vx=(Ln(),function(){function t(){}return t.prototype.getColorFromPalette=function(t,e,n){var i=vn(this.get("color",!0)),o=this.get("colorLayer",!0);return function(t,e,n,i,o,r,a){var s=e(r=r||t),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(o))return u[o];var h=null!=a&&i?function(t,e){for(var n=t.length,i=0;ie)return t[i];return t[n-1]}(i,a):n;if((h=h||n)&&h.length){var c=h[l];return o&&(u[o]=c),s.paletteIdx=(l+1)%h.length,c}}(this,yx,i,o,t,e,n)},t.prototype.clearColorPalette=function(){!function(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}(this,yx)},t}()),_x="\0_ec_inner",xx=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.init=function(t,e,n,i,o,r){i=i||{},this.option=null,this._theme=new i_(i),this._locale=new i_(o),this._optionManager=r},n.prototype.setOption=function(t,e,n){var i=rr(e);this._optionManager.setOption(t,n,i),this._resetOption(null,i)},n.prototype.resetOption=function(t,e){return this._resetOption(t,rr(e))},n.prototype._resetOption=function(t,e){var n=!1,i=this._optionManager;if(!t||"recreate"===t){var o=i.mountOption("recreate"===t);this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(o,e)):nx(this,o),n=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var r=i.getTimelineOption(this);r&&(n=!0,this._mergeOption(r,e))}if(!t||"recreate"===t||"media"===t){var a=i.getMediaOption(this);a.length&&c(a,function(t){n=!0,this._mergeOption(t,e)},this)}return n},n.prototype.mergeOption=function(t){this._mergeOption(t,null)},n.prototype._mergeOption=function(t,e){var n=this.option,i=this._componentsMap,s=this._componentsCount,l=[],u=B(),h=e&&e.replaceMergeMainTypeMap;gx(this).datasetMap=B(),c(t,function(t,e){null!=t&&(W_.hasClass(e)?e&&(l.push(e),u.set(e,!0)):n[e]=null==n[e]?o(t):r(n[e],t,!0))}),h&&h.each(function(t,e){W_.hasClass(e)&&!u.get(e)&&(l.push(e),u.set(e,!0))}),W_.topologicalTravel(l,W_.getAllClassMainTypes(),function(e){var o=function(t,e,n){var i=mx.get(e);if(!i)return n;var o=i(t);return o?n.concat(o):n}(this,e,vn(t[e])),r=i.get(e),l=bn(r,o,r?h&&h.get(e)?"replaceMerge":"normalMerge":"replaceAll");!function(t,e,n){c(t,function(t){var i=t.newOption;b(i)&&(t.keyInfo.mainType=e,t.keyInfo.subType=function(t,e,n,i){return e.type?e.type:n?n.subType:i.determineSubType(t,e)}(e,i,t.existing,n))})}(l,e,W_),n[e]=null,i.set(e,null),s.set(e,0);var u,d=[],p=[],f=0;c(l,function(t,n){var i=t.existing,o=t.newOption;if(o){var r=W_.getClass(e,t.keyInfo.subType,!("series"===e));if(!r)return;if("tooltip"===e){if(u)return;u=!0}if(i&&i.constructor===r)i.name=t.keyInfo.name,i.mergeOption(o,this),i.optionUpdated(o,!1);else{var s=a({componentIndex:n},t.keyInfo);a(i=new r(o,this,this,s),s),t.brandNew&&(i.__requireNewView=!0),i.init(o,this,this),i.optionUpdated(null,!0)}}else i&&(i.mergeOption({},this),i.optionUpdated({},!1));i?(d.push(i.option),p.push(i),f++):(d.push(void 0),p.push(void 0))},this),n[e]=d,i.set(e,p),s.set(e,f),"series"===e&&tx(this)},this),this._seriesIndices||tx(this)},n.prototype.getOption=function(){var t=o(this.option);return c(t,function(e,n){if(W_.hasClass(n)){for(var i=vn(e),o=i.length,r=!1,a=o-1;a>=0;a--)i[a]&&!kn(i[a])?r=!0:(i[a]=null,!r&&o--);i.length=o,t[n]=i}}),delete t[_x],t},n.prototype.setTheme=function(t){this._theme=new i_(t),this._resetOption("recreate",null)},n.prototype.getTheme=function(){return this._theme},n.prototype.getLocaleModel=function(){return this._locale},n.prototype.setUpdatePayload=function(t){this._payload=t},n.prototype.getUpdatePayload=function(){return this._payload},n.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){var i=n[e||0];if(i)return i;if(null==e)for(var o=0;ou&&(u=p)}s[0]=l,s[1]=u}},o=function(){return this._data?this._data.length/this._dimSize:0};(e={})[rx+"_"+hx]={pure:!0,appendData:t},e[rx+"_"+cx]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[ax]={pure:!0,appendData:t},e[sx]={pure:!0,appendData:function(t){var e=this._data;c(t,function(t,n){for(var i=e[n]||(e[n]=[]),o=0;o<(t||[]).length;o++)i.push(t[o])})}},e[ox]={appendData:t},e[lx]={persistent:!1,pure:!0,appendData:function(t){this._data=t},clean:function(){this._offset+=this.count(),this._data=null}},Ax=e}(),t}(),Gx=function(t){y(t)||kr("series.data or dataset.source must be an array.")},Ux=((Ix={})[rx+"_"+hx]=Gx,Ix[rx+"_"+cx]=Gx,Ix[ax]=Gx,Ix[sx]=function(t,e){for(var n=0;n=0&&(s=r.interpolatedValue[l])}return null!=s?s+"":""}):void 0},t.prototype.getRawValue=function(t,e){return Or(this.getData(e),t)},t.prototype.formatTooltip=function(t,e,n){},t}(),tw=function(){function t(t){this._reset=(t=t||{}).reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return t.prototype.perform=function(t){function e(t){return!(t>=1)&&(t=1),t}var n,i=this._upstream,o=t&&t.skip;if(this._dirty&&i){var r=this.context;r.data=r.outputData=i.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!o&&(n=this._plan(this.context));var a,s=e(this._modBy),l=this._modDataCount||0,u=e(t&&t.modBy),h=t&&t.modDataCount||0;s===u&&l===h||(n="reset"),(this._dirty||"reset"===n)&&(this._dirty=!1,a=this._doReset(o)),this._modBy=u,this._modDataCount=h;var c=t&&t.step;if(this._dueEnd=i?i._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,p=Math.min(null!=c?this._dueIndex+c:1/0,this._dueEnd);if(!o&&(a||d=n?null:t1&&r>0?e:t}};return s}(),nw=(B({number:function(t){return parseFloat(t)},time:function(t){return+cn(t)},trim:function(t){return _(t)?z(t):t}}),function(){function t(t,e){var n="desc"===t;this._resultLT=n?1:-1,null==e&&(e=n?"min":"max"),this._incomparable="min"===e?-1/0:1/0}return t.prototype.evaluate=function(t,e){var n=w(t)?t:fn(t),i=w(e)?e:fn(e),o=isNaN(n),r=isNaN(i);if(o&&(n=this._incomparable),r&&(i=this._incomparable),o&&r){var a=_(t),s=_(e);a&&(n=s?t:0),s&&(i=a?e:0)}return ni?-this._resultLT:0},t}()),iw=function(){function t(){}return t.prototype.getRawData=function(){throw new Error("not supported")},t.prototype.getRawDataItem=function(t){throw new Error("not supported")},t.prototype.cloneRawData=function(){},t.prototype.getDimensionInfo=function(t){},t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},t.prototype.retrieveValue=function(t,e){},t.prototype.retrieveValueFromItem=function(t,e){},t.prototype.convertValue=function(t,e){return Rr(t,e)},t}(),ow=B(),rw="undefined",aw=typeof Uint32Array===rw?Array:Uint32Array,sw=typeof Uint16Array===rw?Array:Uint16Array,lw=typeof Int32Array===rw?Array:Int32Array,uw=typeof Float64Array===rw?Array:Float64Array,hw={float:uw,int:lw,ordinal:Array,number:Array,time:uw},cw=function(){function t(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=B()}return t.prototype.initData=function(t,e,n){this._provider=t,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var i=t.getSource(),o=this.defaultDimValueGetter=zx[i.sourceFormat];this._dimValueGetter=n||o,this._rawExtent=[],Cr(i),this._dimensions=d(e,function(t){return{type:t.type,property:t.property}}),this._initDataFromProvider(0,t.count())},t.prototype.getProvider=function(){return this._provider},t.prototype.getSource=function(){return this._provider.getSource()},t.prototype.ensureCalculationDimension=function(t,e){var n=this._calcDimNameToIdx,i=this._dimensions,o=n.get(t);if(null!=o){if(i[o].type===e)return o}else o=i.length;return i[o]={type:e},n.set(t,o),this._chunks[o]=new hw[e||"float"](this._rawCount),this._rawExtent[o]=[1/0,-1/0],o},t.prototype.collectOrdinalMeta=function(t,e){var n=this._chunks[t],i=this._dimensions[t],o=this._rawExtent,r=i.ordinalOffset||0,a=n.length;0===r&&(o[t]=[1/0,-1/0]);for(var s=o[t],l=r;lf[1]&&(f[1]=p)}return this._rawCount=this._count=s,{start:a,end:s}},t.prototype._initDataFromProvider=function(t,e,n){for(var i=this._provider,o=this._chunks,r=this._dimensions,a=r.length,s=this._rawExtent,l=d(r,function(t){return t.property}),u=0;uy[1]&&(y[1]=m)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=e,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(t,e){if(!(e>=0&&e=0&&e=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&nt))return r;o=r-1}}return-1},t.prototype.getIndices=function(){var t,e=this._indices;if(e){var n=this._count;if((o=e.constructor)===Array){t=new o(n);for(var i=0;i=u&&T<=h||isNaN(T))&&(a[s++]=p),p++;d=!0}else if(2===o){f=c[i[0]];var y=c[i[1]],v=t[i[1]][0],_=t[i[1]][1];for(m=0;m=u&&T<=h||isNaN(T))&&(x>=v&&x<=_||isNaN(x))&&(a[s++]=p),p++}d=!0}}if(!d)if(1===o)for(m=0;m=u&&T<=h||isNaN(T))&&(a[s++]=w)}else for(m=0;mt[M][1])&&(b=!1)}b&&(a[s++]=e.getRawIndex(m))}return sm[1]&&(m[1]=g)}}},t.prototype.lttbDownSample=function(t,e){var n,i,o,r=this.clone([t],!0),a=r._chunks[t],s=this.count(),l=0,u=Math.floor(1/e),h=this.getRawIndex(0),c=new(Wr(this._rawCount))(Math.min(2*(Math.ceil(s/u)+2),s));c[l++]=h;for(var d=1;dn&&(n=i,o=M)}T>0&&Ta&&(f=a-u);for(var g=0;gp&&(p=m,d=u+g)}var y=this.getRawIndex(h),v=this.getRawIndex(d);hu-p&&(a.length=s=u-p);for(var f=0;fh[1]&&(h[1]=m),c[d++]=y}return o._count=d,o._indices=c,o._updateGetRawIdx(),o},t.prototype.each=function(t,e){if(this._count)for(var n=t.length,i=this._chunks,o=0,r=this.count();oa&&(a=l)}return this._extent[t]=i=[r,a],i},t.prototype.getRawDataItem=function(t){var e=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(e);for(var n=[],i=this._chunks,o=0;o=0?this._indices[t]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=function(){function t(t,e,n,i){return Rr(t[i],this._dimensions[i])}zx={arrayRows:t,objectRows:function(t,e,n,i){return Rr(t[e],this._dimensions[i])},keyedColumns:t,original:function(t,e,n,i){var o=t&&(null==t.value?t:t.value);return Rr(o instanceof Array?o[i]:o,this._dimensions[i])},typedArray:function(t,e,n,i){return t[i]}}}(),t}();const dw=cw;var pw=function(){function t(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(t,e){this._sourceList=t,this._upstreamSignList=e,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var t,e,n=this._sourceHost,i=this._getUpstreamSourceManagers(),o=!!i.length;if(Yr(n)){var r=n,a=void 0,s=void 0,l=void 0;if(o){var u=i[0];u.prepareSource(),a=(l=u.getSource()).data,s=l.sourceFormat,e=[u._getVersionSign()]}else s=T(a=r.get("data",!0))?lx:ox,e=[];var h=this._getSourceMetaRawOption()||{},c=l&&l.metaRawOption||{},d=L(h.seriesLayoutBy,c.seriesLayoutBy)||null,p=L(h.sourceHeader,c.sourceHeader),f=L(h.dimensions,c.dimensions);t=d!==c.seriesLayoutBy||!!p!=!!c.sourceHeader||f?[wr(a,{seriesLayoutBy:d,sourceHeader:p,dimensions:f},s)]:[]}else{var g=n;if(o){var m=this._applyTransform(i);t=m.sourceList,e=m.upstreamSignList}else t=[wr(g.get("source",!0),this._getSourceMetaRawOption(),null)],e=[]}this._setLocalSource(t,e)},t.prototype._applyTransform=function(t){var e,n=this._sourceHost,i=n.get("transform",!0),r=n.get("fromTransformResult",!0);null!=r&&1!==t.length&&Xr("");var a,s=[],l=[];return c(t,function(t){t.prepareSource();var e=t.getSource(r||0);null==r||e||Xr(""),s.push(e),l.push(t._getVersionSign())}),i?e=function(t,e){var n=vn(t),i=n.length;i||Ir("");for(var o=0,r=i;o':'':{renderMode:r,content:"{"+(n.markerId||"markerX")+"|} ",style:"subItem"===o?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}:""}({color:e,type:t,renderMode:n,markerId:i});return _(o)?o:(this.richTextStyles[i]=o.style,o.content)},t.prototype.wrapRichTextStyle=function(t,e){var n={};y(e)?c(e,function(t){return a(n,t)}):a(n,e);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},t}(),yw=Ln(),vw=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._selectedDataIndicesMap={},e}var i;return e(n,t),n.prototype.init=function(t,e,n){this.seriesIndex=this.componentIndex,this.dataTask=Er({count:ha,reset:ca}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,n),(yw(this).sourceManager=new pw(this)).prepareSource();var i=this.getInitialData(t,n);pa(i,this),this.dataTask.context.data=i,yw(this).dataBeforeProcessed=i,ua(this),this._initSelectedMapFromData(i)},n.prototype.mergeDefaultAndTheme=function(t,e){var n=Ko(this),i=n?Jo(t):{},o=this.subType;W_.hasClass(o)&&(o+="Series"),r(t,e.getTheme().get(this.subType)),r(t,this.getDefaultOption()),_n(t,"label",["show"]),this.fillDataTextStyle(t.data),n&&$o(t,i,n)},n.prototype.mergeOption=function(t,e){t=r(this.option,t,!0),this.fillDataTextStyle(t.data);var n=Ko(this);n&&$o(this.option,t,n);var i=yw(this).sourceManager;i.dirty(),i.prepareSource();var o=this.getInitialData(t,e);pa(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,yw(this).dataBeforeProcessed=o,ua(this),this._initSelectedMapFromData(o)},n.prototype.fillDataTextStyle=function(t){if(t&&!T(t))for(var e=["show"],n=0;n=0&&h<0)&&(u=r,h=o,c=0),o===h&&(l[c++]=e))}),l.length=c,l},n.prototype.formatTooltip=function(t,e,n){return sa({series:this,dataIndex:t,multipleSeries:e})},n.prototype.isAnimationEnabled=function(){var t=this.ecModel;if(Qp.node&&(!t||!t.ssr))return!1;var e=this.getShallow("animation");return e&&this.getData().count()>this.getShallow("animationThreshold")&&(e=!1),!!e},n.prototype.restoreData=function(){this.dataTask.dirty()},n.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel,o=vx.prototype.getColorFromPalette.call(this,t,e,n);return o||(o=i.getColorFromPalette(t,e,n)),o},n.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},n.prototype.getProgressive=function(){return this.get("progressive")},n.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},n.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},n.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n){var i=this.option.selectedMode,o=this.getData(e);if("series"===i||"all"===n)return this.option.selectedMap={},void(this._selectedDataIndicesMap={});for(var r=0;r=0&&n.push(o)}return n},n.prototype.isSelected=function(t,e){var n=this.option.selectedMap;if(!n)return!1;var i=this.getData(e);return("all"===n||n[la(i,t)])&&!i.getItemModel(t).get(["select","disabled"])},n.prototype.isUniversalTransitionEnabled=function(){if(this.__universalTransitionEnabled)return!0;var t=this.option.universalTransition;return!!t&&(!0===t||t&&t.enabled)},n.prototype._innerSelect=function(t,e){var n,i,o=this.option,r=o.selectedMode,a=e.length;if(r&&a)if("series"===r)o.selectedMap="all";else if("multiple"===r){b(o.selectedMap)||(o.selectedMap={});for(var s=o.selectedMap,l=0;l0&&this._innerSelect(t,e)}},n.registerClass=function(t){return W_.registerClass(t)},n.protoInitialize=((i=n.prototype).type="series.__base__",i.seriesIndex=0,i.ignoreStyleOnData=!1,i.hasSymbolVisual=!1,i.defaultSymbol="circle",i.visualStyleAccessPath="itemStyle",void(i.visualDrawType="fill")),n}(W_);u(vw,Qx),u(vw,vx),Rn(vw,W_);const _w=vw;var xw=function(){function t(){this.group=new Em,this.uid=mo("viewComponent")}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,i){},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,i){},t.prototype.updateLayout=function(t,e,n,i){},t.prototype.updateVisual=function(t,e,n,i){},t.prototype.toggleBlurSeries=function(t,e,n){},t.prototype.eachRendered=function(t){var e=this.group;e&&e.traverse(t)},t}();En(xw),Fn(xw);const ww=xw;var bw=Yy.CMD,Sw=[[],[],[]],Tw=Math.sqrt,Mw=Math.atan2,Cw=Math.sqrt,kw=Math.sin,Iw=Math.cos,Lw=Math.PI,Pw=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Dw=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g,Aw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return W(e,t),e.prototype.applyTransform=function(t){},e}(ov),Ow=function(){this.cx=0,this.cy=0,this.r=0},zw=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new Ow},e.prototype.buildPath=function(t,e){t.moveTo(e.cx+e.r,e.cy),t.arc(e.cx,e.cy,e.r,0,2*Math.PI)},e}(ov);zw.prototype.type="circle";const Ew=zw;var Rw=function(){this.cx=0,this.cy=0,this.rx=0,this.ry=0},Bw=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new Rw},e.prototype.buildPath=function(t,e){var n=.5522848,i=e.cx,o=e.cy,r=e.rx,a=e.ry,s=r*n,l=a*n;t.moveTo(i-r,o),t.bezierCurveTo(i-r,o-l,i-s,o-a,i,o-a),t.bezierCurveTo(i+s,o-a,i+r,o-l,i+r,o),t.bezierCurveTo(i+r,o+l,i+s,o+a,i,o+a),t.bezierCurveTo(i-s,o+a,i-r,o+l,i-r,o),t.closePath()},e}(ov);Bw.prototype.type="ellipse";const Nw=Bw;var Fw=Math.PI,Vw=2*Fw,Zw=Math.sin,Hw=Math.cos,Ww=Math.acos,jw=Math.atan2,Gw=Math.abs,Uw=Math.sqrt,Yw=Math.max,Xw=Math.min,qw=1e-4,Kw=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0},$w=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new Kw},e.prototype.buildPath=function(t,e){!function(t,e){var n,i=Yw(e.r,0),o=Yw(e.r0||0,0),r=i>0;if(r||o>0){if(r||(i=o,o=0),o>i){var a=i;i=o,o=a}var s=e.startAngle,l=e.endAngle;if(!isNaN(s)&&!isNaN(l)){var u=e.cx,h=e.cy,c=!!e.clockwise,d=Gw(l-s),p=d>Vw&&d%Vw;if(p>qw&&(d=p),i>qw)if(d>Vw-qw)t.moveTo(u+i*Hw(s),h+i*Zw(s)),t.arc(u,h,i,s,l,!c),o>qw&&(t.moveTo(u+o*Hw(l),h+o*Zw(l)),t.arc(u,h,o,l,s,c));else{var f=void 0,g=void 0,m=void 0,v=void 0,_=void 0,x=void 0,w=void 0,b=void 0,S=void 0,T=void 0,M=void 0,C=void 0,k=void 0,I=void 0,L=void 0,P=void 0,D=i*Hw(s),A=i*Zw(s),O=o*Hw(l),z=o*Zw(l),E=d>qw;if(E){var R=e.cornerRadius;R&&(n=function(t){var e;if(y(t)){var n=t.length;if(!n)return t;e=1===n?[t[0],t[0],0,0]:2===n?[t[0],t[0],t[1],t[1]]:3===n?t.concat(t[2]):t}else e=[t,t,t,t];return e}(R),f=n[0],g=n[1],m=n[2],v=n[3]);var B=Gw(i-o)/2;if(_=Xw(B,m),x=Xw(B,v),w=Xw(B,f),b=Xw(B,g),M=S=Yw(_,x),C=T=Yw(w,b),(S>qw||T>qw)&&(k=i*Hw(l),I=i*Zw(l),L=o*Hw(s),P=o*Zw(s),dqw){var G=Xw(m,M),U=Xw(v,M),Y=Sa(L,P,D,A,i,G,c),X=Sa(k,I,O,z,i,U,c);t.moveTo(u+Y.cx+Y.x0,h+Y.cy+Y.y0),M0&&t.arc(u+Y.cx,h+Y.cy,G,jw(Y.y0,Y.x0),jw(Y.y1,Y.x1),!c),t.arc(u,h,i,jw(Y.cy+Y.y1,Y.cx+Y.x1),jw(X.cy+X.y1,X.cx+X.x1),!c),U>0&&t.arc(u+X.cx,h+X.cy,U,jw(X.y1,X.x1),jw(X.y0,X.x0),!c))}else t.moveTo(u+D,h+A),t.arc(u,h,i,s,l,!c);else t.moveTo(u+D,h+A);o>qw&&E?C>qw?(G=Xw(f,C),Y=Sa(O,z,k,I,o,-(U=Xw(g,C)),c),X=Sa(D,A,L,P,o,-G,c),t.lineTo(u+Y.cx+Y.x0,h+Y.cy+Y.y0),C0&&t.arc(u+Y.cx,h+Y.cy,U,jw(Y.y0,Y.x0),jw(Y.y1,Y.x1),!c),t.arc(u,h,o,jw(Y.cy+Y.y1,Y.cx+Y.x1),jw(X.cy+X.y1,X.cx+X.x1),c),G>0&&t.arc(u+X.cx,h+X.cy,G,jw(X.y1,X.x1),jw(X.y0,X.x0),!c))):(t.lineTo(u+O,h+z),t.arc(u,h,o,l,s,c)):t.lineTo(u+O,h+z)}else t.moveTo(u,h);t.closePath()}}}(t,e)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(ov);$w.prototype.type="sector";const Jw=$w;var Qw=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},tb=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new Qw},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,o=2*Math.PI;t.moveTo(n+e.r,i),t.arc(n,i,e.r,0,o,!1),t.moveTo(n+e.r0,i),t.arc(n,i,e.r0,0,o,!0)},e}(ov);tb.prototype.type="ring";const eb=tb;var nb=function(){this.points=null,this.smooth=0,this.smoothConstraint=null},ib=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new nb},e.prototype.buildPath=function(t,e){Ta(t,e,!0)},e}(ov);ib.prototype.type="polygon";const ob=ib;var rb=function(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null},ab=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new rb},e.prototype.buildPath=function(t,e){Ta(t,e,!1)},e}(ov);ab.prototype.type="polyline";const sb=ab;var lb={},ub=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},hb=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new ub},e.prototype.buildPath=function(t,e){var n,i,o,r;if(this.subPixelOptimize){var a=vi(lb,e,this.style);n=a.x1,i=a.y1,o=a.x2,r=a.y2}else n=e.x1,i=e.y1,o=e.x2,r=e.y2;var s=e.percent;0!==s&&(t.moveTo(n,i),s<1&&(o=n*(1-s)+o*s,r=i*(1-s)+r*s),t.lineTo(o,r))},e.prototype.pointAt=function(t){var e=this.shape;return[e.x1*(1-t)+e.x2*t,e.y1*(1-t)+e.y2*t]},e}(ov);hb.prototype.type="line";const cb=hb;var db=[],pb=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1},fb=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new pb},e.prototype.buildPath=function(t,e){var n=e.x1,i=e.y1,o=e.x2,r=e.y2,a=e.cpx1,s=e.cpy1,l=e.cpx2,u=e.cpy2,h=e.percent;0!==h&&(t.moveTo(n,i),null==l||null==u?(h<1&&(Yt(n,a,o,h,db),a=db[1],o=db[2],Yt(i,s,r,h,db),s=db[1],r=db[2]),t.quadraticCurveTo(a,s,o,r)):(h<1&&(Ht(n,a,l,o,h,db),a=db[1],l=db[2],o=db[3],Ht(i,s,u,r,h,db),s=db[1],u=db[2],r=db[3]),t.bezierCurveTo(a,s,l,u,o,r)))},e.prototype.pointAt=function(t){return Ma(this.shape,t,!1)},e.prototype.tangentAt=function(t){var e=Ma(this.shape,t,!0);return Q(e,e)},e}(ov);fb.prototype.type="bezier-curve";const gb=fb;var mb=function(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},yb=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new mb},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,o=Math.max(e.r,0),r=e.startAngle,a=e.endAngle,s=e.clockwise,l=Math.cos(r),u=Math.sin(r);t.moveTo(l*o+n,u*o+i),t.arc(n,i,o,r,a,!s)},e}(ov);yb.prototype.type="arc";const vb=yb;var _b=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="compound",e}return W(e,t),e.prototype._updatePathDirty=function(){for(var t=this.shape.paths,e=this.shapeChanged(),n=0;nLb[1]){if(o=!1,Pb.negativeSize||n)return o;var s=kb(Lb[0]-Ib[1]),l=kb(Ib[0]-Lb[1]);Mb(s,l)>Ab.len()&&Gf.scale(Ab,a,s=l||!Pb.bidirectional)&&(Gf.scale(Db,a,-l*i),Pb.useDir&&Pb.calcDirMTV())))}return o},t.prototype._getProjMinMaxOnAxis=function(t,e,n){for(var i=this._axes[t],o=this._origin,r=e[0].dot(i)+o[t],a=r,s=r,l=1;ln.blockIndex?n.step:null,r=i&&i.modDataCount;return{step:o,modBy:null!=r?Math.ceil(r/o):null,modDataCount:r}}},t.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},t.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData().count(),o=n.progressiveEnabled&&e.incrementalPrepareRender&&i>=n.threshold,r=t.get("large")&&i>=t.get("largeThreshold"),a="mod"===t.get("progressiveChunkMode")?i:null;t.pipelineContext=n.context={progressiveRender:o,modDataCount:a,large:r}},t.prototype.restorePipelines=function(t){var e=this,n=e._pipelineMap=B();t.eachSeries(function(t){var i=t.getProgressive(),o=t.uid;n.set(o,{id:o,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:i&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),e._pipe(t,t.dataTask)})},t.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.api.getModel(),n=this.api;c(this._allHandlers,function(i){var o=t.get(i.uid)||t.set(i.uid,{});O(!(i.reset&&i.overallReset),""),i.reset&&this._createSeriesStageTask(i,o,e,n),i.overallReset&&this._createOverallStageTask(i,o,e,n)},this)},t.prototype.prepareView=function(t,e,n,i){var o=t.renderTask,r=o.context;r.model=e,r.ecModel=n,r.api=i,o.__block=!t.incrementalPrepareRender,this._pipe(e,o)},t.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},t.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},t.prototype._performStageTasks=function(t,e,n,i){function o(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}i=i||{};var r=!1,a=this;c(t,function(t,s){if(!i.visualType||i.visualType===t.visualType){var l=a._stageTaskMap.get(t.uid),u=l.seriesTaskMap,h=l.overallTask;if(h){var c,d=h.agentStubMap;d.each(function(t){o(i,t)&&(t.dirty(),c=!0)}),c&&h.dirty(),a.updatePayload(h,n);var p=a.getPerformArgs(h,i.block);d.each(function(t){t.perform(p)}),h.perform(p)&&(r=!0)}else u&&u.each(function(s,l){o(i,s)&&s.dirty();var u=a.getPerformArgs(s,i.block);u.skip=!t.performRawSeries&&e.isSeriesFiltered(s.context.model),a.updatePayload(s,n),s.perform(u)&&(r=!0)})}}),this.unfinished=r||this.unfinished},t.prototype.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e=t.dataTask.perform()||e}),this.unfinished=e||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)})},t.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},t.prototype._createSeriesStageTask=function(t,e,n,i){function o(e){var o=e.uid,l=s.set(o,a&&a.get(o)||Er({plan:Cs,reset:ks,count:Ls}));l.context={model:e,ecModel:n,api:i,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:r},r._pipe(e,l)}var r=this,a=e.seriesTaskMap,s=e.seriesTaskMap=B(),l=t.seriesType,u=t.getTargetSeries;t.createOnAllSeries?n.eachRawSeries(o):l?n.eachRawSeriesByType(l,o):u&&u(n,i).each(o)},t.prototype._createOverallStageTask=function(t,e,n,i){function o(t){var e=t.uid,n=l.set(e,s&&s.get(e)||(p=!0,Er({reset:Ss,onDirty:Ms})));n.context={model:t,overallProgress:d},n.agent=a,n.__block=d,r._pipe(t,n)}var r=this,a=e.overallTask=e.overallTask||Er({reset:bs});a.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:r};var s=a.agentStubMap,l=a.agentStubMap=B(),u=t.seriesType,h=t.getTargetSeries,d=!0,p=!1;O(!t.createOnAllSeries,""),u?n.eachRawSeriesByType(u,o):h?h(n,i).each(o):(d=!1,c(n.getSeries(),o)),p&&a.dirty()},t.prototype._pipe=function(t,e){var n=this._pipelineMap.get(t.uid);!n.head&&(n.head=e),n.tail&&n.tail.pipe(e),n.tail=e,e.__idxInPipeline=n.count++,e.__pipeline=n},t.wrapStageHandler=function(t,e){return v(t)&&(t={overallReset:t,seriesType:Ps(t)}),t.uid=mo("stageHandler"),e&&(t.visualType=e),t},t}(),hS=Is(0),cS={},dS={};Ds(cS,bx),Ds(dS,Tx),cS.eachSeriesByType=cS.eachRawSeriesByType=function(t){$b=t},cS.eachComponent=function(t){"series"===t.mainType&&t.subType&&($b=t.subType)};const pS=uS;var fS,gS=X_.darkColor,mS=function(){return{axisLine:{lineStyle:{color:gS.axisLine}},splitLine:{lineStyle:{color:gS.axisSplitLine}},splitArea:{areaStyle:{color:[gS.backgroundTint,gS.backgroundTransparent]}},minorSplitLine:{lineStyle:{color:gS.axisMinorSplitLine}},axisLabel:{color:gS.axisLabel},axisName:{}}},yS={label:{color:gS.secondary},itemStyle:{borderColor:gS.borderTint},dividerLineStyle:{color:gS.border}},vS={darkMode:!0,color:gS.theme,backgroundColor:gS.background,axisPointer:{lineStyle:{color:gS.border},crossStyle:{color:gS.borderShade},label:{color:gS.tertiary}},legend:{textStyle:{color:gS.secondary},pageTextStyle:{color:gS.tertiary}},textStyle:{color:gS.secondary},title:{textStyle:{color:gS.primary},subtextStyle:{color:gS.quaternary}},toolbox:{iconStyle:{borderColor:gS.accent50}},tooltip:{backgroundColor:gS.neutral20,defaultBorderColor:gS.border,textStyle:{color:gS.tertiary}},dataZoom:{borderColor:gS.accent10,textStyle:{color:gS.tertiary},brushStyle:{color:gS.backgroundTint},handleStyle:{color:gS.neutral00,borderColor:gS.accent20},moveHandleStyle:{color:gS.accent40},emphasis:{handleStyle:{borderColor:gS.accent50}},dataBackground:{lineStyle:{color:gS.accent30},areaStyle:{color:gS.accent20}},selectedDataBackground:{lineStyle:{color:gS.accent50},areaStyle:{color:gS.accent30}}},visualMap:{textStyle:{color:gS.secondary},handleStyle:{borderColor:gS.neutral30}},timeline:{lineStyle:{color:gS.accent10},label:{color:gS.tertiary},controlStyle:{color:gS.accent30,borderColor:gS.accent30}},calendar:{itemStyle:{color:gS.neutral00,borderColor:gS.neutral20},dayLabel:{color:gS.tertiary},monthLabel:{color:gS.secondary},yearLabel:{color:gS.secondary}},matrix:{x:yS,y:yS,backgroundColor:{borderColor:gS.axisLine},body:{itemStyle:{borderColor:gS.borderTint}}},timeAxis:mS(),logAxis:mS(),valueAxis:mS(),categoryAxis:mS(),line:{symbol:"circle"},graph:{color:gS.theme},gauge:{title:{color:gS.secondary},axisLine:{lineStyle:{color:[[1,gS.neutral05]]}},axisLabel:{color:gS.axisLabel},detail:{color:gS.primary}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}},funnel:{itemStyle:{borderColor:gS.background}},radar:(fS=mS(),fS.axisName={color:gS.axisLabel},fS.axisLine.lineStyle.color=gS.neutral20,fS),treemap:{breadcrumb:{itemStyle:{color:gS.neutral20,textStyle:{color:gS.secondary}},emphasis:{itemStyle:{color:gS.neutral30}}}},sunburst:{itemStyle:{borderColor:gS.background}},map:{itemStyle:{borderColor:gS.border,areaColor:gS.neutral10},label:{color:gS.tertiary},emphasis:{label:{color:gS.primary},itemStyle:{areaColor:gS.highlight}},select:{label:{color:gS.primary},itemStyle:{areaColor:gS.highlight}}},geo:{itemStyle:{borderColor:gS.border,areaColor:gS.neutral10},emphasis:{label:{color:gS.primary},itemStyle:{areaColor:gS.highlight}},select:{label:{color:gS.primary},itemStyle:{color:gS.highlight}}}};vS.categoryAxis.splitLine.show=!1;const _S=vS;var xS=function(){function t(){}return t.prototype.normalizeQuery=function(t){var e={},n={},i={};if(_(t)){var o=zn(t);e.mainType=o.main||null,e.subType=o.sub||null}else{var r=["Index","Name","Id"],a={name:1,dataIndex:1,dataType:1};c(t,function(t,o){for(var s=!1,l=0;l0&&h===o.length-u.length){var c=o.slice(0,h);"data"!==c&&(e.mainType=c,e[u.toLowerCase()]=t,s=!0)}}a.hasOwnProperty(o)&&(n[o]=t,s=!0),s||(i[o]=t)})}return{cptQuery:e,dataQuery:n,otherQuery:i}},t.prototype.filter=function(t,e){function n(t,e,n,i){return null==t[n]||e[i||n]===t[n]}var i=this.eventInfo;if(!i)return!0;var o=i.targetEl,r=i.packedEvent,a=i.model,s=i.view;if(!a||!s)return!0;var l=e.cptQuery,u=e.dataQuery;return n(l,a,"mainType")&&n(l,a,"subType")&&n(l,a,"index","componentIndex")&&n(l,a,"name")&&n(l,a,"id")&&n(u,r,"name")&&n(u,r,"dataIndex")&&n(u,r,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(t,e.otherQuery,o,r))},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),wS=["symbol","symbolSize","symbolRotate","symbolOffset"],bS=wS.concat(["symbolKeepAspect"]),SS={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData();if(t.legendIcon&&n.setVisual("legendIcon",t.legendIcon),t.hasSymbolVisual){for(var i={},o={},r=!1,s=0;s0&&t.unfinished);t.unfinished||this._zr.flush()}}},n.prototype.getDom=function(){return this._dom},n.prototype.getId=function(){return this.id},n.prototype.getZr=function(){return this._zr},n.prototype.isSSR=function(){return this._ssr},n.prototype.setOption=function(t,e,n){if(!this[dT])if(this._disposed);else{var i,o,r;if(b(e)&&(n=e.lazyUpdate,i=e.silent,o=e.replaceMerge,r=e.transition,e=e.notMerge),this[dT]=!0,sT(this),!this._model||e){var a=new kx(this._api),s=this._theme,l=this._model=new bx;l.scheduler=this._scheduler,l.ssr=this._ssr,l.init(null,null,null,s,this._locale,a)}this._model.setOption(t,{replaceMerge:o},kT);var u={seriesTransition:r,optionChanged:!0};if(n)this[fT]={silent:i,updateParams:u},this[dT]=!1,this.getZr().wakeUp();else{try{WS(this),US.update.call(this,null,u)}catch(t){throw this[fT]=null,this[dT]=!1,t}this._ssr||this._zr.flush(),this[fT]=null,this[dT]=!1,KS.call(this,i),$S.call(this,i)}}},n.prototype.setTheme=function(t,e){if(!this[dT])if(this._disposed);else{var n=this._model;if(n){var i=e&&e.silent,o=null;this[fT]&&(null==i&&(i=this[fT].silent),o=this[fT].updateParams,this[fT]=null),this[dT]=!0,sT(this);try{this._updateTheme(t),n.setTheme(this._theme),WS(this),US.update.call(this,{type:"setTheme"},o)}catch(t){throw this[dT]=!1,t}this[dT]=!1,KS.call(this,i),$S.call(this,i)}}},n.prototype._updateTheme=function(t){_(t)&&(t=LT[t]),t&&((t=o(t))&&_r(t,!0),this._theme=t)},n.prototype.getModel=function(){return this._model},n.prototype.getOption=function(){return this._model&&this._model.getOption()},n.prototype.getWidth=function(){return this._zr.getWidth()},n.prototype.getHeight=function(){return this._zr.getHeight()},n.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||Qp.hasGlobalWindow&&window.devicePixelRatio||1},n.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},n.prototype.renderToCanvas=function(t){return this._zr.painter.getRenderedCanvas({backgroundColor:(t=t||{}).backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},n.prototype.renderToSVGString=function(t){return this._zr.painter.renderToString({useViewBox:(t=t||{}).useViewBox})},n.prototype.getSvgDataURL=function(){var t=this._zr;return c(t.storage.getDisplayList(),function(t){t.stopAnimation(null,!0)}),t.painter.toDataURL()},n.prototype.getDataURL=function(t){if(!this._disposed){var e=this._model,n=[],i=this;c((t=t||{}).excludeComponents,function(t){e.eachComponent({mainType:t},function(t){var e=i._componentsMap[t.__viewId];e.group.ignore||(n.push(e),e.group.ignore=!0)})});var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return c(n,function(t){t.group.ignore=!1}),o}},n.prototype.getConnectedDataURL=function(t){if(!this._disposed){var e="svg"===t.type,n=this.group,i=Math.min,r=Math.max,a=1/0;if(AT[n]){var s=a,l=a,u=-1/0,h=-1/0,d=[],p=t&&t.pixelRatio||this.getDevicePixelRatio();c(DT,function(a,c){if(a.group===n){var p=e?a.getZr().painter.getSvgDom().innerHTML:a.renderToCanvas(o(t)),f=a.getDom().getBoundingClientRect();s=i(f.left,s),l=i(f.top,l),u=r(f.right,u),h=r(f.bottom,h),d.push({dom:p,left:f.left,top:f.top})}});var f=(u*=p)-(s*=p),g=(h*=p)-(l*=p),m=af.createCanvas(),y=en(m,{renderer:e?"svg":"canvas"});if(y.resize({width:f,height:g}),e){var v="";return c(d,function(t){v+=''+t.dom+""}),y.painter.getSvgRoot().innerHTML=v,t.connectedBackgroundColor&&y.painter.setBackgroundColor(t.connectedBackgroundColor),y.refreshImmediately(),y.painter.toDataURL()}return t.connectedBackgroundColor&&y.add(new mv({shape:{x:0,y:0,width:f,height:g},style:{fill:t.connectedBackgroundColor}})),c(d,function(t){var e=new cv({style:{x:t.left*p-s,y:t.top*p-l,image:t.dom}});y.add(e)}),y.refreshImmediately(),m.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}},n.prototype.convertToPixel=function(t,e,n){return YS(this,"convertToPixel",t,e,n)},n.prototype.convertToLayout=function(t,e,n){return YS(this,"convertToLayout",t,e,n)},n.prototype.convertFromPixel=function(t,e,n){return YS(this,"convertFromPixel",t,e,n)},n.prototype.containPixel=function(t,e){var n;if(!this._disposed)return c(Pn(this._model,t),function(t,i){i.indexOf("Models")>=0&&c(t,function(t){var o=t.coordinateSystem;if(o&&o.containPoint)n=n||!!o.containPoint(e);else if("seriesModels"===i){var r=this._chartsMap[t.__viewId];r&&r.containPoint&&(n=n||r.containPoint(e,t))}},this)},this),!!n},n.prototype.getVisual=function(t,e){var n=Pn(this._model,t,{defaultMainType:"series"}),i=n.seriesModel.getData(),o=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?i.indexOfRawIndex(n.dataIndex):null;return null!=o?function(t,e,n){switch(n){case"color":return t.getItemVisual(e,"style")[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,n)}}(i,o,e):function(t,e){switch(e){case"color":return t.getVisual("style")[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e)}}(i,e)},n.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},n.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},n.prototype._initEvents=function(){var t=this;c(bT,function(e){var n=function(n){var i,o=t.getModel(),r=n.target;if("globalout"===e?i={}:r&&Os(r,function(t){var e=Mv(t);if(e&&null!=e.dataIndex){var n=e.dataModel||o.getSeriesByIndex(e.seriesIndex);return i=n&&n.getDataParams(e.dataIndex,e.dataType,r)||{},!0}if(e.eventData)return i=a({},e.eventData),!0},!0),i){var s=i.componentType,l=i.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=i.seriesIndex);var u=s&&null!=l&&o.getComponent(s,l),h=u&&t["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];i.event=n,i.type=e,t._$eventProcessor.eventInfo={targetEl:r,packedEvent:i,model:u,view:h},t.trigger(e,i)}};n.zrEventfulCallAtLast=!0,t._zr.on(e,n,t)});var e=this._messageCenter;c(MT,function(n,i){e.on(i,function(e){t.trigger(i,e)})}),function(t,e,n){t.on("selectchanged",function(t){var i=n.getModel();t.isFromClick?(As("map","selectchanged",e,i,t),As("pie","selectchanged",e,i,t)):"select"===t.fromAction?(As("map","selected",e,i,t),As("pie","selected",e,i,t)):"unselect"===t.fromAction&&(As("map","unselected",e,i,t),As("pie","unselected",e,i,t))})}(e,this,this._api)},n.prototype.isDisposed=function(){return this._disposed},n.prototype.clear=function(){this._disposed||this.setOption({series:[]},!0)},n.prototype.dispose=function(){if(this._disposed);else{this._disposed=!0,this.getDom()&&On(this.getDom(),zT,"");var t=this,e=t._api,n=t._model;c(t._componentsViews,function(t){t.dispose(n,e)}),c(t._chartsViews,function(t){t.dispose(n,e)}),t._zr.dispose(),t._dom=t._model=t._chartsMap=t._componentsMap=t._chartsViews=t._componentsViews=t._scheduler=t._api=t._zr=t._throttledZrFlush=t._theme=t._coordSysMgr=t._messageCenter=null,delete DT[t.id]}},n.prototype.resize=function(t){if(!this[dT])if(this._disposed);else{this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var n=e.resetOption("media"),i=t&&t.silent;this[fT]&&(null==i&&(i=this[fT].silent),n=!0,this[fT]=null),this[dT]=!0,sT(this);try{n&&WS(this),US.update.call(this,{type:"resize",animation:a({duration:0},t&&t.animation)})}catch(t){throw this[dT]=!1,t}this[dT]=!1,KS.call(this,i),$S.call(this,i)}}},n.prototype.showLoading=function(t,e){if(this._disposed);else if(b(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),PT[t]){var n=PT[t](this._api,e),i=this._zr;this._loadingFX=n,i.add(n)}},n.prototype.hideLoading=function(){this._disposed||(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},n.prototype.makeActionFromEvent=function(t){var e=a({},t);return e.type=TT[t.type],e},n.prototype.dispatchAction=function(t,e){if(this._disposed);else if(b(e)||(e={silent:!!e}),ST[t.type]&&this._model)if(this[dT])this._pendingActions.push(t);else{var n=e.silent;qS.call(this,t,n);var i=e.flush;i?this._zr.flush():!1!==i&&Qp.browser.weChat&&this._throttledZrFlush(),KS.call(this,n),$S.call(this,n)}},n.prototype.updateLabelLayout=function(){HS.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},n.prototype.appendData=function(t){if(this._disposed);else{var e=t.seriesIndex;this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},n.internalField=function(){function t(t){t.clearColorPalette(),t.eachSeries(function(t){t.clearColorPalette()})}function n(t){for(var e=[],n=t.currentStates,i=0;i0?{duration:r,delay:i.get("delay"),easing:i.get("easing")}:null;e.eachRendered(function(t){if(t.states&&t.states.emphasis){if(Pa(t))return;if(t instanceof ov&&function(t){var e=Iv(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var n=t.states.select||{};e.selectFill=n.style&&n.style.fill||null,e.selectStroke=n.style&&n.style.stroke||null}(t),t.__dirty){var e=t.prevStates;e&&t.useStates(e)}if(o){t.stateTransition=a;var i=t.getTextContent(),r=t.getTextGuideLine();i&&(i.stateTransition=a),r&&(r.stateTransition=a)}t.__dirty&&n(t)}})}WS=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),jS(t,!0),jS(t,!1),e.plan()},jS=function(t,e){function n(t){var n=t.__requireNewView;t.__requireNewView=!1;var u="_ec_"+t.id+"_"+t.type,h=!n&&a[u];if(!h){var c=zn(t.type);(h=new(e?ww.getClass(c.main,c.sub):Kb.getClass(c.sub))).init(i,l),a[u]=h,r.push(h),s.add(h.group)}t.__viewId=h.__id=u,h.__alive=!0,h.__model=t,h.group.__ecComponentInfo={mainType:t.mainType,index:t.componentIndex},!e&&o.prepareView(h,t,i,l)}for(var i=t._model,o=t._scheduler,r=e?t._componentsViews:t._chartsViews,a=e?t._componentsMap:t._chartsMap,s=t._zr,l=t._api,u=0;ue.get("hoverLayerThreshold")&&!Qp.node&&!Qp.worker&&e.eachSeries(function(e){if(!e.preventUsingHoverLayer){var n=t._chartsMap[e.__viewId];n.__alive&&n.eachRendered(function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)})}})}(t,e),HS.trigger("series:afterupdate",e,n,l)},rT=function(t){t[gT]=!0,t.getZr().wakeUp()},sT=function(t){t[pT]=(t[pT]+1)%1e3},aT=function(t){t[gT]&&(t.getZr().storage.traverse(function(t){Pa(t)||n(t)}),t[gT]=!1)},iT=function(t){return new(function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return e(i,n),i.prototype.getCoordinateSystems=function(){return t._coordSysMgr.getCoordinateSystems()},i.prototype.getComponentByElement=function(e){for(;e;){var n=e.__ecComponentInfo;if(null!=n)return t._model.getComponent(n.mainType,n.index);e=e.parent}},i.prototype.enterEmphasis=function(e,n){ji(e,n),rT(t)},i.prototype.leaveEmphasis=function(e,n){Gi(e,n),rT(t)},i.prototype.enterBlur=function(e){!function(t){Fi(t,zi)}(e),rT(t)},i.prototype.leaveBlur=function(e){Ui(e),rT(t)},i.prototype.enterSelect=function(e){Yi(e),rT(t)},i.prototype.leaveSelect=function(e){Xi(e),rT(t)},i.prototype.getModel=function(){return t.getModel()},i.prototype.getViewOfComponentModel=function(e){return t.getViewOfComponentModel(e)},i.prototype.getViewOfSeriesModel=function(e){return t.getViewOfSeriesModel(e)},i.prototype.getMainProcessVersion=function(){return t[pT]},i}(Tx))(t)},oT=function(t){function e(t,e){for(var n=0;n0?t[n-1].seriesModel:null)}),function(t){c(t,function(e,n){var i=[],o=[NaN,NaN],r=[e.stackResultDimension,e.stackedOverDimension],a=e.data,s=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";a.modify(r,function(r,u,h){var c,d,p=a.get(e.stackedDimension,h);if(isNaN(p))return o;s?d=a.getRawIndex(h):c=a.get(e.stackedByDimension,h);for(var f=NaN,g=n-1;g>=0;g--){var m=t[g];if(s||(d=m.data.rawIndexOf(m.stackedByDimension,c)),d>=0){var y=m.data.getByRawIndex(m.stackResultDimension,d);if("all"===l||"positive"===l&&y>0||"negative"===l&&y<0||"samesign"===l&&p>=0&&y>0||"samesign"===l&&p<=0&&y<0){p=ln(p,y),f=y;break}}}return i[0]=p,i[1]=f,i})})}(t))})}),vl("default",function(t,e){s(e=e||{},{text:"loading",textColor:X_.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:X_.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Em,i=new mv({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});n.add(i);var o,r=new Tv({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new mv({style:{fill:"none"},textContent:r,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});return n.add(a),e.showSpinner&&((o=new vb({shape:{startAngle:-lS/2,endAngle:-lS/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*lS/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:3*lS/2}).delay(300).start("circularInOut"),n.add(o)),n.resize=function(){var n=r.getBoundingRect().width,s=e.showSpinner?e.spinnerRadius:0,l=(t.getWidth()-2*s-(e.showSpinner&&n?10:0)-n)/2-(e.showSpinner&&n?0:5+n/2)+(e.showSpinner?0:n/2)+(n?0:s),u=t.getHeight()/2;e.showSpinner&&o.setShape({cx:l,cy:u}),a.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),i.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},n.resize(),n}),fl({type:Av,event:Av,update:Av},H),fl({type:Ov,event:Ov,update:Ov},H),fl({type:zv,event:Bv,update:zv,action:H,refineEvent:_l,publishNonRefinedEvent:!0}),fl({type:Ev,event:Bv,update:Ev,action:H,refineEvent:_l,publishNonRefinedEvent:!0}),fl({type:Rv,event:Bv,update:Rv,action:H,refineEvent:_l,publishNonRefinedEvent:!0}),hl("default",{}),hl("dark",_S);const BT={...{metadata:!0,svgRender:!1,switchMode:!1,maxPointsFetched:1e4,loadMoreAtZoomLevel:9,clustering:!1,clusteringThreshold:100,disableClusteringAtLevel:8,clusterRadius:80,clusterSeparation:20,showMetaOnNarrowScreens:!1,showMapLabelsAtZoom:13,showGraphLabelsAtZoom:null,echartsOption:{aria:{show:!0,description:"This is a force-oriented graph chart that depicts the relationship between ip nodes."},toolbox:{show:!0,iconStyle:{borderColor:"#fff"},feature:{restore:{show:!0,title:"Restore view"},saveAsImage:{show:!0,title:"Save image"}}}},graphConfig:{series:{layout:"force",label:{show:!0,color:"#fff",position:"top"},labelLayout:{hideOverlap:!0},force:{gravity:.1,edgeLength:[20,60],repulsion:120},roam:!0,draggable:!0,legendHoverLink:!0,emphasis:{focus:"none",lineStyle:{color:"#3acc38",opacity:1}},nodeStyle:{color:"#ffebc4"},linkStyle:{width:6,color:"#1ba619"},nodeSize:"15"},baseOptions:{backgroundColor:"#282222",media:[{query:{minWidth:320,maxWidth:500},option:{series:[{zoom:.7}],toolbox:{itemSize:18}}},{query:{minWidth:501},option:{series:[{zoom:1}],toolbox:{itemSize:15}}},{query:{minWidth:320,maxWidth:850},option:{tooltip:{show:!1}}},{query:{minWidth:851},option:{tooltip:{show:!0}}}]}},mapOptions:{roam:!0,zoomAnimation:!1,worldCopyJump:!0,minZoom:3,maxZoom:18,nodeConfig:{type:"scatter",label:{show:!1,color:"#000000",position:"top",formatter:"{b}",fontSize:13,backgroundColor:"rgba(255, 255, 255, 0.8)",padding:[6,8],borderRadius:5},emphasis:{scale:1},nodeStyle:{color:"#1566a9"},nodeSize:"17"},linkConfig:{linkStyle:{width:5,color:"#1ba619"},emphasis:{focus:"none",lineStyle:{color:"#3acc38",opacity:1}}},clusterConfig:{symbolSize:30,itemStyle:{color:"#1566a9"},tooltip:{show:!1},label:{show:!0,position:"inside",color:"#fff",offset:[0,0],backgroundColor:"transparent"}},baseOptions:{toolbox:{show:!1},media:[{query:{minWidth:320,maxWidth:850},option:{tooltip:{show:!1}}},{query:{minWidth:851},option:{tooltip:{show:!0}}}]},nodePopup:{show:!1,content:null,config:{autoPan:!0,autoPanPadding:[25,25],offset:null}}},mapTileConfig:[{urlTemplate:"MISSING_ENV_VAR".MAPBOX_URL_TEMPLATE||"http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",options:{attribution:'© OpenStreetMap contributors,\n tiles offered by Mapbox'}}],geoOptions:{style:{fillColor:"#1566a9",weight:0,fillOpacity:.8,radius:8}},nodeCategories:[{name:"ok",nodeStyle:{color:"#1ba619"}},{name:"problem",nodeStyle:{color:"#ffa500"}},{name:"critical",nodeStyle:{color:"#c92517"}}],linkCategories:[],bookmarkableActions:{enabled:!1,id:null,zoomOnRestore:!0,zoomLevel:null},prepareData(t){t&&t.nodes&&t.nodes.forEach(t=>{if(t.properties&&t.properties.status){const e=t.properties.status.toLowerCase();"ok"!==e&&"problem"!==e&&"critical"!==e||(t.category=e)}})},onClickElement(t,e){let n;this.utils&&this.utils.isNetJSON(this.data)?(n="node"===t?this.utils.nodeInfo(e):"link"===t?this.utils.linkInfo(e):e,(this.config.showMetaOnNarrowScreens||this.el.clientWidth>850)&&(this.gui.metaInfoContainer.style.display="flex")):({nodeLinkData:n}={nodeLinkData:e}),this.gui.getNodeLinkInfo(t,n),this.gui.sideBar.classList.remove("hidden")},onReady(){}}};Object.defineProperty(BT,"crs",{get(){const t=xl(!0);return t?t.CRS.EPSG3857:null},enumerable:!0,configurable:!0});const NT=BT,FT=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class VT{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,n]=new Uint8Array(t,0,2);if(219!==e)throw new Error("Data does not appear to be in a KDBush format.");const i=n>>4;if(1!==i)throw new Error(`Got v${i} data when expected v1.`);const o=FT[15&n];if(!o)throw new Error("Unrecognized array type.");const[r]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new VT(a,r,o,t)}constructor(t,e=64,n=Float64Array,i){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=n,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const o=FT.indexOf(this.ArrayType),r=2*t*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-a%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${n}.`);i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+a+s,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+r+a+s),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+a+s,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+o]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=t,this.coords[this._pos++]=e,n}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return wl(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:r,nodeSize:a}=this,s=[0,o.length-1,0],l=[];for(;s.length;){const u=s.pop()||0,h=s.pop()||0,c=s.pop()||0;if(h-c<=a){for(let a=c;a<=h;a++){const s=r[2*a],u=r[2*a+1];s>=t&&s<=n&&u>=e&&u<=i&&l.push(o[a])}continue}const d=c+h>>1,p=r[2*d],f=r[2*d+1];p>=t&&p<=n&&f>=e&&f<=i&&l.push(o[d]),(0===u?t<=p:e<=f)&&(s.push(c),s.push(d-1),s.push(1-u)),(0===u?n>=p:i>=f)&&(s.push(d+1),s.push(h),s.push(1-u))}return l}within(t,e,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:r}=this,a=[0,i.length-1,0],s=[],l=n*n;for(;a.length;){const u=a.pop()||0,h=a.pop()||0,c=a.pop()||0;if(h-c<=r){for(let n=c;n<=h;n++)Ml(o[2*n],o[2*n+1],t,e)<=l&&s.push(i[n]);continue}const d=c+h>>1,p=o[2*d],f=o[2*d+1];Ml(p,f,t,e)<=l&&s.push(i[d]),(0===u?t-n<=p:e-n<=f)&&(a.push(c),a.push(d-1),a.push(1-u)),(0===u?t+n>=p:e+n>=f)&&(a.push(d+1),a.push(h),a.push(1-u))}return s}}const ZT=class{JSONParamParse(t){return"string"==typeof t?fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},credentials:"include"}).then(t=>t).catch(t=>{console.error(t)}):Promise.resolve(t)}async paginatedDataParse(t){let e,n;try{let i=await this.utils.JSONParamParse(t);if(i.json)for(e=await i.json(),n=e.results?e.results:e;e.next&&n.nodes.length<=this.config.maxPointsFetched;)i=await this.utils.JSONParamParse(e.next),e=await i.json(),n.nodes=n.nodes.concat(e.results.nodes),n.links=n.links.concat(e.results.links),this.hasMoreData=!!e.next;else n=i}catch(t){console.error(t)}return n}async getBBoxData(t,e){let n;try{const i=`${t=t[0].split("?")[0]}bbox?swLat=${e._southWest.lat}&swLng=${e._southWest.lng}&neLat=${e._northEast.lat}&neLng=${e._northEast.lng}`,o=await this.utils.JSONParamParse(i);n=await o.json()}catch(t){console.error(t)}return n}dateParse({dateString:t,parseRegular:e=/^([1-9]\d{3})-(\d{1,2})-(\d{1,2})T(\d{1,2}):(\d{1,2}):(\d{1,2})(?:\.(\d{1,3}))?Z$/,hourDiffer:n=(new Date).getTimezoneOffset()/60}){const i=e.exec(t);if(!i||i.length<7)return console.error("Date doesn't meet the specifications."),"";const o=["dateYear","dateMonth","dateDay","dateHour"],r={},a=new Map([["dateMonth",12],["dateDay",[31,i[1]%4==0&&i[1]%100!=0||i[1]%400==0?29:28,31,30,31,30,31,31,30,31,30,31]],["dateHour",24]]);for(let t=o.length;t>0;t-=1)r[o[t-1]]=parseInt(i[t],10);let s,l=-n;for(let t=o.length;t>0;t-=1){if("dateYear"===o[t-1]){r[o[t-1]]+=l;break}s="dateDay"===o[t-1]?a.get("dateDay")[r.dateMonth-1]:a.get(o[t-1]);let e=r[o[t-1]]+l;l="dateHour"===o[t-1]?e<0?-1:e>=s?1:0:e<=0?-1:e>s?1:0,1===l?e-=s:l<0&&("dateDay"===o[t-1]&&(s=a.get("dateDay")[(r[o[t-1]]+10)%11]),e+=s),r[o[t-1]]=e}return`${r.dateYear}.${this.numberMinDigit(r.dateMonth)}.${this.numberMinDigit(r.dateDay)} ${this.numberMinDigit(r.dateHour)}:${this.numberMinDigit(i[5])}:${this.numberMinDigit(i[6])}${i[7]?`.${this.numberMinDigit(i[7],3)}`:""}`}numberMinDigit(t,e=2,n="0"){return(Array(e).join(n)+t).slice(-e)}isObject(t){return"Object"===Object.prototype.toString.call(t).slice(8,14)}isArray(t){return"Array"===Object.prototype.toString.call(t).slice(8,13)}isElement(t){return"object"==typeof HTMLElement?t instanceof HTMLElement:t&&"object"==typeof t&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName}isNetJSON(t){return!(!t.nodes||!t.links)&&this.isObject(t)&&this.isArray(t.nodes)&&this.isArray(t.links)}isGeoJSON(t){return t.type&&"FeatureCollection"===t.type?this.isObject(t)&&this.isArray(t.features):!(!t.type||"Feature"!==t.type)&&this.isObject(t)&&this.isArray(t.geometry)}geojsonToNetjson(t){return function(t){const e=[],n=[];if(!t||!Array.isArray(t.features))return{nodes:e,links:n};const i=new Map,o=(t,n={})=>{const o=`${t[0]},${t[1]}`;if(i.has(o))return i.get(o);const r=n.id||n.node_id||null,a=n.label||n.name||r||null,s=r?String(r):`gjn_${e.length}`,l=!r,u={id:s,...a?{label:String(a)}:{},location:{lng:t[0],lat:t[1]},properties:{...n,location:{lng:t[0],lat:t[1]}},_generatedIdentity:l};return e.push(u),i.set(o,s),s},r=(t,e,i={})=>{n.push({source:t,target:e,properties:i})},a=(t,e,n=!1)=>{for(let n=0;n2){const n=o(t[0],e),i=o(t[t.length-1],e);r(i,n,e)}},s=(t,e)=>{if(!t)return;const{type:n,coordinates:i,geometries:r}=t;switch(n){case"Point":o(i,{...e,_featureType:"Point"});break;case"MultiPoint":i.forEach(t=>o(t,{...e,_featureType:"Point"}));break;case"LineString":a(i,{...e,_featureType:"LineString"},!1);break;case"MultiLineString":i.forEach(t=>a(t,{...e,_featureType:"LineString"},!1));break;case"Polygon":case"MultiPolygon":break;case"GeometryCollection":r.forEach(t=>s(t,e));break;default:console.warn(`Unsupported GeoJSON geometry type: ${n}`)}};return t.features.forEach(t=>{const e={...t.properties||{},...null!=t.id?{id:t.id}:{}};s(t.geometry,e)}),{nodes:e,links:n}}(t)}deepCopy(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>this.deepCopy(t));const e={};return Object.keys(t).forEach(n=>{e[n]=this.deepCopy(t[n])}),e}fastDeepCopy(t){return"function"==typeof structuredClone?structuredClone(t):JSON.parse(JSON.stringify(t))}deepMergeObj(...t){const e=[...t].reverse(),n=e.length;for(let t=0;t{i[t]&&this.isObject(i[t])&&this.isObject(n[t])?this.deepMergeObj(i[t],n[t]):i[t]=n[t]}):i||(e[t+1]=n)}return e[n-1]}makeCluster(t){const{nodes:e,links:n}=t.data,i=t=>!(t.properties&&t.properties._featureType)||"Point"===t.properties._featureType,o=e.filter(i),r=e.filter(t=>!i(t)),a=[],s=[],l=new Map;r.forEach(t=>l.set(t.id,null));let u=0;o.forEach(e=>{const n=e.properties&&e.properties.location||e.location;if(!n||void 0===n.lat||void 0===n.lng)return;e.location=n,e._origLocation?(n.lat=e._origLocation.lat,n.lng=e._origLocation.lng):e._origLocation={lat:n.lat,lng:n.lng};const i=t.leaflet.latLngToContainerPoint([n.lat,n.lng]);e.x=i.x,e.y=i.y,e.visited=!1,e.cluster=null});const h=new VT(o.length);o.forEach(({x:t,y:e})=>h.add(t,e)),h.finish();const c=t.config&&t.config.mapOptions&&t.config.mapOptions.clusterConfig&&t.config.mapOptions.clusterConfig.symbolSize,d=t=>{if("function"==typeof c)try{return c(t)}catch(t){return 30}return Array.isArray(c)?c[0]||30:"number"==typeof c?c:30},p=new Map;o.forEach(e=>{if(e.visited)return;const n=h.within(e.x,e.y,t.config.clusterRadius).map(t=>o[t]);if(n.length>1){const i=`${Math.round(e.x)},${Math.round(e.y)}`;p.has(i)||p.set(i,new Map);const o=p.get(i);n.forEach(e=>{if(e.visited)return;const n=t.config.clusteringAttribute?e.properties[t.config.clusteringAttribute]:"default";o.has(n)||o.set(n,[]),o.get(n).push(e),e.visited=!0})}else e.visited=!0,l.set(e.id,null),r.push(e)}),p.forEach(e=>{const n=Array.from(e.entries()),i=n.length;let o=0;n.forEach(([,t])=>{const e=d(t.length);e>o&&(o=e)});const a="number"==typeof t.config.clusterSeparation?t.config.clusterSeparation:Math.max(10,Math.floor(t.config.clusterRadius/2));let h=0;if(i>1){const t=Math.PI/i,e=Math.sin(t);e>0&&(h=o/(2*e))}const c=Math.max(a,h+4);n.forEach(([,e],n)=>{if(e.length>1){let o=0,r=0;if(e.forEach(t=>{t.cluster=u,l.set(t.id,t.cluster),o+=t.location.lng,r+=t.location.lat}),o/=e.length,r/=e.length,i>1){const e=2*Math.PI*n/i,a=t.leaflet.latLngToContainerPoint([r,o]),s=[a.x+c*Math.cos(e),a.y+c*Math.sin(e)],l=t.leaflet.containerPointToLatLng(s);o=l.lng,r=l.lat}const a={id:u,cluster:!0,name:e.length,value:[o,r],childNodes:e,...t.config.mapOptions.clusterConfig};if(t.config.clusteringAttribute){const n=t.config.nodeCategories.find(n=>n.name===e[0].properties[t.config.clusteringAttribute]);n&&(a.itemStyle={...a.itemStyle,color:n.nodeStyle.color})}s.push(a),u+=1}else if(1===e.length){const t=e[0];l.set(t.id,null),r.push(t)}})}),n.forEach(t=>{null===l.get(t.source)&&null===l.get(t.target)&&a.push(t)});const f=[...s.map(t=>({ref:t,isCluster:!0,count:t.childNodes.length,get value(){return t.value},set value([e,n]){t.value=[e,n]}})),...r.filter(i).map(t=>({ref:t,isCluster:!1,count:1,get value(){return[t.location.lng,t.location.lat]},set value([e,n]){t.location.lng=e,t.location.lat=n}}))];if(f.length>1){const e=f.map(e=>{const[n,i]=e.value,o=t.leaflet.latLngToContainerPoint([i,n]);return{ref:e.ref,isCluster:e.isCluster,x:o.x,y:o.y,r:d(e.count)/2,setValue:([t,n])=>{e.value=[t,n]}}}),n=4,i=5;for(let t=0;t0&&s{const n=t.leaflet.containerPointToLatLng([e.x,e.y]);e.isCluster?e.ref.value=[n.lng,n.lat]:(e.ref.location.lng=n.lng,e.ref.location.lat=n.lat)})}return{clusters:s,nonClusterNodes:r,nonClusterLinks:a}}updateMetadata(){if(this.config.metadata){const t=this.utils.getMetadata(this.data),e=document.querySelector(".njg-metaData"),n=document.querySelectorAll(".njg-metaDataItems");for(let t=0;t{const i=document.createElement("div");i.classList.add("njg-metaDataItems");const o=document.createElement("span");o.setAttribute("class","njg-keyLabel");const r=document.createElement("span");r.setAttribute("class","njg-valueLabel"),o.innerHTML=n,r.innerHTML=t[n],i.appendChild(o),i.appendChild(r),e.appendChild(i)})}}getMetadata(t){const e=t,n={};return e.label&&(n.label=e.label),["protocol","version","revision","metric","router_id","topology_id"].forEach(t=>{e[t]&&(n[t]=e[t])}),n.nodes=e.nodes.length,n.links=e.links.length,n}nodeInfo(t){const e={};!t._generatedIdentity&&(e.id=t.id,t.label&&"string"==typeof t.label&&(e.label=t.label)),t.name&&(e.name=t.name),t.location&&(e.location=t.location);let n=null;Array.isArray(t.clients)?n=t.clients:t.properties&&Array.isArray(t.properties.clients)&&(n=t.properties.clients);let i=0;n?i=n.length:"number"==typeof t.clients?i=t.clients:t.properties&&"number"==typeof t.properties.clients&&(i=t.properties.clients),i>0&&(e.clients=i),n&&n.length&&n.forEach((t,n)=>{e[`clients [${n+1}]`]=t});const o=(t,e)=>"location"===t&&e&&"object"==typeof e?{lat:e.lat,lng:e.lng}:"time"===t&&"string"==typeof e?this.dateParse({dateString:e}):e,r=t._source&&this.isObject(t._source)?t._source:t;if(Object.keys(r).forEach(t=>{if("properties"===t||"clients"===t||"_source"===t||"_generatedIdentity"===t||"local_addresses"===t||"linkCount"===t)return;const n=o(t,r[t]);null!=n&&""!==n&&(e[t]=n)}),r.properties&&this.isObject(r.properties)&&Object.keys(r.properties).forEach(t=>{if("clients"===t)return;const n=o(t,r.properties[t]);null==n||"string"==typeof n&&""===n.trim()||(e[t]=n)}),t.linkCount&&(e.links=t.linkCount),Array.isArray(r.local_addresses)){const t=r.local_addresses.map(t=>"string"==typeof t?t:t&&"string"==typeof t.address?t.address:null).filter(t=>t);t.length&&(e.localAddresses=t)}return t.local_addresses&&(e.localAddresses=t.local_addresses),e}createTooltipItem(t,e){const n=document.createElement("div");n.classList.add("njg-tooltip-item");const i=document.createElement("span");i.setAttribute("class","njg-tooltip-key");const o=document.createElement("span");return o.setAttribute("class","njg-tooltip-value"),i.innerHTML=t,o.innerHTML=e,n.appendChild(i),n.appendChild(o),n}getNodeTooltipInfo(t){const e=document.createElement("div");e.classList.add("njg-tooltip-inner");const n=!t._generatedIdentity;return n&&t.id&&e.appendChild(this.createTooltipItem("id",t.id)),n&&t.label&&"string"==typeof t.label&&e.appendChild(this.createTooltipItem("label",t.label)),t.properties&&Object.keys(t.properties).forEach(i=>{if("object"!=typeof t.properties[i]&&!i.startsWith("_")&&("id"!==i&&"label"!==i||!n))if("location"===i)e.appendChild(this.createTooltipItem("location",`${Math.round(1e3*t.properties.location.lat)/1e3}, ${Math.round(1e3*t.properties.location.lng)/1e3}`));else if("time"===i){const n=this.dateParse({dateString:t.properties[i]});e.appendChild(this.createTooltipItem("time",n))}else e.appendChild(this.createTooltipItem(`${i.replace(/_/g," ")}`,t.properties[i]))}),t.linkCount&&e.appendChild(this.createTooltipItem("Links",t.linkCount)),t.local_addresses&&e.appendChild(this.createTooltipItem("Local Addresses",t.local_addresses.join("
"))),e}getLinkTooltipInfo(t){const e=document.createElement("div");e.classList.add("njg-tooltip-inner");const n=t=>"string"==typeof t&&t.startsWith("gjn_");return n(t.source)||e.appendChild(this.createTooltipItem("source",t.source)),n(t.target)||e.appendChild(this.createTooltipItem("target",t.target)),null!=t.cost&&e.appendChild(this.createTooltipItem("cost",t.cost)),t.properties&&Object.keys(t.properties).forEach(n=>{const i=t.properties[n];if(null!=i)if("time"===n){const t=this.dateParse({dateString:i});e.appendChild(this.createTooltipItem("time",t))}else{const t="string"==typeof i?i.replace(/\n/g,"
"):i;e.appendChild(this.createTooltipItem(`${n.replace(/_/g," ")}`,t))}}),e}linkInfo(t){const e={},n=t=>"string"==typeof t&&t.startsWith("gjn_");return n(t.source)||(e.source=t.source),n(t.target)||(e.target=t.target),null!=t.cost&&(e.cost=t.cost),t.properties&&Object.keys(t.properties).forEach(n=>{const i=t.properties[n];if(null!=i)if("time"===n){const t=this.dateParse({dateString:i});e[n]=t}else{const t="string"==typeof i?i.replace(/\n/g,"
"):i;e[n.replace(/_/g," ")]=t}}),e}generateStyle(t,e){return"function"==typeof t?t(e):t}getNodeStyle(t,e,n){let i,o={},r={},a=!1;if(t.category&&e.nodeCategories&&e.nodeCategories.length){const n=e.nodeCategories.find(e=>e.name===t.category);if(n){a=!0,i=this.generateStyle(n.nodeStyle||{},t),o=this.generateStyle(n.nodeSize||{},t);let e={},s={};n.emphasis&&(e=this.generateStyle(n.emphasis.nodeStyle||{},t),s=this.generateStyle(n.emphasis.nodeSize||{},t),r={nodeStyle:e,nodeSize:s})}}if(!a)if("map"===n){const n=e.mapOptions&&e.mapOptions.nodeConfig;i=this.generateStyle(n&&n.nodeStyle||{},t),o=this.generateStyle(n&&n.nodeSize||{},t);const a=n&&n.emphasis;a&&(r={nodeStyle:this.generateStyle(a&&a.nodeStyle||{},t),nodeSize:this.generateStyle(a&&a.nodeSize||{},t)})}else{const n=e.graphConfig&&e.graphConfig.series;i=this.generateStyle(n&&n.nodeStyle||{},t),o=this.generateStyle(n&&n.nodeSize||{},t);const a=n&&n.emphasis;a&&(r={nodeStyle:this.generateStyle(a&&a.itemStyle||{},t),nodeSize:this.generateStyle(a&&a.symbolSize||o||{},t)})}return{nodeStyleConfig:i,nodeSizeConfig:o,nodeEmphasisConfig:r}}getLinkStyle(t,e,n){let i,o={};if(t.category&&e.linkCategories.length){const n=e.linkCategories.find(e=>e.name===t.category);i=this.generateStyle(n.linkStyle||{},t),o={...o,linkStyle:n.emphasis?this.generateStyle(n.emphasis.linkStyle||{},t):{}}}else i=this.generateStyle("map"===n?e.mapOptions.linkConfig.linkStyle:e.graphConfig.series.linkStyle,t);return{linkStyleConfig:i,linkEmphasisConfig:o}}showLoading(){let t=this.el.querySelector(".njg-loadingContainer");return t?t.style.visibility="visible":(t=document.createElement("div"),t.classList.add("njg-loadingContainer"),t.innerHTML='\n
\n
\n

Loading...

\n
\n ',this.el.appendChild(t)),t}hideLoading(){const t=this.el.querySelector(".njg-loadingContainer");return t&&(t.style.visibility="hidden"),t}createEvent(){const t=new Map,e=new Map;return{on(e,...n){t.set(e,[...t.get(e)||[],...n])},once(t,...n){e.set(t,[...e.get(t)||[],...n])},emit(n){const i=t.get(n)||[],o=e.get(n)||[],r=i.map(t=>t()),a=o.map(t=>t());return e.delete(n),[...r,...a]},delete(n){t.delete(n),e.delete(n)}}}parseUrlFragments(){let t;try{t=decodeURIComponent(window.location.hash.replace(/^#/,""))}catch(e){t=window.location.hash.replace(/^#/,"")}const e={};return t.split(";").forEach(t=>{const n=new URLSearchParams(t),i=n.get("id");null!=i&&(e[i]=n)}),e}updateUrlFragments(t,e){const n=Object.values(t).map(t=>t.toString()).join(";").replace(/([^&=]+)=([^&;]*)/g,(t,e,n)=>`${e}=${encodeURIComponent(n.replace(/%7E/gi,"~"))}`);window.history.pushState(e,"",`#${n}`)}addActionToUrl(t,e){if(!t.config.bookmarkableActions.enabled||!e.data||e.data.cluster)return;if(!t.nodeLinkIndex)return void console.error("Lookup object for node or link not found.");const n=this.parseUrlFragments(),{id:i}=t.config.bookmarkableActions;let o;if(t.config.render===t.utils.graphRender){if("node"===e.dataType)o=e.data.id;else if("edge"===e.dataType){const{source:t,target:n}=e.data;o=`${t}~${n}`}}else if(t.config.render===t.utils.mapRender)if("scatter"===e.seriesType)o=e.data.node.id;else if("lines"===e.seriesType){const{source:t,target:n}=e.data.link;o=`${t}~${n}`}o&&t.nodeLinkIndex[o]?(n[i]||(n[i]=new URLSearchParams,n[i].set("id",i)),n[i].set("nodeId",o),this.updateUrlFragments(n,t.nodeLinkIndex[o])):console.error("nodeId not found in nodeLinkIndex lookup.")}removeUrlFragment(t,e=null){const n=this.parseUrlFragments();n[t]&&(e?n[t].delete(e):delete n[t],this.updateUrlFragments(n,{id:t}))}applyUrlFragmentState(t){if(!t.config.bookmarkableActions.enabled)return;const{id:e}=t.config.bookmarkableActions,n=t.utils.parseUrlFragments(),i=n[e]&&n[e].get?n[e]:null,o=i&&i.get?i.get("nodeId"):void 0;if(!o||!t.nodeLinkIndex||null==t.nodeLinkIndex[o])return;const[r,a]=o.split("~"),s=t.nodeLinkIndex[o],l=t.config.graphConfig&&t.config.graphConfig.series&&t.config.graphConfig.series.type||t.config.mapOptions&&t.config.mapOptions.nodeConfig&&t.config.mapOptions.nodeConfig.type,{location:u,cluster:h}=s||{};t.config.bookmarkableActions.zoomOnRestore&&["scatter","effectScatter"].includes(l)&&null==a&&null!=u&&t.leaflet&&t.leaflet.setView([u.lat,u.lng],null!=h?t.config.disableClusteringAtLevel:t.config.bookmarkableActions.zoomLevel||t.config.showMapLabelsAtZoom),null==a&&t.config.mapOptions?.nodePopup?.show&&t.gui.loadNodePopup(s),"function"==typeof t.config.onClickElement&&t.config.onClickElement.call(t,r&&a?"link":"node",s)}setupHashChangeHandler(t){return t._popstateHandler&&window.removeEventListener("popstate",t._popstateHandler),t._popstateHandler=()=>{this.applyUrlFragmentState(t)},window.addEventListener("popstate",t._popstateHandler),()=>{window.removeEventListener("popstate",t._popstateHandler),t._popstateHandler=null}}moveNodeInRealTime(t,e){if(!this.echarts||"function"!=typeof this.echarts.getOption)return void console.warn("moveNodeInRealTime: ECharts instance not ready");const n=this.echarts.getOption();if(!n||!Array.isArray(n.series))return void console.warn("moveNodeInRealTime: No series data available");const i=n.series.find(t=>"scatter"===t.type||"effectScatter"===t.type);if(!i)return void console.warn("moveNodeInRealTime: No scatter series found");const o=i.data.findIndex(e=>e.node.id===t);if(-1===o)return void console.warn(`moveNodeInRealTime: Node with id "${t}" not found`);const r=i.data[o],{node:a}=r;a.location=e,a.properties?(a.properties.location=e,r.value=[e.lng,e.lat],this.nodeLinkIndex[t].location=e,this.nodeLinkIndex[t].properties&&(this.nodeLinkIndex[t].properties.location=e,this.echarts.setOption({series:n.series}))):console.warn("moveNodeInRealTime: Node properties not found")}updateLabelVisibility(t,e){if(!t.echarts||"function"!=typeof t.echarts.setOption)return void console.warn("updateLabelVisibility: ECharts instance not ready");const n=e&&!1!==t.config.showMapLabelsAtZoom&&t.leaflet.getZoom()>=t.config.showMapLabelsAtZoom;t.echarts.setOption({series:[{id:"geo-map",label:{show:n,silent:!0},emphasis:{label:{show:!1}}}]})}},HT=class extends ZT{searchElements(t){const e=this,n={"":{data:{...e.data},param:[...e.JSONParam]}};return window.history.pushState({searchValue:""},""),window.onpopstate=i=>{n[i.state.searchValue]?e.utils.JSONDataUpdate.call(e,n[i.state.searchValue].data).then(()=>{e.JSONParam=n[i.state.searchValue].param}):e.utils.JSONDataUpdate.call(e,t+i.state.searchValue)},function(i,o=!0,r=!0){const a=i.trim();if(!window.history.state||window.history.state&&window.history.state.searchValue!==a)return window.history.pushState({searchValue:a},""),e.utils.JSONDataUpdate.call(e,t+a,o,r).then(()=>{n[a]={data:{...e.data},param:[...e.JSONParam]}})}}JSONDataUpdate(t,e=!0,n=!0){const i=this;return i.config.onUpdate.call(i),i.utils.paginatedDataParse.call(i,t).then(o=>{function r(){e?(i.JSONParam=[t],i.utils.overrideData(o,i)):(i.JSONParam.push(t),i.config.render===i.utils.mapRender?i.utils.appendData(o,i):i.utils.addData(o,i)),i.utils.isNetJSON(i.data)&&i.utils.updateMetadata.call(i)}return n?(i.utils.isNetJSON(i.data)&&i.config.prepareData.call(i,o),i.config.dealDataByWorker?i.utils.dealDataByWorker.call(i,o,i.config.dealDataByWorker,r):r()):r(),o}).catch(t=>{console.error(t)})}dealDataByWorker(t,e,n){const i=new Worker(e),o=this;i.postMessage(t),i.addEventListener("error",t=>{console.error(t),console.error("Error in dealing JSONData!")}),i.addEventListener("message",t=>{n?n():(o.utils.overrideData(t.data,o),o.utils.isNetJSON(o.data)&&o.utils.updateMetadata.call(o))})}overrideData(t,e){e.data=t,e.utils.isNetJSON(e.data)||e.leaflet.geoJSON.removeFrom(e.leaflet),e.utils.render(),e.config.afterUpdate.call(e)}},WT=class{constructor(t){this.utils=new HT,this.config=this.utils.deepCopy(NT),this.config.crs=NT.crs,this.JSONParam=this.utils.isArray(t)?t:[t]}setConfig(t){if(this.utils.deepMergeObj(this.config,t),this.el)t&&t.el&&console.error("Can't change el again!");else if(this.el=this.config.el?this.utils.isElement(this.config.el)?this.config.el:document.querySelector(this.config.el):document.body,this.el){if(this.el.classList.add("njg-container"),this.el===document.body){const t=document.documentElement;t.style.width="100%",t.style.height="100%",this.el.classList.add("njg-relativePosition")}}else console.error("NetJSONGraph: The specified element for rendering was not found and could not be set.");return this.config}render(){const[t,...e]=this.JSONParam;this.config.onRender.call(this);const n=new Promise(t=>{this.event.once("onReady",async()=>{try{await this.config.onReady.call(this)}catch(t){console.error("onReady callback failed:",t)}t()})});if(this.event.once("onLoad",this.config.onLoad.bind(this)),this.event.once("applyUrlFragmentState",async()=>{await n,this.utils.applyUrlFragmentState.call(this,this)}),this.utils.paginatedDataParse.call(this,t).then(t=>{if(this.utils.isNetJSON(t))this.type="netjson";else{if(!this.utils.isGeoJSON(t))throw new Error("Invalid data format!");this.type="geojson",this.originalGeoJSON=this.utils.fastDeepCopy(t),t=this.utils.geojsonToNetjson(t)}if(this.utils.isNetJSON(t)){t.nodes.length>this.config.maxPointsFetched&&(this.hasMoreData=!0),t.nodes.splice(this.config.maxPointsFetched-1,t.nodes.length-this.config.maxPointsFetched);const e=new Set;this.nodeLinkIndex={},t.nodes.forEach(t=>{e.add(t.id),this.nodeLinkIndex[t.id]=t}),t.links=t.links.filter(t=>e.has(t.source)&&e.has(t.target)?(this.nodeLinkIndex[`${t.source}~${t.target}`]=t,!0):(e.has(t.source)?console.warn(`Node ${t.target} does not exist!`):console.warn(`Node ${t.source} does not exist!`),!1))}this.config.prepareData.call(this,t),this.data=t,this.config.dealDataByWorker?this.utils.dealDataByWorker.call(this,t,this.config.dealDataByWorker):(this.data=t,this.utils.render())}).catch(t=>{console.error(t)}),e.length){const n=function(){e.map(t=>this.utils.JSONDataUpdate.call(this,t,!1))};this.JSONParam=[t],this.event.once("renderArray",n.bind(this))}}setUtils(t={}){const e=this;return e.utils=Object.assign(e.utils,{...t},{render(){if(!e.config.render)throw new Error("No render function!");e.config.render(e.data,e)}}),"function"==typeof e.utils.moveNodeInRealTime&&(e.utils.moveNodeInRealTime=e.utils.moveNodeInRealTime.bind(e)),e.utils}};var jT,GT={},UT=[],YT={registerPreprocessor:cl,registerProcessor:dl,registerPostInit:function(t){pl("afterinit",t)},registerPostUpdate:function(t){pl("afterupdate",t)},registerUpdateLifecycle:pl,registerAction:fl,registerCoordinateSystem:gl,registerLayout:function(t,e){yl(IT,t,e,1e3,"layout")},registerVisual:ml,registerTransform:function(t){var e=(t=o(t)).type;e||Ir("");var n=e.split(":");2!==n.length&&Ir("");var i=!1;"echarts"===n[0]&&(e=n[1],i=!0),t.__isBuiltIn=i,ow.set(e,t)},registerLoading:vl,registerMap:function(t,e,n){var i=lT.registerMap;i&&i(t,e,n)},registerImpl:function(t,e){lT[t]=e},PRIORITY:cT,ComponentModel:W_,ComponentView:ww,SeriesModel:_w,ChartView:Kb,registerComponentModel:function(t){W_.registerClass(t)},registerComponentView:function(t){ww.registerClass(t)},registerSeriesModel:function(t){_w.registerClass(t)},registerChartView:function(t){Kb.registerClass(t)},registerCustomSeries:function(t,e){!function(t,e){GT[t]=e}(t,e)},registerSubTypeDefaulter:function(t,e){W_.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){Bm[t]=e}},XT=cb.prototype,qT=gb.prototype,KT=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};e(function(){return null!==jT&&jT.apply(this,arguments)||this},jT=KT);const $T=function(t){function n(e){var n=t.call(this,e)||this;return n.type="ec-line",n}return e(n,t),n.prototype.getDefaultStyle=function(){return{stroke:X_.color.neutral99,fill:null}},n.prototype.getDefaultShape=function(){return new KT},n.prototype.buildPath=function(t,e){kl(e)?XT.buildPath.call(this,t,e):qT.buildPath.call(this,t,e)},n.prototype.pointAt=function(t){return kl(this.shape)?XT.pointAt.call(this,t):qT.pointAt.call(this,t)},n.prototype.tangentAt=function(t){var e=this.shape,n=kl(e)?[e.x2-e.x1,e.y2-e.y1]:qT.tangentAt.call(this,t);return Q(n,n)},n}(ov);var JT=["fromSymbol","toSymbol"],QT=function(t){function n(e,n,i){var o=t.call(this)||this;return o._createLine(e,n,i),o}return e(n,t),n.prototype._createLine=function(t,e,n){var i=t.hostModel,o=t.getItemLayout(e),r=t.getItemVisual(e,"z2"),a=function(t){var e=new $T({name:"line",subPixelOptimize:!0});return Dl(e.shape,t),e}(o);a.shape.percent=0,La(a,{z2:L(r,0),shape:{percent:1}},i,e),this.add(a),c(JT,function(n){var i=Pl(n,t,e);this.add(i),this[Il(n)]=Ll(n,t,e)},this),this._updateCommonStl(t,e,n)},n.prototype.updateData=function(t,e,n){var i=t.hostModel,o=this.childOfName("line"),r=t.getItemLayout(e),a={shape:{}};Dl(a.shape,r),Ia(o,a,i,e),c(JT,function(n){var i=Ll(n,t,e),o=Il(n);if(this[o]!==i){this.remove(this.childOfName(n));var r=Pl(n,t,e);this.add(r)}this[o]=i},this),this._updateCommonStl(t,e,n)},n.prototype.getLinePath=function(){return this.childAt(0)},n.prototype._updateCommonStl=function(t,e,n){var i=t.hostModel,o=this.childOfName("line"),r=n&&n.emphasisLineStyle,a=n&&n.blurLineStyle,s=n&&n.selectLineStyle,l=n&&n.labelStatesModels,u=n&&n.emphasisDisabled,h=n&&n.focus,d=n&&n.blurScope;if(!n||t.hasItemOption){var p=t.getItemModel(e),f=p.getModel("emphasis");r=f.getModel("lineStyle").getLineStyle(),a=p.getModel(["blur","lineStyle"]).getLineStyle(),s=p.getModel(["select","lineStyle"]).getLineStyle(),u=f.get("disabled"),h=f.get("focus"),d=f.get("blurScope"),l=ho(p)}var g=t.getItemVisual(e,"style"),m=g.stroke;o.useStyle(g),o.style.fill=null,o.style.strokeNoScale=!0,o.ensureState("emphasis").style=r,o.ensureState("blur").style=a,o.ensureState("select").style=s,c(JT,function(t){var e=this.childOfName(t);if(e){e.setColor(m),e.style.opacity=g.opacity;for(var n=0;n0&&(_[0]=-_[0],_[1]=-_[1]);var w=v[0]<0?-1:1;if("start"!==o.__position&&"end"!==o.__position){var b=-Math.atan2(v[1],v[0]);h[0].8?"left":c[0]<-.8?"right":"center",p=c[1]>.8?"top":c[1]<-.8?"bottom":"middle";break;case"start":o.x=-c[0]*g+u[0],o.y=-c[1]*m+u[1],d=c[0]>.8?"right":c[0]<-.8?"left":"center",p=c[1]>.8?"bottom":c[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":o.x=g*w+u[0],o.y=u[1]+S,d=v[0]<0?"right":"left",o.originX=-g*w,o.originY=-S;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":o.x=x[0],o.y=x[1]+S,d="center",o.originY=-S;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":o.x=-g*w+h[0],o.y=h[1]+S,d=v[0]>=0?"right":"left",o.originX=g*w,o.originY=-S}o.scaleX=o.scaleY=r,o.setStyle({verticalAlign:o.__verticalAlign||p,align:o.__align||d})}}}},n}(Em);const tM=QT,eM=function(){function t(t){this.group=new Em,this._LineCtor=t||tM}return t.prototype.updateData=function(t){var e=this;this._progressiveEls=null;var n=this,i=n.group,o=n._lineData;n._lineData=t,o||i.removeAll();var r=Al(t);t.diff(o).add(function(n){e._doAdd(t,n,r)}).update(function(n,i){e._doUpdate(o,t,i,n,r)}).remove(function(t){i.remove(o.getItemGraphicEl(t))}).execute()},t.prototype.updateLayout=function(){var t=this._lineData;t&&t.eachItemGraphicEl(function(e,n){e.updateLayout(t,n)},this)},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=Al(t),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e){function n(t){t.isGroup||function(t){return t.animators&&t.animators.length>0}(t)||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var i=t.start;i0&&(r=this._getLineLength(i)/l*1e3),r!==this._period||a!==this._loop||s!==this._roundTrip){i.stopAnimation();var h=void 0;h=v(u)?u(n):u,i.__t>0&&(h=-r*i.__t),this._animateSymbol(i,r,h,a,s)}this._period=r,this._loop=a,this._roundTrip=s}},n.prototype._animateSymbol=function(t,e,n,i,o){if(e>0){t.__t=0;var r=this,a=t.animate("",i).when(o?2*e:e,{__t:o?2:1}).delay(n).during(function(){r._updateSymbolPosition(t)});i||a.done(function(){r.remove(t)}),a.start()}},n.prototype._getLineLength=function(t){return Cf(t.__p1,t.__cp1)+Cf(t.__cp1,t.__p2)},n.prototype._updateAnimationPoints=function(t,e){t.__p1=e[0],t.__p2=e[1],t.__cp1=e[2]||[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]},n.prototype.updateData=function(t,e,n){this.childAt(0).updateData(t,e,n),this._updateEffectSymbol(t,e)},n.prototype._updateSymbolPosition=function(t){var e=t.__p1,n=t.__p2,i=t.__cp1,o=t.__t<1?t.__t:2-t.__t,r=[t.x,t.y],a=r.slice(),s=jt,l=Gt;r[0]=s(e[0],i[0],n[0],o),r[1]=s(e[1],i[1],n[1],o);var u=t.__t<1?l(e[0],i[0],n[0],o):l(n[0],i[0],e[0],1-o),h=t.__t<1?l(e[1],i[1],n[1],o):l(n[1],i[1],e[1],1-o);t.rotation=-Math.atan2(h,u)-Math.PI/2,"line"!==this._symbolType&&"rect"!==this._symbolType&&"roundRect"!==this._symbolType||(void 0!==t.__lastT&&t.__lastT=0&&!(i[r]<=e);r--);r=Math.min(r,o-2)}else{for(r=a;re);r++);r=Math.min(r-1,o-2)}var s=(e-i[r])/(i[r+1]-i[r]),l=n[r],u=n[r+1];t.x=l[0]*(1-s)+s*u[0],t.y=l[1]*(1-s)+s*u[1],t.rotation=-Math.atan2(t.__t<1?u[1]-l[1]:l[1]-u[1],t.__t<1?u[0]-l[0]:l[0]-u[0])-Math.PI/2,this._lastFrame=r,this._lastFramePercent=e,t.ignore=!1}},n}(iM);const sM=aM;var lM=function(){this.polyline=!1,this.curveness=0,this.segs=[]},uM=function(t){function n(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return e(n,t),n.prototype.reset=function(){this.notClear=!1,this._off=0},n.prototype.getDefaultStyle=function(){return{stroke:X_.color.neutral99,fill:null}},n.prototype.getDefaultShape=function(){return new lM},n.prototype.buildPath=function(t,e){var n,i=e.segs,o=e.curveness;if(e.polyline)for(n=this._off;n0){t.moveTo(i[n++],i[n++]);for(var a=1;a0?t.quadraticCurveTo((s+u)/2-(l-h)*o,(l+h)/2-(u-s)*o,u,h):t.lineTo(u,h)}this.incremental&&(this._off=n,this.notClear=!0)},n.prototype.findDataIndex=function(t,e){var n=this.shape,i=n.segs,o=n.curveness,r=this.style.lineWidth;if(n.polyline)for(var a=0,s=0;s0)for(var u=i[s++],h=i[s++],c=1;c0){if(ui(u,h,(u+d)/2-(h-p)*o,(h+p)/2-(d-u)*o,d,p,r,t,e))return a}else if(si(u,h,d,p,r,t,e))return a;a++}return-1},n.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e);return this.getBoundingRect().contain(t=n[0],e=n[1])?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},n.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape.segs,n=1/0,i=1/0,o=-1/0,r=-1/0,a=0;a0&&(r.dataIndex=n+t.__startIndex)})},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}();var cM={seriesType:"lines",plan:ma(),reset:function(t){var e=t.coordinateSystem;if(e){var n=t.get("polyline"),i=t.pipelineContext.large;return{progress:function(o,r){var a=[];if(i){var s=void 0,l=o.end-o.start;if(n){for(var u=0,h=o.start;h0&&(l||s.configLayer(r,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(a/10+.9,1),0)})),o.updateData(i);var u=t.get("clip",!0)&&function(t,e,n){return t?"polar"===t.type?function(t){var e=t.getArea(),n=rn(e.r0,1),i=rn(e.r,1),o=new Jw({shape:{cx:rn(t.cx,1),cy:rn(t.cy,1),r0:n,r:i,startAngle:e.startAngle,endAngle:e.endAngle,clockwise:e.clockwise}});return o}(t):"cartesian2d"===t.type?function(t,e,n){var i=t.getArea(),o=i.x,r=i.y,a=i.width,s=i.height,l=n.get(["lineStyle","width"])||0;o-=l/2,r-=l/2,a+=l,s+=l,a=Math.ceil(a),o!==Math.floor(o)&&(o=Math.floor(o),a++);var u=new mv({shape:{x:o,y:r,width:a,height:s}});return u}(t,0,n):null:null}(t.coordinateSystem,0,t);u?this.group.setClipPath(u):this.group.removeClipPath(),this._lastZlevel=r,this._finished=!0},n.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData();this._updateLineDraw(i,t).incrementalPrepareUpdate(i),this._clearLayer(n),this._finished=!1},n.prototype.incrementalRender=function(t,e,n){this._lineDraw.incrementalUpdate(t,e.getData()),this._finished=t.end===e.getData().count()},n.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},n.prototype.updateTransform=function(t,e,n){var i=t.getData(),o=t.pipelineContext;if(!this._finished||o.large||o.progressiveRender)return{update:!0};var r=dM.reset(t,e,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),this._lineDraw.updateLayout(),this._clearLayer(n)},n.prototype._updateLineDraw=function(t,e){var n=this._lineDraw,i=this._showEffect(e),o=!!e.get("polyline"),r=e.pipelineContext.large;return n&&i===this._hasEffet&&o===this._isPolyline&&r===this._isLargeDraw||(n&&n.remove(),n=this._lineDraw=r?new hM:new eM(o?i?sM:rM:i?iM:tM),this._hasEffet=i,this._isPolyline=o,this._isLargeDraw=r),this.group.add(n.group),n},n.prototype._showEffect=function(t){return!!t.get(["effect","show"])},n.prototype._clearLayer=function(t){var e=t.getZr();"svg"===e.painter.getType()||null==this._lastZlevel||e.painter.getLayer(this._lastZlevel).clear(!0)},n.prototype.remove=function(t,e){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(e)},n.prototype.dispose=function(t,e){this.remove(t,e)},n.type="lines",n}(Kb);var fM=function(){function t(t,e,n,i,o,r){this._old=t,this._new=e,this._oldKeyGetter=n||Rl,this._newKeyGetter=i||Rl,this.context=o,this._diffModeMultiple="multiple"===r}return t.prototype.add=function(t){return this._add=t,this},t.prototype.update=function(t){return this._update=t,this},t.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},t.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},t.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},t.prototype.remove=function(t){return this._remove=t,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var t=this._old,e=this._new,n={},i=new Array(t.length),o=new Array(e.length);this._initIndexMap(t,null,i,"_oldKeyGetter"),this._initIndexMap(e,n,o,"_newKeyGetter");for(var r=0;r1){var u=s.shift();1===s.length&&(n[a]=s[0]),this._update&&this._update(u,r)}else 1===l?(n[a]=null,this._update&&this._update(s,r)):this._remove&&this._remove(r)}this._performRestAdd(o,n)},t.prototype._executeMultiple=function(){var t=this._new,e={},n={},i=[],o=[];this._initIndexMap(this._old,e,i,"_oldKeyGetter"),this._initIndexMap(t,n,o,"_newKeyGetter");for(var r=0;r1&&1===h)this._updateManyToOne&&this._updateManyToOne(l,s),n[a]=null;else if(1===u&&h>1)this._updateOneToMany&&this._updateOneToMany(l,s),n[a]=null;else if(1===u&&1===h)this._update&&this._update(l,s),n[a]=null;else if(u>1&&h>1)this._updateManyToMany&&this._updateManyToMany(l,s),n[a]=null;else if(u>1)for(var c=0;c1)for(var a=0;a=e)){var n=this._store.getProvider();this._updateOrdinalMeta();var i=this._nameList,o=this._idList;if(n.getSource().sourceFormat===ox&&!n.pure)for(var r=[],a=t;a0},t.prototype.ensureUniqueItemVisual=function(t,e){var n=this._itemVisuals,i=n[t];i||(i=n[t]={});var o=i[e];return null==o&&(y(o=this.getVisual(e))?o=o.slice():IM(o)&&(o=a({},o)),i[e]=o),o},t.prototype.setItemVisual=function(t,e,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,IM(e)?a(i,e):i[e]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(t,e){IM(t)?a(this._layout,t):this._layout[t]=e},t.prototype.getLayout=function(t){return this._layout[t]},t.prototype.getItemLayout=function(t){return this._itemLayouts[t]},t.prototype.setItemLayout=function(t,e,n){this._itemLayouts[t]=n?a(this._itemLayouts[t]||{},e):e},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(t,e){!function(t,e,n,i){if(i){var o=Mv(i);o.dataIndex=n,o.dataType=e,o.seriesIndex=t,o.ssrType="chart","group"===i.type&&i.traverse(function(i){var o=Mv(i);o.seriesIndex=t,o.dataIndex=n,o.dataType=e,o.ssrType="chart"})}}(this.hostModel&&this.hostModel.seriesIndex,this.dataType,t,e),this._graphicEls[t]=e},t.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},t.prototype.eachItemGraphicEl=function(t,e){c(this._graphicEls,function(n,i){n&&t&&t.call(e,n,i)})},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:LM(this.dimensions,this._getDimInfo,this),this.hostModel)),bM(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(t,e){var n=this[t];v(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=n.apply(this,arguments);return e.apply(this,[t].concat(D(arguments)))})},t.internalField=(vM=function(t){var e=t._invertedIndicesMap;c(e,function(n,i){var o=t._dimInfos[i],r=o.ordinalMeta,a=t._store;if(r){n=e[i]=new PM(r.categories.length);for(var s=0;s1&&(s+="__ec__"+u),i[e]=s}})),t}();const zM=OM;var EM="undefined"==typeof Uint32Array?Array:Uint32Array,RM="undefined"==typeof Float64Array?Array:Float64Array,BM=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.visualStyleAccessPath="lineStyle",e.visualDrawType="stroke",e}return e(n,t),n.prototype.init=function(e){e.data=e.data||[],Hl(e);var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count)),t.prototype.init.apply(this,arguments)},n.prototype.mergeOption=function(e){if(Hl(e),e.data){var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count))}t.prototype.mergeOption.apply(this,arguments)},n.prototype.appendData=function(t){var e=this._processFlatCoordsArray(t.data);e.flatCoords&&(this._flatCoords?(this._flatCoords=N(this._flatCoords,e.flatCoords),this._flatCoordsOffset=N(this._flatCoordsOffset,e.flatCoordsOffset)):(this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset),t.data=new Float32Array(e.count)),this.getRawData().appendData(t.data)},n.prototype._getCoordsFromItemModel=function(t){var e=this.getData().getItemModel(t);return e.option instanceof Array?e.option:e.getShallow("coords")},n.prototype.getLineCoordsCount=function(t){return this._flatCoordsOffset?this._flatCoordsOffset[2*t+1]:this._getCoordsFromItemModel(t).length},n.prototype.getLineCoords=function(t,e){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*t],i=this._flatCoordsOffset[2*t+1],o=0;o ")})},n.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},n.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},n.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},n.prototype.getZLevelKey=function(){var t=this.getModel("effect"),e=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&e>0?e+"":""},n.type="series.lines",n.dependencies=["grid","polar","geo","calendar"],n.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}},n}(_w);const NM=BM,FM={seriesType:"lines",reset:function(t){var e=Wl(t.get("symbol")),n=Wl(t.get("symbolSize")),i=t.getData();return i.setVisual("fromSymbol",e&&e[0]),i.setVisual("toSymbol",e&&e[1]),i.setVisual("fromSymbolSize",n&&n[0]),i.setVisual("toSymbolSize",n&&n[1]),{dataEach:i.hasItemOption?function(t,e){var n=t.getItemModel(e),i=Wl(n.getShallow("symbol",!0)),o=Wl(n.getShallow("symbolSize",!0));i[0]&&t.setItemVisual(e,"fromSymbol",i[0]),i[1]&&t.setItemVisual(e,"toSymbol",i[1]),o[0]&&t.setItemVisual(e,"fromSymbolSize",o[0]),o[1]&&t.setItemVisual(e,"toSymbolSize",o[1])}:null}}};var VM="--\x3e",ZM=function(t){return t.get("autoCurveness")||null},HM=function(t,e){var n=ZM(t),i=20,o=[];if(w(n))i=n;else if(y(n))return void(t.__curvenessList=n);e>i&&(i=e);var r=i%2?i+2:i+3;o=[];for(var a=0;a0?+p:1;k.scaleX=this._sizeX*I,k.scaleY=this._sizeY*I,this.setSymbolScale(1),io(this,u,h,c)},n.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},n.prototype.fadeOut=function(t,e,n){var i=this.childAt(0),o=Mv(this).dataIndex,r=n&&n.animation;if(this.silent=i.silent=!0,n&&n.fadeLabel){var a=i.getTextContent();a&&Da(a,{style:{opacity:0}},e,{dataIndex:o,removeOpt:r,cb:function(){i.removeTextContent()}})}else i.removeTextContent();Da(i,{style:{opacity:0},scaleX:0,scaleY:0},e,{dataIndex:o,cb:t,removeOpt:r})},n.getSymbolSize=function(t,e){return Rs(t.getItemVisual(e,"symbolSize"))},n.getSymbolZ2=function(t,e){return t.getItemVisual(e,"z2")},n}(Em);const tC=QM;var eC=function(){function t(t){this.group=new Em,this._SymbolCtor=t||tC}return t.prototype.updateData=function(t,e){this._progressiveEls=null,e=cu(e);var n=this.group,i=t.hostModel,o=this._data,r=this._SymbolCtor,a=e.disableAnimation,s=du(t),l={disableAnimation:a},u=e.getSymbolPoint||function(e){return t.getItemLayout(e)};o||n.removeAll(),t.diff(o).add(function(i){var o=u(i);if(hu(t,o,i,e)){var a=new r(t,i,s,l);a.setPosition(o),t.setItemGraphicEl(i,a),n.add(a)}}).update(function(h,c){var d=o.getItemGraphicEl(c),p=u(h);if(hu(t,p,h,e)){var f=t.getItemVisual(h,"symbol")||"circle",g=d&&d.getSymbolType&&d.getSymbolType();if(!d||g&&g!==f)n.remove(d),(d=new r(t,h,s,l)).setPosition(p);else{d.updateData(t,h,s,l);var m={x:p[0],y:p[1]};a?d.attr(m):Ia(d,m,i)}n.add(d),t.setItemGraphicEl(h,d)}else n.remove(d)}).remove(function(t){var e=o.getItemGraphicEl(t);e&&e.fadeOut(function(){n.remove(e)},i)}).execute(),this._getSymbolPoint=u,this._data=t},t.prototype.updateLayout=function(){var t=this,e=this._data;e&&e.eachItemGraphicEl(function(e,n){var i=t._getSymbolPoint(n);e.setPosition(i),e.markRedraw()})},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=du(t),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e,n){function i(t){t.isGroup||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],n=cu(n);for(var o=t.start;o3?1.4:o>1?1.2:1.1;this._checkTriggerMoveZoom(this,"zoom","zoomOnMouseWheel",t,{scale:i>0?s:1/s,originX:r,originY:a,isAvailableBehavior:null})}if(n){var l=Math.abs(i);this._checkTriggerMoveZoom(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:(i>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:r,originY:a,isAvailableBehavior:null})}}}},n.prototype._pinchHandler=function(t){pu(this._zr,"globalPan")||gu(t)||this._checkTriggerMoveZoom(this,"zoom",null,t,{scale:t.pinchScale>1?1.1:1/1.1,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})},n.prototype._checkTriggerMoveZoom=function(t,e,n,i,o){t._checkPointer(i,o.originX,o.originY)&&(Zf(i.event),i.__ecRoamConsumed=!0,xu(t,e,n,i,o))},n}(Af),aC=Ln();const sC=rC;var lC=[],uC=[],hC=[],cC=jt,dC=kf,pC=Math.abs,fC=Ln(),gC=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.init=function(t,e){var n=new nC,i=new eM,o=this.group,r=new Em;this._controller=new sC(e.getZr()),this._controllerHost={target:r},r.add(n.group),r.add(i.group),o.add(r),this._symbolDraw=n,this._lineDraw=i,this._mainGroup=r,this._firstRender=!0},n.prototype.render=function(t,e,n){var i=this,o=t.coordinateSystem,r=!1;this._model=t,this._api=n,this._active=!0;var a=this._getThumbnailInfo();a&&a.bridge.reset(n);var s=this._symbolDraw,l=this._lineDraw;if(Tu(o)){var u={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?this._mainGroup.attr(u):Ia(this._mainGroup,u,t)}Su(t.getGraph(),Jl(t));var h=t.getData();s.updateData(h);var c=t.getEdgeData();l.updateData(c),this._updateNodeAndLinkScale(),this._updateController(null,t,n),clearTimeout(this._layoutTimeout);var d=t.forceLayout,p=t.get(["force","layoutAnimation"]);d&&(r=!0,this._startForceLayoutIteration(d,n,p));var f=t.get("layout");h.graph.eachNode(function(e){var o=e.dataIndex,r=e.getGraphicEl(),a=e.getModel();if(r){r.off("drag").off("dragend");var s=a.get("draggable");s&&r.on("drag",function(a){switch(f){case"force":d.warmUp(),!i._layouting&&i._startForceLayoutIteration(d,n,p),d.setFixed(o),h.setItemLayout(o,[r.x,r.y]);break;case"circular":h.setItemLayout(o,[r.x,r.y]),e.setLayout({fixed:!0},!0),tu(t,"symbolSize",e,[a.offsetX,a.offsetY]),i.updateLayout(t);break;default:h.setItemLayout(o,[r.x,r.y]),Kl(t.getGraph(),t),i.updateLayout(t)}}).on("dragend",function(){d&&d.setUnfixed(o)}),r.setDraggable(s,!!a.get("cursor")),"adjacency"===a.get(["emphasis","focus"])&&(Mv(r).focus=e.getAdjacentDataIndices())}}),h.graph.eachEdge(function(t){var e=t.getGraphicEl(),n=t.getModel().get(["emphasis","focus"]);e&&"adjacency"===n&&(Mv(e).focus={edge:[t.dataIndex],node:[t.node1.dataIndex,t.node2.dataIndex]})});var g="circular"===t.get("layout")&&t.get(["circular","rotateLabel"]),m=h.getLayout("cx"),y=h.getLayout("cy");h.graph.eachNode(function(t){eu(t,g,m,y)}),this._firstRender=!1,r||this._renderThumbnail(t,n,this._symbolDraw,this._lineDraw)},n.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},n.prototype._startForceLayoutIteration=function(t,e,n){var i=this,o=!1;!function r(){t.step(function(t){i.updateLayout(i._model),!t&&o||(o=!0,i._renderThumbnail(i._model,e,i._symbolDraw,i._lineDraw)),(i._layouting=!t)&&(n?i._layoutTimeout=setTimeout(r,16):r())})}()},n.prototype._updateController=function(t,e,n){var i=this._controller,o=this._controllerHost,r=e.coordinateSystem;Tu(r)?(i.enable(e.get("roam"),{api:n,zInfo:{component:e},triggerInfo:{roamTrigger:e.get("roamTrigger"),isInSelf:function(t,e,n){return r.containPoint([e,n])},isInClip:function(e,n,i){return!t||t.contain(n,i)}}}),o.zoomLimit=e.get("scaleLimit"),o.zoom=r.getZoom(),i.off("pan").off("zoom").on("pan",function(t){n.dispatchAction({seriesId:e.id,type:"graphRoam",dx:t.dx,dy:t.dy})}).on("zoom",function(t){n.dispatchAction({seriesId:e.id,type:"graphRoam",zoom:t.scale,originX:t.originX,originY:t.originY})})):i.disable()},n.prototype.updateViewOnPan=function(t,e,n){this._active&&(function(t,e,n){var i=t.target;i.x+=e,i.y+=n,i.dirty()}(this._controllerHost,n.dx,n.dy),this._updateThumbnailWindow())},n.prototype.updateViewOnZoom=function(t,e,n){this._active&&(function(t,e,n,i){var o=t.target,r=t.zoomLimit,a=t.zoom=t.zoom||1,s=(a=au(a*=e,r))/t.zoom;t.zoom=a,ru(o,n,i,s),o.dirty()}(this._controllerHost,n.zoom,n.originX,n.originY),this._updateNodeAndLinkScale(),Su(t.getGraph(),Jl(t)),this._lineDraw.updateLayout(),e.updateLabelLayout(),this._updateThumbnailWindow())},n.prototype._updateNodeAndLinkScale=function(){var t=this._model,e=t.getData(),n=Jl(t);e.eachItemGraphicEl(function(t,e){t&&t.setSymbolScale(n)})},n.prototype.updateLayout=function(t){this._active&&(Su(t.getGraph(),Jl(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout())},n.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()},n.prototype._getThumbnailInfo=function(){var t=this._model,e=t.coordinateSystem;if("view"===e.type){var n=function(t){if(t)return fC(t).bridge}(t);if(n)return{bridge:n,coordSys:e}}},n.prototype._updateThumbnailWindow=function(){var t=this._getThumbnailInfo();t&&t.bridge.updateWindow(t.coordSys.transform,this._api)},n.prototype._renderThumbnail=function(t,e,n,i){var r=this._getThumbnailInfo();if(r){var s=new Em,l=n.group.children(),u=i.group.children(),h=new Em,c=new Em;s.add(c),s.add(h);for(var d=0;d=0&&t.call(e,n[o],o)},t.prototype.eachEdge=function(t,e){for(var n=this.edges,i=n.length,o=0;o=0&&n[o].node1.dataIndex>=0&&n[o].node2.dataIndex>=0&&t.call(e,n[o],o)},t.prototype.breadthFirstTraverse=function(t,e,n,i){if(e instanceof vC||(e=this._nodesMap[Mu(e)]),e){for(var o="out"===n?"outEdges":"in"===n?"inEdges":"edges",r=0;r=0&&n.node2.dataIndex>=0}),o=0,r=i.length;o=0&&!t.hasKey(p)&&(t.set(p,!0),r.push(d.node1))}for(s=0;s=0&&!t.hasKey(v)&&(t.set(v,!0),a.push(y.node2))}}}return{edge:t.keys(),node:e.keys()}},t}(),_C=function(){function t(t,e,n){this.dataIndex=-1,this.node1=t,this.node2=e,this.dataIndex=null==n?-1:n}return t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(t)},t.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},t.prototype.getTrajectoryDataIndices=function(){var t=B(),e=B();t.set(this.dataIndex,!0);for(var n=[this.node1],i=[this.node2],o=0;o=0&&!t.hasKey(u)&&(t.set(u,!0),n.push(l.node1))}for(o=0;o=0&&!t.hasKey(d)&&(t.set(d,!0),i.push(c.node2))}return{edge:t.keys(),node:e.keys()}},t}();u(vC,Cu("hostGraph","data")),u(_C,Cu("hostGraph","edgeData"));const xC=yC;var wC=Ln(),bC=function(t){this.coordSysDims=[],this.axisMap=B(),this.categoryAxisMap=B(),this.coordSysName=t},SC={cartesian2d:function(t,e,n,i){var o=t.getReferringComponents("xAxis",Km).models[0],r=t.getReferringComponents("yAxis",Km).models[0];e.coordSysDims=["x","y"],n.set("x",o),n.set("y",r),Ru(o)&&(i.set("x",o),e.firstCategoryDimIndex=0),Ru(r)&&(i.set("y",r),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,n,i){var o=t.getReferringComponents("singleAxis",Km).models[0];e.coordSysDims=["single"],n.set("single",o),Ru(o)&&(i.set("single",o),e.firstCategoryDimIndex=0)},polar:function(t,e,n,i){var o=t.getReferringComponents("polar",Km).models[0],r=o.findAxisModel("radiusAxis"),a=o.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],n.set("radius",r),n.set("angle",a),Ru(r)&&(i.set("radius",r),e.firstCategoryDimIndex=0),Ru(a)&&(i.set("angle",a),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},geo:function(t,e,n,i){e.coordSysDims=["lng","lat"]},parallel:function(t,e,n,i){var o=t.ecModel,r=o.getComponent("parallel",t.get("parallelIndex")),a=e.coordSysDims=r.dimensions.slice();c(r.parallelAxisIndex,function(t,r){var s=o.getComponent("parallelAxis",t),l=a[r];n.set(l,s),Ru(s)&&(i.set(l,s),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=r))})},matrix:function(t,e,n,i){var o=t.getReferringComponents("matrix",Km).models[0];e.coordSysDims=["x","y"];var r=o.getDimensionModel("x"),a=o.getDimensionModel("y");n.set("x",r),n.set("y",a),i.set("x",r),i.set("y",a)}};const TC=function(t,e,n){n=n||{};var i,o=e.getSourceManager(),r=!1;t?(r=!0,i=br(t)):r=(i=o.getSource()).sourceFormat===ox;var a=function(t){var e=t.get("coordinateSystem"),n=new bC(e),i=SC[e];if(i)return i(t,n,n.axisMap,n.categoryAxisMap),n}(e),s=function(t,e){var n,i=t.get("coordinateSystem"),o=E_.get(i);return e&&e.coordSysDims&&(n=d(e.coordSysDims,function(t){var n={name:t},i=e.axisMap.get(t);if(i){var o=i.get("type");n.type=function(t){return"category"===t?"ordinal":"time"===t?"time":"float"}(o)}return n})),n||(n=o&&(o.getDimensionsInfo?o.getDimensionsInfo():o.dimensions.slice())||["x","y"]),n}(e,a),l=n.useEncodeDefaulter,u=v(l)?l:l?m(tr,s,e):null,h=zu(i,{coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!r}),p=function(t,e,n){var i,o;return n&&c(t,function(t,r){var a=n.categoryAxisMap.get(t.coordDim);a&&(null==i&&(i=r),t.ordinalMeta=a.getOrdinalMeta(),e&&(t.createInvertedIndices=!0)),null!=t.otherDims.itemName&&(o=!0)}),o||null==i||(t[i].otherDims.itemName=0),i}(h.dimensions,n.createInvertedIndices,a),f=r?null:o.getSharedDataStore(h),g=function(t,e,n){var i,o,r,a=(n=n||{}).byIndex,s=n.stackedCoordDimension;!function(t){return!Nl(t.schema)}(e)?(i=(o=e.schema).dimensions,r=e.store):i=e;var l,u,h,d,p=!(!t||!t.get("stack"));if(c(i,function(t,e){_(t)&&(i[e]=t={name:t}),p&&!t.isExtraCoord&&(a||l||!t.ordinalMeta||(l=t),u||"ordinal"===t.type||"time"===t.type||s&&s!==t.coordDim||(u=t))}),!u||a||l||(a=!0),u){h="__\0ecstackresult_"+t.id,d="__\0ecstackedover_"+t.id,l&&(l.createInvertedIndices=!0);var f=u.coordDim,g=u.type,m=0;c(i,function(t){t.coordDim===f&&m++});var y={name:h,coordDim:f,coordDimIndex:m,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length},v={name:d,coordDim:d,coordDimIndex:m+1,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length+1};o?(r&&(y.storeDimIndex=r.ensureCalculationDimension(d,g),v.storeDimIndex=r.ensureCalculationDimension(h,g)),o.appendCalculationDimension(y),o.appendCalculationDimension(v)):(i.push(y),i.push(v))}return{stackedDimension:u&&u.name,stackedByDimension:l&&l.name,isStackedByIndex:a,stackedOverDimension:d,stackResultDimension:h}}(e,{schema:h,store:f}),x=new zM(h,e);x.setCalculationInfo(g);var w=null!=p&&function(t){if(t.sourceFormat===ox)return!y(xn(function(t){for(var e=0;e=0},t.prototype.indexOfName=function(t){return this._getDataWithEncodedVisual().indexOfName(t)},t.prototype.getItemVisual=function(t,e){return this._getDataWithEncodedVisual().getItemVisual(t,e)},t}();const CC=MC;var kC=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.hasSymbolVisual=!0,e}return e(n,t),n.prototype.init=function(e){function n(){return i._categoriesData}t.prototype.init.apply(this,arguments);var i=this;this.legendVisualProvider=new CC(n,n),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},n.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},n.prototype.mergeDefaultAndTheme=function(e){t.prototype.mergeDefaultAndTheme.apply(this,arguments),_n(e,"edgeLabel",["show"])},n.prototype.getInitialData=function(t,e){var n,i=t.edges||t.links||[],o=t.data||t.nodes||[],r=this;if(o&&i){ZM(n=this)&&(n.__curvenessList=[],n.__edgeMap={},HM(n));var a=function(t,e,n,i,o){for(var r=new xC(!0),a=0;a "+f)),h++)}var g,y=n.get("coordinateSystem");if("cartesian2d"===y||"polar"===y||"matrix"===y)g=TC(t,n);else{var v=E_.get(y),_=v&&v.dimensions||[];l(_,"value")<0&&_.concat(["value"]);var x=zu(t,{coordDimensions:_,encodeDefine:n.getEncode()}).dimensions;(g=new zM(x,n)).initData(t)}var w,b,S,T=new zM(["value"],n);return T.initData(u,s),o&&o(g,T),b=(w={mainData:g,struct:r,structAttr:"graph",datas:{node:g,edge:T},datasAttr:{node:"data",edge:"edgeData"}}).mainData,(S=w.datas)||(S={main:b},w.datasAttr={main:"data"}),w.datas=w.mainData=null,Au(b,S,w),c(S,function(t){c(b.TRANSFERABLE_METHODS,function(e){t.wrapMethod(e,m(ku,w))})}),b.wrapMethod("cloneShallow",m(Lu,w)),c(b.CHANGABLE_METHODS,function(t){b.wrapMethod(t,m(Iu,w))}),O(S[b.dataType]===b),r.update(),r}(o,i,this,0,function(t,e){function n(t,e){var n=o.call(this,t,e);return n.resolveParentPath=i,n}function i(t){if(t&&("label"===t[0]||"label"===t[1])){var e=t.slice();return"label"===t[0]?e[0]="edgeLabel":"label"===t[1]&&(e[1]="edgeLabel"),e}return t}t.wrapMethod("getItemModel",function(t){var e=r._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t});var o=i_.prototype.getModel;e.wrapMethod("getItemModel",function(t){return t.resolveParentPath=i,t.getModel=n,t})});return c(a.edges,function(t){!function(t,e,n,i){if(ZM(n)){var o=WM(t,e,n),r=n.__edgeMap,a=r[jM(o)];r[o]&&!a?r[o].isForward=!0:a&&r[o]&&(a.isForward=!0,r[o].isForward=!1),r[o]=r[o]||[],r[o].push(i)}}(t.node1,t.node2,this,t.dataIndex)},this),a.data}},n.prototype.getGraph=function(){return this.getData().graph},n.prototype.getEdgeData=function(){return this.getGraph().edgeData},n.prototype.getCategoriesData=function(){return this._categoriesData},n.prototype.formatTooltip=function(t,e,n){if("edge"===n){var i=this.getData(),o=this.getDataParams(t,n),r=i.graph.getEdgeByIndex(t),a=i.getName(r.node1.dataIndex),s=i.getName(r.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),$r("nameValue",{name:l.join(" > "),value:o.value,noValue:null==o.value})}return sa({series:this,dataIndex:t,multipleSeries:e})},n.prototype._updateCategoriesData=function(){var t=d(this.option.categories||[],function(t){return null!=t.value?t:a({value:0},t)}),e=new zM(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray(function(t){return e.getItemModel(t)})},n.prototype.setZoom=function(t){this.option.zoom=t},n.prototype.setCenter=function(t){this.option.center=t},n.prototype.isAnimationEnabled=function(){return t.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},n.type="series.graph",n.dependencies=["grid","polar","geo","singleAxis","calendar"],n.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:X_.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:X_.color.primary}}},n}(_w);const IC=kC,LC=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.hasSymbolVisual=!0,e}return e(n,t),n.prototype.getInitialData=function(t,e){return TC(null,this,{useEncodeDefaulter:!0})},n.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?5e3:this.get("progressive"):t},n.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?1e4:this.get("progressiveThreshold"):t},n.prototype.brushSelector=function(t,e,n){return n.point(e.getItemLayout(t))},n.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},n.type="series.scatter",n.dependencies=["grid","polar","geo","singleAxis","calendar","matrix"],n.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:X_.color.primary}},universalTransition:{divideShape:"clone"}},n}(_w);var PC=function(){},DC=function(t){function n(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return e(n,t),n.prototype.getDefaultShape=function(){return new PC},n.prototype.reset=function(){this.notClear=!1,this._off=0},n.prototype.buildPath=function(t,e){var n,i=e.points,o=e.size,r=this.symbolProxy,a=r.shape,s=t.getContext?t.getContext():t,l=this.softClipShape;if(s&&o[0]<4)this._ctx=s;else{for(this._ctx=null,n=this._off;n=0;s--){var l=2*s,u=i[l]-r/2,h=i[l+1]-a/2;if(t>=u&&e>=h&&t<=u+r&&e<=h+a)return s}return-1},n.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e);return this.getBoundingRect().contain(t=n[0],e=n[1])?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},n.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape,n=e.points,i=e.size,o=i[0],r=i[1],a=1/0,s=1/0,l=-1/0,u=-1/0,h=0;h=0&&(l.dataIndex=n+(t.startIndex||0))})},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}();const OC=AC;var zC="undefined"!=typeof Float32Array,EC=zC?Float32Array:Array;const RC=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){var i=t.getData();this._updateSymbolDraw(i,t).updateData(i,{clipShape:this._getClipShape(t)}),this._finished=!0},n.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData();this._updateSymbolDraw(i,t).incrementalPrepareUpdate(i),this._finished=!1},n.prototype.incrementalRender=function(t,e,n){this._symbolDraw.incrementalUpdate(t,e.getData(),{clipShape:this._getClipShape(e)}),this._finished=t.end===e.getData().count()},n.prototype.updateTransform=function(t,e,n){var i=t.getData();if(this.group.dirty(),!this._finished||i.count()>1e4)return{update:!0};var o=Nu("").reset(t,e,n);o.progress&&o.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout(i)},n.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},n.prototype._getClipShape=function(t){if(t.get("clip",!0)){var e=t.coordinateSystem;return e&&e.getArea&&e.getArea(.1)}},n.prototype._updateSymbolDraw=function(t,e){var n=this._symbolDraw,i=e.pipelineContext.large;return n&&i===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=i?new OC:new nC,this._isLargeDraw=i,this.group.removeAll()),this.group.add(n.group),n},n.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},n.prototype.dispose=function(){},n.type="scatter",n}(Kb);var BC={left:0,right:0,top:0,bottom:0},NC=["25%","25%"];const FC=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.mergeDefaultAndTheme=function(e,n){var i=Jo(e.outerBounds);t.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&e.outerBounds&&$o(e.outerBounds,i)},n.prototype.mergeOption=function(e,n){t.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&e.outerBounds&&$o(this.option.outerBounds,e.outerBounds)},n.type="grid",n.dependencies=["xAxis","yAxis"],n.layoutMode="box",n.defaultOption={show:!1,z:0,left:"15%",top:65,right:"10%",bottom:80,containLabel:!1,outerBoundsMode:"auto",outerBounds:BC,outerBoundsContain:"all",outerBoundsClampWidth:NC[0],outerBoundsClampHeight:NC[1],backgroundColor:X_.color.transparent,borderWidth:1,borderColor:X_.color.neutral30},n}(W_);var VC=function(){function t(){}return t.prototype.getNeedCrossZero=function(){return!this.option.scale},t.prototype.getCoordSysModel=function(){},t}(),ZC=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Km).models[0]},n.type="cartesian2dAxis",n}(W_);u(ZC,VC);var HC={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:X_.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:X_.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:X_.color.axisSplitLine,width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:[X_.color.backgroundTint,X_.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:X_.color.neutral00,borderColor:X_.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:"auto"}},WC=r({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},HC),jC=r({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:X_.color.axisMinorSplitLine,width:1}}},HC);const GC={category:WC,value:jC,time:r({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},jC),log:s({logBase:10},jC)};var UC=0;const YC=function(){function t(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++UC,this._onCollect=t.onCollect}return t.createByAxisModel=function(e){var n=e.option,i=n.data,o=i&&d(i,Fu);return new t({categories:o,needCollect:!o,deduplication:!1!==n.dedplication})},t.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},t.prototype.parseAndCollect=function(t){var e,n=this._needCollect;if(!_(t)&&!n)return t;if(n&&!this._deduplication)return this.categories[e=this.categories.length]=t,this._onCollect&&this._onCollect(t,e),e;var i=this._getOrCreateMap();return null==(e=i.get(t))&&(n?(this.categories[e=this.categories.length]=t,i.set(t,e),this._onCollect&&this._onCollect(t,e)):e=NaN),e},t.prototype._getOrCreateMap=function(){return this._map||(this._map=B(this.categories))},t}();var XC={value:1,category:1,time:1,log:1},qC=null,KC=function(){function t(){this.normalize=Xu,this.scale=qu}return t.prototype.updateMethods=function(t){t.hasBreaks()?(this.normalize=_f(t.normalize,t),this.scale=_f(t.scale,t)):(this.normalize=Xu,this.scale=qu)},t}(),$C=function(){function t(t){this._calculator=new KC,this._setting=t||{},this._extent=[1/0,-1/0];var e=vo();e&&(this._brkCtx=e.createScaleBreakContext(),this._brkCtx.update(this._extent))}return t.prototype.getSetting=function(t){return this._setting[t]},t.prototype._innerUnionExtent=function(t){var e=this._extent;this._innerSetExtent(t[0]e[1]?t[1]:e[1])},t.prototype.unionExtentFromData=function(t,e){this._innerUnionExtent(t.getApproximateExtent(e))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(t,e){this._innerSetExtent(t,e)},t.prototype._innerSetExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e),this._brkCtx&&this._brkCtx.update(n)},t.prototype.setBreaksFromOption=function(t){var e=vo();e&&this._innerSetBreak(e.parseAxisBreakOption(t,_f(this.parse,this)))},t.prototype._innerSetBreak=function(t){this._brkCtx&&(this._brkCtx.setBreaks(t),this._calculator.updateMethods(this._brkCtx),this._brkCtx.update(this._extent))},t.prototype._innerGetBreaks=function(){return this._brkCtx?this._brkCtx.breaks:[]},t.prototype.hasBreaks=function(){return!!this._brkCtx&&this._brkCtx.hasBreaks()},t.prototype._getExtentSpanWithBreaks=function(){return this._brkCtx&&this._brkCtx.hasBreaks()?this._brkCtx.getExtentSpan():this._extent[1]-this._extent[0]},t.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(t){this._isBlank=t},t}();Fn($C);const JC=$C;var QC=function(t){function n(e){var n=t.call(this,e)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new YC({})),y(i)&&(i=new YC({categories:d(i,function(t){return b(t)?t.value:t})})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return e(n,t),n.prototype.parse=function(t){return null==t?NaN:_(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},n.prototype.contain=function(t){return Yu(t,this._extent)&&t>=0&&t=0&&t=0&&t=t},n.prototype.getOrdinalMeta=function(){return this._ordinalMeta},n.prototype.calcNiceTicks=function(){},n.prototype.calcNiceExtent=function(){},n.type="ordinal",n}(JC);JC.registerClass(QC);const tk=QC;var ek=rn,nk=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="interval",e._interval=0,e._intervalPrecision=2,e}return e(n,t),n.prototype.parse=function(t){return null==t||""===t?NaN:Number(t)},n.prototype.contain=function(t){return Yu(t,this._extent)},n.prototype.normalize=function(t){return this._calculator.normalize(t,this._extent)},n.prototype.scale=function(t){return this._calculator.scale(t,this._extent)},n.prototype.getInterval=function(){return this._interval},n.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=Gu(t)},n.prototype.getTicks=function(t){t=t||{};var e=this._interval,n=this._extent,i=this._niceExtent,o=this._intervalPrecision,r=vo(),a=[];if(!e)return a;if("only_break"===t.breakTicks&&r)return r.addBreaksToTicks(a,this._brkCtx.breaks,this._extent),a;n[0]=0&&(l=ek(l+u*e,o))}if(a.length>0&&l===a[a.length-1].value)break;if(a.length>1e4)return[]}var h=a.length?a[a.length-1].value:i[1];return n[1]>h&&a.push(t.expandToNicedExtent?{value:ek(h+e,o)}:{value:n[1]}),r&&r.pruneTicksByBreak(t.pruneByBreak,a,this._brkCtx.breaks,function(t){return t.value},this._interval,this._extent),"none"!==t.breakTicks&&r&&r.addBreaksToTicks(a,this._brkCtx.breaks,this._extent),a},n.prototype.getMinorTicks=function(t){for(var e=this.getTicks({expandToNicedExtent:!0}),n=[],i=this.getExtent(),o=1;oi[0]&&co&&(a=r.interval=o);var s=r.intervalPrecision=Gu(a);return function(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),Uu(t,0,e),Uu(t,1,e),t[0]>t[1]&&(t[0]=t[1])}(r.niceTickExtent=[rn(Math.ceil(t[0]/a)*a,s),rn(Math.floor(t[1]/a)*a,s)],t),r}(i,o,t,e,n);this._intervalPrecision=r.intervalPrecision,this._interval=r.interval,this._niceExtent=r.niceTickExtent}},n.prototype.calcNiceExtent=function(t){var e=this._extent.slice();if(e[0]===e[1])if(0!==e[0]){var n=Math.abs(e[0]);t.fixMax||(e[1]+=n/2),e[0]-=n/2}else e[1]=1;isFinite(e[1]-e[0])||(e[0]=0,e[1]=1),this._innerSetExtent(e[0],e[1]),e=this._extent.slice(),this.calcNiceTicks(t.splitNumber,t.minInterval,t.maxInterval);var i=this._interval,o=this._intervalPrecision;t.fixMin||(e[0]=ek(Math.floor(e[0]/i)*i,o)),t.fixMax||(e[1]=ek(Math.ceil(e[1]/i)*i,o)),this._innerSetExtent(e[0],e[1])},n.prototype.setNiceExtent=function(t,e){this._niceExtent=[t,e]},n.type="interval",n}(JC);JC.registerClass(nk);const ik=nk;var ok="__ec_stack_",rk=function(t){function n(e){var n=t.call(this,e)||this;return n.type="time",n}return e(n,t),n.prototype.getLabel=function(t){var e=this.getSetting("useUTC");return bo(t.value,x_[function(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}(xo(this._minLevelUnit))]||x_.second,e,this.getSetting("locale"))},n.prototype.getFormattedLabel=function(t,e,n){var i=this.getSetting("useUTC");return function(t,e,n,i,o){var r=null;if(_(n))r=n;else if(v(n)){var a={time:t.time,level:t.time.level},s=vo();s&&s.makeAxisLabelFormatterParamBreak(a,t.break),r=n(t.value,e,a)}else{var l=t.time;if(l){var u=n[l.lowerTimeUnit][l.upperTimeUnit];r=u[Math.min(l.level,u.length-1)]||""}else{var h=So(t.value,o);r=n[h][h][0]}}return bo(new Date(t.value),r,o,i)}(t,e,n,this.getSetting("locale"),i)},n.prototype.getTicks=function(t){t=t||{};var e=this._interval,n=this._extent,i=vo(),o=[];if(!e)return o;var r=this.getSetting("useUTC");if(i&&"only_break"===t.breakTicks)return vo().addBreaksToTicks(o,this._brkCtx.breaks,this._extent),o;var a=So(n[1],r);o.push({value:n[0],time:{level:0,upperTimeUnit:a,lowerTimeUnit:a}});var s=function(t,e,n,i,o,r){function a(t,e,n,o,a,s,l){for(var h=function(t,e){var n=new Date(0);n[t](1);var i=n.getTime();n[t](1+e);var o=n.getTime()-i;return function(t,e){return Math.max(0,Math.round((e-t)/o))}}(a,t),c=e,d=new Date(c);c1e4));)if(d[a](d[o]()+t),c=d.getTime(),r){var p=r.calcNiceTickMultiple(c,h);p>0&&(d[a](d[o]()+p*t),c=d.getTime())}l.push({value:c,notAdd:!0})}function s(t,o,r){var s=[],l=!o.length;if(!Qu(xo(t),i[0],i[1],n)){l&&(o=[{value:rh(i[0],t,n)},{value:i[1]}]);for(var u=0;u=i[0]&&h<=i[1]&&a(d,h,c,p,f,0,s),"year"===t&&r.length>1&&0===u&&r.unshift({value:r[0].value-d})}}for(u=0;u=i[0]&&x<=i[1]&&p++)}var w=o/e;if(p>1.5*w&&g>w/1.5)break;if(h.push(v),p>w||t===l[m])break}c=[]}}var b=f(d(h,function(t){return f(t,function(t){return t.value>=i[0]&&t.value<=i[1]&&!t.notAdd})}),function(t){return t.length>0}),S=[],T=b.length-1;for(m=0;mn&&(this._approxInterval=n);var o=ak.length,r=Math.min(function(t,e,n,i){for(;n>>1;t[o][1]0;)i*=10;var o=[lk(hk(e[0]/i)*i),lk(uk(e[1]/i)*i)];this._interval=i,this._intervalPrecision=Gu(i),this._niceExtent=o}},n.prototype.calcNiceExtent=function(e){t.prototype.calcNiceExtent.call(this,e),this._fixMin=e.fixMin,this._fixMax=e.fixMax},n.prototype.contain=function(e){return e=dk(e)/dk(this.base),t.prototype.contain.call(this,e)},n.prototype.normalize=function(e){return e=dk(e)/dk(this.base),t.prototype.normalize.call(this,e)},n.prototype.scale=function(e){return e=t.prototype.scale.call(this,e),ck(this.base,e)},n.prototype.setBreaksFromOption=function(t){var e=vo();if(e){var n=e.logarithmicParseBreaksFromOption(t,this.base,_f(this.parse,this)),i=n.parsedLogged;this._originalScale._innerSetBreak(n.parsedOriginal),this._innerSetBreak(i)}},n.type="log",n}(ik);JC.registerClass(pk);const fk=pk;var gk=function(){function t(t,e,n){this._prepareParams(t,e,n)}return t.prototype._prepareParams=function(t,e,n){n[1]0&&s>0&&!l&&(a=0),a<0&&s<0&&!u&&(s=0));var c=this._determinedMin,d=this._determinedMax;return null!=c&&(a=c,l=!0),null!=d&&(s=d,u=!0),{min:a,max:s,minFixed:l,maxFixed:u,isBlank:h}},t.prototype.modifyDataMinMax=function(t,e){this[yk[t]]=e},t.prototype.setDeterminedMinMax=function(t,e){this[mk[t]]=e},t.prototype.freeze=function(){this.frozen=!0},t}(),mk={min:"_determinedMin",max:"_determinedMax"},yk={min:"_dataMin",max:"_dataMax"},vk=function(){function t(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return t.prototype.getAxis=function(t){return this._axes[t]},t.prototype.getAxes=function(){return d(this._dimList,function(t){return this._axes[t]},this)},t.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),f(this.getAxes(),function(e){return e.scale.type===t})},t.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},t}(),_k=["x","y"],xk=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cartesian2d",e.dimensions=_k,e}return e(n,t),n.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,e=this.getAxis("y").scale;if(_h(t)&&_h(e)){var n=t.getExtent(),i=e.getExtent(),o=this.dataToPoint([n[0],i[0]]),r=this.dataToPoint([n[1],i[1]]),a=n[1]-n[0],s=i[1]-i[0];if(a&&s){var l=(r[0]-o[0])/a,u=(r[1]-o[1])/s,h=this._transform=[l,0,0,u,o[0]-n[0]*l,o[1]-i[0]*u];this._invTransform=bt([],h)}}},n.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},n.prototype.containPoint=function(t){var e=this.getAxis("x"),n=this.getAxis("y");return e.contain(e.toLocalCoord(t[0]))&&n.contain(n.toLocalCoord(t[1]))},n.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},n.prototype.containZone=function(t,e){var n=this.dataToPoint(t),i=this.dataToPoint(e),o=this.getArea(),r=new lg(n[0],n[1],i[0]-n[0],i[1]-n[1]);return o.intersect(r)},n.prototype.dataToPoint=function(t,e,n){n=n||[];var i=t[0],o=t[1];if(this._transform&&null!=i&&isFinite(i)&&null!=o&&isFinite(o))return et(n,t,this._transform);var r=this.getAxis("x"),a=this.getAxis("y");return n[0]=r.toGlobalCoord(r.dataToCoord(i,e)),n[1]=a.toGlobalCoord(a.dataToCoord(o,e)),n},n.prototype.clampData=function(t,e){var n=this.getAxis("x").scale,i=this.getAxis("y").scale,o=n.getExtent(),r=i.getExtent(),a=n.parse(t[0]),s=i.parse(t[1]);return(e=e||[])[0]=Math.min(Math.max(Math.min(o[0],o[1]),a),Math.max(o[0],o[1])),e[1]=Math.min(Math.max(Math.min(r[0],r[1]),s),Math.max(r[0],r[1])),e},n.prototype.pointToData=function(t,e,n){if(n=n||[],this._invTransform)return et(n,t,this._invTransform);var i=this.getAxis("x"),o=this.getAxis("y");return n[0]=i.coordToData(i.toLocalCoord(t[0]),e),n[1]=o.coordToData(o.toLocalCoord(t[1]),e),n},n.prototype.getOtherAxis=function(t){return this.getAxis("x"===t.dim?"y":"x")},n.prototype.getArea=function(t){t=t||0;var e=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),i=Math.min(e[0],e[1])-t,o=Math.min(n[0],n[1])-t,r=Math.max(e[0],e[1])-i+t,a=Math.max(n[0],n[1])-o+t;return new lg(i,o,r,a)},n}(vk);const wk=xk;var bk=Ln(),Sk=Ln(),Tk=1,Mk=2,Ck=Sh("axisTick"),kk=Sh("axisLabel"),Ik=[0,1],Lk=function(){function t(t,e,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=n||[0,0]}return t.prototype.contain=function(t){var e=this._extent,n=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return t>=n&&t<=i},t.prototype.containData=function(t){return this.scale.contain(this.scale.parse(t))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(t){return sn(t||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(t,e){var n=this._extent;n[0]=t,n[1]=e},t.prototype.dataToCoord=function(t,e){var n=this._extent,i=this.scale;return t=i.normalize(i.parse(t)),this.onBand&&"ordinal"===i.type&&Ph(n=n.slice(),i.count()),nn(t,Ik,n,e)},t.prototype.coordToData=function(t,e){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&Ph(n=n.slice(),i.count());var o=nn(t,n,Ik,e);return this.scale.scale(o)},t.prototype.pointToData=function(t,e){},t.prototype.getTicksCoords=function(t){var e=(t=t||{}).tickModel||this.getTickModel(),n=d(function(t,e,n){var i=t.getTickModel().get("customValues");if(i){var o=t.scale.getExtent();return{ticks:f(wh(t,i),function(t){return t>=o[0]&&t<=o[1]})}}return"category"===t.type?function(t,e){var n,i,o=Ck(t),r=ph(e),a=Th(o,r);if(a)return a;if(e.get("show")&&!t.scale.isBlank()||(n=[]),v(r))n=Lh(t,r,!0);else if("auto"===r){var s=bh(t,t.getLabelModel(),xh(Mk));i=s.labelCategoryInterval,n=d(s.labels,function(t){return t.tickValue})}else n=Ih(t,i=r,!0);return Mh(o,r,{ticks:n,tickCategoryInterval:i})}(t,e):{ticks:d(t.scale.getTicks(n),function(t){return t.value})}}(this,e,{breakTicks:t.breakTicks,pruneByBreak:t.pruneByBreak}).ticks,function(t){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(t):t),tickValue:t}},this);return function(t,e,n,i){function o(t,e){return t=rn(t),e=rn(e),h?t>e:ts[1];o(e[0].coord,s[0])&&(i?e[0].coord=s[0]:e.shift()),i&&o(s[0],e[0].coord)&&e.unshift({coord:s[0],onBand:!0}),o(s[1],a.coord)&&(i?a.coord=s[1]:e.pop()),i&&o(a.coord,s[1])&&e.push({coord:s[1],onBand:!0})}}(this,n,e.get("alignWithLabel"),t.clamp),n},t.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)return[];var t=this.model.getModel("minorTick").get("splitNumber");return t>0&&t<100||(t=5),d(this.scale.getMinorTicks(t),function(t){return d(t,function(t){return{coord:this.dataToCoord(t),tickValue:t}},this)},this)},t.prototype.getViewLabels=function(t){return function(t,e){var n=t.getLabelModel().get("customValues");if(n){var i=ch(t),o=t.scale.getExtent();return{labels:d(f(wh(t,n),function(t){return t>=o[0]&&t<=o[1]}),function(e){var n={value:e};return{formattedLabel:i(n),rawLabel:t.scale.getLabel(n),tickValue:e,time:void 0,break:void 0}})}}return"category"===t.type?function(t,e){var n=t.getLabelModel(),i=bh(t,n,e);return!n.get("show")||t.scale.isBlank()?{labels:[]}:i}(t,e):function(t){var e=t.scale.getTicks(),n=ch(t);return{labels:d(e,function(e,i){return{formattedLabel:n(e,i),rawLabel:t.scale.getLabel(e),tickValue:e.value,time:e.time,break:e.break}})}}(t)}(this,t=t||xh(Mk)).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),n=e[1]-e[0]+(this.onBand?1:0);0===n&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},t.prototype.calculateCategoryInterval=function(t){return function(t,e){var n=e.kind,i=function(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}(t),o=ch(t),r=(i.axisRotate-i.labelRotate)/180*Math.PI,a=t.scale,s=a.getExtent(),l=a.count();if(s[1]-s[0]<1)return 0;var u=1;l>40&&(u=Math.max(1,Math.floor(l/40)));for(var h=s[0],c=t.dataToCoord(h+1)-t.dataToCoord(h),d=Math.abs(c*Math.cos(r)),p=Math.abs(c*Math.sin(r)),f=0,g=0;h<=s[1];h+=u){var m,y=Ge(o({value:h}),i.font,"center","top");m=1.3*y.height,f=Math.max(f,1.3*y.width,7),g=Math.max(g,m,7)}var v=f/d,_=g/p;isNaN(v)&&(v=1/0),isNaN(_)&&(_=1/0);var x=Math.max(0,Math.floor(Math.min(v,_)));if(n===Tk)return e.out.noPxChangeTryDetermine.push(_f(Ch,null,t,x,l)),x;var w=kh(t,x,l);return null!=w?w:x}(this,t=t||xh(Mk))},t}(),Pk=function(t){function n(e,n,i,o,r){var a=t.call(this,e,n,i)||this;return a.index=0,a.type=o||"value",a.position=r||"bottom",a}return e(n,t),n.prototype.isHorizontal=function(){var t=this.position;return"top"===t||"bottom"===t},n.prototype.getGlobalExtent=function(t){var e=this.getExtent();return e[0]=this.toGlobalCoord(e[0]),e[1]=this.toGlobalCoord(e[1]),t&&e[0]>e[1]&&e.reverse(),e},n.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},n.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},n}(Lk);const Dk=Pk;var Ak=["label","labelLine","layoutOption","priority","defaultAttr","marginForce","minMarginForce","marginDefault","suggestIgnore"],Ok=[0,0,0,0],zk="expandAxisBreak",Ek=Math.PI,Rk=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],Bk=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],Nk=Ln(),Fk=Ln(),Vk=function(){function t(t){this.recordMap={},this.resolveAxisNameOverlap=t}return t.prototype.ensureRecord=function(t){var e=t.axis.dim,n=t.componentIndex,i=this.recordMap,o=i[e]||(i[e]=[]);return o[n]||(o[n]={ready:{}})},t}(),Zk=[1,0,0,1,0,0],Hk=new lg(0,0,0,0),Wk=function(t,e,n,i,o,r){if(mh(t.nameLocation)){var a=r.stOccupiedRect;a&&Bh(function(t,e,n){return t.transform=ls(t.transform,n),t.localRect=ss(t.localRect,e),t.rect=ss(t.rect,e),n&&t.rect.applyTransform(n),t.axisAligned=as(n),t.obb=void 0,(t.label=t.label||{}).ignore=!1,t}({},a,r.transGroup.transform),i,o)}else Nh(r.labelInfoList,r.dirVec,i,o)},jk=function(){function t(t,e,n,i){this.group=new Em,this._axisModel=t,this._api=e,this._local={},this._shared=i||new Vk(Wk),this._resetCfgDetermined(n)}return t.prototype.updateCfg=function(t){var e=this._cfg.raw;e.position=t.position,e.labelOffset=t.labelOffset,this._resetCfgDetermined(e)},t.prototype.__getRawCfg=function(){return this._cfg.raw},t.prototype._resetCfgDetermined=function(t){var e=this._axisModel,n=e.getDefaultOption?e.getDefaultOption():{},i=L(t.axisName,e.get("name")),o=e.get("nameMoveOverlap");null!=o&&"auto"!==o||(o=L(t.defaultNameMoveOverlap,!0));var r={raw:t,position:t.position,rotation:t.rotation,nameDirection:L(t.nameDirection,1),tickDirection:L(t.tickDirection,1),labelDirection:L(t.labelDirection,1),labelOffset:L(t.labelOffset,0),silent:L(t.silent,!0),axisName:i,nameLocation:P(e.get("nameLocation"),n.nameLocation,"end"),shouldNameMoveOverlap:Gh(i)&&o,optionHideOverlap:e.get(["axisLabel","hideOverlap"]),showMinorTicks:e.get(["minorTick","show"])};this._cfg=r;var a=new Em({x:r.position[0],y:r.position[1],rotation:r.rotation});a.updateTransform(),this._transformGroup=a;var s=this._shared.ensureRecord(e);s.transGroup=this._transformGroup,s.dirVec=new Gf(Math.cos(-r.rotation),Math.sin(-r.rotation))},t.prototype.build=function(t,e){var n=this;return t||(t={axisLine:!0,axisTickLabelEstimate:!1,axisTickLabelDetermine:!0,axisName:!0}),c(Gk,function(i){t[i]&&Uk[i](n._cfg,n._local,n._shared,n._axisModel,n.group,n._transformGroup,n._api,e||{})}),this},t.innerTextLayout=function(t,e,n){var i,o,r=un(e-t);return hn(r)?(o=n>0?"top":"bottom",i="center"):hn(r-Ek)?(o=n>0?"bottom":"top",i="center"):(o="middle",i=r>0&&r0?"right":"left":n>0?"left":"right"),{rotation:r,textAlign:i,textVerticalAlign:o}},t.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},t.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},t}(),Gk=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],Uk={axisLine:function(t,e,n,i,o,r,s){var l=i.get(["axisLine","show"]);if("auto"===l&&(l=!0,null!=t.raw.axisLineAutoShow&&(l=!!t.raw.axisLineAutoShow)),l){var u=i.axis.getExtent(),h=r.transform,d=[u[0],0],p=[u[1],0],f=d[0]>p[0];h&&(et(d,d,h),et(p,p,h));var g=a({lineCap:"round"},i.getModel(["axisLine","lineStyle"]).getLineStyle()),m={strokeContainThreshold:t.raw.strokeContainThreshold||5,silent:!0,z2:1,style:g};if(i.get(["axisLine","breakLine"])&&i.axis.scale.hasBreaks())Vu().buildAxisBreakLine(i,o,r,m);else{var y=new cb(a({shape:{x1:d[0],y1:d[1],x2:p[0],y2:p[1]}},m));Ha(y.shape,y.style.lineWidth),y.anid="line",o.add(y)}var v=i.get(["axisLine","symbol"]);if(null!=v){var x=i.get(["axisLine","symbolSize"]);_(v)&&(v=[v,v]),(_(x)||w(x))&&(x=[x,x]);var b=Bs(i.get(["axisLine","symbolOffset"])||0,x),S=x[0],T=x[1];c([{rotate:t.rotation+Math.PI/2,offset:b[0],r:0},{rotate:t.rotation-Math.PI/2,offset:b[1],r:Math.sqrt((d[0]-p[0])*(d[0]-p[0])+(d[1]-p[1])*(d[1]-p[1]))}],function(e,n){if("none"!==v[n]&&null!=v[n]){var i=Es(v[n],-S/2,-T/2,S,T,g.stroke,!0),r=e.r+e.offset,a=f?p:d;i.attr({rotation:e.rotate,x:a[0]+r*Math.cos(t.rotation),y:a[1]-r*Math.sin(t.rotation),silent:!0,z2:11}),o.add(i)}})}}},axisTickLabelEstimate:function(t,e,n,i,o,r,a,s){Hh(e,o,s)&&Fh(t,e,n,i,o,r,a,Tk)},axisTickLabelDetermine:function(t,e,n,i,o,r,a,l){Hh(e,o,l)&&Fh(t,e,n,i,o,r,a,Mk);var u=function(t,e,n,i){var o=i.axis,r=i.getModel("axisTick"),a=r.get("show");if("auto"===a&&(a=!0,null!=t.raw.axisTickAutoShow&&(a=!!t.raw.axisTickAutoShow)),!a||o.scale.isBlank())return[];for(var l=r.getModel("lineStyle"),u=t.tickDirection*r.get("length"),h=Zh(o.getTicksCoords(),n.transform,u,s(l.getLineStyle(),{stroke:i.get(["axisLine","lineStyle","color"])}),"ticks"),c=0;ci[1],l="start"===e&&!s||"start"!==e&&s;return hn(a-Ek/2)?(r=l?"bottom":"top",o="center"):hn(a-1.5*Ek)?(r=l?"top":"bottom",o="center"):(r="middle",o=a<1.5*Ek&&a>Ek/2?l?"left":"right":l?"right":"left"),{rotation:a,textAlign:o,textVerticalAlign:r}}(t.rotation,h,w||0,f),null!=(x=t.raw.axisNameAvailableWidth)&&(x=Math.abs(x/Math.sin(_.rotation)),!isFinite(x)&&(x=null)));var b=d.getFont(),S=i.get("nameTruncate",!0)||{},T=S.ellipsis,M=I(t.raw.nameTruncateMaxWidth,S.maxWidth,x),C=s.nameMarginLevel||0,k=new Tv({x:m.x,y:m.y,rotation:_.rotation,silent:jk.isLabelSilent(i),style:co(d,{text:u,font:b,overflow:"truncate",width:M,ellipsis:T,fill:d.getTextColor()||i.get(["axisLine","lineStyle","color"]),align:d.get("align")||_.textAlign,verticalAlign:d.get("verticalAlign")||_.textVerticalAlign}),z2:1});if(is({el:k,componentModel:i,itemName:u}),k.__fullText=u,k.anid="name",i.get("triggerEvent")){var L=jk.makeAxisEventDataBase(i);L.targetType="axisName",L.name=u,Mv(k).eventData=L}r.add(k),k.updateTransform(),e.nameEl=k;var P=l.nameLayout=Oh({label:k,priority:k.z2,defaultAttr:{ignore:k.ignore},marginDefault:mh(h)?Rk[C]:Bk[C]});if(l.nameLocation=h,o.add(k),k.decomposeTransform(),t.shouldNameMoveOverlap&&P){var D=n.ensureRecord(i);n.resolveAxisNameOverlap(t,n,i,P,y,D)}}}},Yk=new mv,Xk=new mv;const qk=jk;var Kk=[[3,1],[0,2]],$k=function(){function t(t,e,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=_k,this._initCartesian(t,e,n),this.model=t}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(t,e){function n(t){var e,n=g(t),i=n.length;if(i){for(var o=[],r=i-1;r>=0;r--){var a=t[+n[r]],s=a.model,l=a.scale;Wu(l)&&s.get("alignTicks")&&null==s.get("interval")?o.push(a):(hh(l,s),Wu(l)&&(e=a))}o.length&&(e||hh((e=o.pop()).scale,e.model),c(o,function(t){!function(t,e,n){var i=ik.prototype,o=i.getTicks.call(n),r=i.getTicks.call(n,{expandToNicedExtent:!0}),a=o.length-1,s=i.getInterval.call(n),l=uh(t,e),u=l.extent,h=l.fixMin,c=l.fixMax;"log"===t.type&&(u=Ku(t.base,u,!0)),t.setBreaksFromOption(vh(e)),t.setExtent(u[0],u[1]),t.calcNiceExtent({splitNumber:a,fixMin:h,fixMax:c});var d=i.getExtent.call(t);h&&(u[0]=d[0]),c&&(u[1]=d[1]);var p=i.getInterval.call(t),f=u[0],g=u[1];if(h&&c)p=(g-f)/a;else if(h)for(g=u[0]+p*a;gu[0]&&isFinite(f)&&isFinite(u[0]);)p=ju(p),f=u[1]-p*a;else{t.getTicks().length-1>a&&(p=ju(p));var m=p*a;(f=rn((g=Math.ceil(u[1]/p)*p)-m))<0&&u[0]>=0?(f=0,g=rn(m)):g>0&&u[1]<=0&&(g=0,f=-rn(m))}var y=(o[0].value-r[0].value)/s,v=(o[a].value-r[a].value)/s;i.setExtent.call(t,f+p*y,g+p*v),i.setInterval.call(t,p),(y||v)&&i.setNiceExtent.call(t,f+p,g-p)}(t.scale,t.model,e.scale)}))}}var i=this._axesMap;this._updateScale(t,this.model),n(i.x),n(i.y);var o={};c(i.x,function(t){qh(i,"y",t,o)}),c(i.y,function(t){qh(i,"x",t,o)}),this.resize(this.model,e)},t.prototype.resize=function(t,e,n){var i=Xo(t,e),o=this._rect=Yo(t.getBoxLayoutParams(),i.refContainer),r=this._axesMap,a=this._coordsList,s=t.get("containLabel");if($h(r,o),!n){var u=function(t,e,n,i,o){var r=new Vk(Jk);return c(n,function(n){return c(n,function(n){yh(n.model)&&(n.axisBuilder=function(t,e,n,i,o,r){for(var a=Uh(t,n),s=!1,l=!1,u=0;ul[1]&&l.reverse(),(null==a||a>l[1])&&(a=l[1]),aa)return!0;if(r){var s=nc(t).seriesDataCount,l=i.getExtent();return Math.abs(l[0]-l[1])/s>a}return!1}return!0===n},t.prototype.makeElOption=function(t,e,n,i,o){},t.prototype.createPointerEl=function(t,e,n,i){var o=e.pointer;if(o){var r=cI(t).pointerEl=new qp[o.type](dI(e.pointer));t.add(r)}},t.prototype.createLabelEl=function(t,e,n,i){if(e.label){var o=cI(t).labelEl=new Tv(dI(e.label));t.add(o),lc(o,i)}},t.prototype.updatePointerEl=function(t,e,n){var i=cI(t).pointerEl;i&&e.pointer&&(i.setStyle(e.pointer.style),n(i,{shape:e.pointer.shape}))},t.prototype.updateLabelEl=function(t,e,n,i){var o=cI(t).labelEl;o&&(o.setStyle(e.label.style),n(o,{x:e.label.x,y:e.label.y}),lc(o,i))},t.prototype._renderHandle=function(t){if(!this._dragging&&this.updateHandleTransform){var e,n=this._axisPointerModel,i=this._api.getZr(),o=this._handle,r=n.getModel("handle"),a=n.get("status");if(!r.get("show")||!a||"hide"===a)return o&&i.remove(o),void(this._handle=null);this._handle||(e=!0,o=this._handle=$a(r.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){Zf(t.event)},onmousedown:pI(this._onHandleDragMove,this,0,0),drift:pI(this._onHandleDragMove,this),ondragend:pI(this._onHandleDragEnd,this)}),i.add(o)),hc(o,n,!1),o.setStyle(r.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=r.get("size");y(s)||(s=[s,s]),o.scaleX=s[0]/2,o.scaleY=s[1]/2,vs(this,"_doDispatchAxisPointer",r.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},t.prototype._moveHandleToValue=function(t,e){ac(this._axisPointerModel,!e&&this._moveAnimation,this._handle,uc(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(t,e){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(uc(n),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(uc(i)),cI(n).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){if(this._handle){var t=this._payloadInfo,e=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),n=this._group,i=this._handle;e&&n&&(this._lastGraphicKey=null,n&&e.remove(n),i&&e.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),_s(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}},t}(),gI=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.makeElOption=function(t,e,n,i,o){var r=n.axis,a=r.grid,s=i.get("type"),l=pc(a,r).getOtherAxis(r).getGlobalExtent(),u=r.toGlobalCoord(r.dataToCoord(e,!0));if(s&&"none"!==s){var h=function(t){var e,n=t.get("type"),i=t.getModel(n+"Style");return"line"===n?(e=i.getLineStyle()).fill=null:"shadow"===n&&((e=i.getAreaStyle()).stroke=null),e}(i),c=mI[s](r,u,l);c.style=h,t.graphicKey=c.type,t.pointer=c}!function(t,e,n,i,o,r){var a=qk.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=o.get(["label","margin"]),function(t,e,n,i,o){var r=cc(n.get("value"),e.axis,e.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),a=n.getModel("label"),s=S_(a.get("padding")||0),l=a.getFont(),u=Ge(r,l),h=o.position,c=u.width+s[1]+s[3],d=u.height+s[0]+s[2],p=o.align;"right"===p&&(h[0]-=c),"center"===p&&(h[0]-=c/2);var f=o.verticalAlign;"bottom"===f&&(h[1]-=d),"middle"===f&&(h[1]-=d/2),function(t,e,n,i){var o=i.getWidth(),r=i.getHeight();t[0]=Math.min(t[0]+e,o)-e,t[1]=Math.min(t[1]+n,r)-n,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}(h,c,d,i);var g=a.get("backgroundColor");g&&"auto"!==g||(g=e.get(["axisLine","lineStyle","color"])),t.label={x:h[0],y:h[1],style:co(a,{text:r,font:l,fill:a.getTextColor(),padding:s,backgroundColor:g}),z2:10}}(e,i,o,r,{position:dc(i.axis,t,n),align:a.textAlign,verticalAlign:a.textVerticalAlign})}(e,t,Uh(a.getRect(),n),n,i,o)},n.prototype.getHandleTransform=function(t,e,n){var i=Uh(e.axis.grid.getRect(),e,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var o=dc(e.axis,t,i);return{x:o[0],y:o[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},n.prototype.updateHandleTransform=function(t,e,n,i){var o=n.axis,r=o.grid,a=o.getGlobalExtent(!0),s=pc(r,o).getOtherAxis(o).getGlobalExtent(),l="x"===o.dim?0:1,u=[t.x,t.y];u[l]+=e[l],u[l]=Math.min(a[1],u[l]),u[l]=Math.max(a[0],u[l]);var h=(s[1]+s[0])/2,c=[h,h];return c[l]=u[l],{x:u[0],y:u[1],rotation:t.rotation,cursorPoint:c,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},n}(fI),mI={line:function(t,e,n){var i,o,r;return{type:"Line",subPixelOptimize:!0,shape:(i=[e,n[0]],o=[e,n[1]],r=fc(t),{x1:i[r=r||0],y1:i[1-r],x2:o[r],y2:o[1-r]})}},shadow:function(t,e,n){var i,o,r,a=Math.max(1,t.getBandWidth());return{type:"Rect",shape:(i=[e-a/2,n[0]],o=[a,n[1]-n[0]],r=fc(t),{x:i[r=r||0],y:i[1-r],width:o[r],height:o[1-r]})}}};const yI=gI,vI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="axisPointer",n.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:X_.color.border,width:1,type:"dashed"},shadowStyle:{color:X_.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:X_.color.neutral00,padding:[5,7,5,7],backgroundColor:X_.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:X_.color.accent40,throttle:40}},n}(W_);var _I=Ln(),xI=c,wI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){var i=e.getComponent("tooltip"),o=t.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";gc("axisPointer",n,function(t,e,n){"none"!==o&&("leave"===t||o.indexOf(t)>=0)&&n({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})})},n.prototype.remove=function(t,e){vc("axisPointer",e)},n.prototype.dispose=function(t,e){vc("axisPointer",e)},n.type="axisPointer",n}(ww);const bI=wI;var SI=Ln();const TI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="tooltip",n.dependencies=["axisPointer"],n.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:X_.color.neutral00,shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:X_.color.border,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:X_.color.borderShade,width:1,type:"dashed",textStyle:{}}},textStyle:{color:X_.color.tertiary,fontSize:14}},n}(W_);var MI=Ic(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),CI=Lc(Ic(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),"transition"),kI=Lc(MI,"transform"),II="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(Qp.transform3dSupported?"will-change:transform;":""),LI=function(){function t(t,e){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,Qp.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var i=this._zr=t.getZr(),o=e.appendTo,r=o&&(_(o)?document.querySelector(o):M(o)?o:v(o)&&o(t.getDom()));Dc(this._styleCoord,i,r,t.getWidth()/2,t.getHeight()/2),(r||t.getDom()).appendChild(n),this._api=t,this._container=r;var a=this;n.onmouseenter=function(){a._enterable&&(clearTimeout(a._hideTimeout),a._show=!0),a._inContent=!0},n.onmousemove=function(t){if(t=t||window.event,!a._enterable){var e=i.handler;dt(i.painter.getViewportRoot(),t,!0),e.dispatch("mousemove",t)}},n.onmouseleave=function(){a._inContent=!1,a._enterable&&a._show&&a.hideLater(a._hideDelay)}}return t.prototype.update=function(t){if(!this._container){var e=this._api.getDom(),n=(r="position",(a=(o=e).currentStyle||document.defaultView&&document.defaultView.getComputedStyle(o))?r?a[r]:a:null),i=e.style;"absolute"!==i.position&&"absolute"!==n&&(i.position="relative")}var o,r,a,s=t.get("alwaysShowContent");s&&this._moveIfResized(),this._alwaysShowContent=s,this._enableDisplayTransition=t.get("displayTransition")&&t.get("transitionDuration")>0,this.el.className=t.get("className")||""},t.prototype.show=function(t,e){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=n.style,o=this._styleCoord;n.innerHTML?i.cssText=II+function(t,e,n,i){var o=[],r=t.get("transitionDuration"),a=t.get("backgroundColor"),s=t.get("shadowBlur"),l=t.get("shadowColor"),u=t.get("shadowOffsetX"),h=t.get("shadowOffsetY"),d=t.getModel("textStyle"),p=aa(t,"html");return o.push("box-shadow:"+u+"px "+h+"px "+s+"px "+l),e&&r>0&&o.push(function(t,e,n){var i="cubic-bezier(0.23,1,0.32,1)",o="",r="";return n&&(r="opacity"+(o=" "+t/2+"s "+i)+",visibility"+o),e||(o=" "+t+"s "+i,r+=(r.length?",":"")+(Qp.transformSupported?""+kI+o:",left"+o+",top"+o)),CI+":"+r}(r,n,i)),a&&o.push("background-color:"+a),c(["width","color","radius"],function(e){var n="border-"+e,i=Vo(n),r=t.get(i);null!=r&&o.push(n+":"+r+("color"===e?"":"px"))}),o.push(function(t){var e=[],n=t.get("fontSize"),i=t.getTextColor();i&&e.push("color:"+i),e.push("font:"+t.getFont());var o=L(t.get("lineHeight"),Math.round(3*n/2));n&&e.push("line-height:"+o+"px");var r=t.get("textShadowColor"),a=t.get("textShadowBlur")||0,s=t.get("textShadowOffsetX")||0,l=t.get("textShadowOffsetY")||0;return r&&a&&e.push("text-shadow:"+s+"px "+l+"px "+a+"px "+r),c(["decoration","align"],function(n){var i=t.get(n);i&&e.push("text-"+n+":"+i)}),e.join(";")}(d)),null!=p&&o.push("padding:"+S_(p).join("px ")+"px"),o.join(";")+";"}(t,!this._firstShow,this._longHide,this._enableDisplayTransition)+Pc(o[0],o[1],!0)+"border-color:"+Wo(e)+";"+(t.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(t,e,n,i,o){var r=this.el;if(null!=t){var a="";if(_(o)&&"item"===n.get("trigger")&&!kc(n)&&(a=function(t,e,n){if(!_(n)||"inside"===n)return"";var i=t.get("backgroundColor"),o=t.get("borderWidth");e=Wo(e);var r,a,s="left"===(r=n)?"right":"right"===r?"left":"top"===r?"bottom":"top",u=Math.max(1.5*Math.round(o),6),h="",c=kI+":";l(["left","right"],s)>-1?(h+="top:50%",c+="translateY(-50%) rotate("+(a="left"===s?-225:-45)+"deg)"):(h+="left:50%",c+="translateX(-50%) rotate("+(a="top"===s?225:45)+"deg)");var d=a*Math.PI/180,p=u+o,f=p*Math.abs(Math.cos(d))+p*Math.abs(Math.sin(d)),g=e+" solid "+o+"px;";return'
'}(n,i,o)),_(t))r.innerHTML=t+a;else if(t){r.innerHTML="",y(t)||(t=[t]);for(var s=0;s=0?this._tryShow(n,i):"leave"===e&&this._hide(i))},this))},n.prototype._keepShow=function(){var t=this._tooltipModel,e=this._ecModel,n=this._api,i=t.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==i&&"click"!==i){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&o.manuallyShowTip(t,e,n,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},n.prototype.manuallyShowTip=function(t,e,n,i){if(i.from!==this.uid&&!Qp.node&&n.getDom()){var o=Rc(i,n);this._ticket="";var r=i.dataByCoordSys,a=function(t,e,n){var i=Dn(t).queryOptionMap,o=i.keys()[0];if(o&&"series"!==o){var r,a=An(e,o,i.get(o),{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];if(a)return n.getViewOfComponentModel(a).group.traverse(function(e){var n=Mv(e).tooltipConfig;if(n&&n.name===t.name)return r=e,!0}),r?{componentMainType:o,componentIndex:a.componentIndex,el:r}:void 0}}(i,e,n);if(a){var s=a.el.getBoundingRect().clone();s.applyTransform(a.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:a.el,position:i.position,positionDefault:"bottom"},o)}else if(i.tooltip&&null!=i.x&&null!=i.y){var l=AI;l.x=i.x,l.y=i.y,l.update(),Mv(l).tooltipConfig={name:null,option:i.tooltip},this._tryShow({offsetX:i.x,offsetY:i.y,target:l},o)}else if(r)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:r,tooltipOption:i.tooltipOption},o);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(t,e,n,i))return;var u=_c(i,e),h=u.point[0],c=u.point[1];null!=h&&null!=c&&this._tryShow({offsetX:h,offsetY:c,target:u.el,position:i.position,positionDefault:"bottom"},o)}else null!=i.x&&null!=i.y&&(n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},o))}},n.prototype.manuallyHideTip=function(t,e,n,i){this._tooltipModel&&this._tooltipContent.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(Rc(i,n))},n.prototype._manuallyAxisShowTip=function(t,e,n,i){var o=i.seriesIndex,r=i.dataIndex,a=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=o&&null!=r&&null!=a){var s=e.getSeriesByIndex(o);if(s&&"axis"===Ec([s.getData().getItemModel(r),s,(s.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:r,position:i.position}),!0}},n.prototype._tryShow=function(t,e){var n=t.target;if(this._tooltipModel){this._lastX=t.offsetX,this._lastY=t.offsetY;var i=t.dataByCoordSys;if(i&&i.length)this._showAxisTooltip(i,t);else if(n){var o,r;if("legend"===Mv(n).ssrType)return;this._lastDataByCoordSys=null,Os(n,function(t){if(t.tooltipDisabled)return o=r=null,!0;o||r||(null!=Mv(t).dataIndex?o=t:null!=Mv(t).tooltipConfig&&(r=t))},!0),o?this._showSeriesItemTooltip(t,o,e):r?this._showComponentItemTooltip(t,r,e):this._hide(e)}else this._lastDataByCoordSys=null,this._hide(e)}},n.prototype._showOrMove=function(t,e){var n=t.get("showDelay");e=_f(e,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(e,n):e()},n.prototype._showAxisTooltip=function(t,e){var n=this._ecModel,i=this._tooltipModel,o=[e.offsetX,e.offsetY],r=Ec([e.tooltipOption],i),s=this._renderMode,l=[],u=$r("section",{blocks:[],noHeader:!0}),h=[],d=new mw;c(t,function(t){c(t.dataByAxis,function(t){var e=n.getComponent(t.axisDim+"Axis",t.axisIndex),o=t.value;if(e&&null!=o){var r=cc(o,e.axis,n,t.seriesDataIndices,t.valueLabelOpt),p=$r("section",{header:r,noHeader:!z(r),sortBlocks:!0,blocks:[]});u.blocks.push(p),c(t.seriesDataIndices,function(u){var c=n.getSeriesByIndex(u.seriesIndex),f=u.dataIndexInside,g=c.getDataParams(f);if(!(g.dataIndex<0)){g.axisDim=t.axisDim,g.axisIndex=t.axisIndex,g.axisType=t.axisType,g.axisId=t.axisId,g.axisValue=dh(e.axis,{value:o}),g.axisValueLabel=r,g.marker=d.makeTooltipMarker("item",Wo(g.color),s);var m=zr(c.formatTooltip(f,!0,null)),y=m.frag;if(y){var v=Ec([c],i).get("valueFormatter");p.blocks.push(v?a({valueFormatter:v},y):y)}m.text&&h.push(m.text),l.push(g)}})}})}),u.blocks.reverse(),h.reverse();var p=e.position,f=r.get("order"),g=ia(u,d,s,f,n.get("useUTC"),r.get("textStyle"));g&&h.unshift(g);var m=h.join("richText"===s?"\n\n":"
");this._showOrMove(r,function(){this._updateContentNotChangedOnAxis(t,l)?this._updatePosition(r,p,o[0],o[1],this._tooltipContent,l):this._showTooltipContent(r,m,l,Math.random()+"",o[0],o[1],p,null,d)})},n.prototype._showSeriesItemTooltip=function(t,e,n){var i=this._ecModel,o=Mv(e),r=o.seriesIndex,s=i.getSeriesByIndex(r),l=o.dataModel||s,u=o.dataIndex,h=o.dataType,c=l.getData(h),d=this._renderMode,p=t.positionDefault,f=Ec([c.getItemModel(u),l,s&&(s.coordinateSystem||{}).model],this._tooltipModel,p?{position:p}:null),g=f.get("trigger");if(null==g||"item"===g){var m=l.getDataParams(u,h),y=new mw;m.marker=y.makeTooltipMarker("item",Wo(m.color),d);var v=zr(l.formatTooltip(u,!1,h)),_=f.get("order"),x=f.get("valueFormatter"),w=v.frag,b=w?ia(x?a({valueFormatter:x},w):w,y,d,_,i.get("useUTC"),f.get("textStyle")):v.text,S="item_"+l.name+"_"+u;this._showOrMove(f,function(){this._showTooltipContent(f,b,m,S,t.offsetX,t.offsetY,t.position,t.target,y)}),n({type:"showTip",dataIndexInside:u,dataIndex:c.getRawIndex(u),seriesIndex:r,from:this.uid})}},n.prototype._showComponentItemTooltip=function(t,e,n){var i="html"===this._renderMode,r=Mv(e),a=r.tooltipConfig.option||{},s=a.encodeHTMLContent;_(a)&&(a={content:a,formatter:a},s=!0),s&&i&&a.content&&((a=o(a)).content=lt(a.content));var l=[a],u=this._ecModel.getComponent(r.componentMainType,r.componentIndex);u&&l.push(u),l.push({formatter:a.content});var h=t.positionDefault,c=Ec(l,this._tooltipModel,h?{position:h}:null),d=c.get("content"),p=Math.random()+"",f=new mw;this._showOrMove(c,function(){var n=o(c.get("formatterParams")||{});this._showTooltipContent(c,d,n,p,t.offsetX,t.offsetY,t.position,e,f)}),n({type:"showTip",from:this.uid})},n.prototype._showTooltipContent=function(t,e,n,i,o,r,a,s,l){if(this._ticket="",t.get("showContent")&&t.get("show")){var u=this._tooltipContent;u.setEnterable(t.get("enterable"));var h=t.get("formatter");a=a||t.get("position");var c=e,d=this._getNearestPoint([o,r],n,t.get("trigger"),t.get("borderColor"),t.get("defaultBorderColor",!0)).color;if(h)if(_(h)){var p=t.ecModel.get("useUTC"),f=y(n)?n[0]:n;c=h,f&&f.axisType&&f.axisType.indexOf("time")>=0&&(c=bo(f.axisValue,c,p)),c=Ho(c,n,!0)}else if(v(h)){var g=_f(function(e,i){e===this._ticket&&(u.setContent(i,l,t,d,a),this._updatePosition(t,a,o,r,u,n,s))},this);this._ticket=i,c=h(n,i,g)}else c=h;u.setContent(c,l,t,d,a),u.show(t,d),this._updatePosition(t,a,o,r,u,n,s)}},n.prototype._getNearestPoint=function(t,e,n,i,o){return"axis"===n||y(e)?{color:i||o}:y(e)?void 0:{color:i||e.color||e.borderColor}},n.prototype._updatePosition=function(t,e,n,i,o,r,a){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u=o.getSize(),h=t.get("align"),c=t.get("verticalAlign"),d=a&&a.getBoundingRect().clone();if(a&&d.applyTransform(a.transform),v(e)&&(e=e([n,i],r,o.el,d,{viewSize:[s,l],contentSize:u.slice()})),y(e))n=jm(e[0],s),i=jm(e[1],l);else if(b(e)){var p=e;p.width=u[0],p.height=u[1];var f=Yo(p,{width:s,height:l});n=f.x,i=f.y,h=null,c=null}else if(_(e)&&a){var g=function(t,e,n,i){var o=n[0],r=n[1],a=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=e.width,h=e.height;switch(t){case"inside":s=e.x+u/2-o/2,l=e.y+h/2-r/2;break;case"top":s=e.x+u/2-o/2,l=e.y-r-a;break;case"bottom":s=e.x+u/2-o/2,l=e.y+h+a;break;case"left":s=e.x-o-a,l=e.y+h/2-r/2;break;case"right":s=e.x+u+a,l=e.y+h/2-r/2}return[s,l]}(e,d,u,t.get("borderWidth"));n=g[0],i=g[1]}else g=function(t,e,n,i,o,r,a){var s=n.getSize(),l=s[0],u=s[1];return null!=r&&(t+l+r+2>i?t-=l+r:t+=r),null!=a&&(e+u+a>o?e-=u+a:e+=a),[t,e]}(n,i,o,s,l,h?null:20,c?null:20),n=g[0],i=g[1];h&&(n-=Bc(h)?u[0]/2:"right"===h?u[0]:0),c&&(i-=Bc(c)?u[1]/2:"bottom"===c?u[1]:0),kc(t)&&(g=function(t,e,n,i,o){var r=n.getSize(),a=r[0],s=r[1];return t=Math.min(t+a,i)-a,e=Math.min(e+s,o)-s,[t=Math.max(t,0),e=Math.max(e,0)]}(n,i,o,s,l),n=g[0],i=g[1]),o.moveTo(n,i)},n.prototype._updateContentNotChangedOnAxis=function(t,e){var n=this._lastDataByCoordSys,i=this._cbParamsList,o=!!n&&n.length===t.length;return o&&c(n,function(n,r){var a=n.dataByAxis||[],s=(t[r]||{}).dataByAxis||[];(o=o&&a.length===s.length)&&c(a,function(t,n){var r=s[n]||{},a=t.seriesDataIndices||[],l=r.seriesDataIndices||[];(o=o&&t.value===r.value&&t.axisType===r.axisType&&t.axisId===r.axisId&&a.length===l.length)&&c(a,function(t,e){var n=l[e];o=o&&t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex}),i&&c(t.seriesDataIndices,function(t){var n=t.seriesIndex,r=e[n],a=i[n];r&&a&&a.data!==r.data&&(o=!1)})})}),this._lastDataByCoordSys=t,this._cbParamsList=e,!!o},n.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},n.prototype.dispose=function(t,e){!Qp.node&&e.getDom()&&(_s(this,"_updatePosition"),this._tooltipContent.dispose(),vc("itemTooltip",e))},n.type="tooltip",n}(ww);const zI=OI;var EI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.layoutMode={type:"box",ignoreSize:!0},e}return e(n,t),n.type="title",n.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:"center",top:X_.size.m,backgroundColor:X_.color.transparent,borderColor:X_.color.primary,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:X_.color.primary},subtextStyle:{fontSize:12,color:X_.color.quaternary}},n}(W_),RI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){if(this.group.removeAll(),t.get("show")){var i=this.group,o=t.getModel("textStyle"),r=t.getModel("subtextStyle"),a=t.get("textAlign"),s=L(t.get("textBaseline"),t.get("textVerticalAlign")),l=new Tv({style:co(o,{text:t.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),h=t.get("subtext"),c=new Tv({style:co(r,{text:h,fill:r.getTextColor(),y:u.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),d=t.get("link"),p=t.get("sublink"),f=t.get("triggerEvent",!0);l.silent=!d&&!f,c.silent=!p&&!f,d&&l.on("click",function(){jo(d,"_"+t.get("target"))}),p&&c.on("click",function(){jo(p,"_"+t.get("subtarget"))}),Mv(l).eventData=Mv(c).eventData=f?{componentType:"title",componentIndex:t.componentIndex}:null,i.add(l),h&&i.add(c);var g=i.getBoundingRect(),m=t.getBoxLayoutParams();m.width=g.width,m.height=g.height;var y=Yo(m,Xo(t,n).refContainer,t.get("padding"));a||("middle"===(a=t.get("left")||t.get("right"))&&(a="center"),"right"===a?y.x+=y.width:"center"===a&&(y.x+=y.width/2)),s||("center"===(s=t.get("top")||t.get("bottom"))&&(s="middle"),"bottom"===s?y.y+=y.height:"middle"===s&&(y.y+=y.height/2),s=s||"top"),i.x=y.x,i.y=y.y,i.markRedraw();var v={align:a,verticalAlign:s};l.setStyle(v),c.setStyle(v),g=i.getBoundingRect();var _=y.margin,x=t.getItemStyle(["color","opacity"]);x.fill=t.get("backgroundColor");var w=new mv({shape:{x:g.x-_[3],y:g.y-_[0],width:g.width+_[1]+_[3],height:g.height+_[0]+_[2],r:t.get("borderRadius")},style:x,subPixelOptimize:!0,silent:!0});i.add(w)}},n.type="title",n}(ww),BI=["x","y","radius","angle","single"],NI=["cartesian2d","polar","singleAxis"],FI=function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(t){this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},t}();const VI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="dataZoom.select",n}(function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e._autoThrottle=!0,e._noTarget=!0,e._rangePropMode=["percent","percent"],e}return e(n,t),n.prototype.init=function(t,e,n){var i=Fc(t);this.settledOption=i,this.mergeDefaultAndTheme(t,n),this._doInit(i)},n.prototype.mergeOption=function(t){var e=Fc(t);r(this.option,t,!0),r(this.settledOption,e,!0),this._doInit(e)},n.prototype._doInit=function(t){var e=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var n=this.settledOption;c([["start","startValue"],["end","endValue"]],function(t,i){"value"===this._rangePropMode[i]&&(e[t[0]]=n[t[0]]=null)},this),this._resetTarget()},n.prototype._resetTarget=function(){var t=this.get("orient",!0),e=this._targetAxisInfoMap=B();this._fillSpecifiedTargetAxis(e)?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(e,this._orient)),this._noTarget=!0,e.each(function(t){t.indexList.length&&(this._noTarget=!1)},this)},n.prototype._fillSpecifiedTargetAxis=function(t){var e=!1;return c(BI,function(n){var i=this.getReferringComponents(Nc(n),$m);if(i.specified){e=!0;var o=new FI;c(i.models,function(t){o.add(t.componentIndex)}),t.set(n,o)}},this),e},n.prototype._fillAutoTargetAxisByOrient=function(t,e){function n(e,n){var i=e[0];if(i){var r=new FI;if(r.add(i.componentIndex),t.set(n,r),o=!1,"x"===n||"y"===n){var a=i.getReferringComponents("grid",Km).models[0];a&&c(e,function(t){i.componentIndex!==t.componentIndex&&a===t.getReferringComponents("grid",Km).models[0]&&r.add(t.componentIndex)})}}}var i=this.ecModel,o=!0;if(o){var r="vertical"===e?"y":"x";n(i.findComponents({mainType:r+"Axis"}),r)}o&&n(i.findComponents({mainType:"singleAxis",filter:function(t){return t.get("orient",!0)===e}}),"single"),o&&c(BI,function(e){if(o){var n=i.findComponents({mainType:Nc(e),filter:function(t){return"category"===t.get("type",!0)}});if(n[0]){var r=new FI;r.add(n[0].componentIndex),t.set(e,r),o=!1}}},this)},n.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis(function(e){!t&&(t=e)},this),"y"===t?"vertical":"horizontal"},n.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var e=this.ecModel.option;this.option.throttle=e.animation&&e.animationDurationUpdate>0?100:20}},n.prototype._updateRangeUse=function(t){var e=this._rangePropMode,n=this.get("rangeMode");c([["start","startValue"],["end","endValue"]],function(i,o){var r=null!=t[i[0]],a=null!=t[i[1]];r&&!a?e[o]="percent":!r&&a?e[o]="value":n?e[o]=n[o]:r&&(e[o]="percent")})},n.prototype.noTarget=function(){return this._noTarget},n.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis(function(e,n){null==t&&(t=this.ecModel.getComponent(Nc(e),n))},this),t},n.prototype.eachTargetAxis=function(t,e){this._targetAxisInfoMap.each(function(n,i){c(n.indexList,function(n){t.call(e,i,n)})})},n.prototype.getAxisProxy=function(t,e){var n=this.getAxisModel(t,e);if(n)return n.__dzAxisProxy},n.prototype.getAxisModel=function(t,e){var n=this._targetAxisInfoMap.get(t);if(n&&n.indexMap[e])return this.ecModel.getComponent(Nc(t),e)},n.prototype.setRawRange=function(t){var e=this.option,n=this.settledOption;c([["start","startValue"],["end","endValue"]],function(i){null==t[i[0]]&&null==t[i[1]]||(e[i[0]]=n[i[0]]=t[i[0]],e[i[1]]=n[i[1]]=t[i[1]])},this),this._updateRangeUse(t)},n.prototype.setCalculatedRange=function(t){var e=this.option;c(["start","startValue","end","endValue"],function(n){e[n]=t[n]})},n.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},n.prototype.getValueRange=function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var n=this.findRepresentativeAxisProxy();return n?n.getDataValueWindow():void 0},n.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var e,n=this._targetAxisInfoMap.keys(),i=0;i=0}(e)){var n=Nc(this._dimName),i=e.getReferringComponents(n,Km).models[0];i&&this._axisIndex===i.componentIndex&&t.push(e)}},this),t},t.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},t.prototype.getMinMaxSpan=function(){return o(this._minMaxSpan)},t.prototype.calculateDataWindow=function(t){function e(t,e,n,i,r){var a=r?"Span":"ValueSpan";Vc(0,t,n,"all",u["min"+a],u["max"+a]);for(var s=0;s<2;s++)e[s]=nn(t[s],n,i,!0),r&&(e[s]=o.parse(e[s]))}var n,i=this._dataExtent,o=this.getAxisModel().axis.scale,r=this._dataZoomModel.getRangePropMode(),a=[0,100],s=[],l=[];HI(["start","end"],function(e,u){var h=t[e],c=t[e+"Value"];"percent"===r[u]?(null==h&&(h=a[u]),c=o.parse(nn(h,a,i))):(n=!0,h=nn(c=null==c?i[u]:o.parse(c),i,a)),l[u]=null==c||isNaN(c)?i[u]:c,s[u]=null==h||isNaN(h)?a[u]:h}),WI(l),WI(s);var u=this._minMaxSpan;return n?e(l,s,i,a,!1):e(s,l,a,i,!0),{valueWindow:l,percentWindow:s}},t.prototype.reset=function(t){if(t===this._dataZoomModel){var e=this.getTargetSeriesModels();this._dataExtent=function(t,e,n){var i=[1/0,-1/0];HI(n,function(t){!function(t,e,n){e&&c(gh(e,n),function(n){var i=e.getApproximateExtent(n);i[0]t[1]&&(t[1]=i[1])})}(i,t.getData(),e)});var o=t.getAxisModel(),r=sh(o.axis.scale,o,i).calculate();return[r.min,r.max]}(this,this._dimName,e),this._updateMinMaxSpan();var n=this.calculateDataWindow(t.settledOption);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,this._setAxisModel()}},t.prototype.filterData=function(t,e){if(t===this._dataZoomModel){var n=this._dimName,i=this.getTargetSeriesModels(),o=t.get("filterMode"),r=this._valueWindow;"none"!==o&&HI(i,function(t){var e=t.getData(),i=e.mapDimensionsAll(n);if(i.length){if("weakFilter"===o){var a=e.getStore(),s=d(i,function(t){return e.getDimensionIndex(t)},e);e.filterSelf(function(t){for(var e,n,o,l=0;lr[1];if(h&&!c&&!d)return!0;h&&(o=!0),c&&(e=!0),d&&(n=!0)}return o&&e&&n})}else HI(i,function(n){if("empty"===o)t.setData(e=e.map(n,function(t){return function(t){return t>=r[0]&&t<=r[1]}(t)?t:NaN}));else{var i={};i[n]=r,e.selectRange(i)}});HI(i,function(t){e.setApproximateExtent(r,t)})}})}},t.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},e=this._dataZoomModel,n=this._dataExtent;HI(["min","max"],function(i){var o=e.get(i+"Span"),r=e.get(i+"ValueSpan");null!=r&&(r=this.getAxisModel().axis.scale.parse(r)),null!=r?o=nn(n[0]+r,n,[0,100],!0):null!=o&&(r=nn(o,[0,100],n,!0)-n[0]),t[i+"Span"]=o,t[i+"ValueSpan"]=r},this)},t.prototype._setAxisModel=function(){var t=this.getAxisModel(),e=this._percentWindow,n=this._valueWindow;if(e){var i=sn(n,[0,500]);i=Math.min(i,20);var o=t.axis.scale.rawExtentInfo;0!==e[0]&&o.setDeterminedMinMax("min",+n[0].toFixed(i)),100!==e[1]&&o.setDeterminedMinMax("max",+n[1].toFixed(i)),o.freeze()}},t}();const GI=jI,UI={getTargetSeries:function(t){function e(e){t.eachComponent("dataZoom",function(n){n.eachTargetAxis(function(i,o){var r=t.getComponent(Nc(i),o);e(i,o,r,n)})})}e(function(t,e,n,i){n.__dzAxisProxy=null});var n=[];e(function(e,i,o,r){o.__dzAxisProxy||(o.__dzAxisProxy=new GI(e,i,r,t),n.push(o.__dzAxisProxy))});var i=B();return c(n,function(t){c(t.getTargetSeriesModels(),function(t){i.set(t.uid,t)})}),i},overallReset:function(t,e){t.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(e,n){t.getAxisProxy(e,n).reset(t)}),t.eachTargetAxis(function(n,i){t.getAxisProxy(n,i).filterData(t,e)})}),t.eachComponent("dataZoom",function(t){var e=t.findRepresentativeAxisProxy();if(e){var n=e.getDataPercentWindow(),i=e.getDataValueWindow();t.setCalculatedRange({start:n[0],end:n[1],startValue:i[0],endValue:i[1]})}})}};var YI=!1,XI=function(){},qI={};const KI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.optionUpdated=function(){t.prototype.optionUpdated.apply(this,arguments);var e=this.ecModel;c(this.option.feature,function(t,n){var i=Gc(n);i&&(i.getDefaultOption&&(i.defaultOption=i.getDefaultOption(e)),r(t,i.defaultOption))})},n.type="toolbox",n.layoutMode={type:"box",ignoreSize:!0},n.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:X_.color.border,borderRadius:0,borderWidth:0,padding:X_.size.m,itemSize:15,itemGap:X_.size.s,showTitle:!0,iconStyle:{borderColor:X_.color.accent50,color:"none"},emphasis:{iconStyle:{borderColor:X_.color.accent50}},tooltip:{show:!1,position:"bottom"}},n}(W_);var $I=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.render=function(t,e,n,i){function o(o,d){var p,f=h[o],g=h[d],m=l[f],y=new i_(m,t,t.ecModel);if(i&&null!=i.newTitle&&i.featureName===f&&(m.title=i.newTitle),f&&!g){if(function(t){return 0===t.indexOf("my")}(f))p={onclick:y.option.onclick,featureName:f};else{var v=Gc(f);if(!v)return;p=new v}u[f]=p}else if(!(p=u[g]))return;p.uid=mo("toolbox-feature"),p.model=y,p.ecModel=e,p.api=n;var x=p instanceof XI;f||!g?!y.get("show")||x&&p.unusable?x&&p.remove&&p.remove(e,n):(function(i,o,l){var u,h,d=i.getModel("iconStyle"),p=i.getModel(["emphasis","iconStyle"]),f=o instanceof XI&&o.getIcons?o.getIcons():i.get("icon"),g=i.get("title")||{};_(f)?(u={})[l]=f:u=f,_(g)?(h={})[l]=g:h=g;var m=i.iconPaths={};c(u,function(l,u){var c=$a(l,{},{x:-a/2,y:-a/2,width:a,height:a});c.setStyle(d.getItemStyle()),c.ensureState("emphasis").style=p.getItemStyle();var f=new Tv({style:{text:h[u],align:p.get("textAlign"),borderRadius:p.get("textBorderRadius"),padding:p.get("textPadding"),fill:null,font:go({fontStyle:p.get("textFontStyle"),fontFamily:p.get("textFontFamily"),fontSize:p.get("textFontSize"),fontWeight:p.get("textFontWeight")},e)},ignore:!0});c.setTextContent(f),is({el:c,componentModel:t,itemName:u,formatterParamsExtra:{title:h[u]}}),c.__title=h[u],c.on("mouseover",function(){var e=p.getItemStyle(),i=s?null==t.get("right")&&"right"!==t.get("left")?"right":"left":null==t.get("bottom")&&"bottom"!==t.get("top")?"bottom":"top";f.setStyle({fill:p.get("textFill")||e.fill||e.stroke||X_.color.neutral99,backgroundColor:p.get("textBackgroundColor")}),c.setTextConfig({position:p.get("textPosition")||i}),f.ignore=!t.get("showTitle"),n.enterEmphasis(this)}).on("mouseout",function(){"emphasis"!==i.get(["iconStatus",u])&&n.leaveEmphasis(this),f.hide()}),("emphasis"===i.get(["iconStatus",u])?ji:Gi)(c),r.add(c),c.on("click",_f(o.onclick,o,e,n,u)),m[u]=c})}(y,p,f),y.setIconStatus=function(t,e){var n=this.option,i=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[t]=e,i[t]&&("emphasis"===e?ji:Gi)(i[t])},p instanceof XI&&p.render&&p.render(y,e,n,i)):x&&p.dispose&&p.dispose(e,n)}var r=this.group;if(r.removeAll(),t.get("show")){var a=+t.get("itemSize"),s="vertical"===t.get("orient"),l=t.get("feature")||{},u=this._features||(this._features={}),h=[];c(l,function(t,e){h.push(e)}),new gM(this._featureNames||[],h).add(o).update(o).remove(m(o,null)).execute(),this._featureNames=h;var d=Xo(t,n).refContainer,p=t.getBoxLayoutParams(),f=t.get("padding"),g=Yo(p,d,f);F_(t.get("orient"),r,t.get("itemGap"),g.width,g.height),qo(r,p,d,f),r.add(Uc(r.getBoundingRect(),t)),s||r.eachChild(function(t){var e=t.__title,i=t.ensureState("emphasis"),o=i.textConfig||(i.textConfig={}),s=t.getTextContent(),l=s&&s.ensureState("emphasis");if(l&&!v(l)&&e){var u=l.style||(l.style={}),h=Ge(e,Tv.makeFont(u)),c=t.x+r.x,d=!1;t.y+r.y+a+h.height>n.getHeight()&&(o.position="top",d=!0);var p=d?-5-h.height:a+10;c+h.width/2>n.getWidth()?(o.position=["100%",p],u.align="right"):c-h.width/2<0&&(o.position=[0,p],u.align="left")}})}},n.prototype.updateView=function(t,e,n,i){c(this._features,function(t){t instanceof XI&&t.updateView&&t.updateView(t.model,e,n,i)})},n.prototype.remove=function(t,e){c(this._features,function(n){n instanceof XI&&n.remove&&n.remove(t,e)}),this.group.removeAll()},n.prototype.dispose=function(t,e){c(this._features,function(n){n instanceof XI&&n.dispose&&n.dispose(t,e)})},n.type="toolbox",n}(ww);const JI=$I,QI=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.onclick=function(t,e){var n=this.model,i=n.get("name")||t.get("title.0.text")||"echarts",o="svg"===e.getZr().painter.getType(),r=o?"svg":n.get("type",!0)||"png",a=e.getConnectedDataURL({type:r,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||X_.color.neutral00,connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),s=Qp.browser;if("function"!=typeof MouseEvent||!s.newEdge&&(s.ie||s.edge))if(window.navigator.msSaveOrOpenBlob||o){var l=a.split(","),u=l[0].indexOf("base64")>-1,h=o?decodeURIComponent(l[1]):l[1];u&&(h=window.atob(h));var c=i+"."+r;if(window.navigator.msSaveOrOpenBlob){for(var d=h.length,p=new Uint8Array(d);d--;)p[d]=h.charCodeAt(d);var f=new Blob([p]);window.navigator.msSaveOrOpenBlob(f,c)}else{var g=document.createElement("iframe");document.body.appendChild(g);var m=g.contentWindow,y=m.document;y.open("image/svg+xml","replace"),y.write(h),y.close(),m.focus(),y.execCommand("SaveAs",!0,c),document.body.removeChild(g)}}else{var v=n.get("lang"),_='',x=window.open();x.document.write(_),x.document.title=i}else{var w=document.createElement("a");w.download=i+"."+r,w.target="_blank",w.href=a;var b=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});w.dispatchEvent(b)}},n.getDefaultOption=function(t){return{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:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:X_.color.neutral00,name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])}},n}(XI);var tL="__ec_magicType_stack__",eL=[["line","bar"],["stack"]],nL=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.getIcons=function(){var t=this.model,e=t.get("icon"),n={};return c(t.get("type"),function(t){e[t]&&(n[t]=e[t])}),n},n.getDefaultOption=function(t){return{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:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},n.prototype.onclick=function(t,e,n){var i=this.model,o=i.get(["seriesIndex",n]);if(iL[n]){var a,u={series:[]};c(eL,function(t){l(t,n)>=0&&c(t,function(t){i.setIconStatus(t,"normal")})}),i.setIconStatus(n,"emphasis"),t.eachComponent({mainType:"series",query:null==o?null:{seriesIndex:o}},function(t){var e=iL[n](t.subType,t.id,t,i);e&&(s(e,t.option),u.series.push(e));var o=t.coordinateSystem;if(o&&"cartesian2d"===o.type&&("line"===n||"bar"===n)){var r=o.getAxesByScale("ordinal")[0];if(r){var a=r.dim+"Axis",l=t.getReferringComponents(a,Km).models[0].componentIndex;u[a]=u[a]||[];for(var h=0;h<=l;h++)u[a][l]=u[a][l]||{};u[a][l].boundaryGap="bar"===n}}});var h=n;"stack"===n&&(a=r({stack:i.option.title.tiled,tiled:i.option.title.stack},i.option.title),"emphasis"!==i.get(["iconStatus",n])&&(h="tiled")),e.dispatchAction({type:"changeMagicType",currentType:h,newOption:u,newTitle:a,featureName:"magicType"})}},n}(XI),iL={line:function(t,e,n,i){if("bar"===t)return r({id:e,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(t,e,n,i){if("line"===t)return r({id:e,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(t,e,n,i){var o=n.get("stack")===tL;if("line"===t||"bar"===t)return i.setIconStatus("stack",o?"normal":"emphasis"),r({id:e,stack:o?"":tL},i.get(["option","stack"])||{},!0)}};fl({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)});const oL=nL;var rL=new Array(60).join("-"),aL="\t",sL=new RegExp("[\t]+","g"),lL=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.onclick=function(t,e){function n(){i.removeChild(r),C._dom=null}setTimeout(function(){e.dispatchAction({type:"hideTip"})});var i=e.getDom(),o=this.model;this._dom&&i.removeChild(this._dom);var r=document.createElement("div");r.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",r.style.backgroundColor=o.get("backgroundColor")||X_.color.neutral00;var a=document.createElement("h4"),s=o.get("lang")||[];a.innerHTML=s[0]||o.get("title"),a.style.cssText="margin:10px 20px",a.style.color=o.get("textColor");var l=document.createElement("div"),u=document.createElement("textarea");l.style.cssText="overflow:auto";var h=o.get("optionToContent"),p=o.get("contentToOption"),g=function(t){var e,n,i,o=function(t){var e={},n=[],i=[];return t.eachRawSeries(function(t){var o=t.coordinateSystem;if(!o||"cartesian2d"!==o.type&&"polar"!==o.type)n.push(t);else{var r=o.getBaseAxis();if("category"===r.type){var a=r.dim+"_"+r.index;e[a]||(e[a]={categoryAxis:r,valueAxis:o.getOtherAxis(r),series:[]},i.push({axisDim:r.dim,axisIndex:r.index})),e[a].series.push(t)}else n.push(t)}}),{seriesGroupByCategoryAxis:e,other:n,meta:i}}(t);return{value:f([(n=o.seriesGroupByCategoryAxis,i=[],c(n,function(t,e){var n=t.categoryAxis,o=t.valueAxis.dim,r=[" "].concat(d(t.series,function(t){return t.name})),a=[n.model.getCategories()];c(t.series,function(t){var e=t.getRawData();a.push(t.getRawData().mapArray(e.mapDimension(o),function(t){return t}))});for(var s=[r.join(aL)],l=0;l=0)return!0}(t)){var o=function(t){for(var e=t.split(/\n+/g),n=[],i=d(Yc(e.shift()).split(sL),function(t){return{name:t,data:[]}}),o=0;oi.getWidth()||n<0||n>i.getHeight()}(t,e.offsetX,e.offsetY)){var i=t._zr,o=t._covers,r=nd(t,e,n);if(!t._dragging)for(var a=0;a=0)&&t(o,i._targetInfoList)})}return t.prototype.setOutputRanges=function(t,e){return this.matchOutputRanges(t,e,function(t,e,n){if((t.coordRanges||(t.coordRanges=[])).push(e),!t.coordRange){t.coordRange=e;var i=AL[t.brushType](0,n,e);t.__rangeOffset={offset:OL[t.brushType](i.values,t.range,[1,1]),xyMinMax:i.xyMinMax}}}),t},t.prototype.matchOutputRanges=function(t,e,n){c(t,function(t){var i=this.findTargetInfo(t,e);i&&!0!==i&&c(i.coordSyses,function(i){var o=AL[t.brushType](1,i,t.range,!0);n(t,o.values,i,e)})},this)},t.prototype.setInputRanges=function(t,e){c(t,function(t){var n,i,o,r,a=this.findTargetInfo(t,e);if(t.range=t.range||[],a&&!0!==a){t.panelId=a.panelId;var s=AL[t.brushType](0,a.coordSys,t.coordRange),l=t.__rangeOffset;t.range=l?OL[t.brushType](s.values,l.offset,(n=l.xyMinMax,i=Ad(s.xyMinMax),o=Ad(n),r=[i[0]/o[0],i[1]/o[1]],isNaN(r[0])&&(r[0]=1),isNaN(r[1])&&(r[1]=1),r)):s.values}},this)},t.prototype.makePanelOpts=function(t,e){return d(this._targetInfoList,function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:e?e(n):null,clipPath:Td(i),isTargetByCursor:Cd(i,t,n.coordSysModel),getLinearBrushOtherExtent:Md(i)}})},t.prototype.controlSeries=function(t,e,n){var i=this.findTargetInfo(t,n);return!0===i||i&&l(i.coordSyses,e.coordinateSystem)>=0},t.prototype.findTargetInfo=function(t,e){for(var n=this._targetInfoList,i=Ld(e,t),o=0;o=0||l(i,t.getAxis("y").model)>=0)&&o.push(t)}),e.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:o[0],coordSyses:o,getPanelRect:DL.grid,xAxisDeclared:a[t.id],yAxisDeclared:s[t.id]})}))},geo:function(t,e){c(t.geoModels,function(t){var n=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:n,coordSyses:[n],getPanelRect:DL.geo})})}},PL=[function(t,e){var n=t.xAxisModel,i=t.yAxisModel,o=t.gridModel;return!o&&n&&(o=n.axis.grid.model),!o&&i&&(o=i.axis.grid.model),o&&o===e.gridModel},function(t,e){var n=t.geoModel;return n&&n===e.geoModel}],DL={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(ja(t)),e}},AL={lineX:m(Pd,0),lineY:m(Pd,1),rect:function(t,e,n,i){var o=t?e.pointToData([n[0][0],n[1][0]],i):e.dataToPoint([n[0][0],n[1][0]],i),r=t?e.pointToData([n[0][1],n[1][1]],i):e.dataToPoint([n[0][1],n[1][1]],i),a=[Id([o[0],r[0]]),Id([o[1],r[1]])];return{values:a,xyMinMax:a}},polygon:function(t,e,n,i){var o=[[1/0,-1/0],[1/0,-1/0]];return{values:d(n,function(n){var r=t?e.pointToData(n,i):e.dataToPoint(n,i);return o[0][0]=Math.min(o[0][0],r[0]),o[1][0]=Math.min(o[1][0],r[1]),o[0][1]=Math.max(o[0][1],r[0]),o[1][1]=Math.max(o[1][1],r[1]),r}),xyMinMax:o}}},OL={lineX:m(Dd,0),lineY:m(Dd,1),rect:function(t,e,n){return[[t[0][0]-n[0]*e[0][0],t[0][1]-n[0]*e[0][1]],[t[1][0]-n[1]*e[1][0],t[1][1]-n[1]*e[1][1]]]},polygon:function(t,e,n){return d(t,function(t,i){return[t[0]-n[0]*e[i][0],t[1]-n[1]*e[i][1]]})}};const zL=IL;var EL,RL=c,BL=Ym+"toolbox-dataZoom_",NL=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.render=function(t,e,n,i){this._brushController||(this._brushController=new CL(n.getZr()),this._brushController.on("brush",_f(this._onBrush,this)).mount()),function(t,e,n,i,o){var r=n._isZoomActive;i&&"takeGlobalCursor"===i.type&&(r="dataZoomSelect"===i.key&&i.dataZoomSelectActive),n._isZoomActive=r,t.setIconStatus("zoom",r?"emphasis":"normal");var a=new zL(Od(t),e,{include:["grid"]}).makePanelOpts(o,function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"});n._brushController.setPanels(a).enableBrush(!(!r||!a.length)&&{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()})}(t,e,this,i,n),function(t,e){t.setIconStatus("back",function(t){return qc(t).length}(e)>1?"emphasis":"normal")}(t,e)},n.prototype.onclick=function(t,e,n){FL[n].call(this)},n.prototype.remove=function(t,e){this._brushController&&this._brushController.unmount()},n.prototype.dispose=function(t,e){this._brushController&&this._brushController.dispose()},n.prototype._onBrush=function(t){function e(t,e,n){var r=e.getAxis(t),a=r.model,s=function(t,e,n){var i;return n.eachComponent({mainType:"dataZoom",subType:"select"},function(n){n.getAxisModel(t,e.componentIndex)&&(i=n)}),i}(t,a,o),l=s.findRepresentativeAxisProxy(a).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(n=Vc(0,n.slice(),r.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(i[s.id]={dataZoomId:s.id,startValue:n[0],endValue:n[1]})}var n=t.areas;if(t.isEnd&&n.length){var i={},o=this.ecModel;this._brushController.updateCovers([]),new zL(Od(this.model),o,{include:["grid"]}).matchOutputRanges(n,o,function(t,n,i){if("cartesian2d"===i.type){var o=t.brushType;"rect"===o?(e("x",i,n[0]),e("y",i,n[1])):e({lineX:"x",lineY:"y"}[o],i,n)}}),function(t,e){var n=qc(t);hL(e,function(e,i){for(var o=n.length-1;o>=0&&!n[o][i];o--);if(o<0){var r=t.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(r){var a=r.getPercentRange();n[0][i]={dataZoomId:i,start:a[0],end:a[1]}}}}),n.push(e)}(o,i),this._dispatchZoomAction(i)}},n.prototype._dispatchZoomAction=function(t){var e=[];RL(t,function(t,n){e.push(o(t))}),e.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:e})},n.getDefaultOption=function(t){return{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:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:X_.color.backgroundTint}}},n}(XI),FL={zoom:function(){this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:!this._isZoomActive})},back:function(){this._dispatchZoomAction(function(t){var e=qc(t),n=e[e.length-1];e.length>1&&e.pop();var i={};return hL(n,function(t,n){for(var o=e.length-1;o>=0;o--)if(t=e[o][n]){i[n]=t;break}}),i}(this.ecModel))}};EL=function(t){function e(t,e,n){var i=t.componentIndex,a={type:"select",$fromToolbox:!0,filterMode:o.get("filterMode",!0)||"filter",id:BL+e+i};a[n]=i,r.push(a)}var n=t.getComponent("toolbox",0),i=["feature","dataZoom"];if(n&&null!=n.get(i)){var o=n.getModel(i),r=[],a=Pn(t,Od(o));return RL(a.xAxisModels,function(t){return e(t,"xAxis","xAxisIndex")}),RL(a.yAxisModels,function(t){return e(t,"yAxis","yAxisIndex")}),r}},O(null==mx.get("dataZoom")&&EL),mx.set("dataZoom",EL);const VL=NL,ZL=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.layoutMode={type:"box",ignoreSize:!0},e}return e(n,t),n.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),t.selected=t.selected||{},this._updateSelector(t)},n.prototype.mergeOption=function(e,n){t.prototype.mergeOption.call(this,e,n),this._updateSelector(e)},n.prototype._updateSelector=function(t){var e=t.selector,n=this.ecModel;!0===e&&(e=t.selector=["all","inverse"]),y(e)&&c(e,function(t,i){_(t)&&(t={type:t}),e[i]=r(t,function(t,e){return"all"===e?{type:"all",title:t.getLocaleModel().get(["legend","selector","all"])}:"inverse"===e?{type:"inverse",title:t.getLocaleModel().get(["legend","selector","inverse"])}:void 0}(n,t.type))})},n.prototype.optionUpdated=function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&"single"===this.get("selectedMode")){for(var e=!1,n=0;n=0},n.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},n.type="legend.plain",n.dependencies=["series"],n.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",bottom:X_.size.m,align:"auto",backgroundColor:X_.color.transparent,borderColor:X_.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:X_.color.disabled,inactiveBorderColor:X_.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:X_.color.disabled,inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:X_.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:X_.color.tertiary,borderWidth:1,borderColor:X_.color.border},emphasis:{selectorLabel:{show:!0,color:X_.color.quaternary}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},n}(W_);var HL=m,WL=c,jL=Em,GL=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.newlineDisabled=!1,e}return e(n,t),n.prototype.init=function(){this.group.add(this._contentGroup=new jL),this.group.add(this._selectorGroup=new jL),this._isFirstRender=!0},n.prototype.getContentGroup=function(){return this._contentGroup},n.prototype.getSelectorGroup=function(){return this._selectorGroup},n.prototype.render=function(t,e,n){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var o=t.get("align"),r=t.get("orient");o&&"auto"!==o||(o="right"===t.get("left")&&"vertical"===r?"right":"left");var a=t.get("selector",!0),l=t.get("selectorPosition",!0);!a||l&&"auto"!==l||(l="horizontal"===r?"end":"start"),this.renderInner(o,t,e,n,a,r,l);var u=Xo(t,n).refContainer,h=t.getBoxLayoutParams(),c=t.get("padding"),d=Yo(h,u,c),p=this.layoutInner(t,o,d,i,a,l),f=Yo(s({width:p.width,height:p.height},h),u,c);this.group.x=f.x-p.x,this.group.y=f.y-p.y,this.group.markRedraw(),this.group.add(this._backgroundEl=Uc(p,t))}},n.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},n.prototype.renderInner=function(t,e,n,i,o,r,s){var l=this.getContentGroup(),u=B(),h=e.get("selectedMode"),c=e.get("triggerEvent"),d=[];n.eachRawSeries(function(t){!t.get("legendHoverLink")&&d.push(t.id)}),WL(e.getData(),function(o,r){var s=this,p=o.get("name");if(!this.newlineDisabled&&(""===p||"\n"===p)){var f=new jL;return f.newline=!0,void l.add(f)}var g=n.getSeriesByName(p)[0];if(!u.get(p))if(g){var m=g.getData(),y=m.getVisual("legendLineStyle")||{},v=m.getVisual("legendIcon"),_=m.getVisual("style"),x=this._createItem(g,p,r,o,e,t,y,_,v,h,i);x.on("click",HL(zd,p,null,i,d)).on("mouseover",HL(Rd,g.name,null,i,d)).on("mouseout",HL(Bd,g.name,null,i,d)),n.ssr&&x.eachChild(function(t){var e=Mv(t);e.seriesIndex=g.seriesIndex,e.dataIndex=r,e.ssrType="legend"}),c&&x.eachChild(function(t){s.packEventData(t,e,g,r,p)}),u.set(p,!0)}else n.eachRawSeries(function(s){var l=this;if(!u.get(p)&&s.legendVisualProvider){var f=s.legendVisualProvider;if(!f.containName(p))return;var g=f.indexOfName(p),m=f.getItemVisual(g,"style"),y=f.getItemVisual(g,"legendIcon"),v=oe(m.fill);v&&0===v[3]&&(v[3]=.2,m=a(a({},m),{fill:le(v,"rgba")}));var _=this._createItem(s,p,r,o,e,t,{},m,y,h,i);_.on("click",HL(zd,null,p,i,d)).on("mouseover",HL(Rd,null,p,i,d)).on("mouseout",HL(Bd,null,p,i,d)),n.ssr&&_.eachChild(function(t){var e=Mv(t);e.seriesIndex=s.seriesIndex,e.dataIndex=r,e.ssrType="legend"}),c&&_.eachChild(function(t){l.packEventData(t,e,s,r,p)}),u.set(p,!0)}},this)},this),o&&this._createSelector(o,e,i,r,s)},n.prototype.packEventData=function(t,e,n,i,o){var r={componentType:"legend",componentIndex:e.componentIndex,dataIndex:i,value:o,seriesIndex:n.seriesIndex};Mv(t).eventData=r},n.prototype._createSelector=function(t,e,n,i,o){var r=this.getSelectorGroup();WL(t,function(t){var i=t.type,o=new Tv({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect",legendId:e.id})}});r.add(o),uo(o,{normal:e.getModel("selectorLabel"),emphasis:e.getModel(["emphasis","selectorLabel"])},{defaultText:t.title}),no(o)})},n.prototype._createItem=function(t,e,n,i,o,r,a,s,l,u,h){var c,d,p,f=t.visualDrawType,g=o.get("itemWidth"),m=o.get("itemHeight"),y=o.isSelected(e),x=i.get("symbolRotate"),w=i.get("symbolKeepAspect"),b=i.get("icon"),S=function(t,e,n,i,o,r,a){function s(t,e){"auto"===t.lineWidth&&(t.lineWidth=e.lineWidth>0?2:0),WL(t,function(n,i){"inherit"===t[i]&&(t[i]=e[i])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),h=0===t.lastIndexOf("empty",0)?"fill":"stroke",c=l.getShallow("decal");u.decal=c&&"inherit"!==c?nl(c,a):i.decal,"inherit"===u.fill&&(u.fill=i[o]),"inherit"===u.stroke&&(u.stroke=i[h]),"inherit"===u.opacity&&(u.opacity=("fill"===o?i:n).opacity),s(u,i);var d=e.getModel("lineStyle"),p=d.getLineStyle();if(s(p,n),"auto"===u.fill&&(u.fill=i.fill),"auto"===u.stroke&&(u.stroke=i.fill),"auto"===p.stroke&&(p.stroke=i.fill),!r){var f=e.get("inactiveBorderWidth");u.lineWidth="auto"===f?i.lineWidth>0&&u[h]?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),p.stroke=d.get("inactiveColor"),p.lineWidth=d.get("inactiveWidth")}return{itemStyle:u,lineStyle:p}}(l=b||l||"roundRect",i,a,s,f,y,h),T=new jL,M=i.getModel("textStyle");if(!v(t.getLegendIcon)||b&&"inherit"!==b){var C="inherit"===b&&t.getData().getVisual("symbol")?"inherit"===x?t.getData().getVisual("symbolRotate"):x:0;T.add(((p=Es(d=(c={itemWidth:g,itemHeight:m,icon:l,iconRotate:C,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:w}).icon||"roundRect",0,0,c.itemWidth,c.itemHeight,c.itemStyle.fill,c.symbolKeepAspect)).setStyle(c.itemStyle),p.rotation=(c.iconRotate||0)*Math.PI/180,p.setOrigin([c.itemWidth/2,c.itemHeight/2]),d.indexOf("empty")>-1&&(p.style.stroke=p.style.fill,p.style.fill=X_.color.neutral00,p.style.lineWidth=2),p))}else T.add(t.getLegendIcon({itemWidth:g,itemHeight:m,icon:l,iconRotate:x,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:w}));var k="left"===r?g+5:-5,I=r,L=o.get("formatter"),P=e;_(L)&&L?P=L.replace("{name}",null!=e?e:""):v(L)&&(P=L(e));var D=y?M.getTextColor():i.get("inactiveColor");T.add(new Tv({style:co(M,{text:P,x:k,y:m/2,fill:D,align:I,verticalAlign:"middle"},{inheritColor:D})}));var A=new mv({shape:T.getBoundingRect(),style:{fill:"transparent"}}),O=i.getModel("tooltip");return O.get("show")&&is({el:A,componentModel:o,itemName:e,itemTooltipOption:O.option}),T.add(A),T.eachChild(function(t){t.silent=!0}),A.silent=!u,this.getContentGroup().add(T),no(T),T.__legendDataIndex=n,T},n.prototype.layoutInner=function(t,e,n,i,o,r){var a=this.getContentGroup(),s=this.getSelectorGroup();F_(t.get("orient"),a,t.get("itemGap"),n.width,n.height);var l=a.getBoundingRect(),u=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),o){F_("horizontal",s,t.get("selectorItemGap",!0));var h=s.getBoundingRect(),c=[-h.x,-h.y],d=t.get("selectorButtonGap",!0),p=t.getOrient().index,f=0===p?"width":"height",g=0===p?"height":"width",m=0===p?"y":"x";"end"===r?c[p]+=l[f]+d:u[p]+=h[f]+d,c[1-p]+=l[g]/2-h[g]/2,s.x=c[0],s.y=c[1],a.x=u[0],a.y=u[1];var y={x:0,y:0};return y[f]=l[f]+d+h[f],y[g]=Math.max(l[g],h[g]),y[m]=Math.min(0,h[m]+c[1-p]),y}return a.x=u[0],a.y=u[1],this.group.getBoundingRect()},n.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},n.type="legend.plain",n}(ww);const UL=GL,YL=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}var i;return e(n,t),n.prototype.setScrollDataIndex=function(t){this.option.scrollDataIndex=t},n.prototype.init=function(e,n,i){var o=Jo(e);t.prototype.init.call(this,e,n,i),Hd(this,e,o)},n.prototype.mergeOption=function(e,n){t.prototype.mergeOption.call(this,e,n),Hd(this,this.option,e)},n.type="legend.scroll",n.defaultOption=(i={scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:X_.color.accent50,pageIconInactiveColor:X_.color.accent10,pageIconSize:15,pageTextStyle:{color:X_.color.tertiary},animationDurationUpdate:800},r(r({},ZL.defaultOption,!0),i,!0)),n}(ZL);var XL=Em,qL=["width","height"],KL=["x","y"],$L=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.newlineDisabled=!0,e._currentIndex=0,e}return e(n,t),n.prototype.init=function(){t.prototype.init.call(this),this.group.add(this._containerGroup=new XL),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new XL)},n.prototype.resetInner=function(){t.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},n.prototype.renderInner=function(e,n,i,o,r,a,s){function l(t,e){var i=t+"DataIndex",r=$a(n.get("pageIcons",!0)[n.getOrient().name][e],{onclick:_f(u._pageGo,u,i,n,o)},{x:-d[0]/2,y:-d[1]/2,width:d[0],height:d[1]});r.name=t,h.add(r)}var u=this;t.prototype.renderInner.call(this,e,n,i,o,r,a,s);var h=this._controllerGroup,c=n.get("pageIconSize",!0),d=y(c)?c:[c,c];l("pagePrev",0);var p=n.getModel("pageTextStyle");h.add(new Tv({name:"pageText",style:{text:"xx/xx",fill:p.getTextColor(),font:p.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),l("pageNext",1)},n.prototype.layoutInner=function(t,e,n,i,r,a){var s=this.getSelectorGroup(),l=t.getOrient().index,u=qL[l],h=KL[l],c=qL[1-l],d=KL[1-l];r&&F_("horizontal",s,t.get("selectorItemGap",!0));var p=t.get("selectorButtonGap",!0),f=s.getBoundingRect(),g=[-f.x,-f.y],m=o(n);r&&(m[u]=n[u]-f[u]-p);var y=this._layoutContentAndController(t,i,m,l,u,c,d,h);if(r){if("end"===a)g[l]+=y[u]+p;else{var v=f[u]+p;g[l]-=v,y[h]-=v}y[u]+=f[u]+p,g[1-l]+=y[d]+y[c]/2-f[c]/2,y[c]=Math.max(y[c],f[c]),y[d]=Math.min(y[d],f[d]+g[1-l]),s.x=g[0],s.y=g[1],s.markRedraw()}return y},n.prototype._layoutContentAndController=function(t,e,n,i,o,r,a,s){var l=this.getContentGroup(),u=this._containerGroup,h=this._controllerGroup;F_(t.get("orient"),l,t.get("itemGap"),i?n.width:null,i?null:n.height),F_("horizontal",h,t.get("pageButtonItemGap",!0));var c=l.getBoundingRect(),d=h.getBoundingRect(),p=this._showController=c[o]>n[o],f=[-c.x,-c.y];e||(f[i]=l[s]);var g=[0,0],m=[-d.x,-d.y],y=L(t.get("pageButtonGap",!0),t.get("itemGap",!0));p&&("end"===t.get("pageButtonPosition",!0)?m[i]+=n[o]-d[o]:g[i]+=d[o]+y),m[1-i]+=c[r]/2-d[r]/2,l.setPosition(f),u.setPosition(g),h.setPosition(m);var v={x:0,y:0};if(v[o]=p?n[o]:c[o],v[r]=Math.max(c[r],d[r]),v[a]=Math.min(0,d[a]+m[1-i]),u.__rectSize=n[o],p){var _={x:0,y:0};_[o]=Math.max(n[o]-d[o]-y,0),_[r]=v[r],u.setClipPath(new mv({shape:_})),u.__rectSize=_[o]}else h.eachChild(function(t){t.attr({invisible:!0,silent:!0})});var x=this._getPageInfo(t);return null!=x.pageIndex&&Ia(l,{x:x.contentPosition[0],y:x.contentPosition[1]},p?t:null),this._updatePageInfoView(t,x),v},n.prototype._pageGo=function(t,e,n){var i=this._getPageInfo(e)[t];null!=i&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:e.id})},n.prototype._updatePageInfoView=function(t,e){var n=this._controllerGroup;c(["pagePrev","pageNext"],function(i){var o=null!=e[i+"DataIndex"],r=n.childOfName(i);r&&(r.setStyle("fill",t.get(o?"pageIconColor":"pageIconInactiveColor",!0)),r.cursor=o?"pointer":"default")});var i=n.childOfName("pageText"),o=t.get("pageFormatter"),r=e.pageIndex,a=null!=r?r+1:0,s=e.pageCount;i&&o&&i.setStyle("text",_(o)?o.replace("{current}",null==a?"":a+"").replace("{total}",null==s?"":s+""):o({current:a,total:s}))},n.prototype._getPageInfo=function(t){function e(t){if(t){var e=t.getBoundingRect(),n=e[l]+t[l];return{s:n,e:n+e[s],i:t.__legendDataIndex}}}function n(t,e){return t.e>=e&&t.s<=e+r}var i=t.get("scrollDataIndex",!0),o=this.getContentGroup(),r=this._containerGroup.__rectSize,a=t.getOrient().index,s=qL[a],l=KL[a],u=this._findTargetItemIndex(i),h=o.children(),c=h[u],d=h.length,p=d?1:0,f={contentPosition:[o.x,o.y],pageCount:p,pageIndex:p-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!c)return f;var g=e(c);f.contentPosition[a]=-g.s;for(var m=u+1,y=g,v=g,_=null;m<=d;++m)(!(_=e(h[m]))&&v.e>y.s+r||_&&!n(_,y.s))&&(y=v.i>y.i?v:_)&&(null==f.pageNextDataIndex&&(f.pageNextDataIndex=y.i),++f.pageCount),v=_;for(m=u-1,y=g,v=g,_=null;m>=-1;--m)(_=e(h[m]))&&n(v,_.s)||!(y.i=0;u--){var p,f,g;if(g=null!=(f=Mn((p=n[u]).id,null))?o.get(f):null){d=cP(m=g.parent);var m,y={},v=qo(g,p,m===i?{width:r,height:a}:{width:d.width,height:d.height},null,{hv:p.hv,boundingMode:p.bounding},y);if(!cP(g).isNew&&v){for(var _=p.transition,x={},w=0;w=0)?x[b]=S:g[b]=S}Ia(g,x,t,0)}else g.attr(y)}}},n.prototype._clear=function(){var t=this,e=this._elMap;e.each(function(n){op(n,cP(n).option,e,t._lastGraphicModel)}),this._elMap=B()},n.prototype.dispose=function(){this._clear()},n.type="graphic",n}(ww),pP=Math.sin,fP=Math.cos,gP=Math.PI,mP=2*Math.PI,yP=180/gP;const vP=function(){function t(){}return t.prototype.reset=function(t){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,t||4)},t.prototype.moveTo=function(t,e){this._add("M",t,e)},t.prototype.lineTo=function(t,e){this._add("L",t,e)},t.prototype.bezierCurveTo=function(t,e,n,i,o,r){this._add("C",t,e,n,i,o,r)},t.prototype.quadraticCurveTo=function(t,e,n,i){this._add("Q",t,e,n,i)},t.prototype.arc=function(t,e,n,i,o,r){this.ellipse(t,e,n,n,0,i,o,r)},t.prototype.ellipse=function(t,e,n,i,o,r,a,s){var l,u=a-r,h=!s,c=Math.abs(u),d=de(c-mP)||(h?u>=mP:-u>=mP),p=u>0?u%mP:u%mP+mP;l=!!d||!de(c)&&p>=gP==!!h;var f=t+n*fP(r),g=e+i*pP(r);this._start&&this._add("M",f,g);var m=Math.round(o*yP);if(d){var y=1/this._p,v=(h?1:-1)*(mP-y);this._add("A",n,i,m,1,+h,t+n*fP(r+v),e+i*pP(r+v)),y>.01&&this._add("A",n,i,m,0,+h,f,g)}else{var _=t+n*fP(a),x=e+i*pP(a);this._add("A",n,i,m,+l,+h,_,x)}},t.prototype.rect=function(t,e,n,i){this._add("M",t,e),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},t.prototype.closePath=function(){this._d.length>0&&this._add("Z")},t.prototype._add=function(t,e,n,i,o,r,a,s,l){for(var u=[],h=this._p,c=1;c"].join(i):""}(o.cssNodes,o.cssAnims,{newline:!0});if(u){var h=sp("style","stl",{},[],u);r.push(h)}}return hp(n,i,r,t.useViewBox)},t.prototype.renderToString=function(t){return lp(this.renderToVNode({animation:L((t=t||{}).cssAnimation,!0),emphasis:L(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:L(t.useViewBox,!0)}),{newline:!0})},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t},t.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},t.prototype._paintList=function(t,e,n){for(var i,o,r=t.length,a=[],s=0,l=0,u=0;u=0&&(!c||!o||c[f]!==o[f]);f--);for(var g=p-1;g>f;g--)i=a[--s-1];for(var m=f+1;m=s)}}if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;for(var r,a=[],s=this.maxRepaintRectCount,l=!1,u=new lg(0,0,0,0),h=this.__startIndex;h15)break}n.prevElClipPaths&&c.restore()};if(p)if(0===p.length)s=h.__endIndex;else for(var x=d.dpr,w=0;w0&&t>i[0]){for(s=0;st);s++);a=n[i[s]]}if(i.splice(s+1,0,t),n[t]=e,!e.virtual)if(a){var l=a.dom;l.nextSibling?r.insertBefore(e.dom,l.nextSibling):r.appendChild(e.dom)}else r.firstChild?r.insertBefore(e.dom,r.firstChild):r.appendChild(e.dom);e.painter||(e.painter=this)}},t.prototype.eachLayer=function(t,e){for(var n=this._zlevelList,i=0;i0?HP:0),this._needsManuallyCompositing),h.__builtin__||i("ZLevel "+u+" has been used by unkown layer "+h.id),h!==a&&(h.__used=!0,h.__startIndex!==r&&(h.__dirty=!0),h.__startIndex=r,h.__drawIndex=h.incremental?-1:r,e(r),a=h),1&l.__dirty&&!l.__inHover&&(h.__dirty=!0,h.incremental&&h.__drawIndex<0&&(h.__drawIndex=r))}e(r),this.eachBuiltinLayer(function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)})},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(t){t.clear()},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t,c(this._layers,function(t){t.setUnpainted()})},t.prototype.configLayer=function(t,e){if(e){var n=this._layerConfig;n[t]?r(n[t],e,!0):n[t]=e;for(var i=0;i{let r="right";return o.viewSize[0]-t[0]"graph"===t.componentSubType?"edge"===t.dataType?e.utils.getLinkTooltipInfo(t.data):e.utils.getNodeTooltipInfo(t.data):"lines"===t.componentSubType?e.utils.getLinkTooltipInfo(t.data.link):e.utils.getNodeTooltipInfo(t.data.node)}},n.echartsOption);return i.setOption(e.utils.deepMergeObj(o,t)),i.on("click",t=>{const i=n.onClickElement.bind(e);e.utils.addActionToUrl(e,t),"graph"!==t.componentSubType?"lines"!==t.componentSubType?t.data.cluster||(n.mapOptions?.nodePopup?.show&&e.gui.loadNodePopup(t.data.node),i("node",t.data.node)):i("link",t.data.link):i("edge"===t.dataType?"link":"node",t.data)},{passive:!0}),i}generateGraphOption(t,e){const n=[],i=e.config,o=t.nodes.map(t=>{const n=e.utils.fastDeepCopy(t),{nodeStyleConfig:o,nodeSizeConfig:r,nodeEmphasisConfig:a}=e.utils.getNodeStyle(t,i,"graph");n.itemStyle=o,n.symbolSize=r,n.emphasis={itemStyle:a.nodeStyle,symbolSize:a.nodeSize};let s="";return"string"==typeof t.label?s=t.label:"string"==typeof t.name?s=t.name:null!=t.id&&(s=String(t.id)),n.name=s,n._source=e.utils.fastDeepCopy(t),n}),r=t.links.map(t=>{const n=e.utils.fastDeepCopy(t),{linkStyleConfig:o,linkEmphasisConfig:r}=e.utils.getLinkStyle(t,i,"graph");return n.lineStyle=o,n.emphasis={lineStyle:r.linkStyle},n}),a={...i.graphConfig.series},s={...a.label||{}};if("number"==typeof e.config.showGraphLabelsAtZoom&&e.config.showGraphLabelsAtZoom>0){const t=e.config.showGraphLabelsAtZoom;s.formatter=n=>(()=>{try{const t=e.echarts.getOption(),n=(Array.isArray(t.series)?t.series:[]).find(t=>t&&"network-graph"===t.id);return n&&"number"==typeof n.zoom?n.zoom:1}catch(t){return 1}})()>=t&&n&&n.data&&n.data.name||""}a.label=s;const l=[{...a,id:"network-graph",type:"graph",layout:i.graphConfig.series.layout||"force",nodes:o,links:r}];return{legend:n.length?{data:n}:void 0,series:l,...i.graphConfig.baseOptions}}generateMapOption(t,e,n=[]){const i=e.config,{nodes:o,links:r}=t,a=t.flatNodes||{},s=[];let l=[];o.forEach(n=>{if(n.properties&&(t.flatNodes||(a[n.id]=e.utils.fastDeepCopy(n))),!n.properties||!n.properties._featureType||"Point"===n.properties._featureType)if(n.properties){const{location:t}=n.properties;if(t&&t.lng&&t.lat){const{nodeEmphasisConfig:o}=e.utils.getNodeStyle(n,i,"map");let r="";"string"==typeof n.label?r=n.label:"string"==typeof n.name?r=n.name:null!=n.id&&(r=String(n.id)),l.push({name:r,value:[t.lng,t.lat],emphasis:{itemStyle:o.nodeStyle,symbolSize:o.nodeSize},node:n,_source:e.utils.fastDeepCopy(n)})}else console.error(`Node ${n.id} position is undefined!`)}else console.error(`Node ${n.id} position is undefined!`)}),r.forEach(t=>{if(a[t.source])if(a[t.target]){const{linkStyleConfig:n,linkEmphasisConfig:o}=e.utils.getLinkStyle(t,i,"map");s.push({coords:[[a[t.source].properties.location.lng,a[t.source].properties.location.lat],[a[t.target].properties.location.lng,a[t.target].properties.location.lat]],lineStyle:n,emphasis:{lineStyle:o.linkStyle},link:t})}else console.warn(`Node ${t.target} does not exist!`);else console.warn(`Node ${t.source} does not exist!`)}),l=l.concat(n);const u=[{id:"geo-map",type:"scatter",name:"nodes",coordinateSystem:"leaflet",data:l,label:{...i.mapOptions.nodeConfig.label||{},...!1===i.showMapLabelsAtZoom?{show:!1}:{},silent:!0},itemStyle:{color:t=>{if(t.data&&t.data.cluster&&t.data.itemStyle&&t.data.itemStyle.color)return t.data.itemStyle.color;if(t.data&&t.data.node&&t.data.node.category){const e=i.nodeCategories.find(e=>e.name===t.data.node.category);return e&&e.nodeStyle&&e.nodeStyle.color||i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeStyle&&i.mapOptions.nodeConfig.nodeStyle.color||"#6c757d"}return i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeStyle&&i.mapOptions.nodeConfig.nodeStyle.color||"#6c757d"}},symbolSize:(t,n)=>{if(n.data&&n.data.cluster)return i.mapOptions.clusterConfig&&i.mapOptions.clusterConfig.symbolSize||30;if(n.data&&n.data.node){const{nodeSizeConfig:t}=e.utils.getNodeStyle(n.data.node,i,"map");return"object"==typeof t?i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeSize||17:t}return i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeSize||17},emphasis:i.mapOptions.nodeConfig.emphasis},Object.assign(i.mapOptions.linkConfig,{id:"map-links",type:"lines",coordinateSystem:"leaflet",data:s})];return{leaflet:{tiles:i.mapTileConfig,mapOptions:i.mapOptions},series:u,...i.mapOptions.baseOptions}}_propagateGraphZoom(t){const e=t.echarts.getDom&&t.echarts.getDom();if(!e)return;const n=e.querySelector("canvas");e.addEventListener("wheel",t=>{if(!n)return;const i=e.getBoundingClientRect();if(t.clientXi.right||t.clientYi.bottom)return;t.preventDefault();const o=n.getBoundingClientRect();n.dispatchEvent(new WheelEvent("wheel",{bubbles:!0,cancelable:!0,view:window,clientX:o.left+o.width/2,clientY:o.top+o.height/2,deltaY:-t.deltaY,deltaMode:t.deltaMode}))},{passive:!1})}graphRender(t,e){e.utils.echartsSetOption(e.utils.generateGraphOption(t,e),e),window.onresize=()=>{e.echarts.resize()},e.utils._propagateGraphZoom(e),e.config.showGraphLabelsAtZoom>0&&e.echarts.on("graphRoam",t=>{if(!t||!t.zoom)return;const n=e.echarts.getOption(),i=n&&n.series&&n.series[0]&&n.series[0].zoom>=e.config.showGraphLabelsAtZoom;i!==e._labelsVisible&&(e.echarts.resize({animation:!1,silent:!0}),e._labelsVisible=i)}),e.utils.setupHashChangeHandler(e),e.event.emit("onLoad"),e.event.emit("onReady"),e.event.emit("renderArray"),e.event.emit("applyUrlFragmentState")}mapRender(t,e){const n=xl();if(!n)throw new Error("Leaflet api is not loaded");const{circleMarker:i,latLngBounds:o}=n;if(!e.config.mapTileConfig[0])throw new Error('You must add the tiles via the "mapTileConfig" param!');e.utils.isGeoJSON(t)&&(e.originalGeoJSON=e.utils.fastDeepCopy(t),t=e.utils.geojsonToNetjson(t));const r=e.utils.generateMapOption(t,e);if(e.utils.echartsSetOption(r,e),e.bboxData={nodes:[],links:[]},e.leaflet=e.echarts._api.getCoordinateSystems()[0].getLeaflet(),e.leaflet._zoomAnimated=!1,e.config.geoOptions=e.utils.deepMergeObj({pointToLayer:(t,n)=>i(n,e.config.geoOptions.style),onEachFeature:(t,n)=>{n.on("click",()=>{const n={...t.properties};e.config.onClickElement.call(e,"Feature",n)})}},e.config.geoOptions),e.originalGeoJSON){!function(t){if(!t.originalGeoJSON||!Array.isArray(t.originalGeoJSON.features))return;const e=xl();if(!e)return;const{geoJSON:n}=e,i=t.leaflet,o=t.originalGeoJSON.features.filter(t=>t&&t.geometry&&("Polygon"===t.geometry.type||"MultiPolygon"===t.geometry.type));if(!o.length)return;let r=i.getPane("njg-polygons");r||(r=i.createPane("njg-polygons"),r.style.zIndex=410);const a={fillColor:"#1566a9",color:"#1566a9",weight:0,fillOpacity:.6},s=n({type:"FeatureCollection",features:o},{pane:"njg-polygons",style:e=>{const n=e.properties&&e.properties.echartsStyle||{},i={...a,...t.config.geoOptions&&t.config.geoOptions.style};return n.areaColor&&(i.fillColor=n.areaColor),n.color&&(i.color=n.color),void 0!==n.opacity&&(i.fillOpacity=n.opacity),void 0!==n.borderWidth&&(i.weight=n.borderWidth),i},onEachFeature:(e,n)=>{n.on("click",()=>{t.config.onClickElement.call(t,"Feature",e.properties||{})})},...t.config.geoOptions}).addTo(i);t.leaflet.polygonGeoJSON=s}(e);let n=null;if(e.leaflet.polygonGeoJSON&&"function"==typeof e.leaflet.polygonGeoJSON.getBounds&&(n=e.leaflet.polygonGeoJSON.getBounds()),t.nodes&&t.nodes.length){const e=t.nodes.map(t=>t.properties.location).map(t=>[t.lat,t.lng]);n?e.forEach(t=>n.extend(t)):n=o(e)}n&&n.isValid()&&e.leaflet.fitBounds(n,{padding:[20,20]})}if(e.utils.updateLabelVisibility(e,!0),e.leaflet.on("zoomend",()=>{e.utils.updateLabelVisibility(e,!0);const t=e.leaflet.getZoom(),n=e.leaflet.getMinZoom(),i=e.leaflet.getMaxZoom(),o=document.querySelector(".leaflet-control-zoom-in"),r=document.querySelector(".leaflet-control-zoom-out");o&&r&&(Math.round(t)>=i?o.classList.add("leaflet-disabled"):o.classList.remove("leaflet-disabled"),Math.round(t)<=n?r.classList.add("leaflet-disabled"):r.classList.remove("leaflet-disabled"))}),e.leaflet.on("moveend",async()=>{const n=e.leaflet.getBounds();if(e.leaflet.getZoom()>=e.config.loadMoreAtZoomLevel&&e.hasMoreData){const i=await e.utils.getBBoxData.call(e,e.JSONParam,n);e.config.prepareData.call(e,i);const o=new Set(e.data.nodes.map(t=>t.id)),r=new Set(e.data.links.map(t=>t.source)),a=new Set(e.data.links.map(t=>t.target)),s=i.nodes.filter(t=>!o.has(t.id)),l=i.links.filter(t=>!r.has(t.source)&&!a.has(t.target)),u=new Set(i.nodes.map(t=>t.id)),h=e.bboxData.nodes.filter(t=>!u.has(t.id)),c=new Set(h.map(t=>t.id));t.nodes=t.nodes.filter(t=>!c.has(t.id)),e.bboxData.nodes=e.bboxData.nodes.concat(s),e.bboxData.links=e.bboxData.links.concat(l),t={...t,nodes:t.nodes.concat(s),links:t.links.concat(l)},e.echarts.setOption(e.utils.generateMapOption(t,e)),e.data=t}else e.hasMoreData&&e.bboxData.nodes.length>0&&(()=>{const n=new Set(e.bboxData.nodes),i=new Set(e.bboxData.links);t={...t,nodes:t.nodes.filter(t=>!n.has(t)),links:t.links.filter(t=>!i.has(t))},e.data=t,e.echarts.setOption(e.utils.generateMapOption(t,e)),e.bboxData.nodes=[],e.bboxData.links=[]})()}),e.config.clustering&&e.config.clusteringThresholde.config.disableClusteringAtLevel&&(n=[],i=t.nodes,o=t.links),e.echarts.setOption(e.utils.generateMapOption({...t,nodes:i,links:o},e,n)),e.utils.updateLabelVisibility(e,!0),e.echarts.on("click",t=>{if(("scatter"===t.componentSubType||"effectScatter"===t.componentSubType)&&t.data.cluster){const n=e.leaflet.getZoom(),i=Math.min(n+2,e.leaflet.getMaxZoom());e.leaflet.setView([t.data.value[1],t.data.value[0]],i)}}),e.leaflet.on("zoomend",()=>{if(e.leaflet.getZoom(){e.echarts.appendData({seriesIndex:n,data:t.data})}),e.utils.mergeData(t,e)),e.config.afterUpdate.call(e)}addData(t,e){e.utils.mergeData(t,e),e.data.nodes&&e.data.nodes.length>0&&(e.data.nodes=e.utils.deduplicateNodesById(e.data.nodes)),e.utils.render(),e.config.afterUpdate.call(e)}mergeData(t,e){t.nodes||(t.nodes=[]);const n=new Set;e.data.nodes.forEach(t=>{t.id&&n.add(t.id)});const i=t.nodes.filter(t=>!t.id||!n.has(t.id)||(console.warn(`Duplicate node ID ${t.id} detected during merge and skipped.`),!1)),o=e.data.nodes.concat(i),r=e.data.links.concat(t.links||[]);Object.assign(e.data,t,{nodes:o,links:r})}},UP=class{constructor(t){this.self=t,this.renderModeSelector=null,this.controls=null,this.sideBar=null,this.metaInfoContainer=null,this.nodeLinkInfoContainer=null}createControls(){const t=document.createElement("div");return t.setAttribute("class","njg-controls"),this.self.el.appendChild(t),t}createRenderModeSelector(){const t=document.createElement("div"),e=document.createElement("span");return e.setAttribute("class","iconfont icon-eye"),t.setAttribute("class","njg-selectIcon"),t.appendChild(e),this.controls.appendChild(t),t}createSideBar(){const t=document.createElement("div");t.setAttribute("class","njg-sideBar"),t.classList.add("hidden");const e=document.createElement("button");return t.appendChild(e),e.classList.add("sideBarHandle"),e.onclick=()=>{t.classList.toggle("hidden");const e=document.querySelector(".njg-metaInfoContainer");(this.self.config.showMetaOnNarrowScreens||this.self.el.clientWidth>850)&&e&&(e.style.display="flex")},this.self.el.appendChild(t),t}hideInfoOnNarrowScreen(){!this.self.config.showMetaOnNarrowScreens&&this.self.el.clientWidth<850&&(this.metaInfoContainer.style.display="none"),"none"===this.metaInfoContainer.style.display&&"none"===this.nodeLinkInfoContainer.style.display&&this.sideBar.classList.add("hidden")}createMetaInfoContainer(){const t=document.createElement("div"),e=document.createElement("h2"),n=document.createElement("div");n.classList.add("njg-metaData"),t.classList.add("njg-metaInfoContainer");const i=document.createElement("span");return i.classList.add("njg-closeButton"),e.innerHTML="Info",i.innerHTML=" ✕",e.appendChild(i),t.appendChild(e),t.appendChild(n),this.metaInfoContainer=t,this.sideBar.appendChild(t),this.nodeLinkInfoContainer=this.createNodeLinkInfoContainer(),this.hideInfoOnNarrowScreen(),window.addEventListener("resize",this.hideInfoOnNarrowScreen.bind(this)),i.onclick=()=>{this.metaInfoContainer.style.display="none","none"===this.nodeLinkInfoContainer.style.display&&this.sideBar.classList.add("hidden")},t}createNodeLinkInfoContainer(){const t=document.createElement("div");return t.classList.add("njg-nodeLinkInfoContainer"),t.style.display="none",this.sideBar.appendChild(t),t}getNodeLinkInfo(t,e){const n=document.querySelectorAll(".njg-infoContainer"),i=document.querySelectorAll(".njg-headerContainer");for(let t=0;t"clients"===t?"Clients":/^clients\s*\[\d+\]$/i.test(t)?t.replace(/^clients/i,"Client"):"localAddresses"===t?"Local Addresses":t.replace(/_/g," "),u=(t,e,n,i=0)=>{if(null==n||"string"==typeof n&&(""===n.trim()||/^(undefined|null)$/i.test(n.trim()))&&"0"!==n)return;if(Array.isArray(n)){if(0===n.length){const n=document.createElement("div");n.classList.add("njg-infoItems"),n.style.paddingLeft=12*i+"px";const o=document.createElement("span");o.setAttribute("class","njg-keyLabel");const r=document.createElement("span");return r.setAttribute("class","njg-valueLabel"),o.innerHTML=l(e),r.innerHTML="[]",n.appendChild(o),n.appendChild(r),void t.appendChild(n)}if(n.every(t=>"object"!=typeof t||null===t)){const o=document.createElement("div");o.classList.add("njg-infoItems"),o.style.paddingLeft=12*i+"px";const r=document.createElement("span");r.setAttribute("class","njg-keyLabel");const a=document.createElement("span");return a.setAttribute("class","njg-valueLabel"),r.innerHTML=l(e),a.innerHTML=n.map(t=>"string"==typeof t?t.replace(/\n/g,"
"):String(t)).join("
"),o.appendChild(r),o.appendChild(a),void t.appendChild(o)}return void n.forEach((n,o)=>{u(t,`${e} [${o+1}]`,n,i)})}if("object"==typeof n){if("location"===e&&"number"==typeof n.lat&&"number"==typeof n.lng){const e=document.createElement("div");e.classList.add("njg-infoItems"),e.style.paddingLeft=12*i+"px";const o=document.createElement("span");o.setAttribute("class","njg-keyLabel");const r=document.createElement("span");return r.setAttribute("class","njg-valueLabel"),o.innerHTML="Location",r.innerHTML=`${Math.round(1e3*n.lat)/1e3}, ${Math.round(1e3*n.lng)/1e3}`,e.appendChild(o),e.appendChild(r),void t.appendChild(e)}const o=document.createElement("div");o.classList.add("njg-infoItems"),o.style.paddingLeft=12*i+"px";const r=document.createElement("span");r.setAttribute("class","njg-keyLabel");const a=document.createElement("span");return a.setAttribute("class","njg-valueLabel"),r.innerHTML=l(e),a.innerHTML="",o.appendChild(r),o.appendChild(a),t.appendChild(o),void Object.keys(n).forEach(e=>{u(t,e,n[e],i+1)})}const o=document.createElement("div");o.classList.add("njg-infoItems"),o.style.paddingLeft=12*i+"px";const r=document.createElement("span");r.setAttribute("class","njg-keyLabel");const a=document.createElement("span");a.setAttribute("class","njg-valueLabel"),r.innerHTML=l(e);const s="string"==typeof n?n.replace(/\n/g,"
"):String(n);a.innerHTML=s,o.appendChild(r),o.appendChild(a),t.appendChild(o)};Object.keys(e).forEach(t=>u(r,t,e[t],0)),o.appendChild(a),o.appendChild(s),this.nodeLinkInfoContainer.appendChild(o),this.nodeLinkInfoContainer.appendChild(r),s.onclick=()=>{this.nodeLinkInfoContainer.style.display="none",null!==this.metaInfoContainer&&"none"!==this.metaInfoContainer.style.display||this.sideBar.classList.add("hidden")}}async loadNodePopup(t){if(!this.self.leaflet)return void console.error("Leaflet map not available. Cannot load popup.");this.self.echarts?.setOption({media:[{option:{tooltip:{show:!1}}}]}),this.self.utils.updateLabelVisibility(this.self,!1);const e=t?.properties?.location||t?.location;if(!e)return void console.error("Node location not available. Cannot load popup.");const n=this.self.config.bookmarkableActions&&this.self.config.bookmarkableActions.id;let i=this.self.config.mapOptions.nodePopup.content;if(null==i)i=this.createDefaultPopupContent(t);else if("function"==typeof i){const e=i.call(this,t,this.self);this.self.leaflet.currentPopupRequest=e;try{i=await e}catch(t){if(this.self.utils.removeUrlFragment(n,"nodeId"),this.self.leaflet.currentPopupRequest!==e)return;return void console.error("Failed to build node popup content:",t)}if(this.self.leaflet.currentPopupRequest!==e)return void this.self.utils.removeUrlFragment(n,"nodeId")}const o=Object.fromEntries(Object.entries(this.self.config.mapOptions.nodePopup.config||{}).filter(([,t])=>null!=t)),r=window.L.popup({...o}).setLatLng(e).setContent(i).openOn(this.self.leaflet);this.self.leaflet.currentPopup=r;const{onOpen:a}=this.self.config.mapOptions.nodePopup;if(a&&"function"==typeof a)try{a.call(this,this.self)}catch(t){this.self.utils.removeUrlFragment(n,"nodeId"),console.error("Failed to run popup onOpen callback:",t)}const s=r.getElement()?.querySelector(".leaflet-popup-close-button");s?.addEventListener("click",()=>{this.self.echarts?.setOption({media:[{option:{tooltip:{show:!0}}}]}),this.self.utils.updateLabelVisibility(this.self,!0),this.self.utils.removeUrlFragment(n,"nodeId")})}createDefaultPopupContent(t){const e=document.createElement("div");e.classList.add("default-popup");const n=t?.location||t?.properties?.location,i=Number(n?.lat),o=Number(n?.lng),r=Number.isFinite(i)&&Number.isFinite(o),a={name:t?.name,id:t?.id,label:t?.label,location:r?`${i.toFixed(8)}, ${o.toFixed(8)}`:null};return Object.keys(a).forEach(t=>{const n=a[t];if(!n)return;const i=document.createElement("div");i.classList.add("njg-tooltip-item");const o=document.createElement("span");o.classList.add("njg-tooltip-key"),o.textContent=t;const r=document.createElement("span");r.classList.add("njg-tooltip-value"),r.textContent=String(n),i.appendChild(o),i.appendChild(r),e.appendChild(i)}),e}init(){this.sideBar=this.createSideBar(),this.self.config.switchMode&&(this.controls=this.createControls(),this.renderModeSelector=this.createRenderModeSelector())}},YP=function(){function t(t,e){this._map=t,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=e,this._projection=r.Mercator}function e(t,e,n,i){const{leafletModel:o,seriesModel:r}=n,a=o?o.coordinateSystem:r?r.coordinateSystem||(r.getReferringComponents("leaflet")[0]||{}).coordinateSystem:null;return a===this?a[t](i):null}const n=xl();if(!n)throw new Error("Leaflet api is not loaded");const{Layer:i,DomUtil:o,Projection:r,LatLng:a,map:s,control:l,tileLayer:u}=n,h=i.extend({initialize(t){this._container=t},onAdd(t){t.getPane(this.options.pane).appendChild(this._container),t.zoomControl.setPosition("topright")},onRemove(){o.remove(this._container)},_update(){}});return t.dimensions=["lng","lat"],t.prototype.dimensions=["lng","lat"],t.prototype.setZoom=function(t){this._zoom=t},t.prototype.setCenter=function(t){this._center=this._projection.project(new a(t[1],t[0]))},t.prototype.setMapOffset=function(t){this._mapOffset=t},t.prototype.getLeaflet=function(){return this._map},t.prototype.getViewRect=function(){const t=this._api;return new lg(0,0,t.getWidth(),t.getHeight())},t.prototype.getRoamTransform=function(){return[1,0,0,1,0,0]},t.prototype.dataToPoint=function(t){const e=new a(t[1],t[0]),n=this._map.latLngToLayerPoint(e),i=this._mapOffset;return[n.x-i[0],n.y-i[1]]},t.prototype.pointToData=function(t){const e=this._mapOffset,n=this._map.layerPointToLatLng({x:t[0]+e[0],y:t[1]+e[1]});return[n.lng,n.lat]},t.prototype.convertToPixel=m(e,"dataToPoint"),t.prototype.convertFromPixel=m(e,"pointToData"),t.create=function(e,n){let i;const o=[],r=n.getDom();return e.eachComponent("leaflet",e=>{const a=n.getZr().painter.getViewportRoot();if(i)throw new Error("Only one leaflet component can exist");if(!e.__map){let t=r.querySelector(".ec-extension-leaflet");t&&(a.style.left="0px",a.style.top="0px",r.removeChild(t)),t=document.createElement("div"),t.style.cssText="width:100%;height:100%",t.classList.add("ec-extension-leaflet"),r.appendChild(t),e.__map=s(t,e.get("mapOptions"));const n=e.__map,i=e.get("tiles"),o={};let c=!1;if(i.forEach(t=>{const e=u(t.urlTemplate,t.options);t.label?(c||(e.addTo(n),c=!0),o[t.label]=e):e.addTo(n)}),i.length>1){const t=e.get("layerControl");l.layers(o,{},t).addTo(n)}const d=document.createElement("div");d.style="position: absolute;left: 0;top: 0;z-index: 100",d.appendChild(a),new h(d).addTo(n)}i=new t(e.__map,n),o.push(i),i.setMapOffset(e.__mapOffset||[0,0]);const{center:c,zoom:d}=e.get("mapOptions");c&&d&&(i.setZoom(d),i.setCenter(c)),e.coordinateSystem=i}),e.eachSeries(t=>{"leaflet"===t.get("coordinateSystem")&&(t.coordinateSystem=i)}),o},t};Xp.version="1.0.0";const XP=Xp;window.L=t(481);let qP=!1;window.NetJSONGraph=class{constructor(t,e={}){return this.graph=new WT(t),this.config=this.initializeConfig(e),this.graph.setConfig(this.config),this.setupGraph(),this.config.onInit.call(this.graph),this.initializeECharts(),void 0===e.showMapLabelsAtZoom&&void 0!==e.showLabelsAtZoomLevel&&(console.warn("showLabelsAtZoomLevel has been renamed to showMapLabelsAtZoom, please update your code accordingly."),this.graph.config.showMapLabelsAtZoom=e.showLabelsAtZoomLevel),this.graph}initializeConfig(t={}){return{...t,render:"map"===t.render?GP.prototype.mapRender:GP.prototype.graphRender,onInit:this.onInit,onRender:this.onRender,onUpdate:this.onUpdate,afterUpdate:this.afterUpdate,onLoad:this.onLoad}}setupGraph(){Object.setPrototypeOf(GP.prototype,this.graph.utils),this.graph.gui=new UP(this.graph),this.graph.utils=new GP,this.graph.setUtils(),this.graph.event=this.graph.utils.createEvent()}initializeECharts(){qP||(XP(),qP=!0),this.graph.echarts=function(t,e,n){var i=!(n&&n.ssr);if(i){var o=ul(t);if(o)return o}var r=new xT(t,null,n);return r.id="ec_"+OT++,DT[r.id]=r,i&&On(t,zT,r.id),oT(r),HS.trigger("afterinit",r),r}(this.graph.el,0,{renderer:this.graph.config.svgRender?"svg":"canvas"})}onInit(){return this.config}onRender(){return this.utils.showLoading.call(this),this.gui.init(),this.config}onUpdate(){return this.config}afterUpdate(){return this.config}onLoad(){return this.config.metadata&&this.utils.isNetJSON(this.data)?(this.gui.createMetaInfoContainer(this.graph),this.utils.updateMetadata.call(this)):this.gui.nodeLinkInfoContainer=this.gui.createNodeLinkInfoContainer(),this.config.switchMode&&this.utils.isNetJSON(this.data)&&(this.gui.renderModeSelector.onclick=()=>{if(this.config.render===this.utils.mapRender){this.config.render=this.utils.graphRender;const t=this.echarts.getZr().painter.getViewportRoot().parentNode;this.echarts.clear(),this.utils.graphRender(this.data,this),t.style.background=this.echarts.getZr()._backgroundColor,document.querySelector(".leaflet-control-attribution").style.display="none",document.querySelector(".leaflet-control-zoom").style.display="none"}else this.echarts.clear(),this.config.render=this.utils.mapRender,this.utils.mapRender(this.data,this),document.querySelector(".leaflet-control-attribution").style.display="block",document.querySelector(".leaflet-control-zoom").style.display="block"}),this.utils.hideLoading.call(this),this.attachClientsOverlay=t=>function(t,e={}){function n(){u=function(){const t=o.getOption();return t&&t.series&&t.series[0]&&t.series[0].zoom?t.series[0].zoom:1}(),d.attr("invisible",!(u>=l))}function i(){const t=o.getModel().getSeriesByIndex(0);if(!t)return;const e=t.getData();if(!e)return;if(n(),d.removeAll(),u{let r=0;if(0!==n)for(let s=0;rt?"number"==typeof t.clients?t.clients:Array.isArray(t.clients)?t.clients.length:0:0,c=function(){const t=o.getModel().getSeriesByIndex(0);if(!t)return null;const e=(o._chartsViews||[]).find(e=>e&&e.__model&&e.__model.uid===t.uid);return e?e.group:null}();if(!c)return{destroy(){}};const d=new Em({silent:!0,z:100,zlevel:1});c.add(d);const p=t&&t.config&&t.config.graphConfig&&t.config.graphConfig.series||{},f=("number"==typeof p.nodeSize?p.nodeSize:18)/2,g=[["finished",i],["rendered",i],["graphLayoutEnd",i],["graphRoam",()=>{n(),i()}]];return g.forEach(([t,e])=>o.on(t,e)),i(),{destroy(){g.forEach(([t,e])=>{o&&o.off&&o.off(t,e)}),d&&d.parent&&d.parent.remove(d)},setMinZoomLevel(t){l=t,i()},getMinZoomLevel:()=>l}}(this,t),this.config}}})()})(); \ No newline at end of file From 71d6d0194e39e86151da444c03dea9444c7dae33 Mon Sep 17 00:00:00 2001 From: dee077 Date: Fri, 22 May 2026 18:23:17 +0530 Subject: [PATCH 2/4] [fix] Tests and some minor refactoring --- .../device/static/monitoring/js/device-map.js | 65 ++++++------------- .../device/static/monitoring/js/floorplan.js | 3 + .../monitoring/js/lib/netjsongraph.min.js | 2 +- 3 files changed, 24 insertions(+), 46 deletions(-) diff --git a/openwisp_monitoring/device/static/monitoring/js/device-map.js b/openwisp_monitoring/device/static/monitoring/js/device-map.js index 724328739..ea2930eb9 100644 --- a/openwisp_monitoring/device/static/monitoring/js/device-map.js +++ b/openwisp_monitoring/device/static/monitoring/js/device-map.js @@ -56,9 +56,10 @@ }); }; - async function loadPopUpContent(nodeData, netjsongraphInstance) { + async function loadPopUpContent(nodeData) { + const netjsongraphInstance = this; loadingOverlay.show(); - const map = netjsongraphInstance.leaflet; + const map = netjsongraphInstance?.leaflet; const locationId = nodeData?.properties?.id || nodeData.id; let popupContent = null; const url = getLocationDeviceUrl(locationId); @@ -73,7 +74,7 @@ let nextUrl = data.next; let statusFilterButtons = ""; - netjsongraphInstance.leaflet._popupState = { + map._popupState = { devices, nextUrl, url, @@ -156,17 +157,17 @@ function renderRows(netjsongraphInstance, deviceList) { deviceList = deviceList || netjsongraphInstance.leaflet._popupState.devices; - // deviceList = deviceList || devices; const popup = $(".map-detail"); if (deviceList.length === 0) { - popup.find("tbody").html(` + const emptyRow = ` ${gettext("No devices found")} - `); - return ""; + `; + popup.find("tbody").html(emptyRow); + return emptyRow; } const rows = deviceList .map( @@ -186,14 +187,15 @@ return rows; } - function bindPopupEventListener(netjsongraphInstance) { - const currentPopup = netjsongraphInstance.leaflet.currentPopup; + function bindPopupEventListener() { + const netjsongraphInstance = this; + const currentPopup = netjsongraphInstance?.leaflet?.currentPopup; if (!currentPopup) { - console.error("Popup not found, cann't bind event listeners"); + console.error("Popup not found, can't bind event listeners"); return; } let { devices, nextUrl, url, locationId } = - netjsongraphInstance.leaflet._popupState; + netjsongraphInstance?.leaflet?._popupState; const el = $(currentPopup.getElement()); let fetchDevicesTimeout; let loading = false; @@ -231,7 +233,6 @@ url: fetchUrl, xhrFields: { withCredentials: true }, success(data) { - debugger; if (append) { devices = devices.concat(data.results); } else { @@ -350,7 +351,7 @@ closeOnClick: false, autoPan: true, autoPanPadding: [25, 25], - offset: [0, 0], + offset: [0, 8], }, }, }, @@ -403,37 +404,9 @@ fillOpacity: 0.7, }; }, - onEachFeature: function (feature, layer) { - const color = getColor(feature.properties); - feature.properties.status = Object.keys(STATUS_COLORS).find( - (key) => STATUS_COLORS[key] === color, - ); - - layer.on("mouseover", function () { - if (layer._tooltipDisabled) return; - layer.unbindTooltip(); - if (!layer.isPopupOpen()) { - layer.bindTooltip(feature.properties.name).openTooltip(); - } - }); - - layer.on("click", function () { - const clickedLayer = this; - // Close any open Leaflet tooltip before showing the popup - clickedLayer.closeTooltip(); - clickedLayer.unbindTooltip(); - clickedLayer.unbindPopup(); - clickedLayer._tooltipDisabled = true; // block future hovers for this marker - - loadPopUpContent(feature, map); - - // Re-enable tooltip when the popup is closed - map.leaflet.once("popupclose", function () { - clickedLayer._tooltipDisabled = false; - }); - }); - }, }, + // Popup handling is delegated to nodePopup.content, + // so disable the default onClickElement popup behavior. onClickElement: function () {}, onReady: function () { const map = this; @@ -452,7 +425,7 @@ try { const initialZoom = map.leaflet.getZoom(); - const showLabel = initialZoom >= map.config.showLabelsAtZoomLevel; + const showLabel = initialZoom >= map.config.showMapLabelsAtZoom; map.echarts.setOption({ series: [ { @@ -520,7 +493,7 @@ const nodeData = map?.data?.nodes?.[index]; if (index == null || index === -1 || !nodeData) { const id = map.config.bookmarkableActions.id; - map.utils.removeUrlFragment(id); + map.utils.removeUrlFragment(id, "nodeId"); console.error(`Node with ID "${locationId}" not found.`); return; } @@ -571,6 +544,8 @@ ws.onmessage = function (e) { const data = JSON.parse(e.data); const [lng, lat] = data.geometry.coordinates; + const currentPopup = window._owGeoMap?.leaflet?.currentPopup; + const currentPopupLocationId = window._owGeoMap?.leaflet?._popupState?.locationId; if (currentPopup && data.id === currentPopupLocationId) { $(currentPopup.getElement()).hide(); } diff --git a/openwisp_monitoring/device/static/monitoring/js/floorplan.js b/openwisp_monitoring/device/static/monitoring/js/floorplan.js index c2ab3decf..6140cbbe5 100644 --- a/openwisp_monitoring/device/static/monitoring/js/floorplan.js +++ b/openwisp_monitoring/device/static/monitoring/js/floorplan.js @@ -420,6 +420,7 @@ enabled: true, id: `${locationId}_${floor}`, zoomOnRestore: false, + preserveFragment: true, }, nodeCategories: Object.keys(status_colors).map((status) => ({ name: status, @@ -528,6 +529,8 @@ // without requiring a node click to add the fragment. pushIndoorMapIdFragment(this, locationId, floor); }, + // Popup handling is delegated to nodePopup.content, + // so disable the default onClickElement popup behavior. onClickElement: function () {}, }); indoorMap.setUtils({ diff --git a/openwisp_monitoring/device/static/monitoring/js/lib/netjsongraph.min.js b/openwisp_monitoring/device/static/monitoring/js/lib/netjsongraph.min.js index 7d3e0807a..83e1357df 100644 --- a/openwisp_monitoring/device/static/monitoring/js/lib/netjsongraph.min.js +++ b/openwisp_monitoring/device/static/monitoring/js/lib/netjsongraph.min.js @@ -1 +1 @@ -(()=>{function t(i){var o=n[i];if(void 0!==o)return o.exports;var r=n[i]={exports:{}};return e[i].call(r.exports,r,r.exports,t),r.exports}var e={481(t,e){!function(t){"use strict";function e(t){var e,n,i,o;for(n=1,i=arguments.length;n=0}function O(t){sn[t.pointerId]=t}function z(t){sn[t.pointerId]&&(sn[t.pointerId]=t)}function E(t){delete sn[t.pointerId]}function R(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var n in e.touches=[],sn)e.touches.push(sn[n]);e.changedTouches=[e],t(e)}}function B(t){return"string"==typeof t?document.getElementById(t):t}function N(t,e){var n=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!n||"auto"===n)&&document.defaultView){var i=document.defaultView.getComputedStyle(t,null);n=i?i[e]:null}return"auto"===n?null:n}function F(t,e,n){var i=document.createElement(t);return i.className=e||"",n&&n.appendChild(i),i}function V(t){var e=t.parentNode;e&&e.removeChild(t)}function Z(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function H(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function W(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function j(t,e){if(void 0!==t.classList)return t.classList.contains(e);var n=X(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)}function G(t,e){if(void 0!==t.classList)for(var n=u(e),i=0,o=n.length;ie&&(n.push(t[i]),o=i);return ol&&(r=a,l=s);l>n&&(e[r]=1,Mt(t,e,n,i,r),Mt(t,e,n,r,o))}function Ct(t,e,n,i,o){var r,a,s,l=i?In:It(t,n),u=It(e,n);for(In=u;;){if(!(l|u))return[t,e];if(l&u)return!1;s=It(a=kt(t,e,r=l||u,n,o),n),r===l?(t=a,l=s):(e=a,u=s)}}function kt(t,e,n,i,o){var r,a,s=e.x-t.x,l=e.y-t.y,u=i.min,h=i.max;return 8&n?(r=t.x+s*(h.y-t.y)/l,a=h.y):4&n?(r=t.x+s*(u.y-t.y)/l,a=u.y):2&n?(r=h.x,a=t.y+l*(h.x-t.x)/s):1&n&&(r=u.x,a=t.y+l*(u.x-t.x)/s),new _(r,a,o)}function It(t,e){var n=0;return t.xe.max.x&&(n|=2),t.ye.max.y&&(n|=8),n}function Lt(t,e){var n=e.x-t.x,i=e.y-t.y;return n*n+i*i}function Pt(t,e,n,i){var o,r=e.x,a=e.y,s=n.x-r,l=n.y-a,u=s*s+l*l;return u>0&&((o=((t.x-r)*s+(t.y-a)*l)/u)>1?(r=n.x,a=n.y):o>0&&(r+=s*o,a+=l*o)),s=t.x-r,l=t.y-a,i?s*s+l*l:new _(r,a)}function Dt(t){return!qt(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function At(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Dt(t)}function Ot(t,e){var n,i,o,r,a,s,l,u;if(!t||0===t.length)throw new Error("latlngs not passed");Dt(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var h=C([0,0]),c=T(t);c.getNorthWest().distanceTo(c.getSouthWest())*c.getNorthEast().distanceTo(c.getNorthWest())<1700&&(h=bt(t));var d=t.length,p=[];for(n=0;ni){u=[s.x-(l=(r-i)/o)*(s.x-a.x),s.y-l*(s.y-a.y)];break}var g=e.unproject(x(u));return C([g.lat+h.lat,g.lng+h.lng])}function zt(t,e){var n,i,o,r,a="Feature"===t.type?t.geometry:t,s=a?a.coordinates:null,l=[],u=e&&e.pointToLayer,h=e&&e.coordsToLatLng||Rt;if(!s&&!a)return null;switch(a.type){case"Point":return Et(u,t,n=h(s),e);case"MultiPoint":for(o=0,r=s.length;o0&&o.push(o[0].slice()),o}function Vt(t,n){return t.feature?e({},t.feature,{geometry:n}):Zt(n)}function Zt(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}function Ht(t,e){return new Jn(t,e)}function Wt(t,e){return new ui(t,e)}function jt(t){return Qe.canvas?new di(t):null}function Gt(t){return Qe.svg||Qe.vml?new mi(t):null}var Ut=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}(),Yt=0,Xt=/\{ *([\w_ -]+) *\}/g,qt=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Kt="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",$t=0,Jt=window.requestAnimationFrame||f("RequestAnimationFrame")||g,Qt=window.cancelAnimationFrame||f("CancelAnimationFrame")||f("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)},te={__proto__:null,extend:e,create:Ut,bind:n,get lastId(){return Yt},stamp:i,throttle:o,wrapNum:r,falseFn:a,formatNum:s,trim:l,splitWords:u,setOptions:h,getParamString:c,template:d,isArray:qt,indexOf:p,emptyImageUrl:Kt,requestFn:Jt,cancelFn:Qt,requestAnimFrame:m,cancelAnimFrame:y};v.extend=function(t){var n=function(){h(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=n.__super__=this.prototype,o=Ut(i);for(var r in o.constructor=n,n.prototype=o,this)Object.prototype.hasOwnProperty.call(this,r)&&"prototype"!==r&&"__super__"!==r&&(n[r]=this[r]);return t.statics&&e(n,t.statics),t.includes&&(function(t){if("undefined"!=typeof L&&L&&L.Mixin){t=qt(t)?t:[t];for(var e=0;e0?Math.floor(t):Math.ceil(t)};_.prototype={clone:function(){return new _(this.x,this.y)},add:function(t){return this.clone()._add(x(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(x(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new _(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new _(this.x/t.x,this.y/t.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=ie(this.x),this.y=ie(this.y),this},distanceTo:function(t){var e=(t=x(t)).x-this.x,n=t.y-this.y;return Math.sqrt(e*e+n*n)},equals:function(t){return(t=x(t)).x===this.x&&t.y===this.y},contains:function(t){return t=x(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+s(this.x)+", "+s(this.y)+")"}},w.prototype={extend:function(t){var e,n;if(!t)return this;if(t instanceof _||"number"==typeof t[0]||"x"in t)e=n=x(t);else if(n=(t=b(t)).max,!(e=t.min)||!n)return this;return this.min||this.max?(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(n.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(n.y,this.max.y)):(this.min=e.clone(),this.max=n.clone()),this},getCenter:function(t){return x((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return x(this.min.x,this.max.y)},getTopRight:function(){return x(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,n;return(t="number"==typeof t[0]||t instanceof _?x(t):b(t))instanceof w?(e=t.min,n=t.max):e=n=t,e.x>=this.min.x&&n.x<=this.max.x&&e.y>=this.min.y&&n.y<=this.max.y},intersects:function(t){t=b(t);var e=this.min,n=this.max,i=t.min,o=t.max;return o.x>=e.x&&i.x<=n.x&&o.y>=e.y&&i.y<=n.y},overlaps:function(t){t=b(t);var e=this.min,n=this.max,i=t.min,o=t.max;return o.x>e.x&&i.xe.y&&i.y=i.lat&&n.lat<=o.lat&&e.lng>=i.lng&&n.lng<=o.lng},intersects:function(t){t=T(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),o=t.getNorthEast();return o.lat>=e.lat&&i.lat<=n.lat&&o.lng>=e.lng&&i.lng<=n.lng},overlaps:function(t){t=T(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),o=t.getNorthEast();return o.lat>e.lat&&i.late.lng&&i.lng1,Xe=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",a,e),window.removeEventListener("testPassiveEventSupport",a,e)}catch(t){}return t}(),qe=!!document.createElement("canvas").getContext,Ke=!(!document.createElementNS||!P("svg").createSVGRect),$e=!!Ke&&((ue=document.createElement("div")).innerHTML="","http://www.w3.org/2000/svg"===(ue.firstChild&&ue.firstChild.namespaceURI)),Je=!Ke&&function(){try{var t=document.createElement("div");t.innerHTML='';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),Qe={ie:_e,ielt9:xe,edge:we,webkit:be,android:Se,android23:Te,androidStock:Ce,opera:ke,chrome:Ie,gecko:Le,safari:Pe,phantom:De,opera12:Ae,win:Oe,ie3d:ze,webkit3d:Ee,gecko3d:Re,any3d:Be,mobile:Ne,mobileWebkit:Fe,mobileWebkit3d:Ve,msPointer:Ze,pointer:He,touch:je,touchNative:We,mobileOpera:Ge,mobileGecko:Ue,retina:Ye,passiveEvents:Xe,canvas:qe,svg:Ke,vml:Je,inlineSvg:$e,mac:0===navigator.platform.indexOf("Mac"),linux:0===navigator.platform.indexOf("Linux")},tn=Qe.msPointer?"MSPointerDown":"pointerdown",en=Qe.msPointer?"MSPointerMove":"pointermove",nn=Qe.msPointer?"MSPointerUp":"pointerup",on=Qe.msPointer?"MSPointerCancel":"pointercancel",rn={touchstart:tn,touchmove:en,touchend:nn,touchcancel:on},an={touchstart:function(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&ft(e),R(t,e)},touchmove:R,touchend:R,touchcancel:R},sn={},ln=!1,un=200,hn=K(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),cn=K(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),dn="webkitTransition"===cn||"OTransition"===cn?cn+"End":"transitionend";if("onselectstart"in document)he=function(){at(window,"selectstart",ft)},ce=function(){st(window,"selectstart",ft)};else{var pn=K(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);he=function(){if(pn){var t=document.documentElement.style;de=t[pn],t[pn]="none"}},ce=function(){pn&&(document.documentElement.style[pn]=de,de=void 0)}}var fn={__proto__:null,TRANSFORM:hn,TRANSITION:cn,TRANSITION_END:dn,get:B,getStyle:N,create:F,remove:V,empty:Z,toFront:H,toBack:W,hasClass:j,addClass:G,removeClass:U,setClass:Y,getClass:X,setOpacity:q,testProp:K,setTransform:$,setPosition:J,getPosition:Q,get disableTextSelection(){return he},get enableTextSelection(){return ce},disableImageDrag:tt,enableImageDrag:et,preventOutline:nt,restoreOutline:it,getSizedParentNode:ot,getScale:rt},gn="_leaflet_events",mn={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"},yn=Qe.linux&&Qe.chrome?window.devicePixelRatio:Qe.mac?3*window.devicePixelRatio:window.devicePixelRatio>0?2*window.devicePixelRatio:1,vn={__proto__:null,on:at,off:st,stopPropagation:ct,disableScrollPropagation:dt,disableClickPropagation:pt,preventDefault:ft,stop:gt,getPropagationPath:mt,getMousePosition:yt,getWheelDelta:vt,isExternalTarget:_t,addListener:at,removeListener:st},_n=ne.extend({run:function(t,e,n,i){this.stop(),this._el=t,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(i||.5,.2),this._startPos=Q(t),this._offset=e.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=m(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,n=1e3*this._duration;ethis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var n=this.getCenter(),i=this._limitCenter(n,this._zoom,T(t));return n.equals(i)||this.panTo(i,e),this._enforcingBounds=!1,this},panInside:function(t,e){var n=x((e=e||{}).paddingTopLeft||e.padding||[0,0]),i=x(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),r=this.project(t),a=this.getPixelBounds(),s=b([a.min.add(n),a.max.subtract(i)]),l=s.getSize();if(!s.contains(r)){this._enforcingBounds=!0;var u=r.subtract(s.getCenter()),h=s.extend(r).getSize().subtract(l);o.x+=u.x<0?-h.x:h.x,o.y+=u.y<0?-h.y:h.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=e({animate:!1,pan:!0},!0===t?{animate:!0}:t);var i=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),r=i.divideBy(2).round(),a=o.divideBy(2).round(),s=r.subtract(a);return s.x||s.y?(t.animate&&t.pan?this.panBy(s):(t.pan&&this._rawPanBy(s),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(n(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:i,newSize:o})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=e({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var i=n(this._handleGeolocationResponse,this),o=n(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(i,o,t):navigator.geolocation.getCurrentPosition(i,o,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,n=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+n+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=new M(t.coords.latitude,t.coords.longitude),n=e.toBounds(2*t.coords.accuracy),i=this._locateOptions;if(i.setView){var o=this.getBoundsZoom(n);this.setView(e,i.maxZoom?Math.min(o,i.maxZoom):o)}var r={latlng:e,bounds:n,timestamp:t.timestamp};for(var a in t.coords)"number"==typeof t.coords[a]&&(r[a]=t.coords[a]);this.fire("locationfound",r)}},addHandler:function(t,e){if(!e)return this;var n=this[t]=new e(this);return this._handlers.push(n),this.options[t]&&n.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(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),V(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(y(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)V(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var n=F("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new S(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,n){t=T(t),n=x(n||[0,0]);var i=this.getZoom()||0,o=this.getMinZoom(),r=this.getMaxZoom(),a=t.getNorthWest(),s=t.getSouthEast(),l=this.getSize().subtract(n),u=b(this.project(s,i),this.project(a,i)).getSize(),h=Qe.any3d?this.options.zoomSnap:1,c=l.x/u.x,d=l.y/u.y,p=e?Math.max(c,d):Math.min(c,d);return i=this.getScaleZoom(p,i),h&&(i=Math.round(i/(h/100))*(h/100),i=e?Math.ceil(i/h)*h:Math.floor(i/h)*h),Math.max(o,Math.min(r,i))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new _(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var n=this._getTopLeftPoint(t,e);return new w(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var n=this.options.crs;return e=void 0===e?this._zoom:e,n.scale(t)/n.scale(e)},getScaleZoom:function(t,e){var n=this.options.crs,i=n.zoom(t*n.scale(e=void 0===e?this._zoom:e));return isNaN(i)?1/0:i},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(C(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(x(t),e)},layerPointToLatLng:function(t){var e=x(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(C(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(C(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(T(t))},distance:function(t,e){return this.options.crs.distance(C(t),C(e))},containerPointToLayerPoint:function(t){return x(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return x(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(x(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(C(t)))},mouseEventToContainerPoint:function(t){return yt(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=B(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");at(e,"scroll",this._onScroll,this),this._containerId=i(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&Qe.any3d,G(t,"leaflet-container"+(Qe.touch?" leaflet-touch":"")+(Qe.retina?" leaflet-retina":"")+(Qe.ielt9?" leaflet-oldie":"")+(Qe.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=N(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),J(this._mapPane,new _(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(G(t.markerPane,"leaflet-zoom-hide"),G(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,n){J(this._mapPane,new _(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,n)._move(t,e)._moveEnd(o),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,n,i){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),i?n&&n.pinch&&this.fire("zoom",n):((o||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return y(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){J(this._mapPane,this._getMapPanePos().subtract(t))},_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(t){this._targets={},this._targets[i(this._container)]=this;var e=t?st:at;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),Qe.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){y(this._resizeRequest),this._resizeRequest=m(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var n,o=[],r="mouseout"===e||"mouseover"===e,a=t.target||t.srcElement,s=!1;a;){if((n=this._targets[i(a)])&&("click"===e||"preclick"===e)&&this._draggableMoved(n)){s=!0;break}if(n&&n.listens(e,!0)){if(r&&!_t(a,t))break;if(o.push(n),r)break}if(a===this._container)break;a=a.parentNode}return o.length||s||r||!this.listens(e,!0)||(o=[this]),o},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(e))){var n=t.type;"mousedown"===n&&nt(e),this._fireDOMEvent(t,n)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,n,i){if("click"===t.type){var o=e({},t);o.type="preclick",this._fireDOMEvent(o,o.type,i)}var r=this._findEventTargets(t,n);if(i){for(var a=[],s=0;s0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),n=this.getMaxZoom(),i=Qe.any3d?this.options.zoomSnap:1;return i&&(t=Math.round(t/i)*i),Math.max(e,Math.min(n,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){U(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var n=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(n)||(this.panBy(n,e),0))},_createAnimProxy:function(){var t=this._proxy=F("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(t){var e=hn,n=this._proxy.style[e];$(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),n===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){V(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();$(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,n){if(this._animatingZoom)return!0;if(n=n||{},!this._zoomAnimated||!1===n.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var i=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/i);return!(!0!==n.animate&&!this.getSize().contains(o)||(m(function(){this._moveStart(!0,n.noMoveStart||!1)._animateZoom(t,e,!0)},this),0))},_animateZoom:function(t,e,i,o){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,G(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:o}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(n(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&U(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))}}),wn=v.extend({options:{position:"topright"},initialize:function(t){h(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),n=this.getPosition(),i=t._controlCorners[n];return G(e,"leaflet-control"),-1!==n.indexOf("bottom")?i.insertBefore(e,i.firstChild):i.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(V(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),bn=function(t){return new wn(t)};xn.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){function t(t,o){e[t+o]=F("div",n+t+" "+n+o,i)}var e=this._controlCorners={},n="leaflet-",i=this._controlContainer=F("div",n+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)V(this._controlCorners[t]);V(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Sn=wn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,n,i){return n1)?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(i(t.target)),n=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;n&&this._map.fire(n,e)},_createRadioElement:function(t,e){var n='",i=document.createElement("div");return i.innerHTML=n,i.firstChild},_addItem:function(t){var e,n=document.createElement("label"),o=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=o):e=this._createRadioElement("leaflet-base-layers_"+i(this),o),this._layerControlInputs.push(e),e.layerId=i(t.layer),at(e,"click",this._onInputClick,this);var r=document.createElement("span");r.innerHTML=" "+t.name;var a=document.createElement("span");return n.appendChild(a),a.appendChild(e),a.appendChild(r),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var t,e,n=this._layerControlInputs,i=[],o=[];this._handlingClick=!0;for(var r=n.length-1;r>=0;r--)e=this._getLayer((t=n[r]).layerId).layer,t.checked?i.push(e):t.checked||o.push(e);for(r=0;r=0;o--)e=this._getLayer((t=n[o]).layerId).layer,t.disabled=void 0!==e.options.minZoom&&ie.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,at(t,"click",ft),this.expand();var e=this;setTimeout(function(){st(t,"click",ft),e._preventClick=!1})}}),Tn=wn.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",n=F("div",e+" leaflet-bar"),i=this.options;return this._zoomInButton=this._createButton(i.zoomInText,i.zoomInTitle,e+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(i.zoomOutText,i.zoomOutTitle,e+"-out",n,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(t){t.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(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,n,i,o){var r=F("a",n,i);return r.innerHTML=t,r.href="#",r.title=e,r.setAttribute("role","button"),r.setAttribute("aria-label",e),pt(r),at(r,"click",gt),at(r,"click",o,this),at(r,"click",this._refocusOnMap,this),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";U(this._zoomInButton,e),U(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(G(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(G(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});xn.mergeOptions({zoomControl:!0}),xn.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Tn,this.addControl(this.zoomControl))});var Mn=wn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",n=F("div",e),i=this.options;return this._addScales(i,e+"-line",n),t.on(i.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),n},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,n){t.metric&&(this._mScale=F("div",e,n)),t.imperial&&(this._iScale=F("div",e,n))},_update:function(){var t=this._map,e=t.getSize().y/2,n=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(n)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,n,i,o=3.2808399*t;o>5280?(n=this._getRoundNum(e=o/5280),this._updateScale(this._iScale,n+" mi",n/e)):(i=this._getRoundNum(o),this._updateScale(this._iScale,i+" ft",i/o))},_updateScale:function(t,e,n){t.style.width=Math.round(this.options.maxWidth*n)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),n=t/e;return e*(n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}}),Cn=wn.extend({options:{position:"bottomright",prefix:''+(Qe.inlineSvg?' ':"")+"Leaflet"},initialize:function(t){h(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=F("div","leaflet-control-attribution"),pt(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var n=[];this.options.prefix&&n.push(this.options.prefix),t.length&&n.push(t.join(", ")),this._container.innerHTML=n.join(' ')}}});xn.mergeOptions({attributionControl:!0}),xn.addInitHook(function(){this.options.attributionControl&&(new Cn).addTo(this)}),wn.Layers=Sn,wn.Zoom=Tn,wn.Scale=Mn,wn.Attribution=Cn,bn.layers=function(t,e,n){return new Sn(t,e,n)},bn.zoom=function(t){return new Tn(t)},bn.scale=function(t){return new Mn(t)},bn.attribution=function(t){return new Cn(t)};var kn=v.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});kn.addTo=function(t,e){return t.addHandler(e,this),this};var In,Ln={Events:ee},Pn=Qe.touch?"touchstart mousedown":"mousedown",Dn=ne.extend({options:{clickTolerance:3},initialize:function(t,e,n,i){h(this,i),this._element=t,this._dragStartTarget=e||t,this._preventOutline=n},enable:function(){this._enabled||(at(this._dragStartTarget,Pn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Dn._dragging===this&&this.finishDrag(!0),st(this._dragStartTarget,Pn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!j(this._element,"leaflet-zoom-anim")))if(t.touches&&1!==t.touches.length)Dn._dragging===this&&this.finishDrag();else if(!(Dn._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(Dn._dragging=this,this._preventOutline&&nt(this._element),tt(),he(),this._moving))){this.fire("down");var e=t.touches?t.touches[0]:t,n=ot(this._element);this._startPoint=new _(e.clientX,e.clientY),this._startPos=Q(this._element),this._parentScale=rt(n);var i="mousedown"===t.type;at(document,i?"mousemove":"touchmove",this._onMove,this),at(document,i?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(t){if(this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,n=new _(e.clientX,e.clientY)._subtract(this._startPoint);(n.x||n.y)&&(Math.abs(n.x)+Math.abs(n.y)1e-7;l++)e=r*Math.sin(s),e=Math.pow((1-e)/(1+e),r/2),s+=u=Math.PI/2-2*Math.atan(a*e)-s;return new M(s*n,t.x*n/i)}},Rn={__proto__:null,LonLat:zn,Mercator:En,SphericalMercator:le},Bn=e({},ae,{code:"EPSG:3395",projection:En,transformation:function(){var t=.5/(Math.PI*En.R);return I(t,.5,-t,.5)}()}),Nn=e({},ae,{code:"EPSG:4326",projection:zn,transformation:I(1/180,1,-1/180,.5)}),Fn=e({},re,{projection:zn,transformation:I(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var n=e.lng-t.lng,i=e.lat-t.lat;return Math.sqrt(n*n+i*i)},infinite:!0});re.Earth=ae,re.EPSG3395=Bn,re.EPSG3857=me,re.EPSG900913=ye,re.EPSG4326=Nn,re.Simple=Fn;var Vn=ne.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[i(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[i(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var n=this.getEvents();e.on(n,this),this.once("remove",function(){e.off(n,this)},this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});xn.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=i(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=i(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return i(t)in this._layers},eachLayer:function(t,e){for(var n in this._layers)t.call(e,this._layers[n]);return this},_addLayers:function(t){for(var e=0,n=(t=t?qt(t)?t:[t]:[]).length;ethis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()=2&&e[0]instanceof M&&e[0].equals(e[n-1])&&e.pop(),e},_setLatLngs:function(t){Kn.prototype._setLatLngs.call(this,t),Dt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Dt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,n=new _(e,e);if(t=new w(t.min.subtract(n),t.max.add(n)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var i,o=0,r=this._rings.length;ot.y!=(i=e[a]).y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(u=!u);return u||Kn.prototype._containsPoint.call(this,t,!0)}}),Jn=Hn.extend({initialize:function(t,e){h(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,n,i,o=qt(t)?t:t.features;if(o){for(e=0,n=o.length;e0?o:[e.src]}else{qt(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var s=0;si?(e.height=i+"px",G(t,o)):U(t,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),n=this._getAnchor();J(this._container,e.add(n))},_adjustPan:function(){if(this.options.autoPan)if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)this._autopanning=!1;else{var t=this._map,e=parseInt(N(this._container,"marginBottom"),10)||0,n=this._container.offsetHeight+e,i=this._containerWidth,o=new _(this._containerLeft,-n-this._containerBottom);o._add(Q(this._container));var r=t.layerPointToContainerPoint(o),a=x(this.options.autoPanPadding),s=x(this.options.autoPanPaddingTopLeft||a),l=x(this.options.autoPanPaddingBottomRight||a),u=t.getSize(),h=0,c=0;r.x+i+l.x>u.x&&(h=r.x+i-u.x+l.x),r.x-h-s.x<0&&(h=r.x-s.x),r.y+n+l.y>u.y&&(c=r.y+n-u.y+l.y),r.y-c-s.y<0&&(c=r.y-s.y),(h||c)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([h,c]))}},_getAnchor:function(){return x(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});xn.mergeOptions({closePopupOnClick:!0}),xn.include({openPopup:function(t,e,n){return this._initOverlay(ri,t,e,n).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),Vn.include({bindPopup:function(t,e){return this._popup=this._initOverlay(ri,this._popup,t,e),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(t){return this._popup&&(this instanceof Hn||(this._popup._source=this),this._popup._prepareOpen(t||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()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(this._popup&&this._map){gt(t);var e=t.layer||t.target;this._popup._source!==e||e instanceof Yn?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var ai=oi.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){oi.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){oi.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=oi.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){this._contentNode=this._container=F("div","leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide")),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+i(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,n,i=this._map,o=this._container,r=i.latLngToContainerPoint(i.getCenter()),a=i.layerPointToContainerPoint(t),s=this.options.direction,l=o.offsetWidth,u=o.offsetHeight,h=x(this.options.offset),c=this._getAnchor();"top"===s?(e=l/2,n=u):"bottom"===s?(e=l/2,n=0):"center"===s?(e=l/2,n=u/2):"right"===s?(e=0,n=u/2):"left"===s?(e=l,n=u/2):a.xthis.options.maxZoom||ni&&this._retainParent(o,r,a,i))},_retainChildren:function(t,e,n,i){for(var o=2*t;o<2*t+2;o++)for(var r=2*e;r<2*e+2;r++){var a=new _(o,r);a.z=n+1;var s=this._tileCoordsToKey(a),l=this._tiles[s];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),n+1this.options.maxZoom||void 0!==this.options.minZoom&&o1)this._setView(t,n);else{for(var c=o.min.y;c<=o.max.y;c++)for(var d=o.min.x;d<=o.max.x;d++){var p=new _(d,c);if(p.z=this._tileZoom,this._isValidTile(p)){var f=this._tiles[this._tileCoordsToKey(p)];f?f.current=!0:a.push(p)}}if(a.sort(function(t,e){return t.distanceTo(r)-e.distanceTo(r)}),0!==a.length){this._loading||(this._loading=!0,this.fire("loading"));var g=document.createDocumentFragment();for(d=0;dn.max.x)||!e.wrapLat&&(t.yn.max.y))return!1}if(!this.options.bounds)return!0;var i=this._tileCoordsToBounds(t);return T(this.options.bounds).overlaps(i)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,n=this.getTileSize(),i=t.scaleBy(n),o=i.add(n);return[e.unproject(i,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),n=new S(e[0],e[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),n=new _(+e[0],+e[1]);return n.z=+e[2],n},_removeTile:function(t){var e=this._tiles[t];e&&(V(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){G(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=a,t.onmousemove=a,Qe.ielt9&&this.options.opacity<1&&q(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),o=this._tileCoordsToKey(t),r=this.createTile(this._wrapCoords(t),n(this._tileReady,this,t));this._initTile(r),this.createTile.length<2&&m(n(this._tileReady,this,t,null,r)),J(r,i),this._tiles[o]={el:r,coords:t,current:!0},e.appendChild(r),this.fire("tileloadstart",{tile:r,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var o=this._tileCoordsToKey(t);(i=this._tiles[o])&&(i.loaded=+new Date,this._map._fadeAnimated?(q(i.el,0),y(this._fadeFrame),this._fadeFrame=m(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(G(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Qe.ielt9||!this._map._fadeAnimated?m(this._pruneTiles,this):setTimeout(n(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new _(this._wrapX?r(t.x,this._wrapX):t.x,this._wrapY?r(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new w(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}}),ui=li.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=h(this,e)).detectRetina&&Qe.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return at(i,"load",n(this._tileOnLoad,this,e,i)),at(i,"error",n(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var n={r:Qe.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(n.y=i),n["-y"]=i}return d(this._url,e(n,this.options))},_tileOnLoad:function(t,e){Qe.ielt9?setTimeout(n(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,n){var i=this.options.errorTileUrl;i&&e.getAttribute("src")!==i&&(e.src=i),t(n,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom;return this.options.zoomReverse&&(t=this.options.maxZoom-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=a,e.onerror=a,!e.complete)){e.src=Kt;var n=this._tiles[t].coords;V(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:n})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",Kt),li.prototype._removeTile.call(this,t)},_tileReady:function(t,e,n){if(this._map&&(!n||n.getAttribute("src")!==Kt))return li.prototype._tileReady.call(this,t,e,n)}}),hi=ui.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,n){this._url=t;var i=e({},this.defaultWmsParams);for(var o in n)o in this.options||(i[o]=n[o]);var r=(n=h(this,n)).detectRetina&&Qe.retina?2:1,a=this.getTileSize();i.width=a.x*r,i.height=a.y*r,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version),this.wmsParams[this._wmsVersion>=1.3?"crs":"srs"]=this._crs.code,ui.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),n=this._crs,i=b(n.project(e[0]),n.project(e[1])),o=i.min,r=i.max,a=(this._wmsVersion>=1.3&&this._crs===Nn?[o.y,o.x,r.y,r.x]:[o.x,o.y,r.x,r.y]).join(","),s=ui.prototype.getTileUrl.call(this,t);return s+c(this.wmsParams,s,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+a},setParams:function(t,n){return e(this.wmsParams,t),n||this.redraw(),this}});ui.WMS=hi,Wt.wms=function(t,e){return new hi(t,e)};var ci=Vn.extend({options:{padding:.1},initialize:function(t){h(this,t),i(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),G(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 t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var n=this._map.getZoomScale(e,this._zoom),i=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),r=i.multiplyBy(-n).add(o).subtract(this._map._getNewPixelOrigin(t,e));Qe.any3d?$(this._container,r,n):J(this._container,r)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),n=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new w(n,n.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),di=ci.extend({options:{tolerance:0},getEvents:function(){var t=ci.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ci.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");at(t,"mousemove",this._onMouseMove,this),at(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),at(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){y(this._redrawRequest),delete this._ctx,V(this._container),st(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){ci.prototype._update.call(this);var t=this._bounds,e=this._container,n=t.getSize(),i=Qe.retina?2:1;J(e,t.min),e.width=i*n.x,e.height=i*n.y,e.style.width=n.x+"px",e.style.height=n.y+"px",Qe.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){ci.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[i(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,n=e.next,o=e.prev;n?n.prev=o:this._drawLast=o,o?o.next=n:this._drawFirst=n,delete t._order,delete this._layers[i(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,n,i=t.options.dashArray.split(/[, ]+/),o=[];for(n=0;n')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),fi={_initContainer:function(){this._container=F("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ci.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=pi("shape");G(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=pi("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[i(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;V(e),t.removeInteractiveTarget(e),delete this._layers[i(t)]},_updateStyle:function(t){var e=t._stroke,n=t._fill,i=t.options,o=t._container;o.stroked=!!i.stroke,o.filled=!!i.fill,i.stroke?(e||(e=t._stroke=pi("stroke")),o.appendChild(e),e.weight=i.weight+"px",e.color=i.color,e.opacity=i.opacity,e.dashStyle=i.dashArray?qt(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):"",e.endcap=i.lineCap.replace("butt","flat"),e.joinstyle=i.lineJoin):e&&(o.removeChild(e),t._stroke=null),i.fill?(n||(n=t._fill=pi("fill")),o.appendChild(n),n.color=i.fillColor||i.color,n.opacity=i.fillOpacity):n&&(o.removeChild(n),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),n=Math.round(t._radius),i=Math.round(t._radiusY||n);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+n+","+i+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){H(t._container)},_bringToBack:function(t){W(t._container)}},gi=Qe.vml?pi:P,mi=ci.extend({_initContainer:function(){this._container=gi("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=gi("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){V(this._container),st(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){ci.prototype._update.call(this);var t=this._bounds,e=t.getSize(),n=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,n.setAttribute("width",e.x),n.setAttribute("height",e.y)),J(n,t.min),n.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=gi("path");t.options.className&&G(e,t.options.className),t.options.interactive&&G(e,"leaflet-interactive"),this._updateStyle(t),this._layers[i(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){V(t._path),t.removeInteractiveTarget(t._path),delete this._layers[i(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,n=t.options;e&&(n.stroke?(e.setAttribute("stroke",n.color),e.setAttribute("stroke-opacity",n.opacity),e.setAttribute("stroke-width",n.weight),e.setAttribute("stroke-linecap",n.lineCap),e.setAttribute("stroke-linejoin",n.lineJoin),n.dashArray?e.setAttribute("stroke-dasharray",n.dashArray):e.removeAttribute("stroke-dasharray"),n.dashOffset?e.setAttribute("stroke-dashoffset",n.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),n.fill?(e.setAttribute("fill",n.fillColor||n.color),e.setAttribute("fill-opacity",n.fillOpacity),e.setAttribute("fill-rule",n.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,D(t._parts,e))},_updateCircle:function(t){var e=t._point,n=Math.max(Math.round(t._radius),1),i="a"+n+","+(Math.max(Math.round(t._radiusY),1)||n)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-n)+","+e.y+i+2*n+",0 "+i+2*-n+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){H(t._path)},_bringToBack:function(t){W(t._path)}});Qe.vml&&mi.include(fi),xn.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&jt(t)||Gt(t)}});var yi=$n.extend({initialize:function(t,e){$n.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=T(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});mi.create=gi,mi.pointsToPath=D,Jn.geometryToLayer=zt,Jn.coordsToLatLng=Rt,Jn.coordsToLatLngs=Bt,Jn.latLngToCoords=Nt,Jn.latLngsToCoords=Ft,Jn.getFeature=Vt,Jn.asFeature=Zt,xn.mergeOptions({boxZoom:!0});var vi=kn.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){at(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){st(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){V(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),he(),tt(),this._startPoint=this._map.mouseEventToContainerPoint(t),at(document,{contextmenu:gt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=F("div","leaflet-zoom-box",this._container),G(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new w(this._point,this._startPoint),n=e.getSize();J(this._box,e.min),this._box.style.width=n.x+"px",this._box.style.height=n.y+"px"},_finish:function(){this._moved&&(V(this._box),U(this._container,"leaflet-crosshair")),ce(),et(),st(document,{contextmenu:gt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(n(this._resetState,this),0);var e=new S(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});xn.addInitHook("addHandler","boxZoom",vi),xn.mergeOptions({doubleClickZoom:!0});var _i=kn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,n=e.getZoom(),i=e.options.zoomDelta,o=t.originalEvent.shiftKey?n-i:n+i;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});xn.addInitHook("addHandler","doubleClickZoom",_i),xn.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var xi=kn.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new Dn(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}G(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){U(this._map._container,"leaflet-grab"),U(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 t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=T(this._map.options.maxBounds);this._offsetLimit=b(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.xe.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),n=this._initialWorldOffset,i=this._draggable._newPos.x,o=(i-e+n)%t+e-n,r=(i+e+n)%t-e-n,a=Math.abs(o+n)0?o:-o))-e;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}});xn.addInitHook("addHandler","scrollWheelZoom",bi),xn.mergeOptions({tapHold:Qe.touchNative&&Qe.safari&&Qe.mobile,tapTolerance:15});var Si=kn.extend({addHooks:function(){at(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){st(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),1===t.touches.length){var e=t.touches[0];this._startPos=this._newPos=new _(e.clientX,e.clientY),this._holdTimeout=setTimeout(n(function(){this._cancel(),this._isTapValid()&&(at(document,"touchend",ft),at(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),600),at(document,"touchend touchcancel contextmenu",this._cancel,this),at(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){st(document,"touchend",ft),st(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),st(document,"touchend touchcancel contextmenu",this._cancel,this),st(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new _(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var n=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});n._simulated=!0,e.target.dispatchEvent(n)}});xn.addInitHook("addHandler","tapHold",Si),xn.mergeOptions({touchZoom:Qe.touch,bounceAtZoomLimits:!0});var Ti=kn.extend({addHooks:function(){G(this._map._container,"leaflet-touch-zoom"),at(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){U(this._map._container,"leaflet-touch-zoom"),st(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var n=e.mouseEventToContainerPoint(t.touches[0]),i=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(n.add(i)._divideBy(2))),this._startDist=n.distanceTo(i),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),at(document,"touchmove",this._onTouchMove,this),at(document,"touchend touchcancel",this._onTouchEnd,this),ft(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),o=e.mouseEventToContainerPoint(t.touches[1]),r=i.distanceTo(o)/this._startDist;if(this._zoom=e.getScaleZoom(r,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoome.getMaxZoom()&&r>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===r)return}else{var a=i._add(o)._divideBy(2)._subtract(this._centerPoint);if(1===r&&0===a.x&&0===a.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(a),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),y(this._animRequest);var s=n(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=m(s,this,!0),ft(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,y(this._animRequest),st(document,"touchmove",this._onTouchMove,this),st(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))):this._zooming=!1}});xn.addInitHook("addHandler","touchZoom",Ti),xn.BoxZoom=vi,xn.DoubleClickZoom=_i,xn.Drag=xi,xn.Keyboard=wi,xn.ScrollWheelZoom=bi,xn.TapHold=Si,xn.TouchZoom=Ti,t.Bounds=w,t.Browser=Qe,t.CRS=re,t.Canvas=di,t.Circle=qn,t.CircleMarker=Xn,t.Class=v,t.Control=wn,t.DivIcon=si,t.DivOverlay=oi,t.DomEvent=vn,t.DomUtil=fn,t.Draggable=Dn,t.Evented=ne,t.FeatureGroup=Hn,t.GeoJSON=Jn,t.GridLayer=li,t.Handler=kn,t.Icon=Wn,t.ImageOverlay=ei,t.LatLng=M,t.LatLngBounds=S,t.Layer=Vn,t.LayerGroup=Zn,t.LineUtil=On,t.Map=xn,t.Marker=Un,t.Mixin=Ln,t.Path=Yn,t.Point=_,t.PolyUtil=An,t.Polygon=$n,t.Polyline=Kn,t.Popup=ri,t.PosAnimation=_n,t.Projection=Rn,t.Rectangle=yi,t.Renderer=ci,t.SVG=mi,t.SVGOverlay=ii,t.TileLayer=ui,t.Tooltip=ai,t.Transformation=k,t.Util=te,t.VideoOverlay=ni,t.bind=n,t.bounds=b,t.canvas=jt,t.circle=function(t,e,n){return new qn(t,e,n)},t.circleMarker=function(t,e){return new Xn(t,e)},t.control=bn,t.divIcon=function(t){return new si(t)},t.extend=e,t.featureGroup=function(t,e){return new Hn(t,e)},t.geoJSON=Ht,t.geoJson=ti,t.gridLayer=function(t){return new li(t)},t.icon=function(t){return new Wn(t)},t.imageOverlay=function(t,e,n){return new ei(t,e,n)},t.latLng=C,t.latLngBounds=T,t.layerGroup=function(t,e){return new Zn(t,e)},t.map=function(t,e){return new xn(t,e)},t.marker=function(t,e){return new Un(t,e)},t.point=x,t.polygon=function(t,e){return new $n(t,e)},t.polyline=function(t,e){return new Kn(t,e)},t.popup=function(t,e){return new ri(t,e)},t.rectangle=function(t,e){return new yi(t,e)},t.setOptions=h,t.stamp=i,t.svg=Gt,t.svgOverlay=function(t,e,n){return new ii(t,e,n)},t.tileLayer=Wt,t.tooltip=function(t,e){return new ai(t,e)},t.transformation=I,t.version="1.9.4",t.videoOverlay=function(t,e,n){return new ni(t,e,n)};var Mi=window.L;t.noConflict=function(){return window.L=Mi,this},window.L=t}(e)}},n={};t.d=(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";function e(t,e){function n(){this.constructor=t}if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Kp(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function n(){return vf++}function i(){for(var t=[],e=0;e>1)%2;a.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[s]+":0",o[l]+":0",i[1-s]+":auto",o[1-l]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}return e.clearMarkers=function(){c(n,function(t){t.parentNode&&t.parentNode.removeChild(t)})},n}(e,r),s=function(t,e,n){for(var i=n?"invTrans":"trans",o=e[i],r=e.srcCoords,a=[],s=[],l=!0,u=0;u<4;u++){var h=t[u].getBoundingClientRect(),c=2*u,d=h.left,p=h.top;a.push(d,p),l=l&&r&&d===r[c]&&p===r[c+1],s.push(t[u].offsetLeft,t[u].offsetTop)}return l&&o?o:(e.srcCoords=a,e[i]=n?rt(s,a):rt(a,s))}(a,r,o);if(s)return s(t,n,i),!0}return!1}function st(t){return"CANVAS"===t.nodeName.toUpperCase()}function lt(t){return null==t?"":(t+"").replace(Rf,function(t,e){return Bf[e]})}function ut(t,e,n,i){return n=n||{},i?ht(t,e,n):Vf&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):ht(t,e,n),n}function ht(t,e,n){if(Qp.domSupported&&t.getBoundingClientRect){var i=e.clientX,o=e.clientY;if(st(t)){var r=t.getBoundingClientRect();return n.zrX=i-r.left,void(n.zrY=o-r.top)}if(at(Ff,t,i,o))return n.zrX=Ff[0],void(n.zrY=Ff[1])}n.zrX=n.zrY=0}function ct(t){return t||window.event}function dt(t,e,n){if(null!=(e=ct(e)).zrX)return e;var i=e.type;if(i&&i.indexOf("touch")>=0){var o="touchend"!==i?e.targetTouches[0]:e.changedTouches[0];o&&ut(t,o,e,n)}else{ut(t,e,e,n);var r=function(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,i=t.deltaY;return null==n||null==i?e:3*(0!==i?Math.abs(i):Math.abs(n))*(i>0?-1:i<0?1:n>0?-1:1)}(e);e.zrDelta=r?r/120:-(e.detail||0)/3}var a=e.button;return null==e.which&&void 0!==a&&Nf.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function pt(t,e,n,i){t.addEventListener(e,n,i)}function ft(t,e,n,i){t.removeEventListener(e,n,i)}function gt(t){return 2===t.which||3===t.which}function mt(t){var e=t[1][0]-t[0][0],n=t[1][1]-t[0][1];return Math.sqrt(e*e+n*n)}function yt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function vt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function _t(t,e,n){var i=e[1]*n[0]+e[3]*n[1],o=e[0]*n[2]+e[2]*n[3],r=e[1]*n[2]+e[3]*n[3],a=e[0]*n[4]+e[2]*n[5]+e[4],s=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=e[0]*n[0]+e[2]*n[1],t[1]=i,t[2]=o,t[3]=r,t[4]=a,t[5]=s,t}function xt(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function wt(t,e,n,i){void 0===i&&(i=[0,0]);var o=e[0],r=e[2],a=e[4],s=e[1],l=e[3],u=e[5],h=Math.sin(n),c=Math.cos(n);return t[0]=o*c+s*h,t[1]=-o*h+s*c,t[2]=r*c+l*h,t[3]=-r*h+c*l,t[4]=c*(a-i[0])+h*(u-i[1])+i[0],t[5]=c*(u-i[1])-h*(a-i[0])+i[1],t}function bt(t,e){var n=e[0],i=e[2],o=e[4],r=e[1],a=e[3],s=e[5],l=n*a-r*i;return l?(t[0]=a*(l=1/l),t[1]=-r*l,t[2]=-i*l,t[3]=n*l,t[4]=(i*s-a*o)*l,t[5]=(r*o-n*s)*l,t):null}function St(t,e,n,i,o,r,a,s){var l=Xf(e-n),u=Xf(i-t),h=Uf(l,u),c=qf[o],d=qf[1-o],p=Kf[o];e=u||!eg.bidirectional)&&(ng[c]=-u,ng[d]=0,eg.useDir&&eg.calcDirMTV())))}function Tt(){function t(t){return Xf(t)<1e-10}var e=0,n=new Gf,i=new Gf,o={minTv:new Gf,maxTv:new Gf,useDir:!1,dirMinTv:new Gf,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(t,r){o.touchThreshold=0,t&&null!=t.touchThreshold&&(o.touchThreshold=Yf(0,t.touchThreshold)),o.negativeSize=!1,r&&(o.minTv.set(1/0,1/0),o.maxTv.set(0,0),o.useDir=!1,t&&null!=t.direction&&(o.useDir=!0,o.dirMinTv.copy(o.minTv),i.copy(o.minTv),e=t.direction,o.bidirectional=null==t.bidirectional||!!t.bidirectional,o.bidirectional||n.set(Math.cos(e),Math.sin(e))))},calcDirMTV:function(){var r=o.minTv,a=o.dirMinTv,s=r.y*r.y+r.x*r.x,l=Math.sin(e),u=Math.cos(e),h=l*r.y+u*r.x;t(h)?t(r.x)&&t(r.y)&&a.set(0,0):(i.x=s*u/h,i.y=s*l/h,t(i.x)&&t(i.y)?a.set(0,0):(o.bidirectional||n.dot(i)>0)&&i.len()=0;r--){var a=t[r],s=void 0;if(a!==o&&!a.ignore&&(s=Ct(a,n,i))&&(!e.topTarget&&(e.topTarget=a),s!==ug)){e.target=a;break}}}function It(t,e,n){var i=t.painter;return e<0||e>i.getWidth()||n<0||n>i.getHeight()}function Lt(t,e,n,i){var o=e+1;if(o===n)return 1;if(i(t[o++],t[e])<0){for(;o=0;)o++;return o-e}function Pt(t,e,n,i,o){for(i===e&&i++;i>>1])<0?l=r:s=r+1;var u=i-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;u>0;)t[s+u]=t[s+u-1],u--}t[s]=a}}function Dt(t,e,n,i,o,r){var a=0,s=0,l=1;if(r(t,e[n+o])>0){for(s=i-o;l0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=o,l+=o}else{for(s=o+1;ls&&(l=s);var u=a;a=o-l,l=o-u}for(a++;a>>1);r(t,e[n+h])>0?a=h+1:l=h}return l}function At(t,e,n,i,o,r){var a=0,s=0,l=1;if(r(t,e[n+o])<0){for(s=o+1;ls&&(l=s);var u=a;a=o-l,l=o-u}else{for(s=i-o;l=0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=o,l+=o}for(a++;a>>1);r(t,e[n+h])<0?l=h:a=h+1}return l}function Ot(t,e,n,i){n||(n=0),i||(i=t.length);var o=i-n;if(!(o<2)){var r=0;if(o<32)Pt(t,n,i,n+(r=Lt(t,n,i,e)),e);else{var a=function(t,e){function n(n){var l=i[n],u=o[n],h=i[n+1],c=o[n+1];o[n]=u+c,n===a-3&&(i[n+1]=i[n+2],o[n+1]=o[n+2]),a--;var d=At(t[h],t,l,u,0,e);l+=d,0!==(u-=d)&&0!==(c=Dt(t[l+u-1],t,h,c,c-1,e))&&(u<=c?function(n,i,o,a){var l=0;for(l=0;l=7||p>=7);if(f)break;g<0&&(g=0),g+=2}if((r=g)<1&&(r=1),1===i){for(l=0;l=0;l--)t[p+l]=t[d+l];if(0===i){y=!0;break}}if(t[c--]=s[h--],1===--a){y=!0;break}if(0!==(m=a-Dt(t[u],s,0,a,a-1,e))){for(a-=m,p=1+(c-=m),d=1+(h-=m),l=0;l=7||m>=7);if(y)break;f<0&&(f=0),f+=2}if((r=f)<1&&(r=1),1===a){for(p=1+(c-=i),d=1+(u-=i),l=i-1;l>=0;l--)t[p+l]=t[d+l];t[c]=s[h]}else{if(0===a)throw new Error;for(d=c-(a-1),l=0;l=0;l--)t[p+l]=t[d+l];t[c]=s[h]}else for(d=c-(a-1),l=0;l1;){var t=a-2;if(t>=1&&o[t-1]<=o[t]+o[t+1]||t>=2&&o[t-2]<=o[t]+o[t-1])o[t-1]o[t+1])break;n(t)}},forceMergeRuns:function(){for(;a>1;){var t=a-2;t>0&&o[t-1]=32;)e|=1&t,t>>=1;return t+e}(o);do{if((r=Lt(t,n,i,e))s&&(l=s),Pt(t,n,n+l,n+r,e),r=l}a.pushRun(n,r),a.mergeRuns(),o-=r,n+=r}while(0!==o);a.forceMergeRuns()}}}function zt(){mg||(mg=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Et(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}function Rt(t){return t>-1e-8&&tTg||t<-1e-8}function Nt(t,e,n,i,o){var r=1-o;return r*r*(r*t+3*o*e)+o*o*(o*i+3*r*n)}function Ft(t,e,n,i,o){var r=1-o;return 3*(((e-t)*r+2*(n-e)*o)*r+(i-n)*o*o)}function Vt(t,e,n,i,o,r){var a=i+3*(e-n)-t,s=3*(n-2*e+t),l=3*(e-t),u=t-o,h=s*s-3*a*l,c=s*l-9*a*u,d=l*l-3*s*u,p=0;if(Rt(h)&&Rt(c))Rt(s)?r[0]=0:(T=-l/s)>=0&&T<=1&&(r[p++]=T);else{var f=c*c-4*h*d;if(Rt(f)){var g=c/h,m=-g/2;(T=-s/a+g)>=0&&T<=1&&(r[p++]=T),m>=0&&m<=1&&(r[p++]=m)}else if(f>0){var y=Sg(f),v=h*s+1.5*a*(-c+y),_=h*s+1.5*a*(-c-y);(T=(-s-((v=v<0?-bg(-v,kg):bg(v,kg))+(_=_<0?-bg(-_,kg):bg(_,kg))))/(3*a))>=0&&T<=1&&(r[p++]=T)}else{var x=(2*h*s-3*a*c)/(2*Sg(h*h*h)),w=Math.acos(x)/3,b=Sg(h),S=Math.cos(w),T=(-s-2*b*S)/(3*a),M=(m=(-s+b*(S+Cg*Math.sin(w)))/(3*a),(-s+b*(S-Cg*Math.sin(w)))/(3*a));T>=0&&T<=1&&(r[p++]=T),m>=0&&m<=1&&(r[p++]=m),M>=0&&M<=1&&(r[p++]=M)}}return p}function Zt(t,e,n,i,o){var r=6*n-12*e+6*t,a=9*e+3*i-3*t-9*n,s=3*e-3*t,l=0;if(Rt(a))Bt(r)&&(h=-s/r)>=0&&h<=1&&(o[l++]=h);else{var u=r*r-4*a*s;if(Rt(u))o[0]=-r/(2*a);else if(u>0){var h,c=Sg(u),d=(-r-c)/(2*a);(h=(-r+c)/(2*a))>=0&&h<=1&&(o[l++]=h),d>=0&&d<=1&&(o[l++]=d)}}return l}function Ht(t,e,n,i,o,r){var a=(e-t)*o+t,s=(n-e)*o+e,l=(i-n)*o+n,u=(s-a)*o+a,h=(l-s)*o+s,c=(h-u)*o+u;r[0]=t,r[1]=a,r[2]=u,r[3]=c,r[4]=c,r[5]=h,r[6]=l,r[7]=i}function Wt(t,e,n,i,o,r,a,s,l){for(var u=t,h=e,c=0,d=1/l,p=1;p<=l;p++){var f=p*d,g=Nt(t,n,o,a,f),m=Nt(e,i,r,s,f),y=g-u,v=m-h;c+=Math.sqrt(y*y+v*v),u=g,h=m}return c}function jt(t,e,n,i){var o=1-i;return o*(o*t+2*i*e)+i*i*n}function Gt(t,e,n,i){return 2*((1-i)*(e-t)+i*(n-e))}function Ut(t,e,n){var i=t+n-2*e;return 0===i?.5:(t-e)/i}function Yt(t,e,n,i,o){var r=(e-t)*i+t,a=(n-e)*i+e,s=(a-r)*i+r;o[0]=t,o[1]=r,o[2]=s,o[3]=s,o[4]=a,o[5]=n}function Xt(t,e,n,i,o,r,a){for(var s=t,l=e,u=0,h=1/a,c=1;c<=a;c++){var d=c*h,p=jt(t,n,o,d),f=jt(e,i,r,d),g=p-s,m=f-l;u+=Math.sqrt(g*g+m*m),s=p,l=f}return u}function qt(t){var e=t&&Dg.exec(t);if(e){var n=e[1].split(","),i=+z(n[0]),o=+z(n[1]),r=+z(n[2]),a=+z(n[3]);if(isNaN(i+o+r+a))return;var s=[];return function(t){return t<=0?0:t>=1?1:Vt(0,i,r,1,t,s)&&Nt(0,o,a,1,s[0])}}}function Kt(t){return(t=Math.round(t))<0?0:t>255?255:t}function $t(t){return t<0?0:t>1?1:t}function Jt(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?Kt(parseFloat(e)/100*255):Kt(parseInt(e,10))}function Qt(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?$t(parseFloat(e)/100):$t(parseFloat(e))}function te(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function ee(t,e,n,i,o){return t[0]=e,t[1]=n,t[2]=i,t[3]=o,t}function ne(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function ie(t,e){Fg&&ne(Fg,e),Fg=Ng.put(t,Fg||e.slice())}function oe(t,e){if(t){e=e||[];var n=Ng.get(t);if(n)return ne(e,n);var i=(t+="").replace(/ /g,"").toLowerCase();if(i in Bg)return ne(e,Bg[i]),ie(t,e),e;var o,r=i.length;if("#"===i.charAt(0))return 4===r||5===r?(o=parseInt(i.slice(1,4),16))>=0&&o<=4095?(ee(e,(3840&o)>>4|(3840&o)>>8,240&o|(240&o)>>4,15&o|(15&o)<<4,5===r?parseInt(i.slice(4),16)/15:1),ie(t,e),e):void ee(e,0,0,0,1):7===r||9===r?(o=parseInt(i.slice(1,7),16))>=0&&o<=16777215?(ee(e,(16711680&o)>>16,(65280&o)>>8,255&o,9===r?parseInt(i.slice(7),16)/255:1),ie(t,e),e):void ee(e,0,0,0,1):void 0;var a=i.indexOf("("),s=i.indexOf(")");if(-1!==a&&s+1===r){var l=i.substr(0,a),u=i.substr(a+1,s-(a+1)).split(","),h=1;switch(l){case"rgba":if(4!==u.length)return 3===u.length?ee(e,+u[0],+u[1],+u[2],1):ee(e,0,0,0,1);h=Qt(u.pop());case"rgb":return u.length>=3?(ee(e,Jt(u[0]),Jt(u[1]),Jt(u[2]),3===u.length?h:Qt(u[3])),ie(t,e),e):void ee(e,0,0,0,1);case"hsla":return 4!==u.length?void ee(e,0,0,0,1):(u[3]=Qt(u[3]),re(u,e),ie(t,e),e);case"hsl":return 3!==u.length?void ee(e,0,0,0,1):(re(u,e),ie(t,e),e);default:return}}ee(e,0,0,0,1)}}function re(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=Qt(t[1]),o=Qt(t[2]),r=o<=.5?o*(i+1):o+i-o*i,a=2*o-r;return ee(e=e||[],Kt(255*te(a,r,n+1/3)),Kt(255*te(a,r,n)),Kt(255*te(a,r,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function ae(t,e){var n=oe(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,n[i]>255?n[i]=255:n[i]<0&&(n[i]=0);return le(n,4===n.length?"rgba":"rgb")}}function se(t,e,n,i){var o,r=oe(t);if(t)return r=function(t){if(t){var e,n,i=t[0]/255,o=t[1]/255,r=t[2]/255,a=Math.min(i,o,r),s=Math.max(i,o,r),l=s-a,u=(s+a)/2;if(0===l)e=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var h=((s-i)/6+l/2)/l,c=((s-o)/6+l/2)/l,d=((s-r)/6+l/2)/l;i===s?e=d-c:o===s?e=1/3+h-d:r===s&&(e=2/3+c-h),e<0&&(e+=1),e>1&&(e-=1)}var p=[360*e,n,u];return null!=t[3]&&p.push(t[3]),p}}(r),null!=e&&(r[0]=(o=v(e)?e(r[0]):e,(o=Math.round(o))<0?0:o>360?360:o)),null!=n&&(r[1]=Qt(v(n)?n(r[1]):n)),null!=i&&(r[2]=Qt(v(i)?i(r[2]):i)),le(re(r),"rgba")}function le(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}function ue(t,e){var n=oe(t);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*e:0}function he(t){if(_(t)){var e=Vg.get(t);return e||(e=ae(t,-.1),Vg.put(t,e)),e}if(C(t)){var n=a({},t);return n.colorStops=d(t.colorStops,function(t){return{offset:t.offset,color:ae(t.color,-.1)}}),n}return t}function ce(t){var e;if(t&&"transparent"!==t){if("string"==typeof t&&t.indexOf("rgba")>-1){var n=oe(t);n&&(t="rgb("+n[0]+","+n[1]+","+n[2]+")",e=n[3])}}else t="none";return{color:t,opacity:null==e?1:e}}function de(t){return t-1e-4}function pe(t){return Zg(1e3*t)/1e3}function fe(t){return Zg(1e4*t)/1e4}function ge(t){return t&&!!t.image}function me(t){return ge(t)||function(t){return t&&!!t.svgElement}(t)}function ye(t){return"linear"===t.type}function ve(t){return"radial"===t.type}function _e(t){return t&&("linear"===t.type||"radial"===t.type)}function xe(t){return"url(#"+t+")"}function we(t){var e=t.getGlobalScale(),n=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(n)/Math.log(10)),1)}function be(t){var e=t.x||0,n=t.y||0,i=(t.rotation||0)*Tf,o=L(t.scaleX,1),r=L(t.scaleY,1),a=t.skewX||0,s=t.skewY||0,l=[];return(e||n)&&l.push("translate("+e+"px,"+n+"px)"),i&&l.push("rotate("+i+")"),1===o&&1===r||l.push("scale("+o+","+r+")"),(a||s)&&l.push("skew("+Zg(a*Tf)+"deg, "+Zg(s*Tf)+"deg)"),l.join(" ")}function Se(t,e,n){return(e-t)*n+t}function Te(t,e,n,i){for(var o=e.length,r=0;ri?e:t,r=Math.min(n,i),a=o[r-1]||{color:[0,0,0,0],offset:0},s=r;sa)i.length=a;else for(var s=r;sgm||t<-5e-5}function Ve(t,e){for(var n=0;n=Mm)){t=t||of;for(var e=[],n=+new Date,i=0;i<=127;i++)e[i]=af.measureText(String.fromCharCode(i),t).width;var o=+new Date-n;return o>16?Tm=Mm:o>2&&Tm++,e}}(t.font),t.asciiWidthMapTried=!0),0<=e&&e<=127?null!=t.asciiWidthMap?t.asciiWidthMap[e]:t.asciiCharWidth:t.stWideCharWidth}function We(t,e){var n=t.strWidthCache,i=n.get(e);return null==i&&(i=af.measureText(e,t.font).width,n.put(e,i)),i}function je(t,e,n,i){var o=We(Ze(e),t),r=Xe(e),a=Ue(0,o,n),s=Ye(0,r,i);return new lg(a,s,o,r)}function Ge(t,e,n,i){var o=((t||"")+"").split("\n");if(1===o.length)return je(o[0],e,n,i);for(var r=new lg(0,0,0,0),a=0;a=0?parseFloat(t)/100*e:parseFloat(t):t}function Ke(t,e,n){var i=e.position||"inside",o=null!=e.distance?e.distance:5,r=n.height,a=n.width,s=r/2,l=n.x,u=n.y,h="left",c="top";if(i instanceof Array)l+=qe(i[0],n.width),u+=qe(i[1],n.height),h=null,c=null;else switch(i){case"left":l-=o,u+=s,h="right",c="middle";break;case"right":l+=o+a,u+=s,c="middle";break;case"top":l+=a/2,u-=o,h="center",c="bottom";break;case"bottom":l+=a/2,u+=r+o,h="center";break;case"inside":l+=a/2,u+=s,h="center",c="middle";break;case"insideLeft":l+=o,u+=s,c="middle";break;case"insideRight":l+=a-o,u+=s,h="right",c="middle";break;case"insideTop":l+=a/2,u+=o,h="center";break;case"insideBottom":l+=a/2,u+=r-o,h="center",c="bottom";break;case"insideTopLeft":l+=o,u+=o;break;case"insideTopRight":l+=a-o,u+=o,h="right";break;case"insideBottomLeft":l+=o,u+=r-o,c="bottom";break;case"insideBottomRight":l+=a-o,u+=r-o,h="right",c="bottom"}return(t=t||{}).x=l,t.y=u,t.align=h,t.verticalAlign=c,t}function $e(t,e,n,i,o){var r=[];tn(t,"",t,e,n=n||{},i,r,o);var a=r.length,s=!1,l=n.done,u=n.aborted,h=function(){s=!0,--a<=0&&(s?l&&l():u&&u())},c=function(){--a<=0&&(s?l&&l():u&&u())};a||l&&l(),r.length>0&&n.during&&r[0].during(function(t,e){n.during(e)});for(var d=0;d0||o.force&&!a.length){var k,I=void 0,L=void 0,P=void 0;if(s)for(L={},m&&(I={}),T=0;T0){if(t<=o)return a;if(t>=r)return s}else{if(t>=o)return a;if(t<=r)return s}else{if(t===o)return a;if(t===r)return s}return(t-o)/l*u+a}function on(t,e,n){return _(t)?(i=t,i.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(t)/100*e+(n||0):parseFloat(t):null==t?NaN:+t;var i}function rn(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),n?t:+t}function an(t){if(t=+t,isNaN(t))return 0;if(t>1e-14)for(var e=1,n=0;n<15;n++,e*=10)if(Math.round(t*e)/e===t)return n;return function(t){var e=t.toString().toLowerCase(),n=e.indexOf("e"),i=n>0?+e.slice(n+1):0,o=n>0?n:e.length,r=e.indexOf(".");return Math.max(0,(r<0?0:o-1-r)-i)}(t)}function sn(t,e){var n=Math.log,i=Math.LN10,o=Math.floor(n(t[1]-t[0])/i),r=Math.round(n(Wm(e[1]-e[0]))/i),a=Math.min(Math.max(-o+r,0),20);return isFinite(a)?a:20}function ln(t,e){var n=Math.max(an(t),an(e)),i=t+e;return n>20?i:rn(i,n)}function un(t){var e=2*Math.PI;return(t%e+e)%e}function hn(t){return t>-1e-4&&t=10&&e++,e}function pn(t,e){var n=dn(t),i=Math.pow(10,n),o=t/i;return t=(e?o<1.5?1:o<2.5?2:o<4?3:o<7?5:10:o<1?1:o<2?2:o<3?3:o<5?5:10)*i,n>=-20?+t.toFixed(n<0?-n:0):t}function fn(t){var e=parseFloat(t);return e==t&&(0!==e||!_(t)||t.indexOf("x")<=0)?e:NaN}function gn(){return Math.round(9*Math.random())}function mn(t,e){return 0===e?t:mn(e,t%e)}function yn(t,e){return null==t?e:null==e?t:t*e/mn(t,e)}function vn(t){return t instanceof Array?t:null==t?[]:[t]}function _n(t,e,n){if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};for(var i=0,o=n.length;i=0||o&&l(o,s)<0)){var u=n.getShallow(s,e);null!=u&&(r[t[a][0]]=u)}}return r}}function Zn(t){if("string"==typeof t){var e=iy.get(t);return e&&e.image}return t}function Hn(t,e,n,i,o){if(t){if("string"==typeof t){if(e&&e.__zrImageSrc===t||!n)return e;var r=iy.get(t),a={hostEl:n,cb:i,cbPayload:o};return r?!jn(e=r.image)&&r.pending.push(a):((e=af.loadImage(t,Wn,Wn)).__zrImageSrc=t,iy.put(t,e.__cachedImgObj={image:e,pending:[a]})),e}return t}return e}function Wn(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=l;h++)u-=l;var c=We(s,n);return c>u&&(n="",c=0),u=t-c,o.ellipsis=n,o.ellipsisWidth=c,o.contentWidth=u,o.containerWidth=t,o}function Yn(t,e,n){var i=n.containerWidth,o=n.contentWidth,r=n.fontMeasureInfo;if(!i)return t.textLine="",void(t.isTruncated=!1);var a=We(r,e);if(a<=i)return t.textLine=e,void(t.isTruncated=!1);for(var s=0;;s++){if(a<=o||s>=n.maxIterations){e+=n.ellipsis;break}var l=0===s?Xn(e,o,r):a>0?Math.floor(e.length*o/a):0;a=We(r,e=e.substr(0,l))}""===e&&(e=n.placeholder),t.textLine=e,t.isTruncated=!0}function Xn(t,e,n){for(var i=0,o=0,r=t.length;o0&&f+i.accumWidth>i.width&&(r=e.split("\n"),c=!0),i.accumWidth=f}else{var g=$n(e,h,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+p,a=g.linesWidths,r=g.lines}}r||(r=e.split("\n"));for(var m=Ze(h),y=0;y=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}(t)||!!ly[t]}function $n(t,e,n,i,o){for(var r=[],a=[],s="",l="",u=0,h=0,c=Ze(e),d=0;dn:o+h+f>n)?h?(s||l)&&(g?(s||(s=l,l="",h=u=0),r.push(s),a.push(h-u),l+=p,s="",h=u+=f):(l&&(s+=l,l="",u=0),r.push(s),a.push(h),s=p,h=f)):g?(r.push(l),a.push(u),l=p,u=f):(r.push(p),a.push(f)):(h+=f,g?(l+=p,u+=f):(l&&(s+=l,l="",u=0),s+=p))}else l&&(s+=l,h+=u),r.push(s),a.push(h),s="",l="",u=0,h=0}return l&&(s+=l),s&&(r.push(s),a.push(h)),1===r.length&&(h+=o),{accumWidth:h,lines:r,linesWidths:a}}function Jn(t,e,n,i,o,r){if(t.baseX=n,t.baseY=i,t.outerWidth=t.outerHeight=null,e){var a=2*e.width,s=2*e.height;lg.set(uy,Ue(n,a,o),Ye(i,s,r),a,s),lg.intersect(e,uy,null,hy);var l=hy.outIntersectRect;t.outerWidth=l.width,t.outerHeight=l.height,t.baseX=Ue(l.x,l.width,o,!0),t.baseY=Ye(l.y,l.height,r,!0)}}function Qn(t){return null!=t?t+="":t=""}function ti(t,e,n,i){var o=new lg(Ue(t.x||0,e,t.textAlign),Ye(t.y||0,n,t.textBaseline),e,n),r=null!=i?i:ei(t)?t.lineWidth:0;return r>0&&(o.x-=r/2,o.y-=r/2,o.width+=r,o.height+=r),o}function ei(t){var e=t.stroke;return null!=e&&"none"!==e&&t.lineWidth>0}function ni(t,e,n,i,o,r){o[0]=xy(t,n),o[1]=xy(e,i),r[0]=wy(t,n),r[1]=wy(e,i)}function ii(t,e,n,i,o,r,a,s,l,u){var h=Zt,c=Nt,d=h(t,n,o,a,Iy);l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0;for(var p=0;p1e-4)return s[0]=t-n,s[1]=e-i,l[0]=t+n,void(l[1]=e+i);if(My[0]=Sy(o)*n+t,My[1]=by(o)*i+e,Cy[0]=Sy(r)*n+t,Cy[1]=by(r)*i+e,u(s,My,Cy),h(l,My,Cy),(o%=Ty)<0&&(o+=Ty),(r%=Ty)<0&&(r+=Ty),o>r&&!a?r+=Ty:oo&&(ky[0]=Sy(p)*n+t,ky[1]=by(p)*i+e,u(s,ky,s),h(l,ky,l))}function ai(t){return Math.round(t/Hy*1e8)/1e8%2*Hy}function si(t,e,n,i,o,r,a){if(0===o)return!1;var s,l=o;if(a>e+l&&a>i+l||at+l&&r>n+l||re+c&&h>i+c&&h>r+c&&h>s+c||ht+c&&u>n+c&&u>o+c&&u>a+c||u=0&&pe+u&&l>i+u&&l>r+u||lt+u&&s>n+u&&s>o+u||s=0&&gn||h+uo&&(o+=qy);var d=Math.atan2(l,s);return d<0&&(d+=qy),d>=i&&d<=o||d+qy>=i&&d+qy<=o}function di(t,e,n,i,o,r){if(r>e&&r>i||ro?s:0}function pi(){var t=Qy[0];Qy[0]=Qy[1],Qy[1]=t}function fi(t,e,n,i,o,r,a,s,l,u){if(u>e&&u>i&&u>r&&u>s||u1&&pi(),p=Nt(e,i,r,s,Qy[0]),d>1&&(f=Nt(e,i,r,s,Qy[1]))),c+=2===d?me&&s>i&&s>r||s=0&&h<=1&&(o[l++]=h);else{var u=a*a-4*r*s;if(Rt(u))(h=-a/(2*r))>=0&&h<=1&&(o[l++]=h);else if(u>0){var h,c=Sg(u),d=(-a-c)/(2*r);(h=(-a+c)/(2*r))>=0&&h<=1&&(o[l++]=h),d>=0&&d<=1&&(o[l++]=d)}}return l}(e,i,r,s,Jy);if(0===l)return 0;var u=Ut(e,i,r);if(u>=0&&u<=1){for(var h=0,c=jt(e,i,r,u),d=0;dn||s<-n)return 0;var l=Math.sqrt(n*n-s*s);Jy[0]=-l,Jy[1]=l;var u=Math.abs(i-o);if(u<1e-4)return 0;if(u>=$y-1e-4){i=0,o=$y;var h=r?1:-1;return a>=Jy[0]+t&&a<=Jy[1]+t?h:0}if(i>o){var c=i;i=o,o=c}i<0&&(i+=$y,o+=$y);for(var d=0,p=0;p<2;p++){var f=Jy[p];if(f+t>a){var g=Math.atan2(s,f);h=r?1:-1,g<0&&(g=$y+g),(g>=i&&g<=o||g+$y>=i&&g+$y<=o)&&(g>Math.PI/2&&g<1.5*Math.PI&&(h=-h),d+=h)}}return d}function yi(t,e,n,i,o){for(var r,a,s=t.data,l=t.len(),u=0,h=0,c=0,d=0,p=0,f=0;f1&&(n||(u+=di(h,c,d,p,i,o))),m&&(d=h=s[f],p=c=s[f+1]),g){case Ky.M:h=d=s[f++],c=p=s[f++];break;case Ky.L:if(n){if(si(h,c,s[f],s[f+1],e,i,o))return!0}else u+=di(h,c,s[f],s[f+1],i,o)||0;h=s[f++],c=s[f++];break;case Ky.C:if(n){if(li(h,c,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],e,i,o))return!0}else u+=fi(h,c,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],i,o)||0;h=s[f++],c=s[f++];break;case Ky.Q:if(n){if(ui(h,c,s[f++],s[f++],s[f],s[f+1],e,i,o))return!0}else u+=gi(h,c,s[f++],s[f++],s[f],s[f+1],i,o)||0;h=s[f++],c=s[f++];break;case Ky.A:var y=s[f++],v=s[f++],_=s[f++],x=s[f++],w=s[f++],b=s[f++];f+=1;var S=!!(1-s[f++]);r=Math.cos(w)*_+y,a=Math.sin(w)*x+v,m?(d=r,p=a):u+=di(h,c,r,a,i,o);var T=(i-y)*x/_+y;if(n){if(ci(y,v,x,w,w+b,S,e,T,o))return!0}else u+=mi(y,v,x,w,w+b,S,T,o);h=Math.cos(w+b)*_+y,c=Math.sin(w+b)*x+v;break;case Ky.R:if(d=h=s[f++],p=c=s[f++],r=d+s[f++],a=p+s[f++],n){if(si(d,p,r,p,e,i,o)||si(r,p,r,a,e,i,o)||si(r,a,d,a,e,i,o)||si(d,a,d,p,e,i,o))return!0}else u+=di(r,p,r,a,i,o),u+=di(d,a,d,p,i,o);break;case Ky.Z:if(n){if(si(h,c,d,p,e,i,o))return!0}else u+=di(h,c,d,p,i,o);h=d,c=p}}return n||Math.abs(c-p)<1e-4||(u+=di(h,c,d,p,i,o)||0),0!==u}function vi(t,e,n){if(e){var i=e.x1,o=e.x2,r=e.y1,a=e.y2;t.x1=i,t.x2=o,t.y1=r,t.y2=a;var s=n&&n.lineWidth;return s?(dv(2*i)===dv(2*o)&&(t.x1=t.x2=xi(i,s,!0)),dv(2*r)===dv(2*a)&&(t.y1=t.y2=xi(r,s,!0)),t):t}}function _i(t,e,n){if(e){var i=e.x,o=e.y,r=e.width,a=e.height;t.x=i,t.y=o,t.width=r,t.height=a;var s=n&&n.lineWidth;return s?(t.x=xi(i,s,!0),t.y=xi(o,s,!0),t.width=Math.max(xi(i+r,s,!1)-t.x,0===r?0:1),t.height=Math.max(xi(o+a,s,!1)-t.y,0===a?0:1),t):t}}function xi(t,e,n){if(!e)return t;var i=dv(2*t);return(i+dv(e))%2==0?i/2:(i+(n?1:-1))/2}function wi(t){return"string"!=typeof t||-1===t.indexOf("px")&&-1===t.indexOf("rem")&&-1===t.indexOf("em")?isNaN(+t)?"12px":t+"px":t}function bi(t,e){for(var n=0;n=0,r=!1;if(t instanceof ov){var s=Iv(t),u=o&&s.selectFill||s.normalFill,h=o&&s.selectStroke||s.normalStroke;if(Pi(u)||Pi(h)){var c=(i=i||{}).style||{};"inherit"===c.fill?(r=!0,i=a({},i),(c=a({},c)).fill=u):!Pi(c.fill)&&Pi(u)?(r=!0,i=a({},i),(c=a({},c)).fill=he(u)):!Pi(c.stroke)&&Pi(h)&&(r||(i=a({},i),c=a({},c)),c.stroke=he(h)),i.style=c}}if(i&&null==i.z2){r||(i=a({},i));var d=t.z2EmphasisLift;i.z2=t.z2+(null!=d?d:10)}return i}(this,0,e,n);if("blur"===t)return function(t,e,n){var i=l(t.currentStates,e)>=0,o=t.style.opacity,r=i?null:function(t,e,n,i){for(var o=t.style,r={},a=0;a0){var r={dataIndex:o,seriesIndex:t.seriesIndex};null!=i&&(r.dataType=i),e.push(r)}})}),e}function no(t,e,n){oo(t,!0),Fi(t,Zi),function(t,e,n){var i=Mv(t);null!=e?(i.focus=e,i.blurScope=n):i.focus&&(i.focus=null)}(t,e,n)}function io(t,e,n,i){i?function(t){oo(t,!1)}(t):no(t,e,n)}function oo(t,e){var n=!1===e,i=t;t.highDownSilentOnTouch&&(i.__highDownSilentOnTouch=t.highDownSilentOnTouch),n&&!i.__highDownDispatcher||(i.__highByOuter=i.__highByOuter||0,i.__highDownDispatcher=!n)}function ro(t){return!(!t||!t.__highDownDispatcher)}function ao(t){var e=t.type;return e===zv||e===Ev||e===Rv}function so(t){var e=t.type;return e===Av||e===Ov}function lo(t,e,n){var i,o=t.labelFetcher,r=t.labelDataIndex,a=t.labelDimIndex,s=e.normal;o&&(i=o.getFormattedLabel(r,"normal",null,a,s&&s.get("formatter"),null!=n?{interpolatedValue:n}:null)),null==i&&(i=v(t.defaultText)?t.defaultText(r,t,n):t.defaultText);for(var l={normal:i},u=0;u=12?"pm":"am",m=g.toUpperCase(),y=i instanceof i_?i:function(t){return u_[t]}(i||h_)||u_[s_],v=y.getModel("time"),_=v.get("month"),x=v.get("monthAbbr"),w=v.get("dayOfWeek"),b=v.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,g+"").replace(/{A}/g,m+"").replace(/{yyyy}/g,r+"").replace(/{yy}/g,_o(r%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,_[a-1]).replace(/{MMM}/g,x[a-1]).replace(/{MM}/g,_o(a,2)).replace(/{M}/g,a+"").replace(/{dd}/g,_o(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,w[u]).replace(/{ee}/g,b[u]).replace(/{e}/g,u+"").replace(/{HH}/g,_o(h,2)).replace(/{H}/g,h+"").replace(/{hh}/g,_o(c+"",2)).replace(/{h}/g,c+"").replace(/{mm}/g,_o(d,2)).replace(/{m}/g,d+"").replace(/{ss}/g,_o(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,_o(f,3)).replace(/{S}/g,f+"")}function So(t,e){var n=cn(t),i=n[Co(e)]()+1,o=n[ko(e)](),r=n[Io(e)](),a=n[Lo(e)](),s=n[Po(e)](),l=0===n[Do(e)](),u=l&&0===s,h=u&&0===a,c=h&&0===r,d=c&&1===o;return d&&1===i?"year":d?"month":c?"day":h?"hour":u?"minute":l?"second":"millisecond"}function To(t,e,n){switch(e){case"year":t[Oo(n)](0);case"month":t[zo(n)](1);case"day":t[Eo(n)](0);case"hour":t[Ro(n)](0);case"minute":t[Bo(n)](0);case"second":t[No(n)](0)}return t}function Mo(t){return t?"getUTCFullYear":"getFullYear"}function Co(t){return t?"getUTCMonth":"getMonth"}function ko(t){return t?"getUTCDate":"getDate"}function Io(t){return t?"getUTCHours":"getHours"}function Lo(t){return t?"getUTCMinutes":"getMinutes"}function Po(t){return t?"getUTCSeconds":"getSeconds"}function Do(t){return t?"getUTCMilliseconds":"getMilliseconds"}function Ao(t){return t?"setUTCFullYear":"setFullYear"}function Oo(t){return t?"setUTCMonth":"setMonth"}function zo(t){return t?"setUTCDate":"setDate"}function Eo(t){return t?"setUTCHours":"setHours"}function Ro(t){return t?"setUTCMinutes":"setMinutes"}function Bo(t){return t?"setUTCSeconds":"setSeconds"}function No(t){return t?"setUTCMilliseconds":"setMilliseconds"}function Fo(t){if(isNaN(fn(t)))return _(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function Vo(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}function Zo(t,e,n){function i(t){return t&&z(t)?t:"-"}function o(t){return!(null==t||isNaN(t)||!isFinite(t))}var r="time"===e,a=t instanceof Date;if(r||a){var s=r?cn(t):t;if(!isNaN(+s))return bo(s,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",n);if(a)return"-"}if("ordinal"===e)return x(t)?i(t):w(t)&&o(t)?t+"":"-";var l=fn(t);return o(l)?Fo(l):x(t)?i(t):"boolean"==typeof t?t+"":"-"}function Ho(t,e,n){y(e)||(e=[e]);var i=e.length;if(!i)return"";for(var o=e[0].$vars||[],r=0;ri||l.newline?(r=0,h=g,a+=s+n,s=d.height):s=Math.max(s,d.height)}else{var m=d.height+(f?-f.y+d.y:0);(c=a+m)>o||l.newline?(r+=s+n,a=0,c=m,s=d.width):s=Math.max(s,d.width)}l.newline||(l.x=r,l.y=a,l.markRedraw(),"horizontal"===t?r=h+n:a=c+n)})}function Yo(t,e,n){n=S_(n||0);var i=e.width,o=e.height,r=jm(t.left,i),a=jm(t.top,o),s=jm(t.right,i),l=jm(t.bottom,o),u=jm(t.width,i),h=jm(t.height,o),c=n[2]+n[0],d=n[1]+n[3],p=t.aspect;switch(isNaN(u)&&(u=i-s-d-r),isNaN(h)&&(h=o-l-c-a),null!=p&&(isNaN(u)&&isNaN(h)&&(p>i/o?u=.8*i:h=.8*o),isNaN(u)&&(u=p*h),isNaN(h)&&(h=u/p)),isNaN(r)&&(r=i-s-u-d),isNaN(a)&&(a=o-l-h-c),t.left||t.right){case"center":r=i/2-u/2-n[3];break;case"right":r=i-u-d}switch(t.top||t.bottom){case"middle":case"center":a=o/2-h/2-n[0];break;case"bottom":a=o-h-c}r=r||0,a=a||0,isNaN(u)&&(u=i-d-r-(s||0)),isNaN(h)&&(h=o-c-a-(l||0));var f=new lg((e.x||0)+r+n[3],(e.y||0)+a+n[0],u,h);return f.margin=n,f}function Xo(t,e,n){var i,o,r,a,s=t.boxCoordinateSystem;if(s){var l=function(t){var e=t.getShallow("coord",!0),n=L_;if(null==e){var i=D_.get(t.type);i&&i.getCoord2&&(n=P_,e=i.getCoord2(t))}return{coord:e,from:n}}(t),u=l.coord,h=l.from;if(s.dataToLayout){r=V_.rect,a=h;var c=s.dataToLayout(u);i=c.contentRect||c.rect}else n&&n.enableLayoutOnlyByCenter&&s.dataToPoint&&(r=V_.point,a=h,o=s.dataToPoint(u))}return null==r&&(r=V_.rect),r===V_.rect&&(i||(i={x:0,y:0,width:e.getWidth(),height:e.getHeight()}),o=[i.x+i.width/2,i.y+i.height/2]),{type:r,refContainer:i,refPoint:o,boxCoordFrom:a}}function qo(t,e,n,i,o,r){var a,l=!o||!o.hv||o.hv[0],u=!o||!o.hv||o.hv[1],h=o&&o.boundingMode||"all";if((r=r||t).x=t.x,r.y=t.y,!l&&!u)return!1;if("raw"===h)a="group"===t.type?new lg(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(a=t.getBoundingRect(),t.needLocalTransform()){var c=t.getLocalTransform();(a=a.clone()).applyTransform(c)}var d=Yo(s({width:a.width,height:a.height},e),n,i),p=l?d.x-a.x:0,f=u?d.y-a.y:0;return"raw"===h?(r.x=p,r.y=f):(r.x+=p,r.y+=f),r===t&&t.markRedraw(),!0}function Ko(t){var e=t.layoutMode||t.constructor.layoutMode;return b(e)?e:e?{type:e}:null}function $o(t,e,n){function i(n,i){var r={},s=0,l={},u=0;if(R_(n,function(e){l[e]=t[e]}),R_(n,function(t){Z(e,t)&&(r[t]=l[t]=e[t]),o(r,t)&&s++,o(l,t)&&u++}),a[i])return o(e,n[1])?l[n[2]]=null:o(e,n[2])&&(l[n[1]]=null),l;if(2!==u&&s){if(s>=2)return r;for(var h=0;h=e:"max"===n?t<=e:t===e})(i[a],t,r)||(o=!1)}}),o}function sr(t){var e=t&&t.itemStyle;if(e)for(var n=0,i=Bx.length;n65535?aw:sw}function jr(){return[1/0,-1/0]}function Gr(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function Ur(t,e,n,i,o){var r=hw[n||"float"];if(o){var a=t[e],s=a&&a.length;if(s!==i){for(var l=new r(i),u=0;u1||n>0&&!t.noHeader;return c(t.blocks,function(t){var n=ta(t);n>=e&&(e=n+ +(i&&(!n||Jr(t)&&!t.noHeader)))}),e}return 0}function ea(t,e,n,i){var o,r=e.noHeader,s=(o=ta(e),{html:fw[o],richText:gw[o]}),l=[],u=e.blocks||[];O(!u||y(u)),u=u||[];var h=t.orderMode;if(e.sortBlocks&&h){u=u.slice();var d={valueAsc:"asc",valueDesc:"desc"};if(Z(d,h)){var p=new nw(d[h],null);u.sort(function(t,e){return p.evaluate(t.sortParam,e.sortParam)})}else"seriesDesc"===h&&u.reverse()}c(u,function(n,o){var r=e.valueFormatter,u=Qr(n)(r?a(a({},t),{valueFormatter:r}):t,n,o>0?s.html:0,i);null!=u&&l.push(u)});var f="richText"===t.renderMode?l.join(s.richText):oa(i,l.join(""),r?n:s.html);if(r)return f;var g=Zo(e.header,"ordinal",t.useUTC),m=Kr(i,t.renderMode).nameStyle,v=qr(i);return"richText"===t.renderMode?ra(t,g,m)+s.richText+f:oa(i,'
'+lt(g)+"
"+f,n)}function na(t,e,n,i){var o=t.renderMode,r=e.noName,a=e.noValue,s=!e.markerType,l=e.name,u=t.useUTC,h=e.valueFormatter||t.valueFormatter||function(t){return d(t=y(t)?t:[t],function(t,e){return Zo(t,y(f)?f[e]:f,u)})};if(!r||!a){var c=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||X_.color.secondary,o),p=r?"":Zo(l,"ordinal",u),f=e.valueType,g=a?[]:h(e.value,e.dataIndex),m=!s||!r,v=!s&&r,_=Kr(i,o),x=_.nameStyle,w=_.valueStyle;return"richText"===o?(s?"":c)+(r?"":ra(t,p,x))+(a?"":function(t,e,n,i,o){var r=[o];return n&&r.push({padding:[0,0,0,i?10:20],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(y(e)?e.join(" "):e,r)}(t,g,m,v,w)):oa(i,(s?"":c)+(r?"":function(t,e,n){return''+lt(t)+""}(p,!s,x))+(a?"":function(t,e,n,i){return''+d(t=y(t)?t:[t],function(t){return lt(t)}).join("  ")+""}(g,m,v,w)),n)}}function ia(t,e,n,i,o,r){if(t)return Qr(t)({useUTC:o,renderMode:n,orderMode:i,markupStyleCreator:e,valueFormatter:t.valueFormatter},t,0,r)}function oa(t,e,n){return'
'+e+'
'}function ra(t,e,n){return t.markupStyleCreator.wrapRichTextStyle(e,n)}function aa(t,e){var n=t.get("padding");return null!=n?n:"richText"===e?[8,10]:10}function sa(t){var e,n,i,o,r=t.series,a=t.dataIndex,s=t.multipleSeries,l=r.getData(),u=l.mapDimensionsAll("defaultedTooltip"),h=u.length,d=r.getRawValue(a),f=y(d),g=function(t,e){return Wo(t.getData().getItemVisual(e,"style")[t.visualDrawType])}(r,a);if(h>1||f&&!h){var m=function(t,e,n,i,o){function r(t,e){var n=a.getDimensionInfo(e);n&&!1!==n.otherDims.tooltip&&(s?h.push($r("nameValue",{markerType:"subItem",markerColor:o,name:n.displayName,value:t,valueType:n.type})):(l.push(t),u.push(n.type)))}var a=e.getData(),s=p(t,function(t,e,n){var i=a.getDimensionInfo(n);return t||i&&!1!==i.tooltip&&null!=i.displayName},!1),l=[],u=[],h=[];return i.length?c(i,function(t){r(Or(a,n,t),t)}):c(t,r),{inlineValues:l,inlineValueTypes:u,blocks:h}}(d,r,a,u,g);e=m.inlineValues,n=m.inlineValueTypes,i=m.blocks,o=m.inlineValues[0]}else if(h){var v=l.getDimensionInfo(u[0]);o=e=Or(l,a,u[0]),n=v.type}else o=e=f?d[0]:d;var _=Cn(r),x=_&&r.name||"",w=l.getName(a),b=s?x:w;return $r("section",{header:x,noHeader:s||!_,sortParam:o,blocks:[$r("nameValue",{markerType:"item",markerColor:g,name:b,noName:!z(b),value:e,valueType:n,dataIndex:a})].concat(i||[])})}function la(t,e){return t.getName(e)||t.getId(e)}function ua(t){var e=t.name;Cn(t)||(t.name=function(t){var e=t.getRawData(),n=e.mapDimensionsAll("seriesName"),i=[];return c(n,function(t){var n=e.getDimensionInfo(t);n.displayName&&i.push(n.displayName)}),i.join(" ")}(t)||e)}function ha(t){return t.model.getRawData().count()}function ca(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),da}function da(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function pa(t,e){c(N(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(n){t.wrapMethod(n,m(fa,e))})}function fa(t,e){var n=ga(t);return n&&n.setOutputEnd((e||this).count()),e}function ga(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){var i=n.currentTask;if(i){var o=i.agentStubMap;o&&(i=o.get(t.uid))}return i}}function ma(){var t=Ln();return function(e){var n=t(e),i=e.pipelineContext,o=!!n.large,r=!!n.progressiveRender,a=n.large=!(!i||!i.large),s=n.progressiveRender=!(!i||!i.progressiveRender);return!(o===a&&r===s)&&"reset"}}function ya(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function va(t,e){return(t[0]*e[0]+t[1]*e[1])/(ya(t)*ya(e))}function _a(t,e){return(t[0]*e[1]1&&(a*=Cw(f),s*=Cw(f));var g=(o===r?-1:1)*Cw((a*a*(s*s)-a*a*(p*p)-s*s*(d*d))/(a*a*(p*p)+s*s*(d*d)))||0,m=g*a*p/s,y=g*-s*d/a,v=(t+n)/2+Iw(c)*m-kw(c)*y,_=(e+i)/2+kw(c)*m+Iw(c)*y,x=_a([1,0],[(d-m)/a,(p-y)/s]),w=[(d-m)/a,(p-y)/s],b=[(-1*d-m)/a,(-1*p-y)/s],S=_a(w,b);if(va(w,b)<=-1&&(S=Lw),va(w,b)>=1&&(S=0),S<0){var T=Math.round(S/Lw*1e6)/1e6;S=2*Lw+T%2*Lw}h.addData(u,v,_,a,s,x,S,c,r)}function wa(t){return null!=t.setData}function ba(t,e){var n=function(t){var e=new Yy;if(!t)return e;var n,i=0,o=0,r=i,a=o,s=Yy.CMD,l=t.match(Pw);if(!l)return e;for(var u=0;uP*P+D*D&&(T=C,M=k),{cx:T,cy:M,x0:-h,y0:-c,x1:T*(o/w-1),y1:M*(o/w-1)}}function Ta(t,e,n){var i=e.smooth,o=e.points;if(o&&o.length>=2){if(i){var r=function(t,e,n,i){var o,r,a,s,l=[],u=[],h=[],c=[];if(i){a=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,p=t.length;d0){var c={duration:h.duration,delay:h.delay||0,easing:h.easing,done:r,force:!!r||!!a,setToFinal:!u,scope:t,during:a};l?e.animateFrom(n,c):e.animateTo(n,c)}else e.stopAnimation(),!l&&e.attr(n),a&&a(1),r&&r()}function Ia(t,e,n,i,o,r){ka("update",t,e,n,i,o,r)}function La(t,e,n,i,o,r){ka("enter",t,e,n,i,o,r)}function Pa(t){if(!t.__zr)return!0;for(var e=0;eWm(r[1])?r[0]>0?"right":"left":r[1]>0?"bottom":"top"}function Ya(t){return!t.isGroup}function Xa(t,e,n){function i(t){var e={x:t.x,y:t.y,rotation:t.rotation};return function(t){return null!=t.shape}(t)&&(e.shape=o(t.shape)),e}if(t&&e){var r,a=(r={},t.traverse(function(t){Ya(t)&&t.anid&&(r[t.anid]=t)}),r);e.traverse(function(t){if(Ya(t)&&t.anid){var e=a[t.anid];if(e){var o=i(t);t.attr(i(e)),Ia(t,o,n,Mv(t).dataIndex)}}})}}function qa(t,e){return d(t,function(t){var n=t[0];n=Hm(n,e.x),n=Zm(n,e.x+e.width);var i=t[1];return i=Hm(i,e.y),[n,i=Zm(i,e.y+e.height)]})}function Ka(t,e){var n=Hm(t.x,e.x),i=Zm(t.x+t.width,e.x+e.width),o=Hm(t.y,e.y),r=Zm(t.y+t.height,e.y+e.height);if(i>=n&&r>=o)return{x:n,y:o,width:i-n,height:r-o}}function $a(t,e,n){var i=a({rectHover:!0},e),o=i.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(o.image=t.slice(8),s(o,n),new cv(i)):Na(t.replace("path://",""),i,n,"center")}function Ja(t,e,n,i,o){for(var r=0,a=o[o.length-1];r=-1e-6)return!1;var f=t-o,g=e-r,m=ts(f,g,u,h)/p;if(m<0||m>1)return!1;var y=ts(f,g,c,d)/p;return!(y<0||y>1)}function ts(t,e,n,i){return t*i-n*e}function es(t,e,n,i,o){return null==e||(w(e)?jb[0]=jb[1]=jb[2]=jb[3]=e:(jb[0]=e[0],jb[1]=e[1],jb[2]=e[2],jb[3]=e[3]),i&&(jb[0]=Hm(0,jb[0]),jb[1]=Hm(0,jb[1]),jb[2]=Hm(0,jb[2]),jb[3]=Hm(0,jb[3])),n&&(jb[0]=-jb[0],jb[1]=-jb[1],jb[2]=-jb[2],jb[3]=-jb[3]),ns(t,jb,"x","width",3,1,o&&o[0]||0),ns(t,jb,"y","height",0,2,o&&o[1]||0)),t}function ns(t,e,n,i,o,r,a){var s=e[r]+e[o],l=t[i];t[i]+=s,a=Hm(0,Zm(a,l)),t[i]=0?-e[o]:e[r]>=0?l+e[r]:Wm(s)>1e-8?(l-a)*e[o]/s:0):t[n]-=e[o]}function is(t){var e=t.itemTooltipOption,n=t.componentModel,i=t.itemName,o=_(e)?{formatter:e}:e,r=n.mainType,a=n.componentIndex,l={componentType:r,name:i,$vars:["name"]};l[r+"Index"]=a;var u=t.formatterParamsExtra;u&&c(g(u),function(t){Z(l,t)||(l[t]=u[t],l.$vars.push(t))});var h=Mv(t.el);h.componentMainType=r,h.componentIndex=a,h.tooltipConfig={name:i,option:s({content:i,encodeHTMLContent:!0,formatterParams:l},o)}}function os(t,e){var n;t.isGroup&&(n=e(t)),n||t.traverse(e)}function rs(t,e){if(t)if(y(t))for(var n=0;ni&&(i=e),ei&&(o=i=0),{min:o,max:i}}function cs(t,e,n){ds(t,e,n,-1/0)}function ds(t,e,n,i){if(t.ignoreModelZ)return i;var o=t.getTextContent(),r=t.getTextGuideLine();if(t.isGroup)for(var a=t.childrenRef(),s=0;s=0?i():c=setTimeout(i,-r),u=o};return d.clear=function(){c&&(clearTimeout(c),c=null)},d.debounceNextCall=function(t){l=t},d}function vs(t,e,n,i){var o=t[e];if(o){var r=o[Jb]||o;if(o[Qb]!==n||o[tS]!==i){if(null==n||!i)return t[e]=r;(o=t[e]=ys(r,n,"debounce"===i))[Jb]=r,o[tS]=i,o[Qb]=n}return o}}function _s(t,e){var n=t[e];n&&n[Jb]&&(n.clear&&n.clear(),t[e]=n[Jb])}function xs(t,e){return t.visualStyleMapper||nS[e]||(console.warn("Unknown style type '"+e+"'."),nS.itemStyle)}function ws(t,e){return t.visualDrawType||iS[e]||(console.warn("Unknown style type '"+e+"'."),"fill")}function bs(t){t.overallReset(t.ecModel,t.api,t.payload)}function Ss(t){return t.overallProgress&&Ts}function Ts(){this.agent.dirty(),this.getDownstream().dirty()}function Ms(){this.agent&&this.agent.dirty()}function Cs(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function ks(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=vn(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?d(e,function(t,e){return Is(e)}):hS}function Is(t){return function(e,n){var i=n.data,o=n.resetDefines[t];if(o&&o.dataEach)for(var r=e.start;r=0&&Ns(l)?l:.5,t.createRadialGradient(a,s,0,a,s,l)}(t,e,n):function(t,e,n){var i=null==e.x?0:e.x,o=null==e.x2?1:e.x2,r=null==e.y?0:e.y,a=null==e.y2?0:e.y2;return e.global||(i=i*n.width+n.x,o=o*n.width+n.x,r=r*n.height+n.y,a=a*n.height+n.y),i=Ns(i)?i:0,o=Ns(o)?o:1,r=Ns(r)?r:0,a=Ns(a)?a:0,t.createLinearGradient(i,r,o,a)}(t,e,n),o=e.colorStops,r=0;r0&&(n=i.lineWidth,(e=i.lineDash)&&"solid"!==e&&n>0?"dashed"===e?[4*n,2*n]:"dotted"===e?[n]:w(e)?[e]:y(e)?e:null:null),r=i.lineDashOffset;if(o){var a=i.strokeNoScale&&t.getLineScale?t.getLineScale():1;a&&1!==a&&(o=d(o,function(t){return t/a}),r/=a)}return[o,r]}function Ws(t){var e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))}function js(t){return"string"==typeof t&&"none"!==t}function Gs(t){var e=t.fill;return null!=e&&"none"!==e}function Us(t,e){if(null!=e.fillOpacity&&1!==e.fillOpacity){var n=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=n}else t.fill()}function Ys(t,e){if(null!=e.strokeOpacity&&1!==e.strokeOpacity){var n=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=n}else t.stroke()}function Xs(t,e,n){var i=Hn(e.image,e.__image,n);if(jn(i)){var o=t.createPattern(i,e.repeat||"repeat");if("function"==typeof DOMMatrix&&o&&o.setTransform){var r=new DOMMatrix;r.translateSelf(e.x||0,e.y||0),r.rotateSelf(0,0,(e.rotation||0)*Tf),r.scaleSelf(e.scaleX||1,e.scaleY||1),o.setTransform(r)}return o}}function qs(t,e,n,i,o){var r=!1;if(!i&&e===(n=n||{}))return!1;if(i||e.opacity!==n.opacity){Js(t,o),r=!0;var a=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(a)?dy.opacity:a}(i||e.blend!==n.blend)&&(r||(Js(t,o),r=!0),t.globalCompositeOperation=e.blend||dy.blend);for(var s=0;s=0)){ET.push(n);var r=pS.wrapStageHandler(n,o);r.__prio=e,r.__raw=n,t.push(r)}}function vl(t,e){PT[t]=e}function _l(t,e,n,i){return{eventContent:{selected:eo(n),isFromClick:e.isFromClick||!1}}}function xl(e=!1){return RT||(RT=t(481),RT)}function wl(t,e,n,i,o,r){if(o-i<=n)return;const a=i+o>>1;bl(t,e,a,i,o,r),wl(t,e,n,i,a-1,1-r),wl(t,e,n,a+1,o,1-r)}function bl(t,e,n,i,o,r){for(;o>i;){if(o-i>600){const a=o-i+1,s=n-i+1,l=Math.log(a),u=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*u*(a-u)/a)*(s-a/2<0?-1:1);bl(t,e,n,Math.max(i,Math.floor(n-s*u/a+h)),Math.min(o,Math.floor(n+(a-s)*u/a+h)),r)}const a=e[2*n+r];let s=i,l=o;for(Sl(t,e,i,n),e[2*o+r]>a&&Sl(t,e,i,o);sa;)l--}e[2*i+r]===a?Sl(t,e,i,l):(l++,Sl(t,e,l,o)),l<=n&&(i=l+1),n<=l&&(o=l-1)}}function Sl(t,e,n,i){Tl(t,n,i),Tl(e,2*n,2*i),Tl(e,2*n+1,2*i+1)}function Tl(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function Ml(t,e,n,i){const o=t-n,r=e-i;return o*o+r*r}function Cl(t){y(t)?c(t,function(t){Cl(t)}):l(UT,t)>=0||(UT.push(t),v(t)&&(t={install:t}),t.install(YT))}function kl(t){return isNaN(+t.cpx1)||isNaN(+t.cpy1)}function Il(t){return"_"+t+"Type"}function Ll(t,e,n){var i=e.getItemVisual(n,t);if(!i||"none"===i)return i;var o=e.getItemVisual(n,t+"Size"),r=e.getItemVisual(n,t+"Rotate"),a=e.getItemVisual(n,t+"Offset"),s=e.getItemVisual(n,t+"KeepAspect"),l=Rs(o);return i+l+Bs(a||0,l)+(r||"")+(s||"")}function Pl(t,e,n){var i=e.getItemVisual(n,t);if(i&&"none"!==i){var o=e.getItemVisual(n,t+"Size"),r=e.getItemVisual(n,t+"Rotate"),a=e.getItemVisual(n,t+"Offset"),s=e.getItemVisual(n,t+"KeepAspect"),l=Rs(o),u=Bs(a||0,l),h=Es(i,-l[0]/2+u[0],-l[1]/2+u[1],l[0],l[1],null,s);return h.__specifiedRotation=null==r||isNaN(r)?void 0:+r*Math.PI/180||0,h.name=t,h}}function Dl(t,e){t.x1=e[0][0],t.y1=e[0][1],t.x2=e[1][0],t.y2=e[1][1],t.percent=1;var n=e[2];n?(t.cpx1=n[0],t.cpy1=n[1]):(t.cpx1=NaN,t.cpy1=NaN)}function Al(t){var e=t.hostModel,n=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:n.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:n.get("disabled"),blurScope:n.get("blurScope"),focus:n.get("focus"),labelStatesModels:ho(e)}}function Ol(t){return isNaN(t[0])||isNaN(t[1])}function zl(t){return t&&!Ol(t[0])&&!Ol(t[1])}function El(t){return null==t?0:t.length||1}function Rl(t){return t}function Bl(t,e){return t.hasOwnProperty(e)||(t[e]=[]),t[e]}function Nl(t){return t instanceof kM}function Fl(t){for(var e=B(),n=0;n<(t||[]).length;n++){var i=t[n],o=b(i)?i.name:i;null!=o&&null==e.get(o)&&e.set(o,n)}return e}function Vl(t){var e=MM(t);return e.dimNameMap||(e.dimNameMap=Fl(t.dimensionsDefine))}function Zl(t){return t>30}function Hl(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(t.data=d(e,function(t){var e={coords:[t[0].coord,t[1].coord]};return t[0].name&&(e.fromName=t[0].name),t[1].name&&(e.toName=t[1].name),function(t){for(var e=t[0],n=1,i=t.length;nn&&!l||o=0?i+=u:i-=u:f>=0?i-=u:i+=u}return i}function Su(t,e){var n=[],i=Yt,o=[[],[],[]],r=[[],[]],a=[];e/=2,t.eachEdge(function(t,s){var l=t.getLayout(),u=t.getVisual("fromSymbol"),h=t.getVisual("toSymbol");l.__original||(l.__original=[U(l[0]),U(l[1])],l[2]&&l.__original.push(U(l[2])));var c=l.__original;if(null!=l[2]){if(G(o[0],c[0]),G(o[1],c[2]),G(o[2],c[1]),u&&"none"!==u){var d=Ql(t.node1),p=bu(o,c[0],d*e);i(o[0][0],o[1][0],o[2][0],p,n),o[0][0]=n[3],o[1][0]=n[4],i(o[0][1],o[1][1],o[2][1],p,n),o[0][1]=n[3],o[1][1]=n[4]}h&&"none"!==h&&(d=Ql(t.node2),p=bu(o,c[1],d*e),i(o[0][0],o[1][0],o[2][0],p,n),o[1][0]=n[1],o[2][0]=n[2],i(o[0][1],o[1][1],o[2][1],p,n),o[1][1]=n[1],o[2][1]=n[2]),G(l[0],o[0]),G(l[1],o[2]),G(l[2],o[1])}else G(r[0],c[0]),G(r[1],c[1]),K(a,r[1],r[0]),Q(a,a),u&&"none"!==u&&(d=Ql(t.node1),q(r[0],r[0],a,d*e)),h&&"none"!==h&&(d=Ql(t.node2),q(r[1],r[1],a,-d*e)),G(l[0],r[0]),G(l[1],r[1])})}function Tu(t){return"view"===t.type}function Mu(t){return"_EC_"+t}function Cu(t,e){return{getValue:function(n){var i=this[t][e];return i.getStore().get(i.getDimensionIndex(n||"value"),this.dataIndex)},setVisual:function(n,i){this.dataIndex>=0&&this[t][e].setItemVisual(this.dataIndex,n,i)},getVisual:function(n){return this[t][e].getItemVisual(this.dataIndex,n)},setLayout:function(n,i){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,n,i)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}}function ku(t,e){if(wC(this).mainData===this){var n=a({},wC(this).datas);n[this.dataType]=e,Au(e,n,t)}else Ou(e,this.dataType,wC(this).mainData,t);return e}function Iu(t,e){return t.struct&&t.struct.update(),e}function Lu(t,e){return c(wC(e).datas,function(n,i){n!==e&&Ou(n.cloneShallow(),i,e,t)}),e}function Pu(t){var e=wC(this).mainData;return null==t||null==e?e:wC(e).datas[t]}function Du(){var t=wC(this).mainData;return null==t?[{data:t}]:d(g(wC(t).datas),function(e){return{type:e,data:wC(t).datas[e]}})}function Au(t,e,n){wC(t).datas={},c(e,function(e,i){Ou(e,i,t,n)})}function Ou(t,e,n,i){wC(n).datas[e]=t,wC(t).mainData=n,t.dataType=e,i.struct&&(t[i.structAttr]=i.struct,i.struct[i.datasAttr[e]]=t),t.getLinkedData=Pu,t.getLinkedDataAll=Du}function zu(t,e){function n(t){var e=v[t];if(e<0){var n=l[t],i=b(n)?n:{name:n},o=new yM,r=i.name;return null!=r&&null!=g.get(r)&&(o.name=o.displayName=r),null!=i.type&&(o.type=i.type),null!=i.displayName&&(o.displayName=i.displayName),v[t]=h.length,o.storeDimIndex=t,h.push(o),o}return h[e]}function i(t,e,n){null!=ix.get(e)?t.otherDims[e]=n:(t.coordDim=e,t.coordDimIndex=n,u.set(e,!0))}function o(t){null==t.name&&(t.name=t.coordDim)}xr(t)||(t=br(t));var r=(e=e||{}).coordDimensions||[],l=e.dimensionsDefine||t.dimensionsDefine||[],u=B(),h=[],d=function(t,e,n,i){var o=Math.max(t.dimensionsDetectedCount||1,e.length,n.length,i||0);return c(e,function(t){var e;b(t)&&(e=t.dimsDef)&&(o=Math.max(o,e.length))}),o}(t,r,l,e.dimensionsCount),p=e.canOmitUnusedDimensions&&Zl(d),f=l===t.dimensionsDefine,g=f?Vl(t):Fl(l),m=e.encodeDefine;!m&&e.encodeDefaulter&&(m=e.encodeDefaulter(t,d));for(var y=B(m),v=new lw(d),x=0;x0&&(i.name=o+(r-1)),r++,e.set(o,r)}}(h),new kM({source:t,dimensions:h,fullDimensionCount:d,dimensionOmitted:p})}function Eu(t,e,n){if(n||e.hasKey(t)){for(var i=0;e.hasKey(t+i);)i++;t+=i}return e.set(t,!0),t}function Ru(t){return"category"===t.get("type")}function Bu(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function Nu(t,e){return{seriesType:t,plan:ma(),reset:function(t){var n=t.getData(),i=t.coordinateSystem,o=e||t.pipelineContext.large;if(i){var r=d(i.dimensions,function(t){return n.mapDimension(t)}).slice(0,2),a=r.length,s=n.getCalculationInfo("stackResultDimension");Bu(n,r[0])&&(r[0]=s),Bu(n,r[1])&&(r[1]=s);var l=n.getStore(),u=n.getDimensionIndex(r[0]),h=n.getDimensionIndex(r[1]);return a&&{progress:function(t,e){for(var n,r=o&&(y(n=(t.end-t.start)*a)?zC?new Float32Array(n):n:new EC(n)),s=[],c=[],d=t.start,p=0;d=e[0]&&t<=e[1]}function Xu(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function qu(t,e){return t*(e[1]-e[0])+e[0]}function Ku(t,e,n){var i=Math.log(t);return[Math.log(n?e[0]:Math.max(0,e[0]))/i,Math.log(n?e[1]:Math.max(0,e[1]))/i]}function $u(t){return t.get("stack")||ok+t.seriesIndex}function Ju(t){return t.dim+t.index}function Qu(t,e,n,i){return To(new Date(e),t,i).getTime()===To(new Date(n),t,i).getTime()}function th(t,e){return(t/=g_)>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function eh(t){return(t/=2592e6)>6?6:t>3?3:t>2?2:1}function nh(t){return(t/=f_)>12?12:t>6?6:t>3.5?4:t>2?2:1}function ih(t,e){return(t/=e?p_:d_)>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function oh(t){return pn(t,!0)}function rh(t,e,n){var i=Math.max(0,l(w_,e)-1);return To(new Date(t),w_[i],n).getTime()}function ah(t,e){return lk(t,an(e))}function sh(t,e,n){var i=t.rawExtentInfo;return i||(i=new gk(t,e,n),t.rawExtentInfo=i,i)}function lh(t,e){return null==e?null:k(e)?NaN:t.parse(e)}function uh(t,e){var n=t.type,i=sh(t,e,t.getExtent()).calculate();t.setBlank(i.isBlank);var o,r,a,s=i.min,l=i.max,u=e.ecModel;if(u&&"time"===n){var h=function(t,e){var n=[];return e.eachSeriesByType("bar",function(t){(function(t){return t.coordinateSystem&&"cartesian2d"===t.coordinateSystem.type})(t)&&n.push(t)}),n}(0,u),d=!1;if(c(h,function(t){d=d||t.getBaseAxis()===e.axis}),d){var p=(r=function(t){var e={};c(t,function(t){var n=t.coordinateSystem.getBaseAxis();if("time"===n.type||"value"===n.type)for(var i=t.getData(),o=n.dim+"_"+n.index,r=i.getDimensionIndex(i.mapDimension(n.dim)),a=i.getStore(),s=0,l=a.count();s0&&(r=null===r?s:Math.min(r,s))}n[i]=r}}return n}(o=h),a=[],c(o,function(t){var e,n=t.coordinateSystem.getBaseAxis(),i=n.getExtent();if("category"===n.type)e=n.getBandWidth();else if("value"===n.type||"time"===n.type){var o=r[n.dim+"_"+n.index],s=Math.abs(i[1]-i[0]),l=n.scale.getExtent(),u=Math.abs(l[1]-l[0]);e=o?s/u*o:s}else{var h=t.getData();e=Math.abs(i[1]-i[0])/h.count()}var c=jm(t.get("barWidth"),e),d=jm(t.get("barMaxWidth"),e),p=jm(t.get("barMinWidth")||(function(t){return t.pipelineContext&&t.pipelineContext.large}(t)?.5:1),e),f=t.get("barGap"),g=t.get("barCategoryGap"),m=t.get("defaultBarGap");a.push({bandWidth:e,barWidth:c,barMaxWidth:d,barMinWidth:p,barGap:f,barCategoryGap:g,defaultBarGap:m,axisKey:Ju(n),stackId:$u(t)})}),function(t){var e={};c(t,function(t,n){var i=t.axisKey,o=t.bandWidth,r=e[i]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:t.defaultBarGap||0,stacks:{}},a=r.stacks;e[i]=r;var s=t.stackId;a[s]||r.autoWidthCount++,a[s]=a[s]||{width:0,maxWidth:0};var l=t.barWidth;l&&!a[s].width&&(a[s].width=l,l=Math.min(r.remainedWidth,l),r.remainedWidth-=l);var u=t.barMaxWidth;u&&(a[s].maxWidth=u);var h=t.barMinWidth;h&&(a[s].minWidth=h);var c=t.barGap;null!=c&&(r.gap=c);var d=t.barCategoryGap;null!=d&&(r.categoryGap=d)});var n={};return c(e,function(t,e){n[e]={};var i=t.stacks,o=t.bandWidth,r=t.categoryGap;if(null==r){var a=g(i).length;r=Math.max(35-4*a,15)+"%"}var s=jm(r,o),l=jm(t.gap,1),u=t.remainedWidth,h=t.autoWidthCount,d=(u-s)/(h+(h-1)*l);d=Math.max(d,0),c(i,function(t){var e=t.maxWidth,n=t.minWidth;if(t.width)i=t.width,e&&(i=Math.min(i,e)),n&&(i=Math.max(i,n)),t.width=i,u-=i+l*i,h--;else{var i=d;e&&ei&&(i=n),i!==d&&(t.width=i,u-=i+l*i,h--)}}),d=(u-s)/(h+(h-1)*l),d=Math.max(d,0);var p,f=0;c(i,function(t,e){t.width||(t.width=d),p=t,f+=t.width*(1+l)}),p&&(f-=p.width*l);var m=-f/2;c(i,function(t,i){n[e][i]=n[e][i]||{bandWidth:o,offset:m,width:t.width},m+=t.width*(1+l)})}),n}(a)),f=function(t,e,n,i){var o=n.axis.getExtent(),r=Math.abs(o[1]-o[0]),a=function(t,e){if(t&&e)return t[Ju(e)]}(i,n.axis);if(void 0===a)return{min:t,max:e};var s=1/0;c(a,function(t){s=Math.min(t.offset,s)});var l=-1/0;c(a,function(t){l=Math.max(t.offset+t.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=e-t,d=h/(1-(s+l)/r)-h;return{min:t-=d*(s/u),max:e+=d*(l/u)}}(s,l,e,p);s=f.min,l=f.max}}return{extent:[s,l],fixMin:i.minFixed,fixMax:i.maxFixed}}function hh(t,e){var n=e,i=uh(t,n),o=i.extent,r=n.get("splitNumber");t instanceof fk&&(t.base=n.get("logBase"));var a=t.type,s=n.get("interval"),l="interval"===a||"time"===a;t.setBreaksFromOption(vh(n)),t.setExtent(o[0],o[1]),t.calcNiceExtent({splitNumber:r,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?n.get("minInterval"):null,maxInterval:l?n.get("maxInterval"):null}),null!=s&&t.setInterval&&t.setInterval(s)}function ch(t){var e,n=t.getLabelModel().get("formatter");if("time"===t.type){var i=_(e=n)||v(e)?e:function(t){t=t||{};var e={},n=!0;return c(w_,function(e){n&&(n=null==t[e])}),c(w_,function(i,o){var r=t[i];e[i]={};for(var a=null,s=o;s>=0;s--){var l=w_[s],u=b(r)&&!y(r)?r[l]:r,h=void 0;y(u)?a=(h=u.slice())[0]||"":_(u)?h=[a=u]:(null==a?a=v_[i]:y_[l].test(a)||(a=e[l][l][0]+" "+a),h=[a],n&&(h[1]="{primary|"+a+"}")),e[i][l]=h}}),e}(e);return function(e,n){return t.scale.getFormattedLabel(e,n,i)}}if(_(n))return function(e){var i=t.scale.getLabel(e);return n.replace("{value}",null!=i?i:"")};if(v(n)){if("category"===t.type)return function(e,i){return n(dh(t,e),e.value-t.scale.getExtent()[0],null)};var o=vo();return function(e,i){var r=null;return o&&(r=o.makeAxisLabelFormatterParamBreak(r,e.break)),n(dh(t,e),i,r)}}return function(e){return t.scale.getLabel(e)}}function dh(t,e){return"category"===t.type?t.scale.getLabel(e):e.value}function ph(t){var e=t.get("interval");return null==e?"auto":e}function fh(t){return"category"===t.type&&0===ph(t.getLabelModel())}function gh(t,e){var n={};return c(t.mapDimensionsAll(e),function(e){n[function(t,e){return Bu(t,e)?t.getCalculationInfo("stackResultDimension"):e}(t,e)]=!0}),g(n)}function mh(t){return"middle"===t||"center"===t}function yh(t){return t.getShallow("show")}function vh(t){var e,n=t.get("breaks",!0);if(null!=n)return vo()?"x"!==(e=t.axis).dim&&"y"!==e.dim&&"z"!==e.dim&&"single"!==e.dim||"category"===e.type?void 0:n:void 0}function _h(t){return("interval"===t.type||"time"===t.type)&&!t.hasBreaks()}function xh(t){return{out:{noPxChangeTryDetermine:[]},kind:t}}function wh(t,e){var n=d(e,function(e){return t.scale.parse(e)});return"time"===t.type&&n.length>0&&(n.sort(),n.unshift(n[0]),n.push(n[n.length-1])),n}function bh(t,e,n){var i,o,r=kk(t),a=ph(e),s=n.kind===Tk;if(!s){var l=Th(r,a);if(l)return l}v(a)?i=Lh(t,a):(o="auto"===a?function(t,e){if(e.kind===Tk){var n=t.calculateCategoryInterval(e);return e.out.noPxChangeTryDetermine.push(function(){return Sk(t).autoInterval=n,!0}),n}var i=Sk(t).autoInterval;return null!=i?i:Sk(t).autoInterval=t.calculateCategoryInterval(e)}(t,n):a,i=Ih(t,o));var u={labels:i,labelCategoryInterval:o};return s?n.out.noPxChangeTryDetermine.push(function(){return Mh(r,a,u),!0}):Mh(r,a,u),u}function Sh(t){return function(e){return Sk(e)[t]||(Sk(e)[t]={list:[]})}}function Th(t,e){for(var n=0;ne&&i.axisExtent0===o[0]&&i.axisExtent1===o[1])return r;i.lastTickCount=n,i.lastAutoInterval=e,i.axisExtent0=o[0],i.axisExtent1=o[1]}function Ih(t,e,n){function i(t){var e={value:t};l.push(n?t:{formattedLabel:o(e),rawLabel:r.getLabel(e),tickValue:t,time:void 0,break:void 0})}var o=ch(t),r=t.scale,a=r.getExtent(),s=t.getLabelModel(),l=[],u=Math.max((e||0)+1,1),h=a[0],c=r.count();0!==h&&u>1&&c/u>2&&(h=Math.round(Math.ceil(h/u)*u));var d=fh(t),p=s.get("showMinLabel")||d,f=s.get("showMaxLabel")||d;p&&h!==a[0]&&i(a[0]);for(var g=h;g<=a[1];g+=u)i(g);return f&&g-u!==a[1]&&i(a[1]),l}function Lh(t,e,n){var i=t.scale,o=ch(t),r=[];return c(i.getTicks(),function(t){var a=i.getLabel(t),s=t.value;e(t.value,a)&&r.push(n?s:{formattedLabel:o(t),rawLabel:a,tickValue:s,time:void 0,break:void 0})}),r}function Ph(t,e){var n=(t[1]-t[0])/e/2;t[0]+=n,t[1]-=n}function Dh(t,e,n){n=n||3,e?t.dirty|=n:t.dirty&=~n}function Ah(t,e){return e=e||3,null==t.dirty||!!(t.dirty&e)}function Oh(t){if(t)return Ah(t)&&function(t,e,n){var i=e.getComputedTransform();t.transform=ls(t.transform,i);var o=t.localRect=ss(t.localRect,e.getBoundingRect()),r=e.style,a=r.margin,s=n&&n.marginForce,l=n&&n.minMarginForce,u=n&&n.marginDefault,h=r.__marginType;null==h&&u&&(a=u,h=Wv.textMargin);for(var c=0;c<4;c++)Ok[c]=h===Wv.minMargin&&l&&null!=l[c]?l[c]:s&&null!=s[c]?s[c]:a?a[c]:0;h===Wv.textMargin&&es(o,Ok,!1,!1);var d=t.rect=ss(t.rect,o);i&&d.applyTransform(i),h===Wv.minMargin&&es(d,Ok,!1,!1),t.axisAligned=as(i),(t.label=t.label||{}).ignore=e.ignore,Dh(t,!1),Dh(t,!0,2)}(t,t.label,t),t}function zh(t,e){for(var n=0;n=0,r=0,a=t.length;r.1?"x":"y",h=a.transGroup[u];if(s.sort(function(t,e){return Math.abs(t.label[u]-h)-Math.abs(e.label[u]-h)}),l&&o){var d=r.getExtent(),p=Math.min(d[0],d[1]),f=Math.max(d[0],d[1])-p;o.union(new lg(p,0,f,1))}a.stOccupiedRect=o,a.labelInfoList=s}(t,n,i,l)}function Vh(t){t&&(t.ignore=!0)}function Zh(t,e,n,i,o){for(var r=[],a=[],s=[],l=0;l0&&i>0||n<0&&i<0)}(t)}function $h(t,e){c(t.x,function(t){return Jh(t,e.x,e.width)}),c(t.y,function(t){return Jh(t,e.y,e.height)})}function Jh(t,e,n){var i=[0,n],o=t.inverse?1:0;t.setExtent(i[o],i[1-o]),function(t,e){var n=t.getExtent(),i=n[0]+n[1];t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return i-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return i-t+e}}(t,e)}function Qh(t,e,n,i,o,r,a){function s(t){c(o[Fb[t]],function(e){if(yh(e.model)){var n=r.ensureRecord(e.model),i=n.labelInfoList;if(i)for(var o=0;o0&&!k(e)&&e>1e-4&&(t/=e),t}tc(i,o,Tk,e,!1,a);var h=[0,0,0,0];s(0),s(1),l(i,0,NaN),l(i,1,NaN);var d=null==function(t,e){if(t&&e)for(var n=0,i=t.length;n0});return es(i,h,!0,!0,n),$h(o,i),d}function tc(t,e,n,i,o,r){function a(e){l[Fb[1-e]]=t[Vb[e]]<=.5*r.refContainer[Vb[e]]?0:1-e==1?2:1}var s=n===Mk;c(e,function(e){return c(e,function(e){yh(e.model)&&(function(t,e,n){var i=Uh(e,n);t.updateCfg(i)}(e.axisBuilder,t,e.model),e.axisBuilder.build(s?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:o}))})});var l={x:0,y:0};a(0),a(1),c(e,function(t,e){return c(t,function(t){yh(t.model)&&(("all"===i||s)&&t.axisBuilder.build({axisName:!0},{nameMarginLevel:l[e]}),s&&t.axisBuilder.build({axisLine:!0}))})})}function ec(t,e){return"all"===t||y(t)&&l(t,e)>=0||t===e}function nc(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[oc(t)]}function ic(t){return!!t.get(["handle","show"])}function oc(t){return t.type+"||"+t.id}function rc(t){t.registerComponentView(uI),t.registerComponentModel(FC),t.registerCoordinateSystem("cartesian2d",Qk),Zu(t,"x",ZC,hI),Zu(t,"y",ZC,hI),t.registerComponentView(sI),t.registerComponentView(lI),t.registerPreprocessor(function(t){t.xAxis&&t.yAxis&&!t.grid&&(t.grid={})})}function ac(t,e,n,i){sc(cI(n).lastProp,i)||(cI(n).lastProp=i,e?Ia(n,i,t):(n.stopAnimation(),n.attr(i)))}function sc(t,e){if(b(t)&&b(e)){var n=!0;return c(e,function(e,i){n=n&&sc(t[i],e)}),!!n}return t===e}function lc(t,e){t[e.get(["label","show"])?"show":"hide"]()}function uc(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function hc(t,e,n){var i=e.get("z"),o=e.get("zlevel");t&&t.traverse(function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=o&&(t.zlevel=o),t.silent=n)})}function cc(t,e,n,i,o){t=e.scale.parse(t);var r=e.scale.getLabel({value:t},{precision:o.precision}),a=o.formatter;if(a){var s={value:dh(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};c(i,function(t){var e=n.getSeriesByIndex(t.seriesIndex),i=e&&e.getDataParams(t.dataIndexInside);i&&s.seriesData.push(i)}),_(a)?r=a.replace("{value}",r):v(a)&&(r=a(s))}return r}function dc(t,e,n){var i=[1,0,0,1,0,0];return wt(i,i,n.rotation),xt(i,i,n.position),Ga([t.dataToCoord(e),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}function pc(t,e){var n={};return n[e.dim+"AxisIndex"]=e.index,t.getCartesian(n)}function fc(t){return"x"===t.dim?0:1}function gc(t,e,n){if(!Qp.node){var i=e.getZr();_I(i).records||(_I(i).records={}),function(t,e){function n(n,i){t.on(n,function(n){var o=function(t){var e={showTip:[],hideTip:[]},n=function(i){var o=e[i.type];o?o.push(i):(i.dispatchAction=n,t.dispatchAction(i))};return{dispatchAction:n,pendings:e}}(e);xI(_I(t).records,function(t){t&&i(t,n,o.dispatchAction)}),function(t,e){var n,i=t.showTip.length,o=t.hideTip.length;i?n=t.showTip[i-1]:o&&(n=t.hideTip[o-1]),n&&(n.dispatchAction=null,e.dispatchAction(n))}(o.pendings,e)})}_I(t).initialized||(_I(t).initialized=!0,n("click",m(yc,"click")),n("mousemove",m(yc,"mousemove")),n("globalout",mc))}(i,e),(_I(i).records[t]||(_I(i).records[t]={})).handler=n}}function mc(t,e,n){t.handler("leave",null,n)}function yc(t,e,n,i){e.handler(t,n,i)}function vc(t,e){if(!Qp.node){var n=e.getZr();(_I(n).records||{})[t]&&(_I(n).records[t]=null)}}function _c(t,e){var n,i=[],o=t.seriesIndex;if(null==o||!(n=e.getSeriesByIndex(o)))return{point:[]};var r=n.getData(),a=In(r,t);if(null==a||a<0||y(a))return{point:[]};var s=r.getItemGraphicEl(a),l=n.coordinateSystem;if(n.getTooltipPosition)i=n.getTooltipPosition(a)||[];else if(l&&l.dataToPoint)if(t.isStacked){var u=l.getBaseAxis(),h=l.getOtherAxis(u).dim,c="x"===h||"radius"===h?1:0,p=r.mapDimension(u.dim),f=[];f[c]=r.get(p,a),f[1-c]=r.get(r.getCalculationInfo("stackResultDimension"),a),i=l.dataToPoint(f)||[]}else i=l.dataToPoint(r.getValues(d(l.dimensions,function(t){return r.mapDimension(t)}),a))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),i=[g.x+g.width/2,g.y+g.height/2]}return{point:i,el:s}}function xc(t,e,n){var i=t.currTrigger,o=[t.x,t.y],r=t,a=t.dispatchAction||_f(n.dispatchAction,n),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){Mc(o)&&(o=_c({seriesIndex:r.seriesIndex,dataIndex:r.dataIndex},e).point);var l=Mc(o),u=r.axesInfo,h=s.axesInfo,d="leave"===i||Mc(o),p={},f={},g={list:[],map:{}},y={showPointer:m(bc,f),showTooltip:m(Sc,g)};c(s.coordSysMap,function(t,e){var n=l||t.containPoint(o);c(s.coordSysAxesInfo[e],function(t,e){var i=t.axis,r=function(t,e){for(var n=0;n<(t||[]).length;n++){var i=t[n];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}(u,t);if(!d&&n&&(!u||r)){var a=r&&r.value;null!=a||l||(a=i.pointToData(o)),null!=a&&wc(t,a,y,!1,p)}})});var v={};return c(h,function(t,e){var n=t.linkGroup;n&&!f[e]&&c(n.axesInfo,function(e,i){var o=f[i];if(e!==t&&o){var r=o.value;n.mapper&&(r=t.axis.scale.parse(n.mapper(r,Tc(e),Tc(t)))),v[t.key]=r}})}),c(v,function(t,e){wc(h[e],t,y,!0,p)}),function(t,e,n){var i=n.axesInfo=[];c(e,function(e,n){var o=e.axisPointerModel.option,r=t[n];r?(!e.useHandle&&(o.status="show"),o.value=r.value,o.seriesDataIndices=(r.payloadBatch||[]).slice()):!e.useHandle&&(o.status="hide"),"show"===o.status&&i.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:o.value})})}(f,h,p),function(t,e,n,i){if(!Mc(e)&&t.list.length){var o=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:o.dataIndexInside,dataIndex:o.dataIndex,seriesIndex:o.seriesIndex,dataByCoordSys:t.list})}else i({type:"hideTip"})}(g,o,t,a),function(t,e,n){var i=n.getZr(),o="axisPointerLastHighlights",r=SI(i)[o]||{},a=SI(i)[o]={};c(t,function(t,e){var n=t.axisPointerModel.option;"show"===n.status&&t.triggerEmphasis&&c(n.seriesDataIndices,function(t){a[t.seriesIndex+" | "+t.dataIndex]=t})});var s=[],l=[];c(r,function(t,e){!a[e]&&l.push(t)}),c(a,function(t,e){!r[e]&&s.push(t)}),l.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}(h,0,n),p}}function wc(t,e,n,i,o){var r=t.axis;if(!r.scale.isBlank()&&r.containData(e))if(t.involveSeries){var s=function(t,e){var n=e.axis,i=n.dim,o=t,r=[],a=Number.MAX_VALUE,s=-1;return c(e.seriesModels,function(e,l){var u,h,d=e.getData().mapDimensionsAll(i);if(e.getAxisTooltipData){var p=e.getAxisTooltipData(d,t,n);h=p.dataIndices,u=p.nestestValue}else{if(!(h=e.indicesOfNearest(i,d[0],t,"category"===n.type?.5:null)).length)return;u=e.getData().get(d[0],h[0])}if(null!=u&&isFinite(u)){var f=t-u,g=Math.abs(f);g<=a&&((g=0&&s<0)&&(a=g,s=f,o=u,r.length=0),c(h,function(t){r.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})}))}}),{payloadBatch:r,snapToValue:o}}(e,t),l=s.payloadBatch,u=s.snapToValue;l[0]&&null==o.seriesIndex&&a(o,l[0]),!i&&t.snap&&r.containData(u)&&null!=u&&(e=u),n.showPointer(t,e,l),n.showTooltip(t,s,u)}else n.showPointer(t,e)}function bc(t,e,n,i){t[e.key]={value:n,payloadBatch:i}}function Sc(t,e,n,i){var o=n.payloadBatch,r=e.axis,a=r.model,s=e.axisPointerModel;if(e.triggerTooltip&&o.length){var l=e.coordSys.model,u=oc(l),h=t.map[u];h||(h=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(h)),h.dataByAxis.push({axisDim:r.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:o.slice()})}}function Tc(t){var e=t.axis.model,n={},i=n.axisDim=t.axis.dim;return n.axisIndex=n[i+"AxisIndex"]=e.componentIndex,n.axisName=n[i+"AxisName"]=e.name,n.axisId=n[i+"AxisId"]=e.id,n}function Mc(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function Cc(t){nI.registerAxisPointerClass("CartesianAxisPointer",yI),t.registerComponentModel(vI),t.registerComponentView(bI),t.registerPreprocessor(function(t){if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!y(e)&&(t.axisPointer.link=[e])}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=function(t,e){var n={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return function(t,e,n){var i=e.getComponent("tooltip"),r=e.getComponent("axisPointer"),a=r.get("link",!0)||[],l=[];c(n.getCoordinateSystems(),function(n){function u(i,u,h){var f=h.model.getModel("axisPointer",r),g=f.get("show");if(g&&("auto"!==g||i||ic(f))){null==u&&(u=f.get("triggerTooltip")),f=i?function(t,e,n,i,r,a){var l=e.getModel("axisPointer"),u={};c(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],function(t){u[t]=o(l.get(t))}),u.snap="category"!==t.type&&!!a,"cross"===l.get("type")&&(u.type="line");var h=u.label||(u.label={});if(null==h.show&&(h.show=!1),"cross"===r){var d=l.get(["label","show"]);if(h.show=null==d||d,!a){var p=u.lineStyle=l.get("crossStyle");p&&s(h,p.textStyle)}}return t.model.getModel("axisPointer",new i_(u,n,i))}(h,p,r,e,i,u):f;var m=f.get("snap"),y=f.get("triggerEmphasis"),v=oc(h.model),_=u||m||"category"===h.type,x=t.axesInfo[v]={key:v,axis:h,coordSys:n,axisPointerModel:f,triggerTooltip:u,triggerEmphasis:y,involveSeries:_,snap:m,useHandle:ic(f),seriesModels:[],linkGroup:null};d[v]=x,t.seriesInvolved=t.seriesInvolved||_;var w=function(t,e){for(var n=e.model,i=e.dim,o=0;o=0;r--){var a=t[r];a&&(a instanceof i_&&(a=a.get("tooltip",!0)),_(a)&&(a={formatter:a}),a&&(i=new i_(a,i,o)))}return i}function Rc(t,e){return t.dispatchAction||_f(e.dispatchAction,e)}function Bc(t){return"center"===t||"middle"===t}function Nc(t){return t+"Axis"}function Fc(t){var e={};return c(["start","end","startValue","endValue","throttle"],function(n){t.hasOwnProperty(n)&&(e[n]=t[n])}),e}function Vc(t,e,n,i,o,r){t=t||0;var a=n[1]-n[0];if(null!=o&&(o=Hc(o,[0,a])),null!=r&&(r=Math.max(r,null!=o?o:0)),"all"===i){var s=Math.abs(e[1]-e[0]);s=Hc(s,[0,a]),o=r=Hc(s,[o,r]),i=0}e[0]=Hc(e[0],n),e[1]=Hc(e[1],n);var l=Zc(e,i);e[i]+=t;var u,h=o||0,c=n.slice();return l.sign<0?c[0]+=h:c[1]-=h,e[i]=Hc(e[i],c),u=Zc(e,i),null!=o&&(u.sign!==l.sign||u.spanr&&(e[1-i]=e[i]+u.sign*r),e}function Zc(t,e){var n=t[e]-t[1-e];return{span:Math.abs(n),sign:n>0?-1:n<0?1:e?-1:1}}function Hc(t,e){return Math.min(null!=e[1]?e[1]:1/0,Math.max(null!=e[0]?e[0]:-1/0,t))}function Wc(t){t.registerComponentModel(VI),t.registerComponentView(ZI),function(t){YI||(YI=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,UI),function(t){t.registerAction("dataZoom",function(t,e){c(function(t,e){function n(t){!s.get(t.uid)&&function(t){var e=!1;return t.eachTargetAxis(function(t,n){var i=r.get(t);i&&i[n]&&(e=!0)}),e}(t)&&(i(t),o=!0)}function i(t){s.set(t.uid,!0),a.push(t),t.eachTargetAxis(function(t,e){(r.get(t)||r.set(t,[]))[e]=!0})}var o,r=B(),a=[],s=B();t.eachComponent({mainType:"dataZoom",query:e},function(t){s.get(t.uid)||i(t)});do{o=!1,t.eachComponent("dataZoom",n)}while(o);return a}(e,t),function(e){e.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})})}(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}(t)}function jc(t,e){qI[t]=e}function Gc(t){return qI[t]}function Uc(t,e){var n=S_(e.get("padding")),i=e.getItemStyle(["color","opacity"]);return i.fill=e.get("backgroundColor"),new mv({shape:{x:t.x-n[3],y:t.y-n[0],width:t.width+n[1]+n[3],height:t.height+n[0]+n[2],r:e.get("borderRadius")},style:i,silent:!0,z2:-1})}function Yc(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Xc(t,e){return d(t,function(t,n){var i=e&&e[n];if(b(i)&&!y(i)){b(t)&&!y(t)||(t={value:t});var o=null!=i.name&&null==t.name;return t=s(t,i),o&&delete t.name,t}return t})}function qc(t){var e=cL(t);return e.snapshots||(e.snapshots=[{}]),e.snapshots}function Kc(t,e){var n=ML[e.brushType].createCover(t,e);return n.__brushOption=e,Qc(n,e),t.group.add(n),n}function $c(t,e){var n=ed(e);return n.endCreating&&(n.endCreating(t,e),Qc(e,e.__brushOption)),e}function Jc(t,e){var n=e.__brushOption;ed(e).updateCoverShape(t,e,n.range,n)}function Qc(t,e){var n=e.z;null==n&&(n=1e4),t.traverse(function(t){t.z=n,t.z2=n})}function td(t,e){ed(e).updateCommon(t,e),Jc(t,e)}function ed(t){return ML[t.__brushOption.brushType]}function nd(t,e,n){var i,o=t._panels;if(!o)return fL;var r=t._transform;return c(o,function(t){t.isTargetByCursor(e,n,r)&&(i=t)}),i}function id(t,e){var n=t._panels;if(!n)return fL;var i=e.__brushOption.panelId;return null!=i?n[i]:fL}function od(t){var e=t._covers,n=e.length;return c(e,function(e){t.group.remove(e)},t),e.length=0,!!n}function rd(t,e){var n=d(t._covers,function(t){var e=t.__brushOption,n=o(e.range);return{brushType:e.brushType,panelId:e.panelId,range:n}});t.trigger("brush",{areas:n,isEnd:!!e.isEnd,removeOnClick:!!e.removeOnClick})}function ad(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function sd(t,e,n,i){var o=new Em;return o.add(new mv({name:"main",style:cd(n),silent:!0,draggable:!0,cursor:"move",drift:m(fd,t,e,o,["n","s","w","e"]),ondragend:m(rd,e,{isEnd:!0})})),c(i,function(n){o.add(new mv({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:m(fd,t,e,o,n),ondragend:m(rd,e,{isEnd:!0})}))}),o}function ld(t,e,n,i){var o=i.brushStyle.lineWidth||0,r=mL(o,6),a=n[0][0],s=n[1][0],l=a-o/2,u=s-o/2,h=n[0][1],c=n[1][1],d=h-r+o/2,p=c-r+o/2,f=h-a,g=c-s,m=f+o,y=g+o;hd(t,e,"main",a,s,f,g),i.transformable&&(hd(t,e,"w",l,u,r,y),hd(t,e,"e",d,u,r,y),hd(t,e,"n",l,u,m,r),hd(t,e,"s",l,p,m,r),hd(t,e,"nw",l,u,r,r),hd(t,e,"ne",d,u,r,r),hd(t,e,"sw",l,p,r,r),hd(t,e,"se",d,p,r,r))}function ud(t,e){var n=e.__brushOption,i=n.transformable,o=e.childAt(0);o.useStyle(cd(n)),o.attr({silent:!i,cursor:i?"move":"default"}),c([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(n){var o=e.childOfName(n.join("")),r=1===n.length?pd(t,n[0]):function(t,e){var n=[pd(t,e[0]),pd(t,e[1])];return("e"===n[0]||"w"===n[0])&&n.reverse(),n.join("")}(t,n);o&&o.attr({silent:!i,invisible:!i,cursor:i?xL[r]+"-resize":null})})}function hd(t,e,n,i,o,r,a){var s=e.childOfName(n);s&&s.setShape(function(t){var e=gL(t[0][0],t[1][0]),n=gL(t[0][1],t[1][1]);return{x:e,y:n,width:mL(t[0][0],t[1][0])-e,height:mL(t[0][1],t[1][1])-n}}(yd(t,e,[[i,o],[i+r,o+a]])))}function cd(t){return s({strokeNoScale:!0},t.brushStyle)}function dd(t,e,n,i){var o=[gL(t,n),gL(e,i)],r=[mL(t,n),mL(e,i)];return[[o[0],r[0]],[o[1],r[1]]]}function pd(t,e){var n=Ua({w:"left",e:"right",n:"top",s:"bottom"}[e],function(t){return ja(t.group)}(t));return{left:"w",right:"e",top:"n",bottom:"s"}[n]}function fd(t,e,n,i,o,r){var a=n.__brushOption,s=t.toRectRange(a.range),l=md(e,o,r);c(i,function(t){var e=_L[t];s[e[0]][e[1]]+=l[e[0]]}),a.range=t.fromRectRange(dd(s[0][0],s[1][0],s[0][1],s[1][1])),td(e,n),rd(e,{isEnd:!1})}function gd(t,e,n,i){var o=e.__brushOption.range,r=md(t,n,i);c(o,function(t){t[0]+=r[0],t[1]+=r[1]}),td(t,e),rd(t,{isEnd:!1})}function md(t,e,n){var i=t.group,o=i.transformCoordToLocal(e,n),r=i.transformCoordToLocal(0,0);return[o[0]-r[0],o[1]-r[1]]}function yd(t,e,n){var i=id(t,e);return i&&i!==fL?i.clipPath(n,t._transform):o(n)}function vd(t){var e=t.event;e.preventDefault&&e.preventDefault()}function _d(t,e,n){return t.childOfName("main").contain(e,n)}function xd(t,e,n,i){var r,a=t._creatingCover,s=t._creatingPanel,l=t._brushOption;if(t._track.push(n.slice()),function(t){var e=t._track;if(!e.length)return!1;var n=e[e.length-1],i=e[0],o=n[0]-i[0],r=n[1]-i[1];return yL(o*o+r*r,.5)>6}(t)||a){if(s&&!a){"single"===l.brushMode&&od(t);var u=o(l);u.brushType=wd(u.brushType,s),u.panelId=s===fL?null:s.panelId,a=t._creatingCover=Kc(t,u),t._covers.push(a)}if(a){var h=ML[wd(t._brushType,s)];a.__brushOption.range=h.getCreatingRange(yd(t,a,t._track)),i&&($c(t,a),h.updateCommon(t,a)),Jc(t,a),r={isEnd:i}}}else i&&"single"===l.brushMode&&l.removeOnClick&&nd(t,e,n)&&od(t)&&(r={isEnd:i,removeOnClick:!0});return r}function wd(t,e){return"auto"===t?e.defaultBrushType:t}function bd(t,e){if(t._dragging){vd(e);var n=t.group.transformCoordToLocal(e.offsetX,e.offsetY),i=xd(t,e,n,!0);t._dragging=!1,t._track=[],t._creatingCover=null,i&&rd(t,i)}}function Sd(t){return{createCover:function(e,n){return sd({toRectRange:function(e){var n=[e,[0,100]];return t&&n.reverse(),n},fromRectRange:function(e){return e[t]}},e,n,[[["w"],["e"]],[["n"],["s"]]][t])},getCreatingRange:function(e){var n=ad(e);return[gL(n[0][t],n[1][t]),mL(n[0][t],n[1][t])]},updateCoverShape:function(e,n,i,o){var r,a=id(e,n);if(a!==fL&&a.getLinearBrushOtherExtent)r=a.getLinearBrushOtherExtent(t);else{var s=e._zr;r=[0,[s.getWidth(),s.getHeight()][1-t]]}var l=[i,r];t&&l.reverse(),ld(e,n,l,o)},updateCommon:ud,contain:_d}}function Td(t){return t=kd(t),function(e){return qa(e,t)}}function Md(t,e){return t=kd(t),function(n){var i=null!=e?e:n,o=i?t.x:t.y;return[o,o+((i?t.width:t.height)||0)]}}function Cd(t,e,n){var i=kd(t);return function(t,o){return i.contain(o[0],o[1])&&!fu(t,e,n)}}function kd(t){return lg.create(t)}function Id(t){return t[0]>t[1]&&t.reverse(),t}function Ld(t,e){return Pn(t,e,{includeMainTypes:kL})}function Pd(t,e,n,i){var o=n.getAxis(["x","y"][t]),r=Id(d([0,1],function(t){return e?o.coordToData(o.toLocalCoord(i[t]),!0):o.toGlobalCoord(o.dataToCoord(i[t]))})),a=[];return a[t]=r,a[1-t]=[NaN,NaN],{values:r,xyMinMax:a}}function Dd(t,e,n,i){return[e[0]-i[t]*n[0],e[1]-i[t]*n[1]]}function Ad(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}function Od(t){var e={xAxisIndex:t.get("xAxisIndex",!0),yAxisIndex:t.get("yAxisIndex",!0),xAxisId:t.get("xAxisId",!0),yAxisId:t.get("yAxisId",!0)};return null==e.xAxisIndex&&null==e.xAxisId&&(e.xAxisIndex="all"),null==e.yAxisIndex&&null==e.yAxisId&&(e.yAxisIndex="all"),e}function zd(t,e,n,i){Bd(t,e,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=t?t:e}),Rd(t,e,n,i)}function Ed(t){for(var e,n=t.getZr().storage.getDisplayList(),i=0,o=n.length;i0&&(s.during=l?_f($d,{el:e,userDuring:l}):null,s.setToFinal=!0,s.scope=t),a(s,n[r]),s}function Xd(t,e,n,i){var o=(i=i||{}).dataIndex,r=i.isInit,s=i.clearStyle,u=n.isAnimationEnabled(),h=rP(t),d=e.style;h.userDuring=e.during;var p={},f={};if(function(t,e,n){for(var i=0;i=0)){var c=t.getAnimationStyleProps(),d=c?c.style:null;if(d){!o&&(o=i.style={});var p=g(n);for(h=0;h0&&t.animateFrom(_,x)}else!function(t,e,n,i,o){if(o){var r=Yd("update",t,e,i,n);r.duration>0&&t.animateFrom(o,r)}}(t,e,o||0,n,p);qd(t,e),d?t.dirty():t.markRedraw()}function qd(t,e){for(var n=rP(t).leaveToProps,i=0;i=0){!r&&(r=i[t]={});var p=g(s);for(d=0;d"}(o,e.attrs)+("style"!==o?lt(r):r||"")+(i?""+n+d(i,function(e){return t(e)}).join(n)+n:"")+""}(t)}function up(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function hp(t,e,n,i){return sp("svg","root",{width:t,height:e,xmlns:MP,"xmlns:xlink":CP,version:"1.1",baseProfile:"full",viewBox:!!i&&"0 0 "+t+" "+e},n)}function cp(){return IP++}function dp(t,e,n){var i=a({},t.shape);a(i,e),t.buildPath(n,i);var o=new vP;return o.reset(we(t)),n.rebuildPath(o,1),o.generateStr(),o.getStr()}function pp(t,e){var n=e.originX,i=e.originY;(n||i)&&(t[PP]=n+"px "+i+"px")}function fp(t,e){var n=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[n]=t,n}function gp(t){return _(t)?LP[t]?"cubic-bezier("+LP[t]+")":qt(t)?t:"":""}function mp(t,e,n,i){function o(o){function r(t,e,n){for(var i=t.getTracks(),o=t.getMaxTime(),r=0;r0}).length)return fp(d,n)+" "+o[0]+" both"}var r=t.animators,s=r.length,l=[];if(t instanceof xb){var u=function(t,e,n){var i,o,r={};if(c(t.shape.paths,function(t){var e=up(n.zrId);e.animation=!0,mp(t,{},e,!0);var a=e.cssAnims,s=e.cssNodes,l=g(a),u=l.length;if(u){var h=a[o=l[u-1]];for(var c in h){var d=h[c];r[c]=r[c]||{d:""},r[c].d+=d.d||""}for(var p in s){var f=s[p].animation;f.indexOf(o)>=0&&(i=f)}}}),i){e.d=!1;var a=fp(r,n);return i.replace(o,a)}}(t,e,n);if(u)l.push(u);else if(!s)return}else if(!s)return;for(var h={},d=0;d=0&&a||r;s&&(o=he(s))}var l=i.lineWidth;l&&(l/=!i.strokeNoScale&&t.transform?t.transform[0]:1);var u={cursor:"pointer"};o&&(u.fill=o),i.stroke&&(u.stroke=i.stroke),l&&(u["stroke-width"]=l),yp(u,e,n,!0)}}(t,r,e),sp(s,t.id+"",r)}function kp(t,e){return t instanceof ov?Cp(t,e):t instanceof cv?function(t,e){var n=t.style,i=n.image;if(i&&!_(i)&&(vp(i)?i=i.src:_p(i)&&(i=i.toDataURL())),i){var o=n.x||0,r=n.y||0,a={href:i,width:n.width,height:n.height};return o&&(a.x=o),r&&(a.y=r),Sp(a,t.transform),xp(a,n,t,e),wp(a,t),e.animation&&mp(t,a,e),sp("image",t.id+"",a)}}(t,e):t instanceof sv?function(t,e){var n=t.style,i=n.text;if(null!=i&&(i+=""),i&&!isNaN(n.x)&&!isNaN(n.y)){var o=n.font||of,r=n.x||0,a=function(t,e,n){return"top"===n?t+=e/2:"bottom"===n&&(t-=e/2),t}(n.y||0,Xe(o),n.textBaseline),s={"dominant-baseline":"central","text-anchor":Wg[n.textAlign]||n.textAlign};if(Si(n)){var l="",u=n.fontStyle,h=wi(n.fontSize);if(!parseFloat(h))return;var c=n.fontWeight;l+="font-size:"+h+";font-family:"+(n.fontFamily||nf)+";",u&&"normal"!==u&&(l+="font-style:"+u+";"),c&&"normal"!==c&&(l+="font-weight:"+c+";"),s.style=l}else s.style="font: "+o;return i.match(/\s/)&&(s["xml:space"]="preserve"),r&&(s.x=r),a&&(s.y=a),Sp(s,t.transform),xp(s,n,t,e),wp(s,t),e.animation&&mp(t,s,e),sp("text",t.id+"",s,void 0,i)}}(t,e):void 0}function Ip(t,e,n,i){var o,r=t[n],a={gradientUnits:r.global?"userSpaceOnUse":"objectBoundingBox"};if(ye(r))o="linearGradient",a.x1=r.x,a.y1=r.y,a.x2=r.x2,a.y2=r.y2;else{if(!ve(r))return;o="radialGradient",a.cx=L(r.x,.5),a.cy=L(r.y,.5),a.r=L(r.r,.5)}for(var s=r.colorStops,l=[],u=0,h=s.length;ul?Wp(t,null==n[c+1]?null:n[c+1].elm,n,s,c):jp(t,e,a,l))}(n,i,o):Fp(o)?(Fp(t.text)&&Bp(n,""),Wp(n,null,o,0,o.length-1)):Fp(i)?jp(n,i,0,i.length-1):Fp(t.text)&&Bp(n,""):t.text!==e.text&&(Fp(i)&&jp(n,i,0,i.length-1),Bp(n,e.text)))}function Yp(t,e,n){var i=af.createCanvas(),o=e.getWidth(),r=e.getHeight(),a=i.style;return a&&(a.position="absolute",a.left="0",a.top="0",a.width=o+"px",a.height=r+"px",i.setAttribute("data-zr-dom-id",t)),i.width=o*n,i.height=r*n,i}function Xp(){xl(!0)&&(function(t){var e=W_.extend(t);W_.registerClass(e)}({type:"leaflet",getLeaflet(){return this.__map},setCenterAndZoom(t,e){this.option.center=t,this.option.zoom=e},centerOrZoomChanged(t,e){const{option:n}=this;return o=n.center,!((i=t)&&o&&i[0]===o[0]&&i[1]===o[1]&&e===n.zoom);var i,o},defaultOption:{mapOptions:{},tiles:[{urlTemplate:"http://{s}.tile.osm.org/{z}/{x}/{y}.png",options:{attribution:'© OpenStreetMap contributors'}}],layerControl:{}}}),function(t){var e=ww.extend(t);ww.registerClass(e)}({type:"leaflet",render(t,e,n){function i(e){if(s)return;const i=l._mapPane;let o=i.style.transform,r=0,a=0;if(o){o=o.replace("translate3d(","");const t=o.split(",");r=-parseInt(t[0],10),a=-parseInt(t[1],10)}else r=-parseInt(i.style.left,10),a=-parseInt(i.style.top,10);const c=[r,a];u.style.left=`${c[0]}px`,u.style.top=`${c[1]}px`,h.setMapOffset(c),t.__mapOffset=c,n.dispatchAction({type:"leafletRoam",animation:{duration:0}})}function o(){s||n.dispatchAction({type:"leafletRoam"})}function r(){i()}function a(){ul(n.getDom()).resize()}let s=!0;const l=t.getLeaflet(),u=n.getZr().painter.getViewportRoot().parentNode,h=t.coordinateSystem,{roam:c}=t.get("mapOptions");c&&"scale"!==c?l.dragging.enable():l.dragging.disable(),c&&"move"!==c?(l.scrollWheelZoom.enable(),l.doubleClickZoom.enable(),l.touchZoom.enable()):(l.scrollWheelZoom.disable(),l.doubleClickZoom.disable(),l.touchZoom.disable()),this._oldMoveHandler&&l.off("move",this._oldMoveHandler),this._oldZoomHandler&&l.off("zoom",this._oldZoomHandler),this._oldZoomEndHandler&&l.off("zoomend",this._oldZoomEndHandler),this._oldResizeHandler&&l.off("resize",this._oldResizeHandler),l.on("move",i),l.on("zoom",r),l.on("zoomend",o),l.on("resize",a),this._oldMoveHandler=i,this._oldZoomHandler=r,this._oldZoomEndHandler=o,this._oldResizeHandler=a,s=!1}}),gl("leaflet",YP()),fl({type:"leafletRoam",event:"leafletRoam",update:"updateLayout"},(t,e)=>{e.eachComponent("leaflet",t=>{const e=t.getLeaflet(),n=e.getCenter();t.setCenterAndZoom([n.lng,n.lat],e.getZoom())})}))}var qp={};t.r(qp),t.d(qp,{Arc:()=>vb,BezierCurve:()=>gb,BoundingRect:()=>lg,Circle:()=>Ew,CompoundPath:()=>xb,Ellipse:()=>Nw,Group:()=>Em,Image:()=>cv,IncrementalDisplayable:()=>Rb,Line:()=>cb,LinearGradient:()=>Sb,OrientedBoundingRect:()=>zb,Path:()=>ov,Point:()=>Gf,Polygon:()=>ob,Polyline:()=>sb,RadialGradient:()=>Tb,Rect:()=>mv,Ring:()=>eb,Sector:()=>Jw,Text:()=>Tv,WH:()=>Vb,XY:()=>Fb,applyTransform:()=>Ga,calcZ2Range:()=>hs,clipPointsByRect:()=>qa,clipRectByRect:()=>Ka,createIcon:()=>$a,ensureCopyRect:()=>ss,ensureCopyTransform:()=>ls,expandOrShrinkRect:()=>es,extendPath:()=>Ea,extendShape:()=>za,getShapeClass:()=>Ba,getTransform:()=>ja,groupTransition:()=>Xa,initProps:()=>La,isBoundingRectAxisAligned:()=>as,isElementRemoved:()=>Pa,lineLineIntersect:()=>Qa,linePolygonIntersect:()=>Ja,makeImage:()=>Fa,makePath:()=>Na,mergePath:()=>Hb,registerShape:()=>Ra,removeElement:()=>Da,removeElementWithFadeOut:()=>Oa,resizePath:()=>Za,retrieveZInfo:()=>us,setTooltipConfig:()=>is,subPixelOptimize:()=>Wb,subPixelOptimizeLine:()=>Ha,subPixelOptimizeRect:()=>Wa,transformDirection:()=>Ua,traverseElements:()=>rs,traverseUpdateZ:()=>cs,updateProps:()=>Ia});var Kp=function(t,e){return Kp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Kp(t,e)},$p=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},Jp=new function(){this.browser=new $p,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(Jp.wxa=!0,Jp.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?Jp.worker=!0:!Jp.hasGlobalWindow||"Deno"in window||"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Node.js")>-1?(Jp.node=!0,Jp.svgSupported=!0):function(t,e){var n=e.browser,i=t.match(/Firefox\/([\d.]+)/),o=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),r=t.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(t);if(i&&(n.firefox=!0,n.version=i[1]),o&&(n.ie=!0,n.version=o[1]),r&&(n.edge=!0,n.version=r[1],n.newEdge=+r[1].split(".")[0]>18),a&&(n.weChat=!0),e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,e.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11),e.domSupported="undefined"!=typeof document){var s=document.documentElement.style;e.transform3dSupported=(n.ie&&"transition"in s||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||n.ie&&+n.version>=9}}(navigator.userAgent,Jp);const Qp=Jp;var tf,ef,nf="sans-serif",of="12px "+nf,rf=function(){var t={};if("undefined"==typeof JSON)return t;for(var e=0;e<95;e++){var n=String.fromCharCode(e+32),i=("007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N".charCodeAt(e)-20)/100;t[n]=i}return t}(),af={createCanvas:function(){return"undefined"!=typeof document&&document.createElement("canvas")},measureText:function(t,e){if(!tf){var n=af.createCanvas();tf=n&&n.getContext("2d")}if(tf)return ef!==e&&(ef=tf.font=e||of),tf.measureText(t);t=t||"";var i=/((?:\d+)?\.?\d*)px/.exec(e=e||of),o=i&&+i[1]||12,r=0;if(e.indexOf("mono")>=0)r=o*t.length;else for(var a=0;a"'])/g,Bf={"&":"&","<":"<",">":">",'"':""","'":"'"},Nf=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ff=[],Vf=Qp.browser.firefox&&+Qp.browser.version.split(".")[0]<39,Zf=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0},Hf=function(){function t(){this._track=[]}return t.prototype.recognize=function(t,e,n){return this._doTrack(t,e,n),this._recognize(t)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(t,e,n){var i=t.touches;if(i){for(var o={points:[],touches:[],target:e,event:t},r=0,a=i.length;r1&&o&&o.length>1){var a=mt(o)/mt(r);!isFinite(a)&&(a=1),e.pinchScale=a;var s=[((i=o)[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2];return e.pinchX=s[0],e.pinchY=s[1],{type:"pinch",target:t[0].target,event:e}}}}},jf=function(){function t(t,e){this.x=t||0,this.y=e||0}return t.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},t.prototype.scale=function(t){this.x*=t,this.y*=t},t.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},t.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},t.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},t.prototype.distanceSquare=function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(t){if(t){var e=this.x,n=this.y;return this.x=t[0]*e+t[2]*n+t[4],this.y=t[1]*e+t[3]*n+t[5],this}},t.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},t.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},t.set=function(t,e,n){t.x=e,t.y=n},t.copy=function(t,e){t.x=e.x,t.y=e.y},t.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},t.lenSquare=function(t){return t.x*t.x+t.y*t.y},t.dot=function(t,e){return t.x*e.x+t.y*e.y},t.add=function(t,e,n){t.x=e.x+n.x,t.y=e.y+n.y},t.sub=function(t,e,n){t.x=e.x-n.x,t.y=e.y-n.y},t.scale=function(t,e,n){t.x=e.x*n,t.y=e.y*n},t.scaleAndAdd=function(t,e,n,i){t.x=e.x+n.x*i,t.y=e.y+n.y*i},t.lerp=function(t,e,n,i){var o=1-i;t.x=o*e.x+i*n.x,t.y=o*e.y+i*n.y},t}();const Gf=jf;var Uf=Math.min,Yf=Math.max,Xf=Math.abs,qf=["x","y"],Kf=["width","height"],$f=new Gf,Jf=new Gf,Qf=new Gf,tg=new Gf,eg=Tt(),ng=eg.minTv,ig=eg.maxTv,og=[0,0],rg=function(){function t(e,n,i,o){t.set(this,e,n,i,o)}return t.set=function(t,e,n,i,o){return i<0&&(e+=i,i=-i),o<0&&(n+=o,o=-o),t.x=e,t.y=n,t.width=i,t.height=o,t},t.prototype.union=function(t){var e=Uf(t.x,this.x),n=Uf(t.y,this.y);this.width=isFinite(this.x)&&isFinite(this.width)?Yf(t.x+t.width,this.x+this.width)-e:t.width,this.height=isFinite(this.y)&&isFinite(this.height)?Yf(t.y+t.height,this.y+this.height)-n:t.height,this.x=e,this.y=n},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(t){var e=this,n=t.width/e.width,i=t.height/e.height,o=[1,0,0,1,0,0];return xt(o,o,[-e.x,-e.y]),function(t,e,n){var i=n[0],o=n[1];t[0]=e[0]*i,t[1]=e[1]*o,t[2]=e[2]*i,t[3]=e[3]*o,t[4]=e[4]*i,t[5]=e[5]*o}(o,o,[n,i]),xt(o,o,[t.x,t.y]),o},t.prototype.intersect=function(e,n,i){return t.intersect(this,e,n,i)},t.intersect=function(e,n,i,o){i&&Gf.set(i,0,0);var r=o&&o.outIntersectRect||null,a=o&&o.clamp;if(r&&(r.x=r.y=r.width=r.height=NaN),!e||!n)return!1;e instanceof t||(e=t.set(ag,e.x,e.y,e.width,e.height)),n instanceof t||(n=t.set(sg,n.x,n.y,n.width,n.height));var s=!!i;eg.reset(o,s);var l=eg.touchThreshold,u=e.x+l,h=e.x+e.width-l,c=e.y+l,d=e.y+e.height-l,p=n.x+l,f=n.x+n.width-l,g=n.y+l,m=n.y+n.height-l;if(u>h||c>d||p>f||g>m)return!1;var y=!(h=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},t.prototype.contain=function(e,n){return t.contain(this,e,n)},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return 0===this.width||0===this.height},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(t,e){return t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t},t.applyTransform=function(e,n,i){if(i){if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var o=i[0],r=i[3],a=i[5];return e.x=n.x*o+i[4],e.y=n.y*r+a,e.width=n.width*o,e.height=n.height*r,e.width<0&&(e.x+=e.width,e.width=-e.width),void(e.height<0&&(e.y+=e.height,e.height=-e.height))}$f.x=Qf.x=n.x,$f.y=tg.y=n.y,Jf.x=tg.x=n.x+n.width,Jf.y=Qf.y=n.y+n.height,$f.transform(i),tg.transform(i),Jf.transform(i),Qf.transform(i),e.x=Uf($f.x,Jf.x,Qf.x,tg.x),e.y=Uf($f.y,Jf.y,Qf.y,tg.y);var s=Yf($f.x,Jf.x,Qf.x,tg.x),l=Yf($f.y,Jf.y,Qf.y,tg.y);e.width=s-e.x,e.height=l-e.y}else e!==n&&t.copy(e,n)},t}(),ag=new rg(0,0,0,0),sg=new rg(0,0,0,0);const lg=rg;var ug="silent",hg=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.handler=null,e}return W(e,t),e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(Af),cg=function(t,e){this.x=t,this.y=e},dg=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],pg=new lg(0,0,0,0),fg=function(t){function e(e,n,i,o,r){var a=t.call(this)||this;return a._hovered=new cg(0,0),a.storage=e,a.painter=n,a.painterRoot=o,a._pointerSize=r,i=i||new hg,a.proxy=null,a.setHandlerProxy(i),a._draggingMgr=new Pf(a),a}return W(e,t),e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(c(dg,function(e){t.on&&t.on(e,this[e],this)},this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var e=t.zrX,n=t.zrY,i=It(this,e,n),o=this._hovered,r=o.target;r&&!r.__zr&&(r=(o=this.findHover(o.x,o.y)).target);var a=this._hovered=i?new cg(e,n):this.findHover(e,n),s=a.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),r&&s!==r&&this.dispatchToElement(o,"mouseout",t),this.dispatchToElement(a,"mousemove",t),s&&s!==r&&this.dispatchToElement(a,"mouseover",t)},e.prototype.mouseout=function(t){var e=t.zrEventControl;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new cg(0,0)},e.prototype.dispatch=function(t,e){var n=this[t];n&&n.call(this,e)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},e.prototype.dispatchToElement=function(t,e,n){var i=(t=t||{}).target;if(!i||!i.silent){for(var o="on"+e,r=function(t,e,n){return{type:t,event:n,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:Mt}}(e,t,n);i&&(i[o]&&(r.cancelBubble=!!i[o].call(i,r)),i.trigger(e,r),i=i.__hostTarget?i.__hostTarget:i.parent,!r.cancelBubble););r.cancelBubble||(this.trigger(e,r),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(t){"function"==typeof t[o]&&t[o].call(t,r),t.trigger&&t.trigger(e,r)}))}},e.prototype.findHover=function(t,e,n){var i=this.storage.getDisplayList(),o=new cg(t,e);if(kt(i,o,t,e,n),this._pointerSize&&!o.target){for(var r=[],a=this._pointerSize,s=a/2,l=new lg(t-s,e-s,a,a),u=i.length-1;u>=0;u--){var h=i[u];h===n||h.ignore||h.ignoreCoarsePointer||h.parent&&h.parent.ignoreCoarsePointer||(pg.copy(h.getBoundingRect()),h.transform&&pg.applyTransform(h.transform),pg.intersect(l)&&r.push(h))}if(r.length)for(var c=Math.PI/12,d=2*Math.PI,p=0;p4)return;this._downPoint=null}this.dispatchToElement(n,t,e)}});const gg=fg;var mg=!1,yg=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Et}return t.prototype.traverse=function(t,e){for(var n=0;n=0&&this._roots.splice(i,1)}},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}();const vg=yg,_g=Qp.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};var xg={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),(t*=2)<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-xg.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*xg.bounceIn(2*t):.5*xg.bounceOut(2*t-1)+.5}};const wg=xg;var bg=Math.pow,Sg=Math.sqrt,Tg=1e-8,Mg=1e-4,Cg=Sg(3),kg=1/3,Ig=j(),Lg=j(),Pg=j(),Dg=/cubic-bezier\(([0-9,\.e ]+)\)/;const Ag=function(){function t(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||H,this.ondestroy=t.ondestroy||H,this.onrestart=t.onrestart||H,t.easing&&this.setEasing(t.easing)}return t.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),!this._paused){var n=this._life,i=t-this._startTime-this._pausedTime,o=i/n;o<0&&(o=0),o=Math.min(o,1);var r=this.easingFunc,a=r?r(o):o;if(this.onframe(a),1===o){if(!this.loop)return!0;this._startTime=t-i%n,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=e},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(t){this.easing=t,this.easingFunc=v(t)?t:wg[t]||qt(t)},t}();var Og=function(t){this.value=t},zg=function(){function t(){this._len=0}return t.prototype.insert=function(t){var e=new Og(t);return this.insertEntry(e),e},t.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++},t.prototype.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),Eg=function(){function t(t){this._list=new zg,this._maxSize=10,this._map={},this._maxSize=t}return t.prototype.put=function(t,e){var n=this._list,i=this._map,o=null;if(null==i[t]){var r=n.len(),a=this._lastRemovedEntry;if(r>=this._maxSize&&r>0){var s=n.head;n.remove(s),delete i[s.key],o=s.value,this._lastRemovedEntry=s}a?a.value=e:a=new Og(e),a.key=t,n.insertEntry(a),i[t]=a}return o},t.prototype.get=function(t){var e=this._map[t],n=this._list;if(null!=e)return e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}();const Rg=Eg;var Bg={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]},Ng=new Rg(20),Fg=null,Vg=new Rg(100),Zg=Math.round,Hg=1e-4,Wg={left:"start",right:"end",center:"middle",middle:"middle"},jg=Qp.hasGlobalWindow&&v(window.btoa)?function(t){return window.btoa(unescape(encodeURIComponent(t)))}:"undefined"!=typeof Buffer?function(t){return Buffer.from(t).toString("base64")}:function(t){return null},Gg=Array.prototype.slice,Ug=[0,0,0,0],Yg=function(){function t(t){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=t}return t.prototype.isFinished=function(){return this._finished},t.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},t.prototype.needsAnimate=function(){return this.keyframes.length>=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(t,e,n){this._needsSort=!0;var i=this.keyframes,o=i.length,r=!1,s=6,l=e;if(h(e)){var u=function(t){return h(t&&t[0])?2:1}(e);s=u,(1===u&&!w(e[0])||2===u&&!w(e[0][0]))&&(r=!0)}else if(w(e)&&!k(e))s=0;else if(_(e))if(isNaN(+e)){var c=oe(e);c&&(l=c,s=3)}else s=0;else if(C(e)){var p=a({},l);p.colorStops=d(e.colorStops,function(t){return{offset:t.offset,color:oe(t.color)}}),ye(e)?s=4:ve(e)&&(s=5),l=p}0===o?this.valType=s:s===this.valType&&6!==s||(r=!0),this.discrete=this.discrete||r;var f={time:t,value:l,rawValue:e,percent:0};return n&&(f.easing=n,f.easingFunc=v(n)?n:wg[n]||qt(n)),i.push(f),f},t.prototype.prepare=function(t,e){var n=this.keyframes;this._needsSort&&n.sort(function(t,e){return t.time-e.time});for(var i=this.valType,o=n.length,r=n[o-1],a=this.discrete,s=Ae(i),l=De(i),u=0;u=0&&!(l[n].percent<=e);n--);n=f(n,u-2)}else{for(n=p;ne);n++);n=f(n-1,u-2)}o=l[n+1],i=l[n]}if(i&&o){this._lastFr=n,this._lastFrP=e;var g=o.percent-i.percent,m=0===g?1:f((e-i.percent)/g,1);o.easingFunc&&(m=o.easingFunc(m));var y=r?this._additiveValue:c?Ug:t[h];if(!Ae(s)&&!c||y||(y=this._additiveValue=[]),this.discrete)t[h]=m<1?i.rawValue:o.rawValue;else if(Ae(s))1===s?Te(y,i[a],o[a],m):function(t,e,n,i){for(var o=e.length,r=o&&e[0].length,a=0;a0&&s.addKeyframe(0,Le(l),i),this._trackKeys.push(a)}s.addKeyframe(t,Le(e[a]),i)}return this._maxTime=Math.max(this._maxTime,t),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,n=0;n0)){this._started=1;for(var e=this,n=[],i=this._maxTime||0,o=0;o1){var a=r.pop();o.addKeyframe(a.time,t[i]),o.prepare(this._maxTime,o.getAdditiveTrack())}}}},t}();const qg=Xg;var Kg=function(t){function e(e){var n=t.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,n.stage=(e=e||{}).stage||{},n}return W(e,t),e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var e=t.getClip();e&&this.addClip(e)},e.prototype.removeClip=function(t){if(t.animation){var e=t.prev,n=t.next;e?e.next=n:this._head=n,n?n.prev=e:this._tail=e,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var e=t.getClip();e&&this.removeClip(e),t.animation=null},e.prototype.update=function(t){for(var e=Oe()-this._pausedTime,n=e-this._time,i=this._head;i;){var o=i.next;i.step(e,n)?(i.ondestroy(),this.removeClip(i),i=o):i=o}this._time=e,t||(this.trigger("frame",n),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0,_g(function e(){t._running&&(_g(e),!t._paused&&t.update())})},e.prototype.start=function(){this._running||(this._time=Oe(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=Oe(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=Oe()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var e=t.next;t.prev=t.next=t.animation=null,t=e}this._head=this._tail=null},e.prototype.isFinished=function(){return null==this._head},e.prototype.animate=function(t,e){e=e||{},this.start();var n=new qg(t,e.loop);return this.addAnimator(n),n},e}(Af);const $g=Kg;var Jg,Qg,tm=Qp.domSupported,em=(Qg={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:Jg=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:d(Jg,function(t){var e=t.replace("mouse","pointer");return Qg.hasOwnProperty(e)?e:t})}),nm=["mousemove","mouseup"],im=["pointermove","pointerup"],om=!1,rm=function(t,e){this.stopPropagation=H,this.stopImmediatePropagation=H,this.preventDefault=H,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY},am={mousedown:function(t){t=dt(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=dt(this.dom,t);var e=this.__mayPointerCapture;!e||t.zrX===e[0]&&t.zrY===e[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=dt(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){Re(this,(t=dt(this.dom,t)).toElement||t.relatedTarget)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){om=!0,t=dt(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){om||(t=dt(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){Ee(t=dt(this.dom,t)),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),am.mousemove.call(this,t),am.mousedown.call(this,t)},touchmove:function(t){Ee(t=dt(this.dom,t)),this.handler.processGesture(t,"change"),am.mousemove.call(this,t)},touchend:function(t){Ee(t=dt(this.dom,t)),this.handler.processGesture(t,"end"),am.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<300&&am.click.call(this,t)},pointerdown:function(t){am.mousedown.call(this,t)},pointermove:function(t){ze(t)||am.mousemove.call(this,t)},pointerup:function(t){am.mouseup.call(this,t)},pointerout:function(t){ze(t)||am.mouseout.call(this,t)}};c(["click","dblclick","contextmenu"],function(t){am[t]=function(e){e=dt(this.dom,e),this.trigger(t,e)}});var sm={pointermove:function(t){ze(t)||sm.mousemove.call(this,t)},pointerup:function(t){sm.mouseup.call(this,t)},mousemove:function(t){this.trigger("mousemove",t)},mouseup:function(t){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",t),e&&(t.zrEventControl="only_globalout",this.trigger("mouseout",t))}},lm=function(t,e){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=t,this.domHandlers=e};const um=function(t){function e(e,n){var i,o,r,a=t.call(this)||this;return a.__pointerCapturing=!1,a.dom=e,a.painterRoot=n,a._localHandlerScope=new lm(e,am),tm&&(a._globalHandlerScope=new lm(document,sm)),i=a,r=(o=a._localHandlerScope).domHandlers,Qp.pointerEventsSupported?c(em.pointer,function(t){Be(o,t,function(e){r[t].call(i,e)})}):(Qp.touchEventsSupported&&c(em.touch,function(t){Be(o,t,function(e){r[t].call(i,e),function(t){t.touching=!0,null!=t.touchTimer&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout(function(){t.touching=!1,t.touchTimer=null},700)}(o)})}),c(em.mouse,function(t){Be(o,t,function(e){e=ct(e),o.touching||r[t].call(i,e)})})),a}return W(e,t),e.prototype.dispose=function(){Ne(this._localHandlerScope),tm&&Ne(this._globalHandlerScope)},e.prototype.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},e.prototype.__togglePointerCapture=function(t){if(this.__mayPointerCapture=null,tm&&+this.__pointerCapturing^+t){this.__pointerCapturing=t;var e=this._globalHandlerScope;t?function(t,e){function n(n){Be(e,n,function(i){i=ct(i),Re(t,i.target)||(i=function(t,e){return dt(t.dom,new rm(t,e),!0)}(t,i),e.domHandlers[n].call(t,i))},{capture:!0})}Qp.pointerEventsSupported?c(im,n):Qp.touchEventsSupported||c(nm,n)}(this,e):Ne(e)}},e}(Af);var hm=1;Qp.hasGlobalWindow&&(hm=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var cm=hm,dm="#333",pm="#ccc",fm=yt,gm=5e-5,mm=[],ym=[],vm=[1,0,0,1,0,0],_m=Math.abs,xm=function(){function t(){}var e;return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},t.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},t.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},t.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},t.prototype.needLocalTransform=function(){return Fe(this.rotation)||Fe(this.x)||Fe(this.y)||Fe(this.scaleX-1)||Fe(this.scaleY-1)||Fe(this.skewX)||Fe(this.skewY)},t.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),n=this.transform;e||t?(n=n||[1,0,0,1,0,0],e?this.getLocalTransform(n):fm(n),t&&(e?_t(n,t,n):vt(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)):n&&(fm(n),this.invTransform=null)},t.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(null!=e&&1!==e){this.getGlobalScale(mm);var n=mm[0]<0?-1:1,i=mm[1]<0?-1:1,o=((mm[0]-n)*e+n)/mm[0]||0,r=((mm[1]-i)*e+i)/mm[1]||0;t[0]*=o,t[1]*=o,t[2]*=r,t[3]*=r}this.invTransform=this.invTransform||[1,0,0,1,0,0],bt(this.invTransform,t)},t.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},t.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],n=t[2]*t[2]+t[3]*t[3],i=Math.atan2(t[1],t[0]),o=Math.PI/2+i-Math.atan2(t[3],t[2]);n=Math.sqrt(n)*Math.cos(o),e=Math.sqrt(e),this.skewX=o,this.skewY=0,this.rotation=-i,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||[1,0,0,1,0,0],_t(ym,t.invTransform,e),e=ym);var n=this.originX,i=this.originY;(n||i)&&(vm[4]=n,vm[5]=i,_t(ym,e,vm),ym[4]-=n,ym[5]-=i,e=ym),this.setLocalTransform(e)}},t.prototype.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},t.prototype.transformCoordToLocal=function(t,e){var n=[t,e],i=this.invTransform;return i&&et(n,n,i),n},t.prototype.transformCoordToGlobal=function(t,e){var n=[t,e],i=this.transform;return i&&et(n,n,i),n},t.prototype.getLineScale=function(){var t=this.transform;return t&&_m(t[0]-1)>1e-10&&_m(t[3]-1)>1e-10?Math.sqrt(_m(t[0]*t[3]-t[2]*t[1])):1},t.prototype.copyTransform=function(t){Ve(this,t)},t.getLocalTransform=function(t,e){e=e||[];var n=t.originX||0,i=t.originY||0,o=t.scaleX,r=t.scaleY,a=t.anchorX,s=t.anchorY,l=t.rotation||0,u=t.x,h=t.y,c=t.skewX?Math.tan(t.skewX):0,d=t.skewY?Math.tan(-t.skewY):0;if(n||i||a||s){var p=n+a,f=i+s;e[4]=-p*o-c*f*r,e[5]=-f*r-d*p*o}else e[4]=e[5]=0;return e[0]=o,e[3]=r,e[1]=d*o,e[2]=c*r,l&&wt(e,e,l),e[4]+=n+u,e[5]+=i+h,e},t.initDefaultProps=((e=t.prototype).scaleX=e.scaleY=e.globalScaleRatio=1,void(e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0)),t}(),wm=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];const bm=xm;var Sm,Tm=0,Mm=5,Cm="__zr_normal__",km=wm.concat(["ignore"]),Im=p(wm,function(t,e){return t[e]=!0,t},{ignore:!1}),Lm={},Pm=new lg(0,0,0,0),Dm=[],Am=function(){function t(t){this.id=n(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return t.prototype._init=function(t){this.attr(t)},t.prototype.drift=function(t,e,n){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=e,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,o=e.innerTransformable,r=void 0,a=void 0,s=!1;o.parent=i?this:null;var l=!1;o.copyTransform(e);var u=null!=n.position,h=n.autoOverflowArea,c=void 0;if((h||u)&&((c=Pm).copy(n.layoutRect?n.layoutRect:this.getBoundingRect()),i||c.applyTransform(this.transform)),u){this.calculateTextPosition?this.calculateTextPosition(Lm,n,c):Ke(Lm,n,c),o.x=Lm.x,o.y=Lm.y,r=Lm.align,a=Lm.verticalAlign;var d=n.origin;if(d&&null!=n.rotation){var p=void 0,f=void 0;"center"===d?(p=.5*c.width,f=.5*c.height):(p=qe(d[0],c.width),f=qe(d[1],c.height)),l=!0,o.originX=-o.x+p+(i?0:c.x),o.originY=-o.y+f+(i?0:c.y)}}null!=n.rotation&&(o.rotation=n.rotation);var g=n.offset;g&&(o.x+=g[0],o.y+=g[1],l||(o.originX=-g[0],o.originY=-g[1]));var m=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(h){var y=m.overflowRect=m.overflowRect||new lg(0,0,0,0);o.getLocalTransform(Dm),bt(Dm,Dm),lg.copy(y,c),y.applyTransform(Dm)}else m.overflowRect=null;var v=void 0,_=void 0,x=void 0;(null==n.inside?"string"==typeof n.position&&n.position.indexOf("inside")>=0:n.inside)&&this.canBeInsideText()?(_=n.insideStroke,null!=(v=n.insideFill)&&"auto"!==v||(v=this.getInsideTextFill()),null!=_&&"auto"!==_||(_=this.getInsideTextStroke(v),x=!0)):(_=n.outsideStroke,null!=(v=n.outsideFill)&&"auto"!==v||(v=this.getOutsideFill()),null!=_&&"auto"!==_||(_=this.getOutsideStroke(v),x=!0)),(v=v||"#000")===m.fill&&_===m.stroke&&x===m.autoStroke&&r===m.align&&a===m.verticalAlign||(s=!0,m.fill=v,m.stroke=_,m.autoStroke=x,m.align=r,m.verticalAlign=a,e.setDefaultTextStyle(m)),e.__dirty|=1,s&&e.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(t){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?pm:dm},t.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),n="string"==typeof e&&oe(e);n||(n=[255,255,255,1]);for(var i=n[3],o=this.__zr.isDarkMode(),r=0;r<3;r++)n[r]=n[r]*i+(o?0:255)*(1-i);return n[3]=1,le(n,"rgba")},t.prototype.traverse=function(t,e){},t.prototype.attrKV=function(t,e){"textConfig"===t?this.setTextConfig(e):"textContent"===t?this.setTextContent(e):"clipPath"===t?this.setClipPath(e):"extra"===t?(this.extra=this.extra||{},a(this.extra,e)):this[t]=e},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(b(t))for(var n=g(t),i=0;i0},t.prototype.getState=function(t){return this.states[t]},t.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},t.prototype.clearStates=function(t){this.useState(Cm,!1,t)},t.prototype.useState=function(t,e,n,o){var r=t===Cm;if(this.hasState()||!r){var a=this.currentStates,s=this.stateTransition;if(!(l(a,t)>=0)||!e&&1!==a.length){var u;if(this.stateProxy&&!r&&(u=this.stateProxy(t)),u||(u=this.states&&this.states[t]),u||r){r||this.saveCurrentToNormalState(u);var h=!!(u&&u.hoverLayer||o);h&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,u,this._normalState,e,!n&&!this.__inHover&&s&&s.duration>0,s);var c=this._textContent,d=this._textGuide;return c&&c.useState(t,e,n,h),d&&d.useState(t,e,n,h),r?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),u}i("State "+t+" not exists.")}}},t.prototype.useStates=function(t,e,n){if(t.length){var i=[],o=this.currentStates,r=t.length,a=r===o.length;if(a)for(var s=0;s0,p);var f=this._textContent,g=this._textGuide;f&&f.useStates(t,e,c),g&&g.useStates(t,e,c),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}else this.clearStates()},t.prototype.isSilent=function(){for(var t=this;t;){if(t.silent)return!0;var e=t.__hostTarget;t=e?t.ignoreHostSilent?null:e:t.parent}return!1},t.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var n=this.currentStates.slice();n.splice(e,1),this.useStates(n)}},t.prototype.replaceState=function(t,e,n){var i=this.currentStates.slice(),o=l(i,t),r=l(i,e)>=0;o>=0?r?i.splice(o,1):i[o]=e:n&&!r&&i.push(e),this.useStates(i)},t.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},t.prototype._mergeStates=function(t){for(var e,n={},i=0;i=0&&e.splice(n,1)}),this.animators.push(t),n&&n.animation.addAnimator(t),n&&n.wakeUp()},t.prototype.updateDuringAnimation=function(t){this.markRedraw()},t.prototype.stopAnimation=function(t,e){for(var n=this.animators,i=n.length,o=[],r=0;r=0&&(n.splice(i,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,e){var n=l(this._children,t);return n>=0&&this.replaceAt(e,n),this},e.prototype.replaceAt=function(t,e){var n=this._children,i=n[e];if(t&&t!==this&&t.parent!==this&&t!==i){n[e]=t,i.parent=null;var o=this.__zr;o&&i.removeSelfFromZr(o),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__zr;e&&e!==t.__zr&&t.addSelfToZr(e),e&&e.refresh()},e.prototype.remove=function(t){var e=this.__zr,n=this._children,i=l(n,t);return i<0||(n.splice(i,1),t.parent=null,e&&t.removeSelfFromZr(e),e&&e.refresh()),this},e.prototype.removeAll=function(){for(var t=this._children,e=this.__zr,n=0;n0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},t.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover())},t.prototype.resize=function(t){this._disposed||(this.painter.resize((t=t||{}).width,t.height),this.handler.resize())},t.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},t.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},t.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},t.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},t.prototype.findHover=function(t,e){if(!this._disposed)return this.handler.findHover(t,e)},t.prototype.on=function(t,e,n){return this._disposed||this.handler.on(t,e,n),this},t.prototype.off=function(t,e){this._disposed||this.handler.off(t,e)},t.prototype.trigger=function(t,e){this._disposed||this.handler.trigger(t,e)},t.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),e=0;e0?t.length:0,this.item=null,this.key=NaN,this},t.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)}}(),"___EC__COMPONENT__CONTAINER___"),Qm="___EC__EXTENDED_CLASS___",ty=Math.round(10*Math.random()),ey=Vn([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),ny=function(){function t(){}return t.prototype.getAreaStyle=function(t,e){return ey(this,t,e)},t}(),iy=new Rg(50),oy=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,ry=function(){},ay=function(t){this.tokens=[],t&&(this.tokens=t)},sy=function(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1},ly=p(",&?/;] ".split(""),function(t,e){return t[e]=!0,t},{}),uy=new lg(0,0,0,0),hy={outIntersectRect:{},clamp:!0},cy="__zr_style_"+Math.round(10*Math.random()),dy={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},py={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};dy[cy]=!0;var fy=["z","z2","invisible"],gy=["invisible"],my=function(t){function e(e){return t.call(this,e)||this}var n;return W(e,t),e.prototype._init=function(e){for(var n=g(e),i=0;i0&&(this._ux=Zy(n/cm/t)||0,this._uy=Zy(n/cm/e)||0)},t.prototype.setDPR=function(t){this.dpr=t},t.prototype.setContext=function(t){this._ctx=t},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(Py.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},t.prototype.lineTo=function(t,e){var n=Zy(t-this._xi),i=Zy(e-this._yi),o=n>this._ux||i>this._uy;if(this.addData(Py.L,t,e),this._ctx&&o&&this._ctx.lineTo(t,e),o)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var r=n*n+i*i;r>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=r)}return this},t.prototype.bezierCurveTo=function(t,e,n,i,o,r){return this._drawPendingPt(),this.addData(Py.C,t,e,n,i,o,r),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,o,r),this._xi=o,this._yi=r,this},t.prototype.quadraticCurveTo=function(t,e,n,i){return this._drawPendingPt(),this.addData(Py.Q,t,e,n,i),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this._xi=n,this._yi=i,this},t.prototype.arc=function(t,e,n,i,o,r){return this._drawPendingPt(),Gy[0]=i,Gy[1]=o,function(t,e){var n=ai(t[0]);n<0&&(n+=Wy);var i=t[1];i+=n-t[0],!e&&i-n>=Wy?i=n+Wy:e&&n-i>=Wy?i=n-Wy:!e&&n>i?i=n+(Wy-ai(n-i)):e&&n0&&r))for(var a=0;au.length&&(this._expandData(),u=this.data);for(var h=0;h0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e11&&(this.data=new Float32Array(t)))}},t.prototype.getBoundingRect=function(){Oy[0]=Oy[1]=Ey[0]=Ey[1]=Number.MAX_VALUE,zy[0]=zy[1]=Ry[0]=Ry[1]=-Number.MAX_VALUE;var t,e=this.data,n=0,i=0,o=0,r=0;for(t=0;tn||Zy(m)>i||c===e-1)&&(f=Math.sqrt(L*L+m*m),o=g,r=_);break;case Py.C:var y=t[c++],v=t[c++],_=(g=t[c++],t[c++]),x=t[c++],w=t[c++];f=Wt(o,r,y,v,g,_,x,w,10),o=x,r=w;break;case Py.Q:f=Xt(o,r,y=t[c++],v=t[c++],g=t[c++],_=t[c++],10),o=g,r=_;break;case Py.A:var b=t[c++],S=t[c++],T=t[c++],M=t[c++],C=t[c++],k=t[c++],I=k+C;c+=1,p&&(a=Fy(C)*T+b,s=Vy(C)*M+S),f=Ny(T,M)*By(Wy,Math.abs(k)),o=Fy(I)*T+b,r=Vy(I)*M+S;break;case Py.R:a=o=t[c++],s=r=t[c++],f=2*t[c++]+2*t[c++];break;case Py.Z:var L=a-o;m=s-r,f=Math.sqrt(L*L+m*m),o=a,r=s}f>=0&&(l[h++]=f,u+=f)}return this._pathLen=u,u},t.prototype.rebuildPath=function(t,e){var n,i,o,r,a,s,l,u,h,c,d=this.data,p=this._ux,f=this._uy,g=this._len,m=e<1,y=0,v=0,_=0;if(!m||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=e*this._pathLen))t:for(var x=0;x0&&(t.lineTo(h,c),_=0),w){case Py.M:n=o=d[x++],i=r=d[x++],t.moveTo(o,r);break;case Py.L:a=d[x++],s=d[x++];var S=Zy(a-o),T=Zy(s-r);if(S>p||T>f){if(m){if(y+(Y=l[v++])>u){t.lineTo(o*(1-(X=(u-y)/Y))+a*X,r*(1-X)+s*X);break t}y+=Y}t.lineTo(a,s),o=a,r=s,_=0}else{var M=S*S+T*T;M>_&&(h=a,c=s,_=M)}break;case Py.C:var C=d[x++],k=d[x++],I=d[x++],L=d[x++],P=d[x++],D=d[x++];if(m){if(y+(Y=l[v++])>u){Ht(o,C,I,P,X=(u-y)/Y,Dy),Ht(r,k,L,D,X,Ay),t.bezierCurveTo(Dy[1],Ay[1],Dy[2],Ay[2],Dy[3],Ay[3]);break t}y+=Y}t.bezierCurveTo(C,k,I,L,P,D),o=P,r=D;break;case Py.Q:if(C=d[x++],k=d[x++],I=d[x++],L=d[x++],m){if(y+(Y=l[v++])>u){Yt(o,C,I,X=(u-y)/Y,Dy),Yt(r,k,L,X,Ay),t.quadraticCurveTo(Dy[1],Ay[1],Dy[2],Ay[2]);break t}y+=Y}t.quadraticCurveTo(C,k,I,L),o=I,r=L;break;case Py.A:var A=d[x++],O=d[x++],z=d[x++],E=d[x++],R=d[x++],B=d[x++],N=d[x++],F=!d[x++],V=z>E?z:E,Z=Zy(z-E)>.001,H=R+B,W=!1;if(m&&(y+(Y=l[v++])>u&&(H=R+B*(u-y)/Y,W=!0),y+=Y),Z&&t.ellipse?t.ellipse(A,O,z,E,N,R,H,F):t.arc(A,O,V,R,H,F),W)break t;b&&(n=Fy(R)*z+A,i=Vy(R)*E+O),o=Fy(H)*z+A,r=Vy(H)*E+O;break;case Py.R:n=o=d[x],i=r=d[x+1],a=d[x++],s=d[x++];var j=d[x++],G=d[x++];if(m){if(y+(Y=l[v++])>u){var U=u-y;t.moveTo(a,s),t.lineTo(a+By(U,j),s),(U-=j)>0&&t.lineTo(a+j,s+By(U,G)),(U-=G)>0&&t.lineTo(a+Ny(j-U,0),s+G),(U-=j)>0&&t.lineTo(a,s+Ny(G-U,0));break t}y+=Y}t.rect(a,s,j,G);break;case Py.Z:if(m){var Y;if(y+(Y=l[v++])>u){var X;t.lineTo(o*(1-(X=(u-y)/Y))+n*X,r*(1-X)+i*X);break t}y+=Y}t.closePath(),o=n,r=i}}},t.prototype.clone=function(){var e=new t,n=this.data;return e.data=n.slice?n.slice():Array.prototype.slice.call(n),e._len=this._len,e},t.prototype.canSave=function(){return!!this._saveData},t.CMD=Py,t.initDefaultProps=((e=t.prototype)._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,void(e._version=0)),t}();const Yy=Uy;var Xy=2*Math.PI,qy=2*Math.PI,Ky=Yy.CMD,$y=2*Math.PI,Jy=[-1,-1,-1],Qy=[-1,-1],tv=s({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},dy),ev={style:s({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},py.style)},nv=wm.concat(["invisible","culling","z","z2","zlevel","parent"]),iv=function(t){function e(e){return t.call(this,e)||this}var n;return W(e,t),e.prototype.update=function(){var n=this;t.prototype.update.call(this);var i=this.style;if(i.decal){var o=this._decalEl=this._decalEl||new e;o.buildPath===e.prototype.buildPath&&(o.buildPath=function(t){n.buildPath(t,n.shape)}),o.silent=!0;var r=o.style;for(var a in i)r[a]!==i[a]&&(r[a]=i[a]);r.fill=i.fill?i.decal:null,r.decal=null,r.shadowColor=null,i.strokeFirst&&(r.stroke=null);for(var s=0;s.5?dm:e>.2?"#eee":pm}if(t)return pm}return dm},e.prototype.getInsideTextStroke=function(t){var e=this.style.fill;if(_(e)){var n=this.__zr;if(!(!n||!n.isDarkMode())==ue(t,0)<.4)return e}},e.prototype.buildPath=function(t,e,n){},e.prototype.pathUpdated=function(){this.__dirty&=-5},e.prototype.getUpdatedPathProxy=function(t){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,t),this.path},e.prototype.createPathProxy=function(){this.path=new Yy(!1)},e.prototype.hasStroke=function(){var t=this.style,e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))},e.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},e.prototype.getBoundingRect=function(){var t=this._rect,e=this.style,n=!t;if(n){var i=!1;this.path||(i=!0,this.createPathProxy());var o=this.path;(i||4&this.__dirty)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),t=o.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var r=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||n){r.copy(t);var a=e.strokeNoScale?this.getLineScale():1,s=e.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;s=Math.max(s,null==l?4:l)}a>1e-10&&(r.width+=s/a,r.height+=s/a,r.x-=s/a/2,r.y-=s/a/2)}return r}return t},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect(),o=this.style;if(i.contain(t=n[0],e=n[1])){var r=this.path;if(this.hasStroke()){var a=o.lineWidth,s=o.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),function(t,e,n,i){return yi(t,e,!0,n,i)}(r,a/s,t,e)))return!0}if(this.hasFill())return function(t,e,n){return yi(t,0,!1,e,n)}(r,t,e)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():"shape"===t?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(e,n){"shape"===e?this.setShape(n):t.prototype.attrKV.call(this,e,n)},e.prototype.setShape=function(t,e){var n=this.shape;return n||(n=this.shape={}),"string"==typeof t?n[t]=e:a(n,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(4&this.__dirty)},e.prototype.createStyle=function(t){return F(tv,t)},e.prototype._innerSaveToNormal=function(e){t.prototype._innerSaveToNormal.call(this,e);var n=this._normalState;e.shape&&!n.shape&&(n.shape=a({},this.shape))},e.prototype._applyStateObj=function(e,n,i,o,r,s){t.prototype._applyStateObj.call(this,e,n,i,o,r,s);var l,u=!(n&&o);if(n&&n.shape?r?o?l=n.shape:(l=a({},i.shape),a(l,n.shape)):(l=a({},o?this.shape:i.shape),a(l,n.shape)):u&&(l=i.shape),l)if(r){this.shape=a({},this.shape);for(var h={},c=g(l),d=0;du&&(n*=u/(a=n+i),i*=u/a),o+r>u&&(o*=u/(a=o+r),r*=u/a),i+o>h&&(i*=h/(a=i+o),o*=h/a),n+r>h&&(n*=h/(a=n+r),r*=h/a),t.moveTo(s+n,l),t.lineTo(s+u-i,l),0!==i&&t.arc(s+u-i,l+i,i,-Math.PI/2,0),t.lineTo(s+u,l+h-o),0!==o&&t.arc(s+u-o,l+h-o,o,0,Math.PI/2),t.lineTo(s+r,l+h),0!==r&&t.arc(s+r,l+h-r,r,Math.PI/2,Math.PI),t.lineTo(s,l+n),0!==n&&t.arc(s+n,l+n,n,Math.PI,1.5*Math.PI)}(t,e):t.rect(n,i,o,r)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(ov);gv.prototype.type="rect";const mv=gv;var yv={fill:"#000"},vv={},_v={style:s({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},py.style)},xv=function(t){function e(e){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=yv,n.attr(e),n}return W(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var e=0;ey&&p){var _=Math.floor(y/d);f=f||m.length>_,v=(m=m.slice(0,_)).length*d}if(o&&h&&null!=g)for(var x=Un(g,u,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),w={},b=0;b0,M=0;Mm&&qn(a,s.substring(m,y),e,g),qn(a,p[2],e,g,p[1]),m=oy.lastIndex}md){var R=a.lines.length;I>0?(M.tokens=M.tokens.slice(0,I),r(M,k,C),a.lines=a.lines.slice(0,T+1)):a.lines=a.lines.slice(0,T),a.isTruncated=a.isTruncated||a.lines.length=0&&"right"===(k=_[C]).align;)this._placeToken(k,t,w,f,M,"right",m),b-=k.width,M-=k.width,C--;for(T+=(s-(T-p)-(g-M)-b)/2;S<=C;)this._placeToken(k=_[S],t,w,f,T+k.width/2,"center",m),T+=k.width,S++;f+=w}},e.prototype._placeToken=function(t,e,n,i,o,r,a){var s=e.rich[t.styleName]||{};s.text=t.text;var l=t.verticalAlign,u=i+n/2;"top"===l?u=i+t.height/2:"bottom"===l&&(u=i+n-t.height/2),!t.isLineHolder&&Li(s)&&this._renderBackground(s,e,"right"===r?o-t.width:"center"===r?o-t.width/2:o,u-t.height/2,t.width,t.height);var h=!!s.backgroundColor,c=t.textPadding;c&&(o=ki(o,r,c),u-=t.height/2-c[0]-t.innerHeight/2);var d=this._getOrCreateChild(sv),p=d.createStyle();d.useStyle(p);var f=this._defaultStyle,g=!1,m=0,y=!1,v=Ci("fill"in s?s.fill:"fill"in e?e.fill:(g=!0,f.fill)),_=Mi("stroke"in s?s.stroke:"stroke"in e?e.stroke:h||a||f.autoStroke&&!g?null:(m=2,y=!0,f.stroke)),x=s.textShadowBlur>0||e.textShadowBlur>0;p.text=t.text,p.x=o,p.y=u,x&&(p.shadowBlur=s.textShadowBlur||e.textShadowBlur||0,p.shadowColor=s.textShadowColor||e.textShadowColor||"transparent",p.shadowOffsetX=s.textShadowOffsetX||e.textShadowOffsetX||0,p.shadowOffsetY=s.textShadowOffsetY||e.textShadowOffsetY||0),p.textAlign=r,p.textBaseline="middle",p.font=t.font||of,p.opacity=P(s.opacity,e.opacity,1),bi(p,s),_&&(p.lineWidth=P(s.lineWidth,e.lineWidth,m),p.lineDash=L(s.lineDash,e.lineDash),p.lineDashOffset=e.lineDashOffset||0,p.stroke=_),v&&(p.fill=v),d.setBoundingRect(ti(p,t.contentWidth,t.contentHeight,y?0:null))},e.prototype._renderBackground=function(t,e,n,i,o,r){var a,s,l,u=t.backgroundColor,h=t.borderWidth,c=t.borderColor,d=u&&u.image,p=u&&!d,f=t.borderRadius,g=this;if(p||t.lineHeight||h&&c){(a=this._getOrCreateChild(mv)).useStyle(a.createStyle()),a.style.fill=null;var m=a.shape;m.x=n,m.y=i,m.width=o,m.height=r,m.r=f,a.dirtyShape()}if(p)(l=a.style).fill=u||null,l.fillOpacity=L(t.fillOpacity,1);else if(d){(s=this._getOrCreateChild(cv)).onload=function(){g.dirtyStyle()};var y=s.style;y.image=u.image,y.x=n,y.y=i,y.width=o,y.height=r}h&&c&&((l=a.style).lineWidth=h,l.stroke=c,l.strokeOpacity=L(t.strokeOpacity,1),l.lineDash=t.borderDash,l.lineDashOffset=t.borderDashOffset||0,a.strokeContainThreshold=0,a.hasFill()&&a.hasStroke()&&(l.strokeFirst=!0,l.lineWidth*=2));var v=(a||s).style;v.shadowBlur=t.shadowBlur||0,v.shadowColor=t.shadowColor||"transparent",v.shadowOffsetX=t.shadowOffsetX||0,v.shadowOffsetY=t.shadowOffsetY||0,v.opacity=P(t.opacity,e.opacity,1)},e.makeFont=function(t){var e="";return Si(t)&&(e=[t.fontStyle,t.fontWeight,wi(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),e&&z(e)||t.textFont||t.font},e}(_y),wv={left:!0,right:1,center:1},bv={top:1,bottom:1,middle:1},Sv=["fontStyle","fontWeight","fontSize","fontFamily"];const Tv=xv;var Mv=Ln(),Cv=1,kv={},Iv=Ln(),Lv=Ln(),Pv=["emphasis","blur","select"],Dv=["normal","emphasis","blur","select"],Av="highlight",Ov="downplay",zv="select",Ev="unselect",Rv="toggleSelect",Bv="selectchanged",Nv={},Fv=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],Vv=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],Zv=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],Hv=Ln(),Wv={minMargin:1,textMargin:2},jv=["textStyle","color"],Gv=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],Uv=new Tv;const Yv=function(){function t(){}return t.prototype.getTextColor=function(t){var e=this.ecModel;return this.getShallow("color")||(!t&&e?e.get(jv):null)},t.prototype.getFont=function(){return go({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},t.prototype.getTextRect=function(t){for(var e={text:t,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},n=0;n-1?r_:s_;yo(a_,{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:". "}}}}),yo(r_,{time:{month:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"],monthAbbr:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],dayOfWeek:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],dayOfWeekAbbr:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"]},legend:{selector:{all:"\u5168\u9009",inverse:"\u53cd\u9009"}},toolbox:{brush:{title:{rect:"\u77e9\u5f62\u9009\u62e9",polygon:"\u5708\u9009",lineX:"\u6a2a\u5411\u9009\u62e9",lineY:"\u7eb5\u5411\u9009\u62e9",keep:"\u4fdd\u6301\u9009\u62e9",clear:"\u6e05\u9664\u9009\u62e9"}},dataView:{title:"\u6570\u636e\u89c6\u56fe",lang:["\u6570\u636e\u89c6\u56fe","\u5173\u95ed","\u5237\u65b0"]},dataZoom:{title:{zoom:"\u533a\u57df\u7f29\u653e",back:"\u533a\u57df\u7f29\u653e\u8fd8\u539f"}},magicType:{title:{line:"\u5207\u6362\u4e3a\u6298\u7ebf\u56fe",bar:"\u5207\u6362\u4e3a\u67f1\u72b6\u56fe",stack:"\u5207\u6362\u4e3a\u5806\u53e0",tiled:"\u5207\u6362\u4e3a\u5e73\u94fa"}},restore:{title:"\u8fd8\u539f"},saveAsImage:{title:"\u4fdd\u5b58\u4e3a\u56fe\u7247",lang:["\u53f3\u952e\u53e6\u5b58\u4e3a\u56fe\u7247"]}},series:{typeNames:{pie:"\u997c\u56fe",bar:"\u67f1\u72b6\u56fe",line:"\u6298\u7ebf\u56fe",scatter:"\u6563\u70b9\u56fe",effectScatter:"\u6d9f\u6f2a\u6563\u70b9\u56fe",radar:"\u96f7\u8fbe\u56fe",tree:"\u6811\u56fe",treemap:"\u77e9\u5f62\u6811\u56fe",boxplot:"\u7bb1\u578b\u56fe",candlestick:"K\u7ebf\u56fe",k:"K\u7ebf\u56fe",heatmap:"\u70ed\u529b\u56fe",map:"\u5730\u56fe",parallel:"\u5e73\u884c\u5750\u6807\u56fe",lines:"\u7ebf\u56fe",graph:"\u5173\u7cfb\u56fe",sankey:"\u6851\u57fa\u56fe",funnel:"\u6f0f\u6597\u56fe",gauge:"\u4eea\u8868\u76d8\u56fe",pictorialBar:"\u8c61\u5f62\u67f1\u56fe",themeRiver:"\u4e3b\u9898\u6cb3\u6d41\u56fe",sunburst:"\u65ed\u65e5\u56fe",custom:"\u81ea\u5b9a\u4e49\u56fe\u8868",chart:"\u56fe\u8868"}},aria:{general:{withTitle:"\u8fd9\u662f\u4e00\u4e2a\u5173\u4e8e\u201c{title}\u201d\u7684\u56fe\u8868\u3002",withoutTitle:"\u8fd9\u662f\u4e00\u4e2a\u56fe\u8868\uff0c"},series:{single:{prefix:"",withName:"\u56fe\u8868\u7c7b\u578b\u662f{seriesType}\uff0c\u8868\u793a{seriesName}\u3002",withoutName:"\u56fe\u8868\u7c7b\u578b\u662f{seriesType}\u3002"},multiple:{prefix:"\u5b83\u7531{seriesCount}\u4e2a\u56fe\u8868\u7cfb\u5217\u7ec4\u6210\u3002",withName:"\u7b2c{seriesId}\u4e2a\u7cfb\u5217\u662f\u4e00\u4e2a\u8868\u793a{seriesName}\u7684{seriesType}\uff0c",withoutName:"\u7b2c{seriesId}\u4e2a\u7cfb\u5217\u662f\u4e00\u4e2a{seriesType}\uff0c",separator:{middle:"\uff1b",end:"\u3002"}}},data:{allData:"\u5176\u6570\u636e\u662f\u2014\u2014",partialData:"\u5176\u4e2d\uff0c\u524d{displayCnt}\u9879\u662f\u2014\u2014",withName:"{name}\u7684\u6570\u636e\u662f{value}",withoutName:"{value}",separator:{middle:"\uff0c",end:""}}}});var c_=null,d_=1e3,p_=6e4,f_=36e5,g_=864e5,m_=31536e6,y_={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})/},v_={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},__="{yyyy}-{MM}-{dd}",x_={year:"{yyyy}",month:"{yyyy}-{MM}",day:__,hour:__+" "+v_.hour,minute:__+" "+v_.minute,second:__+" "+v_.second,millisecond:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},w_=["year","month","day","hour","minute","second","millisecond"],b_=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"],S_=A,T_=["a","b","c","d","e","f","g"],M_=function(t,e){return"{"+t+(null==e?"":e)+"}"},C_={},k_={},I_=function(){function t(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return t.prototype.create=function(t,e){function n(n,i){var o=[];return c(n,function(n,i){var r=n.create(t,e);o=o.concat(r||[])}),o}this._nonSeriesBoxMasterList=n(C_),this._normalMasterList=n(k_)},t.prototype.update=function(t,e){c(this._normalMasterList,function(n){n.update&&n.update(t,e)})},t.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},t.register=function(t,e){"matrix"!==t&&"calendar"!==t?k_[t]=e:C_[t]=e},t.get=function(t){return k_[t]||C_[t]},t}(),L_=1,P_=2,D_=B(),A_=0,O_=1,z_=2;const E_=I_;var R_=c,B_=["left","right","top","bottom","width","height"],N_=[["width","left","right"],["height","top","bottom"]],F_=Uo,V_=(m(Uo,"vertical"),m(Uo,"horizontal"),{rect:1,point:2}),Z_=Ln(),H_=function(t){function n(e,n,i){var o=t.call(this,e,n,i)||this;return o.uid=mo("ec_cpt_model"),o}var i;return e(n,t),n.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n)},n.prototype.mergeDefaultAndTheme=function(t,e){var n=Ko(this),i=n?Jo(t):{};r(t,e.getTheme().get(this.mainType)),r(t,this.getDefaultOption()),n&&$o(t,i,n)},n.prototype.mergeOption=function(t,e){r(this.option,t,!0);var n=Ko(this);n&&$o(this.option,t,n)},n.prototype.optionUpdated=function(t,e){},n.prototype.getDefaultOption=function(){var t=this.constructor;if(!function(t){return!(!t||!t[Qm])}(t))return t.defaultOption;var e=Z_(this);if(!e.defaultOption){for(var n=[],i=t;i;){var o=i.prototype.defaultOption;o&&n.push(o),i=i.superClass}for(var a={},s=n.length-1;s>=0;s--)a=r(a,n[s],!0);e.defaultOption=a}return e.defaultOption},n.prototype.getReferringComponents=function(t,e){var n=t+"Id";return An(this.ecModel,t,{index:this.get(t+"Index",!0),id:this.get(n,!0)},e)},n.prototype.getBoxLayoutParams=function(){return{left:(t=this).getShallow("left",e=!1),top:t.getShallow("top",e),right:t.getShallow("right",e),bottom:t.getShallow("bottom",e),width:t.getShallow("width",e),height:t.getShallow("height",e)};var t,e},n.prototype.getZLevelKey=function(){return""},n.prototype.setZLevel=function(t){this.option.zlevel=t},n.protoInitialize=((i=n.prototype).type="component",i.id="",i.name="",i.mainType="",i.subType="",void(i.componentIndex=0)),n}(i_);Rn(H_,i_),Fn(H_),function(t){var e={};t.registerSubTypeDefaulter=function(t,n){var i=zn(t);e[i.main]=n},t.determineSubType=function(n,i){var o=i.type;if(!o){var r=zn(n).main;t.hasSubTypes(n)&&e[r]&&(o=e[r](i))}return o}}(H_),function(t){function e(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}t.topologicalTravel=function(t,n,i,o){function r(t){u[t].entryCount--,0===u[t].entryCount&&h.push(t)}function a(t){p[t]=!0,r(t)}if(t.length){var s=function(t){var n={},i=[];return c(t,function(o){var r,a,s=e(n,o),u=function(t,e){var n=[];return c(t,function(t){l(e,t)>=0&&n.push(t)}),n}(s.originalDeps=(a=[],c(H_.getClassesByMainType(r=o),function(t){a=a.concat(t.dependencies||t.prototype.dependencies||[])}),a=d(a,function(t){return zn(t).main}),"dataset"!==r&&l(a,"dataset")<=0&&a.unshift("dataset"),a),t);s.entryCount=u.length,0===s.entryCount&&i.push(o),c(u,function(t){l(s.predecessor,t)<0&&s.predecessor.push(t);var i=e(n,t);l(i.successor,t)<0&&i.successor.push(o)})}),{graph:n,noEntryList:i}}(n),u=s.graph,h=s.noEntryList,p={};for(c(t,function(t){p[t]=!0});h.length;){var f=h.pop(),g=u[f],m=!!p[f];m&&(i.call(o,f,g.originalDeps.slice()),delete p[f]),c(g.successor,m?a:r)}c(p,function(){throw new Error("")})}}}(H_);const W_=H_;var j_={color:{},darkColor:{},size:{}},G_=j_.color={theme:["#5070dd","#b6d634","#505372","#ff994d","#0ca8df","#ffd10a","#fb628b","#785db0","#3fbe95"],neutral00:"#fff",neutral05:"#f4f7fd",neutral10:"#e8ebf0",neutral15:"#dbdee4",neutral20:"#cfd2d7",neutral25:"#c3c5cb",neutral30:"#b7b9be",neutral35:"#aaacb2",neutral40:"#9ea0a5",neutral45:"#929399",neutral50:"#86878c",neutral55:"#797b7f",neutral60:"#6d6e73",neutral65:"#616266",neutral70:"#54555a",neutral75:"#48494d",neutral80:"#3c3c41",neutral85:"#303034",neutral90:"#232328",neutral95:"#17171b",neutral99:"#000",accent05:"#eff1f9",accent10:"#e0e4f2",accent15:"#d0d6ec",accent20:"#c0c9e6",accent25:"#b1bbdf",accent30:"#a1aed9",accent35:"#91a0d3",accent40:"#8292cc",accent45:"#7285c6",accent50:"#6578ba",accent55:"#5c6da9",accent60:"#536298",accent65:"#4a5787",accent70:"#404c76",accent75:"#374165",accent80:"#2e3654",accent85:"#252b43",accent90:"#1b2032",accent95:"#121521",transparent:"rgba(0,0,0,0)",highlight:"rgba(255,231,130,0.8)"};for(var U_ in a(G_,{primary:G_.neutral80,secondary:G_.neutral70,tertiary:G_.neutral60,quaternary:G_.neutral50,disabled:G_.neutral20,border:G_.neutral30,borderTint:G_.neutral20,borderShade:G_.neutral40,background:G_.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:G_.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:G_.neutral70,axisLineTint:G_.neutral40,axisTick:G_.neutral70,axisTickMinor:G_.neutral60,axisLabel:G_.neutral70,axisSplitLine:G_.neutral15,axisMinorSplitLine:G_.neutral05}),G_)if(G_.hasOwnProperty(U_)){var Y_=G_[U_];"theme"===U_?j_.darkColor.theme=G_.theme.slice():"highlight"===U_?j_.darkColor.highlight="rgba(255,231,130,0.4)":j_.darkColor[U_]=0===U_.indexOf("accent")?se(Y_,null,function(t){return.5*t},function(t){return Math.min(1,1.3-t)}):se(Y_,null,function(t){return.9*t},function(t){return 1-Math.pow(t,1.5)})}j_.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};const X_=j_;var q_="";"undefined"!=typeof navigator&&(q_=navigator.platform||"");var K_="rgba(0, 0, 0, 0.2)",$_=X_.color.theme[0],J_=se($_,null,null,.9);const Q_={darkMode:"auto",colorBy:"series",color:X_.color.theme,gradientColor:[J_,$_],aria:{decal:{decals:[{color:K_,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:K_,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:K_,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:K_,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:K_,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:K_,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:q_.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 tx,ex,nx,ix=B(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),ox="original",rx="arrayRows",ax="objectRows",sx="keyedColumns",lx="typedArray",ux="unknown",hx="column",cx="row",dx=1,px=2,fx=3,gx=Ln(),mx=B(),yx=Ln(),vx=(Ln(),function(){function t(){}return t.prototype.getColorFromPalette=function(t,e,n){var i=vn(this.get("color",!0)),o=this.get("colorLayer",!0);return function(t,e,n,i,o,r,a){var s=e(r=r||t),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(o))return u[o];var h=null!=a&&i?function(t,e){for(var n=t.length,i=0;ie)return t[i];return t[n-1]}(i,a):n;if((h=h||n)&&h.length){var c=h[l];return o&&(u[o]=c),s.paletteIdx=(l+1)%h.length,c}}(this,yx,i,o,t,e,n)},t.prototype.clearColorPalette=function(){!function(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}(this,yx)},t}()),_x="\0_ec_inner",xx=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.init=function(t,e,n,i,o,r){i=i||{},this.option=null,this._theme=new i_(i),this._locale=new i_(o),this._optionManager=r},n.prototype.setOption=function(t,e,n){var i=rr(e);this._optionManager.setOption(t,n,i),this._resetOption(null,i)},n.prototype.resetOption=function(t,e){return this._resetOption(t,rr(e))},n.prototype._resetOption=function(t,e){var n=!1,i=this._optionManager;if(!t||"recreate"===t){var o=i.mountOption("recreate"===t);this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(o,e)):nx(this,o),n=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var r=i.getTimelineOption(this);r&&(n=!0,this._mergeOption(r,e))}if(!t||"recreate"===t||"media"===t){var a=i.getMediaOption(this);a.length&&c(a,function(t){n=!0,this._mergeOption(t,e)},this)}return n},n.prototype.mergeOption=function(t){this._mergeOption(t,null)},n.prototype._mergeOption=function(t,e){var n=this.option,i=this._componentsMap,s=this._componentsCount,l=[],u=B(),h=e&&e.replaceMergeMainTypeMap;gx(this).datasetMap=B(),c(t,function(t,e){null!=t&&(W_.hasClass(e)?e&&(l.push(e),u.set(e,!0)):n[e]=null==n[e]?o(t):r(n[e],t,!0))}),h&&h.each(function(t,e){W_.hasClass(e)&&!u.get(e)&&(l.push(e),u.set(e,!0))}),W_.topologicalTravel(l,W_.getAllClassMainTypes(),function(e){var o=function(t,e,n){var i=mx.get(e);if(!i)return n;var o=i(t);return o?n.concat(o):n}(this,e,vn(t[e])),r=i.get(e),l=bn(r,o,r?h&&h.get(e)?"replaceMerge":"normalMerge":"replaceAll");!function(t,e,n){c(t,function(t){var i=t.newOption;b(i)&&(t.keyInfo.mainType=e,t.keyInfo.subType=function(t,e,n,i){return e.type?e.type:n?n.subType:i.determineSubType(t,e)}(e,i,t.existing,n))})}(l,e,W_),n[e]=null,i.set(e,null),s.set(e,0);var u,d=[],p=[],f=0;c(l,function(t,n){var i=t.existing,o=t.newOption;if(o){var r=W_.getClass(e,t.keyInfo.subType,!("series"===e));if(!r)return;if("tooltip"===e){if(u)return;u=!0}if(i&&i.constructor===r)i.name=t.keyInfo.name,i.mergeOption(o,this),i.optionUpdated(o,!1);else{var s=a({componentIndex:n},t.keyInfo);a(i=new r(o,this,this,s),s),t.brandNew&&(i.__requireNewView=!0),i.init(o,this,this),i.optionUpdated(null,!0)}}else i&&(i.mergeOption({},this),i.optionUpdated({},!1));i?(d.push(i.option),p.push(i),f++):(d.push(void 0),p.push(void 0))},this),n[e]=d,i.set(e,p),s.set(e,f),"series"===e&&tx(this)},this),this._seriesIndices||tx(this)},n.prototype.getOption=function(){var t=o(this.option);return c(t,function(e,n){if(W_.hasClass(n)){for(var i=vn(e),o=i.length,r=!1,a=o-1;a>=0;a--)i[a]&&!kn(i[a])?r=!0:(i[a]=null,!r&&o--);i.length=o,t[n]=i}}),delete t[_x],t},n.prototype.setTheme=function(t){this._theme=new i_(t),this._resetOption("recreate",null)},n.prototype.getTheme=function(){return this._theme},n.prototype.getLocaleModel=function(){return this._locale},n.prototype.setUpdatePayload=function(t){this._payload=t},n.prototype.getUpdatePayload=function(){return this._payload},n.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){var i=n[e||0];if(i)return i;if(null==e)for(var o=0;ou&&(u=p)}s[0]=l,s[1]=u}},o=function(){return this._data?this._data.length/this._dimSize:0};(e={})[rx+"_"+hx]={pure:!0,appendData:t},e[rx+"_"+cx]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[ax]={pure:!0,appendData:t},e[sx]={pure:!0,appendData:function(t){var e=this._data;c(t,function(t,n){for(var i=e[n]||(e[n]=[]),o=0;o<(t||[]).length;o++)i.push(t[o])})}},e[ox]={appendData:t},e[lx]={persistent:!1,pure:!0,appendData:function(t){this._data=t},clean:function(){this._offset+=this.count(),this._data=null}},Ax=e}(),t}(),Gx=function(t){y(t)||kr("series.data or dataset.source must be an array.")},Ux=((Ix={})[rx+"_"+hx]=Gx,Ix[rx+"_"+cx]=Gx,Ix[ax]=Gx,Ix[sx]=function(t,e){for(var n=0;n=0&&(s=r.interpolatedValue[l])}return null!=s?s+"":""}):void 0},t.prototype.getRawValue=function(t,e){return Or(this.getData(e),t)},t.prototype.formatTooltip=function(t,e,n){},t}(),tw=function(){function t(t){this._reset=(t=t||{}).reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return t.prototype.perform=function(t){function e(t){return!(t>=1)&&(t=1),t}var n,i=this._upstream,o=t&&t.skip;if(this._dirty&&i){var r=this.context;r.data=r.outputData=i.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!o&&(n=this._plan(this.context));var a,s=e(this._modBy),l=this._modDataCount||0,u=e(t&&t.modBy),h=t&&t.modDataCount||0;s===u&&l===h||(n="reset"),(this._dirty||"reset"===n)&&(this._dirty=!1,a=this._doReset(o)),this._modBy=u,this._modDataCount=h;var c=t&&t.step;if(this._dueEnd=i?i._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,p=Math.min(null!=c?this._dueIndex+c:1/0,this._dueEnd);if(!o&&(a||d=n?null:t1&&r>0?e:t}};return s}(),nw=(B({number:function(t){return parseFloat(t)},time:function(t){return+cn(t)},trim:function(t){return _(t)?z(t):t}}),function(){function t(t,e){var n="desc"===t;this._resultLT=n?1:-1,null==e&&(e=n?"min":"max"),this._incomparable="min"===e?-1/0:1/0}return t.prototype.evaluate=function(t,e){var n=w(t)?t:fn(t),i=w(e)?e:fn(e),o=isNaN(n),r=isNaN(i);if(o&&(n=this._incomparable),r&&(i=this._incomparable),o&&r){var a=_(t),s=_(e);a&&(n=s?t:0),s&&(i=a?e:0)}return ni?-this._resultLT:0},t}()),iw=function(){function t(){}return t.prototype.getRawData=function(){throw new Error("not supported")},t.prototype.getRawDataItem=function(t){throw new Error("not supported")},t.prototype.cloneRawData=function(){},t.prototype.getDimensionInfo=function(t){},t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},t.prototype.retrieveValue=function(t,e){},t.prototype.retrieveValueFromItem=function(t,e){},t.prototype.convertValue=function(t,e){return Rr(t,e)},t}(),ow=B(),rw="undefined",aw=typeof Uint32Array===rw?Array:Uint32Array,sw=typeof Uint16Array===rw?Array:Uint16Array,lw=typeof Int32Array===rw?Array:Int32Array,uw=typeof Float64Array===rw?Array:Float64Array,hw={float:uw,int:lw,ordinal:Array,number:Array,time:uw},cw=function(){function t(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=B()}return t.prototype.initData=function(t,e,n){this._provider=t,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var i=t.getSource(),o=this.defaultDimValueGetter=zx[i.sourceFormat];this._dimValueGetter=n||o,this._rawExtent=[],Cr(i),this._dimensions=d(e,function(t){return{type:t.type,property:t.property}}),this._initDataFromProvider(0,t.count())},t.prototype.getProvider=function(){return this._provider},t.prototype.getSource=function(){return this._provider.getSource()},t.prototype.ensureCalculationDimension=function(t,e){var n=this._calcDimNameToIdx,i=this._dimensions,o=n.get(t);if(null!=o){if(i[o].type===e)return o}else o=i.length;return i[o]={type:e},n.set(t,o),this._chunks[o]=new hw[e||"float"](this._rawCount),this._rawExtent[o]=[1/0,-1/0],o},t.prototype.collectOrdinalMeta=function(t,e){var n=this._chunks[t],i=this._dimensions[t],o=this._rawExtent,r=i.ordinalOffset||0,a=n.length;0===r&&(o[t]=[1/0,-1/0]);for(var s=o[t],l=r;lf[1]&&(f[1]=p)}return this._rawCount=this._count=s,{start:a,end:s}},t.prototype._initDataFromProvider=function(t,e,n){for(var i=this._provider,o=this._chunks,r=this._dimensions,a=r.length,s=this._rawExtent,l=d(r,function(t){return t.property}),u=0;uy[1]&&(y[1]=m)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=e,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(t,e){if(!(e>=0&&e=0&&e=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&nt))return r;o=r-1}}return-1},t.prototype.getIndices=function(){var t,e=this._indices;if(e){var n=this._count;if((o=e.constructor)===Array){t=new o(n);for(var i=0;i=u&&T<=h||isNaN(T))&&(a[s++]=p),p++;d=!0}else if(2===o){f=c[i[0]];var y=c[i[1]],v=t[i[1]][0],_=t[i[1]][1];for(m=0;m=u&&T<=h||isNaN(T))&&(x>=v&&x<=_||isNaN(x))&&(a[s++]=p),p++}d=!0}}if(!d)if(1===o)for(m=0;m=u&&T<=h||isNaN(T))&&(a[s++]=w)}else for(m=0;mt[M][1])&&(b=!1)}b&&(a[s++]=e.getRawIndex(m))}return sm[1]&&(m[1]=g)}}},t.prototype.lttbDownSample=function(t,e){var n,i,o,r=this.clone([t],!0),a=r._chunks[t],s=this.count(),l=0,u=Math.floor(1/e),h=this.getRawIndex(0),c=new(Wr(this._rawCount))(Math.min(2*(Math.ceil(s/u)+2),s));c[l++]=h;for(var d=1;dn&&(n=i,o=M)}T>0&&Ta&&(f=a-u);for(var g=0;gp&&(p=m,d=u+g)}var y=this.getRawIndex(h),v=this.getRawIndex(d);hu-p&&(a.length=s=u-p);for(var f=0;fh[1]&&(h[1]=m),c[d++]=y}return o._count=d,o._indices=c,o._updateGetRawIdx(),o},t.prototype.each=function(t,e){if(this._count)for(var n=t.length,i=this._chunks,o=0,r=this.count();oa&&(a=l)}return this._extent[t]=i=[r,a],i},t.prototype.getRawDataItem=function(t){var e=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(e);for(var n=[],i=this._chunks,o=0;o=0?this._indices[t]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=function(){function t(t,e,n,i){return Rr(t[i],this._dimensions[i])}zx={arrayRows:t,objectRows:function(t,e,n,i){return Rr(t[e],this._dimensions[i])},keyedColumns:t,original:function(t,e,n,i){var o=t&&(null==t.value?t:t.value);return Rr(o instanceof Array?o[i]:o,this._dimensions[i])},typedArray:function(t,e,n,i){return t[i]}}}(),t}();const dw=cw;var pw=function(){function t(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(t,e){this._sourceList=t,this._upstreamSignList=e,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var t,e,n=this._sourceHost,i=this._getUpstreamSourceManagers(),o=!!i.length;if(Yr(n)){var r=n,a=void 0,s=void 0,l=void 0;if(o){var u=i[0];u.prepareSource(),a=(l=u.getSource()).data,s=l.sourceFormat,e=[u._getVersionSign()]}else s=T(a=r.get("data",!0))?lx:ox,e=[];var h=this._getSourceMetaRawOption()||{},c=l&&l.metaRawOption||{},d=L(h.seriesLayoutBy,c.seriesLayoutBy)||null,p=L(h.sourceHeader,c.sourceHeader),f=L(h.dimensions,c.dimensions);t=d!==c.seriesLayoutBy||!!p!=!!c.sourceHeader||f?[wr(a,{seriesLayoutBy:d,sourceHeader:p,dimensions:f},s)]:[]}else{var g=n;if(o){var m=this._applyTransform(i);t=m.sourceList,e=m.upstreamSignList}else t=[wr(g.get("source",!0),this._getSourceMetaRawOption(),null)],e=[]}this._setLocalSource(t,e)},t.prototype._applyTransform=function(t){var e,n=this._sourceHost,i=n.get("transform",!0),r=n.get("fromTransformResult",!0);null!=r&&1!==t.length&&Xr("");var a,s=[],l=[];return c(t,function(t){t.prepareSource();var e=t.getSource(r||0);null==r||e||Xr(""),s.push(e),l.push(t._getVersionSign())}),i?e=function(t,e){var n=vn(t),i=n.length;i||Ir("");for(var o=0,r=i;o':'':{renderMode:r,content:"{"+(n.markerId||"markerX")+"|} ",style:"subItem"===o?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}:""}({color:e,type:t,renderMode:n,markerId:i});return _(o)?o:(this.richTextStyles[i]=o.style,o.content)},t.prototype.wrapRichTextStyle=function(t,e){var n={};y(e)?c(e,function(t){return a(n,t)}):a(n,e);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},t}(),yw=Ln(),vw=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._selectedDataIndicesMap={},e}var i;return e(n,t),n.prototype.init=function(t,e,n){this.seriesIndex=this.componentIndex,this.dataTask=Er({count:ha,reset:ca}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,n),(yw(this).sourceManager=new pw(this)).prepareSource();var i=this.getInitialData(t,n);pa(i,this),this.dataTask.context.data=i,yw(this).dataBeforeProcessed=i,ua(this),this._initSelectedMapFromData(i)},n.prototype.mergeDefaultAndTheme=function(t,e){var n=Ko(this),i=n?Jo(t):{},o=this.subType;W_.hasClass(o)&&(o+="Series"),r(t,e.getTheme().get(this.subType)),r(t,this.getDefaultOption()),_n(t,"label",["show"]),this.fillDataTextStyle(t.data),n&&$o(t,i,n)},n.prototype.mergeOption=function(t,e){t=r(this.option,t,!0),this.fillDataTextStyle(t.data);var n=Ko(this);n&&$o(this.option,t,n);var i=yw(this).sourceManager;i.dirty(),i.prepareSource();var o=this.getInitialData(t,e);pa(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,yw(this).dataBeforeProcessed=o,ua(this),this._initSelectedMapFromData(o)},n.prototype.fillDataTextStyle=function(t){if(t&&!T(t))for(var e=["show"],n=0;n=0&&h<0)&&(u=r,h=o,c=0),o===h&&(l[c++]=e))}),l.length=c,l},n.prototype.formatTooltip=function(t,e,n){return sa({series:this,dataIndex:t,multipleSeries:e})},n.prototype.isAnimationEnabled=function(){var t=this.ecModel;if(Qp.node&&(!t||!t.ssr))return!1;var e=this.getShallow("animation");return e&&this.getData().count()>this.getShallow("animationThreshold")&&(e=!1),!!e},n.prototype.restoreData=function(){this.dataTask.dirty()},n.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel,o=vx.prototype.getColorFromPalette.call(this,t,e,n);return o||(o=i.getColorFromPalette(t,e,n)),o},n.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},n.prototype.getProgressive=function(){return this.get("progressive")},n.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},n.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},n.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n){var i=this.option.selectedMode,o=this.getData(e);if("series"===i||"all"===n)return this.option.selectedMap={},void(this._selectedDataIndicesMap={});for(var r=0;r=0&&n.push(o)}return n},n.prototype.isSelected=function(t,e){var n=this.option.selectedMap;if(!n)return!1;var i=this.getData(e);return("all"===n||n[la(i,t)])&&!i.getItemModel(t).get(["select","disabled"])},n.prototype.isUniversalTransitionEnabled=function(){if(this.__universalTransitionEnabled)return!0;var t=this.option.universalTransition;return!!t&&(!0===t||t&&t.enabled)},n.prototype._innerSelect=function(t,e){var n,i,o=this.option,r=o.selectedMode,a=e.length;if(r&&a)if("series"===r)o.selectedMap="all";else if("multiple"===r){b(o.selectedMap)||(o.selectedMap={});for(var s=o.selectedMap,l=0;l0&&this._innerSelect(t,e)}},n.registerClass=function(t){return W_.registerClass(t)},n.protoInitialize=((i=n.prototype).type="series.__base__",i.seriesIndex=0,i.ignoreStyleOnData=!1,i.hasSymbolVisual=!1,i.defaultSymbol="circle",i.visualStyleAccessPath="itemStyle",void(i.visualDrawType="fill")),n}(W_);u(vw,Qx),u(vw,vx),Rn(vw,W_);const _w=vw;var xw=function(){function t(){this.group=new Em,this.uid=mo("viewComponent")}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,i){},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,i){},t.prototype.updateLayout=function(t,e,n,i){},t.prototype.updateVisual=function(t,e,n,i){},t.prototype.toggleBlurSeries=function(t,e,n){},t.prototype.eachRendered=function(t){var e=this.group;e&&e.traverse(t)},t}();En(xw),Fn(xw);const ww=xw;var bw=Yy.CMD,Sw=[[],[],[]],Tw=Math.sqrt,Mw=Math.atan2,Cw=Math.sqrt,kw=Math.sin,Iw=Math.cos,Lw=Math.PI,Pw=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Dw=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g,Aw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return W(e,t),e.prototype.applyTransform=function(t){},e}(ov),Ow=function(){this.cx=0,this.cy=0,this.r=0},zw=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new Ow},e.prototype.buildPath=function(t,e){t.moveTo(e.cx+e.r,e.cy),t.arc(e.cx,e.cy,e.r,0,2*Math.PI)},e}(ov);zw.prototype.type="circle";const Ew=zw;var Rw=function(){this.cx=0,this.cy=0,this.rx=0,this.ry=0},Bw=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new Rw},e.prototype.buildPath=function(t,e){var n=.5522848,i=e.cx,o=e.cy,r=e.rx,a=e.ry,s=r*n,l=a*n;t.moveTo(i-r,o),t.bezierCurveTo(i-r,o-l,i-s,o-a,i,o-a),t.bezierCurveTo(i+s,o-a,i+r,o-l,i+r,o),t.bezierCurveTo(i+r,o+l,i+s,o+a,i,o+a),t.bezierCurveTo(i-s,o+a,i-r,o+l,i-r,o),t.closePath()},e}(ov);Bw.prototype.type="ellipse";const Nw=Bw;var Fw=Math.PI,Vw=2*Fw,Zw=Math.sin,Hw=Math.cos,Ww=Math.acos,jw=Math.atan2,Gw=Math.abs,Uw=Math.sqrt,Yw=Math.max,Xw=Math.min,qw=1e-4,Kw=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0},$w=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new Kw},e.prototype.buildPath=function(t,e){!function(t,e){var n,i=Yw(e.r,0),o=Yw(e.r0||0,0),r=i>0;if(r||o>0){if(r||(i=o,o=0),o>i){var a=i;i=o,o=a}var s=e.startAngle,l=e.endAngle;if(!isNaN(s)&&!isNaN(l)){var u=e.cx,h=e.cy,c=!!e.clockwise,d=Gw(l-s),p=d>Vw&&d%Vw;if(p>qw&&(d=p),i>qw)if(d>Vw-qw)t.moveTo(u+i*Hw(s),h+i*Zw(s)),t.arc(u,h,i,s,l,!c),o>qw&&(t.moveTo(u+o*Hw(l),h+o*Zw(l)),t.arc(u,h,o,l,s,c));else{var f=void 0,g=void 0,m=void 0,v=void 0,_=void 0,x=void 0,w=void 0,b=void 0,S=void 0,T=void 0,M=void 0,C=void 0,k=void 0,I=void 0,L=void 0,P=void 0,D=i*Hw(s),A=i*Zw(s),O=o*Hw(l),z=o*Zw(l),E=d>qw;if(E){var R=e.cornerRadius;R&&(n=function(t){var e;if(y(t)){var n=t.length;if(!n)return t;e=1===n?[t[0],t[0],0,0]:2===n?[t[0],t[0],t[1],t[1]]:3===n?t.concat(t[2]):t}else e=[t,t,t,t];return e}(R),f=n[0],g=n[1],m=n[2],v=n[3]);var B=Gw(i-o)/2;if(_=Xw(B,m),x=Xw(B,v),w=Xw(B,f),b=Xw(B,g),M=S=Yw(_,x),C=T=Yw(w,b),(S>qw||T>qw)&&(k=i*Hw(l),I=i*Zw(l),L=o*Hw(s),P=o*Zw(s),dqw){var G=Xw(m,M),U=Xw(v,M),Y=Sa(L,P,D,A,i,G,c),X=Sa(k,I,O,z,i,U,c);t.moveTo(u+Y.cx+Y.x0,h+Y.cy+Y.y0),M0&&t.arc(u+Y.cx,h+Y.cy,G,jw(Y.y0,Y.x0),jw(Y.y1,Y.x1),!c),t.arc(u,h,i,jw(Y.cy+Y.y1,Y.cx+Y.x1),jw(X.cy+X.y1,X.cx+X.x1),!c),U>0&&t.arc(u+X.cx,h+X.cy,U,jw(X.y1,X.x1),jw(X.y0,X.x0),!c))}else t.moveTo(u+D,h+A),t.arc(u,h,i,s,l,!c);else t.moveTo(u+D,h+A);o>qw&&E?C>qw?(G=Xw(f,C),Y=Sa(O,z,k,I,o,-(U=Xw(g,C)),c),X=Sa(D,A,L,P,o,-G,c),t.lineTo(u+Y.cx+Y.x0,h+Y.cy+Y.y0),C0&&t.arc(u+Y.cx,h+Y.cy,U,jw(Y.y0,Y.x0),jw(Y.y1,Y.x1),!c),t.arc(u,h,o,jw(Y.cy+Y.y1,Y.cx+Y.x1),jw(X.cy+X.y1,X.cx+X.x1),c),G>0&&t.arc(u+X.cx,h+X.cy,G,jw(X.y1,X.x1),jw(X.y0,X.x0),!c))):(t.lineTo(u+O,h+z),t.arc(u,h,o,l,s,c)):t.lineTo(u+O,h+z)}else t.moveTo(u,h);t.closePath()}}}(t,e)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(ov);$w.prototype.type="sector";const Jw=$w;var Qw=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},tb=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new Qw},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,o=2*Math.PI;t.moveTo(n+e.r,i),t.arc(n,i,e.r,0,o,!1),t.moveTo(n+e.r0,i),t.arc(n,i,e.r0,0,o,!0)},e}(ov);tb.prototype.type="ring";const eb=tb;var nb=function(){this.points=null,this.smooth=0,this.smoothConstraint=null},ib=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new nb},e.prototype.buildPath=function(t,e){Ta(t,e,!0)},e}(ov);ib.prototype.type="polygon";const ob=ib;var rb=function(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null},ab=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new rb},e.prototype.buildPath=function(t,e){Ta(t,e,!1)},e}(ov);ab.prototype.type="polyline";const sb=ab;var lb={},ub=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},hb=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new ub},e.prototype.buildPath=function(t,e){var n,i,o,r;if(this.subPixelOptimize){var a=vi(lb,e,this.style);n=a.x1,i=a.y1,o=a.x2,r=a.y2}else n=e.x1,i=e.y1,o=e.x2,r=e.y2;var s=e.percent;0!==s&&(t.moveTo(n,i),s<1&&(o=n*(1-s)+o*s,r=i*(1-s)+r*s),t.lineTo(o,r))},e.prototype.pointAt=function(t){var e=this.shape;return[e.x1*(1-t)+e.x2*t,e.y1*(1-t)+e.y2*t]},e}(ov);hb.prototype.type="line";const cb=hb;var db=[],pb=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1},fb=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new pb},e.prototype.buildPath=function(t,e){var n=e.x1,i=e.y1,o=e.x2,r=e.y2,a=e.cpx1,s=e.cpy1,l=e.cpx2,u=e.cpy2,h=e.percent;0!==h&&(t.moveTo(n,i),null==l||null==u?(h<1&&(Yt(n,a,o,h,db),a=db[1],o=db[2],Yt(i,s,r,h,db),s=db[1],r=db[2]),t.quadraticCurveTo(a,s,o,r)):(h<1&&(Ht(n,a,l,o,h,db),a=db[1],l=db[2],o=db[3],Ht(i,s,u,r,h,db),s=db[1],u=db[2],r=db[3]),t.bezierCurveTo(a,s,l,u,o,r)))},e.prototype.pointAt=function(t){return Ma(this.shape,t,!1)},e.prototype.tangentAt=function(t){var e=Ma(this.shape,t,!0);return Q(e,e)},e}(ov);fb.prototype.type="bezier-curve";const gb=fb;var mb=function(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},yb=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new mb},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,o=Math.max(e.r,0),r=e.startAngle,a=e.endAngle,s=e.clockwise,l=Math.cos(r),u=Math.sin(r);t.moveTo(l*o+n,u*o+i),t.arc(n,i,o,r,a,!s)},e}(ov);yb.prototype.type="arc";const vb=yb;var _b=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="compound",e}return W(e,t),e.prototype._updatePathDirty=function(){for(var t=this.shape.paths,e=this.shapeChanged(),n=0;nLb[1]){if(o=!1,Pb.negativeSize||n)return o;var s=kb(Lb[0]-Ib[1]),l=kb(Ib[0]-Lb[1]);Mb(s,l)>Ab.len()&&Gf.scale(Ab,a,s=l||!Pb.bidirectional)&&(Gf.scale(Db,a,-l*i),Pb.useDir&&Pb.calcDirMTV())))}return o},t.prototype._getProjMinMaxOnAxis=function(t,e,n){for(var i=this._axes[t],o=this._origin,r=e[0].dot(i)+o[t],a=r,s=r,l=1;ln.blockIndex?n.step:null,r=i&&i.modDataCount;return{step:o,modBy:null!=r?Math.ceil(r/o):null,modDataCount:r}}},t.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},t.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData().count(),o=n.progressiveEnabled&&e.incrementalPrepareRender&&i>=n.threshold,r=t.get("large")&&i>=t.get("largeThreshold"),a="mod"===t.get("progressiveChunkMode")?i:null;t.pipelineContext=n.context={progressiveRender:o,modDataCount:a,large:r}},t.prototype.restorePipelines=function(t){var e=this,n=e._pipelineMap=B();t.eachSeries(function(t){var i=t.getProgressive(),o=t.uid;n.set(o,{id:o,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:i&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),e._pipe(t,t.dataTask)})},t.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.api.getModel(),n=this.api;c(this._allHandlers,function(i){var o=t.get(i.uid)||t.set(i.uid,{});O(!(i.reset&&i.overallReset),""),i.reset&&this._createSeriesStageTask(i,o,e,n),i.overallReset&&this._createOverallStageTask(i,o,e,n)},this)},t.prototype.prepareView=function(t,e,n,i){var o=t.renderTask,r=o.context;r.model=e,r.ecModel=n,r.api=i,o.__block=!t.incrementalPrepareRender,this._pipe(e,o)},t.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},t.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},t.prototype._performStageTasks=function(t,e,n,i){function o(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}i=i||{};var r=!1,a=this;c(t,function(t,s){if(!i.visualType||i.visualType===t.visualType){var l=a._stageTaskMap.get(t.uid),u=l.seriesTaskMap,h=l.overallTask;if(h){var c,d=h.agentStubMap;d.each(function(t){o(i,t)&&(t.dirty(),c=!0)}),c&&h.dirty(),a.updatePayload(h,n);var p=a.getPerformArgs(h,i.block);d.each(function(t){t.perform(p)}),h.perform(p)&&(r=!0)}else u&&u.each(function(s,l){o(i,s)&&s.dirty();var u=a.getPerformArgs(s,i.block);u.skip=!t.performRawSeries&&e.isSeriesFiltered(s.context.model),a.updatePayload(s,n),s.perform(u)&&(r=!0)})}}),this.unfinished=r||this.unfinished},t.prototype.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e=t.dataTask.perform()||e}),this.unfinished=e||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)})},t.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},t.prototype._createSeriesStageTask=function(t,e,n,i){function o(e){var o=e.uid,l=s.set(o,a&&a.get(o)||Er({plan:Cs,reset:ks,count:Ls}));l.context={model:e,ecModel:n,api:i,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:r},r._pipe(e,l)}var r=this,a=e.seriesTaskMap,s=e.seriesTaskMap=B(),l=t.seriesType,u=t.getTargetSeries;t.createOnAllSeries?n.eachRawSeries(o):l?n.eachRawSeriesByType(l,o):u&&u(n,i).each(o)},t.prototype._createOverallStageTask=function(t,e,n,i){function o(t){var e=t.uid,n=l.set(e,s&&s.get(e)||(p=!0,Er({reset:Ss,onDirty:Ms})));n.context={model:t,overallProgress:d},n.agent=a,n.__block=d,r._pipe(t,n)}var r=this,a=e.overallTask=e.overallTask||Er({reset:bs});a.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:r};var s=a.agentStubMap,l=a.agentStubMap=B(),u=t.seriesType,h=t.getTargetSeries,d=!0,p=!1;O(!t.createOnAllSeries,""),u?n.eachRawSeriesByType(u,o):h?h(n,i).each(o):(d=!1,c(n.getSeries(),o)),p&&a.dirty()},t.prototype._pipe=function(t,e){var n=this._pipelineMap.get(t.uid);!n.head&&(n.head=e),n.tail&&n.tail.pipe(e),n.tail=e,e.__idxInPipeline=n.count++,e.__pipeline=n},t.wrapStageHandler=function(t,e){return v(t)&&(t={overallReset:t,seriesType:Ps(t)}),t.uid=mo("stageHandler"),e&&(t.visualType=e),t},t}(),hS=Is(0),cS={},dS={};Ds(cS,bx),Ds(dS,Tx),cS.eachSeriesByType=cS.eachRawSeriesByType=function(t){$b=t},cS.eachComponent=function(t){"series"===t.mainType&&t.subType&&($b=t.subType)};const pS=uS;var fS,gS=X_.darkColor,mS=function(){return{axisLine:{lineStyle:{color:gS.axisLine}},splitLine:{lineStyle:{color:gS.axisSplitLine}},splitArea:{areaStyle:{color:[gS.backgroundTint,gS.backgroundTransparent]}},minorSplitLine:{lineStyle:{color:gS.axisMinorSplitLine}},axisLabel:{color:gS.axisLabel},axisName:{}}},yS={label:{color:gS.secondary},itemStyle:{borderColor:gS.borderTint},dividerLineStyle:{color:gS.border}},vS={darkMode:!0,color:gS.theme,backgroundColor:gS.background,axisPointer:{lineStyle:{color:gS.border},crossStyle:{color:gS.borderShade},label:{color:gS.tertiary}},legend:{textStyle:{color:gS.secondary},pageTextStyle:{color:gS.tertiary}},textStyle:{color:gS.secondary},title:{textStyle:{color:gS.primary},subtextStyle:{color:gS.quaternary}},toolbox:{iconStyle:{borderColor:gS.accent50}},tooltip:{backgroundColor:gS.neutral20,defaultBorderColor:gS.border,textStyle:{color:gS.tertiary}},dataZoom:{borderColor:gS.accent10,textStyle:{color:gS.tertiary},brushStyle:{color:gS.backgroundTint},handleStyle:{color:gS.neutral00,borderColor:gS.accent20},moveHandleStyle:{color:gS.accent40},emphasis:{handleStyle:{borderColor:gS.accent50}},dataBackground:{lineStyle:{color:gS.accent30},areaStyle:{color:gS.accent20}},selectedDataBackground:{lineStyle:{color:gS.accent50},areaStyle:{color:gS.accent30}}},visualMap:{textStyle:{color:gS.secondary},handleStyle:{borderColor:gS.neutral30}},timeline:{lineStyle:{color:gS.accent10},label:{color:gS.tertiary},controlStyle:{color:gS.accent30,borderColor:gS.accent30}},calendar:{itemStyle:{color:gS.neutral00,borderColor:gS.neutral20},dayLabel:{color:gS.tertiary},monthLabel:{color:gS.secondary},yearLabel:{color:gS.secondary}},matrix:{x:yS,y:yS,backgroundColor:{borderColor:gS.axisLine},body:{itemStyle:{borderColor:gS.borderTint}}},timeAxis:mS(),logAxis:mS(),valueAxis:mS(),categoryAxis:mS(),line:{symbol:"circle"},graph:{color:gS.theme},gauge:{title:{color:gS.secondary},axisLine:{lineStyle:{color:[[1,gS.neutral05]]}},axisLabel:{color:gS.axisLabel},detail:{color:gS.primary}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}},funnel:{itemStyle:{borderColor:gS.background}},radar:(fS=mS(),fS.axisName={color:gS.axisLabel},fS.axisLine.lineStyle.color=gS.neutral20,fS),treemap:{breadcrumb:{itemStyle:{color:gS.neutral20,textStyle:{color:gS.secondary}},emphasis:{itemStyle:{color:gS.neutral30}}}},sunburst:{itemStyle:{borderColor:gS.background}},map:{itemStyle:{borderColor:gS.border,areaColor:gS.neutral10},label:{color:gS.tertiary},emphasis:{label:{color:gS.primary},itemStyle:{areaColor:gS.highlight}},select:{label:{color:gS.primary},itemStyle:{areaColor:gS.highlight}}},geo:{itemStyle:{borderColor:gS.border,areaColor:gS.neutral10},emphasis:{label:{color:gS.primary},itemStyle:{areaColor:gS.highlight}},select:{label:{color:gS.primary},itemStyle:{color:gS.highlight}}}};vS.categoryAxis.splitLine.show=!1;const _S=vS;var xS=function(){function t(){}return t.prototype.normalizeQuery=function(t){var e={},n={},i={};if(_(t)){var o=zn(t);e.mainType=o.main||null,e.subType=o.sub||null}else{var r=["Index","Name","Id"],a={name:1,dataIndex:1,dataType:1};c(t,function(t,o){for(var s=!1,l=0;l0&&h===o.length-u.length){var c=o.slice(0,h);"data"!==c&&(e.mainType=c,e[u.toLowerCase()]=t,s=!0)}}a.hasOwnProperty(o)&&(n[o]=t,s=!0),s||(i[o]=t)})}return{cptQuery:e,dataQuery:n,otherQuery:i}},t.prototype.filter=function(t,e){function n(t,e,n,i){return null==t[n]||e[i||n]===t[n]}var i=this.eventInfo;if(!i)return!0;var o=i.targetEl,r=i.packedEvent,a=i.model,s=i.view;if(!a||!s)return!0;var l=e.cptQuery,u=e.dataQuery;return n(l,a,"mainType")&&n(l,a,"subType")&&n(l,a,"index","componentIndex")&&n(l,a,"name")&&n(l,a,"id")&&n(u,r,"name")&&n(u,r,"dataIndex")&&n(u,r,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(t,e.otherQuery,o,r))},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),wS=["symbol","symbolSize","symbolRotate","symbolOffset"],bS=wS.concat(["symbolKeepAspect"]),SS={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData();if(t.legendIcon&&n.setVisual("legendIcon",t.legendIcon),t.hasSymbolVisual){for(var i={},o={},r=!1,s=0;s0&&t.unfinished);t.unfinished||this._zr.flush()}}},n.prototype.getDom=function(){return this._dom},n.prototype.getId=function(){return this.id},n.prototype.getZr=function(){return this._zr},n.prototype.isSSR=function(){return this._ssr},n.prototype.setOption=function(t,e,n){if(!this[dT])if(this._disposed);else{var i,o,r;if(b(e)&&(n=e.lazyUpdate,i=e.silent,o=e.replaceMerge,r=e.transition,e=e.notMerge),this[dT]=!0,sT(this),!this._model||e){var a=new kx(this._api),s=this._theme,l=this._model=new bx;l.scheduler=this._scheduler,l.ssr=this._ssr,l.init(null,null,null,s,this._locale,a)}this._model.setOption(t,{replaceMerge:o},kT);var u={seriesTransition:r,optionChanged:!0};if(n)this[fT]={silent:i,updateParams:u},this[dT]=!1,this.getZr().wakeUp();else{try{WS(this),US.update.call(this,null,u)}catch(t){throw this[fT]=null,this[dT]=!1,t}this._ssr||this._zr.flush(),this[fT]=null,this[dT]=!1,KS.call(this,i),$S.call(this,i)}}},n.prototype.setTheme=function(t,e){if(!this[dT])if(this._disposed);else{var n=this._model;if(n){var i=e&&e.silent,o=null;this[fT]&&(null==i&&(i=this[fT].silent),o=this[fT].updateParams,this[fT]=null),this[dT]=!0,sT(this);try{this._updateTheme(t),n.setTheme(this._theme),WS(this),US.update.call(this,{type:"setTheme"},o)}catch(t){throw this[dT]=!1,t}this[dT]=!1,KS.call(this,i),$S.call(this,i)}}},n.prototype._updateTheme=function(t){_(t)&&(t=LT[t]),t&&((t=o(t))&&_r(t,!0),this._theme=t)},n.prototype.getModel=function(){return this._model},n.prototype.getOption=function(){return this._model&&this._model.getOption()},n.prototype.getWidth=function(){return this._zr.getWidth()},n.prototype.getHeight=function(){return this._zr.getHeight()},n.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||Qp.hasGlobalWindow&&window.devicePixelRatio||1},n.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},n.prototype.renderToCanvas=function(t){return this._zr.painter.getRenderedCanvas({backgroundColor:(t=t||{}).backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},n.prototype.renderToSVGString=function(t){return this._zr.painter.renderToString({useViewBox:(t=t||{}).useViewBox})},n.prototype.getSvgDataURL=function(){var t=this._zr;return c(t.storage.getDisplayList(),function(t){t.stopAnimation(null,!0)}),t.painter.toDataURL()},n.prototype.getDataURL=function(t){if(!this._disposed){var e=this._model,n=[],i=this;c((t=t||{}).excludeComponents,function(t){e.eachComponent({mainType:t},function(t){var e=i._componentsMap[t.__viewId];e.group.ignore||(n.push(e),e.group.ignore=!0)})});var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return c(n,function(t){t.group.ignore=!1}),o}},n.prototype.getConnectedDataURL=function(t){if(!this._disposed){var e="svg"===t.type,n=this.group,i=Math.min,r=Math.max,a=1/0;if(AT[n]){var s=a,l=a,u=-1/0,h=-1/0,d=[],p=t&&t.pixelRatio||this.getDevicePixelRatio();c(DT,function(a,c){if(a.group===n){var p=e?a.getZr().painter.getSvgDom().innerHTML:a.renderToCanvas(o(t)),f=a.getDom().getBoundingClientRect();s=i(f.left,s),l=i(f.top,l),u=r(f.right,u),h=r(f.bottom,h),d.push({dom:p,left:f.left,top:f.top})}});var f=(u*=p)-(s*=p),g=(h*=p)-(l*=p),m=af.createCanvas(),y=en(m,{renderer:e?"svg":"canvas"});if(y.resize({width:f,height:g}),e){var v="";return c(d,function(t){v+=''+t.dom+""}),y.painter.getSvgRoot().innerHTML=v,t.connectedBackgroundColor&&y.painter.setBackgroundColor(t.connectedBackgroundColor),y.refreshImmediately(),y.painter.toDataURL()}return t.connectedBackgroundColor&&y.add(new mv({shape:{x:0,y:0,width:f,height:g},style:{fill:t.connectedBackgroundColor}})),c(d,function(t){var e=new cv({style:{x:t.left*p-s,y:t.top*p-l,image:t.dom}});y.add(e)}),y.refreshImmediately(),m.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}},n.prototype.convertToPixel=function(t,e,n){return YS(this,"convertToPixel",t,e,n)},n.prototype.convertToLayout=function(t,e,n){return YS(this,"convertToLayout",t,e,n)},n.prototype.convertFromPixel=function(t,e,n){return YS(this,"convertFromPixel",t,e,n)},n.prototype.containPixel=function(t,e){var n;if(!this._disposed)return c(Pn(this._model,t),function(t,i){i.indexOf("Models")>=0&&c(t,function(t){var o=t.coordinateSystem;if(o&&o.containPoint)n=n||!!o.containPoint(e);else if("seriesModels"===i){var r=this._chartsMap[t.__viewId];r&&r.containPoint&&(n=n||r.containPoint(e,t))}},this)},this),!!n},n.prototype.getVisual=function(t,e){var n=Pn(this._model,t,{defaultMainType:"series"}),i=n.seriesModel.getData(),o=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?i.indexOfRawIndex(n.dataIndex):null;return null!=o?function(t,e,n){switch(n){case"color":return t.getItemVisual(e,"style")[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,n)}}(i,o,e):function(t,e){switch(e){case"color":return t.getVisual("style")[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e)}}(i,e)},n.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},n.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},n.prototype._initEvents=function(){var t=this;c(bT,function(e){var n=function(n){var i,o=t.getModel(),r=n.target;if("globalout"===e?i={}:r&&Os(r,function(t){var e=Mv(t);if(e&&null!=e.dataIndex){var n=e.dataModel||o.getSeriesByIndex(e.seriesIndex);return i=n&&n.getDataParams(e.dataIndex,e.dataType,r)||{},!0}if(e.eventData)return i=a({},e.eventData),!0},!0),i){var s=i.componentType,l=i.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=i.seriesIndex);var u=s&&null!=l&&o.getComponent(s,l),h=u&&t["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];i.event=n,i.type=e,t._$eventProcessor.eventInfo={targetEl:r,packedEvent:i,model:u,view:h},t.trigger(e,i)}};n.zrEventfulCallAtLast=!0,t._zr.on(e,n,t)});var e=this._messageCenter;c(MT,function(n,i){e.on(i,function(e){t.trigger(i,e)})}),function(t,e,n){t.on("selectchanged",function(t){var i=n.getModel();t.isFromClick?(As("map","selectchanged",e,i,t),As("pie","selectchanged",e,i,t)):"select"===t.fromAction?(As("map","selected",e,i,t),As("pie","selected",e,i,t)):"unselect"===t.fromAction&&(As("map","unselected",e,i,t),As("pie","unselected",e,i,t))})}(e,this,this._api)},n.prototype.isDisposed=function(){return this._disposed},n.prototype.clear=function(){this._disposed||this.setOption({series:[]},!0)},n.prototype.dispose=function(){if(this._disposed);else{this._disposed=!0,this.getDom()&&On(this.getDom(),zT,"");var t=this,e=t._api,n=t._model;c(t._componentsViews,function(t){t.dispose(n,e)}),c(t._chartsViews,function(t){t.dispose(n,e)}),t._zr.dispose(),t._dom=t._model=t._chartsMap=t._componentsMap=t._chartsViews=t._componentsViews=t._scheduler=t._api=t._zr=t._throttledZrFlush=t._theme=t._coordSysMgr=t._messageCenter=null,delete DT[t.id]}},n.prototype.resize=function(t){if(!this[dT])if(this._disposed);else{this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var n=e.resetOption("media"),i=t&&t.silent;this[fT]&&(null==i&&(i=this[fT].silent),n=!0,this[fT]=null),this[dT]=!0,sT(this);try{n&&WS(this),US.update.call(this,{type:"resize",animation:a({duration:0},t&&t.animation)})}catch(t){throw this[dT]=!1,t}this[dT]=!1,KS.call(this,i),$S.call(this,i)}}},n.prototype.showLoading=function(t,e){if(this._disposed);else if(b(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),PT[t]){var n=PT[t](this._api,e),i=this._zr;this._loadingFX=n,i.add(n)}},n.prototype.hideLoading=function(){this._disposed||(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},n.prototype.makeActionFromEvent=function(t){var e=a({},t);return e.type=TT[t.type],e},n.prototype.dispatchAction=function(t,e){if(this._disposed);else if(b(e)||(e={silent:!!e}),ST[t.type]&&this._model)if(this[dT])this._pendingActions.push(t);else{var n=e.silent;qS.call(this,t,n);var i=e.flush;i?this._zr.flush():!1!==i&&Qp.browser.weChat&&this._throttledZrFlush(),KS.call(this,n),$S.call(this,n)}},n.prototype.updateLabelLayout=function(){HS.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},n.prototype.appendData=function(t){if(this._disposed);else{var e=t.seriesIndex;this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},n.internalField=function(){function t(t){t.clearColorPalette(),t.eachSeries(function(t){t.clearColorPalette()})}function n(t){for(var e=[],n=t.currentStates,i=0;i0?{duration:r,delay:i.get("delay"),easing:i.get("easing")}:null;e.eachRendered(function(t){if(t.states&&t.states.emphasis){if(Pa(t))return;if(t instanceof ov&&function(t){var e=Iv(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var n=t.states.select||{};e.selectFill=n.style&&n.style.fill||null,e.selectStroke=n.style&&n.style.stroke||null}(t),t.__dirty){var e=t.prevStates;e&&t.useStates(e)}if(o){t.stateTransition=a;var i=t.getTextContent(),r=t.getTextGuideLine();i&&(i.stateTransition=a),r&&(r.stateTransition=a)}t.__dirty&&n(t)}})}WS=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),jS(t,!0),jS(t,!1),e.plan()},jS=function(t,e){function n(t){var n=t.__requireNewView;t.__requireNewView=!1;var u="_ec_"+t.id+"_"+t.type,h=!n&&a[u];if(!h){var c=zn(t.type);(h=new(e?ww.getClass(c.main,c.sub):Kb.getClass(c.sub))).init(i,l),a[u]=h,r.push(h),s.add(h.group)}t.__viewId=h.__id=u,h.__alive=!0,h.__model=t,h.group.__ecComponentInfo={mainType:t.mainType,index:t.componentIndex},!e&&o.prepareView(h,t,i,l)}for(var i=t._model,o=t._scheduler,r=e?t._componentsViews:t._chartsViews,a=e?t._componentsMap:t._chartsMap,s=t._zr,l=t._api,u=0;ue.get("hoverLayerThreshold")&&!Qp.node&&!Qp.worker&&e.eachSeries(function(e){if(!e.preventUsingHoverLayer){var n=t._chartsMap[e.__viewId];n.__alive&&n.eachRendered(function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)})}})}(t,e),HS.trigger("series:afterupdate",e,n,l)},rT=function(t){t[gT]=!0,t.getZr().wakeUp()},sT=function(t){t[pT]=(t[pT]+1)%1e3},aT=function(t){t[gT]&&(t.getZr().storage.traverse(function(t){Pa(t)||n(t)}),t[gT]=!1)},iT=function(t){return new(function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return e(i,n),i.prototype.getCoordinateSystems=function(){return t._coordSysMgr.getCoordinateSystems()},i.prototype.getComponentByElement=function(e){for(;e;){var n=e.__ecComponentInfo;if(null!=n)return t._model.getComponent(n.mainType,n.index);e=e.parent}},i.prototype.enterEmphasis=function(e,n){ji(e,n),rT(t)},i.prototype.leaveEmphasis=function(e,n){Gi(e,n),rT(t)},i.prototype.enterBlur=function(e){!function(t){Fi(t,zi)}(e),rT(t)},i.prototype.leaveBlur=function(e){Ui(e),rT(t)},i.prototype.enterSelect=function(e){Yi(e),rT(t)},i.prototype.leaveSelect=function(e){Xi(e),rT(t)},i.prototype.getModel=function(){return t.getModel()},i.prototype.getViewOfComponentModel=function(e){return t.getViewOfComponentModel(e)},i.prototype.getViewOfSeriesModel=function(e){return t.getViewOfSeriesModel(e)},i.prototype.getMainProcessVersion=function(){return t[pT]},i}(Tx))(t)},oT=function(t){function e(t,e){for(var n=0;n0?t[n-1].seriesModel:null)}),function(t){c(t,function(e,n){var i=[],o=[NaN,NaN],r=[e.stackResultDimension,e.stackedOverDimension],a=e.data,s=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";a.modify(r,function(r,u,h){var c,d,p=a.get(e.stackedDimension,h);if(isNaN(p))return o;s?d=a.getRawIndex(h):c=a.get(e.stackedByDimension,h);for(var f=NaN,g=n-1;g>=0;g--){var m=t[g];if(s||(d=m.data.rawIndexOf(m.stackedByDimension,c)),d>=0){var y=m.data.getByRawIndex(m.stackResultDimension,d);if("all"===l||"positive"===l&&y>0||"negative"===l&&y<0||"samesign"===l&&p>=0&&y>0||"samesign"===l&&p<=0&&y<0){p=ln(p,y),f=y;break}}}return i[0]=p,i[1]=f,i})})}(t))})}),vl("default",function(t,e){s(e=e||{},{text:"loading",textColor:X_.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:X_.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Em,i=new mv({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});n.add(i);var o,r=new Tv({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new mv({style:{fill:"none"},textContent:r,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});return n.add(a),e.showSpinner&&((o=new vb({shape:{startAngle:-lS/2,endAngle:-lS/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*lS/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:3*lS/2}).delay(300).start("circularInOut"),n.add(o)),n.resize=function(){var n=r.getBoundingRect().width,s=e.showSpinner?e.spinnerRadius:0,l=(t.getWidth()-2*s-(e.showSpinner&&n?10:0)-n)/2-(e.showSpinner&&n?0:5+n/2)+(e.showSpinner?0:n/2)+(n?0:s),u=t.getHeight()/2;e.showSpinner&&o.setShape({cx:l,cy:u}),a.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),i.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},n.resize(),n}),fl({type:Av,event:Av,update:Av},H),fl({type:Ov,event:Ov,update:Ov},H),fl({type:zv,event:Bv,update:zv,action:H,refineEvent:_l,publishNonRefinedEvent:!0}),fl({type:Ev,event:Bv,update:Ev,action:H,refineEvent:_l,publishNonRefinedEvent:!0}),fl({type:Rv,event:Bv,update:Rv,action:H,refineEvent:_l,publishNonRefinedEvent:!0}),hl("default",{}),hl("dark",_S);const BT={...{metadata:!0,svgRender:!1,switchMode:!1,maxPointsFetched:1e4,loadMoreAtZoomLevel:9,clustering:!1,clusteringThreshold:100,disableClusteringAtLevel:8,clusterRadius:80,clusterSeparation:20,showMetaOnNarrowScreens:!1,showMapLabelsAtZoom:13,showGraphLabelsAtZoom:null,echartsOption:{aria:{show:!0,description:"This is a force-oriented graph chart that depicts the relationship between ip nodes."},toolbox:{show:!0,iconStyle:{borderColor:"#fff"},feature:{restore:{show:!0,title:"Restore view"},saveAsImage:{show:!0,title:"Save image"}}}},graphConfig:{series:{layout:"force",label:{show:!0,color:"#fff",position:"top"},labelLayout:{hideOverlap:!0},force:{gravity:.1,edgeLength:[20,60],repulsion:120},roam:!0,draggable:!0,legendHoverLink:!0,emphasis:{focus:"none",lineStyle:{color:"#3acc38",opacity:1}},nodeStyle:{color:"#ffebc4"},linkStyle:{width:6,color:"#1ba619"},nodeSize:"15"},baseOptions:{backgroundColor:"#282222",media:[{query:{minWidth:320,maxWidth:500},option:{series:[{zoom:.7}],toolbox:{itemSize:18}}},{query:{minWidth:501},option:{series:[{zoom:1}],toolbox:{itemSize:15}}},{query:{minWidth:320,maxWidth:850},option:{tooltip:{show:!1}}},{query:{minWidth:851},option:{tooltip:{show:!0}}}]}},mapOptions:{roam:!0,zoomAnimation:!1,worldCopyJump:!0,minZoom:3,maxZoom:18,nodeConfig:{type:"scatter",label:{show:!1,color:"#000000",position:"top",formatter:"{b}",fontSize:13,backgroundColor:"rgba(255, 255, 255, 0.8)",padding:[6,8],borderRadius:5},emphasis:{scale:1},nodeStyle:{color:"#1566a9"},nodeSize:"17"},linkConfig:{linkStyle:{width:5,color:"#1ba619"},emphasis:{focus:"none",lineStyle:{color:"#3acc38",opacity:1}}},clusterConfig:{symbolSize:30,itemStyle:{color:"#1566a9"},tooltip:{show:!1},label:{show:!0,position:"inside",color:"#fff",offset:[0,0],backgroundColor:"transparent"}},baseOptions:{toolbox:{show:!1},media:[{query:{minWidth:320,maxWidth:850},option:{tooltip:{show:!1}}},{query:{minWidth:851},option:{tooltip:{show:!0}}}]},nodePopup:{show:!1,content:null,config:{autoPan:!0,autoPanPadding:[25,25],offset:null}}},mapTileConfig:[{urlTemplate:"MISSING_ENV_VAR".MAPBOX_URL_TEMPLATE||"http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",options:{attribution:'© OpenStreetMap contributors,\n tiles offered by Mapbox'}}],geoOptions:{style:{fillColor:"#1566a9",weight:0,fillOpacity:.8,radius:8}},nodeCategories:[{name:"ok",nodeStyle:{color:"#1ba619"}},{name:"problem",nodeStyle:{color:"#ffa500"}},{name:"critical",nodeStyle:{color:"#c92517"}}],linkCategories:[],bookmarkableActions:{enabled:!1,id:null,zoomOnRestore:!0,zoomLevel:null},prepareData(t){t&&t.nodes&&t.nodes.forEach(t=>{if(t.properties&&t.properties.status){const e=t.properties.status.toLowerCase();"ok"!==e&&"problem"!==e&&"critical"!==e||(t.category=e)}})},onClickElement(t,e){let n;this.utils&&this.utils.isNetJSON(this.data)?(n="node"===t?this.utils.nodeInfo(e):"link"===t?this.utils.linkInfo(e):e,(this.config.showMetaOnNarrowScreens||this.el.clientWidth>850)&&(this.gui.metaInfoContainer.style.display="flex")):({nodeLinkData:n}={nodeLinkData:e}),this.gui.getNodeLinkInfo(t,n),this.gui.sideBar.classList.remove("hidden")},onReady(){}}};Object.defineProperty(BT,"crs",{get(){const t=xl(!0);return t?t.CRS.EPSG3857:null},enumerable:!0,configurable:!0});const NT=BT,FT=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class VT{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,n]=new Uint8Array(t,0,2);if(219!==e)throw new Error("Data does not appear to be in a KDBush format.");const i=n>>4;if(1!==i)throw new Error(`Got v${i} data when expected v1.`);const o=FT[15&n];if(!o)throw new Error("Unrecognized array type.");const[r]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new VT(a,r,o,t)}constructor(t,e=64,n=Float64Array,i){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=n,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const o=FT.indexOf(this.ArrayType),r=2*t*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-a%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${n}.`);i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+a+s,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+r+a+s),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+a+s,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+o]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=t,this.coords[this._pos++]=e,n}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return wl(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:r,nodeSize:a}=this,s=[0,o.length-1,0],l=[];for(;s.length;){const u=s.pop()||0,h=s.pop()||0,c=s.pop()||0;if(h-c<=a){for(let a=c;a<=h;a++){const s=r[2*a],u=r[2*a+1];s>=t&&s<=n&&u>=e&&u<=i&&l.push(o[a])}continue}const d=c+h>>1,p=r[2*d],f=r[2*d+1];p>=t&&p<=n&&f>=e&&f<=i&&l.push(o[d]),(0===u?t<=p:e<=f)&&(s.push(c),s.push(d-1),s.push(1-u)),(0===u?n>=p:i>=f)&&(s.push(d+1),s.push(h),s.push(1-u))}return l}within(t,e,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:r}=this,a=[0,i.length-1,0],s=[],l=n*n;for(;a.length;){const u=a.pop()||0,h=a.pop()||0,c=a.pop()||0;if(h-c<=r){for(let n=c;n<=h;n++)Ml(o[2*n],o[2*n+1],t,e)<=l&&s.push(i[n]);continue}const d=c+h>>1,p=o[2*d],f=o[2*d+1];Ml(p,f,t,e)<=l&&s.push(i[d]),(0===u?t-n<=p:e-n<=f)&&(a.push(c),a.push(d-1),a.push(1-u)),(0===u?t+n>=p:e+n>=f)&&(a.push(d+1),a.push(h),a.push(1-u))}return s}}const ZT=class{JSONParamParse(t){return"string"==typeof t?fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},credentials:"include"}).then(t=>t).catch(t=>{console.error(t)}):Promise.resolve(t)}async paginatedDataParse(t){let e,n;try{let i=await this.utils.JSONParamParse(t);if(i.json)for(e=await i.json(),n=e.results?e.results:e;e.next&&n.nodes.length<=this.config.maxPointsFetched;)i=await this.utils.JSONParamParse(e.next),e=await i.json(),n.nodes=n.nodes.concat(e.results.nodes),n.links=n.links.concat(e.results.links),this.hasMoreData=!!e.next;else n=i}catch(t){console.error(t)}return n}async getBBoxData(t,e){let n;try{const i=`${t=t[0].split("?")[0]}bbox?swLat=${e._southWest.lat}&swLng=${e._southWest.lng}&neLat=${e._northEast.lat}&neLng=${e._northEast.lng}`,o=await this.utils.JSONParamParse(i);n=await o.json()}catch(t){console.error(t)}return n}dateParse({dateString:t,parseRegular:e=/^([1-9]\d{3})-(\d{1,2})-(\d{1,2})T(\d{1,2}):(\d{1,2}):(\d{1,2})(?:\.(\d{1,3}))?Z$/,hourDiffer:n=(new Date).getTimezoneOffset()/60}){const i=e.exec(t);if(!i||i.length<7)return console.error("Date doesn't meet the specifications."),"";const o=["dateYear","dateMonth","dateDay","dateHour"],r={},a=new Map([["dateMonth",12],["dateDay",[31,i[1]%4==0&&i[1]%100!=0||i[1]%400==0?29:28,31,30,31,30,31,31,30,31,30,31]],["dateHour",24]]);for(let t=o.length;t>0;t-=1)r[o[t-1]]=parseInt(i[t],10);let s,l=-n;for(let t=o.length;t>0;t-=1){if("dateYear"===o[t-1]){r[o[t-1]]+=l;break}s="dateDay"===o[t-1]?a.get("dateDay")[r.dateMonth-1]:a.get(o[t-1]);let e=r[o[t-1]]+l;l="dateHour"===o[t-1]?e<0?-1:e>=s?1:0:e<=0?-1:e>s?1:0,1===l?e-=s:l<0&&("dateDay"===o[t-1]&&(s=a.get("dateDay")[(r[o[t-1]]+10)%11]),e+=s),r[o[t-1]]=e}return`${r.dateYear}.${this.numberMinDigit(r.dateMonth)}.${this.numberMinDigit(r.dateDay)} ${this.numberMinDigit(r.dateHour)}:${this.numberMinDigit(i[5])}:${this.numberMinDigit(i[6])}${i[7]?`.${this.numberMinDigit(i[7],3)}`:""}`}numberMinDigit(t,e=2,n="0"){return(Array(e).join(n)+t).slice(-e)}isObject(t){return"Object"===Object.prototype.toString.call(t).slice(8,14)}isArray(t){return"Array"===Object.prototype.toString.call(t).slice(8,13)}isElement(t){return"object"==typeof HTMLElement?t instanceof HTMLElement:t&&"object"==typeof t&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName}isNetJSON(t){return!(!t.nodes||!t.links)&&this.isObject(t)&&this.isArray(t.nodes)&&this.isArray(t.links)}isGeoJSON(t){return t.type&&"FeatureCollection"===t.type?this.isObject(t)&&this.isArray(t.features):!(!t.type||"Feature"!==t.type)&&this.isObject(t)&&this.isArray(t.geometry)}geojsonToNetjson(t){return function(t){const e=[],n=[];if(!t||!Array.isArray(t.features))return{nodes:e,links:n};const i=new Map,o=(t,n={})=>{const o=`${t[0]},${t[1]}`;if(i.has(o))return i.get(o);const r=n.id||n.node_id||null,a=n.label||n.name||r||null,s=r?String(r):`gjn_${e.length}`,l=!r,u={id:s,...a?{label:String(a)}:{},location:{lng:t[0],lat:t[1]},properties:{...n,location:{lng:t[0],lat:t[1]}},_generatedIdentity:l};return e.push(u),i.set(o,s),s},r=(t,e,i={})=>{n.push({source:t,target:e,properties:i})},a=(t,e,n=!1)=>{for(let n=0;n2){const n=o(t[0],e),i=o(t[t.length-1],e);r(i,n,e)}},s=(t,e)=>{if(!t)return;const{type:n,coordinates:i,geometries:r}=t;switch(n){case"Point":o(i,{...e,_featureType:"Point"});break;case"MultiPoint":i.forEach(t=>o(t,{...e,_featureType:"Point"}));break;case"LineString":a(i,{...e,_featureType:"LineString"},!1);break;case"MultiLineString":i.forEach(t=>a(t,{...e,_featureType:"LineString"},!1));break;case"Polygon":case"MultiPolygon":break;case"GeometryCollection":r.forEach(t=>s(t,e));break;default:console.warn(`Unsupported GeoJSON geometry type: ${n}`)}};return t.features.forEach(t=>{const e={...t.properties||{},...null!=t.id?{id:t.id}:{}};s(t.geometry,e)}),{nodes:e,links:n}}(t)}deepCopy(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>this.deepCopy(t));const e={};return Object.keys(t).forEach(n=>{e[n]=this.deepCopy(t[n])}),e}fastDeepCopy(t){return"function"==typeof structuredClone?structuredClone(t):JSON.parse(JSON.stringify(t))}deepMergeObj(...t){const e=[...t].reverse(),n=e.length;for(let t=0;t{i[t]&&this.isObject(i[t])&&this.isObject(n[t])?this.deepMergeObj(i[t],n[t]):i[t]=n[t]}):i||(e[t+1]=n)}return e[n-1]}makeCluster(t){const{nodes:e,links:n}=t.data,i=t=>!(t.properties&&t.properties._featureType)||"Point"===t.properties._featureType,o=e.filter(i),r=e.filter(t=>!i(t)),a=[],s=[],l=new Map;r.forEach(t=>l.set(t.id,null));let u=0;o.forEach(e=>{const n=e.properties&&e.properties.location||e.location;if(!n||void 0===n.lat||void 0===n.lng)return;e.location=n,e._origLocation?(n.lat=e._origLocation.lat,n.lng=e._origLocation.lng):e._origLocation={lat:n.lat,lng:n.lng};const i=t.leaflet.latLngToContainerPoint([n.lat,n.lng]);e.x=i.x,e.y=i.y,e.visited=!1,e.cluster=null});const h=new VT(o.length);o.forEach(({x:t,y:e})=>h.add(t,e)),h.finish();const c=t.config&&t.config.mapOptions&&t.config.mapOptions.clusterConfig&&t.config.mapOptions.clusterConfig.symbolSize,d=t=>{if("function"==typeof c)try{return c(t)}catch(t){return 30}return Array.isArray(c)?c[0]||30:"number"==typeof c?c:30},p=new Map;o.forEach(e=>{if(e.visited)return;const n=h.within(e.x,e.y,t.config.clusterRadius).map(t=>o[t]);if(n.length>1){const i=`${Math.round(e.x)},${Math.round(e.y)}`;p.has(i)||p.set(i,new Map);const o=p.get(i);n.forEach(e=>{if(e.visited)return;const n=t.config.clusteringAttribute?e.properties[t.config.clusteringAttribute]:"default";o.has(n)||o.set(n,[]),o.get(n).push(e),e.visited=!0})}else e.visited=!0,l.set(e.id,null),r.push(e)}),p.forEach(e=>{const n=Array.from(e.entries()),i=n.length;let o=0;n.forEach(([,t])=>{const e=d(t.length);e>o&&(o=e)});const a="number"==typeof t.config.clusterSeparation?t.config.clusterSeparation:Math.max(10,Math.floor(t.config.clusterRadius/2));let h=0;if(i>1){const t=Math.PI/i,e=Math.sin(t);e>0&&(h=o/(2*e))}const c=Math.max(a,h+4);n.forEach(([,e],n)=>{if(e.length>1){let o=0,r=0;if(e.forEach(t=>{t.cluster=u,l.set(t.id,t.cluster),o+=t.location.lng,r+=t.location.lat}),o/=e.length,r/=e.length,i>1){const e=2*Math.PI*n/i,a=t.leaflet.latLngToContainerPoint([r,o]),s=[a.x+c*Math.cos(e),a.y+c*Math.sin(e)],l=t.leaflet.containerPointToLatLng(s);o=l.lng,r=l.lat}const a={id:u,cluster:!0,name:e.length,value:[o,r],childNodes:e,...t.config.mapOptions.clusterConfig};if(t.config.clusteringAttribute){const n=t.config.nodeCategories.find(n=>n.name===e[0].properties[t.config.clusteringAttribute]);n&&(a.itemStyle={...a.itemStyle,color:n.nodeStyle.color})}s.push(a),u+=1}else if(1===e.length){const t=e[0];l.set(t.id,null),r.push(t)}})}),n.forEach(t=>{null===l.get(t.source)&&null===l.get(t.target)&&a.push(t)});const f=[...s.map(t=>({ref:t,isCluster:!0,count:t.childNodes.length,get value(){return t.value},set value([e,n]){t.value=[e,n]}})),...r.filter(i).map(t=>({ref:t,isCluster:!1,count:1,get value(){return[t.location.lng,t.location.lat]},set value([e,n]){t.location.lng=e,t.location.lat=n}}))];if(f.length>1){const e=f.map(e=>{const[n,i]=e.value,o=t.leaflet.latLngToContainerPoint([i,n]);return{ref:e.ref,isCluster:e.isCluster,x:o.x,y:o.y,r:d(e.count)/2,setValue:([t,n])=>{e.value=[t,n]}}}),n=4,i=5;for(let t=0;t0&&s{const n=t.leaflet.containerPointToLatLng([e.x,e.y]);e.isCluster?e.ref.value=[n.lng,n.lat]:(e.ref.location.lng=n.lng,e.ref.location.lat=n.lat)})}return{clusters:s,nonClusterNodes:r,nonClusterLinks:a}}updateMetadata(){if(this.config.metadata){const t=this.utils.getMetadata(this.data),e=document.querySelector(".njg-metaData"),n=document.querySelectorAll(".njg-metaDataItems");for(let t=0;t{const i=document.createElement("div");i.classList.add("njg-metaDataItems");const o=document.createElement("span");o.setAttribute("class","njg-keyLabel");const r=document.createElement("span");r.setAttribute("class","njg-valueLabel"),o.innerHTML=n,r.innerHTML=t[n],i.appendChild(o),i.appendChild(r),e.appendChild(i)})}}getMetadata(t){const e=t,n={};return e.label&&(n.label=e.label),["protocol","version","revision","metric","router_id","topology_id"].forEach(t=>{e[t]&&(n[t]=e[t])}),n.nodes=e.nodes.length,n.links=e.links.length,n}nodeInfo(t){const e={};!t._generatedIdentity&&(e.id=t.id,t.label&&"string"==typeof t.label&&(e.label=t.label)),t.name&&(e.name=t.name),t.location&&(e.location=t.location);let n=null;Array.isArray(t.clients)?n=t.clients:t.properties&&Array.isArray(t.properties.clients)&&(n=t.properties.clients);let i=0;n?i=n.length:"number"==typeof t.clients?i=t.clients:t.properties&&"number"==typeof t.properties.clients&&(i=t.properties.clients),i>0&&(e.clients=i),n&&n.length&&n.forEach((t,n)=>{e[`clients [${n+1}]`]=t});const o=(t,e)=>"location"===t&&e&&"object"==typeof e?{lat:e.lat,lng:e.lng}:"time"===t&&"string"==typeof e?this.dateParse({dateString:e}):e,r=t._source&&this.isObject(t._source)?t._source:t;if(Object.keys(r).forEach(t=>{if("properties"===t||"clients"===t||"_source"===t||"_generatedIdentity"===t||"local_addresses"===t||"linkCount"===t)return;const n=o(t,r[t]);null!=n&&""!==n&&(e[t]=n)}),r.properties&&this.isObject(r.properties)&&Object.keys(r.properties).forEach(t=>{if("clients"===t)return;const n=o(t,r.properties[t]);null==n||"string"==typeof n&&""===n.trim()||(e[t]=n)}),t.linkCount&&(e.links=t.linkCount),Array.isArray(r.local_addresses)){const t=r.local_addresses.map(t=>"string"==typeof t?t:t&&"string"==typeof t.address?t.address:null).filter(t=>t);t.length&&(e.localAddresses=t)}return t.local_addresses&&(e.localAddresses=t.local_addresses),e}createTooltipItem(t,e){const n=document.createElement("div");n.classList.add("njg-tooltip-item");const i=document.createElement("span");i.setAttribute("class","njg-tooltip-key");const o=document.createElement("span");return o.setAttribute("class","njg-tooltip-value"),i.innerHTML=t,o.innerHTML=e,n.appendChild(i),n.appendChild(o),n}getNodeTooltipInfo(t){const e=document.createElement("div");e.classList.add("njg-tooltip-inner");const n=!t._generatedIdentity;return n&&t.id&&e.appendChild(this.createTooltipItem("id",t.id)),n&&t.label&&"string"==typeof t.label&&e.appendChild(this.createTooltipItem("label",t.label)),t.properties&&Object.keys(t.properties).forEach(i=>{if("object"!=typeof t.properties[i]&&!i.startsWith("_")&&("id"!==i&&"label"!==i||!n))if("location"===i)e.appendChild(this.createTooltipItem("location",`${Math.round(1e3*t.properties.location.lat)/1e3}, ${Math.round(1e3*t.properties.location.lng)/1e3}`));else if("time"===i){const n=this.dateParse({dateString:t.properties[i]});e.appendChild(this.createTooltipItem("time",n))}else e.appendChild(this.createTooltipItem(`${i.replace(/_/g," ")}`,t.properties[i]))}),t.linkCount&&e.appendChild(this.createTooltipItem("Links",t.linkCount)),t.local_addresses&&e.appendChild(this.createTooltipItem("Local Addresses",t.local_addresses.join("
"))),e}getLinkTooltipInfo(t){const e=document.createElement("div");e.classList.add("njg-tooltip-inner");const n=t=>"string"==typeof t&&t.startsWith("gjn_");return n(t.source)||e.appendChild(this.createTooltipItem("source",t.source)),n(t.target)||e.appendChild(this.createTooltipItem("target",t.target)),null!=t.cost&&e.appendChild(this.createTooltipItem("cost",t.cost)),t.properties&&Object.keys(t.properties).forEach(n=>{const i=t.properties[n];if(null!=i)if("time"===n){const t=this.dateParse({dateString:i});e.appendChild(this.createTooltipItem("time",t))}else{const t="string"==typeof i?i.replace(/\n/g,"
"):i;e.appendChild(this.createTooltipItem(`${n.replace(/_/g," ")}`,t))}}),e}linkInfo(t){const e={},n=t=>"string"==typeof t&&t.startsWith("gjn_");return n(t.source)||(e.source=t.source),n(t.target)||(e.target=t.target),null!=t.cost&&(e.cost=t.cost),t.properties&&Object.keys(t.properties).forEach(n=>{const i=t.properties[n];if(null!=i)if("time"===n){const t=this.dateParse({dateString:i});e[n]=t}else{const t="string"==typeof i?i.replace(/\n/g,"
"):i;e[n.replace(/_/g," ")]=t}}),e}generateStyle(t,e){return"function"==typeof t?t(e):t}getNodeStyle(t,e,n){let i,o={},r={},a=!1;if(t.category&&e.nodeCategories&&e.nodeCategories.length){const n=e.nodeCategories.find(e=>e.name===t.category);if(n){a=!0,i=this.generateStyle(n.nodeStyle||{},t),o=this.generateStyle(n.nodeSize||{},t);let e={},s={};n.emphasis&&(e=this.generateStyle(n.emphasis.nodeStyle||{},t),s=this.generateStyle(n.emphasis.nodeSize||{},t),r={nodeStyle:e,nodeSize:s})}}if(!a)if("map"===n){const n=e.mapOptions&&e.mapOptions.nodeConfig;i=this.generateStyle(n&&n.nodeStyle||{},t),o=this.generateStyle(n&&n.nodeSize||{},t);const a=n&&n.emphasis;a&&(r={nodeStyle:this.generateStyle(a&&a.nodeStyle||{},t),nodeSize:this.generateStyle(a&&a.nodeSize||{},t)})}else{const n=e.graphConfig&&e.graphConfig.series;i=this.generateStyle(n&&n.nodeStyle||{},t),o=this.generateStyle(n&&n.nodeSize||{},t);const a=n&&n.emphasis;a&&(r={nodeStyle:this.generateStyle(a&&a.itemStyle||{},t),nodeSize:this.generateStyle(a&&a.symbolSize||o||{},t)})}return{nodeStyleConfig:i,nodeSizeConfig:o,nodeEmphasisConfig:r}}getLinkStyle(t,e,n){let i,o={};if(t.category&&e.linkCategories.length){const n=e.linkCategories.find(e=>e.name===t.category);i=this.generateStyle(n.linkStyle||{},t),o={...o,linkStyle:n.emphasis?this.generateStyle(n.emphasis.linkStyle||{},t):{}}}else i=this.generateStyle("map"===n?e.mapOptions.linkConfig.linkStyle:e.graphConfig.series.linkStyle,t);return{linkStyleConfig:i,linkEmphasisConfig:o}}showLoading(){let t=this.el.querySelector(".njg-loadingContainer");return t?t.style.visibility="visible":(t=document.createElement("div"),t.classList.add("njg-loadingContainer"),t.innerHTML='\n
\n
\n

Loading...

\n
\n ',this.el.appendChild(t)),t}hideLoading(){const t=this.el.querySelector(".njg-loadingContainer");return t&&(t.style.visibility="hidden"),t}createEvent(){const t=new Map,e=new Map;return{on(e,...n){t.set(e,[...t.get(e)||[],...n])},once(t,...n){e.set(t,[...e.get(t)||[],...n])},emit(n){const i=t.get(n)||[],o=e.get(n)||[],r=i.map(t=>t()),a=o.map(t=>t());return e.delete(n),[...r,...a]},delete(n){t.delete(n),e.delete(n)}}}parseUrlFragments(){let t;try{t=decodeURIComponent(window.location.hash.replace(/^#/,""))}catch(e){t=window.location.hash.replace(/^#/,"")}const e={};return t.split(";").forEach(t=>{const n=new URLSearchParams(t),i=n.get("id");null!=i&&(e[i]=n)}),e}updateUrlFragments(t,e){const n=Object.values(t).map(t=>t.toString()).join(";").replace(/([^&=]+)=([^&;]*)/g,(t,e,n)=>`${e}=${encodeURIComponent(n.replace(/%7E/gi,"~"))}`);window.history.pushState(e,"",`#${n}`)}addActionToUrl(t,e){if(!t.config.bookmarkableActions.enabled||!e.data||e.data.cluster)return;if(!t.nodeLinkIndex)return void console.error("Lookup object for node or link not found.");const n=this.parseUrlFragments(),{id:i}=t.config.bookmarkableActions;let o;if(t.config.render===t.utils.graphRender){if("node"===e.dataType)o=e.data.id;else if("edge"===e.dataType){const{source:t,target:n}=e.data;o=`${t}~${n}`}}else if(t.config.render===t.utils.mapRender)if("scatter"===e.seriesType)o=e.data.node.id;else if("lines"===e.seriesType){const{source:t,target:n}=e.data.link;o=`${t}~${n}`}o&&t.nodeLinkIndex[o]?(n[i]||(n[i]=new URLSearchParams,n[i].set("id",i)),n[i].set("nodeId",o),this.updateUrlFragments(n,t.nodeLinkIndex[o])):console.error("nodeId not found in nodeLinkIndex lookup.")}removeUrlFragment(t,e=null){const n=this.parseUrlFragments();n[t]&&(e?n[t].delete(e):delete n[t],this.updateUrlFragments(n,{id:t}))}applyUrlFragmentState(t){if(!t.config.bookmarkableActions.enabled)return;const{id:e}=t.config.bookmarkableActions,n=t.utils.parseUrlFragments(),i=n[e]&&n[e].get?n[e]:null,o=i&&i.get?i.get("nodeId"):void 0;if(!o||!t.nodeLinkIndex||null==t.nodeLinkIndex[o])return;const[r,a]=o.split("~"),s=t.nodeLinkIndex[o],l=t.config.graphConfig&&t.config.graphConfig.series&&t.config.graphConfig.series.type||t.config.mapOptions&&t.config.mapOptions.nodeConfig&&t.config.mapOptions.nodeConfig.type,{location:u,cluster:h}=s||{};t.config.bookmarkableActions.zoomOnRestore&&["scatter","effectScatter"].includes(l)&&null==a&&null!=u&&t.leaflet&&t.leaflet.setView([u.lat,u.lng],null!=h?t.config.disableClusteringAtLevel:t.config.bookmarkableActions.zoomLevel||t.config.showMapLabelsAtZoom),null==a&&t.config.mapOptions?.nodePopup?.show&&t.gui.loadNodePopup(s),"function"==typeof t.config.onClickElement&&t.config.onClickElement.call(t,r&&a?"link":"node",s)}setupHashChangeHandler(t){return t._popstateHandler&&window.removeEventListener("popstate",t._popstateHandler),t._popstateHandler=()=>{this.applyUrlFragmentState(t)},window.addEventListener("popstate",t._popstateHandler),()=>{window.removeEventListener("popstate",t._popstateHandler),t._popstateHandler=null}}moveNodeInRealTime(t,e){if(!this.echarts||"function"!=typeof this.echarts.getOption)return void console.warn("moveNodeInRealTime: ECharts instance not ready");const n=this.echarts.getOption();if(!n||!Array.isArray(n.series))return void console.warn("moveNodeInRealTime: No series data available");const i=n.series.find(t=>"scatter"===t.type||"effectScatter"===t.type);if(!i)return void console.warn("moveNodeInRealTime: No scatter series found");const o=i.data.findIndex(e=>e.node.id===t);if(-1===o)return void console.warn(`moveNodeInRealTime: Node with id "${t}" not found`);const r=i.data[o],{node:a}=r;a.location=e,a.properties?(a.properties.location=e,r.value=[e.lng,e.lat],this.nodeLinkIndex[t].location=e,this.nodeLinkIndex[t].properties&&(this.nodeLinkIndex[t].properties.location=e,this.echarts.setOption({series:n.series}))):console.warn("moveNodeInRealTime: Node properties not found")}updateLabelVisibility(t,e){if(!t.echarts||"function"!=typeof t.echarts.setOption)return void console.warn("updateLabelVisibility: ECharts instance not ready");const n=e&&!1!==t.config.showMapLabelsAtZoom&&t.leaflet.getZoom()>=t.config.showMapLabelsAtZoom;t.echarts.setOption({series:[{id:"geo-map",label:{show:n,silent:!0},emphasis:{label:{show:!1}}}]})}},HT=class extends ZT{searchElements(t){const e=this,n={"":{data:{...e.data},param:[...e.JSONParam]}};return window.history.pushState({searchValue:""},""),window.onpopstate=i=>{n[i.state.searchValue]?e.utils.JSONDataUpdate.call(e,n[i.state.searchValue].data).then(()=>{e.JSONParam=n[i.state.searchValue].param}):e.utils.JSONDataUpdate.call(e,t+i.state.searchValue)},function(i,o=!0,r=!0){const a=i.trim();if(!window.history.state||window.history.state&&window.history.state.searchValue!==a)return window.history.pushState({searchValue:a},""),e.utils.JSONDataUpdate.call(e,t+a,o,r).then(()=>{n[a]={data:{...e.data},param:[...e.JSONParam]}})}}JSONDataUpdate(t,e=!0,n=!0){const i=this;return i.config.onUpdate.call(i),i.utils.paginatedDataParse.call(i,t).then(o=>{function r(){e?(i.JSONParam=[t],i.utils.overrideData(o,i)):(i.JSONParam.push(t),i.config.render===i.utils.mapRender?i.utils.appendData(o,i):i.utils.addData(o,i)),i.utils.isNetJSON(i.data)&&i.utils.updateMetadata.call(i)}return n?(i.utils.isNetJSON(i.data)&&i.config.prepareData.call(i,o),i.config.dealDataByWorker?i.utils.dealDataByWorker.call(i,o,i.config.dealDataByWorker,r):r()):r(),o}).catch(t=>{console.error(t)})}dealDataByWorker(t,e,n){const i=new Worker(e),o=this;i.postMessage(t),i.addEventListener("error",t=>{console.error(t),console.error("Error in dealing JSONData!")}),i.addEventListener("message",t=>{n?n():(o.utils.overrideData(t.data,o),o.utils.isNetJSON(o.data)&&o.utils.updateMetadata.call(o))})}overrideData(t,e){e.data=t,e.utils.isNetJSON(e.data)||e.leaflet.geoJSON.removeFrom(e.leaflet),e.utils.render(),e.config.afterUpdate.call(e)}},WT=class{constructor(t){this.utils=new HT,this.config=this.utils.deepCopy(NT),this.config.crs=NT.crs,this.JSONParam=this.utils.isArray(t)?t:[t]}setConfig(t){if(this.utils.deepMergeObj(this.config,t),this.el)t&&t.el&&console.error("Can't change el again!");else if(this.el=this.config.el?this.utils.isElement(this.config.el)?this.config.el:document.querySelector(this.config.el):document.body,this.el){if(this.el.classList.add("njg-container"),this.el===document.body){const t=document.documentElement;t.style.width="100%",t.style.height="100%",this.el.classList.add("njg-relativePosition")}}else console.error("NetJSONGraph: The specified element for rendering was not found and could not be set.");return this.config}render(){const[t,...e]=this.JSONParam;this.config.onRender.call(this);const n=new Promise(t=>{this.event.once("onReady",async()=>{try{await this.config.onReady.call(this)}catch(t){console.error("onReady callback failed:",t)}t()})});if(this.event.once("onLoad",this.config.onLoad.bind(this)),this.event.once("applyUrlFragmentState",async()=>{await n,this.utils.applyUrlFragmentState.call(this,this)}),this.utils.paginatedDataParse.call(this,t).then(t=>{if(this.utils.isNetJSON(t))this.type="netjson";else{if(!this.utils.isGeoJSON(t))throw new Error("Invalid data format!");this.type="geojson",this.originalGeoJSON=this.utils.fastDeepCopy(t),t=this.utils.geojsonToNetjson(t)}if(this.utils.isNetJSON(t)){t.nodes.length>this.config.maxPointsFetched&&(this.hasMoreData=!0),t.nodes.splice(this.config.maxPointsFetched-1,t.nodes.length-this.config.maxPointsFetched);const e=new Set;this.nodeLinkIndex={},t.nodes.forEach(t=>{e.add(t.id),this.nodeLinkIndex[t.id]=t}),t.links=t.links.filter(t=>e.has(t.source)&&e.has(t.target)?(this.nodeLinkIndex[`${t.source}~${t.target}`]=t,!0):(e.has(t.source)?console.warn(`Node ${t.target} does not exist!`):console.warn(`Node ${t.source} does not exist!`),!1))}this.config.prepareData.call(this,t),this.data=t,this.config.dealDataByWorker?this.utils.dealDataByWorker.call(this,t,this.config.dealDataByWorker):(this.data=t,this.utils.render())}).catch(t=>{console.error(t)}),e.length){const n=function(){e.map(t=>this.utils.JSONDataUpdate.call(this,t,!1))};this.JSONParam=[t],this.event.once("renderArray",n.bind(this))}}setUtils(t={}){const e=this;return e.utils=Object.assign(e.utils,{...t},{render(){if(!e.config.render)throw new Error("No render function!");e.config.render(e.data,e)}}),"function"==typeof e.utils.moveNodeInRealTime&&(e.utils.moveNodeInRealTime=e.utils.moveNodeInRealTime.bind(e)),e.utils}};var jT,GT={},UT=[],YT={registerPreprocessor:cl,registerProcessor:dl,registerPostInit:function(t){pl("afterinit",t)},registerPostUpdate:function(t){pl("afterupdate",t)},registerUpdateLifecycle:pl,registerAction:fl,registerCoordinateSystem:gl,registerLayout:function(t,e){yl(IT,t,e,1e3,"layout")},registerVisual:ml,registerTransform:function(t){var e=(t=o(t)).type;e||Ir("");var n=e.split(":");2!==n.length&&Ir("");var i=!1;"echarts"===n[0]&&(e=n[1],i=!0),t.__isBuiltIn=i,ow.set(e,t)},registerLoading:vl,registerMap:function(t,e,n){var i=lT.registerMap;i&&i(t,e,n)},registerImpl:function(t,e){lT[t]=e},PRIORITY:cT,ComponentModel:W_,ComponentView:ww,SeriesModel:_w,ChartView:Kb,registerComponentModel:function(t){W_.registerClass(t)},registerComponentView:function(t){ww.registerClass(t)},registerSeriesModel:function(t){_w.registerClass(t)},registerChartView:function(t){Kb.registerClass(t)},registerCustomSeries:function(t,e){!function(t,e){GT[t]=e}(t,e)},registerSubTypeDefaulter:function(t,e){W_.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){Bm[t]=e}},XT=cb.prototype,qT=gb.prototype,KT=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};e(function(){return null!==jT&&jT.apply(this,arguments)||this},jT=KT);const $T=function(t){function n(e){var n=t.call(this,e)||this;return n.type="ec-line",n}return e(n,t),n.prototype.getDefaultStyle=function(){return{stroke:X_.color.neutral99,fill:null}},n.prototype.getDefaultShape=function(){return new KT},n.prototype.buildPath=function(t,e){kl(e)?XT.buildPath.call(this,t,e):qT.buildPath.call(this,t,e)},n.prototype.pointAt=function(t){return kl(this.shape)?XT.pointAt.call(this,t):qT.pointAt.call(this,t)},n.prototype.tangentAt=function(t){var e=this.shape,n=kl(e)?[e.x2-e.x1,e.y2-e.y1]:qT.tangentAt.call(this,t);return Q(n,n)},n}(ov);var JT=["fromSymbol","toSymbol"],QT=function(t){function n(e,n,i){var o=t.call(this)||this;return o._createLine(e,n,i),o}return e(n,t),n.prototype._createLine=function(t,e,n){var i=t.hostModel,o=t.getItemLayout(e),r=t.getItemVisual(e,"z2"),a=function(t){var e=new $T({name:"line",subPixelOptimize:!0});return Dl(e.shape,t),e}(o);a.shape.percent=0,La(a,{z2:L(r,0),shape:{percent:1}},i,e),this.add(a),c(JT,function(n){var i=Pl(n,t,e);this.add(i),this[Il(n)]=Ll(n,t,e)},this),this._updateCommonStl(t,e,n)},n.prototype.updateData=function(t,e,n){var i=t.hostModel,o=this.childOfName("line"),r=t.getItemLayout(e),a={shape:{}};Dl(a.shape,r),Ia(o,a,i,e),c(JT,function(n){var i=Ll(n,t,e),o=Il(n);if(this[o]!==i){this.remove(this.childOfName(n));var r=Pl(n,t,e);this.add(r)}this[o]=i},this),this._updateCommonStl(t,e,n)},n.prototype.getLinePath=function(){return this.childAt(0)},n.prototype._updateCommonStl=function(t,e,n){var i=t.hostModel,o=this.childOfName("line"),r=n&&n.emphasisLineStyle,a=n&&n.blurLineStyle,s=n&&n.selectLineStyle,l=n&&n.labelStatesModels,u=n&&n.emphasisDisabled,h=n&&n.focus,d=n&&n.blurScope;if(!n||t.hasItemOption){var p=t.getItemModel(e),f=p.getModel("emphasis");r=f.getModel("lineStyle").getLineStyle(),a=p.getModel(["blur","lineStyle"]).getLineStyle(),s=p.getModel(["select","lineStyle"]).getLineStyle(),u=f.get("disabled"),h=f.get("focus"),d=f.get("blurScope"),l=ho(p)}var g=t.getItemVisual(e,"style"),m=g.stroke;o.useStyle(g),o.style.fill=null,o.style.strokeNoScale=!0,o.ensureState("emphasis").style=r,o.ensureState("blur").style=a,o.ensureState("select").style=s,c(JT,function(t){var e=this.childOfName(t);if(e){e.setColor(m),e.style.opacity=g.opacity;for(var n=0;n0&&(_[0]=-_[0],_[1]=-_[1]);var w=v[0]<0?-1:1;if("start"!==o.__position&&"end"!==o.__position){var b=-Math.atan2(v[1],v[0]);h[0].8?"left":c[0]<-.8?"right":"center",p=c[1]>.8?"top":c[1]<-.8?"bottom":"middle";break;case"start":o.x=-c[0]*g+u[0],o.y=-c[1]*m+u[1],d=c[0]>.8?"right":c[0]<-.8?"left":"center",p=c[1]>.8?"bottom":c[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":o.x=g*w+u[0],o.y=u[1]+S,d=v[0]<0?"right":"left",o.originX=-g*w,o.originY=-S;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":o.x=x[0],o.y=x[1]+S,d="center",o.originY=-S;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":o.x=-g*w+h[0],o.y=h[1]+S,d=v[0]>=0?"right":"left",o.originX=g*w,o.originY=-S}o.scaleX=o.scaleY=r,o.setStyle({verticalAlign:o.__verticalAlign||p,align:o.__align||d})}}}},n}(Em);const tM=QT,eM=function(){function t(t){this.group=new Em,this._LineCtor=t||tM}return t.prototype.updateData=function(t){var e=this;this._progressiveEls=null;var n=this,i=n.group,o=n._lineData;n._lineData=t,o||i.removeAll();var r=Al(t);t.diff(o).add(function(n){e._doAdd(t,n,r)}).update(function(n,i){e._doUpdate(o,t,i,n,r)}).remove(function(t){i.remove(o.getItemGraphicEl(t))}).execute()},t.prototype.updateLayout=function(){var t=this._lineData;t&&t.eachItemGraphicEl(function(e,n){e.updateLayout(t,n)},this)},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=Al(t),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e){function n(t){t.isGroup||function(t){return t.animators&&t.animators.length>0}(t)||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var i=t.start;i0&&(r=this._getLineLength(i)/l*1e3),r!==this._period||a!==this._loop||s!==this._roundTrip){i.stopAnimation();var h=void 0;h=v(u)?u(n):u,i.__t>0&&(h=-r*i.__t),this._animateSymbol(i,r,h,a,s)}this._period=r,this._loop=a,this._roundTrip=s}},n.prototype._animateSymbol=function(t,e,n,i,o){if(e>0){t.__t=0;var r=this,a=t.animate("",i).when(o?2*e:e,{__t:o?2:1}).delay(n).during(function(){r._updateSymbolPosition(t)});i||a.done(function(){r.remove(t)}),a.start()}},n.prototype._getLineLength=function(t){return Cf(t.__p1,t.__cp1)+Cf(t.__cp1,t.__p2)},n.prototype._updateAnimationPoints=function(t,e){t.__p1=e[0],t.__p2=e[1],t.__cp1=e[2]||[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]},n.prototype.updateData=function(t,e,n){this.childAt(0).updateData(t,e,n),this._updateEffectSymbol(t,e)},n.prototype._updateSymbolPosition=function(t){var e=t.__p1,n=t.__p2,i=t.__cp1,o=t.__t<1?t.__t:2-t.__t,r=[t.x,t.y],a=r.slice(),s=jt,l=Gt;r[0]=s(e[0],i[0],n[0],o),r[1]=s(e[1],i[1],n[1],o);var u=t.__t<1?l(e[0],i[0],n[0],o):l(n[0],i[0],e[0],1-o),h=t.__t<1?l(e[1],i[1],n[1],o):l(n[1],i[1],e[1],1-o);t.rotation=-Math.atan2(h,u)-Math.PI/2,"line"!==this._symbolType&&"rect"!==this._symbolType&&"roundRect"!==this._symbolType||(void 0!==t.__lastT&&t.__lastT=0&&!(i[r]<=e);r--);r=Math.min(r,o-2)}else{for(r=a;re);r++);r=Math.min(r-1,o-2)}var s=(e-i[r])/(i[r+1]-i[r]),l=n[r],u=n[r+1];t.x=l[0]*(1-s)+s*u[0],t.y=l[1]*(1-s)+s*u[1],t.rotation=-Math.atan2(t.__t<1?u[1]-l[1]:l[1]-u[1],t.__t<1?u[0]-l[0]:l[0]-u[0])-Math.PI/2,this._lastFrame=r,this._lastFramePercent=e,t.ignore=!1}},n}(iM);const sM=aM;var lM=function(){this.polyline=!1,this.curveness=0,this.segs=[]},uM=function(t){function n(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return e(n,t),n.prototype.reset=function(){this.notClear=!1,this._off=0},n.prototype.getDefaultStyle=function(){return{stroke:X_.color.neutral99,fill:null}},n.prototype.getDefaultShape=function(){return new lM},n.prototype.buildPath=function(t,e){var n,i=e.segs,o=e.curveness;if(e.polyline)for(n=this._off;n0){t.moveTo(i[n++],i[n++]);for(var a=1;a0?t.quadraticCurveTo((s+u)/2-(l-h)*o,(l+h)/2-(u-s)*o,u,h):t.lineTo(u,h)}this.incremental&&(this._off=n,this.notClear=!0)},n.prototype.findDataIndex=function(t,e){var n=this.shape,i=n.segs,o=n.curveness,r=this.style.lineWidth;if(n.polyline)for(var a=0,s=0;s0)for(var u=i[s++],h=i[s++],c=1;c0){if(ui(u,h,(u+d)/2-(h-p)*o,(h+p)/2-(d-u)*o,d,p,r,t,e))return a}else if(si(u,h,d,p,r,t,e))return a;a++}return-1},n.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e);return this.getBoundingRect().contain(t=n[0],e=n[1])?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},n.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape.segs,n=1/0,i=1/0,o=-1/0,r=-1/0,a=0;a0&&(r.dataIndex=n+t.__startIndex)})},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}();var cM={seriesType:"lines",plan:ma(),reset:function(t){var e=t.coordinateSystem;if(e){var n=t.get("polyline"),i=t.pipelineContext.large;return{progress:function(o,r){var a=[];if(i){var s=void 0,l=o.end-o.start;if(n){for(var u=0,h=o.start;h0&&(l||s.configLayer(r,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(a/10+.9,1),0)})),o.updateData(i);var u=t.get("clip",!0)&&function(t,e,n){return t?"polar"===t.type?function(t){var e=t.getArea(),n=rn(e.r0,1),i=rn(e.r,1),o=new Jw({shape:{cx:rn(t.cx,1),cy:rn(t.cy,1),r0:n,r:i,startAngle:e.startAngle,endAngle:e.endAngle,clockwise:e.clockwise}});return o}(t):"cartesian2d"===t.type?function(t,e,n){var i=t.getArea(),o=i.x,r=i.y,a=i.width,s=i.height,l=n.get(["lineStyle","width"])||0;o-=l/2,r-=l/2,a+=l,s+=l,a=Math.ceil(a),o!==Math.floor(o)&&(o=Math.floor(o),a++);var u=new mv({shape:{x:o,y:r,width:a,height:s}});return u}(t,0,n):null:null}(t.coordinateSystem,0,t);u?this.group.setClipPath(u):this.group.removeClipPath(),this._lastZlevel=r,this._finished=!0},n.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData();this._updateLineDraw(i,t).incrementalPrepareUpdate(i),this._clearLayer(n),this._finished=!1},n.prototype.incrementalRender=function(t,e,n){this._lineDraw.incrementalUpdate(t,e.getData()),this._finished=t.end===e.getData().count()},n.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},n.prototype.updateTransform=function(t,e,n){var i=t.getData(),o=t.pipelineContext;if(!this._finished||o.large||o.progressiveRender)return{update:!0};var r=dM.reset(t,e,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),this._lineDraw.updateLayout(),this._clearLayer(n)},n.prototype._updateLineDraw=function(t,e){var n=this._lineDraw,i=this._showEffect(e),o=!!e.get("polyline"),r=e.pipelineContext.large;return n&&i===this._hasEffet&&o===this._isPolyline&&r===this._isLargeDraw||(n&&n.remove(),n=this._lineDraw=r?new hM:new eM(o?i?sM:rM:i?iM:tM),this._hasEffet=i,this._isPolyline=o,this._isLargeDraw=r),this.group.add(n.group),n},n.prototype._showEffect=function(t){return!!t.get(["effect","show"])},n.prototype._clearLayer=function(t){var e=t.getZr();"svg"===e.painter.getType()||null==this._lastZlevel||e.painter.getLayer(this._lastZlevel).clear(!0)},n.prototype.remove=function(t,e){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(e)},n.prototype.dispose=function(t,e){this.remove(t,e)},n.type="lines",n}(Kb);var fM=function(){function t(t,e,n,i,o,r){this._old=t,this._new=e,this._oldKeyGetter=n||Rl,this._newKeyGetter=i||Rl,this.context=o,this._diffModeMultiple="multiple"===r}return t.prototype.add=function(t){return this._add=t,this},t.prototype.update=function(t){return this._update=t,this},t.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},t.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},t.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},t.prototype.remove=function(t){return this._remove=t,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var t=this._old,e=this._new,n={},i=new Array(t.length),o=new Array(e.length);this._initIndexMap(t,null,i,"_oldKeyGetter"),this._initIndexMap(e,n,o,"_newKeyGetter");for(var r=0;r1){var u=s.shift();1===s.length&&(n[a]=s[0]),this._update&&this._update(u,r)}else 1===l?(n[a]=null,this._update&&this._update(s,r)):this._remove&&this._remove(r)}this._performRestAdd(o,n)},t.prototype._executeMultiple=function(){var t=this._new,e={},n={},i=[],o=[];this._initIndexMap(this._old,e,i,"_oldKeyGetter"),this._initIndexMap(t,n,o,"_newKeyGetter");for(var r=0;r1&&1===h)this._updateManyToOne&&this._updateManyToOne(l,s),n[a]=null;else if(1===u&&h>1)this._updateOneToMany&&this._updateOneToMany(l,s),n[a]=null;else if(1===u&&1===h)this._update&&this._update(l,s),n[a]=null;else if(u>1&&h>1)this._updateManyToMany&&this._updateManyToMany(l,s),n[a]=null;else if(u>1)for(var c=0;c1)for(var a=0;a=e)){var n=this._store.getProvider();this._updateOrdinalMeta();var i=this._nameList,o=this._idList;if(n.getSource().sourceFormat===ox&&!n.pure)for(var r=[],a=t;a0},t.prototype.ensureUniqueItemVisual=function(t,e){var n=this._itemVisuals,i=n[t];i||(i=n[t]={});var o=i[e];return null==o&&(y(o=this.getVisual(e))?o=o.slice():IM(o)&&(o=a({},o)),i[e]=o),o},t.prototype.setItemVisual=function(t,e,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,IM(e)?a(i,e):i[e]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(t,e){IM(t)?a(this._layout,t):this._layout[t]=e},t.prototype.getLayout=function(t){return this._layout[t]},t.prototype.getItemLayout=function(t){return this._itemLayouts[t]},t.prototype.setItemLayout=function(t,e,n){this._itemLayouts[t]=n?a(this._itemLayouts[t]||{},e):e},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(t,e){!function(t,e,n,i){if(i){var o=Mv(i);o.dataIndex=n,o.dataType=e,o.seriesIndex=t,o.ssrType="chart","group"===i.type&&i.traverse(function(i){var o=Mv(i);o.seriesIndex=t,o.dataIndex=n,o.dataType=e,o.ssrType="chart"})}}(this.hostModel&&this.hostModel.seriesIndex,this.dataType,t,e),this._graphicEls[t]=e},t.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},t.prototype.eachItemGraphicEl=function(t,e){c(this._graphicEls,function(n,i){n&&t&&t.call(e,n,i)})},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:LM(this.dimensions,this._getDimInfo,this),this.hostModel)),bM(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(t,e){var n=this[t];v(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=n.apply(this,arguments);return e.apply(this,[t].concat(D(arguments)))})},t.internalField=(vM=function(t){var e=t._invertedIndicesMap;c(e,function(n,i){var o=t._dimInfos[i],r=o.ordinalMeta,a=t._store;if(r){n=e[i]=new PM(r.categories.length);for(var s=0;s1&&(s+="__ec__"+u),i[e]=s}})),t}();const zM=OM;var EM="undefined"==typeof Uint32Array?Array:Uint32Array,RM="undefined"==typeof Float64Array?Array:Float64Array,BM=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.visualStyleAccessPath="lineStyle",e.visualDrawType="stroke",e}return e(n,t),n.prototype.init=function(e){e.data=e.data||[],Hl(e);var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count)),t.prototype.init.apply(this,arguments)},n.prototype.mergeOption=function(e){if(Hl(e),e.data){var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count))}t.prototype.mergeOption.apply(this,arguments)},n.prototype.appendData=function(t){var e=this._processFlatCoordsArray(t.data);e.flatCoords&&(this._flatCoords?(this._flatCoords=N(this._flatCoords,e.flatCoords),this._flatCoordsOffset=N(this._flatCoordsOffset,e.flatCoordsOffset)):(this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset),t.data=new Float32Array(e.count)),this.getRawData().appendData(t.data)},n.prototype._getCoordsFromItemModel=function(t){var e=this.getData().getItemModel(t);return e.option instanceof Array?e.option:e.getShallow("coords")},n.prototype.getLineCoordsCount=function(t){return this._flatCoordsOffset?this._flatCoordsOffset[2*t+1]:this._getCoordsFromItemModel(t).length},n.prototype.getLineCoords=function(t,e){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*t],i=this._flatCoordsOffset[2*t+1],o=0;o ")})},n.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},n.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},n.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},n.prototype.getZLevelKey=function(){var t=this.getModel("effect"),e=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&e>0?e+"":""},n.type="series.lines",n.dependencies=["grid","polar","geo","calendar"],n.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}},n}(_w);const NM=BM,FM={seriesType:"lines",reset:function(t){var e=Wl(t.get("symbol")),n=Wl(t.get("symbolSize")),i=t.getData();return i.setVisual("fromSymbol",e&&e[0]),i.setVisual("toSymbol",e&&e[1]),i.setVisual("fromSymbolSize",n&&n[0]),i.setVisual("toSymbolSize",n&&n[1]),{dataEach:i.hasItemOption?function(t,e){var n=t.getItemModel(e),i=Wl(n.getShallow("symbol",!0)),o=Wl(n.getShallow("symbolSize",!0));i[0]&&t.setItemVisual(e,"fromSymbol",i[0]),i[1]&&t.setItemVisual(e,"toSymbol",i[1]),o[0]&&t.setItemVisual(e,"fromSymbolSize",o[0]),o[1]&&t.setItemVisual(e,"toSymbolSize",o[1])}:null}}};var VM="--\x3e",ZM=function(t){return t.get("autoCurveness")||null},HM=function(t,e){var n=ZM(t),i=20,o=[];if(w(n))i=n;else if(y(n))return void(t.__curvenessList=n);e>i&&(i=e);var r=i%2?i+2:i+3;o=[];for(var a=0;a0?+p:1;k.scaleX=this._sizeX*I,k.scaleY=this._sizeY*I,this.setSymbolScale(1),io(this,u,h,c)},n.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},n.prototype.fadeOut=function(t,e,n){var i=this.childAt(0),o=Mv(this).dataIndex,r=n&&n.animation;if(this.silent=i.silent=!0,n&&n.fadeLabel){var a=i.getTextContent();a&&Da(a,{style:{opacity:0}},e,{dataIndex:o,removeOpt:r,cb:function(){i.removeTextContent()}})}else i.removeTextContent();Da(i,{style:{opacity:0},scaleX:0,scaleY:0},e,{dataIndex:o,cb:t,removeOpt:r})},n.getSymbolSize=function(t,e){return Rs(t.getItemVisual(e,"symbolSize"))},n.getSymbolZ2=function(t,e){return t.getItemVisual(e,"z2")},n}(Em);const tC=QM;var eC=function(){function t(t){this.group=new Em,this._SymbolCtor=t||tC}return t.prototype.updateData=function(t,e){this._progressiveEls=null,e=cu(e);var n=this.group,i=t.hostModel,o=this._data,r=this._SymbolCtor,a=e.disableAnimation,s=du(t),l={disableAnimation:a},u=e.getSymbolPoint||function(e){return t.getItemLayout(e)};o||n.removeAll(),t.diff(o).add(function(i){var o=u(i);if(hu(t,o,i,e)){var a=new r(t,i,s,l);a.setPosition(o),t.setItemGraphicEl(i,a),n.add(a)}}).update(function(h,c){var d=o.getItemGraphicEl(c),p=u(h);if(hu(t,p,h,e)){var f=t.getItemVisual(h,"symbol")||"circle",g=d&&d.getSymbolType&&d.getSymbolType();if(!d||g&&g!==f)n.remove(d),(d=new r(t,h,s,l)).setPosition(p);else{d.updateData(t,h,s,l);var m={x:p[0],y:p[1]};a?d.attr(m):Ia(d,m,i)}n.add(d),t.setItemGraphicEl(h,d)}else n.remove(d)}).remove(function(t){var e=o.getItemGraphicEl(t);e&&e.fadeOut(function(){n.remove(e)},i)}).execute(),this._getSymbolPoint=u,this._data=t},t.prototype.updateLayout=function(){var t=this,e=this._data;e&&e.eachItemGraphicEl(function(e,n){var i=t._getSymbolPoint(n);e.setPosition(i),e.markRedraw()})},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=du(t),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e,n){function i(t){t.isGroup||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],n=cu(n);for(var o=t.start;o3?1.4:o>1?1.2:1.1;this._checkTriggerMoveZoom(this,"zoom","zoomOnMouseWheel",t,{scale:i>0?s:1/s,originX:r,originY:a,isAvailableBehavior:null})}if(n){var l=Math.abs(i);this._checkTriggerMoveZoom(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:(i>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:r,originY:a,isAvailableBehavior:null})}}}},n.prototype._pinchHandler=function(t){pu(this._zr,"globalPan")||gu(t)||this._checkTriggerMoveZoom(this,"zoom",null,t,{scale:t.pinchScale>1?1.1:1/1.1,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})},n.prototype._checkTriggerMoveZoom=function(t,e,n,i,o){t._checkPointer(i,o.originX,o.originY)&&(Zf(i.event),i.__ecRoamConsumed=!0,xu(t,e,n,i,o))},n}(Af),aC=Ln();const sC=rC;var lC=[],uC=[],hC=[],cC=jt,dC=kf,pC=Math.abs,fC=Ln(),gC=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.init=function(t,e){var n=new nC,i=new eM,o=this.group,r=new Em;this._controller=new sC(e.getZr()),this._controllerHost={target:r},r.add(n.group),r.add(i.group),o.add(r),this._symbolDraw=n,this._lineDraw=i,this._mainGroup=r,this._firstRender=!0},n.prototype.render=function(t,e,n){var i=this,o=t.coordinateSystem,r=!1;this._model=t,this._api=n,this._active=!0;var a=this._getThumbnailInfo();a&&a.bridge.reset(n);var s=this._symbolDraw,l=this._lineDraw;if(Tu(o)){var u={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?this._mainGroup.attr(u):Ia(this._mainGroup,u,t)}Su(t.getGraph(),Jl(t));var h=t.getData();s.updateData(h);var c=t.getEdgeData();l.updateData(c),this._updateNodeAndLinkScale(),this._updateController(null,t,n),clearTimeout(this._layoutTimeout);var d=t.forceLayout,p=t.get(["force","layoutAnimation"]);d&&(r=!0,this._startForceLayoutIteration(d,n,p));var f=t.get("layout");h.graph.eachNode(function(e){var o=e.dataIndex,r=e.getGraphicEl(),a=e.getModel();if(r){r.off("drag").off("dragend");var s=a.get("draggable");s&&r.on("drag",function(a){switch(f){case"force":d.warmUp(),!i._layouting&&i._startForceLayoutIteration(d,n,p),d.setFixed(o),h.setItemLayout(o,[r.x,r.y]);break;case"circular":h.setItemLayout(o,[r.x,r.y]),e.setLayout({fixed:!0},!0),tu(t,"symbolSize",e,[a.offsetX,a.offsetY]),i.updateLayout(t);break;default:h.setItemLayout(o,[r.x,r.y]),Kl(t.getGraph(),t),i.updateLayout(t)}}).on("dragend",function(){d&&d.setUnfixed(o)}),r.setDraggable(s,!!a.get("cursor")),"adjacency"===a.get(["emphasis","focus"])&&(Mv(r).focus=e.getAdjacentDataIndices())}}),h.graph.eachEdge(function(t){var e=t.getGraphicEl(),n=t.getModel().get(["emphasis","focus"]);e&&"adjacency"===n&&(Mv(e).focus={edge:[t.dataIndex],node:[t.node1.dataIndex,t.node2.dataIndex]})});var g="circular"===t.get("layout")&&t.get(["circular","rotateLabel"]),m=h.getLayout("cx"),y=h.getLayout("cy");h.graph.eachNode(function(t){eu(t,g,m,y)}),this._firstRender=!1,r||this._renderThumbnail(t,n,this._symbolDraw,this._lineDraw)},n.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},n.prototype._startForceLayoutIteration=function(t,e,n){var i=this,o=!1;!function r(){t.step(function(t){i.updateLayout(i._model),!t&&o||(o=!0,i._renderThumbnail(i._model,e,i._symbolDraw,i._lineDraw)),(i._layouting=!t)&&(n?i._layoutTimeout=setTimeout(r,16):r())})}()},n.prototype._updateController=function(t,e,n){var i=this._controller,o=this._controllerHost,r=e.coordinateSystem;Tu(r)?(i.enable(e.get("roam"),{api:n,zInfo:{component:e},triggerInfo:{roamTrigger:e.get("roamTrigger"),isInSelf:function(t,e,n){return r.containPoint([e,n])},isInClip:function(e,n,i){return!t||t.contain(n,i)}}}),o.zoomLimit=e.get("scaleLimit"),o.zoom=r.getZoom(),i.off("pan").off("zoom").on("pan",function(t){n.dispatchAction({seriesId:e.id,type:"graphRoam",dx:t.dx,dy:t.dy})}).on("zoom",function(t){n.dispatchAction({seriesId:e.id,type:"graphRoam",zoom:t.scale,originX:t.originX,originY:t.originY})})):i.disable()},n.prototype.updateViewOnPan=function(t,e,n){this._active&&(function(t,e,n){var i=t.target;i.x+=e,i.y+=n,i.dirty()}(this._controllerHost,n.dx,n.dy),this._updateThumbnailWindow())},n.prototype.updateViewOnZoom=function(t,e,n){this._active&&(function(t,e,n,i){var o=t.target,r=t.zoomLimit,a=t.zoom=t.zoom||1,s=(a=au(a*=e,r))/t.zoom;t.zoom=a,ru(o,n,i,s),o.dirty()}(this._controllerHost,n.zoom,n.originX,n.originY),this._updateNodeAndLinkScale(),Su(t.getGraph(),Jl(t)),this._lineDraw.updateLayout(),e.updateLabelLayout(),this._updateThumbnailWindow())},n.prototype._updateNodeAndLinkScale=function(){var t=this._model,e=t.getData(),n=Jl(t);e.eachItemGraphicEl(function(t,e){t&&t.setSymbolScale(n)})},n.prototype.updateLayout=function(t){this._active&&(Su(t.getGraph(),Jl(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout())},n.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()},n.prototype._getThumbnailInfo=function(){var t=this._model,e=t.coordinateSystem;if("view"===e.type){var n=function(t){if(t)return fC(t).bridge}(t);if(n)return{bridge:n,coordSys:e}}},n.prototype._updateThumbnailWindow=function(){var t=this._getThumbnailInfo();t&&t.bridge.updateWindow(t.coordSys.transform,this._api)},n.prototype._renderThumbnail=function(t,e,n,i){var r=this._getThumbnailInfo();if(r){var s=new Em,l=n.group.children(),u=i.group.children(),h=new Em,c=new Em;s.add(c),s.add(h);for(var d=0;d=0&&t.call(e,n[o],o)},t.prototype.eachEdge=function(t,e){for(var n=this.edges,i=n.length,o=0;o=0&&n[o].node1.dataIndex>=0&&n[o].node2.dataIndex>=0&&t.call(e,n[o],o)},t.prototype.breadthFirstTraverse=function(t,e,n,i){if(e instanceof vC||(e=this._nodesMap[Mu(e)]),e){for(var o="out"===n?"outEdges":"in"===n?"inEdges":"edges",r=0;r=0&&n.node2.dataIndex>=0}),o=0,r=i.length;o=0&&!t.hasKey(p)&&(t.set(p,!0),r.push(d.node1))}for(s=0;s=0&&!t.hasKey(v)&&(t.set(v,!0),a.push(y.node2))}}}return{edge:t.keys(),node:e.keys()}},t}(),_C=function(){function t(t,e,n){this.dataIndex=-1,this.node1=t,this.node2=e,this.dataIndex=null==n?-1:n}return t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(t)},t.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},t.prototype.getTrajectoryDataIndices=function(){var t=B(),e=B();t.set(this.dataIndex,!0);for(var n=[this.node1],i=[this.node2],o=0;o=0&&!t.hasKey(u)&&(t.set(u,!0),n.push(l.node1))}for(o=0;o=0&&!t.hasKey(d)&&(t.set(d,!0),i.push(c.node2))}return{edge:t.keys(),node:e.keys()}},t}();u(vC,Cu("hostGraph","data")),u(_C,Cu("hostGraph","edgeData"));const xC=yC;var wC=Ln(),bC=function(t){this.coordSysDims=[],this.axisMap=B(),this.categoryAxisMap=B(),this.coordSysName=t},SC={cartesian2d:function(t,e,n,i){var o=t.getReferringComponents("xAxis",Km).models[0],r=t.getReferringComponents("yAxis",Km).models[0];e.coordSysDims=["x","y"],n.set("x",o),n.set("y",r),Ru(o)&&(i.set("x",o),e.firstCategoryDimIndex=0),Ru(r)&&(i.set("y",r),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,n,i){var o=t.getReferringComponents("singleAxis",Km).models[0];e.coordSysDims=["single"],n.set("single",o),Ru(o)&&(i.set("single",o),e.firstCategoryDimIndex=0)},polar:function(t,e,n,i){var o=t.getReferringComponents("polar",Km).models[0],r=o.findAxisModel("radiusAxis"),a=o.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],n.set("radius",r),n.set("angle",a),Ru(r)&&(i.set("radius",r),e.firstCategoryDimIndex=0),Ru(a)&&(i.set("angle",a),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},geo:function(t,e,n,i){e.coordSysDims=["lng","lat"]},parallel:function(t,e,n,i){var o=t.ecModel,r=o.getComponent("parallel",t.get("parallelIndex")),a=e.coordSysDims=r.dimensions.slice();c(r.parallelAxisIndex,function(t,r){var s=o.getComponent("parallelAxis",t),l=a[r];n.set(l,s),Ru(s)&&(i.set(l,s),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=r))})},matrix:function(t,e,n,i){var o=t.getReferringComponents("matrix",Km).models[0];e.coordSysDims=["x","y"];var r=o.getDimensionModel("x"),a=o.getDimensionModel("y");n.set("x",r),n.set("y",a),i.set("x",r),i.set("y",a)}};const TC=function(t,e,n){n=n||{};var i,o=e.getSourceManager(),r=!1;t?(r=!0,i=br(t)):r=(i=o.getSource()).sourceFormat===ox;var a=function(t){var e=t.get("coordinateSystem"),n=new bC(e),i=SC[e];if(i)return i(t,n,n.axisMap,n.categoryAxisMap),n}(e),s=function(t,e){var n,i=t.get("coordinateSystem"),o=E_.get(i);return e&&e.coordSysDims&&(n=d(e.coordSysDims,function(t){var n={name:t},i=e.axisMap.get(t);if(i){var o=i.get("type");n.type=function(t){return"category"===t?"ordinal":"time"===t?"time":"float"}(o)}return n})),n||(n=o&&(o.getDimensionsInfo?o.getDimensionsInfo():o.dimensions.slice())||["x","y"]),n}(e,a),l=n.useEncodeDefaulter,u=v(l)?l:l?m(tr,s,e):null,h=zu(i,{coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!r}),p=function(t,e,n){var i,o;return n&&c(t,function(t,r){var a=n.categoryAxisMap.get(t.coordDim);a&&(null==i&&(i=r),t.ordinalMeta=a.getOrdinalMeta(),e&&(t.createInvertedIndices=!0)),null!=t.otherDims.itemName&&(o=!0)}),o||null==i||(t[i].otherDims.itemName=0),i}(h.dimensions,n.createInvertedIndices,a),f=r?null:o.getSharedDataStore(h),g=function(t,e,n){var i,o,r,a=(n=n||{}).byIndex,s=n.stackedCoordDimension;!function(t){return!Nl(t.schema)}(e)?(i=(o=e.schema).dimensions,r=e.store):i=e;var l,u,h,d,p=!(!t||!t.get("stack"));if(c(i,function(t,e){_(t)&&(i[e]=t={name:t}),p&&!t.isExtraCoord&&(a||l||!t.ordinalMeta||(l=t),u||"ordinal"===t.type||"time"===t.type||s&&s!==t.coordDim||(u=t))}),!u||a||l||(a=!0),u){h="__\0ecstackresult_"+t.id,d="__\0ecstackedover_"+t.id,l&&(l.createInvertedIndices=!0);var f=u.coordDim,g=u.type,m=0;c(i,function(t){t.coordDim===f&&m++});var y={name:h,coordDim:f,coordDimIndex:m,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length},v={name:d,coordDim:d,coordDimIndex:m+1,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length+1};o?(r&&(y.storeDimIndex=r.ensureCalculationDimension(d,g),v.storeDimIndex=r.ensureCalculationDimension(h,g)),o.appendCalculationDimension(y),o.appendCalculationDimension(v)):(i.push(y),i.push(v))}return{stackedDimension:u&&u.name,stackedByDimension:l&&l.name,isStackedByIndex:a,stackedOverDimension:d,stackResultDimension:h}}(e,{schema:h,store:f}),x=new zM(h,e);x.setCalculationInfo(g);var w=null!=p&&function(t){if(t.sourceFormat===ox)return!y(xn(function(t){for(var e=0;e=0},t.prototype.indexOfName=function(t){return this._getDataWithEncodedVisual().indexOfName(t)},t.prototype.getItemVisual=function(t,e){return this._getDataWithEncodedVisual().getItemVisual(t,e)},t}();const CC=MC;var kC=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.hasSymbolVisual=!0,e}return e(n,t),n.prototype.init=function(e){function n(){return i._categoriesData}t.prototype.init.apply(this,arguments);var i=this;this.legendVisualProvider=new CC(n,n),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},n.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},n.prototype.mergeDefaultAndTheme=function(e){t.prototype.mergeDefaultAndTheme.apply(this,arguments),_n(e,"edgeLabel",["show"])},n.prototype.getInitialData=function(t,e){var n,i=t.edges||t.links||[],o=t.data||t.nodes||[],r=this;if(o&&i){ZM(n=this)&&(n.__curvenessList=[],n.__edgeMap={},HM(n));var a=function(t,e,n,i,o){for(var r=new xC(!0),a=0;a "+f)),h++)}var g,y=n.get("coordinateSystem");if("cartesian2d"===y||"polar"===y||"matrix"===y)g=TC(t,n);else{var v=E_.get(y),_=v&&v.dimensions||[];l(_,"value")<0&&_.concat(["value"]);var x=zu(t,{coordDimensions:_,encodeDefine:n.getEncode()}).dimensions;(g=new zM(x,n)).initData(t)}var w,b,S,T=new zM(["value"],n);return T.initData(u,s),o&&o(g,T),b=(w={mainData:g,struct:r,structAttr:"graph",datas:{node:g,edge:T},datasAttr:{node:"data",edge:"edgeData"}}).mainData,(S=w.datas)||(S={main:b},w.datasAttr={main:"data"}),w.datas=w.mainData=null,Au(b,S,w),c(S,function(t){c(b.TRANSFERABLE_METHODS,function(e){t.wrapMethod(e,m(ku,w))})}),b.wrapMethod("cloneShallow",m(Lu,w)),c(b.CHANGABLE_METHODS,function(t){b.wrapMethod(t,m(Iu,w))}),O(S[b.dataType]===b),r.update(),r}(o,i,this,0,function(t,e){function n(t,e){var n=o.call(this,t,e);return n.resolveParentPath=i,n}function i(t){if(t&&("label"===t[0]||"label"===t[1])){var e=t.slice();return"label"===t[0]?e[0]="edgeLabel":"label"===t[1]&&(e[1]="edgeLabel"),e}return t}t.wrapMethod("getItemModel",function(t){var e=r._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t});var o=i_.prototype.getModel;e.wrapMethod("getItemModel",function(t){return t.resolveParentPath=i,t.getModel=n,t})});return c(a.edges,function(t){!function(t,e,n,i){if(ZM(n)){var o=WM(t,e,n),r=n.__edgeMap,a=r[jM(o)];r[o]&&!a?r[o].isForward=!0:a&&r[o]&&(a.isForward=!0,r[o].isForward=!1),r[o]=r[o]||[],r[o].push(i)}}(t.node1,t.node2,this,t.dataIndex)},this),a.data}},n.prototype.getGraph=function(){return this.getData().graph},n.prototype.getEdgeData=function(){return this.getGraph().edgeData},n.prototype.getCategoriesData=function(){return this._categoriesData},n.prototype.formatTooltip=function(t,e,n){if("edge"===n){var i=this.getData(),o=this.getDataParams(t,n),r=i.graph.getEdgeByIndex(t),a=i.getName(r.node1.dataIndex),s=i.getName(r.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),$r("nameValue",{name:l.join(" > "),value:o.value,noValue:null==o.value})}return sa({series:this,dataIndex:t,multipleSeries:e})},n.prototype._updateCategoriesData=function(){var t=d(this.option.categories||[],function(t){return null!=t.value?t:a({value:0},t)}),e=new zM(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray(function(t){return e.getItemModel(t)})},n.prototype.setZoom=function(t){this.option.zoom=t},n.prototype.setCenter=function(t){this.option.center=t},n.prototype.isAnimationEnabled=function(){return t.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},n.type="series.graph",n.dependencies=["grid","polar","geo","singleAxis","calendar"],n.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:X_.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:X_.color.primary}}},n}(_w);const IC=kC,LC=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.hasSymbolVisual=!0,e}return e(n,t),n.prototype.getInitialData=function(t,e){return TC(null,this,{useEncodeDefaulter:!0})},n.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?5e3:this.get("progressive"):t},n.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?1e4:this.get("progressiveThreshold"):t},n.prototype.brushSelector=function(t,e,n){return n.point(e.getItemLayout(t))},n.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},n.type="series.scatter",n.dependencies=["grid","polar","geo","singleAxis","calendar","matrix"],n.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:X_.color.primary}},universalTransition:{divideShape:"clone"}},n}(_w);var PC=function(){},DC=function(t){function n(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return e(n,t),n.prototype.getDefaultShape=function(){return new PC},n.prototype.reset=function(){this.notClear=!1,this._off=0},n.prototype.buildPath=function(t,e){var n,i=e.points,o=e.size,r=this.symbolProxy,a=r.shape,s=t.getContext?t.getContext():t,l=this.softClipShape;if(s&&o[0]<4)this._ctx=s;else{for(this._ctx=null,n=this._off;n=0;s--){var l=2*s,u=i[l]-r/2,h=i[l+1]-a/2;if(t>=u&&e>=h&&t<=u+r&&e<=h+a)return s}return-1},n.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e);return this.getBoundingRect().contain(t=n[0],e=n[1])?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},n.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape,n=e.points,i=e.size,o=i[0],r=i[1],a=1/0,s=1/0,l=-1/0,u=-1/0,h=0;h=0&&(l.dataIndex=n+(t.startIndex||0))})},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}();const OC=AC;var zC="undefined"!=typeof Float32Array,EC=zC?Float32Array:Array;const RC=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){var i=t.getData();this._updateSymbolDraw(i,t).updateData(i,{clipShape:this._getClipShape(t)}),this._finished=!0},n.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData();this._updateSymbolDraw(i,t).incrementalPrepareUpdate(i),this._finished=!1},n.prototype.incrementalRender=function(t,e,n){this._symbolDraw.incrementalUpdate(t,e.getData(),{clipShape:this._getClipShape(e)}),this._finished=t.end===e.getData().count()},n.prototype.updateTransform=function(t,e,n){var i=t.getData();if(this.group.dirty(),!this._finished||i.count()>1e4)return{update:!0};var o=Nu("").reset(t,e,n);o.progress&&o.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout(i)},n.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},n.prototype._getClipShape=function(t){if(t.get("clip",!0)){var e=t.coordinateSystem;return e&&e.getArea&&e.getArea(.1)}},n.prototype._updateSymbolDraw=function(t,e){var n=this._symbolDraw,i=e.pipelineContext.large;return n&&i===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=i?new OC:new nC,this._isLargeDraw=i,this.group.removeAll()),this.group.add(n.group),n},n.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},n.prototype.dispose=function(){},n.type="scatter",n}(Kb);var BC={left:0,right:0,top:0,bottom:0},NC=["25%","25%"];const FC=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.mergeDefaultAndTheme=function(e,n){var i=Jo(e.outerBounds);t.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&e.outerBounds&&$o(e.outerBounds,i)},n.prototype.mergeOption=function(e,n){t.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&e.outerBounds&&$o(this.option.outerBounds,e.outerBounds)},n.type="grid",n.dependencies=["xAxis","yAxis"],n.layoutMode="box",n.defaultOption={show:!1,z:0,left:"15%",top:65,right:"10%",bottom:80,containLabel:!1,outerBoundsMode:"auto",outerBounds:BC,outerBoundsContain:"all",outerBoundsClampWidth:NC[0],outerBoundsClampHeight:NC[1],backgroundColor:X_.color.transparent,borderWidth:1,borderColor:X_.color.neutral30},n}(W_);var VC=function(){function t(){}return t.prototype.getNeedCrossZero=function(){return!this.option.scale},t.prototype.getCoordSysModel=function(){},t}(),ZC=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Km).models[0]},n.type="cartesian2dAxis",n}(W_);u(ZC,VC);var HC={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:X_.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:X_.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:X_.color.axisSplitLine,width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:[X_.color.backgroundTint,X_.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:X_.color.neutral00,borderColor:X_.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:"auto"}},WC=r({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},HC),jC=r({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:X_.color.axisMinorSplitLine,width:1}}},HC);const GC={category:WC,value:jC,time:r({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},jC),log:s({logBase:10},jC)};var UC=0;const YC=function(){function t(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++UC,this._onCollect=t.onCollect}return t.createByAxisModel=function(e){var n=e.option,i=n.data,o=i&&d(i,Fu);return new t({categories:o,needCollect:!o,deduplication:!1!==n.dedplication})},t.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},t.prototype.parseAndCollect=function(t){var e,n=this._needCollect;if(!_(t)&&!n)return t;if(n&&!this._deduplication)return this.categories[e=this.categories.length]=t,this._onCollect&&this._onCollect(t,e),e;var i=this._getOrCreateMap();return null==(e=i.get(t))&&(n?(this.categories[e=this.categories.length]=t,i.set(t,e),this._onCollect&&this._onCollect(t,e)):e=NaN),e},t.prototype._getOrCreateMap=function(){return this._map||(this._map=B(this.categories))},t}();var XC={value:1,category:1,time:1,log:1},qC=null,KC=function(){function t(){this.normalize=Xu,this.scale=qu}return t.prototype.updateMethods=function(t){t.hasBreaks()?(this.normalize=_f(t.normalize,t),this.scale=_f(t.scale,t)):(this.normalize=Xu,this.scale=qu)},t}(),$C=function(){function t(t){this._calculator=new KC,this._setting=t||{},this._extent=[1/0,-1/0];var e=vo();e&&(this._brkCtx=e.createScaleBreakContext(),this._brkCtx.update(this._extent))}return t.prototype.getSetting=function(t){return this._setting[t]},t.prototype._innerUnionExtent=function(t){var e=this._extent;this._innerSetExtent(t[0]e[1]?t[1]:e[1])},t.prototype.unionExtentFromData=function(t,e){this._innerUnionExtent(t.getApproximateExtent(e))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(t,e){this._innerSetExtent(t,e)},t.prototype._innerSetExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e),this._brkCtx&&this._brkCtx.update(n)},t.prototype.setBreaksFromOption=function(t){var e=vo();e&&this._innerSetBreak(e.parseAxisBreakOption(t,_f(this.parse,this)))},t.prototype._innerSetBreak=function(t){this._brkCtx&&(this._brkCtx.setBreaks(t),this._calculator.updateMethods(this._brkCtx),this._brkCtx.update(this._extent))},t.prototype._innerGetBreaks=function(){return this._brkCtx?this._brkCtx.breaks:[]},t.prototype.hasBreaks=function(){return!!this._brkCtx&&this._brkCtx.hasBreaks()},t.prototype._getExtentSpanWithBreaks=function(){return this._brkCtx&&this._brkCtx.hasBreaks()?this._brkCtx.getExtentSpan():this._extent[1]-this._extent[0]},t.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(t){this._isBlank=t},t}();Fn($C);const JC=$C;var QC=function(t){function n(e){var n=t.call(this,e)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new YC({})),y(i)&&(i=new YC({categories:d(i,function(t){return b(t)?t.value:t})})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return e(n,t),n.prototype.parse=function(t){return null==t?NaN:_(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},n.prototype.contain=function(t){return Yu(t,this._extent)&&t>=0&&t=0&&t=0&&t=t},n.prototype.getOrdinalMeta=function(){return this._ordinalMeta},n.prototype.calcNiceTicks=function(){},n.prototype.calcNiceExtent=function(){},n.type="ordinal",n}(JC);JC.registerClass(QC);const tk=QC;var ek=rn,nk=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="interval",e._interval=0,e._intervalPrecision=2,e}return e(n,t),n.prototype.parse=function(t){return null==t||""===t?NaN:Number(t)},n.prototype.contain=function(t){return Yu(t,this._extent)},n.prototype.normalize=function(t){return this._calculator.normalize(t,this._extent)},n.prototype.scale=function(t){return this._calculator.scale(t,this._extent)},n.prototype.getInterval=function(){return this._interval},n.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=Gu(t)},n.prototype.getTicks=function(t){t=t||{};var e=this._interval,n=this._extent,i=this._niceExtent,o=this._intervalPrecision,r=vo(),a=[];if(!e)return a;if("only_break"===t.breakTicks&&r)return r.addBreaksToTicks(a,this._brkCtx.breaks,this._extent),a;n[0]=0&&(l=ek(l+u*e,o))}if(a.length>0&&l===a[a.length-1].value)break;if(a.length>1e4)return[]}var h=a.length?a[a.length-1].value:i[1];return n[1]>h&&a.push(t.expandToNicedExtent?{value:ek(h+e,o)}:{value:n[1]}),r&&r.pruneTicksByBreak(t.pruneByBreak,a,this._brkCtx.breaks,function(t){return t.value},this._interval,this._extent),"none"!==t.breakTicks&&r&&r.addBreaksToTicks(a,this._brkCtx.breaks,this._extent),a},n.prototype.getMinorTicks=function(t){for(var e=this.getTicks({expandToNicedExtent:!0}),n=[],i=this.getExtent(),o=1;oi[0]&&co&&(a=r.interval=o);var s=r.intervalPrecision=Gu(a);return function(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),Uu(t,0,e),Uu(t,1,e),t[0]>t[1]&&(t[0]=t[1])}(r.niceTickExtent=[rn(Math.ceil(t[0]/a)*a,s),rn(Math.floor(t[1]/a)*a,s)],t),r}(i,o,t,e,n);this._intervalPrecision=r.intervalPrecision,this._interval=r.interval,this._niceExtent=r.niceTickExtent}},n.prototype.calcNiceExtent=function(t){var e=this._extent.slice();if(e[0]===e[1])if(0!==e[0]){var n=Math.abs(e[0]);t.fixMax||(e[1]+=n/2),e[0]-=n/2}else e[1]=1;isFinite(e[1]-e[0])||(e[0]=0,e[1]=1),this._innerSetExtent(e[0],e[1]),e=this._extent.slice(),this.calcNiceTicks(t.splitNumber,t.minInterval,t.maxInterval);var i=this._interval,o=this._intervalPrecision;t.fixMin||(e[0]=ek(Math.floor(e[0]/i)*i,o)),t.fixMax||(e[1]=ek(Math.ceil(e[1]/i)*i,o)),this._innerSetExtent(e[0],e[1])},n.prototype.setNiceExtent=function(t,e){this._niceExtent=[t,e]},n.type="interval",n}(JC);JC.registerClass(nk);const ik=nk;var ok="__ec_stack_",rk=function(t){function n(e){var n=t.call(this,e)||this;return n.type="time",n}return e(n,t),n.prototype.getLabel=function(t){var e=this.getSetting("useUTC");return bo(t.value,x_[function(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}(xo(this._minLevelUnit))]||x_.second,e,this.getSetting("locale"))},n.prototype.getFormattedLabel=function(t,e,n){var i=this.getSetting("useUTC");return function(t,e,n,i,o){var r=null;if(_(n))r=n;else if(v(n)){var a={time:t.time,level:t.time.level},s=vo();s&&s.makeAxisLabelFormatterParamBreak(a,t.break),r=n(t.value,e,a)}else{var l=t.time;if(l){var u=n[l.lowerTimeUnit][l.upperTimeUnit];r=u[Math.min(l.level,u.length-1)]||""}else{var h=So(t.value,o);r=n[h][h][0]}}return bo(new Date(t.value),r,o,i)}(t,e,n,this.getSetting("locale"),i)},n.prototype.getTicks=function(t){t=t||{};var e=this._interval,n=this._extent,i=vo(),o=[];if(!e)return o;var r=this.getSetting("useUTC");if(i&&"only_break"===t.breakTicks)return vo().addBreaksToTicks(o,this._brkCtx.breaks,this._extent),o;var a=So(n[1],r);o.push({value:n[0],time:{level:0,upperTimeUnit:a,lowerTimeUnit:a}});var s=function(t,e,n,i,o,r){function a(t,e,n,o,a,s,l){for(var h=function(t,e){var n=new Date(0);n[t](1);var i=n.getTime();n[t](1+e);var o=n.getTime()-i;return function(t,e){return Math.max(0,Math.round((e-t)/o))}}(a,t),c=e,d=new Date(c);c1e4));)if(d[a](d[o]()+t),c=d.getTime(),r){var p=r.calcNiceTickMultiple(c,h);p>0&&(d[a](d[o]()+p*t),c=d.getTime())}l.push({value:c,notAdd:!0})}function s(t,o,r){var s=[],l=!o.length;if(!Qu(xo(t),i[0],i[1],n)){l&&(o=[{value:rh(i[0],t,n)},{value:i[1]}]);for(var u=0;u=i[0]&&h<=i[1]&&a(d,h,c,p,f,0,s),"year"===t&&r.length>1&&0===u&&r.unshift({value:r[0].value-d})}}for(u=0;u=i[0]&&x<=i[1]&&p++)}var w=o/e;if(p>1.5*w&&g>w/1.5)break;if(h.push(v),p>w||t===l[m])break}c=[]}}var b=f(d(h,function(t){return f(t,function(t){return t.value>=i[0]&&t.value<=i[1]&&!t.notAdd})}),function(t){return t.length>0}),S=[],T=b.length-1;for(m=0;mn&&(this._approxInterval=n);var o=ak.length,r=Math.min(function(t,e,n,i){for(;n>>1;t[o][1]0;)i*=10;var o=[lk(hk(e[0]/i)*i),lk(uk(e[1]/i)*i)];this._interval=i,this._intervalPrecision=Gu(i),this._niceExtent=o}},n.prototype.calcNiceExtent=function(e){t.prototype.calcNiceExtent.call(this,e),this._fixMin=e.fixMin,this._fixMax=e.fixMax},n.prototype.contain=function(e){return e=dk(e)/dk(this.base),t.prototype.contain.call(this,e)},n.prototype.normalize=function(e){return e=dk(e)/dk(this.base),t.prototype.normalize.call(this,e)},n.prototype.scale=function(e){return e=t.prototype.scale.call(this,e),ck(this.base,e)},n.prototype.setBreaksFromOption=function(t){var e=vo();if(e){var n=e.logarithmicParseBreaksFromOption(t,this.base,_f(this.parse,this)),i=n.parsedLogged;this._originalScale._innerSetBreak(n.parsedOriginal),this._innerSetBreak(i)}},n.type="log",n}(ik);JC.registerClass(pk);const fk=pk;var gk=function(){function t(t,e,n){this._prepareParams(t,e,n)}return t.prototype._prepareParams=function(t,e,n){n[1]0&&s>0&&!l&&(a=0),a<0&&s<0&&!u&&(s=0));var c=this._determinedMin,d=this._determinedMax;return null!=c&&(a=c,l=!0),null!=d&&(s=d,u=!0),{min:a,max:s,minFixed:l,maxFixed:u,isBlank:h}},t.prototype.modifyDataMinMax=function(t,e){this[yk[t]]=e},t.prototype.setDeterminedMinMax=function(t,e){this[mk[t]]=e},t.prototype.freeze=function(){this.frozen=!0},t}(),mk={min:"_determinedMin",max:"_determinedMax"},yk={min:"_dataMin",max:"_dataMax"},vk=function(){function t(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return t.prototype.getAxis=function(t){return this._axes[t]},t.prototype.getAxes=function(){return d(this._dimList,function(t){return this._axes[t]},this)},t.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),f(this.getAxes(),function(e){return e.scale.type===t})},t.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},t}(),_k=["x","y"],xk=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cartesian2d",e.dimensions=_k,e}return e(n,t),n.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,e=this.getAxis("y").scale;if(_h(t)&&_h(e)){var n=t.getExtent(),i=e.getExtent(),o=this.dataToPoint([n[0],i[0]]),r=this.dataToPoint([n[1],i[1]]),a=n[1]-n[0],s=i[1]-i[0];if(a&&s){var l=(r[0]-o[0])/a,u=(r[1]-o[1])/s,h=this._transform=[l,0,0,u,o[0]-n[0]*l,o[1]-i[0]*u];this._invTransform=bt([],h)}}},n.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},n.prototype.containPoint=function(t){var e=this.getAxis("x"),n=this.getAxis("y");return e.contain(e.toLocalCoord(t[0]))&&n.contain(n.toLocalCoord(t[1]))},n.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},n.prototype.containZone=function(t,e){var n=this.dataToPoint(t),i=this.dataToPoint(e),o=this.getArea(),r=new lg(n[0],n[1],i[0]-n[0],i[1]-n[1]);return o.intersect(r)},n.prototype.dataToPoint=function(t,e,n){n=n||[];var i=t[0],o=t[1];if(this._transform&&null!=i&&isFinite(i)&&null!=o&&isFinite(o))return et(n,t,this._transform);var r=this.getAxis("x"),a=this.getAxis("y");return n[0]=r.toGlobalCoord(r.dataToCoord(i,e)),n[1]=a.toGlobalCoord(a.dataToCoord(o,e)),n},n.prototype.clampData=function(t,e){var n=this.getAxis("x").scale,i=this.getAxis("y").scale,o=n.getExtent(),r=i.getExtent(),a=n.parse(t[0]),s=i.parse(t[1]);return(e=e||[])[0]=Math.min(Math.max(Math.min(o[0],o[1]),a),Math.max(o[0],o[1])),e[1]=Math.min(Math.max(Math.min(r[0],r[1]),s),Math.max(r[0],r[1])),e},n.prototype.pointToData=function(t,e,n){if(n=n||[],this._invTransform)return et(n,t,this._invTransform);var i=this.getAxis("x"),o=this.getAxis("y");return n[0]=i.coordToData(i.toLocalCoord(t[0]),e),n[1]=o.coordToData(o.toLocalCoord(t[1]),e),n},n.prototype.getOtherAxis=function(t){return this.getAxis("x"===t.dim?"y":"x")},n.prototype.getArea=function(t){t=t||0;var e=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),i=Math.min(e[0],e[1])-t,o=Math.min(n[0],n[1])-t,r=Math.max(e[0],e[1])-i+t,a=Math.max(n[0],n[1])-o+t;return new lg(i,o,r,a)},n}(vk);const wk=xk;var bk=Ln(),Sk=Ln(),Tk=1,Mk=2,Ck=Sh("axisTick"),kk=Sh("axisLabel"),Ik=[0,1],Lk=function(){function t(t,e,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=n||[0,0]}return t.prototype.contain=function(t){var e=this._extent,n=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return t>=n&&t<=i},t.prototype.containData=function(t){return this.scale.contain(this.scale.parse(t))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(t){return sn(t||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(t,e){var n=this._extent;n[0]=t,n[1]=e},t.prototype.dataToCoord=function(t,e){var n=this._extent,i=this.scale;return t=i.normalize(i.parse(t)),this.onBand&&"ordinal"===i.type&&Ph(n=n.slice(),i.count()),nn(t,Ik,n,e)},t.prototype.coordToData=function(t,e){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&Ph(n=n.slice(),i.count());var o=nn(t,n,Ik,e);return this.scale.scale(o)},t.prototype.pointToData=function(t,e){},t.prototype.getTicksCoords=function(t){var e=(t=t||{}).tickModel||this.getTickModel(),n=d(function(t,e,n){var i=t.getTickModel().get("customValues");if(i){var o=t.scale.getExtent();return{ticks:f(wh(t,i),function(t){return t>=o[0]&&t<=o[1]})}}return"category"===t.type?function(t,e){var n,i,o=Ck(t),r=ph(e),a=Th(o,r);if(a)return a;if(e.get("show")&&!t.scale.isBlank()||(n=[]),v(r))n=Lh(t,r,!0);else if("auto"===r){var s=bh(t,t.getLabelModel(),xh(Mk));i=s.labelCategoryInterval,n=d(s.labels,function(t){return t.tickValue})}else n=Ih(t,i=r,!0);return Mh(o,r,{ticks:n,tickCategoryInterval:i})}(t,e):{ticks:d(t.scale.getTicks(n),function(t){return t.value})}}(this,e,{breakTicks:t.breakTicks,pruneByBreak:t.pruneByBreak}).ticks,function(t){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(t):t),tickValue:t}},this);return function(t,e,n,i){function o(t,e){return t=rn(t),e=rn(e),h?t>e:ts[1];o(e[0].coord,s[0])&&(i?e[0].coord=s[0]:e.shift()),i&&o(s[0],e[0].coord)&&e.unshift({coord:s[0],onBand:!0}),o(s[1],a.coord)&&(i?a.coord=s[1]:e.pop()),i&&o(a.coord,s[1])&&e.push({coord:s[1],onBand:!0})}}(this,n,e.get("alignWithLabel"),t.clamp),n},t.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)return[];var t=this.model.getModel("minorTick").get("splitNumber");return t>0&&t<100||(t=5),d(this.scale.getMinorTicks(t),function(t){return d(t,function(t){return{coord:this.dataToCoord(t),tickValue:t}},this)},this)},t.prototype.getViewLabels=function(t){return function(t,e){var n=t.getLabelModel().get("customValues");if(n){var i=ch(t),o=t.scale.getExtent();return{labels:d(f(wh(t,n),function(t){return t>=o[0]&&t<=o[1]}),function(e){var n={value:e};return{formattedLabel:i(n),rawLabel:t.scale.getLabel(n),tickValue:e,time:void 0,break:void 0}})}}return"category"===t.type?function(t,e){var n=t.getLabelModel(),i=bh(t,n,e);return!n.get("show")||t.scale.isBlank()?{labels:[]}:i}(t,e):function(t){var e=t.scale.getTicks(),n=ch(t);return{labels:d(e,function(e,i){return{formattedLabel:n(e,i),rawLabel:t.scale.getLabel(e),tickValue:e.value,time:e.time,break:e.break}})}}(t)}(this,t=t||xh(Mk)).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),n=e[1]-e[0]+(this.onBand?1:0);0===n&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},t.prototype.calculateCategoryInterval=function(t){return function(t,e){var n=e.kind,i=function(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}(t),o=ch(t),r=(i.axisRotate-i.labelRotate)/180*Math.PI,a=t.scale,s=a.getExtent(),l=a.count();if(s[1]-s[0]<1)return 0;var u=1;l>40&&(u=Math.max(1,Math.floor(l/40)));for(var h=s[0],c=t.dataToCoord(h+1)-t.dataToCoord(h),d=Math.abs(c*Math.cos(r)),p=Math.abs(c*Math.sin(r)),f=0,g=0;h<=s[1];h+=u){var m,y=Ge(o({value:h}),i.font,"center","top");m=1.3*y.height,f=Math.max(f,1.3*y.width,7),g=Math.max(g,m,7)}var v=f/d,_=g/p;isNaN(v)&&(v=1/0),isNaN(_)&&(_=1/0);var x=Math.max(0,Math.floor(Math.min(v,_)));if(n===Tk)return e.out.noPxChangeTryDetermine.push(_f(Ch,null,t,x,l)),x;var w=kh(t,x,l);return null!=w?w:x}(this,t=t||xh(Mk))},t}(),Pk=function(t){function n(e,n,i,o,r){var a=t.call(this,e,n,i)||this;return a.index=0,a.type=o||"value",a.position=r||"bottom",a}return e(n,t),n.prototype.isHorizontal=function(){var t=this.position;return"top"===t||"bottom"===t},n.prototype.getGlobalExtent=function(t){var e=this.getExtent();return e[0]=this.toGlobalCoord(e[0]),e[1]=this.toGlobalCoord(e[1]),t&&e[0]>e[1]&&e.reverse(),e},n.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},n.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},n}(Lk);const Dk=Pk;var Ak=["label","labelLine","layoutOption","priority","defaultAttr","marginForce","minMarginForce","marginDefault","suggestIgnore"],Ok=[0,0,0,0],zk="expandAxisBreak",Ek=Math.PI,Rk=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],Bk=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],Nk=Ln(),Fk=Ln(),Vk=function(){function t(t){this.recordMap={},this.resolveAxisNameOverlap=t}return t.prototype.ensureRecord=function(t){var e=t.axis.dim,n=t.componentIndex,i=this.recordMap,o=i[e]||(i[e]=[]);return o[n]||(o[n]={ready:{}})},t}(),Zk=[1,0,0,1,0,0],Hk=new lg(0,0,0,0),Wk=function(t,e,n,i,o,r){if(mh(t.nameLocation)){var a=r.stOccupiedRect;a&&Bh(function(t,e,n){return t.transform=ls(t.transform,n),t.localRect=ss(t.localRect,e),t.rect=ss(t.rect,e),n&&t.rect.applyTransform(n),t.axisAligned=as(n),t.obb=void 0,(t.label=t.label||{}).ignore=!1,t}({},a,r.transGroup.transform),i,o)}else Nh(r.labelInfoList,r.dirVec,i,o)},jk=function(){function t(t,e,n,i){this.group=new Em,this._axisModel=t,this._api=e,this._local={},this._shared=i||new Vk(Wk),this._resetCfgDetermined(n)}return t.prototype.updateCfg=function(t){var e=this._cfg.raw;e.position=t.position,e.labelOffset=t.labelOffset,this._resetCfgDetermined(e)},t.prototype.__getRawCfg=function(){return this._cfg.raw},t.prototype._resetCfgDetermined=function(t){var e=this._axisModel,n=e.getDefaultOption?e.getDefaultOption():{},i=L(t.axisName,e.get("name")),o=e.get("nameMoveOverlap");null!=o&&"auto"!==o||(o=L(t.defaultNameMoveOverlap,!0));var r={raw:t,position:t.position,rotation:t.rotation,nameDirection:L(t.nameDirection,1),tickDirection:L(t.tickDirection,1),labelDirection:L(t.labelDirection,1),labelOffset:L(t.labelOffset,0),silent:L(t.silent,!0),axisName:i,nameLocation:P(e.get("nameLocation"),n.nameLocation,"end"),shouldNameMoveOverlap:Gh(i)&&o,optionHideOverlap:e.get(["axisLabel","hideOverlap"]),showMinorTicks:e.get(["minorTick","show"])};this._cfg=r;var a=new Em({x:r.position[0],y:r.position[1],rotation:r.rotation});a.updateTransform(),this._transformGroup=a;var s=this._shared.ensureRecord(e);s.transGroup=this._transformGroup,s.dirVec=new Gf(Math.cos(-r.rotation),Math.sin(-r.rotation))},t.prototype.build=function(t,e){var n=this;return t||(t={axisLine:!0,axisTickLabelEstimate:!1,axisTickLabelDetermine:!0,axisName:!0}),c(Gk,function(i){t[i]&&Uk[i](n._cfg,n._local,n._shared,n._axisModel,n.group,n._transformGroup,n._api,e||{})}),this},t.innerTextLayout=function(t,e,n){var i,o,r=un(e-t);return hn(r)?(o=n>0?"top":"bottom",i="center"):hn(r-Ek)?(o=n>0?"bottom":"top",i="center"):(o="middle",i=r>0&&r0?"right":"left":n>0?"left":"right"),{rotation:r,textAlign:i,textVerticalAlign:o}},t.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},t.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},t}(),Gk=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],Uk={axisLine:function(t,e,n,i,o,r,s){var l=i.get(["axisLine","show"]);if("auto"===l&&(l=!0,null!=t.raw.axisLineAutoShow&&(l=!!t.raw.axisLineAutoShow)),l){var u=i.axis.getExtent(),h=r.transform,d=[u[0],0],p=[u[1],0],f=d[0]>p[0];h&&(et(d,d,h),et(p,p,h));var g=a({lineCap:"round"},i.getModel(["axisLine","lineStyle"]).getLineStyle()),m={strokeContainThreshold:t.raw.strokeContainThreshold||5,silent:!0,z2:1,style:g};if(i.get(["axisLine","breakLine"])&&i.axis.scale.hasBreaks())Vu().buildAxisBreakLine(i,o,r,m);else{var y=new cb(a({shape:{x1:d[0],y1:d[1],x2:p[0],y2:p[1]}},m));Ha(y.shape,y.style.lineWidth),y.anid="line",o.add(y)}var v=i.get(["axisLine","symbol"]);if(null!=v){var x=i.get(["axisLine","symbolSize"]);_(v)&&(v=[v,v]),(_(x)||w(x))&&(x=[x,x]);var b=Bs(i.get(["axisLine","symbolOffset"])||0,x),S=x[0],T=x[1];c([{rotate:t.rotation+Math.PI/2,offset:b[0],r:0},{rotate:t.rotation-Math.PI/2,offset:b[1],r:Math.sqrt((d[0]-p[0])*(d[0]-p[0])+(d[1]-p[1])*(d[1]-p[1]))}],function(e,n){if("none"!==v[n]&&null!=v[n]){var i=Es(v[n],-S/2,-T/2,S,T,g.stroke,!0),r=e.r+e.offset,a=f?p:d;i.attr({rotation:e.rotate,x:a[0]+r*Math.cos(t.rotation),y:a[1]-r*Math.sin(t.rotation),silent:!0,z2:11}),o.add(i)}})}}},axisTickLabelEstimate:function(t,e,n,i,o,r,a,s){Hh(e,o,s)&&Fh(t,e,n,i,o,r,a,Tk)},axisTickLabelDetermine:function(t,e,n,i,o,r,a,l){Hh(e,o,l)&&Fh(t,e,n,i,o,r,a,Mk);var u=function(t,e,n,i){var o=i.axis,r=i.getModel("axisTick"),a=r.get("show");if("auto"===a&&(a=!0,null!=t.raw.axisTickAutoShow&&(a=!!t.raw.axisTickAutoShow)),!a||o.scale.isBlank())return[];for(var l=r.getModel("lineStyle"),u=t.tickDirection*r.get("length"),h=Zh(o.getTicksCoords(),n.transform,u,s(l.getLineStyle(),{stroke:i.get(["axisLine","lineStyle","color"])}),"ticks"),c=0;ci[1],l="start"===e&&!s||"start"!==e&&s;return hn(a-Ek/2)?(r=l?"bottom":"top",o="center"):hn(a-1.5*Ek)?(r=l?"top":"bottom",o="center"):(r="middle",o=a<1.5*Ek&&a>Ek/2?l?"left":"right":l?"right":"left"),{rotation:a,textAlign:o,textVerticalAlign:r}}(t.rotation,h,w||0,f),null!=(x=t.raw.axisNameAvailableWidth)&&(x=Math.abs(x/Math.sin(_.rotation)),!isFinite(x)&&(x=null)));var b=d.getFont(),S=i.get("nameTruncate",!0)||{},T=S.ellipsis,M=I(t.raw.nameTruncateMaxWidth,S.maxWidth,x),C=s.nameMarginLevel||0,k=new Tv({x:m.x,y:m.y,rotation:_.rotation,silent:jk.isLabelSilent(i),style:co(d,{text:u,font:b,overflow:"truncate",width:M,ellipsis:T,fill:d.getTextColor()||i.get(["axisLine","lineStyle","color"]),align:d.get("align")||_.textAlign,verticalAlign:d.get("verticalAlign")||_.textVerticalAlign}),z2:1});if(is({el:k,componentModel:i,itemName:u}),k.__fullText=u,k.anid="name",i.get("triggerEvent")){var L=jk.makeAxisEventDataBase(i);L.targetType="axisName",L.name=u,Mv(k).eventData=L}r.add(k),k.updateTransform(),e.nameEl=k;var P=l.nameLayout=Oh({label:k,priority:k.z2,defaultAttr:{ignore:k.ignore},marginDefault:mh(h)?Rk[C]:Bk[C]});if(l.nameLocation=h,o.add(k),k.decomposeTransform(),t.shouldNameMoveOverlap&&P){var D=n.ensureRecord(i);n.resolveAxisNameOverlap(t,n,i,P,y,D)}}}},Yk=new mv,Xk=new mv;const qk=jk;var Kk=[[3,1],[0,2]],$k=function(){function t(t,e,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=_k,this._initCartesian(t,e,n),this.model=t}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(t,e){function n(t){var e,n=g(t),i=n.length;if(i){for(var o=[],r=i-1;r>=0;r--){var a=t[+n[r]],s=a.model,l=a.scale;Wu(l)&&s.get("alignTicks")&&null==s.get("interval")?o.push(a):(hh(l,s),Wu(l)&&(e=a))}o.length&&(e||hh((e=o.pop()).scale,e.model),c(o,function(t){!function(t,e,n){var i=ik.prototype,o=i.getTicks.call(n),r=i.getTicks.call(n,{expandToNicedExtent:!0}),a=o.length-1,s=i.getInterval.call(n),l=uh(t,e),u=l.extent,h=l.fixMin,c=l.fixMax;"log"===t.type&&(u=Ku(t.base,u,!0)),t.setBreaksFromOption(vh(e)),t.setExtent(u[0],u[1]),t.calcNiceExtent({splitNumber:a,fixMin:h,fixMax:c});var d=i.getExtent.call(t);h&&(u[0]=d[0]),c&&(u[1]=d[1]);var p=i.getInterval.call(t),f=u[0],g=u[1];if(h&&c)p=(g-f)/a;else if(h)for(g=u[0]+p*a;gu[0]&&isFinite(f)&&isFinite(u[0]);)p=ju(p),f=u[1]-p*a;else{t.getTicks().length-1>a&&(p=ju(p));var m=p*a;(f=rn((g=Math.ceil(u[1]/p)*p)-m))<0&&u[0]>=0?(f=0,g=rn(m)):g>0&&u[1]<=0&&(g=0,f=-rn(m))}var y=(o[0].value-r[0].value)/s,v=(o[a].value-r[a].value)/s;i.setExtent.call(t,f+p*y,g+p*v),i.setInterval.call(t,p),(y||v)&&i.setNiceExtent.call(t,f+p,g-p)}(t.scale,t.model,e.scale)}))}}var i=this._axesMap;this._updateScale(t,this.model),n(i.x),n(i.y);var o={};c(i.x,function(t){qh(i,"y",t,o)}),c(i.y,function(t){qh(i,"x",t,o)}),this.resize(this.model,e)},t.prototype.resize=function(t,e,n){var i=Xo(t,e),o=this._rect=Yo(t.getBoxLayoutParams(),i.refContainer),r=this._axesMap,a=this._coordsList,s=t.get("containLabel");if($h(r,o),!n){var u=function(t,e,n,i,o){var r=new Vk(Jk);return c(n,function(n){return c(n,function(n){yh(n.model)&&(n.axisBuilder=function(t,e,n,i,o,r){for(var a=Uh(t,n),s=!1,l=!1,u=0;ul[1]&&l.reverse(),(null==a||a>l[1])&&(a=l[1]),aa)return!0;if(r){var s=nc(t).seriesDataCount,l=i.getExtent();return Math.abs(l[0]-l[1])/s>a}return!1}return!0===n},t.prototype.makeElOption=function(t,e,n,i,o){},t.prototype.createPointerEl=function(t,e,n,i){var o=e.pointer;if(o){var r=cI(t).pointerEl=new qp[o.type](dI(e.pointer));t.add(r)}},t.prototype.createLabelEl=function(t,e,n,i){if(e.label){var o=cI(t).labelEl=new Tv(dI(e.label));t.add(o),lc(o,i)}},t.prototype.updatePointerEl=function(t,e,n){var i=cI(t).pointerEl;i&&e.pointer&&(i.setStyle(e.pointer.style),n(i,{shape:e.pointer.shape}))},t.prototype.updateLabelEl=function(t,e,n,i){var o=cI(t).labelEl;o&&(o.setStyle(e.label.style),n(o,{x:e.label.x,y:e.label.y}),lc(o,i))},t.prototype._renderHandle=function(t){if(!this._dragging&&this.updateHandleTransform){var e,n=this._axisPointerModel,i=this._api.getZr(),o=this._handle,r=n.getModel("handle"),a=n.get("status");if(!r.get("show")||!a||"hide"===a)return o&&i.remove(o),void(this._handle=null);this._handle||(e=!0,o=this._handle=$a(r.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){Zf(t.event)},onmousedown:pI(this._onHandleDragMove,this,0,0),drift:pI(this._onHandleDragMove,this),ondragend:pI(this._onHandleDragEnd,this)}),i.add(o)),hc(o,n,!1),o.setStyle(r.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=r.get("size");y(s)||(s=[s,s]),o.scaleX=s[0]/2,o.scaleY=s[1]/2,vs(this,"_doDispatchAxisPointer",r.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},t.prototype._moveHandleToValue=function(t,e){ac(this._axisPointerModel,!e&&this._moveAnimation,this._handle,uc(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(t,e){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(uc(n),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(uc(i)),cI(n).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){if(this._handle){var t=this._payloadInfo,e=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),n=this._group,i=this._handle;e&&n&&(this._lastGraphicKey=null,n&&e.remove(n),i&&e.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),_s(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}},t}(),gI=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.makeElOption=function(t,e,n,i,o){var r=n.axis,a=r.grid,s=i.get("type"),l=pc(a,r).getOtherAxis(r).getGlobalExtent(),u=r.toGlobalCoord(r.dataToCoord(e,!0));if(s&&"none"!==s){var h=function(t){var e,n=t.get("type"),i=t.getModel(n+"Style");return"line"===n?(e=i.getLineStyle()).fill=null:"shadow"===n&&((e=i.getAreaStyle()).stroke=null),e}(i),c=mI[s](r,u,l);c.style=h,t.graphicKey=c.type,t.pointer=c}!function(t,e,n,i,o,r){var a=qk.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=o.get(["label","margin"]),function(t,e,n,i,o){var r=cc(n.get("value"),e.axis,e.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),a=n.getModel("label"),s=S_(a.get("padding")||0),l=a.getFont(),u=Ge(r,l),h=o.position,c=u.width+s[1]+s[3],d=u.height+s[0]+s[2],p=o.align;"right"===p&&(h[0]-=c),"center"===p&&(h[0]-=c/2);var f=o.verticalAlign;"bottom"===f&&(h[1]-=d),"middle"===f&&(h[1]-=d/2),function(t,e,n,i){var o=i.getWidth(),r=i.getHeight();t[0]=Math.min(t[0]+e,o)-e,t[1]=Math.min(t[1]+n,r)-n,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}(h,c,d,i);var g=a.get("backgroundColor");g&&"auto"!==g||(g=e.get(["axisLine","lineStyle","color"])),t.label={x:h[0],y:h[1],style:co(a,{text:r,font:l,fill:a.getTextColor(),padding:s,backgroundColor:g}),z2:10}}(e,i,o,r,{position:dc(i.axis,t,n),align:a.textAlign,verticalAlign:a.textVerticalAlign})}(e,t,Uh(a.getRect(),n),n,i,o)},n.prototype.getHandleTransform=function(t,e,n){var i=Uh(e.axis.grid.getRect(),e,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var o=dc(e.axis,t,i);return{x:o[0],y:o[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},n.prototype.updateHandleTransform=function(t,e,n,i){var o=n.axis,r=o.grid,a=o.getGlobalExtent(!0),s=pc(r,o).getOtherAxis(o).getGlobalExtent(),l="x"===o.dim?0:1,u=[t.x,t.y];u[l]+=e[l],u[l]=Math.min(a[1],u[l]),u[l]=Math.max(a[0],u[l]);var h=(s[1]+s[0])/2,c=[h,h];return c[l]=u[l],{x:u[0],y:u[1],rotation:t.rotation,cursorPoint:c,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},n}(fI),mI={line:function(t,e,n){var i,o,r;return{type:"Line",subPixelOptimize:!0,shape:(i=[e,n[0]],o=[e,n[1]],r=fc(t),{x1:i[r=r||0],y1:i[1-r],x2:o[r],y2:o[1-r]})}},shadow:function(t,e,n){var i,o,r,a=Math.max(1,t.getBandWidth());return{type:"Rect",shape:(i=[e-a/2,n[0]],o=[a,n[1]-n[0]],r=fc(t),{x:i[r=r||0],y:i[1-r],width:o[r],height:o[1-r]})}}};const yI=gI,vI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="axisPointer",n.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:X_.color.border,width:1,type:"dashed"},shadowStyle:{color:X_.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:X_.color.neutral00,padding:[5,7,5,7],backgroundColor:X_.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:X_.color.accent40,throttle:40}},n}(W_);var _I=Ln(),xI=c,wI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){var i=e.getComponent("tooltip"),o=t.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";gc("axisPointer",n,function(t,e,n){"none"!==o&&("leave"===t||o.indexOf(t)>=0)&&n({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})})},n.prototype.remove=function(t,e){vc("axisPointer",e)},n.prototype.dispose=function(t,e){vc("axisPointer",e)},n.type="axisPointer",n}(ww);const bI=wI;var SI=Ln();const TI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="tooltip",n.dependencies=["axisPointer"],n.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:X_.color.neutral00,shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:X_.color.border,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:X_.color.borderShade,width:1,type:"dashed",textStyle:{}}},textStyle:{color:X_.color.tertiary,fontSize:14}},n}(W_);var MI=Ic(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),CI=Lc(Ic(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),"transition"),kI=Lc(MI,"transform"),II="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(Qp.transform3dSupported?"will-change:transform;":""),LI=function(){function t(t,e){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,Qp.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var i=this._zr=t.getZr(),o=e.appendTo,r=o&&(_(o)?document.querySelector(o):M(o)?o:v(o)&&o(t.getDom()));Dc(this._styleCoord,i,r,t.getWidth()/2,t.getHeight()/2),(r||t.getDom()).appendChild(n),this._api=t,this._container=r;var a=this;n.onmouseenter=function(){a._enterable&&(clearTimeout(a._hideTimeout),a._show=!0),a._inContent=!0},n.onmousemove=function(t){if(t=t||window.event,!a._enterable){var e=i.handler;dt(i.painter.getViewportRoot(),t,!0),e.dispatch("mousemove",t)}},n.onmouseleave=function(){a._inContent=!1,a._enterable&&a._show&&a.hideLater(a._hideDelay)}}return t.prototype.update=function(t){if(!this._container){var e=this._api.getDom(),n=(r="position",(a=(o=e).currentStyle||document.defaultView&&document.defaultView.getComputedStyle(o))?r?a[r]:a:null),i=e.style;"absolute"!==i.position&&"absolute"!==n&&(i.position="relative")}var o,r,a,s=t.get("alwaysShowContent");s&&this._moveIfResized(),this._alwaysShowContent=s,this._enableDisplayTransition=t.get("displayTransition")&&t.get("transitionDuration")>0,this.el.className=t.get("className")||""},t.prototype.show=function(t,e){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=n.style,o=this._styleCoord;n.innerHTML?i.cssText=II+function(t,e,n,i){var o=[],r=t.get("transitionDuration"),a=t.get("backgroundColor"),s=t.get("shadowBlur"),l=t.get("shadowColor"),u=t.get("shadowOffsetX"),h=t.get("shadowOffsetY"),d=t.getModel("textStyle"),p=aa(t,"html");return o.push("box-shadow:"+u+"px "+h+"px "+s+"px "+l),e&&r>0&&o.push(function(t,e,n){var i="cubic-bezier(0.23,1,0.32,1)",o="",r="";return n&&(r="opacity"+(o=" "+t/2+"s "+i)+",visibility"+o),e||(o=" "+t+"s "+i,r+=(r.length?",":"")+(Qp.transformSupported?""+kI+o:",left"+o+",top"+o)),CI+":"+r}(r,n,i)),a&&o.push("background-color:"+a),c(["width","color","radius"],function(e){var n="border-"+e,i=Vo(n),r=t.get(i);null!=r&&o.push(n+":"+r+("color"===e?"":"px"))}),o.push(function(t){var e=[],n=t.get("fontSize"),i=t.getTextColor();i&&e.push("color:"+i),e.push("font:"+t.getFont());var o=L(t.get("lineHeight"),Math.round(3*n/2));n&&e.push("line-height:"+o+"px");var r=t.get("textShadowColor"),a=t.get("textShadowBlur")||0,s=t.get("textShadowOffsetX")||0,l=t.get("textShadowOffsetY")||0;return r&&a&&e.push("text-shadow:"+s+"px "+l+"px "+a+"px "+r),c(["decoration","align"],function(n){var i=t.get(n);i&&e.push("text-"+n+":"+i)}),e.join(";")}(d)),null!=p&&o.push("padding:"+S_(p).join("px ")+"px"),o.join(";")+";"}(t,!this._firstShow,this._longHide,this._enableDisplayTransition)+Pc(o[0],o[1],!0)+"border-color:"+Wo(e)+";"+(t.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(t,e,n,i,o){var r=this.el;if(null!=t){var a="";if(_(o)&&"item"===n.get("trigger")&&!kc(n)&&(a=function(t,e,n){if(!_(n)||"inside"===n)return"";var i=t.get("backgroundColor"),o=t.get("borderWidth");e=Wo(e);var r,a,s="left"===(r=n)?"right":"right"===r?"left":"top"===r?"bottom":"top",u=Math.max(1.5*Math.round(o),6),h="",c=kI+":";l(["left","right"],s)>-1?(h+="top:50%",c+="translateY(-50%) rotate("+(a="left"===s?-225:-45)+"deg)"):(h+="left:50%",c+="translateX(-50%) rotate("+(a="top"===s?225:45)+"deg)");var d=a*Math.PI/180,p=u+o,f=p*Math.abs(Math.cos(d))+p*Math.abs(Math.sin(d)),g=e+" solid "+o+"px;";return'
'}(n,i,o)),_(t))r.innerHTML=t+a;else if(t){r.innerHTML="",y(t)||(t=[t]);for(var s=0;s=0?this._tryShow(n,i):"leave"===e&&this._hide(i))},this))},n.prototype._keepShow=function(){var t=this._tooltipModel,e=this._ecModel,n=this._api,i=t.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==i&&"click"!==i){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&o.manuallyShowTip(t,e,n,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},n.prototype.manuallyShowTip=function(t,e,n,i){if(i.from!==this.uid&&!Qp.node&&n.getDom()){var o=Rc(i,n);this._ticket="";var r=i.dataByCoordSys,a=function(t,e,n){var i=Dn(t).queryOptionMap,o=i.keys()[0];if(o&&"series"!==o){var r,a=An(e,o,i.get(o),{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];if(a)return n.getViewOfComponentModel(a).group.traverse(function(e){var n=Mv(e).tooltipConfig;if(n&&n.name===t.name)return r=e,!0}),r?{componentMainType:o,componentIndex:a.componentIndex,el:r}:void 0}}(i,e,n);if(a){var s=a.el.getBoundingRect().clone();s.applyTransform(a.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:a.el,position:i.position,positionDefault:"bottom"},o)}else if(i.tooltip&&null!=i.x&&null!=i.y){var l=AI;l.x=i.x,l.y=i.y,l.update(),Mv(l).tooltipConfig={name:null,option:i.tooltip},this._tryShow({offsetX:i.x,offsetY:i.y,target:l},o)}else if(r)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:r,tooltipOption:i.tooltipOption},o);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(t,e,n,i))return;var u=_c(i,e),h=u.point[0],c=u.point[1];null!=h&&null!=c&&this._tryShow({offsetX:h,offsetY:c,target:u.el,position:i.position,positionDefault:"bottom"},o)}else null!=i.x&&null!=i.y&&(n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},o))}},n.prototype.manuallyHideTip=function(t,e,n,i){this._tooltipModel&&this._tooltipContent.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(Rc(i,n))},n.prototype._manuallyAxisShowTip=function(t,e,n,i){var o=i.seriesIndex,r=i.dataIndex,a=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=o&&null!=r&&null!=a){var s=e.getSeriesByIndex(o);if(s&&"axis"===Ec([s.getData().getItemModel(r),s,(s.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:r,position:i.position}),!0}},n.prototype._tryShow=function(t,e){var n=t.target;if(this._tooltipModel){this._lastX=t.offsetX,this._lastY=t.offsetY;var i=t.dataByCoordSys;if(i&&i.length)this._showAxisTooltip(i,t);else if(n){var o,r;if("legend"===Mv(n).ssrType)return;this._lastDataByCoordSys=null,Os(n,function(t){if(t.tooltipDisabled)return o=r=null,!0;o||r||(null!=Mv(t).dataIndex?o=t:null!=Mv(t).tooltipConfig&&(r=t))},!0),o?this._showSeriesItemTooltip(t,o,e):r?this._showComponentItemTooltip(t,r,e):this._hide(e)}else this._lastDataByCoordSys=null,this._hide(e)}},n.prototype._showOrMove=function(t,e){var n=t.get("showDelay");e=_f(e,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(e,n):e()},n.prototype._showAxisTooltip=function(t,e){var n=this._ecModel,i=this._tooltipModel,o=[e.offsetX,e.offsetY],r=Ec([e.tooltipOption],i),s=this._renderMode,l=[],u=$r("section",{blocks:[],noHeader:!0}),h=[],d=new mw;c(t,function(t){c(t.dataByAxis,function(t){var e=n.getComponent(t.axisDim+"Axis",t.axisIndex),o=t.value;if(e&&null!=o){var r=cc(o,e.axis,n,t.seriesDataIndices,t.valueLabelOpt),p=$r("section",{header:r,noHeader:!z(r),sortBlocks:!0,blocks:[]});u.blocks.push(p),c(t.seriesDataIndices,function(u){var c=n.getSeriesByIndex(u.seriesIndex),f=u.dataIndexInside,g=c.getDataParams(f);if(!(g.dataIndex<0)){g.axisDim=t.axisDim,g.axisIndex=t.axisIndex,g.axisType=t.axisType,g.axisId=t.axisId,g.axisValue=dh(e.axis,{value:o}),g.axisValueLabel=r,g.marker=d.makeTooltipMarker("item",Wo(g.color),s);var m=zr(c.formatTooltip(f,!0,null)),y=m.frag;if(y){var v=Ec([c],i).get("valueFormatter");p.blocks.push(v?a({valueFormatter:v},y):y)}m.text&&h.push(m.text),l.push(g)}})}})}),u.blocks.reverse(),h.reverse();var p=e.position,f=r.get("order"),g=ia(u,d,s,f,n.get("useUTC"),r.get("textStyle"));g&&h.unshift(g);var m=h.join("richText"===s?"\n\n":"
");this._showOrMove(r,function(){this._updateContentNotChangedOnAxis(t,l)?this._updatePosition(r,p,o[0],o[1],this._tooltipContent,l):this._showTooltipContent(r,m,l,Math.random()+"",o[0],o[1],p,null,d)})},n.prototype._showSeriesItemTooltip=function(t,e,n){var i=this._ecModel,o=Mv(e),r=o.seriesIndex,s=i.getSeriesByIndex(r),l=o.dataModel||s,u=o.dataIndex,h=o.dataType,c=l.getData(h),d=this._renderMode,p=t.positionDefault,f=Ec([c.getItemModel(u),l,s&&(s.coordinateSystem||{}).model],this._tooltipModel,p?{position:p}:null),g=f.get("trigger");if(null==g||"item"===g){var m=l.getDataParams(u,h),y=new mw;m.marker=y.makeTooltipMarker("item",Wo(m.color),d);var v=zr(l.formatTooltip(u,!1,h)),_=f.get("order"),x=f.get("valueFormatter"),w=v.frag,b=w?ia(x?a({valueFormatter:x},w):w,y,d,_,i.get("useUTC"),f.get("textStyle")):v.text,S="item_"+l.name+"_"+u;this._showOrMove(f,function(){this._showTooltipContent(f,b,m,S,t.offsetX,t.offsetY,t.position,t.target,y)}),n({type:"showTip",dataIndexInside:u,dataIndex:c.getRawIndex(u),seriesIndex:r,from:this.uid})}},n.prototype._showComponentItemTooltip=function(t,e,n){var i="html"===this._renderMode,r=Mv(e),a=r.tooltipConfig.option||{},s=a.encodeHTMLContent;_(a)&&(a={content:a,formatter:a},s=!0),s&&i&&a.content&&((a=o(a)).content=lt(a.content));var l=[a],u=this._ecModel.getComponent(r.componentMainType,r.componentIndex);u&&l.push(u),l.push({formatter:a.content});var h=t.positionDefault,c=Ec(l,this._tooltipModel,h?{position:h}:null),d=c.get("content"),p=Math.random()+"",f=new mw;this._showOrMove(c,function(){var n=o(c.get("formatterParams")||{});this._showTooltipContent(c,d,n,p,t.offsetX,t.offsetY,t.position,e,f)}),n({type:"showTip",from:this.uid})},n.prototype._showTooltipContent=function(t,e,n,i,o,r,a,s,l){if(this._ticket="",t.get("showContent")&&t.get("show")){var u=this._tooltipContent;u.setEnterable(t.get("enterable"));var h=t.get("formatter");a=a||t.get("position");var c=e,d=this._getNearestPoint([o,r],n,t.get("trigger"),t.get("borderColor"),t.get("defaultBorderColor",!0)).color;if(h)if(_(h)){var p=t.ecModel.get("useUTC"),f=y(n)?n[0]:n;c=h,f&&f.axisType&&f.axisType.indexOf("time")>=0&&(c=bo(f.axisValue,c,p)),c=Ho(c,n,!0)}else if(v(h)){var g=_f(function(e,i){e===this._ticket&&(u.setContent(i,l,t,d,a),this._updatePosition(t,a,o,r,u,n,s))},this);this._ticket=i,c=h(n,i,g)}else c=h;u.setContent(c,l,t,d,a),u.show(t,d),this._updatePosition(t,a,o,r,u,n,s)}},n.prototype._getNearestPoint=function(t,e,n,i,o){return"axis"===n||y(e)?{color:i||o}:y(e)?void 0:{color:i||e.color||e.borderColor}},n.prototype._updatePosition=function(t,e,n,i,o,r,a){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u=o.getSize(),h=t.get("align"),c=t.get("verticalAlign"),d=a&&a.getBoundingRect().clone();if(a&&d.applyTransform(a.transform),v(e)&&(e=e([n,i],r,o.el,d,{viewSize:[s,l],contentSize:u.slice()})),y(e))n=jm(e[0],s),i=jm(e[1],l);else if(b(e)){var p=e;p.width=u[0],p.height=u[1];var f=Yo(p,{width:s,height:l});n=f.x,i=f.y,h=null,c=null}else if(_(e)&&a){var g=function(t,e,n,i){var o=n[0],r=n[1],a=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=e.width,h=e.height;switch(t){case"inside":s=e.x+u/2-o/2,l=e.y+h/2-r/2;break;case"top":s=e.x+u/2-o/2,l=e.y-r-a;break;case"bottom":s=e.x+u/2-o/2,l=e.y+h+a;break;case"left":s=e.x-o-a,l=e.y+h/2-r/2;break;case"right":s=e.x+u+a,l=e.y+h/2-r/2}return[s,l]}(e,d,u,t.get("borderWidth"));n=g[0],i=g[1]}else g=function(t,e,n,i,o,r,a){var s=n.getSize(),l=s[0],u=s[1];return null!=r&&(t+l+r+2>i?t-=l+r:t+=r),null!=a&&(e+u+a>o?e-=u+a:e+=a),[t,e]}(n,i,o,s,l,h?null:20,c?null:20),n=g[0],i=g[1];h&&(n-=Bc(h)?u[0]/2:"right"===h?u[0]:0),c&&(i-=Bc(c)?u[1]/2:"bottom"===c?u[1]:0),kc(t)&&(g=function(t,e,n,i,o){var r=n.getSize(),a=r[0],s=r[1];return t=Math.min(t+a,i)-a,e=Math.min(e+s,o)-s,[t=Math.max(t,0),e=Math.max(e,0)]}(n,i,o,s,l),n=g[0],i=g[1]),o.moveTo(n,i)},n.prototype._updateContentNotChangedOnAxis=function(t,e){var n=this._lastDataByCoordSys,i=this._cbParamsList,o=!!n&&n.length===t.length;return o&&c(n,function(n,r){var a=n.dataByAxis||[],s=(t[r]||{}).dataByAxis||[];(o=o&&a.length===s.length)&&c(a,function(t,n){var r=s[n]||{},a=t.seriesDataIndices||[],l=r.seriesDataIndices||[];(o=o&&t.value===r.value&&t.axisType===r.axisType&&t.axisId===r.axisId&&a.length===l.length)&&c(a,function(t,e){var n=l[e];o=o&&t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex}),i&&c(t.seriesDataIndices,function(t){var n=t.seriesIndex,r=e[n],a=i[n];r&&a&&a.data!==r.data&&(o=!1)})})}),this._lastDataByCoordSys=t,this._cbParamsList=e,!!o},n.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},n.prototype.dispose=function(t,e){!Qp.node&&e.getDom()&&(_s(this,"_updatePosition"),this._tooltipContent.dispose(),vc("itemTooltip",e))},n.type="tooltip",n}(ww);const zI=OI;var EI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.layoutMode={type:"box",ignoreSize:!0},e}return e(n,t),n.type="title",n.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:"center",top:X_.size.m,backgroundColor:X_.color.transparent,borderColor:X_.color.primary,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:X_.color.primary},subtextStyle:{fontSize:12,color:X_.color.quaternary}},n}(W_),RI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){if(this.group.removeAll(),t.get("show")){var i=this.group,o=t.getModel("textStyle"),r=t.getModel("subtextStyle"),a=t.get("textAlign"),s=L(t.get("textBaseline"),t.get("textVerticalAlign")),l=new Tv({style:co(o,{text:t.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),h=t.get("subtext"),c=new Tv({style:co(r,{text:h,fill:r.getTextColor(),y:u.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),d=t.get("link"),p=t.get("sublink"),f=t.get("triggerEvent",!0);l.silent=!d&&!f,c.silent=!p&&!f,d&&l.on("click",function(){jo(d,"_"+t.get("target"))}),p&&c.on("click",function(){jo(p,"_"+t.get("subtarget"))}),Mv(l).eventData=Mv(c).eventData=f?{componentType:"title",componentIndex:t.componentIndex}:null,i.add(l),h&&i.add(c);var g=i.getBoundingRect(),m=t.getBoxLayoutParams();m.width=g.width,m.height=g.height;var y=Yo(m,Xo(t,n).refContainer,t.get("padding"));a||("middle"===(a=t.get("left")||t.get("right"))&&(a="center"),"right"===a?y.x+=y.width:"center"===a&&(y.x+=y.width/2)),s||("center"===(s=t.get("top")||t.get("bottom"))&&(s="middle"),"bottom"===s?y.y+=y.height:"middle"===s&&(y.y+=y.height/2),s=s||"top"),i.x=y.x,i.y=y.y,i.markRedraw();var v={align:a,verticalAlign:s};l.setStyle(v),c.setStyle(v),g=i.getBoundingRect();var _=y.margin,x=t.getItemStyle(["color","opacity"]);x.fill=t.get("backgroundColor");var w=new mv({shape:{x:g.x-_[3],y:g.y-_[0],width:g.width+_[1]+_[3],height:g.height+_[0]+_[2],r:t.get("borderRadius")},style:x,subPixelOptimize:!0,silent:!0});i.add(w)}},n.type="title",n}(ww),BI=["x","y","radius","angle","single"],NI=["cartesian2d","polar","singleAxis"],FI=function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(t){this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},t}();const VI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="dataZoom.select",n}(function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e._autoThrottle=!0,e._noTarget=!0,e._rangePropMode=["percent","percent"],e}return e(n,t),n.prototype.init=function(t,e,n){var i=Fc(t);this.settledOption=i,this.mergeDefaultAndTheme(t,n),this._doInit(i)},n.prototype.mergeOption=function(t){var e=Fc(t);r(this.option,t,!0),r(this.settledOption,e,!0),this._doInit(e)},n.prototype._doInit=function(t){var e=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var n=this.settledOption;c([["start","startValue"],["end","endValue"]],function(t,i){"value"===this._rangePropMode[i]&&(e[t[0]]=n[t[0]]=null)},this),this._resetTarget()},n.prototype._resetTarget=function(){var t=this.get("orient",!0),e=this._targetAxisInfoMap=B();this._fillSpecifiedTargetAxis(e)?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(e,this._orient)),this._noTarget=!0,e.each(function(t){t.indexList.length&&(this._noTarget=!1)},this)},n.prototype._fillSpecifiedTargetAxis=function(t){var e=!1;return c(BI,function(n){var i=this.getReferringComponents(Nc(n),$m);if(i.specified){e=!0;var o=new FI;c(i.models,function(t){o.add(t.componentIndex)}),t.set(n,o)}},this),e},n.prototype._fillAutoTargetAxisByOrient=function(t,e){function n(e,n){var i=e[0];if(i){var r=new FI;if(r.add(i.componentIndex),t.set(n,r),o=!1,"x"===n||"y"===n){var a=i.getReferringComponents("grid",Km).models[0];a&&c(e,function(t){i.componentIndex!==t.componentIndex&&a===t.getReferringComponents("grid",Km).models[0]&&r.add(t.componentIndex)})}}}var i=this.ecModel,o=!0;if(o){var r="vertical"===e?"y":"x";n(i.findComponents({mainType:r+"Axis"}),r)}o&&n(i.findComponents({mainType:"singleAxis",filter:function(t){return t.get("orient",!0)===e}}),"single"),o&&c(BI,function(e){if(o){var n=i.findComponents({mainType:Nc(e),filter:function(t){return"category"===t.get("type",!0)}});if(n[0]){var r=new FI;r.add(n[0].componentIndex),t.set(e,r),o=!1}}},this)},n.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis(function(e){!t&&(t=e)},this),"y"===t?"vertical":"horizontal"},n.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var e=this.ecModel.option;this.option.throttle=e.animation&&e.animationDurationUpdate>0?100:20}},n.prototype._updateRangeUse=function(t){var e=this._rangePropMode,n=this.get("rangeMode");c([["start","startValue"],["end","endValue"]],function(i,o){var r=null!=t[i[0]],a=null!=t[i[1]];r&&!a?e[o]="percent":!r&&a?e[o]="value":n?e[o]=n[o]:r&&(e[o]="percent")})},n.prototype.noTarget=function(){return this._noTarget},n.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis(function(e,n){null==t&&(t=this.ecModel.getComponent(Nc(e),n))},this),t},n.prototype.eachTargetAxis=function(t,e){this._targetAxisInfoMap.each(function(n,i){c(n.indexList,function(n){t.call(e,i,n)})})},n.prototype.getAxisProxy=function(t,e){var n=this.getAxisModel(t,e);if(n)return n.__dzAxisProxy},n.prototype.getAxisModel=function(t,e){var n=this._targetAxisInfoMap.get(t);if(n&&n.indexMap[e])return this.ecModel.getComponent(Nc(t),e)},n.prototype.setRawRange=function(t){var e=this.option,n=this.settledOption;c([["start","startValue"],["end","endValue"]],function(i){null==t[i[0]]&&null==t[i[1]]||(e[i[0]]=n[i[0]]=t[i[0]],e[i[1]]=n[i[1]]=t[i[1]])},this),this._updateRangeUse(t)},n.prototype.setCalculatedRange=function(t){var e=this.option;c(["start","startValue","end","endValue"],function(n){e[n]=t[n]})},n.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},n.prototype.getValueRange=function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var n=this.findRepresentativeAxisProxy();return n?n.getDataValueWindow():void 0},n.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var e,n=this._targetAxisInfoMap.keys(),i=0;i=0}(e)){var n=Nc(this._dimName),i=e.getReferringComponents(n,Km).models[0];i&&this._axisIndex===i.componentIndex&&t.push(e)}},this),t},t.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},t.prototype.getMinMaxSpan=function(){return o(this._minMaxSpan)},t.prototype.calculateDataWindow=function(t){function e(t,e,n,i,r){var a=r?"Span":"ValueSpan";Vc(0,t,n,"all",u["min"+a],u["max"+a]);for(var s=0;s<2;s++)e[s]=nn(t[s],n,i,!0),r&&(e[s]=o.parse(e[s]))}var n,i=this._dataExtent,o=this.getAxisModel().axis.scale,r=this._dataZoomModel.getRangePropMode(),a=[0,100],s=[],l=[];HI(["start","end"],function(e,u){var h=t[e],c=t[e+"Value"];"percent"===r[u]?(null==h&&(h=a[u]),c=o.parse(nn(h,a,i))):(n=!0,h=nn(c=null==c?i[u]:o.parse(c),i,a)),l[u]=null==c||isNaN(c)?i[u]:c,s[u]=null==h||isNaN(h)?a[u]:h}),WI(l),WI(s);var u=this._minMaxSpan;return n?e(l,s,i,a,!1):e(s,l,a,i,!0),{valueWindow:l,percentWindow:s}},t.prototype.reset=function(t){if(t===this._dataZoomModel){var e=this.getTargetSeriesModels();this._dataExtent=function(t,e,n){var i=[1/0,-1/0];HI(n,function(t){!function(t,e,n){e&&c(gh(e,n),function(n){var i=e.getApproximateExtent(n);i[0]t[1]&&(t[1]=i[1])})}(i,t.getData(),e)});var o=t.getAxisModel(),r=sh(o.axis.scale,o,i).calculate();return[r.min,r.max]}(this,this._dimName,e),this._updateMinMaxSpan();var n=this.calculateDataWindow(t.settledOption);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,this._setAxisModel()}},t.prototype.filterData=function(t,e){if(t===this._dataZoomModel){var n=this._dimName,i=this.getTargetSeriesModels(),o=t.get("filterMode"),r=this._valueWindow;"none"!==o&&HI(i,function(t){var e=t.getData(),i=e.mapDimensionsAll(n);if(i.length){if("weakFilter"===o){var a=e.getStore(),s=d(i,function(t){return e.getDimensionIndex(t)},e);e.filterSelf(function(t){for(var e,n,o,l=0;lr[1];if(h&&!c&&!d)return!0;h&&(o=!0),c&&(e=!0),d&&(n=!0)}return o&&e&&n})}else HI(i,function(n){if("empty"===o)t.setData(e=e.map(n,function(t){return function(t){return t>=r[0]&&t<=r[1]}(t)?t:NaN}));else{var i={};i[n]=r,e.selectRange(i)}});HI(i,function(t){e.setApproximateExtent(r,t)})}})}},t.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},e=this._dataZoomModel,n=this._dataExtent;HI(["min","max"],function(i){var o=e.get(i+"Span"),r=e.get(i+"ValueSpan");null!=r&&(r=this.getAxisModel().axis.scale.parse(r)),null!=r?o=nn(n[0]+r,n,[0,100],!0):null!=o&&(r=nn(o,[0,100],n,!0)-n[0]),t[i+"Span"]=o,t[i+"ValueSpan"]=r},this)},t.prototype._setAxisModel=function(){var t=this.getAxisModel(),e=this._percentWindow,n=this._valueWindow;if(e){var i=sn(n,[0,500]);i=Math.min(i,20);var o=t.axis.scale.rawExtentInfo;0!==e[0]&&o.setDeterminedMinMax("min",+n[0].toFixed(i)),100!==e[1]&&o.setDeterminedMinMax("max",+n[1].toFixed(i)),o.freeze()}},t}();const GI=jI,UI={getTargetSeries:function(t){function e(e){t.eachComponent("dataZoom",function(n){n.eachTargetAxis(function(i,o){var r=t.getComponent(Nc(i),o);e(i,o,r,n)})})}e(function(t,e,n,i){n.__dzAxisProxy=null});var n=[];e(function(e,i,o,r){o.__dzAxisProxy||(o.__dzAxisProxy=new GI(e,i,r,t),n.push(o.__dzAxisProxy))});var i=B();return c(n,function(t){c(t.getTargetSeriesModels(),function(t){i.set(t.uid,t)})}),i},overallReset:function(t,e){t.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(e,n){t.getAxisProxy(e,n).reset(t)}),t.eachTargetAxis(function(n,i){t.getAxisProxy(n,i).filterData(t,e)})}),t.eachComponent("dataZoom",function(t){var e=t.findRepresentativeAxisProxy();if(e){var n=e.getDataPercentWindow(),i=e.getDataValueWindow();t.setCalculatedRange({start:n[0],end:n[1],startValue:i[0],endValue:i[1]})}})}};var YI=!1,XI=function(){},qI={};const KI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.optionUpdated=function(){t.prototype.optionUpdated.apply(this,arguments);var e=this.ecModel;c(this.option.feature,function(t,n){var i=Gc(n);i&&(i.getDefaultOption&&(i.defaultOption=i.getDefaultOption(e)),r(t,i.defaultOption))})},n.type="toolbox",n.layoutMode={type:"box",ignoreSize:!0},n.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:X_.color.border,borderRadius:0,borderWidth:0,padding:X_.size.m,itemSize:15,itemGap:X_.size.s,showTitle:!0,iconStyle:{borderColor:X_.color.accent50,color:"none"},emphasis:{iconStyle:{borderColor:X_.color.accent50}},tooltip:{show:!1,position:"bottom"}},n}(W_);var $I=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.render=function(t,e,n,i){function o(o,d){var p,f=h[o],g=h[d],m=l[f],y=new i_(m,t,t.ecModel);if(i&&null!=i.newTitle&&i.featureName===f&&(m.title=i.newTitle),f&&!g){if(function(t){return 0===t.indexOf("my")}(f))p={onclick:y.option.onclick,featureName:f};else{var v=Gc(f);if(!v)return;p=new v}u[f]=p}else if(!(p=u[g]))return;p.uid=mo("toolbox-feature"),p.model=y,p.ecModel=e,p.api=n;var x=p instanceof XI;f||!g?!y.get("show")||x&&p.unusable?x&&p.remove&&p.remove(e,n):(function(i,o,l){var u,h,d=i.getModel("iconStyle"),p=i.getModel(["emphasis","iconStyle"]),f=o instanceof XI&&o.getIcons?o.getIcons():i.get("icon"),g=i.get("title")||{};_(f)?(u={})[l]=f:u=f,_(g)?(h={})[l]=g:h=g;var m=i.iconPaths={};c(u,function(l,u){var c=$a(l,{},{x:-a/2,y:-a/2,width:a,height:a});c.setStyle(d.getItemStyle()),c.ensureState("emphasis").style=p.getItemStyle();var f=new Tv({style:{text:h[u],align:p.get("textAlign"),borderRadius:p.get("textBorderRadius"),padding:p.get("textPadding"),fill:null,font:go({fontStyle:p.get("textFontStyle"),fontFamily:p.get("textFontFamily"),fontSize:p.get("textFontSize"),fontWeight:p.get("textFontWeight")},e)},ignore:!0});c.setTextContent(f),is({el:c,componentModel:t,itemName:u,formatterParamsExtra:{title:h[u]}}),c.__title=h[u],c.on("mouseover",function(){var e=p.getItemStyle(),i=s?null==t.get("right")&&"right"!==t.get("left")?"right":"left":null==t.get("bottom")&&"bottom"!==t.get("top")?"bottom":"top";f.setStyle({fill:p.get("textFill")||e.fill||e.stroke||X_.color.neutral99,backgroundColor:p.get("textBackgroundColor")}),c.setTextConfig({position:p.get("textPosition")||i}),f.ignore=!t.get("showTitle"),n.enterEmphasis(this)}).on("mouseout",function(){"emphasis"!==i.get(["iconStatus",u])&&n.leaveEmphasis(this),f.hide()}),("emphasis"===i.get(["iconStatus",u])?ji:Gi)(c),r.add(c),c.on("click",_f(o.onclick,o,e,n,u)),m[u]=c})}(y,p,f),y.setIconStatus=function(t,e){var n=this.option,i=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[t]=e,i[t]&&("emphasis"===e?ji:Gi)(i[t])},p instanceof XI&&p.render&&p.render(y,e,n,i)):x&&p.dispose&&p.dispose(e,n)}var r=this.group;if(r.removeAll(),t.get("show")){var a=+t.get("itemSize"),s="vertical"===t.get("orient"),l=t.get("feature")||{},u=this._features||(this._features={}),h=[];c(l,function(t,e){h.push(e)}),new gM(this._featureNames||[],h).add(o).update(o).remove(m(o,null)).execute(),this._featureNames=h;var d=Xo(t,n).refContainer,p=t.getBoxLayoutParams(),f=t.get("padding"),g=Yo(p,d,f);F_(t.get("orient"),r,t.get("itemGap"),g.width,g.height),qo(r,p,d,f),r.add(Uc(r.getBoundingRect(),t)),s||r.eachChild(function(t){var e=t.__title,i=t.ensureState("emphasis"),o=i.textConfig||(i.textConfig={}),s=t.getTextContent(),l=s&&s.ensureState("emphasis");if(l&&!v(l)&&e){var u=l.style||(l.style={}),h=Ge(e,Tv.makeFont(u)),c=t.x+r.x,d=!1;t.y+r.y+a+h.height>n.getHeight()&&(o.position="top",d=!0);var p=d?-5-h.height:a+10;c+h.width/2>n.getWidth()?(o.position=["100%",p],u.align="right"):c-h.width/2<0&&(o.position=[0,p],u.align="left")}})}},n.prototype.updateView=function(t,e,n,i){c(this._features,function(t){t instanceof XI&&t.updateView&&t.updateView(t.model,e,n,i)})},n.prototype.remove=function(t,e){c(this._features,function(n){n instanceof XI&&n.remove&&n.remove(t,e)}),this.group.removeAll()},n.prototype.dispose=function(t,e){c(this._features,function(n){n instanceof XI&&n.dispose&&n.dispose(t,e)})},n.type="toolbox",n}(ww);const JI=$I,QI=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.onclick=function(t,e){var n=this.model,i=n.get("name")||t.get("title.0.text")||"echarts",o="svg"===e.getZr().painter.getType(),r=o?"svg":n.get("type",!0)||"png",a=e.getConnectedDataURL({type:r,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||X_.color.neutral00,connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),s=Qp.browser;if("function"!=typeof MouseEvent||!s.newEdge&&(s.ie||s.edge))if(window.navigator.msSaveOrOpenBlob||o){var l=a.split(","),u=l[0].indexOf("base64")>-1,h=o?decodeURIComponent(l[1]):l[1];u&&(h=window.atob(h));var c=i+"."+r;if(window.navigator.msSaveOrOpenBlob){for(var d=h.length,p=new Uint8Array(d);d--;)p[d]=h.charCodeAt(d);var f=new Blob([p]);window.navigator.msSaveOrOpenBlob(f,c)}else{var g=document.createElement("iframe");document.body.appendChild(g);var m=g.contentWindow,y=m.document;y.open("image/svg+xml","replace"),y.write(h),y.close(),m.focus(),y.execCommand("SaveAs",!0,c),document.body.removeChild(g)}}else{var v=n.get("lang"),_='',x=window.open();x.document.write(_),x.document.title=i}else{var w=document.createElement("a");w.download=i+"."+r,w.target="_blank",w.href=a;var b=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});w.dispatchEvent(b)}},n.getDefaultOption=function(t){return{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:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:X_.color.neutral00,name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])}},n}(XI);var tL="__ec_magicType_stack__",eL=[["line","bar"],["stack"]],nL=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.getIcons=function(){var t=this.model,e=t.get("icon"),n={};return c(t.get("type"),function(t){e[t]&&(n[t]=e[t])}),n},n.getDefaultOption=function(t){return{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:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},n.prototype.onclick=function(t,e,n){var i=this.model,o=i.get(["seriesIndex",n]);if(iL[n]){var a,u={series:[]};c(eL,function(t){l(t,n)>=0&&c(t,function(t){i.setIconStatus(t,"normal")})}),i.setIconStatus(n,"emphasis"),t.eachComponent({mainType:"series",query:null==o?null:{seriesIndex:o}},function(t){var e=iL[n](t.subType,t.id,t,i);e&&(s(e,t.option),u.series.push(e));var o=t.coordinateSystem;if(o&&"cartesian2d"===o.type&&("line"===n||"bar"===n)){var r=o.getAxesByScale("ordinal")[0];if(r){var a=r.dim+"Axis",l=t.getReferringComponents(a,Km).models[0].componentIndex;u[a]=u[a]||[];for(var h=0;h<=l;h++)u[a][l]=u[a][l]||{};u[a][l].boundaryGap="bar"===n}}});var h=n;"stack"===n&&(a=r({stack:i.option.title.tiled,tiled:i.option.title.stack},i.option.title),"emphasis"!==i.get(["iconStatus",n])&&(h="tiled")),e.dispatchAction({type:"changeMagicType",currentType:h,newOption:u,newTitle:a,featureName:"magicType"})}},n}(XI),iL={line:function(t,e,n,i){if("bar"===t)return r({id:e,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(t,e,n,i){if("line"===t)return r({id:e,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(t,e,n,i){var o=n.get("stack")===tL;if("line"===t||"bar"===t)return i.setIconStatus("stack",o?"normal":"emphasis"),r({id:e,stack:o?"":tL},i.get(["option","stack"])||{},!0)}};fl({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)});const oL=nL;var rL=new Array(60).join("-"),aL="\t",sL=new RegExp("[\t]+","g"),lL=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.onclick=function(t,e){function n(){i.removeChild(r),C._dom=null}setTimeout(function(){e.dispatchAction({type:"hideTip"})});var i=e.getDom(),o=this.model;this._dom&&i.removeChild(this._dom);var r=document.createElement("div");r.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",r.style.backgroundColor=o.get("backgroundColor")||X_.color.neutral00;var a=document.createElement("h4"),s=o.get("lang")||[];a.innerHTML=s[0]||o.get("title"),a.style.cssText="margin:10px 20px",a.style.color=o.get("textColor");var l=document.createElement("div"),u=document.createElement("textarea");l.style.cssText="overflow:auto";var h=o.get("optionToContent"),p=o.get("contentToOption"),g=function(t){var e,n,i,o=function(t){var e={},n=[],i=[];return t.eachRawSeries(function(t){var o=t.coordinateSystem;if(!o||"cartesian2d"!==o.type&&"polar"!==o.type)n.push(t);else{var r=o.getBaseAxis();if("category"===r.type){var a=r.dim+"_"+r.index;e[a]||(e[a]={categoryAxis:r,valueAxis:o.getOtherAxis(r),series:[]},i.push({axisDim:r.dim,axisIndex:r.index})),e[a].series.push(t)}else n.push(t)}}),{seriesGroupByCategoryAxis:e,other:n,meta:i}}(t);return{value:f([(n=o.seriesGroupByCategoryAxis,i=[],c(n,function(t,e){var n=t.categoryAxis,o=t.valueAxis.dim,r=[" "].concat(d(t.series,function(t){return t.name})),a=[n.model.getCategories()];c(t.series,function(t){var e=t.getRawData();a.push(t.getRawData().mapArray(e.mapDimension(o),function(t){return t}))});for(var s=[r.join(aL)],l=0;l=0)return!0}(t)){var o=function(t){for(var e=t.split(/\n+/g),n=[],i=d(Yc(e.shift()).split(sL),function(t){return{name:t,data:[]}}),o=0;oi.getWidth()||n<0||n>i.getHeight()}(t,e.offsetX,e.offsetY)){var i=t._zr,o=t._covers,r=nd(t,e,n);if(!t._dragging)for(var a=0;a=0)&&t(o,i._targetInfoList)})}return t.prototype.setOutputRanges=function(t,e){return this.matchOutputRanges(t,e,function(t,e,n){if((t.coordRanges||(t.coordRanges=[])).push(e),!t.coordRange){t.coordRange=e;var i=AL[t.brushType](0,n,e);t.__rangeOffset={offset:OL[t.brushType](i.values,t.range,[1,1]),xyMinMax:i.xyMinMax}}}),t},t.prototype.matchOutputRanges=function(t,e,n){c(t,function(t){var i=this.findTargetInfo(t,e);i&&!0!==i&&c(i.coordSyses,function(i){var o=AL[t.brushType](1,i,t.range,!0);n(t,o.values,i,e)})},this)},t.prototype.setInputRanges=function(t,e){c(t,function(t){var n,i,o,r,a=this.findTargetInfo(t,e);if(t.range=t.range||[],a&&!0!==a){t.panelId=a.panelId;var s=AL[t.brushType](0,a.coordSys,t.coordRange),l=t.__rangeOffset;t.range=l?OL[t.brushType](s.values,l.offset,(n=l.xyMinMax,i=Ad(s.xyMinMax),o=Ad(n),r=[i[0]/o[0],i[1]/o[1]],isNaN(r[0])&&(r[0]=1),isNaN(r[1])&&(r[1]=1),r)):s.values}},this)},t.prototype.makePanelOpts=function(t,e){return d(this._targetInfoList,function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:e?e(n):null,clipPath:Td(i),isTargetByCursor:Cd(i,t,n.coordSysModel),getLinearBrushOtherExtent:Md(i)}})},t.prototype.controlSeries=function(t,e,n){var i=this.findTargetInfo(t,n);return!0===i||i&&l(i.coordSyses,e.coordinateSystem)>=0},t.prototype.findTargetInfo=function(t,e){for(var n=this._targetInfoList,i=Ld(e,t),o=0;o=0||l(i,t.getAxis("y").model)>=0)&&o.push(t)}),e.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:o[0],coordSyses:o,getPanelRect:DL.grid,xAxisDeclared:a[t.id],yAxisDeclared:s[t.id]})}))},geo:function(t,e){c(t.geoModels,function(t){var n=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:n,coordSyses:[n],getPanelRect:DL.geo})})}},PL=[function(t,e){var n=t.xAxisModel,i=t.yAxisModel,o=t.gridModel;return!o&&n&&(o=n.axis.grid.model),!o&&i&&(o=i.axis.grid.model),o&&o===e.gridModel},function(t,e){var n=t.geoModel;return n&&n===e.geoModel}],DL={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(ja(t)),e}},AL={lineX:m(Pd,0),lineY:m(Pd,1),rect:function(t,e,n,i){var o=t?e.pointToData([n[0][0],n[1][0]],i):e.dataToPoint([n[0][0],n[1][0]],i),r=t?e.pointToData([n[0][1],n[1][1]],i):e.dataToPoint([n[0][1],n[1][1]],i),a=[Id([o[0],r[0]]),Id([o[1],r[1]])];return{values:a,xyMinMax:a}},polygon:function(t,e,n,i){var o=[[1/0,-1/0],[1/0,-1/0]];return{values:d(n,function(n){var r=t?e.pointToData(n,i):e.dataToPoint(n,i);return o[0][0]=Math.min(o[0][0],r[0]),o[1][0]=Math.min(o[1][0],r[1]),o[0][1]=Math.max(o[0][1],r[0]),o[1][1]=Math.max(o[1][1],r[1]),r}),xyMinMax:o}}},OL={lineX:m(Dd,0),lineY:m(Dd,1),rect:function(t,e,n){return[[t[0][0]-n[0]*e[0][0],t[0][1]-n[0]*e[0][1]],[t[1][0]-n[1]*e[1][0],t[1][1]-n[1]*e[1][1]]]},polygon:function(t,e,n){return d(t,function(t,i){return[t[0]-n[0]*e[i][0],t[1]-n[1]*e[i][1]]})}};const zL=IL;var EL,RL=c,BL=Ym+"toolbox-dataZoom_",NL=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.render=function(t,e,n,i){this._brushController||(this._brushController=new CL(n.getZr()),this._brushController.on("brush",_f(this._onBrush,this)).mount()),function(t,e,n,i,o){var r=n._isZoomActive;i&&"takeGlobalCursor"===i.type&&(r="dataZoomSelect"===i.key&&i.dataZoomSelectActive),n._isZoomActive=r,t.setIconStatus("zoom",r?"emphasis":"normal");var a=new zL(Od(t),e,{include:["grid"]}).makePanelOpts(o,function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"});n._brushController.setPanels(a).enableBrush(!(!r||!a.length)&&{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()})}(t,e,this,i,n),function(t,e){t.setIconStatus("back",function(t){return qc(t).length}(e)>1?"emphasis":"normal")}(t,e)},n.prototype.onclick=function(t,e,n){FL[n].call(this)},n.prototype.remove=function(t,e){this._brushController&&this._brushController.unmount()},n.prototype.dispose=function(t,e){this._brushController&&this._brushController.dispose()},n.prototype._onBrush=function(t){function e(t,e,n){var r=e.getAxis(t),a=r.model,s=function(t,e,n){var i;return n.eachComponent({mainType:"dataZoom",subType:"select"},function(n){n.getAxisModel(t,e.componentIndex)&&(i=n)}),i}(t,a,o),l=s.findRepresentativeAxisProxy(a).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(n=Vc(0,n.slice(),r.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(i[s.id]={dataZoomId:s.id,startValue:n[0],endValue:n[1]})}var n=t.areas;if(t.isEnd&&n.length){var i={},o=this.ecModel;this._brushController.updateCovers([]),new zL(Od(this.model),o,{include:["grid"]}).matchOutputRanges(n,o,function(t,n,i){if("cartesian2d"===i.type){var o=t.brushType;"rect"===o?(e("x",i,n[0]),e("y",i,n[1])):e({lineX:"x",lineY:"y"}[o],i,n)}}),function(t,e){var n=qc(t);hL(e,function(e,i){for(var o=n.length-1;o>=0&&!n[o][i];o--);if(o<0){var r=t.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(r){var a=r.getPercentRange();n[0][i]={dataZoomId:i,start:a[0],end:a[1]}}}}),n.push(e)}(o,i),this._dispatchZoomAction(i)}},n.prototype._dispatchZoomAction=function(t){var e=[];RL(t,function(t,n){e.push(o(t))}),e.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:e})},n.getDefaultOption=function(t){return{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:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:X_.color.backgroundTint}}},n}(XI),FL={zoom:function(){this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:!this._isZoomActive})},back:function(){this._dispatchZoomAction(function(t){var e=qc(t),n=e[e.length-1];e.length>1&&e.pop();var i={};return hL(n,function(t,n){for(var o=e.length-1;o>=0;o--)if(t=e[o][n]){i[n]=t;break}}),i}(this.ecModel))}};EL=function(t){function e(t,e,n){var i=t.componentIndex,a={type:"select",$fromToolbox:!0,filterMode:o.get("filterMode",!0)||"filter",id:BL+e+i};a[n]=i,r.push(a)}var n=t.getComponent("toolbox",0),i=["feature","dataZoom"];if(n&&null!=n.get(i)){var o=n.getModel(i),r=[],a=Pn(t,Od(o));return RL(a.xAxisModels,function(t){return e(t,"xAxis","xAxisIndex")}),RL(a.yAxisModels,function(t){return e(t,"yAxis","yAxisIndex")}),r}},O(null==mx.get("dataZoom")&&EL),mx.set("dataZoom",EL);const VL=NL,ZL=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.layoutMode={type:"box",ignoreSize:!0},e}return e(n,t),n.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),t.selected=t.selected||{},this._updateSelector(t)},n.prototype.mergeOption=function(e,n){t.prototype.mergeOption.call(this,e,n),this._updateSelector(e)},n.prototype._updateSelector=function(t){var e=t.selector,n=this.ecModel;!0===e&&(e=t.selector=["all","inverse"]),y(e)&&c(e,function(t,i){_(t)&&(t={type:t}),e[i]=r(t,function(t,e){return"all"===e?{type:"all",title:t.getLocaleModel().get(["legend","selector","all"])}:"inverse"===e?{type:"inverse",title:t.getLocaleModel().get(["legend","selector","inverse"])}:void 0}(n,t.type))})},n.prototype.optionUpdated=function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&"single"===this.get("selectedMode")){for(var e=!1,n=0;n=0},n.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},n.type="legend.plain",n.dependencies=["series"],n.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",bottom:X_.size.m,align:"auto",backgroundColor:X_.color.transparent,borderColor:X_.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:X_.color.disabled,inactiveBorderColor:X_.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:X_.color.disabled,inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:X_.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:X_.color.tertiary,borderWidth:1,borderColor:X_.color.border},emphasis:{selectorLabel:{show:!0,color:X_.color.quaternary}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},n}(W_);var HL=m,WL=c,jL=Em,GL=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.newlineDisabled=!1,e}return e(n,t),n.prototype.init=function(){this.group.add(this._contentGroup=new jL),this.group.add(this._selectorGroup=new jL),this._isFirstRender=!0},n.prototype.getContentGroup=function(){return this._contentGroup},n.prototype.getSelectorGroup=function(){return this._selectorGroup},n.prototype.render=function(t,e,n){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var o=t.get("align"),r=t.get("orient");o&&"auto"!==o||(o="right"===t.get("left")&&"vertical"===r?"right":"left");var a=t.get("selector",!0),l=t.get("selectorPosition",!0);!a||l&&"auto"!==l||(l="horizontal"===r?"end":"start"),this.renderInner(o,t,e,n,a,r,l);var u=Xo(t,n).refContainer,h=t.getBoxLayoutParams(),c=t.get("padding"),d=Yo(h,u,c),p=this.layoutInner(t,o,d,i,a,l),f=Yo(s({width:p.width,height:p.height},h),u,c);this.group.x=f.x-p.x,this.group.y=f.y-p.y,this.group.markRedraw(),this.group.add(this._backgroundEl=Uc(p,t))}},n.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},n.prototype.renderInner=function(t,e,n,i,o,r,s){var l=this.getContentGroup(),u=B(),h=e.get("selectedMode"),c=e.get("triggerEvent"),d=[];n.eachRawSeries(function(t){!t.get("legendHoverLink")&&d.push(t.id)}),WL(e.getData(),function(o,r){var s=this,p=o.get("name");if(!this.newlineDisabled&&(""===p||"\n"===p)){var f=new jL;return f.newline=!0,void l.add(f)}var g=n.getSeriesByName(p)[0];if(!u.get(p))if(g){var m=g.getData(),y=m.getVisual("legendLineStyle")||{},v=m.getVisual("legendIcon"),_=m.getVisual("style"),x=this._createItem(g,p,r,o,e,t,y,_,v,h,i);x.on("click",HL(zd,p,null,i,d)).on("mouseover",HL(Rd,g.name,null,i,d)).on("mouseout",HL(Bd,g.name,null,i,d)),n.ssr&&x.eachChild(function(t){var e=Mv(t);e.seriesIndex=g.seriesIndex,e.dataIndex=r,e.ssrType="legend"}),c&&x.eachChild(function(t){s.packEventData(t,e,g,r,p)}),u.set(p,!0)}else n.eachRawSeries(function(s){var l=this;if(!u.get(p)&&s.legendVisualProvider){var f=s.legendVisualProvider;if(!f.containName(p))return;var g=f.indexOfName(p),m=f.getItemVisual(g,"style"),y=f.getItemVisual(g,"legendIcon"),v=oe(m.fill);v&&0===v[3]&&(v[3]=.2,m=a(a({},m),{fill:le(v,"rgba")}));var _=this._createItem(s,p,r,o,e,t,{},m,y,h,i);_.on("click",HL(zd,null,p,i,d)).on("mouseover",HL(Rd,null,p,i,d)).on("mouseout",HL(Bd,null,p,i,d)),n.ssr&&_.eachChild(function(t){var e=Mv(t);e.seriesIndex=s.seriesIndex,e.dataIndex=r,e.ssrType="legend"}),c&&_.eachChild(function(t){l.packEventData(t,e,s,r,p)}),u.set(p,!0)}},this)},this),o&&this._createSelector(o,e,i,r,s)},n.prototype.packEventData=function(t,e,n,i,o){var r={componentType:"legend",componentIndex:e.componentIndex,dataIndex:i,value:o,seriesIndex:n.seriesIndex};Mv(t).eventData=r},n.prototype._createSelector=function(t,e,n,i,o){var r=this.getSelectorGroup();WL(t,function(t){var i=t.type,o=new Tv({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect",legendId:e.id})}});r.add(o),uo(o,{normal:e.getModel("selectorLabel"),emphasis:e.getModel(["emphasis","selectorLabel"])},{defaultText:t.title}),no(o)})},n.prototype._createItem=function(t,e,n,i,o,r,a,s,l,u,h){var c,d,p,f=t.visualDrawType,g=o.get("itemWidth"),m=o.get("itemHeight"),y=o.isSelected(e),x=i.get("symbolRotate"),w=i.get("symbolKeepAspect"),b=i.get("icon"),S=function(t,e,n,i,o,r,a){function s(t,e){"auto"===t.lineWidth&&(t.lineWidth=e.lineWidth>0?2:0),WL(t,function(n,i){"inherit"===t[i]&&(t[i]=e[i])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),h=0===t.lastIndexOf("empty",0)?"fill":"stroke",c=l.getShallow("decal");u.decal=c&&"inherit"!==c?nl(c,a):i.decal,"inherit"===u.fill&&(u.fill=i[o]),"inherit"===u.stroke&&(u.stroke=i[h]),"inherit"===u.opacity&&(u.opacity=("fill"===o?i:n).opacity),s(u,i);var d=e.getModel("lineStyle"),p=d.getLineStyle();if(s(p,n),"auto"===u.fill&&(u.fill=i.fill),"auto"===u.stroke&&(u.stroke=i.fill),"auto"===p.stroke&&(p.stroke=i.fill),!r){var f=e.get("inactiveBorderWidth");u.lineWidth="auto"===f?i.lineWidth>0&&u[h]?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),p.stroke=d.get("inactiveColor"),p.lineWidth=d.get("inactiveWidth")}return{itemStyle:u,lineStyle:p}}(l=b||l||"roundRect",i,a,s,f,y,h),T=new jL,M=i.getModel("textStyle");if(!v(t.getLegendIcon)||b&&"inherit"!==b){var C="inherit"===b&&t.getData().getVisual("symbol")?"inherit"===x?t.getData().getVisual("symbolRotate"):x:0;T.add(((p=Es(d=(c={itemWidth:g,itemHeight:m,icon:l,iconRotate:C,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:w}).icon||"roundRect",0,0,c.itemWidth,c.itemHeight,c.itemStyle.fill,c.symbolKeepAspect)).setStyle(c.itemStyle),p.rotation=(c.iconRotate||0)*Math.PI/180,p.setOrigin([c.itemWidth/2,c.itemHeight/2]),d.indexOf("empty")>-1&&(p.style.stroke=p.style.fill,p.style.fill=X_.color.neutral00,p.style.lineWidth=2),p))}else T.add(t.getLegendIcon({itemWidth:g,itemHeight:m,icon:l,iconRotate:x,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:w}));var k="left"===r?g+5:-5,I=r,L=o.get("formatter"),P=e;_(L)&&L?P=L.replace("{name}",null!=e?e:""):v(L)&&(P=L(e));var D=y?M.getTextColor():i.get("inactiveColor");T.add(new Tv({style:co(M,{text:P,x:k,y:m/2,fill:D,align:I,verticalAlign:"middle"},{inheritColor:D})}));var A=new mv({shape:T.getBoundingRect(),style:{fill:"transparent"}}),O=i.getModel("tooltip");return O.get("show")&&is({el:A,componentModel:o,itemName:e,itemTooltipOption:O.option}),T.add(A),T.eachChild(function(t){t.silent=!0}),A.silent=!u,this.getContentGroup().add(T),no(T),T.__legendDataIndex=n,T},n.prototype.layoutInner=function(t,e,n,i,o,r){var a=this.getContentGroup(),s=this.getSelectorGroup();F_(t.get("orient"),a,t.get("itemGap"),n.width,n.height);var l=a.getBoundingRect(),u=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),o){F_("horizontal",s,t.get("selectorItemGap",!0));var h=s.getBoundingRect(),c=[-h.x,-h.y],d=t.get("selectorButtonGap",!0),p=t.getOrient().index,f=0===p?"width":"height",g=0===p?"height":"width",m=0===p?"y":"x";"end"===r?c[p]+=l[f]+d:u[p]+=h[f]+d,c[1-p]+=l[g]/2-h[g]/2,s.x=c[0],s.y=c[1],a.x=u[0],a.y=u[1];var y={x:0,y:0};return y[f]=l[f]+d+h[f],y[g]=Math.max(l[g],h[g]),y[m]=Math.min(0,h[m]+c[1-p]),y}return a.x=u[0],a.y=u[1],this.group.getBoundingRect()},n.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},n.type="legend.plain",n}(ww);const UL=GL,YL=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}var i;return e(n,t),n.prototype.setScrollDataIndex=function(t){this.option.scrollDataIndex=t},n.prototype.init=function(e,n,i){var o=Jo(e);t.prototype.init.call(this,e,n,i),Hd(this,e,o)},n.prototype.mergeOption=function(e,n){t.prototype.mergeOption.call(this,e,n),Hd(this,this.option,e)},n.type="legend.scroll",n.defaultOption=(i={scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:X_.color.accent50,pageIconInactiveColor:X_.color.accent10,pageIconSize:15,pageTextStyle:{color:X_.color.tertiary},animationDurationUpdate:800},r(r({},ZL.defaultOption,!0),i,!0)),n}(ZL);var XL=Em,qL=["width","height"],KL=["x","y"],$L=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.newlineDisabled=!0,e._currentIndex=0,e}return e(n,t),n.prototype.init=function(){t.prototype.init.call(this),this.group.add(this._containerGroup=new XL),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new XL)},n.prototype.resetInner=function(){t.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},n.prototype.renderInner=function(e,n,i,o,r,a,s){function l(t,e){var i=t+"DataIndex",r=$a(n.get("pageIcons",!0)[n.getOrient().name][e],{onclick:_f(u._pageGo,u,i,n,o)},{x:-d[0]/2,y:-d[1]/2,width:d[0],height:d[1]});r.name=t,h.add(r)}var u=this;t.prototype.renderInner.call(this,e,n,i,o,r,a,s);var h=this._controllerGroup,c=n.get("pageIconSize",!0),d=y(c)?c:[c,c];l("pagePrev",0);var p=n.getModel("pageTextStyle");h.add(new Tv({name:"pageText",style:{text:"xx/xx",fill:p.getTextColor(),font:p.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),l("pageNext",1)},n.prototype.layoutInner=function(t,e,n,i,r,a){var s=this.getSelectorGroup(),l=t.getOrient().index,u=qL[l],h=KL[l],c=qL[1-l],d=KL[1-l];r&&F_("horizontal",s,t.get("selectorItemGap",!0));var p=t.get("selectorButtonGap",!0),f=s.getBoundingRect(),g=[-f.x,-f.y],m=o(n);r&&(m[u]=n[u]-f[u]-p);var y=this._layoutContentAndController(t,i,m,l,u,c,d,h);if(r){if("end"===a)g[l]+=y[u]+p;else{var v=f[u]+p;g[l]-=v,y[h]-=v}y[u]+=f[u]+p,g[1-l]+=y[d]+y[c]/2-f[c]/2,y[c]=Math.max(y[c],f[c]),y[d]=Math.min(y[d],f[d]+g[1-l]),s.x=g[0],s.y=g[1],s.markRedraw()}return y},n.prototype._layoutContentAndController=function(t,e,n,i,o,r,a,s){var l=this.getContentGroup(),u=this._containerGroup,h=this._controllerGroup;F_(t.get("orient"),l,t.get("itemGap"),i?n.width:null,i?null:n.height),F_("horizontal",h,t.get("pageButtonItemGap",!0));var c=l.getBoundingRect(),d=h.getBoundingRect(),p=this._showController=c[o]>n[o],f=[-c.x,-c.y];e||(f[i]=l[s]);var g=[0,0],m=[-d.x,-d.y],y=L(t.get("pageButtonGap",!0),t.get("itemGap",!0));p&&("end"===t.get("pageButtonPosition",!0)?m[i]+=n[o]-d[o]:g[i]+=d[o]+y),m[1-i]+=c[r]/2-d[r]/2,l.setPosition(f),u.setPosition(g),h.setPosition(m);var v={x:0,y:0};if(v[o]=p?n[o]:c[o],v[r]=Math.max(c[r],d[r]),v[a]=Math.min(0,d[a]+m[1-i]),u.__rectSize=n[o],p){var _={x:0,y:0};_[o]=Math.max(n[o]-d[o]-y,0),_[r]=v[r],u.setClipPath(new mv({shape:_})),u.__rectSize=_[o]}else h.eachChild(function(t){t.attr({invisible:!0,silent:!0})});var x=this._getPageInfo(t);return null!=x.pageIndex&&Ia(l,{x:x.contentPosition[0],y:x.contentPosition[1]},p?t:null),this._updatePageInfoView(t,x),v},n.prototype._pageGo=function(t,e,n){var i=this._getPageInfo(e)[t];null!=i&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:e.id})},n.prototype._updatePageInfoView=function(t,e){var n=this._controllerGroup;c(["pagePrev","pageNext"],function(i){var o=null!=e[i+"DataIndex"],r=n.childOfName(i);r&&(r.setStyle("fill",t.get(o?"pageIconColor":"pageIconInactiveColor",!0)),r.cursor=o?"pointer":"default")});var i=n.childOfName("pageText"),o=t.get("pageFormatter"),r=e.pageIndex,a=null!=r?r+1:0,s=e.pageCount;i&&o&&i.setStyle("text",_(o)?o.replace("{current}",null==a?"":a+"").replace("{total}",null==s?"":s+""):o({current:a,total:s}))},n.prototype._getPageInfo=function(t){function e(t){if(t){var e=t.getBoundingRect(),n=e[l]+t[l];return{s:n,e:n+e[s],i:t.__legendDataIndex}}}function n(t,e){return t.e>=e&&t.s<=e+r}var i=t.get("scrollDataIndex",!0),o=this.getContentGroup(),r=this._containerGroup.__rectSize,a=t.getOrient().index,s=qL[a],l=KL[a],u=this._findTargetItemIndex(i),h=o.children(),c=h[u],d=h.length,p=d?1:0,f={contentPosition:[o.x,o.y],pageCount:p,pageIndex:p-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!c)return f;var g=e(c);f.contentPosition[a]=-g.s;for(var m=u+1,y=g,v=g,_=null;m<=d;++m)(!(_=e(h[m]))&&v.e>y.s+r||_&&!n(_,y.s))&&(y=v.i>y.i?v:_)&&(null==f.pageNextDataIndex&&(f.pageNextDataIndex=y.i),++f.pageCount),v=_;for(m=u-1,y=g,v=g,_=null;m>=-1;--m)(_=e(h[m]))&&n(v,_.s)||!(y.i=0;u--){var p,f,g;if(g=null!=(f=Mn((p=n[u]).id,null))?o.get(f):null){d=cP(m=g.parent);var m,y={},v=qo(g,p,m===i?{width:r,height:a}:{width:d.width,height:d.height},null,{hv:p.hv,boundingMode:p.bounding},y);if(!cP(g).isNew&&v){for(var _=p.transition,x={},w=0;w=0)?x[b]=S:g[b]=S}Ia(g,x,t,0)}else g.attr(y)}}},n.prototype._clear=function(){var t=this,e=this._elMap;e.each(function(n){op(n,cP(n).option,e,t._lastGraphicModel)}),this._elMap=B()},n.prototype.dispose=function(){this._clear()},n.type="graphic",n}(ww),pP=Math.sin,fP=Math.cos,gP=Math.PI,mP=2*Math.PI,yP=180/gP;const vP=function(){function t(){}return t.prototype.reset=function(t){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,t||4)},t.prototype.moveTo=function(t,e){this._add("M",t,e)},t.prototype.lineTo=function(t,e){this._add("L",t,e)},t.prototype.bezierCurveTo=function(t,e,n,i,o,r){this._add("C",t,e,n,i,o,r)},t.prototype.quadraticCurveTo=function(t,e,n,i){this._add("Q",t,e,n,i)},t.prototype.arc=function(t,e,n,i,o,r){this.ellipse(t,e,n,n,0,i,o,r)},t.prototype.ellipse=function(t,e,n,i,o,r,a,s){var l,u=a-r,h=!s,c=Math.abs(u),d=de(c-mP)||(h?u>=mP:-u>=mP),p=u>0?u%mP:u%mP+mP;l=!!d||!de(c)&&p>=gP==!!h;var f=t+n*fP(r),g=e+i*pP(r);this._start&&this._add("M",f,g);var m=Math.round(o*yP);if(d){var y=1/this._p,v=(h?1:-1)*(mP-y);this._add("A",n,i,m,1,+h,t+n*fP(r+v),e+i*pP(r+v)),y>.01&&this._add("A",n,i,m,0,+h,f,g)}else{var _=t+n*fP(a),x=e+i*pP(a);this._add("A",n,i,m,+l,+h,_,x)}},t.prototype.rect=function(t,e,n,i){this._add("M",t,e),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},t.prototype.closePath=function(){this._d.length>0&&this._add("Z")},t.prototype._add=function(t,e,n,i,o,r,a,s,l){for(var u=[],h=this._p,c=1;c"].join(i):""}(o.cssNodes,o.cssAnims,{newline:!0});if(u){var h=sp("style","stl",{},[],u);r.push(h)}}return hp(n,i,r,t.useViewBox)},t.prototype.renderToString=function(t){return lp(this.renderToVNode({animation:L((t=t||{}).cssAnimation,!0),emphasis:L(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:L(t.useViewBox,!0)}),{newline:!0})},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t},t.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},t.prototype._paintList=function(t,e,n){for(var i,o,r=t.length,a=[],s=0,l=0,u=0;u=0&&(!c||!o||c[f]!==o[f]);f--);for(var g=p-1;g>f;g--)i=a[--s-1];for(var m=f+1;m=s)}}if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;for(var r,a=[],s=this.maxRepaintRectCount,l=!1,u=new lg(0,0,0,0),h=this.__startIndex;h15)break}n.prevElClipPaths&&c.restore()};if(p)if(0===p.length)s=h.__endIndex;else for(var x=d.dpr,w=0;w0&&t>i[0]){for(s=0;st);s++);a=n[i[s]]}if(i.splice(s+1,0,t),n[t]=e,!e.virtual)if(a){var l=a.dom;l.nextSibling?r.insertBefore(e.dom,l.nextSibling):r.appendChild(e.dom)}else r.firstChild?r.insertBefore(e.dom,r.firstChild):r.appendChild(e.dom);e.painter||(e.painter=this)}},t.prototype.eachLayer=function(t,e){for(var n=this._zlevelList,i=0;i0?HP:0),this._needsManuallyCompositing),h.__builtin__||i("ZLevel "+u+" has been used by unkown layer "+h.id),h!==a&&(h.__used=!0,h.__startIndex!==r&&(h.__dirty=!0),h.__startIndex=r,h.__drawIndex=h.incremental?-1:r,e(r),a=h),1&l.__dirty&&!l.__inHover&&(h.__dirty=!0,h.incremental&&h.__drawIndex<0&&(h.__drawIndex=r))}e(r),this.eachBuiltinLayer(function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)})},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(t){t.clear()},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t,c(this._layers,function(t){t.setUnpainted()})},t.prototype.configLayer=function(t,e){if(e){var n=this._layerConfig;n[t]?r(n[t],e,!0):n[t]=e;for(var i=0;i{let r="right";return o.viewSize[0]-t[0]"graph"===t.componentSubType?"edge"===t.dataType?e.utils.getLinkTooltipInfo(t.data):e.utils.getNodeTooltipInfo(t.data):"lines"===t.componentSubType?e.utils.getLinkTooltipInfo(t.data.link):e.utils.getNodeTooltipInfo(t.data.node)}},n.echartsOption);return i.setOption(e.utils.deepMergeObj(o,t)),i.on("click",t=>{const i=n.onClickElement.bind(e);e.utils.addActionToUrl(e,t),"graph"!==t.componentSubType?"lines"!==t.componentSubType?t.data.cluster||(n.mapOptions?.nodePopup?.show&&e.gui.loadNodePopup(t.data.node),i("node",t.data.node)):i("link",t.data.link):i("edge"===t.dataType?"link":"node",t.data)},{passive:!0}),i}generateGraphOption(t,e){const n=[],i=e.config,o=t.nodes.map(t=>{const n=e.utils.fastDeepCopy(t),{nodeStyleConfig:o,nodeSizeConfig:r,nodeEmphasisConfig:a}=e.utils.getNodeStyle(t,i,"graph");n.itemStyle=o,n.symbolSize=r,n.emphasis={itemStyle:a.nodeStyle,symbolSize:a.nodeSize};let s="";return"string"==typeof t.label?s=t.label:"string"==typeof t.name?s=t.name:null!=t.id&&(s=String(t.id)),n.name=s,n._source=e.utils.fastDeepCopy(t),n}),r=t.links.map(t=>{const n=e.utils.fastDeepCopy(t),{linkStyleConfig:o,linkEmphasisConfig:r}=e.utils.getLinkStyle(t,i,"graph");return n.lineStyle=o,n.emphasis={lineStyle:r.linkStyle},n}),a={...i.graphConfig.series},s={...a.label||{}};if("number"==typeof e.config.showGraphLabelsAtZoom&&e.config.showGraphLabelsAtZoom>0){const t=e.config.showGraphLabelsAtZoom;s.formatter=n=>(()=>{try{const t=e.echarts.getOption(),n=(Array.isArray(t.series)?t.series:[]).find(t=>t&&"network-graph"===t.id);return n&&"number"==typeof n.zoom?n.zoom:1}catch(t){return 1}})()>=t&&n&&n.data&&n.data.name||""}a.label=s;const l=[{...a,id:"network-graph",type:"graph",layout:i.graphConfig.series.layout||"force",nodes:o,links:r}];return{legend:n.length?{data:n}:void 0,series:l,...i.graphConfig.baseOptions}}generateMapOption(t,e,n=[]){const i=e.config,{nodes:o,links:r}=t,a=t.flatNodes||{},s=[];let l=[];o.forEach(n=>{if(n.properties&&(t.flatNodes||(a[n.id]=e.utils.fastDeepCopy(n))),!n.properties||!n.properties._featureType||"Point"===n.properties._featureType)if(n.properties){const{location:t}=n.properties;if(t&&t.lng&&t.lat){const{nodeEmphasisConfig:o}=e.utils.getNodeStyle(n,i,"map");let r="";"string"==typeof n.label?r=n.label:"string"==typeof n.name?r=n.name:null!=n.id&&(r=String(n.id)),l.push({name:r,value:[t.lng,t.lat],emphasis:{itemStyle:o.nodeStyle,symbolSize:o.nodeSize},node:n,_source:e.utils.fastDeepCopy(n)})}else console.error(`Node ${n.id} position is undefined!`)}else console.error(`Node ${n.id} position is undefined!`)}),r.forEach(t=>{if(a[t.source])if(a[t.target]){const{linkStyleConfig:n,linkEmphasisConfig:o}=e.utils.getLinkStyle(t,i,"map");s.push({coords:[[a[t.source].properties.location.lng,a[t.source].properties.location.lat],[a[t.target].properties.location.lng,a[t.target].properties.location.lat]],lineStyle:n,emphasis:{lineStyle:o.linkStyle},link:t})}else console.warn(`Node ${t.target} does not exist!`);else console.warn(`Node ${t.source} does not exist!`)}),l=l.concat(n);const u=[{id:"geo-map",type:"scatter",name:"nodes",coordinateSystem:"leaflet",data:l,label:{...i.mapOptions.nodeConfig.label||{},...!1===i.showMapLabelsAtZoom?{show:!1}:{},silent:!0},itemStyle:{color:t=>{if(t.data&&t.data.cluster&&t.data.itemStyle&&t.data.itemStyle.color)return t.data.itemStyle.color;if(t.data&&t.data.node&&t.data.node.category){const e=i.nodeCategories.find(e=>e.name===t.data.node.category);return e&&e.nodeStyle&&e.nodeStyle.color||i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeStyle&&i.mapOptions.nodeConfig.nodeStyle.color||"#6c757d"}return i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeStyle&&i.mapOptions.nodeConfig.nodeStyle.color||"#6c757d"}},symbolSize:(t,n)=>{if(n.data&&n.data.cluster)return i.mapOptions.clusterConfig&&i.mapOptions.clusterConfig.symbolSize||30;if(n.data&&n.data.node){const{nodeSizeConfig:t}=e.utils.getNodeStyle(n.data.node,i,"map");return"object"==typeof t?i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeSize||17:t}return i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeSize||17},emphasis:i.mapOptions.nodeConfig.emphasis},Object.assign(i.mapOptions.linkConfig,{id:"map-links",type:"lines",coordinateSystem:"leaflet",data:s})];return{leaflet:{tiles:i.mapTileConfig,mapOptions:i.mapOptions},series:u,...i.mapOptions.baseOptions}}_propagateGraphZoom(t){const e=t.echarts.getDom&&t.echarts.getDom();if(!e)return;const n=e.querySelector("canvas");e.addEventListener("wheel",t=>{if(!n)return;const i=e.getBoundingClientRect();if(t.clientXi.right||t.clientYi.bottom)return;t.preventDefault();const o=n.getBoundingClientRect();n.dispatchEvent(new WheelEvent("wheel",{bubbles:!0,cancelable:!0,view:window,clientX:o.left+o.width/2,clientY:o.top+o.height/2,deltaY:-t.deltaY,deltaMode:t.deltaMode}))},{passive:!1})}graphRender(t,e){e.utils.echartsSetOption(e.utils.generateGraphOption(t,e),e),window.onresize=()=>{e.echarts.resize()},e.utils._propagateGraphZoom(e),e.config.showGraphLabelsAtZoom>0&&e.echarts.on("graphRoam",t=>{if(!t||!t.zoom)return;const n=e.echarts.getOption(),i=n&&n.series&&n.series[0]&&n.series[0].zoom>=e.config.showGraphLabelsAtZoom;i!==e._labelsVisible&&(e.echarts.resize({animation:!1,silent:!0}),e._labelsVisible=i)}),e.utils.setupHashChangeHandler(e),e.event.emit("onLoad"),e.event.emit("onReady"),e.event.emit("renderArray"),e.event.emit("applyUrlFragmentState")}mapRender(t,e){const n=xl();if(!n)throw new Error("Leaflet api is not loaded");const{circleMarker:i,latLngBounds:o}=n;if(!e.config.mapTileConfig[0])throw new Error('You must add the tiles via the "mapTileConfig" param!');e.utils.isGeoJSON(t)&&(e.originalGeoJSON=e.utils.fastDeepCopy(t),t=e.utils.geojsonToNetjson(t));const r=e.utils.generateMapOption(t,e);if(e.utils.echartsSetOption(r,e),e.bboxData={nodes:[],links:[]},e.leaflet=e.echarts._api.getCoordinateSystems()[0].getLeaflet(),e.leaflet._zoomAnimated=!1,e.config.geoOptions=e.utils.deepMergeObj({pointToLayer:(t,n)=>i(n,e.config.geoOptions.style),onEachFeature:(t,n)=>{n.on("click",()=>{const n={...t.properties};e.config.onClickElement.call(e,"Feature",n)})}},e.config.geoOptions),e.originalGeoJSON){!function(t){if(!t.originalGeoJSON||!Array.isArray(t.originalGeoJSON.features))return;const e=xl();if(!e)return;const{geoJSON:n}=e,i=t.leaflet,o=t.originalGeoJSON.features.filter(t=>t&&t.geometry&&("Polygon"===t.geometry.type||"MultiPolygon"===t.geometry.type));if(!o.length)return;let r=i.getPane("njg-polygons");r||(r=i.createPane("njg-polygons"),r.style.zIndex=410);const a={fillColor:"#1566a9",color:"#1566a9",weight:0,fillOpacity:.6},s=n({type:"FeatureCollection",features:o},{pane:"njg-polygons",style:e=>{const n=e.properties&&e.properties.echartsStyle||{},i={...a,...t.config.geoOptions&&t.config.geoOptions.style};return n.areaColor&&(i.fillColor=n.areaColor),n.color&&(i.color=n.color),void 0!==n.opacity&&(i.fillOpacity=n.opacity),void 0!==n.borderWidth&&(i.weight=n.borderWidth),i},onEachFeature:(e,n)=>{n.on("click",()=>{t.config.onClickElement.call(t,"Feature",e.properties||{})})},...t.config.geoOptions}).addTo(i);t.leaflet.polygonGeoJSON=s}(e);let n=null;if(e.leaflet.polygonGeoJSON&&"function"==typeof e.leaflet.polygonGeoJSON.getBounds&&(n=e.leaflet.polygonGeoJSON.getBounds()),t.nodes&&t.nodes.length){const e=t.nodes.map(t=>t.properties.location).map(t=>[t.lat,t.lng]);n?e.forEach(t=>n.extend(t)):n=o(e)}n&&n.isValid()&&e.leaflet.fitBounds(n,{padding:[20,20]})}if(e.utils.updateLabelVisibility(e,!0),e.leaflet.on("zoomend",()=>{e.utils.updateLabelVisibility(e,!0);const t=e.leaflet.getZoom(),n=e.leaflet.getMinZoom(),i=e.leaflet.getMaxZoom(),o=document.querySelector(".leaflet-control-zoom-in"),r=document.querySelector(".leaflet-control-zoom-out");o&&r&&(Math.round(t)>=i?o.classList.add("leaflet-disabled"):o.classList.remove("leaflet-disabled"),Math.round(t)<=n?r.classList.add("leaflet-disabled"):r.classList.remove("leaflet-disabled"))}),e.leaflet.on("moveend",async()=>{const n=e.leaflet.getBounds();if(e.leaflet.getZoom()>=e.config.loadMoreAtZoomLevel&&e.hasMoreData){const i=await e.utils.getBBoxData.call(e,e.JSONParam,n);e.config.prepareData.call(e,i);const o=new Set(e.data.nodes.map(t=>t.id)),r=new Set(e.data.links.map(t=>t.source)),a=new Set(e.data.links.map(t=>t.target)),s=i.nodes.filter(t=>!o.has(t.id)),l=i.links.filter(t=>!r.has(t.source)&&!a.has(t.target)),u=new Set(i.nodes.map(t=>t.id)),h=e.bboxData.nodes.filter(t=>!u.has(t.id)),c=new Set(h.map(t=>t.id));t.nodes=t.nodes.filter(t=>!c.has(t.id)),e.bboxData.nodes=e.bboxData.nodes.concat(s),e.bboxData.links=e.bboxData.links.concat(l),t={...t,nodes:t.nodes.concat(s),links:t.links.concat(l)},e.echarts.setOption(e.utils.generateMapOption(t,e)),e.data=t}else e.hasMoreData&&e.bboxData.nodes.length>0&&(()=>{const n=new Set(e.bboxData.nodes),i=new Set(e.bboxData.links);t={...t,nodes:t.nodes.filter(t=>!n.has(t)),links:t.links.filter(t=>!i.has(t))},e.data=t,e.echarts.setOption(e.utils.generateMapOption(t,e)),e.bboxData.nodes=[],e.bboxData.links=[]})()}),e.config.clustering&&e.config.clusteringThresholde.config.disableClusteringAtLevel&&(n=[],i=t.nodes,o=t.links),e.echarts.setOption(e.utils.generateMapOption({...t,nodes:i,links:o},e,n)),e.utils.updateLabelVisibility(e,!0),e.echarts.on("click",t=>{if(("scatter"===t.componentSubType||"effectScatter"===t.componentSubType)&&t.data.cluster){const n=e.leaflet.getZoom(),i=Math.min(n+2,e.leaflet.getMaxZoom());e.leaflet.setView([t.data.value[1],t.data.value[0]],i)}}),e.leaflet.on("zoomend",()=>{if(e.leaflet.getZoom(){e.echarts.appendData({seriesIndex:n,data:t.data})}),e.utils.mergeData(t,e)),e.config.afterUpdate.call(e)}addData(t,e){e.utils.mergeData(t,e),e.data.nodes&&e.data.nodes.length>0&&(e.data.nodes=e.utils.deduplicateNodesById(e.data.nodes)),e.utils.render(),e.config.afterUpdate.call(e)}mergeData(t,e){t.nodes||(t.nodes=[]);const n=new Set;e.data.nodes.forEach(t=>{t.id&&n.add(t.id)});const i=t.nodes.filter(t=>!t.id||!n.has(t.id)||(console.warn(`Duplicate node ID ${t.id} detected during merge and skipped.`),!1)),o=e.data.nodes.concat(i),r=e.data.links.concat(t.links||[]);Object.assign(e.data,t,{nodes:o,links:r})}},UP=class{constructor(t){this.self=t,this.renderModeSelector=null,this.controls=null,this.sideBar=null,this.metaInfoContainer=null,this.nodeLinkInfoContainer=null}createControls(){const t=document.createElement("div");return t.setAttribute("class","njg-controls"),this.self.el.appendChild(t),t}createRenderModeSelector(){const t=document.createElement("div"),e=document.createElement("span");return e.setAttribute("class","iconfont icon-eye"),t.setAttribute("class","njg-selectIcon"),t.appendChild(e),this.controls.appendChild(t),t}createSideBar(){const t=document.createElement("div");t.setAttribute("class","njg-sideBar"),t.classList.add("hidden");const e=document.createElement("button");return t.appendChild(e),e.classList.add("sideBarHandle"),e.onclick=()=>{t.classList.toggle("hidden");const e=document.querySelector(".njg-metaInfoContainer");(this.self.config.showMetaOnNarrowScreens||this.self.el.clientWidth>850)&&e&&(e.style.display="flex")},this.self.el.appendChild(t),t}hideInfoOnNarrowScreen(){!this.self.config.showMetaOnNarrowScreens&&this.self.el.clientWidth<850&&(this.metaInfoContainer.style.display="none"),"none"===this.metaInfoContainer.style.display&&"none"===this.nodeLinkInfoContainer.style.display&&this.sideBar.classList.add("hidden")}createMetaInfoContainer(){const t=document.createElement("div"),e=document.createElement("h2"),n=document.createElement("div");n.classList.add("njg-metaData"),t.classList.add("njg-metaInfoContainer");const i=document.createElement("span");return i.classList.add("njg-closeButton"),e.innerHTML="Info",i.innerHTML=" ✕",e.appendChild(i),t.appendChild(e),t.appendChild(n),this.metaInfoContainer=t,this.sideBar.appendChild(t),this.nodeLinkInfoContainer=this.createNodeLinkInfoContainer(),this.hideInfoOnNarrowScreen(),window.addEventListener("resize",this.hideInfoOnNarrowScreen.bind(this)),i.onclick=()=>{this.metaInfoContainer.style.display="none","none"===this.nodeLinkInfoContainer.style.display&&this.sideBar.classList.add("hidden")},t}createNodeLinkInfoContainer(){const t=document.createElement("div");return t.classList.add("njg-nodeLinkInfoContainer"),t.style.display="none",this.sideBar.appendChild(t),t}getNodeLinkInfo(t,e){const n=document.querySelectorAll(".njg-infoContainer"),i=document.querySelectorAll(".njg-headerContainer");for(let t=0;t"clients"===t?"Clients":/^clients\s*\[\d+\]$/i.test(t)?t.replace(/^clients/i,"Client"):"localAddresses"===t?"Local Addresses":t.replace(/_/g," "),u=(t,e,n,i=0)=>{if(null==n||"string"==typeof n&&(""===n.trim()||/^(undefined|null)$/i.test(n.trim()))&&"0"!==n)return;if(Array.isArray(n)){if(0===n.length){const n=document.createElement("div");n.classList.add("njg-infoItems"),n.style.paddingLeft=12*i+"px";const o=document.createElement("span");o.setAttribute("class","njg-keyLabel");const r=document.createElement("span");return r.setAttribute("class","njg-valueLabel"),o.innerHTML=l(e),r.innerHTML="[]",n.appendChild(o),n.appendChild(r),void t.appendChild(n)}if(n.every(t=>"object"!=typeof t||null===t)){const o=document.createElement("div");o.classList.add("njg-infoItems"),o.style.paddingLeft=12*i+"px";const r=document.createElement("span");r.setAttribute("class","njg-keyLabel");const a=document.createElement("span");return a.setAttribute("class","njg-valueLabel"),r.innerHTML=l(e),a.innerHTML=n.map(t=>"string"==typeof t?t.replace(/\n/g,"
"):String(t)).join("
"),o.appendChild(r),o.appendChild(a),void t.appendChild(o)}return void n.forEach((n,o)=>{u(t,`${e} [${o+1}]`,n,i)})}if("object"==typeof n){if("location"===e&&"number"==typeof n.lat&&"number"==typeof n.lng){const e=document.createElement("div");e.classList.add("njg-infoItems"),e.style.paddingLeft=12*i+"px";const o=document.createElement("span");o.setAttribute("class","njg-keyLabel");const r=document.createElement("span");return r.setAttribute("class","njg-valueLabel"),o.innerHTML="Location",r.innerHTML=`${Math.round(1e3*n.lat)/1e3}, ${Math.round(1e3*n.lng)/1e3}`,e.appendChild(o),e.appendChild(r),void t.appendChild(e)}const o=document.createElement("div");o.classList.add("njg-infoItems"),o.style.paddingLeft=12*i+"px";const r=document.createElement("span");r.setAttribute("class","njg-keyLabel");const a=document.createElement("span");return a.setAttribute("class","njg-valueLabel"),r.innerHTML=l(e),a.innerHTML="",o.appendChild(r),o.appendChild(a),t.appendChild(o),void Object.keys(n).forEach(e=>{u(t,e,n[e],i+1)})}const o=document.createElement("div");o.classList.add("njg-infoItems"),o.style.paddingLeft=12*i+"px";const r=document.createElement("span");r.setAttribute("class","njg-keyLabel");const a=document.createElement("span");a.setAttribute("class","njg-valueLabel"),r.innerHTML=l(e);const s="string"==typeof n?n.replace(/\n/g,"
"):String(n);a.innerHTML=s,o.appendChild(r),o.appendChild(a),t.appendChild(o)};Object.keys(e).forEach(t=>u(r,t,e[t],0)),o.appendChild(a),o.appendChild(s),this.nodeLinkInfoContainer.appendChild(o),this.nodeLinkInfoContainer.appendChild(r),s.onclick=()=>{this.nodeLinkInfoContainer.style.display="none",null!==this.metaInfoContainer&&"none"!==this.metaInfoContainer.style.display||this.sideBar.classList.add("hidden")}}async loadNodePopup(t){if(!this.self.leaflet)return void console.error("Leaflet map not available. Cannot load popup.");this.self.echarts?.setOption({media:[{option:{tooltip:{show:!1}}}]}),this.self.utils.updateLabelVisibility(this.self,!1);const e=t?.properties?.location||t?.location;if(!e)return void console.error("Node location not available. Cannot load popup.");const n=this.self.config.bookmarkableActions&&this.self.config.bookmarkableActions.id;let i=this.self.config.mapOptions.nodePopup.content;if(null==i)i=this.createDefaultPopupContent(t);else if("function"==typeof i){const e=i.call(this,t,this.self);this.self.leaflet.currentPopupRequest=e;try{i=await e}catch(t){if(this.self.utils.removeUrlFragment(n,"nodeId"),this.self.leaflet.currentPopupRequest!==e)return;return void console.error("Failed to build node popup content:",t)}if(this.self.leaflet.currentPopupRequest!==e)return void this.self.utils.removeUrlFragment(n,"nodeId")}const o=Object.fromEntries(Object.entries(this.self.config.mapOptions.nodePopup.config||{}).filter(([,t])=>null!=t)),r=window.L.popup({...o}).setLatLng(e).setContent(i).openOn(this.self.leaflet);this.self.leaflet.currentPopup=r;const{onOpen:a}=this.self.config.mapOptions.nodePopup;if(a&&"function"==typeof a)try{a.call(this,this.self)}catch(t){this.self.utils.removeUrlFragment(n,"nodeId"),console.error("Failed to run popup onOpen callback:",t)}const s=r.getElement()?.querySelector(".leaflet-popup-close-button");s?.addEventListener("click",()=>{this.self.echarts?.setOption({media:[{option:{tooltip:{show:!0}}}]}),this.self.utils.updateLabelVisibility(this.self,!0),this.self.utils.removeUrlFragment(n,"nodeId")})}createDefaultPopupContent(t){const e=document.createElement("div");e.classList.add("default-popup");const n=t?.location||t?.properties?.location,i=Number(n?.lat),o=Number(n?.lng),r=Number.isFinite(i)&&Number.isFinite(o),a={name:t?.name,id:t?.id,label:t?.label,location:r?`${i.toFixed(8)}, ${o.toFixed(8)}`:null};return Object.keys(a).forEach(t=>{const n=a[t];if(!n)return;const i=document.createElement("div");i.classList.add("njg-tooltip-item");const o=document.createElement("span");o.classList.add("njg-tooltip-key"),o.textContent=t;const r=document.createElement("span");r.classList.add("njg-tooltip-value"),r.textContent=String(n),i.appendChild(o),i.appendChild(r),e.appendChild(i)}),e}init(){this.sideBar=this.createSideBar(),this.self.config.switchMode&&(this.controls=this.createControls(),this.renderModeSelector=this.createRenderModeSelector())}},YP=function(){function t(t,e){this._map=t,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=e,this._projection=r.Mercator}function e(t,e,n,i){const{leafletModel:o,seriesModel:r}=n,a=o?o.coordinateSystem:r?r.coordinateSystem||(r.getReferringComponents("leaflet")[0]||{}).coordinateSystem:null;return a===this?a[t](i):null}const n=xl();if(!n)throw new Error("Leaflet api is not loaded");const{Layer:i,DomUtil:o,Projection:r,LatLng:a,map:s,control:l,tileLayer:u}=n,h=i.extend({initialize(t){this._container=t},onAdd(t){t.getPane(this.options.pane).appendChild(this._container),t.zoomControl.setPosition("topright")},onRemove(){o.remove(this._container)},_update(){}});return t.dimensions=["lng","lat"],t.prototype.dimensions=["lng","lat"],t.prototype.setZoom=function(t){this._zoom=t},t.prototype.setCenter=function(t){this._center=this._projection.project(new a(t[1],t[0]))},t.prototype.setMapOffset=function(t){this._mapOffset=t},t.prototype.getLeaflet=function(){return this._map},t.prototype.getViewRect=function(){const t=this._api;return new lg(0,0,t.getWidth(),t.getHeight())},t.prototype.getRoamTransform=function(){return[1,0,0,1,0,0]},t.prototype.dataToPoint=function(t){const e=new a(t[1],t[0]),n=this._map.latLngToLayerPoint(e),i=this._mapOffset;return[n.x-i[0],n.y-i[1]]},t.prototype.pointToData=function(t){const e=this._mapOffset,n=this._map.layerPointToLatLng({x:t[0]+e[0],y:t[1]+e[1]});return[n.lng,n.lat]},t.prototype.convertToPixel=m(e,"dataToPoint"),t.prototype.convertFromPixel=m(e,"pointToData"),t.create=function(e,n){let i;const o=[],r=n.getDom();return e.eachComponent("leaflet",e=>{const a=n.getZr().painter.getViewportRoot();if(i)throw new Error("Only one leaflet component can exist");if(!e.__map){let t=r.querySelector(".ec-extension-leaflet");t&&(a.style.left="0px",a.style.top="0px",r.removeChild(t)),t=document.createElement("div"),t.style.cssText="width:100%;height:100%",t.classList.add("ec-extension-leaflet"),r.appendChild(t),e.__map=s(t,e.get("mapOptions"));const n=e.__map,i=e.get("tiles"),o={};let c=!1;if(i.forEach(t=>{const e=u(t.urlTemplate,t.options);t.label?(c||(e.addTo(n),c=!0),o[t.label]=e):e.addTo(n)}),i.length>1){const t=e.get("layerControl");l.layers(o,{},t).addTo(n)}const d=document.createElement("div");d.style="position: absolute;left: 0;top: 0;z-index: 100",d.appendChild(a),new h(d).addTo(n)}i=new t(e.__map,n),o.push(i),i.setMapOffset(e.__mapOffset||[0,0]);const{center:c,zoom:d}=e.get("mapOptions");c&&d&&(i.setZoom(d),i.setCenter(c)),e.coordinateSystem=i}),e.eachSeries(t=>{"leaflet"===t.get("coordinateSystem")&&(t.coordinateSystem=i)}),o},t};Xp.version="1.0.0";const XP=Xp;window.L=t(481);let qP=!1;window.NetJSONGraph=class{constructor(t,e={}){return this.graph=new WT(t),this.config=this.initializeConfig(e),this.graph.setConfig(this.config),this.setupGraph(),this.config.onInit.call(this.graph),this.initializeECharts(),void 0===e.showMapLabelsAtZoom&&void 0!==e.showLabelsAtZoomLevel&&(console.warn("showLabelsAtZoomLevel has been renamed to showMapLabelsAtZoom, please update your code accordingly."),this.graph.config.showMapLabelsAtZoom=e.showLabelsAtZoomLevel),this.graph}initializeConfig(t={}){return{...t,render:"map"===t.render?GP.prototype.mapRender:GP.prototype.graphRender,onInit:this.onInit,onRender:this.onRender,onUpdate:this.onUpdate,afterUpdate:this.afterUpdate,onLoad:this.onLoad}}setupGraph(){Object.setPrototypeOf(GP.prototype,this.graph.utils),this.graph.gui=new UP(this.graph),this.graph.utils=new GP,this.graph.setUtils(),this.graph.event=this.graph.utils.createEvent()}initializeECharts(){qP||(XP(),qP=!0),this.graph.echarts=function(t,e,n){var i=!(n&&n.ssr);if(i){var o=ul(t);if(o)return o}var r=new xT(t,null,n);return r.id="ec_"+OT++,DT[r.id]=r,i&&On(t,zT,r.id),oT(r),HS.trigger("afterinit",r),r}(this.graph.el,0,{renderer:this.graph.config.svgRender?"svg":"canvas"})}onInit(){return this.config}onRender(){return this.utils.showLoading.call(this),this.gui.init(),this.config}onUpdate(){return this.config}afterUpdate(){return this.config}onLoad(){return this.config.metadata&&this.utils.isNetJSON(this.data)?(this.gui.createMetaInfoContainer(this.graph),this.utils.updateMetadata.call(this)):this.gui.nodeLinkInfoContainer=this.gui.createNodeLinkInfoContainer(),this.config.switchMode&&this.utils.isNetJSON(this.data)&&(this.gui.renderModeSelector.onclick=()=>{if(this.config.render===this.utils.mapRender){this.config.render=this.utils.graphRender;const t=this.echarts.getZr().painter.getViewportRoot().parentNode;this.echarts.clear(),this.utils.graphRender(this.data,this),t.style.background=this.echarts.getZr()._backgroundColor,document.querySelector(".leaflet-control-attribution").style.display="none",document.querySelector(".leaflet-control-zoom").style.display="none"}else this.echarts.clear(),this.config.render=this.utils.mapRender,this.utils.mapRender(this.data,this),document.querySelector(".leaflet-control-attribution").style.display="block",document.querySelector(".leaflet-control-zoom").style.display="block"}),this.utils.hideLoading.call(this),this.attachClientsOverlay=t=>function(t,e={}){function n(){u=function(){const t=o.getOption();return t&&t.series&&t.series[0]&&t.series[0].zoom?t.series[0].zoom:1}(),d.attr("invisible",!(u>=l))}function i(){const t=o.getModel().getSeriesByIndex(0);if(!t)return;const e=t.getData();if(!e)return;if(n(),d.removeAll(),u{let r=0;if(0!==n)for(let s=0;rt?"number"==typeof t.clients?t.clients:Array.isArray(t.clients)?t.clients.length:0:0,c=function(){const t=o.getModel().getSeriesByIndex(0);if(!t)return null;const e=(o._chartsViews||[]).find(e=>e&&e.__model&&e.__model.uid===t.uid);return e?e.group:null}();if(!c)return{destroy(){}};const d=new Em({silent:!0,z:100,zlevel:1});c.add(d);const p=t&&t.config&&t.config.graphConfig&&t.config.graphConfig.series||{},f=("number"==typeof p.nodeSize?p.nodeSize:18)/2,g=[["finished",i],["rendered",i],["graphLayoutEnd",i],["graphRoam",()=>{n(),i()}]];return g.forEach(([t,e])=>o.on(t,e)),i(),{destroy(){g.forEach(([t,e])=>{o&&o.off&&o.off(t,e)}),d&&d.parent&&d.parent.remove(d)},setMinZoomLevel(t){l=t,i()},getMinZoomLevel:()=>l}}(this,t),this.config}}})()})(); \ No newline at end of file +(()=>{function t(i){var o=n[i];if(void 0!==o)return o.exports;var r=n[i]={exports:{}};return e[i].call(r.exports,r,r.exports,t),r.exports}var e={481(t,e){!function(t){"use strict";function e(t){var e,n,i,o;for(n=1,i=arguments.length;n=0}function O(t){sn[t.pointerId]=t}function z(t){sn[t.pointerId]&&(sn[t.pointerId]=t)}function E(t){delete sn[t.pointerId]}function R(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var n in e.touches=[],sn)e.touches.push(sn[n]);e.changedTouches=[e],t(e)}}function B(t){return"string"==typeof t?document.getElementById(t):t}function N(t,e){var n=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!n||"auto"===n)&&document.defaultView){var i=document.defaultView.getComputedStyle(t,null);n=i?i[e]:null}return"auto"===n?null:n}function F(t,e,n){var i=document.createElement(t);return i.className=e||"",n&&n.appendChild(i),i}function V(t){var e=t.parentNode;e&&e.removeChild(t)}function Z(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function H(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function W(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function j(t,e){if(void 0!==t.classList)return t.classList.contains(e);var n=X(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)}function G(t,e){if(void 0!==t.classList)for(var n=u(e),i=0,o=n.length;ie&&(n.push(t[i]),o=i);return ol&&(r=a,l=s);l>n&&(e[r]=1,Mt(t,e,n,i,r),Mt(t,e,n,r,o))}function Ct(t,e,n,i,o){var r,a,s,l=i?In:It(t,n),u=It(e,n);for(In=u;;){if(!(l|u))return[t,e];if(l&u)return!1;s=It(a=kt(t,e,r=l||u,n,o),n),r===l?(t=a,l=s):(e=a,u=s)}}function kt(t,e,n,i,o){var r,a,s=e.x-t.x,l=e.y-t.y,u=i.min,h=i.max;return 8&n?(r=t.x+s*(h.y-t.y)/l,a=h.y):4&n?(r=t.x+s*(u.y-t.y)/l,a=u.y):2&n?(r=h.x,a=t.y+l*(h.x-t.x)/s):1&n&&(r=u.x,a=t.y+l*(u.x-t.x)/s),new _(r,a,o)}function It(t,e){var n=0;return t.xe.max.x&&(n|=2),t.ye.max.y&&(n|=8),n}function Lt(t,e){var n=e.x-t.x,i=e.y-t.y;return n*n+i*i}function Pt(t,e,n,i){var o,r=e.x,a=e.y,s=n.x-r,l=n.y-a,u=s*s+l*l;return u>0&&((o=((t.x-r)*s+(t.y-a)*l)/u)>1?(r=n.x,a=n.y):o>0&&(r+=s*o,a+=l*o)),s=t.x-r,l=t.y-a,i?s*s+l*l:new _(r,a)}function Dt(t){return!qt(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function At(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Dt(t)}function Ot(t,e){var n,i,o,r,a,s,l,u;if(!t||0===t.length)throw new Error("latlngs not passed");Dt(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var h=C([0,0]),c=T(t);c.getNorthWest().distanceTo(c.getSouthWest())*c.getNorthEast().distanceTo(c.getNorthWest())<1700&&(h=bt(t));var d=t.length,p=[];for(n=0;ni){u=[s.x-(l=(r-i)/o)*(s.x-a.x),s.y-l*(s.y-a.y)];break}var g=e.unproject(x(u));return C([g.lat+h.lat,g.lng+h.lng])}function zt(t,e){var n,i,o,r,a="Feature"===t.type?t.geometry:t,s=a?a.coordinates:null,l=[],u=e&&e.pointToLayer,h=e&&e.coordsToLatLng||Rt;if(!s&&!a)return null;switch(a.type){case"Point":return Et(u,t,n=h(s),e);case"MultiPoint":for(o=0,r=s.length;o0&&o.push(o[0].slice()),o}function Vt(t,n){return t.feature?e({},t.feature,{geometry:n}):Zt(n)}function Zt(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}function Ht(t,e){return new Jn(t,e)}function Wt(t,e){return new ui(t,e)}function jt(t){return Qe.canvas?new di(t):null}function Gt(t){return Qe.svg||Qe.vml?new mi(t):null}var Ut=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}(),Yt=0,Xt=/\{ *([\w_ -]+) *\}/g,qt=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Kt="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",$t=0,Jt=window.requestAnimationFrame||f("RequestAnimationFrame")||g,Qt=window.cancelAnimationFrame||f("CancelAnimationFrame")||f("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)},te={__proto__:null,extend:e,create:Ut,bind:n,get lastId(){return Yt},stamp:i,throttle:o,wrapNum:r,falseFn:a,formatNum:s,trim:l,splitWords:u,setOptions:h,getParamString:c,template:d,isArray:qt,indexOf:p,emptyImageUrl:Kt,requestFn:Jt,cancelFn:Qt,requestAnimFrame:m,cancelAnimFrame:y};v.extend=function(t){var n=function(){h(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=n.__super__=this.prototype,o=Ut(i);for(var r in o.constructor=n,n.prototype=o,this)Object.prototype.hasOwnProperty.call(this,r)&&"prototype"!==r&&"__super__"!==r&&(n[r]=this[r]);return t.statics&&e(n,t.statics),t.includes&&(function(t){if("undefined"!=typeof L&&L&&L.Mixin){t=qt(t)?t:[t];for(var e=0;e0?Math.floor(t):Math.ceil(t)};_.prototype={clone:function(){return new _(this.x,this.y)},add:function(t){return this.clone()._add(x(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(x(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new _(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new _(this.x/t.x,this.y/t.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=ie(this.x),this.y=ie(this.y),this},distanceTo:function(t){var e=(t=x(t)).x-this.x,n=t.y-this.y;return Math.sqrt(e*e+n*n)},equals:function(t){return(t=x(t)).x===this.x&&t.y===this.y},contains:function(t){return t=x(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+s(this.x)+", "+s(this.y)+")"}},w.prototype={extend:function(t){var e,n;if(!t)return this;if(t instanceof _||"number"==typeof t[0]||"x"in t)e=n=x(t);else if(n=(t=b(t)).max,!(e=t.min)||!n)return this;return this.min||this.max?(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(n.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(n.y,this.max.y)):(this.min=e.clone(),this.max=n.clone()),this},getCenter:function(t){return x((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return x(this.min.x,this.max.y)},getTopRight:function(){return x(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,n;return(t="number"==typeof t[0]||t instanceof _?x(t):b(t))instanceof w?(e=t.min,n=t.max):e=n=t,e.x>=this.min.x&&n.x<=this.max.x&&e.y>=this.min.y&&n.y<=this.max.y},intersects:function(t){t=b(t);var e=this.min,n=this.max,i=t.min,o=t.max;return o.x>=e.x&&i.x<=n.x&&o.y>=e.y&&i.y<=n.y},overlaps:function(t){t=b(t);var e=this.min,n=this.max,i=t.min,o=t.max;return o.x>e.x&&i.xe.y&&i.y=i.lat&&n.lat<=o.lat&&e.lng>=i.lng&&n.lng<=o.lng},intersects:function(t){t=T(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),o=t.getNorthEast();return o.lat>=e.lat&&i.lat<=n.lat&&o.lng>=e.lng&&i.lng<=n.lng},overlaps:function(t){t=T(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),o=t.getNorthEast();return o.lat>e.lat&&i.late.lng&&i.lng1,Xe=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",a,e),window.removeEventListener("testPassiveEventSupport",a,e)}catch(t){}return t}(),qe=!!document.createElement("canvas").getContext,Ke=!(!document.createElementNS||!P("svg").createSVGRect),$e=!!Ke&&((ue=document.createElement("div")).innerHTML="","http://www.w3.org/2000/svg"===(ue.firstChild&&ue.firstChild.namespaceURI)),Je=!Ke&&function(){try{var t=document.createElement("div");t.innerHTML='';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),Qe={ie:_e,ielt9:xe,edge:we,webkit:be,android:Se,android23:Te,androidStock:Ce,opera:ke,chrome:Ie,gecko:Le,safari:Pe,phantom:De,opera12:Ae,win:Oe,ie3d:ze,webkit3d:Ee,gecko3d:Re,any3d:Be,mobile:Ne,mobileWebkit:Fe,mobileWebkit3d:Ve,msPointer:Ze,pointer:He,touch:je,touchNative:We,mobileOpera:Ge,mobileGecko:Ue,retina:Ye,passiveEvents:Xe,canvas:qe,svg:Ke,vml:Je,inlineSvg:$e,mac:0===navigator.platform.indexOf("Mac"),linux:0===navigator.platform.indexOf("Linux")},tn=Qe.msPointer?"MSPointerDown":"pointerdown",en=Qe.msPointer?"MSPointerMove":"pointermove",nn=Qe.msPointer?"MSPointerUp":"pointerup",on=Qe.msPointer?"MSPointerCancel":"pointercancel",rn={touchstart:tn,touchmove:en,touchend:nn,touchcancel:on},an={touchstart:function(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&ft(e),R(t,e)},touchmove:R,touchend:R,touchcancel:R},sn={},ln=!1,un=200,hn=K(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),cn=K(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),dn="webkitTransition"===cn||"OTransition"===cn?cn+"End":"transitionend";if("onselectstart"in document)he=function(){at(window,"selectstart",ft)},ce=function(){st(window,"selectstart",ft)};else{var pn=K(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);he=function(){if(pn){var t=document.documentElement.style;de=t[pn],t[pn]="none"}},ce=function(){pn&&(document.documentElement.style[pn]=de,de=void 0)}}var fn={__proto__:null,TRANSFORM:hn,TRANSITION:cn,TRANSITION_END:dn,get:B,getStyle:N,create:F,remove:V,empty:Z,toFront:H,toBack:W,hasClass:j,addClass:G,removeClass:U,setClass:Y,getClass:X,setOpacity:q,testProp:K,setTransform:$,setPosition:J,getPosition:Q,get disableTextSelection(){return he},get enableTextSelection(){return ce},disableImageDrag:tt,enableImageDrag:et,preventOutline:nt,restoreOutline:it,getSizedParentNode:ot,getScale:rt},gn="_leaflet_events",mn={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"},yn=Qe.linux&&Qe.chrome?window.devicePixelRatio:Qe.mac?3*window.devicePixelRatio:window.devicePixelRatio>0?2*window.devicePixelRatio:1,vn={__proto__:null,on:at,off:st,stopPropagation:ct,disableScrollPropagation:dt,disableClickPropagation:pt,preventDefault:ft,stop:gt,getPropagationPath:mt,getMousePosition:yt,getWheelDelta:vt,isExternalTarget:_t,addListener:at,removeListener:st},_n=ne.extend({run:function(t,e,n,i){this.stop(),this._el=t,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(i||.5,.2),this._startPos=Q(t),this._offset=e.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=m(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,n=1e3*this._duration;ethis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var n=this.getCenter(),i=this._limitCenter(n,this._zoom,T(t));return n.equals(i)||this.panTo(i,e),this._enforcingBounds=!1,this},panInside:function(t,e){var n=x((e=e||{}).paddingTopLeft||e.padding||[0,0]),i=x(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),r=this.project(t),a=this.getPixelBounds(),s=b([a.min.add(n),a.max.subtract(i)]),l=s.getSize();if(!s.contains(r)){this._enforcingBounds=!0;var u=r.subtract(s.getCenter()),h=s.extend(r).getSize().subtract(l);o.x+=u.x<0?-h.x:h.x,o.y+=u.y<0?-h.y:h.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=e({animate:!1,pan:!0},!0===t?{animate:!0}:t);var i=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),r=i.divideBy(2).round(),a=o.divideBy(2).round(),s=r.subtract(a);return s.x||s.y?(t.animate&&t.pan?this.panBy(s):(t.pan&&this._rawPanBy(s),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(n(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:i,newSize:o})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=e({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var i=n(this._handleGeolocationResponse,this),o=n(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(i,o,t):navigator.geolocation.getCurrentPosition(i,o,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,n=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+n+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=new M(t.coords.latitude,t.coords.longitude),n=e.toBounds(2*t.coords.accuracy),i=this._locateOptions;if(i.setView){var o=this.getBoundsZoom(n);this.setView(e,i.maxZoom?Math.min(o,i.maxZoom):o)}var r={latlng:e,bounds:n,timestamp:t.timestamp};for(var a in t.coords)"number"==typeof t.coords[a]&&(r[a]=t.coords[a]);this.fire("locationfound",r)}},addHandler:function(t,e){if(!e)return this;var n=this[t]=new e(this);return this._handlers.push(n),this.options[t]&&n.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(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),V(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(y(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)V(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var n=F("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new S(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,n){t=T(t),n=x(n||[0,0]);var i=this.getZoom()||0,o=this.getMinZoom(),r=this.getMaxZoom(),a=t.getNorthWest(),s=t.getSouthEast(),l=this.getSize().subtract(n),u=b(this.project(s,i),this.project(a,i)).getSize(),h=Qe.any3d?this.options.zoomSnap:1,c=l.x/u.x,d=l.y/u.y,p=e?Math.max(c,d):Math.min(c,d);return i=this.getScaleZoom(p,i),h&&(i=Math.round(i/(h/100))*(h/100),i=e?Math.ceil(i/h)*h:Math.floor(i/h)*h),Math.max(o,Math.min(r,i))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new _(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var n=this._getTopLeftPoint(t,e);return new w(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var n=this.options.crs;return e=void 0===e?this._zoom:e,n.scale(t)/n.scale(e)},getScaleZoom:function(t,e){var n=this.options.crs,i=n.zoom(t*n.scale(e=void 0===e?this._zoom:e));return isNaN(i)?1/0:i},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(C(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(x(t),e)},layerPointToLatLng:function(t){var e=x(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(C(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(C(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(T(t))},distance:function(t,e){return this.options.crs.distance(C(t),C(e))},containerPointToLayerPoint:function(t){return x(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return x(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(x(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(C(t)))},mouseEventToContainerPoint:function(t){return yt(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=B(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");at(e,"scroll",this._onScroll,this),this._containerId=i(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&Qe.any3d,G(t,"leaflet-container"+(Qe.touch?" leaflet-touch":"")+(Qe.retina?" leaflet-retina":"")+(Qe.ielt9?" leaflet-oldie":"")+(Qe.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=N(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),J(this._mapPane,new _(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(G(t.markerPane,"leaflet-zoom-hide"),G(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,n){J(this._mapPane,new _(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,n)._move(t,e)._moveEnd(o),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,n,i){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),i?n&&n.pinch&&this.fire("zoom",n):((o||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return y(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){J(this._mapPane,this._getMapPanePos().subtract(t))},_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(t){this._targets={},this._targets[i(this._container)]=this;var e=t?st:at;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),Qe.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){y(this._resizeRequest),this._resizeRequest=m(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var n,o=[],r="mouseout"===e||"mouseover"===e,a=t.target||t.srcElement,s=!1;a;){if((n=this._targets[i(a)])&&("click"===e||"preclick"===e)&&this._draggableMoved(n)){s=!0;break}if(n&&n.listens(e,!0)){if(r&&!_t(a,t))break;if(o.push(n),r)break}if(a===this._container)break;a=a.parentNode}return o.length||s||r||!this.listens(e,!0)||(o=[this]),o},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(e))){var n=t.type;"mousedown"===n&&nt(e),this._fireDOMEvent(t,n)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,n,i){if("click"===t.type){var o=e({},t);o.type="preclick",this._fireDOMEvent(o,o.type,i)}var r=this._findEventTargets(t,n);if(i){for(var a=[],s=0;s0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),n=this.getMaxZoom(),i=Qe.any3d?this.options.zoomSnap:1;return i&&(t=Math.round(t/i)*i),Math.max(e,Math.min(n,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){U(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var n=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(n)||(this.panBy(n,e),0))},_createAnimProxy:function(){var t=this._proxy=F("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(t){var e=hn,n=this._proxy.style[e];$(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),n===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){V(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();$(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,n){if(this._animatingZoom)return!0;if(n=n||{},!this._zoomAnimated||!1===n.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var i=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/i);return!(!0!==n.animate&&!this.getSize().contains(o)||(m(function(){this._moveStart(!0,n.noMoveStart||!1)._animateZoom(t,e,!0)},this),0))},_animateZoom:function(t,e,i,o){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,G(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:o}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(n(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&U(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))}}),wn=v.extend({options:{position:"topright"},initialize:function(t){h(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),n=this.getPosition(),i=t._controlCorners[n];return G(e,"leaflet-control"),-1!==n.indexOf("bottom")?i.insertBefore(e,i.firstChild):i.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(V(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),bn=function(t){return new wn(t)};xn.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){function t(t,o){e[t+o]=F("div",n+t+" "+n+o,i)}var e=this._controlCorners={},n="leaflet-",i=this._controlContainer=F("div",n+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)V(this._controlCorners[t]);V(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Sn=wn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,n,i){return n1)?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(i(t.target)),n=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;n&&this._map.fire(n,e)},_createRadioElement:function(t,e){var n='",i=document.createElement("div");return i.innerHTML=n,i.firstChild},_addItem:function(t){var e,n=document.createElement("label"),o=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=o):e=this._createRadioElement("leaflet-base-layers_"+i(this),o),this._layerControlInputs.push(e),e.layerId=i(t.layer),at(e,"click",this._onInputClick,this);var r=document.createElement("span");r.innerHTML=" "+t.name;var a=document.createElement("span");return n.appendChild(a),a.appendChild(e),a.appendChild(r),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var t,e,n=this._layerControlInputs,i=[],o=[];this._handlingClick=!0;for(var r=n.length-1;r>=0;r--)e=this._getLayer((t=n[r]).layerId).layer,t.checked?i.push(e):t.checked||o.push(e);for(r=0;r=0;o--)e=this._getLayer((t=n[o]).layerId).layer,t.disabled=void 0!==e.options.minZoom&&ie.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,at(t,"click",ft),this.expand();var e=this;setTimeout(function(){st(t,"click",ft),e._preventClick=!1})}}),Tn=wn.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",n=F("div",e+" leaflet-bar"),i=this.options;return this._zoomInButton=this._createButton(i.zoomInText,i.zoomInTitle,e+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(i.zoomOutText,i.zoomOutTitle,e+"-out",n,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(t){t.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(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,n,i,o){var r=F("a",n,i);return r.innerHTML=t,r.href="#",r.title=e,r.setAttribute("role","button"),r.setAttribute("aria-label",e),pt(r),at(r,"click",gt),at(r,"click",o,this),at(r,"click",this._refocusOnMap,this),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";U(this._zoomInButton,e),U(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(G(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(G(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});xn.mergeOptions({zoomControl:!0}),xn.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Tn,this.addControl(this.zoomControl))});var Mn=wn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",n=F("div",e),i=this.options;return this._addScales(i,e+"-line",n),t.on(i.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),n},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,n){t.metric&&(this._mScale=F("div",e,n)),t.imperial&&(this._iScale=F("div",e,n))},_update:function(){var t=this._map,e=t.getSize().y/2,n=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(n)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,n,i,o=3.2808399*t;o>5280?(n=this._getRoundNum(e=o/5280),this._updateScale(this._iScale,n+" mi",n/e)):(i=this._getRoundNum(o),this._updateScale(this._iScale,i+" ft",i/o))},_updateScale:function(t,e,n){t.style.width=Math.round(this.options.maxWidth*n)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),n=t/e;return e*(n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}}),Cn=wn.extend({options:{position:"bottomright",prefix:''+(Qe.inlineSvg?' ':"")+"Leaflet"},initialize:function(t){h(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=F("div","leaflet-control-attribution"),pt(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var n=[];this.options.prefix&&n.push(this.options.prefix),t.length&&n.push(t.join(", ")),this._container.innerHTML=n.join(' ')}}});xn.mergeOptions({attributionControl:!0}),xn.addInitHook(function(){this.options.attributionControl&&(new Cn).addTo(this)}),wn.Layers=Sn,wn.Zoom=Tn,wn.Scale=Mn,wn.Attribution=Cn,bn.layers=function(t,e,n){return new Sn(t,e,n)},bn.zoom=function(t){return new Tn(t)},bn.scale=function(t){return new Mn(t)},bn.attribution=function(t){return new Cn(t)};var kn=v.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});kn.addTo=function(t,e){return t.addHandler(e,this),this};var In,Ln={Events:ee},Pn=Qe.touch?"touchstart mousedown":"mousedown",Dn=ne.extend({options:{clickTolerance:3},initialize:function(t,e,n,i){h(this,i),this._element=t,this._dragStartTarget=e||t,this._preventOutline=n},enable:function(){this._enabled||(at(this._dragStartTarget,Pn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Dn._dragging===this&&this.finishDrag(!0),st(this._dragStartTarget,Pn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!j(this._element,"leaflet-zoom-anim")))if(t.touches&&1!==t.touches.length)Dn._dragging===this&&this.finishDrag();else if(!(Dn._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(Dn._dragging=this,this._preventOutline&&nt(this._element),tt(),he(),this._moving))){this.fire("down");var e=t.touches?t.touches[0]:t,n=ot(this._element);this._startPoint=new _(e.clientX,e.clientY),this._startPos=Q(this._element),this._parentScale=rt(n);var i="mousedown"===t.type;at(document,i?"mousemove":"touchmove",this._onMove,this),at(document,i?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(t){if(this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,n=new _(e.clientX,e.clientY)._subtract(this._startPoint);(n.x||n.y)&&(Math.abs(n.x)+Math.abs(n.y)1e-7;l++)e=r*Math.sin(s),e=Math.pow((1-e)/(1+e),r/2),s+=u=Math.PI/2-2*Math.atan(a*e)-s;return new M(s*n,t.x*n/i)}},Rn={__proto__:null,LonLat:zn,Mercator:En,SphericalMercator:le},Bn=e({},ae,{code:"EPSG:3395",projection:En,transformation:function(){var t=.5/(Math.PI*En.R);return I(t,.5,-t,.5)}()}),Nn=e({},ae,{code:"EPSG:4326",projection:zn,transformation:I(1/180,1,-1/180,.5)}),Fn=e({},re,{projection:zn,transformation:I(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var n=e.lng-t.lng,i=e.lat-t.lat;return Math.sqrt(n*n+i*i)},infinite:!0});re.Earth=ae,re.EPSG3395=Bn,re.EPSG3857=me,re.EPSG900913=ye,re.EPSG4326=Nn,re.Simple=Fn;var Vn=ne.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[i(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[i(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var n=this.getEvents();e.on(n,this),this.once("remove",function(){e.off(n,this)},this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});xn.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=i(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=i(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return i(t)in this._layers},eachLayer:function(t,e){for(var n in this._layers)t.call(e,this._layers[n]);return this},_addLayers:function(t){for(var e=0,n=(t=t?qt(t)?t:[t]:[]).length;ethis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()=2&&e[0]instanceof M&&e[0].equals(e[n-1])&&e.pop(),e},_setLatLngs:function(t){Kn.prototype._setLatLngs.call(this,t),Dt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Dt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,n=new _(e,e);if(t=new w(t.min.subtract(n),t.max.add(n)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var i,o=0,r=this._rings.length;ot.y!=(i=e[a]).y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(u=!u);return u||Kn.prototype._containsPoint.call(this,t,!0)}}),Jn=Hn.extend({initialize:function(t,e){h(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,n,i,o=qt(t)?t:t.features;if(o){for(e=0,n=o.length;e0?o:[e.src]}else{qt(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var s=0;si?(e.height=i+"px",G(t,o)):U(t,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),n=this._getAnchor();J(this._container,e.add(n))},_adjustPan:function(){if(this.options.autoPan)if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)this._autopanning=!1;else{var t=this._map,e=parseInt(N(this._container,"marginBottom"),10)||0,n=this._container.offsetHeight+e,i=this._containerWidth,o=new _(this._containerLeft,-n-this._containerBottom);o._add(Q(this._container));var r=t.layerPointToContainerPoint(o),a=x(this.options.autoPanPadding),s=x(this.options.autoPanPaddingTopLeft||a),l=x(this.options.autoPanPaddingBottomRight||a),u=t.getSize(),h=0,c=0;r.x+i+l.x>u.x&&(h=r.x+i-u.x+l.x),r.x-h-s.x<0&&(h=r.x-s.x),r.y+n+l.y>u.y&&(c=r.y+n-u.y+l.y),r.y-c-s.y<0&&(c=r.y-s.y),(h||c)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([h,c]))}},_getAnchor:function(){return x(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});xn.mergeOptions({closePopupOnClick:!0}),xn.include({openPopup:function(t,e,n){return this._initOverlay(ri,t,e,n).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),Vn.include({bindPopup:function(t,e){return this._popup=this._initOverlay(ri,this._popup,t,e),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(t){return this._popup&&(this instanceof Hn||(this._popup._source=this),this._popup._prepareOpen(t||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()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(this._popup&&this._map){gt(t);var e=t.layer||t.target;this._popup._source!==e||e instanceof Yn?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var ai=oi.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){oi.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){oi.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=oi.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){this._contentNode=this._container=F("div","leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide")),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+i(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,n,i=this._map,o=this._container,r=i.latLngToContainerPoint(i.getCenter()),a=i.layerPointToContainerPoint(t),s=this.options.direction,l=o.offsetWidth,u=o.offsetHeight,h=x(this.options.offset),c=this._getAnchor();"top"===s?(e=l/2,n=u):"bottom"===s?(e=l/2,n=0):"center"===s?(e=l/2,n=u/2):"right"===s?(e=0,n=u/2):"left"===s?(e=l,n=u/2):a.xthis.options.maxZoom||ni&&this._retainParent(o,r,a,i))},_retainChildren:function(t,e,n,i){for(var o=2*t;o<2*t+2;o++)for(var r=2*e;r<2*e+2;r++){var a=new _(o,r);a.z=n+1;var s=this._tileCoordsToKey(a),l=this._tiles[s];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),n+1this.options.maxZoom||void 0!==this.options.minZoom&&o1)this._setView(t,n);else{for(var c=o.min.y;c<=o.max.y;c++)for(var d=o.min.x;d<=o.max.x;d++){var p=new _(d,c);if(p.z=this._tileZoom,this._isValidTile(p)){var f=this._tiles[this._tileCoordsToKey(p)];f?f.current=!0:a.push(p)}}if(a.sort(function(t,e){return t.distanceTo(r)-e.distanceTo(r)}),0!==a.length){this._loading||(this._loading=!0,this.fire("loading"));var g=document.createDocumentFragment();for(d=0;dn.max.x)||!e.wrapLat&&(t.yn.max.y))return!1}if(!this.options.bounds)return!0;var i=this._tileCoordsToBounds(t);return T(this.options.bounds).overlaps(i)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,n=this.getTileSize(),i=t.scaleBy(n),o=i.add(n);return[e.unproject(i,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),n=new S(e[0],e[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),n=new _(+e[0],+e[1]);return n.z=+e[2],n},_removeTile:function(t){var e=this._tiles[t];e&&(V(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){G(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=a,t.onmousemove=a,Qe.ielt9&&this.options.opacity<1&&q(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),o=this._tileCoordsToKey(t),r=this.createTile(this._wrapCoords(t),n(this._tileReady,this,t));this._initTile(r),this.createTile.length<2&&m(n(this._tileReady,this,t,null,r)),J(r,i),this._tiles[o]={el:r,coords:t,current:!0},e.appendChild(r),this.fire("tileloadstart",{tile:r,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var o=this._tileCoordsToKey(t);(i=this._tiles[o])&&(i.loaded=+new Date,this._map._fadeAnimated?(q(i.el,0),y(this._fadeFrame),this._fadeFrame=m(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(G(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Qe.ielt9||!this._map._fadeAnimated?m(this._pruneTiles,this):setTimeout(n(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new _(this._wrapX?r(t.x,this._wrapX):t.x,this._wrapY?r(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new w(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}}),ui=li.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=h(this,e)).detectRetina&&Qe.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return at(i,"load",n(this._tileOnLoad,this,e,i)),at(i,"error",n(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var n={r:Qe.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(n.y=i),n["-y"]=i}return d(this._url,e(n,this.options))},_tileOnLoad:function(t,e){Qe.ielt9?setTimeout(n(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,n){var i=this.options.errorTileUrl;i&&e.getAttribute("src")!==i&&(e.src=i),t(n,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom;return this.options.zoomReverse&&(t=this.options.maxZoom-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=a,e.onerror=a,!e.complete)){e.src=Kt;var n=this._tiles[t].coords;V(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:n})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",Kt),li.prototype._removeTile.call(this,t)},_tileReady:function(t,e,n){if(this._map&&(!n||n.getAttribute("src")!==Kt))return li.prototype._tileReady.call(this,t,e,n)}}),hi=ui.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,n){this._url=t;var i=e({},this.defaultWmsParams);for(var o in n)o in this.options||(i[o]=n[o]);var r=(n=h(this,n)).detectRetina&&Qe.retina?2:1,a=this.getTileSize();i.width=a.x*r,i.height=a.y*r,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version),this.wmsParams[this._wmsVersion>=1.3?"crs":"srs"]=this._crs.code,ui.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),n=this._crs,i=b(n.project(e[0]),n.project(e[1])),o=i.min,r=i.max,a=(this._wmsVersion>=1.3&&this._crs===Nn?[o.y,o.x,r.y,r.x]:[o.x,o.y,r.x,r.y]).join(","),s=ui.prototype.getTileUrl.call(this,t);return s+c(this.wmsParams,s,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+a},setParams:function(t,n){return e(this.wmsParams,t),n||this.redraw(),this}});ui.WMS=hi,Wt.wms=function(t,e){return new hi(t,e)};var ci=Vn.extend({options:{padding:.1},initialize:function(t){h(this,t),i(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),G(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 t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var n=this._map.getZoomScale(e,this._zoom),i=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),r=i.multiplyBy(-n).add(o).subtract(this._map._getNewPixelOrigin(t,e));Qe.any3d?$(this._container,r,n):J(this._container,r)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),n=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new w(n,n.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),di=ci.extend({options:{tolerance:0},getEvents:function(){var t=ci.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ci.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");at(t,"mousemove",this._onMouseMove,this),at(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),at(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){y(this._redrawRequest),delete this._ctx,V(this._container),st(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){ci.prototype._update.call(this);var t=this._bounds,e=this._container,n=t.getSize(),i=Qe.retina?2:1;J(e,t.min),e.width=i*n.x,e.height=i*n.y,e.style.width=n.x+"px",e.style.height=n.y+"px",Qe.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){ci.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[i(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,n=e.next,o=e.prev;n?n.prev=o:this._drawLast=o,o?o.next=n:this._drawFirst=n,delete t._order,delete this._layers[i(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,n,i=t.options.dashArray.split(/[, ]+/),o=[];for(n=0;n')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),fi={_initContainer:function(){this._container=F("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ci.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=pi("shape");G(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=pi("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[i(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;V(e),t.removeInteractiveTarget(e),delete this._layers[i(t)]},_updateStyle:function(t){var e=t._stroke,n=t._fill,i=t.options,o=t._container;o.stroked=!!i.stroke,o.filled=!!i.fill,i.stroke?(e||(e=t._stroke=pi("stroke")),o.appendChild(e),e.weight=i.weight+"px",e.color=i.color,e.opacity=i.opacity,e.dashStyle=i.dashArray?qt(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):"",e.endcap=i.lineCap.replace("butt","flat"),e.joinstyle=i.lineJoin):e&&(o.removeChild(e),t._stroke=null),i.fill?(n||(n=t._fill=pi("fill")),o.appendChild(n),n.color=i.fillColor||i.color,n.opacity=i.fillOpacity):n&&(o.removeChild(n),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),n=Math.round(t._radius),i=Math.round(t._radiusY||n);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+n+","+i+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){H(t._container)},_bringToBack:function(t){W(t._container)}},gi=Qe.vml?pi:P,mi=ci.extend({_initContainer:function(){this._container=gi("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=gi("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){V(this._container),st(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){ci.prototype._update.call(this);var t=this._bounds,e=t.getSize(),n=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,n.setAttribute("width",e.x),n.setAttribute("height",e.y)),J(n,t.min),n.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=gi("path");t.options.className&&G(e,t.options.className),t.options.interactive&&G(e,"leaflet-interactive"),this._updateStyle(t),this._layers[i(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){V(t._path),t.removeInteractiveTarget(t._path),delete this._layers[i(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,n=t.options;e&&(n.stroke?(e.setAttribute("stroke",n.color),e.setAttribute("stroke-opacity",n.opacity),e.setAttribute("stroke-width",n.weight),e.setAttribute("stroke-linecap",n.lineCap),e.setAttribute("stroke-linejoin",n.lineJoin),n.dashArray?e.setAttribute("stroke-dasharray",n.dashArray):e.removeAttribute("stroke-dasharray"),n.dashOffset?e.setAttribute("stroke-dashoffset",n.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),n.fill?(e.setAttribute("fill",n.fillColor||n.color),e.setAttribute("fill-opacity",n.fillOpacity),e.setAttribute("fill-rule",n.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,D(t._parts,e))},_updateCircle:function(t){var e=t._point,n=Math.max(Math.round(t._radius),1),i="a"+n+","+(Math.max(Math.round(t._radiusY),1)||n)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-n)+","+e.y+i+2*n+",0 "+i+2*-n+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){H(t._path)},_bringToBack:function(t){W(t._path)}});Qe.vml&&mi.include(fi),xn.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&jt(t)||Gt(t)}});var yi=$n.extend({initialize:function(t,e){$n.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=T(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});mi.create=gi,mi.pointsToPath=D,Jn.geometryToLayer=zt,Jn.coordsToLatLng=Rt,Jn.coordsToLatLngs=Bt,Jn.latLngToCoords=Nt,Jn.latLngsToCoords=Ft,Jn.getFeature=Vt,Jn.asFeature=Zt,xn.mergeOptions({boxZoom:!0});var vi=kn.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){at(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){st(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){V(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),he(),tt(),this._startPoint=this._map.mouseEventToContainerPoint(t),at(document,{contextmenu:gt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=F("div","leaflet-zoom-box",this._container),G(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new w(this._point,this._startPoint),n=e.getSize();J(this._box,e.min),this._box.style.width=n.x+"px",this._box.style.height=n.y+"px"},_finish:function(){this._moved&&(V(this._box),U(this._container,"leaflet-crosshair")),ce(),et(),st(document,{contextmenu:gt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(n(this._resetState,this),0);var e=new S(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});xn.addInitHook("addHandler","boxZoom",vi),xn.mergeOptions({doubleClickZoom:!0});var _i=kn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,n=e.getZoom(),i=e.options.zoomDelta,o=t.originalEvent.shiftKey?n-i:n+i;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});xn.addInitHook("addHandler","doubleClickZoom",_i),xn.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var xi=kn.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new Dn(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}G(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){U(this._map._container,"leaflet-grab"),U(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 t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=T(this._map.options.maxBounds);this._offsetLimit=b(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.xe.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),n=this._initialWorldOffset,i=this._draggable._newPos.x,o=(i-e+n)%t+e-n,r=(i+e+n)%t-e-n,a=Math.abs(o+n)0?o:-o))-e;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}});xn.addInitHook("addHandler","scrollWheelZoom",bi),xn.mergeOptions({tapHold:Qe.touchNative&&Qe.safari&&Qe.mobile,tapTolerance:15});var Si=kn.extend({addHooks:function(){at(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){st(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),1===t.touches.length){var e=t.touches[0];this._startPos=this._newPos=new _(e.clientX,e.clientY),this._holdTimeout=setTimeout(n(function(){this._cancel(),this._isTapValid()&&(at(document,"touchend",ft),at(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),600),at(document,"touchend touchcancel contextmenu",this._cancel,this),at(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){st(document,"touchend",ft),st(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),st(document,"touchend touchcancel contextmenu",this._cancel,this),st(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new _(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var n=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});n._simulated=!0,e.target.dispatchEvent(n)}});xn.addInitHook("addHandler","tapHold",Si),xn.mergeOptions({touchZoom:Qe.touch,bounceAtZoomLimits:!0});var Ti=kn.extend({addHooks:function(){G(this._map._container,"leaflet-touch-zoom"),at(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){U(this._map._container,"leaflet-touch-zoom"),st(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var n=e.mouseEventToContainerPoint(t.touches[0]),i=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(n.add(i)._divideBy(2))),this._startDist=n.distanceTo(i),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),at(document,"touchmove",this._onTouchMove,this),at(document,"touchend touchcancel",this._onTouchEnd,this),ft(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),o=e.mouseEventToContainerPoint(t.touches[1]),r=i.distanceTo(o)/this._startDist;if(this._zoom=e.getScaleZoom(r,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoome.getMaxZoom()&&r>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===r)return}else{var a=i._add(o)._divideBy(2)._subtract(this._centerPoint);if(1===r&&0===a.x&&0===a.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(a),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),y(this._animRequest);var s=n(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=m(s,this,!0),ft(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,y(this._animRequest),st(document,"touchmove",this._onTouchMove,this),st(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))):this._zooming=!1}});xn.addInitHook("addHandler","touchZoom",Ti),xn.BoxZoom=vi,xn.DoubleClickZoom=_i,xn.Drag=xi,xn.Keyboard=wi,xn.ScrollWheelZoom=bi,xn.TapHold=Si,xn.TouchZoom=Ti,t.Bounds=w,t.Browser=Qe,t.CRS=re,t.Canvas=di,t.Circle=qn,t.CircleMarker=Xn,t.Class=v,t.Control=wn,t.DivIcon=si,t.DivOverlay=oi,t.DomEvent=vn,t.DomUtil=fn,t.Draggable=Dn,t.Evented=ne,t.FeatureGroup=Hn,t.GeoJSON=Jn,t.GridLayer=li,t.Handler=kn,t.Icon=Wn,t.ImageOverlay=ei,t.LatLng=M,t.LatLngBounds=S,t.Layer=Vn,t.LayerGroup=Zn,t.LineUtil=On,t.Map=xn,t.Marker=Un,t.Mixin=Ln,t.Path=Yn,t.Point=_,t.PolyUtil=An,t.Polygon=$n,t.Polyline=Kn,t.Popup=ri,t.PosAnimation=_n,t.Projection=Rn,t.Rectangle=yi,t.Renderer=ci,t.SVG=mi,t.SVGOverlay=ii,t.TileLayer=ui,t.Tooltip=ai,t.Transformation=k,t.Util=te,t.VideoOverlay=ni,t.bind=n,t.bounds=b,t.canvas=jt,t.circle=function(t,e,n){return new qn(t,e,n)},t.circleMarker=function(t,e){return new Xn(t,e)},t.control=bn,t.divIcon=function(t){return new si(t)},t.extend=e,t.featureGroup=function(t,e){return new Hn(t,e)},t.geoJSON=Ht,t.geoJson=ti,t.gridLayer=function(t){return new li(t)},t.icon=function(t){return new Wn(t)},t.imageOverlay=function(t,e,n){return new ei(t,e,n)},t.latLng=C,t.latLngBounds=T,t.layerGroup=function(t,e){return new Zn(t,e)},t.map=function(t,e){return new xn(t,e)},t.marker=function(t,e){return new Un(t,e)},t.point=x,t.polygon=function(t,e){return new $n(t,e)},t.polyline=function(t,e){return new Kn(t,e)},t.popup=function(t,e){return new ri(t,e)},t.rectangle=function(t,e){return new yi(t,e)},t.setOptions=h,t.stamp=i,t.svg=Gt,t.svgOverlay=function(t,e,n){return new ii(t,e,n)},t.tileLayer=Wt,t.tooltip=function(t,e){return new ai(t,e)},t.transformation=I,t.version="1.9.4",t.videoOverlay=function(t,e,n){return new ni(t,e,n)};var Mi=window.L;t.noConflict=function(){return window.L=Mi,this},window.L=t}(e)}},n={};t.d=(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";function e(t,e){function n(){this.constructor=t}if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Kp(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function n(){return vf++}function i(){for(var t=[],e=0;e>1)%2;a.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[s]+":0",o[l]+":0",i[1-s]+":auto",o[1-l]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}return e.clearMarkers=function(){c(n,function(t){t.parentNode&&t.parentNode.removeChild(t)})},n}(e,r),s=function(t,e,n){for(var i=n?"invTrans":"trans",o=e[i],r=e.srcCoords,a=[],s=[],l=!0,u=0;u<4;u++){var h=t[u].getBoundingClientRect(),c=2*u,d=h.left,p=h.top;a.push(d,p),l=l&&r&&d===r[c]&&p===r[c+1],s.push(t[u].offsetLeft,t[u].offsetTop)}return l&&o?o:(e.srcCoords=a,e[i]=n?rt(s,a):rt(a,s))}(a,r,o);if(s)return s(t,n,i),!0}return!1}function st(t){return"CANVAS"===t.nodeName.toUpperCase()}function lt(t){return null==t?"":(t+"").replace(Rf,function(t,e){return Bf[e]})}function ut(t,e,n,i){return n=n||{},i?ht(t,e,n):Vf&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):ht(t,e,n),n}function ht(t,e,n){if(Qp.domSupported&&t.getBoundingClientRect){var i=e.clientX,o=e.clientY;if(st(t)){var r=t.getBoundingClientRect();return n.zrX=i-r.left,void(n.zrY=o-r.top)}if(at(Ff,t,i,o))return n.zrX=Ff[0],void(n.zrY=Ff[1])}n.zrX=n.zrY=0}function ct(t){return t||window.event}function dt(t,e,n){if(null!=(e=ct(e)).zrX)return e;var i=e.type;if(i&&i.indexOf("touch")>=0){var o="touchend"!==i?e.targetTouches[0]:e.changedTouches[0];o&&ut(t,o,e,n)}else{ut(t,e,e,n);var r=function(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,i=t.deltaY;return null==n||null==i?e:3*(0!==i?Math.abs(i):Math.abs(n))*(i>0?-1:i<0?1:n>0?-1:1)}(e);e.zrDelta=r?r/120:-(e.detail||0)/3}var a=e.button;return null==e.which&&void 0!==a&&Nf.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function pt(t,e,n,i){t.addEventListener(e,n,i)}function ft(t,e,n,i){t.removeEventListener(e,n,i)}function gt(t){return 2===t.which||3===t.which}function mt(t){var e=t[1][0]-t[0][0],n=t[1][1]-t[0][1];return Math.sqrt(e*e+n*n)}function yt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function vt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function _t(t,e,n){var i=e[1]*n[0]+e[3]*n[1],o=e[0]*n[2]+e[2]*n[3],r=e[1]*n[2]+e[3]*n[3],a=e[0]*n[4]+e[2]*n[5]+e[4],s=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=e[0]*n[0]+e[2]*n[1],t[1]=i,t[2]=o,t[3]=r,t[4]=a,t[5]=s,t}function xt(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function wt(t,e,n,i){void 0===i&&(i=[0,0]);var o=e[0],r=e[2],a=e[4],s=e[1],l=e[3],u=e[5],h=Math.sin(n),c=Math.cos(n);return t[0]=o*c+s*h,t[1]=-o*h+s*c,t[2]=r*c+l*h,t[3]=-r*h+c*l,t[4]=c*(a-i[0])+h*(u-i[1])+i[0],t[5]=c*(u-i[1])-h*(a-i[0])+i[1],t}function bt(t,e){var n=e[0],i=e[2],o=e[4],r=e[1],a=e[3],s=e[5],l=n*a-r*i;return l?(t[0]=a*(l=1/l),t[1]=-r*l,t[2]=-i*l,t[3]=n*l,t[4]=(i*s-a*o)*l,t[5]=(r*o-n*s)*l,t):null}function St(t,e,n,i,o,r,a,s){var l=Xf(e-n),u=Xf(i-t),h=Uf(l,u),c=qf[o],d=qf[1-o],p=Kf[o];e=u||!eg.bidirectional)&&(ng[c]=-u,ng[d]=0,eg.useDir&&eg.calcDirMTV())))}function Tt(){function t(t){return Xf(t)<1e-10}var e=0,n=new Gf,i=new Gf,o={minTv:new Gf,maxTv:new Gf,useDir:!1,dirMinTv:new Gf,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(t,r){o.touchThreshold=0,t&&null!=t.touchThreshold&&(o.touchThreshold=Yf(0,t.touchThreshold)),o.negativeSize=!1,r&&(o.minTv.set(1/0,1/0),o.maxTv.set(0,0),o.useDir=!1,t&&null!=t.direction&&(o.useDir=!0,o.dirMinTv.copy(o.minTv),i.copy(o.minTv),e=t.direction,o.bidirectional=null==t.bidirectional||!!t.bidirectional,o.bidirectional||n.set(Math.cos(e),Math.sin(e))))},calcDirMTV:function(){var r=o.minTv,a=o.dirMinTv,s=r.y*r.y+r.x*r.x,l=Math.sin(e),u=Math.cos(e),h=l*r.y+u*r.x;t(h)?t(r.x)&&t(r.y)&&a.set(0,0):(i.x=s*u/h,i.y=s*l/h,t(i.x)&&t(i.y)?a.set(0,0):(o.bidirectional||n.dot(i)>0)&&i.len()=0;r--){var a=t[r],s=void 0;if(a!==o&&!a.ignore&&(s=Ct(a,n,i))&&(!e.topTarget&&(e.topTarget=a),s!==ug)){e.target=a;break}}}function It(t,e,n){var i=t.painter;return e<0||e>i.getWidth()||n<0||n>i.getHeight()}function Lt(t,e,n,i){var o=e+1;if(o===n)return 1;if(i(t[o++],t[e])<0){for(;o=0;)o++;return o-e}function Pt(t,e,n,i,o){for(i===e&&i++;i>>1])<0?l=r:s=r+1;var u=i-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;u>0;)t[s+u]=t[s+u-1],u--}t[s]=a}}function Dt(t,e,n,i,o,r){var a=0,s=0,l=1;if(r(t,e[n+o])>0){for(s=i-o;l0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=o,l+=o}else{for(s=o+1;ls&&(l=s);var u=a;a=o-l,l=o-u}for(a++;a>>1);r(t,e[n+h])>0?a=h+1:l=h}return l}function At(t,e,n,i,o,r){var a=0,s=0,l=1;if(r(t,e[n+o])<0){for(s=o+1;ls&&(l=s);var u=a;a=o-l,l=o-u}else{for(s=i-o;l=0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=o,l+=o}for(a++;a>>1);r(t,e[n+h])<0?l=h:a=h+1}return l}function Ot(t,e,n,i){n||(n=0),i||(i=t.length);var o=i-n;if(!(o<2)){var r=0;if(o<32)Pt(t,n,i,n+(r=Lt(t,n,i,e)),e);else{var a=function(t,e){function n(n){var l=i[n],u=o[n],h=i[n+1],c=o[n+1];o[n]=u+c,n===a-3&&(i[n+1]=i[n+2],o[n+1]=o[n+2]),a--;var d=At(t[h],t,l,u,0,e);l+=d,0!==(u-=d)&&0!==(c=Dt(t[l+u-1],t,h,c,c-1,e))&&(u<=c?function(n,i,o,a){var l=0;for(l=0;l=7||p>=7);if(f)break;g<0&&(g=0),g+=2}if((r=g)<1&&(r=1),1===i){for(l=0;l=0;l--)t[p+l]=t[d+l];if(0===i){y=!0;break}}if(t[c--]=s[h--],1===--a){y=!0;break}if(0!==(m=a-Dt(t[u],s,0,a,a-1,e))){for(a-=m,p=1+(c-=m),d=1+(h-=m),l=0;l=7||m>=7);if(y)break;f<0&&(f=0),f+=2}if((r=f)<1&&(r=1),1===a){for(p=1+(c-=i),d=1+(u-=i),l=i-1;l>=0;l--)t[p+l]=t[d+l];t[c]=s[h]}else{if(0===a)throw new Error;for(d=c-(a-1),l=0;l=0;l--)t[p+l]=t[d+l];t[c]=s[h]}else for(d=c-(a-1),l=0;l1;){var t=a-2;if(t>=1&&o[t-1]<=o[t]+o[t+1]||t>=2&&o[t-2]<=o[t]+o[t-1])o[t-1]o[t+1])break;n(t)}},forceMergeRuns:function(){for(;a>1;){var t=a-2;t>0&&o[t-1]=32;)e|=1&t,t>>=1;return t+e}(o);do{if((r=Lt(t,n,i,e))s&&(l=s),Pt(t,n,n+l,n+r,e),r=l}a.pushRun(n,r),a.mergeRuns(),o-=r,n+=r}while(0!==o);a.forceMergeRuns()}}}function zt(){mg||(mg=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Et(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}function Rt(t){return t>-1e-8&&tTg||t<-1e-8}function Nt(t,e,n,i,o){var r=1-o;return r*r*(r*t+3*o*e)+o*o*(o*i+3*r*n)}function Ft(t,e,n,i,o){var r=1-o;return 3*(((e-t)*r+2*(n-e)*o)*r+(i-n)*o*o)}function Vt(t,e,n,i,o,r){var a=i+3*(e-n)-t,s=3*(n-2*e+t),l=3*(e-t),u=t-o,h=s*s-3*a*l,c=s*l-9*a*u,d=l*l-3*s*u,p=0;if(Rt(h)&&Rt(c))Rt(s)?r[0]=0:(T=-l/s)>=0&&T<=1&&(r[p++]=T);else{var f=c*c-4*h*d;if(Rt(f)){var g=c/h,m=-g/2;(T=-s/a+g)>=0&&T<=1&&(r[p++]=T),m>=0&&m<=1&&(r[p++]=m)}else if(f>0){var y=Sg(f),v=h*s+1.5*a*(-c+y),_=h*s+1.5*a*(-c-y);(T=(-s-((v=v<0?-bg(-v,kg):bg(v,kg))+(_=_<0?-bg(-_,kg):bg(_,kg))))/(3*a))>=0&&T<=1&&(r[p++]=T)}else{var x=(2*h*s-3*a*c)/(2*Sg(h*h*h)),w=Math.acos(x)/3,b=Sg(h),S=Math.cos(w),T=(-s-2*b*S)/(3*a),M=(m=(-s+b*(S+Cg*Math.sin(w)))/(3*a),(-s+b*(S-Cg*Math.sin(w)))/(3*a));T>=0&&T<=1&&(r[p++]=T),m>=0&&m<=1&&(r[p++]=m),M>=0&&M<=1&&(r[p++]=M)}}return p}function Zt(t,e,n,i,o){var r=6*n-12*e+6*t,a=9*e+3*i-3*t-9*n,s=3*e-3*t,l=0;if(Rt(a))Bt(r)&&(h=-s/r)>=0&&h<=1&&(o[l++]=h);else{var u=r*r-4*a*s;if(Rt(u))o[0]=-r/(2*a);else if(u>0){var h,c=Sg(u),d=(-r-c)/(2*a);(h=(-r+c)/(2*a))>=0&&h<=1&&(o[l++]=h),d>=0&&d<=1&&(o[l++]=d)}}return l}function Ht(t,e,n,i,o,r){var a=(e-t)*o+t,s=(n-e)*o+e,l=(i-n)*o+n,u=(s-a)*o+a,h=(l-s)*o+s,c=(h-u)*o+u;r[0]=t,r[1]=a,r[2]=u,r[3]=c,r[4]=c,r[5]=h,r[6]=l,r[7]=i}function Wt(t,e,n,i,o,r,a,s,l){for(var u=t,h=e,c=0,d=1/l,p=1;p<=l;p++){var f=p*d,g=Nt(t,n,o,a,f),m=Nt(e,i,r,s,f),y=g-u,v=m-h;c+=Math.sqrt(y*y+v*v),u=g,h=m}return c}function jt(t,e,n,i){var o=1-i;return o*(o*t+2*i*e)+i*i*n}function Gt(t,e,n,i){return 2*((1-i)*(e-t)+i*(n-e))}function Ut(t,e,n){var i=t+n-2*e;return 0===i?.5:(t-e)/i}function Yt(t,e,n,i,o){var r=(e-t)*i+t,a=(n-e)*i+e,s=(a-r)*i+r;o[0]=t,o[1]=r,o[2]=s,o[3]=s,o[4]=a,o[5]=n}function Xt(t,e,n,i,o,r,a){for(var s=t,l=e,u=0,h=1/a,c=1;c<=a;c++){var d=c*h,p=jt(t,n,o,d),f=jt(e,i,r,d),g=p-s,m=f-l;u+=Math.sqrt(g*g+m*m),s=p,l=f}return u}function qt(t){var e=t&&Dg.exec(t);if(e){var n=e[1].split(","),i=+z(n[0]),o=+z(n[1]),r=+z(n[2]),a=+z(n[3]);if(isNaN(i+o+r+a))return;var s=[];return function(t){return t<=0?0:t>=1?1:Vt(0,i,r,1,t,s)&&Nt(0,o,a,1,s[0])}}}function Kt(t){return(t=Math.round(t))<0?0:t>255?255:t}function $t(t){return t<0?0:t>1?1:t}function Jt(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?Kt(parseFloat(e)/100*255):Kt(parseInt(e,10))}function Qt(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?$t(parseFloat(e)/100):$t(parseFloat(e))}function te(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function ee(t,e,n,i,o){return t[0]=e,t[1]=n,t[2]=i,t[3]=o,t}function ne(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function ie(t,e){Fg&&ne(Fg,e),Fg=Ng.put(t,Fg||e.slice())}function oe(t,e){if(t){e=e||[];var n=Ng.get(t);if(n)return ne(e,n);var i=(t+="").replace(/ /g,"").toLowerCase();if(i in Bg)return ne(e,Bg[i]),ie(t,e),e;var o,r=i.length;if("#"===i.charAt(0))return 4===r||5===r?(o=parseInt(i.slice(1,4),16))>=0&&o<=4095?(ee(e,(3840&o)>>4|(3840&o)>>8,240&o|(240&o)>>4,15&o|(15&o)<<4,5===r?parseInt(i.slice(4),16)/15:1),ie(t,e),e):void ee(e,0,0,0,1):7===r||9===r?(o=parseInt(i.slice(1,7),16))>=0&&o<=16777215?(ee(e,(16711680&o)>>16,(65280&o)>>8,255&o,9===r?parseInt(i.slice(7),16)/255:1),ie(t,e),e):void ee(e,0,0,0,1):void 0;var a=i.indexOf("("),s=i.indexOf(")");if(-1!==a&&s+1===r){var l=i.substr(0,a),u=i.substr(a+1,s-(a+1)).split(","),h=1;switch(l){case"rgba":if(4!==u.length)return 3===u.length?ee(e,+u[0],+u[1],+u[2],1):ee(e,0,0,0,1);h=Qt(u.pop());case"rgb":return u.length>=3?(ee(e,Jt(u[0]),Jt(u[1]),Jt(u[2]),3===u.length?h:Qt(u[3])),ie(t,e),e):void ee(e,0,0,0,1);case"hsla":return 4!==u.length?void ee(e,0,0,0,1):(u[3]=Qt(u[3]),re(u,e),ie(t,e),e);case"hsl":return 3!==u.length?void ee(e,0,0,0,1):(re(u,e),ie(t,e),e);default:return}}ee(e,0,0,0,1)}}function re(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=Qt(t[1]),o=Qt(t[2]),r=o<=.5?o*(i+1):o+i-o*i,a=2*o-r;return ee(e=e||[],Kt(255*te(a,r,n+1/3)),Kt(255*te(a,r,n)),Kt(255*te(a,r,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function ae(t,e){var n=oe(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,n[i]>255?n[i]=255:n[i]<0&&(n[i]=0);return le(n,4===n.length?"rgba":"rgb")}}function se(t,e,n,i){var o,r=oe(t);if(t)return r=function(t){if(t){var e,n,i=t[0]/255,o=t[1]/255,r=t[2]/255,a=Math.min(i,o,r),s=Math.max(i,o,r),l=s-a,u=(s+a)/2;if(0===l)e=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var h=((s-i)/6+l/2)/l,c=((s-o)/6+l/2)/l,d=((s-r)/6+l/2)/l;i===s?e=d-c:o===s?e=1/3+h-d:r===s&&(e=2/3+c-h),e<0&&(e+=1),e>1&&(e-=1)}var p=[360*e,n,u];return null!=t[3]&&p.push(t[3]),p}}(r),null!=e&&(r[0]=(o=v(e)?e(r[0]):e,(o=Math.round(o))<0?0:o>360?360:o)),null!=n&&(r[1]=Qt(v(n)?n(r[1]):n)),null!=i&&(r[2]=Qt(v(i)?i(r[2]):i)),le(re(r),"rgba")}function le(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}function ue(t,e){var n=oe(t);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*e:0}function he(t){if(_(t)){var e=Vg.get(t);return e||(e=ae(t,-.1),Vg.put(t,e)),e}if(C(t)){var n=a({},t);return n.colorStops=d(t.colorStops,function(t){return{offset:t.offset,color:ae(t.color,-.1)}}),n}return t}function ce(t){var e;if(t&&"transparent"!==t){if("string"==typeof t&&t.indexOf("rgba")>-1){var n=oe(t);n&&(t="rgb("+n[0]+","+n[1]+","+n[2]+")",e=n[3])}}else t="none";return{color:t,opacity:null==e?1:e}}function de(t){return t-1e-4}function pe(t){return Zg(1e3*t)/1e3}function fe(t){return Zg(1e4*t)/1e4}function ge(t){return t&&!!t.image}function me(t){return ge(t)||function(t){return t&&!!t.svgElement}(t)}function ye(t){return"linear"===t.type}function ve(t){return"radial"===t.type}function _e(t){return t&&("linear"===t.type||"radial"===t.type)}function xe(t){return"url(#"+t+")"}function we(t){var e=t.getGlobalScale(),n=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(n)/Math.log(10)),1)}function be(t){var e=t.x||0,n=t.y||0,i=(t.rotation||0)*Tf,o=L(t.scaleX,1),r=L(t.scaleY,1),a=t.skewX||0,s=t.skewY||0,l=[];return(e||n)&&l.push("translate("+e+"px,"+n+"px)"),i&&l.push("rotate("+i+")"),1===o&&1===r||l.push("scale("+o+","+r+")"),(a||s)&&l.push("skew("+Zg(a*Tf)+"deg, "+Zg(s*Tf)+"deg)"),l.join(" ")}function Se(t,e,n){return(e-t)*n+t}function Te(t,e,n,i){for(var o=e.length,r=0;ri?e:t,r=Math.min(n,i),a=o[r-1]||{color:[0,0,0,0],offset:0},s=r;sa)i.length=a;else for(var s=r;sgm||t<-5e-5}function Ve(t,e){for(var n=0;n=Mm)){t=t||of;for(var e=[],n=+new Date,i=0;i<=127;i++)e[i]=af.measureText(String.fromCharCode(i),t).width;var o=+new Date-n;return o>16?Tm=Mm:o>2&&Tm++,e}}(t.font),t.asciiWidthMapTried=!0),0<=e&&e<=127?null!=t.asciiWidthMap?t.asciiWidthMap[e]:t.asciiCharWidth:t.stWideCharWidth}function We(t,e){var n=t.strWidthCache,i=n.get(e);return null==i&&(i=af.measureText(e,t.font).width,n.put(e,i)),i}function je(t,e,n,i){var o=We(Ze(e),t),r=Xe(e),a=Ue(0,o,n),s=Ye(0,r,i);return new lg(a,s,o,r)}function Ge(t,e,n,i){var o=((t||"")+"").split("\n");if(1===o.length)return je(o[0],e,n,i);for(var r=new lg(0,0,0,0),a=0;a=0?parseFloat(t)/100*e:parseFloat(t):t}function Ke(t,e,n){var i=e.position||"inside",o=null!=e.distance?e.distance:5,r=n.height,a=n.width,s=r/2,l=n.x,u=n.y,h="left",c="top";if(i instanceof Array)l+=qe(i[0],n.width),u+=qe(i[1],n.height),h=null,c=null;else switch(i){case"left":l-=o,u+=s,h="right",c="middle";break;case"right":l+=o+a,u+=s,c="middle";break;case"top":l+=a/2,u-=o,h="center",c="bottom";break;case"bottom":l+=a/2,u+=r+o,h="center";break;case"inside":l+=a/2,u+=s,h="center",c="middle";break;case"insideLeft":l+=o,u+=s,c="middle";break;case"insideRight":l+=a-o,u+=s,h="right",c="middle";break;case"insideTop":l+=a/2,u+=o,h="center";break;case"insideBottom":l+=a/2,u+=r-o,h="center",c="bottom";break;case"insideTopLeft":l+=o,u+=o;break;case"insideTopRight":l+=a-o,u+=o,h="right";break;case"insideBottomLeft":l+=o,u+=r-o,c="bottom";break;case"insideBottomRight":l+=a-o,u+=r-o,h="right",c="bottom"}return(t=t||{}).x=l,t.y=u,t.align=h,t.verticalAlign=c,t}function $e(t,e,n,i,o){var r=[];tn(t,"",t,e,n=n||{},i,r,o);var a=r.length,s=!1,l=n.done,u=n.aborted,h=function(){s=!0,--a<=0&&(s?l&&l():u&&u())},c=function(){--a<=0&&(s?l&&l():u&&u())};a||l&&l(),r.length>0&&n.during&&r[0].during(function(t,e){n.during(e)});for(var d=0;d0||o.force&&!a.length){var k,I=void 0,L=void 0,P=void 0;if(s)for(L={},m&&(I={}),T=0;T0){if(t<=o)return a;if(t>=r)return s}else{if(t>=o)return a;if(t<=r)return s}else{if(t===o)return a;if(t===r)return s}return(t-o)/l*u+a}function on(t,e,n){return _(t)?(i=t,i.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(t)/100*e+(n||0):parseFloat(t):null==t?NaN:+t;var i}function rn(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),n?t:+t}function an(t){if(t=+t,isNaN(t))return 0;if(t>1e-14)for(var e=1,n=0;n<15;n++,e*=10)if(Math.round(t*e)/e===t)return n;return function(t){var e=t.toString().toLowerCase(),n=e.indexOf("e"),i=n>0?+e.slice(n+1):0,o=n>0?n:e.length,r=e.indexOf(".");return Math.max(0,(r<0?0:o-1-r)-i)}(t)}function sn(t,e){var n=Math.log,i=Math.LN10,o=Math.floor(n(t[1]-t[0])/i),r=Math.round(n(Wm(e[1]-e[0]))/i),a=Math.min(Math.max(-o+r,0),20);return isFinite(a)?a:20}function ln(t,e){var n=Math.max(an(t),an(e)),i=t+e;return n>20?i:rn(i,n)}function un(t){var e=2*Math.PI;return(t%e+e)%e}function hn(t){return t>-1e-4&&t=10&&e++,e}function pn(t,e){var n=dn(t),i=Math.pow(10,n),o=t/i;return t=(e?o<1.5?1:o<2.5?2:o<4?3:o<7?5:10:o<1?1:o<2?2:o<3?3:o<5?5:10)*i,n>=-20?+t.toFixed(n<0?-n:0):t}function fn(t){var e=parseFloat(t);return e==t&&(0!==e||!_(t)||t.indexOf("x")<=0)?e:NaN}function gn(){return Math.round(9*Math.random())}function mn(t,e){return 0===e?t:mn(e,t%e)}function yn(t,e){return null==t?e:null==e?t:t*e/mn(t,e)}function vn(t){return t instanceof Array?t:null==t?[]:[t]}function _n(t,e,n){if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};for(var i=0,o=n.length;i=0||o&&l(o,s)<0)){var u=n.getShallow(s,e);null!=u&&(r[t[a][0]]=u)}}return r}}function Zn(t){if("string"==typeof t){var e=iy.get(t);return e&&e.image}return t}function Hn(t,e,n,i,o){if(t){if("string"==typeof t){if(e&&e.__zrImageSrc===t||!n)return e;var r=iy.get(t),a={hostEl:n,cb:i,cbPayload:o};return r?!jn(e=r.image)&&r.pending.push(a):((e=af.loadImage(t,Wn,Wn)).__zrImageSrc=t,iy.put(t,e.__cachedImgObj={image:e,pending:[a]})),e}return t}return e}function Wn(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=l;h++)u-=l;var c=We(s,n);return c>u&&(n="",c=0),u=t-c,o.ellipsis=n,o.ellipsisWidth=c,o.contentWidth=u,o.containerWidth=t,o}function Yn(t,e,n){var i=n.containerWidth,o=n.contentWidth,r=n.fontMeasureInfo;if(!i)return t.textLine="",void(t.isTruncated=!1);var a=We(r,e);if(a<=i)return t.textLine=e,void(t.isTruncated=!1);for(var s=0;;s++){if(a<=o||s>=n.maxIterations){e+=n.ellipsis;break}var l=0===s?Xn(e,o,r):a>0?Math.floor(e.length*o/a):0;a=We(r,e=e.substr(0,l))}""===e&&(e=n.placeholder),t.textLine=e,t.isTruncated=!0}function Xn(t,e,n){for(var i=0,o=0,r=t.length;o0&&f+i.accumWidth>i.width&&(r=e.split("\n"),c=!0),i.accumWidth=f}else{var g=$n(e,h,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+p,a=g.linesWidths,r=g.lines}}r||(r=e.split("\n"));for(var m=Ze(h),y=0;y=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}(t)||!!ly[t]}function $n(t,e,n,i,o){for(var r=[],a=[],s="",l="",u=0,h=0,c=Ze(e),d=0;dn:o+h+f>n)?h?(s||l)&&(g?(s||(s=l,l="",h=u=0),r.push(s),a.push(h-u),l+=p,s="",h=u+=f):(l&&(s+=l,l="",u=0),r.push(s),a.push(h),s=p,h=f)):g?(r.push(l),a.push(u),l=p,u=f):(r.push(p),a.push(f)):(h+=f,g?(l+=p,u+=f):(l&&(s+=l,l="",u=0),s+=p))}else l&&(s+=l,h+=u),r.push(s),a.push(h),s="",l="",u=0,h=0}return l&&(s+=l),s&&(r.push(s),a.push(h)),1===r.length&&(h+=o),{accumWidth:h,lines:r,linesWidths:a}}function Jn(t,e,n,i,o,r){if(t.baseX=n,t.baseY=i,t.outerWidth=t.outerHeight=null,e){var a=2*e.width,s=2*e.height;lg.set(uy,Ue(n,a,o),Ye(i,s,r),a,s),lg.intersect(e,uy,null,hy);var l=hy.outIntersectRect;t.outerWidth=l.width,t.outerHeight=l.height,t.baseX=Ue(l.x,l.width,o,!0),t.baseY=Ye(l.y,l.height,r,!0)}}function Qn(t){return null!=t?t+="":t=""}function ti(t,e,n,i){var o=new lg(Ue(t.x||0,e,t.textAlign),Ye(t.y||0,n,t.textBaseline),e,n),r=null!=i?i:ei(t)?t.lineWidth:0;return r>0&&(o.x-=r/2,o.y-=r/2,o.width+=r,o.height+=r),o}function ei(t){var e=t.stroke;return null!=e&&"none"!==e&&t.lineWidth>0}function ni(t,e,n,i,o,r){o[0]=xy(t,n),o[1]=xy(e,i),r[0]=wy(t,n),r[1]=wy(e,i)}function ii(t,e,n,i,o,r,a,s,l,u){var h=Zt,c=Nt,d=h(t,n,o,a,Iy);l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0;for(var p=0;p1e-4)return s[0]=t-n,s[1]=e-i,l[0]=t+n,void(l[1]=e+i);if(My[0]=Sy(o)*n+t,My[1]=by(o)*i+e,Cy[0]=Sy(r)*n+t,Cy[1]=by(r)*i+e,u(s,My,Cy),h(l,My,Cy),(o%=Ty)<0&&(o+=Ty),(r%=Ty)<0&&(r+=Ty),o>r&&!a?r+=Ty:oo&&(ky[0]=Sy(p)*n+t,ky[1]=by(p)*i+e,u(s,ky,s),h(l,ky,l))}function ai(t){return Math.round(t/Hy*1e8)/1e8%2*Hy}function si(t,e,n,i,o,r,a){if(0===o)return!1;var s,l=o;if(a>e+l&&a>i+l||at+l&&r>n+l||re+c&&h>i+c&&h>r+c&&h>s+c||ht+c&&u>n+c&&u>o+c&&u>a+c||u=0&&pe+u&&l>i+u&&l>r+u||lt+u&&s>n+u&&s>o+u||s=0&&gn||h+uo&&(o+=qy);var d=Math.atan2(l,s);return d<0&&(d+=qy),d>=i&&d<=o||d+qy>=i&&d+qy<=o}function di(t,e,n,i,o,r){if(r>e&&r>i||ro?s:0}function pi(){var t=Qy[0];Qy[0]=Qy[1],Qy[1]=t}function fi(t,e,n,i,o,r,a,s,l,u){if(u>e&&u>i&&u>r&&u>s||u1&&pi(),p=Nt(e,i,r,s,Qy[0]),d>1&&(f=Nt(e,i,r,s,Qy[1]))),c+=2===d?me&&s>i&&s>r||s=0&&h<=1&&(o[l++]=h);else{var u=a*a-4*r*s;if(Rt(u))(h=-a/(2*r))>=0&&h<=1&&(o[l++]=h);else if(u>0){var h,c=Sg(u),d=(-a-c)/(2*r);(h=(-a+c)/(2*r))>=0&&h<=1&&(o[l++]=h),d>=0&&d<=1&&(o[l++]=d)}}return l}(e,i,r,s,Jy);if(0===l)return 0;var u=Ut(e,i,r);if(u>=0&&u<=1){for(var h=0,c=jt(e,i,r,u),d=0;dn||s<-n)return 0;var l=Math.sqrt(n*n-s*s);Jy[0]=-l,Jy[1]=l;var u=Math.abs(i-o);if(u<1e-4)return 0;if(u>=$y-1e-4){i=0,o=$y;var h=r?1:-1;return a>=Jy[0]+t&&a<=Jy[1]+t?h:0}if(i>o){var c=i;i=o,o=c}i<0&&(i+=$y,o+=$y);for(var d=0,p=0;p<2;p++){var f=Jy[p];if(f+t>a){var g=Math.atan2(s,f);h=r?1:-1,g<0&&(g=$y+g),(g>=i&&g<=o||g+$y>=i&&g+$y<=o)&&(g>Math.PI/2&&g<1.5*Math.PI&&(h=-h),d+=h)}}return d}function yi(t,e,n,i,o){for(var r,a,s=t.data,l=t.len(),u=0,h=0,c=0,d=0,p=0,f=0;f1&&(n||(u+=di(h,c,d,p,i,o))),m&&(d=h=s[f],p=c=s[f+1]),g){case Ky.M:h=d=s[f++],c=p=s[f++];break;case Ky.L:if(n){if(si(h,c,s[f],s[f+1],e,i,o))return!0}else u+=di(h,c,s[f],s[f+1],i,o)||0;h=s[f++],c=s[f++];break;case Ky.C:if(n){if(li(h,c,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],e,i,o))return!0}else u+=fi(h,c,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],i,o)||0;h=s[f++],c=s[f++];break;case Ky.Q:if(n){if(ui(h,c,s[f++],s[f++],s[f],s[f+1],e,i,o))return!0}else u+=gi(h,c,s[f++],s[f++],s[f],s[f+1],i,o)||0;h=s[f++],c=s[f++];break;case Ky.A:var y=s[f++],v=s[f++],_=s[f++],x=s[f++],w=s[f++],b=s[f++];f+=1;var S=!!(1-s[f++]);r=Math.cos(w)*_+y,a=Math.sin(w)*x+v,m?(d=r,p=a):u+=di(h,c,r,a,i,o);var T=(i-y)*x/_+y;if(n){if(ci(y,v,x,w,w+b,S,e,T,o))return!0}else u+=mi(y,v,x,w,w+b,S,T,o);h=Math.cos(w+b)*_+y,c=Math.sin(w+b)*x+v;break;case Ky.R:if(d=h=s[f++],p=c=s[f++],r=d+s[f++],a=p+s[f++],n){if(si(d,p,r,p,e,i,o)||si(r,p,r,a,e,i,o)||si(r,a,d,a,e,i,o)||si(d,a,d,p,e,i,o))return!0}else u+=di(r,p,r,a,i,o),u+=di(d,a,d,p,i,o);break;case Ky.Z:if(n){if(si(h,c,d,p,e,i,o))return!0}else u+=di(h,c,d,p,i,o);h=d,c=p}}return n||Math.abs(c-p)<1e-4||(u+=di(h,c,d,p,i,o)||0),0!==u}function vi(t,e,n){if(e){var i=e.x1,o=e.x2,r=e.y1,a=e.y2;t.x1=i,t.x2=o,t.y1=r,t.y2=a;var s=n&&n.lineWidth;return s?(dv(2*i)===dv(2*o)&&(t.x1=t.x2=xi(i,s,!0)),dv(2*r)===dv(2*a)&&(t.y1=t.y2=xi(r,s,!0)),t):t}}function _i(t,e,n){if(e){var i=e.x,o=e.y,r=e.width,a=e.height;t.x=i,t.y=o,t.width=r,t.height=a;var s=n&&n.lineWidth;return s?(t.x=xi(i,s,!0),t.y=xi(o,s,!0),t.width=Math.max(xi(i+r,s,!1)-t.x,0===r?0:1),t.height=Math.max(xi(o+a,s,!1)-t.y,0===a?0:1),t):t}}function xi(t,e,n){if(!e)return t;var i=dv(2*t);return(i+dv(e))%2==0?i/2:(i+(n?1:-1))/2}function wi(t){return"string"!=typeof t||-1===t.indexOf("px")&&-1===t.indexOf("rem")&&-1===t.indexOf("em")?isNaN(+t)?"12px":t+"px":t}function bi(t,e){for(var n=0;n=0,r=!1;if(t instanceof ov){var s=Iv(t),u=o&&s.selectFill||s.normalFill,h=o&&s.selectStroke||s.normalStroke;if(Pi(u)||Pi(h)){var c=(i=i||{}).style||{};"inherit"===c.fill?(r=!0,i=a({},i),(c=a({},c)).fill=u):!Pi(c.fill)&&Pi(u)?(r=!0,i=a({},i),(c=a({},c)).fill=he(u)):!Pi(c.stroke)&&Pi(h)&&(r||(i=a({},i),c=a({},c)),c.stroke=he(h)),i.style=c}}if(i&&null==i.z2){r||(i=a({},i));var d=t.z2EmphasisLift;i.z2=t.z2+(null!=d?d:10)}return i}(this,0,e,n);if("blur"===t)return function(t,e,n){var i=l(t.currentStates,e)>=0,o=t.style.opacity,r=i?null:function(t,e,n,i){for(var o=t.style,r={},a=0;a0){var r={dataIndex:o,seriesIndex:t.seriesIndex};null!=i&&(r.dataType=i),e.push(r)}})}),e}function no(t,e,n){oo(t,!0),Fi(t,Zi),function(t,e,n){var i=Mv(t);null!=e?(i.focus=e,i.blurScope=n):i.focus&&(i.focus=null)}(t,e,n)}function io(t,e,n,i){i?function(t){oo(t,!1)}(t):no(t,e,n)}function oo(t,e){var n=!1===e,i=t;t.highDownSilentOnTouch&&(i.__highDownSilentOnTouch=t.highDownSilentOnTouch),n&&!i.__highDownDispatcher||(i.__highByOuter=i.__highByOuter||0,i.__highDownDispatcher=!n)}function ro(t){return!(!t||!t.__highDownDispatcher)}function ao(t){var e=t.type;return e===zv||e===Ev||e===Rv}function so(t){var e=t.type;return e===Av||e===Ov}function lo(t,e,n){var i,o=t.labelFetcher,r=t.labelDataIndex,a=t.labelDimIndex,s=e.normal;o&&(i=o.getFormattedLabel(r,"normal",null,a,s&&s.get("formatter"),null!=n?{interpolatedValue:n}:null)),null==i&&(i=v(t.defaultText)?t.defaultText(r,t,n):t.defaultText);for(var l={normal:i},u=0;u=12?"pm":"am",m=g.toUpperCase(),y=i instanceof i_?i:function(t){return u_[t]}(i||h_)||u_[s_],v=y.getModel("time"),_=v.get("month"),x=v.get("monthAbbr"),w=v.get("dayOfWeek"),b=v.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,g+"").replace(/{A}/g,m+"").replace(/{yyyy}/g,r+"").replace(/{yy}/g,_o(r%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,_[a-1]).replace(/{MMM}/g,x[a-1]).replace(/{MM}/g,_o(a,2)).replace(/{M}/g,a+"").replace(/{dd}/g,_o(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,w[u]).replace(/{ee}/g,b[u]).replace(/{e}/g,u+"").replace(/{HH}/g,_o(h,2)).replace(/{H}/g,h+"").replace(/{hh}/g,_o(c+"",2)).replace(/{h}/g,c+"").replace(/{mm}/g,_o(d,2)).replace(/{m}/g,d+"").replace(/{ss}/g,_o(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,_o(f,3)).replace(/{S}/g,f+"")}function So(t,e){var n=cn(t),i=n[Co(e)]()+1,o=n[ko(e)](),r=n[Io(e)](),a=n[Lo(e)](),s=n[Po(e)](),l=0===n[Do(e)](),u=l&&0===s,h=u&&0===a,c=h&&0===r,d=c&&1===o;return d&&1===i?"year":d?"month":c?"day":h?"hour":u?"minute":l?"second":"millisecond"}function To(t,e,n){switch(e){case"year":t[Oo(n)](0);case"month":t[zo(n)](1);case"day":t[Eo(n)](0);case"hour":t[Ro(n)](0);case"minute":t[Bo(n)](0);case"second":t[No(n)](0)}return t}function Mo(t){return t?"getUTCFullYear":"getFullYear"}function Co(t){return t?"getUTCMonth":"getMonth"}function ko(t){return t?"getUTCDate":"getDate"}function Io(t){return t?"getUTCHours":"getHours"}function Lo(t){return t?"getUTCMinutes":"getMinutes"}function Po(t){return t?"getUTCSeconds":"getSeconds"}function Do(t){return t?"getUTCMilliseconds":"getMilliseconds"}function Ao(t){return t?"setUTCFullYear":"setFullYear"}function Oo(t){return t?"setUTCMonth":"setMonth"}function zo(t){return t?"setUTCDate":"setDate"}function Eo(t){return t?"setUTCHours":"setHours"}function Ro(t){return t?"setUTCMinutes":"setMinutes"}function Bo(t){return t?"setUTCSeconds":"setSeconds"}function No(t){return t?"setUTCMilliseconds":"setMilliseconds"}function Fo(t){if(isNaN(fn(t)))return _(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function Vo(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}function Zo(t,e,n){function i(t){return t&&z(t)?t:"-"}function o(t){return!(null==t||isNaN(t)||!isFinite(t))}var r="time"===e,a=t instanceof Date;if(r||a){var s=r?cn(t):t;if(!isNaN(+s))return bo(s,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",n);if(a)return"-"}if("ordinal"===e)return x(t)?i(t):w(t)&&o(t)?t+"":"-";var l=fn(t);return o(l)?Fo(l):x(t)?i(t):"boolean"==typeof t?t+"":"-"}function Ho(t,e,n){y(e)||(e=[e]);var i=e.length;if(!i)return"";for(var o=e[0].$vars||[],r=0;ri||l.newline?(r=0,h=g,a+=s+n,s=d.height):s=Math.max(s,d.height)}else{var m=d.height+(f?-f.y+d.y:0);(c=a+m)>o||l.newline?(r+=s+n,a=0,c=m,s=d.width):s=Math.max(s,d.width)}l.newline||(l.x=r,l.y=a,l.markRedraw(),"horizontal"===t?r=h+n:a=c+n)})}function Yo(t,e,n){n=S_(n||0);var i=e.width,o=e.height,r=jm(t.left,i),a=jm(t.top,o),s=jm(t.right,i),l=jm(t.bottom,o),u=jm(t.width,i),h=jm(t.height,o),c=n[2]+n[0],d=n[1]+n[3],p=t.aspect;switch(isNaN(u)&&(u=i-s-d-r),isNaN(h)&&(h=o-l-c-a),null!=p&&(isNaN(u)&&isNaN(h)&&(p>i/o?u=.8*i:h=.8*o),isNaN(u)&&(u=p*h),isNaN(h)&&(h=u/p)),isNaN(r)&&(r=i-s-u-d),isNaN(a)&&(a=o-l-h-c),t.left||t.right){case"center":r=i/2-u/2-n[3];break;case"right":r=i-u-d}switch(t.top||t.bottom){case"middle":case"center":a=o/2-h/2-n[0];break;case"bottom":a=o-h-c}r=r||0,a=a||0,isNaN(u)&&(u=i-d-r-(s||0)),isNaN(h)&&(h=o-c-a-(l||0));var f=new lg((e.x||0)+r+n[3],(e.y||0)+a+n[0],u,h);return f.margin=n,f}function Xo(t,e,n){var i,o,r,a,s=t.boxCoordinateSystem;if(s){var l=function(t){var e=t.getShallow("coord",!0),n=L_;if(null==e){var i=D_.get(t.type);i&&i.getCoord2&&(n=P_,e=i.getCoord2(t))}return{coord:e,from:n}}(t),u=l.coord,h=l.from;if(s.dataToLayout){r=V_.rect,a=h;var c=s.dataToLayout(u);i=c.contentRect||c.rect}else n&&n.enableLayoutOnlyByCenter&&s.dataToPoint&&(r=V_.point,a=h,o=s.dataToPoint(u))}return null==r&&(r=V_.rect),r===V_.rect&&(i||(i={x:0,y:0,width:e.getWidth(),height:e.getHeight()}),o=[i.x+i.width/2,i.y+i.height/2]),{type:r,refContainer:i,refPoint:o,boxCoordFrom:a}}function qo(t,e,n,i,o,r){var a,l=!o||!o.hv||o.hv[0],u=!o||!o.hv||o.hv[1],h=o&&o.boundingMode||"all";if((r=r||t).x=t.x,r.y=t.y,!l&&!u)return!1;if("raw"===h)a="group"===t.type?new lg(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(a=t.getBoundingRect(),t.needLocalTransform()){var c=t.getLocalTransform();(a=a.clone()).applyTransform(c)}var d=Yo(s({width:a.width,height:a.height},e),n,i),p=l?d.x-a.x:0,f=u?d.y-a.y:0;return"raw"===h?(r.x=p,r.y=f):(r.x+=p,r.y+=f),r===t&&t.markRedraw(),!0}function Ko(t){var e=t.layoutMode||t.constructor.layoutMode;return b(e)?e:e?{type:e}:null}function $o(t,e,n){function i(n,i){var r={},s=0,l={},u=0;if(R_(n,function(e){l[e]=t[e]}),R_(n,function(t){Z(e,t)&&(r[t]=l[t]=e[t]),o(r,t)&&s++,o(l,t)&&u++}),a[i])return o(e,n[1])?l[n[2]]=null:o(e,n[2])&&(l[n[1]]=null),l;if(2!==u&&s){if(s>=2)return r;for(var h=0;h=e:"max"===n?t<=e:t===e})(i[a],t,r)||(o=!1)}}),o}function sr(t){var e=t&&t.itemStyle;if(e)for(var n=0,i=Bx.length;n65535?aw:sw}function jr(){return[1/0,-1/0]}function Gr(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function Ur(t,e,n,i,o){var r=hw[n||"float"];if(o){var a=t[e],s=a&&a.length;if(s!==i){for(var l=new r(i),u=0;u1||n>0&&!t.noHeader;return c(t.blocks,function(t){var n=ta(t);n>=e&&(e=n+ +(i&&(!n||Jr(t)&&!t.noHeader)))}),e}return 0}function ea(t,e,n,i){var o,r=e.noHeader,s=(o=ta(e),{html:fw[o],richText:gw[o]}),l=[],u=e.blocks||[];O(!u||y(u)),u=u||[];var h=t.orderMode;if(e.sortBlocks&&h){u=u.slice();var d={valueAsc:"asc",valueDesc:"desc"};if(Z(d,h)){var p=new nw(d[h],null);u.sort(function(t,e){return p.evaluate(t.sortParam,e.sortParam)})}else"seriesDesc"===h&&u.reverse()}c(u,function(n,o){var r=e.valueFormatter,u=Qr(n)(r?a(a({},t),{valueFormatter:r}):t,n,o>0?s.html:0,i);null!=u&&l.push(u)});var f="richText"===t.renderMode?l.join(s.richText):oa(i,l.join(""),r?n:s.html);if(r)return f;var g=Zo(e.header,"ordinal",t.useUTC),m=Kr(i,t.renderMode).nameStyle,v=qr(i);return"richText"===t.renderMode?ra(t,g,m)+s.richText+f:oa(i,'
'+lt(g)+"
"+f,n)}function na(t,e,n,i){var o=t.renderMode,r=e.noName,a=e.noValue,s=!e.markerType,l=e.name,u=t.useUTC,h=e.valueFormatter||t.valueFormatter||function(t){return d(t=y(t)?t:[t],function(t,e){return Zo(t,y(f)?f[e]:f,u)})};if(!r||!a){var c=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||X_.color.secondary,o),p=r?"":Zo(l,"ordinal",u),f=e.valueType,g=a?[]:h(e.value,e.dataIndex),m=!s||!r,v=!s&&r,_=Kr(i,o),x=_.nameStyle,w=_.valueStyle;return"richText"===o?(s?"":c)+(r?"":ra(t,p,x))+(a?"":function(t,e,n,i,o){var r=[o];return n&&r.push({padding:[0,0,0,i?10:20],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(y(e)?e.join(" "):e,r)}(t,g,m,v,w)):oa(i,(s?"":c)+(r?"":function(t,e,n){return''+lt(t)+""}(p,!s,x))+(a?"":function(t,e,n,i){return''+d(t=y(t)?t:[t],function(t){return lt(t)}).join("  ")+""}(g,m,v,w)),n)}}function ia(t,e,n,i,o,r){if(t)return Qr(t)({useUTC:o,renderMode:n,orderMode:i,markupStyleCreator:e,valueFormatter:t.valueFormatter},t,0,r)}function oa(t,e,n){return'
'+e+'
'}function ra(t,e,n){return t.markupStyleCreator.wrapRichTextStyle(e,n)}function aa(t,e){var n=t.get("padding");return null!=n?n:"richText"===e?[8,10]:10}function sa(t){var e,n,i,o,r=t.series,a=t.dataIndex,s=t.multipleSeries,l=r.getData(),u=l.mapDimensionsAll("defaultedTooltip"),h=u.length,d=r.getRawValue(a),f=y(d),g=function(t,e){return Wo(t.getData().getItemVisual(e,"style")[t.visualDrawType])}(r,a);if(h>1||f&&!h){var m=function(t,e,n,i,o){function r(t,e){var n=a.getDimensionInfo(e);n&&!1!==n.otherDims.tooltip&&(s?h.push($r("nameValue",{markerType:"subItem",markerColor:o,name:n.displayName,value:t,valueType:n.type})):(l.push(t),u.push(n.type)))}var a=e.getData(),s=p(t,function(t,e,n){var i=a.getDimensionInfo(n);return t||i&&!1!==i.tooltip&&null!=i.displayName},!1),l=[],u=[],h=[];return i.length?c(i,function(t){r(Or(a,n,t),t)}):c(t,r),{inlineValues:l,inlineValueTypes:u,blocks:h}}(d,r,a,u,g);e=m.inlineValues,n=m.inlineValueTypes,i=m.blocks,o=m.inlineValues[0]}else if(h){var v=l.getDimensionInfo(u[0]);o=e=Or(l,a,u[0]),n=v.type}else o=e=f?d[0]:d;var _=Cn(r),x=_&&r.name||"",w=l.getName(a),b=s?x:w;return $r("section",{header:x,noHeader:s||!_,sortParam:o,blocks:[$r("nameValue",{markerType:"item",markerColor:g,name:b,noName:!z(b),value:e,valueType:n,dataIndex:a})].concat(i||[])})}function la(t,e){return t.getName(e)||t.getId(e)}function ua(t){var e=t.name;Cn(t)||(t.name=function(t){var e=t.getRawData(),n=e.mapDimensionsAll("seriesName"),i=[];return c(n,function(t){var n=e.getDimensionInfo(t);n.displayName&&i.push(n.displayName)}),i.join(" ")}(t)||e)}function ha(t){return t.model.getRawData().count()}function ca(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),da}function da(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function pa(t,e){c(N(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(n){t.wrapMethod(n,m(fa,e))})}function fa(t,e){var n=ga(t);return n&&n.setOutputEnd((e||this).count()),e}function ga(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){var i=n.currentTask;if(i){var o=i.agentStubMap;o&&(i=o.get(t.uid))}return i}}function ma(){var t=Ln();return function(e){var n=t(e),i=e.pipelineContext,o=!!n.large,r=!!n.progressiveRender,a=n.large=!(!i||!i.large),s=n.progressiveRender=!(!i||!i.progressiveRender);return!(o===a&&r===s)&&"reset"}}function ya(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function va(t,e){return(t[0]*e[0]+t[1]*e[1])/(ya(t)*ya(e))}function _a(t,e){return(t[0]*e[1]1&&(a*=Cw(f),s*=Cw(f));var g=(o===r?-1:1)*Cw((a*a*(s*s)-a*a*(p*p)-s*s*(d*d))/(a*a*(p*p)+s*s*(d*d)))||0,m=g*a*p/s,y=g*-s*d/a,v=(t+n)/2+Iw(c)*m-kw(c)*y,_=(e+i)/2+kw(c)*m+Iw(c)*y,x=_a([1,0],[(d-m)/a,(p-y)/s]),w=[(d-m)/a,(p-y)/s],b=[(-1*d-m)/a,(-1*p-y)/s],S=_a(w,b);if(va(w,b)<=-1&&(S=Lw),va(w,b)>=1&&(S=0),S<0){var T=Math.round(S/Lw*1e6)/1e6;S=2*Lw+T%2*Lw}h.addData(u,v,_,a,s,x,S,c,r)}function wa(t){return null!=t.setData}function ba(t,e){var n=function(t){var e=new Yy;if(!t)return e;var n,i=0,o=0,r=i,a=o,s=Yy.CMD,l=t.match(Pw);if(!l)return e;for(var u=0;uP*P+D*D&&(T=C,M=k),{cx:T,cy:M,x0:-h,y0:-c,x1:T*(o/w-1),y1:M*(o/w-1)}}function Ta(t,e,n){var i=e.smooth,o=e.points;if(o&&o.length>=2){if(i){var r=function(t,e,n,i){var o,r,a,s,l=[],u=[],h=[],c=[];if(i){a=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,p=t.length;d0){var c={duration:h.duration,delay:h.delay||0,easing:h.easing,done:r,force:!!r||!!a,setToFinal:!u,scope:t,during:a};l?e.animateFrom(n,c):e.animateTo(n,c)}else e.stopAnimation(),!l&&e.attr(n),a&&a(1),r&&r()}function Ia(t,e,n,i,o,r){ka("update",t,e,n,i,o,r)}function La(t,e,n,i,o,r){ka("enter",t,e,n,i,o,r)}function Pa(t){if(!t.__zr)return!0;for(var e=0;eWm(r[1])?r[0]>0?"right":"left":r[1]>0?"bottom":"top"}function Ya(t){return!t.isGroup}function Xa(t,e,n){function i(t){var e={x:t.x,y:t.y,rotation:t.rotation};return function(t){return null!=t.shape}(t)&&(e.shape=o(t.shape)),e}if(t&&e){var r,a=(r={},t.traverse(function(t){Ya(t)&&t.anid&&(r[t.anid]=t)}),r);e.traverse(function(t){if(Ya(t)&&t.anid){var e=a[t.anid];if(e){var o=i(t);t.attr(i(e)),Ia(t,o,n,Mv(t).dataIndex)}}})}}function qa(t,e){return d(t,function(t){var n=t[0];n=Hm(n,e.x),n=Zm(n,e.x+e.width);var i=t[1];return i=Hm(i,e.y),[n,i=Zm(i,e.y+e.height)]})}function Ka(t,e){var n=Hm(t.x,e.x),i=Zm(t.x+t.width,e.x+e.width),o=Hm(t.y,e.y),r=Zm(t.y+t.height,e.y+e.height);if(i>=n&&r>=o)return{x:n,y:o,width:i-n,height:r-o}}function $a(t,e,n){var i=a({rectHover:!0},e),o=i.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(o.image=t.slice(8),s(o,n),new cv(i)):Na(t.replace("path://",""),i,n,"center")}function Ja(t,e,n,i,o){for(var r=0,a=o[o.length-1];r=-1e-6)return!1;var f=t-o,g=e-r,m=ts(f,g,u,h)/p;if(m<0||m>1)return!1;var y=ts(f,g,c,d)/p;return!(y<0||y>1)}function ts(t,e,n,i){return t*i-n*e}function es(t,e,n,i,o){return null==e||(w(e)?jb[0]=jb[1]=jb[2]=jb[3]=e:(jb[0]=e[0],jb[1]=e[1],jb[2]=e[2],jb[3]=e[3]),i&&(jb[0]=Hm(0,jb[0]),jb[1]=Hm(0,jb[1]),jb[2]=Hm(0,jb[2]),jb[3]=Hm(0,jb[3])),n&&(jb[0]=-jb[0],jb[1]=-jb[1],jb[2]=-jb[2],jb[3]=-jb[3]),ns(t,jb,"x","width",3,1,o&&o[0]||0),ns(t,jb,"y","height",0,2,o&&o[1]||0)),t}function ns(t,e,n,i,o,r,a){var s=e[r]+e[o],l=t[i];t[i]+=s,a=Hm(0,Zm(a,l)),t[i]=0?-e[o]:e[r]>=0?l+e[r]:Wm(s)>1e-8?(l-a)*e[o]/s:0):t[n]-=e[o]}function is(t){var e=t.itemTooltipOption,n=t.componentModel,i=t.itemName,o=_(e)?{formatter:e}:e,r=n.mainType,a=n.componentIndex,l={componentType:r,name:i,$vars:["name"]};l[r+"Index"]=a;var u=t.formatterParamsExtra;u&&c(g(u),function(t){Z(l,t)||(l[t]=u[t],l.$vars.push(t))});var h=Mv(t.el);h.componentMainType=r,h.componentIndex=a,h.tooltipConfig={name:i,option:s({content:i,encodeHTMLContent:!0,formatterParams:l},o)}}function os(t,e){var n;t.isGroup&&(n=e(t)),n||t.traverse(e)}function rs(t,e){if(t)if(y(t))for(var n=0;ni&&(i=e),ei&&(o=i=0),{min:o,max:i}}function cs(t,e,n){ds(t,e,n,-1/0)}function ds(t,e,n,i){if(t.ignoreModelZ)return i;var o=t.getTextContent(),r=t.getTextGuideLine();if(t.isGroup)for(var a=t.childrenRef(),s=0;s=0?i():c=setTimeout(i,-r),u=o};return d.clear=function(){c&&(clearTimeout(c),c=null)},d.debounceNextCall=function(t){l=t},d}function vs(t,e,n,i){var o=t[e];if(o){var r=o[Jb]||o;if(o[Qb]!==n||o[tS]!==i){if(null==n||!i)return t[e]=r;(o=t[e]=ys(r,n,"debounce"===i))[Jb]=r,o[tS]=i,o[Qb]=n}return o}}function _s(t,e){var n=t[e];n&&n[Jb]&&(n.clear&&n.clear(),t[e]=n[Jb])}function xs(t,e){return t.visualStyleMapper||nS[e]||(console.warn("Unknown style type '"+e+"'."),nS.itemStyle)}function ws(t,e){return t.visualDrawType||iS[e]||(console.warn("Unknown style type '"+e+"'."),"fill")}function bs(t){t.overallReset(t.ecModel,t.api,t.payload)}function Ss(t){return t.overallProgress&&Ts}function Ts(){this.agent.dirty(),this.getDownstream().dirty()}function Ms(){this.agent&&this.agent.dirty()}function Cs(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function ks(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=vn(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?d(e,function(t,e){return Is(e)}):hS}function Is(t){return function(e,n){var i=n.data,o=n.resetDefines[t];if(o&&o.dataEach)for(var r=e.start;r=0&&Ns(l)?l:.5,t.createRadialGradient(a,s,0,a,s,l)}(t,e,n):function(t,e,n){var i=null==e.x?0:e.x,o=null==e.x2?1:e.x2,r=null==e.y?0:e.y,a=null==e.y2?0:e.y2;return e.global||(i=i*n.width+n.x,o=o*n.width+n.x,r=r*n.height+n.y,a=a*n.height+n.y),i=Ns(i)?i:0,o=Ns(o)?o:1,r=Ns(r)?r:0,a=Ns(a)?a:0,t.createLinearGradient(i,r,o,a)}(t,e,n),o=e.colorStops,r=0;r0&&(n=i.lineWidth,(e=i.lineDash)&&"solid"!==e&&n>0?"dashed"===e?[4*n,2*n]:"dotted"===e?[n]:w(e)?[e]:y(e)?e:null:null),r=i.lineDashOffset;if(o){var a=i.strokeNoScale&&t.getLineScale?t.getLineScale():1;a&&1!==a&&(o=d(o,function(t){return t/a}),r/=a)}return[o,r]}function Ws(t){var e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))}function js(t){return"string"==typeof t&&"none"!==t}function Gs(t){var e=t.fill;return null!=e&&"none"!==e}function Us(t,e){if(null!=e.fillOpacity&&1!==e.fillOpacity){var n=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=n}else t.fill()}function Ys(t,e){if(null!=e.strokeOpacity&&1!==e.strokeOpacity){var n=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=n}else t.stroke()}function Xs(t,e,n){var i=Hn(e.image,e.__image,n);if(jn(i)){var o=t.createPattern(i,e.repeat||"repeat");if("function"==typeof DOMMatrix&&o&&o.setTransform){var r=new DOMMatrix;r.translateSelf(e.x||0,e.y||0),r.rotateSelf(0,0,(e.rotation||0)*Tf),r.scaleSelf(e.scaleX||1,e.scaleY||1),o.setTransform(r)}return o}}function qs(t,e,n,i,o){var r=!1;if(!i&&e===(n=n||{}))return!1;if(i||e.opacity!==n.opacity){Js(t,o),r=!0;var a=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(a)?dy.opacity:a}(i||e.blend!==n.blend)&&(r||(Js(t,o),r=!0),t.globalCompositeOperation=e.blend||dy.blend);for(var s=0;s=0)){ET.push(n);var r=pS.wrapStageHandler(n,o);r.__prio=e,r.__raw=n,t.push(r)}}function vl(t,e){PT[t]=e}function _l(t,e,n,i){return{eventContent:{selected:eo(n),isFromClick:e.isFromClick||!1}}}function xl(e=!1){return RT||(RT=t(481),RT)}function wl(t,e,n,i,o,r){if(o-i<=n)return;const a=i+o>>1;bl(t,e,a,i,o,r),wl(t,e,n,i,a-1,1-r),wl(t,e,n,a+1,o,1-r)}function bl(t,e,n,i,o,r){for(;o>i;){if(o-i>600){const a=o-i+1,s=n-i+1,l=Math.log(a),u=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*u*(a-u)/a)*(s-a/2<0?-1:1);bl(t,e,n,Math.max(i,Math.floor(n-s*u/a+h)),Math.min(o,Math.floor(n+(a-s)*u/a+h)),r)}const a=e[2*n+r];let s=i,l=o;for(Sl(t,e,i,n),e[2*o+r]>a&&Sl(t,e,i,o);sa;)l--}e[2*i+r]===a?Sl(t,e,i,l):(l++,Sl(t,e,l,o)),l<=n&&(i=l+1),n<=l&&(o=l-1)}}function Sl(t,e,n,i){Tl(t,n,i),Tl(e,2*n,2*i),Tl(e,2*n+1,2*i+1)}function Tl(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function Ml(t,e,n,i){const o=t-n,r=e-i;return o*o+r*r}function Cl(t){y(t)?c(t,function(t){Cl(t)}):l(UT,t)>=0||(UT.push(t),v(t)&&(t={install:t}),t.install(YT))}function kl(t){return isNaN(+t.cpx1)||isNaN(+t.cpy1)}function Il(t){return"_"+t+"Type"}function Ll(t,e,n){var i=e.getItemVisual(n,t);if(!i||"none"===i)return i;var o=e.getItemVisual(n,t+"Size"),r=e.getItemVisual(n,t+"Rotate"),a=e.getItemVisual(n,t+"Offset"),s=e.getItemVisual(n,t+"KeepAspect"),l=Rs(o);return i+l+Bs(a||0,l)+(r||"")+(s||"")}function Pl(t,e,n){var i=e.getItemVisual(n,t);if(i&&"none"!==i){var o=e.getItemVisual(n,t+"Size"),r=e.getItemVisual(n,t+"Rotate"),a=e.getItemVisual(n,t+"Offset"),s=e.getItemVisual(n,t+"KeepAspect"),l=Rs(o),u=Bs(a||0,l),h=Es(i,-l[0]/2+u[0],-l[1]/2+u[1],l[0],l[1],null,s);return h.__specifiedRotation=null==r||isNaN(r)?void 0:+r*Math.PI/180||0,h.name=t,h}}function Dl(t,e){t.x1=e[0][0],t.y1=e[0][1],t.x2=e[1][0],t.y2=e[1][1],t.percent=1;var n=e[2];n?(t.cpx1=n[0],t.cpy1=n[1]):(t.cpx1=NaN,t.cpy1=NaN)}function Al(t){var e=t.hostModel,n=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:n.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:n.get("disabled"),blurScope:n.get("blurScope"),focus:n.get("focus"),labelStatesModels:ho(e)}}function Ol(t){return isNaN(t[0])||isNaN(t[1])}function zl(t){return t&&!Ol(t[0])&&!Ol(t[1])}function El(t){return null==t?0:t.length||1}function Rl(t){return t}function Bl(t,e){return t.hasOwnProperty(e)||(t[e]=[]),t[e]}function Nl(t){return t instanceof kM}function Fl(t){for(var e=B(),n=0;n<(t||[]).length;n++){var i=t[n],o=b(i)?i.name:i;null!=o&&null==e.get(o)&&e.set(o,n)}return e}function Vl(t){var e=MM(t);return e.dimNameMap||(e.dimNameMap=Fl(t.dimensionsDefine))}function Zl(t){return t>30}function Hl(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(t.data=d(e,function(t){var e={coords:[t[0].coord,t[1].coord]};return t[0].name&&(e.fromName=t[0].name),t[1].name&&(e.toName=t[1].name),function(t){for(var e=t[0],n=1,i=t.length;nn&&!l||o=0?i+=u:i-=u:f>=0?i-=u:i+=u}return i}function Su(t,e){var n=[],i=Yt,o=[[],[],[]],r=[[],[]],a=[];e/=2,t.eachEdge(function(t,s){var l=t.getLayout(),u=t.getVisual("fromSymbol"),h=t.getVisual("toSymbol");l.__original||(l.__original=[U(l[0]),U(l[1])],l[2]&&l.__original.push(U(l[2])));var c=l.__original;if(null!=l[2]){if(G(o[0],c[0]),G(o[1],c[2]),G(o[2],c[1]),u&&"none"!==u){var d=Ql(t.node1),p=bu(o,c[0],d*e);i(o[0][0],o[1][0],o[2][0],p,n),o[0][0]=n[3],o[1][0]=n[4],i(o[0][1],o[1][1],o[2][1],p,n),o[0][1]=n[3],o[1][1]=n[4]}h&&"none"!==h&&(d=Ql(t.node2),p=bu(o,c[1],d*e),i(o[0][0],o[1][0],o[2][0],p,n),o[1][0]=n[1],o[2][0]=n[2],i(o[0][1],o[1][1],o[2][1],p,n),o[1][1]=n[1],o[2][1]=n[2]),G(l[0],o[0]),G(l[1],o[2]),G(l[2],o[1])}else G(r[0],c[0]),G(r[1],c[1]),K(a,r[1],r[0]),Q(a,a),u&&"none"!==u&&(d=Ql(t.node1),q(r[0],r[0],a,d*e)),h&&"none"!==h&&(d=Ql(t.node2),q(r[1],r[1],a,-d*e)),G(l[0],r[0]),G(l[1],r[1])})}function Tu(t){return"view"===t.type}function Mu(t){return"_EC_"+t}function Cu(t,e){return{getValue:function(n){var i=this[t][e];return i.getStore().get(i.getDimensionIndex(n||"value"),this.dataIndex)},setVisual:function(n,i){this.dataIndex>=0&&this[t][e].setItemVisual(this.dataIndex,n,i)},getVisual:function(n){return this[t][e].getItemVisual(this.dataIndex,n)},setLayout:function(n,i){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,n,i)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}}function ku(t,e){if(wC(this).mainData===this){var n=a({},wC(this).datas);n[this.dataType]=e,Au(e,n,t)}else Ou(e,this.dataType,wC(this).mainData,t);return e}function Iu(t,e){return t.struct&&t.struct.update(),e}function Lu(t,e){return c(wC(e).datas,function(n,i){n!==e&&Ou(n.cloneShallow(),i,e,t)}),e}function Pu(t){var e=wC(this).mainData;return null==t||null==e?e:wC(e).datas[t]}function Du(){var t=wC(this).mainData;return null==t?[{data:t}]:d(g(wC(t).datas),function(e){return{type:e,data:wC(t).datas[e]}})}function Au(t,e,n){wC(t).datas={},c(e,function(e,i){Ou(e,i,t,n)})}function Ou(t,e,n,i){wC(n).datas[e]=t,wC(t).mainData=n,t.dataType=e,i.struct&&(t[i.structAttr]=i.struct,i.struct[i.datasAttr[e]]=t),t.getLinkedData=Pu,t.getLinkedDataAll=Du}function zu(t,e){function n(t){var e=v[t];if(e<0){var n=l[t],i=b(n)?n:{name:n},o=new yM,r=i.name;return null!=r&&null!=g.get(r)&&(o.name=o.displayName=r),null!=i.type&&(o.type=i.type),null!=i.displayName&&(o.displayName=i.displayName),v[t]=h.length,o.storeDimIndex=t,h.push(o),o}return h[e]}function i(t,e,n){null!=ix.get(e)?t.otherDims[e]=n:(t.coordDim=e,t.coordDimIndex=n,u.set(e,!0))}function o(t){null==t.name&&(t.name=t.coordDim)}xr(t)||(t=br(t));var r=(e=e||{}).coordDimensions||[],l=e.dimensionsDefine||t.dimensionsDefine||[],u=B(),h=[],d=function(t,e,n,i){var o=Math.max(t.dimensionsDetectedCount||1,e.length,n.length,i||0);return c(e,function(t){var e;b(t)&&(e=t.dimsDef)&&(o=Math.max(o,e.length))}),o}(t,r,l,e.dimensionsCount),p=e.canOmitUnusedDimensions&&Zl(d),f=l===t.dimensionsDefine,g=f?Vl(t):Fl(l),m=e.encodeDefine;!m&&e.encodeDefaulter&&(m=e.encodeDefaulter(t,d));for(var y=B(m),v=new lw(d),x=0;x0&&(i.name=o+(r-1)),r++,e.set(o,r)}}(h),new kM({source:t,dimensions:h,fullDimensionCount:d,dimensionOmitted:p})}function Eu(t,e,n){if(n||e.hasKey(t)){for(var i=0;e.hasKey(t+i);)i++;t+=i}return e.set(t,!0),t}function Ru(t){return"category"===t.get("type")}function Bu(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function Nu(t,e){return{seriesType:t,plan:ma(),reset:function(t){var n=t.getData(),i=t.coordinateSystem,o=e||t.pipelineContext.large;if(i){var r=d(i.dimensions,function(t){return n.mapDimension(t)}).slice(0,2),a=r.length,s=n.getCalculationInfo("stackResultDimension");Bu(n,r[0])&&(r[0]=s),Bu(n,r[1])&&(r[1]=s);var l=n.getStore(),u=n.getDimensionIndex(r[0]),h=n.getDimensionIndex(r[1]);return a&&{progress:function(t,e){for(var n,r=o&&(y(n=(t.end-t.start)*a)?zC?new Float32Array(n):n:new EC(n)),s=[],c=[],d=t.start,p=0;d=e[0]&&t<=e[1]}function Xu(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function qu(t,e){return t*(e[1]-e[0])+e[0]}function Ku(t,e,n){var i=Math.log(t);return[Math.log(n?e[0]:Math.max(0,e[0]))/i,Math.log(n?e[1]:Math.max(0,e[1]))/i]}function $u(t){return t.get("stack")||ok+t.seriesIndex}function Ju(t){return t.dim+t.index}function Qu(t,e,n,i){return To(new Date(e),t,i).getTime()===To(new Date(n),t,i).getTime()}function th(t,e){return(t/=g_)>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function eh(t){return(t/=2592e6)>6?6:t>3?3:t>2?2:1}function nh(t){return(t/=f_)>12?12:t>6?6:t>3.5?4:t>2?2:1}function ih(t,e){return(t/=e?p_:d_)>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function oh(t){return pn(t,!0)}function rh(t,e,n){var i=Math.max(0,l(w_,e)-1);return To(new Date(t),w_[i],n).getTime()}function ah(t,e){return lk(t,an(e))}function sh(t,e,n){var i=t.rawExtentInfo;return i||(i=new gk(t,e,n),t.rawExtentInfo=i,i)}function lh(t,e){return null==e?null:k(e)?NaN:t.parse(e)}function uh(t,e){var n=t.type,i=sh(t,e,t.getExtent()).calculate();t.setBlank(i.isBlank);var o,r,a,s=i.min,l=i.max,u=e.ecModel;if(u&&"time"===n){var h=function(t,e){var n=[];return e.eachSeriesByType("bar",function(t){(function(t){return t.coordinateSystem&&"cartesian2d"===t.coordinateSystem.type})(t)&&n.push(t)}),n}(0,u),d=!1;if(c(h,function(t){d=d||t.getBaseAxis()===e.axis}),d){var p=(r=function(t){var e={};c(t,function(t){var n=t.coordinateSystem.getBaseAxis();if("time"===n.type||"value"===n.type)for(var i=t.getData(),o=n.dim+"_"+n.index,r=i.getDimensionIndex(i.mapDimension(n.dim)),a=i.getStore(),s=0,l=a.count();s0&&(r=null===r?s:Math.min(r,s))}n[i]=r}}return n}(o=h),a=[],c(o,function(t){var e,n=t.coordinateSystem.getBaseAxis(),i=n.getExtent();if("category"===n.type)e=n.getBandWidth();else if("value"===n.type||"time"===n.type){var o=r[n.dim+"_"+n.index],s=Math.abs(i[1]-i[0]),l=n.scale.getExtent(),u=Math.abs(l[1]-l[0]);e=o?s/u*o:s}else{var h=t.getData();e=Math.abs(i[1]-i[0])/h.count()}var c=jm(t.get("barWidth"),e),d=jm(t.get("barMaxWidth"),e),p=jm(t.get("barMinWidth")||(function(t){return t.pipelineContext&&t.pipelineContext.large}(t)?.5:1),e),f=t.get("barGap"),g=t.get("barCategoryGap"),m=t.get("defaultBarGap");a.push({bandWidth:e,barWidth:c,barMaxWidth:d,barMinWidth:p,barGap:f,barCategoryGap:g,defaultBarGap:m,axisKey:Ju(n),stackId:$u(t)})}),function(t){var e={};c(t,function(t,n){var i=t.axisKey,o=t.bandWidth,r=e[i]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:t.defaultBarGap||0,stacks:{}},a=r.stacks;e[i]=r;var s=t.stackId;a[s]||r.autoWidthCount++,a[s]=a[s]||{width:0,maxWidth:0};var l=t.barWidth;l&&!a[s].width&&(a[s].width=l,l=Math.min(r.remainedWidth,l),r.remainedWidth-=l);var u=t.barMaxWidth;u&&(a[s].maxWidth=u);var h=t.barMinWidth;h&&(a[s].minWidth=h);var c=t.barGap;null!=c&&(r.gap=c);var d=t.barCategoryGap;null!=d&&(r.categoryGap=d)});var n={};return c(e,function(t,e){n[e]={};var i=t.stacks,o=t.bandWidth,r=t.categoryGap;if(null==r){var a=g(i).length;r=Math.max(35-4*a,15)+"%"}var s=jm(r,o),l=jm(t.gap,1),u=t.remainedWidth,h=t.autoWidthCount,d=(u-s)/(h+(h-1)*l);d=Math.max(d,0),c(i,function(t){var e=t.maxWidth,n=t.minWidth;if(t.width)i=t.width,e&&(i=Math.min(i,e)),n&&(i=Math.max(i,n)),t.width=i,u-=i+l*i,h--;else{var i=d;e&&ei&&(i=n),i!==d&&(t.width=i,u-=i+l*i,h--)}}),d=(u-s)/(h+(h-1)*l),d=Math.max(d,0);var p,f=0;c(i,function(t,e){t.width||(t.width=d),p=t,f+=t.width*(1+l)}),p&&(f-=p.width*l);var m=-f/2;c(i,function(t,i){n[e][i]=n[e][i]||{bandWidth:o,offset:m,width:t.width},m+=t.width*(1+l)})}),n}(a)),f=function(t,e,n,i){var o=n.axis.getExtent(),r=Math.abs(o[1]-o[0]),a=function(t,e){if(t&&e)return t[Ju(e)]}(i,n.axis);if(void 0===a)return{min:t,max:e};var s=1/0;c(a,function(t){s=Math.min(t.offset,s)});var l=-1/0;c(a,function(t){l=Math.max(t.offset+t.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=e-t,d=h/(1-(s+l)/r)-h;return{min:t-=d*(s/u),max:e+=d*(l/u)}}(s,l,e,p);s=f.min,l=f.max}}return{extent:[s,l],fixMin:i.minFixed,fixMax:i.maxFixed}}function hh(t,e){var n=e,i=uh(t,n),o=i.extent,r=n.get("splitNumber");t instanceof fk&&(t.base=n.get("logBase"));var a=t.type,s=n.get("interval"),l="interval"===a||"time"===a;t.setBreaksFromOption(vh(n)),t.setExtent(o[0],o[1]),t.calcNiceExtent({splitNumber:r,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?n.get("minInterval"):null,maxInterval:l?n.get("maxInterval"):null}),null!=s&&t.setInterval&&t.setInterval(s)}function ch(t){var e,n=t.getLabelModel().get("formatter");if("time"===t.type){var i=_(e=n)||v(e)?e:function(t){t=t||{};var e={},n=!0;return c(w_,function(e){n&&(n=null==t[e])}),c(w_,function(i,o){var r=t[i];e[i]={};for(var a=null,s=o;s>=0;s--){var l=w_[s],u=b(r)&&!y(r)?r[l]:r,h=void 0;y(u)?a=(h=u.slice())[0]||"":_(u)?h=[a=u]:(null==a?a=v_[i]:y_[l].test(a)||(a=e[l][l][0]+" "+a),h=[a],n&&(h[1]="{primary|"+a+"}")),e[i][l]=h}}),e}(e);return function(e,n){return t.scale.getFormattedLabel(e,n,i)}}if(_(n))return function(e){var i=t.scale.getLabel(e);return n.replace("{value}",null!=i?i:"")};if(v(n)){if("category"===t.type)return function(e,i){return n(dh(t,e),e.value-t.scale.getExtent()[0],null)};var o=vo();return function(e,i){var r=null;return o&&(r=o.makeAxisLabelFormatterParamBreak(r,e.break)),n(dh(t,e),i,r)}}return function(e){return t.scale.getLabel(e)}}function dh(t,e){return"category"===t.type?t.scale.getLabel(e):e.value}function ph(t){var e=t.get("interval");return null==e?"auto":e}function fh(t){return"category"===t.type&&0===ph(t.getLabelModel())}function gh(t,e){var n={};return c(t.mapDimensionsAll(e),function(e){n[function(t,e){return Bu(t,e)?t.getCalculationInfo("stackResultDimension"):e}(t,e)]=!0}),g(n)}function mh(t){return"middle"===t||"center"===t}function yh(t){return t.getShallow("show")}function vh(t){var e,n=t.get("breaks",!0);if(null!=n)return vo()?"x"!==(e=t.axis).dim&&"y"!==e.dim&&"z"!==e.dim&&"single"!==e.dim||"category"===e.type?void 0:n:void 0}function _h(t){return("interval"===t.type||"time"===t.type)&&!t.hasBreaks()}function xh(t){return{out:{noPxChangeTryDetermine:[]},kind:t}}function wh(t,e){var n=d(e,function(e){return t.scale.parse(e)});return"time"===t.type&&n.length>0&&(n.sort(),n.unshift(n[0]),n.push(n[n.length-1])),n}function bh(t,e,n){var i,o,r=kk(t),a=ph(e),s=n.kind===Tk;if(!s){var l=Th(r,a);if(l)return l}v(a)?i=Lh(t,a):(o="auto"===a?function(t,e){if(e.kind===Tk){var n=t.calculateCategoryInterval(e);return e.out.noPxChangeTryDetermine.push(function(){return Sk(t).autoInterval=n,!0}),n}var i=Sk(t).autoInterval;return null!=i?i:Sk(t).autoInterval=t.calculateCategoryInterval(e)}(t,n):a,i=Ih(t,o));var u={labels:i,labelCategoryInterval:o};return s?n.out.noPxChangeTryDetermine.push(function(){return Mh(r,a,u),!0}):Mh(r,a,u),u}function Sh(t){return function(e){return Sk(e)[t]||(Sk(e)[t]={list:[]})}}function Th(t,e){for(var n=0;ne&&i.axisExtent0===o[0]&&i.axisExtent1===o[1])return r;i.lastTickCount=n,i.lastAutoInterval=e,i.axisExtent0=o[0],i.axisExtent1=o[1]}function Ih(t,e,n){function i(t){var e={value:t};l.push(n?t:{formattedLabel:o(e),rawLabel:r.getLabel(e),tickValue:t,time:void 0,break:void 0})}var o=ch(t),r=t.scale,a=r.getExtent(),s=t.getLabelModel(),l=[],u=Math.max((e||0)+1,1),h=a[0],c=r.count();0!==h&&u>1&&c/u>2&&(h=Math.round(Math.ceil(h/u)*u));var d=fh(t),p=s.get("showMinLabel")||d,f=s.get("showMaxLabel")||d;p&&h!==a[0]&&i(a[0]);for(var g=h;g<=a[1];g+=u)i(g);return f&&g-u!==a[1]&&i(a[1]),l}function Lh(t,e,n){var i=t.scale,o=ch(t),r=[];return c(i.getTicks(),function(t){var a=i.getLabel(t),s=t.value;e(t.value,a)&&r.push(n?s:{formattedLabel:o(t),rawLabel:a,tickValue:s,time:void 0,break:void 0})}),r}function Ph(t,e){var n=(t[1]-t[0])/e/2;t[0]+=n,t[1]-=n}function Dh(t,e,n){n=n||3,e?t.dirty|=n:t.dirty&=~n}function Ah(t,e){return e=e||3,null==t.dirty||!!(t.dirty&e)}function Oh(t){if(t)return Ah(t)&&function(t,e,n){var i=e.getComputedTransform();t.transform=ls(t.transform,i);var o=t.localRect=ss(t.localRect,e.getBoundingRect()),r=e.style,a=r.margin,s=n&&n.marginForce,l=n&&n.minMarginForce,u=n&&n.marginDefault,h=r.__marginType;null==h&&u&&(a=u,h=Wv.textMargin);for(var c=0;c<4;c++)Ok[c]=h===Wv.minMargin&&l&&null!=l[c]?l[c]:s&&null!=s[c]?s[c]:a?a[c]:0;h===Wv.textMargin&&es(o,Ok,!1,!1);var d=t.rect=ss(t.rect,o);i&&d.applyTransform(i),h===Wv.minMargin&&es(d,Ok,!1,!1),t.axisAligned=as(i),(t.label=t.label||{}).ignore=e.ignore,Dh(t,!1),Dh(t,!0,2)}(t,t.label,t),t}function zh(t,e){for(var n=0;n=0,r=0,a=t.length;r.1?"x":"y",h=a.transGroup[u];if(s.sort(function(t,e){return Math.abs(t.label[u]-h)-Math.abs(e.label[u]-h)}),l&&o){var d=r.getExtent(),p=Math.min(d[0],d[1]),f=Math.max(d[0],d[1])-p;o.union(new lg(p,0,f,1))}a.stOccupiedRect=o,a.labelInfoList=s}(t,n,i,l)}function Vh(t){t&&(t.ignore=!0)}function Zh(t,e,n,i,o){for(var r=[],a=[],s=[],l=0;l0&&i>0||n<0&&i<0)}(t)}function $h(t,e){c(t.x,function(t){return Jh(t,e.x,e.width)}),c(t.y,function(t){return Jh(t,e.y,e.height)})}function Jh(t,e,n){var i=[0,n],o=t.inverse?1:0;t.setExtent(i[o],i[1-o]),function(t,e){var n=t.getExtent(),i=n[0]+n[1];t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return i-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return i-t+e}}(t,e)}function Qh(t,e,n,i,o,r,a){function s(t){c(o[Fb[t]],function(e){if(yh(e.model)){var n=r.ensureRecord(e.model),i=n.labelInfoList;if(i)for(var o=0;o0&&!k(e)&&e>1e-4&&(t/=e),t}tc(i,o,Tk,e,!1,a);var h=[0,0,0,0];s(0),s(1),l(i,0,NaN),l(i,1,NaN);var d=null==function(t,e){if(t&&e)for(var n=0,i=t.length;n0});return es(i,h,!0,!0,n),$h(o,i),d}function tc(t,e,n,i,o,r){function a(e){l[Fb[1-e]]=t[Vb[e]]<=.5*r.refContainer[Vb[e]]?0:1-e==1?2:1}var s=n===Mk;c(e,function(e){return c(e,function(e){yh(e.model)&&(function(t,e,n){var i=Uh(e,n);t.updateCfg(i)}(e.axisBuilder,t,e.model),e.axisBuilder.build(s?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:o}))})});var l={x:0,y:0};a(0),a(1),c(e,function(t,e){return c(t,function(t){yh(t.model)&&(("all"===i||s)&&t.axisBuilder.build({axisName:!0},{nameMarginLevel:l[e]}),s&&t.axisBuilder.build({axisLine:!0}))})})}function ec(t,e){return"all"===t||y(t)&&l(t,e)>=0||t===e}function nc(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[oc(t)]}function ic(t){return!!t.get(["handle","show"])}function oc(t){return t.type+"||"+t.id}function rc(t){t.registerComponentView(uI),t.registerComponentModel(FC),t.registerCoordinateSystem("cartesian2d",Qk),Zu(t,"x",ZC,hI),Zu(t,"y",ZC,hI),t.registerComponentView(sI),t.registerComponentView(lI),t.registerPreprocessor(function(t){t.xAxis&&t.yAxis&&!t.grid&&(t.grid={})})}function ac(t,e,n,i){sc(cI(n).lastProp,i)||(cI(n).lastProp=i,e?Ia(n,i,t):(n.stopAnimation(),n.attr(i)))}function sc(t,e){if(b(t)&&b(e)){var n=!0;return c(e,function(e,i){n=n&&sc(t[i],e)}),!!n}return t===e}function lc(t,e){t[e.get(["label","show"])?"show":"hide"]()}function uc(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function hc(t,e,n){var i=e.get("z"),o=e.get("zlevel");t&&t.traverse(function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=o&&(t.zlevel=o),t.silent=n)})}function cc(t,e,n,i,o){t=e.scale.parse(t);var r=e.scale.getLabel({value:t},{precision:o.precision}),a=o.formatter;if(a){var s={value:dh(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};c(i,function(t){var e=n.getSeriesByIndex(t.seriesIndex),i=e&&e.getDataParams(t.dataIndexInside);i&&s.seriesData.push(i)}),_(a)?r=a.replace("{value}",r):v(a)&&(r=a(s))}return r}function dc(t,e,n){var i=[1,0,0,1,0,0];return wt(i,i,n.rotation),xt(i,i,n.position),Ga([t.dataToCoord(e),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}function pc(t,e){var n={};return n[e.dim+"AxisIndex"]=e.index,t.getCartesian(n)}function fc(t){return"x"===t.dim?0:1}function gc(t,e,n){if(!Qp.node){var i=e.getZr();_I(i).records||(_I(i).records={}),function(t,e){function n(n,i){t.on(n,function(n){var o=function(t){var e={showTip:[],hideTip:[]},n=function(i){var o=e[i.type];o?o.push(i):(i.dispatchAction=n,t.dispatchAction(i))};return{dispatchAction:n,pendings:e}}(e);xI(_I(t).records,function(t){t&&i(t,n,o.dispatchAction)}),function(t,e){var n,i=t.showTip.length,o=t.hideTip.length;i?n=t.showTip[i-1]:o&&(n=t.hideTip[o-1]),n&&(n.dispatchAction=null,e.dispatchAction(n))}(o.pendings,e)})}_I(t).initialized||(_I(t).initialized=!0,n("click",m(yc,"click")),n("mousemove",m(yc,"mousemove")),n("globalout",mc))}(i,e),(_I(i).records[t]||(_I(i).records[t]={})).handler=n}}function mc(t,e,n){t.handler("leave",null,n)}function yc(t,e,n,i){e.handler(t,n,i)}function vc(t,e){if(!Qp.node){var n=e.getZr();(_I(n).records||{})[t]&&(_I(n).records[t]=null)}}function _c(t,e){var n,i=[],o=t.seriesIndex;if(null==o||!(n=e.getSeriesByIndex(o)))return{point:[]};var r=n.getData(),a=In(r,t);if(null==a||a<0||y(a))return{point:[]};var s=r.getItemGraphicEl(a),l=n.coordinateSystem;if(n.getTooltipPosition)i=n.getTooltipPosition(a)||[];else if(l&&l.dataToPoint)if(t.isStacked){var u=l.getBaseAxis(),h=l.getOtherAxis(u).dim,c="x"===h||"radius"===h?1:0,p=r.mapDimension(u.dim),f=[];f[c]=r.get(p,a),f[1-c]=r.get(r.getCalculationInfo("stackResultDimension"),a),i=l.dataToPoint(f)||[]}else i=l.dataToPoint(r.getValues(d(l.dimensions,function(t){return r.mapDimension(t)}),a))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),i=[g.x+g.width/2,g.y+g.height/2]}return{point:i,el:s}}function xc(t,e,n){var i=t.currTrigger,o=[t.x,t.y],r=t,a=t.dispatchAction||_f(n.dispatchAction,n),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){Mc(o)&&(o=_c({seriesIndex:r.seriesIndex,dataIndex:r.dataIndex},e).point);var l=Mc(o),u=r.axesInfo,h=s.axesInfo,d="leave"===i||Mc(o),p={},f={},g={list:[],map:{}},y={showPointer:m(bc,f),showTooltip:m(Sc,g)};c(s.coordSysMap,function(t,e){var n=l||t.containPoint(o);c(s.coordSysAxesInfo[e],function(t,e){var i=t.axis,r=function(t,e){for(var n=0;n<(t||[]).length;n++){var i=t[n];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}(u,t);if(!d&&n&&(!u||r)){var a=r&&r.value;null!=a||l||(a=i.pointToData(o)),null!=a&&wc(t,a,y,!1,p)}})});var v={};return c(h,function(t,e){var n=t.linkGroup;n&&!f[e]&&c(n.axesInfo,function(e,i){var o=f[i];if(e!==t&&o){var r=o.value;n.mapper&&(r=t.axis.scale.parse(n.mapper(r,Tc(e),Tc(t)))),v[t.key]=r}})}),c(v,function(t,e){wc(h[e],t,y,!0,p)}),function(t,e,n){var i=n.axesInfo=[];c(e,function(e,n){var o=e.axisPointerModel.option,r=t[n];r?(!e.useHandle&&(o.status="show"),o.value=r.value,o.seriesDataIndices=(r.payloadBatch||[]).slice()):!e.useHandle&&(o.status="hide"),"show"===o.status&&i.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:o.value})})}(f,h,p),function(t,e,n,i){if(!Mc(e)&&t.list.length){var o=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:o.dataIndexInside,dataIndex:o.dataIndex,seriesIndex:o.seriesIndex,dataByCoordSys:t.list})}else i({type:"hideTip"})}(g,o,t,a),function(t,e,n){var i=n.getZr(),o="axisPointerLastHighlights",r=SI(i)[o]||{},a=SI(i)[o]={};c(t,function(t,e){var n=t.axisPointerModel.option;"show"===n.status&&t.triggerEmphasis&&c(n.seriesDataIndices,function(t){a[t.seriesIndex+" | "+t.dataIndex]=t})});var s=[],l=[];c(r,function(t,e){!a[e]&&l.push(t)}),c(a,function(t,e){!r[e]&&s.push(t)}),l.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}(h,0,n),p}}function wc(t,e,n,i,o){var r=t.axis;if(!r.scale.isBlank()&&r.containData(e))if(t.involveSeries){var s=function(t,e){var n=e.axis,i=n.dim,o=t,r=[],a=Number.MAX_VALUE,s=-1;return c(e.seriesModels,function(e,l){var u,h,d=e.getData().mapDimensionsAll(i);if(e.getAxisTooltipData){var p=e.getAxisTooltipData(d,t,n);h=p.dataIndices,u=p.nestestValue}else{if(!(h=e.indicesOfNearest(i,d[0],t,"category"===n.type?.5:null)).length)return;u=e.getData().get(d[0],h[0])}if(null!=u&&isFinite(u)){var f=t-u,g=Math.abs(f);g<=a&&((g=0&&s<0)&&(a=g,s=f,o=u,r.length=0),c(h,function(t){r.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})}))}}),{payloadBatch:r,snapToValue:o}}(e,t),l=s.payloadBatch,u=s.snapToValue;l[0]&&null==o.seriesIndex&&a(o,l[0]),!i&&t.snap&&r.containData(u)&&null!=u&&(e=u),n.showPointer(t,e,l),n.showTooltip(t,s,u)}else n.showPointer(t,e)}function bc(t,e,n,i){t[e.key]={value:n,payloadBatch:i}}function Sc(t,e,n,i){var o=n.payloadBatch,r=e.axis,a=r.model,s=e.axisPointerModel;if(e.triggerTooltip&&o.length){var l=e.coordSys.model,u=oc(l),h=t.map[u];h||(h=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(h)),h.dataByAxis.push({axisDim:r.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:o.slice()})}}function Tc(t){var e=t.axis.model,n={},i=n.axisDim=t.axis.dim;return n.axisIndex=n[i+"AxisIndex"]=e.componentIndex,n.axisName=n[i+"AxisName"]=e.name,n.axisId=n[i+"AxisId"]=e.id,n}function Mc(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function Cc(t){nI.registerAxisPointerClass("CartesianAxisPointer",yI),t.registerComponentModel(vI),t.registerComponentView(bI),t.registerPreprocessor(function(t){if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!y(e)&&(t.axisPointer.link=[e])}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=function(t,e){var n={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return function(t,e,n){var i=e.getComponent("tooltip"),r=e.getComponent("axisPointer"),a=r.get("link",!0)||[],l=[];c(n.getCoordinateSystems(),function(n){function u(i,u,h){var f=h.model.getModel("axisPointer",r),g=f.get("show");if(g&&("auto"!==g||i||ic(f))){null==u&&(u=f.get("triggerTooltip")),f=i?function(t,e,n,i,r,a){var l=e.getModel("axisPointer"),u={};c(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],function(t){u[t]=o(l.get(t))}),u.snap="category"!==t.type&&!!a,"cross"===l.get("type")&&(u.type="line");var h=u.label||(u.label={});if(null==h.show&&(h.show=!1),"cross"===r){var d=l.get(["label","show"]);if(h.show=null==d||d,!a){var p=u.lineStyle=l.get("crossStyle");p&&s(h,p.textStyle)}}return t.model.getModel("axisPointer",new i_(u,n,i))}(h,p,r,e,i,u):f;var m=f.get("snap"),y=f.get("triggerEmphasis"),v=oc(h.model),_=u||m||"category"===h.type,x=t.axesInfo[v]={key:v,axis:h,coordSys:n,axisPointerModel:f,triggerTooltip:u,triggerEmphasis:y,involveSeries:_,snap:m,useHandle:ic(f),seriesModels:[],linkGroup:null};d[v]=x,t.seriesInvolved=t.seriesInvolved||_;var w=function(t,e){for(var n=e.model,i=e.dim,o=0;o=0;r--){var a=t[r];a&&(a instanceof i_&&(a=a.get("tooltip",!0)),_(a)&&(a={formatter:a}),a&&(i=new i_(a,i,o)))}return i}function Rc(t,e){return t.dispatchAction||_f(e.dispatchAction,e)}function Bc(t){return"center"===t||"middle"===t}function Nc(t){return t+"Axis"}function Fc(t){var e={};return c(["start","end","startValue","endValue","throttle"],function(n){t.hasOwnProperty(n)&&(e[n]=t[n])}),e}function Vc(t,e,n,i,o,r){t=t||0;var a=n[1]-n[0];if(null!=o&&(o=Hc(o,[0,a])),null!=r&&(r=Math.max(r,null!=o?o:0)),"all"===i){var s=Math.abs(e[1]-e[0]);s=Hc(s,[0,a]),o=r=Hc(s,[o,r]),i=0}e[0]=Hc(e[0],n),e[1]=Hc(e[1],n);var l=Zc(e,i);e[i]+=t;var u,h=o||0,c=n.slice();return l.sign<0?c[0]+=h:c[1]-=h,e[i]=Hc(e[i],c),u=Zc(e,i),null!=o&&(u.sign!==l.sign||u.spanr&&(e[1-i]=e[i]+u.sign*r),e}function Zc(t,e){var n=t[e]-t[1-e];return{span:Math.abs(n),sign:n>0?-1:n<0?1:e?-1:1}}function Hc(t,e){return Math.min(null!=e[1]?e[1]:1/0,Math.max(null!=e[0]?e[0]:-1/0,t))}function Wc(t){t.registerComponentModel(VI),t.registerComponentView(ZI),function(t){YI||(YI=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,UI),function(t){t.registerAction("dataZoom",function(t,e){c(function(t,e){function n(t){!s.get(t.uid)&&function(t){var e=!1;return t.eachTargetAxis(function(t,n){var i=r.get(t);i&&i[n]&&(e=!0)}),e}(t)&&(i(t),o=!0)}function i(t){s.set(t.uid,!0),a.push(t),t.eachTargetAxis(function(t,e){(r.get(t)||r.set(t,[]))[e]=!0})}var o,r=B(),a=[],s=B();t.eachComponent({mainType:"dataZoom",query:e},function(t){s.get(t.uid)||i(t)});do{o=!1,t.eachComponent("dataZoom",n)}while(o);return a}(e,t),function(e){e.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})})}(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}(t)}function jc(t,e){qI[t]=e}function Gc(t){return qI[t]}function Uc(t,e){var n=S_(e.get("padding")),i=e.getItemStyle(["color","opacity"]);return i.fill=e.get("backgroundColor"),new mv({shape:{x:t.x-n[3],y:t.y-n[0],width:t.width+n[1]+n[3],height:t.height+n[0]+n[2],r:e.get("borderRadius")},style:i,silent:!0,z2:-1})}function Yc(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Xc(t,e){return d(t,function(t,n){var i=e&&e[n];if(b(i)&&!y(i)){b(t)&&!y(t)||(t={value:t});var o=null!=i.name&&null==t.name;return t=s(t,i),o&&delete t.name,t}return t})}function qc(t){var e=cL(t);return e.snapshots||(e.snapshots=[{}]),e.snapshots}function Kc(t,e){var n=ML[e.brushType].createCover(t,e);return n.__brushOption=e,Qc(n,e),t.group.add(n),n}function $c(t,e){var n=ed(e);return n.endCreating&&(n.endCreating(t,e),Qc(e,e.__brushOption)),e}function Jc(t,e){var n=e.__brushOption;ed(e).updateCoverShape(t,e,n.range,n)}function Qc(t,e){var n=e.z;null==n&&(n=1e4),t.traverse(function(t){t.z=n,t.z2=n})}function td(t,e){ed(e).updateCommon(t,e),Jc(t,e)}function ed(t){return ML[t.__brushOption.brushType]}function nd(t,e,n){var i,o=t._panels;if(!o)return fL;var r=t._transform;return c(o,function(t){t.isTargetByCursor(e,n,r)&&(i=t)}),i}function id(t,e){var n=t._panels;if(!n)return fL;var i=e.__brushOption.panelId;return null!=i?n[i]:fL}function od(t){var e=t._covers,n=e.length;return c(e,function(e){t.group.remove(e)},t),e.length=0,!!n}function rd(t,e){var n=d(t._covers,function(t){var e=t.__brushOption,n=o(e.range);return{brushType:e.brushType,panelId:e.panelId,range:n}});t.trigger("brush",{areas:n,isEnd:!!e.isEnd,removeOnClick:!!e.removeOnClick})}function ad(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function sd(t,e,n,i){var o=new Em;return o.add(new mv({name:"main",style:cd(n),silent:!0,draggable:!0,cursor:"move",drift:m(fd,t,e,o,["n","s","w","e"]),ondragend:m(rd,e,{isEnd:!0})})),c(i,function(n){o.add(new mv({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:m(fd,t,e,o,n),ondragend:m(rd,e,{isEnd:!0})}))}),o}function ld(t,e,n,i){var o=i.brushStyle.lineWidth||0,r=mL(o,6),a=n[0][0],s=n[1][0],l=a-o/2,u=s-o/2,h=n[0][1],c=n[1][1],d=h-r+o/2,p=c-r+o/2,f=h-a,g=c-s,m=f+o,y=g+o;hd(t,e,"main",a,s,f,g),i.transformable&&(hd(t,e,"w",l,u,r,y),hd(t,e,"e",d,u,r,y),hd(t,e,"n",l,u,m,r),hd(t,e,"s",l,p,m,r),hd(t,e,"nw",l,u,r,r),hd(t,e,"ne",d,u,r,r),hd(t,e,"sw",l,p,r,r),hd(t,e,"se",d,p,r,r))}function ud(t,e){var n=e.__brushOption,i=n.transformable,o=e.childAt(0);o.useStyle(cd(n)),o.attr({silent:!i,cursor:i?"move":"default"}),c([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(n){var o=e.childOfName(n.join("")),r=1===n.length?pd(t,n[0]):function(t,e){var n=[pd(t,e[0]),pd(t,e[1])];return("e"===n[0]||"w"===n[0])&&n.reverse(),n.join("")}(t,n);o&&o.attr({silent:!i,invisible:!i,cursor:i?xL[r]+"-resize":null})})}function hd(t,e,n,i,o,r,a){var s=e.childOfName(n);s&&s.setShape(function(t){var e=gL(t[0][0],t[1][0]),n=gL(t[0][1],t[1][1]);return{x:e,y:n,width:mL(t[0][0],t[1][0])-e,height:mL(t[0][1],t[1][1])-n}}(yd(t,e,[[i,o],[i+r,o+a]])))}function cd(t){return s({strokeNoScale:!0},t.brushStyle)}function dd(t,e,n,i){var o=[gL(t,n),gL(e,i)],r=[mL(t,n),mL(e,i)];return[[o[0],r[0]],[o[1],r[1]]]}function pd(t,e){var n=Ua({w:"left",e:"right",n:"top",s:"bottom"}[e],function(t){return ja(t.group)}(t));return{left:"w",right:"e",top:"n",bottom:"s"}[n]}function fd(t,e,n,i,o,r){var a=n.__brushOption,s=t.toRectRange(a.range),l=md(e,o,r);c(i,function(t){var e=_L[t];s[e[0]][e[1]]+=l[e[0]]}),a.range=t.fromRectRange(dd(s[0][0],s[1][0],s[0][1],s[1][1])),td(e,n),rd(e,{isEnd:!1})}function gd(t,e,n,i){var o=e.__brushOption.range,r=md(t,n,i);c(o,function(t){t[0]+=r[0],t[1]+=r[1]}),td(t,e),rd(t,{isEnd:!1})}function md(t,e,n){var i=t.group,o=i.transformCoordToLocal(e,n),r=i.transformCoordToLocal(0,0);return[o[0]-r[0],o[1]-r[1]]}function yd(t,e,n){var i=id(t,e);return i&&i!==fL?i.clipPath(n,t._transform):o(n)}function vd(t){var e=t.event;e.preventDefault&&e.preventDefault()}function _d(t,e,n){return t.childOfName("main").contain(e,n)}function xd(t,e,n,i){var r,a=t._creatingCover,s=t._creatingPanel,l=t._brushOption;if(t._track.push(n.slice()),function(t){var e=t._track;if(!e.length)return!1;var n=e[e.length-1],i=e[0],o=n[0]-i[0],r=n[1]-i[1];return yL(o*o+r*r,.5)>6}(t)||a){if(s&&!a){"single"===l.brushMode&&od(t);var u=o(l);u.brushType=wd(u.brushType,s),u.panelId=s===fL?null:s.panelId,a=t._creatingCover=Kc(t,u),t._covers.push(a)}if(a){var h=ML[wd(t._brushType,s)];a.__brushOption.range=h.getCreatingRange(yd(t,a,t._track)),i&&($c(t,a),h.updateCommon(t,a)),Jc(t,a),r={isEnd:i}}}else i&&"single"===l.brushMode&&l.removeOnClick&&nd(t,e,n)&&od(t)&&(r={isEnd:i,removeOnClick:!0});return r}function wd(t,e){return"auto"===t?e.defaultBrushType:t}function bd(t,e){if(t._dragging){vd(e);var n=t.group.transformCoordToLocal(e.offsetX,e.offsetY),i=xd(t,e,n,!0);t._dragging=!1,t._track=[],t._creatingCover=null,i&&rd(t,i)}}function Sd(t){return{createCover:function(e,n){return sd({toRectRange:function(e){var n=[e,[0,100]];return t&&n.reverse(),n},fromRectRange:function(e){return e[t]}},e,n,[[["w"],["e"]],[["n"],["s"]]][t])},getCreatingRange:function(e){var n=ad(e);return[gL(n[0][t],n[1][t]),mL(n[0][t],n[1][t])]},updateCoverShape:function(e,n,i,o){var r,a=id(e,n);if(a!==fL&&a.getLinearBrushOtherExtent)r=a.getLinearBrushOtherExtent(t);else{var s=e._zr;r=[0,[s.getWidth(),s.getHeight()][1-t]]}var l=[i,r];t&&l.reverse(),ld(e,n,l,o)},updateCommon:ud,contain:_d}}function Td(t){return t=kd(t),function(e){return qa(e,t)}}function Md(t,e){return t=kd(t),function(n){var i=null!=e?e:n,o=i?t.x:t.y;return[o,o+((i?t.width:t.height)||0)]}}function Cd(t,e,n){var i=kd(t);return function(t,o){return i.contain(o[0],o[1])&&!fu(t,e,n)}}function kd(t){return lg.create(t)}function Id(t){return t[0]>t[1]&&t.reverse(),t}function Ld(t,e){return Pn(t,e,{includeMainTypes:kL})}function Pd(t,e,n,i){var o=n.getAxis(["x","y"][t]),r=Id(d([0,1],function(t){return e?o.coordToData(o.toLocalCoord(i[t]),!0):o.toGlobalCoord(o.dataToCoord(i[t]))})),a=[];return a[t]=r,a[1-t]=[NaN,NaN],{values:r,xyMinMax:a}}function Dd(t,e,n,i){return[e[0]-i[t]*n[0],e[1]-i[t]*n[1]]}function Ad(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}function Od(t){var e={xAxisIndex:t.get("xAxisIndex",!0),yAxisIndex:t.get("yAxisIndex",!0),xAxisId:t.get("xAxisId",!0),yAxisId:t.get("yAxisId",!0)};return null==e.xAxisIndex&&null==e.xAxisId&&(e.xAxisIndex="all"),null==e.yAxisIndex&&null==e.yAxisId&&(e.yAxisIndex="all"),e}function zd(t,e,n,i){Bd(t,e,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=t?t:e}),Rd(t,e,n,i)}function Ed(t){for(var e,n=t.getZr().storage.getDisplayList(),i=0,o=n.length;i0&&(s.during=l?_f($d,{el:e,userDuring:l}):null,s.setToFinal=!0,s.scope=t),a(s,n[r]),s}function Xd(t,e,n,i){var o=(i=i||{}).dataIndex,r=i.isInit,s=i.clearStyle,u=n.isAnimationEnabled(),h=rP(t),d=e.style;h.userDuring=e.during;var p={},f={};if(function(t,e,n){for(var i=0;i=0)){var c=t.getAnimationStyleProps(),d=c?c.style:null;if(d){!o&&(o=i.style={});var p=g(n);for(h=0;h0&&t.animateFrom(_,x)}else!function(t,e,n,i,o){if(o){var r=Yd("update",t,e,i,n);r.duration>0&&t.animateFrom(o,r)}}(t,e,o||0,n,p);qd(t,e),d?t.dirty():t.markRedraw()}function qd(t,e){for(var n=rP(t).leaveToProps,i=0;i=0){!r&&(r=i[t]={});var p=g(s);for(d=0;d"}(o,e.attrs)+("style"!==o?lt(r):r||"")+(i?""+n+d(i,function(e){return t(e)}).join(n)+n:"")+""}(t)}function up(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function hp(t,e,n,i){return sp("svg","root",{width:t,height:e,xmlns:MP,"xmlns:xlink":CP,version:"1.1",baseProfile:"full",viewBox:!!i&&"0 0 "+t+" "+e},n)}function cp(){return IP++}function dp(t,e,n){var i=a({},t.shape);a(i,e),t.buildPath(n,i);var o=new vP;return o.reset(we(t)),n.rebuildPath(o,1),o.generateStr(),o.getStr()}function pp(t,e){var n=e.originX,i=e.originY;(n||i)&&(t[PP]=n+"px "+i+"px")}function fp(t,e){var n=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[n]=t,n}function gp(t){return _(t)?LP[t]?"cubic-bezier("+LP[t]+")":qt(t)?t:"":""}function mp(t,e,n,i){function o(o){function r(t,e,n){for(var i=t.getTracks(),o=t.getMaxTime(),r=0;r0}).length)return fp(d,n)+" "+o[0]+" both"}var r=t.animators,s=r.length,l=[];if(t instanceof xb){var u=function(t,e,n){var i,o,r={};if(c(t.shape.paths,function(t){var e=up(n.zrId);e.animation=!0,mp(t,{},e,!0);var a=e.cssAnims,s=e.cssNodes,l=g(a),u=l.length;if(u){var h=a[o=l[u-1]];for(var c in h){var d=h[c];r[c]=r[c]||{d:""},r[c].d+=d.d||""}for(var p in s){var f=s[p].animation;f.indexOf(o)>=0&&(i=f)}}}),i){e.d=!1;var a=fp(r,n);return i.replace(o,a)}}(t,e,n);if(u)l.push(u);else if(!s)return}else if(!s)return;for(var h={},d=0;d=0&&a||r;s&&(o=he(s))}var l=i.lineWidth;l&&(l/=!i.strokeNoScale&&t.transform?t.transform[0]:1);var u={cursor:"pointer"};o&&(u.fill=o),i.stroke&&(u.stroke=i.stroke),l&&(u["stroke-width"]=l),yp(u,e,n,!0)}}(t,r,e),sp(s,t.id+"",r)}function kp(t,e){return t instanceof ov?Cp(t,e):t instanceof cv?function(t,e){var n=t.style,i=n.image;if(i&&!_(i)&&(vp(i)?i=i.src:_p(i)&&(i=i.toDataURL())),i){var o=n.x||0,r=n.y||0,a={href:i,width:n.width,height:n.height};return o&&(a.x=o),r&&(a.y=r),Sp(a,t.transform),xp(a,n,t,e),wp(a,t),e.animation&&mp(t,a,e),sp("image",t.id+"",a)}}(t,e):t instanceof sv?function(t,e){var n=t.style,i=n.text;if(null!=i&&(i+=""),i&&!isNaN(n.x)&&!isNaN(n.y)){var o=n.font||of,r=n.x||0,a=function(t,e,n){return"top"===n?t+=e/2:"bottom"===n&&(t-=e/2),t}(n.y||0,Xe(o),n.textBaseline),s={"dominant-baseline":"central","text-anchor":Wg[n.textAlign]||n.textAlign};if(Si(n)){var l="",u=n.fontStyle,h=wi(n.fontSize);if(!parseFloat(h))return;var c=n.fontWeight;l+="font-size:"+h+";font-family:"+(n.fontFamily||nf)+";",u&&"normal"!==u&&(l+="font-style:"+u+";"),c&&"normal"!==c&&(l+="font-weight:"+c+";"),s.style=l}else s.style="font: "+o;return i.match(/\s/)&&(s["xml:space"]="preserve"),r&&(s.x=r),a&&(s.y=a),Sp(s,t.transform),xp(s,n,t,e),wp(s,t),e.animation&&mp(t,s,e),sp("text",t.id+"",s,void 0,i)}}(t,e):void 0}function Ip(t,e,n,i){var o,r=t[n],a={gradientUnits:r.global?"userSpaceOnUse":"objectBoundingBox"};if(ye(r))o="linearGradient",a.x1=r.x,a.y1=r.y,a.x2=r.x2,a.y2=r.y2;else{if(!ve(r))return;o="radialGradient",a.cx=L(r.x,.5),a.cy=L(r.y,.5),a.r=L(r.r,.5)}for(var s=r.colorStops,l=[],u=0,h=s.length;ul?Wp(t,null==n[c+1]?null:n[c+1].elm,n,s,c):jp(t,e,a,l))}(n,i,o):Fp(o)?(Fp(t.text)&&Bp(n,""),Wp(n,null,o,0,o.length-1)):Fp(i)?jp(n,i,0,i.length-1):Fp(t.text)&&Bp(n,""):t.text!==e.text&&(Fp(i)&&jp(n,i,0,i.length-1),Bp(n,e.text)))}function Yp(t,e,n){var i=af.createCanvas(),o=e.getWidth(),r=e.getHeight(),a=i.style;return a&&(a.position="absolute",a.left="0",a.top="0",a.width=o+"px",a.height=r+"px",i.setAttribute("data-zr-dom-id",t)),i.width=o*n,i.height=r*n,i}function Xp(){xl(!0)&&(function(t){var e=W_.extend(t);W_.registerClass(e)}({type:"leaflet",getLeaflet(){return this.__map},setCenterAndZoom(t,e){this.option.center=t,this.option.zoom=e},centerOrZoomChanged(t,e){const{option:n}=this;return o=n.center,!((i=t)&&o&&i[0]===o[0]&&i[1]===o[1]&&e===n.zoom);var i,o},defaultOption:{mapOptions:{},tiles:[{urlTemplate:"http://{s}.tile.osm.org/{z}/{x}/{y}.png",options:{attribution:'© OpenStreetMap contributors'}}],layerControl:{}}}),function(t){var e=ww.extend(t);ww.registerClass(e)}({type:"leaflet",render(t,e,n){function i(e){if(s)return;const i=l._mapPane;let o=i.style.transform,r=0,a=0;if(o){o=o.replace("translate3d(","");const t=o.split(",");r=-parseInt(t[0],10),a=-parseInt(t[1],10)}else r=-parseInt(i.style.left,10),a=-parseInt(i.style.top,10);const c=[r,a];u.style.left=`${c[0]}px`,u.style.top=`${c[1]}px`,h.setMapOffset(c),t.__mapOffset=c,n.dispatchAction({type:"leafletRoam",animation:{duration:0}})}function o(){s||n.dispatchAction({type:"leafletRoam"})}function r(){i()}function a(){ul(n.getDom()).resize()}let s=!0;const l=t.getLeaflet(),u=n.getZr().painter.getViewportRoot().parentNode,h=t.coordinateSystem,{roam:c}=t.get("mapOptions");c&&"scale"!==c?l.dragging.enable():l.dragging.disable(),c&&"move"!==c?(l.scrollWheelZoom.enable(),l.doubleClickZoom.enable(),l.touchZoom.enable()):(l.scrollWheelZoom.disable(),l.doubleClickZoom.disable(),l.touchZoom.disable()),this._oldMoveHandler&&l.off("move",this._oldMoveHandler),this._oldZoomHandler&&l.off("zoom",this._oldZoomHandler),this._oldZoomEndHandler&&l.off("zoomend",this._oldZoomEndHandler),this._oldResizeHandler&&l.off("resize",this._oldResizeHandler),l.on("move",i),l.on("zoom",r),l.on("zoomend",o),l.on("resize",a),this._oldMoveHandler=i,this._oldZoomHandler=r,this._oldZoomEndHandler=o,this._oldResizeHandler=a,s=!1}}),gl("leaflet",YP()),fl({type:"leafletRoam",event:"leafletRoam",update:"updateLayout"},(t,e)=>{e.eachComponent("leaflet",t=>{const e=t.getLeaflet(),n=e.getCenter();t.setCenterAndZoom([n.lng,n.lat],e.getZoom())})}))}var qp={};t.r(qp),t.d(qp,{Arc:()=>vb,BezierCurve:()=>gb,BoundingRect:()=>lg,Circle:()=>Ew,CompoundPath:()=>xb,Ellipse:()=>Nw,Group:()=>Em,Image:()=>cv,IncrementalDisplayable:()=>Rb,Line:()=>cb,LinearGradient:()=>Sb,OrientedBoundingRect:()=>zb,Path:()=>ov,Point:()=>Gf,Polygon:()=>ob,Polyline:()=>sb,RadialGradient:()=>Tb,Rect:()=>mv,Ring:()=>eb,Sector:()=>Jw,Text:()=>Tv,WH:()=>Vb,XY:()=>Fb,applyTransform:()=>Ga,calcZ2Range:()=>hs,clipPointsByRect:()=>qa,clipRectByRect:()=>Ka,createIcon:()=>$a,ensureCopyRect:()=>ss,ensureCopyTransform:()=>ls,expandOrShrinkRect:()=>es,extendPath:()=>Ea,extendShape:()=>za,getShapeClass:()=>Ba,getTransform:()=>ja,groupTransition:()=>Xa,initProps:()=>La,isBoundingRectAxisAligned:()=>as,isElementRemoved:()=>Pa,lineLineIntersect:()=>Qa,linePolygonIntersect:()=>Ja,makeImage:()=>Fa,makePath:()=>Na,mergePath:()=>Hb,registerShape:()=>Ra,removeElement:()=>Da,removeElementWithFadeOut:()=>Oa,resizePath:()=>Za,retrieveZInfo:()=>us,setTooltipConfig:()=>is,subPixelOptimize:()=>Wb,subPixelOptimizeLine:()=>Ha,subPixelOptimizeRect:()=>Wa,transformDirection:()=>Ua,traverseElements:()=>rs,traverseUpdateZ:()=>cs,updateProps:()=>Ia});var Kp=function(t,e){return Kp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Kp(t,e)},$p=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},Jp=new function(){this.browser=new $p,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(Jp.wxa=!0,Jp.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?Jp.worker=!0:!Jp.hasGlobalWindow||"Deno"in window||"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Node.js")>-1?(Jp.node=!0,Jp.svgSupported=!0):function(t,e){var n=e.browser,i=t.match(/Firefox\/([\d.]+)/),o=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),r=t.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(t);if(i&&(n.firefox=!0,n.version=i[1]),o&&(n.ie=!0,n.version=o[1]),r&&(n.edge=!0,n.version=r[1],n.newEdge=+r[1].split(".")[0]>18),a&&(n.weChat=!0),e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,e.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11),e.domSupported="undefined"!=typeof document){var s=document.documentElement.style;e.transform3dSupported=(n.ie&&"transition"in s||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||n.ie&&+n.version>=9}}(navigator.userAgent,Jp);const Qp=Jp;var tf,ef,nf="sans-serif",of="12px "+nf,rf=function(){var t={};if("undefined"==typeof JSON)return t;for(var e=0;e<95;e++){var n=String.fromCharCode(e+32),i=("007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N".charCodeAt(e)-20)/100;t[n]=i}return t}(),af={createCanvas:function(){return"undefined"!=typeof document&&document.createElement("canvas")},measureText:function(t,e){if(!tf){var n=af.createCanvas();tf=n&&n.getContext("2d")}if(tf)return ef!==e&&(ef=tf.font=e||of),tf.measureText(t);t=t||"";var i=/((?:\d+)?\.?\d*)px/.exec(e=e||of),o=i&&+i[1]||12,r=0;if(e.indexOf("mono")>=0)r=o*t.length;else for(var a=0;a"'])/g,Bf={"&":"&","<":"<",">":">",'"':""","'":"'"},Nf=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ff=[],Vf=Qp.browser.firefox&&+Qp.browser.version.split(".")[0]<39,Zf=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0},Hf=function(){function t(){this._track=[]}return t.prototype.recognize=function(t,e,n){return this._doTrack(t,e,n),this._recognize(t)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(t,e,n){var i=t.touches;if(i){for(var o={points:[],touches:[],target:e,event:t},r=0,a=i.length;r1&&o&&o.length>1){var a=mt(o)/mt(r);!isFinite(a)&&(a=1),e.pinchScale=a;var s=[((i=o)[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2];return e.pinchX=s[0],e.pinchY=s[1],{type:"pinch",target:t[0].target,event:e}}}}},jf=function(){function t(t,e){this.x=t||0,this.y=e||0}return t.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},t.prototype.scale=function(t){this.x*=t,this.y*=t},t.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},t.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},t.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},t.prototype.distanceSquare=function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(t){if(t){var e=this.x,n=this.y;return this.x=t[0]*e+t[2]*n+t[4],this.y=t[1]*e+t[3]*n+t[5],this}},t.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},t.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},t.set=function(t,e,n){t.x=e,t.y=n},t.copy=function(t,e){t.x=e.x,t.y=e.y},t.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},t.lenSquare=function(t){return t.x*t.x+t.y*t.y},t.dot=function(t,e){return t.x*e.x+t.y*e.y},t.add=function(t,e,n){t.x=e.x+n.x,t.y=e.y+n.y},t.sub=function(t,e,n){t.x=e.x-n.x,t.y=e.y-n.y},t.scale=function(t,e,n){t.x=e.x*n,t.y=e.y*n},t.scaleAndAdd=function(t,e,n,i){t.x=e.x+n.x*i,t.y=e.y+n.y*i},t.lerp=function(t,e,n,i){var o=1-i;t.x=o*e.x+i*n.x,t.y=o*e.y+i*n.y},t}();const Gf=jf;var Uf=Math.min,Yf=Math.max,Xf=Math.abs,qf=["x","y"],Kf=["width","height"],$f=new Gf,Jf=new Gf,Qf=new Gf,tg=new Gf,eg=Tt(),ng=eg.minTv,ig=eg.maxTv,og=[0,0],rg=function(){function t(e,n,i,o){t.set(this,e,n,i,o)}return t.set=function(t,e,n,i,o){return i<0&&(e+=i,i=-i),o<0&&(n+=o,o=-o),t.x=e,t.y=n,t.width=i,t.height=o,t},t.prototype.union=function(t){var e=Uf(t.x,this.x),n=Uf(t.y,this.y);this.width=isFinite(this.x)&&isFinite(this.width)?Yf(t.x+t.width,this.x+this.width)-e:t.width,this.height=isFinite(this.y)&&isFinite(this.height)?Yf(t.y+t.height,this.y+this.height)-n:t.height,this.x=e,this.y=n},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(t){var e=this,n=t.width/e.width,i=t.height/e.height,o=[1,0,0,1,0,0];return xt(o,o,[-e.x,-e.y]),function(t,e,n){var i=n[0],o=n[1];t[0]=e[0]*i,t[1]=e[1]*o,t[2]=e[2]*i,t[3]=e[3]*o,t[4]=e[4]*i,t[5]=e[5]*o}(o,o,[n,i]),xt(o,o,[t.x,t.y]),o},t.prototype.intersect=function(e,n,i){return t.intersect(this,e,n,i)},t.intersect=function(e,n,i,o){i&&Gf.set(i,0,0);var r=o&&o.outIntersectRect||null,a=o&&o.clamp;if(r&&(r.x=r.y=r.width=r.height=NaN),!e||!n)return!1;e instanceof t||(e=t.set(ag,e.x,e.y,e.width,e.height)),n instanceof t||(n=t.set(sg,n.x,n.y,n.width,n.height));var s=!!i;eg.reset(o,s);var l=eg.touchThreshold,u=e.x+l,h=e.x+e.width-l,c=e.y+l,d=e.y+e.height-l,p=n.x+l,f=n.x+n.width-l,g=n.y+l,m=n.y+n.height-l;if(u>h||c>d||p>f||g>m)return!1;var y=!(h=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},t.prototype.contain=function(e,n){return t.contain(this,e,n)},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return 0===this.width||0===this.height},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(t,e){return t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t},t.applyTransform=function(e,n,i){if(i){if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var o=i[0],r=i[3],a=i[5];return e.x=n.x*o+i[4],e.y=n.y*r+a,e.width=n.width*o,e.height=n.height*r,e.width<0&&(e.x+=e.width,e.width=-e.width),void(e.height<0&&(e.y+=e.height,e.height=-e.height))}$f.x=Qf.x=n.x,$f.y=tg.y=n.y,Jf.x=tg.x=n.x+n.width,Jf.y=Qf.y=n.y+n.height,$f.transform(i),tg.transform(i),Jf.transform(i),Qf.transform(i),e.x=Uf($f.x,Jf.x,Qf.x,tg.x),e.y=Uf($f.y,Jf.y,Qf.y,tg.y);var s=Yf($f.x,Jf.x,Qf.x,tg.x),l=Yf($f.y,Jf.y,Qf.y,tg.y);e.width=s-e.x,e.height=l-e.y}else e!==n&&t.copy(e,n)},t}(),ag=new rg(0,0,0,0),sg=new rg(0,0,0,0);const lg=rg;var ug="silent",hg=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.handler=null,e}return W(e,t),e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(Af),cg=function(t,e){this.x=t,this.y=e},dg=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],pg=new lg(0,0,0,0),fg=function(t){function e(e,n,i,o,r){var a=t.call(this)||this;return a._hovered=new cg(0,0),a.storage=e,a.painter=n,a.painterRoot=o,a._pointerSize=r,i=i||new hg,a.proxy=null,a.setHandlerProxy(i),a._draggingMgr=new Pf(a),a}return W(e,t),e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(c(dg,function(e){t.on&&t.on(e,this[e],this)},this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var e=t.zrX,n=t.zrY,i=It(this,e,n),o=this._hovered,r=o.target;r&&!r.__zr&&(r=(o=this.findHover(o.x,o.y)).target);var a=this._hovered=i?new cg(e,n):this.findHover(e,n),s=a.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),r&&s!==r&&this.dispatchToElement(o,"mouseout",t),this.dispatchToElement(a,"mousemove",t),s&&s!==r&&this.dispatchToElement(a,"mouseover",t)},e.prototype.mouseout=function(t){var e=t.zrEventControl;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new cg(0,0)},e.prototype.dispatch=function(t,e){var n=this[t];n&&n.call(this,e)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},e.prototype.dispatchToElement=function(t,e,n){var i=(t=t||{}).target;if(!i||!i.silent){for(var o="on"+e,r=function(t,e,n){return{type:t,event:n,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:Mt}}(e,t,n);i&&(i[o]&&(r.cancelBubble=!!i[o].call(i,r)),i.trigger(e,r),i=i.__hostTarget?i.__hostTarget:i.parent,!r.cancelBubble););r.cancelBubble||(this.trigger(e,r),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(t){"function"==typeof t[o]&&t[o].call(t,r),t.trigger&&t.trigger(e,r)}))}},e.prototype.findHover=function(t,e,n){var i=this.storage.getDisplayList(),o=new cg(t,e);if(kt(i,o,t,e,n),this._pointerSize&&!o.target){for(var r=[],a=this._pointerSize,s=a/2,l=new lg(t-s,e-s,a,a),u=i.length-1;u>=0;u--){var h=i[u];h===n||h.ignore||h.ignoreCoarsePointer||h.parent&&h.parent.ignoreCoarsePointer||(pg.copy(h.getBoundingRect()),h.transform&&pg.applyTransform(h.transform),pg.intersect(l)&&r.push(h))}if(r.length)for(var c=Math.PI/12,d=2*Math.PI,p=0;p4)return;this._downPoint=null}this.dispatchToElement(n,t,e)}});const gg=fg;var mg=!1,yg=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Et}return t.prototype.traverse=function(t,e){for(var n=0;n=0&&this._roots.splice(i,1)}},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}();const vg=yg,_g=Qp.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};var xg={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),(t*=2)<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-xg.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*xg.bounceIn(2*t):.5*xg.bounceOut(2*t-1)+.5}};const wg=xg;var bg=Math.pow,Sg=Math.sqrt,Tg=1e-8,Mg=1e-4,Cg=Sg(3),kg=1/3,Ig=j(),Lg=j(),Pg=j(),Dg=/cubic-bezier\(([0-9,\.e ]+)\)/;const Ag=function(){function t(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||H,this.ondestroy=t.ondestroy||H,this.onrestart=t.onrestart||H,t.easing&&this.setEasing(t.easing)}return t.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),!this._paused){var n=this._life,i=t-this._startTime-this._pausedTime,o=i/n;o<0&&(o=0),o=Math.min(o,1);var r=this.easingFunc,a=r?r(o):o;if(this.onframe(a),1===o){if(!this.loop)return!0;this._startTime=t-i%n,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=e},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(t){this.easing=t,this.easingFunc=v(t)?t:wg[t]||qt(t)},t}();var Og=function(t){this.value=t},zg=function(){function t(){this._len=0}return t.prototype.insert=function(t){var e=new Og(t);return this.insertEntry(e),e},t.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++},t.prototype.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),Eg=function(){function t(t){this._list=new zg,this._maxSize=10,this._map={},this._maxSize=t}return t.prototype.put=function(t,e){var n=this._list,i=this._map,o=null;if(null==i[t]){var r=n.len(),a=this._lastRemovedEntry;if(r>=this._maxSize&&r>0){var s=n.head;n.remove(s),delete i[s.key],o=s.value,this._lastRemovedEntry=s}a?a.value=e:a=new Og(e),a.key=t,n.insertEntry(a),i[t]=a}return o},t.prototype.get=function(t){var e=this._map[t],n=this._list;if(null!=e)return e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}();const Rg=Eg;var Bg={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]},Ng=new Rg(20),Fg=null,Vg=new Rg(100),Zg=Math.round,Hg=1e-4,Wg={left:"start",right:"end",center:"middle",middle:"middle"},jg=Qp.hasGlobalWindow&&v(window.btoa)?function(t){return window.btoa(unescape(encodeURIComponent(t)))}:"undefined"!=typeof Buffer?function(t){return Buffer.from(t).toString("base64")}:function(t){return null},Gg=Array.prototype.slice,Ug=[0,0,0,0],Yg=function(){function t(t){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=t}return t.prototype.isFinished=function(){return this._finished},t.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},t.prototype.needsAnimate=function(){return this.keyframes.length>=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(t,e,n){this._needsSort=!0;var i=this.keyframes,o=i.length,r=!1,s=6,l=e;if(h(e)){var u=function(t){return h(t&&t[0])?2:1}(e);s=u,(1===u&&!w(e[0])||2===u&&!w(e[0][0]))&&(r=!0)}else if(w(e)&&!k(e))s=0;else if(_(e))if(isNaN(+e)){var c=oe(e);c&&(l=c,s=3)}else s=0;else if(C(e)){var p=a({},l);p.colorStops=d(e.colorStops,function(t){return{offset:t.offset,color:oe(t.color)}}),ye(e)?s=4:ve(e)&&(s=5),l=p}0===o?this.valType=s:s===this.valType&&6!==s||(r=!0),this.discrete=this.discrete||r;var f={time:t,value:l,rawValue:e,percent:0};return n&&(f.easing=n,f.easingFunc=v(n)?n:wg[n]||qt(n)),i.push(f),f},t.prototype.prepare=function(t,e){var n=this.keyframes;this._needsSort&&n.sort(function(t,e){return t.time-e.time});for(var i=this.valType,o=n.length,r=n[o-1],a=this.discrete,s=Ae(i),l=De(i),u=0;u=0&&!(l[n].percent<=e);n--);n=f(n,u-2)}else{for(n=p;ne);n++);n=f(n-1,u-2)}o=l[n+1],i=l[n]}if(i&&o){this._lastFr=n,this._lastFrP=e;var g=o.percent-i.percent,m=0===g?1:f((e-i.percent)/g,1);o.easingFunc&&(m=o.easingFunc(m));var y=r?this._additiveValue:c?Ug:t[h];if(!Ae(s)&&!c||y||(y=this._additiveValue=[]),this.discrete)t[h]=m<1?i.rawValue:o.rawValue;else if(Ae(s))1===s?Te(y,i[a],o[a],m):function(t,e,n,i){for(var o=e.length,r=o&&e[0].length,a=0;a0&&s.addKeyframe(0,Le(l),i),this._trackKeys.push(a)}s.addKeyframe(t,Le(e[a]),i)}return this._maxTime=Math.max(this._maxTime,t),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,n=0;n0)){this._started=1;for(var e=this,n=[],i=this._maxTime||0,o=0;o1){var a=r.pop();o.addKeyframe(a.time,t[i]),o.prepare(this._maxTime,o.getAdditiveTrack())}}}},t}();const qg=Xg;var Kg=function(t){function e(e){var n=t.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,n.stage=(e=e||{}).stage||{},n}return W(e,t),e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var e=t.getClip();e&&this.addClip(e)},e.prototype.removeClip=function(t){if(t.animation){var e=t.prev,n=t.next;e?e.next=n:this._head=n,n?n.prev=e:this._tail=e,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var e=t.getClip();e&&this.removeClip(e),t.animation=null},e.prototype.update=function(t){for(var e=Oe()-this._pausedTime,n=e-this._time,i=this._head;i;){var o=i.next;i.step(e,n)?(i.ondestroy(),this.removeClip(i),i=o):i=o}this._time=e,t||(this.trigger("frame",n),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0,_g(function e(){t._running&&(_g(e),!t._paused&&t.update())})},e.prototype.start=function(){this._running||(this._time=Oe(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=Oe(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=Oe()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var e=t.next;t.prev=t.next=t.animation=null,t=e}this._head=this._tail=null},e.prototype.isFinished=function(){return null==this._head},e.prototype.animate=function(t,e){e=e||{},this.start();var n=new qg(t,e.loop);return this.addAnimator(n),n},e}(Af);const $g=Kg;var Jg,Qg,tm=Qp.domSupported,em=(Qg={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:Jg=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:d(Jg,function(t){var e=t.replace("mouse","pointer");return Qg.hasOwnProperty(e)?e:t})}),nm=["mousemove","mouseup"],im=["pointermove","pointerup"],om=!1,rm=function(t,e){this.stopPropagation=H,this.stopImmediatePropagation=H,this.preventDefault=H,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY},am={mousedown:function(t){t=dt(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=dt(this.dom,t);var e=this.__mayPointerCapture;!e||t.zrX===e[0]&&t.zrY===e[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=dt(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){Re(this,(t=dt(this.dom,t)).toElement||t.relatedTarget)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){om=!0,t=dt(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){om||(t=dt(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){Ee(t=dt(this.dom,t)),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),am.mousemove.call(this,t),am.mousedown.call(this,t)},touchmove:function(t){Ee(t=dt(this.dom,t)),this.handler.processGesture(t,"change"),am.mousemove.call(this,t)},touchend:function(t){Ee(t=dt(this.dom,t)),this.handler.processGesture(t,"end"),am.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<300&&am.click.call(this,t)},pointerdown:function(t){am.mousedown.call(this,t)},pointermove:function(t){ze(t)||am.mousemove.call(this,t)},pointerup:function(t){am.mouseup.call(this,t)},pointerout:function(t){ze(t)||am.mouseout.call(this,t)}};c(["click","dblclick","contextmenu"],function(t){am[t]=function(e){e=dt(this.dom,e),this.trigger(t,e)}});var sm={pointermove:function(t){ze(t)||sm.mousemove.call(this,t)},pointerup:function(t){sm.mouseup.call(this,t)},mousemove:function(t){this.trigger("mousemove",t)},mouseup:function(t){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",t),e&&(t.zrEventControl="only_globalout",this.trigger("mouseout",t))}},lm=function(t,e){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=t,this.domHandlers=e};const um=function(t){function e(e,n){var i,o,r,a=t.call(this)||this;return a.__pointerCapturing=!1,a.dom=e,a.painterRoot=n,a._localHandlerScope=new lm(e,am),tm&&(a._globalHandlerScope=new lm(document,sm)),i=a,r=(o=a._localHandlerScope).domHandlers,Qp.pointerEventsSupported?c(em.pointer,function(t){Be(o,t,function(e){r[t].call(i,e)})}):(Qp.touchEventsSupported&&c(em.touch,function(t){Be(o,t,function(e){r[t].call(i,e),function(t){t.touching=!0,null!=t.touchTimer&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout(function(){t.touching=!1,t.touchTimer=null},700)}(o)})}),c(em.mouse,function(t){Be(o,t,function(e){e=ct(e),o.touching||r[t].call(i,e)})})),a}return W(e,t),e.prototype.dispose=function(){Ne(this._localHandlerScope),tm&&Ne(this._globalHandlerScope)},e.prototype.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},e.prototype.__togglePointerCapture=function(t){if(this.__mayPointerCapture=null,tm&&+this.__pointerCapturing^+t){this.__pointerCapturing=t;var e=this._globalHandlerScope;t?function(t,e){function n(n){Be(e,n,function(i){i=ct(i),Re(t,i.target)||(i=function(t,e){return dt(t.dom,new rm(t,e),!0)}(t,i),e.domHandlers[n].call(t,i))},{capture:!0})}Qp.pointerEventsSupported?c(im,n):Qp.touchEventsSupported||c(nm,n)}(this,e):Ne(e)}},e}(Af);var hm=1;Qp.hasGlobalWindow&&(hm=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var cm=hm,dm="#333",pm="#ccc",fm=yt,gm=5e-5,mm=[],ym=[],vm=[1,0,0,1,0,0],_m=Math.abs,xm=function(){function t(){}var e;return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},t.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},t.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},t.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},t.prototype.needLocalTransform=function(){return Fe(this.rotation)||Fe(this.x)||Fe(this.y)||Fe(this.scaleX-1)||Fe(this.scaleY-1)||Fe(this.skewX)||Fe(this.skewY)},t.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),n=this.transform;e||t?(n=n||[1,0,0,1,0,0],e?this.getLocalTransform(n):fm(n),t&&(e?_t(n,t,n):vt(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)):n&&(fm(n),this.invTransform=null)},t.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(null!=e&&1!==e){this.getGlobalScale(mm);var n=mm[0]<0?-1:1,i=mm[1]<0?-1:1,o=((mm[0]-n)*e+n)/mm[0]||0,r=((mm[1]-i)*e+i)/mm[1]||0;t[0]*=o,t[1]*=o,t[2]*=r,t[3]*=r}this.invTransform=this.invTransform||[1,0,0,1,0,0],bt(this.invTransform,t)},t.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},t.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],n=t[2]*t[2]+t[3]*t[3],i=Math.atan2(t[1],t[0]),o=Math.PI/2+i-Math.atan2(t[3],t[2]);n=Math.sqrt(n)*Math.cos(o),e=Math.sqrt(e),this.skewX=o,this.skewY=0,this.rotation=-i,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||[1,0,0,1,0,0],_t(ym,t.invTransform,e),e=ym);var n=this.originX,i=this.originY;(n||i)&&(vm[4]=n,vm[5]=i,_t(ym,e,vm),ym[4]-=n,ym[5]-=i,e=ym),this.setLocalTransform(e)}},t.prototype.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},t.prototype.transformCoordToLocal=function(t,e){var n=[t,e],i=this.invTransform;return i&&et(n,n,i),n},t.prototype.transformCoordToGlobal=function(t,e){var n=[t,e],i=this.transform;return i&&et(n,n,i),n},t.prototype.getLineScale=function(){var t=this.transform;return t&&_m(t[0]-1)>1e-10&&_m(t[3]-1)>1e-10?Math.sqrt(_m(t[0]*t[3]-t[2]*t[1])):1},t.prototype.copyTransform=function(t){Ve(this,t)},t.getLocalTransform=function(t,e){e=e||[];var n=t.originX||0,i=t.originY||0,o=t.scaleX,r=t.scaleY,a=t.anchorX,s=t.anchorY,l=t.rotation||0,u=t.x,h=t.y,c=t.skewX?Math.tan(t.skewX):0,d=t.skewY?Math.tan(-t.skewY):0;if(n||i||a||s){var p=n+a,f=i+s;e[4]=-p*o-c*f*r,e[5]=-f*r-d*p*o}else e[4]=e[5]=0;return e[0]=o,e[3]=r,e[1]=d*o,e[2]=c*r,l&&wt(e,e,l),e[4]+=n+u,e[5]+=i+h,e},t.initDefaultProps=((e=t.prototype).scaleX=e.scaleY=e.globalScaleRatio=1,void(e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0)),t}(),wm=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];const bm=xm;var Sm,Tm=0,Mm=5,Cm="__zr_normal__",km=wm.concat(["ignore"]),Im=p(wm,function(t,e){return t[e]=!0,t},{ignore:!1}),Lm={},Pm=new lg(0,0,0,0),Dm=[],Am=function(){function t(t){this.id=n(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return t.prototype._init=function(t){this.attr(t)},t.prototype.drift=function(t,e,n){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=e,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,o=e.innerTransformable,r=void 0,a=void 0,s=!1;o.parent=i?this:null;var l=!1;o.copyTransform(e);var u=null!=n.position,h=n.autoOverflowArea,c=void 0;if((h||u)&&((c=Pm).copy(n.layoutRect?n.layoutRect:this.getBoundingRect()),i||c.applyTransform(this.transform)),u){this.calculateTextPosition?this.calculateTextPosition(Lm,n,c):Ke(Lm,n,c),o.x=Lm.x,o.y=Lm.y,r=Lm.align,a=Lm.verticalAlign;var d=n.origin;if(d&&null!=n.rotation){var p=void 0,f=void 0;"center"===d?(p=.5*c.width,f=.5*c.height):(p=qe(d[0],c.width),f=qe(d[1],c.height)),l=!0,o.originX=-o.x+p+(i?0:c.x),o.originY=-o.y+f+(i?0:c.y)}}null!=n.rotation&&(o.rotation=n.rotation);var g=n.offset;g&&(o.x+=g[0],o.y+=g[1],l||(o.originX=-g[0],o.originY=-g[1]));var m=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(h){var y=m.overflowRect=m.overflowRect||new lg(0,0,0,0);o.getLocalTransform(Dm),bt(Dm,Dm),lg.copy(y,c),y.applyTransform(Dm)}else m.overflowRect=null;var v=void 0,_=void 0,x=void 0;(null==n.inside?"string"==typeof n.position&&n.position.indexOf("inside")>=0:n.inside)&&this.canBeInsideText()?(_=n.insideStroke,null!=(v=n.insideFill)&&"auto"!==v||(v=this.getInsideTextFill()),null!=_&&"auto"!==_||(_=this.getInsideTextStroke(v),x=!0)):(_=n.outsideStroke,null!=(v=n.outsideFill)&&"auto"!==v||(v=this.getOutsideFill()),null!=_&&"auto"!==_||(_=this.getOutsideStroke(v),x=!0)),(v=v||"#000")===m.fill&&_===m.stroke&&x===m.autoStroke&&r===m.align&&a===m.verticalAlign||(s=!0,m.fill=v,m.stroke=_,m.autoStroke=x,m.align=r,m.verticalAlign=a,e.setDefaultTextStyle(m)),e.__dirty|=1,s&&e.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(t){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?pm:dm},t.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),n="string"==typeof e&&oe(e);n||(n=[255,255,255,1]);for(var i=n[3],o=this.__zr.isDarkMode(),r=0;r<3;r++)n[r]=n[r]*i+(o?0:255)*(1-i);return n[3]=1,le(n,"rgba")},t.prototype.traverse=function(t,e){},t.prototype.attrKV=function(t,e){"textConfig"===t?this.setTextConfig(e):"textContent"===t?this.setTextContent(e):"clipPath"===t?this.setClipPath(e):"extra"===t?(this.extra=this.extra||{},a(this.extra,e)):this[t]=e},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(b(t))for(var n=g(t),i=0;i0},t.prototype.getState=function(t){return this.states[t]},t.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},t.prototype.clearStates=function(t){this.useState(Cm,!1,t)},t.prototype.useState=function(t,e,n,o){var r=t===Cm;if(this.hasState()||!r){var a=this.currentStates,s=this.stateTransition;if(!(l(a,t)>=0)||!e&&1!==a.length){var u;if(this.stateProxy&&!r&&(u=this.stateProxy(t)),u||(u=this.states&&this.states[t]),u||r){r||this.saveCurrentToNormalState(u);var h=!!(u&&u.hoverLayer||o);h&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,u,this._normalState,e,!n&&!this.__inHover&&s&&s.duration>0,s);var c=this._textContent,d=this._textGuide;return c&&c.useState(t,e,n,h),d&&d.useState(t,e,n,h),r?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),u}i("State "+t+" not exists.")}}},t.prototype.useStates=function(t,e,n){if(t.length){var i=[],o=this.currentStates,r=t.length,a=r===o.length;if(a)for(var s=0;s0,p);var f=this._textContent,g=this._textGuide;f&&f.useStates(t,e,c),g&&g.useStates(t,e,c),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}else this.clearStates()},t.prototype.isSilent=function(){for(var t=this;t;){if(t.silent)return!0;var e=t.__hostTarget;t=e?t.ignoreHostSilent?null:e:t.parent}return!1},t.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var n=this.currentStates.slice();n.splice(e,1),this.useStates(n)}},t.prototype.replaceState=function(t,e,n){var i=this.currentStates.slice(),o=l(i,t),r=l(i,e)>=0;o>=0?r?i.splice(o,1):i[o]=e:n&&!r&&i.push(e),this.useStates(i)},t.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},t.prototype._mergeStates=function(t){for(var e,n={},i=0;i=0&&e.splice(n,1)}),this.animators.push(t),n&&n.animation.addAnimator(t),n&&n.wakeUp()},t.prototype.updateDuringAnimation=function(t){this.markRedraw()},t.prototype.stopAnimation=function(t,e){for(var n=this.animators,i=n.length,o=[],r=0;r=0&&(n.splice(i,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,e){var n=l(this._children,t);return n>=0&&this.replaceAt(e,n),this},e.prototype.replaceAt=function(t,e){var n=this._children,i=n[e];if(t&&t!==this&&t.parent!==this&&t!==i){n[e]=t,i.parent=null;var o=this.__zr;o&&i.removeSelfFromZr(o),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__zr;e&&e!==t.__zr&&t.addSelfToZr(e),e&&e.refresh()},e.prototype.remove=function(t){var e=this.__zr,n=this._children,i=l(n,t);return i<0||(n.splice(i,1),t.parent=null,e&&t.removeSelfFromZr(e),e&&e.refresh()),this},e.prototype.removeAll=function(){for(var t=this._children,e=this.__zr,n=0;n0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},t.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover())},t.prototype.resize=function(t){this._disposed||(this.painter.resize((t=t||{}).width,t.height),this.handler.resize())},t.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},t.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},t.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},t.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},t.prototype.findHover=function(t,e){if(!this._disposed)return this.handler.findHover(t,e)},t.prototype.on=function(t,e,n){return this._disposed||this.handler.on(t,e,n),this},t.prototype.off=function(t,e){this._disposed||this.handler.off(t,e)},t.prototype.trigger=function(t,e){this._disposed||this.handler.trigger(t,e)},t.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),e=0;e0?t.length:0,this.item=null,this.key=NaN,this},t.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)}}(),"___EC__COMPONENT__CONTAINER___"),Qm="___EC__EXTENDED_CLASS___",ty=Math.round(10*Math.random()),ey=Vn([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),ny=function(){function t(){}return t.prototype.getAreaStyle=function(t,e){return ey(this,t,e)},t}(),iy=new Rg(50),oy=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,ry=function(){},ay=function(t){this.tokens=[],t&&(this.tokens=t)},sy=function(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1},ly=p(",&?/;] ".split(""),function(t,e){return t[e]=!0,t},{}),uy=new lg(0,0,0,0),hy={outIntersectRect:{},clamp:!0},cy="__zr_style_"+Math.round(10*Math.random()),dy={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},py={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};dy[cy]=!0;var fy=["z","z2","invisible"],gy=["invisible"],my=function(t){function e(e){return t.call(this,e)||this}var n;return W(e,t),e.prototype._init=function(e){for(var n=g(e),i=0;i0&&(this._ux=Zy(n/cm/t)||0,this._uy=Zy(n/cm/e)||0)},t.prototype.setDPR=function(t){this.dpr=t},t.prototype.setContext=function(t){this._ctx=t},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(Py.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},t.prototype.lineTo=function(t,e){var n=Zy(t-this._xi),i=Zy(e-this._yi),o=n>this._ux||i>this._uy;if(this.addData(Py.L,t,e),this._ctx&&o&&this._ctx.lineTo(t,e),o)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var r=n*n+i*i;r>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=r)}return this},t.prototype.bezierCurveTo=function(t,e,n,i,o,r){return this._drawPendingPt(),this.addData(Py.C,t,e,n,i,o,r),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,o,r),this._xi=o,this._yi=r,this},t.prototype.quadraticCurveTo=function(t,e,n,i){return this._drawPendingPt(),this.addData(Py.Q,t,e,n,i),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this._xi=n,this._yi=i,this},t.prototype.arc=function(t,e,n,i,o,r){return this._drawPendingPt(),Gy[0]=i,Gy[1]=o,function(t,e){var n=ai(t[0]);n<0&&(n+=Wy);var i=t[1];i+=n-t[0],!e&&i-n>=Wy?i=n+Wy:e&&n-i>=Wy?i=n-Wy:!e&&n>i?i=n+(Wy-ai(n-i)):e&&n0&&r))for(var a=0;au.length&&(this._expandData(),u=this.data);for(var h=0;h0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e11&&(this.data=new Float32Array(t)))}},t.prototype.getBoundingRect=function(){Oy[0]=Oy[1]=Ey[0]=Ey[1]=Number.MAX_VALUE,zy[0]=zy[1]=Ry[0]=Ry[1]=-Number.MAX_VALUE;var t,e=this.data,n=0,i=0,o=0,r=0;for(t=0;tn||Zy(m)>i||c===e-1)&&(f=Math.sqrt(L*L+m*m),o=g,r=_);break;case Py.C:var y=t[c++],v=t[c++],_=(g=t[c++],t[c++]),x=t[c++],w=t[c++];f=Wt(o,r,y,v,g,_,x,w,10),o=x,r=w;break;case Py.Q:f=Xt(o,r,y=t[c++],v=t[c++],g=t[c++],_=t[c++],10),o=g,r=_;break;case Py.A:var b=t[c++],S=t[c++],T=t[c++],M=t[c++],C=t[c++],k=t[c++],I=k+C;c+=1,p&&(a=Fy(C)*T+b,s=Vy(C)*M+S),f=Ny(T,M)*By(Wy,Math.abs(k)),o=Fy(I)*T+b,r=Vy(I)*M+S;break;case Py.R:a=o=t[c++],s=r=t[c++],f=2*t[c++]+2*t[c++];break;case Py.Z:var L=a-o;m=s-r,f=Math.sqrt(L*L+m*m),o=a,r=s}f>=0&&(l[h++]=f,u+=f)}return this._pathLen=u,u},t.prototype.rebuildPath=function(t,e){var n,i,o,r,a,s,l,u,h,c,d=this.data,p=this._ux,f=this._uy,g=this._len,m=e<1,y=0,v=0,_=0;if(!m||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=e*this._pathLen))t:for(var x=0;x0&&(t.lineTo(h,c),_=0),w){case Py.M:n=o=d[x++],i=r=d[x++],t.moveTo(o,r);break;case Py.L:a=d[x++],s=d[x++];var S=Zy(a-o),T=Zy(s-r);if(S>p||T>f){if(m){if(y+(Y=l[v++])>u){t.lineTo(o*(1-(X=(u-y)/Y))+a*X,r*(1-X)+s*X);break t}y+=Y}t.lineTo(a,s),o=a,r=s,_=0}else{var M=S*S+T*T;M>_&&(h=a,c=s,_=M)}break;case Py.C:var C=d[x++],k=d[x++],I=d[x++],L=d[x++],P=d[x++],D=d[x++];if(m){if(y+(Y=l[v++])>u){Ht(o,C,I,P,X=(u-y)/Y,Dy),Ht(r,k,L,D,X,Ay),t.bezierCurveTo(Dy[1],Ay[1],Dy[2],Ay[2],Dy[3],Ay[3]);break t}y+=Y}t.bezierCurveTo(C,k,I,L,P,D),o=P,r=D;break;case Py.Q:if(C=d[x++],k=d[x++],I=d[x++],L=d[x++],m){if(y+(Y=l[v++])>u){Yt(o,C,I,X=(u-y)/Y,Dy),Yt(r,k,L,X,Ay),t.quadraticCurveTo(Dy[1],Ay[1],Dy[2],Ay[2]);break t}y+=Y}t.quadraticCurveTo(C,k,I,L),o=I,r=L;break;case Py.A:var A=d[x++],O=d[x++],z=d[x++],E=d[x++],R=d[x++],B=d[x++],N=d[x++],F=!d[x++],V=z>E?z:E,Z=Zy(z-E)>.001,H=R+B,W=!1;if(m&&(y+(Y=l[v++])>u&&(H=R+B*(u-y)/Y,W=!0),y+=Y),Z&&t.ellipse?t.ellipse(A,O,z,E,N,R,H,F):t.arc(A,O,V,R,H,F),W)break t;b&&(n=Fy(R)*z+A,i=Vy(R)*E+O),o=Fy(H)*z+A,r=Vy(H)*E+O;break;case Py.R:n=o=d[x],i=r=d[x+1],a=d[x++],s=d[x++];var j=d[x++],G=d[x++];if(m){if(y+(Y=l[v++])>u){var U=u-y;t.moveTo(a,s),t.lineTo(a+By(U,j),s),(U-=j)>0&&t.lineTo(a+j,s+By(U,G)),(U-=G)>0&&t.lineTo(a+Ny(j-U,0),s+G),(U-=j)>0&&t.lineTo(a,s+Ny(G-U,0));break t}y+=Y}t.rect(a,s,j,G);break;case Py.Z:if(m){var Y;if(y+(Y=l[v++])>u){var X;t.lineTo(o*(1-(X=(u-y)/Y))+n*X,r*(1-X)+i*X);break t}y+=Y}t.closePath(),o=n,r=i}}},t.prototype.clone=function(){var e=new t,n=this.data;return e.data=n.slice?n.slice():Array.prototype.slice.call(n),e._len=this._len,e},t.prototype.canSave=function(){return!!this._saveData},t.CMD=Py,t.initDefaultProps=((e=t.prototype)._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,void(e._version=0)),t}();const Yy=Uy;var Xy=2*Math.PI,qy=2*Math.PI,Ky=Yy.CMD,$y=2*Math.PI,Jy=[-1,-1,-1],Qy=[-1,-1],tv=s({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},dy),ev={style:s({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},py.style)},nv=wm.concat(["invisible","culling","z","z2","zlevel","parent"]),iv=function(t){function e(e){return t.call(this,e)||this}var n;return W(e,t),e.prototype.update=function(){var n=this;t.prototype.update.call(this);var i=this.style;if(i.decal){var o=this._decalEl=this._decalEl||new e;o.buildPath===e.prototype.buildPath&&(o.buildPath=function(t){n.buildPath(t,n.shape)}),o.silent=!0;var r=o.style;for(var a in i)r[a]!==i[a]&&(r[a]=i[a]);r.fill=i.fill?i.decal:null,r.decal=null,r.shadowColor=null,i.strokeFirst&&(r.stroke=null);for(var s=0;s.5?dm:e>.2?"#eee":pm}if(t)return pm}return dm},e.prototype.getInsideTextStroke=function(t){var e=this.style.fill;if(_(e)){var n=this.__zr;if(!(!n||!n.isDarkMode())==ue(t,0)<.4)return e}},e.prototype.buildPath=function(t,e,n){},e.prototype.pathUpdated=function(){this.__dirty&=-5},e.prototype.getUpdatedPathProxy=function(t){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,t),this.path},e.prototype.createPathProxy=function(){this.path=new Yy(!1)},e.prototype.hasStroke=function(){var t=this.style,e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))},e.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},e.prototype.getBoundingRect=function(){var t=this._rect,e=this.style,n=!t;if(n){var i=!1;this.path||(i=!0,this.createPathProxy());var o=this.path;(i||4&this.__dirty)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),t=o.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var r=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||n){r.copy(t);var a=e.strokeNoScale?this.getLineScale():1,s=e.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;s=Math.max(s,null==l?4:l)}a>1e-10&&(r.width+=s/a,r.height+=s/a,r.x-=s/a/2,r.y-=s/a/2)}return r}return t},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect(),o=this.style;if(i.contain(t=n[0],e=n[1])){var r=this.path;if(this.hasStroke()){var a=o.lineWidth,s=o.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),function(t,e,n,i){return yi(t,e,!0,n,i)}(r,a/s,t,e)))return!0}if(this.hasFill())return function(t,e,n){return yi(t,0,!1,e,n)}(r,t,e)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():"shape"===t?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(e,n){"shape"===e?this.setShape(n):t.prototype.attrKV.call(this,e,n)},e.prototype.setShape=function(t,e){var n=this.shape;return n||(n=this.shape={}),"string"==typeof t?n[t]=e:a(n,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(4&this.__dirty)},e.prototype.createStyle=function(t){return F(tv,t)},e.prototype._innerSaveToNormal=function(e){t.prototype._innerSaveToNormal.call(this,e);var n=this._normalState;e.shape&&!n.shape&&(n.shape=a({},this.shape))},e.prototype._applyStateObj=function(e,n,i,o,r,s){t.prototype._applyStateObj.call(this,e,n,i,o,r,s);var l,u=!(n&&o);if(n&&n.shape?r?o?l=n.shape:(l=a({},i.shape),a(l,n.shape)):(l=a({},o?this.shape:i.shape),a(l,n.shape)):u&&(l=i.shape),l)if(r){this.shape=a({},this.shape);for(var h={},c=g(l),d=0;du&&(n*=u/(a=n+i),i*=u/a),o+r>u&&(o*=u/(a=o+r),r*=u/a),i+o>h&&(i*=h/(a=i+o),o*=h/a),n+r>h&&(n*=h/(a=n+r),r*=h/a),t.moveTo(s+n,l),t.lineTo(s+u-i,l),0!==i&&t.arc(s+u-i,l+i,i,-Math.PI/2,0),t.lineTo(s+u,l+h-o),0!==o&&t.arc(s+u-o,l+h-o,o,0,Math.PI/2),t.lineTo(s+r,l+h),0!==r&&t.arc(s+r,l+h-r,r,Math.PI/2,Math.PI),t.lineTo(s,l+n),0!==n&&t.arc(s+n,l+n,n,Math.PI,1.5*Math.PI)}(t,e):t.rect(n,i,o,r)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(ov);gv.prototype.type="rect";const mv=gv;var yv={fill:"#000"},vv={},_v={style:s({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},py.style)},xv=function(t){function e(e){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=yv,n.attr(e),n}return W(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var e=0;ey&&p){var _=Math.floor(y/d);f=f||m.length>_,v=(m=m.slice(0,_)).length*d}if(o&&h&&null!=g)for(var x=Un(g,u,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),w={},b=0;b0,M=0;Mm&&qn(a,s.substring(m,y),e,g),qn(a,p[2],e,g,p[1]),m=oy.lastIndex}md){var R=a.lines.length;I>0?(M.tokens=M.tokens.slice(0,I),r(M,k,C),a.lines=a.lines.slice(0,T+1)):a.lines=a.lines.slice(0,T),a.isTruncated=a.isTruncated||a.lines.length=0&&"right"===(k=_[C]).align;)this._placeToken(k,t,w,f,M,"right",m),b-=k.width,M-=k.width,C--;for(T+=(s-(T-p)-(g-M)-b)/2;S<=C;)this._placeToken(k=_[S],t,w,f,T+k.width/2,"center",m),T+=k.width,S++;f+=w}},e.prototype._placeToken=function(t,e,n,i,o,r,a){var s=e.rich[t.styleName]||{};s.text=t.text;var l=t.verticalAlign,u=i+n/2;"top"===l?u=i+t.height/2:"bottom"===l&&(u=i+n-t.height/2),!t.isLineHolder&&Li(s)&&this._renderBackground(s,e,"right"===r?o-t.width:"center"===r?o-t.width/2:o,u-t.height/2,t.width,t.height);var h=!!s.backgroundColor,c=t.textPadding;c&&(o=ki(o,r,c),u-=t.height/2-c[0]-t.innerHeight/2);var d=this._getOrCreateChild(sv),p=d.createStyle();d.useStyle(p);var f=this._defaultStyle,g=!1,m=0,y=!1,v=Ci("fill"in s?s.fill:"fill"in e?e.fill:(g=!0,f.fill)),_=Mi("stroke"in s?s.stroke:"stroke"in e?e.stroke:h||a||f.autoStroke&&!g?null:(m=2,y=!0,f.stroke)),x=s.textShadowBlur>0||e.textShadowBlur>0;p.text=t.text,p.x=o,p.y=u,x&&(p.shadowBlur=s.textShadowBlur||e.textShadowBlur||0,p.shadowColor=s.textShadowColor||e.textShadowColor||"transparent",p.shadowOffsetX=s.textShadowOffsetX||e.textShadowOffsetX||0,p.shadowOffsetY=s.textShadowOffsetY||e.textShadowOffsetY||0),p.textAlign=r,p.textBaseline="middle",p.font=t.font||of,p.opacity=P(s.opacity,e.opacity,1),bi(p,s),_&&(p.lineWidth=P(s.lineWidth,e.lineWidth,m),p.lineDash=L(s.lineDash,e.lineDash),p.lineDashOffset=e.lineDashOffset||0,p.stroke=_),v&&(p.fill=v),d.setBoundingRect(ti(p,t.contentWidth,t.contentHeight,y?0:null))},e.prototype._renderBackground=function(t,e,n,i,o,r){var a,s,l,u=t.backgroundColor,h=t.borderWidth,c=t.borderColor,d=u&&u.image,p=u&&!d,f=t.borderRadius,g=this;if(p||t.lineHeight||h&&c){(a=this._getOrCreateChild(mv)).useStyle(a.createStyle()),a.style.fill=null;var m=a.shape;m.x=n,m.y=i,m.width=o,m.height=r,m.r=f,a.dirtyShape()}if(p)(l=a.style).fill=u||null,l.fillOpacity=L(t.fillOpacity,1);else if(d){(s=this._getOrCreateChild(cv)).onload=function(){g.dirtyStyle()};var y=s.style;y.image=u.image,y.x=n,y.y=i,y.width=o,y.height=r}h&&c&&((l=a.style).lineWidth=h,l.stroke=c,l.strokeOpacity=L(t.strokeOpacity,1),l.lineDash=t.borderDash,l.lineDashOffset=t.borderDashOffset||0,a.strokeContainThreshold=0,a.hasFill()&&a.hasStroke()&&(l.strokeFirst=!0,l.lineWidth*=2));var v=(a||s).style;v.shadowBlur=t.shadowBlur||0,v.shadowColor=t.shadowColor||"transparent",v.shadowOffsetX=t.shadowOffsetX||0,v.shadowOffsetY=t.shadowOffsetY||0,v.opacity=P(t.opacity,e.opacity,1)},e.makeFont=function(t){var e="";return Si(t)&&(e=[t.fontStyle,t.fontWeight,wi(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),e&&z(e)||t.textFont||t.font},e}(_y),wv={left:!0,right:1,center:1},bv={top:1,bottom:1,middle:1},Sv=["fontStyle","fontWeight","fontSize","fontFamily"];const Tv=xv;var Mv=Ln(),Cv=1,kv={},Iv=Ln(),Lv=Ln(),Pv=["emphasis","blur","select"],Dv=["normal","emphasis","blur","select"],Av="highlight",Ov="downplay",zv="select",Ev="unselect",Rv="toggleSelect",Bv="selectchanged",Nv={},Fv=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],Vv=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],Zv=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],Hv=Ln(),Wv={minMargin:1,textMargin:2},jv=["textStyle","color"],Gv=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],Uv=new Tv;const Yv=function(){function t(){}return t.prototype.getTextColor=function(t){var e=this.ecModel;return this.getShallow("color")||(!t&&e?e.get(jv):null)},t.prototype.getFont=function(){return go({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},t.prototype.getTextRect=function(t){for(var e={text:t,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},n=0;n-1?r_:s_;yo(a_,{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:". "}}}}),yo(r_,{time:{month:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"],monthAbbr:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],dayOfWeek:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],dayOfWeekAbbr:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"]},legend:{selector:{all:"\u5168\u9009",inverse:"\u53cd\u9009"}},toolbox:{brush:{title:{rect:"\u77e9\u5f62\u9009\u62e9",polygon:"\u5708\u9009",lineX:"\u6a2a\u5411\u9009\u62e9",lineY:"\u7eb5\u5411\u9009\u62e9",keep:"\u4fdd\u6301\u9009\u62e9",clear:"\u6e05\u9664\u9009\u62e9"}},dataView:{title:"\u6570\u636e\u89c6\u56fe",lang:["\u6570\u636e\u89c6\u56fe","\u5173\u95ed","\u5237\u65b0"]},dataZoom:{title:{zoom:"\u533a\u57df\u7f29\u653e",back:"\u533a\u57df\u7f29\u653e\u8fd8\u539f"}},magicType:{title:{line:"\u5207\u6362\u4e3a\u6298\u7ebf\u56fe",bar:"\u5207\u6362\u4e3a\u67f1\u72b6\u56fe",stack:"\u5207\u6362\u4e3a\u5806\u53e0",tiled:"\u5207\u6362\u4e3a\u5e73\u94fa"}},restore:{title:"\u8fd8\u539f"},saveAsImage:{title:"\u4fdd\u5b58\u4e3a\u56fe\u7247",lang:["\u53f3\u952e\u53e6\u5b58\u4e3a\u56fe\u7247"]}},series:{typeNames:{pie:"\u997c\u56fe",bar:"\u67f1\u72b6\u56fe",line:"\u6298\u7ebf\u56fe",scatter:"\u6563\u70b9\u56fe",effectScatter:"\u6d9f\u6f2a\u6563\u70b9\u56fe",radar:"\u96f7\u8fbe\u56fe",tree:"\u6811\u56fe",treemap:"\u77e9\u5f62\u6811\u56fe",boxplot:"\u7bb1\u578b\u56fe",candlestick:"K\u7ebf\u56fe",k:"K\u7ebf\u56fe",heatmap:"\u70ed\u529b\u56fe",map:"\u5730\u56fe",parallel:"\u5e73\u884c\u5750\u6807\u56fe",lines:"\u7ebf\u56fe",graph:"\u5173\u7cfb\u56fe",sankey:"\u6851\u57fa\u56fe",funnel:"\u6f0f\u6597\u56fe",gauge:"\u4eea\u8868\u76d8\u56fe",pictorialBar:"\u8c61\u5f62\u67f1\u56fe",themeRiver:"\u4e3b\u9898\u6cb3\u6d41\u56fe",sunburst:"\u65ed\u65e5\u56fe",custom:"\u81ea\u5b9a\u4e49\u56fe\u8868",chart:"\u56fe\u8868"}},aria:{general:{withTitle:"\u8fd9\u662f\u4e00\u4e2a\u5173\u4e8e\u201c{title}\u201d\u7684\u56fe\u8868\u3002",withoutTitle:"\u8fd9\u662f\u4e00\u4e2a\u56fe\u8868\uff0c"},series:{single:{prefix:"",withName:"\u56fe\u8868\u7c7b\u578b\u662f{seriesType}\uff0c\u8868\u793a{seriesName}\u3002",withoutName:"\u56fe\u8868\u7c7b\u578b\u662f{seriesType}\u3002"},multiple:{prefix:"\u5b83\u7531{seriesCount}\u4e2a\u56fe\u8868\u7cfb\u5217\u7ec4\u6210\u3002",withName:"\u7b2c{seriesId}\u4e2a\u7cfb\u5217\u662f\u4e00\u4e2a\u8868\u793a{seriesName}\u7684{seriesType}\uff0c",withoutName:"\u7b2c{seriesId}\u4e2a\u7cfb\u5217\u662f\u4e00\u4e2a{seriesType}\uff0c",separator:{middle:"\uff1b",end:"\u3002"}}},data:{allData:"\u5176\u6570\u636e\u662f\u2014\u2014",partialData:"\u5176\u4e2d\uff0c\u524d{displayCnt}\u9879\u662f\u2014\u2014",withName:"{name}\u7684\u6570\u636e\u662f{value}",withoutName:"{value}",separator:{middle:"\uff0c",end:""}}}});var c_=null,d_=1e3,p_=6e4,f_=36e5,g_=864e5,m_=31536e6,y_={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})/},v_={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},__="{yyyy}-{MM}-{dd}",x_={year:"{yyyy}",month:"{yyyy}-{MM}",day:__,hour:__+" "+v_.hour,minute:__+" "+v_.minute,second:__+" "+v_.second,millisecond:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},w_=["year","month","day","hour","minute","second","millisecond"],b_=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"],S_=A,T_=["a","b","c","d","e","f","g"],M_=function(t,e){return"{"+t+(null==e?"":e)+"}"},C_={},k_={},I_=function(){function t(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return t.prototype.create=function(t,e){function n(n,i){var o=[];return c(n,function(n,i){var r=n.create(t,e);o=o.concat(r||[])}),o}this._nonSeriesBoxMasterList=n(C_),this._normalMasterList=n(k_)},t.prototype.update=function(t,e){c(this._normalMasterList,function(n){n.update&&n.update(t,e)})},t.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},t.register=function(t,e){"matrix"!==t&&"calendar"!==t?k_[t]=e:C_[t]=e},t.get=function(t){return k_[t]||C_[t]},t}(),L_=1,P_=2,D_=B(),A_=0,O_=1,z_=2;const E_=I_;var R_=c,B_=["left","right","top","bottom","width","height"],N_=[["width","left","right"],["height","top","bottom"]],F_=Uo,V_=(m(Uo,"vertical"),m(Uo,"horizontal"),{rect:1,point:2}),Z_=Ln(),H_=function(t){function n(e,n,i){var o=t.call(this,e,n,i)||this;return o.uid=mo("ec_cpt_model"),o}var i;return e(n,t),n.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n)},n.prototype.mergeDefaultAndTheme=function(t,e){var n=Ko(this),i=n?Jo(t):{};r(t,e.getTheme().get(this.mainType)),r(t,this.getDefaultOption()),n&&$o(t,i,n)},n.prototype.mergeOption=function(t,e){r(this.option,t,!0);var n=Ko(this);n&&$o(this.option,t,n)},n.prototype.optionUpdated=function(t,e){},n.prototype.getDefaultOption=function(){var t=this.constructor;if(!function(t){return!(!t||!t[Qm])}(t))return t.defaultOption;var e=Z_(this);if(!e.defaultOption){for(var n=[],i=t;i;){var o=i.prototype.defaultOption;o&&n.push(o),i=i.superClass}for(var a={},s=n.length-1;s>=0;s--)a=r(a,n[s],!0);e.defaultOption=a}return e.defaultOption},n.prototype.getReferringComponents=function(t,e){var n=t+"Id";return An(this.ecModel,t,{index:this.get(t+"Index",!0),id:this.get(n,!0)},e)},n.prototype.getBoxLayoutParams=function(){return{left:(t=this).getShallow("left",e=!1),top:t.getShallow("top",e),right:t.getShallow("right",e),bottom:t.getShallow("bottom",e),width:t.getShallow("width",e),height:t.getShallow("height",e)};var t,e},n.prototype.getZLevelKey=function(){return""},n.prototype.setZLevel=function(t){this.option.zlevel=t},n.protoInitialize=((i=n.prototype).type="component",i.id="",i.name="",i.mainType="",i.subType="",void(i.componentIndex=0)),n}(i_);Rn(H_,i_),Fn(H_),function(t){var e={};t.registerSubTypeDefaulter=function(t,n){var i=zn(t);e[i.main]=n},t.determineSubType=function(n,i){var o=i.type;if(!o){var r=zn(n).main;t.hasSubTypes(n)&&e[r]&&(o=e[r](i))}return o}}(H_),function(t){function e(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}t.topologicalTravel=function(t,n,i,o){function r(t){u[t].entryCount--,0===u[t].entryCount&&h.push(t)}function a(t){p[t]=!0,r(t)}if(t.length){var s=function(t){var n={},i=[];return c(t,function(o){var r,a,s=e(n,o),u=function(t,e){var n=[];return c(t,function(t){l(e,t)>=0&&n.push(t)}),n}(s.originalDeps=(a=[],c(H_.getClassesByMainType(r=o),function(t){a=a.concat(t.dependencies||t.prototype.dependencies||[])}),a=d(a,function(t){return zn(t).main}),"dataset"!==r&&l(a,"dataset")<=0&&a.unshift("dataset"),a),t);s.entryCount=u.length,0===s.entryCount&&i.push(o),c(u,function(t){l(s.predecessor,t)<0&&s.predecessor.push(t);var i=e(n,t);l(i.successor,t)<0&&i.successor.push(o)})}),{graph:n,noEntryList:i}}(n),u=s.graph,h=s.noEntryList,p={};for(c(t,function(t){p[t]=!0});h.length;){var f=h.pop(),g=u[f],m=!!p[f];m&&(i.call(o,f,g.originalDeps.slice()),delete p[f]),c(g.successor,m?a:r)}c(p,function(){throw new Error("")})}}}(H_);const W_=H_;var j_={color:{},darkColor:{},size:{}},G_=j_.color={theme:["#5070dd","#b6d634","#505372","#ff994d","#0ca8df","#ffd10a","#fb628b","#785db0","#3fbe95"],neutral00:"#fff",neutral05:"#f4f7fd",neutral10:"#e8ebf0",neutral15:"#dbdee4",neutral20:"#cfd2d7",neutral25:"#c3c5cb",neutral30:"#b7b9be",neutral35:"#aaacb2",neutral40:"#9ea0a5",neutral45:"#929399",neutral50:"#86878c",neutral55:"#797b7f",neutral60:"#6d6e73",neutral65:"#616266",neutral70:"#54555a",neutral75:"#48494d",neutral80:"#3c3c41",neutral85:"#303034",neutral90:"#232328",neutral95:"#17171b",neutral99:"#000",accent05:"#eff1f9",accent10:"#e0e4f2",accent15:"#d0d6ec",accent20:"#c0c9e6",accent25:"#b1bbdf",accent30:"#a1aed9",accent35:"#91a0d3",accent40:"#8292cc",accent45:"#7285c6",accent50:"#6578ba",accent55:"#5c6da9",accent60:"#536298",accent65:"#4a5787",accent70:"#404c76",accent75:"#374165",accent80:"#2e3654",accent85:"#252b43",accent90:"#1b2032",accent95:"#121521",transparent:"rgba(0,0,0,0)",highlight:"rgba(255,231,130,0.8)"};for(var U_ in a(G_,{primary:G_.neutral80,secondary:G_.neutral70,tertiary:G_.neutral60,quaternary:G_.neutral50,disabled:G_.neutral20,border:G_.neutral30,borderTint:G_.neutral20,borderShade:G_.neutral40,background:G_.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:G_.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:G_.neutral70,axisLineTint:G_.neutral40,axisTick:G_.neutral70,axisTickMinor:G_.neutral60,axisLabel:G_.neutral70,axisSplitLine:G_.neutral15,axisMinorSplitLine:G_.neutral05}),G_)if(G_.hasOwnProperty(U_)){var Y_=G_[U_];"theme"===U_?j_.darkColor.theme=G_.theme.slice():"highlight"===U_?j_.darkColor.highlight="rgba(255,231,130,0.4)":j_.darkColor[U_]=0===U_.indexOf("accent")?se(Y_,null,function(t){return.5*t},function(t){return Math.min(1,1.3-t)}):se(Y_,null,function(t){return.9*t},function(t){return 1-Math.pow(t,1.5)})}j_.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};const X_=j_;var q_="";"undefined"!=typeof navigator&&(q_=navigator.platform||"");var K_="rgba(0, 0, 0, 0.2)",$_=X_.color.theme[0],J_=se($_,null,null,.9);const Q_={darkMode:"auto",colorBy:"series",color:X_.color.theme,gradientColor:[J_,$_],aria:{decal:{decals:[{color:K_,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:K_,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:K_,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:K_,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:K_,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:K_,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:q_.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 tx,ex,nx,ix=B(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),ox="original",rx="arrayRows",ax="objectRows",sx="keyedColumns",lx="typedArray",ux="unknown",hx="column",cx="row",dx=1,px=2,fx=3,gx=Ln(),mx=B(),yx=Ln(),vx=(Ln(),function(){function t(){}return t.prototype.getColorFromPalette=function(t,e,n){var i=vn(this.get("color",!0)),o=this.get("colorLayer",!0);return function(t,e,n,i,o,r,a){var s=e(r=r||t),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(o))return u[o];var h=null!=a&&i?function(t,e){for(var n=t.length,i=0;ie)return t[i];return t[n-1]}(i,a):n;if((h=h||n)&&h.length){var c=h[l];return o&&(u[o]=c),s.paletteIdx=(l+1)%h.length,c}}(this,yx,i,o,t,e,n)},t.prototype.clearColorPalette=function(){!function(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}(this,yx)},t}()),_x="\0_ec_inner",xx=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.init=function(t,e,n,i,o,r){i=i||{},this.option=null,this._theme=new i_(i),this._locale=new i_(o),this._optionManager=r},n.prototype.setOption=function(t,e,n){var i=rr(e);this._optionManager.setOption(t,n,i),this._resetOption(null,i)},n.prototype.resetOption=function(t,e){return this._resetOption(t,rr(e))},n.prototype._resetOption=function(t,e){var n=!1,i=this._optionManager;if(!t||"recreate"===t){var o=i.mountOption("recreate"===t);this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(o,e)):nx(this,o),n=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var r=i.getTimelineOption(this);r&&(n=!0,this._mergeOption(r,e))}if(!t||"recreate"===t||"media"===t){var a=i.getMediaOption(this);a.length&&c(a,function(t){n=!0,this._mergeOption(t,e)},this)}return n},n.prototype.mergeOption=function(t){this._mergeOption(t,null)},n.prototype._mergeOption=function(t,e){var n=this.option,i=this._componentsMap,s=this._componentsCount,l=[],u=B(),h=e&&e.replaceMergeMainTypeMap;gx(this).datasetMap=B(),c(t,function(t,e){null!=t&&(W_.hasClass(e)?e&&(l.push(e),u.set(e,!0)):n[e]=null==n[e]?o(t):r(n[e],t,!0))}),h&&h.each(function(t,e){W_.hasClass(e)&&!u.get(e)&&(l.push(e),u.set(e,!0))}),W_.topologicalTravel(l,W_.getAllClassMainTypes(),function(e){var o=function(t,e,n){var i=mx.get(e);if(!i)return n;var o=i(t);return o?n.concat(o):n}(this,e,vn(t[e])),r=i.get(e),l=bn(r,o,r?h&&h.get(e)?"replaceMerge":"normalMerge":"replaceAll");!function(t,e,n){c(t,function(t){var i=t.newOption;b(i)&&(t.keyInfo.mainType=e,t.keyInfo.subType=function(t,e,n,i){return e.type?e.type:n?n.subType:i.determineSubType(t,e)}(e,i,t.existing,n))})}(l,e,W_),n[e]=null,i.set(e,null),s.set(e,0);var u,d=[],p=[],f=0;c(l,function(t,n){var i=t.existing,o=t.newOption;if(o){var r=W_.getClass(e,t.keyInfo.subType,!("series"===e));if(!r)return;if("tooltip"===e){if(u)return;u=!0}if(i&&i.constructor===r)i.name=t.keyInfo.name,i.mergeOption(o,this),i.optionUpdated(o,!1);else{var s=a({componentIndex:n},t.keyInfo);a(i=new r(o,this,this,s),s),t.brandNew&&(i.__requireNewView=!0),i.init(o,this,this),i.optionUpdated(null,!0)}}else i&&(i.mergeOption({},this),i.optionUpdated({},!1));i?(d.push(i.option),p.push(i),f++):(d.push(void 0),p.push(void 0))},this),n[e]=d,i.set(e,p),s.set(e,f),"series"===e&&tx(this)},this),this._seriesIndices||tx(this)},n.prototype.getOption=function(){var t=o(this.option);return c(t,function(e,n){if(W_.hasClass(n)){for(var i=vn(e),o=i.length,r=!1,a=o-1;a>=0;a--)i[a]&&!kn(i[a])?r=!0:(i[a]=null,!r&&o--);i.length=o,t[n]=i}}),delete t[_x],t},n.prototype.setTheme=function(t){this._theme=new i_(t),this._resetOption("recreate",null)},n.prototype.getTheme=function(){return this._theme},n.prototype.getLocaleModel=function(){return this._locale},n.prototype.setUpdatePayload=function(t){this._payload=t},n.prototype.getUpdatePayload=function(){return this._payload},n.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){var i=n[e||0];if(i)return i;if(null==e)for(var o=0;ou&&(u=p)}s[0]=l,s[1]=u}},o=function(){return this._data?this._data.length/this._dimSize:0};(e={})[rx+"_"+hx]={pure:!0,appendData:t},e[rx+"_"+cx]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[ax]={pure:!0,appendData:t},e[sx]={pure:!0,appendData:function(t){var e=this._data;c(t,function(t,n){for(var i=e[n]||(e[n]=[]),o=0;o<(t||[]).length;o++)i.push(t[o])})}},e[ox]={appendData:t},e[lx]={persistent:!1,pure:!0,appendData:function(t){this._data=t},clean:function(){this._offset+=this.count(),this._data=null}},Ax=e}(),t}(),Gx=function(t){y(t)||kr("series.data or dataset.source must be an array.")},Ux=((Ix={})[rx+"_"+hx]=Gx,Ix[rx+"_"+cx]=Gx,Ix[ax]=Gx,Ix[sx]=function(t,e){for(var n=0;n=0&&(s=r.interpolatedValue[l])}return null!=s?s+"":""}):void 0},t.prototype.getRawValue=function(t,e){return Or(this.getData(e),t)},t.prototype.formatTooltip=function(t,e,n){},t}(),tw=function(){function t(t){this._reset=(t=t||{}).reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return t.prototype.perform=function(t){function e(t){return!(t>=1)&&(t=1),t}var n,i=this._upstream,o=t&&t.skip;if(this._dirty&&i){var r=this.context;r.data=r.outputData=i.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!o&&(n=this._plan(this.context));var a,s=e(this._modBy),l=this._modDataCount||0,u=e(t&&t.modBy),h=t&&t.modDataCount||0;s===u&&l===h||(n="reset"),(this._dirty||"reset"===n)&&(this._dirty=!1,a=this._doReset(o)),this._modBy=u,this._modDataCount=h;var c=t&&t.step;if(this._dueEnd=i?i._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,p=Math.min(null!=c?this._dueIndex+c:1/0,this._dueEnd);if(!o&&(a||d=n?null:t1&&r>0?e:t}};return s}(),nw=(B({number:function(t){return parseFloat(t)},time:function(t){return+cn(t)},trim:function(t){return _(t)?z(t):t}}),function(){function t(t,e){var n="desc"===t;this._resultLT=n?1:-1,null==e&&(e=n?"min":"max"),this._incomparable="min"===e?-1/0:1/0}return t.prototype.evaluate=function(t,e){var n=w(t)?t:fn(t),i=w(e)?e:fn(e),o=isNaN(n),r=isNaN(i);if(o&&(n=this._incomparable),r&&(i=this._incomparable),o&&r){var a=_(t),s=_(e);a&&(n=s?t:0),s&&(i=a?e:0)}return ni?-this._resultLT:0},t}()),iw=function(){function t(){}return t.prototype.getRawData=function(){throw new Error("not supported")},t.prototype.getRawDataItem=function(t){throw new Error("not supported")},t.prototype.cloneRawData=function(){},t.prototype.getDimensionInfo=function(t){},t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},t.prototype.retrieveValue=function(t,e){},t.prototype.retrieveValueFromItem=function(t,e){},t.prototype.convertValue=function(t,e){return Rr(t,e)},t}(),ow=B(),rw="undefined",aw=typeof Uint32Array===rw?Array:Uint32Array,sw=typeof Uint16Array===rw?Array:Uint16Array,lw=typeof Int32Array===rw?Array:Int32Array,uw=typeof Float64Array===rw?Array:Float64Array,hw={float:uw,int:lw,ordinal:Array,number:Array,time:uw},cw=function(){function t(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=B()}return t.prototype.initData=function(t,e,n){this._provider=t,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var i=t.getSource(),o=this.defaultDimValueGetter=zx[i.sourceFormat];this._dimValueGetter=n||o,this._rawExtent=[],Cr(i),this._dimensions=d(e,function(t){return{type:t.type,property:t.property}}),this._initDataFromProvider(0,t.count())},t.prototype.getProvider=function(){return this._provider},t.prototype.getSource=function(){return this._provider.getSource()},t.prototype.ensureCalculationDimension=function(t,e){var n=this._calcDimNameToIdx,i=this._dimensions,o=n.get(t);if(null!=o){if(i[o].type===e)return o}else o=i.length;return i[o]={type:e},n.set(t,o),this._chunks[o]=new hw[e||"float"](this._rawCount),this._rawExtent[o]=[1/0,-1/0],o},t.prototype.collectOrdinalMeta=function(t,e){var n=this._chunks[t],i=this._dimensions[t],o=this._rawExtent,r=i.ordinalOffset||0,a=n.length;0===r&&(o[t]=[1/0,-1/0]);for(var s=o[t],l=r;lf[1]&&(f[1]=p)}return this._rawCount=this._count=s,{start:a,end:s}},t.prototype._initDataFromProvider=function(t,e,n){for(var i=this._provider,o=this._chunks,r=this._dimensions,a=r.length,s=this._rawExtent,l=d(r,function(t){return t.property}),u=0;uy[1]&&(y[1]=m)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=e,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(t,e){if(!(e>=0&&e=0&&e=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&nt))return r;o=r-1}}return-1},t.prototype.getIndices=function(){var t,e=this._indices;if(e){var n=this._count;if((o=e.constructor)===Array){t=new o(n);for(var i=0;i=u&&T<=h||isNaN(T))&&(a[s++]=p),p++;d=!0}else if(2===o){f=c[i[0]];var y=c[i[1]],v=t[i[1]][0],_=t[i[1]][1];for(m=0;m=u&&T<=h||isNaN(T))&&(x>=v&&x<=_||isNaN(x))&&(a[s++]=p),p++}d=!0}}if(!d)if(1===o)for(m=0;m=u&&T<=h||isNaN(T))&&(a[s++]=w)}else for(m=0;mt[M][1])&&(b=!1)}b&&(a[s++]=e.getRawIndex(m))}return sm[1]&&(m[1]=g)}}},t.prototype.lttbDownSample=function(t,e){var n,i,o,r=this.clone([t],!0),a=r._chunks[t],s=this.count(),l=0,u=Math.floor(1/e),h=this.getRawIndex(0),c=new(Wr(this._rawCount))(Math.min(2*(Math.ceil(s/u)+2),s));c[l++]=h;for(var d=1;dn&&(n=i,o=M)}T>0&&Ta&&(f=a-u);for(var g=0;gp&&(p=m,d=u+g)}var y=this.getRawIndex(h),v=this.getRawIndex(d);hu-p&&(a.length=s=u-p);for(var f=0;fh[1]&&(h[1]=m),c[d++]=y}return o._count=d,o._indices=c,o._updateGetRawIdx(),o},t.prototype.each=function(t,e){if(this._count)for(var n=t.length,i=this._chunks,o=0,r=this.count();oa&&(a=l)}return this._extent[t]=i=[r,a],i},t.prototype.getRawDataItem=function(t){var e=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(e);for(var n=[],i=this._chunks,o=0;o=0?this._indices[t]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=function(){function t(t,e,n,i){return Rr(t[i],this._dimensions[i])}zx={arrayRows:t,objectRows:function(t,e,n,i){return Rr(t[e],this._dimensions[i])},keyedColumns:t,original:function(t,e,n,i){var o=t&&(null==t.value?t:t.value);return Rr(o instanceof Array?o[i]:o,this._dimensions[i])},typedArray:function(t,e,n,i){return t[i]}}}(),t}();const dw=cw;var pw=function(){function t(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(t,e){this._sourceList=t,this._upstreamSignList=e,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var t,e,n=this._sourceHost,i=this._getUpstreamSourceManagers(),o=!!i.length;if(Yr(n)){var r=n,a=void 0,s=void 0,l=void 0;if(o){var u=i[0];u.prepareSource(),a=(l=u.getSource()).data,s=l.sourceFormat,e=[u._getVersionSign()]}else s=T(a=r.get("data",!0))?lx:ox,e=[];var h=this._getSourceMetaRawOption()||{},c=l&&l.metaRawOption||{},d=L(h.seriesLayoutBy,c.seriesLayoutBy)||null,p=L(h.sourceHeader,c.sourceHeader),f=L(h.dimensions,c.dimensions);t=d!==c.seriesLayoutBy||!!p!=!!c.sourceHeader||f?[wr(a,{seriesLayoutBy:d,sourceHeader:p,dimensions:f},s)]:[]}else{var g=n;if(o){var m=this._applyTransform(i);t=m.sourceList,e=m.upstreamSignList}else t=[wr(g.get("source",!0),this._getSourceMetaRawOption(),null)],e=[]}this._setLocalSource(t,e)},t.prototype._applyTransform=function(t){var e,n=this._sourceHost,i=n.get("transform",!0),r=n.get("fromTransformResult",!0);null!=r&&1!==t.length&&Xr("");var a,s=[],l=[];return c(t,function(t){t.prepareSource();var e=t.getSource(r||0);null==r||e||Xr(""),s.push(e),l.push(t._getVersionSign())}),i?e=function(t,e){var n=vn(t),i=n.length;i||Ir("");for(var o=0,r=i;o':'':{renderMode:r,content:"{"+(n.markerId||"markerX")+"|} ",style:"subItem"===o?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}:""}({color:e,type:t,renderMode:n,markerId:i});return _(o)?o:(this.richTextStyles[i]=o.style,o.content)},t.prototype.wrapRichTextStyle=function(t,e){var n={};y(e)?c(e,function(t){return a(n,t)}):a(n,e);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},t}(),yw=Ln(),vw=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._selectedDataIndicesMap={},e}var i;return e(n,t),n.prototype.init=function(t,e,n){this.seriesIndex=this.componentIndex,this.dataTask=Er({count:ha,reset:ca}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,n),(yw(this).sourceManager=new pw(this)).prepareSource();var i=this.getInitialData(t,n);pa(i,this),this.dataTask.context.data=i,yw(this).dataBeforeProcessed=i,ua(this),this._initSelectedMapFromData(i)},n.prototype.mergeDefaultAndTheme=function(t,e){var n=Ko(this),i=n?Jo(t):{},o=this.subType;W_.hasClass(o)&&(o+="Series"),r(t,e.getTheme().get(this.subType)),r(t,this.getDefaultOption()),_n(t,"label",["show"]),this.fillDataTextStyle(t.data),n&&$o(t,i,n)},n.prototype.mergeOption=function(t,e){t=r(this.option,t,!0),this.fillDataTextStyle(t.data);var n=Ko(this);n&&$o(this.option,t,n);var i=yw(this).sourceManager;i.dirty(),i.prepareSource();var o=this.getInitialData(t,e);pa(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,yw(this).dataBeforeProcessed=o,ua(this),this._initSelectedMapFromData(o)},n.prototype.fillDataTextStyle=function(t){if(t&&!T(t))for(var e=["show"],n=0;n=0&&h<0)&&(u=r,h=o,c=0),o===h&&(l[c++]=e))}),l.length=c,l},n.prototype.formatTooltip=function(t,e,n){return sa({series:this,dataIndex:t,multipleSeries:e})},n.prototype.isAnimationEnabled=function(){var t=this.ecModel;if(Qp.node&&(!t||!t.ssr))return!1;var e=this.getShallow("animation");return e&&this.getData().count()>this.getShallow("animationThreshold")&&(e=!1),!!e},n.prototype.restoreData=function(){this.dataTask.dirty()},n.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel,o=vx.prototype.getColorFromPalette.call(this,t,e,n);return o||(o=i.getColorFromPalette(t,e,n)),o},n.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},n.prototype.getProgressive=function(){return this.get("progressive")},n.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},n.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},n.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n){var i=this.option.selectedMode,o=this.getData(e);if("series"===i||"all"===n)return this.option.selectedMap={},void(this._selectedDataIndicesMap={});for(var r=0;r=0&&n.push(o)}return n},n.prototype.isSelected=function(t,e){var n=this.option.selectedMap;if(!n)return!1;var i=this.getData(e);return("all"===n||n[la(i,t)])&&!i.getItemModel(t).get(["select","disabled"])},n.prototype.isUniversalTransitionEnabled=function(){if(this.__universalTransitionEnabled)return!0;var t=this.option.universalTransition;return!!t&&(!0===t||t&&t.enabled)},n.prototype._innerSelect=function(t,e){var n,i,o=this.option,r=o.selectedMode,a=e.length;if(r&&a)if("series"===r)o.selectedMap="all";else if("multiple"===r){b(o.selectedMap)||(o.selectedMap={});for(var s=o.selectedMap,l=0;l0&&this._innerSelect(t,e)}},n.registerClass=function(t){return W_.registerClass(t)},n.protoInitialize=((i=n.prototype).type="series.__base__",i.seriesIndex=0,i.ignoreStyleOnData=!1,i.hasSymbolVisual=!1,i.defaultSymbol="circle",i.visualStyleAccessPath="itemStyle",void(i.visualDrawType="fill")),n}(W_);u(vw,Qx),u(vw,vx),Rn(vw,W_);const _w=vw;var xw=function(){function t(){this.group=new Em,this.uid=mo("viewComponent")}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,i){},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,i){},t.prototype.updateLayout=function(t,e,n,i){},t.prototype.updateVisual=function(t,e,n,i){},t.prototype.toggleBlurSeries=function(t,e,n){},t.prototype.eachRendered=function(t){var e=this.group;e&&e.traverse(t)},t}();En(xw),Fn(xw);const ww=xw;var bw=Yy.CMD,Sw=[[],[],[]],Tw=Math.sqrt,Mw=Math.atan2,Cw=Math.sqrt,kw=Math.sin,Iw=Math.cos,Lw=Math.PI,Pw=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Dw=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g,Aw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return W(e,t),e.prototype.applyTransform=function(t){},e}(ov),Ow=function(){this.cx=0,this.cy=0,this.r=0},zw=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new Ow},e.prototype.buildPath=function(t,e){t.moveTo(e.cx+e.r,e.cy),t.arc(e.cx,e.cy,e.r,0,2*Math.PI)},e}(ov);zw.prototype.type="circle";const Ew=zw;var Rw=function(){this.cx=0,this.cy=0,this.rx=0,this.ry=0},Bw=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new Rw},e.prototype.buildPath=function(t,e){var n=.5522848,i=e.cx,o=e.cy,r=e.rx,a=e.ry,s=r*n,l=a*n;t.moveTo(i-r,o),t.bezierCurveTo(i-r,o-l,i-s,o-a,i,o-a),t.bezierCurveTo(i+s,o-a,i+r,o-l,i+r,o),t.bezierCurveTo(i+r,o+l,i+s,o+a,i,o+a),t.bezierCurveTo(i-s,o+a,i-r,o+l,i-r,o),t.closePath()},e}(ov);Bw.prototype.type="ellipse";const Nw=Bw;var Fw=Math.PI,Vw=2*Fw,Zw=Math.sin,Hw=Math.cos,Ww=Math.acos,jw=Math.atan2,Gw=Math.abs,Uw=Math.sqrt,Yw=Math.max,Xw=Math.min,qw=1e-4,Kw=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0},$w=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new Kw},e.prototype.buildPath=function(t,e){!function(t,e){var n,i=Yw(e.r,0),o=Yw(e.r0||0,0),r=i>0;if(r||o>0){if(r||(i=o,o=0),o>i){var a=i;i=o,o=a}var s=e.startAngle,l=e.endAngle;if(!isNaN(s)&&!isNaN(l)){var u=e.cx,h=e.cy,c=!!e.clockwise,d=Gw(l-s),p=d>Vw&&d%Vw;if(p>qw&&(d=p),i>qw)if(d>Vw-qw)t.moveTo(u+i*Hw(s),h+i*Zw(s)),t.arc(u,h,i,s,l,!c),o>qw&&(t.moveTo(u+o*Hw(l),h+o*Zw(l)),t.arc(u,h,o,l,s,c));else{var f=void 0,g=void 0,m=void 0,v=void 0,_=void 0,x=void 0,w=void 0,b=void 0,S=void 0,T=void 0,M=void 0,C=void 0,k=void 0,I=void 0,L=void 0,P=void 0,D=i*Hw(s),A=i*Zw(s),O=o*Hw(l),z=o*Zw(l),E=d>qw;if(E){var R=e.cornerRadius;R&&(n=function(t){var e;if(y(t)){var n=t.length;if(!n)return t;e=1===n?[t[0],t[0],0,0]:2===n?[t[0],t[0],t[1],t[1]]:3===n?t.concat(t[2]):t}else e=[t,t,t,t];return e}(R),f=n[0],g=n[1],m=n[2],v=n[3]);var B=Gw(i-o)/2;if(_=Xw(B,m),x=Xw(B,v),w=Xw(B,f),b=Xw(B,g),M=S=Yw(_,x),C=T=Yw(w,b),(S>qw||T>qw)&&(k=i*Hw(l),I=i*Zw(l),L=o*Hw(s),P=o*Zw(s),dqw){var G=Xw(m,M),U=Xw(v,M),Y=Sa(L,P,D,A,i,G,c),X=Sa(k,I,O,z,i,U,c);t.moveTo(u+Y.cx+Y.x0,h+Y.cy+Y.y0),M0&&t.arc(u+Y.cx,h+Y.cy,G,jw(Y.y0,Y.x0),jw(Y.y1,Y.x1),!c),t.arc(u,h,i,jw(Y.cy+Y.y1,Y.cx+Y.x1),jw(X.cy+X.y1,X.cx+X.x1),!c),U>0&&t.arc(u+X.cx,h+X.cy,U,jw(X.y1,X.x1),jw(X.y0,X.x0),!c))}else t.moveTo(u+D,h+A),t.arc(u,h,i,s,l,!c);else t.moveTo(u+D,h+A);o>qw&&E?C>qw?(G=Xw(f,C),Y=Sa(O,z,k,I,o,-(U=Xw(g,C)),c),X=Sa(D,A,L,P,o,-G,c),t.lineTo(u+Y.cx+Y.x0,h+Y.cy+Y.y0),C0&&t.arc(u+Y.cx,h+Y.cy,U,jw(Y.y0,Y.x0),jw(Y.y1,Y.x1),!c),t.arc(u,h,o,jw(Y.cy+Y.y1,Y.cx+Y.x1),jw(X.cy+X.y1,X.cx+X.x1),c),G>0&&t.arc(u+X.cx,h+X.cy,G,jw(X.y1,X.x1),jw(X.y0,X.x0),!c))):(t.lineTo(u+O,h+z),t.arc(u,h,o,l,s,c)):t.lineTo(u+O,h+z)}else t.moveTo(u,h);t.closePath()}}}(t,e)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(ov);$w.prototype.type="sector";const Jw=$w;var Qw=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},tb=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new Qw},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,o=2*Math.PI;t.moveTo(n+e.r,i),t.arc(n,i,e.r,0,o,!1),t.moveTo(n+e.r0,i),t.arc(n,i,e.r0,0,o,!0)},e}(ov);tb.prototype.type="ring";const eb=tb;var nb=function(){this.points=null,this.smooth=0,this.smoothConstraint=null},ib=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new nb},e.prototype.buildPath=function(t,e){Ta(t,e,!0)},e}(ov);ib.prototype.type="polygon";const ob=ib;var rb=function(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null},ab=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new rb},e.prototype.buildPath=function(t,e){Ta(t,e,!1)},e}(ov);ab.prototype.type="polyline";const sb=ab;var lb={},ub=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},hb=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new ub},e.prototype.buildPath=function(t,e){var n,i,o,r;if(this.subPixelOptimize){var a=vi(lb,e,this.style);n=a.x1,i=a.y1,o=a.x2,r=a.y2}else n=e.x1,i=e.y1,o=e.x2,r=e.y2;var s=e.percent;0!==s&&(t.moveTo(n,i),s<1&&(o=n*(1-s)+o*s,r=i*(1-s)+r*s),t.lineTo(o,r))},e.prototype.pointAt=function(t){var e=this.shape;return[e.x1*(1-t)+e.x2*t,e.y1*(1-t)+e.y2*t]},e}(ov);hb.prototype.type="line";const cb=hb;var db=[],pb=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1},fb=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new pb},e.prototype.buildPath=function(t,e){var n=e.x1,i=e.y1,o=e.x2,r=e.y2,a=e.cpx1,s=e.cpy1,l=e.cpx2,u=e.cpy2,h=e.percent;0!==h&&(t.moveTo(n,i),null==l||null==u?(h<1&&(Yt(n,a,o,h,db),a=db[1],o=db[2],Yt(i,s,r,h,db),s=db[1],r=db[2]),t.quadraticCurveTo(a,s,o,r)):(h<1&&(Ht(n,a,l,o,h,db),a=db[1],l=db[2],o=db[3],Ht(i,s,u,r,h,db),s=db[1],u=db[2],r=db[3]),t.bezierCurveTo(a,s,l,u,o,r)))},e.prototype.pointAt=function(t){return Ma(this.shape,t,!1)},e.prototype.tangentAt=function(t){var e=Ma(this.shape,t,!0);return Q(e,e)},e}(ov);fb.prototype.type="bezier-curve";const gb=fb;var mb=function(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},yb=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new mb},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,o=Math.max(e.r,0),r=e.startAngle,a=e.endAngle,s=e.clockwise,l=Math.cos(r),u=Math.sin(r);t.moveTo(l*o+n,u*o+i),t.arc(n,i,o,r,a,!s)},e}(ov);yb.prototype.type="arc";const vb=yb;var _b=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="compound",e}return W(e,t),e.prototype._updatePathDirty=function(){for(var t=this.shape.paths,e=this.shapeChanged(),n=0;nLb[1]){if(o=!1,Pb.negativeSize||n)return o;var s=kb(Lb[0]-Ib[1]),l=kb(Ib[0]-Lb[1]);Mb(s,l)>Ab.len()&&Gf.scale(Ab,a,s=l||!Pb.bidirectional)&&(Gf.scale(Db,a,-l*i),Pb.useDir&&Pb.calcDirMTV())))}return o},t.prototype._getProjMinMaxOnAxis=function(t,e,n){for(var i=this._axes[t],o=this._origin,r=e[0].dot(i)+o[t],a=r,s=r,l=1;ln.blockIndex?n.step:null,r=i&&i.modDataCount;return{step:o,modBy:null!=r?Math.ceil(r/o):null,modDataCount:r}}},t.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},t.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData().count(),o=n.progressiveEnabled&&e.incrementalPrepareRender&&i>=n.threshold,r=t.get("large")&&i>=t.get("largeThreshold"),a="mod"===t.get("progressiveChunkMode")?i:null;t.pipelineContext=n.context={progressiveRender:o,modDataCount:a,large:r}},t.prototype.restorePipelines=function(t){var e=this,n=e._pipelineMap=B();t.eachSeries(function(t){var i=t.getProgressive(),o=t.uid;n.set(o,{id:o,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:i&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),e._pipe(t,t.dataTask)})},t.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.api.getModel(),n=this.api;c(this._allHandlers,function(i){var o=t.get(i.uid)||t.set(i.uid,{});O(!(i.reset&&i.overallReset),""),i.reset&&this._createSeriesStageTask(i,o,e,n),i.overallReset&&this._createOverallStageTask(i,o,e,n)},this)},t.prototype.prepareView=function(t,e,n,i){var o=t.renderTask,r=o.context;r.model=e,r.ecModel=n,r.api=i,o.__block=!t.incrementalPrepareRender,this._pipe(e,o)},t.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},t.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},t.prototype._performStageTasks=function(t,e,n,i){function o(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}i=i||{};var r=!1,a=this;c(t,function(t,s){if(!i.visualType||i.visualType===t.visualType){var l=a._stageTaskMap.get(t.uid),u=l.seriesTaskMap,h=l.overallTask;if(h){var c,d=h.agentStubMap;d.each(function(t){o(i,t)&&(t.dirty(),c=!0)}),c&&h.dirty(),a.updatePayload(h,n);var p=a.getPerformArgs(h,i.block);d.each(function(t){t.perform(p)}),h.perform(p)&&(r=!0)}else u&&u.each(function(s,l){o(i,s)&&s.dirty();var u=a.getPerformArgs(s,i.block);u.skip=!t.performRawSeries&&e.isSeriesFiltered(s.context.model),a.updatePayload(s,n),s.perform(u)&&(r=!0)})}}),this.unfinished=r||this.unfinished},t.prototype.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e=t.dataTask.perform()||e}),this.unfinished=e||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)})},t.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},t.prototype._createSeriesStageTask=function(t,e,n,i){function o(e){var o=e.uid,l=s.set(o,a&&a.get(o)||Er({plan:Cs,reset:ks,count:Ls}));l.context={model:e,ecModel:n,api:i,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:r},r._pipe(e,l)}var r=this,a=e.seriesTaskMap,s=e.seriesTaskMap=B(),l=t.seriesType,u=t.getTargetSeries;t.createOnAllSeries?n.eachRawSeries(o):l?n.eachRawSeriesByType(l,o):u&&u(n,i).each(o)},t.prototype._createOverallStageTask=function(t,e,n,i){function o(t){var e=t.uid,n=l.set(e,s&&s.get(e)||(p=!0,Er({reset:Ss,onDirty:Ms})));n.context={model:t,overallProgress:d},n.agent=a,n.__block=d,r._pipe(t,n)}var r=this,a=e.overallTask=e.overallTask||Er({reset:bs});a.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:r};var s=a.agentStubMap,l=a.agentStubMap=B(),u=t.seriesType,h=t.getTargetSeries,d=!0,p=!1;O(!t.createOnAllSeries,""),u?n.eachRawSeriesByType(u,o):h?h(n,i).each(o):(d=!1,c(n.getSeries(),o)),p&&a.dirty()},t.prototype._pipe=function(t,e){var n=this._pipelineMap.get(t.uid);!n.head&&(n.head=e),n.tail&&n.tail.pipe(e),n.tail=e,e.__idxInPipeline=n.count++,e.__pipeline=n},t.wrapStageHandler=function(t,e){return v(t)&&(t={overallReset:t,seriesType:Ps(t)}),t.uid=mo("stageHandler"),e&&(t.visualType=e),t},t}(),hS=Is(0),cS={},dS={};Ds(cS,bx),Ds(dS,Tx),cS.eachSeriesByType=cS.eachRawSeriesByType=function(t){$b=t},cS.eachComponent=function(t){"series"===t.mainType&&t.subType&&($b=t.subType)};const pS=uS;var fS,gS=X_.darkColor,mS=function(){return{axisLine:{lineStyle:{color:gS.axisLine}},splitLine:{lineStyle:{color:gS.axisSplitLine}},splitArea:{areaStyle:{color:[gS.backgroundTint,gS.backgroundTransparent]}},minorSplitLine:{lineStyle:{color:gS.axisMinorSplitLine}},axisLabel:{color:gS.axisLabel},axisName:{}}},yS={label:{color:gS.secondary},itemStyle:{borderColor:gS.borderTint},dividerLineStyle:{color:gS.border}},vS={darkMode:!0,color:gS.theme,backgroundColor:gS.background,axisPointer:{lineStyle:{color:gS.border},crossStyle:{color:gS.borderShade},label:{color:gS.tertiary}},legend:{textStyle:{color:gS.secondary},pageTextStyle:{color:gS.tertiary}},textStyle:{color:gS.secondary},title:{textStyle:{color:gS.primary},subtextStyle:{color:gS.quaternary}},toolbox:{iconStyle:{borderColor:gS.accent50}},tooltip:{backgroundColor:gS.neutral20,defaultBorderColor:gS.border,textStyle:{color:gS.tertiary}},dataZoom:{borderColor:gS.accent10,textStyle:{color:gS.tertiary},brushStyle:{color:gS.backgroundTint},handleStyle:{color:gS.neutral00,borderColor:gS.accent20},moveHandleStyle:{color:gS.accent40},emphasis:{handleStyle:{borderColor:gS.accent50}},dataBackground:{lineStyle:{color:gS.accent30},areaStyle:{color:gS.accent20}},selectedDataBackground:{lineStyle:{color:gS.accent50},areaStyle:{color:gS.accent30}}},visualMap:{textStyle:{color:gS.secondary},handleStyle:{borderColor:gS.neutral30}},timeline:{lineStyle:{color:gS.accent10},label:{color:gS.tertiary},controlStyle:{color:gS.accent30,borderColor:gS.accent30}},calendar:{itemStyle:{color:gS.neutral00,borderColor:gS.neutral20},dayLabel:{color:gS.tertiary},monthLabel:{color:gS.secondary},yearLabel:{color:gS.secondary}},matrix:{x:yS,y:yS,backgroundColor:{borderColor:gS.axisLine},body:{itemStyle:{borderColor:gS.borderTint}}},timeAxis:mS(),logAxis:mS(),valueAxis:mS(),categoryAxis:mS(),line:{symbol:"circle"},graph:{color:gS.theme},gauge:{title:{color:gS.secondary},axisLine:{lineStyle:{color:[[1,gS.neutral05]]}},axisLabel:{color:gS.axisLabel},detail:{color:gS.primary}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}},funnel:{itemStyle:{borderColor:gS.background}},radar:(fS=mS(),fS.axisName={color:gS.axisLabel},fS.axisLine.lineStyle.color=gS.neutral20,fS),treemap:{breadcrumb:{itemStyle:{color:gS.neutral20,textStyle:{color:gS.secondary}},emphasis:{itemStyle:{color:gS.neutral30}}}},sunburst:{itemStyle:{borderColor:gS.background}},map:{itemStyle:{borderColor:gS.border,areaColor:gS.neutral10},label:{color:gS.tertiary},emphasis:{label:{color:gS.primary},itemStyle:{areaColor:gS.highlight}},select:{label:{color:gS.primary},itemStyle:{areaColor:gS.highlight}}},geo:{itemStyle:{borderColor:gS.border,areaColor:gS.neutral10},emphasis:{label:{color:gS.primary},itemStyle:{areaColor:gS.highlight}},select:{label:{color:gS.primary},itemStyle:{color:gS.highlight}}}};vS.categoryAxis.splitLine.show=!1;const _S=vS;var xS=function(){function t(){}return t.prototype.normalizeQuery=function(t){var e={},n={},i={};if(_(t)){var o=zn(t);e.mainType=o.main||null,e.subType=o.sub||null}else{var r=["Index","Name","Id"],a={name:1,dataIndex:1,dataType:1};c(t,function(t,o){for(var s=!1,l=0;l0&&h===o.length-u.length){var c=o.slice(0,h);"data"!==c&&(e.mainType=c,e[u.toLowerCase()]=t,s=!0)}}a.hasOwnProperty(o)&&(n[o]=t,s=!0),s||(i[o]=t)})}return{cptQuery:e,dataQuery:n,otherQuery:i}},t.prototype.filter=function(t,e){function n(t,e,n,i){return null==t[n]||e[i||n]===t[n]}var i=this.eventInfo;if(!i)return!0;var o=i.targetEl,r=i.packedEvent,a=i.model,s=i.view;if(!a||!s)return!0;var l=e.cptQuery,u=e.dataQuery;return n(l,a,"mainType")&&n(l,a,"subType")&&n(l,a,"index","componentIndex")&&n(l,a,"name")&&n(l,a,"id")&&n(u,r,"name")&&n(u,r,"dataIndex")&&n(u,r,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(t,e.otherQuery,o,r))},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),wS=["symbol","symbolSize","symbolRotate","symbolOffset"],bS=wS.concat(["symbolKeepAspect"]),SS={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData();if(t.legendIcon&&n.setVisual("legendIcon",t.legendIcon),t.hasSymbolVisual){for(var i={},o={},r=!1,s=0;s0&&t.unfinished);t.unfinished||this._zr.flush()}}},n.prototype.getDom=function(){return this._dom},n.prototype.getId=function(){return this.id},n.prototype.getZr=function(){return this._zr},n.prototype.isSSR=function(){return this._ssr},n.prototype.setOption=function(t,e,n){if(!this[dT])if(this._disposed);else{var i,o,r;if(b(e)&&(n=e.lazyUpdate,i=e.silent,o=e.replaceMerge,r=e.transition,e=e.notMerge),this[dT]=!0,sT(this),!this._model||e){var a=new kx(this._api),s=this._theme,l=this._model=new bx;l.scheduler=this._scheduler,l.ssr=this._ssr,l.init(null,null,null,s,this._locale,a)}this._model.setOption(t,{replaceMerge:o},kT);var u={seriesTransition:r,optionChanged:!0};if(n)this[fT]={silent:i,updateParams:u},this[dT]=!1,this.getZr().wakeUp();else{try{WS(this),US.update.call(this,null,u)}catch(t){throw this[fT]=null,this[dT]=!1,t}this._ssr||this._zr.flush(),this[fT]=null,this[dT]=!1,KS.call(this,i),$S.call(this,i)}}},n.prototype.setTheme=function(t,e){if(!this[dT])if(this._disposed);else{var n=this._model;if(n){var i=e&&e.silent,o=null;this[fT]&&(null==i&&(i=this[fT].silent),o=this[fT].updateParams,this[fT]=null),this[dT]=!0,sT(this);try{this._updateTheme(t),n.setTheme(this._theme),WS(this),US.update.call(this,{type:"setTheme"},o)}catch(t){throw this[dT]=!1,t}this[dT]=!1,KS.call(this,i),$S.call(this,i)}}},n.prototype._updateTheme=function(t){_(t)&&(t=LT[t]),t&&((t=o(t))&&_r(t,!0),this._theme=t)},n.prototype.getModel=function(){return this._model},n.prototype.getOption=function(){return this._model&&this._model.getOption()},n.prototype.getWidth=function(){return this._zr.getWidth()},n.prototype.getHeight=function(){return this._zr.getHeight()},n.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||Qp.hasGlobalWindow&&window.devicePixelRatio||1},n.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},n.prototype.renderToCanvas=function(t){return this._zr.painter.getRenderedCanvas({backgroundColor:(t=t||{}).backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},n.prototype.renderToSVGString=function(t){return this._zr.painter.renderToString({useViewBox:(t=t||{}).useViewBox})},n.prototype.getSvgDataURL=function(){var t=this._zr;return c(t.storage.getDisplayList(),function(t){t.stopAnimation(null,!0)}),t.painter.toDataURL()},n.prototype.getDataURL=function(t){if(!this._disposed){var e=this._model,n=[],i=this;c((t=t||{}).excludeComponents,function(t){e.eachComponent({mainType:t},function(t){var e=i._componentsMap[t.__viewId];e.group.ignore||(n.push(e),e.group.ignore=!0)})});var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return c(n,function(t){t.group.ignore=!1}),o}},n.prototype.getConnectedDataURL=function(t){if(!this._disposed){var e="svg"===t.type,n=this.group,i=Math.min,r=Math.max,a=1/0;if(AT[n]){var s=a,l=a,u=-1/0,h=-1/0,d=[],p=t&&t.pixelRatio||this.getDevicePixelRatio();c(DT,function(a,c){if(a.group===n){var p=e?a.getZr().painter.getSvgDom().innerHTML:a.renderToCanvas(o(t)),f=a.getDom().getBoundingClientRect();s=i(f.left,s),l=i(f.top,l),u=r(f.right,u),h=r(f.bottom,h),d.push({dom:p,left:f.left,top:f.top})}});var f=(u*=p)-(s*=p),g=(h*=p)-(l*=p),m=af.createCanvas(),y=en(m,{renderer:e?"svg":"canvas"});if(y.resize({width:f,height:g}),e){var v="";return c(d,function(t){v+=''+t.dom+""}),y.painter.getSvgRoot().innerHTML=v,t.connectedBackgroundColor&&y.painter.setBackgroundColor(t.connectedBackgroundColor),y.refreshImmediately(),y.painter.toDataURL()}return t.connectedBackgroundColor&&y.add(new mv({shape:{x:0,y:0,width:f,height:g},style:{fill:t.connectedBackgroundColor}})),c(d,function(t){var e=new cv({style:{x:t.left*p-s,y:t.top*p-l,image:t.dom}});y.add(e)}),y.refreshImmediately(),m.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}},n.prototype.convertToPixel=function(t,e,n){return YS(this,"convertToPixel",t,e,n)},n.prototype.convertToLayout=function(t,e,n){return YS(this,"convertToLayout",t,e,n)},n.prototype.convertFromPixel=function(t,e,n){return YS(this,"convertFromPixel",t,e,n)},n.prototype.containPixel=function(t,e){var n;if(!this._disposed)return c(Pn(this._model,t),function(t,i){i.indexOf("Models")>=0&&c(t,function(t){var o=t.coordinateSystem;if(o&&o.containPoint)n=n||!!o.containPoint(e);else if("seriesModels"===i){var r=this._chartsMap[t.__viewId];r&&r.containPoint&&(n=n||r.containPoint(e,t))}},this)},this),!!n},n.prototype.getVisual=function(t,e){var n=Pn(this._model,t,{defaultMainType:"series"}),i=n.seriesModel.getData(),o=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?i.indexOfRawIndex(n.dataIndex):null;return null!=o?function(t,e,n){switch(n){case"color":return t.getItemVisual(e,"style")[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,n)}}(i,o,e):function(t,e){switch(e){case"color":return t.getVisual("style")[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e)}}(i,e)},n.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},n.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},n.prototype._initEvents=function(){var t=this;c(bT,function(e){var n=function(n){var i,o=t.getModel(),r=n.target;if("globalout"===e?i={}:r&&Os(r,function(t){var e=Mv(t);if(e&&null!=e.dataIndex){var n=e.dataModel||o.getSeriesByIndex(e.seriesIndex);return i=n&&n.getDataParams(e.dataIndex,e.dataType,r)||{},!0}if(e.eventData)return i=a({},e.eventData),!0},!0),i){var s=i.componentType,l=i.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=i.seriesIndex);var u=s&&null!=l&&o.getComponent(s,l),h=u&&t["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];i.event=n,i.type=e,t._$eventProcessor.eventInfo={targetEl:r,packedEvent:i,model:u,view:h},t.trigger(e,i)}};n.zrEventfulCallAtLast=!0,t._zr.on(e,n,t)});var e=this._messageCenter;c(MT,function(n,i){e.on(i,function(e){t.trigger(i,e)})}),function(t,e,n){t.on("selectchanged",function(t){var i=n.getModel();t.isFromClick?(As("map","selectchanged",e,i,t),As("pie","selectchanged",e,i,t)):"select"===t.fromAction?(As("map","selected",e,i,t),As("pie","selected",e,i,t)):"unselect"===t.fromAction&&(As("map","unselected",e,i,t),As("pie","unselected",e,i,t))})}(e,this,this._api)},n.prototype.isDisposed=function(){return this._disposed},n.prototype.clear=function(){this._disposed||this.setOption({series:[]},!0)},n.prototype.dispose=function(){if(this._disposed);else{this._disposed=!0,this.getDom()&&On(this.getDom(),zT,"");var t=this,e=t._api,n=t._model;c(t._componentsViews,function(t){t.dispose(n,e)}),c(t._chartsViews,function(t){t.dispose(n,e)}),t._zr.dispose(),t._dom=t._model=t._chartsMap=t._componentsMap=t._chartsViews=t._componentsViews=t._scheduler=t._api=t._zr=t._throttledZrFlush=t._theme=t._coordSysMgr=t._messageCenter=null,delete DT[t.id]}},n.prototype.resize=function(t){if(!this[dT])if(this._disposed);else{this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var n=e.resetOption("media"),i=t&&t.silent;this[fT]&&(null==i&&(i=this[fT].silent),n=!0,this[fT]=null),this[dT]=!0,sT(this);try{n&&WS(this),US.update.call(this,{type:"resize",animation:a({duration:0},t&&t.animation)})}catch(t){throw this[dT]=!1,t}this[dT]=!1,KS.call(this,i),$S.call(this,i)}}},n.prototype.showLoading=function(t,e){if(this._disposed);else if(b(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),PT[t]){var n=PT[t](this._api,e),i=this._zr;this._loadingFX=n,i.add(n)}},n.prototype.hideLoading=function(){this._disposed||(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},n.prototype.makeActionFromEvent=function(t){var e=a({},t);return e.type=TT[t.type],e},n.prototype.dispatchAction=function(t,e){if(this._disposed);else if(b(e)||(e={silent:!!e}),ST[t.type]&&this._model)if(this[dT])this._pendingActions.push(t);else{var n=e.silent;qS.call(this,t,n);var i=e.flush;i?this._zr.flush():!1!==i&&Qp.browser.weChat&&this._throttledZrFlush(),KS.call(this,n),$S.call(this,n)}},n.prototype.updateLabelLayout=function(){HS.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},n.prototype.appendData=function(t){if(this._disposed);else{var e=t.seriesIndex;this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},n.internalField=function(){function t(t){t.clearColorPalette(),t.eachSeries(function(t){t.clearColorPalette()})}function n(t){for(var e=[],n=t.currentStates,i=0;i0?{duration:r,delay:i.get("delay"),easing:i.get("easing")}:null;e.eachRendered(function(t){if(t.states&&t.states.emphasis){if(Pa(t))return;if(t instanceof ov&&function(t){var e=Iv(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var n=t.states.select||{};e.selectFill=n.style&&n.style.fill||null,e.selectStroke=n.style&&n.style.stroke||null}(t),t.__dirty){var e=t.prevStates;e&&t.useStates(e)}if(o){t.stateTransition=a;var i=t.getTextContent(),r=t.getTextGuideLine();i&&(i.stateTransition=a),r&&(r.stateTransition=a)}t.__dirty&&n(t)}})}WS=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),jS(t,!0),jS(t,!1),e.plan()},jS=function(t,e){function n(t){var n=t.__requireNewView;t.__requireNewView=!1;var u="_ec_"+t.id+"_"+t.type,h=!n&&a[u];if(!h){var c=zn(t.type);(h=new(e?ww.getClass(c.main,c.sub):Kb.getClass(c.sub))).init(i,l),a[u]=h,r.push(h),s.add(h.group)}t.__viewId=h.__id=u,h.__alive=!0,h.__model=t,h.group.__ecComponentInfo={mainType:t.mainType,index:t.componentIndex},!e&&o.prepareView(h,t,i,l)}for(var i=t._model,o=t._scheduler,r=e?t._componentsViews:t._chartsViews,a=e?t._componentsMap:t._chartsMap,s=t._zr,l=t._api,u=0;ue.get("hoverLayerThreshold")&&!Qp.node&&!Qp.worker&&e.eachSeries(function(e){if(!e.preventUsingHoverLayer){var n=t._chartsMap[e.__viewId];n.__alive&&n.eachRendered(function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)})}})}(t,e),HS.trigger("series:afterupdate",e,n,l)},rT=function(t){t[gT]=!0,t.getZr().wakeUp()},sT=function(t){t[pT]=(t[pT]+1)%1e3},aT=function(t){t[gT]&&(t.getZr().storage.traverse(function(t){Pa(t)||n(t)}),t[gT]=!1)},iT=function(t){return new(function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return e(i,n),i.prototype.getCoordinateSystems=function(){return t._coordSysMgr.getCoordinateSystems()},i.prototype.getComponentByElement=function(e){for(;e;){var n=e.__ecComponentInfo;if(null!=n)return t._model.getComponent(n.mainType,n.index);e=e.parent}},i.prototype.enterEmphasis=function(e,n){ji(e,n),rT(t)},i.prototype.leaveEmphasis=function(e,n){Gi(e,n),rT(t)},i.prototype.enterBlur=function(e){!function(t){Fi(t,zi)}(e),rT(t)},i.prototype.leaveBlur=function(e){Ui(e),rT(t)},i.prototype.enterSelect=function(e){Yi(e),rT(t)},i.prototype.leaveSelect=function(e){Xi(e),rT(t)},i.prototype.getModel=function(){return t.getModel()},i.prototype.getViewOfComponentModel=function(e){return t.getViewOfComponentModel(e)},i.prototype.getViewOfSeriesModel=function(e){return t.getViewOfSeriesModel(e)},i.prototype.getMainProcessVersion=function(){return t[pT]},i}(Tx))(t)},oT=function(t){function e(t,e){for(var n=0;n0?t[n-1].seriesModel:null)}),function(t){c(t,function(e,n){var i=[],o=[NaN,NaN],r=[e.stackResultDimension,e.stackedOverDimension],a=e.data,s=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";a.modify(r,function(r,u,h){var c,d,p=a.get(e.stackedDimension,h);if(isNaN(p))return o;s?d=a.getRawIndex(h):c=a.get(e.stackedByDimension,h);for(var f=NaN,g=n-1;g>=0;g--){var m=t[g];if(s||(d=m.data.rawIndexOf(m.stackedByDimension,c)),d>=0){var y=m.data.getByRawIndex(m.stackResultDimension,d);if("all"===l||"positive"===l&&y>0||"negative"===l&&y<0||"samesign"===l&&p>=0&&y>0||"samesign"===l&&p<=0&&y<0){p=ln(p,y),f=y;break}}}return i[0]=p,i[1]=f,i})})}(t))})}),vl("default",function(t,e){s(e=e||{},{text:"loading",textColor:X_.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:X_.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Em,i=new mv({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});n.add(i);var o,r=new Tv({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new mv({style:{fill:"none"},textContent:r,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});return n.add(a),e.showSpinner&&((o=new vb({shape:{startAngle:-lS/2,endAngle:-lS/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*lS/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:3*lS/2}).delay(300).start("circularInOut"),n.add(o)),n.resize=function(){var n=r.getBoundingRect().width,s=e.showSpinner?e.spinnerRadius:0,l=(t.getWidth()-2*s-(e.showSpinner&&n?10:0)-n)/2-(e.showSpinner&&n?0:5+n/2)+(e.showSpinner?0:n/2)+(n?0:s),u=t.getHeight()/2;e.showSpinner&&o.setShape({cx:l,cy:u}),a.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),i.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},n.resize(),n}),fl({type:Av,event:Av,update:Av},H),fl({type:Ov,event:Ov,update:Ov},H),fl({type:zv,event:Bv,update:zv,action:H,refineEvent:_l,publishNonRefinedEvent:!0}),fl({type:Ev,event:Bv,update:Ev,action:H,refineEvent:_l,publishNonRefinedEvent:!0}),fl({type:Rv,event:Bv,update:Rv,action:H,refineEvent:_l,publishNonRefinedEvent:!0}),hl("default",{}),hl("dark",_S);const BT={...{metadata:!0,svgRender:!1,switchMode:!1,maxPointsFetched:1e4,loadMoreAtZoomLevel:9,clustering:!1,clusteringThreshold:100,disableClusteringAtLevel:8,clusterRadius:80,clusterSeparation:20,showMetaOnNarrowScreens:!1,showMapLabelsAtZoom:13,showGraphLabelsAtZoom:null,echartsOption:{aria:{show:!0,description:"This is a force-oriented graph chart that depicts the relationship between ip nodes."},toolbox:{show:!0,iconStyle:{borderColor:"#fff"},feature:{restore:{show:!0,title:"Restore view"},saveAsImage:{show:!0,title:"Save image"}}}},graphConfig:{series:{layout:"force",label:{show:!0,color:"#fff",position:"top"},labelLayout:{hideOverlap:!0},force:{gravity:.1,edgeLength:[20,60],repulsion:120},roam:!0,draggable:!0,legendHoverLink:!0,emphasis:{focus:"none",lineStyle:{color:"#3acc38",opacity:1}},nodeStyle:{color:"#ffebc4"},linkStyle:{width:6,color:"#1ba619"},nodeSize:"15"},baseOptions:{backgroundColor:"#282222",media:[{query:{minWidth:320,maxWidth:500},option:{series:[{zoom:.7}],toolbox:{itemSize:18}}},{query:{minWidth:501},option:{series:[{zoom:1}],toolbox:{itemSize:15}}},{query:{minWidth:320,maxWidth:850},option:{tooltip:{show:!1}}},{query:{minWidth:851},option:{tooltip:{show:!0}}}]}},mapOptions:{roam:!0,zoomAnimation:!1,worldCopyJump:!0,minZoom:3,maxZoom:18,nodeConfig:{type:"scatter",label:{show:!1,color:"#000000",position:"top",formatter:"{b}",fontSize:13,backgroundColor:"rgba(255, 255, 255, 0.8)",padding:[6,8],borderRadius:5},emphasis:{scale:1},nodeStyle:{color:"#1566a9"},nodeSize:"17"},linkConfig:{linkStyle:{width:5,color:"#1ba619"},emphasis:{focus:"none",lineStyle:{color:"#3acc38",opacity:1}}},clusterConfig:{symbolSize:30,itemStyle:{color:"#1566a9"},tooltip:{show:!1},label:{show:!0,position:"inside",color:"#fff",offset:[0,0],backgroundColor:"transparent"}},baseOptions:{toolbox:{show:!1},media:[{query:{minWidth:320,maxWidth:850},option:{tooltip:{show:!1}}},{query:{minWidth:851},option:{tooltip:{show:!0}}}]},nodePopup:{show:!1,content:null,config:{autoPan:!0,autoPanPadding:[25,25]}}},mapTileConfig:[{urlTemplate:"MISSING_ENV_VAR".MAPBOX_URL_TEMPLATE||"http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",options:{attribution:'© OpenStreetMap contributors,\n tiles offered by Mapbox'}}],geoOptions:{style:{fillColor:"#1566a9",weight:0,fillOpacity:.8,radius:8}},nodeCategories:[{name:"ok",nodeStyle:{color:"#1ba619"}},{name:"problem",nodeStyle:{color:"#ffa500"}},{name:"critical",nodeStyle:{color:"#c92517"}}],linkCategories:[],bookmarkableActions:{enabled:!1,id:null,zoomOnRestore:!0,zoomLevel:null,preserveFragment:!1},prepareData(t){t&&t.nodes&&t.nodes.forEach(t=>{if(t.properties&&t.properties.status){const e=t.properties.status.toLowerCase();"ok"!==e&&"problem"!==e&&"critical"!==e||(t.category=e)}})},onClickElement(t,e){let n;this.utils&&this.utils.isNetJSON(this.data)?(n="node"===t?this.utils.nodeInfo(e):"link"===t?this.utils.linkInfo(e):e,(this.config.showMetaOnNarrowScreens||this.el.clientWidth>850)&&(this.gui.metaInfoContainer.style.display="flex")):({nodeLinkData:n}={nodeLinkData:e}),this.gui.getNodeLinkInfo(t,n),this.gui.sideBar.classList.remove("hidden")},onReady(){}}};Object.defineProperty(BT,"crs",{get(){const t=xl(!0);return t?t.CRS.EPSG3857:null},enumerable:!0,configurable:!0});const NT=BT,FT=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class VT{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,n]=new Uint8Array(t,0,2);if(219!==e)throw new Error("Data does not appear to be in a KDBush format.");const i=n>>4;if(1!==i)throw new Error(`Got v${i} data when expected v1.`);const o=FT[15&n];if(!o)throw new Error("Unrecognized array type.");const[r]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new VT(a,r,o,t)}constructor(t,e=64,n=Float64Array,i){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=n,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const o=FT.indexOf(this.ArrayType),r=2*t*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-a%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${n}.`);i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+a+s,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+r+a+s),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+a+s,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+o]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=t,this.coords[this._pos++]=e,n}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return wl(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:r,nodeSize:a}=this,s=[0,o.length-1,0],l=[];for(;s.length;){const u=s.pop()||0,h=s.pop()||0,c=s.pop()||0;if(h-c<=a){for(let a=c;a<=h;a++){const s=r[2*a],u=r[2*a+1];s>=t&&s<=n&&u>=e&&u<=i&&l.push(o[a])}continue}const d=c+h>>1,p=r[2*d],f=r[2*d+1];p>=t&&p<=n&&f>=e&&f<=i&&l.push(o[d]),(0===u?t<=p:e<=f)&&(s.push(c),s.push(d-1),s.push(1-u)),(0===u?n>=p:i>=f)&&(s.push(d+1),s.push(h),s.push(1-u))}return l}within(t,e,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:r}=this,a=[0,i.length-1,0],s=[],l=n*n;for(;a.length;){const u=a.pop()||0,h=a.pop()||0,c=a.pop()||0;if(h-c<=r){for(let n=c;n<=h;n++)Ml(o[2*n],o[2*n+1],t,e)<=l&&s.push(i[n]);continue}const d=c+h>>1,p=o[2*d],f=o[2*d+1];Ml(p,f,t,e)<=l&&s.push(i[d]),(0===u?t-n<=p:e-n<=f)&&(a.push(c),a.push(d-1),a.push(1-u)),(0===u?t+n>=p:e+n>=f)&&(a.push(d+1),a.push(h),a.push(1-u))}return s}}const ZT=class{JSONParamParse(t){return"string"==typeof t?fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},credentials:"include"}).then(t=>t).catch(t=>{console.error(t)}):Promise.resolve(t)}async paginatedDataParse(t){let e,n;try{let i=await this.utils.JSONParamParse(t);if(i.json)for(e=await i.json(),n=e.results?e.results:e;e.next&&n.nodes.length<=this.config.maxPointsFetched;)i=await this.utils.JSONParamParse(e.next),e=await i.json(),n.nodes=n.nodes.concat(e.results.nodes),n.links=n.links.concat(e.results.links),this.hasMoreData=!!e.next;else n=i}catch(t){console.error(t)}return n}async getBBoxData(t,e){let n;try{const i=`${t=t[0].split("?")[0]}bbox?swLat=${e._southWest.lat}&swLng=${e._southWest.lng}&neLat=${e._northEast.lat}&neLng=${e._northEast.lng}`,o=await this.utils.JSONParamParse(i);n=await o.json()}catch(t){console.error(t)}return n}dateParse({dateString:t,parseRegular:e=/^([1-9]\d{3})-(\d{1,2})-(\d{1,2})T(\d{1,2}):(\d{1,2}):(\d{1,2})(?:\.(\d{1,3}))?Z$/,hourDiffer:n=(new Date).getTimezoneOffset()/60}){const i=e.exec(t);if(!i||i.length<7)return console.error("Date doesn't meet the specifications."),"";const o=["dateYear","dateMonth","dateDay","dateHour"],r={},a=new Map([["dateMonth",12],["dateDay",[31,i[1]%4==0&&i[1]%100!=0||i[1]%400==0?29:28,31,30,31,30,31,31,30,31,30,31]],["dateHour",24]]);for(let t=o.length;t>0;t-=1)r[o[t-1]]=parseInt(i[t],10);let s,l=-n;for(let t=o.length;t>0;t-=1){if("dateYear"===o[t-1]){r[o[t-1]]+=l;break}s="dateDay"===o[t-1]?a.get("dateDay")[r.dateMonth-1]:a.get(o[t-1]);let e=r[o[t-1]]+l;l="dateHour"===o[t-1]?e<0?-1:e>=s?1:0:e<=0?-1:e>s?1:0,1===l?e-=s:l<0&&("dateDay"===o[t-1]&&(s=a.get("dateDay")[(r[o[t-1]]+10)%11]),e+=s),r[o[t-1]]=e}return`${r.dateYear}.${this.numberMinDigit(r.dateMonth)}.${this.numberMinDigit(r.dateDay)} ${this.numberMinDigit(r.dateHour)}:${this.numberMinDigit(i[5])}:${this.numberMinDigit(i[6])}${i[7]?`.${this.numberMinDigit(i[7],3)}`:""}`}numberMinDigit(t,e=2,n="0"){return(Array(e).join(n)+t).slice(-e)}isObject(t){return"Object"===Object.prototype.toString.call(t).slice(8,14)}isArray(t){return"Array"===Object.prototype.toString.call(t).slice(8,13)}isElement(t){return"object"==typeof HTMLElement?t instanceof HTMLElement:t&&"object"==typeof t&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName}isNetJSON(t){return!(!t.nodes||!t.links)&&this.isObject(t)&&this.isArray(t.nodes)&&this.isArray(t.links)}isGeoJSON(t){return t.type&&"FeatureCollection"===t.type?this.isObject(t)&&this.isArray(t.features):!(!t.type||"Feature"!==t.type)&&this.isObject(t)&&this.isArray(t.geometry)}geojsonToNetjson(t){return function(t){const e=[],n=[];if(!t||!Array.isArray(t.features))return{nodes:e,links:n};const i=new Map,o=(t,n={})=>{const o=`${t[0]},${t[1]}`;if(i.has(o))return i.get(o);const r=n.id||n.node_id||null,a=n.label||n.name||r||null,s=r?String(r):`gjn_${e.length}`,l=!r,u={id:s,...a?{label:String(a)}:{},location:{lng:t[0],lat:t[1]},properties:{...n,location:{lng:t[0],lat:t[1]}},_generatedIdentity:l};return e.push(u),i.set(o,s),s},r=(t,e,i={})=>{n.push({source:t,target:e,properties:i})},a=(t,e,n=!1)=>{for(let n=0;n2){const n=o(t[0],e),i=o(t[t.length-1],e);r(i,n,e)}},s=(t,e)=>{if(!t)return;const{type:n,coordinates:i,geometries:r}=t;switch(n){case"Point":o(i,{...e,_featureType:"Point"});break;case"MultiPoint":i.forEach(t=>o(t,{...e,_featureType:"Point"}));break;case"LineString":a(i,{...e,_featureType:"LineString"},!1);break;case"MultiLineString":i.forEach(t=>a(t,{...e,_featureType:"LineString"},!1));break;case"Polygon":case"MultiPolygon":break;case"GeometryCollection":r.forEach(t=>s(t,e));break;default:console.warn(`Unsupported GeoJSON geometry type: ${n}`)}};return t.features.forEach(t=>{const e={...t.properties||{},...null!=t.id?{id:t.id}:{}};s(t.geometry,e)}),{nodes:e,links:n}}(t)}deepCopy(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>this.deepCopy(t));const e={};return Object.keys(t).forEach(n=>{e[n]=this.deepCopy(t[n])}),e}fastDeepCopy(t){return"function"==typeof structuredClone?structuredClone(t):JSON.parse(JSON.stringify(t))}deepMergeObj(...t){const e=[...t].reverse(),n=e.length;for(let t=0;t{i[t]&&this.isObject(i[t])&&this.isObject(n[t])?this.deepMergeObj(i[t],n[t]):i[t]=n[t]}):i||(e[t+1]=n)}return e[n-1]}makeCluster(t){const{nodes:e,links:n}=t.data,i=t=>!(t.properties&&t.properties._featureType)||"Point"===t.properties._featureType,o=e.filter(i),r=e.filter(t=>!i(t)),a=[],s=[],l=new Map;r.forEach(t=>l.set(t.id,null));let u=0;o.forEach(e=>{const n=e.properties&&e.properties.location||e.location;if(!n||void 0===n.lat||void 0===n.lng)return;e.location=n,e._origLocation?(n.lat=e._origLocation.lat,n.lng=e._origLocation.lng):e._origLocation={lat:n.lat,lng:n.lng};const i=t.leaflet.latLngToContainerPoint([n.lat,n.lng]);e.x=i.x,e.y=i.y,e.visited=!1,e.cluster=null});const h=new VT(o.length);o.forEach(({x:t,y:e})=>h.add(t,e)),h.finish();const c=t.config&&t.config.mapOptions&&t.config.mapOptions.clusterConfig&&t.config.mapOptions.clusterConfig.symbolSize,d=t=>{if("function"==typeof c)try{return c(t)}catch(t){return 30}return Array.isArray(c)?c[0]||30:"number"==typeof c?c:30},p=new Map;o.forEach(e=>{if(e.visited)return;const n=h.within(e.x,e.y,t.config.clusterRadius).map(t=>o[t]);if(n.length>1){const i=`${Math.round(e.x)},${Math.round(e.y)}`;p.has(i)||p.set(i,new Map);const o=p.get(i);n.forEach(e=>{if(e.visited)return;const n=t.config.clusteringAttribute?e.properties[t.config.clusteringAttribute]:"default";o.has(n)||o.set(n,[]),o.get(n).push(e),e.visited=!0})}else e.visited=!0,l.set(e.id,null),r.push(e)}),p.forEach(e=>{const n=Array.from(e.entries()),i=n.length;let o=0;n.forEach(([,t])=>{const e=d(t.length);e>o&&(o=e)});const a="number"==typeof t.config.clusterSeparation?t.config.clusterSeparation:Math.max(10,Math.floor(t.config.clusterRadius/2));let h=0;if(i>1){const t=Math.PI/i,e=Math.sin(t);e>0&&(h=o/(2*e))}const c=Math.max(a,h+4);n.forEach(([,e],n)=>{if(e.length>1){let o=0,r=0;if(e.forEach(t=>{t.cluster=u,l.set(t.id,t.cluster),o+=t.location.lng,r+=t.location.lat}),o/=e.length,r/=e.length,i>1){const e=2*Math.PI*n/i,a=t.leaflet.latLngToContainerPoint([r,o]),s=[a.x+c*Math.cos(e),a.y+c*Math.sin(e)],l=t.leaflet.containerPointToLatLng(s);o=l.lng,r=l.lat}const a={id:u,cluster:!0,name:e.length,value:[o,r],childNodes:e,...t.config.mapOptions.clusterConfig};if(t.config.clusteringAttribute){const n=t.config.nodeCategories.find(n=>n.name===e[0].properties[t.config.clusteringAttribute]);n&&(a.itemStyle={...a.itemStyle,color:n.nodeStyle.color})}s.push(a),u+=1}else if(1===e.length){const t=e[0];l.set(t.id,null),r.push(t)}})}),n.forEach(t=>{null===l.get(t.source)&&null===l.get(t.target)&&a.push(t)});const f=[...s.map(t=>({ref:t,isCluster:!0,count:t.childNodes.length,get value(){return t.value},set value([e,n]){t.value=[e,n]}})),...r.filter(i).map(t=>({ref:t,isCluster:!1,count:1,get value(){return[t.location.lng,t.location.lat]},set value([e,n]){t.location.lng=e,t.location.lat=n}}))];if(f.length>1){const e=f.map(e=>{const[n,i]=e.value,o=t.leaflet.latLngToContainerPoint([i,n]);return{ref:e.ref,isCluster:e.isCluster,x:o.x,y:o.y,r:d(e.count)/2,setValue:([t,n])=>{e.value=[t,n]}}}),n=4,i=5;for(let t=0;t0&&s{const n=t.leaflet.containerPointToLatLng([e.x,e.y]);e.isCluster?e.ref.value=[n.lng,n.lat]:(e.ref.location.lng=n.lng,e.ref.location.lat=n.lat)})}return{clusters:s,nonClusterNodes:r,nonClusterLinks:a}}updateMetadata(){if(this.config.metadata){const t=this.utils.getMetadata(this.data),e=document.querySelector(".njg-metaData"),n=document.querySelectorAll(".njg-metaDataItems");for(let t=0;t{const i=document.createElement("div");i.classList.add("njg-metaDataItems");const o=document.createElement("span");o.setAttribute("class","njg-keyLabel");const r=document.createElement("span");r.setAttribute("class","njg-valueLabel"),o.innerHTML=n,r.innerHTML=t[n],i.appendChild(o),i.appendChild(r),e.appendChild(i)})}}getMetadata(t){const e=t,n={};return e.label&&(n.label=e.label),["protocol","version","revision","metric","router_id","topology_id"].forEach(t=>{e[t]&&(n[t]=e[t])}),n.nodes=e.nodes.length,n.links=e.links.length,n}nodeInfo(t){const e={};!t._generatedIdentity&&(e.id=t.id,t.label&&"string"==typeof t.label&&(e.label=t.label)),t.name&&(e.name=t.name),t.location&&(e.location=t.location);let n=null;Array.isArray(t.clients)?n=t.clients:t.properties&&Array.isArray(t.properties.clients)&&(n=t.properties.clients);let i=0;n?i=n.length:"number"==typeof t.clients?i=t.clients:t.properties&&"number"==typeof t.properties.clients&&(i=t.properties.clients),i>0&&(e.clients=i),n&&n.length&&n.forEach((t,n)=>{e[`clients [${n+1}]`]=t});const o=(t,e)=>"location"===t&&e&&"object"==typeof e?{lat:e.lat,lng:e.lng}:"time"===t&&"string"==typeof e?this.dateParse({dateString:e}):e,r=t._source&&this.isObject(t._source)?t._source:t;if(Object.keys(r).forEach(t=>{if("properties"===t||"clients"===t||"_source"===t||"_generatedIdentity"===t||"local_addresses"===t||"linkCount"===t)return;const n=o(t,r[t]);null!=n&&""!==n&&(e[t]=n)}),r.properties&&this.isObject(r.properties)&&Object.keys(r.properties).forEach(t=>{if("clients"===t)return;const n=o(t,r.properties[t]);null==n||"string"==typeof n&&""===n.trim()||(e[t]=n)}),t.linkCount&&(e.links=t.linkCount),Array.isArray(r.local_addresses)){const t=r.local_addresses.map(t=>"string"==typeof t?t:t&&"string"==typeof t.address?t.address:null).filter(t=>t);t.length&&(e.localAddresses=t)}return t.local_addresses&&(e.localAddresses=t.local_addresses),e}createTooltipItem(t,e){const n=document.createElement("div");n.classList.add("njg-tooltip-item");const i=document.createElement("span");i.setAttribute("class","njg-tooltip-key");const o=document.createElement("span");return o.setAttribute("class","njg-tooltip-value"),i.innerHTML=t,o.innerHTML=e,n.appendChild(i),n.appendChild(o),n}getNodeTooltipInfo(t){const e=document.createElement("div");e.classList.add("njg-tooltip-inner");const n=!t._generatedIdentity;return n&&t.id&&e.appendChild(this.createTooltipItem("id",t.id)),n&&t.label&&"string"==typeof t.label&&e.appendChild(this.createTooltipItem("label",t.label)),t.properties&&Object.keys(t.properties).forEach(i=>{if("object"!=typeof t.properties[i]&&!i.startsWith("_")&&("id"!==i&&"label"!==i||!n))if("location"===i)e.appendChild(this.createTooltipItem("location",`${Math.round(1e3*t.properties.location.lat)/1e3}, ${Math.round(1e3*t.properties.location.lng)/1e3}`));else if("time"===i){const n=this.dateParse({dateString:t.properties[i]});e.appendChild(this.createTooltipItem("time",n))}else e.appendChild(this.createTooltipItem(`${i.replace(/_/g," ")}`,t.properties[i]))}),t.linkCount&&e.appendChild(this.createTooltipItem("Links",t.linkCount)),t.local_addresses&&e.appendChild(this.createTooltipItem("Local Addresses",t.local_addresses.join("
"))),e}getLinkTooltipInfo(t){const e=document.createElement("div");e.classList.add("njg-tooltip-inner");const n=t=>"string"==typeof t&&t.startsWith("gjn_");return n(t.source)||e.appendChild(this.createTooltipItem("source",t.source)),n(t.target)||e.appendChild(this.createTooltipItem("target",t.target)),null!=t.cost&&e.appendChild(this.createTooltipItem("cost",t.cost)),t.properties&&Object.keys(t.properties).forEach(n=>{const i=t.properties[n];if(null!=i)if("time"===n){const t=this.dateParse({dateString:i});e.appendChild(this.createTooltipItem("time",t))}else{const t="string"==typeof i?i.replace(/\n/g,"
"):i;e.appendChild(this.createTooltipItem(`${n.replace(/_/g," ")}`,t))}}),e}linkInfo(t){const e={},n=t=>"string"==typeof t&&t.startsWith("gjn_");return n(t.source)||(e.source=t.source),n(t.target)||(e.target=t.target),null!=t.cost&&(e.cost=t.cost),t.properties&&Object.keys(t.properties).forEach(n=>{const i=t.properties[n];if(null!=i)if("time"===n){const t=this.dateParse({dateString:i});e[n]=t}else{const t="string"==typeof i?i.replace(/\n/g,"
"):i;e[n.replace(/_/g," ")]=t}}),e}generateStyle(t,e){return"function"==typeof t?t(e):t}getNodeStyle(t,e,n){let i,o={},r={},a=!1;if(t.category&&e.nodeCategories&&e.nodeCategories.length){const n=e.nodeCategories.find(e=>e.name===t.category);if(n){a=!0,i=this.generateStyle(n.nodeStyle||{},t),o=this.generateStyle(n.nodeSize||{},t);let e={},s={};n.emphasis&&(e=this.generateStyle(n.emphasis.nodeStyle||{},t),s=this.generateStyle(n.emphasis.nodeSize||{},t),r={nodeStyle:e,nodeSize:s})}}if(!a)if("map"===n){const n=e.mapOptions&&e.mapOptions.nodeConfig;i=this.generateStyle(n&&n.nodeStyle||{},t),o=this.generateStyle(n&&n.nodeSize||{},t);const a=n&&n.emphasis;a&&(r={nodeStyle:this.generateStyle(a&&a.nodeStyle||{},t),nodeSize:this.generateStyle(a&&a.nodeSize||{},t)})}else{const n=e.graphConfig&&e.graphConfig.series;i=this.generateStyle(n&&n.nodeStyle||{},t),o=this.generateStyle(n&&n.nodeSize||{},t);const a=n&&n.emphasis;a&&(r={nodeStyle:this.generateStyle(a&&a.itemStyle||{},t),nodeSize:this.generateStyle(a&&a.symbolSize||o||{},t)})}return{nodeStyleConfig:i,nodeSizeConfig:o,nodeEmphasisConfig:r}}getLinkStyle(t,e,n){let i,o={};if(t.category&&e.linkCategories.length){const n=e.linkCategories.find(e=>e.name===t.category);i=this.generateStyle(n.linkStyle||{},t),o={...o,linkStyle:n.emphasis?this.generateStyle(n.emphasis.linkStyle||{},t):{}}}else i=this.generateStyle("map"===n?e.mapOptions.linkConfig.linkStyle:e.graphConfig.series.linkStyle,t);return{linkStyleConfig:i,linkEmphasisConfig:o}}showLoading(){let t=this.el.querySelector(".njg-loadingContainer");return t?t.style.visibility="visible":(t=document.createElement("div"),t.classList.add("njg-loadingContainer"),t.innerHTML='\n
\n
\n

Loading...

\n
\n ',this.el.appendChild(t)),t}hideLoading(){const t=this.el.querySelector(".njg-loadingContainer");return t&&(t.style.visibility="hidden"),t}createEvent(){const t=new Map,e=new Map;return{on(e,...n){t.set(e,[...t.get(e)||[],...n])},once(t,...n){e.set(t,[...e.get(t)||[],...n])},emit(n){const i=t.get(n)||[],o=e.get(n)||[],r=i.map(t=>t()),a=o.map(t=>t());return e.delete(n),[...r,...a]},delete(n){t.delete(n),e.delete(n)}}}parseUrlFragments(){let t;try{t=decodeURIComponent(window.location.hash.replace(/^#/,""))}catch(e){t=window.location.hash.replace(/^#/,"")}const e={};return t.split(";").forEach(t=>{const n=new URLSearchParams(t),i=n.get("id");null!=i&&(e[i]=n)}),e}updateUrlFragments(t,e){const n=Object.values(t).map(t=>t.toString()).join(";");if(!n)return void window.history.pushState(e,"",window.location.pathname+window.location.search);const i=n.replace(/([^&=]+)=([^&;]*)/g,(t,e,n)=>`${e}=${encodeURIComponent(n.replace(/%7E/gi,"~"))}`);window.history.pushState(e,"",`#${i}`)}addActionToUrl(t,e){if(!t.config.bookmarkableActions.enabled||!e.data||e.data.cluster)return;if(!t.nodeLinkIndex)return void console.error("Lookup object for node or link not found.");const n=this.parseUrlFragments(),{id:i}=t.config.bookmarkableActions;let o;if(t.config.render===t.utils.graphRender){if("node"===e.dataType)o=e.data.id;else if("edge"===e.dataType){const{source:t,target:n}=e.data;o=`${t}~${n}`}}else if(t.config.render===t.utils.mapRender)if("scatter"===e.seriesType)o=e.data.node.id;else if("lines"===e.seriesType){const{source:t,target:n}=e.data.link;o=`${t}~${n}`}o&&t.nodeLinkIndex[o]?(n[i]||(n[i]=new URLSearchParams,n[i].set("id",i)),n[i].set("nodeId",o),this.updateUrlFragments(n,t.nodeLinkIndex[o])):console.error("nodeId not found in nodeLinkIndex lookup.")}removeUrlFragment(t,e=null,n=!1){const i=this.parseUrlFragments();if(i[t]){if(e){i[t].delete(e);const o=Array.from(i[t].keys()).filter(t=>"id"!==t);n||0!==o.length||delete i[t]}else delete i[t];this.updateUrlFragments(i,{id:t})}}applyUrlFragmentState(t){if(!t.config.bookmarkableActions.enabled)return;const{id:e}=t.config.bookmarkableActions,n=t.utils.parseUrlFragments(),i=n[e]&&n[e].get?n[e]:null,o=i&&i.get?i.get("nodeId"):void 0;if(!o||!t.nodeLinkIndex||null==t.nodeLinkIndex[o])return void(t.leaflet&&t.leaflet.currentPopup&&t.leaflet.currentPopup.remove());const[r,a]=o.split("~"),s=t.nodeLinkIndex[o],l=t.config.graphConfig&&t.config.graphConfig.series&&t.config.graphConfig.series.type||t.config.mapOptions&&t.config.mapOptions.nodeConfig&&t.config.mapOptions.nodeConfig.type,{location:u,cluster:h}=s||{};t.config.bookmarkableActions.zoomOnRestore&&["scatter","effectScatter"].includes(l)&&null==a&&null!=u&&t.leaflet&&t.leaflet.setView([u.lat,u.lng],null!=h?t.config.disableClusteringAtLevel:t.config.bookmarkableActions.zoomLevel||t.config.showMapLabelsAtZoom),null==a&&t.config.mapOptions?.nodePopup?.show&&t.gui.loadNodePopup(s),"function"==typeof t.config.onClickElement&&t.config.onClickElement.call(t,r&&a?"link":"node",s)}setupHashChangeHandler(t){return t._popstateHandler&&window.removeEventListener("popstate",t._popstateHandler),t._popstateHandler=()=>{this.applyUrlFragmentState(t)},window.addEventListener("popstate",t._popstateHandler),()=>{window.removeEventListener("popstate",t._popstateHandler),t._popstateHandler=null}}moveNodeInRealTime(t,e){if(!this.echarts||"function"!=typeof this.echarts.getOption)return void console.warn("moveNodeInRealTime: ECharts instance not ready");const n=this.echarts.getOption();if(!n||!Array.isArray(n.series))return void console.warn("moveNodeInRealTime: No series data available");const i=n.series.find(t=>"scatter"===t.type||"effectScatter"===t.type);if(!i)return void console.warn("moveNodeInRealTime: No scatter series found");const o=i.data.findIndex(e=>e.node.id===t);if(-1===o)return void console.warn(`moveNodeInRealTime: Node with id "${t}" not found`);const r=i.data[o],{node:a}=r;a.location=e,a.properties?(a.properties.location=e,r.value=[e.lng,e.lat],this.nodeLinkIndex[t].location=e,this.nodeLinkIndex[t].properties&&(this.nodeLinkIndex[t].properties.location=e,this.echarts.setOption({series:n.series}))):console.warn("moveNodeInRealTime: Node properties not found")}updateLabelVisibility(t,e){if(!t.echarts||"function"!=typeof t.echarts.setOption)return void console.warn("updateLabelVisibility: ECharts instance not ready");const n=e&&!1!==t.config.showMapLabelsAtZoom&&t.leaflet.getZoom()>=t.config.showMapLabelsAtZoom;t.echarts.setOption({series:[{id:"geo-map",label:{show:n,silent:!0},emphasis:{label:{show:!1}}}]})}setTooltipVisibility(t,e){t.el&&t.el.classList.toggle("njg-hide-tooltip",!e)}},HT=class extends ZT{searchElements(t){const e=this,n={"":{data:{...e.data},param:[...e.JSONParam]}};return window.history.pushState({searchValue:""},""),window.onpopstate=i=>{n[i.state.searchValue]?e.utils.JSONDataUpdate.call(e,n[i.state.searchValue].data).then(()=>{e.JSONParam=n[i.state.searchValue].param}):e.utils.JSONDataUpdate.call(e,t+i.state.searchValue)},function(i,o=!0,r=!0){const a=i.trim();if(!window.history.state||window.history.state&&window.history.state.searchValue!==a)return window.history.pushState({searchValue:a},""),e.utils.JSONDataUpdate.call(e,t+a,o,r).then(()=>{n[a]={data:{...e.data},param:[...e.JSONParam]}})}}JSONDataUpdate(t,e=!0,n=!0){const i=this;return i.config.onUpdate.call(i),i.utils.paginatedDataParse.call(i,t).then(o=>{function r(){e?(i.JSONParam=[t],i.utils.overrideData(o,i)):(i.JSONParam.push(t),i.config.render===i.utils.mapRender?i.utils.appendData(o,i):i.utils.addData(o,i)),i.utils.isNetJSON(i.data)&&i.utils.updateMetadata.call(i)}return n?(i.utils.isNetJSON(i.data)&&i.config.prepareData.call(i,o),i.config.dealDataByWorker?i.utils.dealDataByWorker.call(i,o,i.config.dealDataByWorker,r):r()):r(),o}).catch(t=>{console.error(t)})}dealDataByWorker(t,e,n){const i=new Worker(e),o=this;i.postMessage(t),i.addEventListener("error",t=>{console.error(t),console.error("Error in dealing JSONData!")}),i.addEventListener("message",t=>{n?n():(o.utils.overrideData(t.data,o),o.utils.isNetJSON(o.data)&&o.utils.updateMetadata.call(o))})}overrideData(t,e){e.data=t,e.utils.isNetJSON(e.data)||e.leaflet.geoJSON.removeFrom(e.leaflet),e.utils.render(),e.config.afterUpdate.call(e)}},WT=class{constructor(t){this.utils=new HT,this.config=this.utils.deepCopy(NT),this.config.crs=NT.crs,this.JSONParam=this.utils.isArray(t)?t:[t]}setConfig(t){if(this.utils.deepMergeObj(this.config,t),this.el)t&&t.el&&console.error("Can't change el again!");else if(this.el=this.config.el?this.utils.isElement(this.config.el)?this.config.el:document.querySelector(this.config.el):document.body,this.el){if(this.el.classList.add("njg-container"),this.el===document.body){const t=document.documentElement;t.style.width="100%",t.style.height="100%",this.el.classList.add("njg-relativePosition")}}else console.error("NetJSONGraph: The specified element for rendering was not found and could not be set.");return this.config}render(){const[t,...e]=this.JSONParam;this.config.onRender.call(this);const n=new Promise(t=>{this.event.once("onReady",async()=>{try{await this.config.onReady.call(this)}catch(t){console.error("onReady callback failed:",t)}t()})});if(this.event.once("onLoad",this.config.onLoad.bind(this)),this.event.once("applyUrlFragmentState",async()=>{await n,this.utils.applyUrlFragmentState.call(this,this)}),this.utils.paginatedDataParse.call(this,t).then(t=>{if(this.utils.isNetJSON(t))this.type="netjson";else{if(!this.utils.isGeoJSON(t))throw new Error("Invalid data format!");this.type="geojson",this.originalGeoJSON=this.utils.fastDeepCopy(t),t=this.utils.geojsonToNetjson(t)}if(this.utils.isNetJSON(t)){t.nodes.length>this.config.maxPointsFetched&&(this.hasMoreData=!0),t.nodes.splice(this.config.maxPointsFetched-1,t.nodes.length-this.config.maxPointsFetched);const e=new Set;this.nodeLinkIndex={},t.nodes.forEach(t=>{e.add(t.id),this.nodeLinkIndex[t.id]=t}),t.links=t.links.filter(t=>e.has(t.source)&&e.has(t.target)?(this.nodeLinkIndex[`${t.source}~${t.target}`]=t,!0):(e.has(t.source)?console.warn(`Node ${t.target} does not exist!`):console.warn(`Node ${t.source} does not exist!`),!1))}this.config.prepareData.call(this,t),this.data=t,this.config.dealDataByWorker?this.utils.dealDataByWorker.call(this,t,this.config.dealDataByWorker):(this.data=t,this.utils.render())}).catch(t=>{console.error(t)}),e.length){const n=function(){e.map(t=>this.utils.JSONDataUpdate.call(this,t,!1))};this.JSONParam=[t],this.event.once("renderArray",n.bind(this))}}setUtils(t={}){const e=this;return e.utils=Object.assign(e.utils,{...t},{render(){if(!e.config.render)throw new Error("No render function!");e.config.render(e.data,e)}}),"function"==typeof e.utils.moveNodeInRealTime&&(e.utils.moveNodeInRealTime=e.utils.moveNodeInRealTime.bind(e)),e.utils}};var jT,GT={},UT=[],YT={registerPreprocessor:cl,registerProcessor:dl,registerPostInit:function(t){pl("afterinit",t)},registerPostUpdate:function(t){pl("afterupdate",t)},registerUpdateLifecycle:pl,registerAction:fl,registerCoordinateSystem:gl,registerLayout:function(t,e){yl(IT,t,e,1e3,"layout")},registerVisual:ml,registerTransform:function(t){var e=(t=o(t)).type;e||Ir("");var n=e.split(":");2!==n.length&&Ir("");var i=!1;"echarts"===n[0]&&(e=n[1],i=!0),t.__isBuiltIn=i,ow.set(e,t)},registerLoading:vl,registerMap:function(t,e,n){var i=lT.registerMap;i&&i(t,e,n)},registerImpl:function(t,e){lT[t]=e},PRIORITY:cT,ComponentModel:W_,ComponentView:ww,SeriesModel:_w,ChartView:Kb,registerComponentModel:function(t){W_.registerClass(t)},registerComponentView:function(t){ww.registerClass(t)},registerSeriesModel:function(t){_w.registerClass(t)},registerChartView:function(t){Kb.registerClass(t)},registerCustomSeries:function(t,e){!function(t,e){GT[t]=e}(t,e)},registerSubTypeDefaulter:function(t,e){W_.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){Bm[t]=e}},XT=cb.prototype,qT=gb.prototype,KT=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};e(function(){return null!==jT&&jT.apply(this,arguments)||this},jT=KT);const $T=function(t){function n(e){var n=t.call(this,e)||this;return n.type="ec-line",n}return e(n,t),n.prototype.getDefaultStyle=function(){return{stroke:X_.color.neutral99,fill:null}},n.prototype.getDefaultShape=function(){return new KT},n.prototype.buildPath=function(t,e){kl(e)?XT.buildPath.call(this,t,e):qT.buildPath.call(this,t,e)},n.prototype.pointAt=function(t){return kl(this.shape)?XT.pointAt.call(this,t):qT.pointAt.call(this,t)},n.prototype.tangentAt=function(t){var e=this.shape,n=kl(e)?[e.x2-e.x1,e.y2-e.y1]:qT.tangentAt.call(this,t);return Q(n,n)},n}(ov);var JT=["fromSymbol","toSymbol"],QT=function(t){function n(e,n,i){var o=t.call(this)||this;return o._createLine(e,n,i),o}return e(n,t),n.prototype._createLine=function(t,e,n){var i=t.hostModel,o=t.getItemLayout(e),r=t.getItemVisual(e,"z2"),a=function(t){var e=new $T({name:"line",subPixelOptimize:!0});return Dl(e.shape,t),e}(o);a.shape.percent=0,La(a,{z2:L(r,0),shape:{percent:1}},i,e),this.add(a),c(JT,function(n){var i=Pl(n,t,e);this.add(i),this[Il(n)]=Ll(n,t,e)},this),this._updateCommonStl(t,e,n)},n.prototype.updateData=function(t,e,n){var i=t.hostModel,o=this.childOfName("line"),r=t.getItemLayout(e),a={shape:{}};Dl(a.shape,r),Ia(o,a,i,e),c(JT,function(n){var i=Ll(n,t,e),o=Il(n);if(this[o]!==i){this.remove(this.childOfName(n));var r=Pl(n,t,e);this.add(r)}this[o]=i},this),this._updateCommonStl(t,e,n)},n.prototype.getLinePath=function(){return this.childAt(0)},n.prototype._updateCommonStl=function(t,e,n){var i=t.hostModel,o=this.childOfName("line"),r=n&&n.emphasisLineStyle,a=n&&n.blurLineStyle,s=n&&n.selectLineStyle,l=n&&n.labelStatesModels,u=n&&n.emphasisDisabled,h=n&&n.focus,d=n&&n.blurScope;if(!n||t.hasItemOption){var p=t.getItemModel(e),f=p.getModel("emphasis");r=f.getModel("lineStyle").getLineStyle(),a=p.getModel(["blur","lineStyle"]).getLineStyle(),s=p.getModel(["select","lineStyle"]).getLineStyle(),u=f.get("disabled"),h=f.get("focus"),d=f.get("blurScope"),l=ho(p)}var g=t.getItemVisual(e,"style"),m=g.stroke;o.useStyle(g),o.style.fill=null,o.style.strokeNoScale=!0,o.ensureState("emphasis").style=r,o.ensureState("blur").style=a,o.ensureState("select").style=s,c(JT,function(t){var e=this.childOfName(t);if(e){e.setColor(m),e.style.opacity=g.opacity;for(var n=0;n0&&(_[0]=-_[0],_[1]=-_[1]);var w=v[0]<0?-1:1;if("start"!==o.__position&&"end"!==o.__position){var b=-Math.atan2(v[1],v[0]);h[0].8?"left":c[0]<-.8?"right":"center",p=c[1]>.8?"top":c[1]<-.8?"bottom":"middle";break;case"start":o.x=-c[0]*g+u[0],o.y=-c[1]*m+u[1],d=c[0]>.8?"right":c[0]<-.8?"left":"center",p=c[1]>.8?"bottom":c[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":o.x=g*w+u[0],o.y=u[1]+S,d=v[0]<0?"right":"left",o.originX=-g*w,o.originY=-S;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":o.x=x[0],o.y=x[1]+S,d="center",o.originY=-S;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":o.x=-g*w+h[0],o.y=h[1]+S,d=v[0]>=0?"right":"left",o.originX=g*w,o.originY=-S}o.scaleX=o.scaleY=r,o.setStyle({verticalAlign:o.__verticalAlign||p,align:o.__align||d})}}}},n}(Em);const tM=QT,eM=function(){function t(t){this.group=new Em,this._LineCtor=t||tM}return t.prototype.updateData=function(t){var e=this;this._progressiveEls=null;var n=this,i=n.group,o=n._lineData;n._lineData=t,o||i.removeAll();var r=Al(t);t.diff(o).add(function(n){e._doAdd(t,n,r)}).update(function(n,i){e._doUpdate(o,t,i,n,r)}).remove(function(t){i.remove(o.getItemGraphicEl(t))}).execute()},t.prototype.updateLayout=function(){var t=this._lineData;t&&t.eachItemGraphicEl(function(e,n){e.updateLayout(t,n)},this)},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=Al(t),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e){function n(t){t.isGroup||function(t){return t.animators&&t.animators.length>0}(t)||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var i=t.start;i0&&(r=this._getLineLength(i)/l*1e3),r!==this._period||a!==this._loop||s!==this._roundTrip){i.stopAnimation();var h=void 0;h=v(u)?u(n):u,i.__t>0&&(h=-r*i.__t),this._animateSymbol(i,r,h,a,s)}this._period=r,this._loop=a,this._roundTrip=s}},n.prototype._animateSymbol=function(t,e,n,i,o){if(e>0){t.__t=0;var r=this,a=t.animate("",i).when(o?2*e:e,{__t:o?2:1}).delay(n).during(function(){r._updateSymbolPosition(t)});i||a.done(function(){r.remove(t)}),a.start()}},n.prototype._getLineLength=function(t){return Cf(t.__p1,t.__cp1)+Cf(t.__cp1,t.__p2)},n.prototype._updateAnimationPoints=function(t,e){t.__p1=e[0],t.__p2=e[1],t.__cp1=e[2]||[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]},n.prototype.updateData=function(t,e,n){this.childAt(0).updateData(t,e,n),this._updateEffectSymbol(t,e)},n.prototype._updateSymbolPosition=function(t){var e=t.__p1,n=t.__p2,i=t.__cp1,o=t.__t<1?t.__t:2-t.__t,r=[t.x,t.y],a=r.slice(),s=jt,l=Gt;r[0]=s(e[0],i[0],n[0],o),r[1]=s(e[1],i[1],n[1],o);var u=t.__t<1?l(e[0],i[0],n[0],o):l(n[0],i[0],e[0],1-o),h=t.__t<1?l(e[1],i[1],n[1],o):l(n[1],i[1],e[1],1-o);t.rotation=-Math.atan2(h,u)-Math.PI/2,"line"!==this._symbolType&&"rect"!==this._symbolType&&"roundRect"!==this._symbolType||(void 0!==t.__lastT&&t.__lastT=0&&!(i[r]<=e);r--);r=Math.min(r,o-2)}else{for(r=a;re);r++);r=Math.min(r-1,o-2)}var s=(e-i[r])/(i[r+1]-i[r]),l=n[r],u=n[r+1];t.x=l[0]*(1-s)+s*u[0],t.y=l[1]*(1-s)+s*u[1],t.rotation=-Math.atan2(t.__t<1?u[1]-l[1]:l[1]-u[1],t.__t<1?u[0]-l[0]:l[0]-u[0])-Math.PI/2,this._lastFrame=r,this._lastFramePercent=e,t.ignore=!1}},n}(iM);const sM=aM;var lM=function(){this.polyline=!1,this.curveness=0,this.segs=[]},uM=function(t){function n(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return e(n,t),n.prototype.reset=function(){this.notClear=!1,this._off=0},n.prototype.getDefaultStyle=function(){return{stroke:X_.color.neutral99,fill:null}},n.prototype.getDefaultShape=function(){return new lM},n.prototype.buildPath=function(t,e){var n,i=e.segs,o=e.curveness;if(e.polyline)for(n=this._off;n0){t.moveTo(i[n++],i[n++]);for(var a=1;a0?t.quadraticCurveTo((s+u)/2-(l-h)*o,(l+h)/2-(u-s)*o,u,h):t.lineTo(u,h)}this.incremental&&(this._off=n,this.notClear=!0)},n.prototype.findDataIndex=function(t,e){var n=this.shape,i=n.segs,o=n.curveness,r=this.style.lineWidth;if(n.polyline)for(var a=0,s=0;s0)for(var u=i[s++],h=i[s++],c=1;c0){if(ui(u,h,(u+d)/2-(h-p)*o,(h+p)/2-(d-u)*o,d,p,r,t,e))return a}else if(si(u,h,d,p,r,t,e))return a;a++}return-1},n.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e);return this.getBoundingRect().contain(t=n[0],e=n[1])?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},n.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape.segs,n=1/0,i=1/0,o=-1/0,r=-1/0,a=0;a0&&(r.dataIndex=n+t.__startIndex)})},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}();var cM={seriesType:"lines",plan:ma(),reset:function(t){var e=t.coordinateSystem;if(e){var n=t.get("polyline"),i=t.pipelineContext.large;return{progress:function(o,r){var a=[];if(i){var s=void 0,l=o.end-o.start;if(n){for(var u=0,h=o.start;h0&&(l||s.configLayer(r,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(a/10+.9,1),0)})),o.updateData(i);var u=t.get("clip",!0)&&function(t,e,n){return t?"polar"===t.type?function(t){var e=t.getArea(),n=rn(e.r0,1),i=rn(e.r,1),o=new Jw({shape:{cx:rn(t.cx,1),cy:rn(t.cy,1),r0:n,r:i,startAngle:e.startAngle,endAngle:e.endAngle,clockwise:e.clockwise}});return o}(t):"cartesian2d"===t.type?function(t,e,n){var i=t.getArea(),o=i.x,r=i.y,a=i.width,s=i.height,l=n.get(["lineStyle","width"])||0;o-=l/2,r-=l/2,a+=l,s+=l,a=Math.ceil(a),o!==Math.floor(o)&&(o=Math.floor(o),a++);var u=new mv({shape:{x:o,y:r,width:a,height:s}});return u}(t,0,n):null:null}(t.coordinateSystem,0,t);u?this.group.setClipPath(u):this.group.removeClipPath(),this._lastZlevel=r,this._finished=!0},n.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData();this._updateLineDraw(i,t).incrementalPrepareUpdate(i),this._clearLayer(n),this._finished=!1},n.prototype.incrementalRender=function(t,e,n){this._lineDraw.incrementalUpdate(t,e.getData()),this._finished=t.end===e.getData().count()},n.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},n.prototype.updateTransform=function(t,e,n){var i=t.getData(),o=t.pipelineContext;if(!this._finished||o.large||o.progressiveRender)return{update:!0};var r=dM.reset(t,e,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),this._lineDraw.updateLayout(),this._clearLayer(n)},n.prototype._updateLineDraw=function(t,e){var n=this._lineDraw,i=this._showEffect(e),o=!!e.get("polyline"),r=e.pipelineContext.large;return n&&i===this._hasEffet&&o===this._isPolyline&&r===this._isLargeDraw||(n&&n.remove(),n=this._lineDraw=r?new hM:new eM(o?i?sM:rM:i?iM:tM),this._hasEffet=i,this._isPolyline=o,this._isLargeDraw=r),this.group.add(n.group),n},n.prototype._showEffect=function(t){return!!t.get(["effect","show"])},n.prototype._clearLayer=function(t){var e=t.getZr();"svg"===e.painter.getType()||null==this._lastZlevel||e.painter.getLayer(this._lastZlevel).clear(!0)},n.prototype.remove=function(t,e){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(e)},n.prototype.dispose=function(t,e){this.remove(t,e)},n.type="lines",n}(Kb);var fM=function(){function t(t,e,n,i,o,r){this._old=t,this._new=e,this._oldKeyGetter=n||Rl,this._newKeyGetter=i||Rl,this.context=o,this._diffModeMultiple="multiple"===r}return t.prototype.add=function(t){return this._add=t,this},t.prototype.update=function(t){return this._update=t,this},t.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},t.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},t.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},t.prototype.remove=function(t){return this._remove=t,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var t=this._old,e=this._new,n={},i=new Array(t.length),o=new Array(e.length);this._initIndexMap(t,null,i,"_oldKeyGetter"),this._initIndexMap(e,n,o,"_newKeyGetter");for(var r=0;r1){var u=s.shift();1===s.length&&(n[a]=s[0]),this._update&&this._update(u,r)}else 1===l?(n[a]=null,this._update&&this._update(s,r)):this._remove&&this._remove(r)}this._performRestAdd(o,n)},t.prototype._executeMultiple=function(){var t=this._new,e={},n={},i=[],o=[];this._initIndexMap(this._old,e,i,"_oldKeyGetter"),this._initIndexMap(t,n,o,"_newKeyGetter");for(var r=0;r1&&1===h)this._updateManyToOne&&this._updateManyToOne(l,s),n[a]=null;else if(1===u&&h>1)this._updateOneToMany&&this._updateOneToMany(l,s),n[a]=null;else if(1===u&&1===h)this._update&&this._update(l,s),n[a]=null;else if(u>1&&h>1)this._updateManyToMany&&this._updateManyToMany(l,s),n[a]=null;else if(u>1)for(var c=0;c1)for(var a=0;a=e)){var n=this._store.getProvider();this._updateOrdinalMeta();var i=this._nameList,o=this._idList;if(n.getSource().sourceFormat===ox&&!n.pure)for(var r=[],a=t;a0},t.prototype.ensureUniqueItemVisual=function(t,e){var n=this._itemVisuals,i=n[t];i||(i=n[t]={});var o=i[e];return null==o&&(y(o=this.getVisual(e))?o=o.slice():IM(o)&&(o=a({},o)),i[e]=o),o},t.prototype.setItemVisual=function(t,e,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,IM(e)?a(i,e):i[e]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(t,e){IM(t)?a(this._layout,t):this._layout[t]=e},t.prototype.getLayout=function(t){return this._layout[t]},t.prototype.getItemLayout=function(t){return this._itemLayouts[t]},t.prototype.setItemLayout=function(t,e,n){this._itemLayouts[t]=n?a(this._itemLayouts[t]||{},e):e},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(t,e){!function(t,e,n,i){if(i){var o=Mv(i);o.dataIndex=n,o.dataType=e,o.seriesIndex=t,o.ssrType="chart","group"===i.type&&i.traverse(function(i){var o=Mv(i);o.seriesIndex=t,o.dataIndex=n,o.dataType=e,o.ssrType="chart"})}}(this.hostModel&&this.hostModel.seriesIndex,this.dataType,t,e),this._graphicEls[t]=e},t.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},t.prototype.eachItemGraphicEl=function(t,e){c(this._graphicEls,function(n,i){n&&t&&t.call(e,n,i)})},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:LM(this.dimensions,this._getDimInfo,this),this.hostModel)),bM(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(t,e){var n=this[t];v(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=n.apply(this,arguments);return e.apply(this,[t].concat(D(arguments)))})},t.internalField=(vM=function(t){var e=t._invertedIndicesMap;c(e,function(n,i){var o=t._dimInfos[i],r=o.ordinalMeta,a=t._store;if(r){n=e[i]=new PM(r.categories.length);for(var s=0;s1&&(s+="__ec__"+u),i[e]=s}})),t}();const zM=OM;var EM="undefined"==typeof Uint32Array?Array:Uint32Array,RM="undefined"==typeof Float64Array?Array:Float64Array,BM=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.visualStyleAccessPath="lineStyle",e.visualDrawType="stroke",e}return e(n,t),n.prototype.init=function(e){e.data=e.data||[],Hl(e);var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count)),t.prototype.init.apply(this,arguments)},n.prototype.mergeOption=function(e){if(Hl(e),e.data){var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count))}t.prototype.mergeOption.apply(this,arguments)},n.prototype.appendData=function(t){var e=this._processFlatCoordsArray(t.data);e.flatCoords&&(this._flatCoords?(this._flatCoords=N(this._flatCoords,e.flatCoords),this._flatCoordsOffset=N(this._flatCoordsOffset,e.flatCoordsOffset)):(this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset),t.data=new Float32Array(e.count)),this.getRawData().appendData(t.data)},n.prototype._getCoordsFromItemModel=function(t){var e=this.getData().getItemModel(t);return e.option instanceof Array?e.option:e.getShallow("coords")},n.prototype.getLineCoordsCount=function(t){return this._flatCoordsOffset?this._flatCoordsOffset[2*t+1]:this._getCoordsFromItemModel(t).length},n.prototype.getLineCoords=function(t,e){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*t],i=this._flatCoordsOffset[2*t+1],o=0;o ")})},n.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},n.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},n.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},n.prototype.getZLevelKey=function(){var t=this.getModel("effect"),e=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&e>0?e+"":""},n.type="series.lines",n.dependencies=["grid","polar","geo","calendar"],n.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}},n}(_w);const NM=BM,FM={seriesType:"lines",reset:function(t){var e=Wl(t.get("symbol")),n=Wl(t.get("symbolSize")),i=t.getData();return i.setVisual("fromSymbol",e&&e[0]),i.setVisual("toSymbol",e&&e[1]),i.setVisual("fromSymbolSize",n&&n[0]),i.setVisual("toSymbolSize",n&&n[1]),{dataEach:i.hasItemOption?function(t,e){var n=t.getItemModel(e),i=Wl(n.getShallow("symbol",!0)),o=Wl(n.getShallow("symbolSize",!0));i[0]&&t.setItemVisual(e,"fromSymbol",i[0]),i[1]&&t.setItemVisual(e,"toSymbol",i[1]),o[0]&&t.setItemVisual(e,"fromSymbolSize",o[0]),o[1]&&t.setItemVisual(e,"toSymbolSize",o[1])}:null}}};var VM="--\x3e",ZM=function(t){return t.get("autoCurveness")||null},HM=function(t,e){var n=ZM(t),i=20,o=[];if(w(n))i=n;else if(y(n))return void(t.__curvenessList=n);e>i&&(i=e);var r=i%2?i+2:i+3;o=[];for(var a=0;a0?+p:1;k.scaleX=this._sizeX*I,k.scaleY=this._sizeY*I,this.setSymbolScale(1),io(this,u,h,c)},n.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},n.prototype.fadeOut=function(t,e,n){var i=this.childAt(0),o=Mv(this).dataIndex,r=n&&n.animation;if(this.silent=i.silent=!0,n&&n.fadeLabel){var a=i.getTextContent();a&&Da(a,{style:{opacity:0}},e,{dataIndex:o,removeOpt:r,cb:function(){i.removeTextContent()}})}else i.removeTextContent();Da(i,{style:{opacity:0},scaleX:0,scaleY:0},e,{dataIndex:o,cb:t,removeOpt:r})},n.getSymbolSize=function(t,e){return Rs(t.getItemVisual(e,"symbolSize"))},n.getSymbolZ2=function(t,e){return t.getItemVisual(e,"z2")},n}(Em);const tC=QM;var eC=function(){function t(t){this.group=new Em,this._SymbolCtor=t||tC}return t.prototype.updateData=function(t,e){this._progressiveEls=null,e=cu(e);var n=this.group,i=t.hostModel,o=this._data,r=this._SymbolCtor,a=e.disableAnimation,s=du(t),l={disableAnimation:a},u=e.getSymbolPoint||function(e){return t.getItemLayout(e)};o||n.removeAll(),t.diff(o).add(function(i){var o=u(i);if(hu(t,o,i,e)){var a=new r(t,i,s,l);a.setPosition(o),t.setItemGraphicEl(i,a),n.add(a)}}).update(function(h,c){var d=o.getItemGraphicEl(c),p=u(h);if(hu(t,p,h,e)){var f=t.getItemVisual(h,"symbol")||"circle",g=d&&d.getSymbolType&&d.getSymbolType();if(!d||g&&g!==f)n.remove(d),(d=new r(t,h,s,l)).setPosition(p);else{d.updateData(t,h,s,l);var m={x:p[0],y:p[1]};a?d.attr(m):Ia(d,m,i)}n.add(d),t.setItemGraphicEl(h,d)}else n.remove(d)}).remove(function(t){var e=o.getItemGraphicEl(t);e&&e.fadeOut(function(){n.remove(e)},i)}).execute(),this._getSymbolPoint=u,this._data=t},t.prototype.updateLayout=function(){var t=this,e=this._data;e&&e.eachItemGraphicEl(function(e,n){var i=t._getSymbolPoint(n);e.setPosition(i),e.markRedraw()})},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=du(t),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e,n){function i(t){t.isGroup||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],n=cu(n);for(var o=t.start;o3?1.4:o>1?1.2:1.1;this._checkTriggerMoveZoom(this,"zoom","zoomOnMouseWheel",t,{scale:i>0?s:1/s,originX:r,originY:a,isAvailableBehavior:null})}if(n){var l=Math.abs(i);this._checkTriggerMoveZoom(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:(i>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:r,originY:a,isAvailableBehavior:null})}}}},n.prototype._pinchHandler=function(t){pu(this._zr,"globalPan")||gu(t)||this._checkTriggerMoveZoom(this,"zoom",null,t,{scale:t.pinchScale>1?1.1:1/1.1,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})},n.prototype._checkTriggerMoveZoom=function(t,e,n,i,o){t._checkPointer(i,o.originX,o.originY)&&(Zf(i.event),i.__ecRoamConsumed=!0,xu(t,e,n,i,o))},n}(Af),aC=Ln();const sC=rC;var lC=[],uC=[],hC=[],cC=jt,dC=kf,pC=Math.abs,fC=Ln(),gC=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.init=function(t,e){var n=new nC,i=new eM,o=this.group,r=new Em;this._controller=new sC(e.getZr()),this._controllerHost={target:r},r.add(n.group),r.add(i.group),o.add(r),this._symbolDraw=n,this._lineDraw=i,this._mainGroup=r,this._firstRender=!0},n.prototype.render=function(t,e,n){var i=this,o=t.coordinateSystem,r=!1;this._model=t,this._api=n,this._active=!0;var a=this._getThumbnailInfo();a&&a.bridge.reset(n);var s=this._symbolDraw,l=this._lineDraw;if(Tu(o)){var u={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?this._mainGroup.attr(u):Ia(this._mainGroup,u,t)}Su(t.getGraph(),Jl(t));var h=t.getData();s.updateData(h);var c=t.getEdgeData();l.updateData(c),this._updateNodeAndLinkScale(),this._updateController(null,t,n),clearTimeout(this._layoutTimeout);var d=t.forceLayout,p=t.get(["force","layoutAnimation"]);d&&(r=!0,this._startForceLayoutIteration(d,n,p));var f=t.get("layout");h.graph.eachNode(function(e){var o=e.dataIndex,r=e.getGraphicEl(),a=e.getModel();if(r){r.off("drag").off("dragend");var s=a.get("draggable");s&&r.on("drag",function(a){switch(f){case"force":d.warmUp(),!i._layouting&&i._startForceLayoutIteration(d,n,p),d.setFixed(o),h.setItemLayout(o,[r.x,r.y]);break;case"circular":h.setItemLayout(o,[r.x,r.y]),e.setLayout({fixed:!0},!0),tu(t,"symbolSize",e,[a.offsetX,a.offsetY]),i.updateLayout(t);break;default:h.setItemLayout(o,[r.x,r.y]),Kl(t.getGraph(),t),i.updateLayout(t)}}).on("dragend",function(){d&&d.setUnfixed(o)}),r.setDraggable(s,!!a.get("cursor")),"adjacency"===a.get(["emphasis","focus"])&&(Mv(r).focus=e.getAdjacentDataIndices())}}),h.graph.eachEdge(function(t){var e=t.getGraphicEl(),n=t.getModel().get(["emphasis","focus"]);e&&"adjacency"===n&&(Mv(e).focus={edge:[t.dataIndex],node:[t.node1.dataIndex,t.node2.dataIndex]})});var g="circular"===t.get("layout")&&t.get(["circular","rotateLabel"]),m=h.getLayout("cx"),y=h.getLayout("cy");h.graph.eachNode(function(t){eu(t,g,m,y)}),this._firstRender=!1,r||this._renderThumbnail(t,n,this._symbolDraw,this._lineDraw)},n.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},n.prototype._startForceLayoutIteration=function(t,e,n){var i=this,o=!1;!function r(){t.step(function(t){i.updateLayout(i._model),!t&&o||(o=!0,i._renderThumbnail(i._model,e,i._symbolDraw,i._lineDraw)),(i._layouting=!t)&&(n?i._layoutTimeout=setTimeout(r,16):r())})}()},n.prototype._updateController=function(t,e,n){var i=this._controller,o=this._controllerHost,r=e.coordinateSystem;Tu(r)?(i.enable(e.get("roam"),{api:n,zInfo:{component:e},triggerInfo:{roamTrigger:e.get("roamTrigger"),isInSelf:function(t,e,n){return r.containPoint([e,n])},isInClip:function(e,n,i){return!t||t.contain(n,i)}}}),o.zoomLimit=e.get("scaleLimit"),o.zoom=r.getZoom(),i.off("pan").off("zoom").on("pan",function(t){n.dispatchAction({seriesId:e.id,type:"graphRoam",dx:t.dx,dy:t.dy})}).on("zoom",function(t){n.dispatchAction({seriesId:e.id,type:"graphRoam",zoom:t.scale,originX:t.originX,originY:t.originY})})):i.disable()},n.prototype.updateViewOnPan=function(t,e,n){this._active&&(function(t,e,n){var i=t.target;i.x+=e,i.y+=n,i.dirty()}(this._controllerHost,n.dx,n.dy),this._updateThumbnailWindow())},n.prototype.updateViewOnZoom=function(t,e,n){this._active&&(function(t,e,n,i){var o=t.target,r=t.zoomLimit,a=t.zoom=t.zoom||1,s=(a=au(a*=e,r))/t.zoom;t.zoom=a,ru(o,n,i,s),o.dirty()}(this._controllerHost,n.zoom,n.originX,n.originY),this._updateNodeAndLinkScale(),Su(t.getGraph(),Jl(t)),this._lineDraw.updateLayout(),e.updateLabelLayout(),this._updateThumbnailWindow())},n.prototype._updateNodeAndLinkScale=function(){var t=this._model,e=t.getData(),n=Jl(t);e.eachItemGraphicEl(function(t,e){t&&t.setSymbolScale(n)})},n.prototype.updateLayout=function(t){this._active&&(Su(t.getGraph(),Jl(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout())},n.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()},n.prototype._getThumbnailInfo=function(){var t=this._model,e=t.coordinateSystem;if("view"===e.type){var n=function(t){if(t)return fC(t).bridge}(t);if(n)return{bridge:n,coordSys:e}}},n.prototype._updateThumbnailWindow=function(){var t=this._getThumbnailInfo();t&&t.bridge.updateWindow(t.coordSys.transform,this._api)},n.prototype._renderThumbnail=function(t,e,n,i){var r=this._getThumbnailInfo();if(r){var s=new Em,l=n.group.children(),u=i.group.children(),h=new Em,c=new Em;s.add(c),s.add(h);for(var d=0;d=0&&t.call(e,n[o],o)},t.prototype.eachEdge=function(t,e){for(var n=this.edges,i=n.length,o=0;o=0&&n[o].node1.dataIndex>=0&&n[o].node2.dataIndex>=0&&t.call(e,n[o],o)},t.prototype.breadthFirstTraverse=function(t,e,n,i){if(e instanceof vC||(e=this._nodesMap[Mu(e)]),e){for(var o="out"===n?"outEdges":"in"===n?"inEdges":"edges",r=0;r=0&&n.node2.dataIndex>=0}),o=0,r=i.length;o=0&&!t.hasKey(p)&&(t.set(p,!0),r.push(d.node1))}for(s=0;s=0&&!t.hasKey(v)&&(t.set(v,!0),a.push(y.node2))}}}return{edge:t.keys(),node:e.keys()}},t}(),_C=function(){function t(t,e,n){this.dataIndex=-1,this.node1=t,this.node2=e,this.dataIndex=null==n?-1:n}return t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(t)},t.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},t.prototype.getTrajectoryDataIndices=function(){var t=B(),e=B();t.set(this.dataIndex,!0);for(var n=[this.node1],i=[this.node2],o=0;o=0&&!t.hasKey(u)&&(t.set(u,!0),n.push(l.node1))}for(o=0;o=0&&!t.hasKey(d)&&(t.set(d,!0),i.push(c.node2))}return{edge:t.keys(),node:e.keys()}},t}();u(vC,Cu("hostGraph","data")),u(_C,Cu("hostGraph","edgeData"));const xC=yC;var wC=Ln(),bC=function(t){this.coordSysDims=[],this.axisMap=B(),this.categoryAxisMap=B(),this.coordSysName=t},SC={cartesian2d:function(t,e,n,i){var o=t.getReferringComponents("xAxis",Km).models[0],r=t.getReferringComponents("yAxis",Km).models[0];e.coordSysDims=["x","y"],n.set("x",o),n.set("y",r),Ru(o)&&(i.set("x",o),e.firstCategoryDimIndex=0),Ru(r)&&(i.set("y",r),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,n,i){var o=t.getReferringComponents("singleAxis",Km).models[0];e.coordSysDims=["single"],n.set("single",o),Ru(o)&&(i.set("single",o),e.firstCategoryDimIndex=0)},polar:function(t,e,n,i){var o=t.getReferringComponents("polar",Km).models[0],r=o.findAxisModel("radiusAxis"),a=o.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],n.set("radius",r),n.set("angle",a),Ru(r)&&(i.set("radius",r),e.firstCategoryDimIndex=0),Ru(a)&&(i.set("angle",a),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},geo:function(t,e,n,i){e.coordSysDims=["lng","lat"]},parallel:function(t,e,n,i){var o=t.ecModel,r=o.getComponent("parallel",t.get("parallelIndex")),a=e.coordSysDims=r.dimensions.slice();c(r.parallelAxisIndex,function(t,r){var s=o.getComponent("parallelAxis",t),l=a[r];n.set(l,s),Ru(s)&&(i.set(l,s),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=r))})},matrix:function(t,e,n,i){var o=t.getReferringComponents("matrix",Km).models[0];e.coordSysDims=["x","y"];var r=o.getDimensionModel("x"),a=o.getDimensionModel("y");n.set("x",r),n.set("y",a),i.set("x",r),i.set("y",a)}};const TC=function(t,e,n){n=n||{};var i,o=e.getSourceManager(),r=!1;t?(r=!0,i=br(t)):r=(i=o.getSource()).sourceFormat===ox;var a=function(t){var e=t.get("coordinateSystem"),n=new bC(e),i=SC[e];if(i)return i(t,n,n.axisMap,n.categoryAxisMap),n}(e),s=function(t,e){var n,i=t.get("coordinateSystem"),o=E_.get(i);return e&&e.coordSysDims&&(n=d(e.coordSysDims,function(t){var n={name:t},i=e.axisMap.get(t);if(i){var o=i.get("type");n.type=function(t){return"category"===t?"ordinal":"time"===t?"time":"float"}(o)}return n})),n||(n=o&&(o.getDimensionsInfo?o.getDimensionsInfo():o.dimensions.slice())||["x","y"]),n}(e,a),l=n.useEncodeDefaulter,u=v(l)?l:l?m(tr,s,e):null,h=zu(i,{coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!r}),p=function(t,e,n){var i,o;return n&&c(t,function(t,r){var a=n.categoryAxisMap.get(t.coordDim);a&&(null==i&&(i=r),t.ordinalMeta=a.getOrdinalMeta(),e&&(t.createInvertedIndices=!0)),null!=t.otherDims.itemName&&(o=!0)}),o||null==i||(t[i].otherDims.itemName=0),i}(h.dimensions,n.createInvertedIndices,a),f=r?null:o.getSharedDataStore(h),g=function(t,e,n){var i,o,r,a=(n=n||{}).byIndex,s=n.stackedCoordDimension;!function(t){return!Nl(t.schema)}(e)?(i=(o=e.schema).dimensions,r=e.store):i=e;var l,u,h,d,p=!(!t||!t.get("stack"));if(c(i,function(t,e){_(t)&&(i[e]=t={name:t}),p&&!t.isExtraCoord&&(a||l||!t.ordinalMeta||(l=t),u||"ordinal"===t.type||"time"===t.type||s&&s!==t.coordDim||(u=t))}),!u||a||l||(a=!0),u){h="__\0ecstackresult_"+t.id,d="__\0ecstackedover_"+t.id,l&&(l.createInvertedIndices=!0);var f=u.coordDim,g=u.type,m=0;c(i,function(t){t.coordDim===f&&m++});var y={name:h,coordDim:f,coordDimIndex:m,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length},v={name:d,coordDim:d,coordDimIndex:m+1,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length+1};o?(r&&(y.storeDimIndex=r.ensureCalculationDimension(d,g),v.storeDimIndex=r.ensureCalculationDimension(h,g)),o.appendCalculationDimension(y),o.appendCalculationDimension(v)):(i.push(y),i.push(v))}return{stackedDimension:u&&u.name,stackedByDimension:l&&l.name,isStackedByIndex:a,stackedOverDimension:d,stackResultDimension:h}}(e,{schema:h,store:f}),x=new zM(h,e);x.setCalculationInfo(g);var w=null!=p&&function(t){if(t.sourceFormat===ox)return!y(xn(function(t){for(var e=0;e=0},t.prototype.indexOfName=function(t){return this._getDataWithEncodedVisual().indexOfName(t)},t.prototype.getItemVisual=function(t,e){return this._getDataWithEncodedVisual().getItemVisual(t,e)},t}();const CC=MC;var kC=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.hasSymbolVisual=!0,e}return e(n,t),n.prototype.init=function(e){function n(){return i._categoriesData}t.prototype.init.apply(this,arguments);var i=this;this.legendVisualProvider=new CC(n,n),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},n.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},n.prototype.mergeDefaultAndTheme=function(e){t.prototype.mergeDefaultAndTheme.apply(this,arguments),_n(e,"edgeLabel",["show"])},n.prototype.getInitialData=function(t,e){var n,i=t.edges||t.links||[],o=t.data||t.nodes||[],r=this;if(o&&i){ZM(n=this)&&(n.__curvenessList=[],n.__edgeMap={},HM(n));var a=function(t,e,n,i,o){for(var r=new xC(!0),a=0;a "+f)),h++)}var g,y=n.get("coordinateSystem");if("cartesian2d"===y||"polar"===y||"matrix"===y)g=TC(t,n);else{var v=E_.get(y),_=v&&v.dimensions||[];l(_,"value")<0&&_.concat(["value"]);var x=zu(t,{coordDimensions:_,encodeDefine:n.getEncode()}).dimensions;(g=new zM(x,n)).initData(t)}var w,b,S,T=new zM(["value"],n);return T.initData(u,s),o&&o(g,T),b=(w={mainData:g,struct:r,structAttr:"graph",datas:{node:g,edge:T},datasAttr:{node:"data",edge:"edgeData"}}).mainData,(S=w.datas)||(S={main:b},w.datasAttr={main:"data"}),w.datas=w.mainData=null,Au(b,S,w),c(S,function(t){c(b.TRANSFERABLE_METHODS,function(e){t.wrapMethod(e,m(ku,w))})}),b.wrapMethod("cloneShallow",m(Lu,w)),c(b.CHANGABLE_METHODS,function(t){b.wrapMethod(t,m(Iu,w))}),O(S[b.dataType]===b),r.update(),r}(o,i,this,0,function(t,e){function n(t,e){var n=o.call(this,t,e);return n.resolveParentPath=i,n}function i(t){if(t&&("label"===t[0]||"label"===t[1])){var e=t.slice();return"label"===t[0]?e[0]="edgeLabel":"label"===t[1]&&(e[1]="edgeLabel"),e}return t}t.wrapMethod("getItemModel",function(t){var e=r._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t});var o=i_.prototype.getModel;e.wrapMethod("getItemModel",function(t){return t.resolveParentPath=i,t.getModel=n,t})});return c(a.edges,function(t){!function(t,e,n,i){if(ZM(n)){var o=WM(t,e,n),r=n.__edgeMap,a=r[jM(o)];r[o]&&!a?r[o].isForward=!0:a&&r[o]&&(a.isForward=!0,r[o].isForward=!1),r[o]=r[o]||[],r[o].push(i)}}(t.node1,t.node2,this,t.dataIndex)},this),a.data}},n.prototype.getGraph=function(){return this.getData().graph},n.prototype.getEdgeData=function(){return this.getGraph().edgeData},n.prototype.getCategoriesData=function(){return this._categoriesData},n.prototype.formatTooltip=function(t,e,n){if("edge"===n){var i=this.getData(),o=this.getDataParams(t,n),r=i.graph.getEdgeByIndex(t),a=i.getName(r.node1.dataIndex),s=i.getName(r.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),$r("nameValue",{name:l.join(" > "),value:o.value,noValue:null==o.value})}return sa({series:this,dataIndex:t,multipleSeries:e})},n.prototype._updateCategoriesData=function(){var t=d(this.option.categories||[],function(t){return null!=t.value?t:a({value:0},t)}),e=new zM(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray(function(t){return e.getItemModel(t)})},n.prototype.setZoom=function(t){this.option.zoom=t},n.prototype.setCenter=function(t){this.option.center=t},n.prototype.isAnimationEnabled=function(){return t.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},n.type="series.graph",n.dependencies=["grid","polar","geo","singleAxis","calendar"],n.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:X_.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:X_.color.primary}}},n}(_w);const IC=kC,LC=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.hasSymbolVisual=!0,e}return e(n,t),n.prototype.getInitialData=function(t,e){return TC(null,this,{useEncodeDefaulter:!0})},n.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?5e3:this.get("progressive"):t},n.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?1e4:this.get("progressiveThreshold"):t},n.prototype.brushSelector=function(t,e,n){return n.point(e.getItemLayout(t))},n.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},n.type="series.scatter",n.dependencies=["grid","polar","geo","singleAxis","calendar","matrix"],n.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:X_.color.primary}},universalTransition:{divideShape:"clone"}},n}(_w);var PC=function(){},DC=function(t){function n(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return e(n,t),n.prototype.getDefaultShape=function(){return new PC},n.prototype.reset=function(){this.notClear=!1,this._off=0},n.prototype.buildPath=function(t,e){var n,i=e.points,o=e.size,r=this.symbolProxy,a=r.shape,s=t.getContext?t.getContext():t,l=this.softClipShape;if(s&&o[0]<4)this._ctx=s;else{for(this._ctx=null,n=this._off;n=0;s--){var l=2*s,u=i[l]-r/2,h=i[l+1]-a/2;if(t>=u&&e>=h&&t<=u+r&&e<=h+a)return s}return-1},n.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e);return this.getBoundingRect().contain(t=n[0],e=n[1])?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},n.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape,n=e.points,i=e.size,o=i[0],r=i[1],a=1/0,s=1/0,l=-1/0,u=-1/0,h=0;h=0&&(l.dataIndex=n+(t.startIndex||0))})},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}();const OC=AC;var zC="undefined"!=typeof Float32Array,EC=zC?Float32Array:Array;const RC=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){var i=t.getData();this._updateSymbolDraw(i,t).updateData(i,{clipShape:this._getClipShape(t)}),this._finished=!0},n.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData();this._updateSymbolDraw(i,t).incrementalPrepareUpdate(i),this._finished=!1},n.prototype.incrementalRender=function(t,e,n){this._symbolDraw.incrementalUpdate(t,e.getData(),{clipShape:this._getClipShape(e)}),this._finished=t.end===e.getData().count()},n.prototype.updateTransform=function(t,e,n){var i=t.getData();if(this.group.dirty(),!this._finished||i.count()>1e4)return{update:!0};var o=Nu("").reset(t,e,n);o.progress&&o.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout(i)},n.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},n.prototype._getClipShape=function(t){if(t.get("clip",!0)){var e=t.coordinateSystem;return e&&e.getArea&&e.getArea(.1)}},n.prototype._updateSymbolDraw=function(t,e){var n=this._symbolDraw,i=e.pipelineContext.large;return n&&i===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=i?new OC:new nC,this._isLargeDraw=i,this.group.removeAll()),this.group.add(n.group),n},n.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},n.prototype.dispose=function(){},n.type="scatter",n}(Kb);var BC={left:0,right:0,top:0,bottom:0},NC=["25%","25%"];const FC=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.mergeDefaultAndTheme=function(e,n){var i=Jo(e.outerBounds);t.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&e.outerBounds&&$o(e.outerBounds,i)},n.prototype.mergeOption=function(e,n){t.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&e.outerBounds&&$o(this.option.outerBounds,e.outerBounds)},n.type="grid",n.dependencies=["xAxis","yAxis"],n.layoutMode="box",n.defaultOption={show:!1,z:0,left:"15%",top:65,right:"10%",bottom:80,containLabel:!1,outerBoundsMode:"auto",outerBounds:BC,outerBoundsContain:"all",outerBoundsClampWidth:NC[0],outerBoundsClampHeight:NC[1],backgroundColor:X_.color.transparent,borderWidth:1,borderColor:X_.color.neutral30},n}(W_);var VC=function(){function t(){}return t.prototype.getNeedCrossZero=function(){return!this.option.scale},t.prototype.getCoordSysModel=function(){},t}(),ZC=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Km).models[0]},n.type="cartesian2dAxis",n}(W_);u(ZC,VC);var HC={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:X_.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:X_.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:X_.color.axisSplitLine,width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:[X_.color.backgroundTint,X_.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:X_.color.neutral00,borderColor:X_.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:"auto"}},WC=r({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},HC),jC=r({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:X_.color.axisMinorSplitLine,width:1}}},HC);const GC={category:WC,value:jC,time:r({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},jC),log:s({logBase:10},jC)};var UC=0;const YC=function(){function t(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++UC,this._onCollect=t.onCollect}return t.createByAxisModel=function(e){var n=e.option,i=n.data,o=i&&d(i,Fu);return new t({categories:o,needCollect:!o,deduplication:!1!==n.dedplication})},t.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},t.prototype.parseAndCollect=function(t){var e,n=this._needCollect;if(!_(t)&&!n)return t;if(n&&!this._deduplication)return this.categories[e=this.categories.length]=t,this._onCollect&&this._onCollect(t,e),e;var i=this._getOrCreateMap();return null==(e=i.get(t))&&(n?(this.categories[e=this.categories.length]=t,i.set(t,e),this._onCollect&&this._onCollect(t,e)):e=NaN),e},t.prototype._getOrCreateMap=function(){return this._map||(this._map=B(this.categories))},t}();var XC={value:1,category:1,time:1,log:1},qC=null,KC=function(){function t(){this.normalize=Xu,this.scale=qu}return t.prototype.updateMethods=function(t){t.hasBreaks()?(this.normalize=_f(t.normalize,t),this.scale=_f(t.scale,t)):(this.normalize=Xu,this.scale=qu)},t}(),$C=function(){function t(t){this._calculator=new KC,this._setting=t||{},this._extent=[1/0,-1/0];var e=vo();e&&(this._brkCtx=e.createScaleBreakContext(),this._brkCtx.update(this._extent))}return t.prototype.getSetting=function(t){return this._setting[t]},t.prototype._innerUnionExtent=function(t){var e=this._extent;this._innerSetExtent(t[0]e[1]?t[1]:e[1])},t.prototype.unionExtentFromData=function(t,e){this._innerUnionExtent(t.getApproximateExtent(e))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(t,e){this._innerSetExtent(t,e)},t.prototype._innerSetExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e),this._brkCtx&&this._brkCtx.update(n)},t.prototype.setBreaksFromOption=function(t){var e=vo();e&&this._innerSetBreak(e.parseAxisBreakOption(t,_f(this.parse,this)))},t.prototype._innerSetBreak=function(t){this._brkCtx&&(this._brkCtx.setBreaks(t),this._calculator.updateMethods(this._brkCtx),this._brkCtx.update(this._extent))},t.prototype._innerGetBreaks=function(){return this._brkCtx?this._brkCtx.breaks:[]},t.prototype.hasBreaks=function(){return!!this._brkCtx&&this._brkCtx.hasBreaks()},t.prototype._getExtentSpanWithBreaks=function(){return this._brkCtx&&this._brkCtx.hasBreaks()?this._brkCtx.getExtentSpan():this._extent[1]-this._extent[0]},t.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(t){this._isBlank=t},t}();Fn($C);const JC=$C;var QC=function(t){function n(e){var n=t.call(this,e)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new YC({})),y(i)&&(i=new YC({categories:d(i,function(t){return b(t)?t.value:t})})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return e(n,t),n.prototype.parse=function(t){return null==t?NaN:_(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},n.prototype.contain=function(t){return Yu(t,this._extent)&&t>=0&&t=0&&t=0&&t=t},n.prototype.getOrdinalMeta=function(){return this._ordinalMeta},n.prototype.calcNiceTicks=function(){},n.prototype.calcNiceExtent=function(){},n.type="ordinal",n}(JC);JC.registerClass(QC);const tk=QC;var ek=rn,nk=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="interval",e._interval=0,e._intervalPrecision=2,e}return e(n,t),n.prototype.parse=function(t){return null==t||""===t?NaN:Number(t)},n.prototype.contain=function(t){return Yu(t,this._extent)},n.prototype.normalize=function(t){return this._calculator.normalize(t,this._extent)},n.prototype.scale=function(t){return this._calculator.scale(t,this._extent)},n.prototype.getInterval=function(){return this._interval},n.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=Gu(t)},n.prototype.getTicks=function(t){t=t||{};var e=this._interval,n=this._extent,i=this._niceExtent,o=this._intervalPrecision,r=vo(),a=[];if(!e)return a;if("only_break"===t.breakTicks&&r)return r.addBreaksToTicks(a,this._brkCtx.breaks,this._extent),a;n[0]=0&&(l=ek(l+u*e,o))}if(a.length>0&&l===a[a.length-1].value)break;if(a.length>1e4)return[]}var h=a.length?a[a.length-1].value:i[1];return n[1]>h&&a.push(t.expandToNicedExtent?{value:ek(h+e,o)}:{value:n[1]}),r&&r.pruneTicksByBreak(t.pruneByBreak,a,this._brkCtx.breaks,function(t){return t.value},this._interval,this._extent),"none"!==t.breakTicks&&r&&r.addBreaksToTicks(a,this._brkCtx.breaks,this._extent),a},n.prototype.getMinorTicks=function(t){for(var e=this.getTicks({expandToNicedExtent:!0}),n=[],i=this.getExtent(),o=1;oi[0]&&co&&(a=r.interval=o);var s=r.intervalPrecision=Gu(a);return function(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),Uu(t,0,e),Uu(t,1,e),t[0]>t[1]&&(t[0]=t[1])}(r.niceTickExtent=[rn(Math.ceil(t[0]/a)*a,s),rn(Math.floor(t[1]/a)*a,s)],t),r}(i,o,t,e,n);this._intervalPrecision=r.intervalPrecision,this._interval=r.interval,this._niceExtent=r.niceTickExtent}},n.prototype.calcNiceExtent=function(t){var e=this._extent.slice();if(e[0]===e[1])if(0!==e[0]){var n=Math.abs(e[0]);t.fixMax||(e[1]+=n/2),e[0]-=n/2}else e[1]=1;isFinite(e[1]-e[0])||(e[0]=0,e[1]=1),this._innerSetExtent(e[0],e[1]),e=this._extent.slice(),this.calcNiceTicks(t.splitNumber,t.minInterval,t.maxInterval);var i=this._interval,o=this._intervalPrecision;t.fixMin||(e[0]=ek(Math.floor(e[0]/i)*i,o)),t.fixMax||(e[1]=ek(Math.ceil(e[1]/i)*i,o)),this._innerSetExtent(e[0],e[1])},n.prototype.setNiceExtent=function(t,e){this._niceExtent=[t,e]},n.type="interval",n}(JC);JC.registerClass(nk);const ik=nk;var ok="__ec_stack_",rk=function(t){function n(e){var n=t.call(this,e)||this;return n.type="time",n}return e(n,t),n.prototype.getLabel=function(t){var e=this.getSetting("useUTC");return bo(t.value,x_[function(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}(xo(this._minLevelUnit))]||x_.second,e,this.getSetting("locale"))},n.prototype.getFormattedLabel=function(t,e,n){var i=this.getSetting("useUTC");return function(t,e,n,i,o){var r=null;if(_(n))r=n;else if(v(n)){var a={time:t.time,level:t.time.level},s=vo();s&&s.makeAxisLabelFormatterParamBreak(a,t.break),r=n(t.value,e,a)}else{var l=t.time;if(l){var u=n[l.lowerTimeUnit][l.upperTimeUnit];r=u[Math.min(l.level,u.length-1)]||""}else{var h=So(t.value,o);r=n[h][h][0]}}return bo(new Date(t.value),r,o,i)}(t,e,n,this.getSetting("locale"),i)},n.prototype.getTicks=function(t){t=t||{};var e=this._interval,n=this._extent,i=vo(),o=[];if(!e)return o;var r=this.getSetting("useUTC");if(i&&"only_break"===t.breakTicks)return vo().addBreaksToTicks(o,this._brkCtx.breaks,this._extent),o;var a=So(n[1],r);o.push({value:n[0],time:{level:0,upperTimeUnit:a,lowerTimeUnit:a}});var s=function(t,e,n,i,o,r){function a(t,e,n,o,a,s,l){for(var h=function(t,e){var n=new Date(0);n[t](1);var i=n.getTime();n[t](1+e);var o=n.getTime()-i;return function(t,e){return Math.max(0,Math.round((e-t)/o))}}(a,t),c=e,d=new Date(c);c1e4));)if(d[a](d[o]()+t),c=d.getTime(),r){var p=r.calcNiceTickMultiple(c,h);p>0&&(d[a](d[o]()+p*t),c=d.getTime())}l.push({value:c,notAdd:!0})}function s(t,o,r){var s=[],l=!o.length;if(!Qu(xo(t),i[0],i[1],n)){l&&(o=[{value:rh(i[0],t,n)},{value:i[1]}]);for(var u=0;u=i[0]&&h<=i[1]&&a(d,h,c,p,f,0,s),"year"===t&&r.length>1&&0===u&&r.unshift({value:r[0].value-d})}}for(u=0;u=i[0]&&x<=i[1]&&p++)}var w=o/e;if(p>1.5*w&&g>w/1.5)break;if(h.push(v),p>w||t===l[m])break}c=[]}}var b=f(d(h,function(t){return f(t,function(t){return t.value>=i[0]&&t.value<=i[1]&&!t.notAdd})}),function(t){return t.length>0}),S=[],T=b.length-1;for(m=0;mn&&(this._approxInterval=n);var o=ak.length,r=Math.min(function(t,e,n,i){for(;n>>1;t[o][1]0;)i*=10;var o=[lk(hk(e[0]/i)*i),lk(uk(e[1]/i)*i)];this._interval=i,this._intervalPrecision=Gu(i),this._niceExtent=o}},n.prototype.calcNiceExtent=function(e){t.prototype.calcNiceExtent.call(this,e),this._fixMin=e.fixMin,this._fixMax=e.fixMax},n.prototype.contain=function(e){return e=dk(e)/dk(this.base),t.prototype.contain.call(this,e)},n.prototype.normalize=function(e){return e=dk(e)/dk(this.base),t.prototype.normalize.call(this,e)},n.prototype.scale=function(e){return e=t.prototype.scale.call(this,e),ck(this.base,e)},n.prototype.setBreaksFromOption=function(t){var e=vo();if(e){var n=e.logarithmicParseBreaksFromOption(t,this.base,_f(this.parse,this)),i=n.parsedLogged;this._originalScale._innerSetBreak(n.parsedOriginal),this._innerSetBreak(i)}},n.type="log",n}(ik);JC.registerClass(pk);const fk=pk;var gk=function(){function t(t,e,n){this._prepareParams(t,e,n)}return t.prototype._prepareParams=function(t,e,n){n[1]0&&s>0&&!l&&(a=0),a<0&&s<0&&!u&&(s=0));var c=this._determinedMin,d=this._determinedMax;return null!=c&&(a=c,l=!0),null!=d&&(s=d,u=!0),{min:a,max:s,minFixed:l,maxFixed:u,isBlank:h}},t.prototype.modifyDataMinMax=function(t,e){this[yk[t]]=e},t.prototype.setDeterminedMinMax=function(t,e){this[mk[t]]=e},t.prototype.freeze=function(){this.frozen=!0},t}(),mk={min:"_determinedMin",max:"_determinedMax"},yk={min:"_dataMin",max:"_dataMax"},vk=function(){function t(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return t.prototype.getAxis=function(t){return this._axes[t]},t.prototype.getAxes=function(){return d(this._dimList,function(t){return this._axes[t]},this)},t.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),f(this.getAxes(),function(e){return e.scale.type===t})},t.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},t}(),_k=["x","y"],xk=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cartesian2d",e.dimensions=_k,e}return e(n,t),n.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,e=this.getAxis("y").scale;if(_h(t)&&_h(e)){var n=t.getExtent(),i=e.getExtent(),o=this.dataToPoint([n[0],i[0]]),r=this.dataToPoint([n[1],i[1]]),a=n[1]-n[0],s=i[1]-i[0];if(a&&s){var l=(r[0]-o[0])/a,u=(r[1]-o[1])/s,h=this._transform=[l,0,0,u,o[0]-n[0]*l,o[1]-i[0]*u];this._invTransform=bt([],h)}}},n.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},n.prototype.containPoint=function(t){var e=this.getAxis("x"),n=this.getAxis("y");return e.contain(e.toLocalCoord(t[0]))&&n.contain(n.toLocalCoord(t[1]))},n.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},n.prototype.containZone=function(t,e){var n=this.dataToPoint(t),i=this.dataToPoint(e),o=this.getArea(),r=new lg(n[0],n[1],i[0]-n[0],i[1]-n[1]);return o.intersect(r)},n.prototype.dataToPoint=function(t,e,n){n=n||[];var i=t[0],o=t[1];if(this._transform&&null!=i&&isFinite(i)&&null!=o&&isFinite(o))return et(n,t,this._transform);var r=this.getAxis("x"),a=this.getAxis("y");return n[0]=r.toGlobalCoord(r.dataToCoord(i,e)),n[1]=a.toGlobalCoord(a.dataToCoord(o,e)),n},n.prototype.clampData=function(t,e){var n=this.getAxis("x").scale,i=this.getAxis("y").scale,o=n.getExtent(),r=i.getExtent(),a=n.parse(t[0]),s=i.parse(t[1]);return(e=e||[])[0]=Math.min(Math.max(Math.min(o[0],o[1]),a),Math.max(o[0],o[1])),e[1]=Math.min(Math.max(Math.min(r[0],r[1]),s),Math.max(r[0],r[1])),e},n.prototype.pointToData=function(t,e,n){if(n=n||[],this._invTransform)return et(n,t,this._invTransform);var i=this.getAxis("x"),o=this.getAxis("y");return n[0]=i.coordToData(i.toLocalCoord(t[0]),e),n[1]=o.coordToData(o.toLocalCoord(t[1]),e),n},n.prototype.getOtherAxis=function(t){return this.getAxis("x"===t.dim?"y":"x")},n.prototype.getArea=function(t){t=t||0;var e=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),i=Math.min(e[0],e[1])-t,o=Math.min(n[0],n[1])-t,r=Math.max(e[0],e[1])-i+t,a=Math.max(n[0],n[1])-o+t;return new lg(i,o,r,a)},n}(vk);const wk=xk;var bk=Ln(),Sk=Ln(),Tk=1,Mk=2,Ck=Sh("axisTick"),kk=Sh("axisLabel"),Ik=[0,1],Lk=function(){function t(t,e,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=n||[0,0]}return t.prototype.contain=function(t){var e=this._extent,n=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return t>=n&&t<=i},t.prototype.containData=function(t){return this.scale.contain(this.scale.parse(t))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(t){return sn(t||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(t,e){var n=this._extent;n[0]=t,n[1]=e},t.prototype.dataToCoord=function(t,e){var n=this._extent,i=this.scale;return t=i.normalize(i.parse(t)),this.onBand&&"ordinal"===i.type&&Ph(n=n.slice(),i.count()),nn(t,Ik,n,e)},t.prototype.coordToData=function(t,e){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&Ph(n=n.slice(),i.count());var o=nn(t,n,Ik,e);return this.scale.scale(o)},t.prototype.pointToData=function(t,e){},t.prototype.getTicksCoords=function(t){var e=(t=t||{}).tickModel||this.getTickModel(),n=d(function(t,e,n){var i=t.getTickModel().get("customValues");if(i){var o=t.scale.getExtent();return{ticks:f(wh(t,i),function(t){return t>=o[0]&&t<=o[1]})}}return"category"===t.type?function(t,e){var n,i,o=Ck(t),r=ph(e),a=Th(o,r);if(a)return a;if(e.get("show")&&!t.scale.isBlank()||(n=[]),v(r))n=Lh(t,r,!0);else if("auto"===r){var s=bh(t,t.getLabelModel(),xh(Mk));i=s.labelCategoryInterval,n=d(s.labels,function(t){return t.tickValue})}else n=Ih(t,i=r,!0);return Mh(o,r,{ticks:n,tickCategoryInterval:i})}(t,e):{ticks:d(t.scale.getTicks(n),function(t){return t.value})}}(this,e,{breakTicks:t.breakTicks,pruneByBreak:t.pruneByBreak}).ticks,function(t){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(t):t),tickValue:t}},this);return function(t,e,n,i){function o(t,e){return t=rn(t),e=rn(e),h?t>e:ts[1];o(e[0].coord,s[0])&&(i?e[0].coord=s[0]:e.shift()),i&&o(s[0],e[0].coord)&&e.unshift({coord:s[0],onBand:!0}),o(s[1],a.coord)&&(i?a.coord=s[1]:e.pop()),i&&o(a.coord,s[1])&&e.push({coord:s[1],onBand:!0})}}(this,n,e.get("alignWithLabel"),t.clamp),n},t.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)return[];var t=this.model.getModel("minorTick").get("splitNumber");return t>0&&t<100||(t=5),d(this.scale.getMinorTicks(t),function(t){return d(t,function(t){return{coord:this.dataToCoord(t),tickValue:t}},this)},this)},t.prototype.getViewLabels=function(t){return function(t,e){var n=t.getLabelModel().get("customValues");if(n){var i=ch(t),o=t.scale.getExtent();return{labels:d(f(wh(t,n),function(t){return t>=o[0]&&t<=o[1]}),function(e){var n={value:e};return{formattedLabel:i(n),rawLabel:t.scale.getLabel(n),tickValue:e,time:void 0,break:void 0}})}}return"category"===t.type?function(t,e){var n=t.getLabelModel(),i=bh(t,n,e);return!n.get("show")||t.scale.isBlank()?{labels:[]}:i}(t,e):function(t){var e=t.scale.getTicks(),n=ch(t);return{labels:d(e,function(e,i){return{formattedLabel:n(e,i),rawLabel:t.scale.getLabel(e),tickValue:e.value,time:e.time,break:e.break}})}}(t)}(this,t=t||xh(Mk)).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),n=e[1]-e[0]+(this.onBand?1:0);0===n&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},t.prototype.calculateCategoryInterval=function(t){return function(t,e){var n=e.kind,i=function(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}(t),o=ch(t),r=(i.axisRotate-i.labelRotate)/180*Math.PI,a=t.scale,s=a.getExtent(),l=a.count();if(s[1]-s[0]<1)return 0;var u=1;l>40&&(u=Math.max(1,Math.floor(l/40)));for(var h=s[0],c=t.dataToCoord(h+1)-t.dataToCoord(h),d=Math.abs(c*Math.cos(r)),p=Math.abs(c*Math.sin(r)),f=0,g=0;h<=s[1];h+=u){var m,y=Ge(o({value:h}),i.font,"center","top");m=1.3*y.height,f=Math.max(f,1.3*y.width,7),g=Math.max(g,m,7)}var v=f/d,_=g/p;isNaN(v)&&(v=1/0),isNaN(_)&&(_=1/0);var x=Math.max(0,Math.floor(Math.min(v,_)));if(n===Tk)return e.out.noPxChangeTryDetermine.push(_f(Ch,null,t,x,l)),x;var w=kh(t,x,l);return null!=w?w:x}(this,t=t||xh(Mk))},t}(),Pk=function(t){function n(e,n,i,o,r){var a=t.call(this,e,n,i)||this;return a.index=0,a.type=o||"value",a.position=r||"bottom",a}return e(n,t),n.prototype.isHorizontal=function(){var t=this.position;return"top"===t||"bottom"===t},n.prototype.getGlobalExtent=function(t){var e=this.getExtent();return e[0]=this.toGlobalCoord(e[0]),e[1]=this.toGlobalCoord(e[1]),t&&e[0]>e[1]&&e.reverse(),e},n.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},n.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},n}(Lk);const Dk=Pk;var Ak=["label","labelLine","layoutOption","priority","defaultAttr","marginForce","minMarginForce","marginDefault","suggestIgnore"],Ok=[0,0,0,0],zk="expandAxisBreak",Ek=Math.PI,Rk=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],Bk=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],Nk=Ln(),Fk=Ln(),Vk=function(){function t(t){this.recordMap={},this.resolveAxisNameOverlap=t}return t.prototype.ensureRecord=function(t){var e=t.axis.dim,n=t.componentIndex,i=this.recordMap,o=i[e]||(i[e]=[]);return o[n]||(o[n]={ready:{}})},t}(),Zk=[1,0,0,1,0,0],Hk=new lg(0,0,0,0),Wk=function(t,e,n,i,o,r){if(mh(t.nameLocation)){var a=r.stOccupiedRect;a&&Bh(function(t,e,n){return t.transform=ls(t.transform,n),t.localRect=ss(t.localRect,e),t.rect=ss(t.rect,e),n&&t.rect.applyTransform(n),t.axisAligned=as(n),t.obb=void 0,(t.label=t.label||{}).ignore=!1,t}({},a,r.transGroup.transform),i,o)}else Nh(r.labelInfoList,r.dirVec,i,o)},jk=function(){function t(t,e,n,i){this.group=new Em,this._axisModel=t,this._api=e,this._local={},this._shared=i||new Vk(Wk),this._resetCfgDetermined(n)}return t.prototype.updateCfg=function(t){var e=this._cfg.raw;e.position=t.position,e.labelOffset=t.labelOffset,this._resetCfgDetermined(e)},t.prototype.__getRawCfg=function(){return this._cfg.raw},t.prototype._resetCfgDetermined=function(t){var e=this._axisModel,n=e.getDefaultOption?e.getDefaultOption():{},i=L(t.axisName,e.get("name")),o=e.get("nameMoveOverlap");null!=o&&"auto"!==o||(o=L(t.defaultNameMoveOverlap,!0));var r={raw:t,position:t.position,rotation:t.rotation,nameDirection:L(t.nameDirection,1),tickDirection:L(t.tickDirection,1),labelDirection:L(t.labelDirection,1),labelOffset:L(t.labelOffset,0),silent:L(t.silent,!0),axisName:i,nameLocation:P(e.get("nameLocation"),n.nameLocation,"end"),shouldNameMoveOverlap:Gh(i)&&o,optionHideOverlap:e.get(["axisLabel","hideOverlap"]),showMinorTicks:e.get(["minorTick","show"])};this._cfg=r;var a=new Em({x:r.position[0],y:r.position[1],rotation:r.rotation});a.updateTransform(),this._transformGroup=a;var s=this._shared.ensureRecord(e);s.transGroup=this._transformGroup,s.dirVec=new Gf(Math.cos(-r.rotation),Math.sin(-r.rotation))},t.prototype.build=function(t,e){var n=this;return t||(t={axisLine:!0,axisTickLabelEstimate:!1,axisTickLabelDetermine:!0,axisName:!0}),c(Gk,function(i){t[i]&&Uk[i](n._cfg,n._local,n._shared,n._axisModel,n.group,n._transformGroup,n._api,e||{})}),this},t.innerTextLayout=function(t,e,n){var i,o,r=un(e-t);return hn(r)?(o=n>0?"top":"bottom",i="center"):hn(r-Ek)?(o=n>0?"bottom":"top",i="center"):(o="middle",i=r>0&&r0?"right":"left":n>0?"left":"right"),{rotation:r,textAlign:i,textVerticalAlign:o}},t.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},t.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},t}(),Gk=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],Uk={axisLine:function(t,e,n,i,o,r,s){var l=i.get(["axisLine","show"]);if("auto"===l&&(l=!0,null!=t.raw.axisLineAutoShow&&(l=!!t.raw.axisLineAutoShow)),l){var u=i.axis.getExtent(),h=r.transform,d=[u[0],0],p=[u[1],0],f=d[0]>p[0];h&&(et(d,d,h),et(p,p,h));var g=a({lineCap:"round"},i.getModel(["axisLine","lineStyle"]).getLineStyle()),m={strokeContainThreshold:t.raw.strokeContainThreshold||5,silent:!0,z2:1,style:g};if(i.get(["axisLine","breakLine"])&&i.axis.scale.hasBreaks())Vu().buildAxisBreakLine(i,o,r,m);else{var y=new cb(a({shape:{x1:d[0],y1:d[1],x2:p[0],y2:p[1]}},m));Ha(y.shape,y.style.lineWidth),y.anid="line",o.add(y)}var v=i.get(["axisLine","symbol"]);if(null!=v){var x=i.get(["axisLine","symbolSize"]);_(v)&&(v=[v,v]),(_(x)||w(x))&&(x=[x,x]);var b=Bs(i.get(["axisLine","symbolOffset"])||0,x),S=x[0],T=x[1];c([{rotate:t.rotation+Math.PI/2,offset:b[0],r:0},{rotate:t.rotation-Math.PI/2,offset:b[1],r:Math.sqrt((d[0]-p[0])*(d[0]-p[0])+(d[1]-p[1])*(d[1]-p[1]))}],function(e,n){if("none"!==v[n]&&null!=v[n]){var i=Es(v[n],-S/2,-T/2,S,T,g.stroke,!0),r=e.r+e.offset,a=f?p:d;i.attr({rotation:e.rotate,x:a[0]+r*Math.cos(t.rotation),y:a[1]-r*Math.sin(t.rotation),silent:!0,z2:11}),o.add(i)}})}}},axisTickLabelEstimate:function(t,e,n,i,o,r,a,s){Hh(e,o,s)&&Fh(t,e,n,i,o,r,a,Tk)},axisTickLabelDetermine:function(t,e,n,i,o,r,a,l){Hh(e,o,l)&&Fh(t,e,n,i,o,r,a,Mk);var u=function(t,e,n,i){var o=i.axis,r=i.getModel("axisTick"),a=r.get("show");if("auto"===a&&(a=!0,null!=t.raw.axisTickAutoShow&&(a=!!t.raw.axisTickAutoShow)),!a||o.scale.isBlank())return[];for(var l=r.getModel("lineStyle"),u=t.tickDirection*r.get("length"),h=Zh(o.getTicksCoords(),n.transform,u,s(l.getLineStyle(),{stroke:i.get(["axisLine","lineStyle","color"])}),"ticks"),c=0;ci[1],l="start"===e&&!s||"start"!==e&&s;return hn(a-Ek/2)?(r=l?"bottom":"top",o="center"):hn(a-1.5*Ek)?(r=l?"top":"bottom",o="center"):(r="middle",o=a<1.5*Ek&&a>Ek/2?l?"left":"right":l?"right":"left"),{rotation:a,textAlign:o,textVerticalAlign:r}}(t.rotation,h,w||0,f),null!=(x=t.raw.axisNameAvailableWidth)&&(x=Math.abs(x/Math.sin(_.rotation)),!isFinite(x)&&(x=null)));var b=d.getFont(),S=i.get("nameTruncate",!0)||{},T=S.ellipsis,M=I(t.raw.nameTruncateMaxWidth,S.maxWidth,x),C=s.nameMarginLevel||0,k=new Tv({x:m.x,y:m.y,rotation:_.rotation,silent:jk.isLabelSilent(i),style:co(d,{text:u,font:b,overflow:"truncate",width:M,ellipsis:T,fill:d.getTextColor()||i.get(["axisLine","lineStyle","color"]),align:d.get("align")||_.textAlign,verticalAlign:d.get("verticalAlign")||_.textVerticalAlign}),z2:1});if(is({el:k,componentModel:i,itemName:u}),k.__fullText=u,k.anid="name",i.get("triggerEvent")){var L=jk.makeAxisEventDataBase(i);L.targetType="axisName",L.name=u,Mv(k).eventData=L}r.add(k),k.updateTransform(),e.nameEl=k;var P=l.nameLayout=Oh({label:k,priority:k.z2,defaultAttr:{ignore:k.ignore},marginDefault:mh(h)?Rk[C]:Bk[C]});if(l.nameLocation=h,o.add(k),k.decomposeTransform(),t.shouldNameMoveOverlap&&P){var D=n.ensureRecord(i);n.resolveAxisNameOverlap(t,n,i,P,y,D)}}}},Yk=new mv,Xk=new mv;const qk=jk;var Kk=[[3,1],[0,2]],$k=function(){function t(t,e,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=_k,this._initCartesian(t,e,n),this.model=t}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(t,e){function n(t){var e,n=g(t),i=n.length;if(i){for(var o=[],r=i-1;r>=0;r--){var a=t[+n[r]],s=a.model,l=a.scale;Wu(l)&&s.get("alignTicks")&&null==s.get("interval")?o.push(a):(hh(l,s),Wu(l)&&(e=a))}o.length&&(e||hh((e=o.pop()).scale,e.model),c(o,function(t){!function(t,e,n){var i=ik.prototype,o=i.getTicks.call(n),r=i.getTicks.call(n,{expandToNicedExtent:!0}),a=o.length-1,s=i.getInterval.call(n),l=uh(t,e),u=l.extent,h=l.fixMin,c=l.fixMax;"log"===t.type&&(u=Ku(t.base,u,!0)),t.setBreaksFromOption(vh(e)),t.setExtent(u[0],u[1]),t.calcNiceExtent({splitNumber:a,fixMin:h,fixMax:c});var d=i.getExtent.call(t);h&&(u[0]=d[0]),c&&(u[1]=d[1]);var p=i.getInterval.call(t),f=u[0],g=u[1];if(h&&c)p=(g-f)/a;else if(h)for(g=u[0]+p*a;gu[0]&&isFinite(f)&&isFinite(u[0]);)p=ju(p),f=u[1]-p*a;else{t.getTicks().length-1>a&&(p=ju(p));var m=p*a;(f=rn((g=Math.ceil(u[1]/p)*p)-m))<0&&u[0]>=0?(f=0,g=rn(m)):g>0&&u[1]<=0&&(g=0,f=-rn(m))}var y=(o[0].value-r[0].value)/s,v=(o[a].value-r[a].value)/s;i.setExtent.call(t,f+p*y,g+p*v),i.setInterval.call(t,p),(y||v)&&i.setNiceExtent.call(t,f+p,g-p)}(t.scale,t.model,e.scale)}))}}var i=this._axesMap;this._updateScale(t,this.model),n(i.x),n(i.y);var o={};c(i.x,function(t){qh(i,"y",t,o)}),c(i.y,function(t){qh(i,"x",t,o)}),this.resize(this.model,e)},t.prototype.resize=function(t,e,n){var i=Xo(t,e),o=this._rect=Yo(t.getBoxLayoutParams(),i.refContainer),r=this._axesMap,a=this._coordsList,s=t.get("containLabel");if($h(r,o),!n){var u=function(t,e,n,i,o){var r=new Vk(Jk);return c(n,function(n){return c(n,function(n){yh(n.model)&&(n.axisBuilder=function(t,e,n,i,o,r){for(var a=Uh(t,n),s=!1,l=!1,u=0;ul[1]&&l.reverse(),(null==a||a>l[1])&&(a=l[1]),aa)return!0;if(r){var s=nc(t).seriesDataCount,l=i.getExtent();return Math.abs(l[0]-l[1])/s>a}return!1}return!0===n},t.prototype.makeElOption=function(t,e,n,i,o){},t.prototype.createPointerEl=function(t,e,n,i){var o=e.pointer;if(o){var r=cI(t).pointerEl=new qp[o.type](dI(e.pointer));t.add(r)}},t.prototype.createLabelEl=function(t,e,n,i){if(e.label){var o=cI(t).labelEl=new Tv(dI(e.label));t.add(o),lc(o,i)}},t.prototype.updatePointerEl=function(t,e,n){var i=cI(t).pointerEl;i&&e.pointer&&(i.setStyle(e.pointer.style),n(i,{shape:e.pointer.shape}))},t.prototype.updateLabelEl=function(t,e,n,i){var o=cI(t).labelEl;o&&(o.setStyle(e.label.style),n(o,{x:e.label.x,y:e.label.y}),lc(o,i))},t.prototype._renderHandle=function(t){if(!this._dragging&&this.updateHandleTransform){var e,n=this._axisPointerModel,i=this._api.getZr(),o=this._handle,r=n.getModel("handle"),a=n.get("status");if(!r.get("show")||!a||"hide"===a)return o&&i.remove(o),void(this._handle=null);this._handle||(e=!0,o=this._handle=$a(r.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){Zf(t.event)},onmousedown:pI(this._onHandleDragMove,this,0,0),drift:pI(this._onHandleDragMove,this),ondragend:pI(this._onHandleDragEnd,this)}),i.add(o)),hc(o,n,!1),o.setStyle(r.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=r.get("size");y(s)||(s=[s,s]),o.scaleX=s[0]/2,o.scaleY=s[1]/2,vs(this,"_doDispatchAxisPointer",r.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},t.prototype._moveHandleToValue=function(t,e){ac(this._axisPointerModel,!e&&this._moveAnimation,this._handle,uc(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(t,e){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(uc(n),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(uc(i)),cI(n).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){if(this._handle){var t=this._payloadInfo,e=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),n=this._group,i=this._handle;e&&n&&(this._lastGraphicKey=null,n&&e.remove(n),i&&e.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),_s(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}},t}(),gI=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.makeElOption=function(t,e,n,i,o){var r=n.axis,a=r.grid,s=i.get("type"),l=pc(a,r).getOtherAxis(r).getGlobalExtent(),u=r.toGlobalCoord(r.dataToCoord(e,!0));if(s&&"none"!==s){var h=function(t){var e,n=t.get("type"),i=t.getModel(n+"Style");return"line"===n?(e=i.getLineStyle()).fill=null:"shadow"===n&&((e=i.getAreaStyle()).stroke=null),e}(i),c=mI[s](r,u,l);c.style=h,t.graphicKey=c.type,t.pointer=c}!function(t,e,n,i,o,r){var a=qk.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=o.get(["label","margin"]),function(t,e,n,i,o){var r=cc(n.get("value"),e.axis,e.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),a=n.getModel("label"),s=S_(a.get("padding")||0),l=a.getFont(),u=Ge(r,l),h=o.position,c=u.width+s[1]+s[3],d=u.height+s[0]+s[2],p=o.align;"right"===p&&(h[0]-=c),"center"===p&&(h[0]-=c/2);var f=o.verticalAlign;"bottom"===f&&(h[1]-=d),"middle"===f&&(h[1]-=d/2),function(t,e,n,i){var o=i.getWidth(),r=i.getHeight();t[0]=Math.min(t[0]+e,o)-e,t[1]=Math.min(t[1]+n,r)-n,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}(h,c,d,i);var g=a.get("backgroundColor");g&&"auto"!==g||(g=e.get(["axisLine","lineStyle","color"])),t.label={x:h[0],y:h[1],style:co(a,{text:r,font:l,fill:a.getTextColor(),padding:s,backgroundColor:g}),z2:10}}(e,i,o,r,{position:dc(i.axis,t,n),align:a.textAlign,verticalAlign:a.textVerticalAlign})}(e,t,Uh(a.getRect(),n),n,i,o)},n.prototype.getHandleTransform=function(t,e,n){var i=Uh(e.axis.grid.getRect(),e,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var o=dc(e.axis,t,i);return{x:o[0],y:o[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},n.prototype.updateHandleTransform=function(t,e,n,i){var o=n.axis,r=o.grid,a=o.getGlobalExtent(!0),s=pc(r,o).getOtherAxis(o).getGlobalExtent(),l="x"===o.dim?0:1,u=[t.x,t.y];u[l]+=e[l],u[l]=Math.min(a[1],u[l]),u[l]=Math.max(a[0],u[l]);var h=(s[1]+s[0])/2,c=[h,h];return c[l]=u[l],{x:u[0],y:u[1],rotation:t.rotation,cursorPoint:c,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},n}(fI),mI={line:function(t,e,n){var i,o,r;return{type:"Line",subPixelOptimize:!0,shape:(i=[e,n[0]],o=[e,n[1]],r=fc(t),{x1:i[r=r||0],y1:i[1-r],x2:o[r],y2:o[1-r]})}},shadow:function(t,e,n){var i,o,r,a=Math.max(1,t.getBandWidth());return{type:"Rect",shape:(i=[e-a/2,n[0]],o=[a,n[1]-n[0]],r=fc(t),{x:i[r=r||0],y:i[1-r],width:o[r],height:o[1-r]})}}};const yI=gI,vI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="axisPointer",n.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:X_.color.border,width:1,type:"dashed"},shadowStyle:{color:X_.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:X_.color.neutral00,padding:[5,7,5,7],backgroundColor:X_.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:X_.color.accent40,throttle:40}},n}(W_);var _I=Ln(),xI=c,wI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){var i=e.getComponent("tooltip"),o=t.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";gc("axisPointer",n,function(t,e,n){"none"!==o&&("leave"===t||o.indexOf(t)>=0)&&n({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})})},n.prototype.remove=function(t,e){vc("axisPointer",e)},n.prototype.dispose=function(t,e){vc("axisPointer",e)},n.type="axisPointer",n}(ww);const bI=wI;var SI=Ln();const TI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="tooltip",n.dependencies=["axisPointer"],n.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:X_.color.neutral00,shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:X_.color.border,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:X_.color.borderShade,width:1,type:"dashed",textStyle:{}}},textStyle:{color:X_.color.tertiary,fontSize:14}},n}(W_);var MI=Ic(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),CI=Lc(Ic(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),"transition"),kI=Lc(MI,"transform"),II="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(Qp.transform3dSupported?"will-change:transform;":""),LI=function(){function t(t,e){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,Qp.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var i=this._zr=t.getZr(),o=e.appendTo,r=o&&(_(o)?document.querySelector(o):M(o)?o:v(o)&&o(t.getDom()));Dc(this._styleCoord,i,r,t.getWidth()/2,t.getHeight()/2),(r||t.getDom()).appendChild(n),this._api=t,this._container=r;var a=this;n.onmouseenter=function(){a._enterable&&(clearTimeout(a._hideTimeout),a._show=!0),a._inContent=!0},n.onmousemove=function(t){if(t=t||window.event,!a._enterable){var e=i.handler;dt(i.painter.getViewportRoot(),t,!0),e.dispatch("mousemove",t)}},n.onmouseleave=function(){a._inContent=!1,a._enterable&&a._show&&a.hideLater(a._hideDelay)}}return t.prototype.update=function(t){if(!this._container){var e=this._api.getDom(),n=(r="position",(a=(o=e).currentStyle||document.defaultView&&document.defaultView.getComputedStyle(o))?r?a[r]:a:null),i=e.style;"absolute"!==i.position&&"absolute"!==n&&(i.position="relative")}var o,r,a,s=t.get("alwaysShowContent");s&&this._moveIfResized(),this._alwaysShowContent=s,this._enableDisplayTransition=t.get("displayTransition")&&t.get("transitionDuration")>0,this.el.className=t.get("className")||""},t.prototype.show=function(t,e){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=n.style,o=this._styleCoord;n.innerHTML?i.cssText=II+function(t,e,n,i){var o=[],r=t.get("transitionDuration"),a=t.get("backgroundColor"),s=t.get("shadowBlur"),l=t.get("shadowColor"),u=t.get("shadowOffsetX"),h=t.get("shadowOffsetY"),d=t.getModel("textStyle"),p=aa(t,"html");return o.push("box-shadow:"+u+"px "+h+"px "+s+"px "+l),e&&r>0&&o.push(function(t,e,n){var i="cubic-bezier(0.23,1,0.32,1)",o="",r="";return n&&(r="opacity"+(o=" "+t/2+"s "+i)+",visibility"+o),e||(o=" "+t+"s "+i,r+=(r.length?",":"")+(Qp.transformSupported?""+kI+o:",left"+o+",top"+o)),CI+":"+r}(r,n,i)),a&&o.push("background-color:"+a),c(["width","color","radius"],function(e){var n="border-"+e,i=Vo(n),r=t.get(i);null!=r&&o.push(n+":"+r+("color"===e?"":"px"))}),o.push(function(t){var e=[],n=t.get("fontSize"),i=t.getTextColor();i&&e.push("color:"+i),e.push("font:"+t.getFont());var o=L(t.get("lineHeight"),Math.round(3*n/2));n&&e.push("line-height:"+o+"px");var r=t.get("textShadowColor"),a=t.get("textShadowBlur")||0,s=t.get("textShadowOffsetX")||0,l=t.get("textShadowOffsetY")||0;return r&&a&&e.push("text-shadow:"+s+"px "+l+"px "+a+"px "+r),c(["decoration","align"],function(n){var i=t.get(n);i&&e.push("text-"+n+":"+i)}),e.join(";")}(d)),null!=p&&o.push("padding:"+S_(p).join("px ")+"px"),o.join(";")+";"}(t,!this._firstShow,this._longHide,this._enableDisplayTransition)+Pc(o[0],o[1],!0)+"border-color:"+Wo(e)+";"+(t.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(t,e,n,i,o){var r=this.el;if(null!=t){var a="";if(_(o)&&"item"===n.get("trigger")&&!kc(n)&&(a=function(t,e,n){if(!_(n)||"inside"===n)return"";var i=t.get("backgroundColor"),o=t.get("borderWidth");e=Wo(e);var r,a,s="left"===(r=n)?"right":"right"===r?"left":"top"===r?"bottom":"top",u=Math.max(1.5*Math.round(o),6),h="",c=kI+":";l(["left","right"],s)>-1?(h+="top:50%",c+="translateY(-50%) rotate("+(a="left"===s?-225:-45)+"deg)"):(h+="left:50%",c+="translateX(-50%) rotate("+(a="top"===s?225:45)+"deg)");var d=a*Math.PI/180,p=u+o,f=p*Math.abs(Math.cos(d))+p*Math.abs(Math.sin(d)),g=e+" solid "+o+"px;";return'
'}(n,i,o)),_(t))r.innerHTML=t+a;else if(t){r.innerHTML="",y(t)||(t=[t]);for(var s=0;s=0?this._tryShow(n,i):"leave"===e&&this._hide(i))},this))},n.prototype._keepShow=function(){var t=this._tooltipModel,e=this._ecModel,n=this._api,i=t.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==i&&"click"!==i){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&o.manuallyShowTip(t,e,n,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},n.prototype.manuallyShowTip=function(t,e,n,i){if(i.from!==this.uid&&!Qp.node&&n.getDom()){var o=Rc(i,n);this._ticket="";var r=i.dataByCoordSys,a=function(t,e,n){var i=Dn(t).queryOptionMap,o=i.keys()[0];if(o&&"series"!==o){var r,a=An(e,o,i.get(o),{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];if(a)return n.getViewOfComponentModel(a).group.traverse(function(e){var n=Mv(e).tooltipConfig;if(n&&n.name===t.name)return r=e,!0}),r?{componentMainType:o,componentIndex:a.componentIndex,el:r}:void 0}}(i,e,n);if(a){var s=a.el.getBoundingRect().clone();s.applyTransform(a.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:a.el,position:i.position,positionDefault:"bottom"},o)}else if(i.tooltip&&null!=i.x&&null!=i.y){var l=AI;l.x=i.x,l.y=i.y,l.update(),Mv(l).tooltipConfig={name:null,option:i.tooltip},this._tryShow({offsetX:i.x,offsetY:i.y,target:l},o)}else if(r)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:r,tooltipOption:i.tooltipOption},o);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(t,e,n,i))return;var u=_c(i,e),h=u.point[0],c=u.point[1];null!=h&&null!=c&&this._tryShow({offsetX:h,offsetY:c,target:u.el,position:i.position,positionDefault:"bottom"},o)}else null!=i.x&&null!=i.y&&(n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},o))}},n.prototype.manuallyHideTip=function(t,e,n,i){this._tooltipModel&&this._tooltipContent.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(Rc(i,n))},n.prototype._manuallyAxisShowTip=function(t,e,n,i){var o=i.seriesIndex,r=i.dataIndex,a=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=o&&null!=r&&null!=a){var s=e.getSeriesByIndex(o);if(s&&"axis"===Ec([s.getData().getItemModel(r),s,(s.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:r,position:i.position}),!0}},n.prototype._tryShow=function(t,e){var n=t.target;if(this._tooltipModel){this._lastX=t.offsetX,this._lastY=t.offsetY;var i=t.dataByCoordSys;if(i&&i.length)this._showAxisTooltip(i,t);else if(n){var o,r;if("legend"===Mv(n).ssrType)return;this._lastDataByCoordSys=null,Os(n,function(t){if(t.tooltipDisabled)return o=r=null,!0;o||r||(null!=Mv(t).dataIndex?o=t:null!=Mv(t).tooltipConfig&&(r=t))},!0),o?this._showSeriesItemTooltip(t,o,e):r?this._showComponentItemTooltip(t,r,e):this._hide(e)}else this._lastDataByCoordSys=null,this._hide(e)}},n.prototype._showOrMove=function(t,e){var n=t.get("showDelay");e=_f(e,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(e,n):e()},n.prototype._showAxisTooltip=function(t,e){var n=this._ecModel,i=this._tooltipModel,o=[e.offsetX,e.offsetY],r=Ec([e.tooltipOption],i),s=this._renderMode,l=[],u=$r("section",{blocks:[],noHeader:!0}),h=[],d=new mw;c(t,function(t){c(t.dataByAxis,function(t){var e=n.getComponent(t.axisDim+"Axis",t.axisIndex),o=t.value;if(e&&null!=o){var r=cc(o,e.axis,n,t.seriesDataIndices,t.valueLabelOpt),p=$r("section",{header:r,noHeader:!z(r),sortBlocks:!0,blocks:[]});u.blocks.push(p),c(t.seriesDataIndices,function(u){var c=n.getSeriesByIndex(u.seriesIndex),f=u.dataIndexInside,g=c.getDataParams(f);if(!(g.dataIndex<0)){g.axisDim=t.axisDim,g.axisIndex=t.axisIndex,g.axisType=t.axisType,g.axisId=t.axisId,g.axisValue=dh(e.axis,{value:o}),g.axisValueLabel=r,g.marker=d.makeTooltipMarker("item",Wo(g.color),s);var m=zr(c.formatTooltip(f,!0,null)),y=m.frag;if(y){var v=Ec([c],i).get("valueFormatter");p.blocks.push(v?a({valueFormatter:v},y):y)}m.text&&h.push(m.text),l.push(g)}})}})}),u.blocks.reverse(),h.reverse();var p=e.position,f=r.get("order"),g=ia(u,d,s,f,n.get("useUTC"),r.get("textStyle"));g&&h.unshift(g);var m=h.join("richText"===s?"\n\n":"
");this._showOrMove(r,function(){this._updateContentNotChangedOnAxis(t,l)?this._updatePosition(r,p,o[0],o[1],this._tooltipContent,l):this._showTooltipContent(r,m,l,Math.random()+"",o[0],o[1],p,null,d)})},n.prototype._showSeriesItemTooltip=function(t,e,n){var i=this._ecModel,o=Mv(e),r=o.seriesIndex,s=i.getSeriesByIndex(r),l=o.dataModel||s,u=o.dataIndex,h=o.dataType,c=l.getData(h),d=this._renderMode,p=t.positionDefault,f=Ec([c.getItemModel(u),l,s&&(s.coordinateSystem||{}).model],this._tooltipModel,p?{position:p}:null),g=f.get("trigger");if(null==g||"item"===g){var m=l.getDataParams(u,h),y=new mw;m.marker=y.makeTooltipMarker("item",Wo(m.color),d);var v=zr(l.formatTooltip(u,!1,h)),_=f.get("order"),x=f.get("valueFormatter"),w=v.frag,b=w?ia(x?a({valueFormatter:x},w):w,y,d,_,i.get("useUTC"),f.get("textStyle")):v.text,S="item_"+l.name+"_"+u;this._showOrMove(f,function(){this._showTooltipContent(f,b,m,S,t.offsetX,t.offsetY,t.position,t.target,y)}),n({type:"showTip",dataIndexInside:u,dataIndex:c.getRawIndex(u),seriesIndex:r,from:this.uid})}},n.prototype._showComponentItemTooltip=function(t,e,n){var i="html"===this._renderMode,r=Mv(e),a=r.tooltipConfig.option||{},s=a.encodeHTMLContent;_(a)&&(a={content:a,formatter:a},s=!0),s&&i&&a.content&&((a=o(a)).content=lt(a.content));var l=[a],u=this._ecModel.getComponent(r.componentMainType,r.componentIndex);u&&l.push(u),l.push({formatter:a.content});var h=t.positionDefault,c=Ec(l,this._tooltipModel,h?{position:h}:null),d=c.get("content"),p=Math.random()+"",f=new mw;this._showOrMove(c,function(){var n=o(c.get("formatterParams")||{});this._showTooltipContent(c,d,n,p,t.offsetX,t.offsetY,t.position,e,f)}),n({type:"showTip",from:this.uid})},n.prototype._showTooltipContent=function(t,e,n,i,o,r,a,s,l){if(this._ticket="",t.get("showContent")&&t.get("show")){var u=this._tooltipContent;u.setEnterable(t.get("enterable"));var h=t.get("formatter");a=a||t.get("position");var c=e,d=this._getNearestPoint([o,r],n,t.get("trigger"),t.get("borderColor"),t.get("defaultBorderColor",!0)).color;if(h)if(_(h)){var p=t.ecModel.get("useUTC"),f=y(n)?n[0]:n;c=h,f&&f.axisType&&f.axisType.indexOf("time")>=0&&(c=bo(f.axisValue,c,p)),c=Ho(c,n,!0)}else if(v(h)){var g=_f(function(e,i){e===this._ticket&&(u.setContent(i,l,t,d,a),this._updatePosition(t,a,o,r,u,n,s))},this);this._ticket=i,c=h(n,i,g)}else c=h;u.setContent(c,l,t,d,a),u.show(t,d),this._updatePosition(t,a,o,r,u,n,s)}},n.prototype._getNearestPoint=function(t,e,n,i,o){return"axis"===n||y(e)?{color:i||o}:y(e)?void 0:{color:i||e.color||e.borderColor}},n.prototype._updatePosition=function(t,e,n,i,o,r,a){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u=o.getSize(),h=t.get("align"),c=t.get("verticalAlign"),d=a&&a.getBoundingRect().clone();if(a&&d.applyTransform(a.transform),v(e)&&(e=e([n,i],r,o.el,d,{viewSize:[s,l],contentSize:u.slice()})),y(e))n=jm(e[0],s),i=jm(e[1],l);else if(b(e)){var p=e;p.width=u[0],p.height=u[1];var f=Yo(p,{width:s,height:l});n=f.x,i=f.y,h=null,c=null}else if(_(e)&&a){var g=function(t,e,n,i){var o=n[0],r=n[1],a=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=e.width,h=e.height;switch(t){case"inside":s=e.x+u/2-o/2,l=e.y+h/2-r/2;break;case"top":s=e.x+u/2-o/2,l=e.y-r-a;break;case"bottom":s=e.x+u/2-o/2,l=e.y+h+a;break;case"left":s=e.x-o-a,l=e.y+h/2-r/2;break;case"right":s=e.x+u+a,l=e.y+h/2-r/2}return[s,l]}(e,d,u,t.get("borderWidth"));n=g[0],i=g[1]}else g=function(t,e,n,i,o,r,a){var s=n.getSize(),l=s[0],u=s[1];return null!=r&&(t+l+r+2>i?t-=l+r:t+=r),null!=a&&(e+u+a>o?e-=u+a:e+=a),[t,e]}(n,i,o,s,l,h?null:20,c?null:20),n=g[0],i=g[1];h&&(n-=Bc(h)?u[0]/2:"right"===h?u[0]:0),c&&(i-=Bc(c)?u[1]/2:"bottom"===c?u[1]:0),kc(t)&&(g=function(t,e,n,i,o){var r=n.getSize(),a=r[0],s=r[1];return t=Math.min(t+a,i)-a,e=Math.min(e+s,o)-s,[t=Math.max(t,0),e=Math.max(e,0)]}(n,i,o,s,l),n=g[0],i=g[1]),o.moveTo(n,i)},n.prototype._updateContentNotChangedOnAxis=function(t,e){var n=this._lastDataByCoordSys,i=this._cbParamsList,o=!!n&&n.length===t.length;return o&&c(n,function(n,r){var a=n.dataByAxis||[],s=(t[r]||{}).dataByAxis||[];(o=o&&a.length===s.length)&&c(a,function(t,n){var r=s[n]||{},a=t.seriesDataIndices||[],l=r.seriesDataIndices||[];(o=o&&t.value===r.value&&t.axisType===r.axisType&&t.axisId===r.axisId&&a.length===l.length)&&c(a,function(t,e){var n=l[e];o=o&&t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex}),i&&c(t.seriesDataIndices,function(t){var n=t.seriesIndex,r=e[n],a=i[n];r&&a&&a.data!==r.data&&(o=!1)})})}),this._lastDataByCoordSys=t,this._cbParamsList=e,!!o},n.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},n.prototype.dispose=function(t,e){!Qp.node&&e.getDom()&&(_s(this,"_updatePosition"),this._tooltipContent.dispose(),vc("itemTooltip",e))},n.type="tooltip",n}(ww);const zI=OI;var EI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.layoutMode={type:"box",ignoreSize:!0},e}return e(n,t),n.type="title",n.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:"center",top:X_.size.m,backgroundColor:X_.color.transparent,borderColor:X_.color.primary,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:X_.color.primary},subtextStyle:{fontSize:12,color:X_.color.quaternary}},n}(W_),RI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){if(this.group.removeAll(),t.get("show")){var i=this.group,o=t.getModel("textStyle"),r=t.getModel("subtextStyle"),a=t.get("textAlign"),s=L(t.get("textBaseline"),t.get("textVerticalAlign")),l=new Tv({style:co(o,{text:t.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),h=t.get("subtext"),c=new Tv({style:co(r,{text:h,fill:r.getTextColor(),y:u.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),d=t.get("link"),p=t.get("sublink"),f=t.get("triggerEvent",!0);l.silent=!d&&!f,c.silent=!p&&!f,d&&l.on("click",function(){jo(d,"_"+t.get("target"))}),p&&c.on("click",function(){jo(p,"_"+t.get("subtarget"))}),Mv(l).eventData=Mv(c).eventData=f?{componentType:"title",componentIndex:t.componentIndex}:null,i.add(l),h&&i.add(c);var g=i.getBoundingRect(),m=t.getBoxLayoutParams();m.width=g.width,m.height=g.height;var y=Yo(m,Xo(t,n).refContainer,t.get("padding"));a||("middle"===(a=t.get("left")||t.get("right"))&&(a="center"),"right"===a?y.x+=y.width:"center"===a&&(y.x+=y.width/2)),s||("center"===(s=t.get("top")||t.get("bottom"))&&(s="middle"),"bottom"===s?y.y+=y.height:"middle"===s&&(y.y+=y.height/2),s=s||"top"),i.x=y.x,i.y=y.y,i.markRedraw();var v={align:a,verticalAlign:s};l.setStyle(v),c.setStyle(v),g=i.getBoundingRect();var _=y.margin,x=t.getItemStyle(["color","opacity"]);x.fill=t.get("backgroundColor");var w=new mv({shape:{x:g.x-_[3],y:g.y-_[0],width:g.width+_[1]+_[3],height:g.height+_[0]+_[2],r:t.get("borderRadius")},style:x,subPixelOptimize:!0,silent:!0});i.add(w)}},n.type="title",n}(ww),BI=["x","y","radius","angle","single"],NI=["cartesian2d","polar","singleAxis"],FI=function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(t){this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},t}();const VI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="dataZoom.select",n}(function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e._autoThrottle=!0,e._noTarget=!0,e._rangePropMode=["percent","percent"],e}return e(n,t),n.prototype.init=function(t,e,n){var i=Fc(t);this.settledOption=i,this.mergeDefaultAndTheme(t,n),this._doInit(i)},n.prototype.mergeOption=function(t){var e=Fc(t);r(this.option,t,!0),r(this.settledOption,e,!0),this._doInit(e)},n.prototype._doInit=function(t){var e=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var n=this.settledOption;c([["start","startValue"],["end","endValue"]],function(t,i){"value"===this._rangePropMode[i]&&(e[t[0]]=n[t[0]]=null)},this),this._resetTarget()},n.prototype._resetTarget=function(){var t=this.get("orient",!0),e=this._targetAxisInfoMap=B();this._fillSpecifiedTargetAxis(e)?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(e,this._orient)),this._noTarget=!0,e.each(function(t){t.indexList.length&&(this._noTarget=!1)},this)},n.prototype._fillSpecifiedTargetAxis=function(t){var e=!1;return c(BI,function(n){var i=this.getReferringComponents(Nc(n),$m);if(i.specified){e=!0;var o=new FI;c(i.models,function(t){o.add(t.componentIndex)}),t.set(n,o)}},this),e},n.prototype._fillAutoTargetAxisByOrient=function(t,e){function n(e,n){var i=e[0];if(i){var r=new FI;if(r.add(i.componentIndex),t.set(n,r),o=!1,"x"===n||"y"===n){var a=i.getReferringComponents("grid",Km).models[0];a&&c(e,function(t){i.componentIndex!==t.componentIndex&&a===t.getReferringComponents("grid",Km).models[0]&&r.add(t.componentIndex)})}}}var i=this.ecModel,o=!0;if(o){var r="vertical"===e?"y":"x";n(i.findComponents({mainType:r+"Axis"}),r)}o&&n(i.findComponents({mainType:"singleAxis",filter:function(t){return t.get("orient",!0)===e}}),"single"),o&&c(BI,function(e){if(o){var n=i.findComponents({mainType:Nc(e),filter:function(t){return"category"===t.get("type",!0)}});if(n[0]){var r=new FI;r.add(n[0].componentIndex),t.set(e,r),o=!1}}},this)},n.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis(function(e){!t&&(t=e)},this),"y"===t?"vertical":"horizontal"},n.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var e=this.ecModel.option;this.option.throttle=e.animation&&e.animationDurationUpdate>0?100:20}},n.prototype._updateRangeUse=function(t){var e=this._rangePropMode,n=this.get("rangeMode");c([["start","startValue"],["end","endValue"]],function(i,o){var r=null!=t[i[0]],a=null!=t[i[1]];r&&!a?e[o]="percent":!r&&a?e[o]="value":n?e[o]=n[o]:r&&(e[o]="percent")})},n.prototype.noTarget=function(){return this._noTarget},n.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis(function(e,n){null==t&&(t=this.ecModel.getComponent(Nc(e),n))},this),t},n.prototype.eachTargetAxis=function(t,e){this._targetAxisInfoMap.each(function(n,i){c(n.indexList,function(n){t.call(e,i,n)})})},n.prototype.getAxisProxy=function(t,e){var n=this.getAxisModel(t,e);if(n)return n.__dzAxisProxy},n.prototype.getAxisModel=function(t,e){var n=this._targetAxisInfoMap.get(t);if(n&&n.indexMap[e])return this.ecModel.getComponent(Nc(t),e)},n.prototype.setRawRange=function(t){var e=this.option,n=this.settledOption;c([["start","startValue"],["end","endValue"]],function(i){null==t[i[0]]&&null==t[i[1]]||(e[i[0]]=n[i[0]]=t[i[0]],e[i[1]]=n[i[1]]=t[i[1]])},this),this._updateRangeUse(t)},n.prototype.setCalculatedRange=function(t){var e=this.option;c(["start","startValue","end","endValue"],function(n){e[n]=t[n]})},n.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},n.prototype.getValueRange=function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var n=this.findRepresentativeAxisProxy();return n?n.getDataValueWindow():void 0},n.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var e,n=this._targetAxisInfoMap.keys(),i=0;i=0}(e)){var n=Nc(this._dimName),i=e.getReferringComponents(n,Km).models[0];i&&this._axisIndex===i.componentIndex&&t.push(e)}},this),t},t.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},t.prototype.getMinMaxSpan=function(){return o(this._minMaxSpan)},t.prototype.calculateDataWindow=function(t){function e(t,e,n,i,r){var a=r?"Span":"ValueSpan";Vc(0,t,n,"all",u["min"+a],u["max"+a]);for(var s=0;s<2;s++)e[s]=nn(t[s],n,i,!0),r&&(e[s]=o.parse(e[s]))}var n,i=this._dataExtent,o=this.getAxisModel().axis.scale,r=this._dataZoomModel.getRangePropMode(),a=[0,100],s=[],l=[];HI(["start","end"],function(e,u){var h=t[e],c=t[e+"Value"];"percent"===r[u]?(null==h&&(h=a[u]),c=o.parse(nn(h,a,i))):(n=!0,h=nn(c=null==c?i[u]:o.parse(c),i,a)),l[u]=null==c||isNaN(c)?i[u]:c,s[u]=null==h||isNaN(h)?a[u]:h}),WI(l),WI(s);var u=this._minMaxSpan;return n?e(l,s,i,a,!1):e(s,l,a,i,!0),{valueWindow:l,percentWindow:s}},t.prototype.reset=function(t){if(t===this._dataZoomModel){var e=this.getTargetSeriesModels();this._dataExtent=function(t,e,n){var i=[1/0,-1/0];HI(n,function(t){!function(t,e,n){e&&c(gh(e,n),function(n){var i=e.getApproximateExtent(n);i[0]t[1]&&(t[1]=i[1])})}(i,t.getData(),e)});var o=t.getAxisModel(),r=sh(o.axis.scale,o,i).calculate();return[r.min,r.max]}(this,this._dimName,e),this._updateMinMaxSpan();var n=this.calculateDataWindow(t.settledOption);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,this._setAxisModel()}},t.prototype.filterData=function(t,e){if(t===this._dataZoomModel){var n=this._dimName,i=this.getTargetSeriesModels(),o=t.get("filterMode"),r=this._valueWindow;"none"!==o&&HI(i,function(t){var e=t.getData(),i=e.mapDimensionsAll(n);if(i.length){if("weakFilter"===o){var a=e.getStore(),s=d(i,function(t){return e.getDimensionIndex(t)},e);e.filterSelf(function(t){for(var e,n,o,l=0;lr[1];if(h&&!c&&!d)return!0;h&&(o=!0),c&&(e=!0),d&&(n=!0)}return o&&e&&n})}else HI(i,function(n){if("empty"===o)t.setData(e=e.map(n,function(t){return function(t){return t>=r[0]&&t<=r[1]}(t)?t:NaN}));else{var i={};i[n]=r,e.selectRange(i)}});HI(i,function(t){e.setApproximateExtent(r,t)})}})}},t.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},e=this._dataZoomModel,n=this._dataExtent;HI(["min","max"],function(i){var o=e.get(i+"Span"),r=e.get(i+"ValueSpan");null!=r&&(r=this.getAxisModel().axis.scale.parse(r)),null!=r?o=nn(n[0]+r,n,[0,100],!0):null!=o&&(r=nn(o,[0,100],n,!0)-n[0]),t[i+"Span"]=o,t[i+"ValueSpan"]=r},this)},t.prototype._setAxisModel=function(){var t=this.getAxisModel(),e=this._percentWindow,n=this._valueWindow;if(e){var i=sn(n,[0,500]);i=Math.min(i,20);var o=t.axis.scale.rawExtentInfo;0!==e[0]&&o.setDeterminedMinMax("min",+n[0].toFixed(i)),100!==e[1]&&o.setDeterminedMinMax("max",+n[1].toFixed(i)),o.freeze()}},t}();const GI=jI,UI={getTargetSeries:function(t){function e(e){t.eachComponent("dataZoom",function(n){n.eachTargetAxis(function(i,o){var r=t.getComponent(Nc(i),o);e(i,o,r,n)})})}e(function(t,e,n,i){n.__dzAxisProxy=null});var n=[];e(function(e,i,o,r){o.__dzAxisProxy||(o.__dzAxisProxy=new GI(e,i,r,t),n.push(o.__dzAxisProxy))});var i=B();return c(n,function(t){c(t.getTargetSeriesModels(),function(t){i.set(t.uid,t)})}),i},overallReset:function(t,e){t.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(e,n){t.getAxisProxy(e,n).reset(t)}),t.eachTargetAxis(function(n,i){t.getAxisProxy(n,i).filterData(t,e)})}),t.eachComponent("dataZoom",function(t){var e=t.findRepresentativeAxisProxy();if(e){var n=e.getDataPercentWindow(),i=e.getDataValueWindow();t.setCalculatedRange({start:n[0],end:n[1],startValue:i[0],endValue:i[1]})}})}};var YI=!1,XI=function(){},qI={};const KI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.optionUpdated=function(){t.prototype.optionUpdated.apply(this,arguments);var e=this.ecModel;c(this.option.feature,function(t,n){var i=Gc(n);i&&(i.getDefaultOption&&(i.defaultOption=i.getDefaultOption(e)),r(t,i.defaultOption))})},n.type="toolbox",n.layoutMode={type:"box",ignoreSize:!0},n.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:X_.color.border,borderRadius:0,borderWidth:0,padding:X_.size.m,itemSize:15,itemGap:X_.size.s,showTitle:!0,iconStyle:{borderColor:X_.color.accent50,color:"none"},emphasis:{iconStyle:{borderColor:X_.color.accent50}},tooltip:{show:!1,position:"bottom"}},n}(W_);var $I=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.render=function(t,e,n,i){function o(o,d){var p,f=h[o],g=h[d],m=l[f],y=new i_(m,t,t.ecModel);if(i&&null!=i.newTitle&&i.featureName===f&&(m.title=i.newTitle),f&&!g){if(function(t){return 0===t.indexOf("my")}(f))p={onclick:y.option.onclick,featureName:f};else{var v=Gc(f);if(!v)return;p=new v}u[f]=p}else if(!(p=u[g]))return;p.uid=mo("toolbox-feature"),p.model=y,p.ecModel=e,p.api=n;var x=p instanceof XI;f||!g?!y.get("show")||x&&p.unusable?x&&p.remove&&p.remove(e,n):(function(i,o,l){var u,h,d=i.getModel("iconStyle"),p=i.getModel(["emphasis","iconStyle"]),f=o instanceof XI&&o.getIcons?o.getIcons():i.get("icon"),g=i.get("title")||{};_(f)?(u={})[l]=f:u=f,_(g)?(h={})[l]=g:h=g;var m=i.iconPaths={};c(u,function(l,u){var c=$a(l,{},{x:-a/2,y:-a/2,width:a,height:a});c.setStyle(d.getItemStyle()),c.ensureState("emphasis").style=p.getItemStyle();var f=new Tv({style:{text:h[u],align:p.get("textAlign"),borderRadius:p.get("textBorderRadius"),padding:p.get("textPadding"),fill:null,font:go({fontStyle:p.get("textFontStyle"),fontFamily:p.get("textFontFamily"),fontSize:p.get("textFontSize"),fontWeight:p.get("textFontWeight")},e)},ignore:!0});c.setTextContent(f),is({el:c,componentModel:t,itemName:u,formatterParamsExtra:{title:h[u]}}),c.__title=h[u],c.on("mouseover",function(){var e=p.getItemStyle(),i=s?null==t.get("right")&&"right"!==t.get("left")?"right":"left":null==t.get("bottom")&&"bottom"!==t.get("top")?"bottom":"top";f.setStyle({fill:p.get("textFill")||e.fill||e.stroke||X_.color.neutral99,backgroundColor:p.get("textBackgroundColor")}),c.setTextConfig({position:p.get("textPosition")||i}),f.ignore=!t.get("showTitle"),n.enterEmphasis(this)}).on("mouseout",function(){"emphasis"!==i.get(["iconStatus",u])&&n.leaveEmphasis(this),f.hide()}),("emphasis"===i.get(["iconStatus",u])?ji:Gi)(c),r.add(c),c.on("click",_f(o.onclick,o,e,n,u)),m[u]=c})}(y,p,f),y.setIconStatus=function(t,e){var n=this.option,i=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[t]=e,i[t]&&("emphasis"===e?ji:Gi)(i[t])},p instanceof XI&&p.render&&p.render(y,e,n,i)):x&&p.dispose&&p.dispose(e,n)}var r=this.group;if(r.removeAll(),t.get("show")){var a=+t.get("itemSize"),s="vertical"===t.get("orient"),l=t.get("feature")||{},u=this._features||(this._features={}),h=[];c(l,function(t,e){h.push(e)}),new gM(this._featureNames||[],h).add(o).update(o).remove(m(o,null)).execute(),this._featureNames=h;var d=Xo(t,n).refContainer,p=t.getBoxLayoutParams(),f=t.get("padding"),g=Yo(p,d,f);F_(t.get("orient"),r,t.get("itemGap"),g.width,g.height),qo(r,p,d,f),r.add(Uc(r.getBoundingRect(),t)),s||r.eachChild(function(t){var e=t.__title,i=t.ensureState("emphasis"),o=i.textConfig||(i.textConfig={}),s=t.getTextContent(),l=s&&s.ensureState("emphasis");if(l&&!v(l)&&e){var u=l.style||(l.style={}),h=Ge(e,Tv.makeFont(u)),c=t.x+r.x,d=!1;t.y+r.y+a+h.height>n.getHeight()&&(o.position="top",d=!0);var p=d?-5-h.height:a+10;c+h.width/2>n.getWidth()?(o.position=["100%",p],u.align="right"):c-h.width/2<0&&(o.position=[0,p],u.align="left")}})}},n.prototype.updateView=function(t,e,n,i){c(this._features,function(t){t instanceof XI&&t.updateView&&t.updateView(t.model,e,n,i)})},n.prototype.remove=function(t,e){c(this._features,function(n){n instanceof XI&&n.remove&&n.remove(t,e)}),this.group.removeAll()},n.prototype.dispose=function(t,e){c(this._features,function(n){n instanceof XI&&n.dispose&&n.dispose(t,e)})},n.type="toolbox",n}(ww);const JI=$I,QI=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.onclick=function(t,e){var n=this.model,i=n.get("name")||t.get("title.0.text")||"echarts",o="svg"===e.getZr().painter.getType(),r=o?"svg":n.get("type",!0)||"png",a=e.getConnectedDataURL({type:r,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||X_.color.neutral00,connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),s=Qp.browser;if("function"!=typeof MouseEvent||!s.newEdge&&(s.ie||s.edge))if(window.navigator.msSaveOrOpenBlob||o){var l=a.split(","),u=l[0].indexOf("base64")>-1,h=o?decodeURIComponent(l[1]):l[1];u&&(h=window.atob(h));var c=i+"."+r;if(window.navigator.msSaveOrOpenBlob){for(var d=h.length,p=new Uint8Array(d);d--;)p[d]=h.charCodeAt(d);var f=new Blob([p]);window.navigator.msSaveOrOpenBlob(f,c)}else{var g=document.createElement("iframe");document.body.appendChild(g);var m=g.contentWindow,y=m.document;y.open("image/svg+xml","replace"),y.write(h),y.close(),m.focus(),y.execCommand("SaveAs",!0,c),document.body.removeChild(g)}}else{var v=n.get("lang"),_='',x=window.open();x.document.write(_),x.document.title=i}else{var w=document.createElement("a");w.download=i+"."+r,w.target="_blank",w.href=a;var b=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});w.dispatchEvent(b)}},n.getDefaultOption=function(t){return{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:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:X_.color.neutral00,name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])}},n}(XI);var tL="__ec_magicType_stack__",eL=[["line","bar"],["stack"]],nL=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.getIcons=function(){var t=this.model,e=t.get("icon"),n={};return c(t.get("type"),function(t){e[t]&&(n[t]=e[t])}),n},n.getDefaultOption=function(t){return{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:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},n.prototype.onclick=function(t,e,n){var i=this.model,o=i.get(["seriesIndex",n]);if(iL[n]){var a,u={series:[]};c(eL,function(t){l(t,n)>=0&&c(t,function(t){i.setIconStatus(t,"normal")})}),i.setIconStatus(n,"emphasis"),t.eachComponent({mainType:"series",query:null==o?null:{seriesIndex:o}},function(t){var e=iL[n](t.subType,t.id,t,i);e&&(s(e,t.option),u.series.push(e));var o=t.coordinateSystem;if(o&&"cartesian2d"===o.type&&("line"===n||"bar"===n)){var r=o.getAxesByScale("ordinal")[0];if(r){var a=r.dim+"Axis",l=t.getReferringComponents(a,Km).models[0].componentIndex;u[a]=u[a]||[];for(var h=0;h<=l;h++)u[a][l]=u[a][l]||{};u[a][l].boundaryGap="bar"===n}}});var h=n;"stack"===n&&(a=r({stack:i.option.title.tiled,tiled:i.option.title.stack},i.option.title),"emphasis"!==i.get(["iconStatus",n])&&(h="tiled")),e.dispatchAction({type:"changeMagicType",currentType:h,newOption:u,newTitle:a,featureName:"magicType"})}},n}(XI),iL={line:function(t,e,n,i){if("bar"===t)return r({id:e,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(t,e,n,i){if("line"===t)return r({id:e,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(t,e,n,i){var o=n.get("stack")===tL;if("line"===t||"bar"===t)return i.setIconStatus("stack",o?"normal":"emphasis"),r({id:e,stack:o?"":tL},i.get(["option","stack"])||{},!0)}};fl({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)});const oL=nL;var rL=new Array(60).join("-"),aL="\t",sL=new RegExp("[\t]+","g"),lL=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.onclick=function(t,e){function n(){i.removeChild(r),C._dom=null}setTimeout(function(){e.dispatchAction({type:"hideTip"})});var i=e.getDom(),o=this.model;this._dom&&i.removeChild(this._dom);var r=document.createElement("div");r.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",r.style.backgroundColor=o.get("backgroundColor")||X_.color.neutral00;var a=document.createElement("h4"),s=o.get("lang")||[];a.innerHTML=s[0]||o.get("title"),a.style.cssText="margin:10px 20px",a.style.color=o.get("textColor");var l=document.createElement("div"),u=document.createElement("textarea");l.style.cssText="overflow:auto";var h=o.get("optionToContent"),p=o.get("contentToOption"),g=function(t){var e,n,i,o=function(t){var e={},n=[],i=[];return t.eachRawSeries(function(t){var o=t.coordinateSystem;if(!o||"cartesian2d"!==o.type&&"polar"!==o.type)n.push(t);else{var r=o.getBaseAxis();if("category"===r.type){var a=r.dim+"_"+r.index;e[a]||(e[a]={categoryAxis:r,valueAxis:o.getOtherAxis(r),series:[]},i.push({axisDim:r.dim,axisIndex:r.index})),e[a].series.push(t)}else n.push(t)}}),{seriesGroupByCategoryAxis:e,other:n,meta:i}}(t);return{value:f([(n=o.seriesGroupByCategoryAxis,i=[],c(n,function(t,e){var n=t.categoryAxis,o=t.valueAxis.dim,r=[" "].concat(d(t.series,function(t){return t.name})),a=[n.model.getCategories()];c(t.series,function(t){var e=t.getRawData();a.push(t.getRawData().mapArray(e.mapDimension(o),function(t){return t}))});for(var s=[r.join(aL)],l=0;l=0)return!0}(t)){var o=function(t){for(var e=t.split(/\n+/g),n=[],i=d(Yc(e.shift()).split(sL),function(t){return{name:t,data:[]}}),o=0;oi.getWidth()||n<0||n>i.getHeight()}(t,e.offsetX,e.offsetY)){var i=t._zr,o=t._covers,r=nd(t,e,n);if(!t._dragging)for(var a=0;a=0)&&t(o,i._targetInfoList)})}return t.prototype.setOutputRanges=function(t,e){return this.matchOutputRanges(t,e,function(t,e,n){if((t.coordRanges||(t.coordRanges=[])).push(e),!t.coordRange){t.coordRange=e;var i=AL[t.brushType](0,n,e);t.__rangeOffset={offset:OL[t.brushType](i.values,t.range,[1,1]),xyMinMax:i.xyMinMax}}}),t},t.prototype.matchOutputRanges=function(t,e,n){c(t,function(t){var i=this.findTargetInfo(t,e);i&&!0!==i&&c(i.coordSyses,function(i){var o=AL[t.brushType](1,i,t.range,!0);n(t,o.values,i,e)})},this)},t.prototype.setInputRanges=function(t,e){c(t,function(t){var n,i,o,r,a=this.findTargetInfo(t,e);if(t.range=t.range||[],a&&!0!==a){t.panelId=a.panelId;var s=AL[t.brushType](0,a.coordSys,t.coordRange),l=t.__rangeOffset;t.range=l?OL[t.brushType](s.values,l.offset,(n=l.xyMinMax,i=Ad(s.xyMinMax),o=Ad(n),r=[i[0]/o[0],i[1]/o[1]],isNaN(r[0])&&(r[0]=1),isNaN(r[1])&&(r[1]=1),r)):s.values}},this)},t.prototype.makePanelOpts=function(t,e){return d(this._targetInfoList,function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:e?e(n):null,clipPath:Td(i),isTargetByCursor:Cd(i,t,n.coordSysModel),getLinearBrushOtherExtent:Md(i)}})},t.prototype.controlSeries=function(t,e,n){var i=this.findTargetInfo(t,n);return!0===i||i&&l(i.coordSyses,e.coordinateSystem)>=0},t.prototype.findTargetInfo=function(t,e){for(var n=this._targetInfoList,i=Ld(e,t),o=0;o=0||l(i,t.getAxis("y").model)>=0)&&o.push(t)}),e.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:o[0],coordSyses:o,getPanelRect:DL.grid,xAxisDeclared:a[t.id],yAxisDeclared:s[t.id]})}))},geo:function(t,e){c(t.geoModels,function(t){var n=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:n,coordSyses:[n],getPanelRect:DL.geo})})}},PL=[function(t,e){var n=t.xAxisModel,i=t.yAxisModel,o=t.gridModel;return!o&&n&&(o=n.axis.grid.model),!o&&i&&(o=i.axis.grid.model),o&&o===e.gridModel},function(t,e){var n=t.geoModel;return n&&n===e.geoModel}],DL={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(ja(t)),e}},AL={lineX:m(Pd,0),lineY:m(Pd,1),rect:function(t,e,n,i){var o=t?e.pointToData([n[0][0],n[1][0]],i):e.dataToPoint([n[0][0],n[1][0]],i),r=t?e.pointToData([n[0][1],n[1][1]],i):e.dataToPoint([n[0][1],n[1][1]],i),a=[Id([o[0],r[0]]),Id([o[1],r[1]])];return{values:a,xyMinMax:a}},polygon:function(t,e,n,i){var o=[[1/0,-1/0],[1/0,-1/0]];return{values:d(n,function(n){var r=t?e.pointToData(n,i):e.dataToPoint(n,i);return o[0][0]=Math.min(o[0][0],r[0]),o[1][0]=Math.min(o[1][0],r[1]),o[0][1]=Math.max(o[0][1],r[0]),o[1][1]=Math.max(o[1][1],r[1]),r}),xyMinMax:o}}},OL={lineX:m(Dd,0),lineY:m(Dd,1),rect:function(t,e,n){return[[t[0][0]-n[0]*e[0][0],t[0][1]-n[0]*e[0][1]],[t[1][0]-n[1]*e[1][0],t[1][1]-n[1]*e[1][1]]]},polygon:function(t,e,n){return d(t,function(t,i){return[t[0]-n[0]*e[i][0],t[1]-n[1]*e[i][1]]})}};const zL=IL;var EL,RL=c,BL=Ym+"toolbox-dataZoom_",NL=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.render=function(t,e,n,i){this._brushController||(this._brushController=new CL(n.getZr()),this._brushController.on("brush",_f(this._onBrush,this)).mount()),function(t,e,n,i,o){var r=n._isZoomActive;i&&"takeGlobalCursor"===i.type&&(r="dataZoomSelect"===i.key&&i.dataZoomSelectActive),n._isZoomActive=r,t.setIconStatus("zoom",r?"emphasis":"normal");var a=new zL(Od(t),e,{include:["grid"]}).makePanelOpts(o,function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"});n._brushController.setPanels(a).enableBrush(!(!r||!a.length)&&{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()})}(t,e,this,i,n),function(t,e){t.setIconStatus("back",function(t){return qc(t).length}(e)>1?"emphasis":"normal")}(t,e)},n.prototype.onclick=function(t,e,n){FL[n].call(this)},n.prototype.remove=function(t,e){this._brushController&&this._brushController.unmount()},n.prototype.dispose=function(t,e){this._brushController&&this._brushController.dispose()},n.prototype._onBrush=function(t){function e(t,e,n){var r=e.getAxis(t),a=r.model,s=function(t,e,n){var i;return n.eachComponent({mainType:"dataZoom",subType:"select"},function(n){n.getAxisModel(t,e.componentIndex)&&(i=n)}),i}(t,a,o),l=s.findRepresentativeAxisProxy(a).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(n=Vc(0,n.slice(),r.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(i[s.id]={dataZoomId:s.id,startValue:n[0],endValue:n[1]})}var n=t.areas;if(t.isEnd&&n.length){var i={},o=this.ecModel;this._brushController.updateCovers([]),new zL(Od(this.model),o,{include:["grid"]}).matchOutputRanges(n,o,function(t,n,i){if("cartesian2d"===i.type){var o=t.brushType;"rect"===o?(e("x",i,n[0]),e("y",i,n[1])):e({lineX:"x",lineY:"y"}[o],i,n)}}),function(t,e){var n=qc(t);hL(e,function(e,i){for(var o=n.length-1;o>=0&&!n[o][i];o--);if(o<0){var r=t.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(r){var a=r.getPercentRange();n[0][i]={dataZoomId:i,start:a[0],end:a[1]}}}}),n.push(e)}(o,i),this._dispatchZoomAction(i)}},n.prototype._dispatchZoomAction=function(t){var e=[];RL(t,function(t,n){e.push(o(t))}),e.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:e})},n.getDefaultOption=function(t){return{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:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:X_.color.backgroundTint}}},n}(XI),FL={zoom:function(){this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:!this._isZoomActive})},back:function(){this._dispatchZoomAction(function(t){var e=qc(t),n=e[e.length-1];e.length>1&&e.pop();var i={};return hL(n,function(t,n){for(var o=e.length-1;o>=0;o--)if(t=e[o][n]){i[n]=t;break}}),i}(this.ecModel))}};EL=function(t){function e(t,e,n){var i=t.componentIndex,a={type:"select",$fromToolbox:!0,filterMode:o.get("filterMode",!0)||"filter",id:BL+e+i};a[n]=i,r.push(a)}var n=t.getComponent("toolbox",0),i=["feature","dataZoom"];if(n&&null!=n.get(i)){var o=n.getModel(i),r=[],a=Pn(t,Od(o));return RL(a.xAxisModels,function(t){return e(t,"xAxis","xAxisIndex")}),RL(a.yAxisModels,function(t){return e(t,"yAxis","yAxisIndex")}),r}},O(null==mx.get("dataZoom")&&EL),mx.set("dataZoom",EL);const VL=NL,ZL=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.layoutMode={type:"box",ignoreSize:!0},e}return e(n,t),n.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),t.selected=t.selected||{},this._updateSelector(t)},n.prototype.mergeOption=function(e,n){t.prototype.mergeOption.call(this,e,n),this._updateSelector(e)},n.prototype._updateSelector=function(t){var e=t.selector,n=this.ecModel;!0===e&&(e=t.selector=["all","inverse"]),y(e)&&c(e,function(t,i){_(t)&&(t={type:t}),e[i]=r(t,function(t,e){return"all"===e?{type:"all",title:t.getLocaleModel().get(["legend","selector","all"])}:"inverse"===e?{type:"inverse",title:t.getLocaleModel().get(["legend","selector","inverse"])}:void 0}(n,t.type))})},n.prototype.optionUpdated=function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&"single"===this.get("selectedMode")){for(var e=!1,n=0;n=0},n.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},n.type="legend.plain",n.dependencies=["series"],n.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",bottom:X_.size.m,align:"auto",backgroundColor:X_.color.transparent,borderColor:X_.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:X_.color.disabled,inactiveBorderColor:X_.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:X_.color.disabled,inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:X_.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:X_.color.tertiary,borderWidth:1,borderColor:X_.color.border},emphasis:{selectorLabel:{show:!0,color:X_.color.quaternary}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},n}(W_);var HL=m,WL=c,jL=Em,GL=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.newlineDisabled=!1,e}return e(n,t),n.prototype.init=function(){this.group.add(this._contentGroup=new jL),this.group.add(this._selectorGroup=new jL),this._isFirstRender=!0},n.prototype.getContentGroup=function(){return this._contentGroup},n.prototype.getSelectorGroup=function(){return this._selectorGroup},n.prototype.render=function(t,e,n){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var o=t.get("align"),r=t.get("orient");o&&"auto"!==o||(o="right"===t.get("left")&&"vertical"===r?"right":"left");var a=t.get("selector",!0),l=t.get("selectorPosition",!0);!a||l&&"auto"!==l||(l="horizontal"===r?"end":"start"),this.renderInner(o,t,e,n,a,r,l);var u=Xo(t,n).refContainer,h=t.getBoxLayoutParams(),c=t.get("padding"),d=Yo(h,u,c),p=this.layoutInner(t,o,d,i,a,l),f=Yo(s({width:p.width,height:p.height},h),u,c);this.group.x=f.x-p.x,this.group.y=f.y-p.y,this.group.markRedraw(),this.group.add(this._backgroundEl=Uc(p,t))}},n.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},n.prototype.renderInner=function(t,e,n,i,o,r,s){var l=this.getContentGroup(),u=B(),h=e.get("selectedMode"),c=e.get("triggerEvent"),d=[];n.eachRawSeries(function(t){!t.get("legendHoverLink")&&d.push(t.id)}),WL(e.getData(),function(o,r){var s=this,p=o.get("name");if(!this.newlineDisabled&&(""===p||"\n"===p)){var f=new jL;return f.newline=!0,void l.add(f)}var g=n.getSeriesByName(p)[0];if(!u.get(p))if(g){var m=g.getData(),y=m.getVisual("legendLineStyle")||{},v=m.getVisual("legendIcon"),_=m.getVisual("style"),x=this._createItem(g,p,r,o,e,t,y,_,v,h,i);x.on("click",HL(zd,p,null,i,d)).on("mouseover",HL(Rd,g.name,null,i,d)).on("mouseout",HL(Bd,g.name,null,i,d)),n.ssr&&x.eachChild(function(t){var e=Mv(t);e.seriesIndex=g.seriesIndex,e.dataIndex=r,e.ssrType="legend"}),c&&x.eachChild(function(t){s.packEventData(t,e,g,r,p)}),u.set(p,!0)}else n.eachRawSeries(function(s){var l=this;if(!u.get(p)&&s.legendVisualProvider){var f=s.legendVisualProvider;if(!f.containName(p))return;var g=f.indexOfName(p),m=f.getItemVisual(g,"style"),y=f.getItemVisual(g,"legendIcon"),v=oe(m.fill);v&&0===v[3]&&(v[3]=.2,m=a(a({},m),{fill:le(v,"rgba")}));var _=this._createItem(s,p,r,o,e,t,{},m,y,h,i);_.on("click",HL(zd,null,p,i,d)).on("mouseover",HL(Rd,null,p,i,d)).on("mouseout",HL(Bd,null,p,i,d)),n.ssr&&_.eachChild(function(t){var e=Mv(t);e.seriesIndex=s.seriesIndex,e.dataIndex=r,e.ssrType="legend"}),c&&_.eachChild(function(t){l.packEventData(t,e,s,r,p)}),u.set(p,!0)}},this)},this),o&&this._createSelector(o,e,i,r,s)},n.prototype.packEventData=function(t,e,n,i,o){var r={componentType:"legend",componentIndex:e.componentIndex,dataIndex:i,value:o,seriesIndex:n.seriesIndex};Mv(t).eventData=r},n.prototype._createSelector=function(t,e,n,i,o){var r=this.getSelectorGroup();WL(t,function(t){var i=t.type,o=new Tv({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect",legendId:e.id})}});r.add(o),uo(o,{normal:e.getModel("selectorLabel"),emphasis:e.getModel(["emphasis","selectorLabel"])},{defaultText:t.title}),no(o)})},n.prototype._createItem=function(t,e,n,i,o,r,a,s,l,u,h){var c,d,p,f=t.visualDrawType,g=o.get("itemWidth"),m=o.get("itemHeight"),y=o.isSelected(e),x=i.get("symbolRotate"),w=i.get("symbolKeepAspect"),b=i.get("icon"),S=function(t,e,n,i,o,r,a){function s(t,e){"auto"===t.lineWidth&&(t.lineWidth=e.lineWidth>0?2:0),WL(t,function(n,i){"inherit"===t[i]&&(t[i]=e[i])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),h=0===t.lastIndexOf("empty",0)?"fill":"stroke",c=l.getShallow("decal");u.decal=c&&"inherit"!==c?nl(c,a):i.decal,"inherit"===u.fill&&(u.fill=i[o]),"inherit"===u.stroke&&(u.stroke=i[h]),"inherit"===u.opacity&&(u.opacity=("fill"===o?i:n).opacity),s(u,i);var d=e.getModel("lineStyle"),p=d.getLineStyle();if(s(p,n),"auto"===u.fill&&(u.fill=i.fill),"auto"===u.stroke&&(u.stroke=i.fill),"auto"===p.stroke&&(p.stroke=i.fill),!r){var f=e.get("inactiveBorderWidth");u.lineWidth="auto"===f?i.lineWidth>0&&u[h]?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),p.stroke=d.get("inactiveColor"),p.lineWidth=d.get("inactiveWidth")}return{itemStyle:u,lineStyle:p}}(l=b||l||"roundRect",i,a,s,f,y,h),T=new jL,M=i.getModel("textStyle");if(!v(t.getLegendIcon)||b&&"inherit"!==b){var C="inherit"===b&&t.getData().getVisual("symbol")?"inherit"===x?t.getData().getVisual("symbolRotate"):x:0;T.add(((p=Es(d=(c={itemWidth:g,itemHeight:m,icon:l,iconRotate:C,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:w}).icon||"roundRect",0,0,c.itemWidth,c.itemHeight,c.itemStyle.fill,c.symbolKeepAspect)).setStyle(c.itemStyle),p.rotation=(c.iconRotate||0)*Math.PI/180,p.setOrigin([c.itemWidth/2,c.itemHeight/2]),d.indexOf("empty")>-1&&(p.style.stroke=p.style.fill,p.style.fill=X_.color.neutral00,p.style.lineWidth=2),p))}else T.add(t.getLegendIcon({itemWidth:g,itemHeight:m,icon:l,iconRotate:x,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:w}));var k="left"===r?g+5:-5,I=r,L=o.get("formatter"),P=e;_(L)&&L?P=L.replace("{name}",null!=e?e:""):v(L)&&(P=L(e));var D=y?M.getTextColor():i.get("inactiveColor");T.add(new Tv({style:co(M,{text:P,x:k,y:m/2,fill:D,align:I,verticalAlign:"middle"},{inheritColor:D})}));var A=new mv({shape:T.getBoundingRect(),style:{fill:"transparent"}}),O=i.getModel("tooltip");return O.get("show")&&is({el:A,componentModel:o,itemName:e,itemTooltipOption:O.option}),T.add(A),T.eachChild(function(t){t.silent=!0}),A.silent=!u,this.getContentGroup().add(T),no(T),T.__legendDataIndex=n,T},n.prototype.layoutInner=function(t,e,n,i,o,r){var a=this.getContentGroup(),s=this.getSelectorGroup();F_(t.get("orient"),a,t.get("itemGap"),n.width,n.height);var l=a.getBoundingRect(),u=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),o){F_("horizontal",s,t.get("selectorItemGap",!0));var h=s.getBoundingRect(),c=[-h.x,-h.y],d=t.get("selectorButtonGap",!0),p=t.getOrient().index,f=0===p?"width":"height",g=0===p?"height":"width",m=0===p?"y":"x";"end"===r?c[p]+=l[f]+d:u[p]+=h[f]+d,c[1-p]+=l[g]/2-h[g]/2,s.x=c[0],s.y=c[1],a.x=u[0],a.y=u[1];var y={x:0,y:0};return y[f]=l[f]+d+h[f],y[g]=Math.max(l[g],h[g]),y[m]=Math.min(0,h[m]+c[1-p]),y}return a.x=u[0],a.y=u[1],this.group.getBoundingRect()},n.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},n.type="legend.plain",n}(ww);const UL=GL,YL=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}var i;return e(n,t),n.prototype.setScrollDataIndex=function(t){this.option.scrollDataIndex=t},n.prototype.init=function(e,n,i){var o=Jo(e);t.prototype.init.call(this,e,n,i),Hd(this,e,o)},n.prototype.mergeOption=function(e,n){t.prototype.mergeOption.call(this,e,n),Hd(this,this.option,e)},n.type="legend.scroll",n.defaultOption=(i={scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:X_.color.accent50,pageIconInactiveColor:X_.color.accent10,pageIconSize:15,pageTextStyle:{color:X_.color.tertiary},animationDurationUpdate:800},r(r({},ZL.defaultOption,!0),i,!0)),n}(ZL);var XL=Em,qL=["width","height"],KL=["x","y"],$L=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.newlineDisabled=!0,e._currentIndex=0,e}return e(n,t),n.prototype.init=function(){t.prototype.init.call(this),this.group.add(this._containerGroup=new XL),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new XL)},n.prototype.resetInner=function(){t.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},n.prototype.renderInner=function(e,n,i,o,r,a,s){function l(t,e){var i=t+"DataIndex",r=$a(n.get("pageIcons",!0)[n.getOrient().name][e],{onclick:_f(u._pageGo,u,i,n,o)},{x:-d[0]/2,y:-d[1]/2,width:d[0],height:d[1]});r.name=t,h.add(r)}var u=this;t.prototype.renderInner.call(this,e,n,i,o,r,a,s);var h=this._controllerGroup,c=n.get("pageIconSize",!0),d=y(c)?c:[c,c];l("pagePrev",0);var p=n.getModel("pageTextStyle");h.add(new Tv({name:"pageText",style:{text:"xx/xx",fill:p.getTextColor(),font:p.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),l("pageNext",1)},n.prototype.layoutInner=function(t,e,n,i,r,a){var s=this.getSelectorGroup(),l=t.getOrient().index,u=qL[l],h=KL[l],c=qL[1-l],d=KL[1-l];r&&F_("horizontal",s,t.get("selectorItemGap",!0));var p=t.get("selectorButtonGap",!0),f=s.getBoundingRect(),g=[-f.x,-f.y],m=o(n);r&&(m[u]=n[u]-f[u]-p);var y=this._layoutContentAndController(t,i,m,l,u,c,d,h);if(r){if("end"===a)g[l]+=y[u]+p;else{var v=f[u]+p;g[l]-=v,y[h]-=v}y[u]+=f[u]+p,g[1-l]+=y[d]+y[c]/2-f[c]/2,y[c]=Math.max(y[c],f[c]),y[d]=Math.min(y[d],f[d]+g[1-l]),s.x=g[0],s.y=g[1],s.markRedraw()}return y},n.prototype._layoutContentAndController=function(t,e,n,i,o,r,a,s){var l=this.getContentGroup(),u=this._containerGroup,h=this._controllerGroup;F_(t.get("orient"),l,t.get("itemGap"),i?n.width:null,i?null:n.height),F_("horizontal",h,t.get("pageButtonItemGap",!0));var c=l.getBoundingRect(),d=h.getBoundingRect(),p=this._showController=c[o]>n[o],f=[-c.x,-c.y];e||(f[i]=l[s]);var g=[0,0],m=[-d.x,-d.y],y=L(t.get("pageButtonGap",!0),t.get("itemGap",!0));p&&("end"===t.get("pageButtonPosition",!0)?m[i]+=n[o]-d[o]:g[i]+=d[o]+y),m[1-i]+=c[r]/2-d[r]/2,l.setPosition(f),u.setPosition(g),h.setPosition(m);var v={x:0,y:0};if(v[o]=p?n[o]:c[o],v[r]=Math.max(c[r],d[r]),v[a]=Math.min(0,d[a]+m[1-i]),u.__rectSize=n[o],p){var _={x:0,y:0};_[o]=Math.max(n[o]-d[o]-y,0),_[r]=v[r],u.setClipPath(new mv({shape:_})),u.__rectSize=_[o]}else h.eachChild(function(t){t.attr({invisible:!0,silent:!0})});var x=this._getPageInfo(t);return null!=x.pageIndex&&Ia(l,{x:x.contentPosition[0],y:x.contentPosition[1]},p?t:null),this._updatePageInfoView(t,x),v},n.prototype._pageGo=function(t,e,n){var i=this._getPageInfo(e)[t];null!=i&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:e.id})},n.prototype._updatePageInfoView=function(t,e){var n=this._controllerGroup;c(["pagePrev","pageNext"],function(i){var o=null!=e[i+"DataIndex"],r=n.childOfName(i);r&&(r.setStyle("fill",t.get(o?"pageIconColor":"pageIconInactiveColor",!0)),r.cursor=o?"pointer":"default")});var i=n.childOfName("pageText"),o=t.get("pageFormatter"),r=e.pageIndex,a=null!=r?r+1:0,s=e.pageCount;i&&o&&i.setStyle("text",_(o)?o.replace("{current}",null==a?"":a+"").replace("{total}",null==s?"":s+""):o({current:a,total:s}))},n.prototype._getPageInfo=function(t){function e(t){if(t){var e=t.getBoundingRect(),n=e[l]+t[l];return{s:n,e:n+e[s],i:t.__legendDataIndex}}}function n(t,e){return t.e>=e&&t.s<=e+r}var i=t.get("scrollDataIndex",!0),o=this.getContentGroup(),r=this._containerGroup.__rectSize,a=t.getOrient().index,s=qL[a],l=KL[a],u=this._findTargetItemIndex(i),h=o.children(),c=h[u],d=h.length,p=d?1:0,f={contentPosition:[o.x,o.y],pageCount:p,pageIndex:p-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!c)return f;var g=e(c);f.contentPosition[a]=-g.s;for(var m=u+1,y=g,v=g,_=null;m<=d;++m)(!(_=e(h[m]))&&v.e>y.s+r||_&&!n(_,y.s))&&(y=v.i>y.i?v:_)&&(null==f.pageNextDataIndex&&(f.pageNextDataIndex=y.i),++f.pageCount),v=_;for(m=u-1,y=g,v=g,_=null;m>=-1;--m)(_=e(h[m]))&&n(v,_.s)||!(y.i=0;u--){var p,f,g;if(g=null!=(f=Mn((p=n[u]).id,null))?o.get(f):null){d=cP(m=g.parent);var m,y={},v=qo(g,p,m===i?{width:r,height:a}:{width:d.width,height:d.height},null,{hv:p.hv,boundingMode:p.bounding},y);if(!cP(g).isNew&&v){for(var _=p.transition,x={},w=0;w=0)?x[b]=S:g[b]=S}Ia(g,x,t,0)}else g.attr(y)}}},n.prototype._clear=function(){var t=this,e=this._elMap;e.each(function(n){op(n,cP(n).option,e,t._lastGraphicModel)}),this._elMap=B()},n.prototype.dispose=function(){this._clear()},n.type="graphic",n}(ww),pP=Math.sin,fP=Math.cos,gP=Math.PI,mP=2*Math.PI,yP=180/gP;const vP=function(){function t(){}return t.prototype.reset=function(t){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,t||4)},t.prototype.moveTo=function(t,e){this._add("M",t,e)},t.prototype.lineTo=function(t,e){this._add("L",t,e)},t.prototype.bezierCurveTo=function(t,e,n,i,o,r){this._add("C",t,e,n,i,o,r)},t.prototype.quadraticCurveTo=function(t,e,n,i){this._add("Q",t,e,n,i)},t.prototype.arc=function(t,e,n,i,o,r){this.ellipse(t,e,n,n,0,i,o,r)},t.prototype.ellipse=function(t,e,n,i,o,r,a,s){var l,u=a-r,h=!s,c=Math.abs(u),d=de(c-mP)||(h?u>=mP:-u>=mP),p=u>0?u%mP:u%mP+mP;l=!!d||!de(c)&&p>=gP==!!h;var f=t+n*fP(r),g=e+i*pP(r);this._start&&this._add("M",f,g);var m=Math.round(o*yP);if(d){var y=1/this._p,v=(h?1:-1)*(mP-y);this._add("A",n,i,m,1,+h,t+n*fP(r+v),e+i*pP(r+v)),y>.01&&this._add("A",n,i,m,0,+h,f,g)}else{var _=t+n*fP(a),x=e+i*pP(a);this._add("A",n,i,m,+l,+h,_,x)}},t.prototype.rect=function(t,e,n,i){this._add("M",t,e),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},t.prototype.closePath=function(){this._d.length>0&&this._add("Z")},t.prototype._add=function(t,e,n,i,o,r,a,s,l){for(var u=[],h=this._p,c=1;c"].join(i):""}(o.cssNodes,o.cssAnims,{newline:!0});if(u){var h=sp("style","stl",{},[],u);r.push(h)}}return hp(n,i,r,t.useViewBox)},t.prototype.renderToString=function(t){return lp(this.renderToVNode({animation:L((t=t||{}).cssAnimation,!0),emphasis:L(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:L(t.useViewBox,!0)}),{newline:!0})},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t},t.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},t.prototype._paintList=function(t,e,n){for(var i,o,r=t.length,a=[],s=0,l=0,u=0;u=0&&(!c||!o||c[f]!==o[f]);f--);for(var g=p-1;g>f;g--)i=a[--s-1];for(var m=f+1;m=s)}}if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;for(var r,a=[],s=this.maxRepaintRectCount,l=!1,u=new lg(0,0,0,0),h=this.__startIndex;h15)break}n.prevElClipPaths&&c.restore()};if(p)if(0===p.length)s=h.__endIndex;else for(var x=d.dpr,w=0;w0&&t>i[0]){for(s=0;st);s++);a=n[i[s]]}if(i.splice(s+1,0,t),n[t]=e,!e.virtual)if(a){var l=a.dom;l.nextSibling?r.insertBefore(e.dom,l.nextSibling):r.appendChild(e.dom)}else r.firstChild?r.insertBefore(e.dom,r.firstChild):r.appendChild(e.dom);e.painter||(e.painter=this)}},t.prototype.eachLayer=function(t,e){for(var n=this._zlevelList,i=0;i0?HP:0),this._needsManuallyCompositing),h.__builtin__||i("ZLevel "+u+" has been used by unkown layer "+h.id),h!==a&&(h.__used=!0,h.__startIndex!==r&&(h.__dirty=!0),h.__startIndex=r,h.__drawIndex=h.incremental?-1:r,e(r),a=h),1&l.__dirty&&!l.__inHover&&(h.__dirty=!0,h.incremental&&h.__drawIndex<0&&(h.__drawIndex=r))}e(r),this.eachBuiltinLayer(function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)})},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(t){t.clear()},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t,c(this._layers,function(t){t.setUnpainted()})},t.prototype.configLayer=function(t,e){if(e){var n=this._layerConfig;n[t]?r(n[t],e,!0):n[t]=e;for(var i=0;i{let r="right";return o.viewSize[0]-t[0]"graph"===t.componentSubType?"edge"===t.dataType?e.utils.getLinkTooltipInfo(t.data):e.utils.getNodeTooltipInfo(t.data):"lines"===t.componentSubType?e.utils.getLinkTooltipInfo(t.data.link):e.utils.getNodeTooltipInfo(t.data.node)}},n.echartsOption);return i.setOption(e.utils.deepMergeObj(o,t)),i.on("click",t=>{const i=n.onClickElement.bind(e);e.utils.addActionToUrl(e,t),"graph"!==t.componentSubType?"lines"!==t.componentSubType?t.data&&!t.data.cluster&&(n.mapOptions?.nodePopup?.show&&e.gui.loadNodePopup(t.data.node),i("node",t.data.node)):i("link",t.data.link):i("edge"===t.dataType?"link":"node",t.data)},{passive:!0}),i}generateGraphOption(t,e){const n=[],i=e.config,o=t.nodes.map(t=>{const n=e.utils.fastDeepCopy(t),{nodeStyleConfig:o,nodeSizeConfig:r,nodeEmphasisConfig:a}=e.utils.getNodeStyle(t,i,"graph");n.itemStyle=o,n.symbolSize=r,n.emphasis={itemStyle:a.nodeStyle,symbolSize:a.nodeSize};let s="";return"string"==typeof t.label?s=t.label:"string"==typeof t.name?s=t.name:null!=t.id&&(s=String(t.id)),n.name=s,n._source=e.utils.fastDeepCopy(t),n}),r=t.links.map(t=>{const n=e.utils.fastDeepCopy(t),{linkStyleConfig:o,linkEmphasisConfig:r}=e.utils.getLinkStyle(t,i,"graph");return n.lineStyle=o,n.emphasis={lineStyle:r.linkStyle},n}),a={...i.graphConfig.series},s={...a.label||{}};if("number"==typeof e.config.showGraphLabelsAtZoom&&e.config.showGraphLabelsAtZoom>0){const t=e.config.showGraphLabelsAtZoom;s.formatter=n=>(()=>{try{const t=e.echarts.getOption(),n=(Array.isArray(t.series)?t.series:[]).find(t=>t&&"network-graph"===t.id);return n&&"number"==typeof n.zoom?n.zoom:1}catch(t){return 1}})()>=t&&n&&n.data&&n.data.name||""}a.label=s;const l=[{...a,id:"network-graph",type:"graph",layout:i.graphConfig.series.layout||"force",nodes:o,links:r}];return{legend:n.length?{data:n}:void 0,series:l,...i.graphConfig.baseOptions}}generateMapOption(t,e,n=[]){const i=e.config,{nodes:o,links:r}=t,a=t.flatNodes||{},s=[];let l=[];o.forEach(n=>{if(n.properties&&(t.flatNodes||(a[n.id]=e.utils.fastDeepCopy(n))),!n.properties||!n.properties._featureType||"Point"===n.properties._featureType)if(n.properties){const{location:t}=n.properties;if(t&&t.lng&&t.lat){const{nodeEmphasisConfig:o}=e.utils.getNodeStyle(n,i,"map");let r="";"string"==typeof n.label?r=n.label:"string"==typeof n.name?r=n.name:null!=n.id&&(r=String(n.id)),l.push({name:r,value:[t.lng,t.lat],emphasis:{itemStyle:o.nodeStyle,symbolSize:o.nodeSize},node:n,_source:e.utils.fastDeepCopy(n)})}else console.error(`Node ${n.id} position is undefined!`)}else console.error(`Node ${n.id} position is undefined!`)}),r.forEach(t=>{if(a[t.source])if(a[t.target]){const{linkStyleConfig:n,linkEmphasisConfig:o}=e.utils.getLinkStyle(t,i,"map");s.push({coords:[[a[t.source].properties.location.lng,a[t.source].properties.location.lat],[a[t.target].properties.location.lng,a[t.target].properties.location.lat]],lineStyle:n,emphasis:{lineStyle:o.linkStyle},link:t})}else console.warn(`Node ${t.target} does not exist!`);else console.warn(`Node ${t.source} does not exist!`)}),l=l.concat(n);const u=[{id:"geo-map",type:"scatter",name:"nodes",coordinateSystem:"leaflet",data:l,label:{...i.mapOptions.nodeConfig.label||{},...!1===i.showMapLabelsAtZoom?{show:!1}:{},silent:!0},itemStyle:{color:t=>{if(t.data&&t.data.cluster&&t.data.itemStyle&&t.data.itemStyle.color)return t.data.itemStyle.color;if(t.data&&t.data.node&&t.data.node.category){const e=i.nodeCategories.find(e=>e.name===t.data.node.category);return e&&e.nodeStyle&&e.nodeStyle.color||i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeStyle&&i.mapOptions.nodeConfig.nodeStyle.color||"#6c757d"}return i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeStyle&&i.mapOptions.nodeConfig.nodeStyle.color||"#6c757d"}},symbolSize:(t,n)=>{if(n.data&&n.data.cluster)return i.mapOptions.clusterConfig&&i.mapOptions.clusterConfig.symbolSize||30;if(n.data&&n.data.node){const{nodeSizeConfig:t}=e.utils.getNodeStyle(n.data.node,i,"map");return"object"==typeof t?i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeSize||17:t}return i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeSize||17},emphasis:i.mapOptions.nodeConfig.emphasis},Object.assign(i.mapOptions.linkConfig,{id:"map-links",type:"lines",coordinateSystem:"leaflet",data:s})];return{leaflet:{tiles:i.mapTileConfig,mapOptions:i.mapOptions},series:u,...i.mapOptions.baseOptions}}_propagateGraphZoom(t){const e=t.echarts.getDom&&t.echarts.getDom();if(!e)return;const n=e.querySelector("canvas");e.addEventListener("wheel",t=>{if(!n)return;const i=e.getBoundingClientRect();if(t.clientXi.right||t.clientYi.bottom)return;t.preventDefault();const o=n.getBoundingClientRect();n.dispatchEvent(new WheelEvent("wheel",{bubbles:!0,cancelable:!0,view:window,clientX:o.left+o.width/2,clientY:o.top+o.height/2,deltaY:-t.deltaY,deltaMode:t.deltaMode}))},{passive:!1})}graphRender(t,e){e.utils.echartsSetOption(e.utils.generateGraphOption(t,e),e),window.onresize=()=>{e.echarts.resize()},e.utils._propagateGraphZoom(e),e.config.showGraphLabelsAtZoom>0&&e.echarts.on("graphRoam",t=>{if(!t||!t.zoom)return;const n=e.echarts.getOption(),i=n&&n.series&&n.series[0]&&n.series[0].zoom>=e.config.showGraphLabelsAtZoom;i!==e._labelsVisible&&(e.echarts.resize({animation:!1,silent:!0}),e._labelsVisible=i)}),e.utils.setupHashChangeHandler(e),e.event.emit("onLoad"),e.event.emit("onReady"),e.event.emit("renderArray"),e.event.emit("applyUrlFragmentState")}mapRender(t,e){const n=xl();if(!n)throw new Error("Leaflet api is not loaded");const{circleMarker:i,latLngBounds:o}=n;if(!e.config.mapTileConfig[0])throw new Error('You must add the tiles via the "mapTileConfig" param!');e.utils.isGeoJSON(t)&&(e.originalGeoJSON=e.utils.fastDeepCopy(t),t=e.utils.geojsonToNetjson(t));const r=e.utils.generateMapOption(t,e);if(e.utils.echartsSetOption(r,e),e.bboxData={nodes:[],links:[]},e.leaflet=e.echarts._api.getCoordinateSystems()[0].getLeaflet(),e.leaflet._zoomAnimated=!1,e.config.geoOptions=e.utils.deepMergeObj({pointToLayer:(t,n)=>i(n,e.config.geoOptions.style),onEachFeature:(t,n)=>{n.on("click",()=>{const n={...t.properties};e.config.onClickElement.call(e,"Feature",n)})}},e.config.geoOptions),e.originalGeoJSON){!function(t){if(!t.originalGeoJSON||!Array.isArray(t.originalGeoJSON.features))return;const e=xl();if(!e)return;const{geoJSON:n}=e,i=t.leaflet,o=t.originalGeoJSON.features.filter(t=>t&&t.geometry&&("Polygon"===t.geometry.type||"MultiPolygon"===t.geometry.type));if(!o.length)return;let r=i.getPane("njg-polygons");r||(r=i.createPane("njg-polygons"),r.style.zIndex=410);const a={fillColor:"#1566a9",color:"#1566a9",weight:0,fillOpacity:.6},s=n({type:"FeatureCollection",features:o},{pane:"njg-polygons",style:e=>{const n=e.properties&&e.properties.echartsStyle||{},i={...a,...t.config.geoOptions&&t.config.geoOptions.style};return n.areaColor&&(i.fillColor=n.areaColor),n.color&&(i.color=n.color),void 0!==n.opacity&&(i.fillOpacity=n.opacity),void 0!==n.borderWidth&&(i.weight=n.borderWidth),i},onEachFeature:(e,n)=>{n.on("click",()=>{t.config.onClickElement.call(t,"Feature",e.properties||{})})},...t.config.geoOptions}).addTo(i);t.leaflet.polygonGeoJSON=s}(e);let n=null;if(e.leaflet.polygonGeoJSON&&"function"==typeof e.leaflet.polygonGeoJSON.getBounds&&(n=e.leaflet.polygonGeoJSON.getBounds()),t.nodes&&t.nodes.length){const e=t.nodes.map(t=>t.properties.location).map(t=>[t.lat,t.lng]);n?e.forEach(t=>n.extend(t)):n=o(e)}n&&n.isValid()&&e.leaflet.fitBounds(n,{padding:[20,20]})}if(e.utils.updateLabelVisibility(e,!0),e.leaflet.on("zoomend",()=>{e.utils.updateLabelVisibility(e,!0);const t=e.leaflet.getZoom(),n=e.leaflet.getMinZoom(),i=e.leaflet.getMaxZoom(),o=document.querySelector(".leaflet-control-zoom-in"),r=document.querySelector(".leaflet-control-zoom-out");o&&r&&(Math.round(t)>=i?o.classList.add("leaflet-disabled"):o.classList.remove("leaflet-disabled"),Math.round(t)<=n?r.classList.add("leaflet-disabled"):r.classList.remove("leaflet-disabled"))}),e.leaflet.on("moveend",async()=>{const n=e.leaflet.getBounds();if(e.leaflet.getZoom()>=e.config.loadMoreAtZoomLevel&&e.hasMoreData){const i=await e.utils.getBBoxData.call(e,e.JSONParam,n);e.config.prepareData.call(e,i);const o=new Set(e.data.nodes.map(t=>t.id)),r=new Set(e.data.links.map(t=>t.source)),a=new Set(e.data.links.map(t=>t.target)),s=i.nodes.filter(t=>!o.has(t.id)),l=i.links.filter(t=>!r.has(t.source)&&!a.has(t.target)),u=new Set(i.nodes.map(t=>t.id)),h=e.bboxData.nodes.filter(t=>!u.has(t.id)),c=new Set(h.map(t=>t.id));t.nodes=t.nodes.filter(t=>!c.has(t.id)),e.bboxData.nodes=e.bboxData.nodes.concat(s),e.bboxData.links=e.bboxData.links.concat(l),t={...t,nodes:t.nodes.concat(s),links:t.links.concat(l)},e.echarts.setOption(e.utils.generateMapOption(t,e)),e.data=t}else e.hasMoreData&&e.bboxData.nodes.length>0&&(()=>{const n=new Set(e.bboxData.nodes),i=new Set(e.bboxData.links);t={...t,nodes:t.nodes.filter(t=>!n.has(t)),links:t.links.filter(t=>!i.has(t))},e.data=t,e.echarts.setOption(e.utils.generateMapOption(t,e)),e.bboxData.nodes=[],e.bboxData.links=[]})()}),e.config.clustering&&e.config.clusteringThresholde.config.disableClusteringAtLevel&&(n=[],i=t.nodes,o=t.links),e.echarts.setOption(e.utils.generateMapOption({...t,nodes:i,links:o},e,n)),e.utils.updateLabelVisibility(e,!0),e.echarts.on("click",t=>{if(("scatter"===t.componentSubType||"effectScatter"===t.componentSubType)&&t.data.cluster){const n=e.leaflet.getZoom(),i=Math.min(n+2,e.leaflet.getMaxZoom());e.leaflet.setView([t.data.value[1],t.data.value[0]],i)}}),e.leaflet.on("zoomend",()=>{if(e.leaflet.getZoom(){e.echarts.appendData({seriesIndex:n,data:t.data})}),e.utils.mergeData(t,e)),e.config.afterUpdate.call(e)}addData(t,e){e.utils.mergeData(t,e),e.data.nodes&&e.data.nodes.length>0&&(e.data.nodes=e.utils.deduplicateNodesById(e.data.nodes)),e.utils.render(),e.config.afterUpdate.call(e)}mergeData(t,e){t.nodes||(t.nodes=[]);const n=new Set;e.data.nodes.forEach(t=>{t.id&&n.add(t.id)});const i=t.nodes.filter(t=>!t.id||!n.has(t.id)||(console.warn(`Duplicate node ID ${t.id} detected during merge and skipped.`),!1)),o=e.data.nodes.concat(i),r=e.data.links.concat(t.links||[]);Object.assign(e.data,t,{nodes:o,links:r})}},UP=class{constructor(t){this.self=t,this.renderModeSelector=null,this.controls=null,this.sideBar=null,this.metaInfoContainer=null,this.nodeLinkInfoContainer=null}createControls(){const t=document.createElement("div");return t.setAttribute("class","njg-controls"),this.self.el.appendChild(t),t}createRenderModeSelector(){const t=document.createElement("div"),e=document.createElement("span");return e.setAttribute("class","iconfont icon-eye"),t.setAttribute("class","njg-selectIcon"),t.appendChild(e),this.controls.appendChild(t),t}createSideBar(){const t=document.createElement("div");t.setAttribute("class","njg-sideBar"),t.classList.add("hidden");const e=document.createElement("button");return t.appendChild(e),e.classList.add("sideBarHandle"),e.onclick=()=>{t.classList.toggle("hidden");const e=document.querySelector(".njg-metaInfoContainer");(this.self.config.showMetaOnNarrowScreens||this.self.el.clientWidth>850)&&e&&(e.style.display="flex")},this.self.el.appendChild(t),t}hideInfoOnNarrowScreen(){!this.self.config.showMetaOnNarrowScreens&&this.self.el.clientWidth<850&&(this.metaInfoContainer.style.display="none"),"none"===this.metaInfoContainer.style.display&&"none"===this.nodeLinkInfoContainer.style.display&&this.sideBar.classList.add("hidden")}createMetaInfoContainer(){const t=document.createElement("div"),e=document.createElement("h2"),n=document.createElement("div");n.classList.add("njg-metaData"),t.classList.add("njg-metaInfoContainer");const i=document.createElement("span");return i.classList.add("njg-closeButton"),e.innerHTML="Info",i.innerHTML=" ✕",e.appendChild(i),t.appendChild(e),t.appendChild(n),this.metaInfoContainer=t,this.sideBar.appendChild(t),this.nodeLinkInfoContainer=this.createNodeLinkInfoContainer(),this.hideInfoOnNarrowScreen(),window.addEventListener("resize",this.hideInfoOnNarrowScreen.bind(this)),i.onclick=()=>{this.metaInfoContainer.style.display="none","none"===this.nodeLinkInfoContainer.style.display&&this.sideBar.classList.add("hidden")},t}createNodeLinkInfoContainer(){const t=document.createElement("div");return t.classList.add("njg-nodeLinkInfoContainer"),t.style.display="none",this.sideBar.appendChild(t),t}getNodeLinkInfo(t,e){const n=document.querySelectorAll(".njg-infoContainer"),i=document.querySelectorAll(".njg-headerContainer");for(let t=0;t"clients"===t?"Clients":/^clients\s*\[\d+\]$/i.test(t)?t.replace(/^clients/i,"Client"):"localAddresses"===t?"Local Addresses":t.replace(/_/g," "),u=(t,e,n,i=0)=>{if(null==n||"string"==typeof n&&(""===n.trim()||/^(undefined|null)$/i.test(n.trim()))&&"0"!==n)return;if(Array.isArray(n)){if(0===n.length){const n=document.createElement("div");n.classList.add("njg-infoItems"),n.style.paddingLeft=12*i+"px";const o=document.createElement("span");o.setAttribute("class","njg-keyLabel");const r=document.createElement("span");return r.setAttribute("class","njg-valueLabel"),o.innerHTML=l(e),r.innerHTML="[]",n.appendChild(o),n.appendChild(r),void t.appendChild(n)}if(n.every(t=>"object"!=typeof t||null===t)){const o=document.createElement("div");o.classList.add("njg-infoItems"),o.style.paddingLeft=12*i+"px";const r=document.createElement("span");r.setAttribute("class","njg-keyLabel");const a=document.createElement("span");return a.setAttribute("class","njg-valueLabel"),r.innerHTML=l(e),a.innerHTML=n.map(t=>"string"==typeof t?t.replace(/\n/g,"
"):String(t)).join("
"),o.appendChild(r),o.appendChild(a),void t.appendChild(o)}return void n.forEach((n,o)=>{u(t,`${e} [${o+1}]`,n,i)})}if("object"==typeof n){if("location"===e&&"number"==typeof n.lat&&"number"==typeof n.lng){const e=document.createElement("div");e.classList.add("njg-infoItems"),e.style.paddingLeft=12*i+"px";const o=document.createElement("span");o.setAttribute("class","njg-keyLabel");const r=document.createElement("span");return r.setAttribute("class","njg-valueLabel"),o.innerHTML="Location",r.innerHTML=`${Math.round(1e3*n.lat)/1e3}, ${Math.round(1e3*n.lng)/1e3}`,e.appendChild(o),e.appendChild(r),void t.appendChild(e)}const o=document.createElement("div");o.classList.add("njg-infoItems"),o.style.paddingLeft=12*i+"px";const r=document.createElement("span");r.setAttribute("class","njg-keyLabel");const a=document.createElement("span");return a.setAttribute("class","njg-valueLabel"),r.innerHTML=l(e),a.innerHTML="",o.appendChild(r),o.appendChild(a),t.appendChild(o),void Object.keys(n).forEach(e=>{u(t,e,n[e],i+1)})}const o=document.createElement("div");o.classList.add("njg-infoItems"),o.style.paddingLeft=12*i+"px";const r=document.createElement("span");r.setAttribute("class","njg-keyLabel");const a=document.createElement("span");a.setAttribute("class","njg-valueLabel"),r.innerHTML=l(e);const s="string"==typeof n?n.replace(/\n/g,"
"):String(n);a.innerHTML=s,o.appendChild(r),o.appendChild(a),t.appendChild(o)};Object.keys(e).forEach(t=>u(r,t,e[t],0)),o.appendChild(a),o.appendChild(s),this.nodeLinkInfoContainer.appendChild(o),this.nodeLinkInfoContainer.appendChild(r),s.onclick=()=>{this.nodeLinkInfoContainer.style.display="none",null!==this.metaInfoContainer&&"none"!==this.metaInfoContainer.style.display||this.sideBar.classList.add("hidden")}}getNodeLocation(t){return t?.properties?.location||t?.location}async loadNodePopup(t){const{self:e}=this;if(!e.leaflet)return void console.error("Leaflet map not available. Cannot load popup.");const n=this.getNodeLocation(t);if(!n)return void console.error("Node location not available. Cannot load popup.");const{bookmarkableActions:{id:i,preserveFragment:o}={}}=e.config,r={};e.leaflet.currentPopupRequest=r;const a=Boolean(e.leaflet.currentPopup);if(e.leaflet.currentPopup){const t=e.leaflet.currentPopup;e.leaflet.currentPopup=null,t.remove()}let s=e.config.mapOptions.nodePopup.content;if(null==s)s=this.createDefaultPopupContent(t);else if("function"==typeof s)try{s=await s.call(e,t)}catch(t){if(e.leaflet.currentPopupRequest!==r)return;return e.utils.removeUrlFragment(i,"nodeId",o),e.leaflet.currentPopupRequest=null,a&&(e.utils.setTooltipVisibility(e,!0),e.utils.updateLabelVisibility(e,!0)),void console.error("Failed to build node popup content:",t)}if(e.leaflet.currentPopupRequest!==r)return;const l=Object.fromEntries(Object.entries(e.config.mapOptions.nodePopup.config||{}).filter(([,t])=>null!=t)),u=window.L.popup({...l}).setLatLng(n).setContent(s),h=t&&null!=t.id?String(t.id):null;u.on("remove",()=>{if(e.leaflet.currentPopup===u){if(e.utils.setTooltipVisibility(e,!0),e.utils.updateLabelVisibility(e,!0),e.config.bookmarkableActions&&e.config.bookmarkableActions.enabled&&h){const t=e.utils.parseUrlFragments()[i];t&&t.get("nodeId")===h&&e.utils.removeUrlFragment(i,"nodeId",o)}e.leaflet.currentPopup=null,e.leaflet.currentPopupRequest===r&&(e.leaflet.currentPopupRequest=null)}}),e.leaflet.currentPopup=u,u.openOn(e.leaflet),e.utils.setTooltipVisibility(e,!1),e.utils.updateLabelVisibility(e,!1);const{onOpen:c}=e.config.mapOptions.nodePopup;if("function"==typeof c)try{c.call(e)}catch(t){e.leaflet.currentPopup&&e.leaflet.currentPopup.remove(),console.error("Failed to run popup onOpen callback:",t)}}createDefaultPopupContent(t){const e=document.createElement("div");e.classList.add("default-popup");const n=this.getNodeLocation(t),i=Number(n?.lat),o=Number(n?.lng),r=Number.isFinite(i)&&Number.isFinite(o),a={name:t?.name,id:t?.id,label:t?.label,location:r?`${i.toFixed(8)}, ${o.toFixed(8)}`:null};return Object.keys(a).forEach(t=>{const n=a[t];if(null==n||""===n)return;const i=document.createElement("div");i.classList.add("njg-tooltip-item");const o=document.createElement("span");o.classList.add("njg-tooltip-key"),o.textContent=t;const r=document.createElement("span");r.classList.add("njg-tooltip-value"),r.textContent=String(n),i.appendChild(o),i.appendChild(r),e.appendChild(i)}),e}init(){this.sideBar=this.createSideBar(),this.self.config.switchMode&&(this.controls=this.createControls(),this.renderModeSelector=this.createRenderModeSelector())}},YP=function(){function t(t,e){this._map=t,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=e,this._projection=r.Mercator}function e(t,e,n,i){const{leafletModel:o,seriesModel:r}=n,a=o?o.coordinateSystem:r?r.coordinateSystem||(r.getReferringComponents("leaflet")[0]||{}).coordinateSystem:null;return a===this?a[t](i):null}const n=xl();if(!n)throw new Error("Leaflet api is not loaded");const{Layer:i,DomUtil:o,Projection:r,LatLng:a,map:s,control:l,tileLayer:u}=n,h=i.extend({initialize(t){this._container=t},onAdd(t){t.getPane(this.options.pane).appendChild(this._container),t.zoomControl.setPosition("topright")},onRemove(){o.remove(this._container)},_update(){}});return t.dimensions=["lng","lat"],t.prototype.dimensions=["lng","lat"],t.prototype.setZoom=function(t){this._zoom=t},t.prototype.setCenter=function(t){this._center=this._projection.project(new a(t[1],t[0]))},t.prototype.setMapOffset=function(t){this._mapOffset=t},t.prototype.getLeaflet=function(){return this._map},t.prototype.getViewRect=function(){const t=this._api;return new lg(0,0,t.getWidth(),t.getHeight())},t.prototype.getRoamTransform=function(){return[1,0,0,1,0,0]},t.prototype.dataToPoint=function(t){const e=new a(t[1],t[0]),n=this._map.latLngToLayerPoint(e),i=this._mapOffset;return[n.x-i[0],n.y-i[1]]},t.prototype.pointToData=function(t){const e=this._mapOffset,n=this._map.layerPointToLatLng({x:t[0]+e[0],y:t[1]+e[1]});return[n.lng,n.lat]},t.prototype.convertToPixel=m(e,"dataToPoint"),t.prototype.convertFromPixel=m(e,"pointToData"),t.create=function(e,n){let i;const o=[],r=n.getDom();return e.eachComponent("leaflet",e=>{const a=n.getZr().painter.getViewportRoot();if(i)throw new Error("Only one leaflet component can exist");if(!e.__map){let t=r.querySelector(".ec-extension-leaflet");t&&(a.style.left="0px",a.style.top="0px",r.removeChild(t)),t=document.createElement("div"),t.style.cssText="width:100%;height:100%",t.classList.add("ec-extension-leaflet"),r.appendChild(t),e.__map=s(t,e.get("mapOptions"));const n=e.__map,i=e.get("tiles"),o={};let c=!1;if(i.forEach(t=>{const e=u(t.urlTemplate,t.options);t.label?(c||(e.addTo(n),c=!0),o[t.label]=e):e.addTo(n)}),i.length>1){const t=e.get("layerControl");l.layers(o,{},t).addTo(n)}const d=document.createElement("div");d.style="position: absolute;left: 0;top: 0;z-index: 100",d.appendChild(a),new h(d).addTo(n)}i=new t(e.__map,n),o.push(i),i.setMapOffset(e.__mapOffset||[0,0]);const{center:c,zoom:d}=e.get("mapOptions");c&&d&&(i.setZoom(d),i.setCenter(c)),e.coordinateSystem=i}),e.eachSeries(t=>{"leaflet"===t.get("coordinateSystem")&&(t.coordinateSystem=i)}),o},t};Xp.version="1.0.0";const XP=Xp;window.L=t(481);let qP=!1;window.NetJSONGraph=class{constructor(t,e={}){return this.graph=new WT(t),this.config=this.initializeConfig(e),this.graph.setConfig(this.config),this.setupGraph(),this.config.onInit.call(this.graph),this.initializeECharts(),void 0===e.showMapLabelsAtZoom&&void 0!==e.showLabelsAtZoomLevel&&(console.warn("showLabelsAtZoomLevel has been renamed to showMapLabelsAtZoom, please update your code accordingly."),this.graph.config.showMapLabelsAtZoom=e.showLabelsAtZoomLevel),this.graph}initializeConfig(t={}){return{...t,render:"map"===t.render?GP.prototype.mapRender:GP.prototype.graphRender,onInit:this.onInit,onRender:this.onRender,onUpdate:this.onUpdate,afterUpdate:this.afterUpdate,onLoad:this.onLoad}}setupGraph(){Object.setPrototypeOf(GP.prototype,this.graph.utils),this.graph.gui=new UP(this.graph),this.graph.utils=new GP,this.graph.setUtils(),this.graph.event=this.graph.utils.createEvent()}initializeECharts(){qP||(XP(),qP=!0),this.graph.echarts=function(t,e,n){var i=!(n&&n.ssr);if(i){var o=ul(t);if(o)return o}var r=new xT(t,null,n);return r.id="ec_"+OT++,DT[r.id]=r,i&&On(t,zT,r.id),oT(r),HS.trigger("afterinit",r),r}(this.graph.el,0,{renderer:this.graph.config.svgRender?"svg":"canvas"})}onInit(){return this.config}onRender(){return this.utils.showLoading.call(this),this.gui.init(),this.config}onUpdate(){return this.config}afterUpdate(){return this.config}onLoad(){return this.config.metadata&&this.utils.isNetJSON(this.data)?(this.gui.createMetaInfoContainer(this.graph),this.utils.updateMetadata.call(this)):this.gui.nodeLinkInfoContainer=this.gui.createNodeLinkInfoContainer(),this.config.switchMode&&this.utils.isNetJSON(this.data)&&(this.gui.renderModeSelector.onclick=()=>{if(this.config.render===this.utils.mapRender){this.config.render=this.utils.graphRender;const t=this.echarts.getZr().painter.getViewportRoot().parentNode;this.echarts.clear(),this.utils.graphRender(this.data,this),t.style.background=this.echarts.getZr()._backgroundColor,document.querySelector(".leaflet-control-attribution").style.display="none",document.querySelector(".leaflet-control-zoom").style.display="none"}else this.echarts.clear(),this.config.render=this.utils.mapRender,this.utils.mapRender(this.data,this),document.querySelector(".leaflet-control-attribution").style.display="block",document.querySelector(".leaflet-control-zoom").style.display="block"}),this.utils.hideLoading.call(this),this.attachClientsOverlay=t=>function(t,e={}){function n(){u=function(){const t=o.getOption();return t&&t.series&&t.series[0]&&t.series[0].zoom?t.series[0].zoom:1}(),d.attr("invisible",!(u>=l))}function i(){const t=o.getModel().getSeriesByIndex(0);if(!t)return;const e=t.getData();if(!e)return;if(n(),d.removeAll(),u{let r=0;if(0!==n)for(let s=0;rt?"number"==typeof t.clients?t.clients:Array.isArray(t.clients)?t.clients.length:0:0,c=function(){const t=o.getModel().getSeriesByIndex(0);if(!t)return null;const e=(o._chartsViews||[]).find(e=>e&&e.__model&&e.__model.uid===t.uid);return e?e.group:null}();if(!c)return{destroy(){}};const d=new Em({silent:!0,z:100,zlevel:1});c.add(d);const p=t&&t.config&&t.config.graphConfig&&t.config.graphConfig.series||{},f=("number"==typeof p.nodeSize?p.nodeSize:18)/2,g=[["finished",i],["rendered",i],["graphLayoutEnd",i],["graphRoam",()=>{n(),i()}]];return g.forEach(([t,e])=>o.on(t,e)),i(),{destroy(){g.forEach(([t,e])=>{o&&o.off&&o.off(t,e)}),d&&d.parent&&d.parent.remove(d)},setMinZoomLevel(t){l=t,i()},getMinZoomLevel:()=>l}}(this,t),this.config}}})()})(); \ No newline at end of file From c2d02586c88282b78c5f4ab57bde83a6a86bd3ed Mon Sep 17 00:00:00 2001 From: dee077 Date: Mon, 25 May 2026 19:56:46 +0530 Subject: [PATCH 3/4] [fix] Clear _popupState on error and async race condition --- .../device/static/monitoring/js/device-map.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/openwisp_monitoring/device/static/monitoring/js/device-map.js b/openwisp_monitoring/device/static/monitoring/js/device-map.js index ea2930eb9..4abb62a05 100644 --- a/openwisp_monitoring/device/static/monitoring/js/device-map.js +++ b/openwisp_monitoring/device/static/monitoring/js/device-map.js @@ -149,9 +149,9 @@ return popupContent; } catch (error) { loadingOverlay.hide(); + map._popupState = null; alert(gettext("Error while retrieving data")); - console.error(error); - return null; + throw error; } } @@ -281,6 +281,9 @@ const floorplanUrl = getIndoorCoordinatesUrl(locationId); window.openFloorPlan(floorplanUrl, locationId); }); + currentPopup.on("remove", () => { + netjsongraphInstance.leaflet._popupState = null; + }); } const leafletConfig = JSON.parse($("#leaflet-config").text()); @@ -366,7 +369,7 @@ nodeStyle: { color: STATUS_COLORS[status] }, })), // Hide ECharts node labels completely at any zoom level - showMapLabelsAtZoom: 0, + showMapLabelsAtZoom: 8, echartsOption: { tooltip: { show: false, // Completely disable tooltips From ce0a8302710892d2c5964d5591ead969e8866544 Mon Sep 17 00:00:00 2001 From: dee077 Date: Thu, 28 May 2026 02:38:36 +0530 Subject: [PATCH 4/4] [fix] Label issue --- .../device/static/monitoring/js/device-map.js | 19 ++----------------- .../monitoring/js/lib/netjsongraph.min.js | 2 +- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/openwisp_monitoring/device/static/monitoring/js/device-map.js b/openwisp_monitoring/device/static/monitoring/js/device-map.js index 4abb62a05..8f4b1529c 100644 --- a/openwisp_monitoring/device/static/monitoring/js/device-map.js +++ b/openwisp_monitoring/device/static/monitoring/js/device-map.js @@ -368,8 +368,8 @@ name: status, nodeStyle: { color: STATUS_COLORS[status] }, })), - // Hide ECharts node labels completely at any zoom level - showMapLabelsAtZoom: 8, + // Only shows fixed node lable on zoom >= 10 + showMapLabelsAtZoom: 10, echartsOption: { tooltip: { show: false, // Completely disable tooltips @@ -426,21 +426,6 @@ map.leaflet.addControl(new L.control.scale(scale)); } - try { - const initialZoom = map.leaflet.getZoom(); - const showLabel = initialZoom >= map.config.showMapLabelsAtZoom; - map.echarts.setOption({ - series: [ - { - label: { show: false }, - emphasis: { label: { show: showLabel } }, - }, - ], - }); - } catch (e) { - console.warn(gettext("Unable to set initial label visibility"), e); - } - try { const features = (map.data && map.data.features) || []; if (features.length) { diff --git a/openwisp_monitoring/device/static/monitoring/js/lib/netjsongraph.min.js b/openwisp_monitoring/device/static/monitoring/js/lib/netjsongraph.min.js index 83e1357df..f56dcccad 100644 --- a/openwisp_monitoring/device/static/monitoring/js/lib/netjsongraph.min.js +++ b/openwisp_monitoring/device/static/monitoring/js/lib/netjsongraph.min.js @@ -1 +1 @@ -(()=>{function t(i){var o=n[i];if(void 0!==o)return o.exports;var r=n[i]={exports:{}};return e[i].call(r.exports,r,r.exports,t),r.exports}var e={481(t,e){!function(t){"use strict";function e(t){var e,n,i,o;for(n=1,i=arguments.length;n=0}function O(t){sn[t.pointerId]=t}function z(t){sn[t.pointerId]&&(sn[t.pointerId]=t)}function E(t){delete sn[t.pointerId]}function R(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var n in e.touches=[],sn)e.touches.push(sn[n]);e.changedTouches=[e],t(e)}}function B(t){return"string"==typeof t?document.getElementById(t):t}function N(t,e){var n=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!n||"auto"===n)&&document.defaultView){var i=document.defaultView.getComputedStyle(t,null);n=i?i[e]:null}return"auto"===n?null:n}function F(t,e,n){var i=document.createElement(t);return i.className=e||"",n&&n.appendChild(i),i}function V(t){var e=t.parentNode;e&&e.removeChild(t)}function Z(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function H(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function W(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function j(t,e){if(void 0!==t.classList)return t.classList.contains(e);var n=X(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)}function G(t,e){if(void 0!==t.classList)for(var n=u(e),i=0,o=n.length;ie&&(n.push(t[i]),o=i);return ol&&(r=a,l=s);l>n&&(e[r]=1,Mt(t,e,n,i,r),Mt(t,e,n,r,o))}function Ct(t,e,n,i,o){var r,a,s,l=i?In:It(t,n),u=It(e,n);for(In=u;;){if(!(l|u))return[t,e];if(l&u)return!1;s=It(a=kt(t,e,r=l||u,n,o),n),r===l?(t=a,l=s):(e=a,u=s)}}function kt(t,e,n,i,o){var r,a,s=e.x-t.x,l=e.y-t.y,u=i.min,h=i.max;return 8&n?(r=t.x+s*(h.y-t.y)/l,a=h.y):4&n?(r=t.x+s*(u.y-t.y)/l,a=u.y):2&n?(r=h.x,a=t.y+l*(h.x-t.x)/s):1&n&&(r=u.x,a=t.y+l*(u.x-t.x)/s),new _(r,a,o)}function It(t,e){var n=0;return t.xe.max.x&&(n|=2),t.ye.max.y&&(n|=8),n}function Lt(t,e){var n=e.x-t.x,i=e.y-t.y;return n*n+i*i}function Pt(t,e,n,i){var o,r=e.x,a=e.y,s=n.x-r,l=n.y-a,u=s*s+l*l;return u>0&&((o=((t.x-r)*s+(t.y-a)*l)/u)>1?(r=n.x,a=n.y):o>0&&(r+=s*o,a+=l*o)),s=t.x-r,l=t.y-a,i?s*s+l*l:new _(r,a)}function Dt(t){return!qt(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function At(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Dt(t)}function Ot(t,e){var n,i,o,r,a,s,l,u;if(!t||0===t.length)throw new Error("latlngs not passed");Dt(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var h=C([0,0]),c=T(t);c.getNorthWest().distanceTo(c.getSouthWest())*c.getNorthEast().distanceTo(c.getNorthWest())<1700&&(h=bt(t));var d=t.length,p=[];for(n=0;ni){u=[s.x-(l=(r-i)/o)*(s.x-a.x),s.y-l*(s.y-a.y)];break}var g=e.unproject(x(u));return C([g.lat+h.lat,g.lng+h.lng])}function zt(t,e){var n,i,o,r,a="Feature"===t.type?t.geometry:t,s=a?a.coordinates:null,l=[],u=e&&e.pointToLayer,h=e&&e.coordsToLatLng||Rt;if(!s&&!a)return null;switch(a.type){case"Point":return Et(u,t,n=h(s),e);case"MultiPoint":for(o=0,r=s.length;o0&&o.push(o[0].slice()),o}function Vt(t,n){return t.feature?e({},t.feature,{geometry:n}):Zt(n)}function Zt(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}function Ht(t,e){return new Jn(t,e)}function Wt(t,e){return new ui(t,e)}function jt(t){return Qe.canvas?new di(t):null}function Gt(t){return Qe.svg||Qe.vml?new mi(t):null}var Ut=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}(),Yt=0,Xt=/\{ *([\w_ -]+) *\}/g,qt=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Kt="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",$t=0,Jt=window.requestAnimationFrame||f("RequestAnimationFrame")||g,Qt=window.cancelAnimationFrame||f("CancelAnimationFrame")||f("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)},te={__proto__:null,extend:e,create:Ut,bind:n,get lastId(){return Yt},stamp:i,throttle:o,wrapNum:r,falseFn:a,formatNum:s,trim:l,splitWords:u,setOptions:h,getParamString:c,template:d,isArray:qt,indexOf:p,emptyImageUrl:Kt,requestFn:Jt,cancelFn:Qt,requestAnimFrame:m,cancelAnimFrame:y};v.extend=function(t){var n=function(){h(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=n.__super__=this.prototype,o=Ut(i);for(var r in o.constructor=n,n.prototype=o,this)Object.prototype.hasOwnProperty.call(this,r)&&"prototype"!==r&&"__super__"!==r&&(n[r]=this[r]);return t.statics&&e(n,t.statics),t.includes&&(function(t){if("undefined"!=typeof L&&L&&L.Mixin){t=qt(t)?t:[t];for(var e=0;e0?Math.floor(t):Math.ceil(t)};_.prototype={clone:function(){return new _(this.x,this.y)},add:function(t){return this.clone()._add(x(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(x(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new _(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new _(this.x/t.x,this.y/t.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=ie(this.x),this.y=ie(this.y),this},distanceTo:function(t){var e=(t=x(t)).x-this.x,n=t.y-this.y;return Math.sqrt(e*e+n*n)},equals:function(t){return(t=x(t)).x===this.x&&t.y===this.y},contains:function(t){return t=x(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+s(this.x)+", "+s(this.y)+")"}},w.prototype={extend:function(t){var e,n;if(!t)return this;if(t instanceof _||"number"==typeof t[0]||"x"in t)e=n=x(t);else if(n=(t=b(t)).max,!(e=t.min)||!n)return this;return this.min||this.max?(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(n.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(n.y,this.max.y)):(this.min=e.clone(),this.max=n.clone()),this},getCenter:function(t){return x((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return x(this.min.x,this.max.y)},getTopRight:function(){return x(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,n;return(t="number"==typeof t[0]||t instanceof _?x(t):b(t))instanceof w?(e=t.min,n=t.max):e=n=t,e.x>=this.min.x&&n.x<=this.max.x&&e.y>=this.min.y&&n.y<=this.max.y},intersects:function(t){t=b(t);var e=this.min,n=this.max,i=t.min,o=t.max;return o.x>=e.x&&i.x<=n.x&&o.y>=e.y&&i.y<=n.y},overlaps:function(t){t=b(t);var e=this.min,n=this.max,i=t.min,o=t.max;return o.x>e.x&&i.xe.y&&i.y=i.lat&&n.lat<=o.lat&&e.lng>=i.lng&&n.lng<=o.lng},intersects:function(t){t=T(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),o=t.getNorthEast();return o.lat>=e.lat&&i.lat<=n.lat&&o.lng>=e.lng&&i.lng<=n.lng},overlaps:function(t){t=T(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),o=t.getNorthEast();return o.lat>e.lat&&i.late.lng&&i.lng1,Xe=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",a,e),window.removeEventListener("testPassiveEventSupport",a,e)}catch(t){}return t}(),qe=!!document.createElement("canvas").getContext,Ke=!(!document.createElementNS||!P("svg").createSVGRect),$e=!!Ke&&((ue=document.createElement("div")).innerHTML="","http://www.w3.org/2000/svg"===(ue.firstChild&&ue.firstChild.namespaceURI)),Je=!Ke&&function(){try{var t=document.createElement("div");t.innerHTML='';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),Qe={ie:_e,ielt9:xe,edge:we,webkit:be,android:Se,android23:Te,androidStock:Ce,opera:ke,chrome:Ie,gecko:Le,safari:Pe,phantom:De,opera12:Ae,win:Oe,ie3d:ze,webkit3d:Ee,gecko3d:Re,any3d:Be,mobile:Ne,mobileWebkit:Fe,mobileWebkit3d:Ve,msPointer:Ze,pointer:He,touch:je,touchNative:We,mobileOpera:Ge,mobileGecko:Ue,retina:Ye,passiveEvents:Xe,canvas:qe,svg:Ke,vml:Je,inlineSvg:$e,mac:0===navigator.platform.indexOf("Mac"),linux:0===navigator.platform.indexOf("Linux")},tn=Qe.msPointer?"MSPointerDown":"pointerdown",en=Qe.msPointer?"MSPointerMove":"pointermove",nn=Qe.msPointer?"MSPointerUp":"pointerup",on=Qe.msPointer?"MSPointerCancel":"pointercancel",rn={touchstart:tn,touchmove:en,touchend:nn,touchcancel:on},an={touchstart:function(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&ft(e),R(t,e)},touchmove:R,touchend:R,touchcancel:R},sn={},ln=!1,un=200,hn=K(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),cn=K(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),dn="webkitTransition"===cn||"OTransition"===cn?cn+"End":"transitionend";if("onselectstart"in document)he=function(){at(window,"selectstart",ft)},ce=function(){st(window,"selectstart",ft)};else{var pn=K(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);he=function(){if(pn){var t=document.documentElement.style;de=t[pn],t[pn]="none"}},ce=function(){pn&&(document.documentElement.style[pn]=de,de=void 0)}}var fn={__proto__:null,TRANSFORM:hn,TRANSITION:cn,TRANSITION_END:dn,get:B,getStyle:N,create:F,remove:V,empty:Z,toFront:H,toBack:W,hasClass:j,addClass:G,removeClass:U,setClass:Y,getClass:X,setOpacity:q,testProp:K,setTransform:$,setPosition:J,getPosition:Q,get disableTextSelection(){return he},get enableTextSelection(){return ce},disableImageDrag:tt,enableImageDrag:et,preventOutline:nt,restoreOutline:it,getSizedParentNode:ot,getScale:rt},gn="_leaflet_events",mn={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"},yn=Qe.linux&&Qe.chrome?window.devicePixelRatio:Qe.mac?3*window.devicePixelRatio:window.devicePixelRatio>0?2*window.devicePixelRatio:1,vn={__proto__:null,on:at,off:st,stopPropagation:ct,disableScrollPropagation:dt,disableClickPropagation:pt,preventDefault:ft,stop:gt,getPropagationPath:mt,getMousePosition:yt,getWheelDelta:vt,isExternalTarget:_t,addListener:at,removeListener:st},_n=ne.extend({run:function(t,e,n,i){this.stop(),this._el=t,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(i||.5,.2),this._startPos=Q(t),this._offset=e.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=m(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,n=1e3*this._duration;ethis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var n=this.getCenter(),i=this._limitCenter(n,this._zoom,T(t));return n.equals(i)||this.panTo(i,e),this._enforcingBounds=!1,this},panInside:function(t,e){var n=x((e=e||{}).paddingTopLeft||e.padding||[0,0]),i=x(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),r=this.project(t),a=this.getPixelBounds(),s=b([a.min.add(n),a.max.subtract(i)]),l=s.getSize();if(!s.contains(r)){this._enforcingBounds=!0;var u=r.subtract(s.getCenter()),h=s.extend(r).getSize().subtract(l);o.x+=u.x<0?-h.x:h.x,o.y+=u.y<0?-h.y:h.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=e({animate:!1,pan:!0},!0===t?{animate:!0}:t);var i=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),r=i.divideBy(2).round(),a=o.divideBy(2).round(),s=r.subtract(a);return s.x||s.y?(t.animate&&t.pan?this.panBy(s):(t.pan&&this._rawPanBy(s),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(n(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:i,newSize:o})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=e({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var i=n(this._handleGeolocationResponse,this),o=n(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(i,o,t):navigator.geolocation.getCurrentPosition(i,o,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,n=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+n+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=new M(t.coords.latitude,t.coords.longitude),n=e.toBounds(2*t.coords.accuracy),i=this._locateOptions;if(i.setView){var o=this.getBoundsZoom(n);this.setView(e,i.maxZoom?Math.min(o,i.maxZoom):o)}var r={latlng:e,bounds:n,timestamp:t.timestamp};for(var a in t.coords)"number"==typeof t.coords[a]&&(r[a]=t.coords[a]);this.fire("locationfound",r)}},addHandler:function(t,e){if(!e)return this;var n=this[t]=new e(this);return this._handlers.push(n),this.options[t]&&n.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(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),V(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(y(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)V(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var n=F("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new S(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,n){t=T(t),n=x(n||[0,0]);var i=this.getZoom()||0,o=this.getMinZoom(),r=this.getMaxZoom(),a=t.getNorthWest(),s=t.getSouthEast(),l=this.getSize().subtract(n),u=b(this.project(s,i),this.project(a,i)).getSize(),h=Qe.any3d?this.options.zoomSnap:1,c=l.x/u.x,d=l.y/u.y,p=e?Math.max(c,d):Math.min(c,d);return i=this.getScaleZoom(p,i),h&&(i=Math.round(i/(h/100))*(h/100),i=e?Math.ceil(i/h)*h:Math.floor(i/h)*h),Math.max(o,Math.min(r,i))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new _(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var n=this._getTopLeftPoint(t,e);return new w(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var n=this.options.crs;return e=void 0===e?this._zoom:e,n.scale(t)/n.scale(e)},getScaleZoom:function(t,e){var n=this.options.crs,i=n.zoom(t*n.scale(e=void 0===e?this._zoom:e));return isNaN(i)?1/0:i},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(C(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(x(t),e)},layerPointToLatLng:function(t){var e=x(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(C(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(C(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(T(t))},distance:function(t,e){return this.options.crs.distance(C(t),C(e))},containerPointToLayerPoint:function(t){return x(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return x(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(x(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(C(t)))},mouseEventToContainerPoint:function(t){return yt(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=B(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");at(e,"scroll",this._onScroll,this),this._containerId=i(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&Qe.any3d,G(t,"leaflet-container"+(Qe.touch?" leaflet-touch":"")+(Qe.retina?" leaflet-retina":"")+(Qe.ielt9?" leaflet-oldie":"")+(Qe.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=N(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),J(this._mapPane,new _(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(G(t.markerPane,"leaflet-zoom-hide"),G(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,n){J(this._mapPane,new _(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,n)._move(t,e)._moveEnd(o),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,n,i){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),i?n&&n.pinch&&this.fire("zoom",n):((o||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return y(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){J(this._mapPane,this._getMapPanePos().subtract(t))},_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(t){this._targets={},this._targets[i(this._container)]=this;var e=t?st:at;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),Qe.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){y(this._resizeRequest),this._resizeRequest=m(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var n,o=[],r="mouseout"===e||"mouseover"===e,a=t.target||t.srcElement,s=!1;a;){if((n=this._targets[i(a)])&&("click"===e||"preclick"===e)&&this._draggableMoved(n)){s=!0;break}if(n&&n.listens(e,!0)){if(r&&!_t(a,t))break;if(o.push(n),r)break}if(a===this._container)break;a=a.parentNode}return o.length||s||r||!this.listens(e,!0)||(o=[this]),o},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(e))){var n=t.type;"mousedown"===n&&nt(e),this._fireDOMEvent(t,n)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,n,i){if("click"===t.type){var o=e({},t);o.type="preclick",this._fireDOMEvent(o,o.type,i)}var r=this._findEventTargets(t,n);if(i){for(var a=[],s=0;s0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),n=this.getMaxZoom(),i=Qe.any3d?this.options.zoomSnap:1;return i&&(t=Math.round(t/i)*i),Math.max(e,Math.min(n,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){U(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var n=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(n)||(this.panBy(n,e),0))},_createAnimProxy:function(){var t=this._proxy=F("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(t){var e=hn,n=this._proxy.style[e];$(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),n===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){V(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();$(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,n){if(this._animatingZoom)return!0;if(n=n||{},!this._zoomAnimated||!1===n.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var i=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/i);return!(!0!==n.animate&&!this.getSize().contains(o)||(m(function(){this._moveStart(!0,n.noMoveStart||!1)._animateZoom(t,e,!0)},this),0))},_animateZoom:function(t,e,i,o){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,G(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:o}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(n(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&U(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))}}),wn=v.extend({options:{position:"topright"},initialize:function(t){h(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),n=this.getPosition(),i=t._controlCorners[n];return G(e,"leaflet-control"),-1!==n.indexOf("bottom")?i.insertBefore(e,i.firstChild):i.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(V(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),bn=function(t){return new wn(t)};xn.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){function t(t,o){e[t+o]=F("div",n+t+" "+n+o,i)}var e=this._controlCorners={},n="leaflet-",i=this._controlContainer=F("div",n+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)V(this._controlCorners[t]);V(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Sn=wn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,n,i){return n1)?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(i(t.target)),n=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;n&&this._map.fire(n,e)},_createRadioElement:function(t,e){var n='",i=document.createElement("div");return i.innerHTML=n,i.firstChild},_addItem:function(t){var e,n=document.createElement("label"),o=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=o):e=this._createRadioElement("leaflet-base-layers_"+i(this),o),this._layerControlInputs.push(e),e.layerId=i(t.layer),at(e,"click",this._onInputClick,this);var r=document.createElement("span");r.innerHTML=" "+t.name;var a=document.createElement("span");return n.appendChild(a),a.appendChild(e),a.appendChild(r),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var t,e,n=this._layerControlInputs,i=[],o=[];this._handlingClick=!0;for(var r=n.length-1;r>=0;r--)e=this._getLayer((t=n[r]).layerId).layer,t.checked?i.push(e):t.checked||o.push(e);for(r=0;r=0;o--)e=this._getLayer((t=n[o]).layerId).layer,t.disabled=void 0!==e.options.minZoom&&ie.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,at(t,"click",ft),this.expand();var e=this;setTimeout(function(){st(t,"click",ft),e._preventClick=!1})}}),Tn=wn.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",n=F("div",e+" leaflet-bar"),i=this.options;return this._zoomInButton=this._createButton(i.zoomInText,i.zoomInTitle,e+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(i.zoomOutText,i.zoomOutTitle,e+"-out",n,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(t){t.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(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,n,i,o){var r=F("a",n,i);return r.innerHTML=t,r.href="#",r.title=e,r.setAttribute("role","button"),r.setAttribute("aria-label",e),pt(r),at(r,"click",gt),at(r,"click",o,this),at(r,"click",this._refocusOnMap,this),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";U(this._zoomInButton,e),U(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(G(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(G(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});xn.mergeOptions({zoomControl:!0}),xn.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Tn,this.addControl(this.zoomControl))});var Mn=wn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",n=F("div",e),i=this.options;return this._addScales(i,e+"-line",n),t.on(i.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),n},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,n){t.metric&&(this._mScale=F("div",e,n)),t.imperial&&(this._iScale=F("div",e,n))},_update:function(){var t=this._map,e=t.getSize().y/2,n=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(n)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,n,i,o=3.2808399*t;o>5280?(n=this._getRoundNum(e=o/5280),this._updateScale(this._iScale,n+" mi",n/e)):(i=this._getRoundNum(o),this._updateScale(this._iScale,i+" ft",i/o))},_updateScale:function(t,e,n){t.style.width=Math.round(this.options.maxWidth*n)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),n=t/e;return e*(n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}}),Cn=wn.extend({options:{position:"bottomright",prefix:''+(Qe.inlineSvg?' ':"")+"Leaflet"},initialize:function(t){h(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=F("div","leaflet-control-attribution"),pt(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var n=[];this.options.prefix&&n.push(this.options.prefix),t.length&&n.push(t.join(", ")),this._container.innerHTML=n.join(' ')}}});xn.mergeOptions({attributionControl:!0}),xn.addInitHook(function(){this.options.attributionControl&&(new Cn).addTo(this)}),wn.Layers=Sn,wn.Zoom=Tn,wn.Scale=Mn,wn.Attribution=Cn,bn.layers=function(t,e,n){return new Sn(t,e,n)},bn.zoom=function(t){return new Tn(t)},bn.scale=function(t){return new Mn(t)},bn.attribution=function(t){return new Cn(t)};var kn=v.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});kn.addTo=function(t,e){return t.addHandler(e,this),this};var In,Ln={Events:ee},Pn=Qe.touch?"touchstart mousedown":"mousedown",Dn=ne.extend({options:{clickTolerance:3},initialize:function(t,e,n,i){h(this,i),this._element=t,this._dragStartTarget=e||t,this._preventOutline=n},enable:function(){this._enabled||(at(this._dragStartTarget,Pn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Dn._dragging===this&&this.finishDrag(!0),st(this._dragStartTarget,Pn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!j(this._element,"leaflet-zoom-anim")))if(t.touches&&1!==t.touches.length)Dn._dragging===this&&this.finishDrag();else if(!(Dn._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(Dn._dragging=this,this._preventOutline&&nt(this._element),tt(),he(),this._moving))){this.fire("down");var e=t.touches?t.touches[0]:t,n=ot(this._element);this._startPoint=new _(e.clientX,e.clientY),this._startPos=Q(this._element),this._parentScale=rt(n);var i="mousedown"===t.type;at(document,i?"mousemove":"touchmove",this._onMove,this),at(document,i?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(t){if(this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,n=new _(e.clientX,e.clientY)._subtract(this._startPoint);(n.x||n.y)&&(Math.abs(n.x)+Math.abs(n.y)1e-7;l++)e=r*Math.sin(s),e=Math.pow((1-e)/(1+e),r/2),s+=u=Math.PI/2-2*Math.atan(a*e)-s;return new M(s*n,t.x*n/i)}},Rn={__proto__:null,LonLat:zn,Mercator:En,SphericalMercator:le},Bn=e({},ae,{code:"EPSG:3395",projection:En,transformation:function(){var t=.5/(Math.PI*En.R);return I(t,.5,-t,.5)}()}),Nn=e({},ae,{code:"EPSG:4326",projection:zn,transformation:I(1/180,1,-1/180,.5)}),Fn=e({},re,{projection:zn,transformation:I(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var n=e.lng-t.lng,i=e.lat-t.lat;return Math.sqrt(n*n+i*i)},infinite:!0});re.Earth=ae,re.EPSG3395=Bn,re.EPSG3857=me,re.EPSG900913=ye,re.EPSG4326=Nn,re.Simple=Fn;var Vn=ne.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[i(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[i(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var n=this.getEvents();e.on(n,this),this.once("remove",function(){e.off(n,this)},this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});xn.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=i(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=i(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return i(t)in this._layers},eachLayer:function(t,e){for(var n in this._layers)t.call(e,this._layers[n]);return this},_addLayers:function(t){for(var e=0,n=(t=t?qt(t)?t:[t]:[]).length;ethis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()=2&&e[0]instanceof M&&e[0].equals(e[n-1])&&e.pop(),e},_setLatLngs:function(t){Kn.prototype._setLatLngs.call(this,t),Dt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Dt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,n=new _(e,e);if(t=new w(t.min.subtract(n),t.max.add(n)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var i,o=0,r=this._rings.length;ot.y!=(i=e[a]).y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(u=!u);return u||Kn.prototype._containsPoint.call(this,t,!0)}}),Jn=Hn.extend({initialize:function(t,e){h(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,n,i,o=qt(t)?t:t.features;if(o){for(e=0,n=o.length;e0?o:[e.src]}else{qt(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var s=0;si?(e.height=i+"px",G(t,o)):U(t,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),n=this._getAnchor();J(this._container,e.add(n))},_adjustPan:function(){if(this.options.autoPan)if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)this._autopanning=!1;else{var t=this._map,e=parseInt(N(this._container,"marginBottom"),10)||0,n=this._container.offsetHeight+e,i=this._containerWidth,o=new _(this._containerLeft,-n-this._containerBottom);o._add(Q(this._container));var r=t.layerPointToContainerPoint(o),a=x(this.options.autoPanPadding),s=x(this.options.autoPanPaddingTopLeft||a),l=x(this.options.autoPanPaddingBottomRight||a),u=t.getSize(),h=0,c=0;r.x+i+l.x>u.x&&(h=r.x+i-u.x+l.x),r.x-h-s.x<0&&(h=r.x-s.x),r.y+n+l.y>u.y&&(c=r.y+n-u.y+l.y),r.y-c-s.y<0&&(c=r.y-s.y),(h||c)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([h,c]))}},_getAnchor:function(){return x(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});xn.mergeOptions({closePopupOnClick:!0}),xn.include({openPopup:function(t,e,n){return this._initOverlay(ri,t,e,n).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),Vn.include({bindPopup:function(t,e){return this._popup=this._initOverlay(ri,this._popup,t,e),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(t){return this._popup&&(this instanceof Hn||(this._popup._source=this),this._popup._prepareOpen(t||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()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(this._popup&&this._map){gt(t);var e=t.layer||t.target;this._popup._source!==e||e instanceof Yn?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var ai=oi.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){oi.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){oi.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=oi.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){this._contentNode=this._container=F("div","leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide")),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+i(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,n,i=this._map,o=this._container,r=i.latLngToContainerPoint(i.getCenter()),a=i.layerPointToContainerPoint(t),s=this.options.direction,l=o.offsetWidth,u=o.offsetHeight,h=x(this.options.offset),c=this._getAnchor();"top"===s?(e=l/2,n=u):"bottom"===s?(e=l/2,n=0):"center"===s?(e=l/2,n=u/2):"right"===s?(e=0,n=u/2):"left"===s?(e=l,n=u/2):a.xthis.options.maxZoom||ni&&this._retainParent(o,r,a,i))},_retainChildren:function(t,e,n,i){for(var o=2*t;o<2*t+2;o++)for(var r=2*e;r<2*e+2;r++){var a=new _(o,r);a.z=n+1;var s=this._tileCoordsToKey(a),l=this._tiles[s];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),n+1this.options.maxZoom||void 0!==this.options.minZoom&&o1)this._setView(t,n);else{for(var c=o.min.y;c<=o.max.y;c++)for(var d=o.min.x;d<=o.max.x;d++){var p=new _(d,c);if(p.z=this._tileZoom,this._isValidTile(p)){var f=this._tiles[this._tileCoordsToKey(p)];f?f.current=!0:a.push(p)}}if(a.sort(function(t,e){return t.distanceTo(r)-e.distanceTo(r)}),0!==a.length){this._loading||(this._loading=!0,this.fire("loading"));var g=document.createDocumentFragment();for(d=0;dn.max.x)||!e.wrapLat&&(t.yn.max.y))return!1}if(!this.options.bounds)return!0;var i=this._tileCoordsToBounds(t);return T(this.options.bounds).overlaps(i)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,n=this.getTileSize(),i=t.scaleBy(n),o=i.add(n);return[e.unproject(i,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),n=new S(e[0],e[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),n=new _(+e[0],+e[1]);return n.z=+e[2],n},_removeTile:function(t){var e=this._tiles[t];e&&(V(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){G(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=a,t.onmousemove=a,Qe.ielt9&&this.options.opacity<1&&q(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),o=this._tileCoordsToKey(t),r=this.createTile(this._wrapCoords(t),n(this._tileReady,this,t));this._initTile(r),this.createTile.length<2&&m(n(this._tileReady,this,t,null,r)),J(r,i),this._tiles[o]={el:r,coords:t,current:!0},e.appendChild(r),this.fire("tileloadstart",{tile:r,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var o=this._tileCoordsToKey(t);(i=this._tiles[o])&&(i.loaded=+new Date,this._map._fadeAnimated?(q(i.el,0),y(this._fadeFrame),this._fadeFrame=m(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(G(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Qe.ielt9||!this._map._fadeAnimated?m(this._pruneTiles,this):setTimeout(n(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new _(this._wrapX?r(t.x,this._wrapX):t.x,this._wrapY?r(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new w(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}}),ui=li.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=h(this,e)).detectRetina&&Qe.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return at(i,"load",n(this._tileOnLoad,this,e,i)),at(i,"error",n(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var n={r:Qe.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(n.y=i),n["-y"]=i}return d(this._url,e(n,this.options))},_tileOnLoad:function(t,e){Qe.ielt9?setTimeout(n(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,n){var i=this.options.errorTileUrl;i&&e.getAttribute("src")!==i&&(e.src=i),t(n,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom;return this.options.zoomReverse&&(t=this.options.maxZoom-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=a,e.onerror=a,!e.complete)){e.src=Kt;var n=this._tiles[t].coords;V(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:n})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",Kt),li.prototype._removeTile.call(this,t)},_tileReady:function(t,e,n){if(this._map&&(!n||n.getAttribute("src")!==Kt))return li.prototype._tileReady.call(this,t,e,n)}}),hi=ui.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,n){this._url=t;var i=e({},this.defaultWmsParams);for(var o in n)o in this.options||(i[o]=n[o]);var r=(n=h(this,n)).detectRetina&&Qe.retina?2:1,a=this.getTileSize();i.width=a.x*r,i.height=a.y*r,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version),this.wmsParams[this._wmsVersion>=1.3?"crs":"srs"]=this._crs.code,ui.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),n=this._crs,i=b(n.project(e[0]),n.project(e[1])),o=i.min,r=i.max,a=(this._wmsVersion>=1.3&&this._crs===Nn?[o.y,o.x,r.y,r.x]:[o.x,o.y,r.x,r.y]).join(","),s=ui.prototype.getTileUrl.call(this,t);return s+c(this.wmsParams,s,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+a},setParams:function(t,n){return e(this.wmsParams,t),n||this.redraw(),this}});ui.WMS=hi,Wt.wms=function(t,e){return new hi(t,e)};var ci=Vn.extend({options:{padding:.1},initialize:function(t){h(this,t),i(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),G(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 t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var n=this._map.getZoomScale(e,this._zoom),i=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),r=i.multiplyBy(-n).add(o).subtract(this._map._getNewPixelOrigin(t,e));Qe.any3d?$(this._container,r,n):J(this._container,r)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),n=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new w(n,n.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),di=ci.extend({options:{tolerance:0},getEvents:function(){var t=ci.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ci.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");at(t,"mousemove",this._onMouseMove,this),at(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),at(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){y(this._redrawRequest),delete this._ctx,V(this._container),st(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){ci.prototype._update.call(this);var t=this._bounds,e=this._container,n=t.getSize(),i=Qe.retina?2:1;J(e,t.min),e.width=i*n.x,e.height=i*n.y,e.style.width=n.x+"px",e.style.height=n.y+"px",Qe.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){ci.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[i(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,n=e.next,o=e.prev;n?n.prev=o:this._drawLast=o,o?o.next=n:this._drawFirst=n,delete t._order,delete this._layers[i(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,n,i=t.options.dashArray.split(/[, ]+/),o=[];for(n=0;n')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),fi={_initContainer:function(){this._container=F("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ci.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=pi("shape");G(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=pi("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[i(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;V(e),t.removeInteractiveTarget(e),delete this._layers[i(t)]},_updateStyle:function(t){var e=t._stroke,n=t._fill,i=t.options,o=t._container;o.stroked=!!i.stroke,o.filled=!!i.fill,i.stroke?(e||(e=t._stroke=pi("stroke")),o.appendChild(e),e.weight=i.weight+"px",e.color=i.color,e.opacity=i.opacity,e.dashStyle=i.dashArray?qt(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):"",e.endcap=i.lineCap.replace("butt","flat"),e.joinstyle=i.lineJoin):e&&(o.removeChild(e),t._stroke=null),i.fill?(n||(n=t._fill=pi("fill")),o.appendChild(n),n.color=i.fillColor||i.color,n.opacity=i.fillOpacity):n&&(o.removeChild(n),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),n=Math.round(t._radius),i=Math.round(t._radiusY||n);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+n+","+i+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){H(t._container)},_bringToBack:function(t){W(t._container)}},gi=Qe.vml?pi:P,mi=ci.extend({_initContainer:function(){this._container=gi("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=gi("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){V(this._container),st(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){ci.prototype._update.call(this);var t=this._bounds,e=t.getSize(),n=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,n.setAttribute("width",e.x),n.setAttribute("height",e.y)),J(n,t.min),n.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=gi("path");t.options.className&&G(e,t.options.className),t.options.interactive&&G(e,"leaflet-interactive"),this._updateStyle(t),this._layers[i(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){V(t._path),t.removeInteractiveTarget(t._path),delete this._layers[i(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,n=t.options;e&&(n.stroke?(e.setAttribute("stroke",n.color),e.setAttribute("stroke-opacity",n.opacity),e.setAttribute("stroke-width",n.weight),e.setAttribute("stroke-linecap",n.lineCap),e.setAttribute("stroke-linejoin",n.lineJoin),n.dashArray?e.setAttribute("stroke-dasharray",n.dashArray):e.removeAttribute("stroke-dasharray"),n.dashOffset?e.setAttribute("stroke-dashoffset",n.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),n.fill?(e.setAttribute("fill",n.fillColor||n.color),e.setAttribute("fill-opacity",n.fillOpacity),e.setAttribute("fill-rule",n.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,D(t._parts,e))},_updateCircle:function(t){var e=t._point,n=Math.max(Math.round(t._radius),1),i="a"+n+","+(Math.max(Math.round(t._radiusY),1)||n)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-n)+","+e.y+i+2*n+",0 "+i+2*-n+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){H(t._path)},_bringToBack:function(t){W(t._path)}});Qe.vml&&mi.include(fi),xn.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&jt(t)||Gt(t)}});var yi=$n.extend({initialize:function(t,e){$n.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=T(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});mi.create=gi,mi.pointsToPath=D,Jn.geometryToLayer=zt,Jn.coordsToLatLng=Rt,Jn.coordsToLatLngs=Bt,Jn.latLngToCoords=Nt,Jn.latLngsToCoords=Ft,Jn.getFeature=Vt,Jn.asFeature=Zt,xn.mergeOptions({boxZoom:!0});var vi=kn.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){at(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){st(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){V(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),he(),tt(),this._startPoint=this._map.mouseEventToContainerPoint(t),at(document,{contextmenu:gt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=F("div","leaflet-zoom-box",this._container),G(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new w(this._point,this._startPoint),n=e.getSize();J(this._box,e.min),this._box.style.width=n.x+"px",this._box.style.height=n.y+"px"},_finish:function(){this._moved&&(V(this._box),U(this._container,"leaflet-crosshair")),ce(),et(),st(document,{contextmenu:gt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(n(this._resetState,this),0);var e=new S(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});xn.addInitHook("addHandler","boxZoom",vi),xn.mergeOptions({doubleClickZoom:!0});var _i=kn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,n=e.getZoom(),i=e.options.zoomDelta,o=t.originalEvent.shiftKey?n-i:n+i;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});xn.addInitHook("addHandler","doubleClickZoom",_i),xn.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var xi=kn.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new Dn(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}G(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){U(this._map._container,"leaflet-grab"),U(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 t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=T(this._map.options.maxBounds);this._offsetLimit=b(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.xe.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),n=this._initialWorldOffset,i=this._draggable._newPos.x,o=(i-e+n)%t+e-n,r=(i+e+n)%t-e-n,a=Math.abs(o+n)0?o:-o))-e;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}});xn.addInitHook("addHandler","scrollWheelZoom",bi),xn.mergeOptions({tapHold:Qe.touchNative&&Qe.safari&&Qe.mobile,tapTolerance:15});var Si=kn.extend({addHooks:function(){at(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){st(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),1===t.touches.length){var e=t.touches[0];this._startPos=this._newPos=new _(e.clientX,e.clientY),this._holdTimeout=setTimeout(n(function(){this._cancel(),this._isTapValid()&&(at(document,"touchend",ft),at(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),600),at(document,"touchend touchcancel contextmenu",this._cancel,this),at(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){st(document,"touchend",ft),st(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),st(document,"touchend touchcancel contextmenu",this._cancel,this),st(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new _(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var n=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});n._simulated=!0,e.target.dispatchEvent(n)}});xn.addInitHook("addHandler","tapHold",Si),xn.mergeOptions({touchZoom:Qe.touch,bounceAtZoomLimits:!0});var Ti=kn.extend({addHooks:function(){G(this._map._container,"leaflet-touch-zoom"),at(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){U(this._map._container,"leaflet-touch-zoom"),st(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var n=e.mouseEventToContainerPoint(t.touches[0]),i=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(n.add(i)._divideBy(2))),this._startDist=n.distanceTo(i),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),at(document,"touchmove",this._onTouchMove,this),at(document,"touchend touchcancel",this._onTouchEnd,this),ft(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),o=e.mouseEventToContainerPoint(t.touches[1]),r=i.distanceTo(o)/this._startDist;if(this._zoom=e.getScaleZoom(r,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoome.getMaxZoom()&&r>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===r)return}else{var a=i._add(o)._divideBy(2)._subtract(this._centerPoint);if(1===r&&0===a.x&&0===a.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(a),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),y(this._animRequest);var s=n(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=m(s,this,!0),ft(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,y(this._animRequest),st(document,"touchmove",this._onTouchMove,this),st(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))):this._zooming=!1}});xn.addInitHook("addHandler","touchZoom",Ti),xn.BoxZoom=vi,xn.DoubleClickZoom=_i,xn.Drag=xi,xn.Keyboard=wi,xn.ScrollWheelZoom=bi,xn.TapHold=Si,xn.TouchZoom=Ti,t.Bounds=w,t.Browser=Qe,t.CRS=re,t.Canvas=di,t.Circle=qn,t.CircleMarker=Xn,t.Class=v,t.Control=wn,t.DivIcon=si,t.DivOverlay=oi,t.DomEvent=vn,t.DomUtil=fn,t.Draggable=Dn,t.Evented=ne,t.FeatureGroup=Hn,t.GeoJSON=Jn,t.GridLayer=li,t.Handler=kn,t.Icon=Wn,t.ImageOverlay=ei,t.LatLng=M,t.LatLngBounds=S,t.Layer=Vn,t.LayerGroup=Zn,t.LineUtil=On,t.Map=xn,t.Marker=Un,t.Mixin=Ln,t.Path=Yn,t.Point=_,t.PolyUtil=An,t.Polygon=$n,t.Polyline=Kn,t.Popup=ri,t.PosAnimation=_n,t.Projection=Rn,t.Rectangle=yi,t.Renderer=ci,t.SVG=mi,t.SVGOverlay=ii,t.TileLayer=ui,t.Tooltip=ai,t.Transformation=k,t.Util=te,t.VideoOverlay=ni,t.bind=n,t.bounds=b,t.canvas=jt,t.circle=function(t,e,n){return new qn(t,e,n)},t.circleMarker=function(t,e){return new Xn(t,e)},t.control=bn,t.divIcon=function(t){return new si(t)},t.extend=e,t.featureGroup=function(t,e){return new Hn(t,e)},t.geoJSON=Ht,t.geoJson=ti,t.gridLayer=function(t){return new li(t)},t.icon=function(t){return new Wn(t)},t.imageOverlay=function(t,e,n){return new ei(t,e,n)},t.latLng=C,t.latLngBounds=T,t.layerGroup=function(t,e){return new Zn(t,e)},t.map=function(t,e){return new xn(t,e)},t.marker=function(t,e){return new Un(t,e)},t.point=x,t.polygon=function(t,e){return new $n(t,e)},t.polyline=function(t,e){return new Kn(t,e)},t.popup=function(t,e){return new ri(t,e)},t.rectangle=function(t,e){return new yi(t,e)},t.setOptions=h,t.stamp=i,t.svg=Gt,t.svgOverlay=function(t,e,n){return new ii(t,e,n)},t.tileLayer=Wt,t.tooltip=function(t,e){return new ai(t,e)},t.transformation=I,t.version="1.9.4",t.videoOverlay=function(t,e,n){return new ni(t,e,n)};var Mi=window.L;t.noConflict=function(){return window.L=Mi,this},window.L=t}(e)}},n={};t.d=(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";function e(t,e){function n(){this.constructor=t}if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Kp(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function n(){return vf++}function i(){for(var t=[],e=0;e>1)%2;a.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[s]+":0",o[l]+":0",i[1-s]+":auto",o[1-l]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}return e.clearMarkers=function(){c(n,function(t){t.parentNode&&t.parentNode.removeChild(t)})},n}(e,r),s=function(t,e,n){for(var i=n?"invTrans":"trans",o=e[i],r=e.srcCoords,a=[],s=[],l=!0,u=0;u<4;u++){var h=t[u].getBoundingClientRect(),c=2*u,d=h.left,p=h.top;a.push(d,p),l=l&&r&&d===r[c]&&p===r[c+1],s.push(t[u].offsetLeft,t[u].offsetTop)}return l&&o?o:(e.srcCoords=a,e[i]=n?rt(s,a):rt(a,s))}(a,r,o);if(s)return s(t,n,i),!0}return!1}function st(t){return"CANVAS"===t.nodeName.toUpperCase()}function lt(t){return null==t?"":(t+"").replace(Rf,function(t,e){return Bf[e]})}function ut(t,e,n,i){return n=n||{},i?ht(t,e,n):Vf&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):ht(t,e,n),n}function ht(t,e,n){if(Qp.domSupported&&t.getBoundingClientRect){var i=e.clientX,o=e.clientY;if(st(t)){var r=t.getBoundingClientRect();return n.zrX=i-r.left,void(n.zrY=o-r.top)}if(at(Ff,t,i,o))return n.zrX=Ff[0],void(n.zrY=Ff[1])}n.zrX=n.zrY=0}function ct(t){return t||window.event}function dt(t,e,n){if(null!=(e=ct(e)).zrX)return e;var i=e.type;if(i&&i.indexOf("touch")>=0){var o="touchend"!==i?e.targetTouches[0]:e.changedTouches[0];o&&ut(t,o,e,n)}else{ut(t,e,e,n);var r=function(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,i=t.deltaY;return null==n||null==i?e:3*(0!==i?Math.abs(i):Math.abs(n))*(i>0?-1:i<0?1:n>0?-1:1)}(e);e.zrDelta=r?r/120:-(e.detail||0)/3}var a=e.button;return null==e.which&&void 0!==a&&Nf.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function pt(t,e,n,i){t.addEventListener(e,n,i)}function ft(t,e,n,i){t.removeEventListener(e,n,i)}function gt(t){return 2===t.which||3===t.which}function mt(t){var e=t[1][0]-t[0][0],n=t[1][1]-t[0][1];return Math.sqrt(e*e+n*n)}function yt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function vt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function _t(t,e,n){var i=e[1]*n[0]+e[3]*n[1],o=e[0]*n[2]+e[2]*n[3],r=e[1]*n[2]+e[3]*n[3],a=e[0]*n[4]+e[2]*n[5]+e[4],s=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=e[0]*n[0]+e[2]*n[1],t[1]=i,t[2]=o,t[3]=r,t[4]=a,t[5]=s,t}function xt(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function wt(t,e,n,i){void 0===i&&(i=[0,0]);var o=e[0],r=e[2],a=e[4],s=e[1],l=e[3],u=e[5],h=Math.sin(n),c=Math.cos(n);return t[0]=o*c+s*h,t[1]=-o*h+s*c,t[2]=r*c+l*h,t[3]=-r*h+c*l,t[4]=c*(a-i[0])+h*(u-i[1])+i[0],t[5]=c*(u-i[1])-h*(a-i[0])+i[1],t}function bt(t,e){var n=e[0],i=e[2],o=e[4],r=e[1],a=e[3],s=e[5],l=n*a-r*i;return l?(t[0]=a*(l=1/l),t[1]=-r*l,t[2]=-i*l,t[3]=n*l,t[4]=(i*s-a*o)*l,t[5]=(r*o-n*s)*l,t):null}function St(t,e,n,i,o,r,a,s){var l=Xf(e-n),u=Xf(i-t),h=Uf(l,u),c=qf[o],d=qf[1-o],p=Kf[o];e=u||!eg.bidirectional)&&(ng[c]=-u,ng[d]=0,eg.useDir&&eg.calcDirMTV())))}function Tt(){function t(t){return Xf(t)<1e-10}var e=0,n=new Gf,i=new Gf,o={minTv:new Gf,maxTv:new Gf,useDir:!1,dirMinTv:new Gf,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(t,r){o.touchThreshold=0,t&&null!=t.touchThreshold&&(o.touchThreshold=Yf(0,t.touchThreshold)),o.negativeSize=!1,r&&(o.minTv.set(1/0,1/0),o.maxTv.set(0,0),o.useDir=!1,t&&null!=t.direction&&(o.useDir=!0,o.dirMinTv.copy(o.minTv),i.copy(o.minTv),e=t.direction,o.bidirectional=null==t.bidirectional||!!t.bidirectional,o.bidirectional||n.set(Math.cos(e),Math.sin(e))))},calcDirMTV:function(){var r=o.minTv,a=o.dirMinTv,s=r.y*r.y+r.x*r.x,l=Math.sin(e),u=Math.cos(e),h=l*r.y+u*r.x;t(h)?t(r.x)&&t(r.y)&&a.set(0,0):(i.x=s*u/h,i.y=s*l/h,t(i.x)&&t(i.y)?a.set(0,0):(o.bidirectional||n.dot(i)>0)&&i.len()=0;r--){var a=t[r],s=void 0;if(a!==o&&!a.ignore&&(s=Ct(a,n,i))&&(!e.topTarget&&(e.topTarget=a),s!==ug)){e.target=a;break}}}function It(t,e,n){var i=t.painter;return e<0||e>i.getWidth()||n<0||n>i.getHeight()}function Lt(t,e,n,i){var o=e+1;if(o===n)return 1;if(i(t[o++],t[e])<0){for(;o=0;)o++;return o-e}function Pt(t,e,n,i,o){for(i===e&&i++;i>>1])<0?l=r:s=r+1;var u=i-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;u>0;)t[s+u]=t[s+u-1],u--}t[s]=a}}function Dt(t,e,n,i,o,r){var a=0,s=0,l=1;if(r(t,e[n+o])>0){for(s=i-o;l0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=o,l+=o}else{for(s=o+1;ls&&(l=s);var u=a;a=o-l,l=o-u}for(a++;a>>1);r(t,e[n+h])>0?a=h+1:l=h}return l}function At(t,e,n,i,o,r){var a=0,s=0,l=1;if(r(t,e[n+o])<0){for(s=o+1;ls&&(l=s);var u=a;a=o-l,l=o-u}else{for(s=i-o;l=0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=o,l+=o}for(a++;a>>1);r(t,e[n+h])<0?l=h:a=h+1}return l}function Ot(t,e,n,i){n||(n=0),i||(i=t.length);var o=i-n;if(!(o<2)){var r=0;if(o<32)Pt(t,n,i,n+(r=Lt(t,n,i,e)),e);else{var a=function(t,e){function n(n){var l=i[n],u=o[n],h=i[n+1],c=o[n+1];o[n]=u+c,n===a-3&&(i[n+1]=i[n+2],o[n+1]=o[n+2]),a--;var d=At(t[h],t,l,u,0,e);l+=d,0!==(u-=d)&&0!==(c=Dt(t[l+u-1],t,h,c,c-1,e))&&(u<=c?function(n,i,o,a){var l=0;for(l=0;l=7||p>=7);if(f)break;g<0&&(g=0),g+=2}if((r=g)<1&&(r=1),1===i){for(l=0;l=0;l--)t[p+l]=t[d+l];if(0===i){y=!0;break}}if(t[c--]=s[h--],1===--a){y=!0;break}if(0!==(m=a-Dt(t[u],s,0,a,a-1,e))){for(a-=m,p=1+(c-=m),d=1+(h-=m),l=0;l=7||m>=7);if(y)break;f<0&&(f=0),f+=2}if((r=f)<1&&(r=1),1===a){for(p=1+(c-=i),d=1+(u-=i),l=i-1;l>=0;l--)t[p+l]=t[d+l];t[c]=s[h]}else{if(0===a)throw new Error;for(d=c-(a-1),l=0;l=0;l--)t[p+l]=t[d+l];t[c]=s[h]}else for(d=c-(a-1),l=0;l1;){var t=a-2;if(t>=1&&o[t-1]<=o[t]+o[t+1]||t>=2&&o[t-2]<=o[t]+o[t-1])o[t-1]o[t+1])break;n(t)}},forceMergeRuns:function(){for(;a>1;){var t=a-2;t>0&&o[t-1]=32;)e|=1&t,t>>=1;return t+e}(o);do{if((r=Lt(t,n,i,e))s&&(l=s),Pt(t,n,n+l,n+r,e),r=l}a.pushRun(n,r),a.mergeRuns(),o-=r,n+=r}while(0!==o);a.forceMergeRuns()}}}function zt(){mg||(mg=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Et(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}function Rt(t){return t>-1e-8&&tTg||t<-1e-8}function Nt(t,e,n,i,o){var r=1-o;return r*r*(r*t+3*o*e)+o*o*(o*i+3*r*n)}function Ft(t,e,n,i,o){var r=1-o;return 3*(((e-t)*r+2*(n-e)*o)*r+(i-n)*o*o)}function Vt(t,e,n,i,o,r){var a=i+3*(e-n)-t,s=3*(n-2*e+t),l=3*(e-t),u=t-o,h=s*s-3*a*l,c=s*l-9*a*u,d=l*l-3*s*u,p=0;if(Rt(h)&&Rt(c))Rt(s)?r[0]=0:(T=-l/s)>=0&&T<=1&&(r[p++]=T);else{var f=c*c-4*h*d;if(Rt(f)){var g=c/h,m=-g/2;(T=-s/a+g)>=0&&T<=1&&(r[p++]=T),m>=0&&m<=1&&(r[p++]=m)}else if(f>0){var y=Sg(f),v=h*s+1.5*a*(-c+y),_=h*s+1.5*a*(-c-y);(T=(-s-((v=v<0?-bg(-v,kg):bg(v,kg))+(_=_<0?-bg(-_,kg):bg(_,kg))))/(3*a))>=0&&T<=1&&(r[p++]=T)}else{var x=(2*h*s-3*a*c)/(2*Sg(h*h*h)),w=Math.acos(x)/3,b=Sg(h),S=Math.cos(w),T=(-s-2*b*S)/(3*a),M=(m=(-s+b*(S+Cg*Math.sin(w)))/(3*a),(-s+b*(S-Cg*Math.sin(w)))/(3*a));T>=0&&T<=1&&(r[p++]=T),m>=0&&m<=1&&(r[p++]=m),M>=0&&M<=1&&(r[p++]=M)}}return p}function Zt(t,e,n,i,o){var r=6*n-12*e+6*t,a=9*e+3*i-3*t-9*n,s=3*e-3*t,l=0;if(Rt(a))Bt(r)&&(h=-s/r)>=0&&h<=1&&(o[l++]=h);else{var u=r*r-4*a*s;if(Rt(u))o[0]=-r/(2*a);else if(u>0){var h,c=Sg(u),d=(-r-c)/(2*a);(h=(-r+c)/(2*a))>=0&&h<=1&&(o[l++]=h),d>=0&&d<=1&&(o[l++]=d)}}return l}function Ht(t,e,n,i,o,r){var a=(e-t)*o+t,s=(n-e)*o+e,l=(i-n)*o+n,u=(s-a)*o+a,h=(l-s)*o+s,c=(h-u)*o+u;r[0]=t,r[1]=a,r[2]=u,r[3]=c,r[4]=c,r[5]=h,r[6]=l,r[7]=i}function Wt(t,e,n,i,o,r,a,s,l){for(var u=t,h=e,c=0,d=1/l,p=1;p<=l;p++){var f=p*d,g=Nt(t,n,o,a,f),m=Nt(e,i,r,s,f),y=g-u,v=m-h;c+=Math.sqrt(y*y+v*v),u=g,h=m}return c}function jt(t,e,n,i){var o=1-i;return o*(o*t+2*i*e)+i*i*n}function Gt(t,e,n,i){return 2*((1-i)*(e-t)+i*(n-e))}function Ut(t,e,n){var i=t+n-2*e;return 0===i?.5:(t-e)/i}function Yt(t,e,n,i,o){var r=(e-t)*i+t,a=(n-e)*i+e,s=(a-r)*i+r;o[0]=t,o[1]=r,o[2]=s,o[3]=s,o[4]=a,o[5]=n}function Xt(t,e,n,i,o,r,a){for(var s=t,l=e,u=0,h=1/a,c=1;c<=a;c++){var d=c*h,p=jt(t,n,o,d),f=jt(e,i,r,d),g=p-s,m=f-l;u+=Math.sqrt(g*g+m*m),s=p,l=f}return u}function qt(t){var e=t&&Dg.exec(t);if(e){var n=e[1].split(","),i=+z(n[0]),o=+z(n[1]),r=+z(n[2]),a=+z(n[3]);if(isNaN(i+o+r+a))return;var s=[];return function(t){return t<=0?0:t>=1?1:Vt(0,i,r,1,t,s)&&Nt(0,o,a,1,s[0])}}}function Kt(t){return(t=Math.round(t))<0?0:t>255?255:t}function $t(t){return t<0?0:t>1?1:t}function Jt(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?Kt(parseFloat(e)/100*255):Kt(parseInt(e,10))}function Qt(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?$t(parseFloat(e)/100):$t(parseFloat(e))}function te(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function ee(t,e,n,i,o){return t[0]=e,t[1]=n,t[2]=i,t[3]=o,t}function ne(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function ie(t,e){Fg&&ne(Fg,e),Fg=Ng.put(t,Fg||e.slice())}function oe(t,e){if(t){e=e||[];var n=Ng.get(t);if(n)return ne(e,n);var i=(t+="").replace(/ /g,"").toLowerCase();if(i in Bg)return ne(e,Bg[i]),ie(t,e),e;var o,r=i.length;if("#"===i.charAt(0))return 4===r||5===r?(o=parseInt(i.slice(1,4),16))>=0&&o<=4095?(ee(e,(3840&o)>>4|(3840&o)>>8,240&o|(240&o)>>4,15&o|(15&o)<<4,5===r?parseInt(i.slice(4),16)/15:1),ie(t,e),e):void ee(e,0,0,0,1):7===r||9===r?(o=parseInt(i.slice(1,7),16))>=0&&o<=16777215?(ee(e,(16711680&o)>>16,(65280&o)>>8,255&o,9===r?parseInt(i.slice(7),16)/255:1),ie(t,e),e):void ee(e,0,0,0,1):void 0;var a=i.indexOf("("),s=i.indexOf(")");if(-1!==a&&s+1===r){var l=i.substr(0,a),u=i.substr(a+1,s-(a+1)).split(","),h=1;switch(l){case"rgba":if(4!==u.length)return 3===u.length?ee(e,+u[0],+u[1],+u[2],1):ee(e,0,0,0,1);h=Qt(u.pop());case"rgb":return u.length>=3?(ee(e,Jt(u[0]),Jt(u[1]),Jt(u[2]),3===u.length?h:Qt(u[3])),ie(t,e),e):void ee(e,0,0,0,1);case"hsla":return 4!==u.length?void ee(e,0,0,0,1):(u[3]=Qt(u[3]),re(u,e),ie(t,e),e);case"hsl":return 3!==u.length?void ee(e,0,0,0,1):(re(u,e),ie(t,e),e);default:return}}ee(e,0,0,0,1)}}function re(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=Qt(t[1]),o=Qt(t[2]),r=o<=.5?o*(i+1):o+i-o*i,a=2*o-r;return ee(e=e||[],Kt(255*te(a,r,n+1/3)),Kt(255*te(a,r,n)),Kt(255*te(a,r,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function ae(t,e){var n=oe(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,n[i]>255?n[i]=255:n[i]<0&&(n[i]=0);return le(n,4===n.length?"rgba":"rgb")}}function se(t,e,n,i){var o,r=oe(t);if(t)return r=function(t){if(t){var e,n,i=t[0]/255,o=t[1]/255,r=t[2]/255,a=Math.min(i,o,r),s=Math.max(i,o,r),l=s-a,u=(s+a)/2;if(0===l)e=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var h=((s-i)/6+l/2)/l,c=((s-o)/6+l/2)/l,d=((s-r)/6+l/2)/l;i===s?e=d-c:o===s?e=1/3+h-d:r===s&&(e=2/3+c-h),e<0&&(e+=1),e>1&&(e-=1)}var p=[360*e,n,u];return null!=t[3]&&p.push(t[3]),p}}(r),null!=e&&(r[0]=(o=v(e)?e(r[0]):e,(o=Math.round(o))<0?0:o>360?360:o)),null!=n&&(r[1]=Qt(v(n)?n(r[1]):n)),null!=i&&(r[2]=Qt(v(i)?i(r[2]):i)),le(re(r),"rgba")}function le(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}function ue(t,e){var n=oe(t);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*e:0}function he(t){if(_(t)){var e=Vg.get(t);return e||(e=ae(t,-.1),Vg.put(t,e)),e}if(C(t)){var n=a({},t);return n.colorStops=d(t.colorStops,function(t){return{offset:t.offset,color:ae(t.color,-.1)}}),n}return t}function ce(t){var e;if(t&&"transparent"!==t){if("string"==typeof t&&t.indexOf("rgba")>-1){var n=oe(t);n&&(t="rgb("+n[0]+","+n[1]+","+n[2]+")",e=n[3])}}else t="none";return{color:t,opacity:null==e?1:e}}function de(t){return t-1e-4}function pe(t){return Zg(1e3*t)/1e3}function fe(t){return Zg(1e4*t)/1e4}function ge(t){return t&&!!t.image}function me(t){return ge(t)||function(t){return t&&!!t.svgElement}(t)}function ye(t){return"linear"===t.type}function ve(t){return"radial"===t.type}function _e(t){return t&&("linear"===t.type||"radial"===t.type)}function xe(t){return"url(#"+t+")"}function we(t){var e=t.getGlobalScale(),n=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(n)/Math.log(10)),1)}function be(t){var e=t.x||0,n=t.y||0,i=(t.rotation||0)*Tf,o=L(t.scaleX,1),r=L(t.scaleY,1),a=t.skewX||0,s=t.skewY||0,l=[];return(e||n)&&l.push("translate("+e+"px,"+n+"px)"),i&&l.push("rotate("+i+")"),1===o&&1===r||l.push("scale("+o+","+r+")"),(a||s)&&l.push("skew("+Zg(a*Tf)+"deg, "+Zg(s*Tf)+"deg)"),l.join(" ")}function Se(t,e,n){return(e-t)*n+t}function Te(t,e,n,i){for(var o=e.length,r=0;ri?e:t,r=Math.min(n,i),a=o[r-1]||{color:[0,0,0,0],offset:0},s=r;sa)i.length=a;else for(var s=r;sgm||t<-5e-5}function Ve(t,e){for(var n=0;n=Mm)){t=t||of;for(var e=[],n=+new Date,i=0;i<=127;i++)e[i]=af.measureText(String.fromCharCode(i),t).width;var o=+new Date-n;return o>16?Tm=Mm:o>2&&Tm++,e}}(t.font),t.asciiWidthMapTried=!0),0<=e&&e<=127?null!=t.asciiWidthMap?t.asciiWidthMap[e]:t.asciiCharWidth:t.stWideCharWidth}function We(t,e){var n=t.strWidthCache,i=n.get(e);return null==i&&(i=af.measureText(e,t.font).width,n.put(e,i)),i}function je(t,e,n,i){var o=We(Ze(e),t),r=Xe(e),a=Ue(0,o,n),s=Ye(0,r,i);return new lg(a,s,o,r)}function Ge(t,e,n,i){var o=((t||"")+"").split("\n");if(1===o.length)return je(o[0],e,n,i);for(var r=new lg(0,0,0,0),a=0;a=0?parseFloat(t)/100*e:parseFloat(t):t}function Ke(t,e,n){var i=e.position||"inside",o=null!=e.distance?e.distance:5,r=n.height,a=n.width,s=r/2,l=n.x,u=n.y,h="left",c="top";if(i instanceof Array)l+=qe(i[0],n.width),u+=qe(i[1],n.height),h=null,c=null;else switch(i){case"left":l-=o,u+=s,h="right",c="middle";break;case"right":l+=o+a,u+=s,c="middle";break;case"top":l+=a/2,u-=o,h="center",c="bottom";break;case"bottom":l+=a/2,u+=r+o,h="center";break;case"inside":l+=a/2,u+=s,h="center",c="middle";break;case"insideLeft":l+=o,u+=s,c="middle";break;case"insideRight":l+=a-o,u+=s,h="right",c="middle";break;case"insideTop":l+=a/2,u+=o,h="center";break;case"insideBottom":l+=a/2,u+=r-o,h="center",c="bottom";break;case"insideTopLeft":l+=o,u+=o;break;case"insideTopRight":l+=a-o,u+=o,h="right";break;case"insideBottomLeft":l+=o,u+=r-o,c="bottom";break;case"insideBottomRight":l+=a-o,u+=r-o,h="right",c="bottom"}return(t=t||{}).x=l,t.y=u,t.align=h,t.verticalAlign=c,t}function $e(t,e,n,i,o){var r=[];tn(t,"",t,e,n=n||{},i,r,o);var a=r.length,s=!1,l=n.done,u=n.aborted,h=function(){s=!0,--a<=0&&(s?l&&l():u&&u())},c=function(){--a<=0&&(s?l&&l():u&&u())};a||l&&l(),r.length>0&&n.during&&r[0].during(function(t,e){n.during(e)});for(var d=0;d0||o.force&&!a.length){var k,I=void 0,L=void 0,P=void 0;if(s)for(L={},m&&(I={}),T=0;T0){if(t<=o)return a;if(t>=r)return s}else{if(t>=o)return a;if(t<=r)return s}else{if(t===o)return a;if(t===r)return s}return(t-o)/l*u+a}function on(t,e,n){return _(t)?(i=t,i.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(t)/100*e+(n||0):parseFloat(t):null==t?NaN:+t;var i}function rn(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),n?t:+t}function an(t){if(t=+t,isNaN(t))return 0;if(t>1e-14)for(var e=1,n=0;n<15;n++,e*=10)if(Math.round(t*e)/e===t)return n;return function(t){var e=t.toString().toLowerCase(),n=e.indexOf("e"),i=n>0?+e.slice(n+1):0,o=n>0?n:e.length,r=e.indexOf(".");return Math.max(0,(r<0?0:o-1-r)-i)}(t)}function sn(t,e){var n=Math.log,i=Math.LN10,o=Math.floor(n(t[1]-t[0])/i),r=Math.round(n(Wm(e[1]-e[0]))/i),a=Math.min(Math.max(-o+r,0),20);return isFinite(a)?a:20}function ln(t,e){var n=Math.max(an(t),an(e)),i=t+e;return n>20?i:rn(i,n)}function un(t){var e=2*Math.PI;return(t%e+e)%e}function hn(t){return t>-1e-4&&t=10&&e++,e}function pn(t,e){var n=dn(t),i=Math.pow(10,n),o=t/i;return t=(e?o<1.5?1:o<2.5?2:o<4?3:o<7?5:10:o<1?1:o<2?2:o<3?3:o<5?5:10)*i,n>=-20?+t.toFixed(n<0?-n:0):t}function fn(t){var e=parseFloat(t);return e==t&&(0!==e||!_(t)||t.indexOf("x")<=0)?e:NaN}function gn(){return Math.round(9*Math.random())}function mn(t,e){return 0===e?t:mn(e,t%e)}function yn(t,e){return null==t?e:null==e?t:t*e/mn(t,e)}function vn(t){return t instanceof Array?t:null==t?[]:[t]}function _n(t,e,n){if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};for(var i=0,o=n.length;i=0||o&&l(o,s)<0)){var u=n.getShallow(s,e);null!=u&&(r[t[a][0]]=u)}}return r}}function Zn(t){if("string"==typeof t){var e=iy.get(t);return e&&e.image}return t}function Hn(t,e,n,i,o){if(t){if("string"==typeof t){if(e&&e.__zrImageSrc===t||!n)return e;var r=iy.get(t),a={hostEl:n,cb:i,cbPayload:o};return r?!jn(e=r.image)&&r.pending.push(a):((e=af.loadImage(t,Wn,Wn)).__zrImageSrc=t,iy.put(t,e.__cachedImgObj={image:e,pending:[a]})),e}return t}return e}function Wn(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=l;h++)u-=l;var c=We(s,n);return c>u&&(n="",c=0),u=t-c,o.ellipsis=n,o.ellipsisWidth=c,o.contentWidth=u,o.containerWidth=t,o}function Yn(t,e,n){var i=n.containerWidth,o=n.contentWidth,r=n.fontMeasureInfo;if(!i)return t.textLine="",void(t.isTruncated=!1);var a=We(r,e);if(a<=i)return t.textLine=e,void(t.isTruncated=!1);for(var s=0;;s++){if(a<=o||s>=n.maxIterations){e+=n.ellipsis;break}var l=0===s?Xn(e,o,r):a>0?Math.floor(e.length*o/a):0;a=We(r,e=e.substr(0,l))}""===e&&(e=n.placeholder),t.textLine=e,t.isTruncated=!0}function Xn(t,e,n){for(var i=0,o=0,r=t.length;o0&&f+i.accumWidth>i.width&&(r=e.split("\n"),c=!0),i.accumWidth=f}else{var g=$n(e,h,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+p,a=g.linesWidths,r=g.lines}}r||(r=e.split("\n"));for(var m=Ze(h),y=0;y=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}(t)||!!ly[t]}function $n(t,e,n,i,o){for(var r=[],a=[],s="",l="",u=0,h=0,c=Ze(e),d=0;dn:o+h+f>n)?h?(s||l)&&(g?(s||(s=l,l="",h=u=0),r.push(s),a.push(h-u),l+=p,s="",h=u+=f):(l&&(s+=l,l="",u=0),r.push(s),a.push(h),s=p,h=f)):g?(r.push(l),a.push(u),l=p,u=f):(r.push(p),a.push(f)):(h+=f,g?(l+=p,u+=f):(l&&(s+=l,l="",u=0),s+=p))}else l&&(s+=l,h+=u),r.push(s),a.push(h),s="",l="",u=0,h=0}return l&&(s+=l),s&&(r.push(s),a.push(h)),1===r.length&&(h+=o),{accumWidth:h,lines:r,linesWidths:a}}function Jn(t,e,n,i,o,r){if(t.baseX=n,t.baseY=i,t.outerWidth=t.outerHeight=null,e){var a=2*e.width,s=2*e.height;lg.set(uy,Ue(n,a,o),Ye(i,s,r),a,s),lg.intersect(e,uy,null,hy);var l=hy.outIntersectRect;t.outerWidth=l.width,t.outerHeight=l.height,t.baseX=Ue(l.x,l.width,o,!0),t.baseY=Ye(l.y,l.height,r,!0)}}function Qn(t){return null!=t?t+="":t=""}function ti(t,e,n,i){var o=new lg(Ue(t.x||0,e,t.textAlign),Ye(t.y||0,n,t.textBaseline),e,n),r=null!=i?i:ei(t)?t.lineWidth:0;return r>0&&(o.x-=r/2,o.y-=r/2,o.width+=r,o.height+=r),o}function ei(t){var e=t.stroke;return null!=e&&"none"!==e&&t.lineWidth>0}function ni(t,e,n,i,o,r){o[0]=xy(t,n),o[1]=xy(e,i),r[0]=wy(t,n),r[1]=wy(e,i)}function ii(t,e,n,i,o,r,a,s,l,u){var h=Zt,c=Nt,d=h(t,n,o,a,Iy);l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0;for(var p=0;p1e-4)return s[0]=t-n,s[1]=e-i,l[0]=t+n,void(l[1]=e+i);if(My[0]=Sy(o)*n+t,My[1]=by(o)*i+e,Cy[0]=Sy(r)*n+t,Cy[1]=by(r)*i+e,u(s,My,Cy),h(l,My,Cy),(o%=Ty)<0&&(o+=Ty),(r%=Ty)<0&&(r+=Ty),o>r&&!a?r+=Ty:oo&&(ky[0]=Sy(p)*n+t,ky[1]=by(p)*i+e,u(s,ky,s),h(l,ky,l))}function ai(t){return Math.round(t/Hy*1e8)/1e8%2*Hy}function si(t,e,n,i,o,r,a){if(0===o)return!1;var s,l=o;if(a>e+l&&a>i+l||at+l&&r>n+l||re+c&&h>i+c&&h>r+c&&h>s+c||ht+c&&u>n+c&&u>o+c&&u>a+c||u=0&&pe+u&&l>i+u&&l>r+u||lt+u&&s>n+u&&s>o+u||s=0&&gn||h+uo&&(o+=qy);var d=Math.atan2(l,s);return d<0&&(d+=qy),d>=i&&d<=o||d+qy>=i&&d+qy<=o}function di(t,e,n,i,o,r){if(r>e&&r>i||ro?s:0}function pi(){var t=Qy[0];Qy[0]=Qy[1],Qy[1]=t}function fi(t,e,n,i,o,r,a,s,l,u){if(u>e&&u>i&&u>r&&u>s||u1&&pi(),p=Nt(e,i,r,s,Qy[0]),d>1&&(f=Nt(e,i,r,s,Qy[1]))),c+=2===d?me&&s>i&&s>r||s=0&&h<=1&&(o[l++]=h);else{var u=a*a-4*r*s;if(Rt(u))(h=-a/(2*r))>=0&&h<=1&&(o[l++]=h);else if(u>0){var h,c=Sg(u),d=(-a-c)/(2*r);(h=(-a+c)/(2*r))>=0&&h<=1&&(o[l++]=h),d>=0&&d<=1&&(o[l++]=d)}}return l}(e,i,r,s,Jy);if(0===l)return 0;var u=Ut(e,i,r);if(u>=0&&u<=1){for(var h=0,c=jt(e,i,r,u),d=0;dn||s<-n)return 0;var l=Math.sqrt(n*n-s*s);Jy[0]=-l,Jy[1]=l;var u=Math.abs(i-o);if(u<1e-4)return 0;if(u>=$y-1e-4){i=0,o=$y;var h=r?1:-1;return a>=Jy[0]+t&&a<=Jy[1]+t?h:0}if(i>o){var c=i;i=o,o=c}i<0&&(i+=$y,o+=$y);for(var d=0,p=0;p<2;p++){var f=Jy[p];if(f+t>a){var g=Math.atan2(s,f);h=r?1:-1,g<0&&(g=$y+g),(g>=i&&g<=o||g+$y>=i&&g+$y<=o)&&(g>Math.PI/2&&g<1.5*Math.PI&&(h=-h),d+=h)}}return d}function yi(t,e,n,i,o){for(var r,a,s=t.data,l=t.len(),u=0,h=0,c=0,d=0,p=0,f=0;f1&&(n||(u+=di(h,c,d,p,i,o))),m&&(d=h=s[f],p=c=s[f+1]),g){case Ky.M:h=d=s[f++],c=p=s[f++];break;case Ky.L:if(n){if(si(h,c,s[f],s[f+1],e,i,o))return!0}else u+=di(h,c,s[f],s[f+1],i,o)||0;h=s[f++],c=s[f++];break;case Ky.C:if(n){if(li(h,c,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],e,i,o))return!0}else u+=fi(h,c,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],i,o)||0;h=s[f++],c=s[f++];break;case Ky.Q:if(n){if(ui(h,c,s[f++],s[f++],s[f],s[f+1],e,i,o))return!0}else u+=gi(h,c,s[f++],s[f++],s[f],s[f+1],i,o)||0;h=s[f++],c=s[f++];break;case Ky.A:var y=s[f++],v=s[f++],_=s[f++],x=s[f++],w=s[f++],b=s[f++];f+=1;var S=!!(1-s[f++]);r=Math.cos(w)*_+y,a=Math.sin(w)*x+v,m?(d=r,p=a):u+=di(h,c,r,a,i,o);var T=(i-y)*x/_+y;if(n){if(ci(y,v,x,w,w+b,S,e,T,o))return!0}else u+=mi(y,v,x,w,w+b,S,T,o);h=Math.cos(w+b)*_+y,c=Math.sin(w+b)*x+v;break;case Ky.R:if(d=h=s[f++],p=c=s[f++],r=d+s[f++],a=p+s[f++],n){if(si(d,p,r,p,e,i,o)||si(r,p,r,a,e,i,o)||si(r,a,d,a,e,i,o)||si(d,a,d,p,e,i,o))return!0}else u+=di(r,p,r,a,i,o),u+=di(d,a,d,p,i,o);break;case Ky.Z:if(n){if(si(h,c,d,p,e,i,o))return!0}else u+=di(h,c,d,p,i,o);h=d,c=p}}return n||Math.abs(c-p)<1e-4||(u+=di(h,c,d,p,i,o)||0),0!==u}function vi(t,e,n){if(e){var i=e.x1,o=e.x2,r=e.y1,a=e.y2;t.x1=i,t.x2=o,t.y1=r,t.y2=a;var s=n&&n.lineWidth;return s?(dv(2*i)===dv(2*o)&&(t.x1=t.x2=xi(i,s,!0)),dv(2*r)===dv(2*a)&&(t.y1=t.y2=xi(r,s,!0)),t):t}}function _i(t,e,n){if(e){var i=e.x,o=e.y,r=e.width,a=e.height;t.x=i,t.y=o,t.width=r,t.height=a;var s=n&&n.lineWidth;return s?(t.x=xi(i,s,!0),t.y=xi(o,s,!0),t.width=Math.max(xi(i+r,s,!1)-t.x,0===r?0:1),t.height=Math.max(xi(o+a,s,!1)-t.y,0===a?0:1),t):t}}function xi(t,e,n){if(!e)return t;var i=dv(2*t);return(i+dv(e))%2==0?i/2:(i+(n?1:-1))/2}function wi(t){return"string"!=typeof t||-1===t.indexOf("px")&&-1===t.indexOf("rem")&&-1===t.indexOf("em")?isNaN(+t)?"12px":t+"px":t}function bi(t,e){for(var n=0;n=0,r=!1;if(t instanceof ov){var s=Iv(t),u=o&&s.selectFill||s.normalFill,h=o&&s.selectStroke||s.normalStroke;if(Pi(u)||Pi(h)){var c=(i=i||{}).style||{};"inherit"===c.fill?(r=!0,i=a({},i),(c=a({},c)).fill=u):!Pi(c.fill)&&Pi(u)?(r=!0,i=a({},i),(c=a({},c)).fill=he(u)):!Pi(c.stroke)&&Pi(h)&&(r||(i=a({},i),c=a({},c)),c.stroke=he(h)),i.style=c}}if(i&&null==i.z2){r||(i=a({},i));var d=t.z2EmphasisLift;i.z2=t.z2+(null!=d?d:10)}return i}(this,0,e,n);if("blur"===t)return function(t,e,n){var i=l(t.currentStates,e)>=0,o=t.style.opacity,r=i?null:function(t,e,n,i){for(var o=t.style,r={},a=0;a0){var r={dataIndex:o,seriesIndex:t.seriesIndex};null!=i&&(r.dataType=i),e.push(r)}})}),e}function no(t,e,n){oo(t,!0),Fi(t,Zi),function(t,e,n){var i=Mv(t);null!=e?(i.focus=e,i.blurScope=n):i.focus&&(i.focus=null)}(t,e,n)}function io(t,e,n,i){i?function(t){oo(t,!1)}(t):no(t,e,n)}function oo(t,e){var n=!1===e,i=t;t.highDownSilentOnTouch&&(i.__highDownSilentOnTouch=t.highDownSilentOnTouch),n&&!i.__highDownDispatcher||(i.__highByOuter=i.__highByOuter||0,i.__highDownDispatcher=!n)}function ro(t){return!(!t||!t.__highDownDispatcher)}function ao(t){var e=t.type;return e===zv||e===Ev||e===Rv}function so(t){var e=t.type;return e===Av||e===Ov}function lo(t,e,n){var i,o=t.labelFetcher,r=t.labelDataIndex,a=t.labelDimIndex,s=e.normal;o&&(i=o.getFormattedLabel(r,"normal",null,a,s&&s.get("formatter"),null!=n?{interpolatedValue:n}:null)),null==i&&(i=v(t.defaultText)?t.defaultText(r,t,n):t.defaultText);for(var l={normal:i},u=0;u=12?"pm":"am",m=g.toUpperCase(),y=i instanceof i_?i:function(t){return u_[t]}(i||h_)||u_[s_],v=y.getModel("time"),_=v.get("month"),x=v.get("monthAbbr"),w=v.get("dayOfWeek"),b=v.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,g+"").replace(/{A}/g,m+"").replace(/{yyyy}/g,r+"").replace(/{yy}/g,_o(r%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,_[a-1]).replace(/{MMM}/g,x[a-1]).replace(/{MM}/g,_o(a,2)).replace(/{M}/g,a+"").replace(/{dd}/g,_o(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,w[u]).replace(/{ee}/g,b[u]).replace(/{e}/g,u+"").replace(/{HH}/g,_o(h,2)).replace(/{H}/g,h+"").replace(/{hh}/g,_o(c+"",2)).replace(/{h}/g,c+"").replace(/{mm}/g,_o(d,2)).replace(/{m}/g,d+"").replace(/{ss}/g,_o(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,_o(f,3)).replace(/{S}/g,f+"")}function So(t,e){var n=cn(t),i=n[Co(e)]()+1,o=n[ko(e)](),r=n[Io(e)](),a=n[Lo(e)](),s=n[Po(e)](),l=0===n[Do(e)](),u=l&&0===s,h=u&&0===a,c=h&&0===r,d=c&&1===o;return d&&1===i?"year":d?"month":c?"day":h?"hour":u?"minute":l?"second":"millisecond"}function To(t,e,n){switch(e){case"year":t[Oo(n)](0);case"month":t[zo(n)](1);case"day":t[Eo(n)](0);case"hour":t[Ro(n)](0);case"minute":t[Bo(n)](0);case"second":t[No(n)](0)}return t}function Mo(t){return t?"getUTCFullYear":"getFullYear"}function Co(t){return t?"getUTCMonth":"getMonth"}function ko(t){return t?"getUTCDate":"getDate"}function Io(t){return t?"getUTCHours":"getHours"}function Lo(t){return t?"getUTCMinutes":"getMinutes"}function Po(t){return t?"getUTCSeconds":"getSeconds"}function Do(t){return t?"getUTCMilliseconds":"getMilliseconds"}function Ao(t){return t?"setUTCFullYear":"setFullYear"}function Oo(t){return t?"setUTCMonth":"setMonth"}function zo(t){return t?"setUTCDate":"setDate"}function Eo(t){return t?"setUTCHours":"setHours"}function Ro(t){return t?"setUTCMinutes":"setMinutes"}function Bo(t){return t?"setUTCSeconds":"setSeconds"}function No(t){return t?"setUTCMilliseconds":"setMilliseconds"}function Fo(t){if(isNaN(fn(t)))return _(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function Vo(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}function Zo(t,e,n){function i(t){return t&&z(t)?t:"-"}function o(t){return!(null==t||isNaN(t)||!isFinite(t))}var r="time"===e,a=t instanceof Date;if(r||a){var s=r?cn(t):t;if(!isNaN(+s))return bo(s,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",n);if(a)return"-"}if("ordinal"===e)return x(t)?i(t):w(t)&&o(t)?t+"":"-";var l=fn(t);return o(l)?Fo(l):x(t)?i(t):"boolean"==typeof t?t+"":"-"}function Ho(t,e,n){y(e)||(e=[e]);var i=e.length;if(!i)return"";for(var o=e[0].$vars||[],r=0;ri||l.newline?(r=0,h=g,a+=s+n,s=d.height):s=Math.max(s,d.height)}else{var m=d.height+(f?-f.y+d.y:0);(c=a+m)>o||l.newline?(r+=s+n,a=0,c=m,s=d.width):s=Math.max(s,d.width)}l.newline||(l.x=r,l.y=a,l.markRedraw(),"horizontal"===t?r=h+n:a=c+n)})}function Yo(t,e,n){n=S_(n||0);var i=e.width,o=e.height,r=jm(t.left,i),a=jm(t.top,o),s=jm(t.right,i),l=jm(t.bottom,o),u=jm(t.width,i),h=jm(t.height,o),c=n[2]+n[0],d=n[1]+n[3],p=t.aspect;switch(isNaN(u)&&(u=i-s-d-r),isNaN(h)&&(h=o-l-c-a),null!=p&&(isNaN(u)&&isNaN(h)&&(p>i/o?u=.8*i:h=.8*o),isNaN(u)&&(u=p*h),isNaN(h)&&(h=u/p)),isNaN(r)&&(r=i-s-u-d),isNaN(a)&&(a=o-l-h-c),t.left||t.right){case"center":r=i/2-u/2-n[3];break;case"right":r=i-u-d}switch(t.top||t.bottom){case"middle":case"center":a=o/2-h/2-n[0];break;case"bottom":a=o-h-c}r=r||0,a=a||0,isNaN(u)&&(u=i-d-r-(s||0)),isNaN(h)&&(h=o-c-a-(l||0));var f=new lg((e.x||0)+r+n[3],(e.y||0)+a+n[0],u,h);return f.margin=n,f}function Xo(t,e,n){var i,o,r,a,s=t.boxCoordinateSystem;if(s){var l=function(t){var e=t.getShallow("coord",!0),n=L_;if(null==e){var i=D_.get(t.type);i&&i.getCoord2&&(n=P_,e=i.getCoord2(t))}return{coord:e,from:n}}(t),u=l.coord,h=l.from;if(s.dataToLayout){r=V_.rect,a=h;var c=s.dataToLayout(u);i=c.contentRect||c.rect}else n&&n.enableLayoutOnlyByCenter&&s.dataToPoint&&(r=V_.point,a=h,o=s.dataToPoint(u))}return null==r&&(r=V_.rect),r===V_.rect&&(i||(i={x:0,y:0,width:e.getWidth(),height:e.getHeight()}),o=[i.x+i.width/2,i.y+i.height/2]),{type:r,refContainer:i,refPoint:o,boxCoordFrom:a}}function qo(t,e,n,i,o,r){var a,l=!o||!o.hv||o.hv[0],u=!o||!o.hv||o.hv[1],h=o&&o.boundingMode||"all";if((r=r||t).x=t.x,r.y=t.y,!l&&!u)return!1;if("raw"===h)a="group"===t.type?new lg(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(a=t.getBoundingRect(),t.needLocalTransform()){var c=t.getLocalTransform();(a=a.clone()).applyTransform(c)}var d=Yo(s({width:a.width,height:a.height},e),n,i),p=l?d.x-a.x:0,f=u?d.y-a.y:0;return"raw"===h?(r.x=p,r.y=f):(r.x+=p,r.y+=f),r===t&&t.markRedraw(),!0}function Ko(t){var e=t.layoutMode||t.constructor.layoutMode;return b(e)?e:e?{type:e}:null}function $o(t,e,n){function i(n,i){var r={},s=0,l={},u=0;if(R_(n,function(e){l[e]=t[e]}),R_(n,function(t){Z(e,t)&&(r[t]=l[t]=e[t]),o(r,t)&&s++,o(l,t)&&u++}),a[i])return o(e,n[1])?l[n[2]]=null:o(e,n[2])&&(l[n[1]]=null),l;if(2!==u&&s){if(s>=2)return r;for(var h=0;h=e:"max"===n?t<=e:t===e})(i[a],t,r)||(o=!1)}}),o}function sr(t){var e=t&&t.itemStyle;if(e)for(var n=0,i=Bx.length;n65535?aw:sw}function jr(){return[1/0,-1/0]}function Gr(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function Ur(t,e,n,i,o){var r=hw[n||"float"];if(o){var a=t[e],s=a&&a.length;if(s!==i){for(var l=new r(i),u=0;u1||n>0&&!t.noHeader;return c(t.blocks,function(t){var n=ta(t);n>=e&&(e=n+ +(i&&(!n||Jr(t)&&!t.noHeader)))}),e}return 0}function ea(t,e,n,i){var o,r=e.noHeader,s=(o=ta(e),{html:fw[o],richText:gw[o]}),l=[],u=e.blocks||[];O(!u||y(u)),u=u||[];var h=t.orderMode;if(e.sortBlocks&&h){u=u.slice();var d={valueAsc:"asc",valueDesc:"desc"};if(Z(d,h)){var p=new nw(d[h],null);u.sort(function(t,e){return p.evaluate(t.sortParam,e.sortParam)})}else"seriesDesc"===h&&u.reverse()}c(u,function(n,o){var r=e.valueFormatter,u=Qr(n)(r?a(a({},t),{valueFormatter:r}):t,n,o>0?s.html:0,i);null!=u&&l.push(u)});var f="richText"===t.renderMode?l.join(s.richText):oa(i,l.join(""),r?n:s.html);if(r)return f;var g=Zo(e.header,"ordinal",t.useUTC),m=Kr(i,t.renderMode).nameStyle,v=qr(i);return"richText"===t.renderMode?ra(t,g,m)+s.richText+f:oa(i,'
'+lt(g)+"
"+f,n)}function na(t,e,n,i){var o=t.renderMode,r=e.noName,a=e.noValue,s=!e.markerType,l=e.name,u=t.useUTC,h=e.valueFormatter||t.valueFormatter||function(t){return d(t=y(t)?t:[t],function(t,e){return Zo(t,y(f)?f[e]:f,u)})};if(!r||!a){var c=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||X_.color.secondary,o),p=r?"":Zo(l,"ordinal",u),f=e.valueType,g=a?[]:h(e.value,e.dataIndex),m=!s||!r,v=!s&&r,_=Kr(i,o),x=_.nameStyle,w=_.valueStyle;return"richText"===o?(s?"":c)+(r?"":ra(t,p,x))+(a?"":function(t,e,n,i,o){var r=[o];return n&&r.push({padding:[0,0,0,i?10:20],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(y(e)?e.join(" "):e,r)}(t,g,m,v,w)):oa(i,(s?"":c)+(r?"":function(t,e,n){return''+lt(t)+""}(p,!s,x))+(a?"":function(t,e,n,i){return''+d(t=y(t)?t:[t],function(t){return lt(t)}).join("  ")+""}(g,m,v,w)),n)}}function ia(t,e,n,i,o,r){if(t)return Qr(t)({useUTC:o,renderMode:n,orderMode:i,markupStyleCreator:e,valueFormatter:t.valueFormatter},t,0,r)}function oa(t,e,n){return'
'+e+'
'}function ra(t,e,n){return t.markupStyleCreator.wrapRichTextStyle(e,n)}function aa(t,e){var n=t.get("padding");return null!=n?n:"richText"===e?[8,10]:10}function sa(t){var e,n,i,o,r=t.series,a=t.dataIndex,s=t.multipleSeries,l=r.getData(),u=l.mapDimensionsAll("defaultedTooltip"),h=u.length,d=r.getRawValue(a),f=y(d),g=function(t,e){return Wo(t.getData().getItemVisual(e,"style")[t.visualDrawType])}(r,a);if(h>1||f&&!h){var m=function(t,e,n,i,o){function r(t,e){var n=a.getDimensionInfo(e);n&&!1!==n.otherDims.tooltip&&(s?h.push($r("nameValue",{markerType:"subItem",markerColor:o,name:n.displayName,value:t,valueType:n.type})):(l.push(t),u.push(n.type)))}var a=e.getData(),s=p(t,function(t,e,n){var i=a.getDimensionInfo(n);return t||i&&!1!==i.tooltip&&null!=i.displayName},!1),l=[],u=[],h=[];return i.length?c(i,function(t){r(Or(a,n,t),t)}):c(t,r),{inlineValues:l,inlineValueTypes:u,blocks:h}}(d,r,a,u,g);e=m.inlineValues,n=m.inlineValueTypes,i=m.blocks,o=m.inlineValues[0]}else if(h){var v=l.getDimensionInfo(u[0]);o=e=Or(l,a,u[0]),n=v.type}else o=e=f?d[0]:d;var _=Cn(r),x=_&&r.name||"",w=l.getName(a),b=s?x:w;return $r("section",{header:x,noHeader:s||!_,sortParam:o,blocks:[$r("nameValue",{markerType:"item",markerColor:g,name:b,noName:!z(b),value:e,valueType:n,dataIndex:a})].concat(i||[])})}function la(t,e){return t.getName(e)||t.getId(e)}function ua(t){var e=t.name;Cn(t)||(t.name=function(t){var e=t.getRawData(),n=e.mapDimensionsAll("seriesName"),i=[];return c(n,function(t){var n=e.getDimensionInfo(t);n.displayName&&i.push(n.displayName)}),i.join(" ")}(t)||e)}function ha(t){return t.model.getRawData().count()}function ca(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),da}function da(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function pa(t,e){c(N(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(n){t.wrapMethod(n,m(fa,e))})}function fa(t,e){var n=ga(t);return n&&n.setOutputEnd((e||this).count()),e}function ga(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){var i=n.currentTask;if(i){var o=i.agentStubMap;o&&(i=o.get(t.uid))}return i}}function ma(){var t=Ln();return function(e){var n=t(e),i=e.pipelineContext,o=!!n.large,r=!!n.progressiveRender,a=n.large=!(!i||!i.large),s=n.progressiveRender=!(!i||!i.progressiveRender);return!(o===a&&r===s)&&"reset"}}function ya(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function va(t,e){return(t[0]*e[0]+t[1]*e[1])/(ya(t)*ya(e))}function _a(t,e){return(t[0]*e[1]1&&(a*=Cw(f),s*=Cw(f));var g=(o===r?-1:1)*Cw((a*a*(s*s)-a*a*(p*p)-s*s*(d*d))/(a*a*(p*p)+s*s*(d*d)))||0,m=g*a*p/s,y=g*-s*d/a,v=(t+n)/2+Iw(c)*m-kw(c)*y,_=(e+i)/2+kw(c)*m+Iw(c)*y,x=_a([1,0],[(d-m)/a,(p-y)/s]),w=[(d-m)/a,(p-y)/s],b=[(-1*d-m)/a,(-1*p-y)/s],S=_a(w,b);if(va(w,b)<=-1&&(S=Lw),va(w,b)>=1&&(S=0),S<0){var T=Math.round(S/Lw*1e6)/1e6;S=2*Lw+T%2*Lw}h.addData(u,v,_,a,s,x,S,c,r)}function wa(t){return null!=t.setData}function ba(t,e){var n=function(t){var e=new Yy;if(!t)return e;var n,i=0,o=0,r=i,a=o,s=Yy.CMD,l=t.match(Pw);if(!l)return e;for(var u=0;uP*P+D*D&&(T=C,M=k),{cx:T,cy:M,x0:-h,y0:-c,x1:T*(o/w-1),y1:M*(o/w-1)}}function Ta(t,e,n){var i=e.smooth,o=e.points;if(o&&o.length>=2){if(i){var r=function(t,e,n,i){var o,r,a,s,l=[],u=[],h=[],c=[];if(i){a=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,p=t.length;d0){var c={duration:h.duration,delay:h.delay||0,easing:h.easing,done:r,force:!!r||!!a,setToFinal:!u,scope:t,during:a};l?e.animateFrom(n,c):e.animateTo(n,c)}else e.stopAnimation(),!l&&e.attr(n),a&&a(1),r&&r()}function Ia(t,e,n,i,o,r){ka("update",t,e,n,i,o,r)}function La(t,e,n,i,o,r){ka("enter",t,e,n,i,o,r)}function Pa(t){if(!t.__zr)return!0;for(var e=0;eWm(r[1])?r[0]>0?"right":"left":r[1]>0?"bottom":"top"}function Ya(t){return!t.isGroup}function Xa(t,e,n){function i(t){var e={x:t.x,y:t.y,rotation:t.rotation};return function(t){return null!=t.shape}(t)&&(e.shape=o(t.shape)),e}if(t&&e){var r,a=(r={},t.traverse(function(t){Ya(t)&&t.anid&&(r[t.anid]=t)}),r);e.traverse(function(t){if(Ya(t)&&t.anid){var e=a[t.anid];if(e){var o=i(t);t.attr(i(e)),Ia(t,o,n,Mv(t).dataIndex)}}})}}function qa(t,e){return d(t,function(t){var n=t[0];n=Hm(n,e.x),n=Zm(n,e.x+e.width);var i=t[1];return i=Hm(i,e.y),[n,i=Zm(i,e.y+e.height)]})}function Ka(t,e){var n=Hm(t.x,e.x),i=Zm(t.x+t.width,e.x+e.width),o=Hm(t.y,e.y),r=Zm(t.y+t.height,e.y+e.height);if(i>=n&&r>=o)return{x:n,y:o,width:i-n,height:r-o}}function $a(t,e,n){var i=a({rectHover:!0},e),o=i.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(o.image=t.slice(8),s(o,n),new cv(i)):Na(t.replace("path://",""),i,n,"center")}function Ja(t,e,n,i,o){for(var r=0,a=o[o.length-1];r=-1e-6)return!1;var f=t-o,g=e-r,m=ts(f,g,u,h)/p;if(m<0||m>1)return!1;var y=ts(f,g,c,d)/p;return!(y<0||y>1)}function ts(t,e,n,i){return t*i-n*e}function es(t,e,n,i,o){return null==e||(w(e)?jb[0]=jb[1]=jb[2]=jb[3]=e:(jb[0]=e[0],jb[1]=e[1],jb[2]=e[2],jb[3]=e[3]),i&&(jb[0]=Hm(0,jb[0]),jb[1]=Hm(0,jb[1]),jb[2]=Hm(0,jb[2]),jb[3]=Hm(0,jb[3])),n&&(jb[0]=-jb[0],jb[1]=-jb[1],jb[2]=-jb[2],jb[3]=-jb[3]),ns(t,jb,"x","width",3,1,o&&o[0]||0),ns(t,jb,"y","height",0,2,o&&o[1]||0)),t}function ns(t,e,n,i,o,r,a){var s=e[r]+e[o],l=t[i];t[i]+=s,a=Hm(0,Zm(a,l)),t[i]=0?-e[o]:e[r]>=0?l+e[r]:Wm(s)>1e-8?(l-a)*e[o]/s:0):t[n]-=e[o]}function is(t){var e=t.itemTooltipOption,n=t.componentModel,i=t.itemName,o=_(e)?{formatter:e}:e,r=n.mainType,a=n.componentIndex,l={componentType:r,name:i,$vars:["name"]};l[r+"Index"]=a;var u=t.formatterParamsExtra;u&&c(g(u),function(t){Z(l,t)||(l[t]=u[t],l.$vars.push(t))});var h=Mv(t.el);h.componentMainType=r,h.componentIndex=a,h.tooltipConfig={name:i,option:s({content:i,encodeHTMLContent:!0,formatterParams:l},o)}}function os(t,e){var n;t.isGroup&&(n=e(t)),n||t.traverse(e)}function rs(t,e){if(t)if(y(t))for(var n=0;ni&&(i=e),ei&&(o=i=0),{min:o,max:i}}function cs(t,e,n){ds(t,e,n,-1/0)}function ds(t,e,n,i){if(t.ignoreModelZ)return i;var o=t.getTextContent(),r=t.getTextGuideLine();if(t.isGroup)for(var a=t.childrenRef(),s=0;s=0?i():c=setTimeout(i,-r),u=o};return d.clear=function(){c&&(clearTimeout(c),c=null)},d.debounceNextCall=function(t){l=t},d}function vs(t,e,n,i){var o=t[e];if(o){var r=o[Jb]||o;if(o[Qb]!==n||o[tS]!==i){if(null==n||!i)return t[e]=r;(o=t[e]=ys(r,n,"debounce"===i))[Jb]=r,o[tS]=i,o[Qb]=n}return o}}function _s(t,e){var n=t[e];n&&n[Jb]&&(n.clear&&n.clear(),t[e]=n[Jb])}function xs(t,e){return t.visualStyleMapper||nS[e]||(console.warn("Unknown style type '"+e+"'."),nS.itemStyle)}function ws(t,e){return t.visualDrawType||iS[e]||(console.warn("Unknown style type '"+e+"'."),"fill")}function bs(t){t.overallReset(t.ecModel,t.api,t.payload)}function Ss(t){return t.overallProgress&&Ts}function Ts(){this.agent.dirty(),this.getDownstream().dirty()}function Ms(){this.agent&&this.agent.dirty()}function Cs(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function ks(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=vn(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?d(e,function(t,e){return Is(e)}):hS}function Is(t){return function(e,n){var i=n.data,o=n.resetDefines[t];if(o&&o.dataEach)for(var r=e.start;r=0&&Ns(l)?l:.5,t.createRadialGradient(a,s,0,a,s,l)}(t,e,n):function(t,e,n){var i=null==e.x?0:e.x,o=null==e.x2?1:e.x2,r=null==e.y?0:e.y,a=null==e.y2?0:e.y2;return e.global||(i=i*n.width+n.x,o=o*n.width+n.x,r=r*n.height+n.y,a=a*n.height+n.y),i=Ns(i)?i:0,o=Ns(o)?o:1,r=Ns(r)?r:0,a=Ns(a)?a:0,t.createLinearGradient(i,r,o,a)}(t,e,n),o=e.colorStops,r=0;r0&&(n=i.lineWidth,(e=i.lineDash)&&"solid"!==e&&n>0?"dashed"===e?[4*n,2*n]:"dotted"===e?[n]:w(e)?[e]:y(e)?e:null:null),r=i.lineDashOffset;if(o){var a=i.strokeNoScale&&t.getLineScale?t.getLineScale():1;a&&1!==a&&(o=d(o,function(t){return t/a}),r/=a)}return[o,r]}function Ws(t){var e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))}function js(t){return"string"==typeof t&&"none"!==t}function Gs(t){var e=t.fill;return null!=e&&"none"!==e}function Us(t,e){if(null!=e.fillOpacity&&1!==e.fillOpacity){var n=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=n}else t.fill()}function Ys(t,e){if(null!=e.strokeOpacity&&1!==e.strokeOpacity){var n=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=n}else t.stroke()}function Xs(t,e,n){var i=Hn(e.image,e.__image,n);if(jn(i)){var o=t.createPattern(i,e.repeat||"repeat");if("function"==typeof DOMMatrix&&o&&o.setTransform){var r=new DOMMatrix;r.translateSelf(e.x||0,e.y||0),r.rotateSelf(0,0,(e.rotation||0)*Tf),r.scaleSelf(e.scaleX||1,e.scaleY||1),o.setTransform(r)}return o}}function qs(t,e,n,i,o){var r=!1;if(!i&&e===(n=n||{}))return!1;if(i||e.opacity!==n.opacity){Js(t,o),r=!0;var a=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(a)?dy.opacity:a}(i||e.blend!==n.blend)&&(r||(Js(t,o),r=!0),t.globalCompositeOperation=e.blend||dy.blend);for(var s=0;s=0)){ET.push(n);var r=pS.wrapStageHandler(n,o);r.__prio=e,r.__raw=n,t.push(r)}}function vl(t,e){PT[t]=e}function _l(t,e,n,i){return{eventContent:{selected:eo(n),isFromClick:e.isFromClick||!1}}}function xl(e=!1){return RT||(RT=t(481),RT)}function wl(t,e,n,i,o,r){if(o-i<=n)return;const a=i+o>>1;bl(t,e,a,i,o,r),wl(t,e,n,i,a-1,1-r),wl(t,e,n,a+1,o,1-r)}function bl(t,e,n,i,o,r){for(;o>i;){if(o-i>600){const a=o-i+1,s=n-i+1,l=Math.log(a),u=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*u*(a-u)/a)*(s-a/2<0?-1:1);bl(t,e,n,Math.max(i,Math.floor(n-s*u/a+h)),Math.min(o,Math.floor(n+(a-s)*u/a+h)),r)}const a=e[2*n+r];let s=i,l=o;for(Sl(t,e,i,n),e[2*o+r]>a&&Sl(t,e,i,o);sa;)l--}e[2*i+r]===a?Sl(t,e,i,l):(l++,Sl(t,e,l,o)),l<=n&&(i=l+1),n<=l&&(o=l-1)}}function Sl(t,e,n,i){Tl(t,n,i),Tl(e,2*n,2*i),Tl(e,2*n+1,2*i+1)}function Tl(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function Ml(t,e,n,i){const o=t-n,r=e-i;return o*o+r*r}function Cl(t){y(t)?c(t,function(t){Cl(t)}):l(UT,t)>=0||(UT.push(t),v(t)&&(t={install:t}),t.install(YT))}function kl(t){return isNaN(+t.cpx1)||isNaN(+t.cpy1)}function Il(t){return"_"+t+"Type"}function Ll(t,e,n){var i=e.getItemVisual(n,t);if(!i||"none"===i)return i;var o=e.getItemVisual(n,t+"Size"),r=e.getItemVisual(n,t+"Rotate"),a=e.getItemVisual(n,t+"Offset"),s=e.getItemVisual(n,t+"KeepAspect"),l=Rs(o);return i+l+Bs(a||0,l)+(r||"")+(s||"")}function Pl(t,e,n){var i=e.getItemVisual(n,t);if(i&&"none"!==i){var o=e.getItemVisual(n,t+"Size"),r=e.getItemVisual(n,t+"Rotate"),a=e.getItemVisual(n,t+"Offset"),s=e.getItemVisual(n,t+"KeepAspect"),l=Rs(o),u=Bs(a||0,l),h=Es(i,-l[0]/2+u[0],-l[1]/2+u[1],l[0],l[1],null,s);return h.__specifiedRotation=null==r||isNaN(r)?void 0:+r*Math.PI/180||0,h.name=t,h}}function Dl(t,e){t.x1=e[0][0],t.y1=e[0][1],t.x2=e[1][0],t.y2=e[1][1],t.percent=1;var n=e[2];n?(t.cpx1=n[0],t.cpy1=n[1]):(t.cpx1=NaN,t.cpy1=NaN)}function Al(t){var e=t.hostModel,n=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:n.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:n.get("disabled"),blurScope:n.get("blurScope"),focus:n.get("focus"),labelStatesModels:ho(e)}}function Ol(t){return isNaN(t[0])||isNaN(t[1])}function zl(t){return t&&!Ol(t[0])&&!Ol(t[1])}function El(t){return null==t?0:t.length||1}function Rl(t){return t}function Bl(t,e){return t.hasOwnProperty(e)||(t[e]=[]),t[e]}function Nl(t){return t instanceof kM}function Fl(t){for(var e=B(),n=0;n<(t||[]).length;n++){var i=t[n],o=b(i)?i.name:i;null!=o&&null==e.get(o)&&e.set(o,n)}return e}function Vl(t){var e=MM(t);return e.dimNameMap||(e.dimNameMap=Fl(t.dimensionsDefine))}function Zl(t){return t>30}function Hl(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(t.data=d(e,function(t){var e={coords:[t[0].coord,t[1].coord]};return t[0].name&&(e.fromName=t[0].name),t[1].name&&(e.toName=t[1].name),function(t){for(var e=t[0],n=1,i=t.length;nn&&!l||o=0?i+=u:i-=u:f>=0?i-=u:i+=u}return i}function Su(t,e){var n=[],i=Yt,o=[[],[],[]],r=[[],[]],a=[];e/=2,t.eachEdge(function(t,s){var l=t.getLayout(),u=t.getVisual("fromSymbol"),h=t.getVisual("toSymbol");l.__original||(l.__original=[U(l[0]),U(l[1])],l[2]&&l.__original.push(U(l[2])));var c=l.__original;if(null!=l[2]){if(G(o[0],c[0]),G(o[1],c[2]),G(o[2],c[1]),u&&"none"!==u){var d=Ql(t.node1),p=bu(o,c[0],d*e);i(o[0][0],o[1][0],o[2][0],p,n),o[0][0]=n[3],o[1][0]=n[4],i(o[0][1],o[1][1],o[2][1],p,n),o[0][1]=n[3],o[1][1]=n[4]}h&&"none"!==h&&(d=Ql(t.node2),p=bu(o,c[1],d*e),i(o[0][0],o[1][0],o[2][0],p,n),o[1][0]=n[1],o[2][0]=n[2],i(o[0][1],o[1][1],o[2][1],p,n),o[1][1]=n[1],o[2][1]=n[2]),G(l[0],o[0]),G(l[1],o[2]),G(l[2],o[1])}else G(r[0],c[0]),G(r[1],c[1]),K(a,r[1],r[0]),Q(a,a),u&&"none"!==u&&(d=Ql(t.node1),q(r[0],r[0],a,d*e)),h&&"none"!==h&&(d=Ql(t.node2),q(r[1],r[1],a,-d*e)),G(l[0],r[0]),G(l[1],r[1])})}function Tu(t){return"view"===t.type}function Mu(t){return"_EC_"+t}function Cu(t,e){return{getValue:function(n){var i=this[t][e];return i.getStore().get(i.getDimensionIndex(n||"value"),this.dataIndex)},setVisual:function(n,i){this.dataIndex>=0&&this[t][e].setItemVisual(this.dataIndex,n,i)},getVisual:function(n){return this[t][e].getItemVisual(this.dataIndex,n)},setLayout:function(n,i){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,n,i)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}}function ku(t,e){if(wC(this).mainData===this){var n=a({},wC(this).datas);n[this.dataType]=e,Au(e,n,t)}else Ou(e,this.dataType,wC(this).mainData,t);return e}function Iu(t,e){return t.struct&&t.struct.update(),e}function Lu(t,e){return c(wC(e).datas,function(n,i){n!==e&&Ou(n.cloneShallow(),i,e,t)}),e}function Pu(t){var e=wC(this).mainData;return null==t||null==e?e:wC(e).datas[t]}function Du(){var t=wC(this).mainData;return null==t?[{data:t}]:d(g(wC(t).datas),function(e){return{type:e,data:wC(t).datas[e]}})}function Au(t,e,n){wC(t).datas={},c(e,function(e,i){Ou(e,i,t,n)})}function Ou(t,e,n,i){wC(n).datas[e]=t,wC(t).mainData=n,t.dataType=e,i.struct&&(t[i.structAttr]=i.struct,i.struct[i.datasAttr[e]]=t),t.getLinkedData=Pu,t.getLinkedDataAll=Du}function zu(t,e){function n(t){var e=v[t];if(e<0){var n=l[t],i=b(n)?n:{name:n},o=new yM,r=i.name;return null!=r&&null!=g.get(r)&&(o.name=o.displayName=r),null!=i.type&&(o.type=i.type),null!=i.displayName&&(o.displayName=i.displayName),v[t]=h.length,o.storeDimIndex=t,h.push(o),o}return h[e]}function i(t,e,n){null!=ix.get(e)?t.otherDims[e]=n:(t.coordDim=e,t.coordDimIndex=n,u.set(e,!0))}function o(t){null==t.name&&(t.name=t.coordDim)}xr(t)||(t=br(t));var r=(e=e||{}).coordDimensions||[],l=e.dimensionsDefine||t.dimensionsDefine||[],u=B(),h=[],d=function(t,e,n,i){var o=Math.max(t.dimensionsDetectedCount||1,e.length,n.length,i||0);return c(e,function(t){var e;b(t)&&(e=t.dimsDef)&&(o=Math.max(o,e.length))}),o}(t,r,l,e.dimensionsCount),p=e.canOmitUnusedDimensions&&Zl(d),f=l===t.dimensionsDefine,g=f?Vl(t):Fl(l),m=e.encodeDefine;!m&&e.encodeDefaulter&&(m=e.encodeDefaulter(t,d));for(var y=B(m),v=new lw(d),x=0;x0&&(i.name=o+(r-1)),r++,e.set(o,r)}}(h),new kM({source:t,dimensions:h,fullDimensionCount:d,dimensionOmitted:p})}function Eu(t,e,n){if(n||e.hasKey(t)){for(var i=0;e.hasKey(t+i);)i++;t+=i}return e.set(t,!0),t}function Ru(t){return"category"===t.get("type")}function Bu(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function Nu(t,e){return{seriesType:t,plan:ma(),reset:function(t){var n=t.getData(),i=t.coordinateSystem,o=e||t.pipelineContext.large;if(i){var r=d(i.dimensions,function(t){return n.mapDimension(t)}).slice(0,2),a=r.length,s=n.getCalculationInfo("stackResultDimension");Bu(n,r[0])&&(r[0]=s),Bu(n,r[1])&&(r[1]=s);var l=n.getStore(),u=n.getDimensionIndex(r[0]),h=n.getDimensionIndex(r[1]);return a&&{progress:function(t,e){for(var n,r=o&&(y(n=(t.end-t.start)*a)?zC?new Float32Array(n):n:new EC(n)),s=[],c=[],d=t.start,p=0;d=e[0]&&t<=e[1]}function Xu(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function qu(t,e){return t*(e[1]-e[0])+e[0]}function Ku(t,e,n){var i=Math.log(t);return[Math.log(n?e[0]:Math.max(0,e[0]))/i,Math.log(n?e[1]:Math.max(0,e[1]))/i]}function $u(t){return t.get("stack")||ok+t.seriesIndex}function Ju(t){return t.dim+t.index}function Qu(t,e,n,i){return To(new Date(e),t,i).getTime()===To(new Date(n),t,i).getTime()}function th(t,e){return(t/=g_)>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function eh(t){return(t/=2592e6)>6?6:t>3?3:t>2?2:1}function nh(t){return(t/=f_)>12?12:t>6?6:t>3.5?4:t>2?2:1}function ih(t,e){return(t/=e?p_:d_)>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function oh(t){return pn(t,!0)}function rh(t,e,n){var i=Math.max(0,l(w_,e)-1);return To(new Date(t),w_[i],n).getTime()}function ah(t,e){return lk(t,an(e))}function sh(t,e,n){var i=t.rawExtentInfo;return i||(i=new gk(t,e,n),t.rawExtentInfo=i,i)}function lh(t,e){return null==e?null:k(e)?NaN:t.parse(e)}function uh(t,e){var n=t.type,i=sh(t,e,t.getExtent()).calculate();t.setBlank(i.isBlank);var o,r,a,s=i.min,l=i.max,u=e.ecModel;if(u&&"time"===n){var h=function(t,e){var n=[];return e.eachSeriesByType("bar",function(t){(function(t){return t.coordinateSystem&&"cartesian2d"===t.coordinateSystem.type})(t)&&n.push(t)}),n}(0,u),d=!1;if(c(h,function(t){d=d||t.getBaseAxis()===e.axis}),d){var p=(r=function(t){var e={};c(t,function(t){var n=t.coordinateSystem.getBaseAxis();if("time"===n.type||"value"===n.type)for(var i=t.getData(),o=n.dim+"_"+n.index,r=i.getDimensionIndex(i.mapDimension(n.dim)),a=i.getStore(),s=0,l=a.count();s0&&(r=null===r?s:Math.min(r,s))}n[i]=r}}return n}(o=h),a=[],c(o,function(t){var e,n=t.coordinateSystem.getBaseAxis(),i=n.getExtent();if("category"===n.type)e=n.getBandWidth();else if("value"===n.type||"time"===n.type){var o=r[n.dim+"_"+n.index],s=Math.abs(i[1]-i[0]),l=n.scale.getExtent(),u=Math.abs(l[1]-l[0]);e=o?s/u*o:s}else{var h=t.getData();e=Math.abs(i[1]-i[0])/h.count()}var c=jm(t.get("barWidth"),e),d=jm(t.get("barMaxWidth"),e),p=jm(t.get("barMinWidth")||(function(t){return t.pipelineContext&&t.pipelineContext.large}(t)?.5:1),e),f=t.get("barGap"),g=t.get("barCategoryGap"),m=t.get("defaultBarGap");a.push({bandWidth:e,barWidth:c,barMaxWidth:d,barMinWidth:p,barGap:f,barCategoryGap:g,defaultBarGap:m,axisKey:Ju(n),stackId:$u(t)})}),function(t){var e={};c(t,function(t,n){var i=t.axisKey,o=t.bandWidth,r=e[i]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:t.defaultBarGap||0,stacks:{}},a=r.stacks;e[i]=r;var s=t.stackId;a[s]||r.autoWidthCount++,a[s]=a[s]||{width:0,maxWidth:0};var l=t.barWidth;l&&!a[s].width&&(a[s].width=l,l=Math.min(r.remainedWidth,l),r.remainedWidth-=l);var u=t.barMaxWidth;u&&(a[s].maxWidth=u);var h=t.barMinWidth;h&&(a[s].minWidth=h);var c=t.barGap;null!=c&&(r.gap=c);var d=t.barCategoryGap;null!=d&&(r.categoryGap=d)});var n={};return c(e,function(t,e){n[e]={};var i=t.stacks,o=t.bandWidth,r=t.categoryGap;if(null==r){var a=g(i).length;r=Math.max(35-4*a,15)+"%"}var s=jm(r,o),l=jm(t.gap,1),u=t.remainedWidth,h=t.autoWidthCount,d=(u-s)/(h+(h-1)*l);d=Math.max(d,0),c(i,function(t){var e=t.maxWidth,n=t.minWidth;if(t.width)i=t.width,e&&(i=Math.min(i,e)),n&&(i=Math.max(i,n)),t.width=i,u-=i+l*i,h--;else{var i=d;e&&ei&&(i=n),i!==d&&(t.width=i,u-=i+l*i,h--)}}),d=(u-s)/(h+(h-1)*l),d=Math.max(d,0);var p,f=0;c(i,function(t,e){t.width||(t.width=d),p=t,f+=t.width*(1+l)}),p&&(f-=p.width*l);var m=-f/2;c(i,function(t,i){n[e][i]=n[e][i]||{bandWidth:o,offset:m,width:t.width},m+=t.width*(1+l)})}),n}(a)),f=function(t,e,n,i){var o=n.axis.getExtent(),r=Math.abs(o[1]-o[0]),a=function(t,e){if(t&&e)return t[Ju(e)]}(i,n.axis);if(void 0===a)return{min:t,max:e};var s=1/0;c(a,function(t){s=Math.min(t.offset,s)});var l=-1/0;c(a,function(t){l=Math.max(t.offset+t.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=e-t,d=h/(1-(s+l)/r)-h;return{min:t-=d*(s/u),max:e+=d*(l/u)}}(s,l,e,p);s=f.min,l=f.max}}return{extent:[s,l],fixMin:i.minFixed,fixMax:i.maxFixed}}function hh(t,e){var n=e,i=uh(t,n),o=i.extent,r=n.get("splitNumber");t instanceof fk&&(t.base=n.get("logBase"));var a=t.type,s=n.get("interval"),l="interval"===a||"time"===a;t.setBreaksFromOption(vh(n)),t.setExtent(o[0],o[1]),t.calcNiceExtent({splitNumber:r,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?n.get("minInterval"):null,maxInterval:l?n.get("maxInterval"):null}),null!=s&&t.setInterval&&t.setInterval(s)}function ch(t){var e,n=t.getLabelModel().get("formatter");if("time"===t.type){var i=_(e=n)||v(e)?e:function(t){t=t||{};var e={},n=!0;return c(w_,function(e){n&&(n=null==t[e])}),c(w_,function(i,o){var r=t[i];e[i]={};for(var a=null,s=o;s>=0;s--){var l=w_[s],u=b(r)&&!y(r)?r[l]:r,h=void 0;y(u)?a=(h=u.slice())[0]||"":_(u)?h=[a=u]:(null==a?a=v_[i]:y_[l].test(a)||(a=e[l][l][0]+" "+a),h=[a],n&&(h[1]="{primary|"+a+"}")),e[i][l]=h}}),e}(e);return function(e,n){return t.scale.getFormattedLabel(e,n,i)}}if(_(n))return function(e){var i=t.scale.getLabel(e);return n.replace("{value}",null!=i?i:"")};if(v(n)){if("category"===t.type)return function(e,i){return n(dh(t,e),e.value-t.scale.getExtent()[0],null)};var o=vo();return function(e,i){var r=null;return o&&(r=o.makeAxisLabelFormatterParamBreak(r,e.break)),n(dh(t,e),i,r)}}return function(e){return t.scale.getLabel(e)}}function dh(t,e){return"category"===t.type?t.scale.getLabel(e):e.value}function ph(t){var e=t.get("interval");return null==e?"auto":e}function fh(t){return"category"===t.type&&0===ph(t.getLabelModel())}function gh(t,e){var n={};return c(t.mapDimensionsAll(e),function(e){n[function(t,e){return Bu(t,e)?t.getCalculationInfo("stackResultDimension"):e}(t,e)]=!0}),g(n)}function mh(t){return"middle"===t||"center"===t}function yh(t){return t.getShallow("show")}function vh(t){var e,n=t.get("breaks",!0);if(null!=n)return vo()?"x"!==(e=t.axis).dim&&"y"!==e.dim&&"z"!==e.dim&&"single"!==e.dim||"category"===e.type?void 0:n:void 0}function _h(t){return("interval"===t.type||"time"===t.type)&&!t.hasBreaks()}function xh(t){return{out:{noPxChangeTryDetermine:[]},kind:t}}function wh(t,e){var n=d(e,function(e){return t.scale.parse(e)});return"time"===t.type&&n.length>0&&(n.sort(),n.unshift(n[0]),n.push(n[n.length-1])),n}function bh(t,e,n){var i,o,r=kk(t),a=ph(e),s=n.kind===Tk;if(!s){var l=Th(r,a);if(l)return l}v(a)?i=Lh(t,a):(o="auto"===a?function(t,e){if(e.kind===Tk){var n=t.calculateCategoryInterval(e);return e.out.noPxChangeTryDetermine.push(function(){return Sk(t).autoInterval=n,!0}),n}var i=Sk(t).autoInterval;return null!=i?i:Sk(t).autoInterval=t.calculateCategoryInterval(e)}(t,n):a,i=Ih(t,o));var u={labels:i,labelCategoryInterval:o};return s?n.out.noPxChangeTryDetermine.push(function(){return Mh(r,a,u),!0}):Mh(r,a,u),u}function Sh(t){return function(e){return Sk(e)[t]||(Sk(e)[t]={list:[]})}}function Th(t,e){for(var n=0;ne&&i.axisExtent0===o[0]&&i.axisExtent1===o[1])return r;i.lastTickCount=n,i.lastAutoInterval=e,i.axisExtent0=o[0],i.axisExtent1=o[1]}function Ih(t,e,n){function i(t){var e={value:t};l.push(n?t:{formattedLabel:o(e),rawLabel:r.getLabel(e),tickValue:t,time:void 0,break:void 0})}var o=ch(t),r=t.scale,a=r.getExtent(),s=t.getLabelModel(),l=[],u=Math.max((e||0)+1,1),h=a[0],c=r.count();0!==h&&u>1&&c/u>2&&(h=Math.round(Math.ceil(h/u)*u));var d=fh(t),p=s.get("showMinLabel")||d,f=s.get("showMaxLabel")||d;p&&h!==a[0]&&i(a[0]);for(var g=h;g<=a[1];g+=u)i(g);return f&&g-u!==a[1]&&i(a[1]),l}function Lh(t,e,n){var i=t.scale,o=ch(t),r=[];return c(i.getTicks(),function(t){var a=i.getLabel(t),s=t.value;e(t.value,a)&&r.push(n?s:{formattedLabel:o(t),rawLabel:a,tickValue:s,time:void 0,break:void 0})}),r}function Ph(t,e){var n=(t[1]-t[0])/e/2;t[0]+=n,t[1]-=n}function Dh(t,e,n){n=n||3,e?t.dirty|=n:t.dirty&=~n}function Ah(t,e){return e=e||3,null==t.dirty||!!(t.dirty&e)}function Oh(t){if(t)return Ah(t)&&function(t,e,n){var i=e.getComputedTransform();t.transform=ls(t.transform,i);var o=t.localRect=ss(t.localRect,e.getBoundingRect()),r=e.style,a=r.margin,s=n&&n.marginForce,l=n&&n.minMarginForce,u=n&&n.marginDefault,h=r.__marginType;null==h&&u&&(a=u,h=Wv.textMargin);for(var c=0;c<4;c++)Ok[c]=h===Wv.minMargin&&l&&null!=l[c]?l[c]:s&&null!=s[c]?s[c]:a?a[c]:0;h===Wv.textMargin&&es(o,Ok,!1,!1);var d=t.rect=ss(t.rect,o);i&&d.applyTransform(i),h===Wv.minMargin&&es(d,Ok,!1,!1),t.axisAligned=as(i),(t.label=t.label||{}).ignore=e.ignore,Dh(t,!1),Dh(t,!0,2)}(t,t.label,t),t}function zh(t,e){for(var n=0;n=0,r=0,a=t.length;r.1?"x":"y",h=a.transGroup[u];if(s.sort(function(t,e){return Math.abs(t.label[u]-h)-Math.abs(e.label[u]-h)}),l&&o){var d=r.getExtent(),p=Math.min(d[0],d[1]),f=Math.max(d[0],d[1])-p;o.union(new lg(p,0,f,1))}a.stOccupiedRect=o,a.labelInfoList=s}(t,n,i,l)}function Vh(t){t&&(t.ignore=!0)}function Zh(t,e,n,i,o){for(var r=[],a=[],s=[],l=0;l0&&i>0||n<0&&i<0)}(t)}function $h(t,e){c(t.x,function(t){return Jh(t,e.x,e.width)}),c(t.y,function(t){return Jh(t,e.y,e.height)})}function Jh(t,e,n){var i=[0,n],o=t.inverse?1:0;t.setExtent(i[o],i[1-o]),function(t,e){var n=t.getExtent(),i=n[0]+n[1];t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return i-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return i-t+e}}(t,e)}function Qh(t,e,n,i,o,r,a){function s(t){c(o[Fb[t]],function(e){if(yh(e.model)){var n=r.ensureRecord(e.model),i=n.labelInfoList;if(i)for(var o=0;o0&&!k(e)&&e>1e-4&&(t/=e),t}tc(i,o,Tk,e,!1,a);var h=[0,0,0,0];s(0),s(1),l(i,0,NaN),l(i,1,NaN);var d=null==function(t,e){if(t&&e)for(var n=0,i=t.length;n0});return es(i,h,!0,!0,n),$h(o,i),d}function tc(t,e,n,i,o,r){function a(e){l[Fb[1-e]]=t[Vb[e]]<=.5*r.refContainer[Vb[e]]?0:1-e==1?2:1}var s=n===Mk;c(e,function(e){return c(e,function(e){yh(e.model)&&(function(t,e,n){var i=Uh(e,n);t.updateCfg(i)}(e.axisBuilder,t,e.model),e.axisBuilder.build(s?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:o}))})});var l={x:0,y:0};a(0),a(1),c(e,function(t,e){return c(t,function(t){yh(t.model)&&(("all"===i||s)&&t.axisBuilder.build({axisName:!0},{nameMarginLevel:l[e]}),s&&t.axisBuilder.build({axisLine:!0}))})})}function ec(t,e){return"all"===t||y(t)&&l(t,e)>=0||t===e}function nc(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[oc(t)]}function ic(t){return!!t.get(["handle","show"])}function oc(t){return t.type+"||"+t.id}function rc(t){t.registerComponentView(uI),t.registerComponentModel(FC),t.registerCoordinateSystem("cartesian2d",Qk),Zu(t,"x",ZC,hI),Zu(t,"y",ZC,hI),t.registerComponentView(sI),t.registerComponentView(lI),t.registerPreprocessor(function(t){t.xAxis&&t.yAxis&&!t.grid&&(t.grid={})})}function ac(t,e,n,i){sc(cI(n).lastProp,i)||(cI(n).lastProp=i,e?Ia(n,i,t):(n.stopAnimation(),n.attr(i)))}function sc(t,e){if(b(t)&&b(e)){var n=!0;return c(e,function(e,i){n=n&&sc(t[i],e)}),!!n}return t===e}function lc(t,e){t[e.get(["label","show"])?"show":"hide"]()}function uc(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function hc(t,e,n){var i=e.get("z"),o=e.get("zlevel");t&&t.traverse(function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=o&&(t.zlevel=o),t.silent=n)})}function cc(t,e,n,i,o){t=e.scale.parse(t);var r=e.scale.getLabel({value:t},{precision:o.precision}),a=o.formatter;if(a){var s={value:dh(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};c(i,function(t){var e=n.getSeriesByIndex(t.seriesIndex),i=e&&e.getDataParams(t.dataIndexInside);i&&s.seriesData.push(i)}),_(a)?r=a.replace("{value}",r):v(a)&&(r=a(s))}return r}function dc(t,e,n){var i=[1,0,0,1,0,0];return wt(i,i,n.rotation),xt(i,i,n.position),Ga([t.dataToCoord(e),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}function pc(t,e){var n={};return n[e.dim+"AxisIndex"]=e.index,t.getCartesian(n)}function fc(t){return"x"===t.dim?0:1}function gc(t,e,n){if(!Qp.node){var i=e.getZr();_I(i).records||(_I(i).records={}),function(t,e){function n(n,i){t.on(n,function(n){var o=function(t){var e={showTip:[],hideTip:[]},n=function(i){var o=e[i.type];o?o.push(i):(i.dispatchAction=n,t.dispatchAction(i))};return{dispatchAction:n,pendings:e}}(e);xI(_I(t).records,function(t){t&&i(t,n,o.dispatchAction)}),function(t,e){var n,i=t.showTip.length,o=t.hideTip.length;i?n=t.showTip[i-1]:o&&(n=t.hideTip[o-1]),n&&(n.dispatchAction=null,e.dispatchAction(n))}(o.pendings,e)})}_I(t).initialized||(_I(t).initialized=!0,n("click",m(yc,"click")),n("mousemove",m(yc,"mousemove")),n("globalout",mc))}(i,e),(_I(i).records[t]||(_I(i).records[t]={})).handler=n}}function mc(t,e,n){t.handler("leave",null,n)}function yc(t,e,n,i){e.handler(t,n,i)}function vc(t,e){if(!Qp.node){var n=e.getZr();(_I(n).records||{})[t]&&(_I(n).records[t]=null)}}function _c(t,e){var n,i=[],o=t.seriesIndex;if(null==o||!(n=e.getSeriesByIndex(o)))return{point:[]};var r=n.getData(),a=In(r,t);if(null==a||a<0||y(a))return{point:[]};var s=r.getItemGraphicEl(a),l=n.coordinateSystem;if(n.getTooltipPosition)i=n.getTooltipPosition(a)||[];else if(l&&l.dataToPoint)if(t.isStacked){var u=l.getBaseAxis(),h=l.getOtherAxis(u).dim,c="x"===h||"radius"===h?1:0,p=r.mapDimension(u.dim),f=[];f[c]=r.get(p,a),f[1-c]=r.get(r.getCalculationInfo("stackResultDimension"),a),i=l.dataToPoint(f)||[]}else i=l.dataToPoint(r.getValues(d(l.dimensions,function(t){return r.mapDimension(t)}),a))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),i=[g.x+g.width/2,g.y+g.height/2]}return{point:i,el:s}}function xc(t,e,n){var i=t.currTrigger,o=[t.x,t.y],r=t,a=t.dispatchAction||_f(n.dispatchAction,n),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){Mc(o)&&(o=_c({seriesIndex:r.seriesIndex,dataIndex:r.dataIndex},e).point);var l=Mc(o),u=r.axesInfo,h=s.axesInfo,d="leave"===i||Mc(o),p={},f={},g={list:[],map:{}},y={showPointer:m(bc,f),showTooltip:m(Sc,g)};c(s.coordSysMap,function(t,e){var n=l||t.containPoint(o);c(s.coordSysAxesInfo[e],function(t,e){var i=t.axis,r=function(t,e){for(var n=0;n<(t||[]).length;n++){var i=t[n];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}(u,t);if(!d&&n&&(!u||r)){var a=r&&r.value;null!=a||l||(a=i.pointToData(o)),null!=a&&wc(t,a,y,!1,p)}})});var v={};return c(h,function(t,e){var n=t.linkGroup;n&&!f[e]&&c(n.axesInfo,function(e,i){var o=f[i];if(e!==t&&o){var r=o.value;n.mapper&&(r=t.axis.scale.parse(n.mapper(r,Tc(e),Tc(t)))),v[t.key]=r}})}),c(v,function(t,e){wc(h[e],t,y,!0,p)}),function(t,e,n){var i=n.axesInfo=[];c(e,function(e,n){var o=e.axisPointerModel.option,r=t[n];r?(!e.useHandle&&(o.status="show"),o.value=r.value,o.seriesDataIndices=(r.payloadBatch||[]).slice()):!e.useHandle&&(o.status="hide"),"show"===o.status&&i.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:o.value})})}(f,h,p),function(t,e,n,i){if(!Mc(e)&&t.list.length){var o=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:o.dataIndexInside,dataIndex:o.dataIndex,seriesIndex:o.seriesIndex,dataByCoordSys:t.list})}else i({type:"hideTip"})}(g,o,t,a),function(t,e,n){var i=n.getZr(),o="axisPointerLastHighlights",r=SI(i)[o]||{},a=SI(i)[o]={};c(t,function(t,e){var n=t.axisPointerModel.option;"show"===n.status&&t.triggerEmphasis&&c(n.seriesDataIndices,function(t){a[t.seriesIndex+" | "+t.dataIndex]=t})});var s=[],l=[];c(r,function(t,e){!a[e]&&l.push(t)}),c(a,function(t,e){!r[e]&&s.push(t)}),l.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}(h,0,n),p}}function wc(t,e,n,i,o){var r=t.axis;if(!r.scale.isBlank()&&r.containData(e))if(t.involveSeries){var s=function(t,e){var n=e.axis,i=n.dim,o=t,r=[],a=Number.MAX_VALUE,s=-1;return c(e.seriesModels,function(e,l){var u,h,d=e.getData().mapDimensionsAll(i);if(e.getAxisTooltipData){var p=e.getAxisTooltipData(d,t,n);h=p.dataIndices,u=p.nestestValue}else{if(!(h=e.indicesOfNearest(i,d[0],t,"category"===n.type?.5:null)).length)return;u=e.getData().get(d[0],h[0])}if(null!=u&&isFinite(u)){var f=t-u,g=Math.abs(f);g<=a&&((g=0&&s<0)&&(a=g,s=f,o=u,r.length=0),c(h,function(t){r.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})}))}}),{payloadBatch:r,snapToValue:o}}(e,t),l=s.payloadBatch,u=s.snapToValue;l[0]&&null==o.seriesIndex&&a(o,l[0]),!i&&t.snap&&r.containData(u)&&null!=u&&(e=u),n.showPointer(t,e,l),n.showTooltip(t,s,u)}else n.showPointer(t,e)}function bc(t,e,n,i){t[e.key]={value:n,payloadBatch:i}}function Sc(t,e,n,i){var o=n.payloadBatch,r=e.axis,a=r.model,s=e.axisPointerModel;if(e.triggerTooltip&&o.length){var l=e.coordSys.model,u=oc(l),h=t.map[u];h||(h=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(h)),h.dataByAxis.push({axisDim:r.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:o.slice()})}}function Tc(t){var e=t.axis.model,n={},i=n.axisDim=t.axis.dim;return n.axisIndex=n[i+"AxisIndex"]=e.componentIndex,n.axisName=n[i+"AxisName"]=e.name,n.axisId=n[i+"AxisId"]=e.id,n}function Mc(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function Cc(t){nI.registerAxisPointerClass("CartesianAxisPointer",yI),t.registerComponentModel(vI),t.registerComponentView(bI),t.registerPreprocessor(function(t){if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!y(e)&&(t.axisPointer.link=[e])}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=function(t,e){var n={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return function(t,e,n){var i=e.getComponent("tooltip"),r=e.getComponent("axisPointer"),a=r.get("link",!0)||[],l=[];c(n.getCoordinateSystems(),function(n){function u(i,u,h){var f=h.model.getModel("axisPointer",r),g=f.get("show");if(g&&("auto"!==g||i||ic(f))){null==u&&(u=f.get("triggerTooltip")),f=i?function(t,e,n,i,r,a){var l=e.getModel("axisPointer"),u={};c(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],function(t){u[t]=o(l.get(t))}),u.snap="category"!==t.type&&!!a,"cross"===l.get("type")&&(u.type="line");var h=u.label||(u.label={});if(null==h.show&&(h.show=!1),"cross"===r){var d=l.get(["label","show"]);if(h.show=null==d||d,!a){var p=u.lineStyle=l.get("crossStyle");p&&s(h,p.textStyle)}}return t.model.getModel("axisPointer",new i_(u,n,i))}(h,p,r,e,i,u):f;var m=f.get("snap"),y=f.get("triggerEmphasis"),v=oc(h.model),_=u||m||"category"===h.type,x=t.axesInfo[v]={key:v,axis:h,coordSys:n,axisPointerModel:f,triggerTooltip:u,triggerEmphasis:y,involveSeries:_,snap:m,useHandle:ic(f),seriesModels:[],linkGroup:null};d[v]=x,t.seriesInvolved=t.seriesInvolved||_;var w=function(t,e){for(var n=e.model,i=e.dim,o=0;o=0;r--){var a=t[r];a&&(a instanceof i_&&(a=a.get("tooltip",!0)),_(a)&&(a={formatter:a}),a&&(i=new i_(a,i,o)))}return i}function Rc(t,e){return t.dispatchAction||_f(e.dispatchAction,e)}function Bc(t){return"center"===t||"middle"===t}function Nc(t){return t+"Axis"}function Fc(t){var e={};return c(["start","end","startValue","endValue","throttle"],function(n){t.hasOwnProperty(n)&&(e[n]=t[n])}),e}function Vc(t,e,n,i,o,r){t=t||0;var a=n[1]-n[0];if(null!=o&&(o=Hc(o,[0,a])),null!=r&&(r=Math.max(r,null!=o?o:0)),"all"===i){var s=Math.abs(e[1]-e[0]);s=Hc(s,[0,a]),o=r=Hc(s,[o,r]),i=0}e[0]=Hc(e[0],n),e[1]=Hc(e[1],n);var l=Zc(e,i);e[i]+=t;var u,h=o||0,c=n.slice();return l.sign<0?c[0]+=h:c[1]-=h,e[i]=Hc(e[i],c),u=Zc(e,i),null!=o&&(u.sign!==l.sign||u.spanr&&(e[1-i]=e[i]+u.sign*r),e}function Zc(t,e){var n=t[e]-t[1-e];return{span:Math.abs(n),sign:n>0?-1:n<0?1:e?-1:1}}function Hc(t,e){return Math.min(null!=e[1]?e[1]:1/0,Math.max(null!=e[0]?e[0]:-1/0,t))}function Wc(t){t.registerComponentModel(VI),t.registerComponentView(ZI),function(t){YI||(YI=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,UI),function(t){t.registerAction("dataZoom",function(t,e){c(function(t,e){function n(t){!s.get(t.uid)&&function(t){var e=!1;return t.eachTargetAxis(function(t,n){var i=r.get(t);i&&i[n]&&(e=!0)}),e}(t)&&(i(t),o=!0)}function i(t){s.set(t.uid,!0),a.push(t),t.eachTargetAxis(function(t,e){(r.get(t)||r.set(t,[]))[e]=!0})}var o,r=B(),a=[],s=B();t.eachComponent({mainType:"dataZoom",query:e},function(t){s.get(t.uid)||i(t)});do{o=!1,t.eachComponent("dataZoom",n)}while(o);return a}(e,t),function(e){e.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})})}(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}(t)}function jc(t,e){qI[t]=e}function Gc(t){return qI[t]}function Uc(t,e){var n=S_(e.get("padding")),i=e.getItemStyle(["color","opacity"]);return i.fill=e.get("backgroundColor"),new mv({shape:{x:t.x-n[3],y:t.y-n[0],width:t.width+n[1]+n[3],height:t.height+n[0]+n[2],r:e.get("borderRadius")},style:i,silent:!0,z2:-1})}function Yc(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Xc(t,e){return d(t,function(t,n){var i=e&&e[n];if(b(i)&&!y(i)){b(t)&&!y(t)||(t={value:t});var o=null!=i.name&&null==t.name;return t=s(t,i),o&&delete t.name,t}return t})}function qc(t){var e=cL(t);return e.snapshots||(e.snapshots=[{}]),e.snapshots}function Kc(t,e){var n=ML[e.brushType].createCover(t,e);return n.__brushOption=e,Qc(n,e),t.group.add(n),n}function $c(t,e){var n=ed(e);return n.endCreating&&(n.endCreating(t,e),Qc(e,e.__brushOption)),e}function Jc(t,e){var n=e.__brushOption;ed(e).updateCoverShape(t,e,n.range,n)}function Qc(t,e){var n=e.z;null==n&&(n=1e4),t.traverse(function(t){t.z=n,t.z2=n})}function td(t,e){ed(e).updateCommon(t,e),Jc(t,e)}function ed(t){return ML[t.__brushOption.brushType]}function nd(t,e,n){var i,o=t._panels;if(!o)return fL;var r=t._transform;return c(o,function(t){t.isTargetByCursor(e,n,r)&&(i=t)}),i}function id(t,e){var n=t._panels;if(!n)return fL;var i=e.__brushOption.panelId;return null!=i?n[i]:fL}function od(t){var e=t._covers,n=e.length;return c(e,function(e){t.group.remove(e)},t),e.length=0,!!n}function rd(t,e){var n=d(t._covers,function(t){var e=t.__brushOption,n=o(e.range);return{brushType:e.brushType,panelId:e.panelId,range:n}});t.trigger("brush",{areas:n,isEnd:!!e.isEnd,removeOnClick:!!e.removeOnClick})}function ad(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function sd(t,e,n,i){var o=new Em;return o.add(new mv({name:"main",style:cd(n),silent:!0,draggable:!0,cursor:"move",drift:m(fd,t,e,o,["n","s","w","e"]),ondragend:m(rd,e,{isEnd:!0})})),c(i,function(n){o.add(new mv({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:m(fd,t,e,o,n),ondragend:m(rd,e,{isEnd:!0})}))}),o}function ld(t,e,n,i){var o=i.brushStyle.lineWidth||0,r=mL(o,6),a=n[0][0],s=n[1][0],l=a-o/2,u=s-o/2,h=n[0][1],c=n[1][1],d=h-r+o/2,p=c-r+o/2,f=h-a,g=c-s,m=f+o,y=g+o;hd(t,e,"main",a,s,f,g),i.transformable&&(hd(t,e,"w",l,u,r,y),hd(t,e,"e",d,u,r,y),hd(t,e,"n",l,u,m,r),hd(t,e,"s",l,p,m,r),hd(t,e,"nw",l,u,r,r),hd(t,e,"ne",d,u,r,r),hd(t,e,"sw",l,p,r,r),hd(t,e,"se",d,p,r,r))}function ud(t,e){var n=e.__brushOption,i=n.transformable,o=e.childAt(0);o.useStyle(cd(n)),o.attr({silent:!i,cursor:i?"move":"default"}),c([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(n){var o=e.childOfName(n.join("")),r=1===n.length?pd(t,n[0]):function(t,e){var n=[pd(t,e[0]),pd(t,e[1])];return("e"===n[0]||"w"===n[0])&&n.reverse(),n.join("")}(t,n);o&&o.attr({silent:!i,invisible:!i,cursor:i?xL[r]+"-resize":null})})}function hd(t,e,n,i,o,r,a){var s=e.childOfName(n);s&&s.setShape(function(t){var e=gL(t[0][0],t[1][0]),n=gL(t[0][1],t[1][1]);return{x:e,y:n,width:mL(t[0][0],t[1][0])-e,height:mL(t[0][1],t[1][1])-n}}(yd(t,e,[[i,o],[i+r,o+a]])))}function cd(t){return s({strokeNoScale:!0},t.brushStyle)}function dd(t,e,n,i){var o=[gL(t,n),gL(e,i)],r=[mL(t,n),mL(e,i)];return[[o[0],r[0]],[o[1],r[1]]]}function pd(t,e){var n=Ua({w:"left",e:"right",n:"top",s:"bottom"}[e],function(t){return ja(t.group)}(t));return{left:"w",right:"e",top:"n",bottom:"s"}[n]}function fd(t,e,n,i,o,r){var a=n.__brushOption,s=t.toRectRange(a.range),l=md(e,o,r);c(i,function(t){var e=_L[t];s[e[0]][e[1]]+=l[e[0]]}),a.range=t.fromRectRange(dd(s[0][0],s[1][0],s[0][1],s[1][1])),td(e,n),rd(e,{isEnd:!1})}function gd(t,e,n,i){var o=e.__brushOption.range,r=md(t,n,i);c(o,function(t){t[0]+=r[0],t[1]+=r[1]}),td(t,e),rd(t,{isEnd:!1})}function md(t,e,n){var i=t.group,o=i.transformCoordToLocal(e,n),r=i.transformCoordToLocal(0,0);return[o[0]-r[0],o[1]-r[1]]}function yd(t,e,n){var i=id(t,e);return i&&i!==fL?i.clipPath(n,t._transform):o(n)}function vd(t){var e=t.event;e.preventDefault&&e.preventDefault()}function _d(t,e,n){return t.childOfName("main").contain(e,n)}function xd(t,e,n,i){var r,a=t._creatingCover,s=t._creatingPanel,l=t._brushOption;if(t._track.push(n.slice()),function(t){var e=t._track;if(!e.length)return!1;var n=e[e.length-1],i=e[0],o=n[0]-i[0],r=n[1]-i[1];return yL(o*o+r*r,.5)>6}(t)||a){if(s&&!a){"single"===l.brushMode&&od(t);var u=o(l);u.brushType=wd(u.brushType,s),u.panelId=s===fL?null:s.panelId,a=t._creatingCover=Kc(t,u),t._covers.push(a)}if(a){var h=ML[wd(t._brushType,s)];a.__brushOption.range=h.getCreatingRange(yd(t,a,t._track)),i&&($c(t,a),h.updateCommon(t,a)),Jc(t,a),r={isEnd:i}}}else i&&"single"===l.brushMode&&l.removeOnClick&&nd(t,e,n)&&od(t)&&(r={isEnd:i,removeOnClick:!0});return r}function wd(t,e){return"auto"===t?e.defaultBrushType:t}function bd(t,e){if(t._dragging){vd(e);var n=t.group.transformCoordToLocal(e.offsetX,e.offsetY),i=xd(t,e,n,!0);t._dragging=!1,t._track=[],t._creatingCover=null,i&&rd(t,i)}}function Sd(t){return{createCover:function(e,n){return sd({toRectRange:function(e){var n=[e,[0,100]];return t&&n.reverse(),n},fromRectRange:function(e){return e[t]}},e,n,[[["w"],["e"]],[["n"],["s"]]][t])},getCreatingRange:function(e){var n=ad(e);return[gL(n[0][t],n[1][t]),mL(n[0][t],n[1][t])]},updateCoverShape:function(e,n,i,o){var r,a=id(e,n);if(a!==fL&&a.getLinearBrushOtherExtent)r=a.getLinearBrushOtherExtent(t);else{var s=e._zr;r=[0,[s.getWidth(),s.getHeight()][1-t]]}var l=[i,r];t&&l.reverse(),ld(e,n,l,o)},updateCommon:ud,contain:_d}}function Td(t){return t=kd(t),function(e){return qa(e,t)}}function Md(t,e){return t=kd(t),function(n){var i=null!=e?e:n,o=i?t.x:t.y;return[o,o+((i?t.width:t.height)||0)]}}function Cd(t,e,n){var i=kd(t);return function(t,o){return i.contain(o[0],o[1])&&!fu(t,e,n)}}function kd(t){return lg.create(t)}function Id(t){return t[0]>t[1]&&t.reverse(),t}function Ld(t,e){return Pn(t,e,{includeMainTypes:kL})}function Pd(t,e,n,i){var o=n.getAxis(["x","y"][t]),r=Id(d([0,1],function(t){return e?o.coordToData(o.toLocalCoord(i[t]),!0):o.toGlobalCoord(o.dataToCoord(i[t]))})),a=[];return a[t]=r,a[1-t]=[NaN,NaN],{values:r,xyMinMax:a}}function Dd(t,e,n,i){return[e[0]-i[t]*n[0],e[1]-i[t]*n[1]]}function Ad(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}function Od(t){var e={xAxisIndex:t.get("xAxisIndex",!0),yAxisIndex:t.get("yAxisIndex",!0),xAxisId:t.get("xAxisId",!0),yAxisId:t.get("yAxisId",!0)};return null==e.xAxisIndex&&null==e.xAxisId&&(e.xAxisIndex="all"),null==e.yAxisIndex&&null==e.yAxisId&&(e.yAxisIndex="all"),e}function zd(t,e,n,i){Bd(t,e,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=t?t:e}),Rd(t,e,n,i)}function Ed(t){for(var e,n=t.getZr().storage.getDisplayList(),i=0,o=n.length;i0&&(s.during=l?_f($d,{el:e,userDuring:l}):null,s.setToFinal=!0,s.scope=t),a(s,n[r]),s}function Xd(t,e,n,i){var o=(i=i||{}).dataIndex,r=i.isInit,s=i.clearStyle,u=n.isAnimationEnabled(),h=rP(t),d=e.style;h.userDuring=e.during;var p={},f={};if(function(t,e,n){for(var i=0;i=0)){var c=t.getAnimationStyleProps(),d=c?c.style:null;if(d){!o&&(o=i.style={});var p=g(n);for(h=0;h0&&t.animateFrom(_,x)}else!function(t,e,n,i,o){if(o){var r=Yd("update",t,e,i,n);r.duration>0&&t.animateFrom(o,r)}}(t,e,o||0,n,p);qd(t,e),d?t.dirty():t.markRedraw()}function qd(t,e){for(var n=rP(t).leaveToProps,i=0;i=0){!r&&(r=i[t]={});var p=g(s);for(d=0;d"}(o,e.attrs)+("style"!==o?lt(r):r||"")+(i?""+n+d(i,function(e){return t(e)}).join(n)+n:"")+""}(t)}function up(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function hp(t,e,n,i){return sp("svg","root",{width:t,height:e,xmlns:MP,"xmlns:xlink":CP,version:"1.1",baseProfile:"full",viewBox:!!i&&"0 0 "+t+" "+e},n)}function cp(){return IP++}function dp(t,e,n){var i=a({},t.shape);a(i,e),t.buildPath(n,i);var o=new vP;return o.reset(we(t)),n.rebuildPath(o,1),o.generateStr(),o.getStr()}function pp(t,e){var n=e.originX,i=e.originY;(n||i)&&(t[PP]=n+"px "+i+"px")}function fp(t,e){var n=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[n]=t,n}function gp(t){return _(t)?LP[t]?"cubic-bezier("+LP[t]+")":qt(t)?t:"":""}function mp(t,e,n,i){function o(o){function r(t,e,n){for(var i=t.getTracks(),o=t.getMaxTime(),r=0;r0}).length)return fp(d,n)+" "+o[0]+" both"}var r=t.animators,s=r.length,l=[];if(t instanceof xb){var u=function(t,e,n){var i,o,r={};if(c(t.shape.paths,function(t){var e=up(n.zrId);e.animation=!0,mp(t,{},e,!0);var a=e.cssAnims,s=e.cssNodes,l=g(a),u=l.length;if(u){var h=a[o=l[u-1]];for(var c in h){var d=h[c];r[c]=r[c]||{d:""},r[c].d+=d.d||""}for(var p in s){var f=s[p].animation;f.indexOf(o)>=0&&(i=f)}}}),i){e.d=!1;var a=fp(r,n);return i.replace(o,a)}}(t,e,n);if(u)l.push(u);else if(!s)return}else if(!s)return;for(var h={},d=0;d=0&&a||r;s&&(o=he(s))}var l=i.lineWidth;l&&(l/=!i.strokeNoScale&&t.transform?t.transform[0]:1);var u={cursor:"pointer"};o&&(u.fill=o),i.stroke&&(u.stroke=i.stroke),l&&(u["stroke-width"]=l),yp(u,e,n,!0)}}(t,r,e),sp(s,t.id+"",r)}function kp(t,e){return t instanceof ov?Cp(t,e):t instanceof cv?function(t,e){var n=t.style,i=n.image;if(i&&!_(i)&&(vp(i)?i=i.src:_p(i)&&(i=i.toDataURL())),i){var o=n.x||0,r=n.y||0,a={href:i,width:n.width,height:n.height};return o&&(a.x=o),r&&(a.y=r),Sp(a,t.transform),xp(a,n,t,e),wp(a,t),e.animation&&mp(t,a,e),sp("image",t.id+"",a)}}(t,e):t instanceof sv?function(t,e){var n=t.style,i=n.text;if(null!=i&&(i+=""),i&&!isNaN(n.x)&&!isNaN(n.y)){var o=n.font||of,r=n.x||0,a=function(t,e,n){return"top"===n?t+=e/2:"bottom"===n&&(t-=e/2),t}(n.y||0,Xe(o),n.textBaseline),s={"dominant-baseline":"central","text-anchor":Wg[n.textAlign]||n.textAlign};if(Si(n)){var l="",u=n.fontStyle,h=wi(n.fontSize);if(!parseFloat(h))return;var c=n.fontWeight;l+="font-size:"+h+";font-family:"+(n.fontFamily||nf)+";",u&&"normal"!==u&&(l+="font-style:"+u+";"),c&&"normal"!==c&&(l+="font-weight:"+c+";"),s.style=l}else s.style="font: "+o;return i.match(/\s/)&&(s["xml:space"]="preserve"),r&&(s.x=r),a&&(s.y=a),Sp(s,t.transform),xp(s,n,t,e),wp(s,t),e.animation&&mp(t,s,e),sp("text",t.id+"",s,void 0,i)}}(t,e):void 0}function Ip(t,e,n,i){var o,r=t[n],a={gradientUnits:r.global?"userSpaceOnUse":"objectBoundingBox"};if(ye(r))o="linearGradient",a.x1=r.x,a.y1=r.y,a.x2=r.x2,a.y2=r.y2;else{if(!ve(r))return;o="radialGradient",a.cx=L(r.x,.5),a.cy=L(r.y,.5),a.r=L(r.r,.5)}for(var s=r.colorStops,l=[],u=0,h=s.length;ul?Wp(t,null==n[c+1]?null:n[c+1].elm,n,s,c):jp(t,e,a,l))}(n,i,o):Fp(o)?(Fp(t.text)&&Bp(n,""),Wp(n,null,o,0,o.length-1)):Fp(i)?jp(n,i,0,i.length-1):Fp(t.text)&&Bp(n,""):t.text!==e.text&&(Fp(i)&&jp(n,i,0,i.length-1),Bp(n,e.text)))}function Yp(t,e,n){var i=af.createCanvas(),o=e.getWidth(),r=e.getHeight(),a=i.style;return a&&(a.position="absolute",a.left="0",a.top="0",a.width=o+"px",a.height=r+"px",i.setAttribute("data-zr-dom-id",t)),i.width=o*n,i.height=r*n,i}function Xp(){xl(!0)&&(function(t){var e=W_.extend(t);W_.registerClass(e)}({type:"leaflet",getLeaflet(){return this.__map},setCenterAndZoom(t,e){this.option.center=t,this.option.zoom=e},centerOrZoomChanged(t,e){const{option:n}=this;return o=n.center,!((i=t)&&o&&i[0]===o[0]&&i[1]===o[1]&&e===n.zoom);var i,o},defaultOption:{mapOptions:{},tiles:[{urlTemplate:"http://{s}.tile.osm.org/{z}/{x}/{y}.png",options:{attribution:'© OpenStreetMap contributors'}}],layerControl:{}}}),function(t){var e=ww.extend(t);ww.registerClass(e)}({type:"leaflet",render(t,e,n){function i(e){if(s)return;const i=l._mapPane;let o=i.style.transform,r=0,a=0;if(o){o=o.replace("translate3d(","");const t=o.split(",");r=-parseInt(t[0],10),a=-parseInt(t[1],10)}else r=-parseInt(i.style.left,10),a=-parseInt(i.style.top,10);const c=[r,a];u.style.left=`${c[0]}px`,u.style.top=`${c[1]}px`,h.setMapOffset(c),t.__mapOffset=c,n.dispatchAction({type:"leafletRoam",animation:{duration:0}})}function o(){s||n.dispatchAction({type:"leafletRoam"})}function r(){i()}function a(){ul(n.getDom()).resize()}let s=!0;const l=t.getLeaflet(),u=n.getZr().painter.getViewportRoot().parentNode,h=t.coordinateSystem,{roam:c}=t.get("mapOptions");c&&"scale"!==c?l.dragging.enable():l.dragging.disable(),c&&"move"!==c?(l.scrollWheelZoom.enable(),l.doubleClickZoom.enable(),l.touchZoom.enable()):(l.scrollWheelZoom.disable(),l.doubleClickZoom.disable(),l.touchZoom.disable()),this._oldMoveHandler&&l.off("move",this._oldMoveHandler),this._oldZoomHandler&&l.off("zoom",this._oldZoomHandler),this._oldZoomEndHandler&&l.off("zoomend",this._oldZoomEndHandler),this._oldResizeHandler&&l.off("resize",this._oldResizeHandler),l.on("move",i),l.on("zoom",r),l.on("zoomend",o),l.on("resize",a),this._oldMoveHandler=i,this._oldZoomHandler=r,this._oldZoomEndHandler=o,this._oldResizeHandler=a,s=!1}}),gl("leaflet",YP()),fl({type:"leafletRoam",event:"leafletRoam",update:"updateLayout"},(t,e)=>{e.eachComponent("leaflet",t=>{const e=t.getLeaflet(),n=e.getCenter();t.setCenterAndZoom([n.lng,n.lat],e.getZoom())})}))}var qp={};t.r(qp),t.d(qp,{Arc:()=>vb,BezierCurve:()=>gb,BoundingRect:()=>lg,Circle:()=>Ew,CompoundPath:()=>xb,Ellipse:()=>Nw,Group:()=>Em,Image:()=>cv,IncrementalDisplayable:()=>Rb,Line:()=>cb,LinearGradient:()=>Sb,OrientedBoundingRect:()=>zb,Path:()=>ov,Point:()=>Gf,Polygon:()=>ob,Polyline:()=>sb,RadialGradient:()=>Tb,Rect:()=>mv,Ring:()=>eb,Sector:()=>Jw,Text:()=>Tv,WH:()=>Vb,XY:()=>Fb,applyTransform:()=>Ga,calcZ2Range:()=>hs,clipPointsByRect:()=>qa,clipRectByRect:()=>Ka,createIcon:()=>$a,ensureCopyRect:()=>ss,ensureCopyTransform:()=>ls,expandOrShrinkRect:()=>es,extendPath:()=>Ea,extendShape:()=>za,getShapeClass:()=>Ba,getTransform:()=>ja,groupTransition:()=>Xa,initProps:()=>La,isBoundingRectAxisAligned:()=>as,isElementRemoved:()=>Pa,lineLineIntersect:()=>Qa,linePolygonIntersect:()=>Ja,makeImage:()=>Fa,makePath:()=>Na,mergePath:()=>Hb,registerShape:()=>Ra,removeElement:()=>Da,removeElementWithFadeOut:()=>Oa,resizePath:()=>Za,retrieveZInfo:()=>us,setTooltipConfig:()=>is,subPixelOptimize:()=>Wb,subPixelOptimizeLine:()=>Ha,subPixelOptimizeRect:()=>Wa,transformDirection:()=>Ua,traverseElements:()=>rs,traverseUpdateZ:()=>cs,updateProps:()=>Ia});var Kp=function(t,e){return Kp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Kp(t,e)},$p=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},Jp=new function(){this.browser=new $p,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(Jp.wxa=!0,Jp.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?Jp.worker=!0:!Jp.hasGlobalWindow||"Deno"in window||"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Node.js")>-1?(Jp.node=!0,Jp.svgSupported=!0):function(t,e){var n=e.browser,i=t.match(/Firefox\/([\d.]+)/),o=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),r=t.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(t);if(i&&(n.firefox=!0,n.version=i[1]),o&&(n.ie=!0,n.version=o[1]),r&&(n.edge=!0,n.version=r[1],n.newEdge=+r[1].split(".")[0]>18),a&&(n.weChat=!0),e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,e.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11),e.domSupported="undefined"!=typeof document){var s=document.documentElement.style;e.transform3dSupported=(n.ie&&"transition"in s||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||n.ie&&+n.version>=9}}(navigator.userAgent,Jp);const Qp=Jp;var tf,ef,nf="sans-serif",of="12px "+nf,rf=function(){var t={};if("undefined"==typeof JSON)return t;for(var e=0;e<95;e++){var n=String.fromCharCode(e+32),i=("007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N".charCodeAt(e)-20)/100;t[n]=i}return t}(),af={createCanvas:function(){return"undefined"!=typeof document&&document.createElement("canvas")},measureText:function(t,e){if(!tf){var n=af.createCanvas();tf=n&&n.getContext("2d")}if(tf)return ef!==e&&(ef=tf.font=e||of),tf.measureText(t);t=t||"";var i=/((?:\d+)?\.?\d*)px/.exec(e=e||of),o=i&&+i[1]||12,r=0;if(e.indexOf("mono")>=0)r=o*t.length;else for(var a=0;a"'])/g,Bf={"&":"&","<":"<",">":">",'"':""","'":"'"},Nf=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ff=[],Vf=Qp.browser.firefox&&+Qp.browser.version.split(".")[0]<39,Zf=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0},Hf=function(){function t(){this._track=[]}return t.prototype.recognize=function(t,e,n){return this._doTrack(t,e,n),this._recognize(t)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(t,e,n){var i=t.touches;if(i){for(var o={points:[],touches:[],target:e,event:t},r=0,a=i.length;r1&&o&&o.length>1){var a=mt(o)/mt(r);!isFinite(a)&&(a=1),e.pinchScale=a;var s=[((i=o)[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2];return e.pinchX=s[0],e.pinchY=s[1],{type:"pinch",target:t[0].target,event:e}}}}},jf=function(){function t(t,e){this.x=t||0,this.y=e||0}return t.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},t.prototype.scale=function(t){this.x*=t,this.y*=t},t.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},t.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},t.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},t.prototype.distanceSquare=function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(t){if(t){var e=this.x,n=this.y;return this.x=t[0]*e+t[2]*n+t[4],this.y=t[1]*e+t[3]*n+t[5],this}},t.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},t.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},t.set=function(t,e,n){t.x=e,t.y=n},t.copy=function(t,e){t.x=e.x,t.y=e.y},t.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},t.lenSquare=function(t){return t.x*t.x+t.y*t.y},t.dot=function(t,e){return t.x*e.x+t.y*e.y},t.add=function(t,e,n){t.x=e.x+n.x,t.y=e.y+n.y},t.sub=function(t,e,n){t.x=e.x-n.x,t.y=e.y-n.y},t.scale=function(t,e,n){t.x=e.x*n,t.y=e.y*n},t.scaleAndAdd=function(t,e,n,i){t.x=e.x+n.x*i,t.y=e.y+n.y*i},t.lerp=function(t,e,n,i){var o=1-i;t.x=o*e.x+i*n.x,t.y=o*e.y+i*n.y},t}();const Gf=jf;var Uf=Math.min,Yf=Math.max,Xf=Math.abs,qf=["x","y"],Kf=["width","height"],$f=new Gf,Jf=new Gf,Qf=new Gf,tg=new Gf,eg=Tt(),ng=eg.minTv,ig=eg.maxTv,og=[0,0],rg=function(){function t(e,n,i,o){t.set(this,e,n,i,o)}return t.set=function(t,e,n,i,o){return i<0&&(e+=i,i=-i),o<0&&(n+=o,o=-o),t.x=e,t.y=n,t.width=i,t.height=o,t},t.prototype.union=function(t){var e=Uf(t.x,this.x),n=Uf(t.y,this.y);this.width=isFinite(this.x)&&isFinite(this.width)?Yf(t.x+t.width,this.x+this.width)-e:t.width,this.height=isFinite(this.y)&&isFinite(this.height)?Yf(t.y+t.height,this.y+this.height)-n:t.height,this.x=e,this.y=n},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(t){var e=this,n=t.width/e.width,i=t.height/e.height,o=[1,0,0,1,0,0];return xt(o,o,[-e.x,-e.y]),function(t,e,n){var i=n[0],o=n[1];t[0]=e[0]*i,t[1]=e[1]*o,t[2]=e[2]*i,t[3]=e[3]*o,t[4]=e[4]*i,t[5]=e[5]*o}(o,o,[n,i]),xt(o,o,[t.x,t.y]),o},t.prototype.intersect=function(e,n,i){return t.intersect(this,e,n,i)},t.intersect=function(e,n,i,o){i&&Gf.set(i,0,0);var r=o&&o.outIntersectRect||null,a=o&&o.clamp;if(r&&(r.x=r.y=r.width=r.height=NaN),!e||!n)return!1;e instanceof t||(e=t.set(ag,e.x,e.y,e.width,e.height)),n instanceof t||(n=t.set(sg,n.x,n.y,n.width,n.height));var s=!!i;eg.reset(o,s);var l=eg.touchThreshold,u=e.x+l,h=e.x+e.width-l,c=e.y+l,d=e.y+e.height-l,p=n.x+l,f=n.x+n.width-l,g=n.y+l,m=n.y+n.height-l;if(u>h||c>d||p>f||g>m)return!1;var y=!(h=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},t.prototype.contain=function(e,n){return t.contain(this,e,n)},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return 0===this.width||0===this.height},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(t,e){return t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t},t.applyTransform=function(e,n,i){if(i){if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var o=i[0],r=i[3],a=i[5];return e.x=n.x*o+i[4],e.y=n.y*r+a,e.width=n.width*o,e.height=n.height*r,e.width<0&&(e.x+=e.width,e.width=-e.width),void(e.height<0&&(e.y+=e.height,e.height=-e.height))}$f.x=Qf.x=n.x,$f.y=tg.y=n.y,Jf.x=tg.x=n.x+n.width,Jf.y=Qf.y=n.y+n.height,$f.transform(i),tg.transform(i),Jf.transform(i),Qf.transform(i),e.x=Uf($f.x,Jf.x,Qf.x,tg.x),e.y=Uf($f.y,Jf.y,Qf.y,tg.y);var s=Yf($f.x,Jf.x,Qf.x,tg.x),l=Yf($f.y,Jf.y,Qf.y,tg.y);e.width=s-e.x,e.height=l-e.y}else e!==n&&t.copy(e,n)},t}(),ag=new rg(0,0,0,0),sg=new rg(0,0,0,0);const lg=rg;var ug="silent",hg=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.handler=null,e}return W(e,t),e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(Af),cg=function(t,e){this.x=t,this.y=e},dg=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],pg=new lg(0,0,0,0),fg=function(t){function e(e,n,i,o,r){var a=t.call(this)||this;return a._hovered=new cg(0,0),a.storage=e,a.painter=n,a.painterRoot=o,a._pointerSize=r,i=i||new hg,a.proxy=null,a.setHandlerProxy(i),a._draggingMgr=new Pf(a),a}return W(e,t),e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(c(dg,function(e){t.on&&t.on(e,this[e],this)},this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var e=t.zrX,n=t.zrY,i=It(this,e,n),o=this._hovered,r=o.target;r&&!r.__zr&&(r=(o=this.findHover(o.x,o.y)).target);var a=this._hovered=i?new cg(e,n):this.findHover(e,n),s=a.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),r&&s!==r&&this.dispatchToElement(o,"mouseout",t),this.dispatchToElement(a,"mousemove",t),s&&s!==r&&this.dispatchToElement(a,"mouseover",t)},e.prototype.mouseout=function(t){var e=t.zrEventControl;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new cg(0,0)},e.prototype.dispatch=function(t,e){var n=this[t];n&&n.call(this,e)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},e.prototype.dispatchToElement=function(t,e,n){var i=(t=t||{}).target;if(!i||!i.silent){for(var o="on"+e,r=function(t,e,n){return{type:t,event:n,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:Mt}}(e,t,n);i&&(i[o]&&(r.cancelBubble=!!i[o].call(i,r)),i.trigger(e,r),i=i.__hostTarget?i.__hostTarget:i.parent,!r.cancelBubble););r.cancelBubble||(this.trigger(e,r),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(t){"function"==typeof t[o]&&t[o].call(t,r),t.trigger&&t.trigger(e,r)}))}},e.prototype.findHover=function(t,e,n){var i=this.storage.getDisplayList(),o=new cg(t,e);if(kt(i,o,t,e,n),this._pointerSize&&!o.target){for(var r=[],a=this._pointerSize,s=a/2,l=new lg(t-s,e-s,a,a),u=i.length-1;u>=0;u--){var h=i[u];h===n||h.ignore||h.ignoreCoarsePointer||h.parent&&h.parent.ignoreCoarsePointer||(pg.copy(h.getBoundingRect()),h.transform&&pg.applyTransform(h.transform),pg.intersect(l)&&r.push(h))}if(r.length)for(var c=Math.PI/12,d=2*Math.PI,p=0;p4)return;this._downPoint=null}this.dispatchToElement(n,t,e)}});const gg=fg;var mg=!1,yg=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Et}return t.prototype.traverse=function(t,e){for(var n=0;n=0&&this._roots.splice(i,1)}},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}();const vg=yg,_g=Qp.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};var xg={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),(t*=2)<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-xg.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*xg.bounceIn(2*t):.5*xg.bounceOut(2*t-1)+.5}};const wg=xg;var bg=Math.pow,Sg=Math.sqrt,Tg=1e-8,Mg=1e-4,Cg=Sg(3),kg=1/3,Ig=j(),Lg=j(),Pg=j(),Dg=/cubic-bezier\(([0-9,\.e ]+)\)/;const Ag=function(){function t(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||H,this.ondestroy=t.ondestroy||H,this.onrestart=t.onrestart||H,t.easing&&this.setEasing(t.easing)}return t.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),!this._paused){var n=this._life,i=t-this._startTime-this._pausedTime,o=i/n;o<0&&(o=0),o=Math.min(o,1);var r=this.easingFunc,a=r?r(o):o;if(this.onframe(a),1===o){if(!this.loop)return!0;this._startTime=t-i%n,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=e},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(t){this.easing=t,this.easingFunc=v(t)?t:wg[t]||qt(t)},t}();var Og=function(t){this.value=t},zg=function(){function t(){this._len=0}return t.prototype.insert=function(t){var e=new Og(t);return this.insertEntry(e),e},t.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++},t.prototype.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),Eg=function(){function t(t){this._list=new zg,this._maxSize=10,this._map={},this._maxSize=t}return t.prototype.put=function(t,e){var n=this._list,i=this._map,o=null;if(null==i[t]){var r=n.len(),a=this._lastRemovedEntry;if(r>=this._maxSize&&r>0){var s=n.head;n.remove(s),delete i[s.key],o=s.value,this._lastRemovedEntry=s}a?a.value=e:a=new Og(e),a.key=t,n.insertEntry(a),i[t]=a}return o},t.prototype.get=function(t){var e=this._map[t],n=this._list;if(null!=e)return e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}();const Rg=Eg;var Bg={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]},Ng=new Rg(20),Fg=null,Vg=new Rg(100),Zg=Math.round,Hg=1e-4,Wg={left:"start",right:"end",center:"middle",middle:"middle"},jg=Qp.hasGlobalWindow&&v(window.btoa)?function(t){return window.btoa(unescape(encodeURIComponent(t)))}:"undefined"!=typeof Buffer?function(t){return Buffer.from(t).toString("base64")}:function(t){return null},Gg=Array.prototype.slice,Ug=[0,0,0,0],Yg=function(){function t(t){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=t}return t.prototype.isFinished=function(){return this._finished},t.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},t.prototype.needsAnimate=function(){return this.keyframes.length>=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(t,e,n){this._needsSort=!0;var i=this.keyframes,o=i.length,r=!1,s=6,l=e;if(h(e)){var u=function(t){return h(t&&t[0])?2:1}(e);s=u,(1===u&&!w(e[0])||2===u&&!w(e[0][0]))&&(r=!0)}else if(w(e)&&!k(e))s=0;else if(_(e))if(isNaN(+e)){var c=oe(e);c&&(l=c,s=3)}else s=0;else if(C(e)){var p=a({},l);p.colorStops=d(e.colorStops,function(t){return{offset:t.offset,color:oe(t.color)}}),ye(e)?s=4:ve(e)&&(s=5),l=p}0===o?this.valType=s:s===this.valType&&6!==s||(r=!0),this.discrete=this.discrete||r;var f={time:t,value:l,rawValue:e,percent:0};return n&&(f.easing=n,f.easingFunc=v(n)?n:wg[n]||qt(n)),i.push(f),f},t.prototype.prepare=function(t,e){var n=this.keyframes;this._needsSort&&n.sort(function(t,e){return t.time-e.time});for(var i=this.valType,o=n.length,r=n[o-1],a=this.discrete,s=Ae(i),l=De(i),u=0;u=0&&!(l[n].percent<=e);n--);n=f(n,u-2)}else{for(n=p;ne);n++);n=f(n-1,u-2)}o=l[n+1],i=l[n]}if(i&&o){this._lastFr=n,this._lastFrP=e;var g=o.percent-i.percent,m=0===g?1:f((e-i.percent)/g,1);o.easingFunc&&(m=o.easingFunc(m));var y=r?this._additiveValue:c?Ug:t[h];if(!Ae(s)&&!c||y||(y=this._additiveValue=[]),this.discrete)t[h]=m<1?i.rawValue:o.rawValue;else if(Ae(s))1===s?Te(y,i[a],o[a],m):function(t,e,n,i){for(var o=e.length,r=o&&e[0].length,a=0;a0&&s.addKeyframe(0,Le(l),i),this._trackKeys.push(a)}s.addKeyframe(t,Le(e[a]),i)}return this._maxTime=Math.max(this._maxTime,t),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,n=0;n0)){this._started=1;for(var e=this,n=[],i=this._maxTime||0,o=0;o1){var a=r.pop();o.addKeyframe(a.time,t[i]),o.prepare(this._maxTime,o.getAdditiveTrack())}}}},t}();const qg=Xg;var Kg=function(t){function e(e){var n=t.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,n.stage=(e=e||{}).stage||{},n}return W(e,t),e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var e=t.getClip();e&&this.addClip(e)},e.prototype.removeClip=function(t){if(t.animation){var e=t.prev,n=t.next;e?e.next=n:this._head=n,n?n.prev=e:this._tail=e,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var e=t.getClip();e&&this.removeClip(e),t.animation=null},e.prototype.update=function(t){for(var e=Oe()-this._pausedTime,n=e-this._time,i=this._head;i;){var o=i.next;i.step(e,n)?(i.ondestroy(),this.removeClip(i),i=o):i=o}this._time=e,t||(this.trigger("frame",n),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0,_g(function e(){t._running&&(_g(e),!t._paused&&t.update())})},e.prototype.start=function(){this._running||(this._time=Oe(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=Oe(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=Oe()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var e=t.next;t.prev=t.next=t.animation=null,t=e}this._head=this._tail=null},e.prototype.isFinished=function(){return null==this._head},e.prototype.animate=function(t,e){e=e||{},this.start();var n=new qg(t,e.loop);return this.addAnimator(n),n},e}(Af);const $g=Kg;var Jg,Qg,tm=Qp.domSupported,em=(Qg={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:Jg=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:d(Jg,function(t){var e=t.replace("mouse","pointer");return Qg.hasOwnProperty(e)?e:t})}),nm=["mousemove","mouseup"],im=["pointermove","pointerup"],om=!1,rm=function(t,e){this.stopPropagation=H,this.stopImmediatePropagation=H,this.preventDefault=H,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY},am={mousedown:function(t){t=dt(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=dt(this.dom,t);var e=this.__mayPointerCapture;!e||t.zrX===e[0]&&t.zrY===e[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=dt(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){Re(this,(t=dt(this.dom,t)).toElement||t.relatedTarget)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){om=!0,t=dt(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){om||(t=dt(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){Ee(t=dt(this.dom,t)),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),am.mousemove.call(this,t),am.mousedown.call(this,t)},touchmove:function(t){Ee(t=dt(this.dom,t)),this.handler.processGesture(t,"change"),am.mousemove.call(this,t)},touchend:function(t){Ee(t=dt(this.dom,t)),this.handler.processGesture(t,"end"),am.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<300&&am.click.call(this,t)},pointerdown:function(t){am.mousedown.call(this,t)},pointermove:function(t){ze(t)||am.mousemove.call(this,t)},pointerup:function(t){am.mouseup.call(this,t)},pointerout:function(t){ze(t)||am.mouseout.call(this,t)}};c(["click","dblclick","contextmenu"],function(t){am[t]=function(e){e=dt(this.dom,e),this.trigger(t,e)}});var sm={pointermove:function(t){ze(t)||sm.mousemove.call(this,t)},pointerup:function(t){sm.mouseup.call(this,t)},mousemove:function(t){this.trigger("mousemove",t)},mouseup:function(t){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",t),e&&(t.zrEventControl="only_globalout",this.trigger("mouseout",t))}},lm=function(t,e){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=t,this.domHandlers=e};const um=function(t){function e(e,n){var i,o,r,a=t.call(this)||this;return a.__pointerCapturing=!1,a.dom=e,a.painterRoot=n,a._localHandlerScope=new lm(e,am),tm&&(a._globalHandlerScope=new lm(document,sm)),i=a,r=(o=a._localHandlerScope).domHandlers,Qp.pointerEventsSupported?c(em.pointer,function(t){Be(o,t,function(e){r[t].call(i,e)})}):(Qp.touchEventsSupported&&c(em.touch,function(t){Be(o,t,function(e){r[t].call(i,e),function(t){t.touching=!0,null!=t.touchTimer&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout(function(){t.touching=!1,t.touchTimer=null},700)}(o)})}),c(em.mouse,function(t){Be(o,t,function(e){e=ct(e),o.touching||r[t].call(i,e)})})),a}return W(e,t),e.prototype.dispose=function(){Ne(this._localHandlerScope),tm&&Ne(this._globalHandlerScope)},e.prototype.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},e.prototype.__togglePointerCapture=function(t){if(this.__mayPointerCapture=null,tm&&+this.__pointerCapturing^+t){this.__pointerCapturing=t;var e=this._globalHandlerScope;t?function(t,e){function n(n){Be(e,n,function(i){i=ct(i),Re(t,i.target)||(i=function(t,e){return dt(t.dom,new rm(t,e),!0)}(t,i),e.domHandlers[n].call(t,i))},{capture:!0})}Qp.pointerEventsSupported?c(im,n):Qp.touchEventsSupported||c(nm,n)}(this,e):Ne(e)}},e}(Af);var hm=1;Qp.hasGlobalWindow&&(hm=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var cm=hm,dm="#333",pm="#ccc",fm=yt,gm=5e-5,mm=[],ym=[],vm=[1,0,0,1,0,0],_m=Math.abs,xm=function(){function t(){}var e;return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},t.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},t.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},t.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},t.prototype.needLocalTransform=function(){return Fe(this.rotation)||Fe(this.x)||Fe(this.y)||Fe(this.scaleX-1)||Fe(this.scaleY-1)||Fe(this.skewX)||Fe(this.skewY)},t.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),n=this.transform;e||t?(n=n||[1,0,0,1,0,0],e?this.getLocalTransform(n):fm(n),t&&(e?_t(n,t,n):vt(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)):n&&(fm(n),this.invTransform=null)},t.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(null!=e&&1!==e){this.getGlobalScale(mm);var n=mm[0]<0?-1:1,i=mm[1]<0?-1:1,o=((mm[0]-n)*e+n)/mm[0]||0,r=((mm[1]-i)*e+i)/mm[1]||0;t[0]*=o,t[1]*=o,t[2]*=r,t[3]*=r}this.invTransform=this.invTransform||[1,0,0,1,0,0],bt(this.invTransform,t)},t.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},t.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],n=t[2]*t[2]+t[3]*t[3],i=Math.atan2(t[1],t[0]),o=Math.PI/2+i-Math.atan2(t[3],t[2]);n=Math.sqrt(n)*Math.cos(o),e=Math.sqrt(e),this.skewX=o,this.skewY=0,this.rotation=-i,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||[1,0,0,1,0,0],_t(ym,t.invTransform,e),e=ym);var n=this.originX,i=this.originY;(n||i)&&(vm[4]=n,vm[5]=i,_t(ym,e,vm),ym[4]-=n,ym[5]-=i,e=ym),this.setLocalTransform(e)}},t.prototype.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},t.prototype.transformCoordToLocal=function(t,e){var n=[t,e],i=this.invTransform;return i&&et(n,n,i),n},t.prototype.transformCoordToGlobal=function(t,e){var n=[t,e],i=this.transform;return i&&et(n,n,i),n},t.prototype.getLineScale=function(){var t=this.transform;return t&&_m(t[0]-1)>1e-10&&_m(t[3]-1)>1e-10?Math.sqrt(_m(t[0]*t[3]-t[2]*t[1])):1},t.prototype.copyTransform=function(t){Ve(this,t)},t.getLocalTransform=function(t,e){e=e||[];var n=t.originX||0,i=t.originY||0,o=t.scaleX,r=t.scaleY,a=t.anchorX,s=t.anchorY,l=t.rotation||0,u=t.x,h=t.y,c=t.skewX?Math.tan(t.skewX):0,d=t.skewY?Math.tan(-t.skewY):0;if(n||i||a||s){var p=n+a,f=i+s;e[4]=-p*o-c*f*r,e[5]=-f*r-d*p*o}else e[4]=e[5]=0;return e[0]=o,e[3]=r,e[1]=d*o,e[2]=c*r,l&&wt(e,e,l),e[4]+=n+u,e[5]+=i+h,e},t.initDefaultProps=((e=t.prototype).scaleX=e.scaleY=e.globalScaleRatio=1,void(e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0)),t}(),wm=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];const bm=xm;var Sm,Tm=0,Mm=5,Cm="__zr_normal__",km=wm.concat(["ignore"]),Im=p(wm,function(t,e){return t[e]=!0,t},{ignore:!1}),Lm={},Pm=new lg(0,0,0,0),Dm=[],Am=function(){function t(t){this.id=n(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return t.prototype._init=function(t){this.attr(t)},t.prototype.drift=function(t,e,n){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=e,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,o=e.innerTransformable,r=void 0,a=void 0,s=!1;o.parent=i?this:null;var l=!1;o.copyTransform(e);var u=null!=n.position,h=n.autoOverflowArea,c=void 0;if((h||u)&&((c=Pm).copy(n.layoutRect?n.layoutRect:this.getBoundingRect()),i||c.applyTransform(this.transform)),u){this.calculateTextPosition?this.calculateTextPosition(Lm,n,c):Ke(Lm,n,c),o.x=Lm.x,o.y=Lm.y,r=Lm.align,a=Lm.verticalAlign;var d=n.origin;if(d&&null!=n.rotation){var p=void 0,f=void 0;"center"===d?(p=.5*c.width,f=.5*c.height):(p=qe(d[0],c.width),f=qe(d[1],c.height)),l=!0,o.originX=-o.x+p+(i?0:c.x),o.originY=-o.y+f+(i?0:c.y)}}null!=n.rotation&&(o.rotation=n.rotation);var g=n.offset;g&&(o.x+=g[0],o.y+=g[1],l||(o.originX=-g[0],o.originY=-g[1]));var m=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(h){var y=m.overflowRect=m.overflowRect||new lg(0,0,0,0);o.getLocalTransform(Dm),bt(Dm,Dm),lg.copy(y,c),y.applyTransform(Dm)}else m.overflowRect=null;var v=void 0,_=void 0,x=void 0;(null==n.inside?"string"==typeof n.position&&n.position.indexOf("inside")>=0:n.inside)&&this.canBeInsideText()?(_=n.insideStroke,null!=(v=n.insideFill)&&"auto"!==v||(v=this.getInsideTextFill()),null!=_&&"auto"!==_||(_=this.getInsideTextStroke(v),x=!0)):(_=n.outsideStroke,null!=(v=n.outsideFill)&&"auto"!==v||(v=this.getOutsideFill()),null!=_&&"auto"!==_||(_=this.getOutsideStroke(v),x=!0)),(v=v||"#000")===m.fill&&_===m.stroke&&x===m.autoStroke&&r===m.align&&a===m.verticalAlign||(s=!0,m.fill=v,m.stroke=_,m.autoStroke=x,m.align=r,m.verticalAlign=a,e.setDefaultTextStyle(m)),e.__dirty|=1,s&&e.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(t){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?pm:dm},t.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),n="string"==typeof e&&oe(e);n||(n=[255,255,255,1]);for(var i=n[3],o=this.__zr.isDarkMode(),r=0;r<3;r++)n[r]=n[r]*i+(o?0:255)*(1-i);return n[3]=1,le(n,"rgba")},t.prototype.traverse=function(t,e){},t.prototype.attrKV=function(t,e){"textConfig"===t?this.setTextConfig(e):"textContent"===t?this.setTextContent(e):"clipPath"===t?this.setClipPath(e):"extra"===t?(this.extra=this.extra||{},a(this.extra,e)):this[t]=e},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(b(t))for(var n=g(t),i=0;i0},t.prototype.getState=function(t){return this.states[t]},t.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},t.prototype.clearStates=function(t){this.useState(Cm,!1,t)},t.prototype.useState=function(t,e,n,o){var r=t===Cm;if(this.hasState()||!r){var a=this.currentStates,s=this.stateTransition;if(!(l(a,t)>=0)||!e&&1!==a.length){var u;if(this.stateProxy&&!r&&(u=this.stateProxy(t)),u||(u=this.states&&this.states[t]),u||r){r||this.saveCurrentToNormalState(u);var h=!!(u&&u.hoverLayer||o);h&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,u,this._normalState,e,!n&&!this.__inHover&&s&&s.duration>0,s);var c=this._textContent,d=this._textGuide;return c&&c.useState(t,e,n,h),d&&d.useState(t,e,n,h),r?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),u}i("State "+t+" not exists.")}}},t.prototype.useStates=function(t,e,n){if(t.length){var i=[],o=this.currentStates,r=t.length,a=r===o.length;if(a)for(var s=0;s0,p);var f=this._textContent,g=this._textGuide;f&&f.useStates(t,e,c),g&&g.useStates(t,e,c),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}else this.clearStates()},t.prototype.isSilent=function(){for(var t=this;t;){if(t.silent)return!0;var e=t.__hostTarget;t=e?t.ignoreHostSilent?null:e:t.parent}return!1},t.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var n=this.currentStates.slice();n.splice(e,1),this.useStates(n)}},t.prototype.replaceState=function(t,e,n){var i=this.currentStates.slice(),o=l(i,t),r=l(i,e)>=0;o>=0?r?i.splice(o,1):i[o]=e:n&&!r&&i.push(e),this.useStates(i)},t.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},t.prototype._mergeStates=function(t){for(var e,n={},i=0;i=0&&e.splice(n,1)}),this.animators.push(t),n&&n.animation.addAnimator(t),n&&n.wakeUp()},t.prototype.updateDuringAnimation=function(t){this.markRedraw()},t.prototype.stopAnimation=function(t,e){for(var n=this.animators,i=n.length,o=[],r=0;r=0&&(n.splice(i,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,e){var n=l(this._children,t);return n>=0&&this.replaceAt(e,n),this},e.prototype.replaceAt=function(t,e){var n=this._children,i=n[e];if(t&&t!==this&&t.parent!==this&&t!==i){n[e]=t,i.parent=null;var o=this.__zr;o&&i.removeSelfFromZr(o),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__zr;e&&e!==t.__zr&&t.addSelfToZr(e),e&&e.refresh()},e.prototype.remove=function(t){var e=this.__zr,n=this._children,i=l(n,t);return i<0||(n.splice(i,1),t.parent=null,e&&t.removeSelfFromZr(e),e&&e.refresh()),this},e.prototype.removeAll=function(){for(var t=this._children,e=this.__zr,n=0;n0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},t.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover())},t.prototype.resize=function(t){this._disposed||(this.painter.resize((t=t||{}).width,t.height),this.handler.resize())},t.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},t.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},t.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},t.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},t.prototype.findHover=function(t,e){if(!this._disposed)return this.handler.findHover(t,e)},t.prototype.on=function(t,e,n){return this._disposed||this.handler.on(t,e,n),this},t.prototype.off=function(t,e){this._disposed||this.handler.off(t,e)},t.prototype.trigger=function(t,e){this._disposed||this.handler.trigger(t,e)},t.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),e=0;e0?t.length:0,this.item=null,this.key=NaN,this},t.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)}}(),"___EC__COMPONENT__CONTAINER___"),Qm="___EC__EXTENDED_CLASS___",ty=Math.round(10*Math.random()),ey=Vn([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),ny=function(){function t(){}return t.prototype.getAreaStyle=function(t,e){return ey(this,t,e)},t}(),iy=new Rg(50),oy=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,ry=function(){},ay=function(t){this.tokens=[],t&&(this.tokens=t)},sy=function(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1},ly=p(",&?/;] ".split(""),function(t,e){return t[e]=!0,t},{}),uy=new lg(0,0,0,0),hy={outIntersectRect:{},clamp:!0},cy="__zr_style_"+Math.round(10*Math.random()),dy={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},py={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};dy[cy]=!0;var fy=["z","z2","invisible"],gy=["invisible"],my=function(t){function e(e){return t.call(this,e)||this}var n;return W(e,t),e.prototype._init=function(e){for(var n=g(e),i=0;i0&&(this._ux=Zy(n/cm/t)||0,this._uy=Zy(n/cm/e)||0)},t.prototype.setDPR=function(t){this.dpr=t},t.prototype.setContext=function(t){this._ctx=t},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(Py.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},t.prototype.lineTo=function(t,e){var n=Zy(t-this._xi),i=Zy(e-this._yi),o=n>this._ux||i>this._uy;if(this.addData(Py.L,t,e),this._ctx&&o&&this._ctx.lineTo(t,e),o)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var r=n*n+i*i;r>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=r)}return this},t.prototype.bezierCurveTo=function(t,e,n,i,o,r){return this._drawPendingPt(),this.addData(Py.C,t,e,n,i,o,r),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,o,r),this._xi=o,this._yi=r,this},t.prototype.quadraticCurveTo=function(t,e,n,i){return this._drawPendingPt(),this.addData(Py.Q,t,e,n,i),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this._xi=n,this._yi=i,this},t.prototype.arc=function(t,e,n,i,o,r){return this._drawPendingPt(),Gy[0]=i,Gy[1]=o,function(t,e){var n=ai(t[0]);n<0&&(n+=Wy);var i=t[1];i+=n-t[0],!e&&i-n>=Wy?i=n+Wy:e&&n-i>=Wy?i=n-Wy:!e&&n>i?i=n+(Wy-ai(n-i)):e&&n0&&r))for(var a=0;au.length&&(this._expandData(),u=this.data);for(var h=0;h0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e11&&(this.data=new Float32Array(t)))}},t.prototype.getBoundingRect=function(){Oy[0]=Oy[1]=Ey[0]=Ey[1]=Number.MAX_VALUE,zy[0]=zy[1]=Ry[0]=Ry[1]=-Number.MAX_VALUE;var t,e=this.data,n=0,i=0,o=0,r=0;for(t=0;tn||Zy(m)>i||c===e-1)&&(f=Math.sqrt(L*L+m*m),o=g,r=_);break;case Py.C:var y=t[c++],v=t[c++],_=(g=t[c++],t[c++]),x=t[c++],w=t[c++];f=Wt(o,r,y,v,g,_,x,w,10),o=x,r=w;break;case Py.Q:f=Xt(o,r,y=t[c++],v=t[c++],g=t[c++],_=t[c++],10),o=g,r=_;break;case Py.A:var b=t[c++],S=t[c++],T=t[c++],M=t[c++],C=t[c++],k=t[c++],I=k+C;c+=1,p&&(a=Fy(C)*T+b,s=Vy(C)*M+S),f=Ny(T,M)*By(Wy,Math.abs(k)),o=Fy(I)*T+b,r=Vy(I)*M+S;break;case Py.R:a=o=t[c++],s=r=t[c++],f=2*t[c++]+2*t[c++];break;case Py.Z:var L=a-o;m=s-r,f=Math.sqrt(L*L+m*m),o=a,r=s}f>=0&&(l[h++]=f,u+=f)}return this._pathLen=u,u},t.prototype.rebuildPath=function(t,e){var n,i,o,r,a,s,l,u,h,c,d=this.data,p=this._ux,f=this._uy,g=this._len,m=e<1,y=0,v=0,_=0;if(!m||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=e*this._pathLen))t:for(var x=0;x0&&(t.lineTo(h,c),_=0),w){case Py.M:n=o=d[x++],i=r=d[x++],t.moveTo(o,r);break;case Py.L:a=d[x++],s=d[x++];var S=Zy(a-o),T=Zy(s-r);if(S>p||T>f){if(m){if(y+(Y=l[v++])>u){t.lineTo(o*(1-(X=(u-y)/Y))+a*X,r*(1-X)+s*X);break t}y+=Y}t.lineTo(a,s),o=a,r=s,_=0}else{var M=S*S+T*T;M>_&&(h=a,c=s,_=M)}break;case Py.C:var C=d[x++],k=d[x++],I=d[x++],L=d[x++],P=d[x++],D=d[x++];if(m){if(y+(Y=l[v++])>u){Ht(o,C,I,P,X=(u-y)/Y,Dy),Ht(r,k,L,D,X,Ay),t.bezierCurveTo(Dy[1],Ay[1],Dy[2],Ay[2],Dy[3],Ay[3]);break t}y+=Y}t.bezierCurveTo(C,k,I,L,P,D),o=P,r=D;break;case Py.Q:if(C=d[x++],k=d[x++],I=d[x++],L=d[x++],m){if(y+(Y=l[v++])>u){Yt(o,C,I,X=(u-y)/Y,Dy),Yt(r,k,L,X,Ay),t.quadraticCurveTo(Dy[1],Ay[1],Dy[2],Ay[2]);break t}y+=Y}t.quadraticCurveTo(C,k,I,L),o=I,r=L;break;case Py.A:var A=d[x++],O=d[x++],z=d[x++],E=d[x++],R=d[x++],B=d[x++],N=d[x++],F=!d[x++],V=z>E?z:E,Z=Zy(z-E)>.001,H=R+B,W=!1;if(m&&(y+(Y=l[v++])>u&&(H=R+B*(u-y)/Y,W=!0),y+=Y),Z&&t.ellipse?t.ellipse(A,O,z,E,N,R,H,F):t.arc(A,O,V,R,H,F),W)break t;b&&(n=Fy(R)*z+A,i=Vy(R)*E+O),o=Fy(H)*z+A,r=Vy(H)*E+O;break;case Py.R:n=o=d[x],i=r=d[x+1],a=d[x++],s=d[x++];var j=d[x++],G=d[x++];if(m){if(y+(Y=l[v++])>u){var U=u-y;t.moveTo(a,s),t.lineTo(a+By(U,j),s),(U-=j)>0&&t.lineTo(a+j,s+By(U,G)),(U-=G)>0&&t.lineTo(a+Ny(j-U,0),s+G),(U-=j)>0&&t.lineTo(a,s+Ny(G-U,0));break t}y+=Y}t.rect(a,s,j,G);break;case Py.Z:if(m){var Y;if(y+(Y=l[v++])>u){var X;t.lineTo(o*(1-(X=(u-y)/Y))+n*X,r*(1-X)+i*X);break t}y+=Y}t.closePath(),o=n,r=i}}},t.prototype.clone=function(){var e=new t,n=this.data;return e.data=n.slice?n.slice():Array.prototype.slice.call(n),e._len=this._len,e},t.prototype.canSave=function(){return!!this._saveData},t.CMD=Py,t.initDefaultProps=((e=t.prototype)._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,void(e._version=0)),t}();const Yy=Uy;var Xy=2*Math.PI,qy=2*Math.PI,Ky=Yy.CMD,$y=2*Math.PI,Jy=[-1,-1,-1],Qy=[-1,-1],tv=s({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},dy),ev={style:s({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},py.style)},nv=wm.concat(["invisible","culling","z","z2","zlevel","parent"]),iv=function(t){function e(e){return t.call(this,e)||this}var n;return W(e,t),e.prototype.update=function(){var n=this;t.prototype.update.call(this);var i=this.style;if(i.decal){var o=this._decalEl=this._decalEl||new e;o.buildPath===e.prototype.buildPath&&(o.buildPath=function(t){n.buildPath(t,n.shape)}),o.silent=!0;var r=o.style;for(var a in i)r[a]!==i[a]&&(r[a]=i[a]);r.fill=i.fill?i.decal:null,r.decal=null,r.shadowColor=null,i.strokeFirst&&(r.stroke=null);for(var s=0;s.5?dm:e>.2?"#eee":pm}if(t)return pm}return dm},e.prototype.getInsideTextStroke=function(t){var e=this.style.fill;if(_(e)){var n=this.__zr;if(!(!n||!n.isDarkMode())==ue(t,0)<.4)return e}},e.prototype.buildPath=function(t,e,n){},e.prototype.pathUpdated=function(){this.__dirty&=-5},e.prototype.getUpdatedPathProxy=function(t){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,t),this.path},e.prototype.createPathProxy=function(){this.path=new Yy(!1)},e.prototype.hasStroke=function(){var t=this.style,e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))},e.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},e.prototype.getBoundingRect=function(){var t=this._rect,e=this.style,n=!t;if(n){var i=!1;this.path||(i=!0,this.createPathProxy());var o=this.path;(i||4&this.__dirty)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),t=o.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var r=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||n){r.copy(t);var a=e.strokeNoScale?this.getLineScale():1,s=e.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;s=Math.max(s,null==l?4:l)}a>1e-10&&(r.width+=s/a,r.height+=s/a,r.x-=s/a/2,r.y-=s/a/2)}return r}return t},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect(),o=this.style;if(i.contain(t=n[0],e=n[1])){var r=this.path;if(this.hasStroke()){var a=o.lineWidth,s=o.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),function(t,e,n,i){return yi(t,e,!0,n,i)}(r,a/s,t,e)))return!0}if(this.hasFill())return function(t,e,n){return yi(t,0,!1,e,n)}(r,t,e)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():"shape"===t?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(e,n){"shape"===e?this.setShape(n):t.prototype.attrKV.call(this,e,n)},e.prototype.setShape=function(t,e){var n=this.shape;return n||(n=this.shape={}),"string"==typeof t?n[t]=e:a(n,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(4&this.__dirty)},e.prototype.createStyle=function(t){return F(tv,t)},e.prototype._innerSaveToNormal=function(e){t.prototype._innerSaveToNormal.call(this,e);var n=this._normalState;e.shape&&!n.shape&&(n.shape=a({},this.shape))},e.prototype._applyStateObj=function(e,n,i,o,r,s){t.prototype._applyStateObj.call(this,e,n,i,o,r,s);var l,u=!(n&&o);if(n&&n.shape?r?o?l=n.shape:(l=a({},i.shape),a(l,n.shape)):(l=a({},o?this.shape:i.shape),a(l,n.shape)):u&&(l=i.shape),l)if(r){this.shape=a({},this.shape);for(var h={},c=g(l),d=0;du&&(n*=u/(a=n+i),i*=u/a),o+r>u&&(o*=u/(a=o+r),r*=u/a),i+o>h&&(i*=h/(a=i+o),o*=h/a),n+r>h&&(n*=h/(a=n+r),r*=h/a),t.moveTo(s+n,l),t.lineTo(s+u-i,l),0!==i&&t.arc(s+u-i,l+i,i,-Math.PI/2,0),t.lineTo(s+u,l+h-o),0!==o&&t.arc(s+u-o,l+h-o,o,0,Math.PI/2),t.lineTo(s+r,l+h),0!==r&&t.arc(s+r,l+h-r,r,Math.PI/2,Math.PI),t.lineTo(s,l+n),0!==n&&t.arc(s+n,l+n,n,Math.PI,1.5*Math.PI)}(t,e):t.rect(n,i,o,r)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(ov);gv.prototype.type="rect";const mv=gv;var yv={fill:"#000"},vv={},_v={style:s({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},py.style)},xv=function(t){function e(e){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=yv,n.attr(e),n}return W(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var e=0;ey&&p){var _=Math.floor(y/d);f=f||m.length>_,v=(m=m.slice(0,_)).length*d}if(o&&h&&null!=g)for(var x=Un(g,u,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),w={},b=0;b0,M=0;Mm&&qn(a,s.substring(m,y),e,g),qn(a,p[2],e,g,p[1]),m=oy.lastIndex}md){var R=a.lines.length;I>0?(M.tokens=M.tokens.slice(0,I),r(M,k,C),a.lines=a.lines.slice(0,T+1)):a.lines=a.lines.slice(0,T),a.isTruncated=a.isTruncated||a.lines.length=0&&"right"===(k=_[C]).align;)this._placeToken(k,t,w,f,M,"right",m),b-=k.width,M-=k.width,C--;for(T+=(s-(T-p)-(g-M)-b)/2;S<=C;)this._placeToken(k=_[S],t,w,f,T+k.width/2,"center",m),T+=k.width,S++;f+=w}},e.prototype._placeToken=function(t,e,n,i,o,r,a){var s=e.rich[t.styleName]||{};s.text=t.text;var l=t.verticalAlign,u=i+n/2;"top"===l?u=i+t.height/2:"bottom"===l&&(u=i+n-t.height/2),!t.isLineHolder&&Li(s)&&this._renderBackground(s,e,"right"===r?o-t.width:"center"===r?o-t.width/2:o,u-t.height/2,t.width,t.height);var h=!!s.backgroundColor,c=t.textPadding;c&&(o=ki(o,r,c),u-=t.height/2-c[0]-t.innerHeight/2);var d=this._getOrCreateChild(sv),p=d.createStyle();d.useStyle(p);var f=this._defaultStyle,g=!1,m=0,y=!1,v=Ci("fill"in s?s.fill:"fill"in e?e.fill:(g=!0,f.fill)),_=Mi("stroke"in s?s.stroke:"stroke"in e?e.stroke:h||a||f.autoStroke&&!g?null:(m=2,y=!0,f.stroke)),x=s.textShadowBlur>0||e.textShadowBlur>0;p.text=t.text,p.x=o,p.y=u,x&&(p.shadowBlur=s.textShadowBlur||e.textShadowBlur||0,p.shadowColor=s.textShadowColor||e.textShadowColor||"transparent",p.shadowOffsetX=s.textShadowOffsetX||e.textShadowOffsetX||0,p.shadowOffsetY=s.textShadowOffsetY||e.textShadowOffsetY||0),p.textAlign=r,p.textBaseline="middle",p.font=t.font||of,p.opacity=P(s.opacity,e.opacity,1),bi(p,s),_&&(p.lineWidth=P(s.lineWidth,e.lineWidth,m),p.lineDash=L(s.lineDash,e.lineDash),p.lineDashOffset=e.lineDashOffset||0,p.stroke=_),v&&(p.fill=v),d.setBoundingRect(ti(p,t.contentWidth,t.contentHeight,y?0:null))},e.prototype._renderBackground=function(t,e,n,i,o,r){var a,s,l,u=t.backgroundColor,h=t.borderWidth,c=t.borderColor,d=u&&u.image,p=u&&!d,f=t.borderRadius,g=this;if(p||t.lineHeight||h&&c){(a=this._getOrCreateChild(mv)).useStyle(a.createStyle()),a.style.fill=null;var m=a.shape;m.x=n,m.y=i,m.width=o,m.height=r,m.r=f,a.dirtyShape()}if(p)(l=a.style).fill=u||null,l.fillOpacity=L(t.fillOpacity,1);else if(d){(s=this._getOrCreateChild(cv)).onload=function(){g.dirtyStyle()};var y=s.style;y.image=u.image,y.x=n,y.y=i,y.width=o,y.height=r}h&&c&&((l=a.style).lineWidth=h,l.stroke=c,l.strokeOpacity=L(t.strokeOpacity,1),l.lineDash=t.borderDash,l.lineDashOffset=t.borderDashOffset||0,a.strokeContainThreshold=0,a.hasFill()&&a.hasStroke()&&(l.strokeFirst=!0,l.lineWidth*=2));var v=(a||s).style;v.shadowBlur=t.shadowBlur||0,v.shadowColor=t.shadowColor||"transparent",v.shadowOffsetX=t.shadowOffsetX||0,v.shadowOffsetY=t.shadowOffsetY||0,v.opacity=P(t.opacity,e.opacity,1)},e.makeFont=function(t){var e="";return Si(t)&&(e=[t.fontStyle,t.fontWeight,wi(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),e&&z(e)||t.textFont||t.font},e}(_y),wv={left:!0,right:1,center:1},bv={top:1,bottom:1,middle:1},Sv=["fontStyle","fontWeight","fontSize","fontFamily"];const Tv=xv;var Mv=Ln(),Cv=1,kv={},Iv=Ln(),Lv=Ln(),Pv=["emphasis","blur","select"],Dv=["normal","emphasis","blur","select"],Av="highlight",Ov="downplay",zv="select",Ev="unselect",Rv="toggleSelect",Bv="selectchanged",Nv={},Fv=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],Vv=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],Zv=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],Hv=Ln(),Wv={minMargin:1,textMargin:2},jv=["textStyle","color"],Gv=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],Uv=new Tv;const Yv=function(){function t(){}return t.prototype.getTextColor=function(t){var e=this.ecModel;return this.getShallow("color")||(!t&&e?e.get(jv):null)},t.prototype.getFont=function(){return go({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},t.prototype.getTextRect=function(t){for(var e={text:t,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},n=0;n-1?r_:s_;yo(a_,{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:". "}}}}),yo(r_,{time:{month:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"],monthAbbr:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],dayOfWeek:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],dayOfWeekAbbr:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"]},legend:{selector:{all:"\u5168\u9009",inverse:"\u53cd\u9009"}},toolbox:{brush:{title:{rect:"\u77e9\u5f62\u9009\u62e9",polygon:"\u5708\u9009",lineX:"\u6a2a\u5411\u9009\u62e9",lineY:"\u7eb5\u5411\u9009\u62e9",keep:"\u4fdd\u6301\u9009\u62e9",clear:"\u6e05\u9664\u9009\u62e9"}},dataView:{title:"\u6570\u636e\u89c6\u56fe",lang:["\u6570\u636e\u89c6\u56fe","\u5173\u95ed","\u5237\u65b0"]},dataZoom:{title:{zoom:"\u533a\u57df\u7f29\u653e",back:"\u533a\u57df\u7f29\u653e\u8fd8\u539f"}},magicType:{title:{line:"\u5207\u6362\u4e3a\u6298\u7ebf\u56fe",bar:"\u5207\u6362\u4e3a\u67f1\u72b6\u56fe",stack:"\u5207\u6362\u4e3a\u5806\u53e0",tiled:"\u5207\u6362\u4e3a\u5e73\u94fa"}},restore:{title:"\u8fd8\u539f"},saveAsImage:{title:"\u4fdd\u5b58\u4e3a\u56fe\u7247",lang:["\u53f3\u952e\u53e6\u5b58\u4e3a\u56fe\u7247"]}},series:{typeNames:{pie:"\u997c\u56fe",bar:"\u67f1\u72b6\u56fe",line:"\u6298\u7ebf\u56fe",scatter:"\u6563\u70b9\u56fe",effectScatter:"\u6d9f\u6f2a\u6563\u70b9\u56fe",radar:"\u96f7\u8fbe\u56fe",tree:"\u6811\u56fe",treemap:"\u77e9\u5f62\u6811\u56fe",boxplot:"\u7bb1\u578b\u56fe",candlestick:"K\u7ebf\u56fe",k:"K\u7ebf\u56fe",heatmap:"\u70ed\u529b\u56fe",map:"\u5730\u56fe",parallel:"\u5e73\u884c\u5750\u6807\u56fe",lines:"\u7ebf\u56fe",graph:"\u5173\u7cfb\u56fe",sankey:"\u6851\u57fa\u56fe",funnel:"\u6f0f\u6597\u56fe",gauge:"\u4eea\u8868\u76d8\u56fe",pictorialBar:"\u8c61\u5f62\u67f1\u56fe",themeRiver:"\u4e3b\u9898\u6cb3\u6d41\u56fe",sunburst:"\u65ed\u65e5\u56fe",custom:"\u81ea\u5b9a\u4e49\u56fe\u8868",chart:"\u56fe\u8868"}},aria:{general:{withTitle:"\u8fd9\u662f\u4e00\u4e2a\u5173\u4e8e\u201c{title}\u201d\u7684\u56fe\u8868\u3002",withoutTitle:"\u8fd9\u662f\u4e00\u4e2a\u56fe\u8868\uff0c"},series:{single:{prefix:"",withName:"\u56fe\u8868\u7c7b\u578b\u662f{seriesType}\uff0c\u8868\u793a{seriesName}\u3002",withoutName:"\u56fe\u8868\u7c7b\u578b\u662f{seriesType}\u3002"},multiple:{prefix:"\u5b83\u7531{seriesCount}\u4e2a\u56fe\u8868\u7cfb\u5217\u7ec4\u6210\u3002",withName:"\u7b2c{seriesId}\u4e2a\u7cfb\u5217\u662f\u4e00\u4e2a\u8868\u793a{seriesName}\u7684{seriesType}\uff0c",withoutName:"\u7b2c{seriesId}\u4e2a\u7cfb\u5217\u662f\u4e00\u4e2a{seriesType}\uff0c",separator:{middle:"\uff1b",end:"\u3002"}}},data:{allData:"\u5176\u6570\u636e\u662f\u2014\u2014",partialData:"\u5176\u4e2d\uff0c\u524d{displayCnt}\u9879\u662f\u2014\u2014",withName:"{name}\u7684\u6570\u636e\u662f{value}",withoutName:"{value}",separator:{middle:"\uff0c",end:""}}}});var c_=null,d_=1e3,p_=6e4,f_=36e5,g_=864e5,m_=31536e6,y_={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})/},v_={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},__="{yyyy}-{MM}-{dd}",x_={year:"{yyyy}",month:"{yyyy}-{MM}",day:__,hour:__+" "+v_.hour,minute:__+" "+v_.minute,second:__+" "+v_.second,millisecond:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},w_=["year","month","day","hour","minute","second","millisecond"],b_=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"],S_=A,T_=["a","b","c","d","e","f","g"],M_=function(t,e){return"{"+t+(null==e?"":e)+"}"},C_={},k_={},I_=function(){function t(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return t.prototype.create=function(t,e){function n(n,i){var o=[];return c(n,function(n,i){var r=n.create(t,e);o=o.concat(r||[])}),o}this._nonSeriesBoxMasterList=n(C_),this._normalMasterList=n(k_)},t.prototype.update=function(t,e){c(this._normalMasterList,function(n){n.update&&n.update(t,e)})},t.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},t.register=function(t,e){"matrix"!==t&&"calendar"!==t?k_[t]=e:C_[t]=e},t.get=function(t){return k_[t]||C_[t]},t}(),L_=1,P_=2,D_=B(),A_=0,O_=1,z_=2;const E_=I_;var R_=c,B_=["left","right","top","bottom","width","height"],N_=[["width","left","right"],["height","top","bottom"]],F_=Uo,V_=(m(Uo,"vertical"),m(Uo,"horizontal"),{rect:1,point:2}),Z_=Ln(),H_=function(t){function n(e,n,i){var o=t.call(this,e,n,i)||this;return o.uid=mo("ec_cpt_model"),o}var i;return e(n,t),n.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n)},n.prototype.mergeDefaultAndTheme=function(t,e){var n=Ko(this),i=n?Jo(t):{};r(t,e.getTheme().get(this.mainType)),r(t,this.getDefaultOption()),n&&$o(t,i,n)},n.prototype.mergeOption=function(t,e){r(this.option,t,!0);var n=Ko(this);n&&$o(this.option,t,n)},n.prototype.optionUpdated=function(t,e){},n.prototype.getDefaultOption=function(){var t=this.constructor;if(!function(t){return!(!t||!t[Qm])}(t))return t.defaultOption;var e=Z_(this);if(!e.defaultOption){for(var n=[],i=t;i;){var o=i.prototype.defaultOption;o&&n.push(o),i=i.superClass}for(var a={},s=n.length-1;s>=0;s--)a=r(a,n[s],!0);e.defaultOption=a}return e.defaultOption},n.prototype.getReferringComponents=function(t,e){var n=t+"Id";return An(this.ecModel,t,{index:this.get(t+"Index",!0),id:this.get(n,!0)},e)},n.prototype.getBoxLayoutParams=function(){return{left:(t=this).getShallow("left",e=!1),top:t.getShallow("top",e),right:t.getShallow("right",e),bottom:t.getShallow("bottom",e),width:t.getShallow("width",e),height:t.getShallow("height",e)};var t,e},n.prototype.getZLevelKey=function(){return""},n.prototype.setZLevel=function(t){this.option.zlevel=t},n.protoInitialize=((i=n.prototype).type="component",i.id="",i.name="",i.mainType="",i.subType="",void(i.componentIndex=0)),n}(i_);Rn(H_,i_),Fn(H_),function(t){var e={};t.registerSubTypeDefaulter=function(t,n){var i=zn(t);e[i.main]=n},t.determineSubType=function(n,i){var o=i.type;if(!o){var r=zn(n).main;t.hasSubTypes(n)&&e[r]&&(o=e[r](i))}return o}}(H_),function(t){function e(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}t.topologicalTravel=function(t,n,i,o){function r(t){u[t].entryCount--,0===u[t].entryCount&&h.push(t)}function a(t){p[t]=!0,r(t)}if(t.length){var s=function(t){var n={},i=[];return c(t,function(o){var r,a,s=e(n,o),u=function(t,e){var n=[];return c(t,function(t){l(e,t)>=0&&n.push(t)}),n}(s.originalDeps=(a=[],c(H_.getClassesByMainType(r=o),function(t){a=a.concat(t.dependencies||t.prototype.dependencies||[])}),a=d(a,function(t){return zn(t).main}),"dataset"!==r&&l(a,"dataset")<=0&&a.unshift("dataset"),a),t);s.entryCount=u.length,0===s.entryCount&&i.push(o),c(u,function(t){l(s.predecessor,t)<0&&s.predecessor.push(t);var i=e(n,t);l(i.successor,t)<0&&i.successor.push(o)})}),{graph:n,noEntryList:i}}(n),u=s.graph,h=s.noEntryList,p={};for(c(t,function(t){p[t]=!0});h.length;){var f=h.pop(),g=u[f],m=!!p[f];m&&(i.call(o,f,g.originalDeps.slice()),delete p[f]),c(g.successor,m?a:r)}c(p,function(){throw new Error("")})}}}(H_);const W_=H_;var j_={color:{},darkColor:{},size:{}},G_=j_.color={theme:["#5070dd","#b6d634","#505372","#ff994d","#0ca8df","#ffd10a","#fb628b","#785db0","#3fbe95"],neutral00:"#fff",neutral05:"#f4f7fd",neutral10:"#e8ebf0",neutral15:"#dbdee4",neutral20:"#cfd2d7",neutral25:"#c3c5cb",neutral30:"#b7b9be",neutral35:"#aaacb2",neutral40:"#9ea0a5",neutral45:"#929399",neutral50:"#86878c",neutral55:"#797b7f",neutral60:"#6d6e73",neutral65:"#616266",neutral70:"#54555a",neutral75:"#48494d",neutral80:"#3c3c41",neutral85:"#303034",neutral90:"#232328",neutral95:"#17171b",neutral99:"#000",accent05:"#eff1f9",accent10:"#e0e4f2",accent15:"#d0d6ec",accent20:"#c0c9e6",accent25:"#b1bbdf",accent30:"#a1aed9",accent35:"#91a0d3",accent40:"#8292cc",accent45:"#7285c6",accent50:"#6578ba",accent55:"#5c6da9",accent60:"#536298",accent65:"#4a5787",accent70:"#404c76",accent75:"#374165",accent80:"#2e3654",accent85:"#252b43",accent90:"#1b2032",accent95:"#121521",transparent:"rgba(0,0,0,0)",highlight:"rgba(255,231,130,0.8)"};for(var U_ in a(G_,{primary:G_.neutral80,secondary:G_.neutral70,tertiary:G_.neutral60,quaternary:G_.neutral50,disabled:G_.neutral20,border:G_.neutral30,borderTint:G_.neutral20,borderShade:G_.neutral40,background:G_.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:G_.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:G_.neutral70,axisLineTint:G_.neutral40,axisTick:G_.neutral70,axisTickMinor:G_.neutral60,axisLabel:G_.neutral70,axisSplitLine:G_.neutral15,axisMinorSplitLine:G_.neutral05}),G_)if(G_.hasOwnProperty(U_)){var Y_=G_[U_];"theme"===U_?j_.darkColor.theme=G_.theme.slice():"highlight"===U_?j_.darkColor.highlight="rgba(255,231,130,0.4)":j_.darkColor[U_]=0===U_.indexOf("accent")?se(Y_,null,function(t){return.5*t},function(t){return Math.min(1,1.3-t)}):se(Y_,null,function(t){return.9*t},function(t){return 1-Math.pow(t,1.5)})}j_.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};const X_=j_;var q_="";"undefined"!=typeof navigator&&(q_=navigator.platform||"");var K_="rgba(0, 0, 0, 0.2)",$_=X_.color.theme[0],J_=se($_,null,null,.9);const Q_={darkMode:"auto",colorBy:"series",color:X_.color.theme,gradientColor:[J_,$_],aria:{decal:{decals:[{color:K_,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:K_,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:K_,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:K_,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:K_,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:K_,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:q_.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 tx,ex,nx,ix=B(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),ox="original",rx="arrayRows",ax="objectRows",sx="keyedColumns",lx="typedArray",ux="unknown",hx="column",cx="row",dx=1,px=2,fx=3,gx=Ln(),mx=B(),yx=Ln(),vx=(Ln(),function(){function t(){}return t.prototype.getColorFromPalette=function(t,e,n){var i=vn(this.get("color",!0)),o=this.get("colorLayer",!0);return function(t,e,n,i,o,r,a){var s=e(r=r||t),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(o))return u[o];var h=null!=a&&i?function(t,e){for(var n=t.length,i=0;ie)return t[i];return t[n-1]}(i,a):n;if((h=h||n)&&h.length){var c=h[l];return o&&(u[o]=c),s.paletteIdx=(l+1)%h.length,c}}(this,yx,i,o,t,e,n)},t.prototype.clearColorPalette=function(){!function(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}(this,yx)},t}()),_x="\0_ec_inner",xx=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.init=function(t,e,n,i,o,r){i=i||{},this.option=null,this._theme=new i_(i),this._locale=new i_(o),this._optionManager=r},n.prototype.setOption=function(t,e,n){var i=rr(e);this._optionManager.setOption(t,n,i),this._resetOption(null,i)},n.prototype.resetOption=function(t,e){return this._resetOption(t,rr(e))},n.prototype._resetOption=function(t,e){var n=!1,i=this._optionManager;if(!t||"recreate"===t){var o=i.mountOption("recreate"===t);this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(o,e)):nx(this,o),n=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var r=i.getTimelineOption(this);r&&(n=!0,this._mergeOption(r,e))}if(!t||"recreate"===t||"media"===t){var a=i.getMediaOption(this);a.length&&c(a,function(t){n=!0,this._mergeOption(t,e)},this)}return n},n.prototype.mergeOption=function(t){this._mergeOption(t,null)},n.prototype._mergeOption=function(t,e){var n=this.option,i=this._componentsMap,s=this._componentsCount,l=[],u=B(),h=e&&e.replaceMergeMainTypeMap;gx(this).datasetMap=B(),c(t,function(t,e){null!=t&&(W_.hasClass(e)?e&&(l.push(e),u.set(e,!0)):n[e]=null==n[e]?o(t):r(n[e],t,!0))}),h&&h.each(function(t,e){W_.hasClass(e)&&!u.get(e)&&(l.push(e),u.set(e,!0))}),W_.topologicalTravel(l,W_.getAllClassMainTypes(),function(e){var o=function(t,e,n){var i=mx.get(e);if(!i)return n;var o=i(t);return o?n.concat(o):n}(this,e,vn(t[e])),r=i.get(e),l=bn(r,o,r?h&&h.get(e)?"replaceMerge":"normalMerge":"replaceAll");!function(t,e,n){c(t,function(t){var i=t.newOption;b(i)&&(t.keyInfo.mainType=e,t.keyInfo.subType=function(t,e,n,i){return e.type?e.type:n?n.subType:i.determineSubType(t,e)}(e,i,t.existing,n))})}(l,e,W_),n[e]=null,i.set(e,null),s.set(e,0);var u,d=[],p=[],f=0;c(l,function(t,n){var i=t.existing,o=t.newOption;if(o){var r=W_.getClass(e,t.keyInfo.subType,!("series"===e));if(!r)return;if("tooltip"===e){if(u)return;u=!0}if(i&&i.constructor===r)i.name=t.keyInfo.name,i.mergeOption(o,this),i.optionUpdated(o,!1);else{var s=a({componentIndex:n},t.keyInfo);a(i=new r(o,this,this,s),s),t.brandNew&&(i.__requireNewView=!0),i.init(o,this,this),i.optionUpdated(null,!0)}}else i&&(i.mergeOption({},this),i.optionUpdated({},!1));i?(d.push(i.option),p.push(i),f++):(d.push(void 0),p.push(void 0))},this),n[e]=d,i.set(e,p),s.set(e,f),"series"===e&&tx(this)},this),this._seriesIndices||tx(this)},n.prototype.getOption=function(){var t=o(this.option);return c(t,function(e,n){if(W_.hasClass(n)){for(var i=vn(e),o=i.length,r=!1,a=o-1;a>=0;a--)i[a]&&!kn(i[a])?r=!0:(i[a]=null,!r&&o--);i.length=o,t[n]=i}}),delete t[_x],t},n.prototype.setTheme=function(t){this._theme=new i_(t),this._resetOption("recreate",null)},n.prototype.getTheme=function(){return this._theme},n.prototype.getLocaleModel=function(){return this._locale},n.prototype.setUpdatePayload=function(t){this._payload=t},n.prototype.getUpdatePayload=function(){return this._payload},n.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){var i=n[e||0];if(i)return i;if(null==e)for(var o=0;ou&&(u=p)}s[0]=l,s[1]=u}},o=function(){return this._data?this._data.length/this._dimSize:0};(e={})[rx+"_"+hx]={pure:!0,appendData:t},e[rx+"_"+cx]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[ax]={pure:!0,appendData:t},e[sx]={pure:!0,appendData:function(t){var e=this._data;c(t,function(t,n){for(var i=e[n]||(e[n]=[]),o=0;o<(t||[]).length;o++)i.push(t[o])})}},e[ox]={appendData:t},e[lx]={persistent:!1,pure:!0,appendData:function(t){this._data=t},clean:function(){this._offset+=this.count(),this._data=null}},Ax=e}(),t}(),Gx=function(t){y(t)||kr("series.data or dataset.source must be an array.")},Ux=((Ix={})[rx+"_"+hx]=Gx,Ix[rx+"_"+cx]=Gx,Ix[ax]=Gx,Ix[sx]=function(t,e){for(var n=0;n=0&&(s=r.interpolatedValue[l])}return null!=s?s+"":""}):void 0},t.prototype.getRawValue=function(t,e){return Or(this.getData(e),t)},t.prototype.formatTooltip=function(t,e,n){},t}(),tw=function(){function t(t){this._reset=(t=t||{}).reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return t.prototype.perform=function(t){function e(t){return!(t>=1)&&(t=1),t}var n,i=this._upstream,o=t&&t.skip;if(this._dirty&&i){var r=this.context;r.data=r.outputData=i.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!o&&(n=this._plan(this.context));var a,s=e(this._modBy),l=this._modDataCount||0,u=e(t&&t.modBy),h=t&&t.modDataCount||0;s===u&&l===h||(n="reset"),(this._dirty||"reset"===n)&&(this._dirty=!1,a=this._doReset(o)),this._modBy=u,this._modDataCount=h;var c=t&&t.step;if(this._dueEnd=i?i._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,p=Math.min(null!=c?this._dueIndex+c:1/0,this._dueEnd);if(!o&&(a||d=n?null:t1&&r>0?e:t}};return s}(),nw=(B({number:function(t){return parseFloat(t)},time:function(t){return+cn(t)},trim:function(t){return _(t)?z(t):t}}),function(){function t(t,e){var n="desc"===t;this._resultLT=n?1:-1,null==e&&(e=n?"min":"max"),this._incomparable="min"===e?-1/0:1/0}return t.prototype.evaluate=function(t,e){var n=w(t)?t:fn(t),i=w(e)?e:fn(e),o=isNaN(n),r=isNaN(i);if(o&&(n=this._incomparable),r&&(i=this._incomparable),o&&r){var a=_(t),s=_(e);a&&(n=s?t:0),s&&(i=a?e:0)}return ni?-this._resultLT:0},t}()),iw=function(){function t(){}return t.prototype.getRawData=function(){throw new Error("not supported")},t.prototype.getRawDataItem=function(t){throw new Error("not supported")},t.prototype.cloneRawData=function(){},t.prototype.getDimensionInfo=function(t){},t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},t.prototype.retrieveValue=function(t,e){},t.prototype.retrieveValueFromItem=function(t,e){},t.prototype.convertValue=function(t,e){return Rr(t,e)},t}(),ow=B(),rw="undefined",aw=typeof Uint32Array===rw?Array:Uint32Array,sw=typeof Uint16Array===rw?Array:Uint16Array,lw=typeof Int32Array===rw?Array:Int32Array,uw=typeof Float64Array===rw?Array:Float64Array,hw={float:uw,int:lw,ordinal:Array,number:Array,time:uw},cw=function(){function t(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=B()}return t.prototype.initData=function(t,e,n){this._provider=t,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var i=t.getSource(),o=this.defaultDimValueGetter=zx[i.sourceFormat];this._dimValueGetter=n||o,this._rawExtent=[],Cr(i),this._dimensions=d(e,function(t){return{type:t.type,property:t.property}}),this._initDataFromProvider(0,t.count())},t.prototype.getProvider=function(){return this._provider},t.prototype.getSource=function(){return this._provider.getSource()},t.prototype.ensureCalculationDimension=function(t,e){var n=this._calcDimNameToIdx,i=this._dimensions,o=n.get(t);if(null!=o){if(i[o].type===e)return o}else o=i.length;return i[o]={type:e},n.set(t,o),this._chunks[o]=new hw[e||"float"](this._rawCount),this._rawExtent[o]=[1/0,-1/0],o},t.prototype.collectOrdinalMeta=function(t,e){var n=this._chunks[t],i=this._dimensions[t],o=this._rawExtent,r=i.ordinalOffset||0,a=n.length;0===r&&(o[t]=[1/0,-1/0]);for(var s=o[t],l=r;lf[1]&&(f[1]=p)}return this._rawCount=this._count=s,{start:a,end:s}},t.prototype._initDataFromProvider=function(t,e,n){for(var i=this._provider,o=this._chunks,r=this._dimensions,a=r.length,s=this._rawExtent,l=d(r,function(t){return t.property}),u=0;uy[1]&&(y[1]=m)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=e,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(t,e){if(!(e>=0&&e=0&&e=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&nt))return r;o=r-1}}return-1},t.prototype.getIndices=function(){var t,e=this._indices;if(e){var n=this._count;if((o=e.constructor)===Array){t=new o(n);for(var i=0;i=u&&T<=h||isNaN(T))&&(a[s++]=p),p++;d=!0}else if(2===o){f=c[i[0]];var y=c[i[1]],v=t[i[1]][0],_=t[i[1]][1];for(m=0;m=u&&T<=h||isNaN(T))&&(x>=v&&x<=_||isNaN(x))&&(a[s++]=p),p++}d=!0}}if(!d)if(1===o)for(m=0;m=u&&T<=h||isNaN(T))&&(a[s++]=w)}else for(m=0;mt[M][1])&&(b=!1)}b&&(a[s++]=e.getRawIndex(m))}return sm[1]&&(m[1]=g)}}},t.prototype.lttbDownSample=function(t,e){var n,i,o,r=this.clone([t],!0),a=r._chunks[t],s=this.count(),l=0,u=Math.floor(1/e),h=this.getRawIndex(0),c=new(Wr(this._rawCount))(Math.min(2*(Math.ceil(s/u)+2),s));c[l++]=h;for(var d=1;dn&&(n=i,o=M)}T>0&&Ta&&(f=a-u);for(var g=0;gp&&(p=m,d=u+g)}var y=this.getRawIndex(h),v=this.getRawIndex(d);hu-p&&(a.length=s=u-p);for(var f=0;fh[1]&&(h[1]=m),c[d++]=y}return o._count=d,o._indices=c,o._updateGetRawIdx(),o},t.prototype.each=function(t,e){if(this._count)for(var n=t.length,i=this._chunks,o=0,r=this.count();oa&&(a=l)}return this._extent[t]=i=[r,a],i},t.prototype.getRawDataItem=function(t){var e=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(e);for(var n=[],i=this._chunks,o=0;o=0?this._indices[t]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=function(){function t(t,e,n,i){return Rr(t[i],this._dimensions[i])}zx={arrayRows:t,objectRows:function(t,e,n,i){return Rr(t[e],this._dimensions[i])},keyedColumns:t,original:function(t,e,n,i){var o=t&&(null==t.value?t:t.value);return Rr(o instanceof Array?o[i]:o,this._dimensions[i])},typedArray:function(t,e,n,i){return t[i]}}}(),t}();const dw=cw;var pw=function(){function t(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(t,e){this._sourceList=t,this._upstreamSignList=e,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var t,e,n=this._sourceHost,i=this._getUpstreamSourceManagers(),o=!!i.length;if(Yr(n)){var r=n,a=void 0,s=void 0,l=void 0;if(o){var u=i[0];u.prepareSource(),a=(l=u.getSource()).data,s=l.sourceFormat,e=[u._getVersionSign()]}else s=T(a=r.get("data",!0))?lx:ox,e=[];var h=this._getSourceMetaRawOption()||{},c=l&&l.metaRawOption||{},d=L(h.seriesLayoutBy,c.seriesLayoutBy)||null,p=L(h.sourceHeader,c.sourceHeader),f=L(h.dimensions,c.dimensions);t=d!==c.seriesLayoutBy||!!p!=!!c.sourceHeader||f?[wr(a,{seriesLayoutBy:d,sourceHeader:p,dimensions:f},s)]:[]}else{var g=n;if(o){var m=this._applyTransform(i);t=m.sourceList,e=m.upstreamSignList}else t=[wr(g.get("source",!0),this._getSourceMetaRawOption(),null)],e=[]}this._setLocalSource(t,e)},t.prototype._applyTransform=function(t){var e,n=this._sourceHost,i=n.get("transform",!0),r=n.get("fromTransformResult",!0);null!=r&&1!==t.length&&Xr("");var a,s=[],l=[];return c(t,function(t){t.prepareSource();var e=t.getSource(r||0);null==r||e||Xr(""),s.push(e),l.push(t._getVersionSign())}),i?e=function(t,e){var n=vn(t),i=n.length;i||Ir("");for(var o=0,r=i;o':'':{renderMode:r,content:"{"+(n.markerId||"markerX")+"|} ",style:"subItem"===o?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}:""}({color:e,type:t,renderMode:n,markerId:i});return _(o)?o:(this.richTextStyles[i]=o.style,o.content)},t.prototype.wrapRichTextStyle=function(t,e){var n={};y(e)?c(e,function(t){return a(n,t)}):a(n,e);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},t}(),yw=Ln(),vw=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._selectedDataIndicesMap={},e}var i;return e(n,t),n.prototype.init=function(t,e,n){this.seriesIndex=this.componentIndex,this.dataTask=Er({count:ha,reset:ca}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,n),(yw(this).sourceManager=new pw(this)).prepareSource();var i=this.getInitialData(t,n);pa(i,this),this.dataTask.context.data=i,yw(this).dataBeforeProcessed=i,ua(this),this._initSelectedMapFromData(i)},n.prototype.mergeDefaultAndTheme=function(t,e){var n=Ko(this),i=n?Jo(t):{},o=this.subType;W_.hasClass(o)&&(o+="Series"),r(t,e.getTheme().get(this.subType)),r(t,this.getDefaultOption()),_n(t,"label",["show"]),this.fillDataTextStyle(t.data),n&&$o(t,i,n)},n.prototype.mergeOption=function(t,e){t=r(this.option,t,!0),this.fillDataTextStyle(t.data);var n=Ko(this);n&&$o(this.option,t,n);var i=yw(this).sourceManager;i.dirty(),i.prepareSource();var o=this.getInitialData(t,e);pa(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,yw(this).dataBeforeProcessed=o,ua(this),this._initSelectedMapFromData(o)},n.prototype.fillDataTextStyle=function(t){if(t&&!T(t))for(var e=["show"],n=0;n=0&&h<0)&&(u=r,h=o,c=0),o===h&&(l[c++]=e))}),l.length=c,l},n.prototype.formatTooltip=function(t,e,n){return sa({series:this,dataIndex:t,multipleSeries:e})},n.prototype.isAnimationEnabled=function(){var t=this.ecModel;if(Qp.node&&(!t||!t.ssr))return!1;var e=this.getShallow("animation");return e&&this.getData().count()>this.getShallow("animationThreshold")&&(e=!1),!!e},n.prototype.restoreData=function(){this.dataTask.dirty()},n.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel,o=vx.prototype.getColorFromPalette.call(this,t,e,n);return o||(o=i.getColorFromPalette(t,e,n)),o},n.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},n.prototype.getProgressive=function(){return this.get("progressive")},n.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},n.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},n.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n){var i=this.option.selectedMode,o=this.getData(e);if("series"===i||"all"===n)return this.option.selectedMap={},void(this._selectedDataIndicesMap={});for(var r=0;r=0&&n.push(o)}return n},n.prototype.isSelected=function(t,e){var n=this.option.selectedMap;if(!n)return!1;var i=this.getData(e);return("all"===n||n[la(i,t)])&&!i.getItemModel(t).get(["select","disabled"])},n.prototype.isUniversalTransitionEnabled=function(){if(this.__universalTransitionEnabled)return!0;var t=this.option.universalTransition;return!!t&&(!0===t||t&&t.enabled)},n.prototype._innerSelect=function(t,e){var n,i,o=this.option,r=o.selectedMode,a=e.length;if(r&&a)if("series"===r)o.selectedMap="all";else if("multiple"===r){b(o.selectedMap)||(o.selectedMap={});for(var s=o.selectedMap,l=0;l0&&this._innerSelect(t,e)}},n.registerClass=function(t){return W_.registerClass(t)},n.protoInitialize=((i=n.prototype).type="series.__base__",i.seriesIndex=0,i.ignoreStyleOnData=!1,i.hasSymbolVisual=!1,i.defaultSymbol="circle",i.visualStyleAccessPath="itemStyle",void(i.visualDrawType="fill")),n}(W_);u(vw,Qx),u(vw,vx),Rn(vw,W_);const _w=vw;var xw=function(){function t(){this.group=new Em,this.uid=mo("viewComponent")}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,i){},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,i){},t.prototype.updateLayout=function(t,e,n,i){},t.prototype.updateVisual=function(t,e,n,i){},t.prototype.toggleBlurSeries=function(t,e,n){},t.prototype.eachRendered=function(t){var e=this.group;e&&e.traverse(t)},t}();En(xw),Fn(xw);const ww=xw;var bw=Yy.CMD,Sw=[[],[],[]],Tw=Math.sqrt,Mw=Math.atan2,Cw=Math.sqrt,kw=Math.sin,Iw=Math.cos,Lw=Math.PI,Pw=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Dw=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g,Aw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return W(e,t),e.prototype.applyTransform=function(t){},e}(ov),Ow=function(){this.cx=0,this.cy=0,this.r=0},zw=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new Ow},e.prototype.buildPath=function(t,e){t.moveTo(e.cx+e.r,e.cy),t.arc(e.cx,e.cy,e.r,0,2*Math.PI)},e}(ov);zw.prototype.type="circle";const Ew=zw;var Rw=function(){this.cx=0,this.cy=0,this.rx=0,this.ry=0},Bw=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new Rw},e.prototype.buildPath=function(t,e){var n=.5522848,i=e.cx,o=e.cy,r=e.rx,a=e.ry,s=r*n,l=a*n;t.moveTo(i-r,o),t.bezierCurveTo(i-r,o-l,i-s,o-a,i,o-a),t.bezierCurveTo(i+s,o-a,i+r,o-l,i+r,o),t.bezierCurveTo(i+r,o+l,i+s,o+a,i,o+a),t.bezierCurveTo(i-s,o+a,i-r,o+l,i-r,o),t.closePath()},e}(ov);Bw.prototype.type="ellipse";const Nw=Bw;var Fw=Math.PI,Vw=2*Fw,Zw=Math.sin,Hw=Math.cos,Ww=Math.acos,jw=Math.atan2,Gw=Math.abs,Uw=Math.sqrt,Yw=Math.max,Xw=Math.min,qw=1e-4,Kw=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0},$w=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new Kw},e.prototype.buildPath=function(t,e){!function(t,e){var n,i=Yw(e.r,0),o=Yw(e.r0||0,0),r=i>0;if(r||o>0){if(r||(i=o,o=0),o>i){var a=i;i=o,o=a}var s=e.startAngle,l=e.endAngle;if(!isNaN(s)&&!isNaN(l)){var u=e.cx,h=e.cy,c=!!e.clockwise,d=Gw(l-s),p=d>Vw&&d%Vw;if(p>qw&&(d=p),i>qw)if(d>Vw-qw)t.moveTo(u+i*Hw(s),h+i*Zw(s)),t.arc(u,h,i,s,l,!c),o>qw&&(t.moveTo(u+o*Hw(l),h+o*Zw(l)),t.arc(u,h,o,l,s,c));else{var f=void 0,g=void 0,m=void 0,v=void 0,_=void 0,x=void 0,w=void 0,b=void 0,S=void 0,T=void 0,M=void 0,C=void 0,k=void 0,I=void 0,L=void 0,P=void 0,D=i*Hw(s),A=i*Zw(s),O=o*Hw(l),z=o*Zw(l),E=d>qw;if(E){var R=e.cornerRadius;R&&(n=function(t){var e;if(y(t)){var n=t.length;if(!n)return t;e=1===n?[t[0],t[0],0,0]:2===n?[t[0],t[0],t[1],t[1]]:3===n?t.concat(t[2]):t}else e=[t,t,t,t];return e}(R),f=n[0],g=n[1],m=n[2],v=n[3]);var B=Gw(i-o)/2;if(_=Xw(B,m),x=Xw(B,v),w=Xw(B,f),b=Xw(B,g),M=S=Yw(_,x),C=T=Yw(w,b),(S>qw||T>qw)&&(k=i*Hw(l),I=i*Zw(l),L=o*Hw(s),P=o*Zw(s),dqw){var G=Xw(m,M),U=Xw(v,M),Y=Sa(L,P,D,A,i,G,c),X=Sa(k,I,O,z,i,U,c);t.moveTo(u+Y.cx+Y.x0,h+Y.cy+Y.y0),M0&&t.arc(u+Y.cx,h+Y.cy,G,jw(Y.y0,Y.x0),jw(Y.y1,Y.x1),!c),t.arc(u,h,i,jw(Y.cy+Y.y1,Y.cx+Y.x1),jw(X.cy+X.y1,X.cx+X.x1),!c),U>0&&t.arc(u+X.cx,h+X.cy,U,jw(X.y1,X.x1),jw(X.y0,X.x0),!c))}else t.moveTo(u+D,h+A),t.arc(u,h,i,s,l,!c);else t.moveTo(u+D,h+A);o>qw&&E?C>qw?(G=Xw(f,C),Y=Sa(O,z,k,I,o,-(U=Xw(g,C)),c),X=Sa(D,A,L,P,o,-G,c),t.lineTo(u+Y.cx+Y.x0,h+Y.cy+Y.y0),C0&&t.arc(u+Y.cx,h+Y.cy,U,jw(Y.y0,Y.x0),jw(Y.y1,Y.x1),!c),t.arc(u,h,o,jw(Y.cy+Y.y1,Y.cx+Y.x1),jw(X.cy+X.y1,X.cx+X.x1),c),G>0&&t.arc(u+X.cx,h+X.cy,G,jw(X.y1,X.x1),jw(X.y0,X.x0),!c))):(t.lineTo(u+O,h+z),t.arc(u,h,o,l,s,c)):t.lineTo(u+O,h+z)}else t.moveTo(u,h);t.closePath()}}}(t,e)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(ov);$w.prototype.type="sector";const Jw=$w;var Qw=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},tb=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new Qw},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,o=2*Math.PI;t.moveTo(n+e.r,i),t.arc(n,i,e.r,0,o,!1),t.moveTo(n+e.r0,i),t.arc(n,i,e.r0,0,o,!0)},e}(ov);tb.prototype.type="ring";const eb=tb;var nb=function(){this.points=null,this.smooth=0,this.smoothConstraint=null},ib=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new nb},e.prototype.buildPath=function(t,e){Ta(t,e,!0)},e}(ov);ib.prototype.type="polygon";const ob=ib;var rb=function(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null},ab=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new rb},e.prototype.buildPath=function(t,e){Ta(t,e,!1)},e}(ov);ab.prototype.type="polyline";const sb=ab;var lb={},ub=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},hb=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new ub},e.prototype.buildPath=function(t,e){var n,i,o,r;if(this.subPixelOptimize){var a=vi(lb,e,this.style);n=a.x1,i=a.y1,o=a.x2,r=a.y2}else n=e.x1,i=e.y1,o=e.x2,r=e.y2;var s=e.percent;0!==s&&(t.moveTo(n,i),s<1&&(o=n*(1-s)+o*s,r=i*(1-s)+r*s),t.lineTo(o,r))},e.prototype.pointAt=function(t){var e=this.shape;return[e.x1*(1-t)+e.x2*t,e.y1*(1-t)+e.y2*t]},e}(ov);hb.prototype.type="line";const cb=hb;var db=[],pb=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1},fb=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new pb},e.prototype.buildPath=function(t,e){var n=e.x1,i=e.y1,o=e.x2,r=e.y2,a=e.cpx1,s=e.cpy1,l=e.cpx2,u=e.cpy2,h=e.percent;0!==h&&(t.moveTo(n,i),null==l||null==u?(h<1&&(Yt(n,a,o,h,db),a=db[1],o=db[2],Yt(i,s,r,h,db),s=db[1],r=db[2]),t.quadraticCurveTo(a,s,o,r)):(h<1&&(Ht(n,a,l,o,h,db),a=db[1],l=db[2],o=db[3],Ht(i,s,u,r,h,db),s=db[1],u=db[2],r=db[3]),t.bezierCurveTo(a,s,l,u,o,r)))},e.prototype.pointAt=function(t){return Ma(this.shape,t,!1)},e.prototype.tangentAt=function(t){var e=Ma(this.shape,t,!0);return Q(e,e)},e}(ov);fb.prototype.type="bezier-curve";const gb=fb;var mb=function(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},yb=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new mb},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,o=Math.max(e.r,0),r=e.startAngle,a=e.endAngle,s=e.clockwise,l=Math.cos(r),u=Math.sin(r);t.moveTo(l*o+n,u*o+i),t.arc(n,i,o,r,a,!s)},e}(ov);yb.prototype.type="arc";const vb=yb;var _b=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="compound",e}return W(e,t),e.prototype._updatePathDirty=function(){for(var t=this.shape.paths,e=this.shapeChanged(),n=0;nLb[1]){if(o=!1,Pb.negativeSize||n)return o;var s=kb(Lb[0]-Ib[1]),l=kb(Ib[0]-Lb[1]);Mb(s,l)>Ab.len()&&Gf.scale(Ab,a,s=l||!Pb.bidirectional)&&(Gf.scale(Db,a,-l*i),Pb.useDir&&Pb.calcDirMTV())))}return o},t.prototype._getProjMinMaxOnAxis=function(t,e,n){for(var i=this._axes[t],o=this._origin,r=e[0].dot(i)+o[t],a=r,s=r,l=1;ln.blockIndex?n.step:null,r=i&&i.modDataCount;return{step:o,modBy:null!=r?Math.ceil(r/o):null,modDataCount:r}}},t.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},t.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData().count(),o=n.progressiveEnabled&&e.incrementalPrepareRender&&i>=n.threshold,r=t.get("large")&&i>=t.get("largeThreshold"),a="mod"===t.get("progressiveChunkMode")?i:null;t.pipelineContext=n.context={progressiveRender:o,modDataCount:a,large:r}},t.prototype.restorePipelines=function(t){var e=this,n=e._pipelineMap=B();t.eachSeries(function(t){var i=t.getProgressive(),o=t.uid;n.set(o,{id:o,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:i&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),e._pipe(t,t.dataTask)})},t.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.api.getModel(),n=this.api;c(this._allHandlers,function(i){var o=t.get(i.uid)||t.set(i.uid,{});O(!(i.reset&&i.overallReset),""),i.reset&&this._createSeriesStageTask(i,o,e,n),i.overallReset&&this._createOverallStageTask(i,o,e,n)},this)},t.prototype.prepareView=function(t,e,n,i){var o=t.renderTask,r=o.context;r.model=e,r.ecModel=n,r.api=i,o.__block=!t.incrementalPrepareRender,this._pipe(e,o)},t.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},t.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},t.prototype._performStageTasks=function(t,e,n,i){function o(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}i=i||{};var r=!1,a=this;c(t,function(t,s){if(!i.visualType||i.visualType===t.visualType){var l=a._stageTaskMap.get(t.uid),u=l.seriesTaskMap,h=l.overallTask;if(h){var c,d=h.agentStubMap;d.each(function(t){o(i,t)&&(t.dirty(),c=!0)}),c&&h.dirty(),a.updatePayload(h,n);var p=a.getPerformArgs(h,i.block);d.each(function(t){t.perform(p)}),h.perform(p)&&(r=!0)}else u&&u.each(function(s,l){o(i,s)&&s.dirty();var u=a.getPerformArgs(s,i.block);u.skip=!t.performRawSeries&&e.isSeriesFiltered(s.context.model),a.updatePayload(s,n),s.perform(u)&&(r=!0)})}}),this.unfinished=r||this.unfinished},t.prototype.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e=t.dataTask.perform()||e}),this.unfinished=e||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)})},t.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},t.prototype._createSeriesStageTask=function(t,e,n,i){function o(e){var o=e.uid,l=s.set(o,a&&a.get(o)||Er({plan:Cs,reset:ks,count:Ls}));l.context={model:e,ecModel:n,api:i,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:r},r._pipe(e,l)}var r=this,a=e.seriesTaskMap,s=e.seriesTaskMap=B(),l=t.seriesType,u=t.getTargetSeries;t.createOnAllSeries?n.eachRawSeries(o):l?n.eachRawSeriesByType(l,o):u&&u(n,i).each(o)},t.prototype._createOverallStageTask=function(t,e,n,i){function o(t){var e=t.uid,n=l.set(e,s&&s.get(e)||(p=!0,Er({reset:Ss,onDirty:Ms})));n.context={model:t,overallProgress:d},n.agent=a,n.__block=d,r._pipe(t,n)}var r=this,a=e.overallTask=e.overallTask||Er({reset:bs});a.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:r};var s=a.agentStubMap,l=a.agentStubMap=B(),u=t.seriesType,h=t.getTargetSeries,d=!0,p=!1;O(!t.createOnAllSeries,""),u?n.eachRawSeriesByType(u,o):h?h(n,i).each(o):(d=!1,c(n.getSeries(),o)),p&&a.dirty()},t.prototype._pipe=function(t,e){var n=this._pipelineMap.get(t.uid);!n.head&&(n.head=e),n.tail&&n.tail.pipe(e),n.tail=e,e.__idxInPipeline=n.count++,e.__pipeline=n},t.wrapStageHandler=function(t,e){return v(t)&&(t={overallReset:t,seriesType:Ps(t)}),t.uid=mo("stageHandler"),e&&(t.visualType=e),t},t}(),hS=Is(0),cS={},dS={};Ds(cS,bx),Ds(dS,Tx),cS.eachSeriesByType=cS.eachRawSeriesByType=function(t){$b=t},cS.eachComponent=function(t){"series"===t.mainType&&t.subType&&($b=t.subType)};const pS=uS;var fS,gS=X_.darkColor,mS=function(){return{axisLine:{lineStyle:{color:gS.axisLine}},splitLine:{lineStyle:{color:gS.axisSplitLine}},splitArea:{areaStyle:{color:[gS.backgroundTint,gS.backgroundTransparent]}},minorSplitLine:{lineStyle:{color:gS.axisMinorSplitLine}},axisLabel:{color:gS.axisLabel},axisName:{}}},yS={label:{color:gS.secondary},itemStyle:{borderColor:gS.borderTint},dividerLineStyle:{color:gS.border}},vS={darkMode:!0,color:gS.theme,backgroundColor:gS.background,axisPointer:{lineStyle:{color:gS.border},crossStyle:{color:gS.borderShade},label:{color:gS.tertiary}},legend:{textStyle:{color:gS.secondary},pageTextStyle:{color:gS.tertiary}},textStyle:{color:gS.secondary},title:{textStyle:{color:gS.primary},subtextStyle:{color:gS.quaternary}},toolbox:{iconStyle:{borderColor:gS.accent50}},tooltip:{backgroundColor:gS.neutral20,defaultBorderColor:gS.border,textStyle:{color:gS.tertiary}},dataZoom:{borderColor:gS.accent10,textStyle:{color:gS.tertiary},brushStyle:{color:gS.backgroundTint},handleStyle:{color:gS.neutral00,borderColor:gS.accent20},moveHandleStyle:{color:gS.accent40},emphasis:{handleStyle:{borderColor:gS.accent50}},dataBackground:{lineStyle:{color:gS.accent30},areaStyle:{color:gS.accent20}},selectedDataBackground:{lineStyle:{color:gS.accent50},areaStyle:{color:gS.accent30}}},visualMap:{textStyle:{color:gS.secondary},handleStyle:{borderColor:gS.neutral30}},timeline:{lineStyle:{color:gS.accent10},label:{color:gS.tertiary},controlStyle:{color:gS.accent30,borderColor:gS.accent30}},calendar:{itemStyle:{color:gS.neutral00,borderColor:gS.neutral20},dayLabel:{color:gS.tertiary},monthLabel:{color:gS.secondary},yearLabel:{color:gS.secondary}},matrix:{x:yS,y:yS,backgroundColor:{borderColor:gS.axisLine},body:{itemStyle:{borderColor:gS.borderTint}}},timeAxis:mS(),logAxis:mS(),valueAxis:mS(),categoryAxis:mS(),line:{symbol:"circle"},graph:{color:gS.theme},gauge:{title:{color:gS.secondary},axisLine:{lineStyle:{color:[[1,gS.neutral05]]}},axisLabel:{color:gS.axisLabel},detail:{color:gS.primary}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}},funnel:{itemStyle:{borderColor:gS.background}},radar:(fS=mS(),fS.axisName={color:gS.axisLabel},fS.axisLine.lineStyle.color=gS.neutral20,fS),treemap:{breadcrumb:{itemStyle:{color:gS.neutral20,textStyle:{color:gS.secondary}},emphasis:{itemStyle:{color:gS.neutral30}}}},sunburst:{itemStyle:{borderColor:gS.background}},map:{itemStyle:{borderColor:gS.border,areaColor:gS.neutral10},label:{color:gS.tertiary},emphasis:{label:{color:gS.primary},itemStyle:{areaColor:gS.highlight}},select:{label:{color:gS.primary},itemStyle:{areaColor:gS.highlight}}},geo:{itemStyle:{borderColor:gS.border,areaColor:gS.neutral10},emphasis:{label:{color:gS.primary},itemStyle:{areaColor:gS.highlight}},select:{label:{color:gS.primary},itemStyle:{color:gS.highlight}}}};vS.categoryAxis.splitLine.show=!1;const _S=vS;var xS=function(){function t(){}return t.prototype.normalizeQuery=function(t){var e={},n={},i={};if(_(t)){var o=zn(t);e.mainType=o.main||null,e.subType=o.sub||null}else{var r=["Index","Name","Id"],a={name:1,dataIndex:1,dataType:1};c(t,function(t,o){for(var s=!1,l=0;l0&&h===o.length-u.length){var c=o.slice(0,h);"data"!==c&&(e.mainType=c,e[u.toLowerCase()]=t,s=!0)}}a.hasOwnProperty(o)&&(n[o]=t,s=!0),s||(i[o]=t)})}return{cptQuery:e,dataQuery:n,otherQuery:i}},t.prototype.filter=function(t,e){function n(t,e,n,i){return null==t[n]||e[i||n]===t[n]}var i=this.eventInfo;if(!i)return!0;var o=i.targetEl,r=i.packedEvent,a=i.model,s=i.view;if(!a||!s)return!0;var l=e.cptQuery,u=e.dataQuery;return n(l,a,"mainType")&&n(l,a,"subType")&&n(l,a,"index","componentIndex")&&n(l,a,"name")&&n(l,a,"id")&&n(u,r,"name")&&n(u,r,"dataIndex")&&n(u,r,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(t,e.otherQuery,o,r))},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),wS=["symbol","symbolSize","symbolRotate","symbolOffset"],bS=wS.concat(["symbolKeepAspect"]),SS={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData();if(t.legendIcon&&n.setVisual("legendIcon",t.legendIcon),t.hasSymbolVisual){for(var i={},o={},r=!1,s=0;s0&&t.unfinished);t.unfinished||this._zr.flush()}}},n.prototype.getDom=function(){return this._dom},n.prototype.getId=function(){return this.id},n.prototype.getZr=function(){return this._zr},n.prototype.isSSR=function(){return this._ssr},n.prototype.setOption=function(t,e,n){if(!this[dT])if(this._disposed);else{var i,o,r;if(b(e)&&(n=e.lazyUpdate,i=e.silent,o=e.replaceMerge,r=e.transition,e=e.notMerge),this[dT]=!0,sT(this),!this._model||e){var a=new kx(this._api),s=this._theme,l=this._model=new bx;l.scheduler=this._scheduler,l.ssr=this._ssr,l.init(null,null,null,s,this._locale,a)}this._model.setOption(t,{replaceMerge:o},kT);var u={seriesTransition:r,optionChanged:!0};if(n)this[fT]={silent:i,updateParams:u},this[dT]=!1,this.getZr().wakeUp();else{try{WS(this),US.update.call(this,null,u)}catch(t){throw this[fT]=null,this[dT]=!1,t}this._ssr||this._zr.flush(),this[fT]=null,this[dT]=!1,KS.call(this,i),$S.call(this,i)}}},n.prototype.setTheme=function(t,e){if(!this[dT])if(this._disposed);else{var n=this._model;if(n){var i=e&&e.silent,o=null;this[fT]&&(null==i&&(i=this[fT].silent),o=this[fT].updateParams,this[fT]=null),this[dT]=!0,sT(this);try{this._updateTheme(t),n.setTheme(this._theme),WS(this),US.update.call(this,{type:"setTheme"},o)}catch(t){throw this[dT]=!1,t}this[dT]=!1,KS.call(this,i),$S.call(this,i)}}},n.prototype._updateTheme=function(t){_(t)&&(t=LT[t]),t&&((t=o(t))&&_r(t,!0),this._theme=t)},n.prototype.getModel=function(){return this._model},n.prototype.getOption=function(){return this._model&&this._model.getOption()},n.prototype.getWidth=function(){return this._zr.getWidth()},n.prototype.getHeight=function(){return this._zr.getHeight()},n.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||Qp.hasGlobalWindow&&window.devicePixelRatio||1},n.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},n.prototype.renderToCanvas=function(t){return this._zr.painter.getRenderedCanvas({backgroundColor:(t=t||{}).backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},n.prototype.renderToSVGString=function(t){return this._zr.painter.renderToString({useViewBox:(t=t||{}).useViewBox})},n.prototype.getSvgDataURL=function(){var t=this._zr;return c(t.storage.getDisplayList(),function(t){t.stopAnimation(null,!0)}),t.painter.toDataURL()},n.prototype.getDataURL=function(t){if(!this._disposed){var e=this._model,n=[],i=this;c((t=t||{}).excludeComponents,function(t){e.eachComponent({mainType:t},function(t){var e=i._componentsMap[t.__viewId];e.group.ignore||(n.push(e),e.group.ignore=!0)})});var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return c(n,function(t){t.group.ignore=!1}),o}},n.prototype.getConnectedDataURL=function(t){if(!this._disposed){var e="svg"===t.type,n=this.group,i=Math.min,r=Math.max,a=1/0;if(AT[n]){var s=a,l=a,u=-1/0,h=-1/0,d=[],p=t&&t.pixelRatio||this.getDevicePixelRatio();c(DT,function(a,c){if(a.group===n){var p=e?a.getZr().painter.getSvgDom().innerHTML:a.renderToCanvas(o(t)),f=a.getDom().getBoundingClientRect();s=i(f.left,s),l=i(f.top,l),u=r(f.right,u),h=r(f.bottom,h),d.push({dom:p,left:f.left,top:f.top})}});var f=(u*=p)-(s*=p),g=(h*=p)-(l*=p),m=af.createCanvas(),y=en(m,{renderer:e?"svg":"canvas"});if(y.resize({width:f,height:g}),e){var v="";return c(d,function(t){v+=''+t.dom+""}),y.painter.getSvgRoot().innerHTML=v,t.connectedBackgroundColor&&y.painter.setBackgroundColor(t.connectedBackgroundColor),y.refreshImmediately(),y.painter.toDataURL()}return t.connectedBackgroundColor&&y.add(new mv({shape:{x:0,y:0,width:f,height:g},style:{fill:t.connectedBackgroundColor}})),c(d,function(t){var e=new cv({style:{x:t.left*p-s,y:t.top*p-l,image:t.dom}});y.add(e)}),y.refreshImmediately(),m.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}},n.prototype.convertToPixel=function(t,e,n){return YS(this,"convertToPixel",t,e,n)},n.prototype.convertToLayout=function(t,e,n){return YS(this,"convertToLayout",t,e,n)},n.prototype.convertFromPixel=function(t,e,n){return YS(this,"convertFromPixel",t,e,n)},n.prototype.containPixel=function(t,e){var n;if(!this._disposed)return c(Pn(this._model,t),function(t,i){i.indexOf("Models")>=0&&c(t,function(t){var o=t.coordinateSystem;if(o&&o.containPoint)n=n||!!o.containPoint(e);else if("seriesModels"===i){var r=this._chartsMap[t.__viewId];r&&r.containPoint&&(n=n||r.containPoint(e,t))}},this)},this),!!n},n.prototype.getVisual=function(t,e){var n=Pn(this._model,t,{defaultMainType:"series"}),i=n.seriesModel.getData(),o=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?i.indexOfRawIndex(n.dataIndex):null;return null!=o?function(t,e,n){switch(n){case"color":return t.getItemVisual(e,"style")[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,n)}}(i,o,e):function(t,e){switch(e){case"color":return t.getVisual("style")[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e)}}(i,e)},n.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},n.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},n.prototype._initEvents=function(){var t=this;c(bT,function(e){var n=function(n){var i,o=t.getModel(),r=n.target;if("globalout"===e?i={}:r&&Os(r,function(t){var e=Mv(t);if(e&&null!=e.dataIndex){var n=e.dataModel||o.getSeriesByIndex(e.seriesIndex);return i=n&&n.getDataParams(e.dataIndex,e.dataType,r)||{},!0}if(e.eventData)return i=a({},e.eventData),!0},!0),i){var s=i.componentType,l=i.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=i.seriesIndex);var u=s&&null!=l&&o.getComponent(s,l),h=u&&t["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];i.event=n,i.type=e,t._$eventProcessor.eventInfo={targetEl:r,packedEvent:i,model:u,view:h},t.trigger(e,i)}};n.zrEventfulCallAtLast=!0,t._zr.on(e,n,t)});var e=this._messageCenter;c(MT,function(n,i){e.on(i,function(e){t.trigger(i,e)})}),function(t,e,n){t.on("selectchanged",function(t){var i=n.getModel();t.isFromClick?(As("map","selectchanged",e,i,t),As("pie","selectchanged",e,i,t)):"select"===t.fromAction?(As("map","selected",e,i,t),As("pie","selected",e,i,t)):"unselect"===t.fromAction&&(As("map","unselected",e,i,t),As("pie","unselected",e,i,t))})}(e,this,this._api)},n.prototype.isDisposed=function(){return this._disposed},n.prototype.clear=function(){this._disposed||this.setOption({series:[]},!0)},n.prototype.dispose=function(){if(this._disposed);else{this._disposed=!0,this.getDom()&&On(this.getDom(),zT,"");var t=this,e=t._api,n=t._model;c(t._componentsViews,function(t){t.dispose(n,e)}),c(t._chartsViews,function(t){t.dispose(n,e)}),t._zr.dispose(),t._dom=t._model=t._chartsMap=t._componentsMap=t._chartsViews=t._componentsViews=t._scheduler=t._api=t._zr=t._throttledZrFlush=t._theme=t._coordSysMgr=t._messageCenter=null,delete DT[t.id]}},n.prototype.resize=function(t){if(!this[dT])if(this._disposed);else{this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var n=e.resetOption("media"),i=t&&t.silent;this[fT]&&(null==i&&(i=this[fT].silent),n=!0,this[fT]=null),this[dT]=!0,sT(this);try{n&&WS(this),US.update.call(this,{type:"resize",animation:a({duration:0},t&&t.animation)})}catch(t){throw this[dT]=!1,t}this[dT]=!1,KS.call(this,i),$S.call(this,i)}}},n.prototype.showLoading=function(t,e){if(this._disposed);else if(b(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),PT[t]){var n=PT[t](this._api,e),i=this._zr;this._loadingFX=n,i.add(n)}},n.prototype.hideLoading=function(){this._disposed||(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},n.prototype.makeActionFromEvent=function(t){var e=a({},t);return e.type=TT[t.type],e},n.prototype.dispatchAction=function(t,e){if(this._disposed);else if(b(e)||(e={silent:!!e}),ST[t.type]&&this._model)if(this[dT])this._pendingActions.push(t);else{var n=e.silent;qS.call(this,t,n);var i=e.flush;i?this._zr.flush():!1!==i&&Qp.browser.weChat&&this._throttledZrFlush(),KS.call(this,n),$S.call(this,n)}},n.prototype.updateLabelLayout=function(){HS.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},n.prototype.appendData=function(t){if(this._disposed);else{var e=t.seriesIndex;this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},n.internalField=function(){function t(t){t.clearColorPalette(),t.eachSeries(function(t){t.clearColorPalette()})}function n(t){for(var e=[],n=t.currentStates,i=0;i0?{duration:r,delay:i.get("delay"),easing:i.get("easing")}:null;e.eachRendered(function(t){if(t.states&&t.states.emphasis){if(Pa(t))return;if(t instanceof ov&&function(t){var e=Iv(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var n=t.states.select||{};e.selectFill=n.style&&n.style.fill||null,e.selectStroke=n.style&&n.style.stroke||null}(t),t.__dirty){var e=t.prevStates;e&&t.useStates(e)}if(o){t.stateTransition=a;var i=t.getTextContent(),r=t.getTextGuideLine();i&&(i.stateTransition=a),r&&(r.stateTransition=a)}t.__dirty&&n(t)}})}WS=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),jS(t,!0),jS(t,!1),e.plan()},jS=function(t,e){function n(t){var n=t.__requireNewView;t.__requireNewView=!1;var u="_ec_"+t.id+"_"+t.type,h=!n&&a[u];if(!h){var c=zn(t.type);(h=new(e?ww.getClass(c.main,c.sub):Kb.getClass(c.sub))).init(i,l),a[u]=h,r.push(h),s.add(h.group)}t.__viewId=h.__id=u,h.__alive=!0,h.__model=t,h.group.__ecComponentInfo={mainType:t.mainType,index:t.componentIndex},!e&&o.prepareView(h,t,i,l)}for(var i=t._model,o=t._scheduler,r=e?t._componentsViews:t._chartsViews,a=e?t._componentsMap:t._chartsMap,s=t._zr,l=t._api,u=0;ue.get("hoverLayerThreshold")&&!Qp.node&&!Qp.worker&&e.eachSeries(function(e){if(!e.preventUsingHoverLayer){var n=t._chartsMap[e.__viewId];n.__alive&&n.eachRendered(function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)})}})}(t,e),HS.trigger("series:afterupdate",e,n,l)},rT=function(t){t[gT]=!0,t.getZr().wakeUp()},sT=function(t){t[pT]=(t[pT]+1)%1e3},aT=function(t){t[gT]&&(t.getZr().storage.traverse(function(t){Pa(t)||n(t)}),t[gT]=!1)},iT=function(t){return new(function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return e(i,n),i.prototype.getCoordinateSystems=function(){return t._coordSysMgr.getCoordinateSystems()},i.prototype.getComponentByElement=function(e){for(;e;){var n=e.__ecComponentInfo;if(null!=n)return t._model.getComponent(n.mainType,n.index);e=e.parent}},i.prototype.enterEmphasis=function(e,n){ji(e,n),rT(t)},i.prototype.leaveEmphasis=function(e,n){Gi(e,n),rT(t)},i.prototype.enterBlur=function(e){!function(t){Fi(t,zi)}(e),rT(t)},i.prototype.leaveBlur=function(e){Ui(e),rT(t)},i.prototype.enterSelect=function(e){Yi(e),rT(t)},i.prototype.leaveSelect=function(e){Xi(e),rT(t)},i.prototype.getModel=function(){return t.getModel()},i.prototype.getViewOfComponentModel=function(e){return t.getViewOfComponentModel(e)},i.prototype.getViewOfSeriesModel=function(e){return t.getViewOfSeriesModel(e)},i.prototype.getMainProcessVersion=function(){return t[pT]},i}(Tx))(t)},oT=function(t){function e(t,e){for(var n=0;n0?t[n-1].seriesModel:null)}),function(t){c(t,function(e,n){var i=[],o=[NaN,NaN],r=[e.stackResultDimension,e.stackedOverDimension],a=e.data,s=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";a.modify(r,function(r,u,h){var c,d,p=a.get(e.stackedDimension,h);if(isNaN(p))return o;s?d=a.getRawIndex(h):c=a.get(e.stackedByDimension,h);for(var f=NaN,g=n-1;g>=0;g--){var m=t[g];if(s||(d=m.data.rawIndexOf(m.stackedByDimension,c)),d>=0){var y=m.data.getByRawIndex(m.stackResultDimension,d);if("all"===l||"positive"===l&&y>0||"negative"===l&&y<0||"samesign"===l&&p>=0&&y>0||"samesign"===l&&p<=0&&y<0){p=ln(p,y),f=y;break}}}return i[0]=p,i[1]=f,i})})}(t))})}),vl("default",function(t,e){s(e=e||{},{text:"loading",textColor:X_.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:X_.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Em,i=new mv({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});n.add(i);var o,r=new Tv({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new mv({style:{fill:"none"},textContent:r,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});return n.add(a),e.showSpinner&&((o=new vb({shape:{startAngle:-lS/2,endAngle:-lS/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*lS/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:3*lS/2}).delay(300).start("circularInOut"),n.add(o)),n.resize=function(){var n=r.getBoundingRect().width,s=e.showSpinner?e.spinnerRadius:0,l=(t.getWidth()-2*s-(e.showSpinner&&n?10:0)-n)/2-(e.showSpinner&&n?0:5+n/2)+(e.showSpinner?0:n/2)+(n?0:s),u=t.getHeight()/2;e.showSpinner&&o.setShape({cx:l,cy:u}),a.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),i.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},n.resize(),n}),fl({type:Av,event:Av,update:Av},H),fl({type:Ov,event:Ov,update:Ov},H),fl({type:zv,event:Bv,update:zv,action:H,refineEvent:_l,publishNonRefinedEvent:!0}),fl({type:Ev,event:Bv,update:Ev,action:H,refineEvent:_l,publishNonRefinedEvent:!0}),fl({type:Rv,event:Bv,update:Rv,action:H,refineEvent:_l,publishNonRefinedEvent:!0}),hl("default",{}),hl("dark",_S);const BT={...{metadata:!0,svgRender:!1,switchMode:!1,maxPointsFetched:1e4,loadMoreAtZoomLevel:9,clustering:!1,clusteringThreshold:100,disableClusteringAtLevel:8,clusterRadius:80,clusterSeparation:20,showMetaOnNarrowScreens:!1,showMapLabelsAtZoom:13,showGraphLabelsAtZoom:null,echartsOption:{aria:{show:!0,description:"This is a force-oriented graph chart that depicts the relationship between ip nodes."},toolbox:{show:!0,iconStyle:{borderColor:"#fff"},feature:{restore:{show:!0,title:"Restore view"},saveAsImage:{show:!0,title:"Save image"}}}},graphConfig:{series:{layout:"force",label:{show:!0,color:"#fff",position:"top"},labelLayout:{hideOverlap:!0},force:{gravity:.1,edgeLength:[20,60],repulsion:120},roam:!0,draggable:!0,legendHoverLink:!0,emphasis:{focus:"none",lineStyle:{color:"#3acc38",opacity:1}},nodeStyle:{color:"#ffebc4"},linkStyle:{width:6,color:"#1ba619"},nodeSize:"15"},baseOptions:{backgroundColor:"#282222",media:[{query:{minWidth:320,maxWidth:500},option:{series:[{zoom:.7}],toolbox:{itemSize:18}}},{query:{minWidth:501},option:{series:[{zoom:1}],toolbox:{itemSize:15}}},{query:{minWidth:320,maxWidth:850},option:{tooltip:{show:!1}}},{query:{minWidth:851},option:{tooltip:{show:!0}}}]}},mapOptions:{roam:!0,zoomAnimation:!1,worldCopyJump:!0,minZoom:3,maxZoom:18,nodeConfig:{type:"scatter",label:{show:!1,color:"#000000",position:"top",formatter:"{b}",fontSize:13,backgroundColor:"rgba(255, 255, 255, 0.8)",padding:[6,8],borderRadius:5},emphasis:{scale:1},nodeStyle:{color:"#1566a9"},nodeSize:"17"},linkConfig:{linkStyle:{width:5,color:"#1ba619"},emphasis:{focus:"none",lineStyle:{color:"#3acc38",opacity:1}}},clusterConfig:{symbolSize:30,itemStyle:{color:"#1566a9"},tooltip:{show:!1},label:{show:!0,position:"inside",color:"#fff",offset:[0,0],backgroundColor:"transparent"}},baseOptions:{toolbox:{show:!1},media:[{query:{minWidth:320,maxWidth:850},option:{tooltip:{show:!1}}},{query:{minWidth:851},option:{tooltip:{show:!0}}}]},nodePopup:{show:!1,content:null,config:{autoPan:!0,autoPanPadding:[25,25]}}},mapTileConfig:[{urlTemplate:"MISSING_ENV_VAR".MAPBOX_URL_TEMPLATE||"http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",options:{attribution:'© OpenStreetMap contributors,\n tiles offered by Mapbox'}}],geoOptions:{style:{fillColor:"#1566a9",weight:0,fillOpacity:.8,radius:8}},nodeCategories:[{name:"ok",nodeStyle:{color:"#1ba619"}},{name:"problem",nodeStyle:{color:"#ffa500"}},{name:"critical",nodeStyle:{color:"#c92517"}}],linkCategories:[],bookmarkableActions:{enabled:!1,id:null,zoomOnRestore:!0,zoomLevel:null,preserveFragment:!1},prepareData(t){t&&t.nodes&&t.nodes.forEach(t=>{if(t.properties&&t.properties.status){const e=t.properties.status.toLowerCase();"ok"!==e&&"problem"!==e&&"critical"!==e||(t.category=e)}})},onClickElement(t,e){let n;this.utils&&this.utils.isNetJSON(this.data)?(n="node"===t?this.utils.nodeInfo(e):"link"===t?this.utils.linkInfo(e):e,(this.config.showMetaOnNarrowScreens||this.el.clientWidth>850)&&(this.gui.metaInfoContainer.style.display="flex")):({nodeLinkData:n}={nodeLinkData:e}),this.gui.getNodeLinkInfo(t,n),this.gui.sideBar.classList.remove("hidden")},onReady(){}}};Object.defineProperty(BT,"crs",{get(){const t=xl(!0);return t?t.CRS.EPSG3857:null},enumerable:!0,configurable:!0});const NT=BT,FT=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class VT{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,n]=new Uint8Array(t,0,2);if(219!==e)throw new Error("Data does not appear to be in a KDBush format.");const i=n>>4;if(1!==i)throw new Error(`Got v${i} data when expected v1.`);const o=FT[15&n];if(!o)throw new Error("Unrecognized array type.");const[r]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new VT(a,r,o,t)}constructor(t,e=64,n=Float64Array,i){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=n,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const o=FT.indexOf(this.ArrayType),r=2*t*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-a%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${n}.`);i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+a+s,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+r+a+s),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+a+s,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+o]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=t,this.coords[this._pos++]=e,n}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return wl(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:r,nodeSize:a}=this,s=[0,o.length-1,0],l=[];for(;s.length;){const u=s.pop()||0,h=s.pop()||0,c=s.pop()||0;if(h-c<=a){for(let a=c;a<=h;a++){const s=r[2*a],u=r[2*a+1];s>=t&&s<=n&&u>=e&&u<=i&&l.push(o[a])}continue}const d=c+h>>1,p=r[2*d],f=r[2*d+1];p>=t&&p<=n&&f>=e&&f<=i&&l.push(o[d]),(0===u?t<=p:e<=f)&&(s.push(c),s.push(d-1),s.push(1-u)),(0===u?n>=p:i>=f)&&(s.push(d+1),s.push(h),s.push(1-u))}return l}within(t,e,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:r}=this,a=[0,i.length-1,0],s=[],l=n*n;for(;a.length;){const u=a.pop()||0,h=a.pop()||0,c=a.pop()||0;if(h-c<=r){for(let n=c;n<=h;n++)Ml(o[2*n],o[2*n+1],t,e)<=l&&s.push(i[n]);continue}const d=c+h>>1,p=o[2*d],f=o[2*d+1];Ml(p,f,t,e)<=l&&s.push(i[d]),(0===u?t-n<=p:e-n<=f)&&(a.push(c),a.push(d-1),a.push(1-u)),(0===u?t+n>=p:e+n>=f)&&(a.push(d+1),a.push(h),a.push(1-u))}return s}}const ZT=class{JSONParamParse(t){return"string"==typeof t?fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},credentials:"include"}).then(t=>t).catch(t=>{console.error(t)}):Promise.resolve(t)}async paginatedDataParse(t){let e,n;try{let i=await this.utils.JSONParamParse(t);if(i.json)for(e=await i.json(),n=e.results?e.results:e;e.next&&n.nodes.length<=this.config.maxPointsFetched;)i=await this.utils.JSONParamParse(e.next),e=await i.json(),n.nodes=n.nodes.concat(e.results.nodes),n.links=n.links.concat(e.results.links),this.hasMoreData=!!e.next;else n=i}catch(t){console.error(t)}return n}async getBBoxData(t,e){let n;try{const i=`${t=t[0].split("?")[0]}bbox?swLat=${e._southWest.lat}&swLng=${e._southWest.lng}&neLat=${e._northEast.lat}&neLng=${e._northEast.lng}`,o=await this.utils.JSONParamParse(i);n=await o.json()}catch(t){console.error(t)}return n}dateParse({dateString:t,parseRegular:e=/^([1-9]\d{3})-(\d{1,2})-(\d{1,2})T(\d{1,2}):(\d{1,2}):(\d{1,2})(?:\.(\d{1,3}))?Z$/,hourDiffer:n=(new Date).getTimezoneOffset()/60}){const i=e.exec(t);if(!i||i.length<7)return console.error("Date doesn't meet the specifications."),"";const o=["dateYear","dateMonth","dateDay","dateHour"],r={},a=new Map([["dateMonth",12],["dateDay",[31,i[1]%4==0&&i[1]%100!=0||i[1]%400==0?29:28,31,30,31,30,31,31,30,31,30,31]],["dateHour",24]]);for(let t=o.length;t>0;t-=1)r[o[t-1]]=parseInt(i[t],10);let s,l=-n;for(let t=o.length;t>0;t-=1){if("dateYear"===o[t-1]){r[o[t-1]]+=l;break}s="dateDay"===o[t-1]?a.get("dateDay")[r.dateMonth-1]:a.get(o[t-1]);let e=r[o[t-1]]+l;l="dateHour"===o[t-1]?e<0?-1:e>=s?1:0:e<=0?-1:e>s?1:0,1===l?e-=s:l<0&&("dateDay"===o[t-1]&&(s=a.get("dateDay")[(r[o[t-1]]+10)%11]),e+=s),r[o[t-1]]=e}return`${r.dateYear}.${this.numberMinDigit(r.dateMonth)}.${this.numberMinDigit(r.dateDay)} ${this.numberMinDigit(r.dateHour)}:${this.numberMinDigit(i[5])}:${this.numberMinDigit(i[6])}${i[7]?`.${this.numberMinDigit(i[7],3)}`:""}`}numberMinDigit(t,e=2,n="0"){return(Array(e).join(n)+t).slice(-e)}isObject(t){return"Object"===Object.prototype.toString.call(t).slice(8,14)}isArray(t){return"Array"===Object.prototype.toString.call(t).slice(8,13)}isElement(t){return"object"==typeof HTMLElement?t instanceof HTMLElement:t&&"object"==typeof t&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName}isNetJSON(t){return!(!t.nodes||!t.links)&&this.isObject(t)&&this.isArray(t.nodes)&&this.isArray(t.links)}isGeoJSON(t){return t.type&&"FeatureCollection"===t.type?this.isObject(t)&&this.isArray(t.features):!(!t.type||"Feature"!==t.type)&&this.isObject(t)&&this.isArray(t.geometry)}geojsonToNetjson(t){return function(t){const e=[],n=[];if(!t||!Array.isArray(t.features))return{nodes:e,links:n};const i=new Map,o=(t,n={})=>{const o=`${t[0]},${t[1]}`;if(i.has(o))return i.get(o);const r=n.id||n.node_id||null,a=n.label||n.name||r||null,s=r?String(r):`gjn_${e.length}`,l=!r,u={id:s,...a?{label:String(a)}:{},location:{lng:t[0],lat:t[1]},properties:{...n,location:{lng:t[0],lat:t[1]}},_generatedIdentity:l};return e.push(u),i.set(o,s),s},r=(t,e,i={})=>{n.push({source:t,target:e,properties:i})},a=(t,e,n=!1)=>{for(let n=0;n2){const n=o(t[0],e),i=o(t[t.length-1],e);r(i,n,e)}},s=(t,e)=>{if(!t)return;const{type:n,coordinates:i,geometries:r}=t;switch(n){case"Point":o(i,{...e,_featureType:"Point"});break;case"MultiPoint":i.forEach(t=>o(t,{...e,_featureType:"Point"}));break;case"LineString":a(i,{...e,_featureType:"LineString"},!1);break;case"MultiLineString":i.forEach(t=>a(t,{...e,_featureType:"LineString"},!1));break;case"Polygon":case"MultiPolygon":break;case"GeometryCollection":r.forEach(t=>s(t,e));break;default:console.warn(`Unsupported GeoJSON geometry type: ${n}`)}};return t.features.forEach(t=>{const e={...t.properties||{},...null!=t.id?{id:t.id}:{}};s(t.geometry,e)}),{nodes:e,links:n}}(t)}deepCopy(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>this.deepCopy(t));const e={};return Object.keys(t).forEach(n=>{e[n]=this.deepCopy(t[n])}),e}fastDeepCopy(t){return"function"==typeof structuredClone?structuredClone(t):JSON.parse(JSON.stringify(t))}deepMergeObj(...t){const e=[...t].reverse(),n=e.length;for(let t=0;t{i[t]&&this.isObject(i[t])&&this.isObject(n[t])?this.deepMergeObj(i[t],n[t]):i[t]=n[t]}):i||(e[t+1]=n)}return e[n-1]}makeCluster(t){const{nodes:e,links:n}=t.data,i=t=>!(t.properties&&t.properties._featureType)||"Point"===t.properties._featureType,o=e.filter(i),r=e.filter(t=>!i(t)),a=[],s=[],l=new Map;r.forEach(t=>l.set(t.id,null));let u=0;o.forEach(e=>{const n=e.properties&&e.properties.location||e.location;if(!n||void 0===n.lat||void 0===n.lng)return;e.location=n,e._origLocation?(n.lat=e._origLocation.lat,n.lng=e._origLocation.lng):e._origLocation={lat:n.lat,lng:n.lng};const i=t.leaflet.latLngToContainerPoint([n.lat,n.lng]);e.x=i.x,e.y=i.y,e.visited=!1,e.cluster=null});const h=new VT(o.length);o.forEach(({x:t,y:e})=>h.add(t,e)),h.finish();const c=t.config&&t.config.mapOptions&&t.config.mapOptions.clusterConfig&&t.config.mapOptions.clusterConfig.symbolSize,d=t=>{if("function"==typeof c)try{return c(t)}catch(t){return 30}return Array.isArray(c)?c[0]||30:"number"==typeof c?c:30},p=new Map;o.forEach(e=>{if(e.visited)return;const n=h.within(e.x,e.y,t.config.clusterRadius).map(t=>o[t]);if(n.length>1){const i=`${Math.round(e.x)},${Math.round(e.y)}`;p.has(i)||p.set(i,new Map);const o=p.get(i);n.forEach(e=>{if(e.visited)return;const n=t.config.clusteringAttribute?e.properties[t.config.clusteringAttribute]:"default";o.has(n)||o.set(n,[]),o.get(n).push(e),e.visited=!0})}else e.visited=!0,l.set(e.id,null),r.push(e)}),p.forEach(e=>{const n=Array.from(e.entries()),i=n.length;let o=0;n.forEach(([,t])=>{const e=d(t.length);e>o&&(o=e)});const a="number"==typeof t.config.clusterSeparation?t.config.clusterSeparation:Math.max(10,Math.floor(t.config.clusterRadius/2));let h=0;if(i>1){const t=Math.PI/i,e=Math.sin(t);e>0&&(h=o/(2*e))}const c=Math.max(a,h+4);n.forEach(([,e],n)=>{if(e.length>1){let o=0,r=0;if(e.forEach(t=>{t.cluster=u,l.set(t.id,t.cluster),o+=t.location.lng,r+=t.location.lat}),o/=e.length,r/=e.length,i>1){const e=2*Math.PI*n/i,a=t.leaflet.latLngToContainerPoint([r,o]),s=[a.x+c*Math.cos(e),a.y+c*Math.sin(e)],l=t.leaflet.containerPointToLatLng(s);o=l.lng,r=l.lat}const a={id:u,cluster:!0,name:e.length,value:[o,r],childNodes:e,...t.config.mapOptions.clusterConfig};if(t.config.clusteringAttribute){const n=t.config.nodeCategories.find(n=>n.name===e[0].properties[t.config.clusteringAttribute]);n&&(a.itemStyle={...a.itemStyle,color:n.nodeStyle.color})}s.push(a),u+=1}else if(1===e.length){const t=e[0];l.set(t.id,null),r.push(t)}})}),n.forEach(t=>{null===l.get(t.source)&&null===l.get(t.target)&&a.push(t)});const f=[...s.map(t=>({ref:t,isCluster:!0,count:t.childNodes.length,get value(){return t.value},set value([e,n]){t.value=[e,n]}})),...r.filter(i).map(t=>({ref:t,isCluster:!1,count:1,get value(){return[t.location.lng,t.location.lat]},set value([e,n]){t.location.lng=e,t.location.lat=n}}))];if(f.length>1){const e=f.map(e=>{const[n,i]=e.value,o=t.leaflet.latLngToContainerPoint([i,n]);return{ref:e.ref,isCluster:e.isCluster,x:o.x,y:o.y,r:d(e.count)/2,setValue:([t,n])=>{e.value=[t,n]}}}),n=4,i=5;for(let t=0;t0&&s{const n=t.leaflet.containerPointToLatLng([e.x,e.y]);e.isCluster?e.ref.value=[n.lng,n.lat]:(e.ref.location.lng=n.lng,e.ref.location.lat=n.lat)})}return{clusters:s,nonClusterNodes:r,nonClusterLinks:a}}updateMetadata(){if(this.config.metadata){const t=this.utils.getMetadata(this.data),e=document.querySelector(".njg-metaData"),n=document.querySelectorAll(".njg-metaDataItems");for(let t=0;t{const i=document.createElement("div");i.classList.add("njg-metaDataItems");const o=document.createElement("span");o.setAttribute("class","njg-keyLabel");const r=document.createElement("span");r.setAttribute("class","njg-valueLabel"),o.innerHTML=n,r.innerHTML=t[n],i.appendChild(o),i.appendChild(r),e.appendChild(i)})}}getMetadata(t){const e=t,n={};return e.label&&(n.label=e.label),["protocol","version","revision","metric","router_id","topology_id"].forEach(t=>{e[t]&&(n[t]=e[t])}),n.nodes=e.nodes.length,n.links=e.links.length,n}nodeInfo(t){const e={};!t._generatedIdentity&&(e.id=t.id,t.label&&"string"==typeof t.label&&(e.label=t.label)),t.name&&(e.name=t.name),t.location&&(e.location=t.location);let n=null;Array.isArray(t.clients)?n=t.clients:t.properties&&Array.isArray(t.properties.clients)&&(n=t.properties.clients);let i=0;n?i=n.length:"number"==typeof t.clients?i=t.clients:t.properties&&"number"==typeof t.properties.clients&&(i=t.properties.clients),i>0&&(e.clients=i),n&&n.length&&n.forEach((t,n)=>{e[`clients [${n+1}]`]=t});const o=(t,e)=>"location"===t&&e&&"object"==typeof e?{lat:e.lat,lng:e.lng}:"time"===t&&"string"==typeof e?this.dateParse({dateString:e}):e,r=t._source&&this.isObject(t._source)?t._source:t;if(Object.keys(r).forEach(t=>{if("properties"===t||"clients"===t||"_source"===t||"_generatedIdentity"===t||"local_addresses"===t||"linkCount"===t)return;const n=o(t,r[t]);null!=n&&""!==n&&(e[t]=n)}),r.properties&&this.isObject(r.properties)&&Object.keys(r.properties).forEach(t=>{if("clients"===t)return;const n=o(t,r.properties[t]);null==n||"string"==typeof n&&""===n.trim()||(e[t]=n)}),t.linkCount&&(e.links=t.linkCount),Array.isArray(r.local_addresses)){const t=r.local_addresses.map(t=>"string"==typeof t?t:t&&"string"==typeof t.address?t.address:null).filter(t=>t);t.length&&(e.localAddresses=t)}return t.local_addresses&&(e.localAddresses=t.local_addresses),e}createTooltipItem(t,e){const n=document.createElement("div");n.classList.add("njg-tooltip-item");const i=document.createElement("span");i.setAttribute("class","njg-tooltip-key");const o=document.createElement("span");return o.setAttribute("class","njg-tooltip-value"),i.innerHTML=t,o.innerHTML=e,n.appendChild(i),n.appendChild(o),n}getNodeTooltipInfo(t){const e=document.createElement("div");e.classList.add("njg-tooltip-inner");const n=!t._generatedIdentity;return n&&t.id&&e.appendChild(this.createTooltipItem("id",t.id)),n&&t.label&&"string"==typeof t.label&&e.appendChild(this.createTooltipItem("label",t.label)),t.properties&&Object.keys(t.properties).forEach(i=>{if("object"!=typeof t.properties[i]&&!i.startsWith("_")&&("id"!==i&&"label"!==i||!n))if("location"===i)e.appendChild(this.createTooltipItem("location",`${Math.round(1e3*t.properties.location.lat)/1e3}, ${Math.round(1e3*t.properties.location.lng)/1e3}`));else if("time"===i){const n=this.dateParse({dateString:t.properties[i]});e.appendChild(this.createTooltipItem("time",n))}else e.appendChild(this.createTooltipItem(`${i.replace(/_/g," ")}`,t.properties[i]))}),t.linkCount&&e.appendChild(this.createTooltipItem("Links",t.linkCount)),t.local_addresses&&e.appendChild(this.createTooltipItem("Local Addresses",t.local_addresses.join("
"))),e}getLinkTooltipInfo(t){const e=document.createElement("div");e.classList.add("njg-tooltip-inner");const n=t=>"string"==typeof t&&t.startsWith("gjn_");return n(t.source)||e.appendChild(this.createTooltipItem("source",t.source)),n(t.target)||e.appendChild(this.createTooltipItem("target",t.target)),null!=t.cost&&e.appendChild(this.createTooltipItem("cost",t.cost)),t.properties&&Object.keys(t.properties).forEach(n=>{const i=t.properties[n];if(null!=i)if("time"===n){const t=this.dateParse({dateString:i});e.appendChild(this.createTooltipItem("time",t))}else{const t="string"==typeof i?i.replace(/\n/g,"
"):i;e.appendChild(this.createTooltipItem(`${n.replace(/_/g," ")}`,t))}}),e}linkInfo(t){const e={},n=t=>"string"==typeof t&&t.startsWith("gjn_");return n(t.source)||(e.source=t.source),n(t.target)||(e.target=t.target),null!=t.cost&&(e.cost=t.cost),t.properties&&Object.keys(t.properties).forEach(n=>{const i=t.properties[n];if(null!=i)if("time"===n){const t=this.dateParse({dateString:i});e[n]=t}else{const t="string"==typeof i?i.replace(/\n/g,"
"):i;e[n.replace(/_/g," ")]=t}}),e}generateStyle(t,e){return"function"==typeof t?t(e):t}getNodeStyle(t,e,n){let i,o={},r={},a=!1;if(t.category&&e.nodeCategories&&e.nodeCategories.length){const n=e.nodeCategories.find(e=>e.name===t.category);if(n){a=!0,i=this.generateStyle(n.nodeStyle||{},t),o=this.generateStyle(n.nodeSize||{},t);let e={},s={};n.emphasis&&(e=this.generateStyle(n.emphasis.nodeStyle||{},t),s=this.generateStyle(n.emphasis.nodeSize||{},t),r={nodeStyle:e,nodeSize:s})}}if(!a)if("map"===n){const n=e.mapOptions&&e.mapOptions.nodeConfig;i=this.generateStyle(n&&n.nodeStyle||{},t),o=this.generateStyle(n&&n.nodeSize||{},t);const a=n&&n.emphasis;a&&(r={nodeStyle:this.generateStyle(a&&a.nodeStyle||{},t),nodeSize:this.generateStyle(a&&a.nodeSize||{},t)})}else{const n=e.graphConfig&&e.graphConfig.series;i=this.generateStyle(n&&n.nodeStyle||{},t),o=this.generateStyle(n&&n.nodeSize||{},t);const a=n&&n.emphasis;a&&(r={nodeStyle:this.generateStyle(a&&a.itemStyle||{},t),nodeSize:this.generateStyle(a&&a.symbolSize||o||{},t)})}return{nodeStyleConfig:i,nodeSizeConfig:o,nodeEmphasisConfig:r}}getLinkStyle(t,e,n){let i,o={};if(t.category&&e.linkCategories.length){const n=e.linkCategories.find(e=>e.name===t.category);i=this.generateStyle(n.linkStyle||{},t),o={...o,linkStyle:n.emphasis?this.generateStyle(n.emphasis.linkStyle||{},t):{}}}else i=this.generateStyle("map"===n?e.mapOptions.linkConfig.linkStyle:e.graphConfig.series.linkStyle,t);return{linkStyleConfig:i,linkEmphasisConfig:o}}showLoading(){let t=this.el.querySelector(".njg-loadingContainer");return t?t.style.visibility="visible":(t=document.createElement("div"),t.classList.add("njg-loadingContainer"),t.innerHTML='\n
\n
\n

Loading...

\n
\n ',this.el.appendChild(t)),t}hideLoading(){const t=this.el.querySelector(".njg-loadingContainer");return t&&(t.style.visibility="hidden"),t}createEvent(){const t=new Map,e=new Map;return{on(e,...n){t.set(e,[...t.get(e)||[],...n])},once(t,...n){e.set(t,[...e.get(t)||[],...n])},emit(n){const i=t.get(n)||[],o=e.get(n)||[],r=i.map(t=>t()),a=o.map(t=>t());return e.delete(n),[...r,...a]},delete(n){t.delete(n),e.delete(n)}}}parseUrlFragments(){let t;try{t=decodeURIComponent(window.location.hash.replace(/^#/,""))}catch(e){t=window.location.hash.replace(/^#/,"")}const e={};return t.split(";").forEach(t=>{const n=new URLSearchParams(t),i=n.get("id");null!=i&&(e[i]=n)}),e}updateUrlFragments(t,e){const n=Object.values(t).map(t=>t.toString()).join(";");if(!n)return void window.history.pushState(e,"",window.location.pathname+window.location.search);const i=n.replace(/([^&=]+)=([^&;]*)/g,(t,e,n)=>`${e}=${encodeURIComponent(n.replace(/%7E/gi,"~"))}`);window.history.pushState(e,"",`#${i}`)}addActionToUrl(t,e){if(!t.config.bookmarkableActions.enabled||!e.data||e.data.cluster)return;if(!t.nodeLinkIndex)return void console.error("Lookup object for node or link not found.");const n=this.parseUrlFragments(),{id:i}=t.config.bookmarkableActions;let o;if(t.config.render===t.utils.graphRender){if("node"===e.dataType)o=e.data.id;else if("edge"===e.dataType){const{source:t,target:n}=e.data;o=`${t}~${n}`}}else if(t.config.render===t.utils.mapRender)if("scatter"===e.seriesType)o=e.data.node.id;else if("lines"===e.seriesType){const{source:t,target:n}=e.data.link;o=`${t}~${n}`}o&&t.nodeLinkIndex[o]?(n[i]||(n[i]=new URLSearchParams,n[i].set("id",i)),n[i].set("nodeId",o),this.updateUrlFragments(n,t.nodeLinkIndex[o])):console.error("nodeId not found in nodeLinkIndex lookup.")}removeUrlFragment(t,e=null,n=!1){const i=this.parseUrlFragments();if(i[t]){if(e){i[t].delete(e);const o=Array.from(i[t].keys()).filter(t=>"id"!==t);n||0!==o.length||delete i[t]}else delete i[t];this.updateUrlFragments(i,{id:t})}}applyUrlFragmentState(t){if(!t.config.bookmarkableActions.enabled)return;const{id:e}=t.config.bookmarkableActions,n=t.utils.parseUrlFragments(),i=n[e]&&n[e].get?n[e]:null,o=i&&i.get?i.get("nodeId"):void 0;if(!o||!t.nodeLinkIndex||null==t.nodeLinkIndex[o])return void(t.leaflet&&t.leaflet.currentPopup&&t.leaflet.currentPopup.remove());const[r,a]=o.split("~"),s=t.nodeLinkIndex[o],l=t.config.graphConfig&&t.config.graphConfig.series&&t.config.graphConfig.series.type||t.config.mapOptions&&t.config.mapOptions.nodeConfig&&t.config.mapOptions.nodeConfig.type,{location:u,cluster:h}=s||{};t.config.bookmarkableActions.zoomOnRestore&&["scatter","effectScatter"].includes(l)&&null==a&&null!=u&&t.leaflet&&t.leaflet.setView([u.lat,u.lng],null!=h?t.config.disableClusteringAtLevel:t.config.bookmarkableActions.zoomLevel||t.config.showMapLabelsAtZoom),null==a&&t.config.mapOptions?.nodePopup?.show&&t.gui.loadNodePopup(s),"function"==typeof t.config.onClickElement&&t.config.onClickElement.call(t,r&&a?"link":"node",s)}setupHashChangeHandler(t){return t._popstateHandler&&window.removeEventListener("popstate",t._popstateHandler),t._popstateHandler=()=>{this.applyUrlFragmentState(t)},window.addEventListener("popstate",t._popstateHandler),()=>{window.removeEventListener("popstate",t._popstateHandler),t._popstateHandler=null}}moveNodeInRealTime(t,e){if(!this.echarts||"function"!=typeof this.echarts.getOption)return void console.warn("moveNodeInRealTime: ECharts instance not ready");const n=this.echarts.getOption();if(!n||!Array.isArray(n.series))return void console.warn("moveNodeInRealTime: No series data available");const i=n.series.find(t=>"scatter"===t.type||"effectScatter"===t.type);if(!i)return void console.warn("moveNodeInRealTime: No scatter series found");const o=i.data.findIndex(e=>e.node.id===t);if(-1===o)return void console.warn(`moveNodeInRealTime: Node with id "${t}" not found`);const r=i.data[o],{node:a}=r;a.location=e,a.properties?(a.properties.location=e,r.value=[e.lng,e.lat],this.nodeLinkIndex[t].location=e,this.nodeLinkIndex[t].properties&&(this.nodeLinkIndex[t].properties.location=e,this.echarts.setOption({series:n.series}))):console.warn("moveNodeInRealTime: Node properties not found")}updateLabelVisibility(t,e){if(!t.echarts||"function"!=typeof t.echarts.setOption)return void console.warn("updateLabelVisibility: ECharts instance not ready");const n=e&&!1!==t.config.showMapLabelsAtZoom&&t.leaflet.getZoom()>=t.config.showMapLabelsAtZoom;t.echarts.setOption({series:[{id:"geo-map",label:{show:n,silent:!0},emphasis:{label:{show:!1}}}]})}setTooltipVisibility(t,e){t.el&&t.el.classList.toggle("njg-hide-tooltip",!e)}},HT=class extends ZT{searchElements(t){const e=this,n={"":{data:{...e.data},param:[...e.JSONParam]}};return window.history.pushState({searchValue:""},""),window.onpopstate=i=>{n[i.state.searchValue]?e.utils.JSONDataUpdate.call(e,n[i.state.searchValue].data).then(()=>{e.JSONParam=n[i.state.searchValue].param}):e.utils.JSONDataUpdate.call(e,t+i.state.searchValue)},function(i,o=!0,r=!0){const a=i.trim();if(!window.history.state||window.history.state&&window.history.state.searchValue!==a)return window.history.pushState({searchValue:a},""),e.utils.JSONDataUpdate.call(e,t+a,o,r).then(()=>{n[a]={data:{...e.data},param:[...e.JSONParam]}})}}JSONDataUpdate(t,e=!0,n=!0){const i=this;return i.config.onUpdate.call(i),i.utils.paginatedDataParse.call(i,t).then(o=>{function r(){e?(i.JSONParam=[t],i.utils.overrideData(o,i)):(i.JSONParam.push(t),i.config.render===i.utils.mapRender?i.utils.appendData(o,i):i.utils.addData(o,i)),i.utils.isNetJSON(i.data)&&i.utils.updateMetadata.call(i)}return n?(i.utils.isNetJSON(i.data)&&i.config.prepareData.call(i,o),i.config.dealDataByWorker?i.utils.dealDataByWorker.call(i,o,i.config.dealDataByWorker,r):r()):r(),o}).catch(t=>{console.error(t)})}dealDataByWorker(t,e,n){const i=new Worker(e),o=this;i.postMessage(t),i.addEventListener("error",t=>{console.error(t),console.error("Error in dealing JSONData!")}),i.addEventListener("message",t=>{n?n():(o.utils.overrideData(t.data,o),o.utils.isNetJSON(o.data)&&o.utils.updateMetadata.call(o))})}overrideData(t,e){e.data=t,e.utils.isNetJSON(e.data)||e.leaflet.geoJSON.removeFrom(e.leaflet),e.utils.render(),e.config.afterUpdate.call(e)}},WT=class{constructor(t){this.utils=new HT,this.config=this.utils.deepCopy(NT),this.config.crs=NT.crs,this.JSONParam=this.utils.isArray(t)?t:[t]}setConfig(t){if(this.utils.deepMergeObj(this.config,t),this.el)t&&t.el&&console.error("Can't change el again!");else if(this.el=this.config.el?this.utils.isElement(this.config.el)?this.config.el:document.querySelector(this.config.el):document.body,this.el){if(this.el.classList.add("njg-container"),this.el===document.body){const t=document.documentElement;t.style.width="100%",t.style.height="100%",this.el.classList.add("njg-relativePosition")}}else console.error("NetJSONGraph: The specified element for rendering was not found and could not be set.");return this.config}render(){const[t,...e]=this.JSONParam;this.config.onRender.call(this);const n=new Promise(t=>{this.event.once("onReady",async()=>{try{await this.config.onReady.call(this)}catch(t){console.error("onReady callback failed:",t)}t()})});if(this.event.once("onLoad",this.config.onLoad.bind(this)),this.event.once("applyUrlFragmentState",async()=>{await n,this.utils.applyUrlFragmentState.call(this,this)}),this.utils.paginatedDataParse.call(this,t).then(t=>{if(this.utils.isNetJSON(t))this.type="netjson";else{if(!this.utils.isGeoJSON(t))throw new Error("Invalid data format!");this.type="geojson",this.originalGeoJSON=this.utils.fastDeepCopy(t),t=this.utils.geojsonToNetjson(t)}if(this.utils.isNetJSON(t)){t.nodes.length>this.config.maxPointsFetched&&(this.hasMoreData=!0),t.nodes.splice(this.config.maxPointsFetched-1,t.nodes.length-this.config.maxPointsFetched);const e=new Set;this.nodeLinkIndex={},t.nodes.forEach(t=>{e.add(t.id),this.nodeLinkIndex[t.id]=t}),t.links=t.links.filter(t=>e.has(t.source)&&e.has(t.target)?(this.nodeLinkIndex[`${t.source}~${t.target}`]=t,!0):(e.has(t.source)?console.warn(`Node ${t.target} does not exist!`):console.warn(`Node ${t.source} does not exist!`),!1))}this.config.prepareData.call(this,t),this.data=t,this.config.dealDataByWorker?this.utils.dealDataByWorker.call(this,t,this.config.dealDataByWorker):(this.data=t,this.utils.render())}).catch(t=>{console.error(t)}),e.length){const n=function(){e.map(t=>this.utils.JSONDataUpdate.call(this,t,!1))};this.JSONParam=[t],this.event.once("renderArray",n.bind(this))}}setUtils(t={}){const e=this;return e.utils=Object.assign(e.utils,{...t},{render(){if(!e.config.render)throw new Error("No render function!");e.config.render(e.data,e)}}),"function"==typeof e.utils.moveNodeInRealTime&&(e.utils.moveNodeInRealTime=e.utils.moveNodeInRealTime.bind(e)),e.utils}};var jT,GT={},UT=[],YT={registerPreprocessor:cl,registerProcessor:dl,registerPostInit:function(t){pl("afterinit",t)},registerPostUpdate:function(t){pl("afterupdate",t)},registerUpdateLifecycle:pl,registerAction:fl,registerCoordinateSystem:gl,registerLayout:function(t,e){yl(IT,t,e,1e3,"layout")},registerVisual:ml,registerTransform:function(t){var e=(t=o(t)).type;e||Ir("");var n=e.split(":");2!==n.length&&Ir("");var i=!1;"echarts"===n[0]&&(e=n[1],i=!0),t.__isBuiltIn=i,ow.set(e,t)},registerLoading:vl,registerMap:function(t,e,n){var i=lT.registerMap;i&&i(t,e,n)},registerImpl:function(t,e){lT[t]=e},PRIORITY:cT,ComponentModel:W_,ComponentView:ww,SeriesModel:_w,ChartView:Kb,registerComponentModel:function(t){W_.registerClass(t)},registerComponentView:function(t){ww.registerClass(t)},registerSeriesModel:function(t){_w.registerClass(t)},registerChartView:function(t){Kb.registerClass(t)},registerCustomSeries:function(t,e){!function(t,e){GT[t]=e}(t,e)},registerSubTypeDefaulter:function(t,e){W_.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){Bm[t]=e}},XT=cb.prototype,qT=gb.prototype,KT=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};e(function(){return null!==jT&&jT.apply(this,arguments)||this},jT=KT);const $T=function(t){function n(e){var n=t.call(this,e)||this;return n.type="ec-line",n}return e(n,t),n.prototype.getDefaultStyle=function(){return{stroke:X_.color.neutral99,fill:null}},n.prototype.getDefaultShape=function(){return new KT},n.prototype.buildPath=function(t,e){kl(e)?XT.buildPath.call(this,t,e):qT.buildPath.call(this,t,e)},n.prototype.pointAt=function(t){return kl(this.shape)?XT.pointAt.call(this,t):qT.pointAt.call(this,t)},n.prototype.tangentAt=function(t){var e=this.shape,n=kl(e)?[e.x2-e.x1,e.y2-e.y1]:qT.tangentAt.call(this,t);return Q(n,n)},n}(ov);var JT=["fromSymbol","toSymbol"],QT=function(t){function n(e,n,i){var o=t.call(this)||this;return o._createLine(e,n,i),o}return e(n,t),n.prototype._createLine=function(t,e,n){var i=t.hostModel,o=t.getItemLayout(e),r=t.getItemVisual(e,"z2"),a=function(t){var e=new $T({name:"line",subPixelOptimize:!0});return Dl(e.shape,t),e}(o);a.shape.percent=0,La(a,{z2:L(r,0),shape:{percent:1}},i,e),this.add(a),c(JT,function(n){var i=Pl(n,t,e);this.add(i),this[Il(n)]=Ll(n,t,e)},this),this._updateCommonStl(t,e,n)},n.prototype.updateData=function(t,e,n){var i=t.hostModel,o=this.childOfName("line"),r=t.getItemLayout(e),a={shape:{}};Dl(a.shape,r),Ia(o,a,i,e),c(JT,function(n){var i=Ll(n,t,e),o=Il(n);if(this[o]!==i){this.remove(this.childOfName(n));var r=Pl(n,t,e);this.add(r)}this[o]=i},this),this._updateCommonStl(t,e,n)},n.prototype.getLinePath=function(){return this.childAt(0)},n.prototype._updateCommonStl=function(t,e,n){var i=t.hostModel,o=this.childOfName("line"),r=n&&n.emphasisLineStyle,a=n&&n.blurLineStyle,s=n&&n.selectLineStyle,l=n&&n.labelStatesModels,u=n&&n.emphasisDisabled,h=n&&n.focus,d=n&&n.blurScope;if(!n||t.hasItemOption){var p=t.getItemModel(e),f=p.getModel("emphasis");r=f.getModel("lineStyle").getLineStyle(),a=p.getModel(["blur","lineStyle"]).getLineStyle(),s=p.getModel(["select","lineStyle"]).getLineStyle(),u=f.get("disabled"),h=f.get("focus"),d=f.get("blurScope"),l=ho(p)}var g=t.getItemVisual(e,"style"),m=g.stroke;o.useStyle(g),o.style.fill=null,o.style.strokeNoScale=!0,o.ensureState("emphasis").style=r,o.ensureState("blur").style=a,o.ensureState("select").style=s,c(JT,function(t){var e=this.childOfName(t);if(e){e.setColor(m),e.style.opacity=g.opacity;for(var n=0;n0&&(_[0]=-_[0],_[1]=-_[1]);var w=v[0]<0?-1:1;if("start"!==o.__position&&"end"!==o.__position){var b=-Math.atan2(v[1],v[0]);h[0].8?"left":c[0]<-.8?"right":"center",p=c[1]>.8?"top":c[1]<-.8?"bottom":"middle";break;case"start":o.x=-c[0]*g+u[0],o.y=-c[1]*m+u[1],d=c[0]>.8?"right":c[0]<-.8?"left":"center",p=c[1]>.8?"bottom":c[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":o.x=g*w+u[0],o.y=u[1]+S,d=v[0]<0?"right":"left",o.originX=-g*w,o.originY=-S;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":o.x=x[0],o.y=x[1]+S,d="center",o.originY=-S;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":o.x=-g*w+h[0],o.y=h[1]+S,d=v[0]>=0?"right":"left",o.originX=g*w,o.originY=-S}o.scaleX=o.scaleY=r,o.setStyle({verticalAlign:o.__verticalAlign||p,align:o.__align||d})}}}},n}(Em);const tM=QT,eM=function(){function t(t){this.group=new Em,this._LineCtor=t||tM}return t.prototype.updateData=function(t){var e=this;this._progressiveEls=null;var n=this,i=n.group,o=n._lineData;n._lineData=t,o||i.removeAll();var r=Al(t);t.diff(o).add(function(n){e._doAdd(t,n,r)}).update(function(n,i){e._doUpdate(o,t,i,n,r)}).remove(function(t){i.remove(o.getItemGraphicEl(t))}).execute()},t.prototype.updateLayout=function(){var t=this._lineData;t&&t.eachItemGraphicEl(function(e,n){e.updateLayout(t,n)},this)},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=Al(t),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e){function n(t){t.isGroup||function(t){return t.animators&&t.animators.length>0}(t)||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var i=t.start;i0&&(r=this._getLineLength(i)/l*1e3),r!==this._period||a!==this._loop||s!==this._roundTrip){i.stopAnimation();var h=void 0;h=v(u)?u(n):u,i.__t>0&&(h=-r*i.__t),this._animateSymbol(i,r,h,a,s)}this._period=r,this._loop=a,this._roundTrip=s}},n.prototype._animateSymbol=function(t,e,n,i,o){if(e>0){t.__t=0;var r=this,a=t.animate("",i).when(o?2*e:e,{__t:o?2:1}).delay(n).during(function(){r._updateSymbolPosition(t)});i||a.done(function(){r.remove(t)}),a.start()}},n.prototype._getLineLength=function(t){return Cf(t.__p1,t.__cp1)+Cf(t.__cp1,t.__p2)},n.prototype._updateAnimationPoints=function(t,e){t.__p1=e[0],t.__p2=e[1],t.__cp1=e[2]||[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]},n.prototype.updateData=function(t,e,n){this.childAt(0).updateData(t,e,n),this._updateEffectSymbol(t,e)},n.prototype._updateSymbolPosition=function(t){var e=t.__p1,n=t.__p2,i=t.__cp1,o=t.__t<1?t.__t:2-t.__t,r=[t.x,t.y],a=r.slice(),s=jt,l=Gt;r[0]=s(e[0],i[0],n[0],o),r[1]=s(e[1],i[1],n[1],o);var u=t.__t<1?l(e[0],i[0],n[0],o):l(n[0],i[0],e[0],1-o),h=t.__t<1?l(e[1],i[1],n[1],o):l(n[1],i[1],e[1],1-o);t.rotation=-Math.atan2(h,u)-Math.PI/2,"line"!==this._symbolType&&"rect"!==this._symbolType&&"roundRect"!==this._symbolType||(void 0!==t.__lastT&&t.__lastT=0&&!(i[r]<=e);r--);r=Math.min(r,o-2)}else{for(r=a;re);r++);r=Math.min(r-1,o-2)}var s=(e-i[r])/(i[r+1]-i[r]),l=n[r],u=n[r+1];t.x=l[0]*(1-s)+s*u[0],t.y=l[1]*(1-s)+s*u[1],t.rotation=-Math.atan2(t.__t<1?u[1]-l[1]:l[1]-u[1],t.__t<1?u[0]-l[0]:l[0]-u[0])-Math.PI/2,this._lastFrame=r,this._lastFramePercent=e,t.ignore=!1}},n}(iM);const sM=aM;var lM=function(){this.polyline=!1,this.curveness=0,this.segs=[]},uM=function(t){function n(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return e(n,t),n.prototype.reset=function(){this.notClear=!1,this._off=0},n.prototype.getDefaultStyle=function(){return{stroke:X_.color.neutral99,fill:null}},n.prototype.getDefaultShape=function(){return new lM},n.prototype.buildPath=function(t,e){var n,i=e.segs,o=e.curveness;if(e.polyline)for(n=this._off;n0){t.moveTo(i[n++],i[n++]);for(var a=1;a0?t.quadraticCurveTo((s+u)/2-(l-h)*o,(l+h)/2-(u-s)*o,u,h):t.lineTo(u,h)}this.incremental&&(this._off=n,this.notClear=!0)},n.prototype.findDataIndex=function(t,e){var n=this.shape,i=n.segs,o=n.curveness,r=this.style.lineWidth;if(n.polyline)for(var a=0,s=0;s0)for(var u=i[s++],h=i[s++],c=1;c0){if(ui(u,h,(u+d)/2-(h-p)*o,(h+p)/2-(d-u)*o,d,p,r,t,e))return a}else if(si(u,h,d,p,r,t,e))return a;a++}return-1},n.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e);return this.getBoundingRect().contain(t=n[0],e=n[1])?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},n.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape.segs,n=1/0,i=1/0,o=-1/0,r=-1/0,a=0;a0&&(r.dataIndex=n+t.__startIndex)})},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}();var cM={seriesType:"lines",plan:ma(),reset:function(t){var e=t.coordinateSystem;if(e){var n=t.get("polyline"),i=t.pipelineContext.large;return{progress:function(o,r){var a=[];if(i){var s=void 0,l=o.end-o.start;if(n){for(var u=0,h=o.start;h0&&(l||s.configLayer(r,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(a/10+.9,1),0)})),o.updateData(i);var u=t.get("clip",!0)&&function(t,e,n){return t?"polar"===t.type?function(t){var e=t.getArea(),n=rn(e.r0,1),i=rn(e.r,1),o=new Jw({shape:{cx:rn(t.cx,1),cy:rn(t.cy,1),r0:n,r:i,startAngle:e.startAngle,endAngle:e.endAngle,clockwise:e.clockwise}});return o}(t):"cartesian2d"===t.type?function(t,e,n){var i=t.getArea(),o=i.x,r=i.y,a=i.width,s=i.height,l=n.get(["lineStyle","width"])||0;o-=l/2,r-=l/2,a+=l,s+=l,a=Math.ceil(a),o!==Math.floor(o)&&(o=Math.floor(o),a++);var u=new mv({shape:{x:o,y:r,width:a,height:s}});return u}(t,0,n):null:null}(t.coordinateSystem,0,t);u?this.group.setClipPath(u):this.group.removeClipPath(),this._lastZlevel=r,this._finished=!0},n.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData();this._updateLineDraw(i,t).incrementalPrepareUpdate(i),this._clearLayer(n),this._finished=!1},n.prototype.incrementalRender=function(t,e,n){this._lineDraw.incrementalUpdate(t,e.getData()),this._finished=t.end===e.getData().count()},n.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},n.prototype.updateTransform=function(t,e,n){var i=t.getData(),o=t.pipelineContext;if(!this._finished||o.large||o.progressiveRender)return{update:!0};var r=dM.reset(t,e,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),this._lineDraw.updateLayout(),this._clearLayer(n)},n.prototype._updateLineDraw=function(t,e){var n=this._lineDraw,i=this._showEffect(e),o=!!e.get("polyline"),r=e.pipelineContext.large;return n&&i===this._hasEffet&&o===this._isPolyline&&r===this._isLargeDraw||(n&&n.remove(),n=this._lineDraw=r?new hM:new eM(o?i?sM:rM:i?iM:tM),this._hasEffet=i,this._isPolyline=o,this._isLargeDraw=r),this.group.add(n.group),n},n.prototype._showEffect=function(t){return!!t.get(["effect","show"])},n.prototype._clearLayer=function(t){var e=t.getZr();"svg"===e.painter.getType()||null==this._lastZlevel||e.painter.getLayer(this._lastZlevel).clear(!0)},n.prototype.remove=function(t,e){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(e)},n.prototype.dispose=function(t,e){this.remove(t,e)},n.type="lines",n}(Kb);var fM=function(){function t(t,e,n,i,o,r){this._old=t,this._new=e,this._oldKeyGetter=n||Rl,this._newKeyGetter=i||Rl,this.context=o,this._diffModeMultiple="multiple"===r}return t.prototype.add=function(t){return this._add=t,this},t.prototype.update=function(t){return this._update=t,this},t.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},t.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},t.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},t.prototype.remove=function(t){return this._remove=t,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var t=this._old,e=this._new,n={},i=new Array(t.length),o=new Array(e.length);this._initIndexMap(t,null,i,"_oldKeyGetter"),this._initIndexMap(e,n,o,"_newKeyGetter");for(var r=0;r1){var u=s.shift();1===s.length&&(n[a]=s[0]),this._update&&this._update(u,r)}else 1===l?(n[a]=null,this._update&&this._update(s,r)):this._remove&&this._remove(r)}this._performRestAdd(o,n)},t.prototype._executeMultiple=function(){var t=this._new,e={},n={},i=[],o=[];this._initIndexMap(this._old,e,i,"_oldKeyGetter"),this._initIndexMap(t,n,o,"_newKeyGetter");for(var r=0;r1&&1===h)this._updateManyToOne&&this._updateManyToOne(l,s),n[a]=null;else if(1===u&&h>1)this._updateOneToMany&&this._updateOneToMany(l,s),n[a]=null;else if(1===u&&1===h)this._update&&this._update(l,s),n[a]=null;else if(u>1&&h>1)this._updateManyToMany&&this._updateManyToMany(l,s),n[a]=null;else if(u>1)for(var c=0;c1)for(var a=0;a=e)){var n=this._store.getProvider();this._updateOrdinalMeta();var i=this._nameList,o=this._idList;if(n.getSource().sourceFormat===ox&&!n.pure)for(var r=[],a=t;a0},t.prototype.ensureUniqueItemVisual=function(t,e){var n=this._itemVisuals,i=n[t];i||(i=n[t]={});var o=i[e];return null==o&&(y(o=this.getVisual(e))?o=o.slice():IM(o)&&(o=a({},o)),i[e]=o),o},t.prototype.setItemVisual=function(t,e,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,IM(e)?a(i,e):i[e]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(t,e){IM(t)?a(this._layout,t):this._layout[t]=e},t.prototype.getLayout=function(t){return this._layout[t]},t.prototype.getItemLayout=function(t){return this._itemLayouts[t]},t.prototype.setItemLayout=function(t,e,n){this._itemLayouts[t]=n?a(this._itemLayouts[t]||{},e):e},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(t,e){!function(t,e,n,i){if(i){var o=Mv(i);o.dataIndex=n,o.dataType=e,o.seriesIndex=t,o.ssrType="chart","group"===i.type&&i.traverse(function(i){var o=Mv(i);o.seriesIndex=t,o.dataIndex=n,o.dataType=e,o.ssrType="chart"})}}(this.hostModel&&this.hostModel.seriesIndex,this.dataType,t,e),this._graphicEls[t]=e},t.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},t.prototype.eachItemGraphicEl=function(t,e){c(this._graphicEls,function(n,i){n&&t&&t.call(e,n,i)})},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:LM(this.dimensions,this._getDimInfo,this),this.hostModel)),bM(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(t,e){var n=this[t];v(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=n.apply(this,arguments);return e.apply(this,[t].concat(D(arguments)))})},t.internalField=(vM=function(t){var e=t._invertedIndicesMap;c(e,function(n,i){var o=t._dimInfos[i],r=o.ordinalMeta,a=t._store;if(r){n=e[i]=new PM(r.categories.length);for(var s=0;s1&&(s+="__ec__"+u),i[e]=s}})),t}();const zM=OM;var EM="undefined"==typeof Uint32Array?Array:Uint32Array,RM="undefined"==typeof Float64Array?Array:Float64Array,BM=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.visualStyleAccessPath="lineStyle",e.visualDrawType="stroke",e}return e(n,t),n.prototype.init=function(e){e.data=e.data||[],Hl(e);var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count)),t.prototype.init.apply(this,arguments)},n.prototype.mergeOption=function(e){if(Hl(e),e.data){var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count))}t.prototype.mergeOption.apply(this,arguments)},n.prototype.appendData=function(t){var e=this._processFlatCoordsArray(t.data);e.flatCoords&&(this._flatCoords?(this._flatCoords=N(this._flatCoords,e.flatCoords),this._flatCoordsOffset=N(this._flatCoordsOffset,e.flatCoordsOffset)):(this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset),t.data=new Float32Array(e.count)),this.getRawData().appendData(t.data)},n.prototype._getCoordsFromItemModel=function(t){var e=this.getData().getItemModel(t);return e.option instanceof Array?e.option:e.getShallow("coords")},n.prototype.getLineCoordsCount=function(t){return this._flatCoordsOffset?this._flatCoordsOffset[2*t+1]:this._getCoordsFromItemModel(t).length},n.prototype.getLineCoords=function(t,e){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*t],i=this._flatCoordsOffset[2*t+1],o=0;o ")})},n.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},n.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},n.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},n.prototype.getZLevelKey=function(){var t=this.getModel("effect"),e=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&e>0?e+"":""},n.type="series.lines",n.dependencies=["grid","polar","geo","calendar"],n.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}},n}(_w);const NM=BM,FM={seriesType:"lines",reset:function(t){var e=Wl(t.get("symbol")),n=Wl(t.get("symbolSize")),i=t.getData();return i.setVisual("fromSymbol",e&&e[0]),i.setVisual("toSymbol",e&&e[1]),i.setVisual("fromSymbolSize",n&&n[0]),i.setVisual("toSymbolSize",n&&n[1]),{dataEach:i.hasItemOption?function(t,e){var n=t.getItemModel(e),i=Wl(n.getShallow("symbol",!0)),o=Wl(n.getShallow("symbolSize",!0));i[0]&&t.setItemVisual(e,"fromSymbol",i[0]),i[1]&&t.setItemVisual(e,"toSymbol",i[1]),o[0]&&t.setItemVisual(e,"fromSymbolSize",o[0]),o[1]&&t.setItemVisual(e,"toSymbolSize",o[1])}:null}}};var VM="--\x3e",ZM=function(t){return t.get("autoCurveness")||null},HM=function(t,e){var n=ZM(t),i=20,o=[];if(w(n))i=n;else if(y(n))return void(t.__curvenessList=n);e>i&&(i=e);var r=i%2?i+2:i+3;o=[];for(var a=0;a0?+p:1;k.scaleX=this._sizeX*I,k.scaleY=this._sizeY*I,this.setSymbolScale(1),io(this,u,h,c)},n.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},n.prototype.fadeOut=function(t,e,n){var i=this.childAt(0),o=Mv(this).dataIndex,r=n&&n.animation;if(this.silent=i.silent=!0,n&&n.fadeLabel){var a=i.getTextContent();a&&Da(a,{style:{opacity:0}},e,{dataIndex:o,removeOpt:r,cb:function(){i.removeTextContent()}})}else i.removeTextContent();Da(i,{style:{opacity:0},scaleX:0,scaleY:0},e,{dataIndex:o,cb:t,removeOpt:r})},n.getSymbolSize=function(t,e){return Rs(t.getItemVisual(e,"symbolSize"))},n.getSymbolZ2=function(t,e){return t.getItemVisual(e,"z2")},n}(Em);const tC=QM;var eC=function(){function t(t){this.group=new Em,this._SymbolCtor=t||tC}return t.prototype.updateData=function(t,e){this._progressiveEls=null,e=cu(e);var n=this.group,i=t.hostModel,o=this._data,r=this._SymbolCtor,a=e.disableAnimation,s=du(t),l={disableAnimation:a},u=e.getSymbolPoint||function(e){return t.getItemLayout(e)};o||n.removeAll(),t.diff(o).add(function(i){var o=u(i);if(hu(t,o,i,e)){var a=new r(t,i,s,l);a.setPosition(o),t.setItemGraphicEl(i,a),n.add(a)}}).update(function(h,c){var d=o.getItemGraphicEl(c),p=u(h);if(hu(t,p,h,e)){var f=t.getItemVisual(h,"symbol")||"circle",g=d&&d.getSymbolType&&d.getSymbolType();if(!d||g&&g!==f)n.remove(d),(d=new r(t,h,s,l)).setPosition(p);else{d.updateData(t,h,s,l);var m={x:p[0],y:p[1]};a?d.attr(m):Ia(d,m,i)}n.add(d),t.setItemGraphicEl(h,d)}else n.remove(d)}).remove(function(t){var e=o.getItemGraphicEl(t);e&&e.fadeOut(function(){n.remove(e)},i)}).execute(),this._getSymbolPoint=u,this._data=t},t.prototype.updateLayout=function(){var t=this,e=this._data;e&&e.eachItemGraphicEl(function(e,n){var i=t._getSymbolPoint(n);e.setPosition(i),e.markRedraw()})},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=du(t),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e,n){function i(t){t.isGroup||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],n=cu(n);for(var o=t.start;o3?1.4:o>1?1.2:1.1;this._checkTriggerMoveZoom(this,"zoom","zoomOnMouseWheel",t,{scale:i>0?s:1/s,originX:r,originY:a,isAvailableBehavior:null})}if(n){var l=Math.abs(i);this._checkTriggerMoveZoom(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:(i>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:r,originY:a,isAvailableBehavior:null})}}}},n.prototype._pinchHandler=function(t){pu(this._zr,"globalPan")||gu(t)||this._checkTriggerMoveZoom(this,"zoom",null,t,{scale:t.pinchScale>1?1.1:1/1.1,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})},n.prototype._checkTriggerMoveZoom=function(t,e,n,i,o){t._checkPointer(i,o.originX,o.originY)&&(Zf(i.event),i.__ecRoamConsumed=!0,xu(t,e,n,i,o))},n}(Af),aC=Ln();const sC=rC;var lC=[],uC=[],hC=[],cC=jt,dC=kf,pC=Math.abs,fC=Ln(),gC=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.init=function(t,e){var n=new nC,i=new eM,o=this.group,r=new Em;this._controller=new sC(e.getZr()),this._controllerHost={target:r},r.add(n.group),r.add(i.group),o.add(r),this._symbolDraw=n,this._lineDraw=i,this._mainGroup=r,this._firstRender=!0},n.prototype.render=function(t,e,n){var i=this,o=t.coordinateSystem,r=!1;this._model=t,this._api=n,this._active=!0;var a=this._getThumbnailInfo();a&&a.bridge.reset(n);var s=this._symbolDraw,l=this._lineDraw;if(Tu(o)){var u={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?this._mainGroup.attr(u):Ia(this._mainGroup,u,t)}Su(t.getGraph(),Jl(t));var h=t.getData();s.updateData(h);var c=t.getEdgeData();l.updateData(c),this._updateNodeAndLinkScale(),this._updateController(null,t,n),clearTimeout(this._layoutTimeout);var d=t.forceLayout,p=t.get(["force","layoutAnimation"]);d&&(r=!0,this._startForceLayoutIteration(d,n,p));var f=t.get("layout");h.graph.eachNode(function(e){var o=e.dataIndex,r=e.getGraphicEl(),a=e.getModel();if(r){r.off("drag").off("dragend");var s=a.get("draggable");s&&r.on("drag",function(a){switch(f){case"force":d.warmUp(),!i._layouting&&i._startForceLayoutIteration(d,n,p),d.setFixed(o),h.setItemLayout(o,[r.x,r.y]);break;case"circular":h.setItemLayout(o,[r.x,r.y]),e.setLayout({fixed:!0},!0),tu(t,"symbolSize",e,[a.offsetX,a.offsetY]),i.updateLayout(t);break;default:h.setItemLayout(o,[r.x,r.y]),Kl(t.getGraph(),t),i.updateLayout(t)}}).on("dragend",function(){d&&d.setUnfixed(o)}),r.setDraggable(s,!!a.get("cursor")),"adjacency"===a.get(["emphasis","focus"])&&(Mv(r).focus=e.getAdjacentDataIndices())}}),h.graph.eachEdge(function(t){var e=t.getGraphicEl(),n=t.getModel().get(["emphasis","focus"]);e&&"adjacency"===n&&(Mv(e).focus={edge:[t.dataIndex],node:[t.node1.dataIndex,t.node2.dataIndex]})});var g="circular"===t.get("layout")&&t.get(["circular","rotateLabel"]),m=h.getLayout("cx"),y=h.getLayout("cy");h.graph.eachNode(function(t){eu(t,g,m,y)}),this._firstRender=!1,r||this._renderThumbnail(t,n,this._symbolDraw,this._lineDraw)},n.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},n.prototype._startForceLayoutIteration=function(t,e,n){var i=this,o=!1;!function r(){t.step(function(t){i.updateLayout(i._model),!t&&o||(o=!0,i._renderThumbnail(i._model,e,i._symbolDraw,i._lineDraw)),(i._layouting=!t)&&(n?i._layoutTimeout=setTimeout(r,16):r())})}()},n.prototype._updateController=function(t,e,n){var i=this._controller,o=this._controllerHost,r=e.coordinateSystem;Tu(r)?(i.enable(e.get("roam"),{api:n,zInfo:{component:e},triggerInfo:{roamTrigger:e.get("roamTrigger"),isInSelf:function(t,e,n){return r.containPoint([e,n])},isInClip:function(e,n,i){return!t||t.contain(n,i)}}}),o.zoomLimit=e.get("scaleLimit"),o.zoom=r.getZoom(),i.off("pan").off("zoom").on("pan",function(t){n.dispatchAction({seriesId:e.id,type:"graphRoam",dx:t.dx,dy:t.dy})}).on("zoom",function(t){n.dispatchAction({seriesId:e.id,type:"graphRoam",zoom:t.scale,originX:t.originX,originY:t.originY})})):i.disable()},n.prototype.updateViewOnPan=function(t,e,n){this._active&&(function(t,e,n){var i=t.target;i.x+=e,i.y+=n,i.dirty()}(this._controllerHost,n.dx,n.dy),this._updateThumbnailWindow())},n.prototype.updateViewOnZoom=function(t,e,n){this._active&&(function(t,e,n,i){var o=t.target,r=t.zoomLimit,a=t.zoom=t.zoom||1,s=(a=au(a*=e,r))/t.zoom;t.zoom=a,ru(o,n,i,s),o.dirty()}(this._controllerHost,n.zoom,n.originX,n.originY),this._updateNodeAndLinkScale(),Su(t.getGraph(),Jl(t)),this._lineDraw.updateLayout(),e.updateLabelLayout(),this._updateThumbnailWindow())},n.prototype._updateNodeAndLinkScale=function(){var t=this._model,e=t.getData(),n=Jl(t);e.eachItemGraphicEl(function(t,e){t&&t.setSymbolScale(n)})},n.prototype.updateLayout=function(t){this._active&&(Su(t.getGraph(),Jl(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout())},n.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()},n.prototype._getThumbnailInfo=function(){var t=this._model,e=t.coordinateSystem;if("view"===e.type){var n=function(t){if(t)return fC(t).bridge}(t);if(n)return{bridge:n,coordSys:e}}},n.prototype._updateThumbnailWindow=function(){var t=this._getThumbnailInfo();t&&t.bridge.updateWindow(t.coordSys.transform,this._api)},n.prototype._renderThumbnail=function(t,e,n,i){var r=this._getThumbnailInfo();if(r){var s=new Em,l=n.group.children(),u=i.group.children(),h=new Em,c=new Em;s.add(c),s.add(h);for(var d=0;d=0&&t.call(e,n[o],o)},t.prototype.eachEdge=function(t,e){for(var n=this.edges,i=n.length,o=0;o=0&&n[o].node1.dataIndex>=0&&n[o].node2.dataIndex>=0&&t.call(e,n[o],o)},t.prototype.breadthFirstTraverse=function(t,e,n,i){if(e instanceof vC||(e=this._nodesMap[Mu(e)]),e){for(var o="out"===n?"outEdges":"in"===n?"inEdges":"edges",r=0;r=0&&n.node2.dataIndex>=0}),o=0,r=i.length;o=0&&!t.hasKey(p)&&(t.set(p,!0),r.push(d.node1))}for(s=0;s=0&&!t.hasKey(v)&&(t.set(v,!0),a.push(y.node2))}}}return{edge:t.keys(),node:e.keys()}},t}(),_C=function(){function t(t,e,n){this.dataIndex=-1,this.node1=t,this.node2=e,this.dataIndex=null==n?-1:n}return t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(t)},t.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},t.prototype.getTrajectoryDataIndices=function(){var t=B(),e=B();t.set(this.dataIndex,!0);for(var n=[this.node1],i=[this.node2],o=0;o=0&&!t.hasKey(u)&&(t.set(u,!0),n.push(l.node1))}for(o=0;o=0&&!t.hasKey(d)&&(t.set(d,!0),i.push(c.node2))}return{edge:t.keys(),node:e.keys()}},t}();u(vC,Cu("hostGraph","data")),u(_C,Cu("hostGraph","edgeData"));const xC=yC;var wC=Ln(),bC=function(t){this.coordSysDims=[],this.axisMap=B(),this.categoryAxisMap=B(),this.coordSysName=t},SC={cartesian2d:function(t,e,n,i){var o=t.getReferringComponents("xAxis",Km).models[0],r=t.getReferringComponents("yAxis",Km).models[0];e.coordSysDims=["x","y"],n.set("x",o),n.set("y",r),Ru(o)&&(i.set("x",o),e.firstCategoryDimIndex=0),Ru(r)&&(i.set("y",r),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,n,i){var o=t.getReferringComponents("singleAxis",Km).models[0];e.coordSysDims=["single"],n.set("single",o),Ru(o)&&(i.set("single",o),e.firstCategoryDimIndex=0)},polar:function(t,e,n,i){var o=t.getReferringComponents("polar",Km).models[0],r=o.findAxisModel("radiusAxis"),a=o.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],n.set("radius",r),n.set("angle",a),Ru(r)&&(i.set("radius",r),e.firstCategoryDimIndex=0),Ru(a)&&(i.set("angle",a),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},geo:function(t,e,n,i){e.coordSysDims=["lng","lat"]},parallel:function(t,e,n,i){var o=t.ecModel,r=o.getComponent("parallel",t.get("parallelIndex")),a=e.coordSysDims=r.dimensions.slice();c(r.parallelAxisIndex,function(t,r){var s=o.getComponent("parallelAxis",t),l=a[r];n.set(l,s),Ru(s)&&(i.set(l,s),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=r))})},matrix:function(t,e,n,i){var o=t.getReferringComponents("matrix",Km).models[0];e.coordSysDims=["x","y"];var r=o.getDimensionModel("x"),a=o.getDimensionModel("y");n.set("x",r),n.set("y",a),i.set("x",r),i.set("y",a)}};const TC=function(t,e,n){n=n||{};var i,o=e.getSourceManager(),r=!1;t?(r=!0,i=br(t)):r=(i=o.getSource()).sourceFormat===ox;var a=function(t){var e=t.get("coordinateSystem"),n=new bC(e),i=SC[e];if(i)return i(t,n,n.axisMap,n.categoryAxisMap),n}(e),s=function(t,e){var n,i=t.get("coordinateSystem"),o=E_.get(i);return e&&e.coordSysDims&&(n=d(e.coordSysDims,function(t){var n={name:t},i=e.axisMap.get(t);if(i){var o=i.get("type");n.type=function(t){return"category"===t?"ordinal":"time"===t?"time":"float"}(o)}return n})),n||(n=o&&(o.getDimensionsInfo?o.getDimensionsInfo():o.dimensions.slice())||["x","y"]),n}(e,a),l=n.useEncodeDefaulter,u=v(l)?l:l?m(tr,s,e):null,h=zu(i,{coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!r}),p=function(t,e,n){var i,o;return n&&c(t,function(t,r){var a=n.categoryAxisMap.get(t.coordDim);a&&(null==i&&(i=r),t.ordinalMeta=a.getOrdinalMeta(),e&&(t.createInvertedIndices=!0)),null!=t.otherDims.itemName&&(o=!0)}),o||null==i||(t[i].otherDims.itemName=0),i}(h.dimensions,n.createInvertedIndices,a),f=r?null:o.getSharedDataStore(h),g=function(t,e,n){var i,o,r,a=(n=n||{}).byIndex,s=n.stackedCoordDimension;!function(t){return!Nl(t.schema)}(e)?(i=(o=e.schema).dimensions,r=e.store):i=e;var l,u,h,d,p=!(!t||!t.get("stack"));if(c(i,function(t,e){_(t)&&(i[e]=t={name:t}),p&&!t.isExtraCoord&&(a||l||!t.ordinalMeta||(l=t),u||"ordinal"===t.type||"time"===t.type||s&&s!==t.coordDim||(u=t))}),!u||a||l||(a=!0),u){h="__\0ecstackresult_"+t.id,d="__\0ecstackedover_"+t.id,l&&(l.createInvertedIndices=!0);var f=u.coordDim,g=u.type,m=0;c(i,function(t){t.coordDim===f&&m++});var y={name:h,coordDim:f,coordDimIndex:m,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length},v={name:d,coordDim:d,coordDimIndex:m+1,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length+1};o?(r&&(y.storeDimIndex=r.ensureCalculationDimension(d,g),v.storeDimIndex=r.ensureCalculationDimension(h,g)),o.appendCalculationDimension(y),o.appendCalculationDimension(v)):(i.push(y),i.push(v))}return{stackedDimension:u&&u.name,stackedByDimension:l&&l.name,isStackedByIndex:a,stackedOverDimension:d,stackResultDimension:h}}(e,{schema:h,store:f}),x=new zM(h,e);x.setCalculationInfo(g);var w=null!=p&&function(t){if(t.sourceFormat===ox)return!y(xn(function(t){for(var e=0;e=0},t.prototype.indexOfName=function(t){return this._getDataWithEncodedVisual().indexOfName(t)},t.prototype.getItemVisual=function(t,e){return this._getDataWithEncodedVisual().getItemVisual(t,e)},t}();const CC=MC;var kC=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.hasSymbolVisual=!0,e}return e(n,t),n.prototype.init=function(e){function n(){return i._categoriesData}t.prototype.init.apply(this,arguments);var i=this;this.legendVisualProvider=new CC(n,n),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},n.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},n.prototype.mergeDefaultAndTheme=function(e){t.prototype.mergeDefaultAndTheme.apply(this,arguments),_n(e,"edgeLabel",["show"])},n.prototype.getInitialData=function(t,e){var n,i=t.edges||t.links||[],o=t.data||t.nodes||[],r=this;if(o&&i){ZM(n=this)&&(n.__curvenessList=[],n.__edgeMap={},HM(n));var a=function(t,e,n,i,o){for(var r=new xC(!0),a=0;a "+f)),h++)}var g,y=n.get("coordinateSystem");if("cartesian2d"===y||"polar"===y||"matrix"===y)g=TC(t,n);else{var v=E_.get(y),_=v&&v.dimensions||[];l(_,"value")<0&&_.concat(["value"]);var x=zu(t,{coordDimensions:_,encodeDefine:n.getEncode()}).dimensions;(g=new zM(x,n)).initData(t)}var w,b,S,T=new zM(["value"],n);return T.initData(u,s),o&&o(g,T),b=(w={mainData:g,struct:r,structAttr:"graph",datas:{node:g,edge:T},datasAttr:{node:"data",edge:"edgeData"}}).mainData,(S=w.datas)||(S={main:b},w.datasAttr={main:"data"}),w.datas=w.mainData=null,Au(b,S,w),c(S,function(t){c(b.TRANSFERABLE_METHODS,function(e){t.wrapMethod(e,m(ku,w))})}),b.wrapMethod("cloneShallow",m(Lu,w)),c(b.CHANGABLE_METHODS,function(t){b.wrapMethod(t,m(Iu,w))}),O(S[b.dataType]===b),r.update(),r}(o,i,this,0,function(t,e){function n(t,e){var n=o.call(this,t,e);return n.resolveParentPath=i,n}function i(t){if(t&&("label"===t[0]||"label"===t[1])){var e=t.slice();return"label"===t[0]?e[0]="edgeLabel":"label"===t[1]&&(e[1]="edgeLabel"),e}return t}t.wrapMethod("getItemModel",function(t){var e=r._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t});var o=i_.prototype.getModel;e.wrapMethod("getItemModel",function(t){return t.resolveParentPath=i,t.getModel=n,t})});return c(a.edges,function(t){!function(t,e,n,i){if(ZM(n)){var o=WM(t,e,n),r=n.__edgeMap,a=r[jM(o)];r[o]&&!a?r[o].isForward=!0:a&&r[o]&&(a.isForward=!0,r[o].isForward=!1),r[o]=r[o]||[],r[o].push(i)}}(t.node1,t.node2,this,t.dataIndex)},this),a.data}},n.prototype.getGraph=function(){return this.getData().graph},n.prototype.getEdgeData=function(){return this.getGraph().edgeData},n.prototype.getCategoriesData=function(){return this._categoriesData},n.prototype.formatTooltip=function(t,e,n){if("edge"===n){var i=this.getData(),o=this.getDataParams(t,n),r=i.graph.getEdgeByIndex(t),a=i.getName(r.node1.dataIndex),s=i.getName(r.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),$r("nameValue",{name:l.join(" > "),value:o.value,noValue:null==o.value})}return sa({series:this,dataIndex:t,multipleSeries:e})},n.prototype._updateCategoriesData=function(){var t=d(this.option.categories||[],function(t){return null!=t.value?t:a({value:0},t)}),e=new zM(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray(function(t){return e.getItemModel(t)})},n.prototype.setZoom=function(t){this.option.zoom=t},n.prototype.setCenter=function(t){this.option.center=t},n.prototype.isAnimationEnabled=function(){return t.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},n.type="series.graph",n.dependencies=["grid","polar","geo","singleAxis","calendar"],n.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:X_.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:X_.color.primary}}},n}(_w);const IC=kC,LC=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.hasSymbolVisual=!0,e}return e(n,t),n.prototype.getInitialData=function(t,e){return TC(null,this,{useEncodeDefaulter:!0})},n.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?5e3:this.get("progressive"):t},n.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?1e4:this.get("progressiveThreshold"):t},n.prototype.brushSelector=function(t,e,n){return n.point(e.getItemLayout(t))},n.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},n.type="series.scatter",n.dependencies=["grid","polar","geo","singleAxis","calendar","matrix"],n.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:X_.color.primary}},universalTransition:{divideShape:"clone"}},n}(_w);var PC=function(){},DC=function(t){function n(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return e(n,t),n.prototype.getDefaultShape=function(){return new PC},n.prototype.reset=function(){this.notClear=!1,this._off=0},n.prototype.buildPath=function(t,e){var n,i=e.points,o=e.size,r=this.symbolProxy,a=r.shape,s=t.getContext?t.getContext():t,l=this.softClipShape;if(s&&o[0]<4)this._ctx=s;else{for(this._ctx=null,n=this._off;n=0;s--){var l=2*s,u=i[l]-r/2,h=i[l+1]-a/2;if(t>=u&&e>=h&&t<=u+r&&e<=h+a)return s}return-1},n.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e);return this.getBoundingRect().contain(t=n[0],e=n[1])?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},n.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape,n=e.points,i=e.size,o=i[0],r=i[1],a=1/0,s=1/0,l=-1/0,u=-1/0,h=0;h=0&&(l.dataIndex=n+(t.startIndex||0))})},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}();const OC=AC;var zC="undefined"!=typeof Float32Array,EC=zC?Float32Array:Array;const RC=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){var i=t.getData();this._updateSymbolDraw(i,t).updateData(i,{clipShape:this._getClipShape(t)}),this._finished=!0},n.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData();this._updateSymbolDraw(i,t).incrementalPrepareUpdate(i),this._finished=!1},n.prototype.incrementalRender=function(t,e,n){this._symbolDraw.incrementalUpdate(t,e.getData(),{clipShape:this._getClipShape(e)}),this._finished=t.end===e.getData().count()},n.prototype.updateTransform=function(t,e,n){var i=t.getData();if(this.group.dirty(),!this._finished||i.count()>1e4)return{update:!0};var o=Nu("").reset(t,e,n);o.progress&&o.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout(i)},n.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},n.prototype._getClipShape=function(t){if(t.get("clip",!0)){var e=t.coordinateSystem;return e&&e.getArea&&e.getArea(.1)}},n.prototype._updateSymbolDraw=function(t,e){var n=this._symbolDraw,i=e.pipelineContext.large;return n&&i===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=i?new OC:new nC,this._isLargeDraw=i,this.group.removeAll()),this.group.add(n.group),n},n.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},n.prototype.dispose=function(){},n.type="scatter",n}(Kb);var BC={left:0,right:0,top:0,bottom:0},NC=["25%","25%"];const FC=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.mergeDefaultAndTheme=function(e,n){var i=Jo(e.outerBounds);t.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&e.outerBounds&&$o(e.outerBounds,i)},n.prototype.mergeOption=function(e,n){t.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&e.outerBounds&&$o(this.option.outerBounds,e.outerBounds)},n.type="grid",n.dependencies=["xAxis","yAxis"],n.layoutMode="box",n.defaultOption={show:!1,z:0,left:"15%",top:65,right:"10%",bottom:80,containLabel:!1,outerBoundsMode:"auto",outerBounds:BC,outerBoundsContain:"all",outerBoundsClampWidth:NC[0],outerBoundsClampHeight:NC[1],backgroundColor:X_.color.transparent,borderWidth:1,borderColor:X_.color.neutral30},n}(W_);var VC=function(){function t(){}return t.prototype.getNeedCrossZero=function(){return!this.option.scale},t.prototype.getCoordSysModel=function(){},t}(),ZC=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Km).models[0]},n.type="cartesian2dAxis",n}(W_);u(ZC,VC);var HC={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:X_.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:X_.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:X_.color.axisSplitLine,width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:[X_.color.backgroundTint,X_.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:X_.color.neutral00,borderColor:X_.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:"auto"}},WC=r({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},HC),jC=r({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:X_.color.axisMinorSplitLine,width:1}}},HC);const GC={category:WC,value:jC,time:r({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},jC),log:s({logBase:10},jC)};var UC=0;const YC=function(){function t(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++UC,this._onCollect=t.onCollect}return t.createByAxisModel=function(e){var n=e.option,i=n.data,o=i&&d(i,Fu);return new t({categories:o,needCollect:!o,deduplication:!1!==n.dedplication})},t.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},t.prototype.parseAndCollect=function(t){var e,n=this._needCollect;if(!_(t)&&!n)return t;if(n&&!this._deduplication)return this.categories[e=this.categories.length]=t,this._onCollect&&this._onCollect(t,e),e;var i=this._getOrCreateMap();return null==(e=i.get(t))&&(n?(this.categories[e=this.categories.length]=t,i.set(t,e),this._onCollect&&this._onCollect(t,e)):e=NaN),e},t.prototype._getOrCreateMap=function(){return this._map||(this._map=B(this.categories))},t}();var XC={value:1,category:1,time:1,log:1},qC=null,KC=function(){function t(){this.normalize=Xu,this.scale=qu}return t.prototype.updateMethods=function(t){t.hasBreaks()?(this.normalize=_f(t.normalize,t),this.scale=_f(t.scale,t)):(this.normalize=Xu,this.scale=qu)},t}(),$C=function(){function t(t){this._calculator=new KC,this._setting=t||{},this._extent=[1/0,-1/0];var e=vo();e&&(this._brkCtx=e.createScaleBreakContext(),this._brkCtx.update(this._extent))}return t.prototype.getSetting=function(t){return this._setting[t]},t.prototype._innerUnionExtent=function(t){var e=this._extent;this._innerSetExtent(t[0]e[1]?t[1]:e[1])},t.prototype.unionExtentFromData=function(t,e){this._innerUnionExtent(t.getApproximateExtent(e))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(t,e){this._innerSetExtent(t,e)},t.prototype._innerSetExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e),this._brkCtx&&this._brkCtx.update(n)},t.prototype.setBreaksFromOption=function(t){var e=vo();e&&this._innerSetBreak(e.parseAxisBreakOption(t,_f(this.parse,this)))},t.prototype._innerSetBreak=function(t){this._brkCtx&&(this._brkCtx.setBreaks(t),this._calculator.updateMethods(this._brkCtx),this._brkCtx.update(this._extent))},t.prototype._innerGetBreaks=function(){return this._brkCtx?this._brkCtx.breaks:[]},t.prototype.hasBreaks=function(){return!!this._brkCtx&&this._brkCtx.hasBreaks()},t.prototype._getExtentSpanWithBreaks=function(){return this._brkCtx&&this._brkCtx.hasBreaks()?this._brkCtx.getExtentSpan():this._extent[1]-this._extent[0]},t.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(t){this._isBlank=t},t}();Fn($C);const JC=$C;var QC=function(t){function n(e){var n=t.call(this,e)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new YC({})),y(i)&&(i=new YC({categories:d(i,function(t){return b(t)?t.value:t})})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return e(n,t),n.prototype.parse=function(t){return null==t?NaN:_(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},n.prototype.contain=function(t){return Yu(t,this._extent)&&t>=0&&t=0&&t=0&&t=t},n.prototype.getOrdinalMeta=function(){return this._ordinalMeta},n.prototype.calcNiceTicks=function(){},n.prototype.calcNiceExtent=function(){},n.type="ordinal",n}(JC);JC.registerClass(QC);const tk=QC;var ek=rn,nk=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="interval",e._interval=0,e._intervalPrecision=2,e}return e(n,t),n.prototype.parse=function(t){return null==t||""===t?NaN:Number(t)},n.prototype.contain=function(t){return Yu(t,this._extent)},n.prototype.normalize=function(t){return this._calculator.normalize(t,this._extent)},n.prototype.scale=function(t){return this._calculator.scale(t,this._extent)},n.prototype.getInterval=function(){return this._interval},n.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=Gu(t)},n.prototype.getTicks=function(t){t=t||{};var e=this._interval,n=this._extent,i=this._niceExtent,o=this._intervalPrecision,r=vo(),a=[];if(!e)return a;if("only_break"===t.breakTicks&&r)return r.addBreaksToTicks(a,this._brkCtx.breaks,this._extent),a;n[0]=0&&(l=ek(l+u*e,o))}if(a.length>0&&l===a[a.length-1].value)break;if(a.length>1e4)return[]}var h=a.length?a[a.length-1].value:i[1];return n[1]>h&&a.push(t.expandToNicedExtent?{value:ek(h+e,o)}:{value:n[1]}),r&&r.pruneTicksByBreak(t.pruneByBreak,a,this._brkCtx.breaks,function(t){return t.value},this._interval,this._extent),"none"!==t.breakTicks&&r&&r.addBreaksToTicks(a,this._brkCtx.breaks,this._extent),a},n.prototype.getMinorTicks=function(t){for(var e=this.getTicks({expandToNicedExtent:!0}),n=[],i=this.getExtent(),o=1;oi[0]&&co&&(a=r.interval=o);var s=r.intervalPrecision=Gu(a);return function(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),Uu(t,0,e),Uu(t,1,e),t[0]>t[1]&&(t[0]=t[1])}(r.niceTickExtent=[rn(Math.ceil(t[0]/a)*a,s),rn(Math.floor(t[1]/a)*a,s)],t),r}(i,o,t,e,n);this._intervalPrecision=r.intervalPrecision,this._interval=r.interval,this._niceExtent=r.niceTickExtent}},n.prototype.calcNiceExtent=function(t){var e=this._extent.slice();if(e[0]===e[1])if(0!==e[0]){var n=Math.abs(e[0]);t.fixMax||(e[1]+=n/2),e[0]-=n/2}else e[1]=1;isFinite(e[1]-e[0])||(e[0]=0,e[1]=1),this._innerSetExtent(e[0],e[1]),e=this._extent.slice(),this.calcNiceTicks(t.splitNumber,t.minInterval,t.maxInterval);var i=this._interval,o=this._intervalPrecision;t.fixMin||(e[0]=ek(Math.floor(e[0]/i)*i,o)),t.fixMax||(e[1]=ek(Math.ceil(e[1]/i)*i,o)),this._innerSetExtent(e[0],e[1])},n.prototype.setNiceExtent=function(t,e){this._niceExtent=[t,e]},n.type="interval",n}(JC);JC.registerClass(nk);const ik=nk;var ok="__ec_stack_",rk=function(t){function n(e){var n=t.call(this,e)||this;return n.type="time",n}return e(n,t),n.prototype.getLabel=function(t){var e=this.getSetting("useUTC");return bo(t.value,x_[function(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}(xo(this._minLevelUnit))]||x_.second,e,this.getSetting("locale"))},n.prototype.getFormattedLabel=function(t,e,n){var i=this.getSetting("useUTC");return function(t,e,n,i,o){var r=null;if(_(n))r=n;else if(v(n)){var a={time:t.time,level:t.time.level},s=vo();s&&s.makeAxisLabelFormatterParamBreak(a,t.break),r=n(t.value,e,a)}else{var l=t.time;if(l){var u=n[l.lowerTimeUnit][l.upperTimeUnit];r=u[Math.min(l.level,u.length-1)]||""}else{var h=So(t.value,o);r=n[h][h][0]}}return bo(new Date(t.value),r,o,i)}(t,e,n,this.getSetting("locale"),i)},n.prototype.getTicks=function(t){t=t||{};var e=this._interval,n=this._extent,i=vo(),o=[];if(!e)return o;var r=this.getSetting("useUTC");if(i&&"only_break"===t.breakTicks)return vo().addBreaksToTicks(o,this._brkCtx.breaks,this._extent),o;var a=So(n[1],r);o.push({value:n[0],time:{level:0,upperTimeUnit:a,lowerTimeUnit:a}});var s=function(t,e,n,i,o,r){function a(t,e,n,o,a,s,l){for(var h=function(t,e){var n=new Date(0);n[t](1);var i=n.getTime();n[t](1+e);var o=n.getTime()-i;return function(t,e){return Math.max(0,Math.round((e-t)/o))}}(a,t),c=e,d=new Date(c);c1e4));)if(d[a](d[o]()+t),c=d.getTime(),r){var p=r.calcNiceTickMultiple(c,h);p>0&&(d[a](d[o]()+p*t),c=d.getTime())}l.push({value:c,notAdd:!0})}function s(t,o,r){var s=[],l=!o.length;if(!Qu(xo(t),i[0],i[1],n)){l&&(o=[{value:rh(i[0],t,n)},{value:i[1]}]);for(var u=0;u=i[0]&&h<=i[1]&&a(d,h,c,p,f,0,s),"year"===t&&r.length>1&&0===u&&r.unshift({value:r[0].value-d})}}for(u=0;u=i[0]&&x<=i[1]&&p++)}var w=o/e;if(p>1.5*w&&g>w/1.5)break;if(h.push(v),p>w||t===l[m])break}c=[]}}var b=f(d(h,function(t){return f(t,function(t){return t.value>=i[0]&&t.value<=i[1]&&!t.notAdd})}),function(t){return t.length>0}),S=[],T=b.length-1;for(m=0;mn&&(this._approxInterval=n);var o=ak.length,r=Math.min(function(t,e,n,i){for(;n>>1;t[o][1]0;)i*=10;var o=[lk(hk(e[0]/i)*i),lk(uk(e[1]/i)*i)];this._interval=i,this._intervalPrecision=Gu(i),this._niceExtent=o}},n.prototype.calcNiceExtent=function(e){t.prototype.calcNiceExtent.call(this,e),this._fixMin=e.fixMin,this._fixMax=e.fixMax},n.prototype.contain=function(e){return e=dk(e)/dk(this.base),t.prototype.contain.call(this,e)},n.prototype.normalize=function(e){return e=dk(e)/dk(this.base),t.prototype.normalize.call(this,e)},n.prototype.scale=function(e){return e=t.prototype.scale.call(this,e),ck(this.base,e)},n.prototype.setBreaksFromOption=function(t){var e=vo();if(e){var n=e.logarithmicParseBreaksFromOption(t,this.base,_f(this.parse,this)),i=n.parsedLogged;this._originalScale._innerSetBreak(n.parsedOriginal),this._innerSetBreak(i)}},n.type="log",n}(ik);JC.registerClass(pk);const fk=pk;var gk=function(){function t(t,e,n){this._prepareParams(t,e,n)}return t.prototype._prepareParams=function(t,e,n){n[1]0&&s>0&&!l&&(a=0),a<0&&s<0&&!u&&(s=0));var c=this._determinedMin,d=this._determinedMax;return null!=c&&(a=c,l=!0),null!=d&&(s=d,u=!0),{min:a,max:s,minFixed:l,maxFixed:u,isBlank:h}},t.prototype.modifyDataMinMax=function(t,e){this[yk[t]]=e},t.prototype.setDeterminedMinMax=function(t,e){this[mk[t]]=e},t.prototype.freeze=function(){this.frozen=!0},t}(),mk={min:"_determinedMin",max:"_determinedMax"},yk={min:"_dataMin",max:"_dataMax"},vk=function(){function t(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return t.prototype.getAxis=function(t){return this._axes[t]},t.prototype.getAxes=function(){return d(this._dimList,function(t){return this._axes[t]},this)},t.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),f(this.getAxes(),function(e){return e.scale.type===t})},t.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},t}(),_k=["x","y"],xk=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cartesian2d",e.dimensions=_k,e}return e(n,t),n.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,e=this.getAxis("y").scale;if(_h(t)&&_h(e)){var n=t.getExtent(),i=e.getExtent(),o=this.dataToPoint([n[0],i[0]]),r=this.dataToPoint([n[1],i[1]]),a=n[1]-n[0],s=i[1]-i[0];if(a&&s){var l=(r[0]-o[0])/a,u=(r[1]-o[1])/s,h=this._transform=[l,0,0,u,o[0]-n[0]*l,o[1]-i[0]*u];this._invTransform=bt([],h)}}},n.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},n.prototype.containPoint=function(t){var e=this.getAxis("x"),n=this.getAxis("y");return e.contain(e.toLocalCoord(t[0]))&&n.contain(n.toLocalCoord(t[1]))},n.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},n.prototype.containZone=function(t,e){var n=this.dataToPoint(t),i=this.dataToPoint(e),o=this.getArea(),r=new lg(n[0],n[1],i[0]-n[0],i[1]-n[1]);return o.intersect(r)},n.prototype.dataToPoint=function(t,e,n){n=n||[];var i=t[0],o=t[1];if(this._transform&&null!=i&&isFinite(i)&&null!=o&&isFinite(o))return et(n,t,this._transform);var r=this.getAxis("x"),a=this.getAxis("y");return n[0]=r.toGlobalCoord(r.dataToCoord(i,e)),n[1]=a.toGlobalCoord(a.dataToCoord(o,e)),n},n.prototype.clampData=function(t,e){var n=this.getAxis("x").scale,i=this.getAxis("y").scale,o=n.getExtent(),r=i.getExtent(),a=n.parse(t[0]),s=i.parse(t[1]);return(e=e||[])[0]=Math.min(Math.max(Math.min(o[0],o[1]),a),Math.max(o[0],o[1])),e[1]=Math.min(Math.max(Math.min(r[0],r[1]),s),Math.max(r[0],r[1])),e},n.prototype.pointToData=function(t,e,n){if(n=n||[],this._invTransform)return et(n,t,this._invTransform);var i=this.getAxis("x"),o=this.getAxis("y");return n[0]=i.coordToData(i.toLocalCoord(t[0]),e),n[1]=o.coordToData(o.toLocalCoord(t[1]),e),n},n.prototype.getOtherAxis=function(t){return this.getAxis("x"===t.dim?"y":"x")},n.prototype.getArea=function(t){t=t||0;var e=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),i=Math.min(e[0],e[1])-t,o=Math.min(n[0],n[1])-t,r=Math.max(e[0],e[1])-i+t,a=Math.max(n[0],n[1])-o+t;return new lg(i,o,r,a)},n}(vk);const wk=xk;var bk=Ln(),Sk=Ln(),Tk=1,Mk=2,Ck=Sh("axisTick"),kk=Sh("axisLabel"),Ik=[0,1],Lk=function(){function t(t,e,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=n||[0,0]}return t.prototype.contain=function(t){var e=this._extent,n=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return t>=n&&t<=i},t.prototype.containData=function(t){return this.scale.contain(this.scale.parse(t))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(t){return sn(t||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(t,e){var n=this._extent;n[0]=t,n[1]=e},t.prototype.dataToCoord=function(t,e){var n=this._extent,i=this.scale;return t=i.normalize(i.parse(t)),this.onBand&&"ordinal"===i.type&&Ph(n=n.slice(),i.count()),nn(t,Ik,n,e)},t.prototype.coordToData=function(t,e){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&Ph(n=n.slice(),i.count());var o=nn(t,n,Ik,e);return this.scale.scale(o)},t.prototype.pointToData=function(t,e){},t.prototype.getTicksCoords=function(t){var e=(t=t||{}).tickModel||this.getTickModel(),n=d(function(t,e,n){var i=t.getTickModel().get("customValues");if(i){var o=t.scale.getExtent();return{ticks:f(wh(t,i),function(t){return t>=o[0]&&t<=o[1]})}}return"category"===t.type?function(t,e){var n,i,o=Ck(t),r=ph(e),a=Th(o,r);if(a)return a;if(e.get("show")&&!t.scale.isBlank()||(n=[]),v(r))n=Lh(t,r,!0);else if("auto"===r){var s=bh(t,t.getLabelModel(),xh(Mk));i=s.labelCategoryInterval,n=d(s.labels,function(t){return t.tickValue})}else n=Ih(t,i=r,!0);return Mh(o,r,{ticks:n,tickCategoryInterval:i})}(t,e):{ticks:d(t.scale.getTicks(n),function(t){return t.value})}}(this,e,{breakTicks:t.breakTicks,pruneByBreak:t.pruneByBreak}).ticks,function(t){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(t):t),tickValue:t}},this);return function(t,e,n,i){function o(t,e){return t=rn(t),e=rn(e),h?t>e:ts[1];o(e[0].coord,s[0])&&(i?e[0].coord=s[0]:e.shift()),i&&o(s[0],e[0].coord)&&e.unshift({coord:s[0],onBand:!0}),o(s[1],a.coord)&&(i?a.coord=s[1]:e.pop()),i&&o(a.coord,s[1])&&e.push({coord:s[1],onBand:!0})}}(this,n,e.get("alignWithLabel"),t.clamp),n},t.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)return[];var t=this.model.getModel("minorTick").get("splitNumber");return t>0&&t<100||(t=5),d(this.scale.getMinorTicks(t),function(t){return d(t,function(t){return{coord:this.dataToCoord(t),tickValue:t}},this)},this)},t.prototype.getViewLabels=function(t){return function(t,e){var n=t.getLabelModel().get("customValues");if(n){var i=ch(t),o=t.scale.getExtent();return{labels:d(f(wh(t,n),function(t){return t>=o[0]&&t<=o[1]}),function(e){var n={value:e};return{formattedLabel:i(n),rawLabel:t.scale.getLabel(n),tickValue:e,time:void 0,break:void 0}})}}return"category"===t.type?function(t,e){var n=t.getLabelModel(),i=bh(t,n,e);return!n.get("show")||t.scale.isBlank()?{labels:[]}:i}(t,e):function(t){var e=t.scale.getTicks(),n=ch(t);return{labels:d(e,function(e,i){return{formattedLabel:n(e,i),rawLabel:t.scale.getLabel(e),tickValue:e.value,time:e.time,break:e.break}})}}(t)}(this,t=t||xh(Mk)).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),n=e[1]-e[0]+(this.onBand?1:0);0===n&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},t.prototype.calculateCategoryInterval=function(t){return function(t,e){var n=e.kind,i=function(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}(t),o=ch(t),r=(i.axisRotate-i.labelRotate)/180*Math.PI,a=t.scale,s=a.getExtent(),l=a.count();if(s[1]-s[0]<1)return 0;var u=1;l>40&&(u=Math.max(1,Math.floor(l/40)));for(var h=s[0],c=t.dataToCoord(h+1)-t.dataToCoord(h),d=Math.abs(c*Math.cos(r)),p=Math.abs(c*Math.sin(r)),f=0,g=0;h<=s[1];h+=u){var m,y=Ge(o({value:h}),i.font,"center","top");m=1.3*y.height,f=Math.max(f,1.3*y.width,7),g=Math.max(g,m,7)}var v=f/d,_=g/p;isNaN(v)&&(v=1/0),isNaN(_)&&(_=1/0);var x=Math.max(0,Math.floor(Math.min(v,_)));if(n===Tk)return e.out.noPxChangeTryDetermine.push(_f(Ch,null,t,x,l)),x;var w=kh(t,x,l);return null!=w?w:x}(this,t=t||xh(Mk))},t}(),Pk=function(t){function n(e,n,i,o,r){var a=t.call(this,e,n,i)||this;return a.index=0,a.type=o||"value",a.position=r||"bottom",a}return e(n,t),n.prototype.isHorizontal=function(){var t=this.position;return"top"===t||"bottom"===t},n.prototype.getGlobalExtent=function(t){var e=this.getExtent();return e[0]=this.toGlobalCoord(e[0]),e[1]=this.toGlobalCoord(e[1]),t&&e[0]>e[1]&&e.reverse(),e},n.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},n.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},n}(Lk);const Dk=Pk;var Ak=["label","labelLine","layoutOption","priority","defaultAttr","marginForce","minMarginForce","marginDefault","suggestIgnore"],Ok=[0,0,0,0],zk="expandAxisBreak",Ek=Math.PI,Rk=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],Bk=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],Nk=Ln(),Fk=Ln(),Vk=function(){function t(t){this.recordMap={},this.resolveAxisNameOverlap=t}return t.prototype.ensureRecord=function(t){var e=t.axis.dim,n=t.componentIndex,i=this.recordMap,o=i[e]||(i[e]=[]);return o[n]||(o[n]={ready:{}})},t}(),Zk=[1,0,0,1,0,0],Hk=new lg(0,0,0,0),Wk=function(t,e,n,i,o,r){if(mh(t.nameLocation)){var a=r.stOccupiedRect;a&&Bh(function(t,e,n){return t.transform=ls(t.transform,n),t.localRect=ss(t.localRect,e),t.rect=ss(t.rect,e),n&&t.rect.applyTransform(n),t.axisAligned=as(n),t.obb=void 0,(t.label=t.label||{}).ignore=!1,t}({},a,r.transGroup.transform),i,o)}else Nh(r.labelInfoList,r.dirVec,i,o)},jk=function(){function t(t,e,n,i){this.group=new Em,this._axisModel=t,this._api=e,this._local={},this._shared=i||new Vk(Wk),this._resetCfgDetermined(n)}return t.prototype.updateCfg=function(t){var e=this._cfg.raw;e.position=t.position,e.labelOffset=t.labelOffset,this._resetCfgDetermined(e)},t.prototype.__getRawCfg=function(){return this._cfg.raw},t.prototype._resetCfgDetermined=function(t){var e=this._axisModel,n=e.getDefaultOption?e.getDefaultOption():{},i=L(t.axisName,e.get("name")),o=e.get("nameMoveOverlap");null!=o&&"auto"!==o||(o=L(t.defaultNameMoveOverlap,!0));var r={raw:t,position:t.position,rotation:t.rotation,nameDirection:L(t.nameDirection,1),tickDirection:L(t.tickDirection,1),labelDirection:L(t.labelDirection,1),labelOffset:L(t.labelOffset,0),silent:L(t.silent,!0),axisName:i,nameLocation:P(e.get("nameLocation"),n.nameLocation,"end"),shouldNameMoveOverlap:Gh(i)&&o,optionHideOverlap:e.get(["axisLabel","hideOverlap"]),showMinorTicks:e.get(["minorTick","show"])};this._cfg=r;var a=new Em({x:r.position[0],y:r.position[1],rotation:r.rotation});a.updateTransform(),this._transformGroup=a;var s=this._shared.ensureRecord(e);s.transGroup=this._transformGroup,s.dirVec=new Gf(Math.cos(-r.rotation),Math.sin(-r.rotation))},t.prototype.build=function(t,e){var n=this;return t||(t={axisLine:!0,axisTickLabelEstimate:!1,axisTickLabelDetermine:!0,axisName:!0}),c(Gk,function(i){t[i]&&Uk[i](n._cfg,n._local,n._shared,n._axisModel,n.group,n._transformGroup,n._api,e||{})}),this},t.innerTextLayout=function(t,e,n){var i,o,r=un(e-t);return hn(r)?(o=n>0?"top":"bottom",i="center"):hn(r-Ek)?(o=n>0?"bottom":"top",i="center"):(o="middle",i=r>0&&r0?"right":"left":n>0?"left":"right"),{rotation:r,textAlign:i,textVerticalAlign:o}},t.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},t.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},t}(),Gk=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],Uk={axisLine:function(t,e,n,i,o,r,s){var l=i.get(["axisLine","show"]);if("auto"===l&&(l=!0,null!=t.raw.axisLineAutoShow&&(l=!!t.raw.axisLineAutoShow)),l){var u=i.axis.getExtent(),h=r.transform,d=[u[0],0],p=[u[1],0],f=d[0]>p[0];h&&(et(d,d,h),et(p,p,h));var g=a({lineCap:"round"},i.getModel(["axisLine","lineStyle"]).getLineStyle()),m={strokeContainThreshold:t.raw.strokeContainThreshold||5,silent:!0,z2:1,style:g};if(i.get(["axisLine","breakLine"])&&i.axis.scale.hasBreaks())Vu().buildAxisBreakLine(i,o,r,m);else{var y=new cb(a({shape:{x1:d[0],y1:d[1],x2:p[0],y2:p[1]}},m));Ha(y.shape,y.style.lineWidth),y.anid="line",o.add(y)}var v=i.get(["axisLine","symbol"]);if(null!=v){var x=i.get(["axisLine","symbolSize"]);_(v)&&(v=[v,v]),(_(x)||w(x))&&(x=[x,x]);var b=Bs(i.get(["axisLine","symbolOffset"])||0,x),S=x[0],T=x[1];c([{rotate:t.rotation+Math.PI/2,offset:b[0],r:0},{rotate:t.rotation-Math.PI/2,offset:b[1],r:Math.sqrt((d[0]-p[0])*(d[0]-p[0])+(d[1]-p[1])*(d[1]-p[1]))}],function(e,n){if("none"!==v[n]&&null!=v[n]){var i=Es(v[n],-S/2,-T/2,S,T,g.stroke,!0),r=e.r+e.offset,a=f?p:d;i.attr({rotation:e.rotate,x:a[0]+r*Math.cos(t.rotation),y:a[1]-r*Math.sin(t.rotation),silent:!0,z2:11}),o.add(i)}})}}},axisTickLabelEstimate:function(t,e,n,i,o,r,a,s){Hh(e,o,s)&&Fh(t,e,n,i,o,r,a,Tk)},axisTickLabelDetermine:function(t,e,n,i,o,r,a,l){Hh(e,o,l)&&Fh(t,e,n,i,o,r,a,Mk);var u=function(t,e,n,i){var o=i.axis,r=i.getModel("axisTick"),a=r.get("show");if("auto"===a&&(a=!0,null!=t.raw.axisTickAutoShow&&(a=!!t.raw.axisTickAutoShow)),!a||o.scale.isBlank())return[];for(var l=r.getModel("lineStyle"),u=t.tickDirection*r.get("length"),h=Zh(o.getTicksCoords(),n.transform,u,s(l.getLineStyle(),{stroke:i.get(["axisLine","lineStyle","color"])}),"ticks"),c=0;ci[1],l="start"===e&&!s||"start"!==e&&s;return hn(a-Ek/2)?(r=l?"bottom":"top",o="center"):hn(a-1.5*Ek)?(r=l?"top":"bottom",o="center"):(r="middle",o=a<1.5*Ek&&a>Ek/2?l?"left":"right":l?"right":"left"),{rotation:a,textAlign:o,textVerticalAlign:r}}(t.rotation,h,w||0,f),null!=(x=t.raw.axisNameAvailableWidth)&&(x=Math.abs(x/Math.sin(_.rotation)),!isFinite(x)&&(x=null)));var b=d.getFont(),S=i.get("nameTruncate",!0)||{},T=S.ellipsis,M=I(t.raw.nameTruncateMaxWidth,S.maxWidth,x),C=s.nameMarginLevel||0,k=new Tv({x:m.x,y:m.y,rotation:_.rotation,silent:jk.isLabelSilent(i),style:co(d,{text:u,font:b,overflow:"truncate",width:M,ellipsis:T,fill:d.getTextColor()||i.get(["axisLine","lineStyle","color"]),align:d.get("align")||_.textAlign,verticalAlign:d.get("verticalAlign")||_.textVerticalAlign}),z2:1});if(is({el:k,componentModel:i,itemName:u}),k.__fullText=u,k.anid="name",i.get("triggerEvent")){var L=jk.makeAxisEventDataBase(i);L.targetType="axisName",L.name=u,Mv(k).eventData=L}r.add(k),k.updateTransform(),e.nameEl=k;var P=l.nameLayout=Oh({label:k,priority:k.z2,defaultAttr:{ignore:k.ignore},marginDefault:mh(h)?Rk[C]:Bk[C]});if(l.nameLocation=h,o.add(k),k.decomposeTransform(),t.shouldNameMoveOverlap&&P){var D=n.ensureRecord(i);n.resolveAxisNameOverlap(t,n,i,P,y,D)}}}},Yk=new mv,Xk=new mv;const qk=jk;var Kk=[[3,1],[0,2]],$k=function(){function t(t,e,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=_k,this._initCartesian(t,e,n),this.model=t}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(t,e){function n(t){var e,n=g(t),i=n.length;if(i){for(var o=[],r=i-1;r>=0;r--){var a=t[+n[r]],s=a.model,l=a.scale;Wu(l)&&s.get("alignTicks")&&null==s.get("interval")?o.push(a):(hh(l,s),Wu(l)&&(e=a))}o.length&&(e||hh((e=o.pop()).scale,e.model),c(o,function(t){!function(t,e,n){var i=ik.prototype,o=i.getTicks.call(n),r=i.getTicks.call(n,{expandToNicedExtent:!0}),a=o.length-1,s=i.getInterval.call(n),l=uh(t,e),u=l.extent,h=l.fixMin,c=l.fixMax;"log"===t.type&&(u=Ku(t.base,u,!0)),t.setBreaksFromOption(vh(e)),t.setExtent(u[0],u[1]),t.calcNiceExtent({splitNumber:a,fixMin:h,fixMax:c});var d=i.getExtent.call(t);h&&(u[0]=d[0]),c&&(u[1]=d[1]);var p=i.getInterval.call(t),f=u[0],g=u[1];if(h&&c)p=(g-f)/a;else if(h)for(g=u[0]+p*a;gu[0]&&isFinite(f)&&isFinite(u[0]);)p=ju(p),f=u[1]-p*a;else{t.getTicks().length-1>a&&(p=ju(p));var m=p*a;(f=rn((g=Math.ceil(u[1]/p)*p)-m))<0&&u[0]>=0?(f=0,g=rn(m)):g>0&&u[1]<=0&&(g=0,f=-rn(m))}var y=(o[0].value-r[0].value)/s,v=(o[a].value-r[a].value)/s;i.setExtent.call(t,f+p*y,g+p*v),i.setInterval.call(t,p),(y||v)&&i.setNiceExtent.call(t,f+p,g-p)}(t.scale,t.model,e.scale)}))}}var i=this._axesMap;this._updateScale(t,this.model),n(i.x),n(i.y);var o={};c(i.x,function(t){qh(i,"y",t,o)}),c(i.y,function(t){qh(i,"x",t,o)}),this.resize(this.model,e)},t.prototype.resize=function(t,e,n){var i=Xo(t,e),o=this._rect=Yo(t.getBoxLayoutParams(),i.refContainer),r=this._axesMap,a=this._coordsList,s=t.get("containLabel");if($h(r,o),!n){var u=function(t,e,n,i,o){var r=new Vk(Jk);return c(n,function(n){return c(n,function(n){yh(n.model)&&(n.axisBuilder=function(t,e,n,i,o,r){for(var a=Uh(t,n),s=!1,l=!1,u=0;ul[1]&&l.reverse(),(null==a||a>l[1])&&(a=l[1]),aa)return!0;if(r){var s=nc(t).seriesDataCount,l=i.getExtent();return Math.abs(l[0]-l[1])/s>a}return!1}return!0===n},t.prototype.makeElOption=function(t,e,n,i,o){},t.prototype.createPointerEl=function(t,e,n,i){var o=e.pointer;if(o){var r=cI(t).pointerEl=new qp[o.type](dI(e.pointer));t.add(r)}},t.prototype.createLabelEl=function(t,e,n,i){if(e.label){var o=cI(t).labelEl=new Tv(dI(e.label));t.add(o),lc(o,i)}},t.prototype.updatePointerEl=function(t,e,n){var i=cI(t).pointerEl;i&&e.pointer&&(i.setStyle(e.pointer.style),n(i,{shape:e.pointer.shape}))},t.prototype.updateLabelEl=function(t,e,n,i){var o=cI(t).labelEl;o&&(o.setStyle(e.label.style),n(o,{x:e.label.x,y:e.label.y}),lc(o,i))},t.prototype._renderHandle=function(t){if(!this._dragging&&this.updateHandleTransform){var e,n=this._axisPointerModel,i=this._api.getZr(),o=this._handle,r=n.getModel("handle"),a=n.get("status");if(!r.get("show")||!a||"hide"===a)return o&&i.remove(o),void(this._handle=null);this._handle||(e=!0,o=this._handle=$a(r.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){Zf(t.event)},onmousedown:pI(this._onHandleDragMove,this,0,0),drift:pI(this._onHandleDragMove,this),ondragend:pI(this._onHandleDragEnd,this)}),i.add(o)),hc(o,n,!1),o.setStyle(r.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=r.get("size");y(s)||(s=[s,s]),o.scaleX=s[0]/2,o.scaleY=s[1]/2,vs(this,"_doDispatchAxisPointer",r.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},t.prototype._moveHandleToValue=function(t,e){ac(this._axisPointerModel,!e&&this._moveAnimation,this._handle,uc(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(t,e){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(uc(n),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(uc(i)),cI(n).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){if(this._handle){var t=this._payloadInfo,e=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),n=this._group,i=this._handle;e&&n&&(this._lastGraphicKey=null,n&&e.remove(n),i&&e.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),_s(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}},t}(),gI=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.makeElOption=function(t,e,n,i,o){var r=n.axis,a=r.grid,s=i.get("type"),l=pc(a,r).getOtherAxis(r).getGlobalExtent(),u=r.toGlobalCoord(r.dataToCoord(e,!0));if(s&&"none"!==s){var h=function(t){var e,n=t.get("type"),i=t.getModel(n+"Style");return"line"===n?(e=i.getLineStyle()).fill=null:"shadow"===n&&((e=i.getAreaStyle()).stroke=null),e}(i),c=mI[s](r,u,l);c.style=h,t.graphicKey=c.type,t.pointer=c}!function(t,e,n,i,o,r){var a=qk.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=o.get(["label","margin"]),function(t,e,n,i,o){var r=cc(n.get("value"),e.axis,e.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),a=n.getModel("label"),s=S_(a.get("padding")||0),l=a.getFont(),u=Ge(r,l),h=o.position,c=u.width+s[1]+s[3],d=u.height+s[0]+s[2],p=o.align;"right"===p&&(h[0]-=c),"center"===p&&(h[0]-=c/2);var f=o.verticalAlign;"bottom"===f&&(h[1]-=d),"middle"===f&&(h[1]-=d/2),function(t,e,n,i){var o=i.getWidth(),r=i.getHeight();t[0]=Math.min(t[0]+e,o)-e,t[1]=Math.min(t[1]+n,r)-n,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}(h,c,d,i);var g=a.get("backgroundColor");g&&"auto"!==g||(g=e.get(["axisLine","lineStyle","color"])),t.label={x:h[0],y:h[1],style:co(a,{text:r,font:l,fill:a.getTextColor(),padding:s,backgroundColor:g}),z2:10}}(e,i,o,r,{position:dc(i.axis,t,n),align:a.textAlign,verticalAlign:a.textVerticalAlign})}(e,t,Uh(a.getRect(),n),n,i,o)},n.prototype.getHandleTransform=function(t,e,n){var i=Uh(e.axis.grid.getRect(),e,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var o=dc(e.axis,t,i);return{x:o[0],y:o[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},n.prototype.updateHandleTransform=function(t,e,n,i){var o=n.axis,r=o.grid,a=o.getGlobalExtent(!0),s=pc(r,o).getOtherAxis(o).getGlobalExtent(),l="x"===o.dim?0:1,u=[t.x,t.y];u[l]+=e[l],u[l]=Math.min(a[1],u[l]),u[l]=Math.max(a[0],u[l]);var h=(s[1]+s[0])/2,c=[h,h];return c[l]=u[l],{x:u[0],y:u[1],rotation:t.rotation,cursorPoint:c,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},n}(fI),mI={line:function(t,e,n){var i,o,r;return{type:"Line",subPixelOptimize:!0,shape:(i=[e,n[0]],o=[e,n[1]],r=fc(t),{x1:i[r=r||0],y1:i[1-r],x2:o[r],y2:o[1-r]})}},shadow:function(t,e,n){var i,o,r,a=Math.max(1,t.getBandWidth());return{type:"Rect",shape:(i=[e-a/2,n[0]],o=[a,n[1]-n[0]],r=fc(t),{x:i[r=r||0],y:i[1-r],width:o[r],height:o[1-r]})}}};const yI=gI,vI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="axisPointer",n.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:X_.color.border,width:1,type:"dashed"},shadowStyle:{color:X_.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:X_.color.neutral00,padding:[5,7,5,7],backgroundColor:X_.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:X_.color.accent40,throttle:40}},n}(W_);var _I=Ln(),xI=c,wI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){var i=e.getComponent("tooltip"),o=t.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";gc("axisPointer",n,function(t,e,n){"none"!==o&&("leave"===t||o.indexOf(t)>=0)&&n({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})})},n.prototype.remove=function(t,e){vc("axisPointer",e)},n.prototype.dispose=function(t,e){vc("axisPointer",e)},n.type="axisPointer",n}(ww);const bI=wI;var SI=Ln();const TI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="tooltip",n.dependencies=["axisPointer"],n.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:X_.color.neutral00,shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:X_.color.border,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:X_.color.borderShade,width:1,type:"dashed",textStyle:{}}},textStyle:{color:X_.color.tertiary,fontSize:14}},n}(W_);var MI=Ic(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),CI=Lc(Ic(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),"transition"),kI=Lc(MI,"transform"),II="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(Qp.transform3dSupported?"will-change:transform;":""),LI=function(){function t(t,e){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,Qp.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var i=this._zr=t.getZr(),o=e.appendTo,r=o&&(_(o)?document.querySelector(o):M(o)?o:v(o)&&o(t.getDom()));Dc(this._styleCoord,i,r,t.getWidth()/2,t.getHeight()/2),(r||t.getDom()).appendChild(n),this._api=t,this._container=r;var a=this;n.onmouseenter=function(){a._enterable&&(clearTimeout(a._hideTimeout),a._show=!0),a._inContent=!0},n.onmousemove=function(t){if(t=t||window.event,!a._enterable){var e=i.handler;dt(i.painter.getViewportRoot(),t,!0),e.dispatch("mousemove",t)}},n.onmouseleave=function(){a._inContent=!1,a._enterable&&a._show&&a.hideLater(a._hideDelay)}}return t.prototype.update=function(t){if(!this._container){var e=this._api.getDom(),n=(r="position",(a=(o=e).currentStyle||document.defaultView&&document.defaultView.getComputedStyle(o))?r?a[r]:a:null),i=e.style;"absolute"!==i.position&&"absolute"!==n&&(i.position="relative")}var o,r,a,s=t.get("alwaysShowContent");s&&this._moveIfResized(),this._alwaysShowContent=s,this._enableDisplayTransition=t.get("displayTransition")&&t.get("transitionDuration")>0,this.el.className=t.get("className")||""},t.prototype.show=function(t,e){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=n.style,o=this._styleCoord;n.innerHTML?i.cssText=II+function(t,e,n,i){var o=[],r=t.get("transitionDuration"),a=t.get("backgroundColor"),s=t.get("shadowBlur"),l=t.get("shadowColor"),u=t.get("shadowOffsetX"),h=t.get("shadowOffsetY"),d=t.getModel("textStyle"),p=aa(t,"html");return o.push("box-shadow:"+u+"px "+h+"px "+s+"px "+l),e&&r>0&&o.push(function(t,e,n){var i="cubic-bezier(0.23,1,0.32,1)",o="",r="";return n&&(r="opacity"+(o=" "+t/2+"s "+i)+",visibility"+o),e||(o=" "+t+"s "+i,r+=(r.length?",":"")+(Qp.transformSupported?""+kI+o:",left"+o+",top"+o)),CI+":"+r}(r,n,i)),a&&o.push("background-color:"+a),c(["width","color","radius"],function(e){var n="border-"+e,i=Vo(n),r=t.get(i);null!=r&&o.push(n+":"+r+("color"===e?"":"px"))}),o.push(function(t){var e=[],n=t.get("fontSize"),i=t.getTextColor();i&&e.push("color:"+i),e.push("font:"+t.getFont());var o=L(t.get("lineHeight"),Math.round(3*n/2));n&&e.push("line-height:"+o+"px");var r=t.get("textShadowColor"),a=t.get("textShadowBlur")||0,s=t.get("textShadowOffsetX")||0,l=t.get("textShadowOffsetY")||0;return r&&a&&e.push("text-shadow:"+s+"px "+l+"px "+a+"px "+r),c(["decoration","align"],function(n){var i=t.get(n);i&&e.push("text-"+n+":"+i)}),e.join(";")}(d)),null!=p&&o.push("padding:"+S_(p).join("px ")+"px"),o.join(";")+";"}(t,!this._firstShow,this._longHide,this._enableDisplayTransition)+Pc(o[0],o[1],!0)+"border-color:"+Wo(e)+";"+(t.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(t,e,n,i,o){var r=this.el;if(null!=t){var a="";if(_(o)&&"item"===n.get("trigger")&&!kc(n)&&(a=function(t,e,n){if(!_(n)||"inside"===n)return"";var i=t.get("backgroundColor"),o=t.get("borderWidth");e=Wo(e);var r,a,s="left"===(r=n)?"right":"right"===r?"left":"top"===r?"bottom":"top",u=Math.max(1.5*Math.round(o),6),h="",c=kI+":";l(["left","right"],s)>-1?(h+="top:50%",c+="translateY(-50%) rotate("+(a="left"===s?-225:-45)+"deg)"):(h+="left:50%",c+="translateX(-50%) rotate("+(a="top"===s?225:45)+"deg)");var d=a*Math.PI/180,p=u+o,f=p*Math.abs(Math.cos(d))+p*Math.abs(Math.sin(d)),g=e+" solid "+o+"px;";return'
'}(n,i,o)),_(t))r.innerHTML=t+a;else if(t){r.innerHTML="",y(t)||(t=[t]);for(var s=0;s=0?this._tryShow(n,i):"leave"===e&&this._hide(i))},this))},n.prototype._keepShow=function(){var t=this._tooltipModel,e=this._ecModel,n=this._api,i=t.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==i&&"click"!==i){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&o.manuallyShowTip(t,e,n,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},n.prototype.manuallyShowTip=function(t,e,n,i){if(i.from!==this.uid&&!Qp.node&&n.getDom()){var o=Rc(i,n);this._ticket="";var r=i.dataByCoordSys,a=function(t,e,n){var i=Dn(t).queryOptionMap,o=i.keys()[0];if(o&&"series"!==o){var r,a=An(e,o,i.get(o),{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];if(a)return n.getViewOfComponentModel(a).group.traverse(function(e){var n=Mv(e).tooltipConfig;if(n&&n.name===t.name)return r=e,!0}),r?{componentMainType:o,componentIndex:a.componentIndex,el:r}:void 0}}(i,e,n);if(a){var s=a.el.getBoundingRect().clone();s.applyTransform(a.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:a.el,position:i.position,positionDefault:"bottom"},o)}else if(i.tooltip&&null!=i.x&&null!=i.y){var l=AI;l.x=i.x,l.y=i.y,l.update(),Mv(l).tooltipConfig={name:null,option:i.tooltip},this._tryShow({offsetX:i.x,offsetY:i.y,target:l},o)}else if(r)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:r,tooltipOption:i.tooltipOption},o);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(t,e,n,i))return;var u=_c(i,e),h=u.point[0],c=u.point[1];null!=h&&null!=c&&this._tryShow({offsetX:h,offsetY:c,target:u.el,position:i.position,positionDefault:"bottom"},o)}else null!=i.x&&null!=i.y&&(n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},o))}},n.prototype.manuallyHideTip=function(t,e,n,i){this._tooltipModel&&this._tooltipContent.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(Rc(i,n))},n.prototype._manuallyAxisShowTip=function(t,e,n,i){var o=i.seriesIndex,r=i.dataIndex,a=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=o&&null!=r&&null!=a){var s=e.getSeriesByIndex(o);if(s&&"axis"===Ec([s.getData().getItemModel(r),s,(s.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:r,position:i.position}),!0}},n.prototype._tryShow=function(t,e){var n=t.target;if(this._tooltipModel){this._lastX=t.offsetX,this._lastY=t.offsetY;var i=t.dataByCoordSys;if(i&&i.length)this._showAxisTooltip(i,t);else if(n){var o,r;if("legend"===Mv(n).ssrType)return;this._lastDataByCoordSys=null,Os(n,function(t){if(t.tooltipDisabled)return o=r=null,!0;o||r||(null!=Mv(t).dataIndex?o=t:null!=Mv(t).tooltipConfig&&(r=t))},!0),o?this._showSeriesItemTooltip(t,o,e):r?this._showComponentItemTooltip(t,r,e):this._hide(e)}else this._lastDataByCoordSys=null,this._hide(e)}},n.prototype._showOrMove=function(t,e){var n=t.get("showDelay");e=_f(e,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(e,n):e()},n.prototype._showAxisTooltip=function(t,e){var n=this._ecModel,i=this._tooltipModel,o=[e.offsetX,e.offsetY],r=Ec([e.tooltipOption],i),s=this._renderMode,l=[],u=$r("section",{blocks:[],noHeader:!0}),h=[],d=new mw;c(t,function(t){c(t.dataByAxis,function(t){var e=n.getComponent(t.axisDim+"Axis",t.axisIndex),o=t.value;if(e&&null!=o){var r=cc(o,e.axis,n,t.seriesDataIndices,t.valueLabelOpt),p=$r("section",{header:r,noHeader:!z(r),sortBlocks:!0,blocks:[]});u.blocks.push(p),c(t.seriesDataIndices,function(u){var c=n.getSeriesByIndex(u.seriesIndex),f=u.dataIndexInside,g=c.getDataParams(f);if(!(g.dataIndex<0)){g.axisDim=t.axisDim,g.axisIndex=t.axisIndex,g.axisType=t.axisType,g.axisId=t.axisId,g.axisValue=dh(e.axis,{value:o}),g.axisValueLabel=r,g.marker=d.makeTooltipMarker("item",Wo(g.color),s);var m=zr(c.formatTooltip(f,!0,null)),y=m.frag;if(y){var v=Ec([c],i).get("valueFormatter");p.blocks.push(v?a({valueFormatter:v},y):y)}m.text&&h.push(m.text),l.push(g)}})}})}),u.blocks.reverse(),h.reverse();var p=e.position,f=r.get("order"),g=ia(u,d,s,f,n.get("useUTC"),r.get("textStyle"));g&&h.unshift(g);var m=h.join("richText"===s?"\n\n":"
");this._showOrMove(r,function(){this._updateContentNotChangedOnAxis(t,l)?this._updatePosition(r,p,o[0],o[1],this._tooltipContent,l):this._showTooltipContent(r,m,l,Math.random()+"",o[0],o[1],p,null,d)})},n.prototype._showSeriesItemTooltip=function(t,e,n){var i=this._ecModel,o=Mv(e),r=o.seriesIndex,s=i.getSeriesByIndex(r),l=o.dataModel||s,u=o.dataIndex,h=o.dataType,c=l.getData(h),d=this._renderMode,p=t.positionDefault,f=Ec([c.getItemModel(u),l,s&&(s.coordinateSystem||{}).model],this._tooltipModel,p?{position:p}:null),g=f.get("trigger");if(null==g||"item"===g){var m=l.getDataParams(u,h),y=new mw;m.marker=y.makeTooltipMarker("item",Wo(m.color),d);var v=zr(l.formatTooltip(u,!1,h)),_=f.get("order"),x=f.get("valueFormatter"),w=v.frag,b=w?ia(x?a({valueFormatter:x},w):w,y,d,_,i.get("useUTC"),f.get("textStyle")):v.text,S="item_"+l.name+"_"+u;this._showOrMove(f,function(){this._showTooltipContent(f,b,m,S,t.offsetX,t.offsetY,t.position,t.target,y)}),n({type:"showTip",dataIndexInside:u,dataIndex:c.getRawIndex(u),seriesIndex:r,from:this.uid})}},n.prototype._showComponentItemTooltip=function(t,e,n){var i="html"===this._renderMode,r=Mv(e),a=r.tooltipConfig.option||{},s=a.encodeHTMLContent;_(a)&&(a={content:a,formatter:a},s=!0),s&&i&&a.content&&((a=o(a)).content=lt(a.content));var l=[a],u=this._ecModel.getComponent(r.componentMainType,r.componentIndex);u&&l.push(u),l.push({formatter:a.content});var h=t.positionDefault,c=Ec(l,this._tooltipModel,h?{position:h}:null),d=c.get("content"),p=Math.random()+"",f=new mw;this._showOrMove(c,function(){var n=o(c.get("formatterParams")||{});this._showTooltipContent(c,d,n,p,t.offsetX,t.offsetY,t.position,e,f)}),n({type:"showTip",from:this.uid})},n.prototype._showTooltipContent=function(t,e,n,i,o,r,a,s,l){if(this._ticket="",t.get("showContent")&&t.get("show")){var u=this._tooltipContent;u.setEnterable(t.get("enterable"));var h=t.get("formatter");a=a||t.get("position");var c=e,d=this._getNearestPoint([o,r],n,t.get("trigger"),t.get("borderColor"),t.get("defaultBorderColor",!0)).color;if(h)if(_(h)){var p=t.ecModel.get("useUTC"),f=y(n)?n[0]:n;c=h,f&&f.axisType&&f.axisType.indexOf("time")>=0&&(c=bo(f.axisValue,c,p)),c=Ho(c,n,!0)}else if(v(h)){var g=_f(function(e,i){e===this._ticket&&(u.setContent(i,l,t,d,a),this._updatePosition(t,a,o,r,u,n,s))},this);this._ticket=i,c=h(n,i,g)}else c=h;u.setContent(c,l,t,d,a),u.show(t,d),this._updatePosition(t,a,o,r,u,n,s)}},n.prototype._getNearestPoint=function(t,e,n,i,o){return"axis"===n||y(e)?{color:i||o}:y(e)?void 0:{color:i||e.color||e.borderColor}},n.prototype._updatePosition=function(t,e,n,i,o,r,a){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u=o.getSize(),h=t.get("align"),c=t.get("verticalAlign"),d=a&&a.getBoundingRect().clone();if(a&&d.applyTransform(a.transform),v(e)&&(e=e([n,i],r,o.el,d,{viewSize:[s,l],contentSize:u.slice()})),y(e))n=jm(e[0],s),i=jm(e[1],l);else if(b(e)){var p=e;p.width=u[0],p.height=u[1];var f=Yo(p,{width:s,height:l});n=f.x,i=f.y,h=null,c=null}else if(_(e)&&a){var g=function(t,e,n,i){var o=n[0],r=n[1],a=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=e.width,h=e.height;switch(t){case"inside":s=e.x+u/2-o/2,l=e.y+h/2-r/2;break;case"top":s=e.x+u/2-o/2,l=e.y-r-a;break;case"bottom":s=e.x+u/2-o/2,l=e.y+h+a;break;case"left":s=e.x-o-a,l=e.y+h/2-r/2;break;case"right":s=e.x+u+a,l=e.y+h/2-r/2}return[s,l]}(e,d,u,t.get("borderWidth"));n=g[0],i=g[1]}else g=function(t,e,n,i,o,r,a){var s=n.getSize(),l=s[0],u=s[1];return null!=r&&(t+l+r+2>i?t-=l+r:t+=r),null!=a&&(e+u+a>o?e-=u+a:e+=a),[t,e]}(n,i,o,s,l,h?null:20,c?null:20),n=g[0],i=g[1];h&&(n-=Bc(h)?u[0]/2:"right"===h?u[0]:0),c&&(i-=Bc(c)?u[1]/2:"bottom"===c?u[1]:0),kc(t)&&(g=function(t,e,n,i,o){var r=n.getSize(),a=r[0],s=r[1];return t=Math.min(t+a,i)-a,e=Math.min(e+s,o)-s,[t=Math.max(t,0),e=Math.max(e,0)]}(n,i,o,s,l),n=g[0],i=g[1]),o.moveTo(n,i)},n.prototype._updateContentNotChangedOnAxis=function(t,e){var n=this._lastDataByCoordSys,i=this._cbParamsList,o=!!n&&n.length===t.length;return o&&c(n,function(n,r){var a=n.dataByAxis||[],s=(t[r]||{}).dataByAxis||[];(o=o&&a.length===s.length)&&c(a,function(t,n){var r=s[n]||{},a=t.seriesDataIndices||[],l=r.seriesDataIndices||[];(o=o&&t.value===r.value&&t.axisType===r.axisType&&t.axisId===r.axisId&&a.length===l.length)&&c(a,function(t,e){var n=l[e];o=o&&t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex}),i&&c(t.seriesDataIndices,function(t){var n=t.seriesIndex,r=e[n],a=i[n];r&&a&&a.data!==r.data&&(o=!1)})})}),this._lastDataByCoordSys=t,this._cbParamsList=e,!!o},n.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},n.prototype.dispose=function(t,e){!Qp.node&&e.getDom()&&(_s(this,"_updatePosition"),this._tooltipContent.dispose(),vc("itemTooltip",e))},n.type="tooltip",n}(ww);const zI=OI;var EI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.layoutMode={type:"box",ignoreSize:!0},e}return e(n,t),n.type="title",n.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:"center",top:X_.size.m,backgroundColor:X_.color.transparent,borderColor:X_.color.primary,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:X_.color.primary},subtextStyle:{fontSize:12,color:X_.color.quaternary}},n}(W_),RI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){if(this.group.removeAll(),t.get("show")){var i=this.group,o=t.getModel("textStyle"),r=t.getModel("subtextStyle"),a=t.get("textAlign"),s=L(t.get("textBaseline"),t.get("textVerticalAlign")),l=new Tv({style:co(o,{text:t.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),h=t.get("subtext"),c=new Tv({style:co(r,{text:h,fill:r.getTextColor(),y:u.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),d=t.get("link"),p=t.get("sublink"),f=t.get("triggerEvent",!0);l.silent=!d&&!f,c.silent=!p&&!f,d&&l.on("click",function(){jo(d,"_"+t.get("target"))}),p&&c.on("click",function(){jo(p,"_"+t.get("subtarget"))}),Mv(l).eventData=Mv(c).eventData=f?{componentType:"title",componentIndex:t.componentIndex}:null,i.add(l),h&&i.add(c);var g=i.getBoundingRect(),m=t.getBoxLayoutParams();m.width=g.width,m.height=g.height;var y=Yo(m,Xo(t,n).refContainer,t.get("padding"));a||("middle"===(a=t.get("left")||t.get("right"))&&(a="center"),"right"===a?y.x+=y.width:"center"===a&&(y.x+=y.width/2)),s||("center"===(s=t.get("top")||t.get("bottom"))&&(s="middle"),"bottom"===s?y.y+=y.height:"middle"===s&&(y.y+=y.height/2),s=s||"top"),i.x=y.x,i.y=y.y,i.markRedraw();var v={align:a,verticalAlign:s};l.setStyle(v),c.setStyle(v),g=i.getBoundingRect();var _=y.margin,x=t.getItemStyle(["color","opacity"]);x.fill=t.get("backgroundColor");var w=new mv({shape:{x:g.x-_[3],y:g.y-_[0],width:g.width+_[1]+_[3],height:g.height+_[0]+_[2],r:t.get("borderRadius")},style:x,subPixelOptimize:!0,silent:!0});i.add(w)}},n.type="title",n}(ww),BI=["x","y","radius","angle","single"],NI=["cartesian2d","polar","singleAxis"],FI=function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(t){this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},t}();const VI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="dataZoom.select",n}(function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e._autoThrottle=!0,e._noTarget=!0,e._rangePropMode=["percent","percent"],e}return e(n,t),n.prototype.init=function(t,e,n){var i=Fc(t);this.settledOption=i,this.mergeDefaultAndTheme(t,n),this._doInit(i)},n.prototype.mergeOption=function(t){var e=Fc(t);r(this.option,t,!0),r(this.settledOption,e,!0),this._doInit(e)},n.prototype._doInit=function(t){var e=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var n=this.settledOption;c([["start","startValue"],["end","endValue"]],function(t,i){"value"===this._rangePropMode[i]&&(e[t[0]]=n[t[0]]=null)},this),this._resetTarget()},n.prototype._resetTarget=function(){var t=this.get("orient",!0),e=this._targetAxisInfoMap=B();this._fillSpecifiedTargetAxis(e)?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(e,this._orient)),this._noTarget=!0,e.each(function(t){t.indexList.length&&(this._noTarget=!1)},this)},n.prototype._fillSpecifiedTargetAxis=function(t){var e=!1;return c(BI,function(n){var i=this.getReferringComponents(Nc(n),$m);if(i.specified){e=!0;var o=new FI;c(i.models,function(t){o.add(t.componentIndex)}),t.set(n,o)}},this),e},n.prototype._fillAutoTargetAxisByOrient=function(t,e){function n(e,n){var i=e[0];if(i){var r=new FI;if(r.add(i.componentIndex),t.set(n,r),o=!1,"x"===n||"y"===n){var a=i.getReferringComponents("grid",Km).models[0];a&&c(e,function(t){i.componentIndex!==t.componentIndex&&a===t.getReferringComponents("grid",Km).models[0]&&r.add(t.componentIndex)})}}}var i=this.ecModel,o=!0;if(o){var r="vertical"===e?"y":"x";n(i.findComponents({mainType:r+"Axis"}),r)}o&&n(i.findComponents({mainType:"singleAxis",filter:function(t){return t.get("orient",!0)===e}}),"single"),o&&c(BI,function(e){if(o){var n=i.findComponents({mainType:Nc(e),filter:function(t){return"category"===t.get("type",!0)}});if(n[0]){var r=new FI;r.add(n[0].componentIndex),t.set(e,r),o=!1}}},this)},n.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis(function(e){!t&&(t=e)},this),"y"===t?"vertical":"horizontal"},n.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var e=this.ecModel.option;this.option.throttle=e.animation&&e.animationDurationUpdate>0?100:20}},n.prototype._updateRangeUse=function(t){var e=this._rangePropMode,n=this.get("rangeMode");c([["start","startValue"],["end","endValue"]],function(i,o){var r=null!=t[i[0]],a=null!=t[i[1]];r&&!a?e[o]="percent":!r&&a?e[o]="value":n?e[o]=n[o]:r&&(e[o]="percent")})},n.prototype.noTarget=function(){return this._noTarget},n.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis(function(e,n){null==t&&(t=this.ecModel.getComponent(Nc(e),n))},this),t},n.prototype.eachTargetAxis=function(t,e){this._targetAxisInfoMap.each(function(n,i){c(n.indexList,function(n){t.call(e,i,n)})})},n.prototype.getAxisProxy=function(t,e){var n=this.getAxisModel(t,e);if(n)return n.__dzAxisProxy},n.prototype.getAxisModel=function(t,e){var n=this._targetAxisInfoMap.get(t);if(n&&n.indexMap[e])return this.ecModel.getComponent(Nc(t),e)},n.prototype.setRawRange=function(t){var e=this.option,n=this.settledOption;c([["start","startValue"],["end","endValue"]],function(i){null==t[i[0]]&&null==t[i[1]]||(e[i[0]]=n[i[0]]=t[i[0]],e[i[1]]=n[i[1]]=t[i[1]])},this),this._updateRangeUse(t)},n.prototype.setCalculatedRange=function(t){var e=this.option;c(["start","startValue","end","endValue"],function(n){e[n]=t[n]})},n.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},n.prototype.getValueRange=function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var n=this.findRepresentativeAxisProxy();return n?n.getDataValueWindow():void 0},n.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var e,n=this._targetAxisInfoMap.keys(),i=0;i=0}(e)){var n=Nc(this._dimName),i=e.getReferringComponents(n,Km).models[0];i&&this._axisIndex===i.componentIndex&&t.push(e)}},this),t},t.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},t.prototype.getMinMaxSpan=function(){return o(this._minMaxSpan)},t.prototype.calculateDataWindow=function(t){function e(t,e,n,i,r){var a=r?"Span":"ValueSpan";Vc(0,t,n,"all",u["min"+a],u["max"+a]);for(var s=0;s<2;s++)e[s]=nn(t[s],n,i,!0),r&&(e[s]=o.parse(e[s]))}var n,i=this._dataExtent,o=this.getAxisModel().axis.scale,r=this._dataZoomModel.getRangePropMode(),a=[0,100],s=[],l=[];HI(["start","end"],function(e,u){var h=t[e],c=t[e+"Value"];"percent"===r[u]?(null==h&&(h=a[u]),c=o.parse(nn(h,a,i))):(n=!0,h=nn(c=null==c?i[u]:o.parse(c),i,a)),l[u]=null==c||isNaN(c)?i[u]:c,s[u]=null==h||isNaN(h)?a[u]:h}),WI(l),WI(s);var u=this._minMaxSpan;return n?e(l,s,i,a,!1):e(s,l,a,i,!0),{valueWindow:l,percentWindow:s}},t.prototype.reset=function(t){if(t===this._dataZoomModel){var e=this.getTargetSeriesModels();this._dataExtent=function(t,e,n){var i=[1/0,-1/0];HI(n,function(t){!function(t,e,n){e&&c(gh(e,n),function(n){var i=e.getApproximateExtent(n);i[0]t[1]&&(t[1]=i[1])})}(i,t.getData(),e)});var o=t.getAxisModel(),r=sh(o.axis.scale,o,i).calculate();return[r.min,r.max]}(this,this._dimName,e),this._updateMinMaxSpan();var n=this.calculateDataWindow(t.settledOption);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,this._setAxisModel()}},t.prototype.filterData=function(t,e){if(t===this._dataZoomModel){var n=this._dimName,i=this.getTargetSeriesModels(),o=t.get("filterMode"),r=this._valueWindow;"none"!==o&&HI(i,function(t){var e=t.getData(),i=e.mapDimensionsAll(n);if(i.length){if("weakFilter"===o){var a=e.getStore(),s=d(i,function(t){return e.getDimensionIndex(t)},e);e.filterSelf(function(t){for(var e,n,o,l=0;lr[1];if(h&&!c&&!d)return!0;h&&(o=!0),c&&(e=!0),d&&(n=!0)}return o&&e&&n})}else HI(i,function(n){if("empty"===o)t.setData(e=e.map(n,function(t){return function(t){return t>=r[0]&&t<=r[1]}(t)?t:NaN}));else{var i={};i[n]=r,e.selectRange(i)}});HI(i,function(t){e.setApproximateExtent(r,t)})}})}},t.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},e=this._dataZoomModel,n=this._dataExtent;HI(["min","max"],function(i){var o=e.get(i+"Span"),r=e.get(i+"ValueSpan");null!=r&&(r=this.getAxisModel().axis.scale.parse(r)),null!=r?o=nn(n[0]+r,n,[0,100],!0):null!=o&&(r=nn(o,[0,100],n,!0)-n[0]),t[i+"Span"]=o,t[i+"ValueSpan"]=r},this)},t.prototype._setAxisModel=function(){var t=this.getAxisModel(),e=this._percentWindow,n=this._valueWindow;if(e){var i=sn(n,[0,500]);i=Math.min(i,20);var o=t.axis.scale.rawExtentInfo;0!==e[0]&&o.setDeterminedMinMax("min",+n[0].toFixed(i)),100!==e[1]&&o.setDeterminedMinMax("max",+n[1].toFixed(i)),o.freeze()}},t}();const GI=jI,UI={getTargetSeries:function(t){function e(e){t.eachComponent("dataZoom",function(n){n.eachTargetAxis(function(i,o){var r=t.getComponent(Nc(i),o);e(i,o,r,n)})})}e(function(t,e,n,i){n.__dzAxisProxy=null});var n=[];e(function(e,i,o,r){o.__dzAxisProxy||(o.__dzAxisProxy=new GI(e,i,r,t),n.push(o.__dzAxisProxy))});var i=B();return c(n,function(t){c(t.getTargetSeriesModels(),function(t){i.set(t.uid,t)})}),i},overallReset:function(t,e){t.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(e,n){t.getAxisProxy(e,n).reset(t)}),t.eachTargetAxis(function(n,i){t.getAxisProxy(n,i).filterData(t,e)})}),t.eachComponent("dataZoom",function(t){var e=t.findRepresentativeAxisProxy();if(e){var n=e.getDataPercentWindow(),i=e.getDataValueWindow();t.setCalculatedRange({start:n[0],end:n[1],startValue:i[0],endValue:i[1]})}})}};var YI=!1,XI=function(){},qI={};const KI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.optionUpdated=function(){t.prototype.optionUpdated.apply(this,arguments);var e=this.ecModel;c(this.option.feature,function(t,n){var i=Gc(n);i&&(i.getDefaultOption&&(i.defaultOption=i.getDefaultOption(e)),r(t,i.defaultOption))})},n.type="toolbox",n.layoutMode={type:"box",ignoreSize:!0},n.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:X_.color.border,borderRadius:0,borderWidth:0,padding:X_.size.m,itemSize:15,itemGap:X_.size.s,showTitle:!0,iconStyle:{borderColor:X_.color.accent50,color:"none"},emphasis:{iconStyle:{borderColor:X_.color.accent50}},tooltip:{show:!1,position:"bottom"}},n}(W_);var $I=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.render=function(t,e,n,i){function o(o,d){var p,f=h[o],g=h[d],m=l[f],y=new i_(m,t,t.ecModel);if(i&&null!=i.newTitle&&i.featureName===f&&(m.title=i.newTitle),f&&!g){if(function(t){return 0===t.indexOf("my")}(f))p={onclick:y.option.onclick,featureName:f};else{var v=Gc(f);if(!v)return;p=new v}u[f]=p}else if(!(p=u[g]))return;p.uid=mo("toolbox-feature"),p.model=y,p.ecModel=e,p.api=n;var x=p instanceof XI;f||!g?!y.get("show")||x&&p.unusable?x&&p.remove&&p.remove(e,n):(function(i,o,l){var u,h,d=i.getModel("iconStyle"),p=i.getModel(["emphasis","iconStyle"]),f=o instanceof XI&&o.getIcons?o.getIcons():i.get("icon"),g=i.get("title")||{};_(f)?(u={})[l]=f:u=f,_(g)?(h={})[l]=g:h=g;var m=i.iconPaths={};c(u,function(l,u){var c=$a(l,{},{x:-a/2,y:-a/2,width:a,height:a});c.setStyle(d.getItemStyle()),c.ensureState("emphasis").style=p.getItemStyle();var f=new Tv({style:{text:h[u],align:p.get("textAlign"),borderRadius:p.get("textBorderRadius"),padding:p.get("textPadding"),fill:null,font:go({fontStyle:p.get("textFontStyle"),fontFamily:p.get("textFontFamily"),fontSize:p.get("textFontSize"),fontWeight:p.get("textFontWeight")},e)},ignore:!0});c.setTextContent(f),is({el:c,componentModel:t,itemName:u,formatterParamsExtra:{title:h[u]}}),c.__title=h[u],c.on("mouseover",function(){var e=p.getItemStyle(),i=s?null==t.get("right")&&"right"!==t.get("left")?"right":"left":null==t.get("bottom")&&"bottom"!==t.get("top")?"bottom":"top";f.setStyle({fill:p.get("textFill")||e.fill||e.stroke||X_.color.neutral99,backgroundColor:p.get("textBackgroundColor")}),c.setTextConfig({position:p.get("textPosition")||i}),f.ignore=!t.get("showTitle"),n.enterEmphasis(this)}).on("mouseout",function(){"emphasis"!==i.get(["iconStatus",u])&&n.leaveEmphasis(this),f.hide()}),("emphasis"===i.get(["iconStatus",u])?ji:Gi)(c),r.add(c),c.on("click",_f(o.onclick,o,e,n,u)),m[u]=c})}(y,p,f),y.setIconStatus=function(t,e){var n=this.option,i=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[t]=e,i[t]&&("emphasis"===e?ji:Gi)(i[t])},p instanceof XI&&p.render&&p.render(y,e,n,i)):x&&p.dispose&&p.dispose(e,n)}var r=this.group;if(r.removeAll(),t.get("show")){var a=+t.get("itemSize"),s="vertical"===t.get("orient"),l=t.get("feature")||{},u=this._features||(this._features={}),h=[];c(l,function(t,e){h.push(e)}),new gM(this._featureNames||[],h).add(o).update(o).remove(m(o,null)).execute(),this._featureNames=h;var d=Xo(t,n).refContainer,p=t.getBoxLayoutParams(),f=t.get("padding"),g=Yo(p,d,f);F_(t.get("orient"),r,t.get("itemGap"),g.width,g.height),qo(r,p,d,f),r.add(Uc(r.getBoundingRect(),t)),s||r.eachChild(function(t){var e=t.__title,i=t.ensureState("emphasis"),o=i.textConfig||(i.textConfig={}),s=t.getTextContent(),l=s&&s.ensureState("emphasis");if(l&&!v(l)&&e){var u=l.style||(l.style={}),h=Ge(e,Tv.makeFont(u)),c=t.x+r.x,d=!1;t.y+r.y+a+h.height>n.getHeight()&&(o.position="top",d=!0);var p=d?-5-h.height:a+10;c+h.width/2>n.getWidth()?(o.position=["100%",p],u.align="right"):c-h.width/2<0&&(o.position=[0,p],u.align="left")}})}},n.prototype.updateView=function(t,e,n,i){c(this._features,function(t){t instanceof XI&&t.updateView&&t.updateView(t.model,e,n,i)})},n.prototype.remove=function(t,e){c(this._features,function(n){n instanceof XI&&n.remove&&n.remove(t,e)}),this.group.removeAll()},n.prototype.dispose=function(t,e){c(this._features,function(n){n instanceof XI&&n.dispose&&n.dispose(t,e)})},n.type="toolbox",n}(ww);const JI=$I,QI=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.onclick=function(t,e){var n=this.model,i=n.get("name")||t.get("title.0.text")||"echarts",o="svg"===e.getZr().painter.getType(),r=o?"svg":n.get("type",!0)||"png",a=e.getConnectedDataURL({type:r,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||X_.color.neutral00,connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),s=Qp.browser;if("function"!=typeof MouseEvent||!s.newEdge&&(s.ie||s.edge))if(window.navigator.msSaveOrOpenBlob||o){var l=a.split(","),u=l[0].indexOf("base64")>-1,h=o?decodeURIComponent(l[1]):l[1];u&&(h=window.atob(h));var c=i+"."+r;if(window.navigator.msSaveOrOpenBlob){for(var d=h.length,p=new Uint8Array(d);d--;)p[d]=h.charCodeAt(d);var f=new Blob([p]);window.navigator.msSaveOrOpenBlob(f,c)}else{var g=document.createElement("iframe");document.body.appendChild(g);var m=g.contentWindow,y=m.document;y.open("image/svg+xml","replace"),y.write(h),y.close(),m.focus(),y.execCommand("SaveAs",!0,c),document.body.removeChild(g)}}else{var v=n.get("lang"),_='',x=window.open();x.document.write(_),x.document.title=i}else{var w=document.createElement("a");w.download=i+"."+r,w.target="_blank",w.href=a;var b=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});w.dispatchEvent(b)}},n.getDefaultOption=function(t){return{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:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:X_.color.neutral00,name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])}},n}(XI);var tL="__ec_magicType_stack__",eL=[["line","bar"],["stack"]],nL=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.getIcons=function(){var t=this.model,e=t.get("icon"),n={};return c(t.get("type"),function(t){e[t]&&(n[t]=e[t])}),n},n.getDefaultOption=function(t){return{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:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},n.prototype.onclick=function(t,e,n){var i=this.model,o=i.get(["seriesIndex",n]);if(iL[n]){var a,u={series:[]};c(eL,function(t){l(t,n)>=0&&c(t,function(t){i.setIconStatus(t,"normal")})}),i.setIconStatus(n,"emphasis"),t.eachComponent({mainType:"series",query:null==o?null:{seriesIndex:o}},function(t){var e=iL[n](t.subType,t.id,t,i);e&&(s(e,t.option),u.series.push(e));var o=t.coordinateSystem;if(o&&"cartesian2d"===o.type&&("line"===n||"bar"===n)){var r=o.getAxesByScale("ordinal")[0];if(r){var a=r.dim+"Axis",l=t.getReferringComponents(a,Km).models[0].componentIndex;u[a]=u[a]||[];for(var h=0;h<=l;h++)u[a][l]=u[a][l]||{};u[a][l].boundaryGap="bar"===n}}});var h=n;"stack"===n&&(a=r({stack:i.option.title.tiled,tiled:i.option.title.stack},i.option.title),"emphasis"!==i.get(["iconStatus",n])&&(h="tiled")),e.dispatchAction({type:"changeMagicType",currentType:h,newOption:u,newTitle:a,featureName:"magicType"})}},n}(XI),iL={line:function(t,e,n,i){if("bar"===t)return r({id:e,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(t,e,n,i){if("line"===t)return r({id:e,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(t,e,n,i){var o=n.get("stack")===tL;if("line"===t||"bar"===t)return i.setIconStatus("stack",o?"normal":"emphasis"),r({id:e,stack:o?"":tL},i.get(["option","stack"])||{},!0)}};fl({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)});const oL=nL;var rL=new Array(60).join("-"),aL="\t",sL=new RegExp("[\t]+","g"),lL=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.onclick=function(t,e){function n(){i.removeChild(r),C._dom=null}setTimeout(function(){e.dispatchAction({type:"hideTip"})});var i=e.getDom(),o=this.model;this._dom&&i.removeChild(this._dom);var r=document.createElement("div");r.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",r.style.backgroundColor=o.get("backgroundColor")||X_.color.neutral00;var a=document.createElement("h4"),s=o.get("lang")||[];a.innerHTML=s[0]||o.get("title"),a.style.cssText="margin:10px 20px",a.style.color=o.get("textColor");var l=document.createElement("div"),u=document.createElement("textarea");l.style.cssText="overflow:auto";var h=o.get("optionToContent"),p=o.get("contentToOption"),g=function(t){var e,n,i,o=function(t){var e={},n=[],i=[];return t.eachRawSeries(function(t){var o=t.coordinateSystem;if(!o||"cartesian2d"!==o.type&&"polar"!==o.type)n.push(t);else{var r=o.getBaseAxis();if("category"===r.type){var a=r.dim+"_"+r.index;e[a]||(e[a]={categoryAxis:r,valueAxis:o.getOtherAxis(r),series:[]},i.push({axisDim:r.dim,axisIndex:r.index})),e[a].series.push(t)}else n.push(t)}}),{seriesGroupByCategoryAxis:e,other:n,meta:i}}(t);return{value:f([(n=o.seriesGroupByCategoryAxis,i=[],c(n,function(t,e){var n=t.categoryAxis,o=t.valueAxis.dim,r=[" "].concat(d(t.series,function(t){return t.name})),a=[n.model.getCategories()];c(t.series,function(t){var e=t.getRawData();a.push(t.getRawData().mapArray(e.mapDimension(o),function(t){return t}))});for(var s=[r.join(aL)],l=0;l=0)return!0}(t)){var o=function(t){for(var e=t.split(/\n+/g),n=[],i=d(Yc(e.shift()).split(sL),function(t){return{name:t,data:[]}}),o=0;oi.getWidth()||n<0||n>i.getHeight()}(t,e.offsetX,e.offsetY)){var i=t._zr,o=t._covers,r=nd(t,e,n);if(!t._dragging)for(var a=0;a=0)&&t(o,i._targetInfoList)})}return t.prototype.setOutputRanges=function(t,e){return this.matchOutputRanges(t,e,function(t,e,n){if((t.coordRanges||(t.coordRanges=[])).push(e),!t.coordRange){t.coordRange=e;var i=AL[t.brushType](0,n,e);t.__rangeOffset={offset:OL[t.brushType](i.values,t.range,[1,1]),xyMinMax:i.xyMinMax}}}),t},t.prototype.matchOutputRanges=function(t,e,n){c(t,function(t){var i=this.findTargetInfo(t,e);i&&!0!==i&&c(i.coordSyses,function(i){var o=AL[t.brushType](1,i,t.range,!0);n(t,o.values,i,e)})},this)},t.prototype.setInputRanges=function(t,e){c(t,function(t){var n,i,o,r,a=this.findTargetInfo(t,e);if(t.range=t.range||[],a&&!0!==a){t.panelId=a.panelId;var s=AL[t.brushType](0,a.coordSys,t.coordRange),l=t.__rangeOffset;t.range=l?OL[t.brushType](s.values,l.offset,(n=l.xyMinMax,i=Ad(s.xyMinMax),o=Ad(n),r=[i[0]/o[0],i[1]/o[1]],isNaN(r[0])&&(r[0]=1),isNaN(r[1])&&(r[1]=1),r)):s.values}},this)},t.prototype.makePanelOpts=function(t,e){return d(this._targetInfoList,function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:e?e(n):null,clipPath:Td(i),isTargetByCursor:Cd(i,t,n.coordSysModel),getLinearBrushOtherExtent:Md(i)}})},t.prototype.controlSeries=function(t,e,n){var i=this.findTargetInfo(t,n);return!0===i||i&&l(i.coordSyses,e.coordinateSystem)>=0},t.prototype.findTargetInfo=function(t,e){for(var n=this._targetInfoList,i=Ld(e,t),o=0;o=0||l(i,t.getAxis("y").model)>=0)&&o.push(t)}),e.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:o[0],coordSyses:o,getPanelRect:DL.grid,xAxisDeclared:a[t.id],yAxisDeclared:s[t.id]})}))},geo:function(t,e){c(t.geoModels,function(t){var n=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:n,coordSyses:[n],getPanelRect:DL.geo})})}},PL=[function(t,e){var n=t.xAxisModel,i=t.yAxisModel,o=t.gridModel;return!o&&n&&(o=n.axis.grid.model),!o&&i&&(o=i.axis.grid.model),o&&o===e.gridModel},function(t,e){var n=t.geoModel;return n&&n===e.geoModel}],DL={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(ja(t)),e}},AL={lineX:m(Pd,0),lineY:m(Pd,1),rect:function(t,e,n,i){var o=t?e.pointToData([n[0][0],n[1][0]],i):e.dataToPoint([n[0][0],n[1][0]],i),r=t?e.pointToData([n[0][1],n[1][1]],i):e.dataToPoint([n[0][1],n[1][1]],i),a=[Id([o[0],r[0]]),Id([o[1],r[1]])];return{values:a,xyMinMax:a}},polygon:function(t,e,n,i){var o=[[1/0,-1/0],[1/0,-1/0]];return{values:d(n,function(n){var r=t?e.pointToData(n,i):e.dataToPoint(n,i);return o[0][0]=Math.min(o[0][0],r[0]),o[1][0]=Math.min(o[1][0],r[1]),o[0][1]=Math.max(o[0][1],r[0]),o[1][1]=Math.max(o[1][1],r[1]),r}),xyMinMax:o}}},OL={lineX:m(Dd,0),lineY:m(Dd,1),rect:function(t,e,n){return[[t[0][0]-n[0]*e[0][0],t[0][1]-n[0]*e[0][1]],[t[1][0]-n[1]*e[1][0],t[1][1]-n[1]*e[1][1]]]},polygon:function(t,e,n){return d(t,function(t,i){return[t[0]-n[0]*e[i][0],t[1]-n[1]*e[i][1]]})}};const zL=IL;var EL,RL=c,BL=Ym+"toolbox-dataZoom_",NL=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.render=function(t,e,n,i){this._brushController||(this._brushController=new CL(n.getZr()),this._brushController.on("brush",_f(this._onBrush,this)).mount()),function(t,e,n,i,o){var r=n._isZoomActive;i&&"takeGlobalCursor"===i.type&&(r="dataZoomSelect"===i.key&&i.dataZoomSelectActive),n._isZoomActive=r,t.setIconStatus("zoom",r?"emphasis":"normal");var a=new zL(Od(t),e,{include:["grid"]}).makePanelOpts(o,function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"});n._brushController.setPanels(a).enableBrush(!(!r||!a.length)&&{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()})}(t,e,this,i,n),function(t,e){t.setIconStatus("back",function(t){return qc(t).length}(e)>1?"emphasis":"normal")}(t,e)},n.prototype.onclick=function(t,e,n){FL[n].call(this)},n.prototype.remove=function(t,e){this._brushController&&this._brushController.unmount()},n.prototype.dispose=function(t,e){this._brushController&&this._brushController.dispose()},n.prototype._onBrush=function(t){function e(t,e,n){var r=e.getAxis(t),a=r.model,s=function(t,e,n){var i;return n.eachComponent({mainType:"dataZoom",subType:"select"},function(n){n.getAxisModel(t,e.componentIndex)&&(i=n)}),i}(t,a,o),l=s.findRepresentativeAxisProxy(a).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(n=Vc(0,n.slice(),r.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(i[s.id]={dataZoomId:s.id,startValue:n[0],endValue:n[1]})}var n=t.areas;if(t.isEnd&&n.length){var i={},o=this.ecModel;this._brushController.updateCovers([]),new zL(Od(this.model),o,{include:["grid"]}).matchOutputRanges(n,o,function(t,n,i){if("cartesian2d"===i.type){var o=t.brushType;"rect"===o?(e("x",i,n[0]),e("y",i,n[1])):e({lineX:"x",lineY:"y"}[o],i,n)}}),function(t,e){var n=qc(t);hL(e,function(e,i){for(var o=n.length-1;o>=0&&!n[o][i];o--);if(o<0){var r=t.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(r){var a=r.getPercentRange();n[0][i]={dataZoomId:i,start:a[0],end:a[1]}}}}),n.push(e)}(o,i),this._dispatchZoomAction(i)}},n.prototype._dispatchZoomAction=function(t){var e=[];RL(t,function(t,n){e.push(o(t))}),e.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:e})},n.getDefaultOption=function(t){return{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:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:X_.color.backgroundTint}}},n}(XI),FL={zoom:function(){this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:!this._isZoomActive})},back:function(){this._dispatchZoomAction(function(t){var e=qc(t),n=e[e.length-1];e.length>1&&e.pop();var i={};return hL(n,function(t,n){for(var o=e.length-1;o>=0;o--)if(t=e[o][n]){i[n]=t;break}}),i}(this.ecModel))}};EL=function(t){function e(t,e,n){var i=t.componentIndex,a={type:"select",$fromToolbox:!0,filterMode:o.get("filterMode",!0)||"filter",id:BL+e+i};a[n]=i,r.push(a)}var n=t.getComponent("toolbox",0),i=["feature","dataZoom"];if(n&&null!=n.get(i)){var o=n.getModel(i),r=[],a=Pn(t,Od(o));return RL(a.xAxisModels,function(t){return e(t,"xAxis","xAxisIndex")}),RL(a.yAxisModels,function(t){return e(t,"yAxis","yAxisIndex")}),r}},O(null==mx.get("dataZoom")&&EL),mx.set("dataZoom",EL);const VL=NL,ZL=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.layoutMode={type:"box",ignoreSize:!0},e}return e(n,t),n.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),t.selected=t.selected||{},this._updateSelector(t)},n.prototype.mergeOption=function(e,n){t.prototype.mergeOption.call(this,e,n),this._updateSelector(e)},n.prototype._updateSelector=function(t){var e=t.selector,n=this.ecModel;!0===e&&(e=t.selector=["all","inverse"]),y(e)&&c(e,function(t,i){_(t)&&(t={type:t}),e[i]=r(t,function(t,e){return"all"===e?{type:"all",title:t.getLocaleModel().get(["legend","selector","all"])}:"inverse"===e?{type:"inverse",title:t.getLocaleModel().get(["legend","selector","inverse"])}:void 0}(n,t.type))})},n.prototype.optionUpdated=function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&"single"===this.get("selectedMode")){for(var e=!1,n=0;n=0},n.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},n.type="legend.plain",n.dependencies=["series"],n.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",bottom:X_.size.m,align:"auto",backgroundColor:X_.color.transparent,borderColor:X_.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:X_.color.disabled,inactiveBorderColor:X_.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:X_.color.disabled,inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:X_.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:X_.color.tertiary,borderWidth:1,borderColor:X_.color.border},emphasis:{selectorLabel:{show:!0,color:X_.color.quaternary}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},n}(W_);var HL=m,WL=c,jL=Em,GL=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.newlineDisabled=!1,e}return e(n,t),n.prototype.init=function(){this.group.add(this._contentGroup=new jL),this.group.add(this._selectorGroup=new jL),this._isFirstRender=!0},n.prototype.getContentGroup=function(){return this._contentGroup},n.prototype.getSelectorGroup=function(){return this._selectorGroup},n.prototype.render=function(t,e,n){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var o=t.get("align"),r=t.get("orient");o&&"auto"!==o||(o="right"===t.get("left")&&"vertical"===r?"right":"left");var a=t.get("selector",!0),l=t.get("selectorPosition",!0);!a||l&&"auto"!==l||(l="horizontal"===r?"end":"start"),this.renderInner(o,t,e,n,a,r,l);var u=Xo(t,n).refContainer,h=t.getBoxLayoutParams(),c=t.get("padding"),d=Yo(h,u,c),p=this.layoutInner(t,o,d,i,a,l),f=Yo(s({width:p.width,height:p.height},h),u,c);this.group.x=f.x-p.x,this.group.y=f.y-p.y,this.group.markRedraw(),this.group.add(this._backgroundEl=Uc(p,t))}},n.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},n.prototype.renderInner=function(t,e,n,i,o,r,s){var l=this.getContentGroup(),u=B(),h=e.get("selectedMode"),c=e.get("triggerEvent"),d=[];n.eachRawSeries(function(t){!t.get("legendHoverLink")&&d.push(t.id)}),WL(e.getData(),function(o,r){var s=this,p=o.get("name");if(!this.newlineDisabled&&(""===p||"\n"===p)){var f=new jL;return f.newline=!0,void l.add(f)}var g=n.getSeriesByName(p)[0];if(!u.get(p))if(g){var m=g.getData(),y=m.getVisual("legendLineStyle")||{},v=m.getVisual("legendIcon"),_=m.getVisual("style"),x=this._createItem(g,p,r,o,e,t,y,_,v,h,i);x.on("click",HL(zd,p,null,i,d)).on("mouseover",HL(Rd,g.name,null,i,d)).on("mouseout",HL(Bd,g.name,null,i,d)),n.ssr&&x.eachChild(function(t){var e=Mv(t);e.seriesIndex=g.seriesIndex,e.dataIndex=r,e.ssrType="legend"}),c&&x.eachChild(function(t){s.packEventData(t,e,g,r,p)}),u.set(p,!0)}else n.eachRawSeries(function(s){var l=this;if(!u.get(p)&&s.legendVisualProvider){var f=s.legendVisualProvider;if(!f.containName(p))return;var g=f.indexOfName(p),m=f.getItemVisual(g,"style"),y=f.getItemVisual(g,"legendIcon"),v=oe(m.fill);v&&0===v[3]&&(v[3]=.2,m=a(a({},m),{fill:le(v,"rgba")}));var _=this._createItem(s,p,r,o,e,t,{},m,y,h,i);_.on("click",HL(zd,null,p,i,d)).on("mouseover",HL(Rd,null,p,i,d)).on("mouseout",HL(Bd,null,p,i,d)),n.ssr&&_.eachChild(function(t){var e=Mv(t);e.seriesIndex=s.seriesIndex,e.dataIndex=r,e.ssrType="legend"}),c&&_.eachChild(function(t){l.packEventData(t,e,s,r,p)}),u.set(p,!0)}},this)},this),o&&this._createSelector(o,e,i,r,s)},n.prototype.packEventData=function(t,e,n,i,o){var r={componentType:"legend",componentIndex:e.componentIndex,dataIndex:i,value:o,seriesIndex:n.seriesIndex};Mv(t).eventData=r},n.prototype._createSelector=function(t,e,n,i,o){var r=this.getSelectorGroup();WL(t,function(t){var i=t.type,o=new Tv({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect",legendId:e.id})}});r.add(o),uo(o,{normal:e.getModel("selectorLabel"),emphasis:e.getModel(["emphasis","selectorLabel"])},{defaultText:t.title}),no(o)})},n.prototype._createItem=function(t,e,n,i,o,r,a,s,l,u,h){var c,d,p,f=t.visualDrawType,g=o.get("itemWidth"),m=o.get("itemHeight"),y=o.isSelected(e),x=i.get("symbolRotate"),w=i.get("symbolKeepAspect"),b=i.get("icon"),S=function(t,e,n,i,o,r,a){function s(t,e){"auto"===t.lineWidth&&(t.lineWidth=e.lineWidth>0?2:0),WL(t,function(n,i){"inherit"===t[i]&&(t[i]=e[i])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),h=0===t.lastIndexOf("empty",0)?"fill":"stroke",c=l.getShallow("decal");u.decal=c&&"inherit"!==c?nl(c,a):i.decal,"inherit"===u.fill&&(u.fill=i[o]),"inherit"===u.stroke&&(u.stroke=i[h]),"inherit"===u.opacity&&(u.opacity=("fill"===o?i:n).opacity),s(u,i);var d=e.getModel("lineStyle"),p=d.getLineStyle();if(s(p,n),"auto"===u.fill&&(u.fill=i.fill),"auto"===u.stroke&&(u.stroke=i.fill),"auto"===p.stroke&&(p.stroke=i.fill),!r){var f=e.get("inactiveBorderWidth");u.lineWidth="auto"===f?i.lineWidth>0&&u[h]?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),p.stroke=d.get("inactiveColor"),p.lineWidth=d.get("inactiveWidth")}return{itemStyle:u,lineStyle:p}}(l=b||l||"roundRect",i,a,s,f,y,h),T=new jL,M=i.getModel("textStyle");if(!v(t.getLegendIcon)||b&&"inherit"!==b){var C="inherit"===b&&t.getData().getVisual("symbol")?"inherit"===x?t.getData().getVisual("symbolRotate"):x:0;T.add(((p=Es(d=(c={itemWidth:g,itemHeight:m,icon:l,iconRotate:C,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:w}).icon||"roundRect",0,0,c.itemWidth,c.itemHeight,c.itemStyle.fill,c.symbolKeepAspect)).setStyle(c.itemStyle),p.rotation=(c.iconRotate||0)*Math.PI/180,p.setOrigin([c.itemWidth/2,c.itemHeight/2]),d.indexOf("empty")>-1&&(p.style.stroke=p.style.fill,p.style.fill=X_.color.neutral00,p.style.lineWidth=2),p))}else T.add(t.getLegendIcon({itemWidth:g,itemHeight:m,icon:l,iconRotate:x,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:w}));var k="left"===r?g+5:-5,I=r,L=o.get("formatter"),P=e;_(L)&&L?P=L.replace("{name}",null!=e?e:""):v(L)&&(P=L(e));var D=y?M.getTextColor():i.get("inactiveColor");T.add(new Tv({style:co(M,{text:P,x:k,y:m/2,fill:D,align:I,verticalAlign:"middle"},{inheritColor:D})}));var A=new mv({shape:T.getBoundingRect(),style:{fill:"transparent"}}),O=i.getModel("tooltip");return O.get("show")&&is({el:A,componentModel:o,itemName:e,itemTooltipOption:O.option}),T.add(A),T.eachChild(function(t){t.silent=!0}),A.silent=!u,this.getContentGroup().add(T),no(T),T.__legendDataIndex=n,T},n.prototype.layoutInner=function(t,e,n,i,o,r){var a=this.getContentGroup(),s=this.getSelectorGroup();F_(t.get("orient"),a,t.get("itemGap"),n.width,n.height);var l=a.getBoundingRect(),u=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),o){F_("horizontal",s,t.get("selectorItemGap",!0));var h=s.getBoundingRect(),c=[-h.x,-h.y],d=t.get("selectorButtonGap",!0),p=t.getOrient().index,f=0===p?"width":"height",g=0===p?"height":"width",m=0===p?"y":"x";"end"===r?c[p]+=l[f]+d:u[p]+=h[f]+d,c[1-p]+=l[g]/2-h[g]/2,s.x=c[0],s.y=c[1],a.x=u[0],a.y=u[1];var y={x:0,y:0};return y[f]=l[f]+d+h[f],y[g]=Math.max(l[g],h[g]),y[m]=Math.min(0,h[m]+c[1-p]),y}return a.x=u[0],a.y=u[1],this.group.getBoundingRect()},n.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},n.type="legend.plain",n}(ww);const UL=GL,YL=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}var i;return e(n,t),n.prototype.setScrollDataIndex=function(t){this.option.scrollDataIndex=t},n.prototype.init=function(e,n,i){var o=Jo(e);t.prototype.init.call(this,e,n,i),Hd(this,e,o)},n.prototype.mergeOption=function(e,n){t.prototype.mergeOption.call(this,e,n),Hd(this,this.option,e)},n.type="legend.scroll",n.defaultOption=(i={scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:X_.color.accent50,pageIconInactiveColor:X_.color.accent10,pageIconSize:15,pageTextStyle:{color:X_.color.tertiary},animationDurationUpdate:800},r(r({},ZL.defaultOption,!0),i,!0)),n}(ZL);var XL=Em,qL=["width","height"],KL=["x","y"],$L=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.newlineDisabled=!0,e._currentIndex=0,e}return e(n,t),n.prototype.init=function(){t.prototype.init.call(this),this.group.add(this._containerGroup=new XL),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new XL)},n.prototype.resetInner=function(){t.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},n.prototype.renderInner=function(e,n,i,o,r,a,s){function l(t,e){var i=t+"DataIndex",r=$a(n.get("pageIcons",!0)[n.getOrient().name][e],{onclick:_f(u._pageGo,u,i,n,o)},{x:-d[0]/2,y:-d[1]/2,width:d[0],height:d[1]});r.name=t,h.add(r)}var u=this;t.prototype.renderInner.call(this,e,n,i,o,r,a,s);var h=this._controllerGroup,c=n.get("pageIconSize",!0),d=y(c)?c:[c,c];l("pagePrev",0);var p=n.getModel("pageTextStyle");h.add(new Tv({name:"pageText",style:{text:"xx/xx",fill:p.getTextColor(),font:p.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),l("pageNext",1)},n.prototype.layoutInner=function(t,e,n,i,r,a){var s=this.getSelectorGroup(),l=t.getOrient().index,u=qL[l],h=KL[l],c=qL[1-l],d=KL[1-l];r&&F_("horizontal",s,t.get("selectorItemGap",!0));var p=t.get("selectorButtonGap",!0),f=s.getBoundingRect(),g=[-f.x,-f.y],m=o(n);r&&(m[u]=n[u]-f[u]-p);var y=this._layoutContentAndController(t,i,m,l,u,c,d,h);if(r){if("end"===a)g[l]+=y[u]+p;else{var v=f[u]+p;g[l]-=v,y[h]-=v}y[u]+=f[u]+p,g[1-l]+=y[d]+y[c]/2-f[c]/2,y[c]=Math.max(y[c],f[c]),y[d]=Math.min(y[d],f[d]+g[1-l]),s.x=g[0],s.y=g[1],s.markRedraw()}return y},n.prototype._layoutContentAndController=function(t,e,n,i,o,r,a,s){var l=this.getContentGroup(),u=this._containerGroup,h=this._controllerGroup;F_(t.get("orient"),l,t.get("itemGap"),i?n.width:null,i?null:n.height),F_("horizontal",h,t.get("pageButtonItemGap",!0));var c=l.getBoundingRect(),d=h.getBoundingRect(),p=this._showController=c[o]>n[o],f=[-c.x,-c.y];e||(f[i]=l[s]);var g=[0,0],m=[-d.x,-d.y],y=L(t.get("pageButtonGap",!0),t.get("itemGap",!0));p&&("end"===t.get("pageButtonPosition",!0)?m[i]+=n[o]-d[o]:g[i]+=d[o]+y),m[1-i]+=c[r]/2-d[r]/2,l.setPosition(f),u.setPosition(g),h.setPosition(m);var v={x:0,y:0};if(v[o]=p?n[o]:c[o],v[r]=Math.max(c[r],d[r]),v[a]=Math.min(0,d[a]+m[1-i]),u.__rectSize=n[o],p){var _={x:0,y:0};_[o]=Math.max(n[o]-d[o]-y,0),_[r]=v[r],u.setClipPath(new mv({shape:_})),u.__rectSize=_[o]}else h.eachChild(function(t){t.attr({invisible:!0,silent:!0})});var x=this._getPageInfo(t);return null!=x.pageIndex&&Ia(l,{x:x.contentPosition[0],y:x.contentPosition[1]},p?t:null),this._updatePageInfoView(t,x),v},n.prototype._pageGo=function(t,e,n){var i=this._getPageInfo(e)[t];null!=i&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:e.id})},n.prototype._updatePageInfoView=function(t,e){var n=this._controllerGroup;c(["pagePrev","pageNext"],function(i){var o=null!=e[i+"DataIndex"],r=n.childOfName(i);r&&(r.setStyle("fill",t.get(o?"pageIconColor":"pageIconInactiveColor",!0)),r.cursor=o?"pointer":"default")});var i=n.childOfName("pageText"),o=t.get("pageFormatter"),r=e.pageIndex,a=null!=r?r+1:0,s=e.pageCount;i&&o&&i.setStyle("text",_(o)?o.replace("{current}",null==a?"":a+"").replace("{total}",null==s?"":s+""):o({current:a,total:s}))},n.prototype._getPageInfo=function(t){function e(t){if(t){var e=t.getBoundingRect(),n=e[l]+t[l];return{s:n,e:n+e[s],i:t.__legendDataIndex}}}function n(t,e){return t.e>=e&&t.s<=e+r}var i=t.get("scrollDataIndex",!0),o=this.getContentGroup(),r=this._containerGroup.__rectSize,a=t.getOrient().index,s=qL[a],l=KL[a],u=this._findTargetItemIndex(i),h=o.children(),c=h[u],d=h.length,p=d?1:0,f={contentPosition:[o.x,o.y],pageCount:p,pageIndex:p-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!c)return f;var g=e(c);f.contentPosition[a]=-g.s;for(var m=u+1,y=g,v=g,_=null;m<=d;++m)(!(_=e(h[m]))&&v.e>y.s+r||_&&!n(_,y.s))&&(y=v.i>y.i?v:_)&&(null==f.pageNextDataIndex&&(f.pageNextDataIndex=y.i),++f.pageCount),v=_;for(m=u-1,y=g,v=g,_=null;m>=-1;--m)(_=e(h[m]))&&n(v,_.s)||!(y.i=0;u--){var p,f,g;if(g=null!=(f=Mn((p=n[u]).id,null))?o.get(f):null){d=cP(m=g.parent);var m,y={},v=qo(g,p,m===i?{width:r,height:a}:{width:d.width,height:d.height},null,{hv:p.hv,boundingMode:p.bounding},y);if(!cP(g).isNew&&v){for(var _=p.transition,x={},w=0;w=0)?x[b]=S:g[b]=S}Ia(g,x,t,0)}else g.attr(y)}}},n.prototype._clear=function(){var t=this,e=this._elMap;e.each(function(n){op(n,cP(n).option,e,t._lastGraphicModel)}),this._elMap=B()},n.prototype.dispose=function(){this._clear()},n.type="graphic",n}(ww),pP=Math.sin,fP=Math.cos,gP=Math.PI,mP=2*Math.PI,yP=180/gP;const vP=function(){function t(){}return t.prototype.reset=function(t){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,t||4)},t.prototype.moveTo=function(t,e){this._add("M",t,e)},t.prototype.lineTo=function(t,e){this._add("L",t,e)},t.prototype.bezierCurveTo=function(t,e,n,i,o,r){this._add("C",t,e,n,i,o,r)},t.prototype.quadraticCurveTo=function(t,e,n,i){this._add("Q",t,e,n,i)},t.prototype.arc=function(t,e,n,i,o,r){this.ellipse(t,e,n,n,0,i,o,r)},t.prototype.ellipse=function(t,e,n,i,o,r,a,s){var l,u=a-r,h=!s,c=Math.abs(u),d=de(c-mP)||(h?u>=mP:-u>=mP),p=u>0?u%mP:u%mP+mP;l=!!d||!de(c)&&p>=gP==!!h;var f=t+n*fP(r),g=e+i*pP(r);this._start&&this._add("M",f,g);var m=Math.round(o*yP);if(d){var y=1/this._p,v=(h?1:-1)*(mP-y);this._add("A",n,i,m,1,+h,t+n*fP(r+v),e+i*pP(r+v)),y>.01&&this._add("A",n,i,m,0,+h,f,g)}else{var _=t+n*fP(a),x=e+i*pP(a);this._add("A",n,i,m,+l,+h,_,x)}},t.prototype.rect=function(t,e,n,i){this._add("M",t,e),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},t.prototype.closePath=function(){this._d.length>0&&this._add("Z")},t.prototype._add=function(t,e,n,i,o,r,a,s,l){for(var u=[],h=this._p,c=1;c"].join(i):""}(o.cssNodes,o.cssAnims,{newline:!0});if(u){var h=sp("style","stl",{},[],u);r.push(h)}}return hp(n,i,r,t.useViewBox)},t.prototype.renderToString=function(t){return lp(this.renderToVNode({animation:L((t=t||{}).cssAnimation,!0),emphasis:L(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:L(t.useViewBox,!0)}),{newline:!0})},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t},t.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},t.prototype._paintList=function(t,e,n){for(var i,o,r=t.length,a=[],s=0,l=0,u=0;u=0&&(!c||!o||c[f]!==o[f]);f--);for(var g=p-1;g>f;g--)i=a[--s-1];for(var m=f+1;m=s)}}if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;for(var r,a=[],s=this.maxRepaintRectCount,l=!1,u=new lg(0,0,0,0),h=this.__startIndex;h15)break}n.prevElClipPaths&&c.restore()};if(p)if(0===p.length)s=h.__endIndex;else for(var x=d.dpr,w=0;w0&&t>i[0]){for(s=0;st);s++);a=n[i[s]]}if(i.splice(s+1,0,t),n[t]=e,!e.virtual)if(a){var l=a.dom;l.nextSibling?r.insertBefore(e.dom,l.nextSibling):r.appendChild(e.dom)}else r.firstChild?r.insertBefore(e.dom,r.firstChild):r.appendChild(e.dom);e.painter||(e.painter=this)}},t.prototype.eachLayer=function(t,e){for(var n=this._zlevelList,i=0;i0?HP:0),this._needsManuallyCompositing),h.__builtin__||i("ZLevel "+u+" has been used by unkown layer "+h.id),h!==a&&(h.__used=!0,h.__startIndex!==r&&(h.__dirty=!0),h.__startIndex=r,h.__drawIndex=h.incremental?-1:r,e(r),a=h),1&l.__dirty&&!l.__inHover&&(h.__dirty=!0,h.incremental&&h.__drawIndex<0&&(h.__drawIndex=r))}e(r),this.eachBuiltinLayer(function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)})},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(t){t.clear()},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t,c(this._layers,function(t){t.setUnpainted()})},t.prototype.configLayer=function(t,e){if(e){var n=this._layerConfig;n[t]?r(n[t],e,!0):n[t]=e;for(var i=0;i{let r="right";return o.viewSize[0]-t[0]"graph"===t.componentSubType?"edge"===t.dataType?e.utils.getLinkTooltipInfo(t.data):e.utils.getNodeTooltipInfo(t.data):"lines"===t.componentSubType?e.utils.getLinkTooltipInfo(t.data.link):e.utils.getNodeTooltipInfo(t.data.node)}},n.echartsOption);return i.setOption(e.utils.deepMergeObj(o,t)),i.on("click",t=>{const i=n.onClickElement.bind(e);e.utils.addActionToUrl(e,t),"graph"!==t.componentSubType?"lines"!==t.componentSubType?t.data&&!t.data.cluster&&(n.mapOptions?.nodePopup?.show&&e.gui.loadNodePopup(t.data.node),i("node",t.data.node)):i("link",t.data.link):i("edge"===t.dataType?"link":"node",t.data)},{passive:!0}),i}generateGraphOption(t,e){const n=[],i=e.config,o=t.nodes.map(t=>{const n=e.utils.fastDeepCopy(t),{nodeStyleConfig:o,nodeSizeConfig:r,nodeEmphasisConfig:a}=e.utils.getNodeStyle(t,i,"graph");n.itemStyle=o,n.symbolSize=r,n.emphasis={itemStyle:a.nodeStyle,symbolSize:a.nodeSize};let s="";return"string"==typeof t.label?s=t.label:"string"==typeof t.name?s=t.name:null!=t.id&&(s=String(t.id)),n.name=s,n._source=e.utils.fastDeepCopy(t),n}),r=t.links.map(t=>{const n=e.utils.fastDeepCopy(t),{linkStyleConfig:o,linkEmphasisConfig:r}=e.utils.getLinkStyle(t,i,"graph");return n.lineStyle=o,n.emphasis={lineStyle:r.linkStyle},n}),a={...i.graphConfig.series},s={...a.label||{}};if("number"==typeof e.config.showGraphLabelsAtZoom&&e.config.showGraphLabelsAtZoom>0){const t=e.config.showGraphLabelsAtZoom;s.formatter=n=>(()=>{try{const t=e.echarts.getOption(),n=(Array.isArray(t.series)?t.series:[]).find(t=>t&&"network-graph"===t.id);return n&&"number"==typeof n.zoom?n.zoom:1}catch(t){return 1}})()>=t&&n&&n.data&&n.data.name||""}a.label=s;const l=[{...a,id:"network-graph",type:"graph",layout:i.graphConfig.series.layout||"force",nodes:o,links:r}];return{legend:n.length?{data:n}:void 0,series:l,...i.graphConfig.baseOptions}}generateMapOption(t,e,n=[]){const i=e.config,{nodes:o,links:r}=t,a=t.flatNodes||{},s=[];let l=[];o.forEach(n=>{if(n.properties&&(t.flatNodes||(a[n.id]=e.utils.fastDeepCopy(n))),!n.properties||!n.properties._featureType||"Point"===n.properties._featureType)if(n.properties){const{location:t}=n.properties;if(t&&t.lng&&t.lat){const{nodeEmphasisConfig:o}=e.utils.getNodeStyle(n,i,"map");let r="";"string"==typeof n.label?r=n.label:"string"==typeof n.name?r=n.name:null!=n.id&&(r=String(n.id)),l.push({name:r,value:[t.lng,t.lat],emphasis:{itemStyle:o.nodeStyle,symbolSize:o.nodeSize},node:n,_source:e.utils.fastDeepCopy(n)})}else console.error(`Node ${n.id} position is undefined!`)}else console.error(`Node ${n.id} position is undefined!`)}),r.forEach(t=>{if(a[t.source])if(a[t.target]){const{linkStyleConfig:n,linkEmphasisConfig:o}=e.utils.getLinkStyle(t,i,"map");s.push({coords:[[a[t.source].properties.location.lng,a[t.source].properties.location.lat],[a[t.target].properties.location.lng,a[t.target].properties.location.lat]],lineStyle:n,emphasis:{lineStyle:o.linkStyle},link:t})}else console.warn(`Node ${t.target} does not exist!`);else console.warn(`Node ${t.source} does not exist!`)}),l=l.concat(n);const u=[{id:"geo-map",type:"scatter",name:"nodes",coordinateSystem:"leaflet",data:l,label:{...i.mapOptions.nodeConfig.label||{},...!1===i.showMapLabelsAtZoom?{show:!1}:{},silent:!0},itemStyle:{color:t=>{if(t.data&&t.data.cluster&&t.data.itemStyle&&t.data.itemStyle.color)return t.data.itemStyle.color;if(t.data&&t.data.node&&t.data.node.category){const e=i.nodeCategories.find(e=>e.name===t.data.node.category);return e&&e.nodeStyle&&e.nodeStyle.color||i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeStyle&&i.mapOptions.nodeConfig.nodeStyle.color||"#6c757d"}return i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeStyle&&i.mapOptions.nodeConfig.nodeStyle.color||"#6c757d"}},symbolSize:(t,n)=>{if(n.data&&n.data.cluster)return i.mapOptions.clusterConfig&&i.mapOptions.clusterConfig.symbolSize||30;if(n.data&&n.data.node){const{nodeSizeConfig:t}=e.utils.getNodeStyle(n.data.node,i,"map");return"object"==typeof t?i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeSize||17:t}return i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeSize||17},emphasis:i.mapOptions.nodeConfig.emphasis},Object.assign(i.mapOptions.linkConfig,{id:"map-links",type:"lines",coordinateSystem:"leaflet",data:s})];return{leaflet:{tiles:i.mapTileConfig,mapOptions:i.mapOptions},series:u,...i.mapOptions.baseOptions}}_propagateGraphZoom(t){const e=t.echarts.getDom&&t.echarts.getDom();if(!e)return;const n=e.querySelector("canvas");e.addEventListener("wheel",t=>{if(!n)return;const i=e.getBoundingClientRect();if(t.clientXi.right||t.clientYi.bottom)return;t.preventDefault();const o=n.getBoundingClientRect();n.dispatchEvent(new WheelEvent("wheel",{bubbles:!0,cancelable:!0,view:window,clientX:o.left+o.width/2,clientY:o.top+o.height/2,deltaY:-t.deltaY,deltaMode:t.deltaMode}))},{passive:!1})}graphRender(t,e){e.utils.echartsSetOption(e.utils.generateGraphOption(t,e),e),window.onresize=()=>{e.echarts.resize()},e.utils._propagateGraphZoom(e),e.config.showGraphLabelsAtZoom>0&&e.echarts.on("graphRoam",t=>{if(!t||!t.zoom)return;const n=e.echarts.getOption(),i=n&&n.series&&n.series[0]&&n.series[0].zoom>=e.config.showGraphLabelsAtZoom;i!==e._labelsVisible&&(e.echarts.resize({animation:!1,silent:!0}),e._labelsVisible=i)}),e.utils.setupHashChangeHandler(e),e.event.emit("onLoad"),e.event.emit("onReady"),e.event.emit("renderArray"),e.event.emit("applyUrlFragmentState")}mapRender(t,e){const n=xl();if(!n)throw new Error("Leaflet api is not loaded");const{circleMarker:i,latLngBounds:o}=n;if(!e.config.mapTileConfig[0])throw new Error('You must add the tiles via the "mapTileConfig" param!');e.utils.isGeoJSON(t)&&(e.originalGeoJSON=e.utils.fastDeepCopy(t),t=e.utils.geojsonToNetjson(t));const r=e.utils.generateMapOption(t,e);if(e.utils.echartsSetOption(r,e),e.bboxData={nodes:[],links:[]},e.leaflet=e.echarts._api.getCoordinateSystems()[0].getLeaflet(),e.leaflet._zoomAnimated=!1,e.config.geoOptions=e.utils.deepMergeObj({pointToLayer:(t,n)=>i(n,e.config.geoOptions.style),onEachFeature:(t,n)=>{n.on("click",()=>{const n={...t.properties};e.config.onClickElement.call(e,"Feature",n)})}},e.config.geoOptions),e.originalGeoJSON){!function(t){if(!t.originalGeoJSON||!Array.isArray(t.originalGeoJSON.features))return;const e=xl();if(!e)return;const{geoJSON:n}=e,i=t.leaflet,o=t.originalGeoJSON.features.filter(t=>t&&t.geometry&&("Polygon"===t.geometry.type||"MultiPolygon"===t.geometry.type));if(!o.length)return;let r=i.getPane("njg-polygons");r||(r=i.createPane("njg-polygons"),r.style.zIndex=410);const a={fillColor:"#1566a9",color:"#1566a9",weight:0,fillOpacity:.6},s=n({type:"FeatureCollection",features:o},{pane:"njg-polygons",style:e=>{const n=e.properties&&e.properties.echartsStyle||{},i={...a,...t.config.geoOptions&&t.config.geoOptions.style};return n.areaColor&&(i.fillColor=n.areaColor),n.color&&(i.color=n.color),void 0!==n.opacity&&(i.fillOpacity=n.opacity),void 0!==n.borderWidth&&(i.weight=n.borderWidth),i},onEachFeature:(e,n)=>{n.on("click",()=>{t.config.onClickElement.call(t,"Feature",e.properties||{})})},...t.config.geoOptions}).addTo(i);t.leaflet.polygonGeoJSON=s}(e);let n=null;if(e.leaflet.polygonGeoJSON&&"function"==typeof e.leaflet.polygonGeoJSON.getBounds&&(n=e.leaflet.polygonGeoJSON.getBounds()),t.nodes&&t.nodes.length){const e=t.nodes.map(t=>t.properties.location).map(t=>[t.lat,t.lng]);n?e.forEach(t=>n.extend(t)):n=o(e)}n&&n.isValid()&&e.leaflet.fitBounds(n,{padding:[20,20]})}if(e.utils.updateLabelVisibility(e,!0),e.leaflet.on("zoomend",()=>{e.utils.updateLabelVisibility(e,!0);const t=e.leaflet.getZoom(),n=e.leaflet.getMinZoom(),i=e.leaflet.getMaxZoom(),o=document.querySelector(".leaflet-control-zoom-in"),r=document.querySelector(".leaflet-control-zoom-out");o&&r&&(Math.round(t)>=i?o.classList.add("leaflet-disabled"):o.classList.remove("leaflet-disabled"),Math.round(t)<=n?r.classList.add("leaflet-disabled"):r.classList.remove("leaflet-disabled"))}),e.leaflet.on("moveend",async()=>{const n=e.leaflet.getBounds();if(e.leaflet.getZoom()>=e.config.loadMoreAtZoomLevel&&e.hasMoreData){const i=await e.utils.getBBoxData.call(e,e.JSONParam,n);e.config.prepareData.call(e,i);const o=new Set(e.data.nodes.map(t=>t.id)),r=new Set(e.data.links.map(t=>t.source)),a=new Set(e.data.links.map(t=>t.target)),s=i.nodes.filter(t=>!o.has(t.id)),l=i.links.filter(t=>!r.has(t.source)&&!a.has(t.target)),u=new Set(i.nodes.map(t=>t.id)),h=e.bboxData.nodes.filter(t=>!u.has(t.id)),c=new Set(h.map(t=>t.id));t.nodes=t.nodes.filter(t=>!c.has(t.id)),e.bboxData.nodes=e.bboxData.nodes.concat(s),e.bboxData.links=e.bboxData.links.concat(l),t={...t,nodes:t.nodes.concat(s),links:t.links.concat(l)},e.echarts.setOption(e.utils.generateMapOption(t,e)),e.data=t}else e.hasMoreData&&e.bboxData.nodes.length>0&&(()=>{const n=new Set(e.bboxData.nodes),i=new Set(e.bboxData.links);t={...t,nodes:t.nodes.filter(t=>!n.has(t)),links:t.links.filter(t=>!i.has(t))},e.data=t,e.echarts.setOption(e.utils.generateMapOption(t,e)),e.bboxData.nodes=[],e.bboxData.links=[]})()}),e.config.clustering&&e.config.clusteringThresholde.config.disableClusteringAtLevel&&(n=[],i=t.nodes,o=t.links),e.echarts.setOption(e.utils.generateMapOption({...t,nodes:i,links:o},e,n)),e.utils.updateLabelVisibility(e,!0),e.echarts.on("click",t=>{if(("scatter"===t.componentSubType||"effectScatter"===t.componentSubType)&&t.data.cluster){const n=e.leaflet.getZoom(),i=Math.min(n+2,e.leaflet.getMaxZoom());e.leaflet.setView([t.data.value[1],t.data.value[0]],i)}}),e.leaflet.on("zoomend",()=>{if(e.leaflet.getZoom(){e.echarts.appendData({seriesIndex:n,data:t.data})}),e.utils.mergeData(t,e)),e.config.afterUpdate.call(e)}addData(t,e){e.utils.mergeData(t,e),e.data.nodes&&e.data.nodes.length>0&&(e.data.nodes=e.utils.deduplicateNodesById(e.data.nodes)),e.utils.render(),e.config.afterUpdate.call(e)}mergeData(t,e){t.nodes||(t.nodes=[]);const n=new Set;e.data.nodes.forEach(t=>{t.id&&n.add(t.id)});const i=t.nodes.filter(t=>!t.id||!n.has(t.id)||(console.warn(`Duplicate node ID ${t.id} detected during merge and skipped.`),!1)),o=e.data.nodes.concat(i),r=e.data.links.concat(t.links||[]);Object.assign(e.data,t,{nodes:o,links:r})}},UP=class{constructor(t){this.self=t,this.renderModeSelector=null,this.controls=null,this.sideBar=null,this.metaInfoContainer=null,this.nodeLinkInfoContainer=null}createControls(){const t=document.createElement("div");return t.setAttribute("class","njg-controls"),this.self.el.appendChild(t),t}createRenderModeSelector(){const t=document.createElement("div"),e=document.createElement("span");return e.setAttribute("class","iconfont icon-eye"),t.setAttribute("class","njg-selectIcon"),t.appendChild(e),this.controls.appendChild(t),t}createSideBar(){const t=document.createElement("div");t.setAttribute("class","njg-sideBar"),t.classList.add("hidden");const e=document.createElement("button");return t.appendChild(e),e.classList.add("sideBarHandle"),e.onclick=()=>{t.classList.toggle("hidden");const e=document.querySelector(".njg-metaInfoContainer");(this.self.config.showMetaOnNarrowScreens||this.self.el.clientWidth>850)&&e&&(e.style.display="flex")},this.self.el.appendChild(t),t}hideInfoOnNarrowScreen(){!this.self.config.showMetaOnNarrowScreens&&this.self.el.clientWidth<850&&(this.metaInfoContainer.style.display="none"),"none"===this.metaInfoContainer.style.display&&"none"===this.nodeLinkInfoContainer.style.display&&this.sideBar.classList.add("hidden")}createMetaInfoContainer(){const t=document.createElement("div"),e=document.createElement("h2"),n=document.createElement("div");n.classList.add("njg-metaData"),t.classList.add("njg-metaInfoContainer");const i=document.createElement("span");return i.classList.add("njg-closeButton"),e.innerHTML="Info",i.innerHTML=" ✕",e.appendChild(i),t.appendChild(e),t.appendChild(n),this.metaInfoContainer=t,this.sideBar.appendChild(t),this.nodeLinkInfoContainer=this.createNodeLinkInfoContainer(),this.hideInfoOnNarrowScreen(),window.addEventListener("resize",this.hideInfoOnNarrowScreen.bind(this)),i.onclick=()=>{this.metaInfoContainer.style.display="none","none"===this.nodeLinkInfoContainer.style.display&&this.sideBar.classList.add("hidden")},t}createNodeLinkInfoContainer(){const t=document.createElement("div");return t.classList.add("njg-nodeLinkInfoContainer"),t.style.display="none",this.sideBar.appendChild(t),t}getNodeLinkInfo(t,e){const n=document.querySelectorAll(".njg-infoContainer"),i=document.querySelectorAll(".njg-headerContainer");for(let t=0;t"clients"===t?"Clients":/^clients\s*\[\d+\]$/i.test(t)?t.replace(/^clients/i,"Client"):"localAddresses"===t?"Local Addresses":t.replace(/_/g," "),u=(t,e,n,i=0)=>{if(null==n||"string"==typeof n&&(""===n.trim()||/^(undefined|null)$/i.test(n.trim()))&&"0"!==n)return;if(Array.isArray(n)){if(0===n.length){const n=document.createElement("div");n.classList.add("njg-infoItems"),n.style.paddingLeft=12*i+"px";const o=document.createElement("span");o.setAttribute("class","njg-keyLabel");const r=document.createElement("span");return r.setAttribute("class","njg-valueLabel"),o.innerHTML=l(e),r.innerHTML="[]",n.appendChild(o),n.appendChild(r),void t.appendChild(n)}if(n.every(t=>"object"!=typeof t||null===t)){const o=document.createElement("div");o.classList.add("njg-infoItems"),o.style.paddingLeft=12*i+"px";const r=document.createElement("span");r.setAttribute("class","njg-keyLabel");const a=document.createElement("span");return a.setAttribute("class","njg-valueLabel"),r.innerHTML=l(e),a.innerHTML=n.map(t=>"string"==typeof t?t.replace(/\n/g,"
"):String(t)).join("
"),o.appendChild(r),o.appendChild(a),void t.appendChild(o)}return void n.forEach((n,o)=>{u(t,`${e} [${o+1}]`,n,i)})}if("object"==typeof n){if("location"===e&&"number"==typeof n.lat&&"number"==typeof n.lng){const e=document.createElement("div");e.classList.add("njg-infoItems"),e.style.paddingLeft=12*i+"px";const o=document.createElement("span");o.setAttribute("class","njg-keyLabel");const r=document.createElement("span");return r.setAttribute("class","njg-valueLabel"),o.innerHTML="Location",r.innerHTML=`${Math.round(1e3*n.lat)/1e3}, ${Math.round(1e3*n.lng)/1e3}`,e.appendChild(o),e.appendChild(r),void t.appendChild(e)}const o=document.createElement("div");o.classList.add("njg-infoItems"),o.style.paddingLeft=12*i+"px";const r=document.createElement("span");r.setAttribute("class","njg-keyLabel");const a=document.createElement("span");return a.setAttribute("class","njg-valueLabel"),r.innerHTML=l(e),a.innerHTML="",o.appendChild(r),o.appendChild(a),t.appendChild(o),void Object.keys(n).forEach(e=>{u(t,e,n[e],i+1)})}const o=document.createElement("div");o.classList.add("njg-infoItems"),o.style.paddingLeft=12*i+"px";const r=document.createElement("span");r.setAttribute("class","njg-keyLabel");const a=document.createElement("span");a.setAttribute("class","njg-valueLabel"),r.innerHTML=l(e);const s="string"==typeof n?n.replace(/\n/g,"
"):String(n);a.innerHTML=s,o.appendChild(r),o.appendChild(a),t.appendChild(o)};Object.keys(e).forEach(t=>u(r,t,e[t],0)),o.appendChild(a),o.appendChild(s),this.nodeLinkInfoContainer.appendChild(o),this.nodeLinkInfoContainer.appendChild(r),s.onclick=()=>{this.nodeLinkInfoContainer.style.display="none",null!==this.metaInfoContainer&&"none"!==this.metaInfoContainer.style.display||this.sideBar.classList.add("hidden")}}getNodeLocation(t){return t?.properties?.location||t?.location}async loadNodePopup(t){const{self:e}=this;if(!e.leaflet)return void console.error("Leaflet map not available. Cannot load popup.");const n=this.getNodeLocation(t);if(!n)return void console.error("Node location not available. Cannot load popup.");const{bookmarkableActions:{id:i,preserveFragment:o}={}}=e.config,r={};e.leaflet.currentPopupRequest=r;const a=Boolean(e.leaflet.currentPopup);if(e.leaflet.currentPopup){const t=e.leaflet.currentPopup;e.leaflet.currentPopup=null,t.remove()}let s=e.config.mapOptions.nodePopup.content;if(null==s)s=this.createDefaultPopupContent(t);else if("function"==typeof s)try{s=await s.call(e,t)}catch(t){if(e.leaflet.currentPopupRequest!==r)return;return e.utils.removeUrlFragment(i,"nodeId",o),e.leaflet.currentPopupRequest=null,a&&(e.utils.setTooltipVisibility(e,!0),e.utils.updateLabelVisibility(e,!0)),void console.error("Failed to build node popup content:",t)}if(e.leaflet.currentPopupRequest!==r)return;const l=Object.fromEntries(Object.entries(e.config.mapOptions.nodePopup.config||{}).filter(([,t])=>null!=t)),u=window.L.popup({...l}).setLatLng(n).setContent(s),h=t&&null!=t.id?String(t.id):null;u.on("remove",()=>{if(e.leaflet.currentPopup===u){if(e.utils.setTooltipVisibility(e,!0),e.utils.updateLabelVisibility(e,!0),e.config.bookmarkableActions&&e.config.bookmarkableActions.enabled&&h){const t=e.utils.parseUrlFragments()[i];t&&t.get("nodeId")===h&&e.utils.removeUrlFragment(i,"nodeId",o)}e.leaflet.currentPopup=null,e.leaflet.currentPopupRequest===r&&(e.leaflet.currentPopupRequest=null)}}),e.leaflet.currentPopup=u,u.openOn(e.leaflet),e.utils.setTooltipVisibility(e,!1),e.utils.updateLabelVisibility(e,!1);const{onOpen:c}=e.config.mapOptions.nodePopup;if("function"==typeof c)try{c.call(e)}catch(t){e.leaflet.currentPopup&&e.leaflet.currentPopup.remove(),console.error("Failed to run popup onOpen callback:",t)}}createDefaultPopupContent(t){const e=document.createElement("div");e.classList.add("default-popup");const n=this.getNodeLocation(t),i=Number(n?.lat),o=Number(n?.lng),r=Number.isFinite(i)&&Number.isFinite(o),a={name:t?.name,id:t?.id,label:t?.label,location:r?`${i.toFixed(8)}, ${o.toFixed(8)}`:null};return Object.keys(a).forEach(t=>{const n=a[t];if(null==n||""===n)return;const i=document.createElement("div");i.classList.add("njg-tooltip-item");const o=document.createElement("span");o.classList.add("njg-tooltip-key"),o.textContent=t;const r=document.createElement("span");r.classList.add("njg-tooltip-value"),r.textContent=String(n),i.appendChild(o),i.appendChild(r),e.appendChild(i)}),e}init(){this.sideBar=this.createSideBar(),this.self.config.switchMode&&(this.controls=this.createControls(),this.renderModeSelector=this.createRenderModeSelector())}},YP=function(){function t(t,e){this._map=t,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=e,this._projection=r.Mercator}function e(t,e,n,i){const{leafletModel:o,seriesModel:r}=n,a=o?o.coordinateSystem:r?r.coordinateSystem||(r.getReferringComponents("leaflet")[0]||{}).coordinateSystem:null;return a===this?a[t](i):null}const n=xl();if(!n)throw new Error("Leaflet api is not loaded");const{Layer:i,DomUtil:o,Projection:r,LatLng:a,map:s,control:l,tileLayer:u}=n,h=i.extend({initialize(t){this._container=t},onAdd(t){t.getPane(this.options.pane).appendChild(this._container),t.zoomControl.setPosition("topright")},onRemove(){o.remove(this._container)},_update(){}});return t.dimensions=["lng","lat"],t.prototype.dimensions=["lng","lat"],t.prototype.setZoom=function(t){this._zoom=t},t.prototype.setCenter=function(t){this._center=this._projection.project(new a(t[1],t[0]))},t.prototype.setMapOffset=function(t){this._mapOffset=t},t.prototype.getLeaflet=function(){return this._map},t.prototype.getViewRect=function(){const t=this._api;return new lg(0,0,t.getWidth(),t.getHeight())},t.prototype.getRoamTransform=function(){return[1,0,0,1,0,0]},t.prototype.dataToPoint=function(t){const e=new a(t[1],t[0]),n=this._map.latLngToLayerPoint(e),i=this._mapOffset;return[n.x-i[0],n.y-i[1]]},t.prototype.pointToData=function(t){const e=this._mapOffset,n=this._map.layerPointToLatLng({x:t[0]+e[0],y:t[1]+e[1]});return[n.lng,n.lat]},t.prototype.convertToPixel=m(e,"dataToPoint"),t.prototype.convertFromPixel=m(e,"pointToData"),t.create=function(e,n){let i;const o=[],r=n.getDom();return e.eachComponent("leaflet",e=>{const a=n.getZr().painter.getViewportRoot();if(i)throw new Error("Only one leaflet component can exist");if(!e.__map){let t=r.querySelector(".ec-extension-leaflet");t&&(a.style.left="0px",a.style.top="0px",r.removeChild(t)),t=document.createElement("div"),t.style.cssText="width:100%;height:100%",t.classList.add("ec-extension-leaflet"),r.appendChild(t),e.__map=s(t,e.get("mapOptions"));const n=e.__map,i=e.get("tiles"),o={};let c=!1;if(i.forEach(t=>{const e=u(t.urlTemplate,t.options);t.label?(c||(e.addTo(n),c=!0),o[t.label]=e):e.addTo(n)}),i.length>1){const t=e.get("layerControl");l.layers(o,{},t).addTo(n)}const d=document.createElement("div");d.style="position: absolute;left: 0;top: 0;z-index: 100",d.appendChild(a),new h(d).addTo(n)}i=new t(e.__map,n),o.push(i),i.setMapOffset(e.__mapOffset||[0,0]);const{center:c,zoom:d}=e.get("mapOptions");c&&d&&(i.setZoom(d),i.setCenter(c)),e.coordinateSystem=i}),e.eachSeries(t=>{"leaflet"===t.get("coordinateSystem")&&(t.coordinateSystem=i)}),o},t};Xp.version="1.0.0";const XP=Xp;window.L=t(481);let qP=!1;window.NetJSONGraph=class{constructor(t,e={}){return this.graph=new WT(t),this.config=this.initializeConfig(e),this.graph.setConfig(this.config),this.setupGraph(),this.config.onInit.call(this.graph),this.initializeECharts(),void 0===e.showMapLabelsAtZoom&&void 0!==e.showLabelsAtZoomLevel&&(console.warn("showLabelsAtZoomLevel has been renamed to showMapLabelsAtZoom, please update your code accordingly."),this.graph.config.showMapLabelsAtZoom=e.showLabelsAtZoomLevel),this.graph}initializeConfig(t={}){return{...t,render:"map"===t.render?GP.prototype.mapRender:GP.prototype.graphRender,onInit:this.onInit,onRender:this.onRender,onUpdate:this.onUpdate,afterUpdate:this.afterUpdate,onLoad:this.onLoad}}setupGraph(){Object.setPrototypeOf(GP.prototype,this.graph.utils),this.graph.gui=new UP(this.graph),this.graph.utils=new GP,this.graph.setUtils(),this.graph.event=this.graph.utils.createEvent()}initializeECharts(){qP||(XP(),qP=!0),this.graph.echarts=function(t,e,n){var i=!(n&&n.ssr);if(i){var o=ul(t);if(o)return o}var r=new xT(t,null,n);return r.id="ec_"+OT++,DT[r.id]=r,i&&On(t,zT,r.id),oT(r),HS.trigger("afterinit",r),r}(this.graph.el,0,{renderer:this.graph.config.svgRender?"svg":"canvas"})}onInit(){return this.config}onRender(){return this.utils.showLoading.call(this),this.gui.init(),this.config}onUpdate(){return this.config}afterUpdate(){return this.config}onLoad(){return this.config.metadata&&this.utils.isNetJSON(this.data)?(this.gui.createMetaInfoContainer(this.graph),this.utils.updateMetadata.call(this)):this.gui.nodeLinkInfoContainer=this.gui.createNodeLinkInfoContainer(),this.config.switchMode&&this.utils.isNetJSON(this.data)&&(this.gui.renderModeSelector.onclick=()=>{if(this.config.render===this.utils.mapRender){this.config.render=this.utils.graphRender;const t=this.echarts.getZr().painter.getViewportRoot().parentNode;this.echarts.clear(),this.utils.graphRender(this.data,this),t.style.background=this.echarts.getZr()._backgroundColor,document.querySelector(".leaflet-control-attribution").style.display="none",document.querySelector(".leaflet-control-zoom").style.display="none"}else this.echarts.clear(),this.config.render=this.utils.mapRender,this.utils.mapRender(this.data,this),document.querySelector(".leaflet-control-attribution").style.display="block",document.querySelector(".leaflet-control-zoom").style.display="block"}),this.utils.hideLoading.call(this),this.attachClientsOverlay=t=>function(t,e={}){function n(){u=function(){const t=o.getOption();return t&&t.series&&t.series[0]&&t.series[0].zoom?t.series[0].zoom:1}(),d.attr("invisible",!(u>=l))}function i(){const t=o.getModel().getSeriesByIndex(0);if(!t)return;const e=t.getData();if(!e)return;if(n(),d.removeAll(),u{let r=0;if(0!==n)for(let s=0;rt?"number"==typeof t.clients?t.clients:Array.isArray(t.clients)?t.clients.length:0:0,c=function(){const t=o.getModel().getSeriesByIndex(0);if(!t)return null;const e=(o._chartsViews||[]).find(e=>e&&e.__model&&e.__model.uid===t.uid);return e?e.group:null}();if(!c)return{destroy(){}};const d=new Em({silent:!0,z:100,zlevel:1});c.add(d);const p=t&&t.config&&t.config.graphConfig&&t.config.graphConfig.series||{},f=("number"==typeof p.nodeSize?p.nodeSize:18)/2,g=[["finished",i],["rendered",i],["graphLayoutEnd",i],["graphRoam",()=>{n(),i()}]];return g.forEach(([t,e])=>o.on(t,e)),i(),{destroy(){g.forEach(([t,e])=>{o&&o.off&&o.off(t,e)}),d&&d.parent&&d.parent.remove(d)},setMinZoomLevel(t){l=t,i()},getMinZoomLevel:()=>l}}(this,t),this.config}}})()})(); \ No newline at end of file +(()=>{function t(i){var o=n[i];if(void 0!==o)return o.exports;var r=n[i]={exports:{}};return e[i].call(r.exports,r,r.exports,t),r.exports}var e={481(t,e){!function(t){"use strict";function e(t){var e,n,i,o;for(n=1,i=arguments.length;n=0}function O(t){sn[t.pointerId]=t}function z(t){sn[t.pointerId]&&(sn[t.pointerId]=t)}function E(t){delete sn[t.pointerId]}function R(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var n in e.touches=[],sn)e.touches.push(sn[n]);e.changedTouches=[e],t(e)}}function B(t){return"string"==typeof t?document.getElementById(t):t}function N(t,e){var n=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!n||"auto"===n)&&document.defaultView){var i=document.defaultView.getComputedStyle(t,null);n=i?i[e]:null}return"auto"===n?null:n}function F(t,e,n){var i=document.createElement(t);return i.className=e||"",n&&n.appendChild(i),i}function V(t){var e=t.parentNode;e&&e.removeChild(t)}function Z(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function H(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function W(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function j(t,e){if(void 0!==t.classList)return t.classList.contains(e);var n=X(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)}function G(t,e){if(void 0!==t.classList)for(var n=u(e),i=0,o=n.length;ie&&(n.push(t[i]),o=i);return ol&&(r=a,l=s);l>n&&(e[r]=1,Mt(t,e,n,i,r),Mt(t,e,n,r,o))}function Ct(t,e,n,i,o){var r,a,s,l=i?In:It(t,n),u=It(e,n);for(In=u;;){if(!(l|u))return[t,e];if(l&u)return!1;s=It(a=kt(t,e,r=l||u,n,o),n),r===l?(t=a,l=s):(e=a,u=s)}}function kt(t,e,n,i,o){var r,a,s=e.x-t.x,l=e.y-t.y,u=i.min,h=i.max;return 8&n?(r=t.x+s*(h.y-t.y)/l,a=h.y):4&n?(r=t.x+s*(u.y-t.y)/l,a=u.y):2&n?(r=h.x,a=t.y+l*(h.x-t.x)/s):1&n&&(r=u.x,a=t.y+l*(u.x-t.x)/s),new _(r,a,o)}function It(t,e){var n=0;return t.xe.max.x&&(n|=2),t.ye.max.y&&(n|=8),n}function Lt(t,e){var n=e.x-t.x,i=e.y-t.y;return n*n+i*i}function Pt(t,e,n,i){var o,r=e.x,a=e.y,s=n.x-r,l=n.y-a,u=s*s+l*l;return u>0&&((o=((t.x-r)*s+(t.y-a)*l)/u)>1?(r=n.x,a=n.y):o>0&&(r+=s*o,a+=l*o)),s=t.x-r,l=t.y-a,i?s*s+l*l:new _(r,a)}function Dt(t){return!qt(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function At(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Dt(t)}function Ot(t,e){var n,i,o,r,a,s,l,u;if(!t||0===t.length)throw new Error("latlngs not passed");Dt(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var h=C([0,0]),c=T(t);c.getNorthWest().distanceTo(c.getSouthWest())*c.getNorthEast().distanceTo(c.getNorthWest())<1700&&(h=bt(t));var d=t.length,p=[];for(n=0;ni){u=[s.x-(l=(r-i)/o)*(s.x-a.x),s.y-l*(s.y-a.y)];break}var g=e.unproject(x(u));return C([g.lat+h.lat,g.lng+h.lng])}function zt(t,e){var n,i,o,r,a="Feature"===t.type?t.geometry:t,s=a?a.coordinates:null,l=[],u=e&&e.pointToLayer,h=e&&e.coordsToLatLng||Rt;if(!s&&!a)return null;switch(a.type){case"Point":return Et(u,t,n=h(s),e);case"MultiPoint":for(o=0,r=s.length;o0&&o.push(o[0].slice()),o}function Vt(t,n){return t.feature?e({},t.feature,{geometry:n}):Zt(n)}function Zt(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}function Ht(t,e){return new Jn(t,e)}function Wt(t,e){return new ui(t,e)}function jt(t){return Qe.canvas?new di(t):null}function Gt(t){return Qe.svg||Qe.vml?new mi(t):null}var Ut=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}(),Yt=0,Xt=/\{ *([\w_ -]+) *\}/g,qt=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Kt="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",$t=0,Jt=window.requestAnimationFrame||f("RequestAnimationFrame")||g,Qt=window.cancelAnimationFrame||f("CancelAnimationFrame")||f("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)},te={__proto__:null,extend:e,create:Ut,bind:n,get lastId(){return Yt},stamp:i,throttle:o,wrapNum:r,falseFn:a,formatNum:s,trim:l,splitWords:u,setOptions:h,getParamString:c,template:d,isArray:qt,indexOf:p,emptyImageUrl:Kt,requestFn:Jt,cancelFn:Qt,requestAnimFrame:m,cancelAnimFrame:y};v.extend=function(t){var n=function(){h(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=n.__super__=this.prototype,o=Ut(i);for(var r in o.constructor=n,n.prototype=o,this)Object.prototype.hasOwnProperty.call(this,r)&&"prototype"!==r&&"__super__"!==r&&(n[r]=this[r]);return t.statics&&e(n,t.statics),t.includes&&(function(t){if("undefined"!=typeof L&&L&&L.Mixin){t=qt(t)?t:[t];for(var e=0;e0?Math.floor(t):Math.ceil(t)};_.prototype={clone:function(){return new _(this.x,this.y)},add:function(t){return this.clone()._add(x(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(x(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new _(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new _(this.x/t.x,this.y/t.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=ie(this.x),this.y=ie(this.y),this},distanceTo:function(t){var e=(t=x(t)).x-this.x,n=t.y-this.y;return Math.sqrt(e*e+n*n)},equals:function(t){return(t=x(t)).x===this.x&&t.y===this.y},contains:function(t){return t=x(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+s(this.x)+", "+s(this.y)+")"}},w.prototype={extend:function(t){var e,n;if(!t)return this;if(t instanceof _||"number"==typeof t[0]||"x"in t)e=n=x(t);else if(n=(t=b(t)).max,!(e=t.min)||!n)return this;return this.min||this.max?(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(n.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(n.y,this.max.y)):(this.min=e.clone(),this.max=n.clone()),this},getCenter:function(t){return x((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return x(this.min.x,this.max.y)},getTopRight:function(){return x(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,n;return(t="number"==typeof t[0]||t instanceof _?x(t):b(t))instanceof w?(e=t.min,n=t.max):e=n=t,e.x>=this.min.x&&n.x<=this.max.x&&e.y>=this.min.y&&n.y<=this.max.y},intersects:function(t){t=b(t);var e=this.min,n=this.max,i=t.min,o=t.max;return o.x>=e.x&&i.x<=n.x&&o.y>=e.y&&i.y<=n.y},overlaps:function(t){t=b(t);var e=this.min,n=this.max,i=t.min,o=t.max;return o.x>e.x&&i.xe.y&&i.y=i.lat&&n.lat<=o.lat&&e.lng>=i.lng&&n.lng<=o.lng},intersects:function(t){t=T(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),o=t.getNorthEast();return o.lat>=e.lat&&i.lat<=n.lat&&o.lng>=e.lng&&i.lng<=n.lng},overlaps:function(t){t=T(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),o=t.getNorthEast();return o.lat>e.lat&&i.late.lng&&i.lng1,Xe=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",a,e),window.removeEventListener("testPassiveEventSupport",a,e)}catch(t){}return t}(),qe=!!document.createElement("canvas").getContext,Ke=!(!document.createElementNS||!P("svg").createSVGRect),$e=!!Ke&&((ue=document.createElement("div")).innerHTML="","http://www.w3.org/2000/svg"===(ue.firstChild&&ue.firstChild.namespaceURI)),Je=!Ke&&function(){try{var t=document.createElement("div");t.innerHTML='';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),Qe={ie:_e,ielt9:xe,edge:we,webkit:be,android:Se,android23:Te,androidStock:Ce,opera:ke,chrome:Ie,gecko:Le,safari:Pe,phantom:De,opera12:Ae,win:Oe,ie3d:ze,webkit3d:Ee,gecko3d:Re,any3d:Be,mobile:Ne,mobileWebkit:Fe,mobileWebkit3d:Ve,msPointer:Ze,pointer:He,touch:je,touchNative:We,mobileOpera:Ge,mobileGecko:Ue,retina:Ye,passiveEvents:Xe,canvas:qe,svg:Ke,vml:Je,inlineSvg:$e,mac:0===navigator.platform.indexOf("Mac"),linux:0===navigator.platform.indexOf("Linux")},tn=Qe.msPointer?"MSPointerDown":"pointerdown",en=Qe.msPointer?"MSPointerMove":"pointermove",nn=Qe.msPointer?"MSPointerUp":"pointerup",on=Qe.msPointer?"MSPointerCancel":"pointercancel",rn={touchstart:tn,touchmove:en,touchend:nn,touchcancel:on},an={touchstart:function(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&ft(e),R(t,e)},touchmove:R,touchend:R,touchcancel:R},sn={},ln=!1,un=200,hn=K(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),cn=K(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),dn="webkitTransition"===cn||"OTransition"===cn?cn+"End":"transitionend";if("onselectstart"in document)he=function(){at(window,"selectstart",ft)},ce=function(){st(window,"selectstart",ft)};else{var pn=K(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);he=function(){if(pn){var t=document.documentElement.style;de=t[pn],t[pn]="none"}},ce=function(){pn&&(document.documentElement.style[pn]=de,de=void 0)}}var fn={__proto__:null,TRANSFORM:hn,TRANSITION:cn,TRANSITION_END:dn,get:B,getStyle:N,create:F,remove:V,empty:Z,toFront:H,toBack:W,hasClass:j,addClass:G,removeClass:U,setClass:Y,getClass:X,setOpacity:q,testProp:K,setTransform:$,setPosition:J,getPosition:Q,get disableTextSelection(){return he},get enableTextSelection(){return ce},disableImageDrag:tt,enableImageDrag:et,preventOutline:nt,restoreOutline:it,getSizedParentNode:ot,getScale:rt},gn="_leaflet_events",mn={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"},yn=Qe.linux&&Qe.chrome?window.devicePixelRatio:Qe.mac?3*window.devicePixelRatio:window.devicePixelRatio>0?2*window.devicePixelRatio:1,vn={__proto__:null,on:at,off:st,stopPropagation:ct,disableScrollPropagation:dt,disableClickPropagation:pt,preventDefault:ft,stop:gt,getPropagationPath:mt,getMousePosition:yt,getWheelDelta:vt,isExternalTarget:_t,addListener:at,removeListener:st},_n=ne.extend({run:function(t,e,n,i){this.stop(),this._el=t,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(i||.5,.2),this._startPos=Q(t),this._offset=e.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=m(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,n=1e3*this._duration;ethis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var n=this.getCenter(),i=this._limitCenter(n,this._zoom,T(t));return n.equals(i)||this.panTo(i,e),this._enforcingBounds=!1,this},panInside:function(t,e){var n=x((e=e||{}).paddingTopLeft||e.padding||[0,0]),i=x(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),r=this.project(t),a=this.getPixelBounds(),s=b([a.min.add(n),a.max.subtract(i)]),l=s.getSize();if(!s.contains(r)){this._enforcingBounds=!0;var u=r.subtract(s.getCenter()),h=s.extend(r).getSize().subtract(l);o.x+=u.x<0?-h.x:h.x,o.y+=u.y<0?-h.y:h.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=e({animate:!1,pan:!0},!0===t?{animate:!0}:t);var i=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),r=i.divideBy(2).round(),a=o.divideBy(2).round(),s=r.subtract(a);return s.x||s.y?(t.animate&&t.pan?this.panBy(s):(t.pan&&this._rawPanBy(s),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(n(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:i,newSize:o})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=e({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var i=n(this._handleGeolocationResponse,this),o=n(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(i,o,t):navigator.geolocation.getCurrentPosition(i,o,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,n=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+n+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=new M(t.coords.latitude,t.coords.longitude),n=e.toBounds(2*t.coords.accuracy),i=this._locateOptions;if(i.setView){var o=this.getBoundsZoom(n);this.setView(e,i.maxZoom?Math.min(o,i.maxZoom):o)}var r={latlng:e,bounds:n,timestamp:t.timestamp};for(var a in t.coords)"number"==typeof t.coords[a]&&(r[a]=t.coords[a]);this.fire("locationfound",r)}},addHandler:function(t,e){if(!e)return this;var n=this[t]=new e(this);return this._handlers.push(n),this.options[t]&&n.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(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),V(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(y(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)V(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var n=F("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new S(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,n){t=T(t),n=x(n||[0,0]);var i=this.getZoom()||0,o=this.getMinZoom(),r=this.getMaxZoom(),a=t.getNorthWest(),s=t.getSouthEast(),l=this.getSize().subtract(n),u=b(this.project(s,i),this.project(a,i)).getSize(),h=Qe.any3d?this.options.zoomSnap:1,c=l.x/u.x,d=l.y/u.y,p=e?Math.max(c,d):Math.min(c,d);return i=this.getScaleZoom(p,i),h&&(i=Math.round(i/(h/100))*(h/100),i=e?Math.ceil(i/h)*h:Math.floor(i/h)*h),Math.max(o,Math.min(r,i))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new _(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var n=this._getTopLeftPoint(t,e);return new w(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var n=this.options.crs;return e=void 0===e?this._zoom:e,n.scale(t)/n.scale(e)},getScaleZoom:function(t,e){var n=this.options.crs,i=n.zoom(t*n.scale(e=void 0===e?this._zoom:e));return isNaN(i)?1/0:i},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(C(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(x(t),e)},layerPointToLatLng:function(t){var e=x(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(C(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(C(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(T(t))},distance:function(t,e){return this.options.crs.distance(C(t),C(e))},containerPointToLayerPoint:function(t){return x(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return x(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(x(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(C(t)))},mouseEventToContainerPoint:function(t){return yt(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=B(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");at(e,"scroll",this._onScroll,this),this._containerId=i(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&Qe.any3d,G(t,"leaflet-container"+(Qe.touch?" leaflet-touch":"")+(Qe.retina?" leaflet-retina":"")+(Qe.ielt9?" leaflet-oldie":"")+(Qe.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=N(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),J(this._mapPane,new _(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(G(t.markerPane,"leaflet-zoom-hide"),G(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,n){J(this._mapPane,new _(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,n)._move(t,e)._moveEnd(o),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,n,i){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),i?n&&n.pinch&&this.fire("zoom",n):((o||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return y(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){J(this._mapPane,this._getMapPanePos().subtract(t))},_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(t){this._targets={},this._targets[i(this._container)]=this;var e=t?st:at;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),Qe.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){y(this._resizeRequest),this._resizeRequest=m(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var n,o=[],r="mouseout"===e||"mouseover"===e,a=t.target||t.srcElement,s=!1;a;){if((n=this._targets[i(a)])&&("click"===e||"preclick"===e)&&this._draggableMoved(n)){s=!0;break}if(n&&n.listens(e,!0)){if(r&&!_t(a,t))break;if(o.push(n),r)break}if(a===this._container)break;a=a.parentNode}return o.length||s||r||!this.listens(e,!0)||(o=[this]),o},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(e))){var n=t.type;"mousedown"===n&&nt(e),this._fireDOMEvent(t,n)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,n,i){if("click"===t.type){var o=e({},t);o.type="preclick",this._fireDOMEvent(o,o.type,i)}var r=this._findEventTargets(t,n);if(i){for(var a=[],s=0;s0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),n=this.getMaxZoom(),i=Qe.any3d?this.options.zoomSnap:1;return i&&(t=Math.round(t/i)*i),Math.max(e,Math.min(n,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){U(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var n=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(n)||(this.panBy(n,e),0))},_createAnimProxy:function(){var t=this._proxy=F("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(t){var e=hn,n=this._proxy.style[e];$(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),n===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){V(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();$(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,n){if(this._animatingZoom)return!0;if(n=n||{},!this._zoomAnimated||!1===n.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var i=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/i);return!(!0!==n.animate&&!this.getSize().contains(o)||(m(function(){this._moveStart(!0,n.noMoveStart||!1)._animateZoom(t,e,!0)},this),0))},_animateZoom:function(t,e,i,o){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,G(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:o}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(n(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&U(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))}}),wn=v.extend({options:{position:"topright"},initialize:function(t){h(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),n=this.getPosition(),i=t._controlCorners[n];return G(e,"leaflet-control"),-1!==n.indexOf("bottom")?i.insertBefore(e,i.firstChild):i.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(V(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),bn=function(t){return new wn(t)};xn.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){function t(t,o){e[t+o]=F("div",n+t+" "+n+o,i)}var e=this._controlCorners={},n="leaflet-",i=this._controlContainer=F("div",n+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)V(this._controlCorners[t]);V(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Sn=wn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,n,i){return n1)?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(i(t.target)),n=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;n&&this._map.fire(n,e)},_createRadioElement:function(t,e){var n='",i=document.createElement("div");return i.innerHTML=n,i.firstChild},_addItem:function(t){var e,n=document.createElement("label"),o=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=o):e=this._createRadioElement("leaflet-base-layers_"+i(this),o),this._layerControlInputs.push(e),e.layerId=i(t.layer),at(e,"click",this._onInputClick,this);var r=document.createElement("span");r.innerHTML=" "+t.name;var a=document.createElement("span");return n.appendChild(a),a.appendChild(e),a.appendChild(r),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var t,e,n=this._layerControlInputs,i=[],o=[];this._handlingClick=!0;for(var r=n.length-1;r>=0;r--)e=this._getLayer((t=n[r]).layerId).layer,t.checked?i.push(e):t.checked||o.push(e);for(r=0;r=0;o--)e=this._getLayer((t=n[o]).layerId).layer,t.disabled=void 0!==e.options.minZoom&&ie.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,at(t,"click",ft),this.expand();var e=this;setTimeout(function(){st(t,"click",ft),e._preventClick=!1})}}),Tn=wn.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",n=F("div",e+" leaflet-bar"),i=this.options;return this._zoomInButton=this._createButton(i.zoomInText,i.zoomInTitle,e+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(i.zoomOutText,i.zoomOutTitle,e+"-out",n,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(t){t.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(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,n,i,o){var r=F("a",n,i);return r.innerHTML=t,r.href="#",r.title=e,r.setAttribute("role","button"),r.setAttribute("aria-label",e),pt(r),at(r,"click",gt),at(r,"click",o,this),at(r,"click",this._refocusOnMap,this),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";U(this._zoomInButton,e),U(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(G(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(G(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});xn.mergeOptions({zoomControl:!0}),xn.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Tn,this.addControl(this.zoomControl))});var Mn=wn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",n=F("div",e),i=this.options;return this._addScales(i,e+"-line",n),t.on(i.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),n},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,n){t.metric&&(this._mScale=F("div",e,n)),t.imperial&&(this._iScale=F("div",e,n))},_update:function(){var t=this._map,e=t.getSize().y/2,n=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(n)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,n,i,o=3.2808399*t;o>5280?(n=this._getRoundNum(e=o/5280),this._updateScale(this._iScale,n+" mi",n/e)):(i=this._getRoundNum(o),this._updateScale(this._iScale,i+" ft",i/o))},_updateScale:function(t,e,n){t.style.width=Math.round(this.options.maxWidth*n)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),n=t/e;return e*(n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}}),Cn=wn.extend({options:{position:"bottomright",prefix:''+(Qe.inlineSvg?' ':"")+"Leaflet"},initialize:function(t){h(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=F("div","leaflet-control-attribution"),pt(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var n=[];this.options.prefix&&n.push(this.options.prefix),t.length&&n.push(t.join(", ")),this._container.innerHTML=n.join(' ')}}});xn.mergeOptions({attributionControl:!0}),xn.addInitHook(function(){this.options.attributionControl&&(new Cn).addTo(this)}),wn.Layers=Sn,wn.Zoom=Tn,wn.Scale=Mn,wn.Attribution=Cn,bn.layers=function(t,e,n){return new Sn(t,e,n)},bn.zoom=function(t){return new Tn(t)},bn.scale=function(t){return new Mn(t)},bn.attribution=function(t){return new Cn(t)};var kn=v.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});kn.addTo=function(t,e){return t.addHandler(e,this),this};var In,Ln={Events:ee},Pn=Qe.touch?"touchstart mousedown":"mousedown",Dn=ne.extend({options:{clickTolerance:3},initialize:function(t,e,n,i){h(this,i),this._element=t,this._dragStartTarget=e||t,this._preventOutline=n},enable:function(){this._enabled||(at(this._dragStartTarget,Pn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Dn._dragging===this&&this.finishDrag(!0),st(this._dragStartTarget,Pn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!j(this._element,"leaflet-zoom-anim")))if(t.touches&&1!==t.touches.length)Dn._dragging===this&&this.finishDrag();else if(!(Dn._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(Dn._dragging=this,this._preventOutline&&nt(this._element),tt(),he(),this._moving))){this.fire("down");var e=t.touches?t.touches[0]:t,n=ot(this._element);this._startPoint=new _(e.clientX,e.clientY),this._startPos=Q(this._element),this._parentScale=rt(n);var i="mousedown"===t.type;at(document,i?"mousemove":"touchmove",this._onMove,this),at(document,i?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(t){if(this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,n=new _(e.clientX,e.clientY)._subtract(this._startPoint);(n.x||n.y)&&(Math.abs(n.x)+Math.abs(n.y)1e-7;l++)e=r*Math.sin(s),e=Math.pow((1-e)/(1+e),r/2),s+=u=Math.PI/2-2*Math.atan(a*e)-s;return new M(s*n,t.x*n/i)}},Rn={__proto__:null,LonLat:zn,Mercator:En,SphericalMercator:le},Bn=e({},ae,{code:"EPSG:3395",projection:En,transformation:function(){var t=.5/(Math.PI*En.R);return I(t,.5,-t,.5)}()}),Nn=e({},ae,{code:"EPSG:4326",projection:zn,transformation:I(1/180,1,-1/180,.5)}),Fn=e({},re,{projection:zn,transformation:I(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var n=e.lng-t.lng,i=e.lat-t.lat;return Math.sqrt(n*n+i*i)},infinite:!0});re.Earth=ae,re.EPSG3395=Bn,re.EPSG3857=me,re.EPSG900913=ye,re.EPSG4326=Nn,re.Simple=Fn;var Vn=ne.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[i(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[i(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var n=this.getEvents();e.on(n,this),this.once("remove",function(){e.off(n,this)},this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});xn.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=i(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=i(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return i(t)in this._layers},eachLayer:function(t,e){for(var n in this._layers)t.call(e,this._layers[n]);return this},_addLayers:function(t){for(var e=0,n=(t=t?qt(t)?t:[t]:[]).length;ethis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()=2&&e[0]instanceof M&&e[0].equals(e[n-1])&&e.pop(),e},_setLatLngs:function(t){Kn.prototype._setLatLngs.call(this,t),Dt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Dt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,n=new _(e,e);if(t=new w(t.min.subtract(n),t.max.add(n)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var i,o=0,r=this._rings.length;ot.y!=(i=e[a]).y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(u=!u);return u||Kn.prototype._containsPoint.call(this,t,!0)}}),Jn=Hn.extend({initialize:function(t,e){h(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,n,i,o=qt(t)?t:t.features;if(o){for(e=0,n=o.length;e0?o:[e.src]}else{qt(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var s=0;si?(e.height=i+"px",G(t,o)):U(t,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),n=this._getAnchor();J(this._container,e.add(n))},_adjustPan:function(){if(this.options.autoPan)if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)this._autopanning=!1;else{var t=this._map,e=parseInt(N(this._container,"marginBottom"),10)||0,n=this._container.offsetHeight+e,i=this._containerWidth,o=new _(this._containerLeft,-n-this._containerBottom);o._add(Q(this._container));var r=t.layerPointToContainerPoint(o),a=x(this.options.autoPanPadding),s=x(this.options.autoPanPaddingTopLeft||a),l=x(this.options.autoPanPaddingBottomRight||a),u=t.getSize(),h=0,c=0;r.x+i+l.x>u.x&&(h=r.x+i-u.x+l.x),r.x-h-s.x<0&&(h=r.x-s.x),r.y+n+l.y>u.y&&(c=r.y+n-u.y+l.y),r.y-c-s.y<0&&(c=r.y-s.y),(h||c)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([h,c]))}},_getAnchor:function(){return x(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});xn.mergeOptions({closePopupOnClick:!0}),xn.include({openPopup:function(t,e,n){return this._initOverlay(ri,t,e,n).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),Vn.include({bindPopup:function(t,e){return this._popup=this._initOverlay(ri,this._popup,t,e),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(t){return this._popup&&(this instanceof Hn||(this._popup._source=this),this._popup._prepareOpen(t||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()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(this._popup&&this._map){gt(t);var e=t.layer||t.target;this._popup._source!==e||e instanceof Yn?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var ai=oi.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){oi.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){oi.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=oi.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){this._contentNode=this._container=F("div","leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide")),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+i(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,n,i=this._map,o=this._container,r=i.latLngToContainerPoint(i.getCenter()),a=i.layerPointToContainerPoint(t),s=this.options.direction,l=o.offsetWidth,u=o.offsetHeight,h=x(this.options.offset),c=this._getAnchor();"top"===s?(e=l/2,n=u):"bottom"===s?(e=l/2,n=0):"center"===s?(e=l/2,n=u/2):"right"===s?(e=0,n=u/2):"left"===s?(e=l,n=u/2):a.xthis.options.maxZoom||ni&&this._retainParent(o,r,a,i))},_retainChildren:function(t,e,n,i){for(var o=2*t;o<2*t+2;o++)for(var r=2*e;r<2*e+2;r++){var a=new _(o,r);a.z=n+1;var s=this._tileCoordsToKey(a),l=this._tiles[s];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),n+1this.options.maxZoom||void 0!==this.options.minZoom&&o1)this._setView(t,n);else{for(var c=o.min.y;c<=o.max.y;c++)for(var d=o.min.x;d<=o.max.x;d++){var p=new _(d,c);if(p.z=this._tileZoom,this._isValidTile(p)){var f=this._tiles[this._tileCoordsToKey(p)];f?f.current=!0:a.push(p)}}if(a.sort(function(t,e){return t.distanceTo(r)-e.distanceTo(r)}),0!==a.length){this._loading||(this._loading=!0,this.fire("loading"));var g=document.createDocumentFragment();for(d=0;dn.max.x)||!e.wrapLat&&(t.yn.max.y))return!1}if(!this.options.bounds)return!0;var i=this._tileCoordsToBounds(t);return T(this.options.bounds).overlaps(i)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,n=this.getTileSize(),i=t.scaleBy(n),o=i.add(n);return[e.unproject(i,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),n=new S(e[0],e[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),n=new _(+e[0],+e[1]);return n.z=+e[2],n},_removeTile:function(t){var e=this._tiles[t];e&&(V(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){G(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=a,t.onmousemove=a,Qe.ielt9&&this.options.opacity<1&&q(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),o=this._tileCoordsToKey(t),r=this.createTile(this._wrapCoords(t),n(this._tileReady,this,t));this._initTile(r),this.createTile.length<2&&m(n(this._tileReady,this,t,null,r)),J(r,i),this._tiles[o]={el:r,coords:t,current:!0},e.appendChild(r),this.fire("tileloadstart",{tile:r,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var o=this._tileCoordsToKey(t);(i=this._tiles[o])&&(i.loaded=+new Date,this._map._fadeAnimated?(q(i.el,0),y(this._fadeFrame),this._fadeFrame=m(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(G(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Qe.ielt9||!this._map._fadeAnimated?m(this._pruneTiles,this):setTimeout(n(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new _(this._wrapX?r(t.x,this._wrapX):t.x,this._wrapY?r(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new w(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}}),ui=li.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=h(this,e)).detectRetina&&Qe.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return at(i,"load",n(this._tileOnLoad,this,e,i)),at(i,"error",n(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var n={r:Qe.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(n.y=i),n["-y"]=i}return d(this._url,e(n,this.options))},_tileOnLoad:function(t,e){Qe.ielt9?setTimeout(n(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,n){var i=this.options.errorTileUrl;i&&e.getAttribute("src")!==i&&(e.src=i),t(n,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom;return this.options.zoomReverse&&(t=this.options.maxZoom-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=a,e.onerror=a,!e.complete)){e.src=Kt;var n=this._tiles[t].coords;V(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:n})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",Kt),li.prototype._removeTile.call(this,t)},_tileReady:function(t,e,n){if(this._map&&(!n||n.getAttribute("src")!==Kt))return li.prototype._tileReady.call(this,t,e,n)}}),hi=ui.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,n){this._url=t;var i=e({},this.defaultWmsParams);for(var o in n)o in this.options||(i[o]=n[o]);var r=(n=h(this,n)).detectRetina&&Qe.retina?2:1,a=this.getTileSize();i.width=a.x*r,i.height=a.y*r,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version),this.wmsParams[this._wmsVersion>=1.3?"crs":"srs"]=this._crs.code,ui.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),n=this._crs,i=b(n.project(e[0]),n.project(e[1])),o=i.min,r=i.max,a=(this._wmsVersion>=1.3&&this._crs===Nn?[o.y,o.x,r.y,r.x]:[o.x,o.y,r.x,r.y]).join(","),s=ui.prototype.getTileUrl.call(this,t);return s+c(this.wmsParams,s,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+a},setParams:function(t,n){return e(this.wmsParams,t),n||this.redraw(),this}});ui.WMS=hi,Wt.wms=function(t,e){return new hi(t,e)};var ci=Vn.extend({options:{padding:.1},initialize:function(t){h(this,t),i(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),G(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 t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var n=this._map.getZoomScale(e,this._zoom),i=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),r=i.multiplyBy(-n).add(o).subtract(this._map._getNewPixelOrigin(t,e));Qe.any3d?$(this._container,r,n):J(this._container,r)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),n=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new w(n,n.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),di=ci.extend({options:{tolerance:0},getEvents:function(){var t=ci.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ci.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");at(t,"mousemove",this._onMouseMove,this),at(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),at(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){y(this._redrawRequest),delete this._ctx,V(this._container),st(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){ci.prototype._update.call(this);var t=this._bounds,e=this._container,n=t.getSize(),i=Qe.retina?2:1;J(e,t.min),e.width=i*n.x,e.height=i*n.y,e.style.width=n.x+"px",e.style.height=n.y+"px",Qe.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){ci.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[i(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,n=e.next,o=e.prev;n?n.prev=o:this._drawLast=o,o?o.next=n:this._drawFirst=n,delete t._order,delete this._layers[i(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,n,i=t.options.dashArray.split(/[, ]+/),o=[];for(n=0;n')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),fi={_initContainer:function(){this._container=F("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ci.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=pi("shape");G(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=pi("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[i(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;V(e),t.removeInteractiveTarget(e),delete this._layers[i(t)]},_updateStyle:function(t){var e=t._stroke,n=t._fill,i=t.options,o=t._container;o.stroked=!!i.stroke,o.filled=!!i.fill,i.stroke?(e||(e=t._stroke=pi("stroke")),o.appendChild(e),e.weight=i.weight+"px",e.color=i.color,e.opacity=i.opacity,e.dashStyle=i.dashArray?qt(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):"",e.endcap=i.lineCap.replace("butt","flat"),e.joinstyle=i.lineJoin):e&&(o.removeChild(e),t._stroke=null),i.fill?(n||(n=t._fill=pi("fill")),o.appendChild(n),n.color=i.fillColor||i.color,n.opacity=i.fillOpacity):n&&(o.removeChild(n),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),n=Math.round(t._radius),i=Math.round(t._radiusY||n);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+n+","+i+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){H(t._container)},_bringToBack:function(t){W(t._container)}},gi=Qe.vml?pi:P,mi=ci.extend({_initContainer:function(){this._container=gi("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=gi("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){V(this._container),st(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){ci.prototype._update.call(this);var t=this._bounds,e=t.getSize(),n=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,n.setAttribute("width",e.x),n.setAttribute("height",e.y)),J(n,t.min),n.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=gi("path");t.options.className&&G(e,t.options.className),t.options.interactive&&G(e,"leaflet-interactive"),this._updateStyle(t),this._layers[i(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){V(t._path),t.removeInteractiveTarget(t._path),delete this._layers[i(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,n=t.options;e&&(n.stroke?(e.setAttribute("stroke",n.color),e.setAttribute("stroke-opacity",n.opacity),e.setAttribute("stroke-width",n.weight),e.setAttribute("stroke-linecap",n.lineCap),e.setAttribute("stroke-linejoin",n.lineJoin),n.dashArray?e.setAttribute("stroke-dasharray",n.dashArray):e.removeAttribute("stroke-dasharray"),n.dashOffset?e.setAttribute("stroke-dashoffset",n.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),n.fill?(e.setAttribute("fill",n.fillColor||n.color),e.setAttribute("fill-opacity",n.fillOpacity),e.setAttribute("fill-rule",n.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,D(t._parts,e))},_updateCircle:function(t){var e=t._point,n=Math.max(Math.round(t._radius),1),i="a"+n+","+(Math.max(Math.round(t._radiusY),1)||n)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-n)+","+e.y+i+2*n+",0 "+i+2*-n+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){H(t._path)},_bringToBack:function(t){W(t._path)}});Qe.vml&&mi.include(fi),xn.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&jt(t)||Gt(t)}});var yi=$n.extend({initialize:function(t,e){$n.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=T(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});mi.create=gi,mi.pointsToPath=D,Jn.geometryToLayer=zt,Jn.coordsToLatLng=Rt,Jn.coordsToLatLngs=Bt,Jn.latLngToCoords=Nt,Jn.latLngsToCoords=Ft,Jn.getFeature=Vt,Jn.asFeature=Zt,xn.mergeOptions({boxZoom:!0});var vi=kn.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){at(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){st(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){V(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),he(),tt(),this._startPoint=this._map.mouseEventToContainerPoint(t),at(document,{contextmenu:gt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=F("div","leaflet-zoom-box",this._container),G(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new w(this._point,this._startPoint),n=e.getSize();J(this._box,e.min),this._box.style.width=n.x+"px",this._box.style.height=n.y+"px"},_finish:function(){this._moved&&(V(this._box),U(this._container,"leaflet-crosshair")),ce(),et(),st(document,{contextmenu:gt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(n(this._resetState,this),0);var e=new S(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});xn.addInitHook("addHandler","boxZoom",vi),xn.mergeOptions({doubleClickZoom:!0});var _i=kn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,n=e.getZoom(),i=e.options.zoomDelta,o=t.originalEvent.shiftKey?n-i:n+i;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});xn.addInitHook("addHandler","doubleClickZoom",_i),xn.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var xi=kn.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new Dn(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}G(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){U(this._map._container,"leaflet-grab"),U(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 t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=T(this._map.options.maxBounds);this._offsetLimit=b(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.xe.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),n=this._initialWorldOffset,i=this._draggable._newPos.x,o=(i-e+n)%t+e-n,r=(i+e+n)%t-e-n,a=Math.abs(o+n)0?o:-o))-e;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}});xn.addInitHook("addHandler","scrollWheelZoom",bi),xn.mergeOptions({tapHold:Qe.touchNative&&Qe.safari&&Qe.mobile,tapTolerance:15});var Si=kn.extend({addHooks:function(){at(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){st(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),1===t.touches.length){var e=t.touches[0];this._startPos=this._newPos=new _(e.clientX,e.clientY),this._holdTimeout=setTimeout(n(function(){this._cancel(),this._isTapValid()&&(at(document,"touchend",ft),at(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),600),at(document,"touchend touchcancel contextmenu",this._cancel,this),at(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){st(document,"touchend",ft),st(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),st(document,"touchend touchcancel contextmenu",this._cancel,this),st(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new _(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var n=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});n._simulated=!0,e.target.dispatchEvent(n)}});xn.addInitHook("addHandler","tapHold",Si),xn.mergeOptions({touchZoom:Qe.touch,bounceAtZoomLimits:!0});var Ti=kn.extend({addHooks:function(){G(this._map._container,"leaflet-touch-zoom"),at(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){U(this._map._container,"leaflet-touch-zoom"),st(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var n=e.mouseEventToContainerPoint(t.touches[0]),i=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(n.add(i)._divideBy(2))),this._startDist=n.distanceTo(i),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),at(document,"touchmove",this._onTouchMove,this),at(document,"touchend touchcancel",this._onTouchEnd,this),ft(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),o=e.mouseEventToContainerPoint(t.touches[1]),r=i.distanceTo(o)/this._startDist;if(this._zoom=e.getScaleZoom(r,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoome.getMaxZoom()&&r>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===r)return}else{var a=i._add(o)._divideBy(2)._subtract(this._centerPoint);if(1===r&&0===a.x&&0===a.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(a),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),y(this._animRequest);var s=n(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=m(s,this,!0),ft(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,y(this._animRequest),st(document,"touchmove",this._onTouchMove,this),st(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))):this._zooming=!1}});xn.addInitHook("addHandler","touchZoom",Ti),xn.BoxZoom=vi,xn.DoubleClickZoom=_i,xn.Drag=xi,xn.Keyboard=wi,xn.ScrollWheelZoom=bi,xn.TapHold=Si,xn.TouchZoom=Ti,t.Bounds=w,t.Browser=Qe,t.CRS=re,t.Canvas=di,t.Circle=qn,t.CircleMarker=Xn,t.Class=v,t.Control=wn,t.DivIcon=si,t.DivOverlay=oi,t.DomEvent=vn,t.DomUtil=fn,t.Draggable=Dn,t.Evented=ne,t.FeatureGroup=Hn,t.GeoJSON=Jn,t.GridLayer=li,t.Handler=kn,t.Icon=Wn,t.ImageOverlay=ei,t.LatLng=M,t.LatLngBounds=S,t.Layer=Vn,t.LayerGroup=Zn,t.LineUtil=On,t.Map=xn,t.Marker=Un,t.Mixin=Ln,t.Path=Yn,t.Point=_,t.PolyUtil=An,t.Polygon=$n,t.Polyline=Kn,t.Popup=ri,t.PosAnimation=_n,t.Projection=Rn,t.Rectangle=yi,t.Renderer=ci,t.SVG=mi,t.SVGOverlay=ii,t.TileLayer=ui,t.Tooltip=ai,t.Transformation=k,t.Util=te,t.VideoOverlay=ni,t.bind=n,t.bounds=b,t.canvas=jt,t.circle=function(t,e,n){return new qn(t,e,n)},t.circleMarker=function(t,e){return new Xn(t,e)},t.control=bn,t.divIcon=function(t){return new si(t)},t.extend=e,t.featureGroup=function(t,e){return new Hn(t,e)},t.geoJSON=Ht,t.geoJson=ti,t.gridLayer=function(t){return new li(t)},t.icon=function(t){return new Wn(t)},t.imageOverlay=function(t,e,n){return new ei(t,e,n)},t.latLng=C,t.latLngBounds=T,t.layerGroup=function(t,e){return new Zn(t,e)},t.map=function(t,e){return new xn(t,e)},t.marker=function(t,e){return new Un(t,e)},t.point=x,t.polygon=function(t,e){return new $n(t,e)},t.polyline=function(t,e){return new Kn(t,e)},t.popup=function(t,e){return new ri(t,e)},t.rectangle=function(t,e){return new yi(t,e)},t.setOptions=h,t.stamp=i,t.svg=Gt,t.svgOverlay=function(t,e,n){return new ii(t,e,n)},t.tileLayer=Wt,t.tooltip=function(t,e){return new ai(t,e)},t.transformation=I,t.version="1.9.4",t.videoOverlay=function(t,e,n){return new ni(t,e,n)};var Mi=window.L;t.noConflict=function(){return window.L=Mi,this},window.L=t}(e)}},n={};t.d=(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";function e(t,e){function n(){this.constructor=t}if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Kp(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function n(){return vf++}function i(){for(var t=[],e=0;e>1)%2;a.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[s]+":0",o[l]+":0",i[1-s]+":auto",o[1-l]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}return e.clearMarkers=function(){c(n,function(t){t.parentNode&&t.parentNode.removeChild(t)})},n}(e,r),s=function(t,e,n){for(var i=n?"invTrans":"trans",o=e[i],r=e.srcCoords,a=[],s=[],l=!0,u=0;u<4;u++){var h=t[u].getBoundingClientRect(),c=2*u,d=h.left,p=h.top;a.push(d,p),l=l&&r&&d===r[c]&&p===r[c+1],s.push(t[u].offsetLeft,t[u].offsetTop)}return l&&o?o:(e.srcCoords=a,e[i]=n?rt(s,a):rt(a,s))}(a,r,o);if(s)return s(t,n,i),!0}return!1}function st(t){return"CANVAS"===t.nodeName.toUpperCase()}function lt(t){return null==t?"":(t+"").replace(Rf,function(t,e){return Bf[e]})}function ut(t,e,n,i){return n=n||{},i?ht(t,e,n):Vf&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):ht(t,e,n),n}function ht(t,e,n){if(Qp.domSupported&&t.getBoundingClientRect){var i=e.clientX,o=e.clientY;if(st(t)){var r=t.getBoundingClientRect();return n.zrX=i-r.left,void(n.zrY=o-r.top)}if(at(Ff,t,i,o))return n.zrX=Ff[0],void(n.zrY=Ff[1])}n.zrX=n.zrY=0}function ct(t){return t||window.event}function dt(t,e,n){if(null!=(e=ct(e)).zrX)return e;var i=e.type;if(i&&i.indexOf("touch")>=0){var o="touchend"!==i?e.targetTouches[0]:e.changedTouches[0];o&&ut(t,o,e,n)}else{ut(t,e,e,n);var r=function(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,i=t.deltaY;return null==n||null==i?e:3*(0!==i?Math.abs(i):Math.abs(n))*(i>0?-1:i<0?1:n>0?-1:1)}(e);e.zrDelta=r?r/120:-(e.detail||0)/3}var a=e.button;return null==e.which&&void 0!==a&&Nf.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function pt(t,e,n,i){t.addEventListener(e,n,i)}function ft(t,e,n,i){t.removeEventListener(e,n,i)}function gt(t){return 2===t.which||3===t.which}function mt(t){var e=t[1][0]-t[0][0],n=t[1][1]-t[0][1];return Math.sqrt(e*e+n*n)}function yt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function vt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function _t(t,e,n){var i=e[1]*n[0]+e[3]*n[1],o=e[0]*n[2]+e[2]*n[3],r=e[1]*n[2]+e[3]*n[3],a=e[0]*n[4]+e[2]*n[5]+e[4],s=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=e[0]*n[0]+e[2]*n[1],t[1]=i,t[2]=o,t[3]=r,t[4]=a,t[5]=s,t}function xt(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function wt(t,e,n,i){void 0===i&&(i=[0,0]);var o=e[0],r=e[2],a=e[4],s=e[1],l=e[3],u=e[5],h=Math.sin(n),c=Math.cos(n);return t[0]=o*c+s*h,t[1]=-o*h+s*c,t[2]=r*c+l*h,t[3]=-r*h+c*l,t[4]=c*(a-i[0])+h*(u-i[1])+i[0],t[5]=c*(u-i[1])-h*(a-i[0])+i[1],t}function bt(t,e){var n=e[0],i=e[2],o=e[4],r=e[1],a=e[3],s=e[5],l=n*a-r*i;return l?(t[0]=a*(l=1/l),t[1]=-r*l,t[2]=-i*l,t[3]=n*l,t[4]=(i*s-a*o)*l,t[5]=(r*o-n*s)*l,t):null}function St(t,e,n,i,o,r,a,s){var l=Xf(e-n),u=Xf(i-t),h=Uf(l,u),c=qf[o],d=qf[1-o],p=Kf[o];e=u||!eg.bidirectional)&&(ng[c]=-u,ng[d]=0,eg.useDir&&eg.calcDirMTV())))}function Tt(){function t(t){return Xf(t)<1e-10}var e=0,n=new Gf,i=new Gf,o={minTv:new Gf,maxTv:new Gf,useDir:!1,dirMinTv:new Gf,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(t,r){o.touchThreshold=0,t&&null!=t.touchThreshold&&(o.touchThreshold=Yf(0,t.touchThreshold)),o.negativeSize=!1,r&&(o.minTv.set(1/0,1/0),o.maxTv.set(0,0),o.useDir=!1,t&&null!=t.direction&&(o.useDir=!0,o.dirMinTv.copy(o.minTv),i.copy(o.minTv),e=t.direction,o.bidirectional=null==t.bidirectional||!!t.bidirectional,o.bidirectional||n.set(Math.cos(e),Math.sin(e))))},calcDirMTV:function(){var r=o.minTv,a=o.dirMinTv,s=r.y*r.y+r.x*r.x,l=Math.sin(e),u=Math.cos(e),h=l*r.y+u*r.x;t(h)?t(r.x)&&t(r.y)&&a.set(0,0):(i.x=s*u/h,i.y=s*l/h,t(i.x)&&t(i.y)?a.set(0,0):(o.bidirectional||n.dot(i)>0)&&i.len()=0;r--){var a=t[r],s=void 0;if(a!==o&&!a.ignore&&(s=Ct(a,n,i))&&(!e.topTarget&&(e.topTarget=a),s!==ug)){e.target=a;break}}}function It(t,e,n){var i=t.painter;return e<0||e>i.getWidth()||n<0||n>i.getHeight()}function Lt(t,e,n,i){var o=e+1;if(o===n)return 1;if(i(t[o++],t[e])<0){for(;o=0;)o++;return o-e}function Pt(t,e,n,i,o){for(i===e&&i++;i>>1])<0?l=r:s=r+1;var u=i-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;u>0;)t[s+u]=t[s+u-1],u--}t[s]=a}}function Dt(t,e,n,i,o,r){var a=0,s=0,l=1;if(r(t,e[n+o])>0){for(s=i-o;l0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=o,l+=o}else{for(s=o+1;ls&&(l=s);var u=a;a=o-l,l=o-u}for(a++;a>>1);r(t,e[n+h])>0?a=h+1:l=h}return l}function At(t,e,n,i,o,r){var a=0,s=0,l=1;if(r(t,e[n+o])<0){for(s=o+1;ls&&(l=s);var u=a;a=o-l,l=o-u}else{for(s=i-o;l=0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=o,l+=o}for(a++;a>>1);r(t,e[n+h])<0?l=h:a=h+1}return l}function Ot(t,e,n,i){n||(n=0),i||(i=t.length);var o=i-n;if(!(o<2)){var r=0;if(o<32)Pt(t,n,i,n+(r=Lt(t,n,i,e)),e);else{var a=function(t,e){function n(n){var l=i[n],u=o[n],h=i[n+1],c=o[n+1];o[n]=u+c,n===a-3&&(i[n+1]=i[n+2],o[n+1]=o[n+2]),a--;var d=At(t[h],t,l,u,0,e);l+=d,0!==(u-=d)&&0!==(c=Dt(t[l+u-1],t,h,c,c-1,e))&&(u<=c?function(n,i,o,a){var l=0;for(l=0;l=7||p>=7);if(f)break;g<0&&(g=0),g+=2}if((r=g)<1&&(r=1),1===i){for(l=0;l=0;l--)t[p+l]=t[d+l];if(0===i){y=!0;break}}if(t[c--]=s[h--],1===--a){y=!0;break}if(0!==(m=a-Dt(t[u],s,0,a,a-1,e))){for(a-=m,p=1+(c-=m),d=1+(h-=m),l=0;l=7||m>=7);if(y)break;f<0&&(f=0),f+=2}if((r=f)<1&&(r=1),1===a){for(p=1+(c-=i),d=1+(u-=i),l=i-1;l>=0;l--)t[p+l]=t[d+l];t[c]=s[h]}else{if(0===a)throw new Error;for(d=c-(a-1),l=0;l=0;l--)t[p+l]=t[d+l];t[c]=s[h]}else for(d=c-(a-1),l=0;l1;){var t=a-2;if(t>=1&&o[t-1]<=o[t]+o[t+1]||t>=2&&o[t-2]<=o[t]+o[t-1])o[t-1]o[t+1])break;n(t)}},forceMergeRuns:function(){for(;a>1;){var t=a-2;t>0&&o[t-1]=32;)e|=1&t,t>>=1;return t+e}(o);do{if((r=Lt(t,n,i,e))s&&(l=s),Pt(t,n,n+l,n+r,e),r=l}a.pushRun(n,r),a.mergeRuns(),o-=r,n+=r}while(0!==o);a.forceMergeRuns()}}}function zt(){mg||(mg=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Et(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}function Rt(t){return t>-1e-8&&tTg||t<-1e-8}function Nt(t,e,n,i,o){var r=1-o;return r*r*(r*t+3*o*e)+o*o*(o*i+3*r*n)}function Ft(t,e,n,i,o){var r=1-o;return 3*(((e-t)*r+2*(n-e)*o)*r+(i-n)*o*o)}function Vt(t,e,n,i,o,r){var a=i+3*(e-n)-t,s=3*(n-2*e+t),l=3*(e-t),u=t-o,h=s*s-3*a*l,c=s*l-9*a*u,d=l*l-3*s*u,p=0;if(Rt(h)&&Rt(c))Rt(s)?r[0]=0:(T=-l/s)>=0&&T<=1&&(r[p++]=T);else{var f=c*c-4*h*d;if(Rt(f)){var g=c/h,m=-g/2;(T=-s/a+g)>=0&&T<=1&&(r[p++]=T),m>=0&&m<=1&&(r[p++]=m)}else if(f>0){var y=Sg(f),v=h*s+1.5*a*(-c+y),_=h*s+1.5*a*(-c-y);(T=(-s-((v=v<0?-bg(-v,kg):bg(v,kg))+(_=_<0?-bg(-_,kg):bg(_,kg))))/(3*a))>=0&&T<=1&&(r[p++]=T)}else{var x=(2*h*s-3*a*c)/(2*Sg(h*h*h)),w=Math.acos(x)/3,b=Sg(h),S=Math.cos(w),T=(-s-2*b*S)/(3*a),M=(m=(-s+b*(S+Cg*Math.sin(w)))/(3*a),(-s+b*(S-Cg*Math.sin(w)))/(3*a));T>=0&&T<=1&&(r[p++]=T),m>=0&&m<=1&&(r[p++]=m),M>=0&&M<=1&&(r[p++]=M)}}return p}function Zt(t,e,n,i,o){var r=6*n-12*e+6*t,a=9*e+3*i-3*t-9*n,s=3*e-3*t,l=0;if(Rt(a))Bt(r)&&(h=-s/r)>=0&&h<=1&&(o[l++]=h);else{var u=r*r-4*a*s;if(Rt(u))o[0]=-r/(2*a);else if(u>0){var h,c=Sg(u),d=(-r-c)/(2*a);(h=(-r+c)/(2*a))>=0&&h<=1&&(o[l++]=h),d>=0&&d<=1&&(o[l++]=d)}}return l}function Ht(t,e,n,i,o,r){var a=(e-t)*o+t,s=(n-e)*o+e,l=(i-n)*o+n,u=(s-a)*o+a,h=(l-s)*o+s,c=(h-u)*o+u;r[0]=t,r[1]=a,r[2]=u,r[3]=c,r[4]=c,r[5]=h,r[6]=l,r[7]=i}function Wt(t,e,n,i,o,r,a,s,l){for(var u=t,h=e,c=0,d=1/l,p=1;p<=l;p++){var f=p*d,g=Nt(t,n,o,a,f),m=Nt(e,i,r,s,f),y=g-u,v=m-h;c+=Math.sqrt(y*y+v*v),u=g,h=m}return c}function jt(t,e,n,i){var o=1-i;return o*(o*t+2*i*e)+i*i*n}function Gt(t,e,n,i){return 2*((1-i)*(e-t)+i*(n-e))}function Ut(t,e,n){var i=t+n-2*e;return 0===i?.5:(t-e)/i}function Yt(t,e,n,i,o){var r=(e-t)*i+t,a=(n-e)*i+e,s=(a-r)*i+r;o[0]=t,o[1]=r,o[2]=s,o[3]=s,o[4]=a,o[5]=n}function Xt(t,e,n,i,o,r,a){for(var s=t,l=e,u=0,h=1/a,c=1;c<=a;c++){var d=c*h,p=jt(t,n,o,d),f=jt(e,i,r,d),g=p-s,m=f-l;u+=Math.sqrt(g*g+m*m),s=p,l=f}return u}function qt(t){var e=t&&Dg.exec(t);if(e){var n=e[1].split(","),i=+z(n[0]),o=+z(n[1]),r=+z(n[2]),a=+z(n[3]);if(isNaN(i+o+r+a))return;var s=[];return function(t){return t<=0?0:t>=1?1:Vt(0,i,r,1,t,s)&&Nt(0,o,a,1,s[0])}}}function Kt(t){return(t=Math.round(t))<0?0:t>255?255:t}function $t(t){return t<0?0:t>1?1:t}function Jt(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?Kt(parseFloat(e)/100*255):Kt(parseInt(e,10))}function Qt(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?$t(parseFloat(e)/100):$t(parseFloat(e))}function te(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function ee(t,e,n,i,o){return t[0]=e,t[1]=n,t[2]=i,t[3]=o,t}function ne(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function ie(t,e){Fg&&ne(Fg,e),Fg=Ng.put(t,Fg||e.slice())}function oe(t,e){if(t){e=e||[];var n=Ng.get(t);if(n)return ne(e,n);var i=(t+="").replace(/ /g,"").toLowerCase();if(i in Bg)return ne(e,Bg[i]),ie(t,e),e;var o,r=i.length;if("#"===i.charAt(0))return 4===r||5===r?(o=parseInt(i.slice(1,4),16))>=0&&o<=4095?(ee(e,(3840&o)>>4|(3840&o)>>8,240&o|(240&o)>>4,15&o|(15&o)<<4,5===r?parseInt(i.slice(4),16)/15:1),ie(t,e),e):void ee(e,0,0,0,1):7===r||9===r?(o=parseInt(i.slice(1,7),16))>=0&&o<=16777215?(ee(e,(16711680&o)>>16,(65280&o)>>8,255&o,9===r?parseInt(i.slice(7),16)/255:1),ie(t,e),e):void ee(e,0,0,0,1):void 0;var a=i.indexOf("("),s=i.indexOf(")");if(-1!==a&&s+1===r){var l=i.substr(0,a),u=i.substr(a+1,s-(a+1)).split(","),h=1;switch(l){case"rgba":if(4!==u.length)return 3===u.length?ee(e,+u[0],+u[1],+u[2],1):ee(e,0,0,0,1);h=Qt(u.pop());case"rgb":return u.length>=3?(ee(e,Jt(u[0]),Jt(u[1]),Jt(u[2]),3===u.length?h:Qt(u[3])),ie(t,e),e):void ee(e,0,0,0,1);case"hsla":return 4!==u.length?void ee(e,0,0,0,1):(u[3]=Qt(u[3]),re(u,e),ie(t,e),e);case"hsl":return 3!==u.length?void ee(e,0,0,0,1):(re(u,e),ie(t,e),e);default:return}}ee(e,0,0,0,1)}}function re(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=Qt(t[1]),o=Qt(t[2]),r=o<=.5?o*(i+1):o+i-o*i,a=2*o-r;return ee(e=e||[],Kt(255*te(a,r,n+1/3)),Kt(255*te(a,r,n)),Kt(255*te(a,r,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function ae(t,e){var n=oe(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,n[i]>255?n[i]=255:n[i]<0&&(n[i]=0);return le(n,4===n.length?"rgba":"rgb")}}function se(t,e,n,i){var o,r=oe(t);if(t)return r=function(t){if(t){var e,n,i=t[0]/255,o=t[1]/255,r=t[2]/255,a=Math.min(i,o,r),s=Math.max(i,o,r),l=s-a,u=(s+a)/2;if(0===l)e=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var h=((s-i)/6+l/2)/l,c=((s-o)/6+l/2)/l,d=((s-r)/6+l/2)/l;i===s?e=d-c:o===s?e=1/3+h-d:r===s&&(e=2/3+c-h),e<0&&(e+=1),e>1&&(e-=1)}var p=[360*e,n,u];return null!=t[3]&&p.push(t[3]),p}}(r),null!=e&&(r[0]=(o=v(e)?e(r[0]):e,(o=Math.round(o))<0?0:o>360?360:o)),null!=n&&(r[1]=Qt(v(n)?n(r[1]):n)),null!=i&&(r[2]=Qt(v(i)?i(r[2]):i)),le(re(r),"rgba")}function le(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}function ue(t,e){var n=oe(t);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*e:0}function he(t){if(_(t)){var e=Vg.get(t);return e||(e=ae(t,-.1),Vg.put(t,e)),e}if(C(t)){var n=a({},t);return n.colorStops=d(t.colorStops,function(t){return{offset:t.offset,color:ae(t.color,-.1)}}),n}return t}function ce(t){var e;if(t&&"transparent"!==t){if("string"==typeof t&&t.indexOf("rgba")>-1){var n=oe(t);n&&(t="rgb("+n[0]+","+n[1]+","+n[2]+")",e=n[3])}}else t="none";return{color:t,opacity:null==e?1:e}}function de(t){return t-1e-4}function pe(t){return Zg(1e3*t)/1e3}function fe(t){return Zg(1e4*t)/1e4}function ge(t){return t&&!!t.image}function me(t){return ge(t)||function(t){return t&&!!t.svgElement}(t)}function ye(t){return"linear"===t.type}function ve(t){return"radial"===t.type}function _e(t){return t&&("linear"===t.type||"radial"===t.type)}function xe(t){return"url(#"+t+")"}function we(t){var e=t.getGlobalScale(),n=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(n)/Math.log(10)),1)}function be(t){var e=t.x||0,n=t.y||0,i=(t.rotation||0)*Tf,o=L(t.scaleX,1),r=L(t.scaleY,1),a=t.skewX||0,s=t.skewY||0,l=[];return(e||n)&&l.push("translate("+e+"px,"+n+"px)"),i&&l.push("rotate("+i+")"),1===o&&1===r||l.push("scale("+o+","+r+")"),(a||s)&&l.push("skew("+Zg(a*Tf)+"deg, "+Zg(s*Tf)+"deg)"),l.join(" ")}function Se(t,e,n){return(e-t)*n+t}function Te(t,e,n,i){for(var o=e.length,r=0;ri?e:t,r=Math.min(n,i),a=o[r-1]||{color:[0,0,0,0],offset:0},s=r;sa)i.length=a;else for(var s=r;sgm||t<-5e-5}function Ve(t,e){for(var n=0;n=Mm)){t=t||of;for(var e=[],n=+new Date,i=0;i<=127;i++)e[i]=af.measureText(String.fromCharCode(i),t).width;var o=+new Date-n;return o>16?Tm=Mm:o>2&&Tm++,e}}(t.font),t.asciiWidthMapTried=!0),0<=e&&e<=127?null!=t.asciiWidthMap?t.asciiWidthMap[e]:t.asciiCharWidth:t.stWideCharWidth}function We(t,e){var n=t.strWidthCache,i=n.get(e);return null==i&&(i=af.measureText(e,t.font).width,n.put(e,i)),i}function je(t,e,n,i){var o=We(Ze(e),t),r=Xe(e),a=Ue(0,o,n),s=Ye(0,r,i);return new lg(a,s,o,r)}function Ge(t,e,n,i){var o=((t||"")+"").split("\n");if(1===o.length)return je(o[0],e,n,i);for(var r=new lg(0,0,0,0),a=0;a=0?parseFloat(t)/100*e:parseFloat(t):t}function Ke(t,e,n){var i=e.position||"inside",o=null!=e.distance?e.distance:5,r=n.height,a=n.width,s=r/2,l=n.x,u=n.y,h="left",c="top";if(i instanceof Array)l+=qe(i[0],n.width),u+=qe(i[1],n.height),h=null,c=null;else switch(i){case"left":l-=o,u+=s,h="right",c="middle";break;case"right":l+=o+a,u+=s,c="middle";break;case"top":l+=a/2,u-=o,h="center",c="bottom";break;case"bottom":l+=a/2,u+=r+o,h="center";break;case"inside":l+=a/2,u+=s,h="center",c="middle";break;case"insideLeft":l+=o,u+=s,c="middle";break;case"insideRight":l+=a-o,u+=s,h="right",c="middle";break;case"insideTop":l+=a/2,u+=o,h="center";break;case"insideBottom":l+=a/2,u+=r-o,h="center",c="bottom";break;case"insideTopLeft":l+=o,u+=o;break;case"insideTopRight":l+=a-o,u+=o,h="right";break;case"insideBottomLeft":l+=o,u+=r-o,c="bottom";break;case"insideBottomRight":l+=a-o,u+=r-o,h="right",c="bottom"}return(t=t||{}).x=l,t.y=u,t.align=h,t.verticalAlign=c,t}function $e(t,e,n,i,o){var r=[];tn(t,"",t,e,n=n||{},i,r,o);var a=r.length,s=!1,l=n.done,u=n.aborted,h=function(){s=!0,--a<=0&&(s?l&&l():u&&u())},c=function(){--a<=0&&(s?l&&l():u&&u())};a||l&&l(),r.length>0&&n.during&&r[0].during(function(t,e){n.during(e)});for(var d=0;d0||o.force&&!a.length){var k,I=void 0,L=void 0,P=void 0;if(s)for(L={},m&&(I={}),T=0;T0){if(t<=o)return a;if(t>=r)return s}else{if(t>=o)return a;if(t<=r)return s}else{if(t===o)return a;if(t===r)return s}return(t-o)/l*u+a}function on(t,e,n){return _(t)?(i=t,i.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(t)/100*e+(n||0):parseFloat(t):null==t?NaN:+t;var i}function rn(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),n?t:+t}function an(t){if(t=+t,isNaN(t))return 0;if(t>1e-14)for(var e=1,n=0;n<15;n++,e*=10)if(Math.round(t*e)/e===t)return n;return function(t){var e=t.toString().toLowerCase(),n=e.indexOf("e"),i=n>0?+e.slice(n+1):0,o=n>0?n:e.length,r=e.indexOf(".");return Math.max(0,(r<0?0:o-1-r)-i)}(t)}function sn(t,e){var n=Math.log,i=Math.LN10,o=Math.floor(n(t[1]-t[0])/i),r=Math.round(n(Wm(e[1]-e[0]))/i),a=Math.min(Math.max(-o+r,0),20);return isFinite(a)?a:20}function ln(t,e){var n=Math.max(an(t),an(e)),i=t+e;return n>20?i:rn(i,n)}function un(t){var e=2*Math.PI;return(t%e+e)%e}function hn(t){return t>-1e-4&&t=10&&e++,e}function pn(t,e){var n=dn(t),i=Math.pow(10,n),o=t/i;return t=(e?o<1.5?1:o<2.5?2:o<4?3:o<7?5:10:o<1?1:o<2?2:o<3?3:o<5?5:10)*i,n>=-20?+t.toFixed(n<0?-n:0):t}function fn(t){var e=parseFloat(t);return e==t&&(0!==e||!_(t)||t.indexOf("x")<=0)?e:NaN}function gn(){return Math.round(9*Math.random())}function mn(t,e){return 0===e?t:mn(e,t%e)}function yn(t,e){return null==t?e:null==e?t:t*e/mn(t,e)}function vn(t){return t instanceof Array?t:null==t?[]:[t]}function _n(t,e,n){if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};for(var i=0,o=n.length;i=0||o&&l(o,s)<0)){var u=n.getShallow(s,e);null!=u&&(r[t[a][0]]=u)}}return r}}function Zn(t){if("string"==typeof t){var e=iy.get(t);return e&&e.image}return t}function Hn(t,e,n,i,o){if(t){if("string"==typeof t){if(e&&e.__zrImageSrc===t||!n)return e;var r=iy.get(t),a={hostEl:n,cb:i,cbPayload:o};return r?!jn(e=r.image)&&r.pending.push(a):((e=af.loadImage(t,Wn,Wn)).__zrImageSrc=t,iy.put(t,e.__cachedImgObj={image:e,pending:[a]})),e}return t}return e}function Wn(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=l;h++)u-=l;var c=We(s,n);return c>u&&(n="",c=0),u=t-c,o.ellipsis=n,o.ellipsisWidth=c,o.contentWidth=u,o.containerWidth=t,o}function Yn(t,e,n){var i=n.containerWidth,o=n.contentWidth,r=n.fontMeasureInfo;if(!i)return t.textLine="",void(t.isTruncated=!1);var a=We(r,e);if(a<=i)return t.textLine=e,void(t.isTruncated=!1);for(var s=0;;s++){if(a<=o||s>=n.maxIterations){e+=n.ellipsis;break}var l=0===s?Xn(e,o,r):a>0?Math.floor(e.length*o/a):0;a=We(r,e=e.substr(0,l))}""===e&&(e=n.placeholder),t.textLine=e,t.isTruncated=!0}function Xn(t,e,n){for(var i=0,o=0,r=t.length;o0&&f+i.accumWidth>i.width&&(r=e.split("\n"),c=!0),i.accumWidth=f}else{var g=$n(e,h,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+p,a=g.linesWidths,r=g.lines}}r||(r=e.split("\n"));for(var m=Ze(h),y=0;y=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}(t)||!!ly[t]}function $n(t,e,n,i,o){for(var r=[],a=[],s="",l="",u=0,h=0,c=Ze(e),d=0;dn:o+h+f>n)?h?(s||l)&&(g?(s||(s=l,l="",h=u=0),r.push(s),a.push(h-u),l+=p,s="",h=u+=f):(l&&(s+=l,l="",u=0),r.push(s),a.push(h),s=p,h=f)):g?(r.push(l),a.push(u),l=p,u=f):(r.push(p),a.push(f)):(h+=f,g?(l+=p,u+=f):(l&&(s+=l,l="",u=0),s+=p))}else l&&(s+=l,h+=u),r.push(s),a.push(h),s="",l="",u=0,h=0}return l&&(s+=l),s&&(r.push(s),a.push(h)),1===r.length&&(h+=o),{accumWidth:h,lines:r,linesWidths:a}}function Jn(t,e,n,i,o,r){if(t.baseX=n,t.baseY=i,t.outerWidth=t.outerHeight=null,e){var a=2*e.width,s=2*e.height;lg.set(uy,Ue(n,a,o),Ye(i,s,r),a,s),lg.intersect(e,uy,null,hy);var l=hy.outIntersectRect;t.outerWidth=l.width,t.outerHeight=l.height,t.baseX=Ue(l.x,l.width,o,!0),t.baseY=Ye(l.y,l.height,r,!0)}}function Qn(t){return null!=t?t+="":t=""}function ti(t,e,n,i){var o=new lg(Ue(t.x||0,e,t.textAlign),Ye(t.y||0,n,t.textBaseline),e,n),r=null!=i?i:ei(t)?t.lineWidth:0;return r>0&&(o.x-=r/2,o.y-=r/2,o.width+=r,o.height+=r),o}function ei(t){var e=t.stroke;return null!=e&&"none"!==e&&t.lineWidth>0}function ni(t,e,n,i,o,r){o[0]=xy(t,n),o[1]=xy(e,i),r[0]=wy(t,n),r[1]=wy(e,i)}function ii(t,e,n,i,o,r,a,s,l,u){var h=Zt,c=Nt,d=h(t,n,o,a,Iy);l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0;for(var p=0;p1e-4)return s[0]=t-n,s[1]=e-i,l[0]=t+n,void(l[1]=e+i);if(My[0]=Sy(o)*n+t,My[1]=by(o)*i+e,Cy[0]=Sy(r)*n+t,Cy[1]=by(r)*i+e,u(s,My,Cy),h(l,My,Cy),(o%=Ty)<0&&(o+=Ty),(r%=Ty)<0&&(r+=Ty),o>r&&!a?r+=Ty:oo&&(ky[0]=Sy(p)*n+t,ky[1]=by(p)*i+e,u(s,ky,s),h(l,ky,l))}function ai(t){return Math.round(t/Hy*1e8)/1e8%2*Hy}function si(t,e,n,i,o,r,a){if(0===o)return!1;var s,l=o;if(a>e+l&&a>i+l||at+l&&r>n+l||re+c&&h>i+c&&h>r+c&&h>s+c||ht+c&&u>n+c&&u>o+c&&u>a+c||u=0&&pe+u&&l>i+u&&l>r+u||lt+u&&s>n+u&&s>o+u||s=0&&gn||h+uo&&(o+=qy);var d=Math.atan2(l,s);return d<0&&(d+=qy),d>=i&&d<=o||d+qy>=i&&d+qy<=o}function di(t,e,n,i,o,r){if(r>e&&r>i||ro?s:0}function pi(){var t=Qy[0];Qy[0]=Qy[1],Qy[1]=t}function fi(t,e,n,i,o,r,a,s,l,u){if(u>e&&u>i&&u>r&&u>s||u1&&pi(),p=Nt(e,i,r,s,Qy[0]),d>1&&(f=Nt(e,i,r,s,Qy[1]))),c+=2===d?me&&s>i&&s>r||s=0&&h<=1&&(o[l++]=h);else{var u=a*a-4*r*s;if(Rt(u))(h=-a/(2*r))>=0&&h<=1&&(o[l++]=h);else if(u>0){var h,c=Sg(u),d=(-a-c)/(2*r);(h=(-a+c)/(2*r))>=0&&h<=1&&(o[l++]=h),d>=0&&d<=1&&(o[l++]=d)}}return l}(e,i,r,s,Jy);if(0===l)return 0;var u=Ut(e,i,r);if(u>=0&&u<=1){for(var h=0,c=jt(e,i,r,u),d=0;dn||s<-n)return 0;var l=Math.sqrt(n*n-s*s);Jy[0]=-l,Jy[1]=l;var u=Math.abs(i-o);if(u<1e-4)return 0;if(u>=$y-1e-4){i=0,o=$y;var h=r?1:-1;return a>=Jy[0]+t&&a<=Jy[1]+t?h:0}if(i>o){var c=i;i=o,o=c}i<0&&(i+=$y,o+=$y);for(var d=0,p=0;p<2;p++){var f=Jy[p];if(f+t>a){var g=Math.atan2(s,f);h=r?1:-1,g<0&&(g=$y+g),(g>=i&&g<=o||g+$y>=i&&g+$y<=o)&&(g>Math.PI/2&&g<1.5*Math.PI&&(h=-h),d+=h)}}return d}function yi(t,e,n,i,o){for(var r,a,s=t.data,l=t.len(),u=0,h=0,c=0,d=0,p=0,f=0;f1&&(n||(u+=di(h,c,d,p,i,o))),m&&(d=h=s[f],p=c=s[f+1]),g){case Ky.M:h=d=s[f++],c=p=s[f++];break;case Ky.L:if(n){if(si(h,c,s[f],s[f+1],e,i,o))return!0}else u+=di(h,c,s[f],s[f+1],i,o)||0;h=s[f++],c=s[f++];break;case Ky.C:if(n){if(li(h,c,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],e,i,o))return!0}else u+=fi(h,c,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],i,o)||0;h=s[f++],c=s[f++];break;case Ky.Q:if(n){if(ui(h,c,s[f++],s[f++],s[f],s[f+1],e,i,o))return!0}else u+=gi(h,c,s[f++],s[f++],s[f],s[f+1],i,o)||0;h=s[f++],c=s[f++];break;case Ky.A:var y=s[f++],v=s[f++],_=s[f++],x=s[f++],w=s[f++],b=s[f++];f+=1;var S=!!(1-s[f++]);r=Math.cos(w)*_+y,a=Math.sin(w)*x+v,m?(d=r,p=a):u+=di(h,c,r,a,i,o);var T=(i-y)*x/_+y;if(n){if(ci(y,v,x,w,w+b,S,e,T,o))return!0}else u+=mi(y,v,x,w,w+b,S,T,o);h=Math.cos(w+b)*_+y,c=Math.sin(w+b)*x+v;break;case Ky.R:if(d=h=s[f++],p=c=s[f++],r=d+s[f++],a=p+s[f++],n){if(si(d,p,r,p,e,i,o)||si(r,p,r,a,e,i,o)||si(r,a,d,a,e,i,o)||si(d,a,d,p,e,i,o))return!0}else u+=di(r,p,r,a,i,o),u+=di(d,a,d,p,i,o);break;case Ky.Z:if(n){if(si(h,c,d,p,e,i,o))return!0}else u+=di(h,c,d,p,i,o);h=d,c=p}}return n||Math.abs(c-p)<1e-4||(u+=di(h,c,d,p,i,o)||0),0!==u}function vi(t,e,n){if(e){var i=e.x1,o=e.x2,r=e.y1,a=e.y2;t.x1=i,t.x2=o,t.y1=r,t.y2=a;var s=n&&n.lineWidth;return s?(dv(2*i)===dv(2*o)&&(t.x1=t.x2=xi(i,s,!0)),dv(2*r)===dv(2*a)&&(t.y1=t.y2=xi(r,s,!0)),t):t}}function _i(t,e,n){if(e){var i=e.x,o=e.y,r=e.width,a=e.height;t.x=i,t.y=o,t.width=r,t.height=a;var s=n&&n.lineWidth;return s?(t.x=xi(i,s,!0),t.y=xi(o,s,!0),t.width=Math.max(xi(i+r,s,!1)-t.x,0===r?0:1),t.height=Math.max(xi(o+a,s,!1)-t.y,0===a?0:1),t):t}}function xi(t,e,n){if(!e)return t;var i=dv(2*t);return(i+dv(e))%2==0?i/2:(i+(n?1:-1))/2}function wi(t){return"string"!=typeof t||-1===t.indexOf("px")&&-1===t.indexOf("rem")&&-1===t.indexOf("em")?isNaN(+t)?"12px":t+"px":t}function bi(t,e){for(var n=0;n=0,r=!1;if(t instanceof ov){var s=Iv(t),u=o&&s.selectFill||s.normalFill,h=o&&s.selectStroke||s.normalStroke;if(Pi(u)||Pi(h)){var c=(i=i||{}).style||{};"inherit"===c.fill?(r=!0,i=a({},i),(c=a({},c)).fill=u):!Pi(c.fill)&&Pi(u)?(r=!0,i=a({},i),(c=a({},c)).fill=he(u)):!Pi(c.stroke)&&Pi(h)&&(r||(i=a({},i),c=a({},c)),c.stroke=he(h)),i.style=c}}if(i&&null==i.z2){r||(i=a({},i));var d=t.z2EmphasisLift;i.z2=t.z2+(null!=d?d:10)}return i}(this,0,e,n);if("blur"===t)return function(t,e,n){var i=l(t.currentStates,e)>=0,o=t.style.opacity,r=i?null:function(t,e,n,i){for(var o=t.style,r={},a=0;a0){var r={dataIndex:o,seriesIndex:t.seriesIndex};null!=i&&(r.dataType=i),e.push(r)}})}),e}function no(t,e,n){oo(t,!0),Fi(t,Zi),function(t,e,n){var i=Mv(t);null!=e?(i.focus=e,i.blurScope=n):i.focus&&(i.focus=null)}(t,e,n)}function io(t,e,n,i){i?function(t){oo(t,!1)}(t):no(t,e,n)}function oo(t,e){var n=!1===e,i=t;t.highDownSilentOnTouch&&(i.__highDownSilentOnTouch=t.highDownSilentOnTouch),n&&!i.__highDownDispatcher||(i.__highByOuter=i.__highByOuter||0,i.__highDownDispatcher=!n)}function ro(t){return!(!t||!t.__highDownDispatcher)}function ao(t){var e=t.type;return e===zv||e===Ev||e===Rv}function so(t){var e=t.type;return e===Av||e===Ov}function lo(t,e,n){var i,o=t.labelFetcher,r=t.labelDataIndex,a=t.labelDimIndex,s=e.normal;o&&(i=o.getFormattedLabel(r,"normal",null,a,s&&s.get("formatter"),null!=n?{interpolatedValue:n}:null)),null==i&&(i=v(t.defaultText)?t.defaultText(r,t,n):t.defaultText);for(var l={normal:i},u=0;u=12?"pm":"am",m=g.toUpperCase(),y=i instanceof i_?i:function(t){return u_[t]}(i||h_)||u_[s_],v=y.getModel("time"),_=v.get("month"),x=v.get("monthAbbr"),w=v.get("dayOfWeek"),b=v.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,g+"").replace(/{A}/g,m+"").replace(/{yyyy}/g,r+"").replace(/{yy}/g,_o(r%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,_[a-1]).replace(/{MMM}/g,x[a-1]).replace(/{MM}/g,_o(a,2)).replace(/{M}/g,a+"").replace(/{dd}/g,_o(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,w[u]).replace(/{ee}/g,b[u]).replace(/{e}/g,u+"").replace(/{HH}/g,_o(h,2)).replace(/{H}/g,h+"").replace(/{hh}/g,_o(c+"",2)).replace(/{h}/g,c+"").replace(/{mm}/g,_o(d,2)).replace(/{m}/g,d+"").replace(/{ss}/g,_o(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,_o(f,3)).replace(/{S}/g,f+"")}function So(t,e){var n=cn(t),i=n[Co(e)]()+1,o=n[ko(e)](),r=n[Io(e)](),a=n[Lo(e)](),s=n[Po(e)](),l=0===n[Do(e)](),u=l&&0===s,h=u&&0===a,c=h&&0===r,d=c&&1===o;return d&&1===i?"year":d?"month":c?"day":h?"hour":u?"minute":l?"second":"millisecond"}function To(t,e,n){switch(e){case"year":t[Oo(n)](0);case"month":t[zo(n)](1);case"day":t[Eo(n)](0);case"hour":t[Ro(n)](0);case"minute":t[Bo(n)](0);case"second":t[No(n)](0)}return t}function Mo(t){return t?"getUTCFullYear":"getFullYear"}function Co(t){return t?"getUTCMonth":"getMonth"}function ko(t){return t?"getUTCDate":"getDate"}function Io(t){return t?"getUTCHours":"getHours"}function Lo(t){return t?"getUTCMinutes":"getMinutes"}function Po(t){return t?"getUTCSeconds":"getSeconds"}function Do(t){return t?"getUTCMilliseconds":"getMilliseconds"}function Ao(t){return t?"setUTCFullYear":"setFullYear"}function Oo(t){return t?"setUTCMonth":"setMonth"}function zo(t){return t?"setUTCDate":"setDate"}function Eo(t){return t?"setUTCHours":"setHours"}function Ro(t){return t?"setUTCMinutes":"setMinutes"}function Bo(t){return t?"setUTCSeconds":"setSeconds"}function No(t){return t?"setUTCMilliseconds":"setMilliseconds"}function Fo(t){if(isNaN(fn(t)))return _(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function Vo(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}function Zo(t,e,n){function i(t){return t&&z(t)?t:"-"}function o(t){return!(null==t||isNaN(t)||!isFinite(t))}var r="time"===e,a=t instanceof Date;if(r||a){var s=r?cn(t):t;if(!isNaN(+s))return bo(s,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",n);if(a)return"-"}if("ordinal"===e)return x(t)?i(t):w(t)&&o(t)?t+"":"-";var l=fn(t);return o(l)?Fo(l):x(t)?i(t):"boolean"==typeof t?t+"":"-"}function Ho(t,e,n){y(e)||(e=[e]);var i=e.length;if(!i)return"";for(var o=e[0].$vars||[],r=0;ri||l.newline?(r=0,h=g,a+=s+n,s=d.height):s=Math.max(s,d.height)}else{var m=d.height+(f?-f.y+d.y:0);(c=a+m)>o||l.newline?(r+=s+n,a=0,c=m,s=d.width):s=Math.max(s,d.width)}l.newline||(l.x=r,l.y=a,l.markRedraw(),"horizontal"===t?r=h+n:a=c+n)})}function Yo(t,e,n){n=S_(n||0);var i=e.width,o=e.height,r=jm(t.left,i),a=jm(t.top,o),s=jm(t.right,i),l=jm(t.bottom,o),u=jm(t.width,i),h=jm(t.height,o),c=n[2]+n[0],d=n[1]+n[3],p=t.aspect;switch(isNaN(u)&&(u=i-s-d-r),isNaN(h)&&(h=o-l-c-a),null!=p&&(isNaN(u)&&isNaN(h)&&(p>i/o?u=.8*i:h=.8*o),isNaN(u)&&(u=p*h),isNaN(h)&&(h=u/p)),isNaN(r)&&(r=i-s-u-d),isNaN(a)&&(a=o-l-h-c),t.left||t.right){case"center":r=i/2-u/2-n[3];break;case"right":r=i-u-d}switch(t.top||t.bottom){case"middle":case"center":a=o/2-h/2-n[0];break;case"bottom":a=o-h-c}r=r||0,a=a||0,isNaN(u)&&(u=i-d-r-(s||0)),isNaN(h)&&(h=o-c-a-(l||0));var f=new lg((e.x||0)+r+n[3],(e.y||0)+a+n[0],u,h);return f.margin=n,f}function Xo(t,e,n){var i,o,r,a,s=t.boxCoordinateSystem;if(s){var l=function(t){var e=t.getShallow("coord",!0),n=L_;if(null==e){var i=D_.get(t.type);i&&i.getCoord2&&(n=P_,e=i.getCoord2(t))}return{coord:e,from:n}}(t),u=l.coord,h=l.from;if(s.dataToLayout){r=V_.rect,a=h;var c=s.dataToLayout(u);i=c.contentRect||c.rect}else n&&n.enableLayoutOnlyByCenter&&s.dataToPoint&&(r=V_.point,a=h,o=s.dataToPoint(u))}return null==r&&(r=V_.rect),r===V_.rect&&(i||(i={x:0,y:0,width:e.getWidth(),height:e.getHeight()}),o=[i.x+i.width/2,i.y+i.height/2]),{type:r,refContainer:i,refPoint:o,boxCoordFrom:a}}function qo(t,e,n,i,o,r){var a,l=!o||!o.hv||o.hv[0],u=!o||!o.hv||o.hv[1],h=o&&o.boundingMode||"all";if((r=r||t).x=t.x,r.y=t.y,!l&&!u)return!1;if("raw"===h)a="group"===t.type?new lg(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(a=t.getBoundingRect(),t.needLocalTransform()){var c=t.getLocalTransform();(a=a.clone()).applyTransform(c)}var d=Yo(s({width:a.width,height:a.height},e),n,i),p=l?d.x-a.x:0,f=u?d.y-a.y:0;return"raw"===h?(r.x=p,r.y=f):(r.x+=p,r.y+=f),r===t&&t.markRedraw(),!0}function Ko(t){var e=t.layoutMode||t.constructor.layoutMode;return b(e)?e:e?{type:e}:null}function $o(t,e,n){function i(n,i){var r={},s=0,l={},u=0;if(R_(n,function(e){l[e]=t[e]}),R_(n,function(t){Z(e,t)&&(r[t]=l[t]=e[t]),o(r,t)&&s++,o(l,t)&&u++}),a[i])return o(e,n[1])?l[n[2]]=null:o(e,n[2])&&(l[n[1]]=null),l;if(2!==u&&s){if(s>=2)return r;for(var h=0;h=e:"max"===n?t<=e:t===e})(i[a],t,r)||(o=!1)}}),o}function sr(t){var e=t&&t.itemStyle;if(e)for(var n=0,i=Bx.length;n65535?aw:sw}function jr(){return[1/0,-1/0]}function Gr(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function Ur(t,e,n,i,o){var r=hw[n||"float"];if(o){var a=t[e],s=a&&a.length;if(s!==i){for(var l=new r(i),u=0;u1||n>0&&!t.noHeader;return c(t.blocks,function(t){var n=ta(t);n>=e&&(e=n+ +(i&&(!n||Jr(t)&&!t.noHeader)))}),e}return 0}function ea(t,e,n,i){var o,r=e.noHeader,s=(o=ta(e),{html:fw[o],richText:gw[o]}),l=[],u=e.blocks||[];O(!u||y(u)),u=u||[];var h=t.orderMode;if(e.sortBlocks&&h){u=u.slice();var d={valueAsc:"asc",valueDesc:"desc"};if(Z(d,h)){var p=new nw(d[h],null);u.sort(function(t,e){return p.evaluate(t.sortParam,e.sortParam)})}else"seriesDesc"===h&&u.reverse()}c(u,function(n,o){var r=e.valueFormatter,u=Qr(n)(r?a(a({},t),{valueFormatter:r}):t,n,o>0?s.html:0,i);null!=u&&l.push(u)});var f="richText"===t.renderMode?l.join(s.richText):oa(i,l.join(""),r?n:s.html);if(r)return f;var g=Zo(e.header,"ordinal",t.useUTC),m=Kr(i,t.renderMode).nameStyle,v=qr(i);return"richText"===t.renderMode?ra(t,g,m)+s.richText+f:oa(i,'
'+lt(g)+"
"+f,n)}function na(t,e,n,i){var o=t.renderMode,r=e.noName,a=e.noValue,s=!e.markerType,l=e.name,u=t.useUTC,h=e.valueFormatter||t.valueFormatter||function(t){return d(t=y(t)?t:[t],function(t,e){return Zo(t,y(f)?f[e]:f,u)})};if(!r||!a){var c=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||X_.color.secondary,o),p=r?"":Zo(l,"ordinal",u),f=e.valueType,g=a?[]:h(e.value,e.dataIndex),m=!s||!r,v=!s&&r,_=Kr(i,o),x=_.nameStyle,w=_.valueStyle;return"richText"===o?(s?"":c)+(r?"":ra(t,p,x))+(a?"":function(t,e,n,i,o){var r=[o];return n&&r.push({padding:[0,0,0,i?10:20],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(y(e)?e.join(" "):e,r)}(t,g,m,v,w)):oa(i,(s?"":c)+(r?"":function(t,e,n){return''+lt(t)+""}(p,!s,x))+(a?"":function(t,e,n,i){return''+d(t=y(t)?t:[t],function(t){return lt(t)}).join("  ")+""}(g,m,v,w)),n)}}function ia(t,e,n,i,o,r){if(t)return Qr(t)({useUTC:o,renderMode:n,orderMode:i,markupStyleCreator:e,valueFormatter:t.valueFormatter},t,0,r)}function oa(t,e,n){return'
'+e+'
'}function ra(t,e,n){return t.markupStyleCreator.wrapRichTextStyle(e,n)}function aa(t,e){var n=t.get("padding");return null!=n?n:"richText"===e?[8,10]:10}function sa(t){var e,n,i,o,r=t.series,a=t.dataIndex,s=t.multipleSeries,l=r.getData(),u=l.mapDimensionsAll("defaultedTooltip"),h=u.length,d=r.getRawValue(a),f=y(d),g=function(t,e){return Wo(t.getData().getItemVisual(e,"style")[t.visualDrawType])}(r,a);if(h>1||f&&!h){var m=function(t,e,n,i,o){function r(t,e){var n=a.getDimensionInfo(e);n&&!1!==n.otherDims.tooltip&&(s?h.push($r("nameValue",{markerType:"subItem",markerColor:o,name:n.displayName,value:t,valueType:n.type})):(l.push(t),u.push(n.type)))}var a=e.getData(),s=p(t,function(t,e,n){var i=a.getDimensionInfo(n);return t||i&&!1!==i.tooltip&&null!=i.displayName},!1),l=[],u=[],h=[];return i.length?c(i,function(t){r(Or(a,n,t),t)}):c(t,r),{inlineValues:l,inlineValueTypes:u,blocks:h}}(d,r,a,u,g);e=m.inlineValues,n=m.inlineValueTypes,i=m.blocks,o=m.inlineValues[0]}else if(h){var v=l.getDimensionInfo(u[0]);o=e=Or(l,a,u[0]),n=v.type}else o=e=f?d[0]:d;var _=Cn(r),x=_&&r.name||"",w=l.getName(a),b=s?x:w;return $r("section",{header:x,noHeader:s||!_,sortParam:o,blocks:[$r("nameValue",{markerType:"item",markerColor:g,name:b,noName:!z(b),value:e,valueType:n,dataIndex:a})].concat(i||[])})}function la(t,e){return t.getName(e)||t.getId(e)}function ua(t){var e=t.name;Cn(t)||(t.name=function(t){var e=t.getRawData(),n=e.mapDimensionsAll("seriesName"),i=[];return c(n,function(t){var n=e.getDimensionInfo(t);n.displayName&&i.push(n.displayName)}),i.join(" ")}(t)||e)}function ha(t){return t.model.getRawData().count()}function ca(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),da}function da(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function pa(t,e){c(N(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(n){t.wrapMethod(n,m(fa,e))})}function fa(t,e){var n=ga(t);return n&&n.setOutputEnd((e||this).count()),e}function ga(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){var i=n.currentTask;if(i){var o=i.agentStubMap;o&&(i=o.get(t.uid))}return i}}function ma(){var t=Ln();return function(e){var n=t(e),i=e.pipelineContext,o=!!n.large,r=!!n.progressiveRender,a=n.large=!(!i||!i.large),s=n.progressiveRender=!(!i||!i.progressiveRender);return!(o===a&&r===s)&&"reset"}}function ya(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function va(t,e){return(t[0]*e[0]+t[1]*e[1])/(ya(t)*ya(e))}function _a(t,e){return(t[0]*e[1]1&&(a*=Cw(f),s*=Cw(f));var g=(o===r?-1:1)*Cw((a*a*(s*s)-a*a*(p*p)-s*s*(d*d))/(a*a*(p*p)+s*s*(d*d)))||0,m=g*a*p/s,y=g*-s*d/a,v=(t+n)/2+Iw(c)*m-kw(c)*y,_=(e+i)/2+kw(c)*m+Iw(c)*y,x=_a([1,0],[(d-m)/a,(p-y)/s]),w=[(d-m)/a,(p-y)/s],b=[(-1*d-m)/a,(-1*p-y)/s],S=_a(w,b);if(va(w,b)<=-1&&(S=Lw),va(w,b)>=1&&(S=0),S<0){var T=Math.round(S/Lw*1e6)/1e6;S=2*Lw+T%2*Lw}h.addData(u,v,_,a,s,x,S,c,r)}function wa(t){return null!=t.setData}function ba(t,e){var n=function(t){var e=new Yy;if(!t)return e;var n,i=0,o=0,r=i,a=o,s=Yy.CMD,l=t.match(Pw);if(!l)return e;for(var u=0;uP*P+D*D&&(T=C,M=k),{cx:T,cy:M,x0:-h,y0:-c,x1:T*(o/w-1),y1:M*(o/w-1)}}function Ta(t,e,n){var i=e.smooth,o=e.points;if(o&&o.length>=2){if(i){var r=function(t,e,n,i){var o,r,a,s,l=[],u=[],h=[],c=[];if(i){a=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,p=t.length;d0){var c={duration:h.duration,delay:h.delay||0,easing:h.easing,done:r,force:!!r||!!a,setToFinal:!u,scope:t,during:a};l?e.animateFrom(n,c):e.animateTo(n,c)}else e.stopAnimation(),!l&&e.attr(n),a&&a(1),r&&r()}function Ia(t,e,n,i,o,r){ka("update",t,e,n,i,o,r)}function La(t,e,n,i,o,r){ka("enter",t,e,n,i,o,r)}function Pa(t){if(!t.__zr)return!0;for(var e=0;eWm(r[1])?r[0]>0?"right":"left":r[1]>0?"bottom":"top"}function Ya(t){return!t.isGroup}function Xa(t,e,n){function i(t){var e={x:t.x,y:t.y,rotation:t.rotation};return function(t){return null!=t.shape}(t)&&(e.shape=o(t.shape)),e}if(t&&e){var r,a=(r={},t.traverse(function(t){Ya(t)&&t.anid&&(r[t.anid]=t)}),r);e.traverse(function(t){if(Ya(t)&&t.anid){var e=a[t.anid];if(e){var o=i(t);t.attr(i(e)),Ia(t,o,n,Mv(t).dataIndex)}}})}}function qa(t,e){return d(t,function(t){var n=t[0];n=Hm(n,e.x),n=Zm(n,e.x+e.width);var i=t[1];return i=Hm(i,e.y),[n,i=Zm(i,e.y+e.height)]})}function Ka(t,e){var n=Hm(t.x,e.x),i=Zm(t.x+t.width,e.x+e.width),o=Hm(t.y,e.y),r=Zm(t.y+t.height,e.y+e.height);if(i>=n&&r>=o)return{x:n,y:o,width:i-n,height:r-o}}function $a(t,e,n){var i=a({rectHover:!0},e),o=i.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(o.image=t.slice(8),s(o,n),new cv(i)):Na(t.replace("path://",""),i,n,"center")}function Ja(t,e,n,i,o){for(var r=0,a=o[o.length-1];r=-1e-6)return!1;var f=t-o,g=e-r,m=ts(f,g,u,h)/p;if(m<0||m>1)return!1;var y=ts(f,g,c,d)/p;return!(y<0||y>1)}function ts(t,e,n,i){return t*i-n*e}function es(t,e,n,i,o){return null==e||(w(e)?jb[0]=jb[1]=jb[2]=jb[3]=e:(jb[0]=e[0],jb[1]=e[1],jb[2]=e[2],jb[3]=e[3]),i&&(jb[0]=Hm(0,jb[0]),jb[1]=Hm(0,jb[1]),jb[2]=Hm(0,jb[2]),jb[3]=Hm(0,jb[3])),n&&(jb[0]=-jb[0],jb[1]=-jb[1],jb[2]=-jb[2],jb[3]=-jb[3]),ns(t,jb,"x","width",3,1,o&&o[0]||0),ns(t,jb,"y","height",0,2,o&&o[1]||0)),t}function ns(t,e,n,i,o,r,a){var s=e[r]+e[o],l=t[i];t[i]+=s,a=Hm(0,Zm(a,l)),t[i]=0?-e[o]:e[r]>=0?l+e[r]:Wm(s)>1e-8?(l-a)*e[o]/s:0):t[n]-=e[o]}function is(t){var e=t.itemTooltipOption,n=t.componentModel,i=t.itemName,o=_(e)?{formatter:e}:e,r=n.mainType,a=n.componentIndex,l={componentType:r,name:i,$vars:["name"]};l[r+"Index"]=a;var u=t.formatterParamsExtra;u&&c(g(u),function(t){Z(l,t)||(l[t]=u[t],l.$vars.push(t))});var h=Mv(t.el);h.componentMainType=r,h.componentIndex=a,h.tooltipConfig={name:i,option:s({content:i,encodeHTMLContent:!0,formatterParams:l},o)}}function os(t,e){var n;t.isGroup&&(n=e(t)),n||t.traverse(e)}function rs(t,e){if(t)if(y(t))for(var n=0;ni&&(i=e),ei&&(o=i=0),{min:o,max:i}}function cs(t,e,n){ds(t,e,n,-1/0)}function ds(t,e,n,i){if(t.ignoreModelZ)return i;var o=t.getTextContent(),r=t.getTextGuideLine();if(t.isGroup)for(var a=t.childrenRef(),s=0;s=0?i():c=setTimeout(i,-r),u=o};return d.clear=function(){c&&(clearTimeout(c),c=null)},d.debounceNextCall=function(t){l=t},d}function vs(t,e,n,i){var o=t[e];if(o){var r=o[Jb]||o;if(o[Qb]!==n||o[tS]!==i){if(null==n||!i)return t[e]=r;(o=t[e]=ys(r,n,"debounce"===i))[Jb]=r,o[tS]=i,o[Qb]=n}return o}}function _s(t,e){var n=t[e];n&&n[Jb]&&(n.clear&&n.clear(),t[e]=n[Jb])}function xs(t,e){return t.visualStyleMapper||nS[e]||(console.warn("Unknown style type '"+e+"'."),nS.itemStyle)}function ws(t,e){return t.visualDrawType||iS[e]||(console.warn("Unknown style type '"+e+"'."),"fill")}function bs(t){t.overallReset(t.ecModel,t.api,t.payload)}function Ss(t){return t.overallProgress&&Ts}function Ts(){this.agent.dirty(),this.getDownstream().dirty()}function Ms(){this.agent&&this.agent.dirty()}function Cs(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function ks(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=vn(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?d(e,function(t,e){return Is(e)}):hS}function Is(t){return function(e,n){var i=n.data,o=n.resetDefines[t];if(o&&o.dataEach)for(var r=e.start;r=0&&Ns(l)?l:.5,t.createRadialGradient(a,s,0,a,s,l)}(t,e,n):function(t,e,n){var i=null==e.x?0:e.x,o=null==e.x2?1:e.x2,r=null==e.y?0:e.y,a=null==e.y2?0:e.y2;return e.global||(i=i*n.width+n.x,o=o*n.width+n.x,r=r*n.height+n.y,a=a*n.height+n.y),i=Ns(i)?i:0,o=Ns(o)?o:1,r=Ns(r)?r:0,a=Ns(a)?a:0,t.createLinearGradient(i,r,o,a)}(t,e,n),o=e.colorStops,r=0;r0&&(n=i.lineWidth,(e=i.lineDash)&&"solid"!==e&&n>0?"dashed"===e?[4*n,2*n]:"dotted"===e?[n]:w(e)?[e]:y(e)?e:null:null),r=i.lineDashOffset;if(o){var a=i.strokeNoScale&&t.getLineScale?t.getLineScale():1;a&&1!==a&&(o=d(o,function(t){return t/a}),r/=a)}return[o,r]}function Ws(t){var e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))}function js(t){return"string"==typeof t&&"none"!==t}function Gs(t){var e=t.fill;return null!=e&&"none"!==e}function Us(t,e){if(null!=e.fillOpacity&&1!==e.fillOpacity){var n=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=n}else t.fill()}function Ys(t,e){if(null!=e.strokeOpacity&&1!==e.strokeOpacity){var n=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=n}else t.stroke()}function Xs(t,e,n){var i=Hn(e.image,e.__image,n);if(jn(i)){var o=t.createPattern(i,e.repeat||"repeat");if("function"==typeof DOMMatrix&&o&&o.setTransform){var r=new DOMMatrix;r.translateSelf(e.x||0,e.y||0),r.rotateSelf(0,0,(e.rotation||0)*Tf),r.scaleSelf(e.scaleX||1,e.scaleY||1),o.setTransform(r)}return o}}function qs(t,e,n,i,o){var r=!1;if(!i&&e===(n=n||{}))return!1;if(i||e.opacity!==n.opacity){Js(t,o),r=!0;var a=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(a)?dy.opacity:a}(i||e.blend!==n.blend)&&(r||(Js(t,o),r=!0),t.globalCompositeOperation=e.blend||dy.blend);for(var s=0;s=0)){ET.push(n);var r=pS.wrapStageHandler(n,o);r.__prio=e,r.__raw=n,t.push(r)}}function vl(t,e){PT[t]=e}function _l(t,e,n,i){return{eventContent:{selected:eo(n),isFromClick:e.isFromClick||!1}}}function xl(e=!1){return RT||(RT=t(481),RT)}function wl(t,e,n,i,o,r){if(o-i<=n)return;const a=i+o>>1;bl(t,e,a,i,o,r),wl(t,e,n,i,a-1,1-r),wl(t,e,n,a+1,o,1-r)}function bl(t,e,n,i,o,r){for(;o>i;){if(o-i>600){const a=o-i+1,s=n-i+1,l=Math.log(a),u=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*u*(a-u)/a)*(s-a/2<0?-1:1);bl(t,e,n,Math.max(i,Math.floor(n-s*u/a+h)),Math.min(o,Math.floor(n+(a-s)*u/a+h)),r)}const a=e[2*n+r];let s=i,l=o;for(Sl(t,e,i,n),e[2*o+r]>a&&Sl(t,e,i,o);sa;)l--}e[2*i+r]===a?Sl(t,e,i,l):(l++,Sl(t,e,l,o)),l<=n&&(i=l+1),n<=l&&(o=l-1)}}function Sl(t,e,n,i){Tl(t,n,i),Tl(e,2*n,2*i),Tl(e,2*n+1,2*i+1)}function Tl(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function Ml(t,e,n,i){const o=t-n,r=e-i;return o*o+r*r}function Cl(t){y(t)?c(t,function(t){Cl(t)}):l(UT,t)>=0||(UT.push(t),v(t)&&(t={install:t}),t.install(YT))}function kl(t){return isNaN(+t.cpx1)||isNaN(+t.cpy1)}function Il(t){return"_"+t+"Type"}function Ll(t,e,n){var i=e.getItemVisual(n,t);if(!i||"none"===i)return i;var o=e.getItemVisual(n,t+"Size"),r=e.getItemVisual(n,t+"Rotate"),a=e.getItemVisual(n,t+"Offset"),s=e.getItemVisual(n,t+"KeepAspect"),l=Rs(o);return i+l+Bs(a||0,l)+(r||"")+(s||"")}function Pl(t,e,n){var i=e.getItemVisual(n,t);if(i&&"none"!==i){var o=e.getItemVisual(n,t+"Size"),r=e.getItemVisual(n,t+"Rotate"),a=e.getItemVisual(n,t+"Offset"),s=e.getItemVisual(n,t+"KeepAspect"),l=Rs(o),u=Bs(a||0,l),h=Es(i,-l[0]/2+u[0],-l[1]/2+u[1],l[0],l[1],null,s);return h.__specifiedRotation=null==r||isNaN(r)?void 0:+r*Math.PI/180||0,h.name=t,h}}function Dl(t,e){t.x1=e[0][0],t.y1=e[0][1],t.x2=e[1][0],t.y2=e[1][1],t.percent=1;var n=e[2];n?(t.cpx1=n[0],t.cpy1=n[1]):(t.cpx1=NaN,t.cpy1=NaN)}function Al(t){var e=t.hostModel,n=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:n.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:n.get("disabled"),blurScope:n.get("blurScope"),focus:n.get("focus"),labelStatesModels:ho(e)}}function Ol(t){return isNaN(t[0])||isNaN(t[1])}function zl(t){return t&&!Ol(t[0])&&!Ol(t[1])}function El(t){return null==t?0:t.length||1}function Rl(t){return t}function Bl(t,e){return t.hasOwnProperty(e)||(t[e]=[]),t[e]}function Nl(t){return t instanceof kM}function Fl(t){for(var e=B(),n=0;n<(t||[]).length;n++){var i=t[n],o=b(i)?i.name:i;null!=o&&null==e.get(o)&&e.set(o,n)}return e}function Vl(t){var e=MM(t);return e.dimNameMap||(e.dimNameMap=Fl(t.dimensionsDefine))}function Zl(t){return t>30}function Hl(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(t.data=d(e,function(t){var e={coords:[t[0].coord,t[1].coord]};return t[0].name&&(e.fromName=t[0].name),t[1].name&&(e.toName=t[1].name),function(t){for(var e=t[0],n=1,i=t.length;nn&&!l||o=0?i+=u:i-=u:f>=0?i-=u:i+=u}return i}function Su(t,e){var n=[],i=Yt,o=[[],[],[]],r=[[],[]],a=[];e/=2,t.eachEdge(function(t,s){var l=t.getLayout(),u=t.getVisual("fromSymbol"),h=t.getVisual("toSymbol");l.__original||(l.__original=[U(l[0]),U(l[1])],l[2]&&l.__original.push(U(l[2])));var c=l.__original;if(null!=l[2]){if(G(o[0],c[0]),G(o[1],c[2]),G(o[2],c[1]),u&&"none"!==u){var d=Ql(t.node1),p=bu(o,c[0],d*e);i(o[0][0],o[1][0],o[2][0],p,n),o[0][0]=n[3],o[1][0]=n[4],i(o[0][1],o[1][1],o[2][1],p,n),o[0][1]=n[3],o[1][1]=n[4]}h&&"none"!==h&&(d=Ql(t.node2),p=bu(o,c[1],d*e),i(o[0][0],o[1][0],o[2][0],p,n),o[1][0]=n[1],o[2][0]=n[2],i(o[0][1],o[1][1],o[2][1],p,n),o[1][1]=n[1],o[2][1]=n[2]),G(l[0],o[0]),G(l[1],o[2]),G(l[2],o[1])}else G(r[0],c[0]),G(r[1],c[1]),K(a,r[1],r[0]),Q(a,a),u&&"none"!==u&&(d=Ql(t.node1),q(r[0],r[0],a,d*e)),h&&"none"!==h&&(d=Ql(t.node2),q(r[1],r[1],a,-d*e)),G(l[0],r[0]),G(l[1],r[1])})}function Tu(t){return"view"===t.type}function Mu(t){return"_EC_"+t}function Cu(t,e){return{getValue:function(n){var i=this[t][e];return i.getStore().get(i.getDimensionIndex(n||"value"),this.dataIndex)},setVisual:function(n,i){this.dataIndex>=0&&this[t][e].setItemVisual(this.dataIndex,n,i)},getVisual:function(n){return this[t][e].getItemVisual(this.dataIndex,n)},setLayout:function(n,i){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,n,i)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}}function ku(t,e){if(wC(this).mainData===this){var n=a({},wC(this).datas);n[this.dataType]=e,Au(e,n,t)}else Ou(e,this.dataType,wC(this).mainData,t);return e}function Iu(t,e){return t.struct&&t.struct.update(),e}function Lu(t,e){return c(wC(e).datas,function(n,i){n!==e&&Ou(n.cloneShallow(),i,e,t)}),e}function Pu(t){var e=wC(this).mainData;return null==t||null==e?e:wC(e).datas[t]}function Du(){var t=wC(this).mainData;return null==t?[{data:t}]:d(g(wC(t).datas),function(e){return{type:e,data:wC(t).datas[e]}})}function Au(t,e,n){wC(t).datas={},c(e,function(e,i){Ou(e,i,t,n)})}function Ou(t,e,n,i){wC(n).datas[e]=t,wC(t).mainData=n,t.dataType=e,i.struct&&(t[i.structAttr]=i.struct,i.struct[i.datasAttr[e]]=t),t.getLinkedData=Pu,t.getLinkedDataAll=Du}function zu(t,e){function n(t){var e=v[t];if(e<0){var n=l[t],i=b(n)?n:{name:n},o=new yM,r=i.name;return null!=r&&null!=g.get(r)&&(o.name=o.displayName=r),null!=i.type&&(o.type=i.type),null!=i.displayName&&(o.displayName=i.displayName),v[t]=h.length,o.storeDimIndex=t,h.push(o),o}return h[e]}function i(t,e,n){null!=ix.get(e)?t.otherDims[e]=n:(t.coordDim=e,t.coordDimIndex=n,u.set(e,!0))}function o(t){null==t.name&&(t.name=t.coordDim)}xr(t)||(t=br(t));var r=(e=e||{}).coordDimensions||[],l=e.dimensionsDefine||t.dimensionsDefine||[],u=B(),h=[],d=function(t,e,n,i){var o=Math.max(t.dimensionsDetectedCount||1,e.length,n.length,i||0);return c(e,function(t){var e;b(t)&&(e=t.dimsDef)&&(o=Math.max(o,e.length))}),o}(t,r,l,e.dimensionsCount),p=e.canOmitUnusedDimensions&&Zl(d),f=l===t.dimensionsDefine,g=f?Vl(t):Fl(l),m=e.encodeDefine;!m&&e.encodeDefaulter&&(m=e.encodeDefaulter(t,d));for(var y=B(m),v=new lw(d),x=0;x0&&(i.name=o+(r-1)),r++,e.set(o,r)}}(h),new kM({source:t,dimensions:h,fullDimensionCount:d,dimensionOmitted:p})}function Eu(t,e,n){if(n||e.hasKey(t)){for(var i=0;e.hasKey(t+i);)i++;t+=i}return e.set(t,!0),t}function Ru(t){return"category"===t.get("type")}function Bu(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function Nu(t,e){return{seriesType:t,plan:ma(),reset:function(t){var n=t.getData(),i=t.coordinateSystem,o=e||t.pipelineContext.large;if(i){var r=d(i.dimensions,function(t){return n.mapDimension(t)}).slice(0,2),a=r.length,s=n.getCalculationInfo("stackResultDimension");Bu(n,r[0])&&(r[0]=s),Bu(n,r[1])&&(r[1]=s);var l=n.getStore(),u=n.getDimensionIndex(r[0]),h=n.getDimensionIndex(r[1]);return a&&{progress:function(t,e){for(var n,r=o&&(y(n=(t.end-t.start)*a)?zC?new Float32Array(n):n:new EC(n)),s=[],c=[],d=t.start,p=0;d=e[0]&&t<=e[1]}function Xu(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function qu(t,e){return t*(e[1]-e[0])+e[0]}function Ku(t,e,n){var i=Math.log(t);return[Math.log(n?e[0]:Math.max(0,e[0]))/i,Math.log(n?e[1]:Math.max(0,e[1]))/i]}function $u(t){return t.get("stack")||ok+t.seriesIndex}function Ju(t){return t.dim+t.index}function Qu(t,e,n,i){return To(new Date(e),t,i).getTime()===To(new Date(n),t,i).getTime()}function th(t,e){return(t/=g_)>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function eh(t){return(t/=2592e6)>6?6:t>3?3:t>2?2:1}function nh(t){return(t/=f_)>12?12:t>6?6:t>3.5?4:t>2?2:1}function ih(t,e){return(t/=e?p_:d_)>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function oh(t){return pn(t,!0)}function rh(t,e,n){var i=Math.max(0,l(w_,e)-1);return To(new Date(t),w_[i],n).getTime()}function ah(t,e){return lk(t,an(e))}function sh(t,e,n){var i=t.rawExtentInfo;return i||(i=new gk(t,e,n),t.rawExtentInfo=i,i)}function lh(t,e){return null==e?null:k(e)?NaN:t.parse(e)}function uh(t,e){var n=t.type,i=sh(t,e,t.getExtent()).calculate();t.setBlank(i.isBlank);var o,r,a,s=i.min,l=i.max,u=e.ecModel;if(u&&"time"===n){var h=function(t,e){var n=[];return e.eachSeriesByType("bar",function(t){(function(t){return t.coordinateSystem&&"cartesian2d"===t.coordinateSystem.type})(t)&&n.push(t)}),n}(0,u),d=!1;if(c(h,function(t){d=d||t.getBaseAxis()===e.axis}),d){var p=(r=function(t){var e={};c(t,function(t){var n=t.coordinateSystem.getBaseAxis();if("time"===n.type||"value"===n.type)for(var i=t.getData(),o=n.dim+"_"+n.index,r=i.getDimensionIndex(i.mapDimension(n.dim)),a=i.getStore(),s=0,l=a.count();s0&&(r=null===r?s:Math.min(r,s))}n[i]=r}}return n}(o=h),a=[],c(o,function(t){var e,n=t.coordinateSystem.getBaseAxis(),i=n.getExtent();if("category"===n.type)e=n.getBandWidth();else if("value"===n.type||"time"===n.type){var o=r[n.dim+"_"+n.index],s=Math.abs(i[1]-i[0]),l=n.scale.getExtent(),u=Math.abs(l[1]-l[0]);e=o?s/u*o:s}else{var h=t.getData();e=Math.abs(i[1]-i[0])/h.count()}var c=jm(t.get("barWidth"),e),d=jm(t.get("barMaxWidth"),e),p=jm(t.get("barMinWidth")||(function(t){return t.pipelineContext&&t.pipelineContext.large}(t)?.5:1),e),f=t.get("barGap"),g=t.get("barCategoryGap"),m=t.get("defaultBarGap");a.push({bandWidth:e,barWidth:c,barMaxWidth:d,barMinWidth:p,barGap:f,barCategoryGap:g,defaultBarGap:m,axisKey:Ju(n),stackId:$u(t)})}),function(t){var e={};c(t,function(t,n){var i=t.axisKey,o=t.bandWidth,r=e[i]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:t.defaultBarGap||0,stacks:{}},a=r.stacks;e[i]=r;var s=t.stackId;a[s]||r.autoWidthCount++,a[s]=a[s]||{width:0,maxWidth:0};var l=t.barWidth;l&&!a[s].width&&(a[s].width=l,l=Math.min(r.remainedWidth,l),r.remainedWidth-=l);var u=t.barMaxWidth;u&&(a[s].maxWidth=u);var h=t.barMinWidth;h&&(a[s].minWidth=h);var c=t.barGap;null!=c&&(r.gap=c);var d=t.barCategoryGap;null!=d&&(r.categoryGap=d)});var n={};return c(e,function(t,e){n[e]={};var i=t.stacks,o=t.bandWidth,r=t.categoryGap;if(null==r){var a=g(i).length;r=Math.max(35-4*a,15)+"%"}var s=jm(r,o),l=jm(t.gap,1),u=t.remainedWidth,h=t.autoWidthCount,d=(u-s)/(h+(h-1)*l);d=Math.max(d,0),c(i,function(t){var e=t.maxWidth,n=t.minWidth;if(t.width)i=t.width,e&&(i=Math.min(i,e)),n&&(i=Math.max(i,n)),t.width=i,u-=i+l*i,h--;else{var i=d;e&&ei&&(i=n),i!==d&&(t.width=i,u-=i+l*i,h--)}}),d=(u-s)/(h+(h-1)*l),d=Math.max(d,0);var p,f=0;c(i,function(t,e){t.width||(t.width=d),p=t,f+=t.width*(1+l)}),p&&(f-=p.width*l);var m=-f/2;c(i,function(t,i){n[e][i]=n[e][i]||{bandWidth:o,offset:m,width:t.width},m+=t.width*(1+l)})}),n}(a)),f=function(t,e,n,i){var o=n.axis.getExtent(),r=Math.abs(o[1]-o[0]),a=function(t,e){if(t&&e)return t[Ju(e)]}(i,n.axis);if(void 0===a)return{min:t,max:e};var s=1/0;c(a,function(t){s=Math.min(t.offset,s)});var l=-1/0;c(a,function(t){l=Math.max(t.offset+t.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=e-t,d=h/(1-(s+l)/r)-h;return{min:t-=d*(s/u),max:e+=d*(l/u)}}(s,l,e,p);s=f.min,l=f.max}}return{extent:[s,l],fixMin:i.minFixed,fixMax:i.maxFixed}}function hh(t,e){var n=e,i=uh(t,n),o=i.extent,r=n.get("splitNumber");t instanceof fk&&(t.base=n.get("logBase"));var a=t.type,s=n.get("interval"),l="interval"===a||"time"===a;t.setBreaksFromOption(vh(n)),t.setExtent(o[0],o[1]),t.calcNiceExtent({splitNumber:r,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?n.get("minInterval"):null,maxInterval:l?n.get("maxInterval"):null}),null!=s&&t.setInterval&&t.setInterval(s)}function ch(t){var e,n=t.getLabelModel().get("formatter");if("time"===t.type){var i=_(e=n)||v(e)?e:function(t){t=t||{};var e={},n=!0;return c(w_,function(e){n&&(n=null==t[e])}),c(w_,function(i,o){var r=t[i];e[i]={};for(var a=null,s=o;s>=0;s--){var l=w_[s],u=b(r)&&!y(r)?r[l]:r,h=void 0;y(u)?a=(h=u.slice())[0]||"":_(u)?h=[a=u]:(null==a?a=v_[i]:y_[l].test(a)||(a=e[l][l][0]+" "+a),h=[a],n&&(h[1]="{primary|"+a+"}")),e[i][l]=h}}),e}(e);return function(e,n){return t.scale.getFormattedLabel(e,n,i)}}if(_(n))return function(e){var i=t.scale.getLabel(e);return n.replace("{value}",null!=i?i:"")};if(v(n)){if("category"===t.type)return function(e,i){return n(dh(t,e),e.value-t.scale.getExtent()[0],null)};var o=vo();return function(e,i){var r=null;return o&&(r=o.makeAxisLabelFormatterParamBreak(r,e.break)),n(dh(t,e),i,r)}}return function(e){return t.scale.getLabel(e)}}function dh(t,e){return"category"===t.type?t.scale.getLabel(e):e.value}function ph(t){var e=t.get("interval");return null==e?"auto":e}function fh(t){return"category"===t.type&&0===ph(t.getLabelModel())}function gh(t,e){var n={};return c(t.mapDimensionsAll(e),function(e){n[function(t,e){return Bu(t,e)?t.getCalculationInfo("stackResultDimension"):e}(t,e)]=!0}),g(n)}function mh(t){return"middle"===t||"center"===t}function yh(t){return t.getShallow("show")}function vh(t){var e,n=t.get("breaks",!0);if(null!=n)return vo()?"x"!==(e=t.axis).dim&&"y"!==e.dim&&"z"!==e.dim&&"single"!==e.dim||"category"===e.type?void 0:n:void 0}function _h(t){return("interval"===t.type||"time"===t.type)&&!t.hasBreaks()}function xh(t){return{out:{noPxChangeTryDetermine:[]},kind:t}}function wh(t,e){var n=d(e,function(e){return t.scale.parse(e)});return"time"===t.type&&n.length>0&&(n.sort(),n.unshift(n[0]),n.push(n[n.length-1])),n}function bh(t,e,n){var i,o,r=kk(t),a=ph(e),s=n.kind===Tk;if(!s){var l=Th(r,a);if(l)return l}v(a)?i=Lh(t,a):(o="auto"===a?function(t,e){if(e.kind===Tk){var n=t.calculateCategoryInterval(e);return e.out.noPxChangeTryDetermine.push(function(){return Sk(t).autoInterval=n,!0}),n}var i=Sk(t).autoInterval;return null!=i?i:Sk(t).autoInterval=t.calculateCategoryInterval(e)}(t,n):a,i=Ih(t,o));var u={labels:i,labelCategoryInterval:o};return s?n.out.noPxChangeTryDetermine.push(function(){return Mh(r,a,u),!0}):Mh(r,a,u),u}function Sh(t){return function(e){return Sk(e)[t]||(Sk(e)[t]={list:[]})}}function Th(t,e){for(var n=0;ne&&i.axisExtent0===o[0]&&i.axisExtent1===o[1])return r;i.lastTickCount=n,i.lastAutoInterval=e,i.axisExtent0=o[0],i.axisExtent1=o[1]}function Ih(t,e,n){function i(t){var e={value:t};l.push(n?t:{formattedLabel:o(e),rawLabel:r.getLabel(e),tickValue:t,time:void 0,break:void 0})}var o=ch(t),r=t.scale,a=r.getExtent(),s=t.getLabelModel(),l=[],u=Math.max((e||0)+1,1),h=a[0],c=r.count();0!==h&&u>1&&c/u>2&&(h=Math.round(Math.ceil(h/u)*u));var d=fh(t),p=s.get("showMinLabel")||d,f=s.get("showMaxLabel")||d;p&&h!==a[0]&&i(a[0]);for(var g=h;g<=a[1];g+=u)i(g);return f&&g-u!==a[1]&&i(a[1]),l}function Lh(t,e,n){var i=t.scale,o=ch(t),r=[];return c(i.getTicks(),function(t){var a=i.getLabel(t),s=t.value;e(t.value,a)&&r.push(n?s:{formattedLabel:o(t),rawLabel:a,tickValue:s,time:void 0,break:void 0})}),r}function Ph(t,e){var n=(t[1]-t[0])/e/2;t[0]+=n,t[1]-=n}function Dh(t,e,n){n=n||3,e?t.dirty|=n:t.dirty&=~n}function Ah(t,e){return e=e||3,null==t.dirty||!!(t.dirty&e)}function Oh(t){if(t)return Ah(t)&&function(t,e,n){var i=e.getComputedTransform();t.transform=ls(t.transform,i);var o=t.localRect=ss(t.localRect,e.getBoundingRect()),r=e.style,a=r.margin,s=n&&n.marginForce,l=n&&n.minMarginForce,u=n&&n.marginDefault,h=r.__marginType;null==h&&u&&(a=u,h=Wv.textMargin);for(var c=0;c<4;c++)Ok[c]=h===Wv.minMargin&&l&&null!=l[c]?l[c]:s&&null!=s[c]?s[c]:a?a[c]:0;h===Wv.textMargin&&es(o,Ok,!1,!1);var d=t.rect=ss(t.rect,o);i&&d.applyTransform(i),h===Wv.minMargin&&es(d,Ok,!1,!1),t.axisAligned=as(i),(t.label=t.label||{}).ignore=e.ignore,Dh(t,!1),Dh(t,!0,2)}(t,t.label,t),t}function zh(t,e){for(var n=0;n=0,r=0,a=t.length;r.1?"x":"y",h=a.transGroup[u];if(s.sort(function(t,e){return Math.abs(t.label[u]-h)-Math.abs(e.label[u]-h)}),l&&o){var d=r.getExtent(),p=Math.min(d[0],d[1]),f=Math.max(d[0],d[1])-p;o.union(new lg(p,0,f,1))}a.stOccupiedRect=o,a.labelInfoList=s}(t,n,i,l)}function Vh(t){t&&(t.ignore=!0)}function Zh(t,e,n,i,o){for(var r=[],a=[],s=[],l=0;l0&&i>0||n<0&&i<0)}(t)}function $h(t,e){c(t.x,function(t){return Jh(t,e.x,e.width)}),c(t.y,function(t){return Jh(t,e.y,e.height)})}function Jh(t,e,n){var i=[0,n],o=t.inverse?1:0;t.setExtent(i[o],i[1-o]),function(t,e){var n=t.getExtent(),i=n[0]+n[1];t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return i-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return i-t+e}}(t,e)}function Qh(t,e,n,i,o,r,a){function s(t){c(o[Fb[t]],function(e){if(yh(e.model)){var n=r.ensureRecord(e.model),i=n.labelInfoList;if(i)for(var o=0;o0&&!k(e)&&e>1e-4&&(t/=e),t}tc(i,o,Tk,e,!1,a);var h=[0,0,0,0];s(0),s(1),l(i,0,NaN),l(i,1,NaN);var d=null==function(t,e){if(t&&e)for(var n=0,i=t.length;n0});return es(i,h,!0,!0,n),$h(o,i),d}function tc(t,e,n,i,o,r){function a(e){l[Fb[1-e]]=t[Vb[e]]<=.5*r.refContainer[Vb[e]]?0:1-e==1?2:1}var s=n===Mk;c(e,function(e){return c(e,function(e){yh(e.model)&&(function(t,e,n){var i=Uh(e,n);t.updateCfg(i)}(e.axisBuilder,t,e.model),e.axisBuilder.build(s?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:o}))})});var l={x:0,y:0};a(0),a(1),c(e,function(t,e){return c(t,function(t){yh(t.model)&&(("all"===i||s)&&t.axisBuilder.build({axisName:!0},{nameMarginLevel:l[e]}),s&&t.axisBuilder.build({axisLine:!0}))})})}function ec(t,e){return"all"===t||y(t)&&l(t,e)>=0||t===e}function nc(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[oc(t)]}function ic(t){return!!t.get(["handle","show"])}function oc(t){return t.type+"||"+t.id}function rc(t){t.registerComponentView(uI),t.registerComponentModel(FC),t.registerCoordinateSystem("cartesian2d",Qk),Zu(t,"x",ZC,hI),Zu(t,"y",ZC,hI),t.registerComponentView(sI),t.registerComponentView(lI),t.registerPreprocessor(function(t){t.xAxis&&t.yAxis&&!t.grid&&(t.grid={})})}function ac(t,e,n,i){sc(cI(n).lastProp,i)||(cI(n).lastProp=i,e?Ia(n,i,t):(n.stopAnimation(),n.attr(i)))}function sc(t,e){if(b(t)&&b(e)){var n=!0;return c(e,function(e,i){n=n&&sc(t[i],e)}),!!n}return t===e}function lc(t,e){t[e.get(["label","show"])?"show":"hide"]()}function uc(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function hc(t,e,n){var i=e.get("z"),o=e.get("zlevel");t&&t.traverse(function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=o&&(t.zlevel=o),t.silent=n)})}function cc(t,e,n,i,o){t=e.scale.parse(t);var r=e.scale.getLabel({value:t},{precision:o.precision}),a=o.formatter;if(a){var s={value:dh(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};c(i,function(t){var e=n.getSeriesByIndex(t.seriesIndex),i=e&&e.getDataParams(t.dataIndexInside);i&&s.seriesData.push(i)}),_(a)?r=a.replace("{value}",r):v(a)&&(r=a(s))}return r}function dc(t,e,n){var i=[1,0,0,1,0,0];return wt(i,i,n.rotation),xt(i,i,n.position),Ga([t.dataToCoord(e),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}function pc(t,e){var n={};return n[e.dim+"AxisIndex"]=e.index,t.getCartesian(n)}function fc(t){return"x"===t.dim?0:1}function gc(t,e,n){if(!Qp.node){var i=e.getZr();_I(i).records||(_I(i).records={}),function(t,e){function n(n,i){t.on(n,function(n){var o=function(t){var e={showTip:[],hideTip:[]},n=function(i){var o=e[i.type];o?o.push(i):(i.dispatchAction=n,t.dispatchAction(i))};return{dispatchAction:n,pendings:e}}(e);xI(_I(t).records,function(t){t&&i(t,n,o.dispatchAction)}),function(t,e){var n,i=t.showTip.length,o=t.hideTip.length;i?n=t.showTip[i-1]:o&&(n=t.hideTip[o-1]),n&&(n.dispatchAction=null,e.dispatchAction(n))}(o.pendings,e)})}_I(t).initialized||(_I(t).initialized=!0,n("click",m(yc,"click")),n("mousemove",m(yc,"mousemove")),n("globalout",mc))}(i,e),(_I(i).records[t]||(_I(i).records[t]={})).handler=n}}function mc(t,e,n){t.handler("leave",null,n)}function yc(t,e,n,i){e.handler(t,n,i)}function vc(t,e){if(!Qp.node){var n=e.getZr();(_I(n).records||{})[t]&&(_I(n).records[t]=null)}}function _c(t,e){var n,i=[],o=t.seriesIndex;if(null==o||!(n=e.getSeriesByIndex(o)))return{point:[]};var r=n.getData(),a=In(r,t);if(null==a||a<0||y(a))return{point:[]};var s=r.getItemGraphicEl(a),l=n.coordinateSystem;if(n.getTooltipPosition)i=n.getTooltipPosition(a)||[];else if(l&&l.dataToPoint)if(t.isStacked){var u=l.getBaseAxis(),h=l.getOtherAxis(u).dim,c="x"===h||"radius"===h?1:0,p=r.mapDimension(u.dim),f=[];f[c]=r.get(p,a),f[1-c]=r.get(r.getCalculationInfo("stackResultDimension"),a),i=l.dataToPoint(f)||[]}else i=l.dataToPoint(r.getValues(d(l.dimensions,function(t){return r.mapDimension(t)}),a))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),i=[g.x+g.width/2,g.y+g.height/2]}return{point:i,el:s}}function xc(t,e,n){var i=t.currTrigger,o=[t.x,t.y],r=t,a=t.dispatchAction||_f(n.dispatchAction,n),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){Mc(o)&&(o=_c({seriesIndex:r.seriesIndex,dataIndex:r.dataIndex},e).point);var l=Mc(o),u=r.axesInfo,h=s.axesInfo,d="leave"===i||Mc(o),p={},f={},g={list:[],map:{}},y={showPointer:m(bc,f),showTooltip:m(Sc,g)};c(s.coordSysMap,function(t,e){var n=l||t.containPoint(o);c(s.coordSysAxesInfo[e],function(t,e){var i=t.axis,r=function(t,e){for(var n=0;n<(t||[]).length;n++){var i=t[n];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}(u,t);if(!d&&n&&(!u||r)){var a=r&&r.value;null!=a||l||(a=i.pointToData(o)),null!=a&&wc(t,a,y,!1,p)}})});var v={};return c(h,function(t,e){var n=t.linkGroup;n&&!f[e]&&c(n.axesInfo,function(e,i){var o=f[i];if(e!==t&&o){var r=o.value;n.mapper&&(r=t.axis.scale.parse(n.mapper(r,Tc(e),Tc(t)))),v[t.key]=r}})}),c(v,function(t,e){wc(h[e],t,y,!0,p)}),function(t,e,n){var i=n.axesInfo=[];c(e,function(e,n){var o=e.axisPointerModel.option,r=t[n];r?(!e.useHandle&&(o.status="show"),o.value=r.value,o.seriesDataIndices=(r.payloadBatch||[]).slice()):!e.useHandle&&(o.status="hide"),"show"===o.status&&i.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:o.value})})}(f,h,p),function(t,e,n,i){if(!Mc(e)&&t.list.length){var o=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:o.dataIndexInside,dataIndex:o.dataIndex,seriesIndex:o.seriesIndex,dataByCoordSys:t.list})}else i({type:"hideTip"})}(g,o,t,a),function(t,e,n){var i=n.getZr(),o="axisPointerLastHighlights",r=SI(i)[o]||{},a=SI(i)[o]={};c(t,function(t,e){var n=t.axisPointerModel.option;"show"===n.status&&t.triggerEmphasis&&c(n.seriesDataIndices,function(t){a[t.seriesIndex+" | "+t.dataIndex]=t})});var s=[],l=[];c(r,function(t,e){!a[e]&&l.push(t)}),c(a,function(t,e){!r[e]&&s.push(t)}),l.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}(h,0,n),p}}function wc(t,e,n,i,o){var r=t.axis;if(!r.scale.isBlank()&&r.containData(e))if(t.involveSeries){var s=function(t,e){var n=e.axis,i=n.dim,o=t,r=[],a=Number.MAX_VALUE,s=-1;return c(e.seriesModels,function(e,l){var u,h,d=e.getData().mapDimensionsAll(i);if(e.getAxisTooltipData){var p=e.getAxisTooltipData(d,t,n);h=p.dataIndices,u=p.nestestValue}else{if(!(h=e.indicesOfNearest(i,d[0],t,"category"===n.type?.5:null)).length)return;u=e.getData().get(d[0],h[0])}if(null!=u&&isFinite(u)){var f=t-u,g=Math.abs(f);g<=a&&((g=0&&s<0)&&(a=g,s=f,o=u,r.length=0),c(h,function(t){r.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})}))}}),{payloadBatch:r,snapToValue:o}}(e,t),l=s.payloadBatch,u=s.snapToValue;l[0]&&null==o.seriesIndex&&a(o,l[0]),!i&&t.snap&&r.containData(u)&&null!=u&&(e=u),n.showPointer(t,e,l),n.showTooltip(t,s,u)}else n.showPointer(t,e)}function bc(t,e,n,i){t[e.key]={value:n,payloadBatch:i}}function Sc(t,e,n,i){var o=n.payloadBatch,r=e.axis,a=r.model,s=e.axisPointerModel;if(e.triggerTooltip&&o.length){var l=e.coordSys.model,u=oc(l),h=t.map[u];h||(h=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(h)),h.dataByAxis.push({axisDim:r.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:o.slice()})}}function Tc(t){var e=t.axis.model,n={},i=n.axisDim=t.axis.dim;return n.axisIndex=n[i+"AxisIndex"]=e.componentIndex,n.axisName=n[i+"AxisName"]=e.name,n.axisId=n[i+"AxisId"]=e.id,n}function Mc(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function Cc(t){nI.registerAxisPointerClass("CartesianAxisPointer",yI),t.registerComponentModel(vI),t.registerComponentView(bI),t.registerPreprocessor(function(t){if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!y(e)&&(t.axisPointer.link=[e])}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=function(t,e){var n={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return function(t,e,n){var i=e.getComponent("tooltip"),r=e.getComponent("axisPointer"),a=r.get("link",!0)||[],l=[];c(n.getCoordinateSystems(),function(n){function u(i,u,h){var f=h.model.getModel("axisPointer",r),g=f.get("show");if(g&&("auto"!==g||i||ic(f))){null==u&&(u=f.get("triggerTooltip")),f=i?function(t,e,n,i,r,a){var l=e.getModel("axisPointer"),u={};c(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],function(t){u[t]=o(l.get(t))}),u.snap="category"!==t.type&&!!a,"cross"===l.get("type")&&(u.type="line");var h=u.label||(u.label={});if(null==h.show&&(h.show=!1),"cross"===r){var d=l.get(["label","show"]);if(h.show=null==d||d,!a){var p=u.lineStyle=l.get("crossStyle");p&&s(h,p.textStyle)}}return t.model.getModel("axisPointer",new i_(u,n,i))}(h,p,r,e,i,u):f;var m=f.get("snap"),y=f.get("triggerEmphasis"),v=oc(h.model),_=u||m||"category"===h.type,x=t.axesInfo[v]={key:v,axis:h,coordSys:n,axisPointerModel:f,triggerTooltip:u,triggerEmphasis:y,involveSeries:_,snap:m,useHandle:ic(f),seriesModels:[],linkGroup:null};d[v]=x,t.seriesInvolved=t.seriesInvolved||_;var w=function(t,e){for(var n=e.model,i=e.dim,o=0;o=0;r--){var a=t[r];a&&(a instanceof i_&&(a=a.get("tooltip",!0)),_(a)&&(a={formatter:a}),a&&(i=new i_(a,i,o)))}return i}function Rc(t,e){return t.dispatchAction||_f(e.dispatchAction,e)}function Bc(t){return"center"===t||"middle"===t}function Nc(t){return t+"Axis"}function Fc(t){var e={};return c(["start","end","startValue","endValue","throttle"],function(n){t.hasOwnProperty(n)&&(e[n]=t[n])}),e}function Vc(t,e,n,i,o,r){t=t||0;var a=n[1]-n[0];if(null!=o&&(o=Hc(o,[0,a])),null!=r&&(r=Math.max(r,null!=o?o:0)),"all"===i){var s=Math.abs(e[1]-e[0]);s=Hc(s,[0,a]),o=r=Hc(s,[o,r]),i=0}e[0]=Hc(e[0],n),e[1]=Hc(e[1],n);var l=Zc(e,i);e[i]+=t;var u,h=o||0,c=n.slice();return l.sign<0?c[0]+=h:c[1]-=h,e[i]=Hc(e[i],c),u=Zc(e,i),null!=o&&(u.sign!==l.sign||u.spanr&&(e[1-i]=e[i]+u.sign*r),e}function Zc(t,e){var n=t[e]-t[1-e];return{span:Math.abs(n),sign:n>0?-1:n<0?1:e?-1:1}}function Hc(t,e){return Math.min(null!=e[1]?e[1]:1/0,Math.max(null!=e[0]?e[0]:-1/0,t))}function Wc(t){t.registerComponentModel(VI),t.registerComponentView(ZI),function(t){YI||(YI=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,UI),function(t){t.registerAction("dataZoom",function(t,e){c(function(t,e){function n(t){!s.get(t.uid)&&function(t){var e=!1;return t.eachTargetAxis(function(t,n){var i=r.get(t);i&&i[n]&&(e=!0)}),e}(t)&&(i(t),o=!0)}function i(t){s.set(t.uid,!0),a.push(t),t.eachTargetAxis(function(t,e){(r.get(t)||r.set(t,[]))[e]=!0})}var o,r=B(),a=[],s=B();t.eachComponent({mainType:"dataZoom",query:e},function(t){s.get(t.uid)||i(t)});do{o=!1,t.eachComponent("dataZoom",n)}while(o);return a}(e,t),function(e){e.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})})}(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}(t)}function jc(t,e){qI[t]=e}function Gc(t){return qI[t]}function Uc(t,e){var n=S_(e.get("padding")),i=e.getItemStyle(["color","opacity"]);return i.fill=e.get("backgroundColor"),new mv({shape:{x:t.x-n[3],y:t.y-n[0],width:t.width+n[1]+n[3],height:t.height+n[0]+n[2],r:e.get("borderRadius")},style:i,silent:!0,z2:-1})}function Yc(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Xc(t,e){return d(t,function(t,n){var i=e&&e[n];if(b(i)&&!y(i)){b(t)&&!y(t)||(t={value:t});var o=null!=i.name&&null==t.name;return t=s(t,i),o&&delete t.name,t}return t})}function qc(t){var e=cL(t);return e.snapshots||(e.snapshots=[{}]),e.snapshots}function Kc(t,e){var n=ML[e.brushType].createCover(t,e);return n.__brushOption=e,Qc(n,e),t.group.add(n),n}function $c(t,e){var n=ed(e);return n.endCreating&&(n.endCreating(t,e),Qc(e,e.__brushOption)),e}function Jc(t,e){var n=e.__brushOption;ed(e).updateCoverShape(t,e,n.range,n)}function Qc(t,e){var n=e.z;null==n&&(n=1e4),t.traverse(function(t){t.z=n,t.z2=n})}function td(t,e){ed(e).updateCommon(t,e),Jc(t,e)}function ed(t){return ML[t.__brushOption.brushType]}function nd(t,e,n){var i,o=t._panels;if(!o)return fL;var r=t._transform;return c(o,function(t){t.isTargetByCursor(e,n,r)&&(i=t)}),i}function id(t,e){var n=t._panels;if(!n)return fL;var i=e.__brushOption.panelId;return null!=i?n[i]:fL}function od(t){var e=t._covers,n=e.length;return c(e,function(e){t.group.remove(e)},t),e.length=0,!!n}function rd(t,e){var n=d(t._covers,function(t){var e=t.__brushOption,n=o(e.range);return{brushType:e.brushType,panelId:e.panelId,range:n}});t.trigger("brush",{areas:n,isEnd:!!e.isEnd,removeOnClick:!!e.removeOnClick})}function ad(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function sd(t,e,n,i){var o=new Em;return o.add(new mv({name:"main",style:cd(n),silent:!0,draggable:!0,cursor:"move",drift:m(fd,t,e,o,["n","s","w","e"]),ondragend:m(rd,e,{isEnd:!0})})),c(i,function(n){o.add(new mv({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:m(fd,t,e,o,n),ondragend:m(rd,e,{isEnd:!0})}))}),o}function ld(t,e,n,i){var o=i.brushStyle.lineWidth||0,r=mL(o,6),a=n[0][0],s=n[1][0],l=a-o/2,u=s-o/2,h=n[0][1],c=n[1][1],d=h-r+o/2,p=c-r+o/2,f=h-a,g=c-s,m=f+o,y=g+o;hd(t,e,"main",a,s,f,g),i.transformable&&(hd(t,e,"w",l,u,r,y),hd(t,e,"e",d,u,r,y),hd(t,e,"n",l,u,m,r),hd(t,e,"s",l,p,m,r),hd(t,e,"nw",l,u,r,r),hd(t,e,"ne",d,u,r,r),hd(t,e,"sw",l,p,r,r),hd(t,e,"se",d,p,r,r))}function ud(t,e){var n=e.__brushOption,i=n.transformable,o=e.childAt(0);o.useStyle(cd(n)),o.attr({silent:!i,cursor:i?"move":"default"}),c([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(n){var o=e.childOfName(n.join("")),r=1===n.length?pd(t,n[0]):function(t,e){var n=[pd(t,e[0]),pd(t,e[1])];return("e"===n[0]||"w"===n[0])&&n.reverse(),n.join("")}(t,n);o&&o.attr({silent:!i,invisible:!i,cursor:i?xL[r]+"-resize":null})})}function hd(t,e,n,i,o,r,a){var s=e.childOfName(n);s&&s.setShape(function(t){var e=gL(t[0][0],t[1][0]),n=gL(t[0][1],t[1][1]);return{x:e,y:n,width:mL(t[0][0],t[1][0])-e,height:mL(t[0][1],t[1][1])-n}}(yd(t,e,[[i,o],[i+r,o+a]])))}function cd(t){return s({strokeNoScale:!0},t.brushStyle)}function dd(t,e,n,i){var o=[gL(t,n),gL(e,i)],r=[mL(t,n),mL(e,i)];return[[o[0],r[0]],[o[1],r[1]]]}function pd(t,e){var n=Ua({w:"left",e:"right",n:"top",s:"bottom"}[e],function(t){return ja(t.group)}(t));return{left:"w",right:"e",top:"n",bottom:"s"}[n]}function fd(t,e,n,i,o,r){var a=n.__brushOption,s=t.toRectRange(a.range),l=md(e,o,r);c(i,function(t){var e=_L[t];s[e[0]][e[1]]+=l[e[0]]}),a.range=t.fromRectRange(dd(s[0][0],s[1][0],s[0][1],s[1][1])),td(e,n),rd(e,{isEnd:!1})}function gd(t,e,n,i){var o=e.__brushOption.range,r=md(t,n,i);c(o,function(t){t[0]+=r[0],t[1]+=r[1]}),td(t,e),rd(t,{isEnd:!1})}function md(t,e,n){var i=t.group,o=i.transformCoordToLocal(e,n),r=i.transformCoordToLocal(0,0);return[o[0]-r[0],o[1]-r[1]]}function yd(t,e,n){var i=id(t,e);return i&&i!==fL?i.clipPath(n,t._transform):o(n)}function vd(t){var e=t.event;e.preventDefault&&e.preventDefault()}function _d(t,e,n){return t.childOfName("main").contain(e,n)}function xd(t,e,n,i){var r,a=t._creatingCover,s=t._creatingPanel,l=t._brushOption;if(t._track.push(n.slice()),function(t){var e=t._track;if(!e.length)return!1;var n=e[e.length-1],i=e[0],o=n[0]-i[0],r=n[1]-i[1];return yL(o*o+r*r,.5)>6}(t)||a){if(s&&!a){"single"===l.brushMode&&od(t);var u=o(l);u.brushType=wd(u.brushType,s),u.panelId=s===fL?null:s.panelId,a=t._creatingCover=Kc(t,u),t._covers.push(a)}if(a){var h=ML[wd(t._brushType,s)];a.__brushOption.range=h.getCreatingRange(yd(t,a,t._track)),i&&($c(t,a),h.updateCommon(t,a)),Jc(t,a),r={isEnd:i}}}else i&&"single"===l.brushMode&&l.removeOnClick&&nd(t,e,n)&&od(t)&&(r={isEnd:i,removeOnClick:!0});return r}function wd(t,e){return"auto"===t?e.defaultBrushType:t}function bd(t,e){if(t._dragging){vd(e);var n=t.group.transformCoordToLocal(e.offsetX,e.offsetY),i=xd(t,e,n,!0);t._dragging=!1,t._track=[],t._creatingCover=null,i&&rd(t,i)}}function Sd(t){return{createCover:function(e,n){return sd({toRectRange:function(e){var n=[e,[0,100]];return t&&n.reverse(),n},fromRectRange:function(e){return e[t]}},e,n,[[["w"],["e"]],[["n"],["s"]]][t])},getCreatingRange:function(e){var n=ad(e);return[gL(n[0][t],n[1][t]),mL(n[0][t],n[1][t])]},updateCoverShape:function(e,n,i,o){var r,a=id(e,n);if(a!==fL&&a.getLinearBrushOtherExtent)r=a.getLinearBrushOtherExtent(t);else{var s=e._zr;r=[0,[s.getWidth(),s.getHeight()][1-t]]}var l=[i,r];t&&l.reverse(),ld(e,n,l,o)},updateCommon:ud,contain:_d}}function Td(t){return t=kd(t),function(e){return qa(e,t)}}function Md(t,e){return t=kd(t),function(n){var i=null!=e?e:n,o=i?t.x:t.y;return[o,o+((i?t.width:t.height)||0)]}}function Cd(t,e,n){var i=kd(t);return function(t,o){return i.contain(o[0],o[1])&&!fu(t,e,n)}}function kd(t){return lg.create(t)}function Id(t){return t[0]>t[1]&&t.reverse(),t}function Ld(t,e){return Pn(t,e,{includeMainTypes:kL})}function Pd(t,e,n,i){var o=n.getAxis(["x","y"][t]),r=Id(d([0,1],function(t){return e?o.coordToData(o.toLocalCoord(i[t]),!0):o.toGlobalCoord(o.dataToCoord(i[t]))})),a=[];return a[t]=r,a[1-t]=[NaN,NaN],{values:r,xyMinMax:a}}function Dd(t,e,n,i){return[e[0]-i[t]*n[0],e[1]-i[t]*n[1]]}function Ad(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}function Od(t){var e={xAxisIndex:t.get("xAxisIndex",!0),yAxisIndex:t.get("yAxisIndex",!0),xAxisId:t.get("xAxisId",!0),yAxisId:t.get("yAxisId",!0)};return null==e.xAxisIndex&&null==e.xAxisId&&(e.xAxisIndex="all"),null==e.yAxisIndex&&null==e.yAxisId&&(e.yAxisIndex="all"),e}function zd(t,e,n,i){Bd(t,e,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=t?t:e}),Rd(t,e,n,i)}function Ed(t){for(var e,n=t.getZr().storage.getDisplayList(),i=0,o=n.length;i0&&(s.during=l?_f($d,{el:e,userDuring:l}):null,s.setToFinal=!0,s.scope=t),a(s,n[r]),s}function Xd(t,e,n,i){var o=(i=i||{}).dataIndex,r=i.isInit,s=i.clearStyle,u=n.isAnimationEnabled(),h=rP(t),d=e.style;h.userDuring=e.during;var p={},f={};if(function(t,e,n){for(var i=0;i=0)){var c=t.getAnimationStyleProps(),d=c?c.style:null;if(d){!o&&(o=i.style={});var p=g(n);for(h=0;h0&&t.animateFrom(_,x)}else!function(t,e,n,i,o){if(o){var r=Yd("update",t,e,i,n);r.duration>0&&t.animateFrom(o,r)}}(t,e,o||0,n,p);qd(t,e),d?t.dirty():t.markRedraw()}function qd(t,e){for(var n=rP(t).leaveToProps,i=0;i=0){!r&&(r=i[t]={});var p=g(s);for(d=0;d"}(o,e.attrs)+("style"!==o?lt(r):r||"")+(i?""+n+d(i,function(e){return t(e)}).join(n)+n:"")+""}(t)}function up(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function hp(t,e,n,i){return sp("svg","root",{width:t,height:e,xmlns:MP,"xmlns:xlink":CP,version:"1.1",baseProfile:"full",viewBox:!!i&&"0 0 "+t+" "+e},n)}function cp(){return IP++}function dp(t,e,n){var i=a({},t.shape);a(i,e),t.buildPath(n,i);var o=new vP;return o.reset(we(t)),n.rebuildPath(o,1),o.generateStr(),o.getStr()}function pp(t,e){var n=e.originX,i=e.originY;(n||i)&&(t[PP]=n+"px "+i+"px")}function fp(t,e){var n=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[n]=t,n}function gp(t){return _(t)?LP[t]?"cubic-bezier("+LP[t]+")":qt(t)?t:"":""}function mp(t,e,n,i){function o(o){function r(t,e,n){for(var i=t.getTracks(),o=t.getMaxTime(),r=0;r0}).length)return fp(d,n)+" "+o[0]+" both"}var r=t.animators,s=r.length,l=[];if(t instanceof xb){var u=function(t,e,n){var i,o,r={};if(c(t.shape.paths,function(t){var e=up(n.zrId);e.animation=!0,mp(t,{},e,!0);var a=e.cssAnims,s=e.cssNodes,l=g(a),u=l.length;if(u){var h=a[o=l[u-1]];for(var c in h){var d=h[c];r[c]=r[c]||{d:""},r[c].d+=d.d||""}for(var p in s){var f=s[p].animation;f.indexOf(o)>=0&&(i=f)}}}),i){e.d=!1;var a=fp(r,n);return i.replace(o,a)}}(t,e,n);if(u)l.push(u);else if(!s)return}else if(!s)return;for(var h={},d=0;d=0&&a||r;s&&(o=he(s))}var l=i.lineWidth;l&&(l/=!i.strokeNoScale&&t.transform?t.transform[0]:1);var u={cursor:"pointer"};o&&(u.fill=o),i.stroke&&(u.stroke=i.stroke),l&&(u["stroke-width"]=l),yp(u,e,n,!0)}}(t,r,e),sp(s,t.id+"",r)}function kp(t,e){return t instanceof ov?Cp(t,e):t instanceof cv?function(t,e){var n=t.style,i=n.image;if(i&&!_(i)&&(vp(i)?i=i.src:_p(i)&&(i=i.toDataURL())),i){var o=n.x||0,r=n.y||0,a={href:i,width:n.width,height:n.height};return o&&(a.x=o),r&&(a.y=r),Sp(a,t.transform),xp(a,n,t,e),wp(a,t),e.animation&&mp(t,a,e),sp("image",t.id+"",a)}}(t,e):t instanceof sv?function(t,e){var n=t.style,i=n.text;if(null!=i&&(i+=""),i&&!isNaN(n.x)&&!isNaN(n.y)){var o=n.font||of,r=n.x||0,a=function(t,e,n){return"top"===n?t+=e/2:"bottom"===n&&(t-=e/2),t}(n.y||0,Xe(o),n.textBaseline),s={"dominant-baseline":"central","text-anchor":Wg[n.textAlign]||n.textAlign};if(Si(n)){var l="",u=n.fontStyle,h=wi(n.fontSize);if(!parseFloat(h))return;var c=n.fontWeight;l+="font-size:"+h+";font-family:"+(n.fontFamily||nf)+";",u&&"normal"!==u&&(l+="font-style:"+u+";"),c&&"normal"!==c&&(l+="font-weight:"+c+";"),s.style=l}else s.style="font: "+o;return i.match(/\s/)&&(s["xml:space"]="preserve"),r&&(s.x=r),a&&(s.y=a),Sp(s,t.transform),xp(s,n,t,e),wp(s,t),e.animation&&mp(t,s,e),sp("text",t.id+"",s,void 0,i)}}(t,e):void 0}function Ip(t,e,n,i){var o,r=t[n],a={gradientUnits:r.global?"userSpaceOnUse":"objectBoundingBox"};if(ye(r))o="linearGradient",a.x1=r.x,a.y1=r.y,a.x2=r.x2,a.y2=r.y2;else{if(!ve(r))return;o="radialGradient",a.cx=L(r.x,.5),a.cy=L(r.y,.5),a.r=L(r.r,.5)}for(var s=r.colorStops,l=[],u=0,h=s.length;ul?Wp(t,null==n[c+1]?null:n[c+1].elm,n,s,c):jp(t,e,a,l))}(n,i,o):Fp(o)?(Fp(t.text)&&Bp(n,""),Wp(n,null,o,0,o.length-1)):Fp(i)?jp(n,i,0,i.length-1):Fp(t.text)&&Bp(n,""):t.text!==e.text&&(Fp(i)&&jp(n,i,0,i.length-1),Bp(n,e.text)))}function Yp(t,e,n){var i=af.createCanvas(),o=e.getWidth(),r=e.getHeight(),a=i.style;return a&&(a.position="absolute",a.left="0",a.top="0",a.width=o+"px",a.height=r+"px",i.setAttribute("data-zr-dom-id",t)),i.width=o*n,i.height=r*n,i}function Xp(){xl(!0)&&(function(t){var e=W_.extend(t);W_.registerClass(e)}({type:"leaflet",getLeaflet(){return this.__map},setCenterAndZoom(t,e){this.option.center=t,this.option.zoom=e},centerOrZoomChanged(t,e){const{option:n}=this;return o=n.center,!((i=t)&&o&&i[0]===o[0]&&i[1]===o[1]&&e===n.zoom);var i,o},defaultOption:{mapOptions:{},tiles:[{urlTemplate:"http://{s}.tile.osm.org/{z}/{x}/{y}.png",options:{attribution:'© OpenStreetMap contributors'}}],layerControl:{}}}),function(t){var e=ww.extend(t);ww.registerClass(e)}({type:"leaflet",render(t,e,n){function i(e){if(s)return;const i=l._mapPane;let o=i.style.transform,r=0,a=0;if(o){o=o.replace("translate3d(","");const t=o.split(",");r=-parseInt(t[0],10),a=-parseInt(t[1],10)}else r=-parseInt(i.style.left,10),a=-parseInt(i.style.top,10);const c=[r,a];u.style.left=`${c[0]}px`,u.style.top=`${c[1]}px`,h.setMapOffset(c),t.__mapOffset=c,n.dispatchAction({type:"leafletRoam",animation:{duration:0}})}function o(){s||n.dispatchAction({type:"leafletRoam"})}function r(){i()}function a(){ul(n.getDom()).resize()}let s=!0;const l=t.getLeaflet(),u=n.getZr().painter.getViewportRoot().parentNode,h=t.coordinateSystem,{roam:c}=t.get("mapOptions");c&&"scale"!==c?l.dragging.enable():l.dragging.disable(),c&&"move"!==c?(l.scrollWheelZoom.enable(),l.doubleClickZoom.enable(),l.touchZoom.enable()):(l.scrollWheelZoom.disable(),l.doubleClickZoom.disable(),l.touchZoom.disable()),this._oldMoveHandler&&l.off("move",this._oldMoveHandler),this._oldZoomHandler&&l.off("zoom",this._oldZoomHandler),this._oldZoomEndHandler&&l.off("zoomend",this._oldZoomEndHandler),this._oldResizeHandler&&l.off("resize",this._oldResizeHandler),l.on("move",i),l.on("zoom",r),l.on("zoomend",o),l.on("resize",a),this._oldMoveHandler=i,this._oldZoomHandler=r,this._oldZoomEndHandler=o,this._oldResizeHandler=a,s=!1}}),gl("leaflet",YP()),fl({type:"leafletRoam",event:"leafletRoam",update:"updateLayout"},(t,e)=>{e.eachComponent("leaflet",t=>{const e=t.getLeaflet(),n=e.getCenter();t.setCenterAndZoom([n.lng,n.lat],e.getZoom())})}))}var qp={};t.r(qp),t.d(qp,{Arc:()=>vb,BezierCurve:()=>gb,BoundingRect:()=>lg,Circle:()=>Ew,CompoundPath:()=>xb,Ellipse:()=>Nw,Group:()=>Em,Image:()=>cv,IncrementalDisplayable:()=>Rb,Line:()=>cb,LinearGradient:()=>Sb,OrientedBoundingRect:()=>zb,Path:()=>ov,Point:()=>Gf,Polygon:()=>ob,Polyline:()=>sb,RadialGradient:()=>Tb,Rect:()=>mv,Ring:()=>eb,Sector:()=>Jw,Text:()=>Tv,WH:()=>Vb,XY:()=>Fb,applyTransform:()=>Ga,calcZ2Range:()=>hs,clipPointsByRect:()=>qa,clipRectByRect:()=>Ka,createIcon:()=>$a,ensureCopyRect:()=>ss,ensureCopyTransform:()=>ls,expandOrShrinkRect:()=>es,extendPath:()=>Ea,extendShape:()=>za,getShapeClass:()=>Ba,getTransform:()=>ja,groupTransition:()=>Xa,initProps:()=>La,isBoundingRectAxisAligned:()=>as,isElementRemoved:()=>Pa,lineLineIntersect:()=>Qa,linePolygonIntersect:()=>Ja,makeImage:()=>Fa,makePath:()=>Na,mergePath:()=>Hb,registerShape:()=>Ra,removeElement:()=>Da,removeElementWithFadeOut:()=>Oa,resizePath:()=>Za,retrieveZInfo:()=>us,setTooltipConfig:()=>is,subPixelOptimize:()=>Wb,subPixelOptimizeLine:()=>Ha,subPixelOptimizeRect:()=>Wa,transformDirection:()=>Ua,traverseElements:()=>rs,traverseUpdateZ:()=>cs,updateProps:()=>Ia});var Kp=function(t,e){return Kp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Kp(t,e)},$p=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},Jp=new function(){this.browser=new $p,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(Jp.wxa=!0,Jp.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?Jp.worker=!0:!Jp.hasGlobalWindow||"Deno"in window||"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Node.js")>-1?(Jp.node=!0,Jp.svgSupported=!0):function(t,e){var n=e.browser,i=t.match(/Firefox\/([\d.]+)/),o=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),r=t.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(t);if(i&&(n.firefox=!0,n.version=i[1]),o&&(n.ie=!0,n.version=o[1]),r&&(n.edge=!0,n.version=r[1],n.newEdge=+r[1].split(".")[0]>18),a&&(n.weChat=!0),e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,e.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11),e.domSupported="undefined"!=typeof document){var s=document.documentElement.style;e.transform3dSupported=(n.ie&&"transition"in s||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||n.ie&&+n.version>=9}}(navigator.userAgent,Jp);const Qp=Jp;var tf,ef,nf="sans-serif",of="12px "+nf,rf=function(){var t={};if("undefined"==typeof JSON)return t;for(var e=0;e<95;e++){var n=String.fromCharCode(e+32),i=("007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N".charCodeAt(e)-20)/100;t[n]=i}return t}(),af={createCanvas:function(){return"undefined"!=typeof document&&document.createElement("canvas")},measureText:function(t,e){if(!tf){var n=af.createCanvas();tf=n&&n.getContext("2d")}if(tf)return ef!==e&&(ef=tf.font=e||of),tf.measureText(t);t=t||"";var i=/((?:\d+)?\.?\d*)px/.exec(e=e||of),o=i&&+i[1]||12,r=0;if(e.indexOf("mono")>=0)r=o*t.length;else for(var a=0;a"'])/g,Bf={"&":"&","<":"<",">":">",'"':""","'":"'"},Nf=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ff=[],Vf=Qp.browser.firefox&&+Qp.browser.version.split(".")[0]<39,Zf=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0},Hf=function(){function t(){this._track=[]}return t.prototype.recognize=function(t,e,n){return this._doTrack(t,e,n),this._recognize(t)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(t,e,n){var i=t.touches;if(i){for(var o={points:[],touches:[],target:e,event:t},r=0,a=i.length;r1&&o&&o.length>1){var a=mt(o)/mt(r);!isFinite(a)&&(a=1),e.pinchScale=a;var s=[((i=o)[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2];return e.pinchX=s[0],e.pinchY=s[1],{type:"pinch",target:t[0].target,event:e}}}}},jf=function(){function t(t,e){this.x=t||0,this.y=e||0}return t.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},t.prototype.scale=function(t){this.x*=t,this.y*=t},t.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},t.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},t.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},t.prototype.distanceSquare=function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(t){if(t){var e=this.x,n=this.y;return this.x=t[0]*e+t[2]*n+t[4],this.y=t[1]*e+t[3]*n+t[5],this}},t.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},t.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},t.set=function(t,e,n){t.x=e,t.y=n},t.copy=function(t,e){t.x=e.x,t.y=e.y},t.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},t.lenSquare=function(t){return t.x*t.x+t.y*t.y},t.dot=function(t,e){return t.x*e.x+t.y*e.y},t.add=function(t,e,n){t.x=e.x+n.x,t.y=e.y+n.y},t.sub=function(t,e,n){t.x=e.x-n.x,t.y=e.y-n.y},t.scale=function(t,e,n){t.x=e.x*n,t.y=e.y*n},t.scaleAndAdd=function(t,e,n,i){t.x=e.x+n.x*i,t.y=e.y+n.y*i},t.lerp=function(t,e,n,i){var o=1-i;t.x=o*e.x+i*n.x,t.y=o*e.y+i*n.y},t}();const Gf=jf;var Uf=Math.min,Yf=Math.max,Xf=Math.abs,qf=["x","y"],Kf=["width","height"],$f=new Gf,Jf=new Gf,Qf=new Gf,tg=new Gf,eg=Tt(),ng=eg.minTv,ig=eg.maxTv,og=[0,0],rg=function(){function t(e,n,i,o){t.set(this,e,n,i,o)}return t.set=function(t,e,n,i,o){return i<0&&(e+=i,i=-i),o<0&&(n+=o,o=-o),t.x=e,t.y=n,t.width=i,t.height=o,t},t.prototype.union=function(t){var e=Uf(t.x,this.x),n=Uf(t.y,this.y);this.width=isFinite(this.x)&&isFinite(this.width)?Yf(t.x+t.width,this.x+this.width)-e:t.width,this.height=isFinite(this.y)&&isFinite(this.height)?Yf(t.y+t.height,this.y+this.height)-n:t.height,this.x=e,this.y=n},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(t){var e=this,n=t.width/e.width,i=t.height/e.height,o=[1,0,0,1,0,0];return xt(o,o,[-e.x,-e.y]),function(t,e,n){var i=n[0],o=n[1];t[0]=e[0]*i,t[1]=e[1]*o,t[2]=e[2]*i,t[3]=e[3]*o,t[4]=e[4]*i,t[5]=e[5]*o}(o,o,[n,i]),xt(o,o,[t.x,t.y]),o},t.prototype.intersect=function(e,n,i){return t.intersect(this,e,n,i)},t.intersect=function(e,n,i,o){i&&Gf.set(i,0,0);var r=o&&o.outIntersectRect||null,a=o&&o.clamp;if(r&&(r.x=r.y=r.width=r.height=NaN),!e||!n)return!1;e instanceof t||(e=t.set(ag,e.x,e.y,e.width,e.height)),n instanceof t||(n=t.set(sg,n.x,n.y,n.width,n.height));var s=!!i;eg.reset(o,s);var l=eg.touchThreshold,u=e.x+l,h=e.x+e.width-l,c=e.y+l,d=e.y+e.height-l,p=n.x+l,f=n.x+n.width-l,g=n.y+l,m=n.y+n.height-l;if(u>h||c>d||p>f||g>m)return!1;var y=!(h=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},t.prototype.contain=function(e,n){return t.contain(this,e,n)},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return 0===this.width||0===this.height},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(t,e){return t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t},t.applyTransform=function(e,n,i){if(i){if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var o=i[0],r=i[3],a=i[5];return e.x=n.x*o+i[4],e.y=n.y*r+a,e.width=n.width*o,e.height=n.height*r,e.width<0&&(e.x+=e.width,e.width=-e.width),void(e.height<0&&(e.y+=e.height,e.height=-e.height))}$f.x=Qf.x=n.x,$f.y=tg.y=n.y,Jf.x=tg.x=n.x+n.width,Jf.y=Qf.y=n.y+n.height,$f.transform(i),tg.transform(i),Jf.transform(i),Qf.transform(i),e.x=Uf($f.x,Jf.x,Qf.x,tg.x),e.y=Uf($f.y,Jf.y,Qf.y,tg.y);var s=Yf($f.x,Jf.x,Qf.x,tg.x),l=Yf($f.y,Jf.y,Qf.y,tg.y);e.width=s-e.x,e.height=l-e.y}else e!==n&&t.copy(e,n)},t}(),ag=new rg(0,0,0,0),sg=new rg(0,0,0,0);const lg=rg;var ug="silent",hg=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.handler=null,e}return W(e,t),e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(Af),cg=function(t,e){this.x=t,this.y=e},dg=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],pg=new lg(0,0,0,0),fg=function(t){function e(e,n,i,o,r){var a=t.call(this)||this;return a._hovered=new cg(0,0),a.storage=e,a.painter=n,a.painterRoot=o,a._pointerSize=r,i=i||new hg,a.proxy=null,a.setHandlerProxy(i),a._draggingMgr=new Pf(a),a}return W(e,t),e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(c(dg,function(e){t.on&&t.on(e,this[e],this)},this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var e=t.zrX,n=t.zrY,i=It(this,e,n),o=this._hovered,r=o.target;r&&!r.__zr&&(r=(o=this.findHover(o.x,o.y)).target);var a=this._hovered=i?new cg(e,n):this.findHover(e,n),s=a.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),r&&s!==r&&this.dispatchToElement(o,"mouseout",t),this.dispatchToElement(a,"mousemove",t),s&&s!==r&&this.dispatchToElement(a,"mouseover",t)},e.prototype.mouseout=function(t){var e=t.zrEventControl;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new cg(0,0)},e.prototype.dispatch=function(t,e){var n=this[t];n&&n.call(this,e)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},e.prototype.dispatchToElement=function(t,e,n){var i=(t=t||{}).target;if(!i||!i.silent){for(var o="on"+e,r=function(t,e,n){return{type:t,event:n,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:Mt}}(e,t,n);i&&(i[o]&&(r.cancelBubble=!!i[o].call(i,r)),i.trigger(e,r),i=i.__hostTarget?i.__hostTarget:i.parent,!r.cancelBubble););r.cancelBubble||(this.trigger(e,r),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(t){"function"==typeof t[o]&&t[o].call(t,r),t.trigger&&t.trigger(e,r)}))}},e.prototype.findHover=function(t,e,n){var i=this.storage.getDisplayList(),o=new cg(t,e);if(kt(i,o,t,e,n),this._pointerSize&&!o.target){for(var r=[],a=this._pointerSize,s=a/2,l=new lg(t-s,e-s,a,a),u=i.length-1;u>=0;u--){var h=i[u];h===n||h.ignore||h.ignoreCoarsePointer||h.parent&&h.parent.ignoreCoarsePointer||(pg.copy(h.getBoundingRect()),h.transform&&pg.applyTransform(h.transform),pg.intersect(l)&&r.push(h))}if(r.length)for(var c=Math.PI/12,d=2*Math.PI,p=0;p4)return;this._downPoint=null}this.dispatchToElement(n,t,e)}});const gg=fg;var mg=!1,yg=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Et}return t.prototype.traverse=function(t,e){for(var n=0;n=0&&this._roots.splice(i,1)}},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}();const vg=yg,_g=Qp.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};var xg={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),(t*=2)<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-xg.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*xg.bounceIn(2*t):.5*xg.bounceOut(2*t-1)+.5}};const wg=xg;var bg=Math.pow,Sg=Math.sqrt,Tg=1e-8,Mg=1e-4,Cg=Sg(3),kg=1/3,Ig=j(),Lg=j(),Pg=j(),Dg=/cubic-bezier\(([0-9,\.e ]+)\)/;const Ag=function(){function t(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||H,this.ondestroy=t.ondestroy||H,this.onrestart=t.onrestart||H,t.easing&&this.setEasing(t.easing)}return t.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),!this._paused){var n=this._life,i=t-this._startTime-this._pausedTime,o=i/n;o<0&&(o=0),o=Math.min(o,1);var r=this.easingFunc,a=r?r(o):o;if(this.onframe(a),1===o){if(!this.loop)return!0;this._startTime=t-i%n,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=e},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(t){this.easing=t,this.easingFunc=v(t)?t:wg[t]||qt(t)},t}();var Og=function(t){this.value=t},zg=function(){function t(){this._len=0}return t.prototype.insert=function(t){var e=new Og(t);return this.insertEntry(e),e},t.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++},t.prototype.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),Eg=function(){function t(t){this._list=new zg,this._maxSize=10,this._map={},this._maxSize=t}return t.prototype.put=function(t,e){var n=this._list,i=this._map,o=null;if(null==i[t]){var r=n.len(),a=this._lastRemovedEntry;if(r>=this._maxSize&&r>0){var s=n.head;n.remove(s),delete i[s.key],o=s.value,this._lastRemovedEntry=s}a?a.value=e:a=new Og(e),a.key=t,n.insertEntry(a),i[t]=a}return o},t.prototype.get=function(t){var e=this._map[t],n=this._list;if(null!=e)return e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}();const Rg=Eg;var Bg={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]},Ng=new Rg(20),Fg=null,Vg=new Rg(100),Zg=Math.round,Hg=1e-4,Wg={left:"start",right:"end",center:"middle",middle:"middle"},jg=Qp.hasGlobalWindow&&v(window.btoa)?function(t){return window.btoa(unescape(encodeURIComponent(t)))}:"undefined"!=typeof Buffer?function(t){return Buffer.from(t).toString("base64")}:function(t){return null},Gg=Array.prototype.slice,Ug=[0,0,0,0],Yg=function(){function t(t){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=t}return t.prototype.isFinished=function(){return this._finished},t.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},t.prototype.needsAnimate=function(){return this.keyframes.length>=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(t,e,n){this._needsSort=!0;var i=this.keyframes,o=i.length,r=!1,s=6,l=e;if(h(e)){var u=function(t){return h(t&&t[0])?2:1}(e);s=u,(1===u&&!w(e[0])||2===u&&!w(e[0][0]))&&(r=!0)}else if(w(e)&&!k(e))s=0;else if(_(e))if(isNaN(+e)){var c=oe(e);c&&(l=c,s=3)}else s=0;else if(C(e)){var p=a({},l);p.colorStops=d(e.colorStops,function(t){return{offset:t.offset,color:oe(t.color)}}),ye(e)?s=4:ve(e)&&(s=5),l=p}0===o?this.valType=s:s===this.valType&&6!==s||(r=!0),this.discrete=this.discrete||r;var f={time:t,value:l,rawValue:e,percent:0};return n&&(f.easing=n,f.easingFunc=v(n)?n:wg[n]||qt(n)),i.push(f),f},t.prototype.prepare=function(t,e){var n=this.keyframes;this._needsSort&&n.sort(function(t,e){return t.time-e.time});for(var i=this.valType,o=n.length,r=n[o-1],a=this.discrete,s=Ae(i),l=De(i),u=0;u=0&&!(l[n].percent<=e);n--);n=f(n,u-2)}else{for(n=p;ne);n++);n=f(n-1,u-2)}o=l[n+1],i=l[n]}if(i&&o){this._lastFr=n,this._lastFrP=e;var g=o.percent-i.percent,m=0===g?1:f((e-i.percent)/g,1);o.easingFunc&&(m=o.easingFunc(m));var y=r?this._additiveValue:c?Ug:t[h];if(!Ae(s)&&!c||y||(y=this._additiveValue=[]),this.discrete)t[h]=m<1?i.rawValue:o.rawValue;else if(Ae(s))1===s?Te(y,i[a],o[a],m):function(t,e,n,i){for(var o=e.length,r=o&&e[0].length,a=0;a0&&s.addKeyframe(0,Le(l),i),this._trackKeys.push(a)}s.addKeyframe(t,Le(e[a]),i)}return this._maxTime=Math.max(this._maxTime,t),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,n=0;n0)){this._started=1;for(var e=this,n=[],i=this._maxTime||0,o=0;o1){var a=r.pop();o.addKeyframe(a.time,t[i]),o.prepare(this._maxTime,o.getAdditiveTrack())}}}},t}();const qg=Xg;var Kg=function(t){function e(e){var n=t.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,n.stage=(e=e||{}).stage||{},n}return W(e,t),e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var e=t.getClip();e&&this.addClip(e)},e.prototype.removeClip=function(t){if(t.animation){var e=t.prev,n=t.next;e?e.next=n:this._head=n,n?n.prev=e:this._tail=e,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var e=t.getClip();e&&this.removeClip(e),t.animation=null},e.prototype.update=function(t){for(var e=Oe()-this._pausedTime,n=e-this._time,i=this._head;i;){var o=i.next;i.step(e,n)?(i.ondestroy(),this.removeClip(i),i=o):i=o}this._time=e,t||(this.trigger("frame",n),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0,_g(function e(){t._running&&(_g(e),!t._paused&&t.update())})},e.prototype.start=function(){this._running||(this._time=Oe(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=Oe(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=Oe()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var e=t.next;t.prev=t.next=t.animation=null,t=e}this._head=this._tail=null},e.prototype.isFinished=function(){return null==this._head},e.prototype.animate=function(t,e){e=e||{},this.start();var n=new qg(t,e.loop);return this.addAnimator(n),n},e}(Af);const $g=Kg;var Jg,Qg,tm=Qp.domSupported,em=(Qg={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:Jg=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:d(Jg,function(t){var e=t.replace("mouse","pointer");return Qg.hasOwnProperty(e)?e:t})}),nm=["mousemove","mouseup"],im=["pointermove","pointerup"],om=!1,rm=function(t,e){this.stopPropagation=H,this.stopImmediatePropagation=H,this.preventDefault=H,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY},am={mousedown:function(t){t=dt(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=dt(this.dom,t);var e=this.__mayPointerCapture;!e||t.zrX===e[0]&&t.zrY===e[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=dt(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){Re(this,(t=dt(this.dom,t)).toElement||t.relatedTarget)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){om=!0,t=dt(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){om||(t=dt(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){Ee(t=dt(this.dom,t)),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),am.mousemove.call(this,t),am.mousedown.call(this,t)},touchmove:function(t){Ee(t=dt(this.dom,t)),this.handler.processGesture(t,"change"),am.mousemove.call(this,t)},touchend:function(t){Ee(t=dt(this.dom,t)),this.handler.processGesture(t,"end"),am.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<300&&am.click.call(this,t)},pointerdown:function(t){am.mousedown.call(this,t)},pointermove:function(t){ze(t)||am.mousemove.call(this,t)},pointerup:function(t){am.mouseup.call(this,t)},pointerout:function(t){ze(t)||am.mouseout.call(this,t)}};c(["click","dblclick","contextmenu"],function(t){am[t]=function(e){e=dt(this.dom,e),this.trigger(t,e)}});var sm={pointermove:function(t){ze(t)||sm.mousemove.call(this,t)},pointerup:function(t){sm.mouseup.call(this,t)},mousemove:function(t){this.trigger("mousemove",t)},mouseup:function(t){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",t),e&&(t.zrEventControl="only_globalout",this.trigger("mouseout",t))}},lm=function(t,e){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=t,this.domHandlers=e};const um=function(t){function e(e,n){var i,o,r,a=t.call(this)||this;return a.__pointerCapturing=!1,a.dom=e,a.painterRoot=n,a._localHandlerScope=new lm(e,am),tm&&(a._globalHandlerScope=new lm(document,sm)),i=a,r=(o=a._localHandlerScope).domHandlers,Qp.pointerEventsSupported?c(em.pointer,function(t){Be(o,t,function(e){r[t].call(i,e)})}):(Qp.touchEventsSupported&&c(em.touch,function(t){Be(o,t,function(e){r[t].call(i,e),function(t){t.touching=!0,null!=t.touchTimer&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout(function(){t.touching=!1,t.touchTimer=null},700)}(o)})}),c(em.mouse,function(t){Be(o,t,function(e){e=ct(e),o.touching||r[t].call(i,e)})})),a}return W(e,t),e.prototype.dispose=function(){Ne(this._localHandlerScope),tm&&Ne(this._globalHandlerScope)},e.prototype.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},e.prototype.__togglePointerCapture=function(t){if(this.__mayPointerCapture=null,tm&&+this.__pointerCapturing^+t){this.__pointerCapturing=t;var e=this._globalHandlerScope;t?function(t,e){function n(n){Be(e,n,function(i){i=ct(i),Re(t,i.target)||(i=function(t,e){return dt(t.dom,new rm(t,e),!0)}(t,i),e.domHandlers[n].call(t,i))},{capture:!0})}Qp.pointerEventsSupported?c(im,n):Qp.touchEventsSupported||c(nm,n)}(this,e):Ne(e)}},e}(Af);var hm=1;Qp.hasGlobalWindow&&(hm=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var cm=hm,dm="#333",pm="#ccc",fm=yt,gm=5e-5,mm=[],ym=[],vm=[1,0,0,1,0,0],_m=Math.abs,xm=function(){function t(){}var e;return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},t.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},t.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},t.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},t.prototype.needLocalTransform=function(){return Fe(this.rotation)||Fe(this.x)||Fe(this.y)||Fe(this.scaleX-1)||Fe(this.scaleY-1)||Fe(this.skewX)||Fe(this.skewY)},t.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),n=this.transform;e||t?(n=n||[1,0,0,1,0,0],e?this.getLocalTransform(n):fm(n),t&&(e?_t(n,t,n):vt(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)):n&&(fm(n),this.invTransform=null)},t.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(null!=e&&1!==e){this.getGlobalScale(mm);var n=mm[0]<0?-1:1,i=mm[1]<0?-1:1,o=((mm[0]-n)*e+n)/mm[0]||0,r=((mm[1]-i)*e+i)/mm[1]||0;t[0]*=o,t[1]*=o,t[2]*=r,t[3]*=r}this.invTransform=this.invTransform||[1,0,0,1,0,0],bt(this.invTransform,t)},t.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},t.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],n=t[2]*t[2]+t[3]*t[3],i=Math.atan2(t[1],t[0]),o=Math.PI/2+i-Math.atan2(t[3],t[2]);n=Math.sqrt(n)*Math.cos(o),e=Math.sqrt(e),this.skewX=o,this.skewY=0,this.rotation=-i,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||[1,0,0,1,0,0],_t(ym,t.invTransform,e),e=ym);var n=this.originX,i=this.originY;(n||i)&&(vm[4]=n,vm[5]=i,_t(ym,e,vm),ym[4]-=n,ym[5]-=i,e=ym),this.setLocalTransform(e)}},t.prototype.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},t.prototype.transformCoordToLocal=function(t,e){var n=[t,e],i=this.invTransform;return i&&et(n,n,i),n},t.prototype.transformCoordToGlobal=function(t,e){var n=[t,e],i=this.transform;return i&&et(n,n,i),n},t.prototype.getLineScale=function(){var t=this.transform;return t&&_m(t[0]-1)>1e-10&&_m(t[3]-1)>1e-10?Math.sqrt(_m(t[0]*t[3]-t[2]*t[1])):1},t.prototype.copyTransform=function(t){Ve(this,t)},t.getLocalTransform=function(t,e){e=e||[];var n=t.originX||0,i=t.originY||0,o=t.scaleX,r=t.scaleY,a=t.anchorX,s=t.anchorY,l=t.rotation||0,u=t.x,h=t.y,c=t.skewX?Math.tan(t.skewX):0,d=t.skewY?Math.tan(-t.skewY):0;if(n||i||a||s){var p=n+a,f=i+s;e[4]=-p*o-c*f*r,e[5]=-f*r-d*p*o}else e[4]=e[5]=0;return e[0]=o,e[3]=r,e[1]=d*o,e[2]=c*r,l&&wt(e,e,l),e[4]+=n+u,e[5]+=i+h,e},t.initDefaultProps=((e=t.prototype).scaleX=e.scaleY=e.globalScaleRatio=1,void(e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0)),t}(),wm=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];const bm=xm;var Sm,Tm=0,Mm=5,Cm="__zr_normal__",km=wm.concat(["ignore"]),Im=p(wm,function(t,e){return t[e]=!0,t},{ignore:!1}),Lm={},Pm=new lg(0,0,0,0),Dm=[],Am=function(){function t(t){this.id=n(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return t.prototype._init=function(t){this.attr(t)},t.prototype.drift=function(t,e,n){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=e,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,o=e.innerTransformable,r=void 0,a=void 0,s=!1;o.parent=i?this:null;var l=!1;o.copyTransform(e);var u=null!=n.position,h=n.autoOverflowArea,c=void 0;if((h||u)&&((c=Pm).copy(n.layoutRect?n.layoutRect:this.getBoundingRect()),i||c.applyTransform(this.transform)),u){this.calculateTextPosition?this.calculateTextPosition(Lm,n,c):Ke(Lm,n,c),o.x=Lm.x,o.y=Lm.y,r=Lm.align,a=Lm.verticalAlign;var d=n.origin;if(d&&null!=n.rotation){var p=void 0,f=void 0;"center"===d?(p=.5*c.width,f=.5*c.height):(p=qe(d[0],c.width),f=qe(d[1],c.height)),l=!0,o.originX=-o.x+p+(i?0:c.x),o.originY=-o.y+f+(i?0:c.y)}}null!=n.rotation&&(o.rotation=n.rotation);var g=n.offset;g&&(o.x+=g[0],o.y+=g[1],l||(o.originX=-g[0],o.originY=-g[1]));var m=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(h){var y=m.overflowRect=m.overflowRect||new lg(0,0,0,0);o.getLocalTransform(Dm),bt(Dm,Dm),lg.copy(y,c),y.applyTransform(Dm)}else m.overflowRect=null;var v=void 0,_=void 0,x=void 0;(null==n.inside?"string"==typeof n.position&&n.position.indexOf("inside")>=0:n.inside)&&this.canBeInsideText()?(_=n.insideStroke,null!=(v=n.insideFill)&&"auto"!==v||(v=this.getInsideTextFill()),null!=_&&"auto"!==_||(_=this.getInsideTextStroke(v),x=!0)):(_=n.outsideStroke,null!=(v=n.outsideFill)&&"auto"!==v||(v=this.getOutsideFill()),null!=_&&"auto"!==_||(_=this.getOutsideStroke(v),x=!0)),(v=v||"#000")===m.fill&&_===m.stroke&&x===m.autoStroke&&r===m.align&&a===m.verticalAlign||(s=!0,m.fill=v,m.stroke=_,m.autoStroke=x,m.align=r,m.verticalAlign=a,e.setDefaultTextStyle(m)),e.__dirty|=1,s&&e.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(t){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?pm:dm},t.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),n="string"==typeof e&&oe(e);n||(n=[255,255,255,1]);for(var i=n[3],o=this.__zr.isDarkMode(),r=0;r<3;r++)n[r]=n[r]*i+(o?0:255)*(1-i);return n[3]=1,le(n,"rgba")},t.prototype.traverse=function(t,e){},t.prototype.attrKV=function(t,e){"textConfig"===t?this.setTextConfig(e):"textContent"===t?this.setTextContent(e):"clipPath"===t?this.setClipPath(e):"extra"===t?(this.extra=this.extra||{},a(this.extra,e)):this[t]=e},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(b(t))for(var n=g(t),i=0;i0},t.prototype.getState=function(t){return this.states[t]},t.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},t.prototype.clearStates=function(t){this.useState(Cm,!1,t)},t.prototype.useState=function(t,e,n,o){var r=t===Cm;if(this.hasState()||!r){var a=this.currentStates,s=this.stateTransition;if(!(l(a,t)>=0)||!e&&1!==a.length){var u;if(this.stateProxy&&!r&&(u=this.stateProxy(t)),u||(u=this.states&&this.states[t]),u||r){r||this.saveCurrentToNormalState(u);var h=!!(u&&u.hoverLayer||o);h&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,u,this._normalState,e,!n&&!this.__inHover&&s&&s.duration>0,s);var c=this._textContent,d=this._textGuide;return c&&c.useState(t,e,n,h),d&&d.useState(t,e,n,h),r?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),u}i("State "+t+" not exists.")}}},t.prototype.useStates=function(t,e,n){if(t.length){var i=[],o=this.currentStates,r=t.length,a=r===o.length;if(a)for(var s=0;s0,p);var f=this._textContent,g=this._textGuide;f&&f.useStates(t,e,c),g&&g.useStates(t,e,c),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}else this.clearStates()},t.prototype.isSilent=function(){for(var t=this;t;){if(t.silent)return!0;var e=t.__hostTarget;t=e?t.ignoreHostSilent?null:e:t.parent}return!1},t.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var n=this.currentStates.slice();n.splice(e,1),this.useStates(n)}},t.prototype.replaceState=function(t,e,n){var i=this.currentStates.slice(),o=l(i,t),r=l(i,e)>=0;o>=0?r?i.splice(o,1):i[o]=e:n&&!r&&i.push(e),this.useStates(i)},t.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},t.prototype._mergeStates=function(t){for(var e,n={},i=0;i=0&&e.splice(n,1)}),this.animators.push(t),n&&n.animation.addAnimator(t),n&&n.wakeUp()},t.prototype.updateDuringAnimation=function(t){this.markRedraw()},t.prototype.stopAnimation=function(t,e){for(var n=this.animators,i=n.length,o=[],r=0;r=0&&(n.splice(i,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,e){var n=l(this._children,t);return n>=0&&this.replaceAt(e,n),this},e.prototype.replaceAt=function(t,e){var n=this._children,i=n[e];if(t&&t!==this&&t.parent!==this&&t!==i){n[e]=t,i.parent=null;var o=this.__zr;o&&i.removeSelfFromZr(o),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__zr;e&&e!==t.__zr&&t.addSelfToZr(e),e&&e.refresh()},e.prototype.remove=function(t){var e=this.__zr,n=this._children,i=l(n,t);return i<0||(n.splice(i,1),t.parent=null,e&&t.removeSelfFromZr(e),e&&e.refresh()),this},e.prototype.removeAll=function(){for(var t=this._children,e=this.__zr,n=0;n0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},t.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover())},t.prototype.resize=function(t){this._disposed||(this.painter.resize((t=t||{}).width,t.height),this.handler.resize())},t.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},t.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},t.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},t.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},t.prototype.findHover=function(t,e){if(!this._disposed)return this.handler.findHover(t,e)},t.prototype.on=function(t,e,n){return this._disposed||this.handler.on(t,e,n),this},t.prototype.off=function(t,e){this._disposed||this.handler.off(t,e)},t.prototype.trigger=function(t,e){this._disposed||this.handler.trigger(t,e)},t.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),e=0;e0?t.length:0,this.item=null,this.key=NaN,this},t.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)}}(),"___EC__COMPONENT__CONTAINER___"),Qm="___EC__EXTENDED_CLASS___",ty=Math.round(10*Math.random()),ey=Vn([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),ny=function(){function t(){}return t.prototype.getAreaStyle=function(t,e){return ey(this,t,e)},t}(),iy=new Rg(50),oy=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,ry=function(){},ay=function(t){this.tokens=[],t&&(this.tokens=t)},sy=function(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1},ly=p(",&?/;] ".split(""),function(t,e){return t[e]=!0,t},{}),uy=new lg(0,0,0,0),hy={outIntersectRect:{},clamp:!0},cy="__zr_style_"+Math.round(10*Math.random()),dy={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},py={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};dy[cy]=!0;var fy=["z","z2","invisible"],gy=["invisible"],my=function(t){function e(e){return t.call(this,e)||this}var n;return W(e,t),e.prototype._init=function(e){for(var n=g(e),i=0;i0&&(this._ux=Zy(n/cm/t)||0,this._uy=Zy(n/cm/e)||0)},t.prototype.setDPR=function(t){this.dpr=t},t.prototype.setContext=function(t){this._ctx=t},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(Py.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},t.prototype.lineTo=function(t,e){var n=Zy(t-this._xi),i=Zy(e-this._yi),o=n>this._ux||i>this._uy;if(this.addData(Py.L,t,e),this._ctx&&o&&this._ctx.lineTo(t,e),o)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var r=n*n+i*i;r>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=r)}return this},t.prototype.bezierCurveTo=function(t,e,n,i,o,r){return this._drawPendingPt(),this.addData(Py.C,t,e,n,i,o,r),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,o,r),this._xi=o,this._yi=r,this},t.prototype.quadraticCurveTo=function(t,e,n,i){return this._drawPendingPt(),this.addData(Py.Q,t,e,n,i),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this._xi=n,this._yi=i,this},t.prototype.arc=function(t,e,n,i,o,r){return this._drawPendingPt(),Gy[0]=i,Gy[1]=o,function(t,e){var n=ai(t[0]);n<0&&(n+=Wy);var i=t[1];i+=n-t[0],!e&&i-n>=Wy?i=n+Wy:e&&n-i>=Wy?i=n-Wy:!e&&n>i?i=n+(Wy-ai(n-i)):e&&n0&&r))for(var a=0;au.length&&(this._expandData(),u=this.data);for(var h=0;h0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e11&&(this.data=new Float32Array(t)))}},t.prototype.getBoundingRect=function(){Oy[0]=Oy[1]=Ey[0]=Ey[1]=Number.MAX_VALUE,zy[0]=zy[1]=Ry[0]=Ry[1]=-Number.MAX_VALUE;var t,e=this.data,n=0,i=0,o=0,r=0;for(t=0;tn||Zy(m)>i||c===e-1)&&(f=Math.sqrt(L*L+m*m),o=g,r=_);break;case Py.C:var y=t[c++],v=t[c++],_=(g=t[c++],t[c++]),x=t[c++],w=t[c++];f=Wt(o,r,y,v,g,_,x,w,10),o=x,r=w;break;case Py.Q:f=Xt(o,r,y=t[c++],v=t[c++],g=t[c++],_=t[c++],10),o=g,r=_;break;case Py.A:var b=t[c++],S=t[c++],T=t[c++],M=t[c++],C=t[c++],k=t[c++],I=k+C;c+=1,p&&(a=Fy(C)*T+b,s=Vy(C)*M+S),f=Ny(T,M)*By(Wy,Math.abs(k)),o=Fy(I)*T+b,r=Vy(I)*M+S;break;case Py.R:a=o=t[c++],s=r=t[c++],f=2*t[c++]+2*t[c++];break;case Py.Z:var L=a-o;m=s-r,f=Math.sqrt(L*L+m*m),o=a,r=s}f>=0&&(l[h++]=f,u+=f)}return this._pathLen=u,u},t.prototype.rebuildPath=function(t,e){var n,i,o,r,a,s,l,u,h,c,d=this.data,p=this._ux,f=this._uy,g=this._len,m=e<1,y=0,v=0,_=0;if(!m||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=e*this._pathLen))t:for(var x=0;x0&&(t.lineTo(h,c),_=0),w){case Py.M:n=o=d[x++],i=r=d[x++],t.moveTo(o,r);break;case Py.L:a=d[x++],s=d[x++];var S=Zy(a-o),T=Zy(s-r);if(S>p||T>f){if(m){if(y+(Y=l[v++])>u){t.lineTo(o*(1-(X=(u-y)/Y))+a*X,r*(1-X)+s*X);break t}y+=Y}t.lineTo(a,s),o=a,r=s,_=0}else{var M=S*S+T*T;M>_&&(h=a,c=s,_=M)}break;case Py.C:var C=d[x++],k=d[x++],I=d[x++],L=d[x++],P=d[x++],D=d[x++];if(m){if(y+(Y=l[v++])>u){Ht(o,C,I,P,X=(u-y)/Y,Dy),Ht(r,k,L,D,X,Ay),t.bezierCurveTo(Dy[1],Ay[1],Dy[2],Ay[2],Dy[3],Ay[3]);break t}y+=Y}t.bezierCurveTo(C,k,I,L,P,D),o=P,r=D;break;case Py.Q:if(C=d[x++],k=d[x++],I=d[x++],L=d[x++],m){if(y+(Y=l[v++])>u){Yt(o,C,I,X=(u-y)/Y,Dy),Yt(r,k,L,X,Ay),t.quadraticCurveTo(Dy[1],Ay[1],Dy[2],Ay[2]);break t}y+=Y}t.quadraticCurveTo(C,k,I,L),o=I,r=L;break;case Py.A:var A=d[x++],O=d[x++],z=d[x++],E=d[x++],R=d[x++],B=d[x++],N=d[x++],F=!d[x++],V=z>E?z:E,Z=Zy(z-E)>.001,H=R+B,W=!1;if(m&&(y+(Y=l[v++])>u&&(H=R+B*(u-y)/Y,W=!0),y+=Y),Z&&t.ellipse?t.ellipse(A,O,z,E,N,R,H,F):t.arc(A,O,V,R,H,F),W)break t;b&&(n=Fy(R)*z+A,i=Vy(R)*E+O),o=Fy(H)*z+A,r=Vy(H)*E+O;break;case Py.R:n=o=d[x],i=r=d[x+1],a=d[x++],s=d[x++];var j=d[x++],G=d[x++];if(m){if(y+(Y=l[v++])>u){var U=u-y;t.moveTo(a,s),t.lineTo(a+By(U,j),s),(U-=j)>0&&t.lineTo(a+j,s+By(U,G)),(U-=G)>0&&t.lineTo(a+Ny(j-U,0),s+G),(U-=j)>0&&t.lineTo(a,s+Ny(G-U,0));break t}y+=Y}t.rect(a,s,j,G);break;case Py.Z:if(m){var Y;if(y+(Y=l[v++])>u){var X;t.lineTo(o*(1-(X=(u-y)/Y))+n*X,r*(1-X)+i*X);break t}y+=Y}t.closePath(),o=n,r=i}}},t.prototype.clone=function(){var e=new t,n=this.data;return e.data=n.slice?n.slice():Array.prototype.slice.call(n),e._len=this._len,e},t.prototype.canSave=function(){return!!this._saveData},t.CMD=Py,t.initDefaultProps=((e=t.prototype)._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,void(e._version=0)),t}();const Yy=Uy;var Xy=2*Math.PI,qy=2*Math.PI,Ky=Yy.CMD,$y=2*Math.PI,Jy=[-1,-1,-1],Qy=[-1,-1],tv=s({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},dy),ev={style:s({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},py.style)},nv=wm.concat(["invisible","culling","z","z2","zlevel","parent"]),iv=function(t){function e(e){return t.call(this,e)||this}var n;return W(e,t),e.prototype.update=function(){var n=this;t.prototype.update.call(this);var i=this.style;if(i.decal){var o=this._decalEl=this._decalEl||new e;o.buildPath===e.prototype.buildPath&&(o.buildPath=function(t){n.buildPath(t,n.shape)}),o.silent=!0;var r=o.style;for(var a in i)r[a]!==i[a]&&(r[a]=i[a]);r.fill=i.fill?i.decal:null,r.decal=null,r.shadowColor=null,i.strokeFirst&&(r.stroke=null);for(var s=0;s.5?dm:e>.2?"#eee":pm}if(t)return pm}return dm},e.prototype.getInsideTextStroke=function(t){var e=this.style.fill;if(_(e)){var n=this.__zr;if(!(!n||!n.isDarkMode())==ue(t,0)<.4)return e}},e.prototype.buildPath=function(t,e,n){},e.prototype.pathUpdated=function(){this.__dirty&=-5},e.prototype.getUpdatedPathProxy=function(t){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,t),this.path},e.prototype.createPathProxy=function(){this.path=new Yy(!1)},e.prototype.hasStroke=function(){var t=this.style,e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))},e.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},e.prototype.getBoundingRect=function(){var t=this._rect,e=this.style,n=!t;if(n){var i=!1;this.path||(i=!0,this.createPathProxy());var o=this.path;(i||4&this.__dirty)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),t=o.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var r=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||n){r.copy(t);var a=e.strokeNoScale?this.getLineScale():1,s=e.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;s=Math.max(s,null==l?4:l)}a>1e-10&&(r.width+=s/a,r.height+=s/a,r.x-=s/a/2,r.y-=s/a/2)}return r}return t},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect(),o=this.style;if(i.contain(t=n[0],e=n[1])){var r=this.path;if(this.hasStroke()){var a=o.lineWidth,s=o.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),function(t,e,n,i){return yi(t,e,!0,n,i)}(r,a/s,t,e)))return!0}if(this.hasFill())return function(t,e,n){return yi(t,0,!1,e,n)}(r,t,e)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():"shape"===t?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(e,n){"shape"===e?this.setShape(n):t.prototype.attrKV.call(this,e,n)},e.prototype.setShape=function(t,e){var n=this.shape;return n||(n=this.shape={}),"string"==typeof t?n[t]=e:a(n,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(4&this.__dirty)},e.prototype.createStyle=function(t){return F(tv,t)},e.prototype._innerSaveToNormal=function(e){t.prototype._innerSaveToNormal.call(this,e);var n=this._normalState;e.shape&&!n.shape&&(n.shape=a({},this.shape))},e.prototype._applyStateObj=function(e,n,i,o,r,s){t.prototype._applyStateObj.call(this,e,n,i,o,r,s);var l,u=!(n&&o);if(n&&n.shape?r?o?l=n.shape:(l=a({},i.shape),a(l,n.shape)):(l=a({},o?this.shape:i.shape),a(l,n.shape)):u&&(l=i.shape),l)if(r){this.shape=a({},this.shape);for(var h={},c=g(l),d=0;du&&(n*=u/(a=n+i),i*=u/a),o+r>u&&(o*=u/(a=o+r),r*=u/a),i+o>h&&(i*=h/(a=i+o),o*=h/a),n+r>h&&(n*=h/(a=n+r),r*=h/a),t.moveTo(s+n,l),t.lineTo(s+u-i,l),0!==i&&t.arc(s+u-i,l+i,i,-Math.PI/2,0),t.lineTo(s+u,l+h-o),0!==o&&t.arc(s+u-o,l+h-o,o,0,Math.PI/2),t.lineTo(s+r,l+h),0!==r&&t.arc(s+r,l+h-r,r,Math.PI/2,Math.PI),t.lineTo(s,l+n),0!==n&&t.arc(s+n,l+n,n,Math.PI,1.5*Math.PI)}(t,e):t.rect(n,i,o,r)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(ov);gv.prototype.type="rect";const mv=gv;var yv={fill:"#000"},vv={},_v={style:s({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},py.style)},xv=function(t){function e(e){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=yv,n.attr(e),n}return W(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var e=0;ey&&p){var _=Math.floor(y/d);f=f||m.length>_,v=(m=m.slice(0,_)).length*d}if(o&&h&&null!=g)for(var x=Un(g,u,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),w={},b=0;b0,M=0;Mm&&qn(a,s.substring(m,y),e,g),qn(a,p[2],e,g,p[1]),m=oy.lastIndex}md){var R=a.lines.length;I>0?(M.tokens=M.tokens.slice(0,I),r(M,k,C),a.lines=a.lines.slice(0,T+1)):a.lines=a.lines.slice(0,T),a.isTruncated=a.isTruncated||a.lines.length=0&&"right"===(k=_[C]).align;)this._placeToken(k,t,w,f,M,"right",m),b-=k.width,M-=k.width,C--;for(T+=(s-(T-p)-(g-M)-b)/2;S<=C;)this._placeToken(k=_[S],t,w,f,T+k.width/2,"center",m),T+=k.width,S++;f+=w}},e.prototype._placeToken=function(t,e,n,i,o,r,a){var s=e.rich[t.styleName]||{};s.text=t.text;var l=t.verticalAlign,u=i+n/2;"top"===l?u=i+t.height/2:"bottom"===l&&(u=i+n-t.height/2),!t.isLineHolder&&Li(s)&&this._renderBackground(s,e,"right"===r?o-t.width:"center"===r?o-t.width/2:o,u-t.height/2,t.width,t.height);var h=!!s.backgroundColor,c=t.textPadding;c&&(o=ki(o,r,c),u-=t.height/2-c[0]-t.innerHeight/2);var d=this._getOrCreateChild(sv),p=d.createStyle();d.useStyle(p);var f=this._defaultStyle,g=!1,m=0,y=!1,v=Ci("fill"in s?s.fill:"fill"in e?e.fill:(g=!0,f.fill)),_=Mi("stroke"in s?s.stroke:"stroke"in e?e.stroke:h||a||f.autoStroke&&!g?null:(m=2,y=!0,f.stroke)),x=s.textShadowBlur>0||e.textShadowBlur>0;p.text=t.text,p.x=o,p.y=u,x&&(p.shadowBlur=s.textShadowBlur||e.textShadowBlur||0,p.shadowColor=s.textShadowColor||e.textShadowColor||"transparent",p.shadowOffsetX=s.textShadowOffsetX||e.textShadowOffsetX||0,p.shadowOffsetY=s.textShadowOffsetY||e.textShadowOffsetY||0),p.textAlign=r,p.textBaseline="middle",p.font=t.font||of,p.opacity=P(s.opacity,e.opacity,1),bi(p,s),_&&(p.lineWidth=P(s.lineWidth,e.lineWidth,m),p.lineDash=L(s.lineDash,e.lineDash),p.lineDashOffset=e.lineDashOffset||0,p.stroke=_),v&&(p.fill=v),d.setBoundingRect(ti(p,t.contentWidth,t.contentHeight,y?0:null))},e.prototype._renderBackground=function(t,e,n,i,o,r){var a,s,l,u=t.backgroundColor,h=t.borderWidth,c=t.borderColor,d=u&&u.image,p=u&&!d,f=t.borderRadius,g=this;if(p||t.lineHeight||h&&c){(a=this._getOrCreateChild(mv)).useStyle(a.createStyle()),a.style.fill=null;var m=a.shape;m.x=n,m.y=i,m.width=o,m.height=r,m.r=f,a.dirtyShape()}if(p)(l=a.style).fill=u||null,l.fillOpacity=L(t.fillOpacity,1);else if(d){(s=this._getOrCreateChild(cv)).onload=function(){g.dirtyStyle()};var y=s.style;y.image=u.image,y.x=n,y.y=i,y.width=o,y.height=r}h&&c&&((l=a.style).lineWidth=h,l.stroke=c,l.strokeOpacity=L(t.strokeOpacity,1),l.lineDash=t.borderDash,l.lineDashOffset=t.borderDashOffset||0,a.strokeContainThreshold=0,a.hasFill()&&a.hasStroke()&&(l.strokeFirst=!0,l.lineWidth*=2));var v=(a||s).style;v.shadowBlur=t.shadowBlur||0,v.shadowColor=t.shadowColor||"transparent",v.shadowOffsetX=t.shadowOffsetX||0,v.shadowOffsetY=t.shadowOffsetY||0,v.opacity=P(t.opacity,e.opacity,1)},e.makeFont=function(t){var e="";return Si(t)&&(e=[t.fontStyle,t.fontWeight,wi(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),e&&z(e)||t.textFont||t.font},e}(_y),wv={left:!0,right:1,center:1},bv={top:1,bottom:1,middle:1},Sv=["fontStyle","fontWeight","fontSize","fontFamily"];const Tv=xv;var Mv=Ln(),Cv=1,kv={},Iv=Ln(),Lv=Ln(),Pv=["emphasis","blur","select"],Dv=["normal","emphasis","blur","select"],Av="highlight",Ov="downplay",zv="select",Ev="unselect",Rv="toggleSelect",Bv="selectchanged",Nv={},Fv=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],Vv=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],Zv=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],Hv=Ln(),Wv={minMargin:1,textMargin:2},jv=["textStyle","color"],Gv=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],Uv=new Tv;const Yv=function(){function t(){}return t.prototype.getTextColor=function(t){var e=this.ecModel;return this.getShallow("color")||(!t&&e?e.get(jv):null)},t.prototype.getFont=function(){return go({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},t.prototype.getTextRect=function(t){for(var e={text:t,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},n=0;n-1?r_:s_;yo(a_,{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:". "}}}}),yo(r_,{time:{month:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"],monthAbbr:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],dayOfWeek:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],dayOfWeekAbbr:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"]},legend:{selector:{all:"\u5168\u9009",inverse:"\u53cd\u9009"}},toolbox:{brush:{title:{rect:"\u77e9\u5f62\u9009\u62e9",polygon:"\u5708\u9009",lineX:"\u6a2a\u5411\u9009\u62e9",lineY:"\u7eb5\u5411\u9009\u62e9",keep:"\u4fdd\u6301\u9009\u62e9",clear:"\u6e05\u9664\u9009\u62e9"}},dataView:{title:"\u6570\u636e\u89c6\u56fe",lang:["\u6570\u636e\u89c6\u56fe","\u5173\u95ed","\u5237\u65b0"]},dataZoom:{title:{zoom:"\u533a\u57df\u7f29\u653e",back:"\u533a\u57df\u7f29\u653e\u8fd8\u539f"}},magicType:{title:{line:"\u5207\u6362\u4e3a\u6298\u7ebf\u56fe",bar:"\u5207\u6362\u4e3a\u67f1\u72b6\u56fe",stack:"\u5207\u6362\u4e3a\u5806\u53e0",tiled:"\u5207\u6362\u4e3a\u5e73\u94fa"}},restore:{title:"\u8fd8\u539f"},saveAsImage:{title:"\u4fdd\u5b58\u4e3a\u56fe\u7247",lang:["\u53f3\u952e\u53e6\u5b58\u4e3a\u56fe\u7247"]}},series:{typeNames:{pie:"\u997c\u56fe",bar:"\u67f1\u72b6\u56fe",line:"\u6298\u7ebf\u56fe",scatter:"\u6563\u70b9\u56fe",effectScatter:"\u6d9f\u6f2a\u6563\u70b9\u56fe",radar:"\u96f7\u8fbe\u56fe",tree:"\u6811\u56fe",treemap:"\u77e9\u5f62\u6811\u56fe",boxplot:"\u7bb1\u578b\u56fe",candlestick:"K\u7ebf\u56fe",k:"K\u7ebf\u56fe",heatmap:"\u70ed\u529b\u56fe",map:"\u5730\u56fe",parallel:"\u5e73\u884c\u5750\u6807\u56fe",lines:"\u7ebf\u56fe",graph:"\u5173\u7cfb\u56fe",sankey:"\u6851\u57fa\u56fe",funnel:"\u6f0f\u6597\u56fe",gauge:"\u4eea\u8868\u76d8\u56fe",pictorialBar:"\u8c61\u5f62\u67f1\u56fe",themeRiver:"\u4e3b\u9898\u6cb3\u6d41\u56fe",sunburst:"\u65ed\u65e5\u56fe",custom:"\u81ea\u5b9a\u4e49\u56fe\u8868",chart:"\u56fe\u8868"}},aria:{general:{withTitle:"\u8fd9\u662f\u4e00\u4e2a\u5173\u4e8e\u201c{title}\u201d\u7684\u56fe\u8868\u3002",withoutTitle:"\u8fd9\u662f\u4e00\u4e2a\u56fe\u8868\uff0c"},series:{single:{prefix:"",withName:"\u56fe\u8868\u7c7b\u578b\u662f{seriesType}\uff0c\u8868\u793a{seriesName}\u3002",withoutName:"\u56fe\u8868\u7c7b\u578b\u662f{seriesType}\u3002"},multiple:{prefix:"\u5b83\u7531{seriesCount}\u4e2a\u56fe\u8868\u7cfb\u5217\u7ec4\u6210\u3002",withName:"\u7b2c{seriesId}\u4e2a\u7cfb\u5217\u662f\u4e00\u4e2a\u8868\u793a{seriesName}\u7684{seriesType}\uff0c",withoutName:"\u7b2c{seriesId}\u4e2a\u7cfb\u5217\u662f\u4e00\u4e2a{seriesType}\uff0c",separator:{middle:"\uff1b",end:"\u3002"}}},data:{allData:"\u5176\u6570\u636e\u662f\u2014\u2014",partialData:"\u5176\u4e2d\uff0c\u524d{displayCnt}\u9879\u662f\u2014\u2014",withName:"{name}\u7684\u6570\u636e\u662f{value}",withoutName:"{value}",separator:{middle:"\uff0c",end:""}}}});var c_=null,d_=1e3,p_=6e4,f_=36e5,g_=864e5,m_=31536e6,y_={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})/},v_={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},__="{yyyy}-{MM}-{dd}",x_={year:"{yyyy}",month:"{yyyy}-{MM}",day:__,hour:__+" "+v_.hour,minute:__+" "+v_.minute,second:__+" "+v_.second,millisecond:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},w_=["year","month","day","hour","minute","second","millisecond"],b_=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"],S_=A,T_=["a","b","c","d","e","f","g"],M_=function(t,e){return"{"+t+(null==e?"":e)+"}"},C_={},k_={},I_=function(){function t(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return t.prototype.create=function(t,e){function n(n,i){var o=[];return c(n,function(n,i){var r=n.create(t,e);o=o.concat(r||[])}),o}this._nonSeriesBoxMasterList=n(C_),this._normalMasterList=n(k_)},t.prototype.update=function(t,e){c(this._normalMasterList,function(n){n.update&&n.update(t,e)})},t.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},t.register=function(t,e){"matrix"!==t&&"calendar"!==t?k_[t]=e:C_[t]=e},t.get=function(t){return k_[t]||C_[t]},t}(),L_=1,P_=2,D_=B(),A_=0,O_=1,z_=2;const E_=I_;var R_=c,B_=["left","right","top","bottom","width","height"],N_=[["width","left","right"],["height","top","bottom"]],F_=Uo,V_=(m(Uo,"vertical"),m(Uo,"horizontal"),{rect:1,point:2}),Z_=Ln(),H_=function(t){function n(e,n,i){var o=t.call(this,e,n,i)||this;return o.uid=mo("ec_cpt_model"),o}var i;return e(n,t),n.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n)},n.prototype.mergeDefaultAndTheme=function(t,e){var n=Ko(this),i=n?Jo(t):{};r(t,e.getTheme().get(this.mainType)),r(t,this.getDefaultOption()),n&&$o(t,i,n)},n.prototype.mergeOption=function(t,e){r(this.option,t,!0);var n=Ko(this);n&&$o(this.option,t,n)},n.prototype.optionUpdated=function(t,e){},n.prototype.getDefaultOption=function(){var t=this.constructor;if(!function(t){return!(!t||!t[Qm])}(t))return t.defaultOption;var e=Z_(this);if(!e.defaultOption){for(var n=[],i=t;i;){var o=i.prototype.defaultOption;o&&n.push(o),i=i.superClass}for(var a={},s=n.length-1;s>=0;s--)a=r(a,n[s],!0);e.defaultOption=a}return e.defaultOption},n.prototype.getReferringComponents=function(t,e){var n=t+"Id";return An(this.ecModel,t,{index:this.get(t+"Index",!0),id:this.get(n,!0)},e)},n.prototype.getBoxLayoutParams=function(){return{left:(t=this).getShallow("left",e=!1),top:t.getShallow("top",e),right:t.getShallow("right",e),bottom:t.getShallow("bottom",e),width:t.getShallow("width",e),height:t.getShallow("height",e)};var t,e},n.prototype.getZLevelKey=function(){return""},n.prototype.setZLevel=function(t){this.option.zlevel=t},n.protoInitialize=((i=n.prototype).type="component",i.id="",i.name="",i.mainType="",i.subType="",void(i.componentIndex=0)),n}(i_);Rn(H_,i_),Fn(H_),function(t){var e={};t.registerSubTypeDefaulter=function(t,n){var i=zn(t);e[i.main]=n},t.determineSubType=function(n,i){var o=i.type;if(!o){var r=zn(n).main;t.hasSubTypes(n)&&e[r]&&(o=e[r](i))}return o}}(H_),function(t){function e(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}t.topologicalTravel=function(t,n,i,o){function r(t){u[t].entryCount--,0===u[t].entryCount&&h.push(t)}function a(t){p[t]=!0,r(t)}if(t.length){var s=function(t){var n={},i=[];return c(t,function(o){var r,a,s=e(n,o),u=function(t,e){var n=[];return c(t,function(t){l(e,t)>=0&&n.push(t)}),n}(s.originalDeps=(a=[],c(H_.getClassesByMainType(r=o),function(t){a=a.concat(t.dependencies||t.prototype.dependencies||[])}),a=d(a,function(t){return zn(t).main}),"dataset"!==r&&l(a,"dataset")<=0&&a.unshift("dataset"),a),t);s.entryCount=u.length,0===s.entryCount&&i.push(o),c(u,function(t){l(s.predecessor,t)<0&&s.predecessor.push(t);var i=e(n,t);l(i.successor,t)<0&&i.successor.push(o)})}),{graph:n,noEntryList:i}}(n),u=s.graph,h=s.noEntryList,p={};for(c(t,function(t){p[t]=!0});h.length;){var f=h.pop(),g=u[f],m=!!p[f];m&&(i.call(o,f,g.originalDeps.slice()),delete p[f]),c(g.successor,m?a:r)}c(p,function(){throw new Error("")})}}}(H_);const W_=H_;var j_={color:{},darkColor:{},size:{}},G_=j_.color={theme:["#5070dd","#b6d634","#505372","#ff994d","#0ca8df","#ffd10a","#fb628b","#785db0","#3fbe95"],neutral00:"#fff",neutral05:"#f4f7fd",neutral10:"#e8ebf0",neutral15:"#dbdee4",neutral20:"#cfd2d7",neutral25:"#c3c5cb",neutral30:"#b7b9be",neutral35:"#aaacb2",neutral40:"#9ea0a5",neutral45:"#929399",neutral50:"#86878c",neutral55:"#797b7f",neutral60:"#6d6e73",neutral65:"#616266",neutral70:"#54555a",neutral75:"#48494d",neutral80:"#3c3c41",neutral85:"#303034",neutral90:"#232328",neutral95:"#17171b",neutral99:"#000",accent05:"#eff1f9",accent10:"#e0e4f2",accent15:"#d0d6ec",accent20:"#c0c9e6",accent25:"#b1bbdf",accent30:"#a1aed9",accent35:"#91a0d3",accent40:"#8292cc",accent45:"#7285c6",accent50:"#6578ba",accent55:"#5c6da9",accent60:"#536298",accent65:"#4a5787",accent70:"#404c76",accent75:"#374165",accent80:"#2e3654",accent85:"#252b43",accent90:"#1b2032",accent95:"#121521",transparent:"rgba(0,0,0,0)",highlight:"rgba(255,231,130,0.8)"};for(var U_ in a(G_,{primary:G_.neutral80,secondary:G_.neutral70,tertiary:G_.neutral60,quaternary:G_.neutral50,disabled:G_.neutral20,border:G_.neutral30,borderTint:G_.neutral20,borderShade:G_.neutral40,background:G_.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:G_.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:G_.neutral70,axisLineTint:G_.neutral40,axisTick:G_.neutral70,axisTickMinor:G_.neutral60,axisLabel:G_.neutral70,axisSplitLine:G_.neutral15,axisMinorSplitLine:G_.neutral05}),G_)if(G_.hasOwnProperty(U_)){var Y_=G_[U_];"theme"===U_?j_.darkColor.theme=G_.theme.slice():"highlight"===U_?j_.darkColor.highlight="rgba(255,231,130,0.4)":j_.darkColor[U_]=0===U_.indexOf("accent")?se(Y_,null,function(t){return.5*t},function(t){return Math.min(1,1.3-t)}):se(Y_,null,function(t){return.9*t},function(t){return 1-Math.pow(t,1.5)})}j_.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};const X_=j_;var q_="";"undefined"!=typeof navigator&&(q_=navigator.platform||"");var K_="rgba(0, 0, 0, 0.2)",$_=X_.color.theme[0],J_=se($_,null,null,.9);const Q_={darkMode:"auto",colorBy:"series",color:X_.color.theme,gradientColor:[J_,$_],aria:{decal:{decals:[{color:K_,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:K_,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:K_,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:K_,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:K_,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:K_,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:q_.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 tx,ex,nx,ix=B(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),ox="original",rx="arrayRows",ax="objectRows",sx="keyedColumns",lx="typedArray",ux="unknown",hx="column",cx="row",dx=1,px=2,fx=3,gx=Ln(),mx=B(),yx=Ln(),vx=(Ln(),function(){function t(){}return t.prototype.getColorFromPalette=function(t,e,n){var i=vn(this.get("color",!0)),o=this.get("colorLayer",!0);return function(t,e,n,i,o,r,a){var s=e(r=r||t),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(o))return u[o];var h=null!=a&&i?function(t,e){for(var n=t.length,i=0;ie)return t[i];return t[n-1]}(i,a):n;if((h=h||n)&&h.length){var c=h[l];return o&&(u[o]=c),s.paletteIdx=(l+1)%h.length,c}}(this,yx,i,o,t,e,n)},t.prototype.clearColorPalette=function(){!function(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}(this,yx)},t}()),_x="\0_ec_inner",xx=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.init=function(t,e,n,i,o,r){i=i||{},this.option=null,this._theme=new i_(i),this._locale=new i_(o),this._optionManager=r},n.prototype.setOption=function(t,e,n){var i=rr(e);this._optionManager.setOption(t,n,i),this._resetOption(null,i)},n.prototype.resetOption=function(t,e){return this._resetOption(t,rr(e))},n.prototype._resetOption=function(t,e){var n=!1,i=this._optionManager;if(!t||"recreate"===t){var o=i.mountOption("recreate"===t);this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(o,e)):nx(this,o),n=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var r=i.getTimelineOption(this);r&&(n=!0,this._mergeOption(r,e))}if(!t||"recreate"===t||"media"===t){var a=i.getMediaOption(this);a.length&&c(a,function(t){n=!0,this._mergeOption(t,e)},this)}return n},n.prototype.mergeOption=function(t){this._mergeOption(t,null)},n.prototype._mergeOption=function(t,e){var n=this.option,i=this._componentsMap,s=this._componentsCount,l=[],u=B(),h=e&&e.replaceMergeMainTypeMap;gx(this).datasetMap=B(),c(t,function(t,e){null!=t&&(W_.hasClass(e)?e&&(l.push(e),u.set(e,!0)):n[e]=null==n[e]?o(t):r(n[e],t,!0))}),h&&h.each(function(t,e){W_.hasClass(e)&&!u.get(e)&&(l.push(e),u.set(e,!0))}),W_.topologicalTravel(l,W_.getAllClassMainTypes(),function(e){var o=function(t,e,n){var i=mx.get(e);if(!i)return n;var o=i(t);return o?n.concat(o):n}(this,e,vn(t[e])),r=i.get(e),l=bn(r,o,r?h&&h.get(e)?"replaceMerge":"normalMerge":"replaceAll");!function(t,e,n){c(t,function(t){var i=t.newOption;b(i)&&(t.keyInfo.mainType=e,t.keyInfo.subType=function(t,e,n,i){return e.type?e.type:n?n.subType:i.determineSubType(t,e)}(e,i,t.existing,n))})}(l,e,W_),n[e]=null,i.set(e,null),s.set(e,0);var u,d=[],p=[],f=0;c(l,function(t,n){var i=t.existing,o=t.newOption;if(o){var r=W_.getClass(e,t.keyInfo.subType,!("series"===e));if(!r)return;if("tooltip"===e){if(u)return;u=!0}if(i&&i.constructor===r)i.name=t.keyInfo.name,i.mergeOption(o,this),i.optionUpdated(o,!1);else{var s=a({componentIndex:n},t.keyInfo);a(i=new r(o,this,this,s),s),t.brandNew&&(i.__requireNewView=!0),i.init(o,this,this),i.optionUpdated(null,!0)}}else i&&(i.mergeOption({},this),i.optionUpdated({},!1));i?(d.push(i.option),p.push(i),f++):(d.push(void 0),p.push(void 0))},this),n[e]=d,i.set(e,p),s.set(e,f),"series"===e&&tx(this)},this),this._seriesIndices||tx(this)},n.prototype.getOption=function(){var t=o(this.option);return c(t,function(e,n){if(W_.hasClass(n)){for(var i=vn(e),o=i.length,r=!1,a=o-1;a>=0;a--)i[a]&&!kn(i[a])?r=!0:(i[a]=null,!r&&o--);i.length=o,t[n]=i}}),delete t[_x],t},n.prototype.setTheme=function(t){this._theme=new i_(t),this._resetOption("recreate",null)},n.prototype.getTheme=function(){return this._theme},n.prototype.getLocaleModel=function(){return this._locale},n.prototype.setUpdatePayload=function(t){this._payload=t},n.prototype.getUpdatePayload=function(){return this._payload},n.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){var i=n[e||0];if(i)return i;if(null==e)for(var o=0;ou&&(u=p)}s[0]=l,s[1]=u}},o=function(){return this._data?this._data.length/this._dimSize:0};(e={})[rx+"_"+hx]={pure:!0,appendData:t},e[rx+"_"+cx]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[ax]={pure:!0,appendData:t},e[sx]={pure:!0,appendData:function(t){var e=this._data;c(t,function(t,n){for(var i=e[n]||(e[n]=[]),o=0;o<(t||[]).length;o++)i.push(t[o])})}},e[ox]={appendData:t},e[lx]={persistent:!1,pure:!0,appendData:function(t){this._data=t},clean:function(){this._offset+=this.count(),this._data=null}},Ax=e}(),t}(),Gx=function(t){y(t)||kr("series.data or dataset.source must be an array.")},Ux=((Ix={})[rx+"_"+hx]=Gx,Ix[rx+"_"+cx]=Gx,Ix[ax]=Gx,Ix[sx]=function(t,e){for(var n=0;n=0&&(s=r.interpolatedValue[l])}return null!=s?s+"":""}):void 0},t.prototype.getRawValue=function(t,e){return Or(this.getData(e),t)},t.prototype.formatTooltip=function(t,e,n){},t}(),tw=function(){function t(t){this._reset=(t=t||{}).reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return t.prototype.perform=function(t){function e(t){return!(t>=1)&&(t=1),t}var n,i=this._upstream,o=t&&t.skip;if(this._dirty&&i){var r=this.context;r.data=r.outputData=i.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!o&&(n=this._plan(this.context));var a,s=e(this._modBy),l=this._modDataCount||0,u=e(t&&t.modBy),h=t&&t.modDataCount||0;s===u&&l===h||(n="reset"),(this._dirty||"reset"===n)&&(this._dirty=!1,a=this._doReset(o)),this._modBy=u,this._modDataCount=h;var c=t&&t.step;if(this._dueEnd=i?i._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,p=Math.min(null!=c?this._dueIndex+c:1/0,this._dueEnd);if(!o&&(a||d=n?null:t1&&r>0?e:t}};return s}(),nw=(B({number:function(t){return parseFloat(t)},time:function(t){return+cn(t)},trim:function(t){return _(t)?z(t):t}}),function(){function t(t,e){var n="desc"===t;this._resultLT=n?1:-1,null==e&&(e=n?"min":"max"),this._incomparable="min"===e?-1/0:1/0}return t.prototype.evaluate=function(t,e){var n=w(t)?t:fn(t),i=w(e)?e:fn(e),o=isNaN(n),r=isNaN(i);if(o&&(n=this._incomparable),r&&(i=this._incomparable),o&&r){var a=_(t),s=_(e);a&&(n=s?t:0),s&&(i=a?e:0)}return ni?-this._resultLT:0},t}()),iw=function(){function t(){}return t.prototype.getRawData=function(){throw new Error("not supported")},t.prototype.getRawDataItem=function(t){throw new Error("not supported")},t.prototype.cloneRawData=function(){},t.prototype.getDimensionInfo=function(t){},t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},t.prototype.retrieveValue=function(t,e){},t.prototype.retrieveValueFromItem=function(t,e){},t.prototype.convertValue=function(t,e){return Rr(t,e)},t}(),ow=B(),rw="undefined",aw=typeof Uint32Array===rw?Array:Uint32Array,sw=typeof Uint16Array===rw?Array:Uint16Array,lw=typeof Int32Array===rw?Array:Int32Array,uw=typeof Float64Array===rw?Array:Float64Array,hw={float:uw,int:lw,ordinal:Array,number:Array,time:uw},cw=function(){function t(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=B()}return t.prototype.initData=function(t,e,n){this._provider=t,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var i=t.getSource(),o=this.defaultDimValueGetter=zx[i.sourceFormat];this._dimValueGetter=n||o,this._rawExtent=[],Cr(i),this._dimensions=d(e,function(t){return{type:t.type,property:t.property}}),this._initDataFromProvider(0,t.count())},t.prototype.getProvider=function(){return this._provider},t.prototype.getSource=function(){return this._provider.getSource()},t.prototype.ensureCalculationDimension=function(t,e){var n=this._calcDimNameToIdx,i=this._dimensions,o=n.get(t);if(null!=o){if(i[o].type===e)return o}else o=i.length;return i[o]={type:e},n.set(t,o),this._chunks[o]=new hw[e||"float"](this._rawCount),this._rawExtent[o]=[1/0,-1/0],o},t.prototype.collectOrdinalMeta=function(t,e){var n=this._chunks[t],i=this._dimensions[t],o=this._rawExtent,r=i.ordinalOffset||0,a=n.length;0===r&&(o[t]=[1/0,-1/0]);for(var s=o[t],l=r;lf[1]&&(f[1]=p)}return this._rawCount=this._count=s,{start:a,end:s}},t.prototype._initDataFromProvider=function(t,e,n){for(var i=this._provider,o=this._chunks,r=this._dimensions,a=r.length,s=this._rawExtent,l=d(r,function(t){return t.property}),u=0;uy[1]&&(y[1]=m)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=e,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(t,e){if(!(e>=0&&e=0&&e=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&nt))return r;o=r-1}}return-1},t.prototype.getIndices=function(){var t,e=this._indices;if(e){var n=this._count;if((o=e.constructor)===Array){t=new o(n);for(var i=0;i=u&&T<=h||isNaN(T))&&(a[s++]=p),p++;d=!0}else if(2===o){f=c[i[0]];var y=c[i[1]],v=t[i[1]][0],_=t[i[1]][1];for(m=0;m=u&&T<=h||isNaN(T))&&(x>=v&&x<=_||isNaN(x))&&(a[s++]=p),p++}d=!0}}if(!d)if(1===o)for(m=0;m=u&&T<=h||isNaN(T))&&(a[s++]=w)}else for(m=0;mt[M][1])&&(b=!1)}b&&(a[s++]=e.getRawIndex(m))}return sm[1]&&(m[1]=g)}}},t.prototype.lttbDownSample=function(t,e){var n,i,o,r=this.clone([t],!0),a=r._chunks[t],s=this.count(),l=0,u=Math.floor(1/e),h=this.getRawIndex(0),c=new(Wr(this._rawCount))(Math.min(2*(Math.ceil(s/u)+2),s));c[l++]=h;for(var d=1;dn&&(n=i,o=M)}T>0&&Ta&&(f=a-u);for(var g=0;gp&&(p=m,d=u+g)}var y=this.getRawIndex(h),v=this.getRawIndex(d);hu-p&&(a.length=s=u-p);for(var f=0;fh[1]&&(h[1]=m),c[d++]=y}return o._count=d,o._indices=c,o._updateGetRawIdx(),o},t.prototype.each=function(t,e){if(this._count)for(var n=t.length,i=this._chunks,o=0,r=this.count();oa&&(a=l)}return this._extent[t]=i=[r,a],i},t.prototype.getRawDataItem=function(t){var e=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(e);for(var n=[],i=this._chunks,o=0;o=0?this._indices[t]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=function(){function t(t,e,n,i){return Rr(t[i],this._dimensions[i])}zx={arrayRows:t,objectRows:function(t,e,n,i){return Rr(t[e],this._dimensions[i])},keyedColumns:t,original:function(t,e,n,i){var o=t&&(null==t.value?t:t.value);return Rr(o instanceof Array?o[i]:o,this._dimensions[i])},typedArray:function(t,e,n,i){return t[i]}}}(),t}();const dw=cw;var pw=function(){function t(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(t,e){this._sourceList=t,this._upstreamSignList=e,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var t,e,n=this._sourceHost,i=this._getUpstreamSourceManagers(),o=!!i.length;if(Yr(n)){var r=n,a=void 0,s=void 0,l=void 0;if(o){var u=i[0];u.prepareSource(),a=(l=u.getSource()).data,s=l.sourceFormat,e=[u._getVersionSign()]}else s=T(a=r.get("data",!0))?lx:ox,e=[];var h=this._getSourceMetaRawOption()||{},c=l&&l.metaRawOption||{},d=L(h.seriesLayoutBy,c.seriesLayoutBy)||null,p=L(h.sourceHeader,c.sourceHeader),f=L(h.dimensions,c.dimensions);t=d!==c.seriesLayoutBy||!!p!=!!c.sourceHeader||f?[wr(a,{seriesLayoutBy:d,sourceHeader:p,dimensions:f},s)]:[]}else{var g=n;if(o){var m=this._applyTransform(i);t=m.sourceList,e=m.upstreamSignList}else t=[wr(g.get("source",!0),this._getSourceMetaRawOption(),null)],e=[]}this._setLocalSource(t,e)},t.prototype._applyTransform=function(t){var e,n=this._sourceHost,i=n.get("transform",!0),r=n.get("fromTransformResult",!0);null!=r&&1!==t.length&&Xr("");var a,s=[],l=[];return c(t,function(t){t.prepareSource();var e=t.getSource(r||0);null==r||e||Xr(""),s.push(e),l.push(t._getVersionSign())}),i?e=function(t,e){var n=vn(t),i=n.length;i||Ir("");for(var o=0,r=i;o':'':{renderMode:r,content:"{"+(n.markerId||"markerX")+"|} ",style:"subItem"===o?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}:""}({color:e,type:t,renderMode:n,markerId:i});return _(o)?o:(this.richTextStyles[i]=o.style,o.content)},t.prototype.wrapRichTextStyle=function(t,e){var n={};y(e)?c(e,function(t){return a(n,t)}):a(n,e);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},t}(),yw=Ln(),vw=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._selectedDataIndicesMap={},e}var i;return e(n,t),n.prototype.init=function(t,e,n){this.seriesIndex=this.componentIndex,this.dataTask=Er({count:ha,reset:ca}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,n),(yw(this).sourceManager=new pw(this)).prepareSource();var i=this.getInitialData(t,n);pa(i,this),this.dataTask.context.data=i,yw(this).dataBeforeProcessed=i,ua(this),this._initSelectedMapFromData(i)},n.prototype.mergeDefaultAndTheme=function(t,e){var n=Ko(this),i=n?Jo(t):{},o=this.subType;W_.hasClass(o)&&(o+="Series"),r(t,e.getTheme().get(this.subType)),r(t,this.getDefaultOption()),_n(t,"label",["show"]),this.fillDataTextStyle(t.data),n&&$o(t,i,n)},n.prototype.mergeOption=function(t,e){t=r(this.option,t,!0),this.fillDataTextStyle(t.data);var n=Ko(this);n&&$o(this.option,t,n);var i=yw(this).sourceManager;i.dirty(),i.prepareSource();var o=this.getInitialData(t,e);pa(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,yw(this).dataBeforeProcessed=o,ua(this),this._initSelectedMapFromData(o)},n.prototype.fillDataTextStyle=function(t){if(t&&!T(t))for(var e=["show"],n=0;n=0&&h<0)&&(u=r,h=o,c=0),o===h&&(l[c++]=e))}),l.length=c,l},n.prototype.formatTooltip=function(t,e,n){return sa({series:this,dataIndex:t,multipleSeries:e})},n.prototype.isAnimationEnabled=function(){var t=this.ecModel;if(Qp.node&&(!t||!t.ssr))return!1;var e=this.getShallow("animation");return e&&this.getData().count()>this.getShallow("animationThreshold")&&(e=!1),!!e},n.prototype.restoreData=function(){this.dataTask.dirty()},n.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel,o=vx.prototype.getColorFromPalette.call(this,t,e,n);return o||(o=i.getColorFromPalette(t,e,n)),o},n.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},n.prototype.getProgressive=function(){return this.get("progressive")},n.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},n.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},n.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n){var i=this.option.selectedMode,o=this.getData(e);if("series"===i||"all"===n)return this.option.selectedMap={},void(this._selectedDataIndicesMap={});for(var r=0;r=0&&n.push(o)}return n},n.prototype.isSelected=function(t,e){var n=this.option.selectedMap;if(!n)return!1;var i=this.getData(e);return("all"===n||n[la(i,t)])&&!i.getItemModel(t).get(["select","disabled"])},n.prototype.isUniversalTransitionEnabled=function(){if(this.__universalTransitionEnabled)return!0;var t=this.option.universalTransition;return!!t&&(!0===t||t&&t.enabled)},n.prototype._innerSelect=function(t,e){var n,i,o=this.option,r=o.selectedMode,a=e.length;if(r&&a)if("series"===r)o.selectedMap="all";else if("multiple"===r){b(o.selectedMap)||(o.selectedMap={});for(var s=o.selectedMap,l=0;l0&&this._innerSelect(t,e)}},n.registerClass=function(t){return W_.registerClass(t)},n.protoInitialize=((i=n.prototype).type="series.__base__",i.seriesIndex=0,i.ignoreStyleOnData=!1,i.hasSymbolVisual=!1,i.defaultSymbol="circle",i.visualStyleAccessPath="itemStyle",void(i.visualDrawType="fill")),n}(W_);u(vw,Qx),u(vw,vx),Rn(vw,W_);const _w=vw;var xw=function(){function t(){this.group=new Em,this.uid=mo("viewComponent")}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,i){},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,i){},t.prototype.updateLayout=function(t,e,n,i){},t.prototype.updateVisual=function(t,e,n,i){},t.prototype.toggleBlurSeries=function(t,e,n){},t.prototype.eachRendered=function(t){var e=this.group;e&&e.traverse(t)},t}();En(xw),Fn(xw);const ww=xw;var bw=Yy.CMD,Sw=[[],[],[]],Tw=Math.sqrt,Mw=Math.atan2,Cw=Math.sqrt,kw=Math.sin,Iw=Math.cos,Lw=Math.PI,Pw=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Dw=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g,Aw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return W(e,t),e.prototype.applyTransform=function(t){},e}(ov),Ow=function(){this.cx=0,this.cy=0,this.r=0},zw=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new Ow},e.prototype.buildPath=function(t,e){t.moveTo(e.cx+e.r,e.cy),t.arc(e.cx,e.cy,e.r,0,2*Math.PI)},e}(ov);zw.prototype.type="circle";const Ew=zw;var Rw=function(){this.cx=0,this.cy=0,this.rx=0,this.ry=0},Bw=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new Rw},e.prototype.buildPath=function(t,e){var n=.5522848,i=e.cx,o=e.cy,r=e.rx,a=e.ry,s=r*n,l=a*n;t.moveTo(i-r,o),t.bezierCurveTo(i-r,o-l,i-s,o-a,i,o-a),t.bezierCurveTo(i+s,o-a,i+r,o-l,i+r,o),t.bezierCurveTo(i+r,o+l,i+s,o+a,i,o+a),t.bezierCurveTo(i-s,o+a,i-r,o+l,i-r,o),t.closePath()},e}(ov);Bw.prototype.type="ellipse";const Nw=Bw;var Fw=Math.PI,Vw=2*Fw,Zw=Math.sin,Hw=Math.cos,Ww=Math.acos,jw=Math.atan2,Gw=Math.abs,Uw=Math.sqrt,Yw=Math.max,Xw=Math.min,qw=1e-4,Kw=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0},$w=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new Kw},e.prototype.buildPath=function(t,e){!function(t,e){var n,i=Yw(e.r,0),o=Yw(e.r0||0,0),r=i>0;if(r||o>0){if(r||(i=o,o=0),o>i){var a=i;i=o,o=a}var s=e.startAngle,l=e.endAngle;if(!isNaN(s)&&!isNaN(l)){var u=e.cx,h=e.cy,c=!!e.clockwise,d=Gw(l-s),p=d>Vw&&d%Vw;if(p>qw&&(d=p),i>qw)if(d>Vw-qw)t.moveTo(u+i*Hw(s),h+i*Zw(s)),t.arc(u,h,i,s,l,!c),o>qw&&(t.moveTo(u+o*Hw(l),h+o*Zw(l)),t.arc(u,h,o,l,s,c));else{var f=void 0,g=void 0,m=void 0,v=void 0,_=void 0,x=void 0,w=void 0,b=void 0,S=void 0,T=void 0,M=void 0,C=void 0,k=void 0,I=void 0,L=void 0,P=void 0,D=i*Hw(s),A=i*Zw(s),O=o*Hw(l),z=o*Zw(l),E=d>qw;if(E){var R=e.cornerRadius;R&&(n=function(t){var e;if(y(t)){var n=t.length;if(!n)return t;e=1===n?[t[0],t[0],0,0]:2===n?[t[0],t[0],t[1],t[1]]:3===n?t.concat(t[2]):t}else e=[t,t,t,t];return e}(R),f=n[0],g=n[1],m=n[2],v=n[3]);var B=Gw(i-o)/2;if(_=Xw(B,m),x=Xw(B,v),w=Xw(B,f),b=Xw(B,g),M=S=Yw(_,x),C=T=Yw(w,b),(S>qw||T>qw)&&(k=i*Hw(l),I=i*Zw(l),L=o*Hw(s),P=o*Zw(s),dqw){var G=Xw(m,M),U=Xw(v,M),Y=Sa(L,P,D,A,i,G,c),X=Sa(k,I,O,z,i,U,c);t.moveTo(u+Y.cx+Y.x0,h+Y.cy+Y.y0),M0&&t.arc(u+Y.cx,h+Y.cy,G,jw(Y.y0,Y.x0),jw(Y.y1,Y.x1),!c),t.arc(u,h,i,jw(Y.cy+Y.y1,Y.cx+Y.x1),jw(X.cy+X.y1,X.cx+X.x1),!c),U>0&&t.arc(u+X.cx,h+X.cy,U,jw(X.y1,X.x1),jw(X.y0,X.x0),!c))}else t.moveTo(u+D,h+A),t.arc(u,h,i,s,l,!c);else t.moveTo(u+D,h+A);o>qw&&E?C>qw?(G=Xw(f,C),Y=Sa(O,z,k,I,o,-(U=Xw(g,C)),c),X=Sa(D,A,L,P,o,-G,c),t.lineTo(u+Y.cx+Y.x0,h+Y.cy+Y.y0),C0&&t.arc(u+Y.cx,h+Y.cy,U,jw(Y.y0,Y.x0),jw(Y.y1,Y.x1),!c),t.arc(u,h,o,jw(Y.cy+Y.y1,Y.cx+Y.x1),jw(X.cy+X.y1,X.cx+X.x1),c),G>0&&t.arc(u+X.cx,h+X.cy,G,jw(X.y1,X.x1),jw(X.y0,X.x0),!c))):(t.lineTo(u+O,h+z),t.arc(u,h,o,l,s,c)):t.lineTo(u+O,h+z)}else t.moveTo(u,h);t.closePath()}}}(t,e)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(ov);$w.prototype.type="sector";const Jw=$w;var Qw=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},tb=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new Qw},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,o=2*Math.PI;t.moveTo(n+e.r,i),t.arc(n,i,e.r,0,o,!1),t.moveTo(n+e.r0,i),t.arc(n,i,e.r0,0,o,!0)},e}(ov);tb.prototype.type="ring";const eb=tb;var nb=function(){this.points=null,this.smooth=0,this.smoothConstraint=null},ib=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultShape=function(){return new nb},e.prototype.buildPath=function(t,e){Ta(t,e,!0)},e}(ov);ib.prototype.type="polygon";const ob=ib;var rb=function(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null},ab=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new rb},e.prototype.buildPath=function(t,e){Ta(t,e,!1)},e}(ov);ab.prototype.type="polyline";const sb=ab;var lb={},ub=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},hb=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new ub},e.prototype.buildPath=function(t,e){var n,i,o,r;if(this.subPixelOptimize){var a=vi(lb,e,this.style);n=a.x1,i=a.y1,o=a.x2,r=a.y2}else n=e.x1,i=e.y1,o=e.x2,r=e.y2;var s=e.percent;0!==s&&(t.moveTo(n,i),s<1&&(o=n*(1-s)+o*s,r=i*(1-s)+r*s),t.lineTo(o,r))},e.prototype.pointAt=function(t){var e=this.shape;return[e.x1*(1-t)+e.x2*t,e.y1*(1-t)+e.y2*t]},e}(ov);hb.prototype.type="line";const cb=hb;var db=[],pb=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1},fb=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new pb},e.prototype.buildPath=function(t,e){var n=e.x1,i=e.y1,o=e.x2,r=e.y2,a=e.cpx1,s=e.cpy1,l=e.cpx2,u=e.cpy2,h=e.percent;0!==h&&(t.moveTo(n,i),null==l||null==u?(h<1&&(Yt(n,a,o,h,db),a=db[1],o=db[2],Yt(i,s,r,h,db),s=db[1],r=db[2]),t.quadraticCurveTo(a,s,o,r)):(h<1&&(Ht(n,a,l,o,h,db),a=db[1],l=db[2],o=db[3],Ht(i,s,u,r,h,db),s=db[1],u=db[2],r=db[3]),t.bezierCurveTo(a,s,l,u,o,r)))},e.prototype.pointAt=function(t){return Ma(this.shape,t,!1)},e.prototype.tangentAt=function(t){var e=Ma(this.shape,t,!0);return Q(e,e)},e}(ov);fb.prototype.type="bezier-curve";const gb=fb;var mb=function(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},yb=function(t){function e(e){return t.call(this,e)||this}return W(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new mb},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,o=Math.max(e.r,0),r=e.startAngle,a=e.endAngle,s=e.clockwise,l=Math.cos(r),u=Math.sin(r);t.moveTo(l*o+n,u*o+i),t.arc(n,i,o,r,a,!s)},e}(ov);yb.prototype.type="arc";const vb=yb;var _b=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="compound",e}return W(e,t),e.prototype._updatePathDirty=function(){for(var t=this.shape.paths,e=this.shapeChanged(),n=0;nLb[1]){if(o=!1,Pb.negativeSize||n)return o;var s=kb(Lb[0]-Ib[1]),l=kb(Ib[0]-Lb[1]);Mb(s,l)>Ab.len()&&Gf.scale(Ab,a,s=l||!Pb.bidirectional)&&(Gf.scale(Db,a,-l*i),Pb.useDir&&Pb.calcDirMTV())))}return o},t.prototype._getProjMinMaxOnAxis=function(t,e,n){for(var i=this._axes[t],o=this._origin,r=e[0].dot(i)+o[t],a=r,s=r,l=1;ln.blockIndex?n.step:null,r=i&&i.modDataCount;return{step:o,modBy:null!=r?Math.ceil(r/o):null,modDataCount:r}}},t.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},t.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData().count(),o=n.progressiveEnabled&&e.incrementalPrepareRender&&i>=n.threshold,r=t.get("large")&&i>=t.get("largeThreshold"),a="mod"===t.get("progressiveChunkMode")?i:null;t.pipelineContext=n.context={progressiveRender:o,modDataCount:a,large:r}},t.prototype.restorePipelines=function(t){var e=this,n=e._pipelineMap=B();t.eachSeries(function(t){var i=t.getProgressive(),o=t.uid;n.set(o,{id:o,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:i&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),e._pipe(t,t.dataTask)})},t.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.api.getModel(),n=this.api;c(this._allHandlers,function(i){var o=t.get(i.uid)||t.set(i.uid,{});O(!(i.reset&&i.overallReset),""),i.reset&&this._createSeriesStageTask(i,o,e,n),i.overallReset&&this._createOverallStageTask(i,o,e,n)},this)},t.prototype.prepareView=function(t,e,n,i){var o=t.renderTask,r=o.context;r.model=e,r.ecModel=n,r.api=i,o.__block=!t.incrementalPrepareRender,this._pipe(e,o)},t.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},t.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},t.prototype._performStageTasks=function(t,e,n,i){function o(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}i=i||{};var r=!1,a=this;c(t,function(t,s){if(!i.visualType||i.visualType===t.visualType){var l=a._stageTaskMap.get(t.uid),u=l.seriesTaskMap,h=l.overallTask;if(h){var c,d=h.agentStubMap;d.each(function(t){o(i,t)&&(t.dirty(),c=!0)}),c&&h.dirty(),a.updatePayload(h,n);var p=a.getPerformArgs(h,i.block);d.each(function(t){t.perform(p)}),h.perform(p)&&(r=!0)}else u&&u.each(function(s,l){o(i,s)&&s.dirty();var u=a.getPerformArgs(s,i.block);u.skip=!t.performRawSeries&&e.isSeriesFiltered(s.context.model),a.updatePayload(s,n),s.perform(u)&&(r=!0)})}}),this.unfinished=r||this.unfinished},t.prototype.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e=t.dataTask.perform()||e}),this.unfinished=e||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)})},t.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},t.prototype._createSeriesStageTask=function(t,e,n,i){function o(e){var o=e.uid,l=s.set(o,a&&a.get(o)||Er({plan:Cs,reset:ks,count:Ls}));l.context={model:e,ecModel:n,api:i,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:r},r._pipe(e,l)}var r=this,a=e.seriesTaskMap,s=e.seriesTaskMap=B(),l=t.seriesType,u=t.getTargetSeries;t.createOnAllSeries?n.eachRawSeries(o):l?n.eachRawSeriesByType(l,o):u&&u(n,i).each(o)},t.prototype._createOverallStageTask=function(t,e,n,i){function o(t){var e=t.uid,n=l.set(e,s&&s.get(e)||(p=!0,Er({reset:Ss,onDirty:Ms})));n.context={model:t,overallProgress:d},n.agent=a,n.__block=d,r._pipe(t,n)}var r=this,a=e.overallTask=e.overallTask||Er({reset:bs});a.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:r};var s=a.agentStubMap,l=a.agentStubMap=B(),u=t.seriesType,h=t.getTargetSeries,d=!0,p=!1;O(!t.createOnAllSeries,""),u?n.eachRawSeriesByType(u,o):h?h(n,i).each(o):(d=!1,c(n.getSeries(),o)),p&&a.dirty()},t.prototype._pipe=function(t,e){var n=this._pipelineMap.get(t.uid);!n.head&&(n.head=e),n.tail&&n.tail.pipe(e),n.tail=e,e.__idxInPipeline=n.count++,e.__pipeline=n},t.wrapStageHandler=function(t,e){return v(t)&&(t={overallReset:t,seriesType:Ps(t)}),t.uid=mo("stageHandler"),e&&(t.visualType=e),t},t}(),hS=Is(0),cS={},dS={};Ds(cS,bx),Ds(dS,Tx),cS.eachSeriesByType=cS.eachRawSeriesByType=function(t){$b=t},cS.eachComponent=function(t){"series"===t.mainType&&t.subType&&($b=t.subType)};const pS=uS;var fS,gS=X_.darkColor,mS=function(){return{axisLine:{lineStyle:{color:gS.axisLine}},splitLine:{lineStyle:{color:gS.axisSplitLine}},splitArea:{areaStyle:{color:[gS.backgroundTint,gS.backgroundTransparent]}},minorSplitLine:{lineStyle:{color:gS.axisMinorSplitLine}},axisLabel:{color:gS.axisLabel},axisName:{}}},yS={label:{color:gS.secondary},itemStyle:{borderColor:gS.borderTint},dividerLineStyle:{color:gS.border}},vS={darkMode:!0,color:gS.theme,backgroundColor:gS.background,axisPointer:{lineStyle:{color:gS.border},crossStyle:{color:gS.borderShade},label:{color:gS.tertiary}},legend:{textStyle:{color:gS.secondary},pageTextStyle:{color:gS.tertiary}},textStyle:{color:gS.secondary},title:{textStyle:{color:gS.primary},subtextStyle:{color:gS.quaternary}},toolbox:{iconStyle:{borderColor:gS.accent50}},tooltip:{backgroundColor:gS.neutral20,defaultBorderColor:gS.border,textStyle:{color:gS.tertiary}},dataZoom:{borderColor:gS.accent10,textStyle:{color:gS.tertiary},brushStyle:{color:gS.backgroundTint},handleStyle:{color:gS.neutral00,borderColor:gS.accent20},moveHandleStyle:{color:gS.accent40},emphasis:{handleStyle:{borderColor:gS.accent50}},dataBackground:{lineStyle:{color:gS.accent30},areaStyle:{color:gS.accent20}},selectedDataBackground:{lineStyle:{color:gS.accent50},areaStyle:{color:gS.accent30}}},visualMap:{textStyle:{color:gS.secondary},handleStyle:{borderColor:gS.neutral30}},timeline:{lineStyle:{color:gS.accent10},label:{color:gS.tertiary},controlStyle:{color:gS.accent30,borderColor:gS.accent30}},calendar:{itemStyle:{color:gS.neutral00,borderColor:gS.neutral20},dayLabel:{color:gS.tertiary},monthLabel:{color:gS.secondary},yearLabel:{color:gS.secondary}},matrix:{x:yS,y:yS,backgroundColor:{borderColor:gS.axisLine},body:{itemStyle:{borderColor:gS.borderTint}}},timeAxis:mS(),logAxis:mS(),valueAxis:mS(),categoryAxis:mS(),line:{symbol:"circle"},graph:{color:gS.theme},gauge:{title:{color:gS.secondary},axisLine:{lineStyle:{color:[[1,gS.neutral05]]}},axisLabel:{color:gS.axisLabel},detail:{color:gS.primary}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}},funnel:{itemStyle:{borderColor:gS.background}},radar:(fS=mS(),fS.axisName={color:gS.axisLabel},fS.axisLine.lineStyle.color=gS.neutral20,fS),treemap:{breadcrumb:{itemStyle:{color:gS.neutral20,textStyle:{color:gS.secondary}},emphasis:{itemStyle:{color:gS.neutral30}}}},sunburst:{itemStyle:{borderColor:gS.background}},map:{itemStyle:{borderColor:gS.border,areaColor:gS.neutral10},label:{color:gS.tertiary},emphasis:{label:{color:gS.primary},itemStyle:{areaColor:gS.highlight}},select:{label:{color:gS.primary},itemStyle:{areaColor:gS.highlight}}},geo:{itemStyle:{borderColor:gS.border,areaColor:gS.neutral10},emphasis:{label:{color:gS.primary},itemStyle:{areaColor:gS.highlight}},select:{label:{color:gS.primary},itemStyle:{color:gS.highlight}}}};vS.categoryAxis.splitLine.show=!1;const _S=vS;var xS=function(){function t(){}return t.prototype.normalizeQuery=function(t){var e={},n={},i={};if(_(t)){var o=zn(t);e.mainType=o.main||null,e.subType=o.sub||null}else{var r=["Index","Name","Id"],a={name:1,dataIndex:1,dataType:1};c(t,function(t,o){for(var s=!1,l=0;l0&&h===o.length-u.length){var c=o.slice(0,h);"data"!==c&&(e.mainType=c,e[u.toLowerCase()]=t,s=!0)}}a.hasOwnProperty(o)&&(n[o]=t,s=!0),s||(i[o]=t)})}return{cptQuery:e,dataQuery:n,otherQuery:i}},t.prototype.filter=function(t,e){function n(t,e,n,i){return null==t[n]||e[i||n]===t[n]}var i=this.eventInfo;if(!i)return!0;var o=i.targetEl,r=i.packedEvent,a=i.model,s=i.view;if(!a||!s)return!0;var l=e.cptQuery,u=e.dataQuery;return n(l,a,"mainType")&&n(l,a,"subType")&&n(l,a,"index","componentIndex")&&n(l,a,"name")&&n(l,a,"id")&&n(u,r,"name")&&n(u,r,"dataIndex")&&n(u,r,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(t,e.otherQuery,o,r))},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),wS=["symbol","symbolSize","symbolRotate","symbolOffset"],bS=wS.concat(["symbolKeepAspect"]),SS={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData();if(t.legendIcon&&n.setVisual("legendIcon",t.legendIcon),t.hasSymbolVisual){for(var i={},o={},r=!1,s=0;s0&&t.unfinished);t.unfinished||this._zr.flush()}}},n.prototype.getDom=function(){return this._dom},n.prototype.getId=function(){return this.id},n.prototype.getZr=function(){return this._zr},n.prototype.isSSR=function(){return this._ssr},n.prototype.setOption=function(t,e,n){if(!this[dT])if(this._disposed);else{var i,o,r;if(b(e)&&(n=e.lazyUpdate,i=e.silent,o=e.replaceMerge,r=e.transition,e=e.notMerge),this[dT]=!0,sT(this),!this._model||e){var a=new kx(this._api),s=this._theme,l=this._model=new bx;l.scheduler=this._scheduler,l.ssr=this._ssr,l.init(null,null,null,s,this._locale,a)}this._model.setOption(t,{replaceMerge:o},kT);var u={seriesTransition:r,optionChanged:!0};if(n)this[fT]={silent:i,updateParams:u},this[dT]=!1,this.getZr().wakeUp();else{try{WS(this),US.update.call(this,null,u)}catch(t){throw this[fT]=null,this[dT]=!1,t}this._ssr||this._zr.flush(),this[fT]=null,this[dT]=!1,KS.call(this,i),$S.call(this,i)}}},n.prototype.setTheme=function(t,e){if(!this[dT])if(this._disposed);else{var n=this._model;if(n){var i=e&&e.silent,o=null;this[fT]&&(null==i&&(i=this[fT].silent),o=this[fT].updateParams,this[fT]=null),this[dT]=!0,sT(this);try{this._updateTheme(t),n.setTheme(this._theme),WS(this),US.update.call(this,{type:"setTheme"},o)}catch(t){throw this[dT]=!1,t}this[dT]=!1,KS.call(this,i),$S.call(this,i)}}},n.prototype._updateTheme=function(t){_(t)&&(t=LT[t]),t&&((t=o(t))&&_r(t,!0),this._theme=t)},n.prototype.getModel=function(){return this._model},n.prototype.getOption=function(){return this._model&&this._model.getOption()},n.prototype.getWidth=function(){return this._zr.getWidth()},n.prototype.getHeight=function(){return this._zr.getHeight()},n.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||Qp.hasGlobalWindow&&window.devicePixelRatio||1},n.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},n.prototype.renderToCanvas=function(t){return this._zr.painter.getRenderedCanvas({backgroundColor:(t=t||{}).backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},n.prototype.renderToSVGString=function(t){return this._zr.painter.renderToString({useViewBox:(t=t||{}).useViewBox})},n.prototype.getSvgDataURL=function(){var t=this._zr;return c(t.storage.getDisplayList(),function(t){t.stopAnimation(null,!0)}),t.painter.toDataURL()},n.prototype.getDataURL=function(t){if(!this._disposed){var e=this._model,n=[],i=this;c((t=t||{}).excludeComponents,function(t){e.eachComponent({mainType:t},function(t){var e=i._componentsMap[t.__viewId];e.group.ignore||(n.push(e),e.group.ignore=!0)})});var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return c(n,function(t){t.group.ignore=!1}),o}},n.prototype.getConnectedDataURL=function(t){if(!this._disposed){var e="svg"===t.type,n=this.group,i=Math.min,r=Math.max,a=1/0;if(AT[n]){var s=a,l=a,u=-1/0,h=-1/0,d=[],p=t&&t.pixelRatio||this.getDevicePixelRatio();c(DT,function(a,c){if(a.group===n){var p=e?a.getZr().painter.getSvgDom().innerHTML:a.renderToCanvas(o(t)),f=a.getDom().getBoundingClientRect();s=i(f.left,s),l=i(f.top,l),u=r(f.right,u),h=r(f.bottom,h),d.push({dom:p,left:f.left,top:f.top})}});var f=(u*=p)-(s*=p),g=(h*=p)-(l*=p),m=af.createCanvas(),y=en(m,{renderer:e?"svg":"canvas"});if(y.resize({width:f,height:g}),e){var v="";return c(d,function(t){v+=''+t.dom+""}),y.painter.getSvgRoot().innerHTML=v,t.connectedBackgroundColor&&y.painter.setBackgroundColor(t.connectedBackgroundColor),y.refreshImmediately(),y.painter.toDataURL()}return t.connectedBackgroundColor&&y.add(new mv({shape:{x:0,y:0,width:f,height:g},style:{fill:t.connectedBackgroundColor}})),c(d,function(t){var e=new cv({style:{x:t.left*p-s,y:t.top*p-l,image:t.dom}});y.add(e)}),y.refreshImmediately(),m.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}},n.prototype.convertToPixel=function(t,e,n){return YS(this,"convertToPixel",t,e,n)},n.prototype.convertToLayout=function(t,e,n){return YS(this,"convertToLayout",t,e,n)},n.prototype.convertFromPixel=function(t,e,n){return YS(this,"convertFromPixel",t,e,n)},n.prototype.containPixel=function(t,e){var n;if(!this._disposed)return c(Pn(this._model,t),function(t,i){i.indexOf("Models")>=0&&c(t,function(t){var o=t.coordinateSystem;if(o&&o.containPoint)n=n||!!o.containPoint(e);else if("seriesModels"===i){var r=this._chartsMap[t.__viewId];r&&r.containPoint&&(n=n||r.containPoint(e,t))}},this)},this),!!n},n.prototype.getVisual=function(t,e){var n=Pn(this._model,t,{defaultMainType:"series"}),i=n.seriesModel.getData(),o=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?i.indexOfRawIndex(n.dataIndex):null;return null!=o?function(t,e,n){switch(n){case"color":return t.getItemVisual(e,"style")[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,n)}}(i,o,e):function(t,e){switch(e){case"color":return t.getVisual("style")[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e)}}(i,e)},n.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},n.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},n.prototype._initEvents=function(){var t=this;c(bT,function(e){var n=function(n){var i,o=t.getModel(),r=n.target;if("globalout"===e?i={}:r&&Os(r,function(t){var e=Mv(t);if(e&&null!=e.dataIndex){var n=e.dataModel||o.getSeriesByIndex(e.seriesIndex);return i=n&&n.getDataParams(e.dataIndex,e.dataType,r)||{},!0}if(e.eventData)return i=a({},e.eventData),!0},!0),i){var s=i.componentType,l=i.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=i.seriesIndex);var u=s&&null!=l&&o.getComponent(s,l),h=u&&t["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];i.event=n,i.type=e,t._$eventProcessor.eventInfo={targetEl:r,packedEvent:i,model:u,view:h},t.trigger(e,i)}};n.zrEventfulCallAtLast=!0,t._zr.on(e,n,t)});var e=this._messageCenter;c(MT,function(n,i){e.on(i,function(e){t.trigger(i,e)})}),function(t,e,n){t.on("selectchanged",function(t){var i=n.getModel();t.isFromClick?(As("map","selectchanged",e,i,t),As("pie","selectchanged",e,i,t)):"select"===t.fromAction?(As("map","selected",e,i,t),As("pie","selected",e,i,t)):"unselect"===t.fromAction&&(As("map","unselected",e,i,t),As("pie","unselected",e,i,t))})}(e,this,this._api)},n.prototype.isDisposed=function(){return this._disposed},n.prototype.clear=function(){this._disposed||this.setOption({series:[]},!0)},n.prototype.dispose=function(){if(this._disposed);else{this._disposed=!0,this.getDom()&&On(this.getDom(),zT,"");var t=this,e=t._api,n=t._model;c(t._componentsViews,function(t){t.dispose(n,e)}),c(t._chartsViews,function(t){t.dispose(n,e)}),t._zr.dispose(),t._dom=t._model=t._chartsMap=t._componentsMap=t._chartsViews=t._componentsViews=t._scheduler=t._api=t._zr=t._throttledZrFlush=t._theme=t._coordSysMgr=t._messageCenter=null,delete DT[t.id]}},n.prototype.resize=function(t){if(!this[dT])if(this._disposed);else{this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var n=e.resetOption("media"),i=t&&t.silent;this[fT]&&(null==i&&(i=this[fT].silent),n=!0,this[fT]=null),this[dT]=!0,sT(this);try{n&&WS(this),US.update.call(this,{type:"resize",animation:a({duration:0},t&&t.animation)})}catch(t){throw this[dT]=!1,t}this[dT]=!1,KS.call(this,i),$S.call(this,i)}}},n.prototype.showLoading=function(t,e){if(this._disposed);else if(b(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),PT[t]){var n=PT[t](this._api,e),i=this._zr;this._loadingFX=n,i.add(n)}},n.prototype.hideLoading=function(){this._disposed||(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},n.prototype.makeActionFromEvent=function(t){var e=a({},t);return e.type=TT[t.type],e},n.prototype.dispatchAction=function(t,e){if(this._disposed);else if(b(e)||(e={silent:!!e}),ST[t.type]&&this._model)if(this[dT])this._pendingActions.push(t);else{var n=e.silent;qS.call(this,t,n);var i=e.flush;i?this._zr.flush():!1!==i&&Qp.browser.weChat&&this._throttledZrFlush(),KS.call(this,n),$S.call(this,n)}},n.prototype.updateLabelLayout=function(){HS.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},n.prototype.appendData=function(t){if(this._disposed);else{var e=t.seriesIndex;this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},n.internalField=function(){function t(t){t.clearColorPalette(),t.eachSeries(function(t){t.clearColorPalette()})}function n(t){for(var e=[],n=t.currentStates,i=0;i0?{duration:r,delay:i.get("delay"),easing:i.get("easing")}:null;e.eachRendered(function(t){if(t.states&&t.states.emphasis){if(Pa(t))return;if(t instanceof ov&&function(t){var e=Iv(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var n=t.states.select||{};e.selectFill=n.style&&n.style.fill||null,e.selectStroke=n.style&&n.style.stroke||null}(t),t.__dirty){var e=t.prevStates;e&&t.useStates(e)}if(o){t.stateTransition=a;var i=t.getTextContent(),r=t.getTextGuideLine();i&&(i.stateTransition=a),r&&(r.stateTransition=a)}t.__dirty&&n(t)}})}WS=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),jS(t,!0),jS(t,!1),e.plan()},jS=function(t,e){function n(t){var n=t.__requireNewView;t.__requireNewView=!1;var u="_ec_"+t.id+"_"+t.type,h=!n&&a[u];if(!h){var c=zn(t.type);(h=new(e?ww.getClass(c.main,c.sub):Kb.getClass(c.sub))).init(i,l),a[u]=h,r.push(h),s.add(h.group)}t.__viewId=h.__id=u,h.__alive=!0,h.__model=t,h.group.__ecComponentInfo={mainType:t.mainType,index:t.componentIndex},!e&&o.prepareView(h,t,i,l)}for(var i=t._model,o=t._scheduler,r=e?t._componentsViews:t._chartsViews,a=e?t._componentsMap:t._chartsMap,s=t._zr,l=t._api,u=0;ue.get("hoverLayerThreshold")&&!Qp.node&&!Qp.worker&&e.eachSeries(function(e){if(!e.preventUsingHoverLayer){var n=t._chartsMap[e.__viewId];n.__alive&&n.eachRendered(function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)})}})}(t,e),HS.trigger("series:afterupdate",e,n,l)},rT=function(t){t[gT]=!0,t.getZr().wakeUp()},sT=function(t){t[pT]=(t[pT]+1)%1e3},aT=function(t){t[gT]&&(t.getZr().storage.traverse(function(t){Pa(t)||n(t)}),t[gT]=!1)},iT=function(t){return new(function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return e(i,n),i.prototype.getCoordinateSystems=function(){return t._coordSysMgr.getCoordinateSystems()},i.prototype.getComponentByElement=function(e){for(;e;){var n=e.__ecComponentInfo;if(null!=n)return t._model.getComponent(n.mainType,n.index);e=e.parent}},i.prototype.enterEmphasis=function(e,n){ji(e,n),rT(t)},i.prototype.leaveEmphasis=function(e,n){Gi(e,n),rT(t)},i.prototype.enterBlur=function(e){!function(t){Fi(t,zi)}(e),rT(t)},i.prototype.leaveBlur=function(e){Ui(e),rT(t)},i.prototype.enterSelect=function(e){Yi(e),rT(t)},i.prototype.leaveSelect=function(e){Xi(e),rT(t)},i.prototype.getModel=function(){return t.getModel()},i.prototype.getViewOfComponentModel=function(e){return t.getViewOfComponentModel(e)},i.prototype.getViewOfSeriesModel=function(e){return t.getViewOfSeriesModel(e)},i.prototype.getMainProcessVersion=function(){return t[pT]},i}(Tx))(t)},oT=function(t){function e(t,e){for(var n=0;n0?t[n-1].seriesModel:null)}),function(t){c(t,function(e,n){var i=[],o=[NaN,NaN],r=[e.stackResultDimension,e.stackedOverDimension],a=e.data,s=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";a.modify(r,function(r,u,h){var c,d,p=a.get(e.stackedDimension,h);if(isNaN(p))return o;s?d=a.getRawIndex(h):c=a.get(e.stackedByDimension,h);for(var f=NaN,g=n-1;g>=0;g--){var m=t[g];if(s||(d=m.data.rawIndexOf(m.stackedByDimension,c)),d>=0){var y=m.data.getByRawIndex(m.stackResultDimension,d);if("all"===l||"positive"===l&&y>0||"negative"===l&&y<0||"samesign"===l&&p>=0&&y>0||"samesign"===l&&p<=0&&y<0){p=ln(p,y),f=y;break}}}return i[0]=p,i[1]=f,i})})}(t))})}),vl("default",function(t,e){s(e=e||{},{text:"loading",textColor:X_.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:X_.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Em,i=new mv({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});n.add(i);var o,r=new Tv({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new mv({style:{fill:"none"},textContent:r,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});return n.add(a),e.showSpinner&&((o=new vb({shape:{startAngle:-lS/2,endAngle:-lS/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*lS/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:3*lS/2}).delay(300).start("circularInOut"),n.add(o)),n.resize=function(){var n=r.getBoundingRect().width,s=e.showSpinner?e.spinnerRadius:0,l=(t.getWidth()-2*s-(e.showSpinner&&n?10:0)-n)/2-(e.showSpinner&&n?0:5+n/2)+(e.showSpinner?0:n/2)+(n?0:s),u=t.getHeight()/2;e.showSpinner&&o.setShape({cx:l,cy:u}),a.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),i.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},n.resize(),n}),fl({type:Av,event:Av,update:Av},H),fl({type:Ov,event:Ov,update:Ov},H),fl({type:zv,event:Bv,update:zv,action:H,refineEvent:_l,publishNonRefinedEvent:!0}),fl({type:Ev,event:Bv,update:Ev,action:H,refineEvent:_l,publishNonRefinedEvent:!0}),fl({type:Rv,event:Bv,update:Rv,action:H,refineEvent:_l,publishNonRefinedEvent:!0}),hl("default",{}),hl("dark",_S);const BT={...{metadata:!0,svgRender:!1,switchMode:!1,maxPointsFetched:1e4,loadMoreAtZoomLevel:9,clustering:!1,clusteringThreshold:100,disableClusteringAtLevel:8,clusterRadius:80,clusterSeparation:20,showMetaOnNarrowScreens:!1,showMapLabelsAtZoom:13,showGraphLabelsAtZoom:null,echartsOption:{aria:{show:!0,description:"This is a force-oriented graph chart that depicts the relationship between ip nodes."},toolbox:{show:!0,iconStyle:{borderColor:"#fff"},feature:{restore:{show:!0,title:"Restore view"},saveAsImage:{show:!0,title:"Save image"}}}},graphConfig:{series:{layout:"force",label:{show:!0,color:"#fff",position:"top"},labelLayout:{hideOverlap:!0},force:{gravity:.1,edgeLength:[20,60],repulsion:120},roam:!0,draggable:!0,legendHoverLink:!0,emphasis:{focus:"none",lineStyle:{color:"#3acc38",opacity:1}},nodeStyle:{color:"#ffebc4"},linkStyle:{width:6,color:"#1ba619"},nodeSize:"15"},baseOptions:{backgroundColor:"#282222",media:[{query:{minWidth:320,maxWidth:500},option:{series:[{zoom:.7}],toolbox:{itemSize:18}}},{query:{minWidth:501},option:{series:[{zoom:1}],toolbox:{itemSize:15}}},{query:{minWidth:320,maxWidth:850},option:{tooltip:{show:!1}}},{query:{minWidth:851},option:{tooltip:{show:!0}}}]}},mapOptions:{roam:!0,zoomAnimation:!1,worldCopyJump:!0,minZoom:3,maxZoom:18,nodeConfig:{type:"scatter",label:{show:!1,color:"#000000",position:"top",formatter:"{b}",fontSize:13,backgroundColor:"rgba(255, 255, 255, 0.8)",padding:[6,8],borderRadius:5},emphasis:{scale:1},nodeStyle:{color:"#1566a9"},nodeSize:"17"},linkConfig:{linkStyle:{width:5,color:"#1ba619"},emphasis:{focus:"none",lineStyle:{color:"#3acc38",opacity:1}}},clusterConfig:{symbolSize:30,itemStyle:{color:"#1566a9"},tooltip:{show:!1},label:{show:!0,position:"inside",color:"#fff",offset:[0,0],backgroundColor:"transparent"}},baseOptions:{toolbox:{show:!1},media:[{query:{minWidth:320,maxWidth:850},option:{tooltip:{show:!1}}},{query:{minWidth:851},option:{tooltip:{show:!0}}}]},nodePopup:{show:!1,content:null,config:{autoPan:!0,autoPanPadding:[25,25]}}},mapTileConfig:[{urlTemplate:"MISSING_ENV_VAR".MAPBOX_URL_TEMPLATE||"http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",options:{attribution:'© OpenStreetMap contributors,\n tiles offered by Mapbox'}}],geoOptions:{style:{fillColor:"#1566a9",weight:0,fillOpacity:.8,radius:8}},nodeCategories:[{name:"ok",nodeStyle:{color:"#1ba619"}},{name:"problem",nodeStyle:{color:"#ffa500"}},{name:"critical",nodeStyle:{color:"#c92517"}}],linkCategories:[],bookmarkableActions:{enabled:!1,id:null,zoomOnRestore:!0,zoomLevel:null,preserveFragment:!1},prepareData(t){t&&t.nodes&&t.nodes.forEach(t=>{if(t.properties&&t.properties.status){const e=t.properties.status.toLowerCase();"ok"!==e&&"problem"!==e&&"critical"!==e||(t.category=e)}})},onClickElement(t,e){let n;this.utils&&this.utils.isNetJSON(this.data)?(n="node"===t?this.utils.nodeInfo(e):"link"===t?this.utils.linkInfo(e):e,(this.config.showMetaOnNarrowScreens||this.el.clientWidth>850)&&(this.gui.metaInfoContainer.style.display="flex")):({nodeLinkData:n}={nodeLinkData:e}),this.gui.getNodeLinkInfo(t,n),this.gui.sideBar.classList.remove("hidden")},onReady(){}}};Object.defineProperty(BT,"crs",{get(){const t=xl(!0);return t?t.CRS.EPSG3857:null},enumerable:!0,configurable:!0});const NT=BT,FT=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class VT{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,n]=new Uint8Array(t,0,2);if(219!==e)throw new Error("Data does not appear to be in a KDBush format.");const i=n>>4;if(1!==i)throw new Error(`Got v${i} data when expected v1.`);const o=FT[15&n];if(!o)throw new Error("Unrecognized array type.");const[r]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new VT(a,r,o,t)}constructor(t,e=64,n=Float64Array,i){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=n,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const o=FT.indexOf(this.ArrayType),r=2*t*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-a%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${n}.`);i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+a+s,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+r+a+s),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+a+s,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+o]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=t,this.coords[this._pos++]=e,n}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return wl(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:r,nodeSize:a}=this,s=[0,o.length-1,0],l=[];for(;s.length;){const u=s.pop()||0,h=s.pop()||0,c=s.pop()||0;if(h-c<=a){for(let a=c;a<=h;a++){const s=r[2*a],u=r[2*a+1];s>=t&&s<=n&&u>=e&&u<=i&&l.push(o[a])}continue}const d=c+h>>1,p=r[2*d],f=r[2*d+1];p>=t&&p<=n&&f>=e&&f<=i&&l.push(o[d]),(0===u?t<=p:e<=f)&&(s.push(c),s.push(d-1),s.push(1-u)),(0===u?n>=p:i>=f)&&(s.push(d+1),s.push(h),s.push(1-u))}return l}within(t,e,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:r}=this,a=[0,i.length-1,0],s=[],l=n*n;for(;a.length;){const u=a.pop()||0,h=a.pop()||0,c=a.pop()||0;if(h-c<=r){for(let n=c;n<=h;n++)Ml(o[2*n],o[2*n+1],t,e)<=l&&s.push(i[n]);continue}const d=c+h>>1,p=o[2*d],f=o[2*d+1];Ml(p,f,t,e)<=l&&s.push(i[d]),(0===u?t-n<=p:e-n<=f)&&(a.push(c),a.push(d-1),a.push(1-u)),(0===u?t+n>=p:e+n>=f)&&(a.push(d+1),a.push(h),a.push(1-u))}return s}}const ZT=class{JSONParamParse(t){return"string"==typeof t?fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},credentials:"include"}).then(t=>t).catch(t=>{console.error(t)}):Promise.resolve(t)}async paginatedDataParse(t){let e,n;try{let i=await this.utils.JSONParamParse(t);if(i.json)for(e=await i.json(),n=e.results?e.results:e;e.next&&n.nodes.length<=this.config.maxPointsFetched;)i=await this.utils.JSONParamParse(e.next),e=await i.json(),n.nodes=n.nodes.concat(e.results.nodes),n.links=n.links.concat(e.results.links),this.hasMoreData=!!e.next;else n=i}catch(t){console.error(t)}return n}async getBBoxData(t,e){let n;try{const i=`${t=t[0].split("?")[0]}bbox?swLat=${e._southWest.lat}&swLng=${e._southWest.lng}&neLat=${e._northEast.lat}&neLng=${e._northEast.lng}`,o=await this.utils.JSONParamParse(i);n=await o.json()}catch(t){console.error(t)}return n}dateParse({dateString:t,parseRegular:e=/^([1-9]\d{3})-(\d{1,2})-(\d{1,2})T(\d{1,2}):(\d{1,2}):(\d{1,2})(?:\.(\d{1,3}))?Z$/,hourDiffer:n=(new Date).getTimezoneOffset()/60}){const i=e.exec(t);if(!i||i.length<7)return console.error("Date doesn't meet the specifications."),"";const o=["dateYear","dateMonth","dateDay","dateHour"],r={},a=new Map([["dateMonth",12],["dateDay",[31,i[1]%4==0&&i[1]%100!=0||i[1]%400==0?29:28,31,30,31,30,31,31,30,31,30,31]],["dateHour",24]]);for(let t=o.length;t>0;t-=1)r[o[t-1]]=parseInt(i[t],10);let s,l=-n;for(let t=o.length;t>0;t-=1){if("dateYear"===o[t-1]){r[o[t-1]]+=l;break}s="dateDay"===o[t-1]?a.get("dateDay")[r.dateMonth-1]:a.get(o[t-1]);let e=r[o[t-1]]+l;l="dateHour"===o[t-1]?e<0?-1:e>=s?1:0:e<=0?-1:e>s?1:0,1===l?e-=s:l<0&&("dateDay"===o[t-1]&&(s=a.get("dateDay")[(r[o[t-1]]+10)%11]),e+=s),r[o[t-1]]=e}return`${r.dateYear}.${this.numberMinDigit(r.dateMonth)}.${this.numberMinDigit(r.dateDay)} ${this.numberMinDigit(r.dateHour)}:${this.numberMinDigit(i[5])}:${this.numberMinDigit(i[6])}${i[7]?`.${this.numberMinDigit(i[7],3)}`:""}`}numberMinDigit(t,e=2,n="0"){return(Array(e).join(n)+t).slice(-e)}isObject(t){return"Object"===Object.prototype.toString.call(t).slice(8,14)}isArray(t){return"Array"===Object.prototype.toString.call(t).slice(8,13)}isElement(t){return"object"==typeof HTMLElement?t instanceof HTMLElement:t&&"object"==typeof t&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName}isNetJSON(t){return!(!t.nodes||!t.links)&&this.isObject(t)&&this.isArray(t.nodes)&&this.isArray(t.links)}isGeoJSON(t){return t.type&&"FeatureCollection"===t.type?this.isObject(t)&&this.isArray(t.features):!(!t.type||"Feature"!==t.type)&&this.isObject(t)&&this.isArray(t.geometry)}geojsonToNetjson(t){return function(t){const e=[],n=[];if(!t||!Array.isArray(t.features))return{nodes:e,links:n};const i=new Map,o=(t,n={})=>{const o=`${t[0]},${t[1]}`;if(i.has(o))return i.get(o);const r=n.id||n.node_id||null,a=n.label||n.name||r||null,s=r?String(r):`gjn_${e.length}`,l=!r,u={id:s,...a?{label:String(a)}:{},location:{lng:t[0],lat:t[1]},properties:{...n,location:{lng:t[0],lat:t[1]}},_generatedIdentity:l};return e.push(u),i.set(o,s),s},r=(t,e,i={})=>{n.push({source:t,target:e,properties:i})},a=(t,e,n=!1)=>{for(let n=0;n2){const n=o(t[0],e),i=o(t[t.length-1],e);r(i,n,e)}},s=(t,e)=>{if(!t)return;const{type:n,coordinates:i,geometries:r}=t;switch(n){case"Point":o(i,{...e,_featureType:"Point"});break;case"MultiPoint":i.forEach(t=>o(t,{...e,_featureType:"Point"}));break;case"LineString":a(i,{...e,_featureType:"LineString"},!1);break;case"MultiLineString":i.forEach(t=>a(t,{...e,_featureType:"LineString"},!1));break;case"Polygon":case"MultiPolygon":break;case"GeometryCollection":r.forEach(t=>s(t,e));break;default:console.warn(`Unsupported GeoJSON geometry type: ${n}`)}};return t.features.forEach(t=>{const e={...t.properties||{},...null!=t.id?{id:t.id}:{}};s(t.geometry,e)}),{nodes:e,links:n}}(t)}deepCopy(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>this.deepCopy(t));const e={};return Object.keys(t).forEach(n=>{e[n]=this.deepCopy(t[n])}),e}fastDeepCopy(t){return"function"==typeof structuredClone?structuredClone(t):JSON.parse(JSON.stringify(t))}deepMergeObj(...t){const e=[...t].reverse(),n=e.length;for(let t=0;t{i[t]&&this.isObject(i[t])&&this.isObject(n[t])?this.deepMergeObj(i[t],n[t]):i[t]=n[t]}):i||(e[t+1]=n)}return e[n-1]}makeCluster(t){const{nodes:e,links:n}=t.data,i=t=>!(t.properties&&t.properties._featureType)||"Point"===t.properties._featureType,o=e.filter(i),r=e.filter(t=>!i(t)),a=[],s=[],l=new Map;r.forEach(t=>l.set(t.id,null));let u=0;o.forEach(e=>{const n=e.properties&&e.properties.location||e.location;if(!n||void 0===n.lat||void 0===n.lng)return;e.location=n,e._origLocation?(n.lat=e._origLocation.lat,n.lng=e._origLocation.lng):e._origLocation={lat:n.lat,lng:n.lng};const i=t.leaflet.latLngToContainerPoint([n.lat,n.lng]);e.x=i.x,e.y=i.y,e.visited=!1,e.cluster=null});const h=new VT(o.length);o.forEach(({x:t,y:e})=>h.add(t,e)),h.finish();const c=t.config&&t.config.mapOptions&&t.config.mapOptions.clusterConfig&&t.config.mapOptions.clusterConfig.symbolSize,d=t=>{if("function"==typeof c)try{return c(t)}catch(t){return 30}return Array.isArray(c)?c[0]||30:"number"==typeof c?c:30},p=new Map;o.forEach(e=>{if(e.visited)return;const n=h.within(e.x,e.y,t.config.clusterRadius).map(t=>o[t]);if(n.length>1){const i=`${Math.round(e.x)},${Math.round(e.y)}`;p.has(i)||p.set(i,new Map);const o=p.get(i);n.forEach(e=>{if(e.visited)return;const n=t.config.clusteringAttribute?e.properties[t.config.clusteringAttribute]:"default";o.has(n)||o.set(n,[]),o.get(n).push(e),e.visited=!0})}else e.visited=!0,l.set(e.id,null),r.push(e)}),p.forEach(e=>{const n=Array.from(e.entries()),i=n.length;let o=0;n.forEach(([,t])=>{const e=d(t.length);e>o&&(o=e)});const a="number"==typeof t.config.clusterSeparation?t.config.clusterSeparation:Math.max(10,Math.floor(t.config.clusterRadius/2));let h=0;if(i>1){const t=Math.PI/i,e=Math.sin(t);e>0&&(h=o/(2*e))}const c=Math.max(a,h+4);n.forEach(([,e],n)=>{if(e.length>1){let o=0,r=0;if(e.forEach(t=>{t.cluster=u,l.set(t.id,t.cluster),o+=t.location.lng,r+=t.location.lat}),o/=e.length,r/=e.length,i>1){const e=2*Math.PI*n/i,a=t.leaflet.latLngToContainerPoint([r,o]),s=[a.x+c*Math.cos(e),a.y+c*Math.sin(e)],l=t.leaflet.containerPointToLatLng(s);o=l.lng,r=l.lat}const a={id:u,cluster:!0,name:e.length,value:[o,r],childNodes:e,...t.config.mapOptions.clusterConfig};if(t.config.clusteringAttribute){const n=t.config.nodeCategories.find(n=>n.name===e[0].properties[t.config.clusteringAttribute]);n&&(a.itemStyle={...a.itemStyle,color:n.nodeStyle.color})}s.push(a),u+=1}else if(1===e.length){const t=e[0];l.set(t.id,null),r.push(t)}})}),n.forEach(t=>{null===l.get(t.source)&&null===l.get(t.target)&&a.push(t)});const f=[...s.map(t=>({ref:t,isCluster:!0,count:t.childNodes.length,get value(){return t.value},set value([e,n]){t.value=[e,n]}})),...r.filter(i).map(t=>({ref:t,isCluster:!1,count:1,get value(){return[t.location.lng,t.location.lat]},set value([e,n]){t.location.lng=e,t.location.lat=n}}))];if(f.length>1){const e=f.map(e=>{const[n,i]=e.value,o=t.leaflet.latLngToContainerPoint([i,n]);return{ref:e.ref,isCluster:e.isCluster,x:o.x,y:o.y,r:d(e.count)/2,setValue:([t,n])=>{e.value=[t,n]}}}),n=4,i=5;for(let t=0;t0&&s{const n=t.leaflet.containerPointToLatLng([e.x,e.y]);e.isCluster?e.ref.value=[n.lng,n.lat]:(e.ref.location.lng=n.lng,e.ref.location.lat=n.lat)})}return{clusters:s,nonClusterNodes:r,nonClusterLinks:a}}updateMetadata(){if(this.config.metadata){const t=this.utils.getMetadata(this.data),e=document.querySelector(".njg-metaData"),n=document.querySelectorAll(".njg-metaDataItems");for(let t=0;t{const i=document.createElement("div");i.classList.add("njg-metaDataItems");const o=document.createElement("span");o.setAttribute("class","njg-keyLabel");const r=document.createElement("span");r.setAttribute("class","njg-valueLabel"),o.innerHTML=n,r.innerHTML=t[n],i.appendChild(o),i.appendChild(r),e.appendChild(i)})}}getMetadata(t){const e=t,n={};return e.label&&(n.label=e.label),["protocol","version","revision","metric","router_id","topology_id"].forEach(t=>{e[t]&&(n[t]=e[t])}),n.nodes=e.nodes.length,n.links=e.links.length,n}nodeInfo(t){const e={};!t._generatedIdentity&&(e.id=t.id,t.label&&"string"==typeof t.label&&(e.label=t.label)),t.name&&(e.name=t.name),t.location&&(e.location=t.location);let n=null;Array.isArray(t.clients)?n=t.clients:t.properties&&Array.isArray(t.properties.clients)&&(n=t.properties.clients);let i=0;n?i=n.length:"number"==typeof t.clients?i=t.clients:t.properties&&"number"==typeof t.properties.clients&&(i=t.properties.clients),i>0&&(e.clients=i),n&&n.length&&n.forEach((t,n)=>{e[`clients [${n+1}]`]=t});const o=(t,e)=>"location"===t&&e&&"object"==typeof e?{lat:e.lat,lng:e.lng}:"time"===t&&"string"==typeof e?this.dateParse({dateString:e}):e,r=t._source&&this.isObject(t._source)?t._source:t;if(Object.keys(r).forEach(t=>{if("properties"===t||"clients"===t||"_source"===t||"_generatedIdentity"===t||"local_addresses"===t||"linkCount"===t)return;const n=o(t,r[t]);null!=n&&""!==n&&(e[t]=n)}),r.properties&&this.isObject(r.properties)&&Object.keys(r.properties).forEach(t=>{if("clients"===t)return;const n=o(t,r.properties[t]);null==n||"string"==typeof n&&""===n.trim()||(e[t]=n)}),t.linkCount&&(e.links=t.linkCount),Array.isArray(r.local_addresses)){const t=r.local_addresses.map(t=>"string"==typeof t?t:t&&"string"==typeof t.address?t.address:null).filter(t=>t);t.length&&(e.localAddresses=t)}return t.local_addresses&&(e.localAddresses=t.local_addresses),e}createTooltipItem(t,e){const n=document.createElement("div");n.classList.add("njg-tooltip-item");const i=document.createElement("span");i.setAttribute("class","njg-tooltip-key");const o=document.createElement("span");return o.setAttribute("class","njg-tooltip-value"),i.innerHTML=t,o.innerHTML=e,n.appendChild(i),n.appendChild(o),n}getNodeTooltipInfo(t){const e=document.createElement("div");e.classList.add("njg-tooltip-inner");const n=!t._generatedIdentity;return n&&t.id&&e.appendChild(this.createTooltipItem("id",t.id)),n&&t.label&&"string"==typeof t.label&&e.appendChild(this.createTooltipItem("label",t.label)),t.properties&&Object.keys(t.properties).forEach(i=>{if("object"!=typeof t.properties[i]&&!i.startsWith("_")&&("id"!==i&&"label"!==i||!n))if("location"===i)e.appendChild(this.createTooltipItem("location",`${Math.round(1e3*t.properties.location.lat)/1e3}, ${Math.round(1e3*t.properties.location.lng)/1e3}`));else if("time"===i){const n=this.dateParse({dateString:t.properties[i]});e.appendChild(this.createTooltipItem("time",n))}else e.appendChild(this.createTooltipItem(`${i.replace(/_/g," ")}`,t.properties[i]))}),t.linkCount&&e.appendChild(this.createTooltipItem("Links",t.linkCount)),t.local_addresses&&e.appendChild(this.createTooltipItem("Local Addresses",t.local_addresses.join("
"))),e}getLinkTooltipInfo(t){const e=document.createElement("div");e.classList.add("njg-tooltip-inner");const n=t=>"string"==typeof t&&t.startsWith("gjn_");return n(t.source)||e.appendChild(this.createTooltipItem("source",t.source)),n(t.target)||e.appendChild(this.createTooltipItem("target",t.target)),null!=t.cost&&e.appendChild(this.createTooltipItem("cost",t.cost)),t.properties&&Object.keys(t.properties).forEach(n=>{const i=t.properties[n];if(null!=i)if("time"===n){const t=this.dateParse({dateString:i});e.appendChild(this.createTooltipItem("time",t))}else{const t="string"==typeof i?i.replace(/\n/g,"
"):i;e.appendChild(this.createTooltipItem(`${n.replace(/_/g," ")}`,t))}}),e}linkInfo(t){const e={},n=t=>"string"==typeof t&&t.startsWith("gjn_");return n(t.source)||(e.source=t.source),n(t.target)||(e.target=t.target),null!=t.cost&&(e.cost=t.cost),t.properties&&Object.keys(t.properties).forEach(n=>{const i=t.properties[n];if(null!=i)if("time"===n){const t=this.dateParse({dateString:i});e[n]=t}else{const t="string"==typeof i?i.replace(/\n/g,"
"):i;e[n.replace(/_/g," ")]=t}}),e}generateStyle(t,e){return"function"==typeof t?t(e):t}getNodeStyle(t,e,n){let i,o={},r={},a=!1;if(t.category&&e.nodeCategories&&e.nodeCategories.length){const n=e.nodeCategories.find(e=>e.name===t.category);if(n){a=!0,i=this.generateStyle(n.nodeStyle||{},t),o=this.generateStyle(n.nodeSize||{},t);let e={},s={};n.emphasis&&(e=this.generateStyle(n.emphasis.nodeStyle||{},t),s=this.generateStyle(n.emphasis.nodeSize||{},t),r={nodeStyle:e,nodeSize:s})}}if(!a)if("map"===n){const n=e.mapOptions&&e.mapOptions.nodeConfig;i=this.generateStyle(n&&n.nodeStyle||{},t),o=this.generateStyle(n&&n.nodeSize||{},t);const a=n&&n.emphasis;a&&(r={nodeStyle:this.generateStyle(a&&a.nodeStyle||{},t),nodeSize:this.generateStyle(a&&a.nodeSize||{},t)})}else{const n=e.graphConfig&&e.graphConfig.series;i=this.generateStyle(n&&n.nodeStyle||{},t),o=this.generateStyle(n&&n.nodeSize||{},t);const a=n&&n.emphasis;a&&(r={nodeStyle:this.generateStyle(a&&a.itemStyle||{},t),nodeSize:this.generateStyle(a&&a.symbolSize||o||{},t)})}return{nodeStyleConfig:i,nodeSizeConfig:o,nodeEmphasisConfig:r}}getLinkStyle(t,e,n){let i,o={};if(t.category&&e.linkCategories.length){const n=e.linkCategories.find(e=>e.name===t.category);i=this.generateStyle(n.linkStyle||{},t),o={...o,linkStyle:n.emphasis?this.generateStyle(n.emphasis.linkStyle||{},t):{}}}else i=this.generateStyle("map"===n?e.mapOptions.linkConfig.linkStyle:e.graphConfig.series.linkStyle,t);return{linkStyleConfig:i,linkEmphasisConfig:o}}showLoading(){let t=this.el.querySelector(".njg-loadingContainer");return t?t.style.visibility="visible":(t=document.createElement("div"),t.classList.add("njg-loadingContainer"),t.innerHTML='\n
\n
\n

Loading...

\n
\n ',this.el.appendChild(t)),t}hideLoading(){const t=this.el.querySelector(".njg-loadingContainer");return t&&(t.style.visibility="hidden"),t}createEvent(){const t=new Map,e=new Map;return{on(e,...n){t.set(e,[...t.get(e)||[],...n])},once(t,...n){e.set(t,[...e.get(t)||[],...n])},emit(n){const i=t.get(n)||[],o=e.get(n)||[],r=i.map(t=>t()),a=o.map(t=>t());return e.delete(n),[...r,...a]},delete(n){t.delete(n),e.delete(n)}}}parseUrlFragments(){let t;try{t=decodeURIComponent(window.location.hash.replace(/^#/,""))}catch(e){t=window.location.hash.replace(/^#/,"")}const e={};return t.split(";").forEach(t=>{const n=new URLSearchParams(t),i=n.get("id");null!=i&&(e[i]=n)}),e}updateUrlFragments(t,e){const n=Object.values(t).map(t=>t.toString()).join(";");if(!n)return void window.history.pushState(e,"",window.location.pathname+window.location.search);const i=n.replace(/([^&=]+)=([^&;]*)/g,(t,e,n)=>`${e}=${encodeURIComponent(n.replace(/%7E/gi,"~"))}`);window.history.pushState(e,"",`#${i}`)}addActionToUrl(t,e){if(!t.config.bookmarkableActions.enabled||!e.data||e.data.cluster)return;if(!t.nodeLinkIndex)return void console.error("Lookup object for node or link not found.");const n=this.parseUrlFragments(),{id:i}=t.config.bookmarkableActions;let o;if(t.config.render===t.utils.graphRender){if("node"===e.dataType)o=e.data.id;else if("edge"===e.dataType){const{source:t,target:n}=e.data;o=`${t}~${n}`}}else if(t.config.render===t.utils.mapRender)if("scatter"===e.seriesType)o=e.data.node.id;else if("lines"===e.seriesType){const{source:t,target:n}=e.data.link;o=`${t}~${n}`}o&&t.nodeLinkIndex[o]?(n[i]||(n[i]=new URLSearchParams,n[i].set("id",i)),n[i].set("nodeId",o),this.updateUrlFragments(n,t.nodeLinkIndex[o])):console.error("nodeId not found in nodeLinkIndex lookup.")}removeUrlFragment(t,e=null,n=!1){const i=this.parseUrlFragments();if(i[t]){if(e){i[t].delete(e);const o=Array.from(i[t].keys()).filter(t=>"id"!==t);n||0!==o.length||delete i[t]}else delete i[t];this.updateUrlFragments(i,{id:t})}}applyUrlFragmentState(t){if(!t.config.bookmarkableActions.enabled)return;const{id:e}=t.config.bookmarkableActions,n=t.utils.parseUrlFragments(),i=n[e]&&n[e].get?n[e]:null,o=i&&i.get?i.get("nodeId"):void 0;if(!o||!t.nodeLinkIndex||null==t.nodeLinkIndex[o])return void(t.leaflet&&t.leaflet.currentPopup&&t.leaflet.currentPopup.remove());const[r,a]=o.split("~"),s=t.nodeLinkIndex[o],l=t.config.graphConfig&&t.config.graphConfig.series&&t.config.graphConfig.series.type||t.config.mapOptions&&t.config.mapOptions.nodeConfig&&t.config.mapOptions.nodeConfig.type,{location:u,cluster:h}=s||{};t.config.bookmarkableActions.zoomOnRestore&&["scatter","effectScatter"].includes(l)&&null==a&&null!=u&&t.leaflet&&t.leaflet.setView([u.lat,u.lng],null!=h?t.config.disableClusteringAtLevel:t.config.bookmarkableActions.zoomLevel||t.config.showMapLabelsAtZoom),null==a&&t.config.mapOptions?.nodePopup?.show&&t.gui.loadNodePopup(s),"function"==typeof t.config.onClickElement&&t.config.onClickElement.call(t,r&&a?"link":"node",s)}setupHashChangeHandler(t){return t._popstateHandler&&window.removeEventListener("popstate",t._popstateHandler),t._popstateHandler=()=>{this.applyUrlFragmentState(t)},window.addEventListener("popstate",t._popstateHandler),()=>{window.removeEventListener("popstate",t._popstateHandler),t._popstateHandler=null}}moveNodeInRealTime(t,e){if(!this.echarts||"function"!=typeof this.echarts.getOption)return void console.warn("moveNodeInRealTime: ECharts instance not ready");const n=this.echarts.getOption();if(!n||!Array.isArray(n.series))return void console.warn("moveNodeInRealTime: No series data available");const i=n.series.find(t=>"scatter"===t.type||"effectScatter"===t.type);if(!i)return void console.warn("moveNodeInRealTime: No scatter series found");const o=i.data.findIndex(e=>e.node.id===t);if(-1===o)return void console.warn(`moveNodeInRealTime: Node with id "${t}" not found`);const r=i.data[o],{node:a}=r;a.location=e,a.properties?(a.properties.location=e,r.value=[e.lng,e.lat],this.nodeLinkIndex[t].location=e,this.nodeLinkIndex[t].properties&&(this.nodeLinkIndex[t].properties.location=e,this.echarts.setOption({series:n.series}))):console.warn("moveNodeInRealTime: Node properties not found")}updateLabelVisibility(t,e){if(!t.echarts||"function"!=typeof t.echarts.setOption)return void console.warn("updateLabelVisibility: ECharts instance not ready");const n=e&&!1!==t.config.showMapLabelsAtZoom&&t.leaflet.getZoom()>=t.config.showMapLabelsAtZoom,i=(t.config.mapOptions?.baseOptions?.media||[]).some(t=>!0===t.option?.tooltip?.show);t.echarts.setOption({series:[{id:"geo-map",label:{show:n,silent:!0},emphasis:{label:{show:!i}}}]})}setTooltipVisibility(t,e){t.el&&t.el.classList.toggle("njg-hide-tooltip",!e)}},HT=class extends ZT{searchElements(t){const e=this,n={"":{data:{...e.data},param:[...e.JSONParam]}};return window.history.pushState({searchValue:""},""),window.onpopstate=i=>{n[i.state.searchValue]?e.utils.JSONDataUpdate.call(e,n[i.state.searchValue].data).then(()=>{e.JSONParam=n[i.state.searchValue].param}):e.utils.JSONDataUpdate.call(e,t+i.state.searchValue)},function(i,o=!0,r=!0){const a=i.trim();if(!window.history.state||window.history.state&&window.history.state.searchValue!==a)return window.history.pushState({searchValue:a},""),e.utils.JSONDataUpdate.call(e,t+a,o,r).then(()=>{n[a]={data:{...e.data},param:[...e.JSONParam]}})}}JSONDataUpdate(t,e=!0,n=!0){const i=this;return i.config.onUpdate.call(i),i.utils.paginatedDataParse.call(i,t).then(o=>{function r(){e?(i.JSONParam=[t],i.utils.overrideData(o,i)):(i.JSONParam.push(t),i.config.render===i.utils.mapRender?i.utils.appendData(o,i):i.utils.addData(o,i)),i.utils.isNetJSON(i.data)&&i.utils.updateMetadata.call(i)}return n?(i.utils.isNetJSON(i.data)&&i.config.prepareData.call(i,o),i.config.dealDataByWorker?i.utils.dealDataByWorker.call(i,o,i.config.dealDataByWorker,r):r()):r(),o}).catch(t=>{console.error(t)})}dealDataByWorker(t,e,n){const i=new Worker(e),o=this;i.postMessage(t),i.addEventListener("error",t=>{console.error(t),console.error("Error in dealing JSONData!")}),i.addEventListener("message",t=>{n?n():(o.utils.overrideData(t.data,o),o.utils.isNetJSON(o.data)&&o.utils.updateMetadata.call(o))})}overrideData(t,e){e.data=t,e.utils.isNetJSON(e.data)||e.leaflet.geoJSON.removeFrom(e.leaflet),e.utils.render(),e.config.afterUpdate.call(e)}},WT=class{constructor(t){this.utils=new HT,this.config=this.utils.deepCopy(NT),this.config.crs=NT.crs,this.JSONParam=this.utils.isArray(t)?t:[t]}setConfig(t){if(this.utils.deepMergeObj(this.config,t),this.el)t&&t.el&&console.error("Can't change el again!");else if(this.el=this.config.el?this.utils.isElement(this.config.el)?this.config.el:document.querySelector(this.config.el):document.body,this.el){if(this.el.classList.add("njg-container"),this.el===document.body){const t=document.documentElement;t.style.width="100%",t.style.height="100%",this.el.classList.add("njg-relativePosition")}}else console.error("NetJSONGraph: The specified element for rendering was not found and could not be set.");return this.config}render(){const[t,...e]=this.JSONParam;this.config.onRender.call(this);const n=new Promise(t=>{this.event.once("onReady",async()=>{try{await this.config.onReady.call(this)}catch(t){console.error("onReady callback failed:",t)}t()})});if(this.event.once("onLoad",this.config.onLoad.bind(this)),this.event.once("applyUrlFragmentState",async()=>{await n,this.utils.applyUrlFragmentState.call(this,this)}),this.utils.paginatedDataParse.call(this,t).then(t=>{if(this.utils.isNetJSON(t))this.type="netjson";else{if(!this.utils.isGeoJSON(t))throw new Error("Invalid data format!");this.type="geojson",this.originalGeoJSON=this.utils.fastDeepCopy(t),t=this.utils.geojsonToNetjson(t)}if(this.utils.isNetJSON(t)){t.nodes.length>this.config.maxPointsFetched&&(this.hasMoreData=!0),t.nodes.splice(this.config.maxPointsFetched-1,t.nodes.length-this.config.maxPointsFetched);const e=new Set;this.nodeLinkIndex={},t.nodes.forEach(t=>{e.add(t.id),this.nodeLinkIndex[t.id]=t}),t.links=t.links.filter(t=>e.has(t.source)&&e.has(t.target)?(this.nodeLinkIndex[`${t.source}~${t.target}`]=t,!0):(e.has(t.source)?console.warn(`Node ${t.target} does not exist!`):console.warn(`Node ${t.source} does not exist!`),!1))}this.config.prepareData.call(this,t),this.data=t,this.config.dealDataByWorker?this.utils.dealDataByWorker.call(this,t,this.config.dealDataByWorker):(this.data=t,this.utils.render())}).catch(t=>{console.error(t)}),e.length){const n=function(){e.map(t=>this.utils.JSONDataUpdate.call(this,t,!1))};this.JSONParam=[t],this.event.once("renderArray",n.bind(this))}}setUtils(t={}){const e=this;return e.utils=Object.assign(e.utils,{...t},{render(){if(!e.config.render)throw new Error("No render function!");e.config.render(e.data,e)}}),"function"==typeof e.utils.moveNodeInRealTime&&(e.utils.moveNodeInRealTime=e.utils.moveNodeInRealTime.bind(e)),e.utils}};var jT,GT={},UT=[],YT={registerPreprocessor:cl,registerProcessor:dl,registerPostInit:function(t){pl("afterinit",t)},registerPostUpdate:function(t){pl("afterupdate",t)},registerUpdateLifecycle:pl,registerAction:fl,registerCoordinateSystem:gl,registerLayout:function(t,e){yl(IT,t,e,1e3,"layout")},registerVisual:ml,registerTransform:function(t){var e=(t=o(t)).type;e||Ir("");var n=e.split(":");2!==n.length&&Ir("");var i=!1;"echarts"===n[0]&&(e=n[1],i=!0),t.__isBuiltIn=i,ow.set(e,t)},registerLoading:vl,registerMap:function(t,e,n){var i=lT.registerMap;i&&i(t,e,n)},registerImpl:function(t,e){lT[t]=e},PRIORITY:cT,ComponentModel:W_,ComponentView:ww,SeriesModel:_w,ChartView:Kb,registerComponentModel:function(t){W_.registerClass(t)},registerComponentView:function(t){ww.registerClass(t)},registerSeriesModel:function(t){_w.registerClass(t)},registerChartView:function(t){Kb.registerClass(t)},registerCustomSeries:function(t,e){!function(t,e){GT[t]=e}(t,e)},registerSubTypeDefaulter:function(t,e){W_.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){Bm[t]=e}},XT=cb.prototype,qT=gb.prototype,KT=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};e(function(){return null!==jT&&jT.apply(this,arguments)||this},jT=KT);const $T=function(t){function n(e){var n=t.call(this,e)||this;return n.type="ec-line",n}return e(n,t),n.prototype.getDefaultStyle=function(){return{stroke:X_.color.neutral99,fill:null}},n.prototype.getDefaultShape=function(){return new KT},n.prototype.buildPath=function(t,e){kl(e)?XT.buildPath.call(this,t,e):qT.buildPath.call(this,t,e)},n.prototype.pointAt=function(t){return kl(this.shape)?XT.pointAt.call(this,t):qT.pointAt.call(this,t)},n.prototype.tangentAt=function(t){var e=this.shape,n=kl(e)?[e.x2-e.x1,e.y2-e.y1]:qT.tangentAt.call(this,t);return Q(n,n)},n}(ov);var JT=["fromSymbol","toSymbol"],QT=function(t){function n(e,n,i){var o=t.call(this)||this;return o._createLine(e,n,i),o}return e(n,t),n.prototype._createLine=function(t,e,n){var i=t.hostModel,o=t.getItemLayout(e),r=t.getItemVisual(e,"z2"),a=function(t){var e=new $T({name:"line",subPixelOptimize:!0});return Dl(e.shape,t),e}(o);a.shape.percent=0,La(a,{z2:L(r,0),shape:{percent:1}},i,e),this.add(a),c(JT,function(n){var i=Pl(n,t,e);this.add(i),this[Il(n)]=Ll(n,t,e)},this),this._updateCommonStl(t,e,n)},n.prototype.updateData=function(t,e,n){var i=t.hostModel,o=this.childOfName("line"),r=t.getItemLayout(e),a={shape:{}};Dl(a.shape,r),Ia(o,a,i,e),c(JT,function(n){var i=Ll(n,t,e),o=Il(n);if(this[o]!==i){this.remove(this.childOfName(n));var r=Pl(n,t,e);this.add(r)}this[o]=i},this),this._updateCommonStl(t,e,n)},n.prototype.getLinePath=function(){return this.childAt(0)},n.prototype._updateCommonStl=function(t,e,n){var i=t.hostModel,o=this.childOfName("line"),r=n&&n.emphasisLineStyle,a=n&&n.blurLineStyle,s=n&&n.selectLineStyle,l=n&&n.labelStatesModels,u=n&&n.emphasisDisabled,h=n&&n.focus,d=n&&n.blurScope;if(!n||t.hasItemOption){var p=t.getItemModel(e),f=p.getModel("emphasis");r=f.getModel("lineStyle").getLineStyle(),a=p.getModel(["blur","lineStyle"]).getLineStyle(),s=p.getModel(["select","lineStyle"]).getLineStyle(),u=f.get("disabled"),h=f.get("focus"),d=f.get("blurScope"),l=ho(p)}var g=t.getItemVisual(e,"style"),m=g.stroke;o.useStyle(g),o.style.fill=null,o.style.strokeNoScale=!0,o.ensureState("emphasis").style=r,o.ensureState("blur").style=a,o.ensureState("select").style=s,c(JT,function(t){var e=this.childOfName(t);if(e){e.setColor(m),e.style.opacity=g.opacity;for(var n=0;n0&&(_[0]=-_[0],_[1]=-_[1]);var w=v[0]<0?-1:1;if("start"!==o.__position&&"end"!==o.__position){var b=-Math.atan2(v[1],v[0]);h[0].8?"left":c[0]<-.8?"right":"center",p=c[1]>.8?"top":c[1]<-.8?"bottom":"middle";break;case"start":o.x=-c[0]*g+u[0],o.y=-c[1]*m+u[1],d=c[0]>.8?"right":c[0]<-.8?"left":"center",p=c[1]>.8?"bottom":c[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":o.x=g*w+u[0],o.y=u[1]+S,d=v[0]<0?"right":"left",o.originX=-g*w,o.originY=-S;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":o.x=x[0],o.y=x[1]+S,d="center",o.originY=-S;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":o.x=-g*w+h[0],o.y=h[1]+S,d=v[0]>=0?"right":"left",o.originX=g*w,o.originY=-S}o.scaleX=o.scaleY=r,o.setStyle({verticalAlign:o.__verticalAlign||p,align:o.__align||d})}}}},n}(Em);const tM=QT,eM=function(){function t(t){this.group=new Em,this._LineCtor=t||tM}return t.prototype.updateData=function(t){var e=this;this._progressiveEls=null;var n=this,i=n.group,o=n._lineData;n._lineData=t,o||i.removeAll();var r=Al(t);t.diff(o).add(function(n){e._doAdd(t,n,r)}).update(function(n,i){e._doUpdate(o,t,i,n,r)}).remove(function(t){i.remove(o.getItemGraphicEl(t))}).execute()},t.prototype.updateLayout=function(){var t=this._lineData;t&&t.eachItemGraphicEl(function(e,n){e.updateLayout(t,n)},this)},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=Al(t),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e){function n(t){t.isGroup||function(t){return t.animators&&t.animators.length>0}(t)||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var i=t.start;i0&&(r=this._getLineLength(i)/l*1e3),r!==this._period||a!==this._loop||s!==this._roundTrip){i.stopAnimation();var h=void 0;h=v(u)?u(n):u,i.__t>0&&(h=-r*i.__t),this._animateSymbol(i,r,h,a,s)}this._period=r,this._loop=a,this._roundTrip=s}},n.prototype._animateSymbol=function(t,e,n,i,o){if(e>0){t.__t=0;var r=this,a=t.animate("",i).when(o?2*e:e,{__t:o?2:1}).delay(n).during(function(){r._updateSymbolPosition(t)});i||a.done(function(){r.remove(t)}),a.start()}},n.prototype._getLineLength=function(t){return Cf(t.__p1,t.__cp1)+Cf(t.__cp1,t.__p2)},n.prototype._updateAnimationPoints=function(t,e){t.__p1=e[0],t.__p2=e[1],t.__cp1=e[2]||[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]},n.prototype.updateData=function(t,e,n){this.childAt(0).updateData(t,e,n),this._updateEffectSymbol(t,e)},n.prototype._updateSymbolPosition=function(t){var e=t.__p1,n=t.__p2,i=t.__cp1,o=t.__t<1?t.__t:2-t.__t,r=[t.x,t.y],a=r.slice(),s=jt,l=Gt;r[0]=s(e[0],i[0],n[0],o),r[1]=s(e[1],i[1],n[1],o);var u=t.__t<1?l(e[0],i[0],n[0],o):l(n[0],i[0],e[0],1-o),h=t.__t<1?l(e[1],i[1],n[1],o):l(n[1],i[1],e[1],1-o);t.rotation=-Math.atan2(h,u)-Math.PI/2,"line"!==this._symbolType&&"rect"!==this._symbolType&&"roundRect"!==this._symbolType||(void 0!==t.__lastT&&t.__lastT=0&&!(i[r]<=e);r--);r=Math.min(r,o-2)}else{for(r=a;re);r++);r=Math.min(r-1,o-2)}var s=(e-i[r])/(i[r+1]-i[r]),l=n[r],u=n[r+1];t.x=l[0]*(1-s)+s*u[0],t.y=l[1]*(1-s)+s*u[1],t.rotation=-Math.atan2(t.__t<1?u[1]-l[1]:l[1]-u[1],t.__t<1?u[0]-l[0]:l[0]-u[0])-Math.PI/2,this._lastFrame=r,this._lastFramePercent=e,t.ignore=!1}},n}(iM);const sM=aM;var lM=function(){this.polyline=!1,this.curveness=0,this.segs=[]},uM=function(t){function n(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return e(n,t),n.prototype.reset=function(){this.notClear=!1,this._off=0},n.prototype.getDefaultStyle=function(){return{stroke:X_.color.neutral99,fill:null}},n.prototype.getDefaultShape=function(){return new lM},n.prototype.buildPath=function(t,e){var n,i=e.segs,o=e.curveness;if(e.polyline)for(n=this._off;n0){t.moveTo(i[n++],i[n++]);for(var a=1;a0?t.quadraticCurveTo((s+u)/2-(l-h)*o,(l+h)/2-(u-s)*o,u,h):t.lineTo(u,h)}this.incremental&&(this._off=n,this.notClear=!0)},n.prototype.findDataIndex=function(t,e){var n=this.shape,i=n.segs,o=n.curveness,r=this.style.lineWidth;if(n.polyline)for(var a=0,s=0;s0)for(var u=i[s++],h=i[s++],c=1;c0){if(ui(u,h,(u+d)/2-(h-p)*o,(h+p)/2-(d-u)*o,d,p,r,t,e))return a}else if(si(u,h,d,p,r,t,e))return a;a++}return-1},n.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e);return this.getBoundingRect().contain(t=n[0],e=n[1])?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},n.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape.segs,n=1/0,i=1/0,o=-1/0,r=-1/0,a=0;a0&&(r.dataIndex=n+t.__startIndex)})},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}();var cM={seriesType:"lines",plan:ma(),reset:function(t){var e=t.coordinateSystem;if(e){var n=t.get("polyline"),i=t.pipelineContext.large;return{progress:function(o,r){var a=[];if(i){var s=void 0,l=o.end-o.start;if(n){for(var u=0,h=o.start;h0&&(l||s.configLayer(r,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(a/10+.9,1),0)})),o.updateData(i);var u=t.get("clip",!0)&&function(t,e,n){return t?"polar"===t.type?function(t){var e=t.getArea(),n=rn(e.r0,1),i=rn(e.r,1),o=new Jw({shape:{cx:rn(t.cx,1),cy:rn(t.cy,1),r0:n,r:i,startAngle:e.startAngle,endAngle:e.endAngle,clockwise:e.clockwise}});return o}(t):"cartesian2d"===t.type?function(t,e,n){var i=t.getArea(),o=i.x,r=i.y,a=i.width,s=i.height,l=n.get(["lineStyle","width"])||0;o-=l/2,r-=l/2,a+=l,s+=l,a=Math.ceil(a),o!==Math.floor(o)&&(o=Math.floor(o),a++);var u=new mv({shape:{x:o,y:r,width:a,height:s}});return u}(t,0,n):null:null}(t.coordinateSystem,0,t);u?this.group.setClipPath(u):this.group.removeClipPath(),this._lastZlevel=r,this._finished=!0},n.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData();this._updateLineDraw(i,t).incrementalPrepareUpdate(i),this._clearLayer(n),this._finished=!1},n.prototype.incrementalRender=function(t,e,n){this._lineDraw.incrementalUpdate(t,e.getData()),this._finished=t.end===e.getData().count()},n.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},n.prototype.updateTransform=function(t,e,n){var i=t.getData(),o=t.pipelineContext;if(!this._finished||o.large||o.progressiveRender)return{update:!0};var r=dM.reset(t,e,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),this._lineDraw.updateLayout(),this._clearLayer(n)},n.prototype._updateLineDraw=function(t,e){var n=this._lineDraw,i=this._showEffect(e),o=!!e.get("polyline"),r=e.pipelineContext.large;return n&&i===this._hasEffet&&o===this._isPolyline&&r===this._isLargeDraw||(n&&n.remove(),n=this._lineDraw=r?new hM:new eM(o?i?sM:rM:i?iM:tM),this._hasEffet=i,this._isPolyline=o,this._isLargeDraw=r),this.group.add(n.group),n},n.prototype._showEffect=function(t){return!!t.get(["effect","show"])},n.prototype._clearLayer=function(t){var e=t.getZr();"svg"===e.painter.getType()||null==this._lastZlevel||e.painter.getLayer(this._lastZlevel).clear(!0)},n.prototype.remove=function(t,e){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(e)},n.prototype.dispose=function(t,e){this.remove(t,e)},n.type="lines",n}(Kb);var fM=function(){function t(t,e,n,i,o,r){this._old=t,this._new=e,this._oldKeyGetter=n||Rl,this._newKeyGetter=i||Rl,this.context=o,this._diffModeMultiple="multiple"===r}return t.prototype.add=function(t){return this._add=t,this},t.prototype.update=function(t){return this._update=t,this},t.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},t.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},t.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},t.prototype.remove=function(t){return this._remove=t,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var t=this._old,e=this._new,n={},i=new Array(t.length),o=new Array(e.length);this._initIndexMap(t,null,i,"_oldKeyGetter"),this._initIndexMap(e,n,o,"_newKeyGetter");for(var r=0;r1){var u=s.shift();1===s.length&&(n[a]=s[0]),this._update&&this._update(u,r)}else 1===l?(n[a]=null,this._update&&this._update(s,r)):this._remove&&this._remove(r)}this._performRestAdd(o,n)},t.prototype._executeMultiple=function(){var t=this._new,e={},n={},i=[],o=[];this._initIndexMap(this._old,e,i,"_oldKeyGetter"),this._initIndexMap(t,n,o,"_newKeyGetter");for(var r=0;r1&&1===h)this._updateManyToOne&&this._updateManyToOne(l,s),n[a]=null;else if(1===u&&h>1)this._updateOneToMany&&this._updateOneToMany(l,s),n[a]=null;else if(1===u&&1===h)this._update&&this._update(l,s),n[a]=null;else if(u>1&&h>1)this._updateManyToMany&&this._updateManyToMany(l,s),n[a]=null;else if(u>1)for(var c=0;c1)for(var a=0;a=e)){var n=this._store.getProvider();this._updateOrdinalMeta();var i=this._nameList,o=this._idList;if(n.getSource().sourceFormat===ox&&!n.pure)for(var r=[],a=t;a0},t.prototype.ensureUniqueItemVisual=function(t,e){var n=this._itemVisuals,i=n[t];i||(i=n[t]={});var o=i[e];return null==o&&(y(o=this.getVisual(e))?o=o.slice():IM(o)&&(o=a({},o)),i[e]=o),o},t.prototype.setItemVisual=function(t,e,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,IM(e)?a(i,e):i[e]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(t,e){IM(t)?a(this._layout,t):this._layout[t]=e},t.prototype.getLayout=function(t){return this._layout[t]},t.prototype.getItemLayout=function(t){return this._itemLayouts[t]},t.prototype.setItemLayout=function(t,e,n){this._itemLayouts[t]=n?a(this._itemLayouts[t]||{},e):e},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(t,e){!function(t,e,n,i){if(i){var o=Mv(i);o.dataIndex=n,o.dataType=e,o.seriesIndex=t,o.ssrType="chart","group"===i.type&&i.traverse(function(i){var o=Mv(i);o.seriesIndex=t,o.dataIndex=n,o.dataType=e,o.ssrType="chart"})}}(this.hostModel&&this.hostModel.seriesIndex,this.dataType,t,e),this._graphicEls[t]=e},t.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},t.prototype.eachItemGraphicEl=function(t,e){c(this._graphicEls,function(n,i){n&&t&&t.call(e,n,i)})},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:LM(this.dimensions,this._getDimInfo,this),this.hostModel)),bM(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(t,e){var n=this[t];v(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=n.apply(this,arguments);return e.apply(this,[t].concat(D(arguments)))})},t.internalField=(vM=function(t){var e=t._invertedIndicesMap;c(e,function(n,i){var o=t._dimInfos[i],r=o.ordinalMeta,a=t._store;if(r){n=e[i]=new PM(r.categories.length);for(var s=0;s1&&(s+="__ec__"+u),i[e]=s}})),t}();const zM=OM;var EM="undefined"==typeof Uint32Array?Array:Uint32Array,RM="undefined"==typeof Float64Array?Array:Float64Array,BM=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.visualStyleAccessPath="lineStyle",e.visualDrawType="stroke",e}return e(n,t),n.prototype.init=function(e){e.data=e.data||[],Hl(e);var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count)),t.prototype.init.apply(this,arguments)},n.prototype.mergeOption=function(e){if(Hl(e),e.data){var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count))}t.prototype.mergeOption.apply(this,arguments)},n.prototype.appendData=function(t){var e=this._processFlatCoordsArray(t.data);e.flatCoords&&(this._flatCoords?(this._flatCoords=N(this._flatCoords,e.flatCoords),this._flatCoordsOffset=N(this._flatCoordsOffset,e.flatCoordsOffset)):(this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset),t.data=new Float32Array(e.count)),this.getRawData().appendData(t.data)},n.prototype._getCoordsFromItemModel=function(t){var e=this.getData().getItemModel(t);return e.option instanceof Array?e.option:e.getShallow("coords")},n.prototype.getLineCoordsCount=function(t){return this._flatCoordsOffset?this._flatCoordsOffset[2*t+1]:this._getCoordsFromItemModel(t).length},n.prototype.getLineCoords=function(t,e){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*t],i=this._flatCoordsOffset[2*t+1],o=0;o ")})},n.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},n.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},n.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},n.prototype.getZLevelKey=function(){var t=this.getModel("effect"),e=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&e>0?e+"":""},n.type="series.lines",n.dependencies=["grid","polar","geo","calendar"],n.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}},n}(_w);const NM=BM,FM={seriesType:"lines",reset:function(t){var e=Wl(t.get("symbol")),n=Wl(t.get("symbolSize")),i=t.getData();return i.setVisual("fromSymbol",e&&e[0]),i.setVisual("toSymbol",e&&e[1]),i.setVisual("fromSymbolSize",n&&n[0]),i.setVisual("toSymbolSize",n&&n[1]),{dataEach:i.hasItemOption?function(t,e){var n=t.getItemModel(e),i=Wl(n.getShallow("symbol",!0)),o=Wl(n.getShallow("symbolSize",!0));i[0]&&t.setItemVisual(e,"fromSymbol",i[0]),i[1]&&t.setItemVisual(e,"toSymbol",i[1]),o[0]&&t.setItemVisual(e,"fromSymbolSize",o[0]),o[1]&&t.setItemVisual(e,"toSymbolSize",o[1])}:null}}};var VM="--\x3e",ZM=function(t){return t.get("autoCurveness")||null},HM=function(t,e){var n=ZM(t),i=20,o=[];if(w(n))i=n;else if(y(n))return void(t.__curvenessList=n);e>i&&(i=e);var r=i%2?i+2:i+3;o=[];for(var a=0;a0?+p:1;k.scaleX=this._sizeX*I,k.scaleY=this._sizeY*I,this.setSymbolScale(1),io(this,u,h,c)},n.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},n.prototype.fadeOut=function(t,e,n){var i=this.childAt(0),o=Mv(this).dataIndex,r=n&&n.animation;if(this.silent=i.silent=!0,n&&n.fadeLabel){var a=i.getTextContent();a&&Da(a,{style:{opacity:0}},e,{dataIndex:o,removeOpt:r,cb:function(){i.removeTextContent()}})}else i.removeTextContent();Da(i,{style:{opacity:0},scaleX:0,scaleY:0},e,{dataIndex:o,cb:t,removeOpt:r})},n.getSymbolSize=function(t,e){return Rs(t.getItemVisual(e,"symbolSize"))},n.getSymbolZ2=function(t,e){return t.getItemVisual(e,"z2")},n}(Em);const tC=QM;var eC=function(){function t(t){this.group=new Em,this._SymbolCtor=t||tC}return t.prototype.updateData=function(t,e){this._progressiveEls=null,e=cu(e);var n=this.group,i=t.hostModel,o=this._data,r=this._SymbolCtor,a=e.disableAnimation,s=du(t),l={disableAnimation:a},u=e.getSymbolPoint||function(e){return t.getItemLayout(e)};o||n.removeAll(),t.diff(o).add(function(i){var o=u(i);if(hu(t,o,i,e)){var a=new r(t,i,s,l);a.setPosition(o),t.setItemGraphicEl(i,a),n.add(a)}}).update(function(h,c){var d=o.getItemGraphicEl(c),p=u(h);if(hu(t,p,h,e)){var f=t.getItemVisual(h,"symbol")||"circle",g=d&&d.getSymbolType&&d.getSymbolType();if(!d||g&&g!==f)n.remove(d),(d=new r(t,h,s,l)).setPosition(p);else{d.updateData(t,h,s,l);var m={x:p[0],y:p[1]};a?d.attr(m):Ia(d,m,i)}n.add(d),t.setItemGraphicEl(h,d)}else n.remove(d)}).remove(function(t){var e=o.getItemGraphicEl(t);e&&e.fadeOut(function(){n.remove(e)},i)}).execute(),this._getSymbolPoint=u,this._data=t},t.prototype.updateLayout=function(){var t=this,e=this._data;e&&e.eachItemGraphicEl(function(e,n){var i=t._getSymbolPoint(n);e.setPosition(i),e.markRedraw()})},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=du(t),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e,n){function i(t){t.isGroup||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],n=cu(n);for(var o=t.start;o3?1.4:o>1?1.2:1.1;this._checkTriggerMoveZoom(this,"zoom","zoomOnMouseWheel",t,{scale:i>0?s:1/s,originX:r,originY:a,isAvailableBehavior:null})}if(n){var l=Math.abs(i);this._checkTriggerMoveZoom(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:(i>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:r,originY:a,isAvailableBehavior:null})}}}},n.prototype._pinchHandler=function(t){pu(this._zr,"globalPan")||gu(t)||this._checkTriggerMoveZoom(this,"zoom",null,t,{scale:t.pinchScale>1?1.1:1/1.1,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})},n.prototype._checkTriggerMoveZoom=function(t,e,n,i,o){t._checkPointer(i,o.originX,o.originY)&&(Zf(i.event),i.__ecRoamConsumed=!0,xu(t,e,n,i,o))},n}(Af),aC=Ln();const sC=rC;var lC=[],uC=[],hC=[],cC=jt,dC=kf,pC=Math.abs,fC=Ln(),gC=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.init=function(t,e){var n=new nC,i=new eM,o=this.group,r=new Em;this._controller=new sC(e.getZr()),this._controllerHost={target:r},r.add(n.group),r.add(i.group),o.add(r),this._symbolDraw=n,this._lineDraw=i,this._mainGroup=r,this._firstRender=!0},n.prototype.render=function(t,e,n){var i=this,o=t.coordinateSystem,r=!1;this._model=t,this._api=n,this._active=!0;var a=this._getThumbnailInfo();a&&a.bridge.reset(n);var s=this._symbolDraw,l=this._lineDraw;if(Tu(o)){var u={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?this._mainGroup.attr(u):Ia(this._mainGroup,u,t)}Su(t.getGraph(),Jl(t));var h=t.getData();s.updateData(h);var c=t.getEdgeData();l.updateData(c),this._updateNodeAndLinkScale(),this._updateController(null,t,n),clearTimeout(this._layoutTimeout);var d=t.forceLayout,p=t.get(["force","layoutAnimation"]);d&&(r=!0,this._startForceLayoutIteration(d,n,p));var f=t.get("layout");h.graph.eachNode(function(e){var o=e.dataIndex,r=e.getGraphicEl(),a=e.getModel();if(r){r.off("drag").off("dragend");var s=a.get("draggable");s&&r.on("drag",function(a){switch(f){case"force":d.warmUp(),!i._layouting&&i._startForceLayoutIteration(d,n,p),d.setFixed(o),h.setItemLayout(o,[r.x,r.y]);break;case"circular":h.setItemLayout(o,[r.x,r.y]),e.setLayout({fixed:!0},!0),tu(t,"symbolSize",e,[a.offsetX,a.offsetY]),i.updateLayout(t);break;default:h.setItemLayout(o,[r.x,r.y]),Kl(t.getGraph(),t),i.updateLayout(t)}}).on("dragend",function(){d&&d.setUnfixed(o)}),r.setDraggable(s,!!a.get("cursor")),"adjacency"===a.get(["emphasis","focus"])&&(Mv(r).focus=e.getAdjacentDataIndices())}}),h.graph.eachEdge(function(t){var e=t.getGraphicEl(),n=t.getModel().get(["emphasis","focus"]);e&&"adjacency"===n&&(Mv(e).focus={edge:[t.dataIndex],node:[t.node1.dataIndex,t.node2.dataIndex]})});var g="circular"===t.get("layout")&&t.get(["circular","rotateLabel"]),m=h.getLayout("cx"),y=h.getLayout("cy");h.graph.eachNode(function(t){eu(t,g,m,y)}),this._firstRender=!1,r||this._renderThumbnail(t,n,this._symbolDraw,this._lineDraw)},n.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},n.prototype._startForceLayoutIteration=function(t,e,n){var i=this,o=!1;!function r(){t.step(function(t){i.updateLayout(i._model),!t&&o||(o=!0,i._renderThumbnail(i._model,e,i._symbolDraw,i._lineDraw)),(i._layouting=!t)&&(n?i._layoutTimeout=setTimeout(r,16):r())})}()},n.prototype._updateController=function(t,e,n){var i=this._controller,o=this._controllerHost,r=e.coordinateSystem;Tu(r)?(i.enable(e.get("roam"),{api:n,zInfo:{component:e},triggerInfo:{roamTrigger:e.get("roamTrigger"),isInSelf:function(t,e,n){return r.containPoint([e,n])},isInClip:function(e,n,i){return!t||t.contain(n,i)}}}),o.zoomLimit=e.get("scaleLimit"),o.zoom=r.getZoom(),i.off("pan").off("zoom").on("pan",function(t){n.dispatchAction({seriesId:e.id,type:"graphRoam",dx:t.dx,dy:t.dy})}).on("zoom",function(t){n.dispatchAction({seriesId:e.id,type:"graphRoam",zoom:t.scale,originX:t.originX,originY:t.originY})})):i.disable()},n.prototype.updateViewOnPan=function(t,e,n){this._active&&(function(t,e,n){var i=t.target;i.x+=e,i.y+=n,i.dirty()}(this._controllerHost,n.dx,n.dy),this._updateThumbnailWindow())},n.prototype.updateViewOnZoom=function(t,e,n){this._active&&(function(t,e,n,i){var o=t.target,r=t.zoomLimit,a=t.zoom=t.zoom||1,s=(a=au(a*=e,r))/t.zoom;t.zoom=a,ru(o,n,i,s),o.dirty()}(this._controllerHost,n.zoom,n.originX,n.originY),this._updateNodeAndLinkScale(),Su(t.getGraph(),Jl(t)),this._lineDraw.updateLayout(),e.updateLabelLayout(),this._updateThumbnailWindow())},n.prototype._updateNodeAndLinkScale=function(){var t=this._model,e=t.getData(),n=Jl(t);e.eachItemGraphicEl(function(t,e){t&&t.setSymbolScale(n)})},n.prototype.updateLayout=function(t){this._active&&(Su(t.getGraph(),Jl(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout())},n.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()},n.prototype._getThumbnailInfo=function(){var t=this._model,e=t.coordinateSystem;if("view"===e.type){var n=function(t){if(t)return fC(t).bridge}(t);if(n)return{bridge:n,coordSys:e}}},n.prototype._updateThumbnailWindow=function(){var t=this._getThumbnailInfo();t&&t.bridge.updateWindow(t.coordSys.transform,this._api)},n.prototype._renderThumbnail=function(t,e,n,i){var r=this._getThumbnailInfo();if(r){var s=new Em,l=n.group.children(),u=i.group.children(),h=new Em,c=new Em;s.add(c),s.add(h);for(var d=0;d=0&&t.call(e,n[o],o)},t.prototype.eachEdge=function(t,e){for(var n=this.edges,i=n.length,o=0;o=0&&n[o].node1.dataIndex>=0&&n[o].node2.dataIndex>=0&&t.call(e,n[o],o)},t.prototype.breadthFirstTraverse=function(t,e,n,i){if(e instanceof vC||(e=this._nodesMap[Mu(e)]),e){for(var o="out"===n?"outEdges":"in"===n?"inEdges":"edges",r=0;r=0&&n.node2.dataIndex>=0}),o=0,r=i.length;o=0&&!t.hasKey(p)&&(t.set(p,!0),r.push(d.node1))}for(s=0;s=0&&!t.hasKey(v)&&(t.set(v,!0),a.push(y.node2))}}}return{edge:t.keys(),node:e.keys()}},t}(),_C=function(){function t(t,e,n){this.dataIndex=-1,this.node1=t,this.node2=e,this.dataIndex=null==n?-1:n}return t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(t)},t.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},t.prototype.getTrajectoryDataIndices=function(){var t=B(),e=B();t.set(this.dataIndex,!0);for(var n=[this.node1],i=[this.node2],o=0;o=0&&!t.hasKey(u)&&(t.set(u,!0),n.push(l.node1))}for(o=0;o=0&&!t.hasKey(d)&&(t.set(d,!0),i.push(c.node2))}return{edge:t.keys(),node:e.keys()}},t}();u(vC,Cu("hostGraph","data")),u(_C,Cu("hostGraph","edgeData"));const xC=yC;var wC=Ln(),bC=function(t){this.coordSysDims=[],this.axisMap=B(),this.categoryAxisMap=B(),this.coordSysName=t},SC={cartesian2d:function(t,e,n,i){var o=t.getReferringComponents("xAxis",Km).models[0],r=t.getReferringComponents("yAxis",Km).models[0];e.coordSysDims=["x","y"],n.set("x",o),n.set("y",r),Ru(o)&&(i.set("x",o),e.firstCategoryDimIndex=0),Ru(r)&&(i.set("y",r),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,n,i){var o=t.getReferringComponents("singleAxis",Km).models[0];e.coordSysDims=["single"],n.set("single",o),Ru(o)&&(i.set("single",o),e.firstCategoryDimIndex=0)},polar:function(t,e,n,i){var o=t.getReferringComponents("polar",Km).models[0],r=o.findAxisModel("radiusAxis"),a=o.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],n.set("radius",r),n.set("angle",a),Ru(r)&&(i.set("radius",r),e.firstCategoryDimIndex=0),Ru(a)&&(i.set("angle",a),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},geo:function(t,e,n,i){e.coordSysDims=["lng","lat"]},parallel:function(t,e,n,i){var o=t.ecModel,r=o.getComponent("parallel",t.get("parallelIndex")),a=e.coordSysDims=r.dimensions.slice();c(r.parallelAxisIndex,function(t,r){var s=o.getComponent("parallelAxis",t),l=a[r];n.set(l,s),Ru(s)&&(i.set(l,s),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=r))})},matrix:function(t,e,n,i){var o=t.getReferringComponents("matrix",Km).models[0];e.coordSysDims=["x","y"];var r=o.getDimensionModel("x"),a=o.getDimensionModel("y");n.set("x",r),n.set("y",a),i.set("x",r),i.set("y",a)}};const TC=function(t,e,n){n=n||{};var i,o=e.getSourceManager(),r=!1;t?(r=!0,i=br(t)):r=(i=o.getSource()).sourceFormat===ox;var a=function(t){var e=t.get("coordinateSystem"),n=new bC(e),i=SC[e];if(i)return i(t,n,n.axisMap,n.categoryAxisMap),n}(e),s=function(t,e){var n,i=t.get("coordinateSystem"),o=E_.get(i);return e&&e.coordSysDims&&(n=d(e.coordSysDims,function(t){var n={name:t},i=e.axisMap.get(t);if(i){var o=i.get("type");n.type=function(t){return"category"===t?"ordinal":"time"===t?"time":"float"}(o)}return n})),n||(n=o&&(o.getDimensionsInfo?o.getDimensionsInfo():o.dimensions.slice())||["x","y"]),n}(e,a),l=n.useEncodeDefaulter,u=v(l)?l:l?m(tr,s,e):null,h=zu(i,{coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!r}),p=function(t,e,n){var i,o;return n&&c(t,function(t,r){var a=n.categoryAxisMap.get(t.coordDim);a&&(null==i&&(i=r),t.ordinalMeta=a.getOrdinalMeta(),e&&(t.createInvertedIndices=!0)),null!=t.otherDims.itemName&&(o=!0)}),o||null==i||(t[i].otherDims.itemName=0),i}(h.dimensions,n.createInvertedIndices,a),f=r?null:o.getSharedDataStore(h),g=function(t,e,n){var i,o,r,a=(n=n||{}).byIndex,s=n.stackedCoordDimension;!function(t){return!Nl(t.schema)}(e)?(i=(o=e.schema).dimensions,r=e.store):i=e;var l,u,h,d,p=!(!t||!t.get("stack"));if(c(i,function(t,e){_(t)&&(i[e]=t={name:t}),p&&!t.isExtraCoord&&(a||l||!t.ordinalMeta||(l=t),u||"ordinal"===t.type||"time"===t.type||s&&s!==t.coordDim||(u=t))}),!u||a||l||(a=!0),u){h="__\0ecstackresult_"+t.id,d="__\0ecstackedover_"+t.id,l&&(l.createInvertedIndices=!0);var f=u.coordDim,g=u.type,m=0;c(i,function(t){t.coordDim===f&&m++});var y={name:h,coordDim:f,coordDimIndex:m,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length},v={name:d,coordDim:d,coordDimIndex:m+1,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length+1};o?(r&&(y.storeDimIndex=r.ensureCalculationDimension(d,g),v.storeDimIndex=r.ensureCalculationDimension(h,g)),o.appendCalculationDimension(y),o.appendCalculationDimension(v)):(i.push(y),i.push(v))}return{stackedDimension:u&&u.name,stackedByDimension:l&&l.name,isStackedByIndex:a,stackedOverDimension:d,stackResultDimension:h}}(e,{schema:h,store:f}),x=new zM(h,e);x.setCalculationInfo(g);var w=null!=p&&function(t){if(t.sourceFormat===ox)return!y(xn(function(t){for(var e=0;e=0},t.prototype.indexOfName=function(t){return this._getDataWithEncodedVisual().indexOfName(t)},t.prototype.getItemVisual=function(t,e){return this._getDataWithEncodedVisual().getItemVisual(t,e)},t}();const CC=MC;var kC=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.hasSymbolVisual=!0,e}return e(n,t),n.prototype.init=function(e){function n(){return i._categoriesData}t.prototype.init.apply(this,arguments);var i=this;this.legendVisualProvider=new CC(n,n),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},n.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},n.prototype.mergeDefaultAndTheme=function(e){t.prototype.mergeDefaultAndTheme.apply(this,arguments),_n(e,"edgeLabel",["show"])},n.prototype.getInitialData=function(t,e){var n,i=t.edges||t.links||[],o=t.data||t.nodes||[],r=this;if(o&&i){ZM(n=this)&&(n.__curvenessList=[],n.__edgeMap={},HM(n));var a=function(t,e,n,i,o){for(var r=new xC(!0),a=0;a "+f)),h++)}var g,y=n.get("coordinateSystem");if("cartesian2d"===y||"polar"===y||"matrix"===y)g=TC(t,n);else{var v=E_.get(y),_=v&&v.dimensions||[];l(_,"value")<0&&_.concat(["value"]);var x=zu(t,{coordDimensions:_,encodeDefine:n.getEncode()}).dimensions;(g=new zM(x,n)).initData(t)}var w,b,S,T=new zM(["value"],n);return T.initData(u,s),o&&o(g,T),b=(w={mainData:g,struct:r,structAttr:"graph",datas:{node:g,edge:T},datasAttr:{node:"data",edge:"edgeData"}}).mainData,(S=w.datas)||(S={main:b},w.datasAttr={main:"data"}),w.datas=w.mainData=null,Au(b,S,w),c(S,function(t){c(b.TRANSFERABLE_METHODS,function(e){t.wrapMethod(e,m(ku,w))})}),b.wrapMethod("cloneShallow",m(Lu,w)),c(b.CHANGABLE_METHODS,function(t){b.wrapMethod(t,m(Iu,w))}),O(S[b.dataType]===b),r.update(),r}(o,i,this,0,function(t,e){function n(t,e){var n=o.call(this,t,e);return n.resolveParentPath=i,n}function i(t){if(t&&("label"===t[0]||"label"===t[1])){var e=t.slice();return"label"===t[0]?e[0]="edgeLabel":"label"===t[1]&&(e[1]="edgeLabel"),e}return t}t.wrapMethod("getItemModel",function(t){var e=r._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t});var o=i_.prototype.getModel;e.wrapMethod("getItemModel",function(t){return t.resolveParentPath=i,t.getModel=n,t})});return c(a.edges,function(t){!function(t,e,n,i){if(ZM(n)){var o=WM(t,e,n),r=n.__edgeMap,a=r[jM(o)];r[o]&&!a?r[o].isForward=!0:a&&r[o]&&(a.isForward=!0,r[o].isForward=!1),r[o]=r[o]||[],r[o].push(i)}}(t.node1,t.node2,this,t.dataIndex)},this),a.data}},n.prototype.getGraph=function(){return this.getData().graph},n.prototype.getEdgeData=function(){return this.getGraph().edgeData},n.prototype.getCategoriesData=function(){return this._categoriesData},n.prototype.formatTooltip=function(t,e,n){if("edge"===n){var i=this.getData(),o=this.getDataParams(t,n),r=i.graph.getEdgeByIndex(t),a=i.getName(r.node1.dataIndex),s=i.getName(r.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),$r("nameValue",{name:l.join(" > "),value:o.value,noValue:null==o.value})}return sa({series:this,dataIndex:t,multipleSeries:e})},n.prototype._updateCategoriesData=function(){var t=d(this.option.categories||[],function(t){return null!=t.value?t:a({value:0},t)}),e=new zM(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray(function(t){return e.getItemModel(t)})},n.prototype.setZoom=function(t){this.option.zoom=t},n.prototype.setCenter=function(t){this.option.center=t},n.prototype.isAnimationEnabled=function(){return t.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},n.type="series.graph",n.dependencies=["grid","polar","geo","singleAxis","calendar"],n.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:X_.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:X_.color.primary}}},n}(_w);const IC=kC,LC=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.hasSymbolVisual=!0,e}return e(n,t),n.prototype.getInitialData=function(t,e){return TC(null,this,{useEncodeDefaulter:!0})},n.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?5e3:this.get("progressive"):t},n.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?1e4:this.get("progressiveThreshold"):t},n.prototype.brushSelector=function(t,e,n){return n.point(e.getItemLayout(t))},n.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},n.type="series.scatter",n.dependencies=["grid","polar","geo","singleAxis","calendar","matrix"],n.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:X_.color.primary}},universalTransition:{divideShape:"clone"}},n}(_w);var PC=function(){},DC=function(t){function n(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return e(n,t),n.prototype.getDefaultShape=function(){return new PC},n.prototype.reset=function(){this.notClear=!1,this._off=0},n.prototype.buildPath=function(t,e){var n,i=e.points,o=e.size,r=this.symbolProxy,a=r.shape,s=t.getContext?t.getContext():t,l=this.softClipShape;if(s&&o[0]<4)this._ctx=s;else{for(this._ctx=null,n=this._off;n=0;s--){var l=2*s,u=i[l]-r/2,h=i[l+1]-a/2;if(t>=u&&e>=h&&t<=u+r&&e<=h+a)return s}return-1},n.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e);return this.getBoundingRect().contain(t=n[0],e=n[1])?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},n.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape,n=e.points,i=e.size,o=i[0],r=i[1],a=1/0,s=1/0,l=-1/0,u=-1/0,h=0;h=0&&(l.dataIndex=n+(t.startIndex||0))})},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}();const OC=AC;var zC="undefined"!=typeof Float32Array,EC=zC?Float32Array:Array;const RC=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){var i=t.getData();this._updateSymbolDraw(i,t).updateData(i,{clipShape:this._getClipShape(t)}),this._finished=!0},n.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData();this._updateSymbolDraw(i,t).incrementalPrepareUpdate(i),this._finished=!1},n.prototype.incrementalRender=function(t,e,n){this._symbolDraw.incrementalUpdate(t,e.getData(),{clipShape:this._getClipShape(e)}),this._finished=t.end===e.getData().count()},n.prototype.updateTransform=function(t,e,n){var i=t.getData();if(this.group.dirty(),!this._finished||i.count()>1e4)return{update:!0};var o=Nu("").reset(t,e,n);o.progress&&o.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout(i)},n.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},n.prototype._getClipShape=function(t){if(t.get("clip",!0)){var e=t.coordinateSystem;return e&&e.getArea&&e.getArea(.1)}},n.prototype._updateSymbolDraw=function(t,e){var n=this._symbolDraw,i=e.pipelineContext.large;return n&&i===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=i?new OC:new nC,this._isLargeDraw=i,this.group.removeAll()),this.group.add(n.group),n},n.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},n.prototype.dispose=function(){},n.type="scatter",n}(Kb);var BC={left:0,right:0,top:0,bottom:0},NC=["25%","25%"];const FC=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.mergeDefaultAndTheme=function(e,n){var i=Jo(e.outerBounds);t.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&e.outerBounds&&$o(e.outerBounds,i)},n.prototype.mergeOption=function(e,n){t.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&e.outerBounds&&$o(this.option.outerBounds,e.outerBounds)},n.type="grid",n.dependencies=["xAxis","yAxis"],n.layoutMode="box",n.defaultOption={show:!1,z:0,left:"15%",top:65,right:"10%",bottom:80,containLabel:!1,outerBoundsMode:"auto",outerBounds:BC,outerBoundsContain:"all",outerBoundsClampWidth:NC[0],outerBoundsClampHeight:NC[1],backgroundColor:X_.color.transparent,borderWidth:1,borderColor:X_.color.neutral30},n}(W_);var VC=function(){function t(){}return t.prototype.getNeedCrossZero=function(){return!this.option.scale},t.prototype.getCoordSysModel=function(){},t}(),ZC=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Km).models[0]},n.type="cartesian2dAxis",n}(W_);u(ZC,VC);var HC={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:X_.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:X_.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:X_.color.axisSplitLine,width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:[X_.color.backgroundTint,X_.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:X_.color.neutral00,borderColor:X_.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:"auto"}},WC=r({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},HC),jC=r({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:X_.color.axisMinorSplitLine,width:1}}},HC);const GC={category:WC,value:jC,time:r({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},jC),log:s({logBase:10},jC)};var UC=0;const YC=function(){function t(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++UC,this._onCollect=t.onCollect}return t.createByAxisModel=function(e){var n=e.option,i=n.data,o=i&&d(i,Fu);return new t({categories:o,needCollect:!o,deduplication:!1!==n.dedplication})},t.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},t.prototype.parseAndCollect=function(t){var e,n=this._needCollect;if(!_(t)&&!n)return t;if(n&&!this._deduplication)return this.categories[e=this.categories.length]=t,this._onCollect&&this._onCollect(t,e),e;var i=this._getOrCreateMap();return null==(e=i.get(t))&&(n?(this.categories[e=this.categories.length]=t,i.set(t,e),this._onCollect&&this._onCollect(t,e)):e=NaN),e},t.prototype._getOrCreateMap=function(){return this._map||(this._map=B(this.categories))},t}();var XC={value:1,category:1,time:1,log:1},qC=null,KC=function(){function t(){this.normalize=Xu,this.scale=qu}return t.prototype.updateMethods=function(t){t.hasBreaks()?(this.normalize=_f(t.normalize,t),this.scale=_f(t.scale,t)):(this.normalize=Xu,this.scale=qu)},t}(),$C=function(){function t(t){this._calculator=new KC,this._setting=t||{},this._extent=[1/0,-1/0];var e=vo();e&&(this._brkCtx=e.createScaleBreakContext(),this._brkCtx.update(this._extent))}return t.prototype.getSetting=function(t){return this._setting[t]},t.prototype._innerUnionExtent=function(t){var e=this._extent;this._innerSetExtent(t[0]e[1]?t[1]:e[1])},t.prototype.unionExtentFromData=function(t,e){this._innerUnionExtent(t.getApproximateExtent(e))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(t,e){this._innerSetExtent(t,e)},t.prototype._innerSetExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e),this._brkCtx&&this._brkCtx.update(n)},t.prototype.setBreaksFromOption=function(t){var e=vo();e&&this._innerSetBreak(e.parseAxisBreakOption(t,_f(this.parse,this)))},t.prototype._innerSetBreak=function(t){this._brkCtx&&(this._brkCtx.setBreaks(t),this._calculator.updateMethods(this._brkCtx),this._brkCtx.update(this._extent))},t.prototype._innerGetBreaks=function(){return this._brkCtx?this._brkCtx.breaks:[]},t.prototype.hasBreaks=function(){return!!this._brkCtx&&this._brkCtx.hasBreaks()},t.prototype._getExtentSpanWithBreaks=function(){return this._brkCtx&&this._brkCtx.hasBreaks()?this._brkCtx.getExtentSpan():this._extent[1]-this._extent[0]},t.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(t){this._isBlank=t},t}();Fn($C);const JC=$C;var QC=function(t){function n(e){var n=t.call(this,e)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new YC({})),y(i)&&(i=new YC({categories:d(i,function(t){return b(t)?t.value:t})})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return e(n,t),n.prototype.parse=function(t){return null==t?NaN:_(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},n.prototype.contain=function(t){return Yu(t,this._extent)&&t>=0&&t=0&&t=0&&t=t},n.prototype.getOrdinalMeta=function(){return this._ordinalMeta},n.prototype.calcNiceTicks=function(){},n.prototype.calcNiceExtent=function(){},n.type="ordinal",n}(JC);JC.registerClass(QC);const tk=QC;var ek=rn,nk=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="interval",e._interval=0,e._intervalPrecision=2,e}return e(n,t),n.prototype.parse=function(t){return null==t||""===t?NaN:Number(t)},n.prototype.contain=function(t){return Yu(t,this._extent)},n.prototype.normalize=function(t){return this._calculator.normalize(t,this._extent)},n.prototype.scale=function(t){return this._calculator.scale(t,this._extent)},n.prototype.getInterval=function(){return this._interval},n.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=Gu(t)},n.prototype.getTicks=function(t){t=t||{};var e=this._interval,n=this._extent,i=this._niceExtent,o=this._intervalPrecision,r=vo(),a=[];if(!e)return a;if("only_break"===t.breakTicks&&r)return r.addBreaksToTicks(a,this._brkCtx.breaks,this._extent),a;n[0]=0&&(l=ek(l+u*e,o))}if(a.length>0&&l===a[a.length-1].value)break;if(a.length>1e4)return[]}var h=a.length?a[a.length-1].value:i[1];return n[1]>h&&a.push(t.expandToNicedExtent?{value:ek(h+e,o)}:{value:n[1]}),r&&r.pruneTicksByBreak(t.pruneByBreak,a,this._brkCtx.breaks,function(t){return t.value},this._interval,this._extent),"none"!==t.breakTicks&&r&&r.addBreaksToTicks(a,this._brkCtx.breaks,this._extent),a},n.prototype.getMinorTicks=function(t){for(var e=this.getTicks({expandToNicedExtent:!0}),n=[],i=this.getExtent(),o=1;oi[0]&&co&&(a=r.interval=o);var s=r.intervalPrecision=Gu(a);return function(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),Uu(t,0,e),Uu(t,1,e),t[0]>t[1]&&(t[0]=t[1])}(r.niceTickExtent=[rn(Math.ceil(t[0]/a)*a,s),rn(Math.floor(t[1]/a)*a,s)],t),r}(i,o,t,e,n);this._intervalPrecision=r.intervalPrecision,this._interval=r.interval,this._niceExtent=r.niceTickExtent}},n.prototype.calcNiceExtent=function(t){var e=this._extent.slice();if(e[0]===e[1])if(0!==e[0]){var n=Math.abs(e[0]);t.fixMax||(e[1]+=n/2),e[0]-=n/2}else e[1]=1;isFinite(e[1]-e[0])||(e[0]=0,e[1]=1),this._innerSetExtent(e[0],e[1]),e=this._extent.slice(),this.calcNiceTicks(t.splitNumber,t.minInterval,t.maxInterval);var i=this._interval,o=this._intervalPrecision;t.fixMin||(e[0]=ek(Math.floor(e[0]/i)*i,o)),t.fixMax||(e[1]=ek(Math.ceil(e[1]/i)*i,o)),this._innerSetExtent(e[0],e[1])},n.prototype.setNiceExtent=function(t,e){this._niceExtent=[t,e]},n.type="interval",n}(JC);JC.registerClass(nk);const ik=nk;var ok="__ec_stack_",rk=function(t){function n(e){var n=t.call(this,e)||this;return n.type="time",n}return e(n,t),n.prototype.getLabel=function(t){var e=this.getSetting("useUTC");return bo(t.value,x_[function(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}(xo(this._minLevelUnit))]||x_.second,e,this.getSetting("locale"))},n.prototype.getFormattedLabel=function(t,e,n){var i=this.getSetting("useUTC");return function(t,e,n,i,o){var r=null;if(_(n))r=n;else if(v(n)){var a={time:t.time,level:t.time.level},s=vo();s&&s.makeAxisLabelFormatterParamBreak(a,t.break),r=n(t.value,e,a)}else{var l=t.time;if(l){var u=n[l.lowerTimeUnit][l.upperTimeUnit];r=u[Math.min(l.level,u.length-1)]||""}else{var h=So(t.value,o);r=n[h][h][0]}}return bo(new Date(t.value),r,o,i)}(t,e,n,this.getSetting("locale"),i)},n.prototype.getTicks=function(t){t=t||{};var e=this._interval,n=this._extent,i=vo(),o=[];if(!e)return o;var r=this.getSetting("useUTC");if(i&&"only_break"===t.breakTicks)return vo().addBreaksToTicks(o,this._brkCtx.breaks,this._extent),o;var a=So(n[1],r);o.push({value:n[0],time:{level:0,upperTimeUnit:a,lowerTimeUnit:a}});var s=function(t,e,n,i,o,r){function a(t,e,n,o,a,s,l){for(var h=function(t,e){var n=new Date(0);n[t](1);var i=n.getTime();n[t](1+e);var o=n.getTime()-i;return function(t,e){return Math.max(0,Math.round((e-t)/o))}}(a,t),c=e,d=new Date(c);c1e4));)if(d[a](d[o]()+t),c=d.getTime(),r){var p=r.calcNiceTickMultiple(c,h);p>0&&(d[a](d[o]()+p*t),c=d.getTime())}l.push({value:c,notAdd:!0})}function s(t,o,r){var s=[],l=!o.length;if(!Qu(xo(t),i[0],i[1],n)){l&&(o=[{value:rh(i[0],t,n)},{value:i[1]}]);for(var u=0;u=i[0]&&h<=i[1]&&a(d,h,c,p,f,0,s),"year"===t&&r.length>1&&0===u&&r.unshift({value:r[0].value-d})}}for(u=0;u=i[0]&&x<=i[1]&&p++)}var w=o/e;if(p>1.5*w&&g>w/1.5)break;if(h.push(v),p>w||t===l[m])break}c=[]}}var b=f(d(h,function(t){return f(t,function(t){return t.value>=i[0]&&t.value<=i[1]&&!t.notAdd})}),function(t){return t.length>0}),S=[],T=b.length-1;for(m=0;mn&&(this._approxInterval=n);var o=ak.length,r=Math.min(function(t,e,n,i){for(;n>>1;t[o][1]0;)i*=10;var o=[lk(hk(e[0]/i)*i),lk(uk(e[1]/i)*i)];this._interval=i,this._intervalPrecision=Gu(i),this._niceExtent=o}},n.prototype.calcNiceExtent=function(e){t.prototype.calcNiceExtent.call(this,e),this._fixMin=e.fixMin,this._fixMax=e.fixMax},n.prototype.contain=function(e){return e=dk(e)/dk(this.base),t.prototype.contain.call(this,e)},n.prototype.normalize=function(e){return e=dk(e)/dk(this.base),t.prototype.normalize.call(this,e)},n.prototype.scale=function(e){return e=t.prototype.scale.call(this,e),ck(this.base,e)},n.prototype.setBreaksFromOption=function(t){var e=vo();if(e){var n=e.logarithmicParseBreaksFromOption(t,this.base,_f(this.parse,this)),i=n.parsedLogged;this._originalScale._innerSetBreak(n.parsedOriginal),this._innerSetBreak(i)}},n.type="log",n}(ik);JC.registerClass(pk);const fk=pk;var gk=function(){function t(t,e,n){this._prepareParams(t,e,n)}return t.prototype._prepareParams=function(t,e,n){n[1]0&&s>0&&!l&&(a=0),a<0&&s<0&&!u&&(s=0));var c=this._determinedMin,d=this._determinedMax;return null!=c&&(a=c,l=!0),null!=d&&(s=d,u=!0),{min:a,max:s,minFixed:l,maxFixed:u,isBlank:h}},t.prototype.modifyDataMinMax=function(t,e){this[yk[t]]=e},t.prototype.setDeterminedMinMax=function(t,e){this[mk[t]]=e},t.prototype.freeze=function(){this.frozen=!0},t}(),mk={min:"_determinedMin",max:"_determinedMax"},yk={min:"_dataMin",max:"_dataMax"},vk=function(){function t(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return t.prototype.getAxis=function(t){return this._axes[t]},t.prototype.getAxes=function(){return d(this._dimList,function(t){return this._axes[t]},this)},t.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),f(this.getAxes(),function(e){return e.scale.type===t})},t.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},t}(),_k=["x","y"],xk=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cartesian2d",e.dimensions=_k,e}return e(n,t),n.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,e=this.getAxis("y").scale;if(_h(t)&&_h(e)){var n=t.getExtent(),i=e.getExtent(),o=this.dataToPoint([n[0],i[0]]),r=this.dataToPoint([n[1],i[1]]),a=n[1]-n[0],s=i[1]-i[0];if(a&&s){var l=(r[0]-o[0])/a,u=(r[1]-o[1])/s,h=this._transform=[l,0,0,u,o[0]-n[0]*l,o[1]-i[0]*u];this._invTransform=bt([],h)}}},n.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},n.prototype.containPoint=function(t){var e=this.getAxis("x"),n=this.getAxis("y");return e.contain(e.toLocalCoord(t[0]))&&n.contain(n.toLocalCoord(t[1]))},n.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},n.prototype.containZone=function(t,e){var n=this.dataToPoint(t),i=this.dataToPoint(e),o=this.getArea(),r=new lg(n[0],n[1],i[0]-n[0],i[1]-n[1]);return o.intersect(r)},n.prototype.dataToPoint=function(t,e,n){n=n||[];var i=t[0],o=t[1];if(this._transform&&null!=i&&isFinite(i)&&null!=o&&isFinite(o))return et(n,t,this._transform);var r=this.getAxis("x"),a=this.getAxis("y");return n[0]=r.toGlobalCoord(r.dataToCoord(i,e)),n[1]=a.toGlobalCoord(a.dataToCoord(o,e)),n},n.prototype.clampData=function(t,e){var n=this.getAxis("x").scale,i=this.getAxis("y").scale,o=n.getExtent(),r=i.getExtent(),a=n.parse(t[0]),s=i.parse(t[1]);return(e=e||[])[0]=Math.min(Math.max(Math.min(o[0],o[1]),a),Math.max(o[0],o[1])),e[1]=Math.min(Math.max(Math.min(r[0],r[1]),s),Math.max(r[0],r[1])),e},n.prototype.pointToData=function(t,e,n){if(n=n||[],this._invTransform)return et(n,t,this._invTransform);var i=this.getAxis("x"),o=this.getAxis("y");return n[0]=i.coordToData(i.toLocalCoord(t[0]),e),n[1]=o.coordToData(o.toLocalCoord(t[1]),e),n},n.prototype.getOtherAxis=function(t){return this.getAxis("x"===t.dim?"y":"x")},n.prototype.getArea=function(t){t=t||0;var e=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),i=Math.min(e[0],e[1])-t,o=Math.min(n[0],n[1])-t,r=Math.max(e[0],e[1])-i+t,a=Math.max(n[0],n[1])-o+t;return new lg(i,o,r,a)},n}(vk);const wk=xk;var bk=Ln(),Sk=Ln(),Tk=1,Mk=2,Ck=Sh("axisTick"),kk=Sh("axisLabel"),Ik=[0,1],Lk=function(){function t(t,e,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=n||[0,0]}return t.prototype.contain=function(t){var e=this._extent,n=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return t>=n&&t<=i},t.prototype.containData=function(t){return this.scale.contain(this.scale.parse(t))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(t){return sn(t||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(t,e){var n=this._extent;n[0]=t,n[1]=e},t.prototype.dataToCoord=function(t,e){var n=this._extent,i=this.scale;return t=i.normalize(i.parse(t)),this.onBand&&"ordinal"===i.type&&Ph(n=n.slice(),i.count()),nn(t,Ik,n,e)},t.prototype.coordToData=function(t,e){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&Ph(n=n.slice(),i.count());var o=nn(t,n,Ik,e);return this.scale.scale(o)},t.prototype.pointToData=function(t,e){},t.prototype.getTicksCoords=function(t){var e=(t=t||{}).tickModel||this.getTickModel(),n=d(function(t,e,n){var i=t.getTickModel().get("customValues");if(i){var o=t.scale.getExtent();return{ticks:f(wh(t,i),function(t){return t>=o[0]&&t<=o[1]})}}return"category"===t.type?function(t,e){var n,i,o=Ck(t),r=ph(e),a=Th(o,r);if(a)return a;if(e.get("show")&&!t.scale.isBlank()||(n=[]),v(r))n=Lh(t,r,!0);else if("auto"===r){var s=bh(t,t.getLabelModel(),xh(Mk));i=s.labelCategoryInterval,n=d(s.labels,function(t){return t.tickValue})}else n=Ih(t,i=r,!0);return Mh(o,r,{ticks:n,tickCategoryInterval:i})}(t,e):{ticks:d(t.scale.getTicks(n),function(t){return t.value})}}(this,e,{breakTicks:t.breakTicks,pruneByBreak:t.pruneByBreak}).ticks,function(t){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(t):t),tickValue:t}},this);return function(t,e,n,i){function o(t,e){return t=rn(t),e=rn(e),h?t>e:ts[1];o(e[0].coord,s[0])&&(i?e[0].coord=s[0]:e.shift()),i&&o(s[0],e[0].coord)&&e.unshift({coord:s[0],onBand:!0}),o(s[1],a.coord)&&(i?a.coord=s[1]:e.pop()),i&&o(a.coord,s[1])&&e.push({coord:s[1],onBand:!0})}}(this,n,e.get("alignWithLabel"),t.clamp),n},t.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)return[];var t=this.model.getModel("minorTick").get("splitNumber");return t>0&&t<100||(t=5),d(this.scale.getMinorTicks(t),function(t){return d(t,function(t){return{coord:this.dataToCoord(t),tickValue:t}},this)},this)},t.prototype.getViewLabels=function(t){return function(t,e){var n=t.getLabelModel().get("customValues");if(n){var i=ch(t),o=t.scale.getExtent();return{labels:d(f(wh(t,n),function(t){return t>=o[0]&&t<=o[1]}),function(e){var n={value:e};return{formattedLabel:i(n),rawLabel:t.scale.getLabel(n),tickValue:e,time:void 0,break:void 0}})}}return"category"===t.type?function(t,e){var n=t.getLabelModel(),i=bh(t,n,e);return!n.get("show")||t.scale.isBlank()?{labels:[]}:i}(t,e):function(t){var e=t.scale.getTicks(),n=ch(t);return{labels:d(e,function(e,i){return{formattedLabel:n(e,i),rawLabel:t.scale.getLabel(e),tickValue:e.value,time:e.time,break:e.break}})}}(t)}(this,t=t||xh(Mk)).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),n=e[1]-e[0]+(this.onBand?1:0);0===n&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},t.prototype.calculateCategoryInterval=function(t){return function(t,e){var n=e.kind,i=function(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}(t),o=ch(t),r=(i.axisRotate-i.labelRotate)/180*Math.PI,a=t.scale,s=a.getExtent(),l=a.count();if(s[1]-s[0]<1)return 0;var u=1;l>40&&(u=Math.max(1,Math.floor(l/40)));for(var h=s[0],c=t.dataToCoord(h+1)-t.dataToCoord(h),d=Math.abs(c*Math.cos(r)),p=Math.abs(c*Math.sin(r)),f=0,g=0;h<=s[1];h+=u){var m,y=Ge(o({value:h}),i.font,"center","top");m=1.3*y.height,f=Math.max(f,1.3*y.width,7),g=Math.max(g,m,7)}var v=f/d,_=g/p;isNaN(v)&&(v=1/0),isNaN(_)&&(_=1/0);var x=Math.max(0,Math.floor(Math.min(v,_)));if(n===Tk)return e.out.noPxChangeTryDetermine.push(_f(Ch,null,t,x,l)),x;var w=kh(t,x,l);return null!=w?w:x}(this,t=t||xh(Mk))},t}(),Pk=function(t){function n(e,n,i,o,r){var a=t.call(this,e,n,i)||this;return a.index=0,a.type=o||"value",a.position=r||"bottom",a}return e(n,t),n.prototype.isHorizontal=function(){var t=this.position;return"top"===t||"bottom"===t},n.prototype.getGlobalExtent=function(t){var e=this.getExtent();return e[0]=this.toGlobalCoord(e[0]),e[1]=this.toGlobalCoord(e[1]),t&&e[0]>e[1]&&e.reverse(),e},n.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},n.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},n}(Lk);const Dk=Pk;var Ak=["label","labelLine","layoutOption","priority","defaultAttr","marginForce","minMarginForce","marginDefault","suggestIgnore"],Ok=[0,0,0,0],zk="expandAxisBreak",Ek=Math.PI,Rk=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],Bk=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],Nk=Ln(),Fk=Ln(),Vk=function(){function t(t){this.recordMap={},this.resolveAxisNameOverlap=t}return t.prototype.ensureRecord=function(t){var e=t.axis.dim,n=t.componentIndex,i=this.recordMap,o=i[e]||(i[e]=[]);return o[n]||(o[n]={ready:{}})},t}(),Zk=[1,0,0,1,0,0],Hk=new lg(0,0,0,0),Wk=function(t,e,n,i,o,r){if(mh(t.nameLocation)){var a=r.stOccupiedRect;a&&Bh(function(t,e,n){return t.transform=ls(t.transform,n),t.localRect=ss(t.localRect,e),t.rect=ss(t.rect,e),n&&t.rect.applyTransform(n),t.axisAligned=as(n),t.obb=void 0,(t.label=t.label||{}).ignore=!1,t}({},a,r.transGroup.transform),i,o)}else Nh(r.labelInfoList,r.dirVec,i,o)},jk=function(){function t(t,e,n,i){this.group=new Em,this._axisModel=t,this._api=e,this._local={},this._shared=i||new Vk(Wk),this._resetCfgDetermined(n)}return t.prototype.updateCfg=function(t){var e=this._cfg.raw;e.position=t.position,e.labelOffset=t.labelOffset,this._resetCfgDetermined(e)},t.prototype.__getRawCfg=function(){return this._cfg.raw},t.prototype._resetCfgDetermined=function(t){var e=this._axisModel,n=e.getDefaultOption?e.getDefaultOption():{},i=L(t.axisName,e.get("name")),o=e.get("nameMoveOverlap");null!=o&&"auto"!==o||(o=L(t.defaultNameMoveOverlap,!0));var r={raw:t,position:t.position,rotation:t.rotation,nameDirection:L(t.nameDirection,1),tickDirection:L(t.tickDirection,1),labelDirection:L(t.labelDirection,1),labelOffset:L(t.labelOffset,0),silent:L(t.silent,!0),axisName:i,nameLocation:P(e.get("nameLocation"),n.nameLocation,"end"),shouldNameMoveOverlap:Gh(i)&&o,optionHideOverlap:e.get(["axisLabel","hideOverlap"]),showMinorTicks:e.get(["minorTick","show"])};this._cfg=r;var a=new Em({x:r.position[0],y:r.position[1],rotation:r.rotation});a.updateTransform(),this._transformGroup=a;var s=this._shared.ensureRecord(e);s.transGroup=this._transformGroup,s.dirVec=new Gf(Math.cos(-r.rotation),Math.sin(-r.rotation))},t.prototype.build=function(t,e){var n=this;return t||(t={axisLine:!0,axisTickLabelEstimate:!1,axisTickLabelDetermine:!0,axisName:!0}),c(Gk,function(i){t[i]&&Uk[i](n._cfg,n._local,n._shared,n._axisModel,n.group,n._transformGroup,n._api,e||{})}),this},t.innerTextLayout=function(t,e,n){var i,o,r=un(e-t);return hn(r)?(o=n>0?"top":"bottom",i="center"):hn(r-Ek)?(o=n>0?"bottom":"top",i="center"):(o="middle",i=r>0&&r0?"right":"left":n>0?"left":"right"),{rotation:r,textAlign:i,textVerticalAlign:o}},t.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},t.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},t}(),Gk=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],Uk={axisLine:function(t,e,n,i,o,r,s){var l=i.get(["axisLine","show"]);if("auto"===l&&(l=!0,null!=t.raw.axisLineAutoShow&&(l=!!t.raw.axisLineAutoShow)),l){var u=i.axis.getExtent(),h=r.transform,d=[u[0],0],p=[u[1],0],f=d[0]>p[0];h&&(et(d,d,h),et(p,p,h));var g=a({lineCap:"round"},i.getModel(["axisLine","lineStyle"]).getLineStyle()),m={strokeContainThreshold:t.raw.strokeContainThreshold||5,silent:!0,z2:1,style:g};if(i.get(["axisLine","breakLine"])&&i.axis.scale.hasBreaks())Vu().buildAxisBreakLine(i,o,r,m);else{var y=new cb(a({shape:{x1:d[0],y1:d[1],x2:p[0],y2:p[1]}},m));Ha(y.shape,y.style.lineWidth),y.anid="line",o.add(y)}var v=i.get(["axisLine","symbol"]);if(null!=v){var x=i.get(["axisLine","symbolSize"]);_(v)&&(v=[v,v]),(_(x)||w(x))&&(x=[x,x]);var b=Bs(i.get(["axisLine","symbolOffset"])||0,x),S=x[0],T=x[1];c([{rotate:t.rotation+Math.PI/2,offset:b[0],r:0},{rotate:t.rotation-Math.PI/2,offset:b[1],r:Math.sqrt((d[0]-p[0])*(d[0]-p[0])+(d[1]-p[1])*(d[1]-p[1]))}],function(e,n){if("none"!==v[n]&&null!=v[n]){var i=Es(v[n],-S/2,-T/2,S,T,g.stroke,!0),r=e.r+e.offset,a=f?p:d;i.attr({rotation:e.rotate,x:a[0]+r*Math.cos(t.rotation),y:a[1]-r*Math.sin(t.rotation),silent:!0,z2:11}),o.add(i)}})}}},axisTickLabelEstimate:function(t,e,n,i,o,r,a,s){Hh(e,o,s)&&Fh(t,e,n,i,o,r,a,Tk)},axisTickLabelDetermine:function(t,e,n,i,o,r,a,l){Hh(e,o,l)&&Fh(t,e,n,i,o,r,a,Mk);var u=function(t,e,n,i){var o=i.axis,r=i.getModel("axisTick"),a=r.get("show");if("auto"===a&&(a=!0,null!=t.raw.axisTickAutoShow&&(a=!!t.raw.axisTickAutoShow)),!a||o.scale.isBlank())return[];for(var l=r.getModel("lineStyle"),u=t.tickDirection*r.get("length"),h=Zh(o.getTicksCoords(),n.transform,u,s(l.getLineStyle(),{stroke:i.get(["axisLine","lineStyle","color"])}),"ticks"),c=0;ci[1],l="start"===e&&!s||"start"!==e&&s;return hn(a-Ek/2)?(r=l?"bottom":"top",o="center"):hn(a-1.5*Ek)?(r=l?"top":"bottom",o="center"):(r="middle",o=a<1.5*Ek&&a>Ek/2?l?"left":"right":l?"right":"left"),{rotation:a,textAlign:o,textVerticalAlign:r}}(t.rotation,h,w||0,f),null!=(x=t.raw.axisNameAvailableWidth)&&(x=Math.abs(x/Math.sin(_.rotation)),!isFinite(x)&&(x=null)));var b=d.getFont(),S=i.get("nameTruncate",!0)||{},T=S.ellipsis,M=I(t.raw.nameTruncateMaxWidth,S.maxWidth,x),C=s.nameMarginLevel||0,k=new Tv({x:m.x,y:m.y,rotation:_.rotation,silent:jk.isLabelSilent(i),style:co(d,{text:u,font:b,overflow:"truncate",width:M,ellipsis:T,fill:d.getTextColor()||i.get(["axisLine","lineStyle","color"]),align:d.get("align")||_.textAlign,verticalAlign:d.get("verticalAlign")||_.textVerticalAlign}),z2:1});if(is({el:k,componentModel:i,itemName:u}),k.__fullText=u,k.anid="name",i.get("triggerEvent")){var L=jk.makeAxisEventDataBase(i);L.targetType="axisName",L.name=u,Mv(k).eventData=L}r.add(k),k.updateTransform(),e.nameEl=k;var P=l.nameLayout=Oh({label:k,priority:k.z2,defaultAttr:{ignore:k.ignore},marginDefault:mh(h)?Rk[C]:Bk[C]});if(l.nameLocation=h,o.add(k),k.decomposeTransform(),t.shouldNameMoveOverlap&&P){var D=n.ensureRecord(i);n.resolveAxisNameOverlap(t,n,i,P,y,D)}}}},Yk=new mv,Xk=new mv;const qk=jk;var Kk=[[3,1],[0,2]],$k=function(){function t(t,e,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=_k,this._initCartesian(t,e,n),this.model=t}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(t,e){function n(t){var e,n=g(t),i=n.length;if(i){for(var o=[],r=i-1;r>=0;r--){var a=t[+n[r]],s=a.model,l=a.scale;Wu(l)&&s.get("alignTicks")&&null==s.get("interval")?o.push(a):(hh(l,s),Wu(l)&&(e=a))}o.length&&(e||hh((e=o.pop()).scale,e.model),c(o,function(t){!function(t,e,n){var i=ik.prototype,o=i.getTicks.call(n),r=i.getTicks.call(n,{expandToNicedExtent:!0}),a=o.length-1,s=i.getInterval.call(n),l=uh(t,e),u=l.extent,h=l.fixMin,c=l.fixMax;"log"===t.type&&(u=Ku(t.base,u,!0)),t.setBreaksFromOption(vh(e)),t.setExtent(u[0],u[1]),t.calcNiceExtent({splitNumber:a,fixMin:h,fixMax:c});var d=i.getExtent.call(t);h&&(u[0]=d[0]),c&&(u[1]=d[1]);var p=i.getInterval.call(t),f=u[0],g=u[1];if(h&&c)p=(g-f)/a;else if(h)for(g=u[0]+p*a;gu[0]&&isFinite(f)&&isFinite(u[0]);)p=ju(p),f=u[1]-p*a;else{t.getTicks().length-1>a&&(p=ju(p));var m=p*a;(f=rn((g=Math.ceil(u[1]/p)*p)-m))<0&&u[0]>=0?(f=0,g=rn(m)):g>0&&u[1]<=0&&(g=0,f=-rn(m))}var y=(o[0].value-r[0].value)/s,v=(o[a].value-r[a].value)/s;i.setExtent.call(t,f+p*y,g+p*v),i.setInterval.call(t,p),(y||v)&&i.setNiceExtent.call(t,f+p,g-p)}(t.scale,t.model,e.scale)}))}}var i=this._axesMap;this._updateScale(t,this.model),n(i.x),n(i.y);var o={};c(i.x,function(t){qh(i,"y",t,o)}),c(i.y,function(t){qh(i,"x",t,o)}),this.resize(this.model,e)},t.prototype.resize=function(t,e,n){var i=Xo(t,e),o=this._rect=Yo(t.getBoxLayoutParams(),i.refContainer),r=this._axesMap,a=this._coordsList,s=t.get("containLabel");if($h(r,o),!n){var u=function(t,e,n,i,o){var r=new Vk(Jk);return c(n,function(n){return c(n,function(n){yh(n.model)&&(n.axisBuilder=function(t,e,n,i,o,r){for(var a=Uh(t,n),s=!1,l=!1,u=0;ul[1]&&l.reverse(),(null==a||a>l[1])&&(a=l[1]),aa)return!0;if(r){var s=nc(t).seriesDataCount,l=i.getExtent();return Math.abs(l[0]-l[1])/s>a}return!1}return!0===n},t.prototype.makeElOption=function(t,e,n,i,o){},t.prototype.createPointerEl=function(t,e,n,i){var o=e.pointer;if(o){var r=cI(t).pointerEl=new qp[o.type](dI(e.pointer));t.add(r)}},t.prototype.createLabelEl=function(t,e,n,i){if(e.label){var o=cI(t).labelEl=new Tv(dI(e.label));t.add(o),lc(o,i)}},t.prototype.updatePointerEl=function(t,e,n){var i=cI(t).pointerEl;i&&e.pointer&&(i.setStyle(e.pointer.style),n(i,{shape:e.pointer.shape}))},t.prototype.updateLabelEl=function(t,e,n,i){var o=cI(t).labelEl;o&&(o.setStyle(e.label.style),n(o,{x:e.label.x,y:e.label.y}),lc(o,i))},t.prototype._renderHandle=function(t){if(!this._dragging&&this.updateHandleTransform){var e,n=this._axisPointerModel,i=this._api.getZr(),o=this._handle,r=n.getModel("handle"),a=n.get("status");if(!r.get("show")||!a||"hide"===a)return o&&i.remove(o),void(this._handle=null);this._handle||(e=!0,o=this._handle=$a(r.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){Zf(t.event)},onmousedown:pI(this._onHandleDragMove,this,0,0),drift:pI(this._onHandleDragMove,this),ondragend:pI(this._onHandleDragEnd,this)}),i.add(o)),hc(o,n,!1),o.setStyle(r.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=r.get("size");y(s)||(s=[s,s]),o.scaleX=s[0]/2,o.scaleY=s[1]/2,vs(this,"_doDispatchAxisPointer",r.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},t.prototype._moveHandleToValue=function(t,e){ac(this._axisPointerModel,!e&&this._moveAnimation,this._handle,uc(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(t,e){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(uc(n),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(uc(i)),cI(n).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){if(this._handle){var t=this._payloadInfo,e=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),n=this._group,i=this._handle;e&&n&&(this._lastGraphicKey=null,n&&e.remove(n),i&&e.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),_s(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}},t}(),gI=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.makeElOption=function(t,e,n,i,o){var r=n.axis,a=r.grid,s=i.get("type"),l=pc(a,r).getOtherAxis(r).getGlobalExtent(),u=r.toGlobalCoord(r.dataToCoord(e,!0));if(s&&"none"!==s){var h=function(t){var e,n=t.get("type"),i=t.getModel(n+"Style");return"line"===n?(e=i.getLineStyle()).fill=null:"shadow"===n&&((e=i.getAreaStyle()).stroke=null),e}(i),c=mI[s](r,u,l);c.style=h,t.graphicKey=c.type,t.pointer=c}!function(t,e,n,i,o,r){var a=qk.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=o.get(["label","margin"]),function(t,e,n,i,o){var r=cc(n.get("value"),e.axis,e.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),a=n.getModel("label"),s=S_(a.get("padding")||0),l=a.getFont(),u=Ge(r,l),h=o.position,c=u.width+s[1]+s[3],d=u.height+s[0]+s[2],p=o.align;"right"===p&&(h[0]-=c),"center"===p&&(h[0]-=c/2);var f=o.verticalAlign;"bottom"===f&&(h[1]-=d),"middle"===f&&(h[1]-=d/2),function(t,e,n,i){var o=i.getWidth(),r=i.getHeight();t[0]=Math.min(t[0]+e,o)-e,t[1]=Math.min(t[1]+n,r)-n,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}(h,c,d,i);var g=a.get("backgroundColor");g&&"auto"!==g||(g=e.get(["axisLine","lineStyle","color"])),t.label={x:h[0],y:h[1],style:co(a,{text:r,font:l,fill:a.getTextColor(),padding:s,backgroundColor:g}),z2:10}}(e,i,o,r,{position:dc(i.axis,t,n),align:a.textAlign,verticalAlign:a.textVerticalAlign})}(e,t,Uh(a.getRect(),n),n,i,o)},n.prototype.getHandleTransform=function(t,e,n){var i=Uh(e.axis.grid.getRect(),e,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var o=dc(e.axis,t,i);return{x:o[0],y:o[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},n.prototype.updateHandleTransform=function(t,e,n,i){var o=n.axis,r=o.grid,a=o.getGlobalExtent(!0),s=pc(r,o).getOtherAxis(o).getGlobalExtent(),l="x"===o.dim?0:1,u=[t.x,t.y];u[l]+=e[l],u[l]=Math.min(a[1],u[l]),u[l]=Math.max(a[0],u[l]);var h=(s[1]+s[0])/2,c=[h,h];return c[l]=u[l],{x:u[0],y:u[1],rotation:t.rotation,cursorPoint:c,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},n}(fI),mI={line:function(t,e,n){var i,o,r;return{type:"Line",subPixelOptimize:!0,shape:(i=[e,n[0]],o=[e,n[1]],r=fc(t),{x1:i[r=r||0],y1:i[1-r],x2:o[r],y2:o[1-r]})}},shadow:function(t,e,n){var i,o,r,a=Math.max(1,t.getBandWidth());return{type:"Rect",shape:(i=[e-a/2,n[0]],o=[a,n[1]-n[0]],r=fc(t),{x:i[r=r||0],y:i[1-r],width:o[r],height:o[1-r]})}}};const yI=gI,vI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="axisPointer",n.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:X_.color.border,width:1,type:"dashed"},shadowStyle:{color:X_.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:X_.color.neutral00,padding:[5,7,5,7],backgroundColor:X_.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:X_.color.accent40,throttle:40}},n}(W_);var _I=Ln(),xI=c,wI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){var i=e.getComponent("tooltip"),o=t.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";gc("axisPointer",n,function(t,e,n){"none"!==o&&("leave"===t||o.indexOf(t)>=0)&&n({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})})},n.prototype.remove=function(t,e){vc("axisPointer",e)},n.prototype.dispose=function(t,e){vc("axisPointer",e)},n.type="axisPointer",n}(ww);const bI=wI;var SI=Ln();const TI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="tooltip",n.dependencies=["axisPointer"],n.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:X_.color.neutral00,shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:X_.color.border,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:X_.color.borderShade,width:1,type:"dashed",textStyle:{}}},textStyle:{color:X_.color.tertiary,fontSize:14}},n}(W_);var MI=Ic(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),CI=Lc(Ic(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),"transition"),kI=Lc(MI,"transform"),II="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(Qp.transform3dSupported?"will-change:transform;":""),LI=function(){function t(t,e){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,Qp.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var i=this._zr=t.getZr(),o=e.appendTo,r=o&&(_(o)?document.querySelector(o):M(o)?o:v(o)&&o(t.getDom()));Dc(this._styleCoord,i,r,t.getWidth()/2,t.getHeight()/2),(r||t.getDom()).appendChild(n),this._api=t,this._container=r;var a=this;n.onmouseenter=function(){a._enterable&&(clearTimeout(a._hideTimeout),a._show=!0),a._inContent=!0},n.onmousemove=function(t){if(t=t||window.event,!a._enterable){var e=i.handler;dt(i.painter.getViewportRoot(),t,!0),e.dispatch("mousemove",t)}},n.onmouseleave=function(){a._inContent=!1,a._enterable&&a._show&&a.hideLater(a._hideDelay)}}return t.prototype.update=function(t){if(!this._container){var e=this._api.getDom(),n=(r="position",(a=(o=e).currentStyle||document.defaultView&&document.defaultView.getComputedStyle(o))?r?a[r]:a:null),i=e.style;"absolute"!==i.position&&"absolute"!==n&&(i.position="relative")}var o,r,a,s=t.get("alwaysShowContent");s&&this._moveIfResized(),this._alwaysShowContent=s,this._enableDisplayTransition=t.get("displayTransition")&&t.get("transitionDuration")>0,this.el.className=t.get("className")||""},t.prototype.show=function(t,e){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=n.style,o=this._styleCoord;n.innerHTML?i.cssText=II+function(t,e,n,i){var o=[],r=t.get("transitionDuration"),a=t.get("backgroundColor"),s=t.get("shadowBlur"),l=t.get("shadowColor"),u=t.get("shadowOffsetX"),h=t.get("shadowOffsetY"),d=t.getModel("textStyle"),p=aa(t,"html");return o.push("box-shadow:"+u+"px "+h+"px "+s+"px "+l),e&&r>0&&o.push(function(t,e,n){var i="cubic-bezier(0.23,1,0.32,1)",o="",r="";return n&&(r="opacity"+(o=" "+t/2+"s "+i)+",visibility"+o),e||(o=" "+t+"s "+i,r+=(r.length?",":"")+(Qp.transformSupported?""+kI+o:",left"+o+",top"+o)),CI+":"+r}(r,n,i)),a&&o.push("background-color:"+a),c(["width","color","radius"],function(e){var n="border-"+e,i=Vo(n),r=t.get(i);null!=r&&o.push(n+":"+r+("color"===e?"":"px"))}),o.push(function(t){var e=[],n=t.get("fontSize"),i=t.getTextColor();i&&e.push("color:"+i),e.push("font:"+t.getFont());var o=L(t.get("lineHeight"),Math.round(3*n/2));n&&e.push("line-height:"+o+"px");var r=t.get("textShadowColor"),a=t.get("textShadowBlur")||0,s=t.get("textShadowOffsetX")||0,l=t.get("textShadowOffsetY")||0;return r&&a&&e.push("text-shadow:"+s+"px "+l+"px "+a+"px "+r),c(["decoration","align"],function(n){var i=t.get(n);i&&e.push("text-"+n+":"+i)}),e.join(";")}(d)),null!=p&&o.push("padding:"+S_(p).join("px ")+"px"),o.join(";")+";"}(t,!this._firstShow,this._longHide,this._enableDisplayTransition)+Pc(o[0],o[1],!0)+"border-color:"+Wo(e)+";"+(t.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(t,e,n,i,o){var r=this.el;if(null!=t){var a="";if(_(o)&&"item"===n.get("trigger")&&!kc(n)&&(a=function(t,e,n){if(!_(n)||"inside"===n)return"";var i=t.get("backgroundColor"),o=t.get("borderWidth");e=Wo(e);var r,a,s="left"===(r=n)?"right":"right"===r?"left":"top"===r?"bottom":"top",u=Math.max(1.5*Math.round(o),6),h="",c=kI+":";l(["left","right"],s)>-1?(h+="top:50%",c+="translateY(-50%) rotate("+(a="left"===s?-225:-45)+"deg)"):(h+="left:50%",c+="translateX(-50%) rotate("+(a="top"===s?225:45)+"deg)");var d=a*Math.PI/180,p=u+o,f=p*Math.abs(Math.cos(d))+p*Math.abs(Math.sin(d)),g=e+" solid "+o+"px;";return'
'}(n,i,o)),_(t))r.innerHTML=t+a;else if(t){r.innerHTML="",y(t)||(t=[t]);for(var s=0;s=0?this._tryShow(n,i):"leave"===e&&this._hide(i))},this))},n.prototype._keepShow=function(){var t=this._tooltipModel,e=this._ecModel,n=this._api,i=t.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==i&&"click"!==i){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&o.manuallyShowTip(t,e,n,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},n.prototype.manuallyShowTip=function(t,e,n,i){if(i.from!==this.uid&&!Qp.node&&n.getDom()){var o=Rc(i,n);this._ticket="";var r=i.dataByCoordSys,a=function(t,e,n){var i=Dn(t).queryOptionMap,o=i.keys()[0];if(o&&"series"!==o){var r,a=An(e,o,i.get(o),{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];if(a)return n.getViewOfComponentModel(a).group.traverse(function(e){var n=Mv(e).tooltipConfig;if(n&&n.name===t.name)return r=e,!0}),r?{componentMainType:o,componentIndex:a.componentIndex,el:r}:void 0}}(i,e,n);if(a){var s=a.el.getBoundingRect().clone();s.applyTransform(a.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:a.el,position:i.position,positionDefault:"bottom"},o)}else if(i.tooltip&&null!=i.x&&null!=i.y){var l=AI;l.x=i.x,l.y=i.y,l.update(),Mv(l).tooltipConfig={name:null,option:i.tooltip},this._tryShow({offsetX:i.x,offsetY:i.y,target:l},o)}else if(r)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:r,tooltipOption:i.tooltipOption},o);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(t,e,n,i))return;var u=_c(i,e),h=u.point[0],c=u.point[1];null!=h&&null!=c&&this._tryShow({offsetX:h,offsetY:c,target:u.el,position:i.position,positionDefault:"bottom"},o)}else null!=i.x&&null!=i.y&&(n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},o))}},n.prototype.manuallyHideTip=function(t,e,n,i){this._tooltipModel&&this._tooltipContent.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(Rc(i,n))},n.prototype._manuallyAxisShowTip=function(t,e,n,i){var o=i.seriesIndex,r=i.dataIndex,a=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=o&&null!=r&&null!=a){var s=e.getSeriesByIndex(o);if(s&&"axis"===Ec([s.getData().getItemModel(r),s,(s.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:r,position:i.position}),!0}},n.prototype._tryShow=function(t,e){var n=t.target;if(this._tooltipModel){this._lastX=t.offsetX,this._lastY=t.offsetY;var i=t.dataByCoordSys;if(i&&i.length)this._showAxisTooltip(i,t);else if(n){var o,r;if("legend"===Mv(n).ssrType)return;this._lastDataByCoordSys=null,Os(n,function(t){if(t.tooltipDisabled)return o=r=null,!0;o||r||(null!=Mv(t).dataIndex?o=t:null!=Mv(t).tooltipConfig&&(r=t))},!0),o?this._showSeriesItemTooltip(t,o,e):r?this._showComponentItemTooltip(t,r,e):this._hide(e)}else this._lastDataByCoordSys=null,this._hide(e)}},n.prototype._showOrMove=function(t,e){var n=t.get("showDelay");e=_f(e,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(e,n):e()},n.prototype._showAxisTooltip=function(t,e){var n=this._ecModel,i=this._tooltipModel,o=[e.offsetX,e.offsetY],r=Ec([e.tooltipOption],i),s=this._renderMode,l=[],u=$r("section",{blocks:[],noHeader:!0}),h=[],d=new mw;c(t,function(t){c(t.dataByAxis,function(t){var e=n.getComponent(t.axisDim+"Axis",t.axisIndex),o=t.value;if(e&&null!=o){var r=cc(o,e.axis,n,t.seriesDataIndices,t.valueLabelOpt),p=$r("section",{header:r,noHeader:!z(r),sortBlocks:!0,blocks:[]});u.blocks.push(p),c(t.seriesDataIndices,function(u){var c=n.getSeriesByIndex(u.seriesIndex),f=u.dataIndexInside,g=c.getDataParams(f);if(!(g.dataIndex<0)){g.axisDim=t.axisDim,g.axisIndex=t.axisIndex,g.axisType=t.axisType,g.axisId=t.axisId,g.axisValue=dh(e.axis,{value:o}),g.axisValueLabel=r,g.marker=d.makeTooltipMarker("item",Wo(g.color),s);var m=zr(c.formatTooltip(f,!0,null)),y=m.frag;if(y){var v=Ec([c],i).get("valueFormatter");p.blocks.push(v?a({valueFormatter:v},y):y)}m.text&&h.push(m.text),l.push(g)}})}})}),u.blocks.reverse(),h.reverse();var p=e.position,f=r.get("order"),g=ia(u,d,s,f,n.get("useUTC"),r.get("textStyle"));g&&h.unshift(g);var m=h.join("richText"===s?"\n\n":"
");this._showOrMove(r,function(){this._updateContentNotChangedOnAxis(t,l)?this._updatePosition(r,p,o[0],o[1],this._tooltipContent,l):this._showTooltipContent(r,m,l,Math.random()+"",o[0],o[1],p,null,d)})},n.prototype._showSeriesItemTooltip=function(t,e,n){var i=this._ecModel,o=Mv(e),r=o.seriesIndex,s=i.getSeriesByIndex(r),l=o.dataModel||s,u=o.dataIndex,h=o.dataType,c=l.getData(h),d=this._renderMode,p=t.positionDefault,f=Ec([c.getItemModel(u),l,s&&(s.coordinateSystem||{}).model],this._tooltipModel,p?{position:p}:null),g=f.get("trigger");if(null==g||"item"===g){var m=l.getDataParams(u,h),y=new mw;m.marker=y.makeTooltipMarker("item",Wo(m.color),d);var v=zr(l.formatTooltip(u,!1,h)),_=f.get("order"),x=f.get("valueFormatter"),w=v.frag,b=w?ia(x?a({valueFormatter:x},w):w,y,d,_,i.get("useUTC"),f.get("textStyle")):v.text,S="item_"+l.name+"_"+u;this._showOrMove(f,function(){this._showTooltipContent(f,b,m,S,t.offsetX,t.offsetY,t.position,t.target,y)}),n({type:"showTip",dataIndexInside:u,dataIndex:c.getRawIndex(u),seriesIndex:r,from:this.uid})}},n.prototype._showComponentItemTooltip=function(t,e,n){var i="html"===this._renderMode,r=Mv(e),a=r.tooltipConfig.option||{},s=a.encodeHTMLContent;_(a)&&(a={content:a,formatter:a},s=!0),s&&i&&a.content&&((a=o(a)).content=lt(a.content));var l=[a],u=this._ecModel.getComponent(r.componentMainType,r.componentIndex);u&&l.push(u),l.push({formatter:a.content});var h=t.positionDefault,c=Ec(l,this._tooltipModel,h?{position:h}:null),d=c.get("content"),p=Math.random()+"",f=new mw;this._showOrMove(c,function(){var n=o(c.get("formatterParams")||{});this._showTooltipContent(c,d,n,p,t.offsetX,t.offsetY,t.position,e,f)}),n({type:"showTip",from:this.uid})},n.prototype._showTooltipContent=function(t,e,n,i,o,r,a,s,l){if(this._ticket="",t.get("showContent")&&t.get("show")){var u=this._tooltipContent;u.setEnterable(t.get("enterable"));var h=t.get("formatter");a=a||t.get("position");var c=e,d=this._getNearestPoint([o,r],n,t.get("trigger"),t.get("borderColor"),t.get("defaultBorderColor",!0)).color;if(h)if(_(h)){var p=t.ecModel.get("useUTC"),f=y(n)?n[0]:n;c=h,f&&f.axisType&&f.axisType.indexOf("time")>=0&&(c=bo(f.axisValue,c,p)),c=Ho(c,n,!0)}else if(v(h)){var g=_f(function(e,i){e===this._ticket&&(u.setContent(i,l,t,d,a),this._updatePosition(t,a,o,r,u,n,s))},this);this._ticket=i,c=h(n,i,g)}else c=h;u.setContent(c,l,t,d,a),u.show(t,d),this._updatePosition(t,a,o,r,u,n,s)}},n.prototype._getNearestPoint=function(t,e,n,i,o){return"axis"===n||y(e)?{color:i||o}:y(e)?void 0:{color:i||e.color||e.borderColor}},n.prototype._updatePosition=function(t,e,n,i,o,r,a){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u=o.getSize(),h=t.get("align"),c=t.get("verticalAlign"),d=a&&a.getBoundingRect().clone();if(a&&d.applyTransform(a.transform),v(e)&&(e=e([n,i],r,o.el,d,{viewSize:[s,l],contentSize:u.slice()})),y(e))n=jm(e[0],s),i=jm(e[1],l);else if(b(e)){var p=e;p.width=u[0],p.height=u[1];var f=Yo(p,{width:s,height:l});n=f.x,i=f.y,h=null,c=null}else if(_(e)&&a){var g=function(t,e,n,i){var o=n[0],r=n[1],a=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=e.width,h=e.height;switch(t){case"inside":s=e.x+u/2-o/2,l=e.y+h/2-r/2;break;case"top":s=e.x+u/2-o/2,l=e.y-r-a;break;case"bottom":s=e.x+u/2-o/2,l=e.y+h+a;break;case"left":s=e.x-o-a,l=e.y+h/2-r/2;break;case"right":s=e.x+u+a,l=e.y+h/2-r/2}return[s,l]}(e,d,u,t.get("borderWidth"));n=g[0],i=g[1]}else g=function(t,e,n,i,o,r,a){var s=n.getSize(),l=s[0],u=s[1];return null!=r&&(t+l+r+2>i?t-=l+r:t+=r),null!=a&&(e+u+a>o?e-=u+a:e+=a),[t,e]}(n,i,o,s,l,h?null:20,c?null:20),n=g[0],i=g[1];h&&(n-=Bc(h)?u[0]/2:"right"===h?u[0]:0),c&&(i-=Bc(c)?u[1]/2:"bottom"===c?u[1]:0),kc(t)&&(g=function(t,e,n,i,o){var r=n.getSize(),a=r[0],s=r[1];return t=Math.min(t+a,i)-a,e=Math.min(e+s,o)-s,[t=Math.max(t,0),e=Math.max(e,0)]}(n,i,o,s,l),n=g[0],i=g[1]),o.moveTo(n,i)},n.prototype._updateContentNotChangedOnAxis=function(t,e){var n=this._lastDataByCoordSys,i=this._cbParamsList,o=!!n&&n.length===t.length;return o&&c(n,function(n,r){var a=n.dataByAxis||[],s=(t[r]||{}).dataByAxis||[];(o=o&&a.length===s.length)&&c(a,function(t,n){var r=s[n]||{},a=t.seriesDataIndices||[],l=r.seriesDataIndices||[];(o=o&&t.value===r.value&&t.axisType===r.axisType&&t.axisId===r.axisId&&a.length===l.length)&&c(a,function(t,e){var n=l[e];o=o&&t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex}),i&&c(t.seriesDataIndices,function(t){var n=t.seriesIndex,r=e[n],a=i[n];r&&a&&a.data!==r.data&&(o=!1)})})}),this._lastDataByCoordSys=t,this._cbParamsList=e,!!o},n.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},n.prototype.dispose=function(t,e){!Qp.node&&e.getDom()&&(_s(this,"_updatePosition"),this._tooltipContent.dispose(),vc("itemTooltip",e))},n.type="tooltip",n}(ww);const zI=OI;var EI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.layoutMode={type:"box",ignoreSize:!0},e}return e(n,t),n.type="title",n.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:"center",top:X_.size.m,backgroundColor:X_.color.transparent,borderColor:X_.color.primary,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:X_.color.primary},subtextStyle:{fontSize:12,color:X_.color.quaternary}},n}(W_),RI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){if(this.group.removeAll(),t.get("show")){var i=this.group,o=t.getModel("textStyle"),r=t.getModel("subtextStyle"),a=t.get("textAlign"),s=L(t.get("textBaseline"),t.get("textVerticalAlign")),l=new Tv({style:co(o,{text:t.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),h=t.get("subtext"),c=new Tv({style:co(r,{text:h,fill:r.getTextColor(),y:u.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),d=t.get("link"),p=t.get("sublink"),f=t.get("triggerEvent",!0);l.silent=!d&&!f,c.silent=!p&&!f,d&&l.on("click",function(){jo(d,"_"+t.get("target"))}),p&&c.on("click",function(){jo(p,"_"+t.get("subtarget"))}),Mv(l).eventData=Mv(c).eventData=f?{componentType:"title",componentIndex:t.componentIndex}:null,i.add(l),h&&i.add(c);var g=i.getBoundingRect(),m=t.getBoxLayoutParams();m.width=g.width,m.height=g.height;var y=Yo(m,Xo(t,n).refContainer,t.get("padding"));a||("middle"===(a=t.get("left")||t.get("right"))&&(a="center"),"right"===a?y.x+=y.width:"center"===a&&(y.x+=y.width/2)),s||("center"===(s=t.get("top")||t.get("bottom"))&&(s="middle"),"bottom"===s?y.y+=y.height:"middle"===s&&(y.y+=y.height/2),s=s||"top"),i.x=y.x,i.y=y.y,i.markRedraw();var v={align:a,verticalAlign:s};l.setStyle(v),c.setStyle(v),g=i.getBoundingRect();var _=y.margin,x=t.getItemStyle(["color","opacity"]);x.fill=t.get("backgroundColor");var w=new mv({shape:{x:g.x-_[3],y:g.y-_[0],width:g.width+_[1]+_[3],height:g.height+_[0]+_[2],r:t.get("borderRadius")},style:x,subPixelOptimize:!0,silent:!0});i.add(w)}},n.type="title",n}(ww),BI=["x","y","radius","angle","single"],NI=["cartesian2d","polar","singleAxis"],FI=function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(t){this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},t}();const VI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="dataZoom.select",n}(function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e._autoThrottle=!0,e._noTarget=!0,e._rangePropMode=["percent","percent"],e}return e(n,t),n.prototype.init=function(t,e,n){var i=Fc(t);this.settledOption=i,this.mergeDefaultAndTheme(t,n),this._doInit(i)},n.prototype.mergeOption=function(t){var e=Fc(t);r(this.option,t,!0),r(this.settledOption,e,!0),this._doInit(e)},n.prototype._doInit=function(t){var e=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var n=this.settledOption;c([["start","startValue"],["end","endValue"]],function(t,i){"value"===this._rangePropMode[i]&&(e[t[0]]=n[t[0]]=null)},this),this._resetTarget()},n.prototype._resetTarget=function(){var t=this.get("orient",!0),e=this._targetAxisInfoMap=B();this._fillSpecifiedTargetAxis(e)?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(e,this._orient)),this._noTarget=!0,e.each(function(t){t.indexList.length&&(this._noTarget=!1)},this)},n.prototype._fillSpecifiedTargetAxis=function(t){var e=!1;return c(BI,function(n){var i=this.getReferringComponents(Nc(n),$m);if(i.specified){e=!0;var o=new FI;c(i.models,function(t){o.add(t.componentIndex)}),t.set(n,o)}},this),e},n.prototype._fillAutoTargetAxisByOrient=function(t,e){function n(e,n){var i=e[0];if(i){var r=new FI;if(r.add(i.componentIndex),t.set(n,r),o=!1,"x"===n||"y"===n){var a=i.getReferringComponents("grid",Km).models[0];a&&c(e,function(t){i.componentIndex!==t.componentIndex&&a===t.getReferringComponents("grid",Km).models[0]&&r.add(t.componentIndex)})}}}var i=this.ecModel,o=!0;if(o){var r="vertical"===e?"y":"x";n(i.findComponents({mainType:r+"Axis"}),r)}o&&n(i.findComponents({mainType:"singleAxis",filter:function(t){return t.get("orient",!0)===e}}),"single"),o&&c(BI,function(e){if(o){var n=i.findComponents({mainType:Nc(e),filter:function(t){return"category"===t.get("type",!0)}});if(n[0]){var r=new FI;r.add(n[0].componentIndex),t.set(e,r),o=!1}}},this)},n.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis(function(e){!t&&(t=e)},this),"y"===t?"vertical":"horizontal"},n.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var e=this.ecModel.option;this.option.throttle=e.animation&&e.animationDurationUpdate>0?100:20}},n.prototype._updateRangeUse=function(t){var e=this._rangePropMode,n=this.get("rangeMode");c([["start","startValue"],["end","endValue"]],function(i,o){var r=null!=t[i[0]],a=null!=t[i[1]];r&&!a?e[o]="percent":!r&&a?e[o]="value":n?e[o]=n[o]:r&&(e[o]="percent")})},n.prototype.noTarget=function(){return this._noTarget},n.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis(function(e,n){null==t&&(t=this.ecModel.getComponent(Nc(e),n))},this),t},n.prototype.eachTargetAxis=function(t,e){this._targetAxisInfoMap.each(function(n,i){c(n.indexList,function(n){t.call(e,i,n)})})},n.prototype.getAxisProxy=function(t,e){var n=this.getAxisModel(t,e);if(n)return n.__dzAxisProxy},n.prototype.getAxisModel=function(t,e){var n=this._targetAxisInfoMap.get(t);if(n&&n.indexMap[e])return this.ecModel.getComponent(Nc(t),e)},n.prototype.setRawRange=function(t){var e=this.option,n=this.settledOption;c([["start","startValue"],["end","endValue"]],function(i){null==t[i[0]]&&null==t[i[1]]||(e[i[0]]=n[i[0]]=t[i[0]],e[i[1]]=n[i[1]]=t[i[1]])},this),this._updateRangeUse(t)},n.prototype.setCalculatedRange=function(t){var e=this.option;c(["start","startValue","end","endValue"],function(n){e[n]=t[n]})},n.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},n.prototype.getValueRange=function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var n=this.findRepresentativeAxisProxy();return n?n.getDataValueWindow():void 0},n.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var e,n=this._targetAxisInfoMap.keys(),i=0;i=0}(e)){var n=Nc(this._dimName),i=e.getReferringComponents(n,Km).models[0];i&&this._axisIndex===i.componentIndex&&t.push(e)}},this),t},t.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},t.prototype.getMinMaxSpan=function(){return o(this._minMaxSpan)},t.prototype.calculateDataWindow=function(t){function e(t,e,n,i,r){var a=r?"Span":"ValueSpan";Vc(0,t,n,"all",u["min"+a],u["max"+a]);for(var s=0;s<2;s++)e[s]=nn(t[s],n,i,!0),r&&(e[s]=o.parse(e[s]))}var n,i=this._dataExtent,o=this.getAxisModel().axis.scale,r=this._dataZoomModel.getRangePropMode(),a=[0,100],s=[],l=[];HI(["start","end"],function(e,u){var h=t[e],c=t[e+"Value"];"percent"===r[u]?(null==h&&(h=a[u]),c=o.parse(nn(h,a,i))):(n=!0,h=nn(c=null==c?i[u]:o.parse(c),i,a)),l[u]=null==c||isNaN(c)?i[u]:c,s[u]=null==h||isNaN(h)?a[u]:h}),WI(l),WI(s);var u=this._minMaxSpan;return n?e(l,s,i,a,!1):e(s,l,a,i,!0),{valueWindow:l,percentWindow:s}},t.prototype.reset=function(t){if(t===this._dataZoomModel){var e=this.getTargetSeriesModels();this._dataExtent=function(t,e,n){var i=[1/0,-1/0];HI(n,function(t){!function(t,e,n){e&&c(gh(e,n),function(n){var i=e.getApproximateExtent(n);i[0]t[1]&&(t[1]=i[1])})}(i,t.getData(),e)});var o=t.getAxisModel(),r=sh(o.axis.scale,o,i).calculate();return[r.min,r.max]}(this,this._dimName,e),this._updateMinMaxSpan();var n=this.calculateDataWindow(t.settledOption);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,this._setAxisModel()}},t.prototype.filterData=function(t,e){if(t===this._dataZoomModel){var n=this._dimName,i=this.getTargetSeriesModels(),o=t.get("filterMode"),r=this._valueWindow;"none"!==o&&HI(i,function(t){var e=t.getData(),i=e.mapDimensionsAll(n);if(i.length){if("weakFilter"===o){var a=e.getStore(),s=d(i,function(t){return e.getDimensionIndex(t)},e);e.filterSelf(function(t){for(var e,n,o,l=0;lr[1];if(h&&!c&&!d)return!0;h&&(o=!0),c&&(e=!0),d&&(n=!0)}return o&&e&&n})}else HI(i,function(n){if("empty"===o)t.setData(e=e.map(n,function(t){return function(t){return t>=r[0]&&t<=r[1]}(t)?t:NaN}));else{var i={};i[n]=r,e.selectRange(i)}});HI(i,function(t){e.setApproximateExtent(r,t)})}})}},t.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},e=this._dataZoomModel,n=this._dataExtent;HI(["min","max"],function(i){var o=e.get(i+"Span"),r=e.get(i+"ValueSpan");null!=r&&(r=this.getAxisModel().axis.scale.parse(r)),null!=r?o=nn(n[0]+r,n,[0,100],!0):null!=o&&(r=nn(o,[0,100],n,!0)-n[0]),t[i+"Span"]=o,t[i+"ValueSpan"]=r},this)},t.prototype._setAxisModel=function(){var t=this.getAxisModel(),e=this._percentWindow,n=this._valueWindow;if(e){var i=sn(n,[0,500]);i=Math.min(i,20);var o=t.axis.scale.rawExtentInfo;0!==e[0]&&o.setDeterminedMinMax("min",+n[0].toFixed(i)),100!==e[1]&&o.setDeterminedMinMax("max",+n[1].toFixed(i)),o.freeze()}},t}();const GI=jI,UI={getTargetSeries:function(t){function e(e){t.eachComponent("dataZoom",function(n){n.eachTargetAxis(function(i,o){var r=t.getComponent(Nc(i),o);e(i,o,r,n)})})}e(function(t,e,n,i){n.__dzAxisProxy=null});var n=[];e(function(e,i,o,r){o.__dzAxisProxy||(o.__dzAxisProxy=new GI(e,i,r,t),n.push(o.__dzAxisProxy))});var i=B();return c(n,function(t){c(t.getTargetSeriesModels(),function(t){i.set(t.uid,t)})}),i},overallReset:function(t,e){t.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(e,n){t.getAxisProxy(e,n).reset(t)}),t.eachTargetAxis(function(n,i){t.getAxisProxy(n,i).filterData(t,e)})}),t.eachComponent("dataZoom",function(t){var e=t.findRepresentativeAxisProxy();if(e){var n=e.getDataPercentWindow(),i=e.getDataValueWindow();t.setCalculatedRange({start:n[0],end:n[1],startValue:i[0],endValue:i[1]})}})}};var YI=!1,XI=function(){},qI={};const KI=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.optionUpdated=function(){t.prototype.optionUpdated.apply(this,arguments);var e=this.ecModel;c(this.option.feature,function(t,n){var i=Gc(n);i&&(i.getDefaultOption&&(i.defaultOption=i.getDefaultOption(e)),r(t,i.defaultOption))})},n.type="toolbox",n.layoutMode={type:"box",ignoreSize:!0},n.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:X_.color.border,borderRadius:0,borderWidth:0,padding:X_.size.m,itemSize:15,itemGap:X_.size.s,showTitle:!0,iconStyle:{borderColor:X_.color.accent50,color:"none"},emphasis:{iconStyle:{borderColor:X_.color.accent50}},tooltip:{show:!1,position:"bottom"}},n}(W_);var $I=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.render=function(t,e,n,i){function o(o,d){var p,f=h[o],g=h[d],m=l[f],y=new i_(m,t,t.ecModel);if(i&&null!=i.newTitle&&i.featureName===f&&(m.title=i.newTitle),f&&!g){if(function(t){return 0===t.indexOf("my")}(f))p={onclick:y.option.onclick,featureName:f};else{var v=Gc(f);if(!v)return;p=new v}u[f]=p}else if(!(p=u[g]))return;p.uid=mo("toolbox-feature"),p.model=y,p.ecModel=e,p.api=n;var x=p instanceof XI;f||!g?!y.get("show")||x&&p.unusable?x&&p.remove&&p.remove(e,n):(function(i,o,l){var u,h,d=i.getModel("iconStyle"),p=i.getModel(["emphasis","iconStyle"]),f=o instanceof XI&&o.getIcons?o.getIcons():i.get("icon"),g=i.get("title")||{};_(f)?(u={})[l]=f:u=f,_(g)?(h={})[l]=g:h=g;var m=i.iconPaths={};c(u,function(l,u){var c=$a(l,{},{x:-a/2,y:-a/2,width:a,height:a});c.setStyle(d.getItemStyle()),c.ensureState("emphasis").style=p.getItemStyle();var f=new Tv({style:{text:h[u],align:p.get("textAlign"),borderRadius:p.get("textBorderRadius"),padding:p.get("textPadding"),fill:null,font:go({fontStyle:p.get("textFontStyle"),fontFamily:p.get("textFontFamily"),fontSize:p.get("textFontSize"),fontWeight:p.get("textFontWeight")},e)},ignore:!0});c.setTextContent(f),is({el:c,componentModel:t,itemName:u,formatterParamsExtra:{title:h[u]}}),c.__title=h[u],c.on("mouseover",function(){var e=p.getItemStyle(),i=s?null==t.get("right")&&"right"!==t.get("left")?"right":"left":null==t.get("bottom")&&"bottom"!==t.get("top")?"bottom":"top";f.setStyle({fill:p.get("textFill")||e.fill||e.stroke||X_.color.neutral99,backgroundColor:p.get("textBackgroundColor")}),c.setTextConfig({position:p.get("textPosition")||i}),f.ignore=!t.get("showTitle"),n.enterEmphasis(this)}).on("mouseout",function(){"emphasis"!==i.get(["iconStatus",u])&&n.leaveEmphasis(this),f.hide()}),("emphasis"===i.get(["iconStatus",u])?ji:Gi)(c),r.add(c),c.on("click",_f(o.onclick,o,e,n,u)),m[u]=c})}(y,p,f),y.setIconStatus=function(t,e){var n=this.option,i=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[t]=e,i[t]&&("emphasis"===e?ji:Gi)(i[t])},p instanceof XI&&p.render&&p.render(y,e,n,i)):x&&p.dispose&&p.dispose(e,n)}var r=this.group;if(r.removeAll(),t.get("show")){var a=+t.get("itemSize"),s="vertical"===t.get("orient"),l=t.get("feature")||{},u=this._features||(this._features={}),h=[];c(l,function(t,e){h.push(e)}),new gM(this._featureNames||[],h).add(o).update(o).remove(m(o,null)).execute(),this._featureNames=h;var d=Xo(t,n).refContainer,p=t.getBoxLayoutParams(),f=t.get("padding"),g=Yo(p,d,f);F_(t.get("orient"),r,t.get("itemGap"),g.width,g.height),qo(r,p,d,f),r.add(Uc(r.getBoundingRect(),t)),s||r.eachChild(function(t){var e=t.__title,i=t.ensureState("emphasis"),o=i.textConfig||(i.textConfig={}),s=t.getTextContent(),l=s&&s.ensureState("emphasis");if(l&&!v(l)&&e){var u=l.style||(l.style={}),h=Ge(e,Tv.makeFont(u)),c=t.x+r.x,d=!1;t.y+r.y+a+h.height>n.getHeight()&&(o.position="top",d=!0);var p=d?-5-h.height:a+10;c+h.width/2>n.getWidth()?(o.position=["100%",p],u.align="right"):c-h.width/2<0&&(o.position=[0,p],u.align="left")}})}},n.prototype.updateView=function(t,e,n,i){c(this._features,function(t){t instanceof XI&&t.updateView&&t.updateView(t.model,e,n,i)})},n.prototype.remove=function(t,e){c(this._features,function(n){n instanceof XI&&n.remove&&n.remove(t,e)}),this.group.removeAll()},n.prototype.dispose=function(t,e){c(this._features,function(n){n instanceof XI&&n.dispose&&n.dispose(t,e)})},n.type="toolbox",n}(ww);const JI=$I,QI=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.onclick=function(t,e){var n=this.model,i=n.get("name")||t.get("title.0.text")||"echarts",o="svg"===e.getZr().painter.getType(),r=o?"svg":n.get("type",!0)||"png",a=e.getConnectedDataURL({type:r,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||X_.color.neutral00,connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),s=Qp.browser;if("function"!=typeof MouseEvent||!s.newEdge&&(s.ie||s.edge))if(window.navigator.msSaveOrOpenBlob||o){var l=a.split(","),u=l[0].indexOf("base64")>-1,h=o?decodeURIComponent(l[1]):l[1];u&&(h=window.atob(h));var c=i+"."+r;if(window.navigator.msSaveOrOpenBlob){for(var d=h.length,p=new Uint8Array(d);d--;)p[d]=h.charCodeAt(d);var f=new Blob([p]);window.navigator.msSaveOrOpenBlob(f,c)}else{var g=document.createElement("iframe");document.body.appendChild(g);var m=g.contentWindow,y=m.document;y.open("image/svg+xml","replace"),y.write(h),y.close(),m.focus(),y.execCommand("SaveAs",!0,c),document.body.removeChild(g)}}else{var v=n.get("lang"),_='',x=window.open();x.document.write(_),x.document.title=i}else{var w=document.createElement("a");w.download=i+"."+r,w.target="_blank",w.href=a;var b=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});w.dispatchEvent(b)}},n.getDefaultOption=function(t){return{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:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:X_.color.neutral00,name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])}},n}(XI);var tL="__ec_magicType_stack__",eL=[["line","bar"],["stack"]],nL=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.getIcons=function(){var t=this.model,e=t.get("icon"),n={};return c(t.get("type"),function(t){e[t]&&(n[t]=e[t])}),n},n.getDefaultOption=function(t){return{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:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},n.prototype.onclick=function(t,e,n){var i=this.model,o=i.get(["seriesIndex",n]);if(iL[n]){var a,u={series:[]};c(eL,function(t){l(t,n)>=0&&c(t,function(t){i.setIconStatus(t,"normal")})}),i.setIconStatus(n,"emphasis"),t.eachComponent({mainType:"series",query:null==o?null:{seriesIndex:o}},function(t){var e=iL[n](t.subType,t.id,t,i);e&&(s(e,t.option),u.series.push(e));var o=t.coordinateSystem;if(o&&"cartesian2d"===o.type&&("line"===n||"bar"===n)){var r=o.getAxesByScale("ordinal")[0];if(r){var a=r.dim+"Axis",l=t.getReferringComponents(a,Km).models[0].componentIndex;u[a]=u[a]||[];for(var h=0;h<=l;h++)u[a][l]=u[a][l]||{};u[a][l].boundaryGap="bar"===n}}});var h=n;"stack"===n&&(a=r({stack:i.option.title.tiled,tiled:i.option.title.stack},i.option.title),"emphasis"!==i.get(["iconStatus",n])&&(h="tiled")),e.dispatchAction({type:"changeMagicType",currentType:h,newOption:u,newTitle:a,featureName:"magicType"})}},n}(XI),iL={line:function(t,e,n,i){if("bar"===t)return r({id:e,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(t,e,n,i){if("line"===t)return r({id:e,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(t,e,n,i){var o=n.get("stack")===tL;if("line"===t||"bar"===t)return i.setIconStatus("stack",o?"normal":"emphasis"),r({id:e,stack:o?"":tL},i.get(["option","stack"])||{},!0)}};fl({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)});const oL=nL;var rL=new Array(60).join("-"),aL="\t",sL=new RegExp("[\t]+","g"),lL=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.onclick=function(t,e){function n(){i.removeChild(r),C._dom=null}setTimeout(function(){e.dispatchAction({type:"hideTip"})});var i=e.getDom(),o=this.model;this._dom&&i.removeChild(this._dom);var r=document.createElement("div");r.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",r.style.backgroundColor=o.get("backgroundColor")||X_.color.neutral00;var a=document.createElement("h4"),s=o.get("lang")||[];a.innerHTML=s[0]||o.get("title"),a.style.cssText="margin:10px 20px",a.style.color=o.get("textColor");var l=document.createElement("div"),u=document.createElement("textarea");l.style.cssText="overflow:auto";var h=o.get("optionToContent"),p=o.get("contentToOption"),g=function(t){var e,n,i,o=function(t){var e={},n=[],i=[];return t.eachRawSeries(function(t){var o=t.coordinateSystem;if(!o||"cartesian2d"!==o.type&&"polar"!==o.type)n.push(t);else{var r=o.getBaseAxis();if("category"===r.type){var a=r.dim+"_"+r.index;e[a]||(e[a]={categoryAxis:r,valueAxis:o.getOtherAxis(r),series:[]},i.push({axisDim:r.dim,axisIndex:r.index})),e[a].series.push(t)}else n.push(t)}}),{seriesGroupByCategoryAxis:e,other:n,meta:i}}(t);return{value:f([(n=o.seriesGroupByCategoryAxis,i=[],c(n,function(t,e){var n=t.categoryAxis,o=t.valueAxis.dim,r=[" "].concat(d(t.series,function(t){return t.name})),a=[n.model.getCategories()];c(t.series,function(t){var e=t.getRawData();a.push(t.getRawData().mapArray(e.mapDimension(o),function(t){return t}))});for(var s=[r.join(aL)],l=0;l=0)return!0}(t)){var o=function(t){for(var e=t.split(/\n+/g),n=[],i=d(Yc(e.shift()).split(sL),function(t){return{name:t,data:[]}}),o=0;oi.getWidth()||n<0||n>i.getHeight()}(t,e.offsetX,e.offsetY)){var i=t._zr,o=t._covers,r=nd(t,e,n);if(!t._dragging)for(var a=0;a=0)&&t(o,i._targetInfoList)})}return t.prototype.setOutputRanges=function(t,e){return this.matchOutputRanges(t,e,function(t,e,n){if((t.coordRanges||(t.coordRanges=[])).push(e),!t.coordRange){t.coordRange=e;var i=AL[t.brushType](0,n,e);t.__rangeOffset={offset:OL[t.brushType](i.values,t.range,[1,1]),xyMinMax:i.xyMinMax}}}),t},t.prototype.matchOutputRanges=function(t,e,n){c(t,function(t){var i=this.findTargetInfo(t,e);i&&!0!==i&&c(i.coordSyses,function(i){var o=AL[t.brushType](1,i,t.range,!0);n(t,o.values,i,e)})},this)},t.prototype.setInputRanges=function(t,e){c(t,function(t){var n,i,o,r,a=this.findTargetInfo(t,e);if(t.range=t.range||[],a&&!0!==a){t.panelId=a.panelId;var s=AL[t.brushType](0,a.coordSys,t.coordRange),l=t.__rangeOffset;t.range=l?OL[t.brushType](s.values,l.offset,(n=l.xyMinMax,i=Ad(s.xyMinMax),o=Ad(n),r=[i[0]/o[0],i[1]/o[1]],isNaN(r[0])&&(r[0]=1),isNaN(r[1])&&(r[1]=1),r)):s.values}},this)},t.prototype.makePanelOpts=function(t,e){return d(this._targetInfoList,function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:e?e(n):null,clipPath:Td(i),isTargetByCursor:Cd(i,t,n.coordSysModel),getLinearBrushOtherExtent:Md(i)}})},t.prototype.controlSeries=function(t,e,n){var i=this.findTargetInfo(t,n);return!0===i||i&&l(i.coordSyses,e.coordinateSystem)>=0},t.prototype.findTargetInfo=function(t,e){for(var n=this._targetInfoList,i=Ld(e,t),o=0;o=0||l(i,t.getAxis("y").model)>=0)&&o.push(t)}),e.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:o[0],coordSyses:o,getPanelRect:DL.grid,xAxisDeclared:a[t.id],yAxisDeclared:s[t.id]})}))},geo:function(t,e){c(t.geoModels,function(t){var n=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:n,coordSyses:[n],getPanelRect:DL.geo})})}},PL=[function(t,e){var n=t.xAxisModel,i=t.yAxisModel,o=t.gridModel;return!o&&n&&(o=n.axis.grid.model),!o&&i&&(o=i.axis.grid.model),o&&o===e.gridModel},function(t,e){var n=t.geoModel;return n&&n===e.geoModel}],DL={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(ja(t)),e}},AL={lineX:m(Pd,0),lineY:m(Pd,1),rect:function(t,e,n,i){var o=t?e.pointToData([n[0][0],n[1][0]],i):e.dataToPoint([n[0][0],n[1][0]],i),r=t?e.pointToData([n[0][1],n[1][1]],i):e.dataToPoint([n[0][1],n[1][1]],i),a=[Id([o[0],r[0]]),Id([o[1],r[1]])];return{values:a,xyMinMax:a}},polygon:function(t,e,n,i){var o=[[1/0,-1/0],[1/0,-1/0]];return{values:d(n,function(n){var r=t?e.pointToData(n,i):e.dataToPoint(n,i);return o[0][0]=Math.min(o[0][0],r[0]),o[1][0]=Math.min(o[1][0],r[1]),o[0][1]=Math.max(o[0][1],r[0]),o[1][1]=Math.max(o[1][1],r[1]),r}),xyMinMax:o}}},OL={lineX:m(Dd,0),lineY:m(Dd,1),rect:function(t,e,n){return[[t[0][0]-n[0]*e[0][0],t[0][1]-n[0]*e[0][1]],[t[1][0]-n[1]*e[1][0],t[1][1]-n[1]*e[1][1]]]},polygon:function(t,e,n){return d(t,function(t,i){return[t[0]-n[0]*e[i][0],t[1]-n[1]*e[i][1]]})}};const zL=IL;var EL,RL=c,BL=Ym+"toolbox-dataZoom_",NL=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.render=function(t,e,n,i){this._brushController||(this._brushController=new CL(n.getZr()),this._brushController.on("brush",_f(this._onBrush,this)).mount()),function(t,e,n,i,o){var r=n._isZoomActive;i&&"takeGlobalCursor"===i.type&&(r="dataZoomSelect"===i.key&&i.dataZoomSelectActive),n._isZoomActive=r,t.setIconStatus("zoom",r?"emphasis":"normal");var a=new zL(Od(t),e,{include:["grid"]}).makePanelOpts(o,function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"});n._brushController.setPanels(a).enableBrush(!(!r||!a.length)&&{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()})}(t,e,this,i,n),function(t,e){t.setIconStatus("back",function(t){return qc(t).length}(e)>1?"emphasis":"normal")}(t,e)},n.prototype.onclick=function(t,e,n){FL[n].call(this)},n.prototype.remove=function(t,e){this._brushController&&this._brushController.unmount()},n.prototype.dispose=function(t,e){this._brushController&&this._brushController.dispose()},n.prototype._onBrush=function(t){function e(t,e,n){var r=e.getAxis(t),a=r.model,s=function(t,e,n){var i;return n.eachComponent({mainType:"dataZoom",subType:"select"},function(n){n.getAxisModel(t,e.componentIndex)&&(i=n)}),i}(t,a,o),l=s.findRepresentativeAxisProxy(a).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(n=Vc(0,n.slice(),r.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(i[s.id]={dataZoomId:s.id,startValue:n[0],endValue:n[1]})}var n=t.areas;if(t.isEnd&&n.length){var i={},o=this.ecModel;this._brushController.updateCovers([]),new zL(Od(this.model),o,{include:["grid"]}).matchOutputRanges(n,o,function(t,n,i){if("cartesian2d"===i.type){var o=t.brushType;"rect"===o?(e("x",i,n[0]),e("y",i,n[1])):e({lineX:"x",lineY:"y"}[o],i,n)}}),function(t,e){var n=qc(t);hL(e,function(e,i){for(var o=n.length-1;o>=0&&!n[o][i];o--);if(o<0){var r=t.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(r){var a=r.getPercentRange();n[0][i]={dataZoomId:i,start:a[0],end:a[1]}}}}),n.push(e)}(o,i),this._dispatchZoomAction(i)}},n.prototype._dispatchZoomAction=function(t){var e=[];RL(t,function(t,n){e.push(o(t))}),e.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:e})},n.getDefaultOption=function(t){return{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:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:X_.color.backgroundTint}}},n}(XI),FL={zoom:function(){this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:!this._isZoomActive})},back:function(){this._dispatchZoomAction(function(t){var e=qc(t),n=e[e.length-1];e.length>1&&e.pop();var i={};return hL(n,function(t,n){for(var o=e.length-1;o>=0;o--)if(t=e[o][n]){i[n]=t;break}}),i}(this.ecModel))}};EL=function(t){function e(t,e,n){var i=t.componentIndex,a={type:"select",$fromToolbox:!0,filterMode:o.get("filterMode",!0)||"filter",id:BL+e+i};a[n]=i,r.push(a)}var n=t.getComponent("toolbox",0),i=["feature","dataZoom"];if(n&&null!=n.get(i)){var o=n.getModel(i),r=[],a=Pn(t,Od(o));return RL(a.xAxisModels,function(t){return e(t,"xAxis","xAxisIndex")}),RL(a.yAxisModels,function(t){return e(t,"yAxis","yAxisIndex")}),r}},O(null==mx.get("dataZoom")&&EL),mx.set("dataZoom",EL);const VL=NL,ZL=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.layoutMode={type:"box",ignoreSize:!0},e}return e(n,t),n.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),t.selected=t.selected||{},this._updateSelector(t)},n.prototype.mergeOption=function(e,n){t.prototype.mergeOption.call(this,e,n),this._updateSelector(e)},n.prototype._updateSelector=function(t){var e=t.selector,n=this.ecModel;!0===e&&(e=t.selector=["all","inverse"]),y(e)&&c(e,function(t,i){_(t)&&(t={type:t}),e[i]=r(t,function(t,e){return"all"===e?{type:"all",title:t.getLocaleModel().get(["legend","selector","all"])}:"inverse"===e?{type:"inverse",title:t.getLocaleModel().get(["legend","selector","inverse"])}:void 0}(n,t.type))})},n.prototype.optionUpdated=function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&"single"===this.get("selectedMode")){for(var e=!1,n=0;n=0},n.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},n.type="legend.plain",n.dependencies=["series"],n.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",bottom:X_.size.m,align:"auto",backgroundColor:X_.color.transparent,borderColor:X_.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:X_.color.disabled,inactiveBorderColor:X_.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:X_.color.disabled,inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:X_.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:X_.color.tertiary,borderWidth:1,borderColor:X_.color.border},emphasis:{selectorLabel:{show:!0,color:X_.color.quaternary}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},n}(W_);var HL=m,WL=c,jL=Em,GL=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.newlineDisabled=!1,e}return e(n,t),n.prototype.init=function(){this.group.add(this._contentGroup=new jL),this.group.add(this._selectorGroup=new jL),this._isFirstRender=!0},n.prototype.getContentGroup=function(){return this._contentGroup},n.prototype.getSelectorGroup=function(){return this._selectorGroup},n.prototype.render=function(t,e,n){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var o=t.get("align"),r=t.get("orient");o&&"auto"!==o||(o="right"===t.get("left")&&"vertical"===r?"right":"left");var a=t.get("selector",!0),l=t.get("selectorPosition",!0);!a||l&&"auto"!==l||(l="horizontal"===r?"end":"start"),this.renderInner(o,t,e,n,a,r,l);var u=Xo(t,n).refContainer,h=t.getBoxLayoutParams(),c=t.get("padding"),d=Yo(h,u,c),p=this.layoutInner(t,o,d,i,a,l),f=Yo(s({width:p.width,height:p.height},h),u,c);this.group.x=f.x-p.x,this.group.y=f.y-p.y,this.group.markRedraw(),this.group.add(this._backgroundEl=Uc(p,t))}},n.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},n.prototype.renderInner=function(t,e,n,i,o,r,s){var l=this.getContentGroup(),u=B(),h=e.get("selectedMode"),c=e.get("triggerEvent"),d=[];n.eachRawSeries(function(t){!t.get("legendHoverLink")&&d.push(t.id)}),WL(e.getData(),function(o,r){var s=this,p=o.get("name");if(!this.newlineDisabled&&(""===p||"\n"===p)){var f=new jL;return f.newline=!0,void l.add(f)}var g=n.getSeriesByName(p)[0];if(!u.get(p))if(g){var m=g.getData(),y=m.getVisual("legendLineStyle")||{},v=m.getVisual("legendIcon"),_=m.getVisual("style"),x=this._createItem(g,p,r,o,e,t,y,_,v,h,i);x.on("click",HL(zd,p,null,i,d)).on("mouseover",HL(Rd,g.name,null,i,d)).on("mouseout",HL(Bd,g.name,null,i,d)),n.ssr&&x.eachChild(function(t){var e=Mv(t);e.seriesIndex=g.seriesIndex,e.dataIndex=r,e.ssrType="legend"}),c&&x.eachChild(function(t){s.packEventData(t,e,g,r,p)}),u.set(p,!0)}else n.eachRawSeries(function(s){var l=this;if(!u.get(p)&&s.legendVisualProvider){var f=s.legendVisualProvider;if(!f.containName(p))return;var g=f.indexOfName(p),m=f.getItemVisual(g,"style"),y=f.getItemVisual(g,"legendIcon"),v=oe(m.fill);v&&0===v[3]&&(v[3]=.2,m=a(a({},m),{fill:le(v,"rgba")}));var _=this._createItem(s,p,r,o,e,t,{},m,y,h,i);_.on("click",HL(zd,null,p,i,d)).on("mouseover",HL(Rd,null,p,i,d)).on("mouseout",HL(Bd,null,p,i,d)),n.ssr&&_.eachChild(function(t){var e=Mv(t);e.seriesIndex=s.seriesIndex,e.dataIndex=r,e.ssrType="legend"}),c&&_.eachChild(function(t){l.packEventData(t,e,s,r,p)}),u.set(p,!0)}},this)},this),o&&this._createSelector(o,e,i,r,s)},n.prototype.packEventData=function(t,e,n,i,o){var r={componentType:"legend",componentIndex:e.componentIndex,dataIndex:i,value:o,seriesIndex:n.seriesIndex};Mv(t).eventData=r},n.prototype._createSelector=function(t,e,n,i,o){var r=this.getSelectorGroup();WL(t,function(t){var i=t.type,o=new Tv({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect",legendId:e.id})}});r.add(o),uo(o,{normal:e.getModel("selectorLabel"),emphasis:e.getModel(["emphasis","selectorLabel"])},{defaultText:t.title}),no(o)})},n.prototype._createItem=function(t,e,n,i,o,r,a,s,l,u,h){var c,d,p,f=t.visualDrawType,g=o.get("itemWidth"),m=o.get("itemHeight"),y=o.isSelected(e),x=i.get("symbolRotate"),w=i.get("symbolKeepAspect"),b=i.get("icon"),S=function(t,e,n,i,o,r,a){function s(t,e){"auto"===t.lineWidth&&(t.lineWidth=e.lineWidth>0?2:0),WL(t,function(n,i){"inherit"===t[i]&&(t[i]=e[i])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),h=0===t.lastIndexOf("empty",0)?"fill":"stroke",c=l.getShallow("decal");u.decal=c&&"inherit"!==c?nl(c,a):i.decal,"inherit"===u.fill&&(u.fill=i[o]),"inherit"===u.stroke&&(u.stroke=i[h]),"inherit"===u.opacity&&(u.opacity=("fill"===o?i:n).opacity),s(u,i);var d=e.getModel("lineStyle"),p=d.getLineStyle();if(s(p,n),"auto"===u.fill&&(u.fill=i.fill),"auto"===u.stroke&&(u.stroke=i.fill),"auto"===p.stroke&&(p.stroke=i.fill),!r){var f=e.get("inactiveBorderWidth");u.lineWidth="auto"===f?i.lineWidth>0&&u[h]?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),p.stroke=d.get("inactiveColor"),p.lineWidth=d.get("inactiveWidth")}return{itemStyle:u,lineStyle:p}}(l=b||l||"roundRect",i,a,s,f,y,h),T=new jL,M=i.getModel("textStyle");if(!v(t.getLegendIcon)||b&&"inherit"!==b){var C="inherit"===b&&t.getData().getVisual("symbol")?"inherit"===x?t.getData().getVisual("symbolRotate"):x:0;T.add(((p=Es(d=(c={itemWidth:g,itemHeight:m,icon:l,iconRotate:C,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:w}).icon||"roundRect",0,0,c.itemWidth,c.itemHeight,c.itemStyle.fill,c.symbolKeepAspect)).setStyle(c.itemStyle),p.rotation=(c.iconRotate||0)*Math.PI/180,p.setOrigin([c.itemWidth/2,c.itemHeight/2]),d.indexOf("empty")>-1&&(p.style.stroke=p.style.fill,p.style.fill=X_.color.neutral00,p.style.lineWidth=2),p))}else T.add(t.getLegendIcon({itemWidth:g,itemHeight:m,icon:l,iconRotate:x,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:w}));var k="left"===r?g+5:-5,I=r,L=o.get("formatter"),P=e;_(L)&&L?P=L.replace("{name}",null!=e?e:""):v(L)&&(P=L(e));var D=y?M.getTextColor():i.get("inactiveColor");T.add(new Tv({style:co(M,{text:P,x:k,y:m/2,fill:D,align:I,verticalAlign:"middle"},{inheritColor:D})}));var A=new mv({shape:T.getBoundingRect(),style:{fill:"transparent"}}),O=i.getModel("tooltip");return O.get("show")&&is({el:A,componentModel:o,itemName:e,itemTooltipOption:O.option}),T.add(A),T.eachChild(function(t){t.silent=!0}),A.silent=!u,this.getContentGroup().add(T),no(T),T.__legendDataIndex=n,T},n.prototype.layoutInner=function(t,e,n,i,o,r){var a=this.getContentGroup(),s=this.getSelectorGroup();F_(t.get("orient"),a,t.get("itemGap"),n.width,n.height);var l=a.getBoundingRect(),u=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),o){F_("horizontal",s,t.get("selectorItemGap",!0));var h=s.getBoundingRect(),c=[-h.x,-h.y],d=t.get("selectorButtonGap",!0),p=t.getOrient().index,f=0===p?"width":"height",g=0===p?"height":"width",m=0===p?"y":"x";"end"===r?c[p]+=l[f]+d:u[p]+=h[f]+d,c[1-p]+=l[g]/2-h[g]/2,s.x=c[0],s.y=c[1],a.x=u[0],a.y=u[1];var y={x:0,y:0};return y[f]=l[f]+d+h[f],y[g]=Math.max(l[g],h[g]),y[m]=Math.min(0,h[m]+c[1-p]),y}return a.x=u[0],a.y=u[1],this.group.getBoundingRect()},n.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},n.type="legend.plain",n}(ww);const UL=GL,YL=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}var i;return e(n,t),n.prototype.setScrollDataIndex=function(t){this.option.scrollDataIndex=t},n.prototype.init=function(e,n,i){var o=Jo(e);t.prototype.init.call(this,e,n,i),Hd(this,e,o)},n.prototype.mergeOption=function(e,n){t.prototype.mergeOption.call(this,e,n),Hd(this,this.option,e)},n.type="legend.scroll",n.defaultOption=(i={scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:X_.color.accent50,pageIconInactiveColor:X_.color.accent10,pageIconSize:15,pageTextStyle:{color:X_.color.tertiary},animationDurationUpdate:800},r(r({},ZL.defaultOption,!0),i,!0)),n}(ZL);var XL=Em,qL=["width","height"],KL=["x","y"],$L=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.newlineDisabled=!0,e._currentIndex=0,e}return e(n,t),n.prototype.init=function(){t.prototype.init.call(this),this.group.add(this._containerGroup=new XL),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new XL)},n.prototype.resetInner=function(){t.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},n.prototype.renderInner=function(e,n,i,o,r,a,s){function l(t,e){var i=t+"DataIndex",r=$a(n.get("pageIcons",!0)[n.getOrient().name][e],{onclick:_f(u._pageGo,u,i,n,o)},{x:-d[0]/2,y:-d[1]/2,width:d[0],height:d[1]});r.name=t,h.add(r)}var u=this;t.prototype.renderInner.call(this,e,n,i,o,r,a,s);var h=this._controllerGroup,c=n.get("pageIconSize",!0),d=y(c)?c:[c,c];l("pagePrev",0);var p=n.getModel("pageTextStyle");h.add(new Tv({name:"pageText",style:{text:"xx/xx",fill:p.getTextColor(),font:p.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),l("pageNext",1)},n.prototype.layoutInner=function(t,e,n,i,r,a){var s=this.getSelectorGroup(),l=t.getOrient().index,u=qL[l],h=KL[l],c=qL[1-l],d=KL[1-l];r&&F_("horizontal",s,t.get("selectorItemGap",!0));var p=t.get("selectorButtonGap",!0),f=s.getBoundingRect(),g=[-f.x,-f.y],m=o(n);r&&(m[u]=n[u]-f[u]-p);var y=this._layoutContentAndController(t,i,m,l,u,c,d,h);if(r){if("end"===a)g[l]+=y[u]+p;else{var v=f[u]+p;g[l]-=v,y[h]-=v}y[u]+=f[u]+p,g[1-l]+=y[d]+y[c]/2-f[c]/2,y[c]=Math.max(y[c],f[c]),y[d]=Math.min(y[d],f[d]+g[1-l]),s.x=g[0],s.y=g[1],s.markRedraw()}return y},n.prototype._layoutContentAndController=function(t,e,n,i,o,r,a,s){var l=this.getContentGroup(),u=this._containerGroup,h=this._controllerGroup;F_(t.get("orient"),l,t.get("itemGap"),i?n.width:null,i?null:n.height),F_("horizontal",h,t.get("pageButtonItemGap",!0));var c=l.getBoundingRect(),d=h.getBoundingRect(),p=this._showController=c[o]>n[o],f=[-c.x,-c.y];e||(f[i]=l[s]);var g=[0,0],m=[-d.x,-d.y],y=L(t.get("pageButtonGap",!0),t.get("itemGap",!0));p&&("end"===t.get("pageButtonPosition",!0)?m[i]+=n[o]-d[o]:g[i]+=d[o]+y),m[1-i]+=c[r]/2-d[r]/2,l.setPosition(f),u.setPosition(g),h.setPosition(m);var v={x:0,y:0};if(v[o]=p?n[o]:c[o],v[r]=Math.max(c[r],d[r]),v[a]=Math.min(0,d[a]+m[1-i]),u.__rectSize=n[o],p){var _={x:0,y:0};_[o]=Math.max(n[o]-d[o]-y,0),_[r]=v[r],u.setClipPath(new mv({shape:_})),u.__rectSize=_[o]}else h.eachChild(function(t){t.attr({invisible:!0,silent:!0})});var x=this._getPageInfo(t);return null!=x.pageIndex&&Ia(l,{x:x.contentPosition[0],y:x.contentPosition[1]},p?t:null),this._updatePageInfoView(t,x),v},n.prototype._pageGo=function(t,e,n){var i=this._getPageInfo(e)[t];null!=i&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:e.id})},n.prototype._updatePageInfoView=function(t,e){var n=this._controllerGroup;c(["pagePrev","pageNext"],function(i){var o=null!=e[i+"DataIndex"],r=n.childOfName(i);r&&(r.setStyle("fill",t.get(o?"pageIconColor":"pageIconInactiveColor",!0)),r.cursor=o?"pointer":"default")});var i=n.childOfName("pageText"),o=t.get("pageFormatter"),r=e.pageIndex,a=null!=r?r+1:0,s=e.pageCount;i&&o&&i.setStyle("text",_(o)?o.replace("{current}",null==a?"":a+"").replace("{total}",null==s?"":s+""):o({current:a,total:s}))},n.prototype._getPageInfo=function(t){function e(t){if(t){var e=t.getBoundingRect(),n=e[l]+t[l];return{s:n,e:n+e[s],i:t.__legendDataIndex}}}function n(t,e){return t.e>=e&&t.s<=e+r}var i=t.get("scrollDataIndex",!0),o=this.getContentGroup(),r=this._containerGroup.__rectSize,a=t.getOrient().index,s=qL[a],l=KL[a],u=this._findTargetItemIndex(i),h=o.children(),c=h[u],d=h.length,p=d?1:0,f={contentPosition:[o.x,o.y],pageCount:p,pageIndex:p-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!c)return f;var g=e(c);f.contentPosition[a]=-g.s;for(var m=u+1,y=g,v=g,_=null;m<=d;++m)(!(_=e(h[m]))&&v.e>y.s+r||_&&!n(_,y.s))&&(y=v.i>y.i?v:_)&&(null==f.pageNextDataIndex&&(f.pageNextDataIndex=y.i),++f.pageCount),v=_;for(m=u-1,y=g,v=g,_=null;m>=-1;--m)(_=e(h[m]))&&n(v,_.s)||!(y.i=0;u--){var p,f,g;if(g=null!=(f=Mn((p=n[u]).id,null))?o.get(f):null){d=cP(m=g.parent);var m,y={},v=qo(g,p,m===i?{width:r,height:a}:{width:d.width,height:d.height},null,{hv:p.hv,boundingMode:p.bounding},y);if(!cP(g).isNew&&v){for(var _=p.transition,x={},w=0;w=0)?x[b]=S:g[b]=S}Ia(g,x,t,0)}else g.attr(y)}}},n.prototype._clear=function(){var t=this,e=this._elMap;e.each(function(n){op(n,cP(n).option,e,t._lastGraphicModel)}),this._elMap=B()},n.prototype.dispose=function(){this._clear()},n.type="graphic",n}(ww),pP=Math.sin,fP=Math.cos,gP=Math.PI,mP=2*Math.PI,yP=180/gP;const vP=function(){function t(){}return t.prototype.reset=function(t){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,t||4)},t.prototype.moveTo=function(t,e){this._add("M",t,e)},t.prototype.lineTo=function(t,e){this._add("L",t,e)},t.prototype.bezierCurveTo=function(t,e,n,i,o,r){this._add("C",t,e,n,i,o,r)},t.prototype.quadraticCurveTo=function(t,e,n,i){this._add("Q",t,e,n,i)},t.prototype.arc=function(t,e,n,i,o,r){this.ellipse(t,e,n,n,0,i,o,r)},t.prototype.ellipse=function(t,e,n,i,o,r,a,s){var l,u=a-r,h=!s,c=Math.abs(u),d=de(c-mP)||(h?u>=mP:-u>=mP),p=u>0?u%mP:u%mP+mP;l=!!d||!de(c)&&p>=gP==!!h;var f=t+n*fP(r),g=e+i*pP(r);this._start&&this._add("M",f,g);var m=Math.round(o*yP);if(d){var y=1/this._p,v=(h?1:-1)*(mP-y);this._add("A",n,i,m,1,+h,t+n*fP(r+v),e+i*pP(r+v)),y>.01&&this._add("A",n,i,m,0,+h,f,g)}else{var _=t+n*fP(a),x=e+i*pP(a);this._add("A",n,i,m,+l,+h,_,x)}},t.prototype.rect=function(t,e,n,i){this._add("M",t,e),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},t.prototype.closePath=function(){this._d.length>0&&this._add("Z")},t.prototype._add=function(t,e,n,i,o,r,a,s,l){for(var u=[],h=this._p,c=1;c"].join(i):""}(o.cssNodes,o.cssAnims,{newline:!0});if(u){var h=sp("style","stl",{},[],u);r.push(h)}}return hp(n,i,r,t.useViewBox)},t.prototype.renderToString=function(t){return lp(this.renderToVNode({animation:L((t=t||{}).cssAnimation,!0),emphasis:L(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:L(t.useViewBox,!0)}),{newline:!0})},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t},t.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},t.prototype._paintList=function(t,e,n){for(var i,o,r=t.length,a=[],s=0,l=0,u=0;u=0&&(!c||!o||c[f]!==o[f]);f--);for(var g=p-1;g>f;g--)i=a[--s-1];for(var m=f+1;m=s)}}if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;for(var r,a=[],s=this.maxRepaintRectCount,l=!1,u=new lg(0,0,0,0),h=this.__startIndex;h15)break}n.prevElClipPaths&&c.restore()};if(p)if(0===p.length)s=h.__endIndex;else for(var x=d.dpr,w=0;w0&&t>i[0]){for(s=0;st);s++);a=n[i[s]]}if(i.splice(s+1,0,t),n[t]=e,!e.virtual)if(a){var l=a.dom;l.nextSibling?r.insertBefore(e.dom,l.nextSibling):r.appendChild(e.dom)}else r.firstChild?r.insertBefore(e.dom,r.firstChild):r.appendChild(e.dom);e.painter||(e.painter=this)}},t.prototype.eachLayer=function(t,e){for(var n=this._zlevelList,i=0;i0?HP:0),this._needsManuallyCompositing),h.__builtin__||i("ZLevel "+u+" has been used by unkown layer "+h.id),h!==a&&(h.__used=!0,h.__startIndex!==r&&(h.__dirty=!0),h.__startIndex=r,h.__drawIndex=h.incremental?-1:r,e(r),a=h),1&l.__dirty&&!l.__inHover&&(h.__dirty=!0,h.incremental&&h.__drawIndex<0&&(h.__drawIndex=r))}e(r),this.eachBuiltinLayer(function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)})},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(t){t.clear()},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t,c(this._layers,function(t){t.setUnpainted()})},t.prototype.configLayer=function(t,e){if(e){var n=this._layerConfig;n[t]?r(n[t],e,!0):n[t]=e;for(var i=0;i{let r="right";return o.viewSize[0]-t[0]"graph"===t.componentSubType?"edge"===t.dataType?e.utils.getLinkTooltipInfo(t.data):e.utils.getNodeTooltipInfo(t.data):"lines"===t.componentSubType?e.utils.getLinkTooltipInfo(t.data.link):e.utils.getNodeTooltipInfo(t.data.node)}},n.echartsOption);return i.setOption(e.utils.deepMergeObj(o,t)),i.on("click",t=>{const i=n.onClickElement.bind(e);e.utils.addActionToUrl(e,t),"graph"!==t.componentSubType?"lines"!==t.componentSubType?t.data&&!t.data.cluster&&(n.mapOptions?.nodePopup?.show&&e.gui.loadNodePopup(t.data.node),i("node",t.data.node)):i("link",t.data.link):i("edge"===t.dataType?"link":"node",t.data)},{passive:!0}),i}generateGraphOption(t,e){const n=[],i=e.config,o=t.nodes.map(t=>{const n=e.utils.fastDeepCopy(t),{nodeStyleConfig:o,nodeSizeConfig:r,nodeEmphasisConfig:a}=e.utils.getNodeStyle(t,i,"graph");n.itemStyle=o,n.symbolSize=r,n.emphasis={itemStyle:a.nodeStyle,symbolSize:a.nodeSize};let s="";return"string"==typeof t.label?s=t.label:"string"==typeof t.name?s=t.name:null!=t.id&&(s=String(t.id)),n.name=s,n._source=e.utils.fastDeepCopy(t),n}),r=t.links.map(t=>{const n=e.utils.fastDeepCopy(t),{linkStyleConfig:o,linkEmphasisConfig:r}=e.utils.getLinkStyle(t,i,"graph");return n.lineStyle=o,n.emphasis={lineStyle:r.linkStyle},n}),a={...i.graphConfig.series},s={...a.label||{}};if("number"==typeof e.config.showGraphLabelsAtZoom&&e.config.showGraphLabelsAtZoom>0){const t=e.config.showGraphLabelsAtZoom;s.formatter=n=>(()=>{try{const t=e.echarts.getOption(),n=(Array.isArray(t.series)?t.series:[]).find(t=>t&&"network-graph"===t.id);return n&&"number"==typeof n.zoom?n.zoom:1}catch(t){return 1}})()>=t&&n&&n.data&&n.data.name||""}a.label=s;const l=[{...a,id:"network-graph",type:"graph",layout:i.graphConfig.series.layout||"force",nodes:o,links:r}];return{legend:n.length?{data:n}:void 0,series:l,...i.graphConfig.baseOptions}}generateMapOption(t,e,n=[]){const i=e.config,{nodes:o,links:r}=t,a=t.flatNodes||{},s=[];let l=[];o.forEach(n=>{if(n.properties&&(t.flatNodes||(a[n.id]=e.utils.fastDeepCopy(n))),!n.properties||!n.properties._featureType||"Point"===n.properties._featureType)if(n.properties){const{location:t}=n.properties;if(t&&t.lng&&t.lat){const{nodeEmphasisConfig:o}=e.utils.getNodeStyle(n,i,"map");let r="";"string"==typeof n.label?r=n.label:"string"==typeof n.name?r=n.name:null!=n.id&&(r=String(n.id)),l.push({name:r,value:[t.lng,t.lat],emphasis:{itemStyle:o.nodeStyle,symbolSize:o.nodeSize},node:n,_source:e.utils.fastDeepCopy(n)})}else console.error(`Node ${n.id} position is undefined!`)}else console.error(`Node ${n.id} position is undefined!`)}),r.forEach(t=>{if(a[t.source])if(a[t.target]){const{linkStyleConfig:n,linkEmphasisConfig:o}=e.utils.getLinkStyle(t,i,"map");s.push({coords:[[a[t.source].properties.location.lng,a[t.source].properties.location.lat],[a[t.target].properties.location.lng,a[t.target].properties.location.lat]],lineStyle:n,emphasis:{lineStyle:o.linkStyle},link:t})}else console.warn(`Node ${t.target} does not exist!`);else console.warn(`Node ${t.source} does not exist!`)}),l=l.concat(n);const u=[{id:"geo-map",type:"scatter",name:"nodes",coordinateSystem:"leaflet",data:l,label:{...i.mapOptions.nodeConfig.label||{},...!1===i.showMapLabelsAtZoom?{show:!1}:{},silent:!0},itemStyle:{color:t=>{if(t.data&&t.data.cluster&&t.data.itemStyle&&t.data.itemStyle.color)return t.data.itemStyle.color;if(t.data&&t.data.node&&t.data.node.category){const e=i.nodeCategories.find(e=>e.name===t.data.node.category);return e&&e.nodeStyle&&e.nodeStyle.color||i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeStyle&&i.mapOptions.nodeConfig.nodeStyle.color||"#6c757d"}return i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeStyle&&i.mapOptions.nodeConfig.nodeStyle.color||"#6c757d"}},symbolSize:(t,n)=>{if(n.data&&n.data.cluster)return i.mapOptions.clusterConfig&&i.mapOptions.clusterConfig.symbolSize||30;if(n.data&&n.data.node){const{nodeSizeConfig:t}=e.utils.getNodeStyle(n.data.node,i,"map");return"object"==typeof t?i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeSize||17:t}return i.mapOptions.nodeConfig&&i.mapOptions.nodeConfig.nodeSize||17},emphasis:i.mapOptions.nodeConfig.emphasis},Object.assign(i.mapOptions.linkConfig,{id:"map-links",type:"lines",coordinateSystem:"leaflet",data:s})];return{leaflet:{tiles:i.mapTileConfig,mapOptions:i.mapOptions},series:u,...i.mapOptions.baseOptions}}_propagateGraphZoom(t){const e=t.echarts.getDom&&t.echarts.getDom();if(!e)return;const n=e.querySelector("canvas");e.addEventListener("wheel",t=>{if(!n)return;const i=e.getBoundingClientRect();if(t.clientXi.right||t.clientYi.bottom)return;t.preventDefault();const o=n.getBoundingClientRect();n.dispatchEvent(new WheelEvent("wheel",{bubbles:!0,cancelable:!0,view:window,clientX:o.left+o.width/2,clientY:o.top+o.height/2,deltaY:-t.deltaY,deltaMode:t.deltaMode}))},{passive:!1})}graphRender(t,e){e.utils.echartsSetOption(e.utils.generateGraphOption(t,e),e),window.onresize=()=>{e.echarts.resize()},e.utils._propagateGraphZoom(e),e.config.showGraphLabelsAtZoom>0&&e.echarts.on("graphRoam",t=>{if(!t||!t.zoom)return;const n=e.echarts.getOption(),i=n&&n.series&&n.series[0]&&n.series[0].zoom>=e.config.showGraphLabelsAtZoom;i!==e._labelsVisible&&(e.echarts.resize({animation:!1,silent:!0}),e._labelsVisible=i)}),e.utils.setupHashChangeHandler(e),e.event.emit("onLoad"),e.event.emit("onReady"),e.event.emit("renderArray"),e.event.emit("applyUrlFragmentState")}mapRender(t,e){const n=xl();if(!n)throw new Error("Leaflet api is not loaded");const{circleMarker:i,latLngBounds:o}=n;if(!e.config.mapTileConfig[0])throw new Error('You must add the tiles via the "mapTileConfig" param!');e.utils.isGeoJSON(t)&&(e.originalGeoJSON=e.utils.fastDeepCopy(t),t=e.utils.geojsonToNetjson(t));const r=e.utils.generateMapOption(t,e);if(e.utils.echartsSetOption(r,e),e.bboxData={nodes:[],links:[]},e.leaflet=e.echarts._api.getCoordinateSystems()[0].getLeaflet(),e.leaflet._zoomAnimated=!1,e.config.geoOptions=e.utils.deepMergeObj({pointToLayer:(t,n)=>i(n,e.config.geoOptions.style),onEachFeature:(t,n)=>{n.on("click",()=>{const n={...t.properties};e.config.onClickElement.call(e,"Feature",n)})}},e.config.geoOptions),e.originalGeoJSON){!function(t){if(!t.originalGeoJSON||!Array.isArray(t.originalGeoJSON.features))return;const e=xl();if(!e)return;const{geoJSON:n}=e,i=t.leaflet,o=t.originalGeoJSON.features.filter(t=>t&&t.geometry&&("Polygon"===t.geometry.type||"MultiPolygon"===t.geometry.type));if(!o.length)return;let r=i.getPane("njg-polygons");r||(r=i.createPane("njg-polygons"),r.style.zIndex=410);const a={fillColor:"#1566a9",color:"#1566a9",weight:0,fillOpacity:.6},s=n({type:"FeatureCollection",features:o},{pane:"njg-polygons",style:e=>{const n=e.properties&&e.properties.echartsStyle||{},i={...a,...t.config.geoOptions&&t.config.geoOptions.style};return n.areaColor&&(i.fillColor=n.areaColor),n.color&&(i.color=n.color),void 0!==n.opacity&&(i.fillOpacity=n.opacity),void 0!==n.borderWidth&&(i.weight=n.borderWidth),i},onEachFeature:(e,n)=>{n.on("click",()=>{t.config.onClickElement.call(t,"Feature",e.properties||{})})},...t.config.geoOptions}).addTo(i);t.leaflet.polygonGeoJSON=s}(e);let n=null;if(e.leaflet.polygonGeoJSON&&"function"==typeof e.leaflet.polygonGeoJSON.getBounds&&(n=e.leaflet.polygonGeoJSON.getBounds()),t.nodes&&t.nodes.length){const e=t.nodes.map(t=>t.properties.location).map(t=>[t.lat,t.lng]);n?e.forEach(t=>n.extend(t)):n=o(e)}n&&n.isValid()&&e.leaflet.fitBounds(n,{padding:[20,20]})}if(e.utils.updateLabelVisibility(e,!0),e.leaflet.on("zoomend",()=>{e.utils.updateLabelVisibility(e,!0);const t=e.leaflet.getZoom(),n=e.leaflet.getMinZoom(),i=e.leaflet.getMaxZoom(),o=document.querySelector(".leaflet-control-zoom-in"),r=document.querySelector(".leaflet-control-zoom-out");o&&r&&(Math.round(t)>=i?o.classList.add("leaflet-disabled"):o.classList.remove("leaflet-disabled"),Math.round(t)<=n?r.classList.add("leaflet-disabled"):r.classList.remove("leaflet-disabled"))}),e.leaflet.on("moveend",async()=>{const n=e.leaflet.getBounds();if(e.leaflet.getZoom()>=e.config.loadMoreAtZoomLevel&&e.hasMoreData){const i=await e.utils.getBBoxData.call(e,e.JSONParam,n);e.config.prepareData.call(e,i);const o=new Set(e.data.nodes.map(t=>t.id)),r=new Set(e.data.links.map(t=>t.source)),a=new Set(e.data.links.map(t=>t.target)),s=i.nodes.filter(t=>!o.has(t.id)),l=i.links.filter(t=>!r.has(t.source)&&!a.has(t.target)),u=new Set(i.nodes.map(t=>t.id)),h=e.bboxData.nodes.filter(t=>!u.has(t.id)),c=new Set(h.map(t=>t.id));t.nodes=t.nodes.filter(t=>!c.has(t.id)),e.bboxData.nodes=e.bboxData.nodes.concat(s),e.bboxData.links=e.bboxData.links.concat(l),t={...t,nodes:t.nodes.concat(s),links:t.links.concat(l)},e.echarts.setOption(e.utils.generateMapOption(t,e)),e.data=t}else e.hasMoreData&&e.bboxData.nodes.length>0&&(()=>{const n=new Set(e.bboxData.nodes),i=new Set(e.bboxData.links);t={...t,nodes:t.nodes.filter(t=>!n.has(t)),links:t.links.filter(t=>!i.has(t))},e.data=t,e.echarts.setOption(e.utils.generateMapOption(t,e)),e.bboxData.nodes=[],e.bboxData.links=[]})()}),e.config.clustering&&e.config.clusteringThresholde.config.disableClusteringAtLevel&&(n=[],i=t.nodes,o=t.links),e.echarts.setOption(e.utils.generateMapOption({...t,nodes:i,links:o},e,n)),e.utils.updateLabelVisibility(e,!0),e.echarts.on("click",t=>{if(("scatter"===t.componentSubType||"effectScatter"===t.componentSubType)&&t.data.cluster){const n=e.leaflet.getZoom(),i=Math.min(n+2,e.leaflet.getMaxZoom());e.leaflet.setView([t.data.value[1],t.data.value[0]],i)}}),e.leaflet.on("zoomend",()=>{if(e.leaflet.getZoom(){e.echarts.appendData({seriesIndex:n,data:t.data})}),e.utils.mergeData(t,e)),e.config.afterUpdate.call(e)}addData(t,e){e.utils.mergeData(t,e),e.data.nodes&&e.data.nodes.length>0&&(e.data.nodes=e.utils.deduplicateNodesById(e.data.nodes)),e.utils.render(),e.config.afterUpdate.call(e)}mergeData(t,e){t.nodes||(t.nodes=[]);const n=new Set;e.data.nodes.forEach(t=>{t.id&&n.add(t.id)});const i=t.nodes.filter(t=>!t.id||!n.has(t.id)||(console.warn(`Duplicate node ID ${t.id} detected during merge and skipped.`),!1)),o=e.data.nodes.concat(i),r=e.data.links.concat(t.links||[]);Object.assign(e.data,t,{nodes:o,links:r})}},UP=class{constructor(t){this.self=t,this.renderModeSelector=null,this.controls=null,this.sideBar=null,this.metaInfoContainer=null,this.nodeLinkInfoContainer=null}createControls(){const t=document.createElement("div");return t.setAttribute("class","njg-controls"),this.self.el.appendChild(t),t}createRenderModeSelector(){const t=document.createElement("div"),e=document.createElement("span");return e.setAttribute("class","iconfont icon-eye"),t.setAttribute("class","njg-selectIcon"),t.appendChild(e),this.controls.appendChild(t),t}createSideBar(){const t=document.createElement("div");t.setAttribute("class","njg-sideBar"),t.classList.add("hidden");const e=document.createElement("button");return t.appendChild(e),e.classList.add("sideBarHandle"),e.onclick=()=>{t.classList.toggle("hidden");const e=document.querySelector(".njg-metaInfoContainer");(this.self.config.showMetaOnNarrowScreens||this.self.el.clientWidth>850)&&e&&(e.style.display="flex")},this.self.el.appendChild(t),t}hideInfoOnNarrowScreen(){!this.self.config.showMetaOnNarrowScreens&&this.self.el.clientWidth<850&&(this.metaInfoContainer.style.display="none"),"none"===this.metaInfoContainer.style.display&&"none"===this.nodeLinkInfoContainer.style.display&&this.sideBar.classList.add("hidden")}createMetaInfoContainer(){const t=document.createElement("div"),e=document.createElement("h2"),n=document.createElement("div");n.classList.add("njg-metaData"),t.classList.add("njg-metaInfoContainer");const i=document.createElement("span");return i.classList.add("njg-closeButton"),e.innerHTML="Info",i.innerHTML=" ✕",e.appendChild(i),t.appendChild(e),t.appendChild(n),this.metaInfoContainer=t,this.sideBar.appendChild(t),this.nodeLinkInfoContainer=this.createNodeLinkInfoContainer(),this.hideInfoOnNarrowScreen(),window.addEventListener("resize",this.hideInfoOnNarrowScreen.bind(this)),i.onclick=()=>{this.metaInfoContainer.style.display="none","none"===this.nodeLinkInfoContainer.style.display&&this.sideBar.classList.add("hidden")},t}createNodeLinkInfoContainer(){const t=document.createElement("div");return t.classList.add("njg-nodeLinkInfoContainer"),t.style.display="none",this.sideBar.appendChild(t),t}getNodeLinkInfo(t,e){const n=document.querySelectorAll(".njg-infoContainer"),i=document.querySelectorAll(".njg-headerContainer");for(let t=0;t"clients"===t?"Clients":/^clients\s*\[\d+\]$/i.test(t)?t.replace(/^clients/i,"Client"):"localAddresses"===t?"Local Addresses":t.replace(/_/g," "),u=(t,e,n,i=0)=>{if(null==n||"string"==typeof n&&(""===n.trim()||/^(undefined|null)$/i.test(n.trim()))&&"0"!==n)return;if(Array.isArray(n)){if(0===n.length){const n=document.createElement("div");n.classList.add("njg-infoItems"),n.style.paddingLeft=12*i+"px";const o=document.createElement("span");o.setAttribute("class","njg-keyLabel");const r=document.createElement("span");return r.setAttribute("class","njg-valueLabel"),o.innerHTML=l(e),r.innerHTML="[]",n.appendChild(o),n.appendChild(r),void t.appendChild(n)}if(n.every(t=>"object"!=typeof t||null===t)){const o=document.createElement("div");o.classList.add("njg-infoItems"),o.style.paddingLeft=12*i+"px";const r=document.createElement("span");r.setAttribute("class","njg-keyLabel");const a=document.createElement("span");return a.setAttribute("class","njg-valueLabel"),r.innerHTML=l(e),a.innerHTML=n.map(t=>"string"==typeof t?t.replace(/\n/g,"
"):String(t)).join("
"),o.appendChild(r),o.appendChild(a),void t.appendChild(o)}return void n.forEach((n,o)=>{u(t,`${e} [${o+1}]`,n,i)})}if("object"==typeof n){if("location"===e&&"number"==typeof n.lat&&"number"==typeof n.lng){const e=document.createElement("div");e.classList.add("njg-infoItems"),e.style.paddingLeft=12*i+"px";const o=document.createElement("span");o.setAttribute("class","njg-keyLabel");const r=document.createElement("span");return r.setAttribute("class","njg-valueLabel"),o.innerHTML="Location",r.innerHTML=`${Math.round(1e3*n.lat)/1e3}, ${Math.round(1e3*n.lng)/1e3}`,e.appendChild(o),e.appendChild(r),void t.appendChild(e)}const o=document.createElement("div");o.classList.add("njg-infoItems"),o.style.paddingLeft=12*i+"px";const r=document.createElement("span");r.setAttribute("class","njg-keyLabel");const a=document.createElement("span");return a.setAttribute("class","njg-valueLabel"),r.innerHTML=l(e),a.innerHTML="",o.appendChild(r),o.appendChild(a),t.appendChild(o),void Object.keys(n).forEach(e=>{u(t,e,n[e],i+1)})}const o=document.createElement("div");o.classList.add("njg-infoItems"),o.style.paddingLeft=12*i+"px";const r=document.createElement("span");r.setAttribute("class","njg-keyLabel");const a=document.createElement("span");a.setAttribute("class","njg-valueLabel"),r.innerHTML=l(e);const s="string"==typeof n?n.replace(/\n/g,"
"):String(n);a.innerHTML=s,o.appendChild(r),o.appendChild(a),t.appendChild(o)};Object.keys(e).forEach(t=>u(r,t,e[t],0)),o.appendChild(a),o.appendChild(s),this.nodeLinkInfoContainer.appendChild(o),this.nodeLinkInfoContainer.appendChild(r),s.onclick=()=>{this.nodeLinkInfoContainer.style.display="none",null!==this.metaInfoContainer&&"none"!==this.metaInfoContainer.style.display||this.sideBar.classList.add("hidden")}}getNodeLocation(t){return t?.properties?.location||t?.location}async loadNodePopup(t){const{self:e}=this;if(!e.leaflet)return void console.error("Leaflet map not available. Cannot load popup.");const n=this.getNodeLocation(t);if(!n)return void console.error("Node location not available. Cannot load popup.");const{bookmarkableActions:{id:i,preserveFragment:o}={}}=e.config,r={};e.leaflet.currentPopupRequest=r;const a=Boolean(e.leaflet.currentPopup);if(e.leaflet.currentPopup){const t=e.leaflet.currentPopup;e.leaflet.currentPopup=null,t.remove()}let s=e.config.mapOptions.nodePopup.content;if(null==s)s=this.createDefaultPopupContent(t);else if("function"==typeof s)try{s=await s.call(e,t)}catch(t){if(e.leaflet.currentPopupRequest!==r)return;return e.utils.removeUrlFragment(i,"nodeId",o),e.leaflet.currentPopupRequest=null,a&&(e.utils.setTooltipVisibility(e,!0),e.utils.updateLabelVisibility(e,!0)),void console.error("Failed to build node popup content:",t)}if(e.leaflet.currentPopupRequest!==r)return;const l=Object.fromEntries(Object.entries(e.config.mapOptions.nodePopup.config||{}).filter(([,t])=>null!=t)),u=window.L.popup({...l}).setLatLng(n).setContent(s),h=t&&null!=t.id?String(t.id):null;u.on("remove",()=>{if(e.leaflet.currentPopup===u){if(e.utils.setTooltipVisibility(e,!0),e.utils.updateLabelVisibility(e,!0),e.config.bookmarkableActions&&e.config.bookmarkableActions.enabled&&h){const t=e.utils.parseUrlFragments()[i];t&&t.get("nodeId")===h&&e.utils.removeUrlFragment(i,"nodeId",o)}e.leaflet.currentPopup=null,e.leaflet.currentPopupRequest===r&&(e.leaflet.currentPopupRequest=null)}}),e.leaflet.currentPopup=u,u.openOn(e.leaflet),e.utils.setTooltipVisibility(e,!1),e.utils.updateLabelVisibility(e,!1);const{onOpen:c}=e.config.mapOptions.nodePopup;if("function"==typeof c)try{c.call(e)}catch(t){e.leaflet.currentPopup&&e.leaflet.currentPopup.remove(),console.error("Failed to run popup onOpen callback:",t)}}createDefaultPopupContent(t){const e=document.createElement("div");e.classList.add("default-popup");const n=this.getNodeLocation(t),i=Number(n?.lat),o=Number(n?.lng),r=Number.isFinite(i)&&Number.isFinite(o),a={name:t?.name,id:t?.id,label:t?.label,location:r?`${i.toFixed(8)}, ${o.toFixed(8)}`:null};return Object.keys(a).forEach(t=>{const n=a[t];if(null==n||""===n)return;const i=document.createElement("div");i.classList.add("njg-tooltip-item");const o=document.createElement("span");o.classList.add("njg-tooltip-key"),o.textContent=t;const r=document.createElement("span");r.classList.add("njg-tooltip-value"),r.textContent=String(n),i.appendChild(o),i.appendChild(r),e.appendChild(i)}),e}init(){this.sideBar=this.createSideBar(),this.self.config.switchMode&&(this.controls=this.createControls(),this.renderModeSelector=this.createRenderModeSelector())}},YP=function(){function t(t,e){this._map=t,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=e,this._projection=r.Mercator}function e(t,e,n,i){const{leafletModel:o,seriesModel:r}=n,a=o?o.coordinateSystem:r?r.coordinateSystem||(r.getReferringComponents("leaflet")[0]||{}).coordinateSystem:null;return a===this?a[t](i):null}const n=xl();if(!n)throw new Error("Leaflet api is not loaded");const{Layer:i,DomUtil:o,Projection:r,LatLng:a,map:s,control:l,tileLayer:u}=n,h=i.extend({initialize(t){this._container=t},onAdd(t){t.getPane(this.options.pane).appendChild(this._container),t.zoomControl.setPosition("topright")},onRemove(){o.remove(this._container)},_update(){}});return t.dimensions=["lng","lat"],t.prototype.dimensions=["lng","lat"],t.prototype.setZoom=function(t){this._zoom=t},t.prototype.setCenter=function(t){this._center=this._projection.project(new a(t[1],t[0]))},t.prototype.setMapOffset=function(t){this._mapOffset=t},t.prototype.getLeaflet=function(){return this._map},t.prototype.getViewRect=function(){const t=this._api;return new lg(0,0,t.getWidth(),t.getHeight())},t.prototype.getRoamTransform=function(){return[1,0,0,1,0,0]},t.prototype.dataToPoint=function(t){const e=new a(t[1],t[0]),n=this._map.latLngToLayerPoint(e),i=this._mapOffset;return[n.x-i[0],n.y-i[1]]},t.prototype.pointToData=function(t){const e=this._mapOffset,n=this._map.layerPointToLatLng({x:t[0]+e[0],y:t[1]+e[1]});return[n.lng,n.lat]},t.prototype.convertToPixel=m(e,"dataToPoint"),t.prototype.convertFromPixel=m(e,"pointToData"),t.create=function(e,n){let i;const o=[],r=n.getDom();return e.eachComponent("leaflet",e=>{const a=n.getZr().painter.getViewportRoot();if(i)throw new Error("Only one leaflet component can exist");if(!e.__map){let t=r.querySelector(".ec-extension-leaflet");t&&(a.style.left="0px",a.style.top="0px",r.removeChild(t)),t=document.createElement("div"),t.style.cssText="width:100%;height:100%",t.classList.add("ec-extension-leaflet"),r.appendChild(t),e.__map=s(t,e.get("mapOptions"));const n=e.__map,i=e.get("tiles"),o={};let c=!1;if(i.forEach(t=>{const e=u(t.urlTemplate,t.options);t.label?(c||(e.addTo(n),c=!0),o[t.label]=e):e.addTo(n)}),i.length>1){const t=e.get("layerControl");l.layers(o,{},t).addTo(n)}const d=document.createElement("div");d.style="position: absolute;left: 0;top: 0;z-index: 100",d.appendChild(a),new h(d).addTo(n)}i=new t(e.__map,n),o.push(i),i.setMapOffset(e.__mapOffset||[0,0]);const{center:c,zoom:d}=e.get("mapOptions");c&&d&&(i.setZoom(d),i.setCenter(c)),e.coordinateSystem=i}),e.eachSeries(t=>{"leaflet"===t.get("coordinateSystem")&&(t.coordinateSystem=i)}),o},t};Xp.version="1.0.0";const XP=Xp;window.L=t(481);let qP=!1;window.NetJSONGraph=class{constructor(t,e={}){return this.graph=new WT(t),this.config=this.initializeConfig(e),this.graph.setConfig(this.config),this.setupGraph(),this.config.onInit.call(this.graph),this.initializeECharts(),void 0===e.showMapLabelsAtZoom&&void 0!==e.showLabelsAtZoomLevel&&(console.warn("showLabelsAtZoomLevel has been renamed to showMapLabelsAtZoom, please update your code accordingly."),this.graph.config.showMapLabelsAtZoom=e.showLabelsAtZoomLevel),this.graph}initializeConfig(t={}){return{...t,render:"map"===t.render?GP.prototype.mapRender:GP.prototype.graphRender,onInit:this.onInit,onRender:this.onRender,onUpdate:this.onUpdate,afterUpdate:this.afterUpdate,onLoad:this.onLoad}}setupGraph(){Object.setPrototypeOf(GP.prototype,this.graph.utils),this.graph.gui=new UP(this.graph),this.graph.utils=new GP,this.graph.setUtils(),this.graph.event=this.graph.utils.createEvent()}initializeECharts(){qP||(XP(),qP=!0),this.graph.echarts=function(t,e,n){var i=!(n&&n.ssr);if(i){var o=ul(t);if(o)return o}var r=new xT(t,null,n);return r.id="ec_"+OT++,DT[r.id]=r,i&&On(t,zT,r.id),oT(r),HS.trigger("afterinit",r),r}(this.graph.el,0,{renderer:this.graph.config.svgRender?"svg":"canvas"})}onInit(){return this.config}onRender(){return this.utils.showLoading.call(this),this.gui.init(),this.config}onUpdate(){return this.config}afterUpdate(){return this.config}onLoad(){return this.config.metadata&&this.utils.isNetJSON(this.data)?(this.gui.createMetaInfoContainer(this.graph),this.utils.updateMetadata.call(this)):this.gui.nodeLinkInfoContainer=this.gui.createNodeLinkInfoContainer(),this.config.switchMode&&this.utils.isNetJSON(this.data)&&(this.gui.renderModeSelector.onclick=()=>{if(this.config.render===this.utils.mapRender){this.config.render=this.utils.graphRender;const t=this.echarts.getZr().painter.getViewportRoot().parentNode;this.echarts.clear(),this.utils.graphRender(this.data,this),t.style.background=this.echarts.getZr()._backgroundColor,document.querySelector(".leaflet-control-attribution").style.display="none",document.querySelector(".leaflet-control-zoom").style.display="none"}else this.echarts.clear(),this.config.render=this.utils.mapRender,this.utils.mapRender(this.data,this),document.querySelector(".leaflet-control-attribution").style.display="block",document.querySelector(".leaflet-control-zoom").style.display="block"}),this.utils.hideLoading.call(this),this.attachClientsOverlay=t=>function(t,e={}){function n(){u=function(){const t=o.getOption();return t&&t.series&&t.series[0]&&t.series[0].zoom?t.series[0].zoom:1}(),d.attr("invisible",!(u>=l))}function i(){const t=o.getModel().getSeriesByIndex(0);if(!t)return;const e=t.getData();if(!e)return;if(n(),d.removeAll(),u{let r=0;if(0!==n)for(let s=0;rt?"number"==typeof t.clients?t.clients:Array.isArray(t.clients)?t.clients.length:0:0,c=function(){const t=o.getModel().getSeriesByIndex(0);if(!t)return null;const e=(o._chartsViews||[]).find(e=>e&&e.__model&&e.__model.uid===t.uid);return e?e.group:null}();if(!c)return{destroy(){}};const d=new Em({silent:!0,z:100,zlevel:1});c.add(d);const p=t&&t.config&&t.config.graphConfig&&t.config.graphConfig.series||{},f=("number"==typeof p.nodeSize?p.nodeSize:18)/2,g=[["finished",i],["rendered",i],["graphLayoutEnd",i],["graphRoam",()=>{n(),i()}]];return g.forEach(([t,e])=>o.on(t,e)),i(),{destroy(){g.forEach(([t,e])=>{o&&o.off&&o.off(t,e)}),d&&d.parent&&d.parent.remove(d)},setMinZoomLevel(t){l=t,i()},getMinZoomLevel:()=>l}}(this,t),this.config}}})()})(); \ No newline at end of file