apexcharts 8.2.0 → 8.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/README.md +7 -7
  2. package/dist/apexcharts.common.js +2 -2
  3. package/dist/apexcharts.core.js +271 -173
  4. package/dist/apexcharts.core.min.js +2 -2
  5. package/dist/apexcharts.css +35 -0
  6. package/dist/apexcharts.esm.js +1722 -1527
  7. package/dist/apexcharts.full.js +1459 -1075
  8. package/dist/apexcharts.full.min.js +2 -2
  9. package/dist/apexcharts.js +994 -715
  10. package/dist/apexcharts.min.js +2 -2
  11. package/dist/apexcharts.ssr.common.js +2 -2
  12. package/dist/apexcharts.ssr.esm.js +994 -715
  13. package/dist/area.common.js +2 -2
  14. package/dist/area.esm.js +91 -40
  15. package/dist/bar.common.js +2 -2
  16. package/dist/bar.esm.js +433 -394
  17. package/dist/bar.js +2 -2
  18. package/dist/boxPlot.common.js +2 -2
  19. package/dist/boxPlot.esm.js +364 -322
  20. package/dist/bubble.common.js +2 -2
  21. package/dist/bubble.esm.js +91 -40
  22. package/dist/candlestick.common.js +2 -2
  23. package/dist/candlestick.esm.js +364 -322
  24. package/dist/candlestick.js +2 -2
  25. package/dist/column.common.js +2 -2
  26. package/dist/column.esm.js +433 -394
  27. package/dist/core.common.js +2 -2
  28. package/dist/core.esm.js +271 -173
  29. package/dist/donut.common.js +1 -1
  30. package/dist/donut.esm.js +1 -1
  31. package/dist/dumbbell.common.js +2 -2
  32. package/dist/dumbbell.esm.js +433 -394
  33. package/dist/features/all.common.js +2 -2
  34. package/dist/features/all.esm.js +250 -187
  35. package/dist/features/annotations.common.js +1 -1
  36. package/dist/features/annotations.esm.js +1 -1
  37. package/dist/features/annotations.js +1 -1
  38. package/dist/features/context-menu.common.js +1 -1
  39. package/dist/features/context-menu.esm.js +1 -1
  40. package/dist/features/context-menu.js +1 -1
  41. package/dist/features/drilldown.common.js +2 -2
  42. package/dist/features/drilldown.esm.js +4 -2
  43. package/dist/features/drilldown.js +2 -2
  44. package/dist/features/dumbbell.common.js +1 -1
  45. package/dist/features/dumbbell.esm.js +1 -1
  46. package/dist/features/dumbbell.js +1 -1
  47. package/dist/features/exports.common.js +1 -1
  48. package/dist/features/exports.esm.js +1 -1
  49. package/dist/features/exports.js +1 -1
  50. package/dist/features/facet.common.js +1 -1
  51. package/dist/features/facet.esm.js +1 -1
  52. package/dist/features/facet.js +1 -1
  53. package/dist/features/highlight-filter.common.js +2 -2
  54. package/dist/features/highlight-filter.esm.js +14 -9
  55. package/dist/features/highlight-filter.js +2 -2
  56. package/dist/features/history.common.js +1 -1
  57. package/dist/features/history.esm.js +1 -1
  58. package/dist/features/history.js +1 -1
  59. package/dist/features/ink.common.js +1 -1
  60. package/dist/features/ink.esm.js +1 -1
  61. package/dist/features/ink.js +1 -1
  62. package/dist/features/keyboard.common.js +2 -2
  63. package/dist/features/keyboard.esm.js +97 -145
  64. package/dist/features/keyboard.js +2 -2
  65. package/dist/features/legend.common.js +2 -2
  66. package/dist/features/legend.esm.js +63 -43
  67. package/dist/features/legend.js +2 -2
  68. package/dist/features/link.common.js +1 -1
  69. package/dist/features/link.esm.js +1 -1
  70. package/dist/features/link.js +1 -1
  71. package/dist/features/marks.common.js +1 -1
  72. package/dist/features/marks.esm.js +1 -1
  73. package/dist/features/marks.js +1 -1
  74. package/dist/features/measure.common.js +1 -1
  75. package/dist/features/measure.esm.js +1 -1
  76. package/dist/features/measure.js +1 -1
  77. package/dist/features/morph.common.js +1 -1
  78. package/dist/features/morph.esm.js +1 -1
  79. package/dist/features/morph.js +1 -1
  80. package/dist/features/perspectives.common.js +1 -1
  81. package/dist/features/perspectives.esm.js +1 -1
  82. package/dist/features/perspectives.js +1 -1
  83. package/dist/features/raincloud.common.js +1 -1
  84. package/dist/features/raincloud.esm.js +1 -1
  85. package/dist/features/raincloud.js +1 -1
  86. package/dist/features/renderer-canvas.common.js +2 -2
  87. package/dist/features/renderer-canvas.esm.js +2 -1
  88. package/dist/features/renderer-canvas.js +2 -2
  89. package/dist/features/stats.common.js +1 -1
  90. package/dist/features/stats.esm.js +1 -1
  91. package/dist/features/stats.js +1 -1
  92. package/dist/features/storyboard.common.js +1 -1
  93. package/dist/features/storyboard.esm.js +1 -1
  94. package/dist/features/storyboard.js +1 -1
  95. package/dist/features/streamgraph.common.js +2 -2
  96. package/dist/features/streamgraph.esm.js +3 -2
  97. package/dist/features/streamgraph.js +2 -2
  98. package/dist/features/toolbar.common.js +2 -2
  99. package/dist/features/toolbar.esm.js +92 -2
  100. package/dist/features/toolbar.js +2 -2
  101. package/dist/features/trellis.common.js +2 -2
  102. package/dist/features/trellis.esm.js +83 -47
  103. package/dist/features/trellis.js +2 -2
  104. package/dist/features/waterfall.common.js +1 -1
  105. package/dist/features/waterfall.esm.js +1 -1
  106. package/dist/features/waterfall.js +1 -1
  107. package/dist/features/weave.common.js +1 -1
  108. package/dist/features/weave.esm.js +1 -1
  109. package/dist/features/weave.js +1 -1
  110. package/dist/full.common.js +2 -2
  111. package/dist/full.esm.js +950 -795
  112. package/dist/heatmap.common.js +2 -2
  113. package/dist/heatmap.esm.js +3 -17
  114. package/dist/heatmap.js +2 -2
  115. package/dist/histogram.common.js +2 -2
  116. package/dist/histogram.esm.js +433 -394
  117. package/dist/icicle.common.js +2 -2
  118. package/dist/icicle.esm.js +54 -38
  119. package/dist/icicle.js +2 -2
  120. package/dist/line.common.js +2 -2
  121. package/dist/line.esm.js +91 -40
  122. package/dist/line.js +2 -2
  123. package/dist/locales/en.json +2 -1
  124. package/dist/locales/ro.json +3 -2
  125. package/dist/pictograms.common.js +1 -1
  126. package/dist/pictograms.esm.js +1 -1
  127. package/dist/pictograms.js +1 -1
  128. package/dist/pie.common.js +1 -1
  129. package/dist/pie.esm.js +1 -1
  130. package/dist/pie.js +1 -1
  131. package/dist/polarArea.common.js +1 -1
  132. package/dist/polarArea.esm.js +1 -1
  133. package/dist/radar.common.js +2 -2
  134. package/dist/radar.esm.js +5 -4
  135. package/dist/radar.js +2 -2
  136. package/dist/radialBar.common.js +1 -1
  137. package/dist/radialBar.esm.js +1 -1
  138. package/dist/radialBar.js +1 -1
  139. package/dist/raincloud.common.js +2 -2
  140. package/dist/raincloud.esm.js +72 -26
  141. package/dist/rangeArea.common.js +2 -2
  142. package/dist/rangeArea.esm.js +91 -40
  143. package/dist/rangeBar.common.js +2 -2
  144. package/dist/rangeBar.esm.js +433 -394
  145. package/dist/scatter.common.js +2 -2
  146. package/dist/scatter.esm.js +91 -40
  147. package/dist/streamgraph.common.js +2 -2
  148. package/dist/streamgraph.esm.js +93 -41
  149. package/dist/sunburst.common.js +2 -2
  150. package/dist/sunburst.esm.js +103 -93
  151. package/dist/sunburst.js +2 -2
  152. package/dist/treemap.common.js +2 -2
  153. package/dist/treemap.esm.js +105 -86
  154. package/dist/treemap.js +2 -2
  155. package/dist/unit-shapes.common.js +1 -1
  156. package/dist/unit-shapes.esm.js +1 -1
  157. package/dist/unit-shapes.js +1 -1
  158. package/dist/unit.common.js +2 -2
  159. package/dist/unit.esm.js +280 -202
  160. package/dist/unit.js +2 -2
  161. package/dist/violin.common.js +2 -2
  162. package/dist/violin.esm.js +72 -26
  163. package/dist/violin.js +2 -2
  164. package/dist/waterfall.common.js +2 -2
  165. package/dist/waterfall.esm.js +432 -393
  166. package/package.json +1 -1
  167. package/src/apexcharts.js +13 -6
  168. package/src/assets/apexcharts.css +35 -0
  169. package/src/charts/Bar.js +62 -55
  170. package/src/charts/BarStacked.js +80 -88
  171. package/src/charts/BoxCandleStick.js +28 -31
  172. package/src/charts/Icicle.js +37 -37
  173. package/src/charts/Line.js +118 -42
  174. package/src/charts/Radar.js +5 -7
  175. package/src/charts/RangeBar.js +47 -43
  176. package/src/charts/Sunburst.js +101 -98
  177. package/src/charts/Treemap.js +108 -66
  178. package/src/charts/Unit.js +368 -250
  179. package/src/charts/Violin.js +48 -30
  180. package/src/charts/common/Breadcrumb.js +2 -2
  181. package/src/charts/common/Hierarchy.js +32 -11
  182. package/src/charts/common/Jitter.js +32 -7
  183. package/src/charts/common/bar/DataLabels.js +76 -81
  184. package/src/charts/common/bar/Helpers.js +43 -7
  185. package/src/charts/common/line/Helpers.js +12 -15
  186. package/src/charts/common/partition/NodeTooltip.js +8 -1
  187. package/src/charts/common/partition/Partition.js +33 -1
  188. package/src/charts/common/treemap/Helpers.js +3 -11
  189. package/src/locales/en.json +2 -1
  190. package/src/locales/ro.json +3 -2
  191. package/src/modules/Core.js +4 -0
  192. package/src/modules/CoreUtils.js +18 -42
  193. package/src/modules/Data.js +23 -24
  194. package/src/modules/DataLabels.js +6 -6
  195. package/src/modules/Graphics.js +62 -49
  196. package/src/modules/Markers.js +3 -1
  197. package/src/modules/Range.js +44 -29
  198. package/src/modules/RendererController.js +17 -3
  199. package/src/modules/Scales.js +32 -9
  200. package/src/modules/Series.js +39 -18
  201. package/src/modules/Theme.js +1 -1
  202. package/src/modules/ZoomPanSelection.js +119 -2
  203. package/src/modules/accessibility/KeyboardNavigation.js +114 -186
  204. package/src/modules/animations/LengthTransition.js +22 -2
  205. package/src/modules/drilldown/Breadcrumb.js +5 -2
  206. package/src/modules/helpers/Destroy.js +1 -1
  207. package/src/modules/highlightFilter/HighlightFilter.js +8 -9
  208. package/src/modules/highlightFilter/TreemapPart.js +2 -2
  209. package/src/modules/legend/HeatmapGradientLegend.js +76 -45
  210. package/src/modules/legend/Helpers.js +2 -0
  211. package/src/modules/legend/Legend.js +11 -12
  212. package/src/modules/settings/Options.js +7 -0
  213. package/src/modules/streamgraph/StreamLabels.js +1 -0
  214. package/src/modules/tooltip/Tooltip.js +20 -4
  215. package/src/modules/tooltip/Utils.js +8 -0
  216. package/src/modules/trellis/Trellis.js +6 -0
  217. package/src/modules/trellis/TrellisChrome.js +18 -7
  218. package/src/modules/trellis/TrellisSync.js +2 -0
  219. package/src/renderers/canvas/CanvasGraphics.js +1 -0
  220. package/src/ssr/DOMShim.js +10 -0
  221. package/src/types/internal.d.ts +9 -3
  222. package/types/apexcharts.d.ts +31 -12
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.2.0
2
+ * ApexCharts v8.3.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- !function(t){var e="undefined"!=typeof globalThis?globalThis:self,i=e.ApexCharts;if(i&&i.__internals)return t.call(e);if(i)throw new Error("ApexCharts: dist/features/keyboard.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");if("function"==typeof define&&define.amd)return t.call(e);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/features/keyboard.js is a script-tag add-on and needs the ApexCharts script on the page. A bundler imports the matching apexcharts/ sub-path instead.");var s={file:"dist/features/keyboard.js",run:t,done:!1},o=e.__apexcharts_pending_addons__||(e.__apexcharts_pending_addons__=[]);o.push(s),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!s.done){var i=e.ApexCharts;if(i)if(i.__internals){s.done=!0;var a=o.indexOf(s);-1!==a&&o.splice(a,1);try{t.call(e),i.__drainsAddons||e.console.warn("ApexCharts: dist/features/keyboard.js loaded before the ApexCharts script, which is older than 8.0 and does not pick up add-ons loaded first, so it registered only when the page finished loading. Put its tag after the ApexCharts script.")}catch(t){e.console.error("ApexCharts: dist/features/keyboard.js could not register with the ApexCharts script on this page: "+(t&&t.message))}}else e.console.error("ApexCharts: dist/features/keyboard.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");else e.console.warn("ApexCharts: dist/features/keyboard.js is waiting for the ApexCharts script, which had not loaded when the page finished loading. It registers when an ApexCharts 8.0 or later script loads; if the page has none, add apexcharts.min.js (or apexcharts.core.min.js, or apexcharts.full.min.js).")}})}(function(){var t,e;t=this,e=function(t){"use strict";var e=Object.defineProperty,i=Object.defineProperties,s=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,n=(t,i,s)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[i]=s,l=(t,e)=>{for(var i in e||(e={}))a.call(e,i)&&n(t,i,e[i]);if(o)for(var i of o(e))r.call(e,i)&&n(t,i,e[i]);return t},c=(t,e)=>i(t,s(e));const h=globalThis.ApexCharts,d=globalThis.ApexCharts.__internals.__apex_Graphics,p=globalThis.ApexCharts.__internals.__apex_tooltip_Utils,u=globalThis.ApexCharts.__internals.__apex_Utils;h.registerFeatures({keyboardNavigation:class{constructor(t,e){this.w=t,this.ctx=e,this.seriesIndex=0,this.dataPointIndex=0,this.active=!1,this._tooltipDismissed=!1,this._announceTimer=void 0,this._focusedEl=null,this._hoveredBarEl=null,this._enlargedScatterMarker=null,this._onKeyDown=this._onKeyDown.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onLegendClick=this._onLegendClick.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._lastPointerDownAt=0}init(){const t=this.w.dom.Paper.node;t&&(t.setAttribute("tabindex","0"),t.addEventListener("focus",this._onFocus),t.addEventListener("blur",this._onBlur),t.addEventListener("mousedown",this._onPointerDown,{capture:!0}),t.addEventListener("pointerdown",this._onPointerDown,{capture:!0}),t.addEventListener("touchstart",this._onPointerDown,{capture:!0,passive:!0}),t.addEventListener("keydown",this._onKeyDown,{passive:!1}),this.ctx.events.addEventListener("legendClick",this._onLegendClick))}destroy(){const t=this.w,e=t.dom.Paper&&t.dom.Paper.node;this.ctx.events.removeEventListener("legendClick",this._onLegendClick),clearTimeout(this._announceTimer),e&&(e.removeEventListener("focus",this._onFocus),e.removeEventListener("blur",this._onBlur),e.removeEventListener("keydown",this._onKeyDown),e.removeEventListener("mousedown",this._onPointerDown,{capture:!0}),e.removeEventListener("pointerdown",this._onPointerDown,{capture:!0}),e.removeEventListener("touchstart",this._onPointerDown,{capture:!0}))}_onPointerDown(){this._lastPointerDownAt=Date.now()}notePointerFocus(){this._lastPointerDownAt=Date.now()}_onFocus(){this._isNavEnabled()&&(Date.now()-this._lastPointerDownAt<100||(this.active=!0,this._clampCursor(),this._snapToVisibleRange(),this._showCurrentPoint()))}_onBlur(){this.active=!1,this._tooltipDismissed=!1,this._hideFocus()}_onLegendClick(){this.active&&(this.active=!1,this._hideFocus())}_onKeyDown(t){var e,i,s;if(this._isNavEnabled()&&this.active){if(t.shiftKey&&("ArrowRight"===t.key||"ArrowLeft"===t.key)&&this._canPan())return t.preventDefault(),void this._panBy("ArrowRight"===t.key?1:-1);switch(t.key){case"ArrowRight":t.preventDefault(),this._move(0,1);break;case"ArrowLeft":t.preventDefault(),this._move(0,-1);break;case"ArrowUp":t.preventDefault(),this._move(-1,0);break;case"ArrowDown":t.preventDefault(),this._move(1,0);break;case"Home":t.preventDefault(),this.dataPointIndex=0,this._skipNullForward(),this._showCurrentPoint();break;case"End":t.preventDefault(),this.dataPointIndex=this._getDataPointCount(this.seriesIndex)-1,this._skipNullBackward(),this._showCurrentPoint();break;case"Enter":case" ":t.preventDefault(),this._fireClick();break;case"+":case"=":this._canZoom()&&(t.preventDefault(),null==(e=this.ctx.toolbar)||e.handleZoomIn(),this._announce("Zoomed in"));break;case"-":case"_":this._canZoom()&&(t.preventDefault(),null==(i=this.ctx.toolbar)||i.handleZoomOut(),this._announce("Zoomed out"));break;case"0":this._canZoom()&&this.w.interact.zoomed&&(t.preventDefault(),null==(s=this.ctx.toolbar)||s.handleZoomReset(),this._announce("Zoom reset"));break;case"Escape":t.preventDefault(),this._tooltipDismissed?(this.active=!1,this._tooltipDismissed=!1,this._hideFocus()):(this._tooltipDismissed=!0,this._hideFocus())}}}_canZoom(){var t,e;const i=this.w,s=null==(t=this.ctx.toolbar)?void 0:t._currentXRange();return Boolean(i.globals.axisCharts&&(null==(e=i.config.chart.zoom)?void 0:e.enabled)&&(i.axisFlags.isXNumeric||i.config.xaxis.convertedCatToNumeric||i.axisFlags.isRangeBar)&&(null==s?void 0:s.minX)<(null==s?void 0:s.maxX))}_canPan(){return this._canZoom()}_panBy(t){const e=this.ctx.toolbar;if(!e)return;const i=e._currentXRange(),s=Number(i.minX),o=Number(i.maxX);if(!isFinite(s)||!isFinite(o)||s===o)return;const a=.1*(o-s)*t;e.zoomUpdateOptions(s+a,o+a),this._announce(t>0?"Panned right":"Panned left")}_move(t,e){var i;const s=this.w,o=s.config.chart.accessibility.keyboard.navigation.wrapAround;if(0!==t){const e=this.w.globals.tooltip,a=s.config.chart.type;if("heatmap"!==a&&"treemap"!==a&&e&&e.tConfig&&e.tConfig.shared){const t=this.dataPointIndex;if(e.tooltipUtil&&e.tooltipUtil.isXoverlap(t)&&e.tooltipUtil.isInitialSeriesSameLen())return}"heatmap"!==a||(null==(i=s.config.yaxis[0])?void 0:i.reversed)||(t=-t);const r=this._getSeriesCount();let n=this.seriesIndex;for(let e=1;e<r;e++){let i=n+t*e;if(o)i=(i+r)%r;else if(i<0||i>=r)break;if(!s.globals.collapsedSeriesIndices.includes(i)){n=i;break}}this.seriesIndex=n;const l=this._getDataPointCount(n);this.dataPointIndex>=l&&(this.dataPointIndex=l-1)}if(0!==e){const t=this._getDataPointCount(this.seriesIndex);let i=this.dataPointIndex+e;i<0&&(i=o?t-1:0),i>=t&&(i=o?0:t-1),this.dataPointIndex=i,e>0?this._skipNullForward():this._skipNullBackward(),this._isDataPointVisible(this.seriesIndex,this.dataPointIndex)||this._snapToVisibleRangeInDirection(e)}this._showCurrentPoint()}_skipNullForward(){const t=this.w,e=this.seriesIndex,i=this._getDataPointCount(e);let s=this.dataPointIndex,o=0;if(Array.isArray(t.seriesData.series[e])){for(;o<i&&null===t.seriesData.series[e][s];)s=(s+1)%i,o++;this.dataPointIndex=s}}_skipNullBackward(){const t=this.w,e=this.seriesIndex,i=this._getDataPointCount(e);let s=this.dataPointIndex,o=0;if(Array.isArray(t.seriesData.series[e])){for(;o<i&&null===t.seriesData.series[e][s];)s=(s-1+i)%i,o++;this.dataPointIndex=s}}_showCurrentPoint(){const{seriesIndex:t,dataPointIndex:e}=this,i=this.w,s=i.globals.tooltip;s&&s.ttItems&&(i.interact.capturedSeriesIndex=t,i.interact.capturedDataPointIndex=e,this._applyFocusClass(t,e),this._showTooltip(t,e,s))}_hideFocus(){var t;const e=this.w,i=e.globals.tooltip;if(this._removeFocusClass(),this._leaveHoveredBar(),!i)return;null==(t=i.tooltipPosition)||t.resetPlacementCache(),i.marker&&i.marker.resetPointsSize(),this._enlargedScatterMarker=null;const s=i.getElTooltip();s&&(s.classList.remove("apexcharts-active"),e.config.chart.accessibility.enabled&&e.config.chart.accessibility.announcements.enabled&&s.setAttribute("aria-hidden","true")),e.dom.baseEl.classList.remove("apexcharts-tooltip-active");const o=i.getElXCrosshairs();o&&o.classList.remove("apexcharts-active")}_showTooltip(t,e,i){const s=this.w,o=s.config.chart.type,a=i.getElTooltip();if(!a)return;const r=i.getCachedDimensions();i.tooltipRect={x:0,y:0,ttWidth:r.ttWidth||0,ttHeight:r.ttHeight||0},this._setSyntheticEvent(t,e,i),s.dom.baseEl.classList.add("apexcharts-tooltip-active"),a.classList.add("apexcharts-active"),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.announcements.enabled&&a.removeAttribute("aria-hidden"),"pie"===o||"donut"===o||"polarArea"===o?this._showTooltipNonAxis(t,e,i,a):"radialBar"===o?this._showTooltipRadialBar(t,e,i,a):"heatmap"===o||"treemap"===o?this._showTooltipHeatTree(t,e,i,a,o):this._isBarLikeSeries(t)?this._showTooltipBar(t,e,i):this._showTooltipAxisLine(t,e,i),i.fixedTooltip&&i.drawFixedTooltipRect()}_isBarLikeSeries(t){var e;const i=this.w,s=i.config.series[t],o=i.globals.comboCharts&&null!=(e=null==s?void 0:s.type)?e:i.config.chart.type;return p.isBarLikeType(o)}_setSyntheticEvent(t,e,i){const s=this.w,o=s.config.chart.type;let a=0,r=0;const n=this._getFocusableElement(t,e),l=n?null:this._canvasCell(t,e)||this._canvasMark(t,e);if(n){const t=n.getBoundingClientRect();a=t.left+t.width/2,r=t.top+t.height/2}else if(l){const t=p.plotRect(s);a=t.left+(l.x+l.width/2)*t.zoom,r=t.top+(l.y+l.height/2)*t.zoom}else if(s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const o=s.globals.pointsArray[t][e];if(i.getElGrid&&i.getElGrid()){const t=p.plotRect(s);a=t.left+(o[0]||0)*t.zoom,r=t.top+(o[1]||0)*t.zoom}}else{const t=s.dom.Paper&&s.dom.Paper.node;if(t){const e=t.getBoundingClientRect();a=e.left+e.width/2,r=e.top+e.height/2}}if(!this._isBarLikeSeries(t)&&("line"===o||"area"===o||"rangeArea"===o||"scatter"===o||"bubble"===o||"radar"===o)&&s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const o=s.globals.pointsArray[t][e];if(i.getElGrid&&i.getElGrid()){const t=p.plotRect(s);a=t.left+(o[0]||0)*t.zoom,r=t.top+(o[1]||0)*t.zoom}}i.e={type:"mousemove",clientX:a,clientY:r},i.clientX=a,i.clientY=r}_showTooltipBar(t,e,i){var s,o,a,r;const n=this.w;n.globals.comboCharts&&(i.marker.resetPointsSize(),this._enlargedScatterMarker=null);const h=i.tConfig.shared&&(i.tooltipUtil.isXoverlap(e)||n.globals.isBarHorizontal)&&i.tooltipUtil.isInitialSeriesSameLen(),u=null==(r=null==(a=null==(o=null==(s=n.rangeData.seriesRange)?void 0:s[t])?void 0:o[e])?void 0:a.y)?void 0:r[0];i.tooltipLabels.drawSeriesTexts(c(l(l({ttItems:i.ttItems,i:t,j:e},void 0!==(null==u?void 0:u.y1)&&{y1:u.y1}),void 0!==(null==u?void 0:u.y2)&&{y2:u.y2}),{shared:h}));const f=`.apexcharts-series[data\\:realIndex='${t}']`,g=this._canvasMark(t,e)?null:n.dom.Paper.findOne(`${f} path[j='${e}'], ${f} circle[j='${e}'], ${f} rect[j='${e}']`);if(g&&(this._leaveHoveredBar(),new d(this.w,this.ctx).pathMouseEnter(g,null),this._hoveredBarEl=g),n.globals.isBarHorizontal){const s=i.fixedTooltip;if(!s&&!i.showOnIntersect&&!p.isFollowCursor(n)&&i.tooltipPosition.placeHorizontalSharedTooltip(e))return;const o=this._focusedBarInWrap(t,e,g,i),a=i.getElTooltip();if(o&&a&&!s){const s=i.tooltipRect.ttWidth||0,r=i.tooltipRect.ttHeight||0,l=p.plotInWrap(n),c={top:l.top,bottom:l.top+n.layout.gridHeight,left:l.left,right:l.left+n.layout.gridWidth},h=i.tooltipPosition.placeOnShortPlot((o.left+o.right)/2,o.top,o.bottom);if(h)i.tooltipPosition.applyTooltipPosition(a,h);else if(n.config.tooltip.arrow)i.tooltipPosition.applyTooltipPosition(a,i.tooltipPosition.placeAroundBar(o,c,e,t));else{const t=i.xyRatios&&null!=i.xyRatios.baseLineInvertedY?c.left+i.xyRatios.baseLineInvertedY:(c.left+c.right)/2;let e=(o.left+o.right)/2<t?o.left-s:o.right;if(p.isFollowCursor(n)){const t=(o.left+o.right)/2-c.left+15;e=c.left+(t+s>n.layout.gridWidth?t-s:t)}const l=(o.top+o.bottom)/2-r/2;a.style.left=Math.max(Math.min(e,c.right-s),c.left)+"px",a.style.top=Math.max(Math.min(l,c.bottom-r),c.top)+"px",delete a.dataset.placement}}}else this._pointerHoversOneMark(i)?this._hoverFocusedMark(t,e,g,i):i.tooltipPosition.moveStickyTooltipOverBars(e,t)}_pointerHoversOneMark(t){return!!t.showOnIntersect&&!(this.w.config.chart.group&&"function"==typeof this.ctx.getSyncedCharts&&this.ctx.getSyncedCharts().length>1)}_hoverFocusedMark(t,e,i,s){const o=this.w,a=this._canvasMark(t,e),r=!a&&(null==i?void 0:i.node)&&["apexcharts-bar-area","apexcharts-candlestick-area","apexcharts-boxPlot-area","apexcharts-rangebar-area","apexcharts-violin-area"].some(t=>i.node.classList.contains(t))?i.node:null;if(!a&&!r)return void s.tooltipPosition.moveStickyTooltipOverBars(e,t);const n=o.dom.Paper.node;s.intersect.handleBarTooltip({e:c(l({},s.e),{type:"mousemove",target:r||n,apexHoverTarget:r||n,apexPaintedHit:a}),opt:{paths:r||n,hoverArea:n,elGrid:s.getElGrid(),tooltipEl:s.getElTooltip(),ttItems:s.ttItems}})}_focusedBarInWrap(t,e,i,s){var o,a,r;const n=this.w,l=("violin"===n.config.chart.type||"violin"===(null==(o=n.config.series[t])?void 0:o.type))&&(null==(a=s.intersect)?void 0:a.violinGlyphRect(t,e))||(null==(r=null==i?void 0:i.node)?void 0:r.getBoundingClientRect())||this._canvasMarkRect(t,e);if(!l)return null;const c=n.dom.elWrap.getBoundingClientRect();return{top:l.top-c.top,bottom:l.bottom-c.top,left:l.left-c.left,right:l.right-c.left}}_showTooltipAxisLine(t,e,i){var s;const o=this.w,a=o.config.chart.type,r=i.tConfig.shared&&i.tooltipUtil.isXoverlap(e)&&i.tooltipUtil.isInitialSeriesSameLen();i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:r});const n="scatter"===a||"bubble"===a||"radar"===a,l=o.globals.markers.largestSize>0&&!o.globals.markers.batched&&"canvas"!==(null==(s=this.ctx.renderer)?void 0:s.kind),c=this._pointerHoversOneMark(i)?this._canvasMarker(t,e):null;c?this._hoverPaintedMarker(c,i):n||l&&!r?this._showScatterBubblePoint(t,e,i)||i.tooltipPosition.moveDynamicPointOnHover(e,t):l?i.marker.enlargePoints(e):r?i.tooltipPosition.moveDynamicPointsOnHover(e):i.tooltipPosition.moveDynamicPointOnHover(e,t)}_canvasMarker(t,e){const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findMarker?i.findMarker(t,e):null}_hoverPaintedMarker(t,e){e.intersect.handlePaintedMarkerTooltip({e:c(l({},e.e),{type:"mousemove"}),opt:{tooltipEl:e.getElTooltip(),ttItems:e.ttItems},marker:{i:t.seriesIndex,j:t.dataPointIndex,cx:t.x,cy:t.y,size:t.size}})}_showScatterBubblePoint(t,e,i){const s=this.w.dom.baseEl;this._enlargedScatterMarker&&(i.marker.oldPointSize(this._enlargedScatterMarker),this._enlargedScatterMarker=null);const o=s.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`);if(!o)return!1;const a=o.querySelector(`.apexcharts-marker[rel='${e}']`);return!!a&&(i.marker.enlargeCurrentPoint(e,a),this._enlargedScatterMarker=a,!0)}_showTooltipNonAxis(t,e,i,s){const o=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:e,shared:!1});const a=s.getBoundingClientRect(),r=a.width||i.tooltipRect.ttWidth||0,n=a.height||i.tooltipRect.ttHeight||0,l=o.dom.baseEl.querySelector(`.apexcharts-pie-area[j='${e}']`),c=i.getSliceAnchor(l);if(c){const t=i.tooltipPosition.placeOverAnchor(c.x,c.y,r,n,10);s.style.left=t.x+"px",s.style.top=t.y+"px"}}_showTooltipRadialBar(t,e,i,s){var o;const a=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,shared:!1});const{ttWidth:r=0,ttHeight:n=0}=i.getCachedDimensions(),l=a.dom.baseEl.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if(l){const e=parseFloat(null!=(o=l.getAttribute("data:angle"))?o:"")||0,c=(a.config.plotOptions.radialBar.startAngle||0)+e/2,h=a.layout.gridWidth/2,d=a.layout.gridHeight/2,p=a.globals.radialSize||Math.min(a.layout.gridWidth,a.layout.gridHeight)/2,f=a.seriesData.series.length,g=p/Math.max(f,1),m=p-t*g,_=(m+(m-g))/2,x=u.polarToCartesian(h,d,_,c),v=x.x+(a.layout.translateX||0),b=x.y+(a.layout.translateY||0),y=i.tooltipPosition.placeOverAnchor(v,b,r,n,10);s.style.left=y.x+"px",s.style.top=y.y+"px"}}_showTooltipHeatTree(t,e,i,s,o){var a,r;const n=this.w;if(p.isFollowCursor(n)&&this._hoverFocusedCell(t,e,i))return;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:!1});const l=s.getBoundingClientRect(),c=l.width||i.tooltipRect.ttWidth||0,h=l.height||i.tooltipRect.ttHeight||0,d="heatmap"===o?"apexcharts-heatmap-rect":"apexcharts-treemap-rect",u=n.dom.baseEl.querySelector(`.${d}[i='${t}'][j='${e}']`),f=u?null:this._canvasCell(t,e);if(u||f){const t=n.dom.elWrap.getBoundingClientRect();let e=0,l=0,d=0,g=0;if(u){const s=u.getBoundingClientRect();e=s.left-t.left,l=s.top-t.top,d=s.width,g=s.height;const o=parseFloat(null!=(a=u.getAttribute("cx"))?a:""),n=parseFloat(null!=(r=u.getAttribute("width"))?r:"");i.tooltipPosition.moveXCrosshairs(o+n/2)}else if(f){const t=p.plotInWrap(n);e=t.left+f.x,l=t.top+f.y,d=f.width,g=f.height,i.tooltipPosition.moveXCrosshairs(f.x+f.width/2)}let m=e+d+c/2;const _=l+g/2-h/2;e+d>n.layout.gridWidth/2&&(m=e-c/2);const x=i.tooltipPosition.shortPlotPlacement,v=i.tooltipPosition.placeOnShortPlot(e+d/2,l,l+g);if(v)return void i.tooltipPosition.applyTooltipPosition(s,v);if("heatmap"===o&&n.config.tooltip.arrow&&!p.isFollowCursor(n)){const{left:t,top:o}=p.plotInWrap(n);return void i.tooltipPosition.applyTooltipPosition(s,i.tooltipPosition.placeAroundCell({top:l,bottom:l+g,left:e,right:e+d},{top:o,bottom:o+n.layout.gridHeight,left:t,right:t+n.layout.gridWidth},{el:u,ttWidth:c,ttHeight:h}))}s.style.left=m+"px",s.style.top=_+"px",x&&delete s.dataset.placement}}_hoverFocusedCell(t,e,i){const s=this.w,o=s.config.chart.type,a=i.getElTooltip(),r=s.dom.baseEl.querySelector(`.apexcharts-${o}-rect[i='${t}'][j='${e}']`);if(!a||!r&&!this._canvasCell(t,e))return!1;const n=r||s.dom.Paper.node;s.interact.capturedSeriesIndex=-1,s.interact.capturedDataPointIndex=-1;const h=i.intersect.handleHeatTreeTooltip({e:c(l({},i.e),{type:"mousemove",target:n,apexHoverTarget:n}),opt:{ttItems:i.ttItems},x:0,y:0,type:o}),d=!h.noHit&&s.interact.capturedSeriesIndex===t&&s.interact.capturedDataPointIndex===e;return s.interact.capturedSeriesIndex=t,s.interact.capturedDataPointIndex=e,!!d&&(i.placeCellTooltip(a,h),!0)}_canvasCell(t,e){if("heatmap"!==this.w.config.chart.type)return null;const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findCell?i.findCell(t,e):null}_canvasMark(t,e){if(!this._isBarLikeSeries(t))return null;const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findMark?i.findMark(t,e):null}_canvasMarkRect(t,e){const i=this._canvasMark(t,e);if(!i)return null;const s=p.plotRect(this.w),o=s.left+i.x*s.zoom,a=s.top+i.y*s.zoom;return{left:o,top:a,right:o+i.width*s.zoom,bottom:a+i.height*s.zoom}}_applyFocusClass(t,e){this._removeFocusClass();const i=this._getFocusableElement(t,e)||this._getBatchedFocusEl(t)||this._drawCanvasFocusRing(t,e);if(i){i.classList.add("apexcharts-keyboard-focused"),i.setAttribute("role","img");const s=this._buildPointLabel(t,e);s&&i.setAttribute("aria-label",s),this._focusedEl=i}}_getBatchedFocusEl(t){return this.w.globals.markers.batched?this.w.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-series-markers path`):null}_drawCanvasFocusRing(t,e){const i=this._canvasCell(t,e);if(!i)return this._drawCanvasMarkFocusRing(t,e);const s=this.w.dom.baseEl.querySelector(`.apexcharts-heatmap .apexcharts-series[rel='${t+1}']`);if(!s)return null;const o=new d(this.w,this.ctx).drawRect(i.x,i.y,i.width,i.height,i.radius,"none");return o.node.classList.add("apexcharts-keyboard-focus-ring"),o.attr({i:t,j:e}),s.insertBefore(o.node,s.firstChild),o.node}_drawCanvasMarkFocusRing(t,e){const i=this._canvasMark(t,e);if(!i)return this._drawCanvasMarkerFocusRing(t,e);const s=this.w,o=Array.from(s.dom.baseEl.querySelectorAll(".apexcharts-series")).find(e=>e.getAttribute("data:realIndex")===String(t));if(!o)return null;const a=new d(s,this.ctx).drawPath({d:i.d,fill:"none",classes:"apexcharts-keyboard-focus-ring"});return a.attr("clip-path",`url(#gridRectBarMask${s.globals.cuid})`),o.insertBefore(a.node,o.firstChild),a.node}_drawCanvasMarkerFocusRing(t,e){const i=this._canvasMarker(t,e);if(!i)return null;const s=this.w,o=Array.from(s.dom.baseEl.querySelectorAll(".apexcharts-series")).find(e=>e.getAttribute("data:realIndex")===String(t));if(!o)return null;const a=new d(s,this.ctx).drawPath({d:i.d,fill:"none",classes:"apexcharts-keyboard-focus-ring"});return a.attr("clip-path",`url(#gridRectMarkerMask${s.globals.cuid})`),o.appendChild(a.node),a.node}_removeFocusClass(){this._focusedEl&&(this._focusedEl.classList.remove("apexcharts-keyboard-focused"),this._focusedEl.removeAttribute("role"),this._focusedEl.removeAttribute("aria-label"),this._focusedEl.classList.contains("apexcharts-keyboard-focus-ring")&&this._focusedEl.remove(),this._focusedEl=null)}_buildPointLabel(t,e){var i,s,o,a,r,n,l,c;const h=this.w,d=h.config.chart.type,p=h.seriesData.seriesNames||[],u=h.seriesData.series||[];if("pie"===d||"donut"===d||"polarArea"===d){const t=null!=(s=(null==(i=h.labelData)?void 0:i.labels)&&h.labelData.labels[e])?s:"",o=Array.isArray(u)?u[e]:"";return t?`${t}: ${o}`:`${o}`}if("radialBar"===d)return`${p[t]||`Series ${t+1}`}: ${Array.isArray(u)?u[t]:""}`;const f=p[t]||`Series ${t+1}`,g=(Array.isArray(u[t])?u[t]:[])[e];let m=null==g?"":String(g);const _=null==(a=null==(o=h.formatters)?void 0:o.yLabelFormatters)?void 0:a[t];if("function"==typeof _)try{m=_(g,{seriesIndex:t,dataPointIndex:e,w:h})}catch(t){}let x="";const v=null==(r=h.labelData)?void 0:r.categoryLabels,b=null==(l=null==(n=h.seriesData)?void 0:n.seriesX)?void 0:l[t];if(Array.isArray(v)&&null!=v[e])x=String(v[e]);else if(Array.isArray(b)&&null!=b[e]){const i=null==(c=h.formatters)?void 0:c.xLabelFormatter;if("function"==typeof i)try{x=String(i(b[e],{seriesIndex:t,dataPointIndex:e,w:h}))}catch(t){x=String(b[e])}else x=String(b[e])}return x?`${f}: ${m}, ${x}`:`${f}: ${m}`}_leaveHoveredBar(){this._hoveredBarEl&&(new d(this.w,this.ctx).pathMouseLeave(this._hoveredBarEl,null),this._hoveredBarEl=null)}_getFocusableElement(t,e){const i=this.w,s=i.config.chart.type,o=i.dom.baseEl;return"pie"===s||"donut"===s||"polarArea"===s?o.querySelector(`.apexcharts-pie-area[j='${e}']`):"heatmap"===s?o.querySelector(`.apexcharts-heatmap-rect[i='${t}'][j='${e}']`):"treemap"===s?o.querySelector(`.apexcharts-treemap-rect[i='${t}'][j='${e}']`):"radialBar"===s?o.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`):this._isBarLikeSeries(t)?this._canvasMark(t,e)?null:o.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] path[j='${e}']`):o.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-marker[rel='${e}']`)||null}_fireClick(){const t=this.w.globals.tooltip;t&&t.markerClick({type:"mouseup",clientX:0,clientY:0},this.seriesIndex,this.dataPointIndex)}_isNavEnabled(){const t=this.w.config.chart.accessibility;return t.enabled&&t.keyboard.enabled&&t.keyboard.navigation.enabled}_getSeriesCount(){const t=this.w,e=t.config.chart.type;return"pie"===e||"donut"===e||"polarArea"===e?1:t.seriesData.series.length}_getDataPointCount(t){const e=this.w,i=e.config.chart.type;if("pie"===i||"donut"===i||"polarArea"===i)return e.seriesData.series.length;const s=e.seriesData.series;return s[t]&&Array.isArray(s[t])?s[t].length:0}_clampCursor(){const t=this._getSeriesCount();this.seriesIndex>=t&&(this.seriesIndex=t-1),this.seriesIndex<0&&(this.seriesIndex=0);const e=this._getDataPointCount(this.seriesIndex);this.dataPointIndex>=e&&(this.dataPointIndex=e-1),this.dataPointIndex<0&&(this.dataPointIndex=0)}_snapToVisibleRange(){const t=this.w,e=t.globals,i=this.seriesIndex;if(!t.interact.zoomed)return;const s=t.seriesData.seriesX&&t.seriesData.seriesX[i];if(!s||!s.length)return;const o=e.minX,a=e.maxX;if(void 0===o||void 0===a)return;const r=s[this.dataPointIndex];if(r>=o&&r<=a)return;const n=s.length;for(let t=0;t<n;t++)if(s[t]>=o&&s[t]<=a)return void(this.dataPointIndex=t)}_snapToVisibleRangeInDirection(t){const e=this.w,i=e.globals,s=this.seriesIndex,o=e.seriesData.seriesX&&e.seriesData.seriesX[s];if(!o||!o.length)return;const a=i.minX,r=i.maxX;if(void 0===a||void 0===r)return;const n=o.length;if(t>=0){for(let t=0;t<n;t++)if(o[t]>=a&&o[t]<=r)return void(this.dataPointIndex=t)}else for(let t=n-1;t>=0;t--)if(o[t]>=a&&o[t]<=r)return void(this.dataPointIndex=t)}_isDataPointVisible(t,e){const i=this.w,s=i.globals;if(!i.interact.zoomed)return!0;const o=i.seriesData.seriesX&&i.seriesData.seriesX[t];if(!o)return!0;const a=o[e];return void 0===a||a>=s.minX&&a<=s.maxX}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const i=e.dom.baseEl;if(!i)return;const s=i.querySelector(".apexcharts-sr-status");s&&(s.textContent="",clearTimeout(this._announceTimer),this._announceTimer=setTimeout(()=>{s.textContent=t},0))}}}),t.default=h,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexKeyboard={})});
5
+ !function(t){var e="undefined"!=typeof globalThis?globalThis:self,i=e.ApexCharts;if(i&&i.__internals)return t.call(e);if(i)throw new Error("ApexCharts: dist/features/keyboard.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");if("function"==typeof define&&define.amd)return t.call(e);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/features/keyboard.js is a script-tag add-on and needs the ApexCharts script on the page. A bundler imports the matching apexcharts/ sub-path instead.");var s={file:"dist/features/keyboard.js",run:t,done:!1},o=e.__apexcharts_pending_addons__||(e.__apexcharts_pending_addons__=[]);o.push(s),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!s.done){var i=e.ApexCharts;if(i)if(i.__internals){s.done=!0;var r=o.indexOf(s);-1!==r&&o.splice(r,1);try{t.call(e),i.__drainsAddons||e.console.warn("ApexCharts: dist/features/keyboard.js loaded before the ApexCharts script, which is older than 8.0 and does not pick up add-ons loaded first, so it registered only when the page finished loading. Put its tag after the ApexCharts script.")}catch(t){e.console.error("ApexCharts: dist/features/keyboard.js could not register with the ApexCharts script on this page: "+(t&&t.message))}}else e.console.error("ApexCharts: dist/features/keyboard.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");else e.console.warn("ApexCharts: dist/features/keyboard.js is waiting for the ApexCharts script, which had not loaded when the page finished loading. It registers when an ApexCharts 8.0 or later script loads; if the page has none, add apexcharts.min.js (or apexcharts.core.min.js, or apexcharts.full.min.js).")}})}(function(){var t,e;t=this,e=function(t){"use strict";var e=Object.defineProperty,i=Object.defineProperties,s=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,n=(t,i,s)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[i]=s,l=(t,e)=>{for(var i in e||(e={}))r.call(e,i)&&n(t,i,e[i]);if(o)for(var i of o(e))a.call(e,i)&&n(t,i,e[i]);return t},c=(t,e)=>i(t,s(e));const h=globalThis.ApexCharts,d=globalThis.ApexCharts.__internals.__apex_Graphics,p=globalThis.ApexCharts.__internals.__apex_tooltip_Utils;h.registerFeatures({keyboardNavigation:class{constructor(t,e){this.w=t,this.ctx=e,this.seriesIndex=0,this.dataPointIndex=0,this.active=!1,this._tooltipDismissed=!1,this._announceTimer=void 0,this._focusedEl=null,this._hoveredBarEl=null,this._enlargedScatterMarker=null,this._onKeyDown=this._onKeyDown.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onLegendClick=this._onLegendClick.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._lastPointerDownAt=0}init(){const t=this.w,e=t.dom.Paper.node;if(!e)return;e.setAttribute("tabindex","0"),e.addEventListener("focus",this._onFocus),e.addEventListener("blur",this._onBlur),e.addEventListener("mousedown",this._onPointerDown,{capture:!0}),e.addEventListener("pointerdown",this._onPointerDown,{capture:!0}),e.addEventListener("touchstart",this._onPointerDown,{capture:!0,passive:!0}),e.addEventListener("keydown",this._onKeyDown,{passive:!1}),this.ctx.events.addEventListener("legendClick",this._onLegendClick);const i=t.interact.keyNav,s=e.ownerDocument;t.interact.keyNav=null,!i||s.activeElement&&s.activeElement!==s.body||([this.seriesIndex,this.dataPointIndex,,this._tooltipDismissed]=i,i[2]||this.notePointerFocus(),e.focus({preventScroll:!0}))}destroy(t){var e;const i=this.w,s=i.dom.Paper&&i.dom.Paper.node;this.ctx.events.removeEventListener("legendClick",this._onLegendClick),clearTimeout(this._announceTimer),s&&(t&&(null==(e=s.getRootNode)?void 0:e.call(s).activeElement)===s&&(i.interact.keyNav=[this.seriesIndex,this.dataPointIndex,this.active,this._tooltipDismissed]),s.removeEventListener("focus",this._onFocus),s.removeEventListener("blur",this._onBlur),s.removeEventListener("keydown",this._onKeyDown),s.removeEventListener("mousedown",this._onPointerDown,{capture:!0}),s.removeEventListener("pointerdown",this._onPointerDown,{capture:!0}),s.removeEventListener("touchstart",this._onPointerDown,{capture:!0}))}_onPointerDown(){this._lastPointerDownAt=Date.now()}notePointerFocus(){this._lastPointerDownAt=Date.now()}_onFocus(){this._isNavEnabled()&&(Date.now()-this._lastPointerDownAt<100||(this.active=!0,this._clampCursor(),this._snapToVisibleRange(),this._tooltipDismissed||this._showCurrentPoint()))}_onBlur(){this.active=!1,this._tooltipDismissed=!1,this._hideFocus()}_onLegendClick(){this.active&&(this.active=!1,this._hideFocus())}_onKeyDown(t){var e,i,s;if(this._isNavEnabled()&&this.active){if(t.shiftKey&&("ArrowRight"===t.key||"ArrowLeft"===t.key)&&this._canPan())return t.preventDefault(),void this._panBy("ArrowRight"===t.key?1:-1);switch(t.key){case"ArrowRight":t.preventDefault(),this._move(0,1);break;case"ArrowLeft":t.preventDefault(),this._move(0,-1);break;case"ArrowUp":t.preventDefault(),this._move(-1,0);break;case"ArrowDown":t.preventDefault(),this._move(1,0);break;case"Home":t.preventDefault(),this._seek(0,1),this._showCurrentPoint();break;case"End":t.preventDefault(),this._seek(this._getDataPointCount(this.seriesIndex)-1,-1),this._showCurrentPoint();break;case"Enter":case" ":t.preventDefault(),this._fireClick(t);break;case"+":case"=":this._canZoom()&&(t.preventDefault(),null==(e=this.ctx.toolbar)||e.handleZoomIn(),this._announce("Zoomed in"));break;case"-":case"_":this._canZoom()&&(t.preventDefault(),null==(i=this.ctx.toolbar)||i.handleZoomOut(),this._announce("Zoomed out"));break;case"0":this._canZoom()&&this.w.interact.zoomed&&(t.preventDefault(),null==(s=this.ctx.toolbar)||s.handleZoomReset(),this._announce("Zoom reset"));break;case"Escape":t.preventDefault(),this._tooltipDismissed?(this.active=!1,this._tooltipDismissed=!1,this._hideFocus()):(this._tooltipDismissed=!0,this._hideFocus())}}}_canZoom(){var t,e;const i=this.w,s=null==(t=this.ctx.toolbar)?void 0:t._currentXRange();return Boolean(i.globals.axisCharts&&(null==(e=i.config.chart.zoom)?void 0:e.enabled)&&(i.axisFlags.isXNumeric||i.config.xaxis.convertedCatToNumeric||i.axisFlags.isRangeBar)&&(null==s?void 0:s.minX)<(null==s?void 0:s.maxX))}_canPan(){return this._canZoom()&&this.w.interact.zoomed}_panBy(t){var e;null==(e=this.ctx.zoomPanSelection)||e.panBy(t/10),this._announce(t>0?"Panned right":"Panned left")}_move(t,e){var i;const s=this.w,o=s.config.chart.accessibility.keyboard.navigation.wrapAround;if(0!==t){const e=this.w.globals.tooltip,r=s.config.chart.type;if("heatmap"!==r&&"treemap"!==r&&"radialBar"!==r&&(null==e?void 0:e.ttItems)&&e.tConfig.shared){const t=this.dataPointIndex;if(e.tooltipUtil&&e.tooltipUtil.isXoverlap(t)&&e.tooltipUtil.isInitialSeriesSameLen())return}"heatmap"!==r||(null==(i=s.config.yaxis[0])?void 0:i.reversed)||(t=-t);const a=this._getSeriesCount();let n=this.seriesIndex;for(let e=1;e<a;e++){let i=n+t*e;if(o)i=(i+a)%a;else if(i<0||i>=a)break;if(!s.globals.collapsedSeriesIndices.includes(i)){n=i;break}}this.seriesIndex=n;const l=this._getDataPointCount(n);this.dataPointIndex>=l&&(this.dataPointIndex=l-1)}0!==e&&(this._seek(this.dataPointIndex+e,e),this._isDataPointVisible(this.seriesIndex,this.dataPointIndex)||this._snapToVisibleRangeInDirection(e)),this._showCurrentPoint()}_seek(t,e){const i=this.w,s=i.seriesData.series[this.seriesIndex],o=this._getDataPointCount(this.seriesIndex);for(let r=0;r<o;r++,t+=e){if(i.config.chart.accessibility.keyboard.navigation.wrapAround)t=(t+o)%o;else if(t<0||t>=o)return;if(!Array.isArray(s)||null!==s[t])return void(this.dataPointIndex=t)}}_showCurrentPoint(){const{seriesIndex:t,dataPointIndex:e}=this,i=this.w,s=i.globals.tooltip;if(this._tooltipDismissed=!1,i.interact.capturedSeriesIndex=t,i.interact.capturedDataPointIndex=e,this._applyFocusClass(t,e),!(null==s?void 0:s.ttItems))return this._announce(this._buildPointLabel(t,e));this._showTooltip(t,e,s)}_hideFocus(){var t;const e=this.w,i=e.globals.tooltip;if(this._removeFocusClass(),this._leaveHoveredBar(),!i)return;null==(t=i.tooltipPosition)||t.resetPlacementCache(),i.marker&&i.marker.resetPointsSize(),this._enlargedScatterMarker=null;const s=i.getElTooltip();s&&(s.classList.remove("apexcharts-active"),e.config.chart.accessibility.enabled&&e.config.chart.accessibility.announcements.enabled&&s.setAttribute("aria-hidden","true")),e.dom.baseEl.classList.remove("apexcharts-tooltip-active");const o=i.getElXCrosshairs();o&&o.classList.remove("apexcharts-active")}_showTooltip(t,e,i){const s=this.w,o=s.config.chart.type,r=i.getElTooltip();if(!r)return;const a=i.getCachedDimensions();i.tooltipRect={x:0,y:0,ttWidth:a.ttWidth||0,ttHeight:a.ttHeight||0},this._setSyntheticEvent(t,e,i),s.dom.baseEl.classList.add("apexcharts-tooltip-active"),r.classList.add("apexcharts-active"),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.announcements.enabled&&r.removeAttribute("aria-hidden"),"pie"===o||"donut"===o||"polarArea"===o||"radialBar"===o?this._showTooltipNonAxis(t,e,i,r):"heatmap"===o||"treemap"===o?this._showTooltipHeatTree(t,e,i,r,o):this._isBarLikeSeries(t)?this._showTooltipBar(t,e,i):this._showTooltipAxisLine(t,e,i),i.fixedTooltip&&i.drawFixedTooltipRect()}_isBarLikeSeries(t){var e;const i=this.w,s=i.config.series[t],o=i.globals.comboCharts&&null!=(e=null==s?void 0:s.type)?e:i.config.chart.type;return p.isBarLikeType(o)}_setSyntheticEvent(t,e,i){const s=this.w,o=s.config.chart.type;let r=0,a=0;const n=this._getFocusableElement(t,e),l=n?null:this._canvasCell(t,e)||this._canvasMark(t,e);if(n){const t=n.getBoundingClientRect();r=t.left+t.width/2,a=t.top+t.height/2}else if(l){const t=p.plotRect(s);r=t.left+(l.x+l.width/2)*t.zoom,a=t.top+(l.y+l.height/2)*t.zoom}else if(s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const o=s.globals.pointsArray[t][e];if(i.getElGrid&&i.getElGrid()){const t=p.plotRect(s);r=t.left+(o[0]||0)*t.zoom,a=t.top+(o[1]||0)*t.zoom}}else{const t=s.dom.Paper&&s.dom.Paper.node;if(t){const e=t.getBoundingClientRect();r=e.left+e.width/2,a=e.top+e.height/2}}if(!this._isBarLikeSeries(t)&&("line"===o||"area"===o||"rangeArea"===o||"scatter"===o||"bubble"===o||"radar"===o)&&s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const o=s.globals.pointsArray[t][e];if(i.getElGrid&&i.getElGrid()){const t=p.plotRect(s);r=t.left+(o[0]||0)*t.zoom,a=t.top+(o[1]||0)*t.zoom}}i.e={type:"mousemove",clientX:r,clientY:a},i.clientX=r,i.clientY=a}_showTooltipBar(t,e,i){var s,o,r,a;const n=this.w;n.globals.comboCharts&&(i.marker.resetPointsSize(),this._enlargedScatterMarker=null);const h=i.tConfig.shared&&(i.tooltipUtil.isXoverlap(e)||n.globals.isBarHorizontal)&&i.tooltipUtil.isInitialSeriesSameLen(),u=null==(a=null==(r=null==(o=null==(s=n.rangeData.seriesRange)?void 0:s[t])?void 0:o[e])?void 0:r.y)?void 0:a[0];i.tooltipLabels.drawSeriesTexts(c(l(l({ttItems:i.ttItems,i:t,j:e},void 0!==(null==u?void 0:u.y1)&&{y1:u.y1}),void 0!==(null==u?void 0:u.y2)&&{y2:u.y2}),{shared:h}));const f=`.apexcharts-series[data\\:realIndex='${t}']`,g=this._canvasMark(t,e)?null:n.dom.Paper.findOne(`${f} path[j='${e}'], ${f} circle[j='${e}'], ${f} rect[j='${e}']`);if(g&&(this._leaveHoveredBar(),new d(this.w,this.ctx).pathMouseEnter(g,null),this._hoveredBarEl=g),n.globals.isBarHorizontal){const s=i.fixedTooltip;if(!s&&!i.showOnIntersect&&!p.isFollowCursor(n)&&i.tooltipPosition.placeHorizontalSharedTooltip(e))return;const o=this._focusedBarInWrap(t,e,g,i),r=i.getElTooltip();if(o&&r&&!s){const s=i.tooltipRect.ttWidth||0,a=i.tooltipRect.ttHeight||0,l=p.plotInWrap(n),c={top:l.top,bottom:l.top+n.layout.gridHeight,left:l.left,right:l.left+n.layout.gridWidth},h=i.tooltipPosition.placeOnShortPlot((o.left+o.right)/2,o.top,o.bottom);if(h)i.tooltipPosition.applyTooltipPosition(r,h);else if(n.config.tooltip.arrow)i.tooltipPosition.applyTooltipPosition(r,i.tooltipPosition.placeAroundBar(o,c,e,t));else{const t=i.xyRatios&&null!=i.xyRatios.baseLineInvertedY?c.left+i.xyRatios.baseLineInvertedY:(c.left+c.right)/2;let e=(o.left+o.right)/2<t?o.left-s:o.right;if(p.isFollowCursor(n)){const t=(o.left+o.right)/2-c.left+15;e=c.left+(t+s>n.layout.gridWidth?t-s:t)}const l=(o.top+o.bottom)/2-a/2;r.style.left=Math.max(Math.min(e,c.right-s),c.left)+"px",r.style.top=Math.max(Math.min(l,c.bottom-a),c.top)+"px",delete r.dataset.placement}}}else this._pointerHoversOneMark(i)?this._hoverFocusedMark(t,e,g,i):i.tooltipPosition.moveStickyTooltipOverBars(e,t)}_pointerHoversOneMark(t){return!!t.showOnIntersect&&!(this.w.config.chart.group&&"function"==typeof this.ctx.getSyncedCharts&&this.ctx.getSyncedCharts().length>1)}_hoverFocusedMark(t,e,i,s){const o=this.w,r=this._canvasMark(t,e),a=!r&&(null==i?void 0:i.node)&&["apexcharts-bar-area","apexcharts-candlestick-area","apexcharts-boxPlot-area","apexcharts-rangebar-area","apexcharts-violin-area"].some(t=>i.node.classList.contains(t))?i.node:null;if(!r&&!a)return void s.tooltipPosition.moveStickyTooltipOverBars(e,t);const n=o.dom.Paper.node;s.intersect.handleBarTooltip({e:c(l({},s.e),{type:"mousemove",target:a||n,apexHoverTarget:a||n,apexPaintedHit:r}),opt:{paths:a||n,hoverArea:n,elGrid:s.getElGrid(),tooltipEl:s.getElTooltip(),ttItems:s.ttItems}})}_focusedBarInWrap(t,e,i,s){var o,r,a;const n=this.w,l=("violin"===n.config.chart.type||"violin"===(null==(o=n.config.series[t])?void 0:o.type))&&(null==(r=s.intersect)?void 0:r.violinGlyphRect(t,e))||(null==(a=null==i?void 0:i.node)?void 0:a.getBoundingClientRect())||this._canvasMarkRect(t,e);if(!l)return null;const c=n.dom.elWrap.getBoundingClientRect();return{top:l.top-c.top,bottom:l.bottom-c.top,left:l.left-c.left,right:l.right-c.left}}_showTooltipAxisLine(t,e,i){var s;const o=this.w,r=o.config.chart.type,a=i.tConfig.shared&&i.tooltipUtil.isXoverlap(e)&&i.tooltipUtil.isInitialSeriesSameLen();i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:a});const n="scatter"===r||"bubble"===r||"radar"===r,l=o.globals.markers.largestSize>0&&!o.globals.markers.batched&&"canvas"!==(null==(s=this.ctx.renderer)?void 0:s.kind),c=this._pointerHoversOneMark(i)?this._canvasMarker(t,e):null;c?this._hoverPaintedMarker(c,i):n||l&&!a?this._showScatterBubblePoint(t,e,i)||i.tooltipPosition.moveDynamicPointOnHover(e,t):l?i.marker.enlargePoints(e):a?i.tooltipPosition.moveDynamicPointsOnHover(e):i.tooltipPosition.moveDynamicPointOnHover(e,t)}_canvasMarker(t,e){const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findMarker?i.findMarker(t,e):null}_hoverPaintedMarker(t,e){e.intersect.handlePaintedMarkerTooltip({e:c(l({},e.e),{type:"mousemove"}),opt:{tooltipEl:e.getElTooltip(),ttItems:e.ttItems},marker:{i:t.seriesIndex,j:t.dataPointIndex,cx:t.x,cy:t.y,size:t.size}})}_showScatterBubblePoint(t,e,i){const s=this.w.dom.baseEl;this._enlargedScatterMarker&&(i.marker.oldPointSize(this._enlargedScatterMarker),this._enlargedScatterMarker=null);const o=s.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`);if(!o)return!1;const r=o.querySelector(`.apexcharts-marker[rel='${e}']`);return!!r&&(i.marker.enlargeCurrentPoint(e,r),this._enlargedScatterMarker=r,!0)}_showTooltipNonAxis(t,e,i,s){i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t+e,shared:!1});const o=s.getBoundingClientRect(),r=o.width||i.tooltipRect.ttWidth||0,a=o.height||i.tooltipRect.ttHeight||0,n=i.getSliceAnchor(this._getFocusableElement(t,e));if(n){const t=i.tooltipPosition.placeOverAnchor(n.x,n.y,r,a,10);s.style.left=t.x+"px",s.style.top=t.y+"px"}}_showTooltipHeatTree(t,e,i,s,o){var r,a;const n=this.w;if(p.isFollowCursor(n)&&this._hoverFocusedCell(t,e,i))return;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:!1});const l=s.getBoundingClientRect(),c=l.width||i.tooltipRect.ttWidth||0,h=l.height||i.tooltipRect.ttHeight||0,d="heatmap"===o?"apexcharts-heatmap-rect":"apexcharts-treemap-rect",u=n.dom.baseEl.querySelector(`.${d}[i='${t}'][j='${e}']`),f=u?null:this._canvasCell(t,e);if(u||f){const t=n.dom.elWrap.getBoundingClientRect();let e=0,l=0,d=0,g=0;if(u){const s=u.getBoundingClientRect();e=s.left-t.left,l=s.top-t.top,d=s.width,g=s.height;const o=parseFloat(null!=(r=u.getAttribute("cx"))?r:""),n=parseFloat(null!=(a=u.getAttribute("width"))?a:"");i.tooltipPosition.moveXCrosshairs(o+n/2)}else if(f){const t=p.plotInWrap(n);e=t.left+f.x,l=t.top+f.y,d=f.width,g=f.height,i.tooltipPosition.moveXCrosshairs(f.x+f.width/2)}let v=e+d+c/2;const _=l+g/2-h/2;e+d>n.layout.gridWidth/2&&(v=e-c/2);const m=i.tooltipPosition.shortPlotPlacement,x=i.tooltipPosition.placeOnShortPlot(e+d/2,l,l+g);if(x)return void i.tooltipPosition.applyTooltipPosition(s,x);if("heatmap"===o&&n.config.tooltip.arrow&&!p.isFollowCursor(n)){const{left:t,top:o}=p.plotInWrap(n);return void i.tooltipPosition.applyTooltipPosition(s,i.tooltipPosition.placeAroundCell({top:l,bottom:l+g,left:e,right:e+d},{top:o,bottom:o+n.layout.gridHeight,left:t,right:t+n.layout.gridWidth},{el:u,ttWidth:c,ttHeight:h}))}s.style.left=v+"px",s.style.top=_+"px",m&&delete s.dataset.placement}}_hoverFocusedCell(t,e,i){const s=this.w,o=s.config.chart.type,r=i.getElTooltip(),a=s.dom.baseEl.querySelector(`.apexcharts-${o}-rect[i='${t}'][j='${e}']`);if(!r||!a&&!this._canvasCell(t,e))return!1;const n=a||s.dom.Paper.node;s.interact.capturedSeriesIndex=-1,s.interact.capturedDataPointIndex=-1;const h=i.intersect.handleHeatTreeTooltip({e:c(l({},i.e),{type:"mousemove",target:n,apexHoverTarget:n}),opt:{ttItems:i.ttItems},x:0,y:0,type:o}),d=!h.noHit&&s.interact.capturedSeriesIndex===t&&s.interact.capturedDataPointIndex===e;return s.interact.capturedSeriesIndex=t,s.interact.capturedDataPointIndex=e,!!d&&(i.placeCellTooltip(r,h),!0)}_canvasCell(t,e){if("heatmap"!==this.w.config.chart.type)return null;const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findCell?i.findCell(t,e):null}_canvasMark(t,e){if(!this._isBarLikeSeries(t))return null;const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findMark?i.findMark(t,e):null}_canvasMarkRect(t,e){const i=this._canvasMark(t,e);if(!i)return null;const s=p.plotRect(this.w),o=s.left+i.x*s.zoom,r=s.top+i.y*s.zoom;return{left:o,top:r,right:o+i.width*s.zoom,bottom:r+i.height*s.zoom}}_applyFocusClass(t,e){this._removeFocusClass();const i=this._getFocusableElement(t,e)||this._getBatchedFocusEl(t)||this._drawCanvasFocusRing(t,e);if(i){i.classList.add("apexcharts-keyboard-focused"),i.setAttribute("role","img");const s=this._buildPointLabel(t,e);s&&i.setAttribute("aria-label",s),this._focusedEl=i}}_getBatchedFocusEl(t){return this.w.globals.markers.batched?this.w.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-series-markers path`):null}_drawCanvasFocusRing(t,e){const i=this._canvasCell(t,e);if(!i)return this._drawCanvasMarkFocusRing(t,e);const s=this.w.dom.baseEl.querySelector(`.apexcharts-heatmap .apexcharts-series[rel='${t+1}']`);if(!s)return null;const o=new d(this.w,this.ctx).drawRect(i.x,i.y,i.width,i.height,i.radius,"none");return o.node.classList.add("apexcharts-keyboard-focus-ring"),o.attr({i:t,j:e}),s.insertBefore(o.node,s.firstChild),o.node}_drawCanvasMarkFocusRing(t,e){const i=this._canvasMark(t,e);if(!i)return this._drawCanvasMarkerFocusRing(t,e);const s=this.w,o=this._seriesGroup(t);if(!o)return null;const r=new d(s,this.ctx).drawPath({d:i.d,fill:"none",classes:"apexcharts-keyboard-focus-ring"});return r.attr("clip-path",`url(#gridRectBarMask${s.globals.cuid})`),o.insertBefore(r.node,o.firstChild),r.node}_drawCanvasMarkerFocusRing(t,e){const i=this._canvasMarker(t,e);if(!i)return null;const s=this.w,o=this._seriesGroup(t);if(!o)return null;const r=new d(s,this.ctx).drawPath({d:i.d,fill:"none",classes:"apexcharts-keyboard-focus-ring"});return r.attr("clip-path",`url(#gridRectMarkerMask${s.globals.cuid})`),o.appendChild(r.node),r.node}_removeFocusClass(){this._focusedEl&&(this._focusedEl.classList.remove("apexcharts-keyboard-focused"),this._focusedEl.removeAttribute("role"),this._focusedEl.removeAttribute("aria-label"),this._focusedEl.classList.contains("apexcharts-keyboard-focus-ring")&&this._focusedEl.remove(),this._focusedEl=null)}_buildPointLabel(t,e){var i,s,o,r,a,n,l,c;const h=this.w,d=h.config.chart.type,p=h.seriesData.seriesNames||[],u=h.seriesData.series||[];if("pie"===d||"donut"===d||"polarArea"===d){const t=null!=(s=(null==(i=h.labelData)?void 0:i.labels)&&h.labelData.labels[e])?s:"",o=Array.isArray(u)?u[e]:"";return t?`${t}: ${o}`:`${o}`}if("radialBar"===d)return`${p[t]||`Series ${t+1}`}: ${Array.isArray(u)?u[t]:""}`;const f=p[t]||`Series ${t+1}`,g=(Array.isArray(u[t])?u[t]:[])[e];let v=null==g?"":String(g);const _=null==(r=null==(o=h.formatters)?void 0:o.yLabelFormatters)?void 0:r[t];if("function"==typeof _)try{v=_(g,{seriesIndex:t,dataPointIndex:e,w:h})}catch(t){}let m="";const x=null==(a=h.labelData)?void 0:a.categoryLabels,b=null==(l=null==(n=h.seriesData)?void 0:n.seriesX)?void 0:l[t];if(Array.isArray(x)&&null!=x[e])m=String(x[e]);else if(Array.isArray(b)&&null!=b[e]){const i=null==(c=h.formatters)?void 0:c.xLabelFormatter;if("function"==typeof i)try{m=String(i(b[e],{seriesIndex:t,dataPointIndex:e,w:h}))}catch(t){m=String(b[e])}else m=String(b[e])}return m?`${f}: ${v}, ${m}`:`${f}: ${v}`}_leaveHoveredBar(){this._hoveredBarEl&&(new d(this.w,this.ctx).pathMouseLeave(this._hoveredBarEl,null),this._hoveredBarEl=null)}_getFocusableElement(t,e){var i,s;const o=this.w,r=o.config.chart.type,a=o.dom.baseEl;return"pie"===r||"donut"===r||"polarArea"===r?a.querySelector(`.apexcharts-pie-area[j='${e}']`):"heatmap"===r?a.querySelector(`.apexcharts-heatmap-rect[i='${t}'][j='${e}']`):"treemap"===r?a.querySelector(`.apexcharts-treemap-rect[i='${t}'][j='${e}']`):"radialBar"===r?a.querySelector(`.apexcharts-radialbar-slice-${t}`):this._isBarLikeSeries(t)?this._canvasMark(t,e)?null:null==(i=this._seriesGroup(t))?void 0:i.querySelector(`path[j='${e}']`):null==(s=this._seriesGroup(t))?void 0:s.querySelector(`.apexcharts-marker[rel='${e}']`)}_seriesGroup(t){return Array.from(this.w.dom.baseEl.querySelectorAll(".apexcharts-series")).find(e=>e.getAttribute("data:realIndex")===String(t))}_fireClick(t){var e,i;const s=null==(e=this._focusedEl)?void 0:e.instance,o=this.ctx.pie;s&&new d(this.w,this.ctx).pathMouseDown(s,t),o&&o.getExpandOffset()>0&&o.pieClicked(this.dataPointIndex),null==(i=this.w.globals.tooltip)||i.markerClick(t,this.seriesIndex,this.dataPointIndex)}_isNavEnabled(){const t=this.w.config.chart.accessibility;return t.enabled&&t.keyboard.enabled&&t.keyboard.navigation.enabled}_getSeriesCount(){const t=this.w,e=t.config.chart.type;return"pie"===e||"donut"===e||"polarArea"===e?1:t.seriesData.series.length}_getDataPointCount(t){const e=this.w,i=e.config.chart.type;if("pie"===i||"donut"===i||"polarArea"===i)return e.seriesData.series.length;const s=e.seriesData.series[t];return Array.isArray(s)?s.length:1}_clampCursor(){const t=this._getSeriesCount();this.seriesIndex>=t&&(this.seriesIndex=t-1),this.seriesIndex<0&&(this.seriesIndex=0);const e=this._getDataPointCount(this.seriesIndex);this.dataPointIndex>=e&&(this.dataPointIndex=e-1),this.dataPointIndex<0&&(this.dataPointIndex=0)}_snapToVisibleRange(){const t=this.w,e=t.globals,i=this.seriesIndex;if(!t.interact.zoomed)return;const s=t.seriesData.seriesX&&t.seriesData.seriesX[i];if(!s||!s.length)return;const o=e.minX,r=e.maxX;if(void 0===o||void 0===r)return;const a=s[this.dataPointIndex];if(a>=o&&a<=r)return;const n=s.length;for(let t=0;t<n;t++)if(s[t]>=o&&s[t]<=r)return void(this.dataPointIndex=t)}_snapToVisibleRangeInDirection(t){const e=this.w,i=e.globals,s=this.seriesIndex,o=e.seriesData.seriesX&&e.seriesData.seriesX[s];if(!o||!o.length)return;const r=i.minX,a=i.maxX;if(void 0===r||void 0===a)return;const n=o.length;if(t>=0){for(let t=0;t<n;t++)if(o[t]>=r&&o[t]<=a)return void(this.dataPointIndex=t)}else for(let t=n-1;t>=0;t--)if(o[t]>=r&&o[t]<=a)return void(this.dataPointIndex=t)}_isDataPointVisible(t,e){const i=this.w,s=i.globals;if(!i.interact.zoomed)return!0;const o=i.seriesData.seriesX&&i.seriesData.seriesX[t];if(!o)return!0;const r=o[e];return void 0===r||r>=s.minX&&r<=s.maxX}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const i=e.dom.baseEl;if(!i)return;const s=i.querySelector(".apexcharts-sr-status");s&&(s.textContent="",clearTimeout(this._announceTimer),this._announceTimer=setTimeout(()=>{s.textContent=t},0))}}}),t.default=h,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexKeyboard={})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.2.0
2
+ * ApexCharts v8.3.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- "use strict";var e=Object.defineProperty,t=Object.defineProperties,s=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,l=(t,s,i)=>s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i,o=(e,t)=>{for(var s in t||(t={}))n.call(t,s)&&l(e,s,t[s]);if(i)for(var s of i(t))r.call(t,s)&&l(e,s,t[s]);return e},a=(e,i)=>t(e,s(i));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function c(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const s in e)if("default"!==s){const i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>e[s]})}return t.default=e,Object.freeze(t)}const d=c(require("apexcharts/core")),g=d.__apex_CoreUtils,h=d.__apex_dimensions_Dimensions,p=d.__apex_Graphics,u=d.__apex_Series,f=d.__apex_Utils,m=d.__apex_Environment_Environment;class b{constructor(e){this.w=e.w,this.lgCtx=e}getLegendStyles(){if(m.isSSR())return null;const e=document.createElement("style");e.setAttribute("type","text/css");const t=this.w.config.chart.nonce;t&&e.setAttribute("nonce",t);const s=document.createTextNode(".apexcharts-flip-y{transform:scaleY(-1) translateY(-100%);transform-origin:top;transform-box:fill-box}.apexcharts-flip-x{transform:scaleX(-1);transform-origin:center;transform-box:fill-box}.apexcharts-legend{display:flex;overflow:auto;padding:0 10px}.apexcharts-legend.apexcharts-legend-group-horizontal{flex-direction:column}.apexcharts-legend-group{display:flex}.apexcharts-legend-group-vertical{flex-direction:column-reverse}.apexcharts-legend.apx-legend-position-bottom,.apexcharts-legend.apx-legend-position-top{flex-wrap:wrap}.apexcharts-legend.apx-legend-position-right,.apexcharts-legend.apx-legend-position-left{flex-direction:column;bottom:0}.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left,.apexcharts-legend.apx-legend-position-top.apexcharts-align-left,.apexcharts-legend.apx-legend-position-right,.apexcharts-legend.apx-legend-position-left{justify-content:flex-start;align-items:flex-start}.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center,.apexcharts-legend.apx-legend-position-top.apexcharts-align-center{justify-content:center;align-items:center}.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right,.apexcharts-legend.apx-legend-position-top.apexcharts-align-right{justify-content:flex-end;align-items:flex-end}.apexcharts-legend-series{cursor:pointer;line-height:normal;display:flex;align-items:center}.apexcharts-legend-text{position:relative;font-size:14px}.apexcharts-legend-text *,.apexcharts-legend-marker *{pointer-events:none}.apexcharts-legend-marker{position:relative;display:flex;align-items:center;justify-content:center;cursor:pointer;margin-right:1px}.apexcharts-legend-series.apexcharts-no-click{cursor:auto}.apexcharts-legend .apexcharts-hidden-zero-series,.apexcharts-legend .apexcharts-hidden-null-series{display:none!important}.apexcharts-inactive-legend{opacity:.45}");return e.appendChild(s),e}getLegendDimensions(){const e=this.w.dom.baseEl.querySelector(".apexcharts-legend");if(!e)return{clwh:0,clww:0};const{width:t,height:s}=e.getBoundingClientRect();return{clwh:s,clww:t}}appendToForeignObject(){var e;const t=this.getLegendStyles();!1!==this.w.config.chart.injectStyleSheet&&t&&(null==(e=this.w.dom.elLegendForeign)||e.appendChild(t))}toggleDataSeries(e,t){var s,i,n;const r=this.w;if(r.globals.axisCharts||"radialBar"===r.config.chart.type){r.globals.resized=!0;let l=null,o=null;if(r.globals.risingSeries=[],r.globals.axisCharts){if(l=null!=(s=Array.prototype.find.call(r.dom.baseEl.querySelectorAll(".apexcharts-series"),t=>t.getAttribute("data:realIndex")===String(e)))?s:null,!l)return;o=parseInt(null!=(i=l.getAttribute("data:realIndex"))?i:"",10)}else{if(l=r.dom.baseEl.querySelector(`.apexcharts-series[rel='${e+1}']`),!l)return;o=parseInt(null!=(n=l.getAttribute("rel"))?n:"",10)-1}if(t){[{cs:r.globals.collapsedSeries,csi:r.globals.collapsedSeriesIndices},{cs:r.globals.ancillaryCollapsedSeries,csi:r.globals.ancillaryCollapsedSeriesIndices}].forEach(e=>{const t=e.cs,s=e.csi;this.riseCollapsedSeries(t,s,o)})}else this.hideSeries({seriesEl:l,realIndex:o});if(r.config.chart.accessibility.enabled){const t=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${e+1}"]`);if(t){const s=r.globals.collapsedSeriesIndices.includes(o)||r.globals.ancillaryCollapsedSeriesIndices.includes(o);t.setAttribute("aria-pressed",s?"true":"false");const i=t.querySelector(".apexcharts-legend-text"),n=i?i.textContent:r.seriesData.seriesNames[e],l=s?"hidden":"visible";t.setAttribute("aria-label",`${n}, ${l}. Press Enter or Space to toggle.`)}}}else{if(r.globals.resized=!0,r.globals.risingSeries=[],t)this.riseCollapsedSeries(r.globals.collapsedSeries,r.globals.collapsedSeriesIndices,e);else{const t=this.getSeriesAfterCollapsing({realIndex:e});this.lgCtx.updateSeries(t,r.config.chart.animations.dynamicAnimation.enabled)}if(r.config.chart.accessibility.enabled){const t=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${e+1}"]`);if(t){const s=r.globals.collapsedSeriesIndices.includes(e);t.setAttribute("aria-pressed",s?"true":"false");const i=t.querySelector(".apexcharts-legend-text"),n=i?i.textContent:r.seriesData.seriesNames[e],l=s?"hidden":"visible";t.setAttribute("aria-label",`${n}, ${l}. Press Enter or Space to toggle.`)}}}}_nonAxisSliceContainer(e){const t=this.w.config.chart.type;return("pie"===t||"donut"===t||"polarArea"===t||"sunburst"===t||"icicle"===t)&&1===e.length&&e[0]&&"object"==typeof e[0]&&Array.isArray(e[0].data)?e[0].data:e}_readSliceValue(e){return"unit"===this.w.config.chart.type&&e&&Array.isArray(e.data)?e.data:e&&"object"==typeof e?e.y:e}_writeSliceValue(e,t,s){const i=e[t];"unit"===this.w.config.chart.type&&i&&Array.isArray(i.data)?i.data=Array.isArray(s)?s:[]:i&&"object"==typeof i?i.y=s:e[t]=s}getSeriesAfterCollapsing({realIndex:e}){var t,s;const i=this.w,n=i.globals,r=f.clone(i.config.series);if(n.axisCharts){const t=i.config.yaxis[n.seriesYAxisReverseMap[e]],s={index:e,data:r[e].data.slice(),type:r[e].type||i.config.chart.type,name:(n.seriesNames||[])[e]};if(t&&t.show&&t.showAlways)n.ancillaryCollapsedSeriesIndices.indexOf(e)<0&&(n.ancillaryCollapsedSeries.push(s),n.ancillaryCollapsedSeriesIndices.push(e));else if(n.collapsedSeriesIndices.indexOf(e)<0){n.collapsedSeries.push(s),n.collapsedSeriesIndices.push(e);const t=n.risingSeries.indexOf(e);n.risingSeries.splice(t,1)}}else if(n.collapsedSeriesIndices.indexOf(e)<0){const l=this._nonAxisSliceContainer(r);n.collapsedSeries.push({index:e,data:this._readSliceValue(l[e]),type:null!=(s=null==(t=i.config.series[e])?void 0:t.type)?s:"line",name:(n.seriesNames||[])[e]}),n.collapsedSeriesIndices.push(e)}const l=n.axisCharts?i.config.series.length:this._nonAxisSliceContainer(r).length;return n.allSeriesCollapsed=n.collapsedSeries.length+n.ancillaryCollapsedSeries.length===l,this._getSeriesBasedOnCollapsedState(r)}hideSeries({seriesEl:e,realIndex:t}){const s=this.w,i=this.getSeriesAfterCollapsing({realIndex:t}),n=e.childNodes;for(let e=0;e<n.length;e++)n[e].classList.contains("apexcharts-series-markers-wrap")&&(n[e].classList.contains("apexcharts-hide")?n[e].classList.remove("apexcharts-hide"):n[e].classList.add("apexcharts-hide"));const r=s.config.chart.animations.dynamicAnimation.enabled;r&&(s.globals.collapsingSeriesIndices=[t]);const l=()=>{s.globals.collapsingSeriesIndices=[]},o=this.lgCtx.updateSeries(i,r);l(),o&&"function"==typeof o.then&&o.then(l,l)}riseCollapsedSeries(e,t,s){const i=this.w;let n=f.clone(i.config.series);if(e.length>0){for(let r=0;r<e.length;r++)if(e[r].index===s){if(i.globals.axisCharts)n[s].data=e[r].data.slice(),n[s].hidden=!1;else{const t=this._nonAxisSliceContainer(n);this._writeSliceValue(t,s,e[r].data)}e.splice(r,1),t.splice(r,1),i.globals.risingSeries.push(s),r--}n=this._getSeriesBasedOnCollapsedState(n);const r=this.lgCtx.updateSeries(n,i.config.chart.animations.dynamicAnimation.enabled),l=()=>{i.globals.risingSeries=[]};r&&"function"==typeof r.then?r.then(l,l):l()}}_getSeriesBasedOnCollapsedState(e){const t=this.w;let s=0;if(t.globals.axisCharts)e.forEach((i,n)=>{t.globals.collapsedSeriesIndices.indexOf(n)<0&&t.globals.ancillaryCollapsedSeriesIndices.indexOf(n)<0||(e[n].data=[],s++)});else{const i=this._nonAxisSliceContainer(e);i.forEach((e,n)=>{t.globals.collapsedSeriesIndices.indexOf(n)<0||(this._writeSliceValue(i,n,0),s++)})}const i=t.globals.axisCharts?e.length:this._nonAxisSliceContainer(e).length;return t.globals.allSeriesCollapsed=s===i,e}}const x=d.__apex_BrowserAPIs_BrowserAPIs,y=["#cf4d3f","#8f9499","#26a75b"],v=(e,t,s)=>e+(t-e)*s;function S(e){return Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0")}function w(e,t,s){const i=f.parseHex(A(e)),n=f.parseHex(A(t));return i&&n?"#"+S(v(i[0],n[0],s))+S(v(i[1],n[1],s))+S(v(i[2],n[2],s)):e}function A(e){if("string"!=typeof e)return"#000000";if(f.isColorHex(e))return e;return f.rgb2hex(e)||"#000000"}function _(e,t,s,i){var n,r,l;if(!t||"object"!=typeof t)return null;const o=null==(l=null==(r=null==(n=e.config.plotOptions)?void 0:n.treemap)?void 0:r.colorScale)?void 0:l.colorValue;let a;if(a="function"==typeof o?o(t,{seriesIndex:s,dataPointIndex:i,w:e}):"string"==typeof o?t[o]:t.colorValue,null==a)return null;const c=Number(a);return Number.isFinite(c)?c:null}function L(e){var t,s,i;const n=null==(i=null==(s=null==(t=e.config)?void 0:t.plotOptions)?void 0:s.treemap)?void 0:i.colorScale,r=n&&n.gradient;if(!r)return null;if(!1===r.enabled)return null;const l=e.config.series||[];let o=1/0,a=-1/0,c=!1;for(let t=0;t<l.length;t++){const s=l[t]&&l[t].data;if(Array.isArray(s))for(let i=0;i<s.length;i++){const n=_(e,s[i],t,i);null!=n&&(c=!0,n<o&&(o=n),n>a&&(a=n))}}if(!c&&!0!==r.enabled)return null;Number.isFinite(o)||(o=0,a=0);let d=Number.isFinite(Number(r.min))?Number(r.min):o,g=Number.isFinite(Number(r.max))?Number(r.max):a,h=null;if(null===r.midpoint?h=null:Number.isFinite(Number(r.midpoint))?h=Number(r.midpoint):d<0&&g>0&&(h=0),null!=h&&!1!==r.symmetric&&!Number.isFinite(Number(r.min))&&!Number.isFinite(Number(r.max))){const e=Math.max(Math.abs(d-h),Math.abs(g-h));d=h-e,g=h+e}g===d&&(d-=.5,g+=.5);const p=function(e,t,s,i){if(Array.isArray(e.stops)&&e.stops.length>=2)return e.stops.filter(e=>e&&Number.isFinite(Number(e.value))).map(e=>({value:Number(e.value),color:A(e.color)})).sort((e,t)=>e.value-t.value);const n=(Array.isArray(e.colors)&&e.colors.length>=2?e.colors:y).map(A),r=n.length;if(null!=i&&r>=3){const e=Math.floor((r-1)/2),l=[];for(let s=0;s<=e;s++)l.push({value:v(t,i,s/e),color:n[s]});for(let t=e+1;t<r;t++)l.push({value:v(i,s,(t-e)/(r-1-e)),color:n[t]});return l}return n.map((e,i)=>({value:v(t,s,i/(r-1)),color:e}))}(r,d,g,h);if(p.length<2)return null;const u=g-d,f=p.map(e=>({percent:0===u?0:(e.value-d)/u,color:e.color}));return{min:d,max:g,midpoint:h,stops:p,at:e=>{if(!Number.isFinite(e))return p[Math.floor(p.length/2)].color;if(e<=p[0].value)return p[0].color;const t=p[p.length-1];if(e>=t.value)return t.color;for(let t=1;t<p.length;t++){const s=p[t];if(e<=s.value){const i=p[t-1],n=s.value-i.value,r=0===n?0:(e-i.value)/n;return w(i.color,s.color,r)}}return t.color},legendStops:f}}const C=d.__apex_tooltip_Utils,E="http://www.w3.org/2000/svg";class k{constructor(e,t){this.w=e,this.ctx=t,this.svgEl=null,this.arrowEl=null,this.hoverValueEl=null,this._min=0,this._max=0,this._geom=null,this._bandHitEls=[],this._activeBandIndex=-1,this._targetEl=null,this._onCellEnter=this._onCellEnter.bind(this),this._onCellLeave=this._onCellLeave.bind(this),this._onBandEnter=this._onBandEnter.bind(this),this._onBandLeave=this._onBandLeave.bind(this)}_getFormatter(){const e=this._cfg();return"function"==typeof e.formatter?e.formatter:e=>{if(!Number.isFinite(e))return String(e);const t=Math.abs(e);return t>=1e3?e.toFixed(0):t>=10?e.toFixed(1):e.toFixed(2)}}static colorScaleOf(e){var t,s,i,n,r;const l=null==(s=null==(t=null==e?void 0:e.config)?void 0:t.chart)?void 0:s.type;return l&&(null==(r=null==(n=null==(i=null==e?void 0:e.config)?void 0:i.plotOptions)?void 0:n[l])?void 0:r.colorScale)||null}static configFor(e){const t=k.colorScaleOf(e);return t&&t.gradientLegend||null}_cfg(){return k.configFor(this.w)||{}}static isEnabled(e){if(!k.supports(e))return!1;const t=k.configFor(e);return!(!t||!t.enabled)}static supports(e){var t,s;const i=null==(s=null==(t=null==e?void 0:e.config)?void 0:t.chart)?void 0:s.type;return"heatmap"===i||"treemap"===i}draw(e=null){var t,s,i,n,r,l,o,a;const c=this.w;this._targetEl=e;const d=e||c.dom.elLegendWrap;if(!d)return;const g=this._cfg(),h=c.config.legend.position,p="left"===h||"right"===h,u=null!=(s=null==(t=g.arrow)?void 0:t.size)?s:8,f=u+4,m=g.showLabels?28:4,b=g.showLabels?20:4,y=g.showLabels?44:0,v=this._resolveStripLength(p?g.height:g.width,p),S=g.thickness,w=p?Math.max(S+f+4,y):v+2*m,A=p?v+2*b:S+f+4,_=(w-(S+f))/2,L=p?"left"===h?_:_+f:m,C=p?b:"top"===h?f:4,k=x.createElementNS(E,"svg");k.setAttribute("class","apexcharts-heatmap-gradient-legend apexcharts-gradient-legend"),k.setAttribute("width",String(w)),k.setAttribute("height",String(A)),k.setAttribute("overflow","visible");const I=x.createElementNS(E,"defs"),F=`apexcharts-heatmap-gradient-${c.globals.cuid}`,H=x.createElementNS(E,"linearGradient");H.setAttribute("id",F),p?(H.setAttribute("x1","0"),H.setAttribute("y1","1"),H.setAttribute("x2","0"),H.setAttribute("y2","0")):(H.setAttribute("x1","0"),H.setAttribute("y1","0"),H.setAttribute("x2","1"),H.setAttribute("y2","0"));const{min:N,max:M,stops:O,bands:B}=this._computeStops();this._min=N,this._max=M,O.forEach(e=>{const t=x.createElementNS(E,"stop");t.setAttribute("offset",`${(100*e.percent).toFixed(2)}%`),t.setAttribute("stop-color",e.color),H.appendChild(t)}),I.appendChild(H),k.appendChild(I);const D=x.createElementNS(E,"rect");if(D.setAttribute("x",String(L)),D.setAttribute("y",String(C)),D.setAttribute("width",String(p?S:v)),D.setAttribute("height",String(p?v:S)),D.setAttribute("rx","2"),D.setAttribute("fill",`url(#${F})`),k.appendChild(D),g.showLabels){const e=(null==(i=g.labelStyle)?void 0:i.colors)||(Array.isArray(c.config.legend.labels.colors)?c.config.legend.labels.colors[0]:c.config.legend.labels.colors)||c.config.chart.foreColor,t=(null==(n=g.labelStyle)?void 0:n.fontSize)||"11px",s=(null==(r=g.labelStyle)?void 0:r.fontFamily)||c.config.chart.fontFamily,l=this._getFormatter(),o=(i,n,r,l)=>{const o=x.createElementNS(E,"text");return o.setAttribute("x",String(n)),o.setAttribute("y",String(r)),o.setAttribute("text-anchor",l),o.setAttribute("dominant-baseline","middle"),o.setAttribute("fill",e),o.setAttribute("font-size",t),s&&o.setAttribute("font-family",s),o.textContent=String(i),o};if(p){const e=L+S/2;k.appendChild(o(l(N),e,C+v+10,"middle")),k.appendChild(o(l(M),e,C-10,"middle"))}else{const e=C+S/2;k.appendChild(o(l(N),L-6,e,"end")),k.appendChild(o(l(M),L+v+6,e,"start"))}}const P=(null==(l=g.arrow)?void 0:l.color)||c.config.chart.foreColor,V=this._buildArrow(u,P,h);if(k.appendChild(V),this.arrowEl=V,this._bandHitEls=[],c.config.legend.onItemHover.highlightDataSeries&&B.length>0&&B.forEach(e=>{const t=x.createElementNS(E,"rect");if(p){const s=C+v-e.p2*v,i=C+v-e.p1*v;t.setAttribute("x",String(L)),t.setAttribute("y",String(s)),t.setAttribute("width",String(S)),t.setAttribute("height",String(Math.max(0,i-s)))}else t.setAttribute("x",String(L+e.p1*v)),t.setAttribute("y",String(C)),t.setAttribute("width",String(Math.max(0,(e.p2-e.p1)*v))),t.setAttribute("height",String(S));t.setAttribute("fill","transparent"),t.setAttribute("class","apexcharts-heatmap-gradient-band"),t.setAttribute("data:range-index",String(e.index)),t.style.cursor="pointer",k.appendChild(t),this._bandHitEls.push(t)}),this._geom={isVertical:p,position:h,stripX:L,stripY:C,stripLength:v,stripThickness:S,arrowSize:u,svgWidth:w,svgHeight:A},g.showHoverValue){const e=x.createElement("div");e.classList.add("apexcharts-heatmap-gradient-legend-value"),e.style.position="absolute",e.style.fontSize=(null==(o=g.labelStyle)?void 0:o.fontSize)||"11px",e.style.fontFamily=(null==(a=g.labelStyle)?void 0:a.fontFamily)||c.config.chart.fontFamily||"",e.style.color=c.config.chart.foreColor,e.style.background="rgba(0,0,0,0.65)",e.style.color="#fff",e.style.padding="2px 6px",e.style.borderRadius="3px",e.style.pointerEvents="none",e.style.whiteSpace="nowrap",e.style.opacity="0",e.style.transition="opacity 120ms ease",this.hoverValueEl=e}d.classList.add("apexcharts-heatmap-gradient-legend-wrap"),d.classList.add("apx-legend-position-"+h),d.appendChild(k),this.hoverValueEl&&d.appendChild(this.hoverValueEl),this.svgEl=k,e?(d.style.width=w+"px",d.style.height=A+"px",d.style.position="relative",d.style.overflow="visible"):this._applyWrapAlignment(d,h,p,w,A),this._attachHoverListeners(),this._attachBandHoverListeners()}_resolveStripLength(e,t){const s=this.w,i=t?s.globals.svgHeight||s.config.chart.height||300:s.globals.svgWidth||s.config.chart.width||600;if("string"==typeof e){const t=e.trim();if(t.endsWith("%")){const e=parseFloat(t)||0;return Math.max(20,i*e/100)}const s=parseFloat(t);return Number.isFinite(s)?s:200}return"number"==typeof e&&Number.isFinite(e)?e:200}_applyWrapAlignment(e,t,s,i,n){const r=this.w,l=this._cfg().align||"center",o=12,a=r.globals.svgWidth||r.config.chart.width||600,c=r.globals.svgHeight||r.config.chart.height||300,d=r.config.legend.offsetX||0,g=r.config.legend.offsetY||0;if(e.style.position="absolute",e.style.display="block",e.style.overflow="visible",e.style.padding="0",e.style.width=i+"px",e.style.height=n+"px",e.style.right="auto",e.style.bottom="auto",s){const s=c-n-24;let r;r="start"===l?o:"end"===l?o+Math.max(0,s):o+Math.max(0,s)/2,e.style.top=r+g+"px",e.style.left="left"===t?o+d+"px":a-i-o+d+"px"}else{const s=a-i-24;let r;r="start"===l?o:"end"===l?o+Math.max(0,s):o+Math.max(0,s)/2,e.style.left=r+d+"px",e.style.top="top"===t?o+g+"px":c-n-o+g+"px"}}repositionToPlot(){var e,t;if(!m.isBrowser())return;if(this._targetEl)return;const s=this.w,i=s.globals,n=s.dom.elLegendWrap;if(!n||!this._geom)return;if(!Number.isFinite(i.gridWidth)||!Number.isFinite(i.gridHeight))return;const{isVertical:r,position:l,svgWidth:o,svgHeight:a,stripX:c,stripY:d,stripThickness:g}=this._geom,h=this._cfg().align||"center",p=s.config.legend.offsetX||0,u=s.config.legend.offsetY||0,f=null==(t=null==(e=this.ctx)?void 0:e.dimensions)?void 0:t.dimHelpers,b=f?f.getTitleSubtitleCoords("title").height+f.getTitleSubtitleCoords("subtitle").height:0,y=s.layout.xAxisHeight||0,v=(e,t)=>{const s=Math.max(0,e-t);return"start"===h?0:"end"===h?s:s/2};if(r){n.style.top=i.translateY+v(i.gridHeight,a)+u+"px";const e=(("left"===l?0:i.translateX+i.gridWidth)+("left"===l?i.translateX:i.svgWidth))/2;n.style.left=e-c-g/2+p+"px"}else{n.style.left=i.translateX+v(i.gridWidth,o)+p+"px";const e=(("top"===l?b:i.translateY+i.gridHeight+y)+("top"===l?i.translateY:i.svgHeight))/2;n.style.top=e-d-g/2+u+"px"}x.requestAnimationFrame(()=>this._enforceMinPlotGap())}_enforceMinPlotGap(){const e=this.w,t=e.dom.elLegendWrap,s=this.svgEl&&this.svgEl.querySelector("rect");if(!t||!s||!this._geom)return;if(!e.dom.baseEl||!e.dom.baseEl.querySelector(".apexcharts-svg"))return;const i=s.getBoundingClientRect(),n=C.plotRect(e);if(!(i.width&&i.height&&n.width&&n.height))return;const r=n.left,l=n.left+n.width,o=n.top,a=n.top+n.height,c=n.zoom,{isVertical:d,position:g}=this._geom;if(d){const e=("left"===g?r-i.right:i.left-l)/c;if(e<16){const s=parseFloat(t.style.left)||0,i=16-e;t.style.left=s+("left"===g?-i:i)+"px"}}else{const e=("top"===g?o-i.bottom:i.top-a)/c;if(e<16){const s=parseFloat(t.style.top)||0,i=16-e;t.style.top=s+("top"===g?-i:i)+"px"}}}destroy(){var e,t,s,i,n,r,l;for(let s=0;s<this._bandHitEls.length;s++){const i=this._bandHitEls[s];null==(e=i.removeEventListener)||e.call(i,"mousemove",this._onBandEnter),null==(t=i.removeEventListener)||t.call(i,"mouseout",this._onBandLeave)}if(this._bandHitEls=[],this._activeBandIndex=-1,null==(s=this.ctx)?void 0:s.events)try{null==(n=(i=this.ctx.events).removeEventListener)||n.call(i,"dataPointMouseEnter",this._onCellEnter),null==(l=(r=this.ctx.events).removeEventListener)||l.call(r,"dataPointMouseLeave",this._onCellLeave)}catch(e){}}_attachBandHoverListeners(){if(m.isBrowser())for(let e=0;e<this._bandHitEls.length;e++){const t=this._bandHitEls[e];t.addEventListener("mousemove",this._onBandEnter),t.addEventListener("mouseout",this._onBandLeave)}}_onBandEnter(e){var t,s,i,n;const r=this.w,l=e.currentTarget,o=parseInt(null!=(t=l.getAttribute("data:range-index"))?t:"-1",10);o<0||o===this._activeBandIndex||(this._activeBandIndex=o,null==(n=null==(i=null==(s=this.ctx)?void 0:s.events)?void 0:i.fireEvent)||n.call(i,"legendHover",[this.ctx,o,r]),new u(r).highlightRangeInSeries(o,"highlight"))}_onBandLeave(){if(this._activeBandIndex<0)return;const e=this._activeBandIndex;this._activeBandIndex=-1,new u(this.w).highlightRangeInSeries(e,"reset")}_attachHoverListeners(){var e,t;m.isBrowser()&&(null==(t=null==(e=this.ctx)?void 0:e.events)?void 0:t.addEventListener)&&(this.ctx.events.addEventListener("dataPointMouseEnter",this._onCellEnter),this.ctx.events.addEventListener("dataPointMouseLeave",this._onCellLeave))}_onCellEnter(...e){var t,s,i;const n=this.w;if(!this.arrowEl)return;const r=e[e.length-1];if(!r||"object"!=typeof r)return;const l=r.seriesIndex,o=r.dataPointIndex;if("number"!=typeof l||"number"!=typeof o)return;if(!k.supports(n))return;let a;a=this._continuous?function(e,t,s){const i=e.config.series[t];return _(e,i&&Array.isArray(i.data)?i.data[s]:null,t,s)}(n,l,o):null==(i=null==(s=null==(t=n.seriesData)?void 0:t.series)?void 0:s[l])?void 0:i[o],null==a||Number.isNaN(a)||this._positionArrow(a)}_onCellLeave(){this.arrowEl&&(this.arrowEl.setAttribute("opacity","0"),this.hoverValueEl&&(this.hoverValueEl.style.opacity="0"))}_positionArrow(e){if(!this.arrowEl||!this._geom)return;const{isVertical:t,position:s,stripX:i,stripY:n,stripLength:r,stripThickness:l,arrowSize:o}=this._geom,a=this._min,c=this._max-a;let d;if(d=0===c?.5:(e-a)/c,d<0&&(d=0),d>1&&(d=1),t){const e=n+r-d*r;let t,a;"left"===s?(t=i+l,a=t+o):(t=i,a=t-o);const c=[`${t},${e}`,`${a},${e-o/2}`,`${a},${e+o/2}`].join(" ");this.arrowEl.setAttribute("points",c)}else{const e=i+d*r;let t,a;"top"===s?(t=n+l,a=t+o):(t=n,a=t-o);const c=[`${e},${t}`,`${e-o/2},${a}`,`${e+o/2},${a}`].join(" ");this.arrowEl.setAttribute("points",c)}if(this.arrowEl.setAttribute("opacity","1"),this.hoverValueEl){const a=this._getFormatter();if(this.hoverValueEl.textContent=a(e),t){const e=n+r-d*r;"left"===s?this.hoverValueEl.style.left=`${i+l+o+8}px`:(this.hoverValueEl.style.left=i-o-8+"px",this.hoverValueEl.style.transform="translateX(-100%)"),this.hoverValueEl.style.top=e-9+"px"}else{const e=i+d*r;this.hoverValueEl.style.left=`${e}px`,this.hoverValueEl.style.transform="translateX(-50%)",this.hoverValueEl.style.top="top"===s?`${n+l+o+8}px`:n-o-18+"px"}this.hoverValueEl.style.opacity="1"}}_buildArrow(e,t,s){const i=x.createElementNS(E,"polygon");return i.setAttribute("fill",t),i.setAttribute("opacity","0"),i.setAttribute("class","apexcharts-heatmap-gradient-arrow"),i.setAttribute("points","0,0 0,0 0,0"),i.setAttribute("pointer-events","none"),i}_computeStops(){var e,t;const s=this.w,i=k.colorScaleOf(s)||{},n=this._cfg(),r=L(s);if(r)return this._continuous=!0,{min:r.min,max:r.max,stops:r.legendStops,bands:[]};this._continuous=!1;let l=1/0,c=-1/0;const d=(null==(e=s.seriesData)?void 0:e.series)||[];for(let e=0;e<d.length;e++){const t=d[e];if(t)for(let e=0;e<t.length;e++){const s=t[e];null==s||Number.isNaN(s)||(s<l&&(l=s),s>c&&(c=s))}}Number.isFinite(l)||(l=0),Number.isFinite(c)||(c=0);let g=l,h=c;void 0!==i.min&&void 0!==i.max&&i.max>i.min?(g=i.min,h=i.max):(void 0!==i.min&&(g=i.min<l?i.min:l),void 0!==i.max&&(h=i.max>c?i.max:c));const p=[],u=[];if(i.ranges&&i.ranges.length>0){const e=i.ranges.map((e,t)=>a(o({},e),{_originalIndex:t})).sort((e,t)=>e.from-t.from),t=e[0].from,s=e[e.length-1].to;g=t,h=s;const n=s-t||1;e.forEach(e=>{const s=(e.from-t)/n,i=(e.to-t)/n;p.push({percent:(s+i)/2,color:e.color}),u.push({index:e._originalIndex,p1:s,p2:i})})}else{const e=s.globals.colors[0]||"#008FFB",i=new f,r=s.config.plotOptions[s.config.chart.type]||{},l=null!=(t=r.shadeIntensity)?t:.5,o=s.globals.hasNegs,a=Math.max(2,n.stops||16);for(let t=0;t<a;t++){const n=t/(a-1),c=g+n*(h-g),d=Math.abs(h)+Math.abs(g),u=0===d?0:100*c/d;let f;f=o?r.reverseNegativeShade?u<0?u/100*(1.25*l):1.25*l*(1-u/100):u<=0?1-(1+u/100)*l:(1-u/100)*l:1-u/100,f>1&&(f=1),f<-1&&(f=-1);const m=r.enableShades?i.shadeColor("dark"===s.config.theme.mode?-1*f:f,e):e;p.push({percent:n,color:m})}}return{min:g,max:h,stops:p,bands:u}}}const I=d.__apex_Markers;function F(e){return e.classList.contains("apexcharts-legend-series")||e.classList.contains("apexcharts-legend-text")||e.classList.contains("apexcharts-legend-marker")}d.default.registerFeatures({legend:class{constructor(e,t){this.w=e,this.ctx=t,this.updateSeries=(...e)=>t.updateHelpers._updateSeries(...e),this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.onLegendClickEvent=this.onLegendClickEvent.bind(this),this.onLegendPointerDown=this.onLegendPointerDown.bind(this),this.onLegendPointerUp=this.onLegendPointerUp.bind(this),this.legendPress=null,this.recoveredRel=null,this.isBarsDistributed="bar"===this.w.config.chart.type&&this.w.config.plotOptions.bar.distributed&&1===this.w.config.series.length,this.legendHelpers=new b(this)}init(){const e=this.w,t=e.globals,s=e.config;this.isBarsDistributed="bar"===s.chart.type&&s.plotOptions.bar.distributed&&1===s.series.length;const i=s.legend.showForSingleSeries&&1===this.w.seriesData.series.length||this.isBarsDistributed||"heatmap"===s.chart.type||k.isEnabled(e)||this.w.seriesData.series.length>1;if(this.legendHelpers.appendToForeignObject(),(i||!t.axisCharts)&&s.legend.show){const t=e.dom.elLegendWrap;for(;t.firstChild;)t.removeChild(t.firstChild);this.heatmapGradientLegend&&(this.heatmapGradientLegend.destroy(),this.heatmapGradientLegend=null),k.isEnabled(e)?(this.heatmapGradientLegend=new k(e,this.ctx),this.heatmapGradientLegend.draw()):(this.drawLegends(),"bottom"===s.legend.position||"top"===s.legend.position?this.legendAlignHorizontal():"right"!==s.legend.position&&"left"!==s.legend.position||this.legendAlignVertical())}}createLegendMarker({i:e,fillcolor:t}){const s=this.w,i=x.createElement("span");i.classList.add("apexcharts-legend-marker");const n=s.config.legend.markers.shape||s.config.markers.shape;let r=n;Array.isArray(n)&&(r=n[e]);const l=Array.isArray(s.config.legend.markers.size)?parseFloat(s.config.legend.markers.size[e]):parseFloat(s.config.legend.markers.size),c=Array.isArray(s.config.legend.markers.offsetX)?parseFloat(s.config.legend.markers.offsetX[e]):parseFloat(s.config.legend.markers.offsetX),d=Array.isArray(s.config.legend.markers.offsetY)?parseFloat(s.config.legend.markers.offsetY[e]):parseFloat(s.config.legend.markers.offsetY),g=Array.isArray(s.config.legend.markers.strokeWidth)?parseFloat(s.config.legend.markers.strokeWidth[e]):parseFloat(s.config.legend.markers.strokeWidth),h=i.style;if(h.height=2*(l+g)+"px",h.width=2*(l+g)+"px",h.left=c+"px",h.top=d+"px",s.config.legend.markers.customHTML)h.background="transparent",h.color=t[e],Array.isArray(s.config.legend.markers.customHTML)?s.config.legend.markers.customHTML[e]&&(i.innerHTML=s.config.legend.markers.customHTML[e]()):i.innerHTML=s.config.legend.markers.customHTML();else{const s=new I(this.ctx.w,this.ctx).getMarkerConfig({cssClass:`apexcharts-legend-marker apexcharts-marker apexcharts-marker-${r}`,seriesIndex:e,strokeWidth:g,size:l}),n=(m.isBrowser()?window.SVG:global.SVG)().addTo(i).size("100%","100%"),c=new p(this.w).drawMarker(0,0,a(o({},s),{pointFillColor:Array.isArray(t)?t[e]:s.pointFillColor,shape:r}));c.node.style.transform="triangle"===r?"translate(50%, 45%)":"translate(50%, 50%)",n.add(c)}return i}drawLegends(){var e;const t=this,s=this.w,i=s.dom.elLegendWrap,n=s.config.legend.fontFamily;let r=s.seriesData.seriesNames,l=s.config.legend.markers.fillColors?s.config.legend.markers.fillColors.slice():s.globals.colors.slice();if("heatmap"===s.config.chart.type){const e=s.config.plotOptions.heatmap.colorScale.ranges;r=e.map(e=>e.name?e.name:e.from+" - "+e.to),l=e.map(e=>e.color)}else this.isBarsDistributed&&(r=s.labelData.labels.slice());s.config.legend.customLegendItems.length&&(r=s.config.legend.customLegendItems);const o=s.formatters.legendFormatter,a=s.config.legend.inverseOrder,c=[];s.labelData.seriesGroups.length>1&&s.config.legend.clusterGroupedSeries&&s.labelData.seriesGroups.forEach((e,t)=>{c[t]=x.createElement("div"),c[t].classList.add("apexcharts-legend-group",`apexcharts-legend-group-${t}`),"horizontal"===s.config.legend.clusterGroupedSeriesOrientation?i.classList.add("apexcharts-legend-group-horizontal"):c[t].classList.add("apexcharts-legend-group-vertical")});for(let t=a?r.length-1:0;a?t>=0:t<=r.length-1;a?t--:t++){const a=o(r[t],{seriesIndex:t,w:s});let d=!1,h=!1;if(s.globals.collapsedSeries.length>0)for(let e=0;e<s.globals.collapsedSeries.length;e++)s.globals.collapsedSeries[e].index===t&&(d=!0);if(s.globals.ancillaryCollapsedSeriesIndices.length>0)for(let e=0;e<s.globals.ancillaryCollapsedSeriesIndices.length;e++)s.globals.ancillaryCollapsedSeriesIndices[e]===t&&(h=!0);const u=this.createLegendMarker({i:t,fillcolor:l});p.setAttrs(u,{rel:t+1,"data:collapsed":d||h}),(d||h)&&u.classList.add("apexcharts-inactive-legend");const m=x.createElement("div");if(s.config.chart.accessibility.enabled&&s.config.chart.accessibility.keyboard.enabled){m.setAttribute("role","button"),m.setAttribute("tabindex","0");const e=Array.isArray(a)?a.join(" "):a,t=d||h,s=t?"hidden":"visible";m.setAttribute("aria-label",`${e}, ${s}. Press Enter or Space to toggle.`),m.setAttribute("aria-pressed",t?"true":"false")}const b=x.createElement("span");b.classList.add("apexcharts-legend-text"),b.innerHTML=Array.isArray(a)?a.join(" "):a;let y=s.config.legend.labels.useSeriesColors?s.globals.colors[t]:Array.isArray(s.config.legend.labels.colors)?null==(e=s.config.legend.labels.colors)?void 0:e[t]:s.config.legend.labels.colors;y||(y=s.config.chart.foreColor),b.style.color=y,b.style.fontSize=s.config.legend.fontSize,b.style.fontWeight=s.config.legend.fontWeight,b.style.fontFamily=n||s.config.chart.fontFamily,p.setAttrs(b,{rel:t+1,i:t,"data:default-text":encodeURIComponent(a),"data:collapsed":d||h}),m.appendChild(u),m.appendChild(b);const v=new g(this.w);if(!s.config.legend.showForZeroSeries){0===v.getSeriesTotalByIndex(t)&&v.seriesHaveSameValues(t)&&!v.isSeriesNull(t)&&-1===s.globals.collapsedSeriesIndices.indexOf(t)&&-1===s.globals.ancillaryCollapsedSeriesIndices.indexOf(t)&&m.classList.add("apexcharts-hidden-zero-series")}s.config.legend.showForNullSeries||v.isSeriesNull(t)&&-1===s.globals.collapsedSeriesIndices.indexOf(t)&&-1===s.globals.ancillaryCollapsedSeriesIndices.indexOf(t)&&m.classList.add("apexcharts-hidden-null-series");const S=c[s.labelData.seriesGroupIndex[t]];S&&i.appendChild(S),(S||i).appendChild(m),i.classList.add(`apexcharts-align-${s.config.legend.horizontalAlign}`),i.classList.add("apx-legend-position-"+s.config.legend.position),m.classList.add("apexcharts-legend-series"),m.style.margin=`${s.config.legend.itemMargin.vertical}px ${s.config.legend.itemMargin.horizontal}px`,i.style.width=s.config.legend.width?s.config.legend.width+"px":"",i.style.height=s.config.legend.height?s.config.legend.height+"px":"",p.setAttrs(m,{rel:t+1,seriesName:f.escapeString(r[t]),"data:collapsed":d||h}),(d||h)&&m.classList.add("apexcharts-inactive-legend"),s.config.legend.onItemClick.toggleDataSeries||m.classList.add("apexcharts-no-click")}s.dom.elWrap.addEventListener("click",t.onLegendClickEvent,!0),s.dom.elWrap.addEventListener("pointerdown",t.onLegendPointerDown,!0),s.dom.elWrap.addEventListener("pointerup",t.onLegendPointerUp,!0),s.config.legend.onItemHover.highlightDataSeries&&0===s.config.legend.customLegendItems.length&&(s.dom.elWrap.addEventListener("mousemove",t.onLegendHovered,!0),s.dom.elWrap.addEventListener("mouseout",t.onLegendHovered,!0)),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.keyboard.enabled&&s.dom.elWrap.addEventListener("keydown",t.onLegendKeyDown.bind(t),!0)}setLegendWrapXY(e,t){const s=this.w,i=s.dom.elLegendWrap,n=i.clientHeight;let r=0,l=0;if("bottom"===s.config.legend.position)l=s.globals.svgHeight-Math.min(n,s.globals.svgHeight/2)-5;else if("top"===s.config.legend.position){const e=new h(this.w,this.ctx),t=e.dimHelpers.getTitleSubtitleCoords("title").height,s=e.dimHelpers.getTitleSubtitleCoords("subtitle").height;l=(t>0?t-10:0)+(s>0?s-10:0)}i.style.position="absolute",r=r+e+s.config.legend.offsetX,l=l+t+s.config.legend.offsetY,i.style.left=r+"px",i.style.top=l+"px","right"===s.config.legend.position&&(i.style.left="auto",i.style.right=25+s.config.legend.offsetX+"px");["width","height"].forEach(e=>{i&&i.style[e]&&(i.style[e]=parseInt(String(s.config.legend[e]),10)+"px")})}legendAlignHorizontal(){const e=this.w;e.dom.elLegendWrap.style.right="0";const t=new h(this.w,this.ctx),s=t.dimHelpers.getTitleSubtitleCoords("title"),i=t.dimHelpers.getTitleSubtitleCoords("subtitle");let n=0;"top"===e.config.legend.position&&(n=s.height+i.height+e.config.title.margin+e.config.subtitle.margin-10),this.setLegendWrapXY(20,n)}legendAlignVertical(){this.setLegendWrapXY("left"===this.w.config.legend.position?20:0,20)}onLegendHovered(e){var t;const s=this.w,i=e.target,n=F(i);if("heatmap"===s.config.chart.type||this.isBarsDistributed){if(n){const s=parseInt(null!=(t=i.getAttribute("rel"))?t:"0",10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,s,this.w]);const n=new u(this.ctx.w);"mousemove"===e.type?n.highlightRangeInSeries(s,"highlight"):"mouseout"===e.type&&n.highlightRangeInSeries(s,"reset")}}else if(!i.classList.contains("apexcharts-inactive-legend")&&n){new u(this.ctx.w).toggleSeriesOnHover(e,i)}}onLegendKeyDown(e){const t=this,s=this.w,i=e.target;if(F(i)&&("Enter"===e.key||" "===e.key)){e.preventDefault();const n=i.getAttribute("rel");t.onLegendClick(e),null!==n&&s.config.legend.onItemClick.toggleDataSeries&&requestAnimationFrame(()=>{const e=s.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${n}"]`);e&&e.focus()})}}onLegendPointerDown(e){const t=e.target;this.recoveredRel=null,this.legendPress=0===e.button&&F(t)?{el:t,rel:t.getAttribute("rel")}:null}onLegendPointerUp(e){const t=this.legendPress;this.legendPress=null;const s=e.target;t&&!t.el.isConnected&&F(s)&&s.getAttribute("rel")===t.rel&&(this.recoveredRel=t.rel,this.onLegendClick(e))}onLegendClickEvent(e){const t=this.recoveredRel;this.recoveredRel=null;const s=e.target;null!==t&&e.isTrusted&&s.getAttribute("rel")===t||this.onLegendClick(e)}onLegendClick(e){var t;const s=this.w,i=e.target;if(!s.config.legend.customLegendItems.length&&F(i)){const e=parseInt(null!=(t=i.getAttribute("rel"))?t:"0",10)-1,n="true"===i.getAttribute("data:collapsed"),r=this.w.config.chart.events.legendClick;"function"==typeof r&&r(this.ctx,e,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,e,this.w]);const l=this.w.config.legend.markers.onClick;"function"==typeof l&&i.classList.contains("apexcharts-legend-marker")&&(l(this.ctx,e,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,e,this.w]));"treemap"!==s.config.chart.type&&"heatmap"!==s.config.chart.type&&!this.isBarsDistributed&&s.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(e,n)}}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>d.default});
5
+ "use strict";var e=Object.defineProperty,t=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,r=(t,i,s)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[i]=s,a=(e,t)=>{for(var i in t||(t={}))n.call(t,i)&&r(e,i,t[i]);if(s)for(var i of s(t))l.call(t,i)&&r(e,i,t[i]);return e},o=(e,s)=>t(e,i(s));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function c(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const i in e)if("default"!==i){const s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>e[i]})}return t.default=e,Object.freeze(t)}const d=c(require("apexcharts/core")),g=d.__apex_CoreUtils,h=d.__apex_dimensions_Dimensions,p=d.__apex_Graphics,u=d.__apex_Series,f=d.__apex_Utils,m=d.__apex_Environment_Environment;class b{constructor(e){this.w=e.w,this.lgCtx=e}getLegendStyles(){if(m.isSSR())return null;const e=document.createElement("style");e.setAttribute("type","text/css");const t=this.w.config.chart.nonce;t&&e.setAttribute("nonce",t);const i=document.createTextNode(".apexcharts-flip-y{transform:scaleY(-1) translateY(-100%);transform-origin:top;transform-box:fill-box}.apexcharts-flip-x{transform:scaleX(-1);transform-origin:center;transform-box:fill-box}.apexcharts-legend{display:flex;overflow:auto;padding:0 10px}.apexcharts-legend.apexcharts-legend-group-horizontal{flex-direction:column}.apexcharts-legend-group{display:flex}.apexcharts-legend-group-vertical{flex-direction:column-reverse}.apexcharts-legend.apx-legend-position-bottom,.apexcharts-legend.apx-legend-position-top{flex-wrap:wrap}.apexcharts-legend.apx-legend-position-right,.apexcharts-legend.apx-legend-position-left{flex-direction:column;bottom:0}.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left,.apexcharts-legend.apx-legend-position-top.apexcharts-align-left,.apexcharts-legend.apx-legend-position-right,.apexcharts-legend.apx-legend-position-left{justify-content:flex-start;align-items:flex-start}.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center,.apexcharts-legend.apx-legend-position-top.apexcharts-align-center{justify-content:center;align-items:center}.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right,.apexcharts-legend.apx-legend-position-top.apexcharts-align-right{justify-content:flex-end;align-items:flex-end}.apexcharts-legend-series{cursor:pointer;line-height:normal;display:flex;align-items:center}.apexcharts-legend-text{position:relative;font-size:14px}.apexcharts-legend-text *,.apexcharts-legend-marker *{pointer-events:none}.apexcharts-legend-marker{position:relative;display:flex;align-items:center;justify-content:center;cursor:pointer;margin-right:1px}.apexcharts-legend-series.apexcharts-no-click{cursor:auto}.apexcharts-legend .apexcharts-hidden-zero-series,.apexcharts-legend .apexcharts-hidden-null-series{display:none!important}.apexcharts-inactive-legend{opacity:.45}");return e.appendChild(i),e}getLegendDimensions(){const e=this.w.dom.baseEl.querySelector(".apexcharts-legend");if(!e)return{clwh:0,clww:0};const{width:t,height:i}=e.getBoundingClientRect();return{clwh:i,clww:t}}appendToForeignObject(){var e;const t=this.getLegendStyles();!1!==this.w.config.chart.injectStyleSheet&&t&&(null==(e=this.w.dom.elLegendForeign)||e.appendChild(t))}toggleDataSeries(e,t){var i,s,n;const l=this.w;if(l.dom.baseEl)if(l.globals.axisCharts||"radialBar"===l.config.chart.type){l.globals.resized=!0;let r=null,a=null;if(l.globals.risingSeries=[],l.globals.axisCharts){if(r=null!=(i=Array.prototype.find.call(l.dom.baseEl.querySelectorAll(".apexcharts-series"),t=>t.getAttribute("data:realIndex")===String(e)))?i:null,!r)return;a=parseInt(null!=(s=r.getAttribute("data:realIndex"))?s:"",10)}else{if(r=l.dom.baseEl.querySelector(`.apexcharts-series[rel='${e+1}']`),!r)return;a=parseInt(null!=(n=r.getAttribute("rel"))?n:"",10)-1}if(t){[{cs:l.globals.collapsedSeries,csi:l.globals.collapsedSeriesIndices},{cs:l.globals.ancillaryCollapsedSeries,csi:l.globals.ancillaryCollapsedSeriesIndices}].forEach(e=>{const t=e.cs,i=e.csi;this.riseCollapsedSeries(t,i,a)})}else this.hideSeries({seriesEl:r,realIndex:a});if(l.config.chart.accessibility.enabled){const t=l.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${e+1}"]`);if(t){const i=l.globals.collapsedSeriesIndices.includes(a)||l.globals.ancillaryCollapsedSeriesIndices.includes(a);t.setAttribute("aria-pressed",i?"true":"false");const s=t.querySelector(".apexcharts-legend-text"),n=s?s.textContent:l.seriesData.seriesNames[e],r=i?"hidden":"visible";t.setAttribute("aria-label",`${n}, ${r}. Press Enter or Space to toggle.`)}}}else{if(l.globals.resized=!0,l.globals.risingSeries=[],t)this.riseCollapsedSeries(l.globals.collapsedSeries,l.globals.collapsedSeriesIndices,e);else{const t=this.getSeriesAfterCollapsing({realIndex:e});this.lgCtx.updateSeries(t,l.config.chart.animations.dynamicAnimation.enabled)}if(l.config.chart.accessibility.enabled){const t=l.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${e+1}"]`);if(t){const i=l.globals.collapsedSeriesIndices.includes(e);t.setAttribute("aria-pressed",i?"true":"false");const s=t.querySelector(".apexcharts-legend-text"),n=s?s.textContent:l.seriesData.seriesNames[e],r=i?"hidden":"visible";t.setAttribute("aria-label",`${n}, ${r}. Press Enter or Space to toggle.`)}}}}_nonAxisSliceContainer(e){const t=this.w.config.chart.type;return("pie"===t||"donut"===t||"polarArea"===t||"sunburst"===t||"icicle"===t)&&1===e.length&&e[0]&&"object"==typeof e[0]&&Array.isArray(e[0].data)?e[0].data:e}_readSliceValue(e){return"unit"===this.w.config.chart.type&&e&&Array.isArray(e.data)?e.data:e&&"object"==typeof e?e.y:e}_writeSliceValue(e,t,i){const s=e[t];"unit"===this.w.config.chart.type&&s&&Array.isArray(s.data)?s.data=Array.isArray(i)?i:[]:s&&"object"==typeof s?s.y=i:e[t]=i}getSeriesAfterCollapsing({realIndex:e}){var t,i;const s=this.w,n=s.globals,l=f.clone(s.config.series);if(n.axisCharts){const t=s.config.yaxis[n.seriesYAxisReverseMap[e]],i={index:e,data:l[e].data.slice(),type:l[e].type||s.config.chart.type,name:(n.seriesNames||[])[e]};if(t&&t.show&&t.showAlways)n.ancillaryCollapsedSeriesIndices.indexOf(e)<0&&(n.ancillaryCollapsedSeries.push(i),n.ancillaryCollapsedSeriesIndices.push(e));else if(n.collapsedSeriesIndices.indexOf(e)<0){n.collapsedSeries.push(i),n.collapsedSeriesIndices.push(e);const t=n.risingSeries.indexOf(e);n.risingSeries.splice(t,1)}}else if(n.collapsedSeriesIndices.indexOf(e)<0){const r=this._nonAxisSliceContainer(l);n.collapsedSeries.push({index:e,data:this._readSliceValue(r[e]),type:null!=(i=null==(t=s.config.series[e])?void 0:t.type)?i:"line",name:(n.seriesNames||[])[e]}),n.collapsedSeriesIndices.push(e)}const r=n.axisCharts?s.config.series.length:this._nonAxisSliceContainer(l).length;return n.allSeriesCollapsed=n.collapsedSeries.length+n.ancillaryCollapsedSeries.length===r,this._getSeriesBasedOnCollapsedState(l)}hideSeries({seriesEl:e,realIndex:t}){const i=this.w,s=this.getSeriesAfterCollapsing({realIndex:t}),n=e.childNodes;for(let e=0;e<n.length;e++)n[e].classList.contains("apexcharts-series-markers-wrap")&&(n[e].classList.contains("apexcharts-hide")?n[e].classList.remove("apexcharts-hide"):n[e].classList.add("apexcharts-hide"));const l=i.config.chart.animations.dynamicAnimation.enabled;l&&(i.globals.collapsingSeriesIndices=[t]);const r=()=>{i.globals.collapsingSeriesIndices=[]},a=this.lgCtx.updateSeries(s,l);r(),a&&"function"==typeof a.then&&a.then(r,r)}riseCollapsedSeries(e,t,i){const s=this.w;let n=f.clone(s.config.series);if(e.length>0){for(let l=0;l<e.length;l++)if(e[l].index===i){if(s.globals.axisCharts)n[i].data=e[l].data.slice(),n[i].hidden=!1;else{const t=this._nonAxisSliceContainer(n);this._writeSliceValue(t,i,e[l].data)}e.splice(l,1),t.splice(l,1),s.globals.risingSeries.push(i),l--}n=this._getSeriesBasedOnCollapsedState(n);const l=this.lgCtx.updateSeries(n,s.config.chart.animations.dynamicAnimation.enabled),r=()=>{s.globals.risingSeries=[]};l&&"function"==typeof l.then?l.then(r,r):r()}}_getSeriesBasedOnCollapsedState(e){const t=this.w;let i=0;if(t.globals.axisCharts)e.forEach((s,n)=>{t.globals.collapsedSeriesIndices.indexOf(n)<0&&t.globals.ancillaryCollapsedSeriesIndices.indexOf(n)<0||(e[n].data=[],i++)});else{const s=this._nonAxisSliceContainer(e);s.forEach((e,n)=>{t.globals.collapsedSeriesIndices.indexOf(n)<0||(this._writeSliceValue(s,n,0),i++)})}const s=t.globals.axisCharts?e.length:this._nonAxisSliceContainer(e).length;return t.globals.allSeriesCollapsed=i===s,e}}const x=d.__apex_BrowserAPIs_BrowserAPIs,y=["#cf4d3f","#8f9499","#26a75b"],v=(e,t,i)=>e+(t-e)*i;function S(e){return Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0")}function w(e,t,i){const s=f.parseHex(A(e)),n=f.parseHex(A(t));return s&&n?"#"+S(v(s[0],n[0],i))+S(v(s[1],n[1],i))+S(v(s[2],n[2],i)):e}function A(e){if("string"!=typeof e)return"#000000";if(f.isColorHex(e))return e;return f.rgb2hex(e)||"#000000"}function _(e,t,i,s){var n,l,r;if(!t||"object"!=typeof t)return null;const a=null==(r=null==(l=null==(n=e.config.plotOptions)?void 0:n.treemap)?void 0:l.colorScale)?void 0:r.colorValue;let o;if(o="function"==typeof a?a(t,{seriesIndex:i,dataPointIndex:s,w:e}):"string"==typeof a?t[a]:t.colorValue,null==o)return null;const c=Number(o);return Number.isFinite(c)?c:null}function L(e){var t,i,s;const n=null==(s=null==(i=null==(t=e.config)?void 0:t.plotOptions)?void 0:i.treemap)?void 0:s.colorScale,l=n&&n.gradient;if(!l)return null;if(!1===l.enabled)return null;const r=e.config.series||[];let a=1/0,o=-1/0,c=!1;for(let t=0;t<r.length;t++){const i=r[t]&&r[t].data;if(Array.isArray(i))for(let s=0;s<i.length;s++){const n=_(e,i[s],t,s);null!=n&&(c=!0,n<a&&(a=n),n>o&&(o=n))}}if(!c&&!0!==l.enabled)return null;Number.isFinite(a)||(a=0,o=0);let d=Number.isFinite(Number(l.min))?Number(l.min):a,g=Number.isFinite(Number(l.max))?Number(l.max):o,h=null;if(null===l.midpoint?h=null:Number.isFinite(Number(l.midpoint))?h=Number(l.midpoint):d<0&&g>0&&(h=0),null!=h&&!1!==l.symmetric&&!Number.isFinite(Number(l.min))&&!Number.isFinite(Number(l.max))){const e=Math.max(Math.abs(d-h),Math.abs(g-h));d=h-e,g=h+e}g===d&&(d-=.5,g+=.5);const p=function(e,t,i,s){if(Array.isArray(e.stops)&&e.stops.length>=2)return e.stops.filter(e=>e&&Number.isFinite(Number(e.value))).map(e=>({value:Number(e.value),color:A(e.color)})).sort((e,t)=>e.value-t.value);const n=(Array.isArray(e.colors)&&e.colors.length>=2?e.colors:y).map(A),l=n.length;if(null!=s&&l>=3){const e=Math.floor((l-1)/2),r=[];for(let i=0;i<=e;i++)r.push({value:v(t,s,i/e),color:n[i]});for(let t=e+1;t<l;t++)r.push({value:v(s,i,(t-e)/(l-1-e)),color:n[t]});return r}return n.map((e,s)=>({value:v(t,i,s/(l-1)),color:e}))}(l,d,g,h);if(p.length<2)return null;const u=g-d,f=p.map(e=>({percent:0===u?0:(e.value-d)/u,color:e.color}));return{min:d,max:g,midpoint:h,stops:p,at:e=>{if(!Number.isFinite(e))return p[Math.floor(p.length/2)].color;if(e<=p[0].value)return p[0].color;const t=p[p.length-1];if(e>=t.value)return t.color;for(let t=1;t<p.length;t++){const i=p[t];if(e<=i.value){const s=p[t-1],n=i.value-s.value,l=0===n?0:(e-s.value)/n;return w(s.color,i.color,l)}}return t.color},legendStops:f}}const E=d.__apex_tooltip_Utils,C="http://www.w3.org/2000/svg";class k{constructor(e,t){this.w=e,this.ctx=t,this.svgEl=null,this.arrowEl=null,this.hoverValueEl=null,this._min=0,this._max=0,this._geom=null,this._grad=null,this._bandHitEls=[],this._activeBandIndex=-1,this._targetEl=null,this.panelsW=null,this._onCellEnter=this._onCellEnter.bind(this),this._onCellLeave=this._onCellLeave.bind(this),this._onBandEnter=this._onBandEnter.bind(this),this._onBandLeave=this._onBandLeave.bind(this)}_getFormatter(){const e=this._cfg();return"function"==typeof e.formatter?e.formatter:e=>{if(!Number.isFinite(e))return String(e);const t=Math.abs(e);return t>=1e3?e.toFixed(0):t>=10?e.toFixed(1):e.toFixed(2)}}static colorScaleOf(e){var t,i,s,n,l;const r=null==(i=null==(t=null==e?void 0:e.config)?void 0:t.chart)?void 0:i.type;return r&&(null==(l=null==(n=null==(s=null==e?void 0:e.config)?void 0:s.plotOptions)?void 0:n[r])?void 0:l.colorScale)||null}static configFor(e){const t=k.colorScaleOf(e);return t&&t.gradientLegend||null}_cfg(){return k.configFor(this.w)||{}}static isEnabled(e){if(!k.supports(e))return!1;const t=k.configFor(e);return!(!t||!t.enabled)}static supports(e){var t,i;const s=null==(i=null==(t=null==e?void 0:e.config)?void 0:t.chart)?void 0:i.type;return"heatmap"===s||"treemap"===s}draw(e=null){var t,i,s,n,l,r,a,o;const c=this.w;this._targetEl=e;const d=e||c.dom.elLegendWrap;if(!d)return;const g=this._cfg(),h=c.config.legend.position,p="left"===h||"right"===h,u=null!=(i=null==(t=g.arrow)?void 0:t.size)?i:8,f=u+4,m=g.showLabels?28:4,b=g.showLabels?20:4,y=g.showLabels?44:0,v=this._resolveStripLength(p?g.height:g.width,p),S=g.thickness,w=p?Math.max(S+f+4,y):v+2*m,A=p?v+2*b:S+f+4,_=(w-(S+f))/2,L=p?"left"===h?_:_+f:m,E=p?b:"top"===h?f:4,k=x.createElementNS(C,"svg");k.setAttribute("class","apexcharts-heatmap-gradient-legend apexcharts-gradient-legend"),k.setAttribute("width",String(w)),k.setAttribute("height",String(A)),k.setAttribute("overflow","visible");const I=x.createElementNS(C,"defs"),F=`apexcharts-heatmap-gradient-${c.globals.cuid}`,H=x.createElementNS(C,"linearGradient");H.setAttribute("id",F),p?(H.setAttribute("x1","0"),H.setAttribute("y1","1"),H.setAttribute("x2","0"),H.setAttribute("y2","0")):(H.setAttribute("x1","0"),H.setAttribute("y1","0"),H.setAttribute("x2","1"),H.setAttribute("y2","0")),this._grad=H;const{min:N,max:M,bands:O}=this._paintStops();I.appendChild(H),k.appendChild(I);const B=x.createElementNS(C,"rect");if(B.setAttribute("x",String(L)),B.setAttribute("y",String(E)),B.setAttribute("width",String(p?S:v)),B.setAttribute("height",String(p?v:S)),B.setAttribute("rx","2"),B.setAttribute("fill",`url(#${F})`),k.appendChild(B),g.showLabels){const e=(null==(s=g.labelStyle)?void 0:s.colors)||(Array.isArray(c.config.legend.labels.colors)?c.config.legend.labels.colors[0]:c.config.legend.labels.colors)||c.config.chart.foreColor,t=(null==(n=g.labelStyle)?void 0:n.fontSize)||"11px",i=(null==(l=g.labelStyle)?void 0:l.fontFamily)||c.config.chart.fontFamily,r=this._getFormatter(),a=(s,n,l,r)=>{const a=x.createElementNS(C,"text");return a.setAttribute("x",String(n)),a.setAttribute("y",String(l)),a.setAttribute("text-anchor",r),a.setAttribute("dominant-baseline","middle"),a.setAttribute("fill",e),a.setAttribute("font-size",t),i&&a.setAttribute("font-family",i),a.textContent=String(s),a};if(p){const e=L+S/2;k.appendChild(a(r(N),e,E+v+10,"middle")),k.appendChild(a(r(M),e,E-10,"middle"))}else{const e=E+S/2;k.appendChild(a(r(N),L-6,e,"end")),k.appendChild(a(r(M),L+v+6,e,"start"))}}const D=(null==(r=g.arrow)?void 0:r.color)||c.config.chart.foreColor,P=this._buildArrow(u,D,h);if(k.appendChild(P),this.arrowEl=P,this._bandHitEls=[],c.config.legend.onItemHover.highlightDataSeries&&O.length>0&&O.forEach(e=>{const t=x.createElementNS(C,"rect");if(p){const i=E+v-e.p2*v,s=E+v-e.p1*v;t.setAttribute("x",String(L)),t.setAttribute("y",String(i)),t.setAttribute("width",String(S)),t.setAttribute("height",String(Math.max(0,s-i)))}else t.setAttribute("x",String(L+e.p1*v)),t.setAttribute("y",String(E)),t.setAttribute("width",String(Math.max(0,(e.p2-e.p1)*v))),t.setAttribute("height",String(S));t.setAttribute("fill","transparent"),t.setAttribute("class","apexcharts-heatmap-gradient-band"),t.setAttribute("data:range-index",String(e.index)),t.style.cursor="pointer",k.appendChild(t),this._bandHitEls.push(t)}),this._geom={isVertical:p,position:h,stripX:L,stripY:E,stripLength:v,stripThickness:S,arrowSize:u,svgWidth:w,svgHeight:A},g.showHoverValue){const e=x.createElement("div");e.classList.add("apexcharts-heatmap-gradient-legend-value"),e.style.position="absolute",e.style.fontSize=(null==(a=g.labelStyle)?void 0:a.fontSize)||"11px",e.style.fontFamily=(null==(o=g.labelStyle)?void 0:o.fontFamily)||c.config.chart.fontFamily||"",e.style.color=c.config.chart.foreColor,e.style.background="rgba(0,0,0,0.65)",e.style.color="#fff",e.style.padding="2px 6px",e.style.borderRadius="3px",e.style.pointerEvents="none",e.style.whiteSpace="nowrap",e.style.opacity="0",e.style.transition="opacity 120ms ease",this.hoverValueEl=e}d.classList.add("apexcharts-heatmap-gradient-legend-wrap"),d.classList.add("apx-legend-position-"+h),d.appendChild(k),this.hoverValueEl&&d.appendChild(this.hoverValueEl),this.svgEl=k,e?(d.style.width=w+"px",d.style.height=A+"px",d.style.position="relative",d.style.overflow="visible"):this._applyWrapAlignment(d,h,p,w,A),this._attachHoverListeners(),this._attachBandHoverListeners()}_resolveStripLength(e,t){const i=this.w,s=t?i.globals.svgHeight||i.config.chart.height||300:i.globals.svgWidth||i.config.chart.width||600;if("string"==typeof e){const t=e.trim();if(t.endsWith("%")){const e=parseFloat(t)||0;return Math.max(20,s*e/100)}const i=parseFloat(t);return Number.isFinite(i)?i:200}return"number"==typeof e&&Number.isFinite(e)?e:200}_applyWrapAlignment(e,t,i,s,n){const l=this.w,r=this._cfg().align||"center",a=12,o=l.globals.svgWidth||l.config.chart.width||600,c=l.globals.svgHeight||l.config.chart.height||300,d=l.config.legend.offsetX||0,g=l.config.legend.offsetY||0;if(e.style.position="absolute",e.style.display="block",e.style.overflow="visible",e.style.padding="0",e.style.width=s+"px",e.style.height=n+"px",e.style.right="auto",e.style.bottom="auto",i){const i=c-n-24;let l;l="start"===r?a:"end"===r?a+Math.max(0,i):a+Math.max(0,i)/2,e.style.top=l+g+"px",e.style.left="left"===t?a+d+"px":o-s-a+d+"px"}else{const i=o-s-24;let l;l="start"===r?a:"end"===r?a+Math.max(0,i):a+Math.max(0,i)/2,e.style.left=l+d+"px",e.style.top="top"===t?a+g+"px":c-n-a+g+"px"}}repositionToPlot(){var e,t;if(this._grad&&this._paintStops(),!m.isBrowser())return;if(this._targetEl)return;const i=this.w,s=i.globals,n=i.dom.elLegendWrap;if(!n||!this._geom)return;if(!Number.isFinite(s.gridWidth)||!Number.isFinite(s.gridHeight))return;const{isVertical:l,position:r,svgWidth:a,svgHeight:o,stripX:c,stripY:d,stripThickness:g}=this._geom,h=this._cfg().align||"center",p=i.config.legend.offsetX||0,u=i.config.legend.offsetY||0,f=null==(t=null==(e=this.ctx)?void 0:e.dimensions)?void 0:t.dimHelpers,b=f?f.getTitleSubtitleCoords("title").height+f.getTitleSubtitleCoords("subtitle").height:0,y=i.layout.xAxisHeight||0,v=(e,t)=>{const i=Math.max(0,e-t);return"start"===h?0:"end"===h?i:i/2};if(l){n.style.top=s.translateY+v(s.gridHeight,o)+u+"px";const e=(("left"===r?0:s.translateX+s.gridWidth)+("left"===r?s.translateX:s.svgWidth))/2;n.style.left=e-c-g/2+p+"px"}else{n.style.left=s.translateX+v(s.gridWidth,a)+p+"px";const e=(("top"===r?b:s.translateY+s.gridHeight+y)+("top"===r?s.translateY:s.svgHeight))/2;n.style.top=e-d-g/2+u+"px"}x.requestAnimationFrame(()=>this._enforceMinPlotGap())}_enforceMinPlotGap(){const e=this.w,t=e.dom.elLegendWrap,i=this.svgEl&&this.svgEl.querySelector("rect");if(!t||!i||!this._geom)return;if(!e.dom.baseEl||!e.dom.baseEl.querySelector(".apexcharts-svg"))return;const s=i.getBoundingClientRect(),n=E.plotRect(e);if(!(s.width&&s.height&&n.width&&n.height))return;const l=n.left,r=n.left+n.width,a=n.top,o=n.top+n.height,c=n.zoom,{isVertical:d,position:g}=this._geom;if(d){const e=("left"===g?l-s.right:s.left-r)/c;if(e<16){const i=parseFloat(t.style.left)||0,s=16-e;t.style.left=i+("left"===g?-s:s)+"px"}}else{const e=("top"===g?a-s.bottom:s.top-o)/c;if(e<16){const i=parseFloat(t.style.top)||0,s=16-e;t.style.top=i+("top"===g?-s:s)+"px"}}}destroy(){var e,t,i,s,n,l,r;for(let i=0;i<this._bandHitEls.length;i++){const s=this._bandHitEls[i];null==(e=s.removeEventListener)||e.call(s,"mousemove",this._onBandEnter),null==(t=s.removeEventListener)||t.call(s,"mouseout",this._onBandLeave)}if(this._bandHitEls=[],this._activeBandIndex=-1,null==(i=this.ctx)?void 0:i.events)try{null==(n=(s=this.ctx.events).removeEventListener)||n.call(s,"dataPointMouseEnter",this._onCellEnter),null==(r=(l=this.ctx.events).removeEventListener)||r.call(l,"dataPointMouseLeave",this._onCellLeave)}catch(e){}}_attachBandHoverListeners(){if(m.isBrowser())for(let e=0;e<this._bandHitEls.length;e++){const t=this._bandHitEls[e];t.addEventListener("mousemove",this._onBandEnter),t.addEventListener("mouseout",this._onBandLeave)}}_onBandEnter(e){var t,i,s,n;const l=this.w,r=e.currentTarget,a=parseInt(null!=(t=r.getAttribute("data:range-index"))?t:"-1",10);a<0||a===this._activeBandIndex||(this._activeBandIndex=a,null==(n=null==(s=null==(i=this.ctx)?void 0:i.events)?void 0:s.fireEvent)||n.call(s,"legendHover",[this.ctx,a,l]),this._highlightRange(a,"highlight"))}_onBandLeave(){if(this._activeBandIndex<0)return;const e=this._activeBandIndex;this._activeBandIndex=-1,this._highlightRange(e,"reset")}_highlightRange(e,t){var i;((null==(i=this.panelsW)?void 0:i.call(this))||[this.w]).forEach(i=>new u(i).highlightRangeInSeries(e,t))}_attachHoverListeners(){var e,t;m.isBrowser()&&(null==(t=null==(e=this.ctx)?void 0:e.events)?void 0:t.addEventListener)&&(this.ctx.events.addEventListener("dataPointMouseEnter",this._onCellEnter),this.ctx.events.addEventListener("dataPointMouseLeave",this._onCellLeave))}_onCellEnter(...e){var t,i,s;if(!this.arrowEl)return;const n=e[e.length-1];if(!n||"object"!=typeof n)return;const l=n.w||this.w,r=n.seriesIndex,a=n.dataPointIndex;if("number"!=typeof r||"number"!=typeof a)return;if(!k.supports(l))return;let o;o=this._continuous?function(e,t,i){const s=e.config.series[t];return _(e,s&&Array.isArray(s.data)?s.data[i]:null,t,i)}(l,r,a):null==(s=null==(i=null==(t=l.seriesData)?void 0:t.series)?void 0:i[r])?void 0:s[a],null==o||Number.isNaN(o)||this._positionArrow(o)}_onCellLeave(){this.arrowEl&&(this.arrowEl.setAttribute("opacity","0"),this.hoverValueEl&&(this.hoverValueEl.style.opacity="0"))}_positionArrow(e){if(!this.arrowEl||!this._geom)return;const{isVertical:t,position:i,stripX:s,stripY:n,stripLength:l,stripThickness:r,arrowSize:a}=this._geom,o=this._min,c=this._max-o;let d;if(d=0===c?.5:(e-o)/c,d<0&&(d=0),d>1&&(d=1),t){const e=n+l-d*l;let t,o;"left"===i?(t=s+r,o=t+a):(t=s,o=t-a);const c=[`${t},${e}`,`${o},${e-a/2}`,`${o},${e+a/2}`].join(" ");this.arrowEl.setAttribute("points",c)}else{const e=s+d*l;let t,o;"top"===i?(t=n+r,o=t+a):(t=n,o=t-a);const c=[`${e},${t}`,`${e-a/2},${o}`,`${e+a/2},${o}`].join(" ");this.arrowEl.setAttribute("points",c)}if(this.arrowEl.setAttribute("opacity","1"),this.hoverValueEl){const o=this._getFormatter();if(this.hoverValueEl.textContent=o(e),t){const e=n+l-d*l;"left"===i?this.hoverValueEl.style.left=`${s+r+a+8}px`:(this.hoverValueEl.style.left=s-a-8+"px",this.hoverValueEl.style.transform="translateX(-100%)"),this.hoverValueEl.style.top=e-9+"px"}else{const e=s+d*l;this.hoverValueEl.style.left=`${e}px`,this.hoverValueEl.style.transform="translateX(-50%)",this.hoverValueEl.style.top="top"===i?`${n+r+a+8}px`:n-a-18+"px"}this.hoverValueEl.style.opacity="1"}}_buildArrow(e,t,i){const s=x.createElementNS(C,"polygon");return s.setAttribute("fill",t),s.setAttribute("opacity","0"),s.setAttribute("class","apexcharts-heatmap-gradient-arrow"),s.setAttribute("points","0,0 0,0 0,0"),s.setAttribute("pointer-events","none"),s}_paintStops(){const e=this._computeStops(),t=this._grad;return this._min=e.min,this._max=e.max,t.innerHTML="",e.stops.forEach(e=>{const i=x.createElementNS(C,"stop");i.setAttribute("offset",`${(100*e.percent).toFixed(2)}%`),i.setAttribute("stop-color",e.color),t.appendChild(i)}),e}_computeStops(){var e,t;const i=this.w,s=k.colorScaleOf(i)||{},n=this._cfg(),l=L(i);if(l)return this._continuous=!0,{min:l.min,max:l.max,stops:l.legendStops,bands:[]};this._continuous=!1;let r=1/0,c=-1/0;const d=(null==(e=i.seriesData)?void 0:e.series)||[];for(let e=0;e<d.length;e++){const t=d[e];if(t)for(let e=0;e<t.length;e++){const i=t[e];null==i||Number.isNaN(i)||(i<r&&(r=i),i>c&&(c=i))}}Number.isFinite(r)||(r=0),Number.isFinite(c)||(c=0);let g=r,h=c;const p=void 0!==s.min&&void 0!==s.max&&s.max>s.min;p?(g=s.min,h=s.max):(void 0!==s.min&&(g=s.min<r?s.min:r),void 0!==s.max&&(h=s.max>c?s.max:c));const u=[],m=[];if(s.ranges&&s.ranges.length>0){const e=s.ranges.map((e,t)=>o(a({},e),{_originalIndex:t})).sort((e,t)=>e.from-t.from),t=e[0].from,i=e[e.length-1].to;g=t,h=i;const n=i-t||1;e.forEach(e=>{const i=(e.from-t)/n,s=(e.to-t)/n;u.push({percent:(i+s)/2,color:e.color}),m.push({index:e._originalIndex,p1:i,p2:s})})}else{const e=i.globals.colors[0]||"#008FFB",l=new f,r=i.config.chart.type,a=i.config.plotOptions[r]||{},o=null!=(t=a.shadeIntensity)?t:.5,c=i.globals,d=c.hasNegs,m="heatmap"===r&&!a.distributed&&!p&&c.maxY>=c.minY,b=m?c.maxY:h,x=Math.abs(b)+Math.abs(m?s.min<c.minY?s.min:c.minY:g),y=1.25*o,v=Math.max(2,n.stops||16);for(let t=0;t<v;t++){const s=t/(v-1),n=0===x?0:Math.min(g+s*(h-g),b)/x,c=Math.max(-1,Math.min(1,d?a.reverseNegativeShade?(n<0?n:1-n)*y:n<=0?1-(1+n)*o:(1-n)*o:(1-n)*("treemap"===r?y:1))),p=a.enableShades?l.shadeColor("dark"===i.config.theme.mode?-c:c,e):e;u.push({percent:s,color:p})}}return{min:g,max:h,stops:u,bands:m}}}const I=d.__apex_Markers;function F(e){return e.classList.contains("apexcharts-legend-series")||e.classList.contains("apexcharts-legend-text")||e.classList.contains("apexcharts-legend-marker")}d.default.registerFeatures({legend:class{constructor(e,t){this.w=e,this.ctx=t,this.updateSeries=(...e)=>t.updateHelpers._updateSeries(...e),this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.onLegendClickEvent=this.onLegendClickEvent.bind(this),this.onLegendPointerDown=this.onLegendPointerDown.bind(this),this.onLegendPointerUp=this.onLegendPointerUp.bind(this),this.legendPress=null,this.recoveredRel=null,this.isBarsDistributed="bar"===this.w.config.chart.type&&this.w.config.plotOptions.bar.distributed&&1===this.w.config.series.length,this.legendHelpers=new b(this)}init(){var e;const t=this.w,i=t.globals,s=t.config;null==(e=this.heatmapGradientLegend)||e.destroy(),this.heatmapGradientLegend=null,this.isBarsDistributed="bar"===s.chart.type&&s.plotOptions.bar.distributed&&1===s.series.length;const n=s.legend.showForSingleSeries&&1===this.w.seriesData.series.length||this.isBarsDistributed||"heatmap"===s.chart.type||k.isEnabled(t)||this.w.seriesData.series.length>1;if(this.legendHelpers.appendToForeignObject(),(n||!i.axisCharts)&&s.legend.show){const e=t.dom.elLegendWrap;for(;e.firstChild;)e.removeChild(e.firstChild);k.isEnabled(t)?(this.heatmapGradientLegend=new k(t,this.ctx),this.heatmapGradientLegend.draw()):(this.drawLegends(),"bottom"===s.legend.position||"top"===s.legend.position?this.legendAlignHorizontal():"right"!==s.legend.position&&"left"!==s.legend.position||this.legendAlignVertical())}}createLegendMarker({i:e,fillcolor:t}){const i=this.w,s=x.createElement("span");s.classList.add("apexcharts-legend-marker");const n=i.config.legend.markers.shape||i.config.markers.shape;let l=n;Array.isArray(n)&&(l=n[e]);const r=Array.isArray(i.config.legend.markers.size)?parseFloat(i.config.legend.markers.size[e]):parseFloat(i.config.legend.markers.size),c=Array.isArray(i.config.legend.markers.offsetX)?parseFloat(i.config.legend.markers.offsetX[e]):parseFloat(i.config.legend.markers.offsetX),d=Array.isArray(i.config.legend.markers.offsetY)?parseFloat(i.config.legend.markers.offsetY[e]):parseFloat(i.config.legend.markers.offsetY),g=Array.isArray(i.config.legend.markers.strokeWidth)?parseFloat(i.config.legend.markers.strokeWidth[e]):parseFloat(i.config.legend.markers.strokeWidth),h=s.style;if(h.height=2*(r+g)+"px",h.width=2*(r+g)+"px",h.left=c+"px",h.top=d+"px",i.config.legend.markers.customHTML)h.background="transparent",h.color=t[e],Array.isArray(i.config.legend.markers.customHTML)?i.config.legend.markers.customHTML[e]&&(s.innerHTML=i.config.legend.markers.customHTML[e]()):s.innerHTML=i.config.legend.markers.customHTML();else{const i=new I(this.ctx.w,this.ctx).getMarkerConfig({cssClass:`apexcharts-legend-marker apexcharts-marker apexcharts-marker-${l}`,seriesIndex:e,strokeWidth:g,size:r}),n=(m.isBrowser()?window.SVG:global.SVG)().addTo(s).size("100%","100%"),c=new p(this.w).drawMarker(0,0,o(a({},i),{pointFillColor:Array.isArray(t)?t[e]:i.pointFillColor,shape:l}));c.node.style.transform="triangle"===l?"translate(50%, 45%)":"translate(50%, 50%)",n.add(c)}return s}drawLegends(){var e;const t=this,i=this.w,s=i.dom.elLegendWrap,n=i.config.legend.fontFamily;let l=i.seriesData.seriesNames,r=i.config.legend.markers.fillColors?i.config.legend.markers.fillColors.slice():i.globals.colors.slice();if("heatmap"===i.config.chart.type){const e=i.config.plotOptions.heatmap.colorScale.ranges;l=e.map(e=>e.name?e.name:e.from+" - "+e.to),r=e.map(e=>e.color)}else this.isBarsDistributed&&(l=i.labelData.labels.slice());i.config.legend.customLegendItems.length&&(l=i.config.legend.customLegendItems);const a=i.formatters.legendFormatter,o=i.config.legend.inverseOrder,c=[];i.labelData.seriesGroups.length>1&&i.config.legend.clusterGroupedSeries&&i.labelData.seriesGroups.forEach((e,t)=>{c[t]=x.createElement("div"),c[t].classList.add("apexcharts-legend-group",`apexcharts-legend-group-${t}`),"horizontal"===i.config.legend.clusterGroupedSeriesOrientation?s.classList.add("apexcharts-legend-group-horizontal"):c[t].classList.add("apexcharts-legend-group-vertical")});for(let t=o?l.length-1:0;o?t>=0:t<=l.length-1;o?t--:t++){const o=a(l[t],{seriesIndex:t,w:i});let d=!1,h=!1;if(i.globals.collapsedSeries.length>0)for(let e=0;e<i.globals.collapsedSeries.length;e++)i.globals.collapsedSeries[e].index===t&&(d=!0);if(i.globals.ancillaryCollapsedSeriesIndices.length>0)for(let e=0;e<i.globals.ancillaryCollapsedSeriesIndices.length;e++)i.globals.ancillaryCollapsedSeriesIndices[e]===t&&(h=!0);const u=this.createLegendMarker({i:t,fillcolor:r});p.setAttrs(u,{rel:t+1,"data:collapsed":d||h}),(d||h)&&u.classList.add("apexcharts-inactive-legend");const m=x.createElement("div");if(i.config.chart.accessibility.enabled&&i.config.chart.accessibility.keyboard.enabled){m.setAttribute("role","button"),m.setAttribute("tabindex","0");const e=Array.isArray(o)?o.join(" "):o,t=d||h,i=t?"hidden":"visible";m.setAttribute("aria-label",`${e}, ${i}. Press Enter or Space to toggle.`),m.setAttribute("aria-pressed",t?"true":"false")}const b=x.createElement("span");b.classList.add("apexcharts-legend-text"),b.innerHTML=Array.isArray(o)?o.join(" "):o;let y=i.config.legend.labels.useSeriesColors?i.globals.colors[t]:Array.isArray(i.config.legend.labels.colors)?null==(e=i.config.legend.labels.colors)?void 0:e[t]:i.config.legend.labels.colors;y||(y=i.config.chart.foreColor),b.style.color=y,b.style.fontSize=i.config.legend.fontSize,b.style.fontWeight=i.config.legend.fontWeight,b.style.fontFamily=n||i.config.chart.fontFamily,p.setAttrs(b,{rel:t+1,i:t,"data:default-text":encodeURIComponent(o),"data:collapsed":d||h}),m.appendChild(u),m.appendChild(b);const v=new g(this.w);if(!i.config.legend.showForZeroSeries){0===v.getSeriesTotalByIndex(t)&&v.seriesHaveSameValues(t)&&!v.isSeriesNull(t)&&-1===i.globals.collapsedSeriesIndices.indexOf(t)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(t)&&m.classList.add("apexcharts-hidden-zero-series")}i.config.legend.showForNullSeries||v.isSeriesNull(t)&&-1===i.globals.collapsedSeriesIndices.indexOf(t)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(t)&&m.classList.add("apexcharts-hidden-null-series");const S=c[i.labelData.seriesGroupIndex[t]];S&&!S.parentNode&&s.appendChild(S),(S||s).appendChild(m),s.classList.add(`apexcharts-align-${i.config.legend.horizontalAlign}`),s.classList.add("apx-legend-position-"+i.config.legend.position),m.classList.add("apexcharts-legend-series"),m.style.margin=`${i.config.legend.itemMargin.vertical}px ${i.config.legend.itemMargin.horizontal}px`,s.style.width=i.config.legend.width?i.config.legend.width+"px":"",s.style.height=i.config.legend.height?i.config.legend.height+"px":"",p.setAttrs(m,{rel:t+1,seriesName:f.escapeString(l[t]),"data:collapsed":d||h}),(d||h)&&m.classList.add("apexcharts-inactive-legend"),i.config.legend.onItemClick.toggleDataSeries||m.classList.add("apexcharts-no-click")}i.dom.elWrap.addEventListener("click",t.onLegendClickEvent,!0),i.dom.elWrap.addEventListener("pointerdown",t.onLegendPointerDown,!0),i.dom.elWrap.addEventListener("pointerup",t.onLegendPointerUp,!0),i.config.legend.onItemHover.highlightDataSeries&&0===i.config.legend.customLegendItems.length&&(i.dom.elWrap.addEventListener("mousemove",t.onLegendHovered,!0),i.dom.elWrap.addEventListener("mouseout",t.onLegendHovered,!0)),i.config.chart.accessibility.enabled&&i.config.chart.accessibility.keyboard.enabled&&i.dom.elWrap.addEventListener("keydown",t.onLegendKeyDown.bind(t),!0)}setLegendWrapXY(e,t){const i=this.w,s=i.dom.elLegendWrap,n=s.clientHeight;let l=0,r=0;if("bottom"===i.config.legend.position)r=i.globals.svgHeight-Math.min(n,i.globals.svgHeight/2)-5;else if("top"===i.config.legend.position){const e=new h(this.w,this.ctx),t=e.dimHelpers.getTitleSubtitleCoords("title").height,i=e.dimHelpers.getTitleSubtitleCoords("subtitle").height;r=(t>0?t-10:0)+(i>0?i-10:0)}s.style.position="absolute",l=l+e+i.config.legend.offsetX,r=r+t+i.config.legend.offsetY,s.style.left=l+"px",s.style.top=r+"px","right"===i.config.legend.position&&(s.style.left="auto",s.style.right=25+i.config.legend.offsetX+"px");["width","height"].forEach(e=>{s&&s.style[e]&&(s.style[e]=parseInt(String(i.config.legend[e]),10)+"px")})}legendAlignHorizontal(){const e=this.w;e.dom.elLegendWrap.style.right="0";const t=new h(this.w,this.ctx),i=t.dimHelpers.getTitleSubtitleCoords("title"),s=t.dimHelpers.getTitleSubtitleCoords("subtitle");let n=0;"top"===e.config.legend.position&&(n=i.height+s.height+e.config.title.margin+e.config.subtitle.margin-10),this.setLegendWrapXY(20,n)}legendAlignVertical(){this.setLegendWrapXY("left"===this.w.config.legend.position?20:0,20)}onLegendHovered(e){var t;const i=this.w,s=e.target,n=F(s);if("heatmap"===i.config.chart.type||this.isBarsDistributed){if(n){const i=parseInt(null!=(t=s.getAttribute("rel"))?t:"0",10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,i,this.w]);const n=new u(this.ctx.w);"mousemove"===e.type?n.highlightRangeInSeries(i,"highlight"):"mouseout"===e.type&&n.highlightRangeInSeries(i,"reset")}}else if(n&&!s.closest(".apexcharts-inactive-legend")){new u(this.ctx.w).toggleSeriesOnHover(e,s)}}onLegendKeyDown(e){const t=this,i=this.w,s=e.target;if(F(s)&&("Enter"===e.key||" "===e.key)){e.preventDefault();const n=s.getAttribute("rel");t.onLegendClick(e),null!==n&&i.config.legend.onItemClick.toggleDataSeries&&requestAnimationFrame(()=>{var e;const t=null==(e=i.dom.baseEl)?void 0:e.querySelector(`.apexcharts-legend-series[rel="${n}"]`);t&&t.focus()})}}onLegendPointerDown(e){const t=e.target;this.recoveredRel=null,this.legendPress=0===e.button&&F(t)?{el:t,rel:t.getAttribute("rel")}:null}onLegendPointerUp(e){const t=this.legendPress;this.legendPress=null;const i=e.target;t&&!t.el.isConnected&&F(i)&&i.getAttribute("rel")===t.rel&&(this.recoveredRel=t.rel,this.onLegendClick(e))}onLegendClickEvent(e){const t=this.recoveredRel;this.recoveredRel=null;const i=e.target;null!==t&&e.isTrusted&&i.getAttribute("rel")===t||this.onLegendClick(e)}onLegendClick(e){var t;const i=this.w,s=e.target;if(!i.config.legend.customLegendItems.length&&F(s)){const e=parseInt(null!=(t=s.getAttribute("rel"))?t:"0",10)-1,n="true"===s.getAttribute("data:collapsed"),l=this.w.config.chart.events.legendClick;"function"==typeof l&&l(this.ctx,e,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,e,this.w]);const r=this.w.config.legend.markers.onClick;"function"==typeof r&&s.classList.contains("apexcharts-legend-marker")&&(r(this.ctx,e,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,e,this.w]));"treemap"!==i.config.chart.type&&"heatmap"!==i.config.chart.type&&!this.isBarsDistributed&&i.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(e,n)}}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>d.default});
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * ApexCharts v8.2.0
21
+ * ApexCharts v8.3.0
22
22
  * (c) 2018-2026 ApexCharts
23
23
  */
24
24
  import * as _core from "apexcharts/core";
@@ -77,6 +77,7 @@ class Helpers {
77
77
  toggleDataSeries(seriesCnt, isHidden) {
78
78
  var _a, _b, _c;
79
79
  const w = this.w;
80
+ if (!w.dom.baseEl) return;
80
81
  if (w.globals.axisCharts || w.config.chart.type === "radialBar") {
81
82
  w.globals.resized = true;
82
83
  let seriesEl = null;
@@ -544,9 +545,11 @@ class HeatmapGradientLegend {
544
545
  this._min = 0;
545
546
  this._max = 0;
546
547
  this._geom = null;
548
+ this._grad = null;
547
549
  this._bandHitEls = [];
548
550
  this._activeBandIndex = -1;
549
551
  this._targetEl = null;
552
+ this.panelsW = null;
550
553
  this._onCellEnter = this._onCellEnter.bind(this);
551
554
  this._onCellLeave = this._onCellLeave.bind(this);
552
555
  this._onBandEnter = this._onBandEnter.bind(this);
@@ -661,15 +664,8 @@ class HeatmapGradientLegend {
661
664
  linearGrad.setAttribute("x2", "1");
662
665
  linearGrad.setAttribute("y2", "0");
663
666
  }
664
- const { min, max, stops, bands } = this._computeStops();
665
- this._min = min;
666
- this._max = max;
667
- stops.forEach((s) => {
668
- const stopEl = BrowserAPIs.createElementNS(SVG_NS, "stop");
669
- stopEl.setAttribute("offset", `${(s.percent * 100).toFixed(2)}%`);
670
- stopEl.setAttribute("stop-color", s.color);
671
- linearGrad.appendChild(stopEl);
672
- });
667
+ this._grad = linearGrad;
668
+ const { min, max, bands } = this._paintStops();
673
669
  defs.appendChild(linearGrad);
674
670
  svg.appendChild(defs);
675
671
  const rect = BrowserAPIs.createElementNS(SVG_NS, "rect");
@@ -878,6 +874,7 @@ class HeatmapGradientLegend {
878
874
  */
879
875
  repositionToPlot() {
880
876
  var _a, _b;
877
+ if (this._grad) this._paintStops();
881
878
  if (!Environment.isBrowser()) return;
882
879
  if (this._targetEl) return;
883
880
  const w = this.w;
@@ -1012,14 +1009,25 @@ class HeatmapGradientLegend {
1012
1009
  if (idx < 0 || idx === this._activeBandIndex) return;
1013
1010
  this._activeBandIndex = idx;
1014
1011
  (_d = (_c = (_b = this.ctx) == null ? void 0 : _b.events) == null ? void 0 : _c.fireEvent) == null ? void 0 : _d.call(_c, "legendHover", [this.ctx, idx, w]);
1015
- new Series(w).highlightRangeInSeries(idx, "highlight");
1012
+ this._highlightRange(idx, "highlight");
1016
1013
  }
1017
1014
  /** Leaving a band clears the highlight. */
1018
1015
  _onBandLeave() {
1019
1016
  if (this._activeBandIndex < 0) return;
1020
1017
  const idx = this._activeBandIndex;
1021
1018
  this._activeBandIndex = -1;
1022
- new Series(this.w).highlightRangeInSeries(idx, "reset");
1019
+ this._highlightRange(idx, "reset");
1020
+ }
1021
+ /**
1022
+ * A shared trellis strip sets `panelsW` so a band reaches every panel.
1023
+ * @param {number} idx
1024
+ * @param {'highlight'|'reset'} action
1025
+ */
1026
+ _highlightRange(idx, action) {
1027
+ var _a;
1028
+ (((_a = this.panelsW) == null ? void 0 : _a.call(this)) || [this.w]).forEach(
1029
+ (w) => new Series(w).highlightRangeInSeries(idx, action)
1030
+ );
1023
1031
  }
1024
1032
  _attachHoverListeners() {
1025
1033
  var _a, _b;
@@ -1041,10 +1049,10 @@ class HeatmapGradientLegend {
1041
1049
  */
1042
1050
  _onCellEnter(...args) {
1043
1051
  var _a, _b, _c;
1044
- const w = this.w;
1045
1052
  if (!this.arrowEl) return;
1046
1053
  const opts = args[args.length - 1];
1047
1054
  if (!opts || typeof opts !== "object") return;
1055
+ const w = opts.w || this.w;
1048
1056
  const i = opts.seriesIndex;
1049
1057
  const j = opts.dataPointIndex;
1050
1058
  if (typeof i !== "number" || typeof j !== "number") return;
@@ -1156,6 +1164,21 @@ class HeatmapGradientLegend {
1156
1164
  polygon.setAttribute("pointer-events", "none");
1157
1165
  return polygon;
1158
1166
  }
1167
+ /** (Re)write the strip's stops; returns `_computeStops()`. */
1168
+ _paintStops() {
1169
+ const r = this._computeStops();
1170
+ const grad = this._grad;
1171
+ this._min = r.min;
1172
+ this._max = r.max;
1173
+ grad.innerHTML = "";
1174
+ r.stops.forEach((s) => {
1175
+ const stopEl = BrowserAPIs.createElementNS(SVG_NS, "stop");
1176
+ stopEl.setAttribute("offset", `${(s.percent * 100).toFixed(2)}%`);
1177
+ stopEl.setAttribute("stop-color", s.color);
1178
+ grad.appendChild(stopEl);
1179
+ });
1180
+ return r;
1181
+ }
1159
1182
  /**
1160
1183
  * Build gradient stops + return effective min/max.
1161
1184
  * - If `colorScale.ranges` is set, stops are placed at each range boundary
@@ -1197,7 +1220,8 @@ class HeatmapGradientLegend {
1197
1220
  if (!Number.isFinite(dataMax)) dataMax = 0;
1198
1221
  let min = dataMin;
1199
1222
  let max = dataMax;
1200
- if (typeof cs.min !== "undefined" && typeof cs.max !== "undefined" && cs.max > cs.min) {
1223
+ const csWindow = typeof cs.min !== "undefined" && typeof cs.max !== "undefined" && cs.max > cs.min;
1224
+ if (csWindow) {
1201
1225
  min = cs.min;
1202
1226
  max = cs.max;
1203
1227
  } else {
@@ -1228,34 +1252,30 @@ class HeatmapGradientLegend {
1228
1252
  } else {
1229
1253
  const baseColor = w.globals.colors[0] || "#008FFB";
1230
1254
  const utils = new Utils();
1231
- const plot = w.config.plotOptions[w.config.chart.type] || {};
1255
+ const type = w.config.chart.type;
1256
+ const plot = w.config.plotOptions[type] || {};
1232
1257
  const shadeIntensity = (_b = plot.shadeIntensity) != null ? _b : 0.5;
1233
- const hasNegs = (
1258
+ const g = (
1234
1259
  /** @type {any} */
1235
- w.globals.hasNegs
1260
+ w.globals
1236
1261
  );
1262
+ const hasNegs = g.hasNegs;
1263
+ const yExt = type === "heatmap" && !plot.distributed && !csWindow && g.maxY >= g.minY;
1264
+ const hi = yExt ? g.maxY : max;
1265
+ const total = Math.abs(hi) + Math.abs(yExt ? cs.min < g.minY ? cs.min : g.minY : min);
1266
+ const k = shadeIntensity * 1.25;
1237
1267
  const n = Math.max(2, cfg.stops || 16);
1238
1268
  for (let s = 0; s < n; s++) {
1239
1269
  const t = s / (n - 1);
1240
- const v = min + t * (max - min);
1241
- const total = Math.abs(max) + Math.abs(min);
1242
- const percent_v = total === 0 ? 0 : 100 * v / total;
1243
- let colorShadePercent;
1244
- if (hasNegs) {
1245
- if (plot.reverseNegativeShade) {
1246
- colorShadePercent = percent_v < 0 ? percent_v / 100 * (shadeIntensity * 1.25) : (1 - percent_v / 100) * (shadeIntensity * 1.25);
1247
- } else {
1248
- colorShadePercent = percent_v <= 0 ? 1 - (1 + percent_v / 100) * shadeIntensity : (1 - percent_v / 100) * shadeIntensity;
1249
- }
1250
- } else {
1251
- colorShadePercent = 1 - percent_v / 100;
1252
- }
1253
- if (colorShadePercent > 1) colorShadePercent = 1;
1254
- if (colorShadePercent < -1) colorShadePercent = -1;
1255
- const shaded = plot.enableShades ? utils.shadeColor(
1256
- w.config.theme.mode === "dark" ? colorShadePercent * -1 : colorShadePercent,
1257
- baseColor
1258
- ) : baseColor;
1270
+ const p = total === 0 ? 0 : Math.min(min + t * (max - min), hi) / total;
1271
+ const c = Math.max(
1272
+ -1,
1273
+ Math.min(
1274
+ 1,
1275
+ hasNegs ? plot.reverseNegativeShade ? (p < 0 ? p : 1 - p) * k : p <= 0 ? 1 - (1 + p) * shadeIntensity : (1 - p) * shadeIntensity : (1 - p) * (type === "treemap" ? k : 1)
1276
+ )
1277
+ );
1278
+ const shaded = plot.enableShades ? utils.shadeColor(w.config.theme.mode === "dark" ? -c : c, baseColor) : baseColor;
1259
1279
  stops.push({ percent: t, color: shaded });
1260
1280
  }
1261
1281
  }
@@ -1286,9 +1306,12 @@ class Legend {
1286
1306
  this.legendHelpers = new Helpers(this);
1287
1307
  }
1288
1308
  init() {
1309
+ var _a;
1289
1310
  const w = this.w;
1290
1311
  const gl = w.globals;
1291
1312
  const cnf = w.config;
1313
+ (_a = this.heatmapGradientLegend) == null ? void 0 : _a.destroy();
1314
+ this.heatmapGradientLegend = null;
1292
1315
  this.isBarsDistributed = cnf.chart.type === "bar" && cnf.plotOptions.bar.distributed && cnf.series.length === 1;
1293
1316
  const showLegendAlways = cnf.legend.showForSingleSeries && this.w.seriesData.series.length === 1 || this.isBarsDistributed || // Heatmap legends are colorScale-driven (discrete ranges or the
1294
1317
  // gradient strip), not series-driven, so they must render even for a
@@ -1306,10 +1329,6 @@ class Legend {
1306
1329
  while (elLegendWrap.firstChild) {
1307
1330
  elLegendWrap.removeChild(elLegendWrap.firstChild);
1308
1331
  }
1309
- if (this.heatmapGradientLegend) {
1310
- this.heatmapGradientLegend.destroy();
1311
- this.heatmapGradientLegend = null;
1312
- }
1313
1332
  if (HeatmapGradientLegend.isEnabled(w)) {
1314
1333
  this.heatmapGradientLegend = new HeatmapGradientLegend(w, this.ctx);
1315
1334
  this.heatmapGradientLegend.draw();
@@ -1487,7 +1506,7 @@ class Legend {
1487
1506
  }
1488
1507
  }
1489
1508
  const lg = legendGroups[w.labelData.seriesGroupIndex[i]];
1490
- if (lg) elLegendWrap.appendChild(lg);
1509
+ if (lg && !lg.parentNode) elLegendWrap.appendChild(lg);
1491
1510
  (lg || elLegendWrap).appendChild(elLegend);
1492
1511
  elLegendWrap.classList.add(
1493
1512
  `apexcharts-align-${w.config.legend.horizontalAlign}`
@@ -1598,7 +1617,7 @@ class Legend {
1598
1617
  );
1599
1618
  const hoverOverLegend = isLegendItem(target);
1600
1619
  if (w.config.chart.type !== "heatmap" && !this.isBarsDistributed) {
1601
- if (!target.classList.contains("apexcharts-inactive-legend") && hoverOverLegend) {
1620
+ if (hoverOverLegend && !target.closest(".apexcharts-inactive-legend")) {
1602
1621
  const series = new Series(this.ctx.w);
1603
1622
  series.toggleSeriesOnHover(e, target);
1604
1623
  }
@@ -1632,7 +1651,8 @@ class Legend {
1632
1651
  me.onLegendClick(e);
1633
1652
  if (rel !== null && w.config.legend.onItemClick.toggleDataSeries) {
1634
1653
  requestAnimationFrame(() => {
1635
- const restored = w.dom.baseEl.querySelector(
1654
+ var _a;
1655
+ const restored = (_a = w.dom.baseEl) == null ? void 0 : _a.querySelector(
1636
1656
  `.apexcharts-legend-series[rel="${rel}"]`
1637
1657
  );
1638
1658
  if (restored) restored.focus();