apexcharts 8.2.0 → 8.3.1

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 (256) hide show
  1. package/README.md +7 -7
  2. package/dist/apexcharts.common.js +2 -2
  3. package/dist/apexcharts.core.js +19793 -19713
  4. package/dist/apexcharts.core.min.js +2 -2
  5. package/dist/apexcharts.css +38 -8
  6. package/dist/apexcharts.esm.js +1882 -1625
  7. package/dist/apexcharts.full.js +22044 -21634
  8. package/dist/apexcharts.full.min.js +2 -2
  9. package/dist/apexcharts.js +21414 -21124
  10. package/dist/apexcharts.min.js +2 -2
  11. package/dist/apexcharts.ssr.common.js +2 -2
  12. package/dist/apexcharts.ssr.esm.js +21413 -21123
  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 +478 -406
  17. package/dist/bar.js +2 -2
  18. package/dist/boxPlot.common.js +2 -2
  19. package/dist/boxPlot.esm.js +409 -334
  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 +409 -334
  24. package/dist/candlestick.js +2 -2
  25. package/dist/column.common.js +2 -2
  26. package/dist/column.esm.js +478 -406
  27. package/dist/core.common.js +2 -2
  28. package/dist/core.esm.js +19793 -19713
  29. package/dist/donut.common.js +2 -2
  30. package/dist/donut.esm.js +3 -9
  31. package/dist/dumbbell.common.js +2 -2
  32. package/dist/dumbbell.esm.js +478 -406
  33. package/dist/features/all.common.js +2 -2
  34. package/dist/features/all.esm.js +442 -324
  35. package/dist/features/annotations.common.js +2 -2
  36. package/dist/features/annotations.esm.js +65 -48
  37. package/dist/features/annotations.js +2 -2
  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 +2 -2
  48. package/dist/features/exports.esm.js +10 -4
  49. package/dist/features/exports.js +2 -2
  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 +64 -44
  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 +2 -2
  78. package/dist/features/morph.esm.js +9 -5
  79. package/dist/features/morph.js +2 -2
  80. package/dist/features/perspectives.common.js +2 -2
  81. package/dist/features/perspectives.esm.js +4 -1
  82. package/dist/features/perspectives.js +2 -2
  83. package/dist/features/raincloud.common.js +2 -2
  84. package/dist/features/raincloud.esm.js +26 -27
  85. package/dist/features/raincloud.js +2 -2
  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 +2 -2
  90. package/dist/features/stats.esm.js +52 -59
  91. package/dist/features/stats.js +2 -2
  92. package/dist/features/storyboard.common.js +2 -2
  93. package/dist/features/storyboard.esm.js +4 -1
  94. package/dist/features/storyboard.js +2 -2
  95. package/dist/features/streamgraph.common.js +2 -2
  96. package/dist/features/streamgraph.esm.js +48 -14
  97. package/dist/features/streamgraph.js +2 -2
  98. package/dist/features/toolbar.common.js +2 -2
  99. package/dist/features/toolbar.esm.js +148 -18
  100. package/dist/features/toolbar.js +2 -2
  101. package/dist/features/trellis.common.js +2 -2
  102. package/dist/features/trellis.esm.js +150 -63
  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 +2 -2
  108. package/dist/features/weave.esm.js +13 -12
  109. package/dist/features/weave.js +2 -2
  110. package/dist/full.common.js +2 -2
  111. package/dist/full.esm.js +1068 -842
  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 +529 -464
  117. package/dist/icicle.common.js +2 -2
  118. package/dist/icicle.esm.js +80 -46
  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 +2 -2
  129. package/dist/pie.esm.js +3 -9
  130. package/dist/pie.js +2 -2
  131. package/dist/polarArea.common.js +2 -2
  132. package/dist/polarArea.esm.js +3 -9
  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 +2 -2
  137. package/dist/radialBar.esm.js +5 -12
  138. package/dist/radialBar.js +2 -2
  139. package/dist/raincloud.common.js +2 -2
  140. package/dist/raincloud.esm.js +97 -52
  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 +478 -406
  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 +138 -53
  149. package/dist/sunburst.common.js +2 -2
  150. package/dist/sunburst.esm.js +116 -94
  151. package/dist/sunburst.js +2 -2
  152. package/dist/treemap.common.js +2 -2
  153. package/dist/treemap.esm.js +138 -104
  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 +477 -405
  166. package/package.json +1 -1
  167. package/src/apexcharts.js +40 -59
  168. package/src/assets/apexcharts.css +38 -8
  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 +68 -47
  173. package/src/charts/Line.js +118 -42
  174. package/src/charts/Pie.js +2 -8
  175. package/src/charts/Radar.js +5 -7
  176. package/src/charts/Radial.js +2 -6
  177. package/src/charts/RangeBar.js +47 -43
  178. package/src/charts/Sunburst.js +101 -98
  179. package/src/charts/Treemap.js +150 -88
  180. package/src/charts/Unit.js +368 -250
  181. package/src/charts/Violin.js +48 -30
  182. package/src/charts/common/Breadcrumb.js +2 -2
  183. package/src/charts/common/Hierarchy.js +32 -11
  184. package/src/charts/common/Jitter.js +32 -7
  185. package/src/charts/common/Stats.js +30 -23
  186. package/src/charts/common/bar/DataLabels.js +76 -81
  187. package/src/charts/common/bar/Helpers.js +43 -7
  188. package/src/charts/common/line/Helpers.js +12 -15
  189. package/src/charts/common/partition/NodeTooltip.js +29 -7
  190. package/src/charts/common/partition/Partition.js +33 -1
  191. package/src/charts/common/treemap/Helpers.js +3 -11
  192. package/src/charts/common/treemap/Nested.js +2 -3
  193. package/src/features/raincloud.js +16 -10
  194. package/src/features/stats.js +67 -62
  195. package/src/locales/en.json +2 -1
  196. package/src/locales/ro.json +3 -2
  197. package/src/modules/Animations.js +102 -95
  198. package/src/modules/AxisMapping.js +47 -12
  199. package/src/modules/Core.js +4 -0
  200. package/src/modules/CoreUtils.js +18 -42
  201. package/src/modules/Data.js +23 -24
  202. package/src/modules/DataLabels.js +6 -6
  203. package/src/modules/Exports.js +12 -5
  204. package/src/modules/Fill.js +17 -8
  205. package/src/modules/Filters.js +50 -50
  206. package/src/modules/Graphics.js +69 -51
  207. package/src/modules/Markers.js +3 -1
  208. package/src/modules/MorphTypeChange.js +13 -7
  209. package/src/modules/Range.js +44 -29
  210. package/src/modules/RendererController.js +17 -3
  211. package/src/modules/Scales.js +32 -9
  212. package/src/modules/Series.js +41 -19
  213. package/src/modules/Theme.js +1 -1
  214. package/src/modules/Toolbar.js +3 -2
  215. package/src/modules/UnitMarkRegistry.js +0 -5
  216. package/src/modules/ZoomPanSelection.js +123 -2
  217. package/src/modules/accessibility/KeyboardNavigation.js +114 -186
  218. package/src/modules/animations/Easing.js +2 -1
  219. package/src/modules/animations/LengthTransition.js +22 -2
  220. package/src/modules/annotations/Helpers.js +68 -52
  221. package/src/modules/axes/Grid.js +21 -7
  222. package/src/modules/axes/YAxis.js +8 -9
  223. package/src/modules/dimensions/Dimensions.js +9 -3
  224. package/src/modules/dimensions/Grid.js +2 -2
  225. package/src/modules/dimensions/XAxis.js +2 -5
  226. package/src/modules/drilldown/Breadcrumb.js +5 -2
  227. package/src/modules/helpers/Destroy.js +1 -1
  228. package/src/modules/helpers/UpdateHelpers.js +33 -15
  229. package/src/modules/highlightFilter/HighlightFilter.js +8 -9
  230. package/src/modules/highlightFilter/TreemapPart.js +2 -2
  231. package/src/modules/legend/HeatmapGradientLegend.js +76 -45
  232. package/src/modules/legend/Helpers.js +8 -1
  233. package/src/modules/legend/Legend.js +11 -12
  234. package/src/modules/license/LicenseEnforcer.js +5 -0
  235. package/src/modules/settings/Defaults.js +28 -56
  236. package/src/modules/settings/Globals.js +5 -0
  237. package/src/modules/settings/Options.js +7 -7
  238. package/src/modules/settings/TypeAliases.js +33 -16
  239. package/src/modules/streamgraph/StreamLabels.js +1 -0
  240. package/src/modules/tooltip/Labels.js +73 -76
  241. package/src/modules/tooltip/Marker.js +25 -21
  242. package/src/modules/tooltip/Position.js +88 -51
  243. package/src/modules/tooltip/Tooltip.js +242 -255
  244. package/src/modules/tooltip/Utils.js +71 -130
  245. package/src/modules/tooltip/constants.js +5 -5
  246. package/src/modules/trellis/Trellis.js +6 -0
  247. package/src/modules/trellis/TrellisChrome.js +18 -7
  248. package/src/modules/trellis/TrellisSync.js +2 -0
  249. package/src/modules/trellis/TrellisTooltip.js +2 -11
  250. package/src/modules/weave/WeaveHost.js +18 -12
  251. package/src/renderers/canvas/CanvasGraphics.js +1 -0
  252. package/src/ssr/DOMShim.js +10 -0
  253. package/src/svg/SVGFilter.js +26 -17
  254. package/src/types/internal.d.ts +9 -3
  255. package/src/utils/Utils.js +0 -14
  256. package/types/apexcharts.d.ts +33 -12
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.2.0
2
+ * ApexCharts v8.3.1
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- "use strict";var e=Object.defineProperty,t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,s=(t,r,i)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,n=(e,n)=>{for(var o in n||(n={}))r.call(n,o)&&s(e,o,n[o]);if(t)for(var o of t(n))i.call(n,o)&&s(e,o,n[o]);return e};Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function o(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const a=o(require("apexcharts/core")),l="__apexcharts_plugins__";function c(e){return function(){const e=globalThis;return e[l]||(e[l]={}),e[l]}()[e]||null}const d=Object.freeze({"stroke.dashArray":Object.freeze({type:"number"}),"dataLabels.enabledOnSeries":Object.freeze({type:"boolean"})});function h(e,t){const r=function(e){return e.weaveClaims||(e.weaveClaims={byOption:new Map}),e.weaveClaims}(e);return r.byOption.has(t)||r.byOption.set(t,[]),r.byOption.get(t)}function u(e,t){const r=d[e],i=[];for(const s of Array.isArray(t)?t:[])!s||"string"!=typeof s.series&&"number"!=typeof s.series?console.warn(`[apexcharts] claim on "${e}": each entry needs a series name or index.`):typeof s.value===r.type?i.push({series:s.series,value:s.value}):console.warn(`[apexcharts] claim on "${e}": expected a ${r.type} for series ${String(s.series)}, got ${typeof s.value}.`);return i}const f=["xaxis","yaxis","points","texts","images"];function g(e,t){const r=e.globals;return(r.collapsedSeriesIndices||[]).indexOf(t)<0&&(r.ancillaryCollapsedSeriesIndices||[]).indexOf(t)<0}function p(e,t){const r=t&&t._derived,i=e=>{if(!r)return"core";for(const[t,i]of r)if(i.indexOf(e)>-1)return t;return"core"};return(e.config.series||[]).map((t,r)=>{const s=t&&t.name?String(t.name):`Series ${r+1}`;return{id:`series:${r}`,kind:"series",label:s,owner:i(s),visible:g(e,r)}})}function _(e){const t=e.config.annotations||{},r=[];for(const e of f){(Array.isArray(t[e])?t[e]:[]).forEach((t,i)=>{t&&r.push({id:t.id?String(t.id):`annotation:${e}:${i}`,kind:"annotation",label:y(t,e,i),owner:t.owner?String(t.owner):"core",visible:!0})})}return r}function y(e,t,r){const i=e.label&&e.label.text;return i?String(i):e.text?String(e.text):e.id?String(e.id):`${t} annotation ${r+1}`}const m=Object.freeze(["layer","derived","reserve","pointer","stroke-info","claim","drawn","observations","scale-orientation","highlight"]),b=["updateOptions","updateSeries","appendData","appendSeries","toggleSeries","showSeries","hideSeries","highlightSeries","isSeriesHidden","zoomX","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","dataURI","exportToCSV"];function v(e){const t={};return b.forEach(r=>{"function"==typeof e[r]&&(t[r]=e[r].bind(e))}),Object.freeze(t)}function x(e,t){const r=e.ctx,i=e.w,s={name:t.def.name,version:7,get options(){return t.options},on(e,r){const i=t.handlers;return i.has(e)||i.set(e,[]),i.get(e).push(r),s},off(e,r){const i=t.handlers.get(e);if(i){const e=i.indexOf(r);e>-1&&i.splice(e,1)}return s},store:{},layer:r=>e._layer(t.def.name,r||{}),get scales(){return e._currentScales},get data(){return e._lastData||(e._lastData=e._dataSnapshot())},theme:Object.freeze({get mode(){return i.config.theme.mode},get foreColor(){return i.config.chart.foreColor},seriesColor:e=>i.globals.colors[e],token:t=>e._token(t)}),chart:v(r),get info(){return Object.freeze({type:String(i.config.chart&&(i.config.chart.requestedType||i.config.chart.type)||"line"),axisChart:!0===i.globals.axisCharts,datetimeX:!(!i.config.xaxis||"datetime"!==i.config.xaxis.type),horizontalBars:!!(i.config.plotOptions&&i.config.plotOptions.bar&&i.config.plotOptions.bar.horizontal),dataLabels:Object.freeze({enabled:!(!i.config.dataLabels||!i.config.dataLabels.enabled),enabledOnSeries:Array.isArray(i.config.dataLabels&&i.config.dataLabels.enabledOnSeries)?i.config.dataLabels.enabledOnSeries.slice():null}),stroke:Object.freeze({dashArray:Array.isArray(i.config.stroke&&i.config.stroke.dashArray)?i.config.stroke.dashArray.slice():i.config.stroke&&i.config.stroke.dashArray||0}),title:String(i.config.title&&i.config.title.text||"")})},get categories(){return e._categories()},markDerived:r=>(e._markDerived(t.def.name,r),s),reserve:r=>(e._reserve(t.def.name,r),s),claim(e,r){const s=function(e,t,r,i){if(!Object.prototype.hasOwnProperty.call(d,r))return console.warn(`[apexcharts] "${r}" is not a claimable option. Claimable: ${Object.keys(d).join(", ")}.`),null;const s={owner:t,option:r,entries:u(r,i)};return h(e,r).push(s),s}(i,t.def.name,e,r);return s?Object.freeze({release(){!function(e,t){if(!e.weaveClaims||!t)return;const r=e.weaveClaims.byOption.get(t.option);if(!r)return;const i=r.indexOf(t);i>-1&&r.splice(i,1)}(i,s)},update(t){s.entries=u(e,t)}}):null},highlight:r=>e._highlight(t.def.name,r),drawn:()=>Object.freeze(function(e,t){const r=[];if(t&&t._declared)for(const[e,i]of t._declared)for(const t of i)r.push({id:`overlay:${e}:${t.id}`,kind:"overlay",label:t.label,owner:e,visible:!1!==t.visible});return[...p(e,t),..._(e),...r]}(i,e).map(e=>Object.freeze(e))),declare:r=>(e._declare(t.def.name,r),s),pointer:r=>e._onPointer(t.def.name,r),emit(e,i){r.events.fireEvent(`plugin:${t.def.name}:${e}`,[r,i])},get el(){return i.dom.baseEl}},n=w,o=m.filter(e=>n[e](s)),a=new Set(o),l=s;return l.capabilities=Object.freeze(o),l.can=e=>a.has(e),Object.freeze(s)}const w={layer:e=>"function"==typeof e.layer,derived:e=>"function"==typeof e.markDerived,reserve:e=>"function"==typeof e.reserve,pointer:e=>"function"==typeof e.pointer,"stroke-info":e=>!(!e.info||!e.info.stroke),claim:e=>"function"==typeof e.claim,drawn:e=>"function"==typeof e.drawn&&"function"==typeof e.declare,observations:()=>!0,"scale-orientation":()=>!0,highlight:e=>"function"==typeof e.highlight},S=a.__apex_CoreUtils;function O(e){const t=[];for(const r of Array.isArray(e)?e:[])!r||"string"!=typeof r.series&&"number"!=typeof r.series?console.warn("[apexcharts] highlight: each entry needs a series name or index."):Array.isArray(r.values)?t.push({series:r.series,values:r.values.map(e=>"number"==typeof e&&Number.isFinite(e)?e:null)}):console.warn(`[apexcharts] highlight: expected an array of values for series ${String(r.series)}, got ${typeof r.values}.`);return t}const A=class e{constructor(e,t){this.w=e,this.ctx=t,this.active=[],this._layers=new Map,this._currentScales=null,this._lastPluginsRef=null,this._lastData=null,this._updatedWired=!1,this._derived=null,this._reserved=null,this._reserveTimer=null,this._highlightTimer=null,this._pointerSubs=null,this._declared=null,this._pointerWired=null,this._onUpdated=this._onUpdated.bind(this),this._init()}_init(){(this.w.config.plugins||[]).map((e,t)=>({entry:e,order:null!=e.order?e.order:t})).sort((e,t)=>e.order-t.order).forEach(e=>this._activate(e.entry)),this._lastPluginsRef=this.w.config.plugins,this._wireUpdated()}_wireUpdated(){this._updatedWired||(this.ctx.addEventListener("updated",this._onUpdated),this._updatedWired=!0)}_onUpdated(){this._repairInitialSeries(),this.dispatch("afterUpdate",{pass:"update"})}_activate(e){const t=c(e.name);if(!t)return void console.error(`[apexcharts] plugin "${e.name}" is not registered.`);const r=null!=t.apiVersion?Math.trunc(t.apiVersion):1;if(!(r>=1)||r>7)return void console.error(`[apexcharts] plugin "${t.name}" targets Weave API v${t.apiVersion}, host is v7; skipped.`);const i={def:t,options:Object.freeze(n({},e.options||{})),handlers:new Map,disabled:!1,failures:0,api:null};i.api=x(this,i),this.active.push(i),this._guard(i,"setup",()=>t.setup(i.api))}dispatch(e,t){if("draw"===e&&(this._reconcile(),this._resetLayers()),this._lastData=null,!this.active.length)return;"afterParse"===e?this._currentScales=null:t&&"xyRatios"in t&&this._setScales(t.xyRatios);const r=t&&t.pass||"full";let i=null;for(const t of this.active){if(t.disabled)continue;const s=t.handlers.get(e);if(!s||!s.length)continue;null===i&&(i=this._dataSnapshot(),this._lastData=i);const n={api:t.api,scales:this._currentScales,data:i,pass:r,hook:e};for(const r of s.slice())this._guard(t,e,()=>r(n))}}_guard(e,t,r){if(!e.disabled)try{r()}catch(r){console.error(`[apexcharts] plugin "${e.def.name}" threw in "${t}":`,r),e.failures=(e.failures||0)+1,e.failures>=3&&(e.disabled=!0,this._forget(e.def.name),console.error(`[apexcharts] plugin "${e.def.name}" disabled after repeated errors.`))}}_setScales(e){const t=this.w,r=t.globals,i=t.layout;if(!e||!r.axisCharts)return void(this._currentScales=null);const s=e.xRatio,n=e.yRatio||[],o=e=>null!=n[e]?n[e]:n[0],a=e=>null!=r.maxYArr[e]?r.maxYArr[e]:r.maxY,l=e=>null!=r.minYArr[e]?r.minYArr[e]:r.minY,c=!!r.isBarHorizontal,d=!!t.axisFlags.isRangeBar,h=r.dataPoints>0&&(!t.axisFlags.isXNumeric||c),u=c&&d?t.labelData.labels.length:r.dataPoints,f=c?i.gridHeight:i.gridWidth,g=h&&u>0?f/u:0,p=new Map;if(h){(d?t.labelData.labels:t.axisFlags.isXNumeric&&t.seriesData.seriesX[r.maxValsInArrayIndex]||[]).forEach((e,t)=>{p.has(e)||p.set(e,t)})}const _=h?e=>g*((p.has(e)?p.get(e):e)+.5):e=>(e-r.minX)/s,y=e=>{const i=r.seriesYAxisReverseMap&&r.seriesYAxisReverseMap[e];return t.config.yaxis[null!=i?i:e]||t.config.yaxis[0]},m=e=>{const t=y(e);return!(!t||!t.reversed)};let b=null;const v=c?(e,t=0)=>{const r=Math.abs(a(t)-l(t)),s=r?(e-l(t))/r*i.gridWidth:0;return m(t)?i.gridWidth-s:s}:(e,s=0)=>{const n=((e,i)=>{const s=y(i);return s&&s.logarithmic&&!r.invalidLogScale?(b||(b=new S(t)),b.getLogVal(s.logBase,e,i)):null})(e,s);return null!==n?m(s)?n*i.gridHeight:(1-n)*i.gridHeight:m(s)?(e-l(s))/o(s):(a(s)-e)/o(s)};this._currentScales={x:_,y:v,domainX:h?[-.5,u-.5]:[r.minX,r.maxX],domainY:(e=0)=>[l(e),a(e)],transposed:c,point:(e,t,r=0)=>c?{x:v(t,r),y:_(e)}:{x:_(e),y:v(t,r)},gridWidth:i.gridWidth,gridHeight:i.gridHeight,ratios:e}}_dataSnapshot(){const e=this.w,t=e.globals,r=e.seriesData.series||[],i=e.seriesData.seriesX||[],s=Array.isArray(e.config.series)?e.config.series:[];return r.map((r,n)=>{const o=Array.isArray(r)?r:[r],a=i[n]||[],l=o.map((e,t)=>({x:null!=a[t]?a[t]:t,y:e})),c=s[n],d=c&&"object"==typeof c&&Array.isArray(c.data)?c.data:[],h=e.seriesObservations?e.seriesObservations[n]:null,u=h?{values:h.values.slice(),byPoint:h.byPoint.map(e=>e?e.slice():null)}:null;return{name:t.seriesNames?t.seriesNames[n]:void 0,hidden:(t.collapsedSeriesIndices||[]).includes(n),color:t.colors?t.colors[n]:void 0,points:l,raw:d,observations:u}})}_categories(){const e=this.w,t=e.globals,r=e.config.xaxis&&Array.isArray(e.config.xaxis.categories)?e.config.xaxis.categories:[],i=Array.isArray(t.categoryLabels)?t.categoryLabels:[],s=Array.isArray(t.labels)?t.labels:[],n=r.length?r:i.length?i:s,o=e.seriesData.series||[];let a=0;for(let e=0;e<o.length;e++){const t=o[e];Array.isArray(t)&&t.length>a&&(a=t.length)}a||(a=n.length);const l=[];for(let e=0;e<a;e++){const t=n[e];l.push(String(null==t?e+1:t))}return l}_markDerived(e,t){this._derived||(this._derived=new Map);const r=Array.isArray(t)?t.map(e=>String(e)):[];r.length?this._derived.set(e,r):this._derived.delete(e),this._repairInitialSeries()}_onPointer(e,t){if("function"!=typeof t)return()=>{};this._pointerSubs||(this._pointerSubs=new Map);const r=this._pointerSubs.get(e)||[];return r.push(t),this._pointerSubs.set(e,r),this._wirePointer(),()=>{const r=this._pointerSubs&&this._pointerSubs.get(e);if(!r)return;const i=r.indexOf(t);i>-1&&r.splice(i,1)}}_wirePointer(){if(this._pointerWired)return;if(!this.ctx||"function"!=typeof this.ctx.addEventListener)return;const e=[["enter","dataPointMouseEnter"],["leave","dataPointMouseLeave"],["select","dataPointSelection"]];this._pointerWired=[];for(const[t,r]of e){const e=(e,r,i)=>{this._emitPointer(t,i,e)};this.ctx.addEventListener(r,e),this._pointerWired.push([r,e])}}_emitPointer(t,r,i){if(!this._pointerSubs||!this._pointerSubs.size)return;const s=r&&"number"==typeof r.seriesIndex?r.seriesIndex:-1,n=r&&"number"==typeof r.dataPointIndex?r.dataPointIndex:-1,o=this._categories()||[],a=this.w,l=a&&a.config&&a.config.series||[],c={type:t,seriesIndex:s,dataPointIndex:n,category:n>-1?o[n]:void 0,seriesName:e._seriesName(l,s),selected:"select"===t?e._isSelected(r,s,n):void 0,modifiers:e._modifiers(i)};for(const[e,t]of this._pointerSubs){const r=this.active.find(t=>t.def.name===e);if(r)for(const e of t.slice())this._guard(r,"pointer",()=>e(c))}}static _seriesName(e,t){if(t<0)return;const r=e[t];return r&&"object"==typeof r&&"string"==typeof r.name?r.name:void 0}static _isSelected(e,t,r){const i=e&&e.selectedDataPoints;if(!Array.isArray(i)||t<0)return;const s=i[t];return!!Array.isArray(s)&&s.indexOf(r)>-1}static _modifiers(e){return Object.freeze({shift:!(!e||!e.shiftKey),ctrl:!(!e||!e.ctrlKey),alt:!(!e||!e.altKey),meta:!(!e||!e.metaKey)})}_reserve(t,r){const i=e._normaliseBox(r),s=this._reserved?this._reserved.get(t):void 0;if(i){if(s&&s.left===i.left&&s.right===i.right&&s.top===i.top&&s.bottom===i.bottom)return;this._reserved||(this._reserved=new Map),this._reserved.set(t,i)}else{if(!s||!this._reserved)return;this._reserved.delete(t)}this._resizeForReservation()}static _normaliseBox(e){if(!e||"object"!=typeof e)return null;const t=e=>Number.isFinite(e)&&e>0?Math.round(e):0,r={left:t(e.left),right:t(e.right),top:t(e.top),bottom:t(e.bottom)};return r.left||r.right||r.top||r.bottom?r:null}reservedBox(){if(!this._reserved||0===this._reserved.size)return e.NO_RESERVATION;const t={left:0,right:0,top:0,bottom:0};for(const e of this._reserved.values())t.left+=e.left,t.right+=e.right,t.top+=e.top,t.bottom+=e.bottom;return t}_resizeForReservation(){null==this._reserveTimer&&(this._reserveTimer=setTimeout(()=>{this._reserveTimer=null;const e=this.w.globals;e.isDestroyed||(e.resized=!0,e.dataChanged=!1,this._update("a plugin reservation"))},0))}_update(e){try{Promise.resolve(this.ctx.update()).catch(t=>console.error(`[apexcharts] re-render for ${e} failed:`,t))}catch(e){}}_highlight(e,t){const r=this.w,i=this.ctx.highlightFilter;if(!i)return null;if(!r.globals.axisCharts)return null;if(!i.canDrawParts())return null;if(i.callerCarriesParts())return null;const s=function(e,t,r){const i=O(r);if(!i.length)return null;const s={owner:t,entries:i};return function(e){return e.weaveHighlights||(e.weaveHighlights={records:[]}),e.weaveHighlights}(e).records.push(s),s}(r,e,t);return s?(this._redrawForHighlight(),Object.freeze({release:()=>{!function(e,t){if(!e||!e.weaveHighlights||!t)return;const r=e.weaveHighlights.records,i=r.indexOf(t);i>-1&&r.splice(i,1)}(r,s),this._redrawForHighlight()},update:e=>{s.entries=O(e),this._redrawForHighlight()}})):null}_redrawForHighlight(){null==this._highlightTimer&&(this._highlightTimer=setTimeout(()=>{this._highlightTimer=null;const e=this.w.globals;e.isDestroyed||(e.dataChanged=!0,this._update("plugin highlight parts"))},0))}_derivedNames(){const e=new Set;if(!this._derived)return e;for(const t of this._derived.values())for(const r of t)e.add(r);return e}_repairInitialSeries(){const e=this._derivedNames();if(!e.size)return;const t=this.w.globals,r=t=>!e.has(String(t&&t.name)),i=e=>{if(!Array.isArray(e))return null;const t=e.filter(r);return t.length&&t.length!==e.length?t:null};try{const e=i(t._initialSeriesPeek);e&&(t.initialSeries=e);const r=t.initialConfig,s=r&&i(r.series);s&&(r.series=s)}catch(e){}}_token(e){const t=this.w,r=t.globals;switch(e){case"foreColor":return t.config.chart.foreColor;case"background":return t.config.chart.background;case"accent":case"primary":return r.colors?r.colors[0]:void 0;default:return/^series-\d+$/.test(e)&&r.colors?r.colors[Number(e.split("-")[1])]:void 0}}_layer(e,{z:t="front",className:r=""}={}){let i=this._layers.get(e);if(!i){i=this.ctx.graphics.group({class:`apexcharts-plugin-${e} ${r}`.trim()});const s=this.w.dom.elGraphical.node;"behind"===t?s.insertBefore(i.node,s.firstChild):s.appendChild(i.node),i.node.setAttribute("aria-hidden","true"),this._layers.set(e,i)}return function(e,t,r){const i=t=>(t&&e.add(t),t),s={get node(){return e.node},path(e={}){const{d:r="",stroke:s="#000",width:n=1,fill:o="none",opacity:a=1,dash:l=0,className:c=""}=e;return i(t.drawPath({d:r,stroke:s,strokeWidth:n,fill:o,fillOpacity:"none"===o?0:a,strokeOpacity:a,strokeDashArray:l,classes:c}))},line(e={}){const{x1:r,y1:s,x2:n,y2:o,stroke:a="#000",width:l=1,dash:c=0}=e;return i(t.drawLine(r,s,n,o,a,c,l))},rect(e={}){const{x:r=0,y:s=0,w:n=0,h:o=0,r:a=0,fill:l="#000",stroke:c=null,opacity:d=1}=e;return i(t.drawRect(r,s,n,o,a,l,d,null!=c?1:null,c))},circle(e={}){const{cx:r=0,cy:s=0,r:n=0,fill:o="#000",stroke:a=null}=e;return i(t.drawCircle(n,{cx:r,cy:s,fill:o,stroke:a||"none"}))},text(e={}){const{x:r=0,y:s=0,text:n="",color:o,size:a,anchor:l="start",weight:c}=e;return i(t.drawText({x:r,y:s,text:n,textAnchor:l,fontSize:a,foreColor:o,fontWeight:c}))},clear(){const t=e.node;for(;t.firstChild;)t.removeChild(t.firstChild);return r&&r(),s}};return s}(i,this.ctx.graphics,()=>this._undeclare(e))}_undeclare(e){this._declared&&this._declared.delete(e)}_resetLayers(){const e=this.w.dom.elGraphical,t=e&&e.node;if(t){const e=t.querySelectorAll('g[class*="apexcharts-plugin-"]');Array.prototype.forEach.call(e,e=>e.remove())}this._layers.clear(),this._declared=null}_declare(e,t){if(!t||"string"!=typeof t.id||!t.id)return void console.warn(`[apexcharts] plugin "${e}" declared something with no id; ignored.`);this._declared||(this._declared=new Map);const r=this._declared.get(e)||[],i={id:t.id,label:t.label?String(t.label):t.id,visible:!1!==t.visible},s=r.findIndex(e=>e.id===i.id);s>-1?r[s]=i:r.push(i),this._declared.set(e,r)}_reconcile(){const e=this.w.config.plugins||[];if(e===this._lastPluginsRef)return;this._lastPluginsRef=e;const t=new Map(e.map((e,t)=>[e.name,{entry:e,order:null!=e.order?e.order:t}]));for(let e=this.active.length-1;e>=0;e--){const r=this.active[e],i=t.get(r.def.name);i?r.options=Object.freeze(n({},i.entry.options||{})):(this._guard(r,"destroy",()=>r.def.destroy&&r.def.destroy(r.api)),this.active.splice(e,1),this._forget(r.def.name))}const r=new Set(this.active.map(e=>e.def.name)),i=[];t.forEach((e,t)=>{r.has(t)||i.push(e)}),i.sort((e,t)=>e.order-t.order).forEach(e=>this._activate(e.entry))}_forget(e){const t=this.w,r=function(e,t){if(!e.weaveClaims)return!1;let r=!1;for(const[i,s]of e.weaveClaims.byOption){const n=s.filter(e=>e.owner!==t);n.length!==s.length&&(e.weaveClaims.byOption.set(i,n),r=!0)}return r}(t,e),i=function(e,t){if(!e||!e.weaveHighlights)return!1;const r=e.weaveHighlights.records,i=r.filter(e=>e.owner!==t);return i.length!==r.length&&(e.weaveHighlights.records=i,!0)}(t,e);this._pointerSubs&&this._pointerSubs.delete(e),this._derived&&this._derived.delete(e),this._declared&&this._declared.delete(e);const s=!(!this._reserved||!this._reserved.has(e));this._reserve(e,null),!r&&!i||s||this._redrawForHighlight()}teardown(e){if(!e){this.dispatch("destroy");for(const e of this.active)this._guard(e,"destroy",()=>e.def.destroy&&e.def.destroy(e.api));for(const e of this.active)this._forget(e.def.name);if(this.active=[],this._derived=null,this._reserved=null,this._pointerSubs=null,this._declared=null,this._pointerWired){for(const[e,t]of this._pointerWired)this.ctx.removeEventListener&&this.ctx.removeEventListener(e,t);this._pointerWired=null}null!=this._reserveTimer&&(clearTimeout(this._reserveTimer),this._reserveTimer=null),null!=this._highlightTimer&&(clearTimeout(this._highlightTimer),this._highlightTimer=null),this._updatedWired&&(this.ctx.removeEventListener&&this.ctx.removeEventListener("updated",this._onUpdated),this._updatedWired=!1)}this._layers.clear()}};var P,j,k;P=A,j="NO_RESERVATION",k=Object.freeze({left:0,right:0,top:0,bottom:0}),s(P,"symbol"!=typeof j?j+"":j,k);let z=A;a.default.registerFeatures({weave:z}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>a.default});
5
+ "use strict";var e=Object.defineProperty,t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,s=(t,r,i)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,n=(e,n)=>{for(var o in n||(n={}))r.call(n,o)&&s(e,o,n[o]);if(t)for(var o of t(n))i.call(n,o)&&s(e,o,n[o]);return e};Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function o(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const a=o(require("apexcharts/core")),l="__apexcharts_plugins__";function c(e){return function(){const e=globalThis;return e[l]||(e[l]={}),e[l]}()[e]||null}const d=Object.freeze({"stroke.dashArray":Object.freeze({type:"number"}),"dataLabels.enabledOnSeries":Object.freeze({type:"boolean"})});function h(e,t){const r=function(e){return e.weaveClaims||(e.weaveClaims={byOption:new Map}),e.weaveClaims}(e);return r.byOption.has(t)||r.byOption.set(t,[]),r.byOption.get(t)}function u(e,t){const r=d[e],i=[];for(const s of Array.isArray(t)?t:[])!s||"string"!=typeof s.series&&"number"!=typeof s.series?console.warn(`[apexcharts] claim on "${e}": each entry needs a series name or index.`):typeof s.value===r.type?i.push({series:s.series,value:s.value}):console.warn(`[apexcharts] claim on "${e}": expected a ${r.type} for series ${String(s.series)}, got ${typeof s.value}.`);return i}const f=["xaxis","yaxis","points","texts","images"];function g(e,t){const r=e.globals;return(r.collapsedSeriesIndices||[]).indexOf(t)<0&&(r.ancillaryCollapsedSeriesIndices||[]).indexOf(t)<0}function p(e,t){const r=t&&t._derived,i=e=>{if(!r)return"core";for(const[t,i]of r)if(i.indexOf(e)>-1)return t;return"core"};return(e.config.series||[]).map((t,r)=>{const s=t&&t.name?String(t.name):`Series ${r+1}`;return{id:`series:${r}`,kind:"series",label:s,owner:i(s),visible:g(e,r)}})}function _(e){const t=e.config.annotations||{},r=[];for(const e of f){(Array.isArray(t[e])?t[e]:[]).forEach((t,i)=>{t&&r.push({id:t.id?String(t.id):`annotation:${e}:${i}`,kind:"annotation",label:y(t,e,i),owner:t.owner?String(t.owner):"core",visible:!0})})}return r}function y(e,t,r){const i=e.label&&e.label.text;return i?String(i):e.text?String(e.text):e.id?String(e.id):`${t} annotation ${r+1}`}const m=Object.freeze(["layer","derived","reserve","pointer","stroke-info","claim","drawn","observations","scale-orientation","highlight"]),b=["updateOptions","updateSeries","appendData","appendSeries","toggleSeries","showSeries","hideSeries","highlightSeries","isSeriesHidden","zoomX","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","dataURI","exportToCSV"];function v(e){const t={};return b.forEach(r=>{"function"==typeof e[r]&&(t[r]=e[r].bind(e))}),Object.freeze(t)}function x(e,t){const r=e.ctx,i=e.w,s={name:t.def.name,version:7,get options(){return t.options},on(e,r){const i=t.handlers;return i.has(e)||i.set(e,[]),i.get(e).push(r),s},off(e,r){const i=t.handlers.get(e);if(i){const e=i.indexOf(r);e>-1&&i.splice(e,1)}return s},store:{},layer:r=>e._layer(t.def.name,r||{}),get scales(){return e._currentScales},get data(){return e._lastData||(e._lastData=e._dataSnapshot())},theme:Object.freeze({get mode(){return i.config.theme.mode},get foreColor(){return i.config.chart.foreColor},seriesColor:e=>i.globals.colors[e],token:t=>e._token(t)}),chart:v(r),get info(){return Object.freeze({type:String(i.config.chart&&(i.config.chart.requestedType||i.config.chart.type)||"line"),axisChart:!0===i.globals.axisCharts,datetimeX:!(!i.config.xaxis||"datetime"!==i.config.xaxis.type),horizontalBars:!!(i.config.plotOptions&&i.config.plotOptions.bar&&i.config.plotOptions.bar.horizontal),dataLabels:Object.freeze({enabled:!(!i.config.dataLabels||!i.config.dataLabels.enabled),enabledOnSeries:Array.isArray(i.config.dataLabels&&i.config.dataLabels.enabledOnSeries)?i.config.dataLabels.enabledOnSeries.slice():null}),stroke:Object.freeze({dashArray:Array.isArray(i.config.stroke&&i.config.stroke.dashArray)?i.config.stroke.dashArray.slice():i.config.stroke&&i.config.stroke.dashArray||0}),title:String(i.config.title&&i.config.title.text||"")})},get categories(){return e._categories()},markDerived:r=>(e._markDerived(t.def.name,r),s),reserve:r=>(e._reserve(t.def.name,r),s),claim(e,r){const s=function(e,t,r,i){if(!Object.prototype.hasOwnProperty.call(d,r))return console.warn(`[apexcharts] "${r}" is not a claimable option. Claimable: ${Object.keys(d).join(", ")}.`),null;const s={owner:t,option:r,entries:u(r,i)};return h(e,r).push(s),s}(i,t.def.name,e,r);return s?Object.freeze({release(){!function(e,t){if(!e.weaveClaims||!t)return;const r=e.weaveClaims.byOption.get(t.option);if(!r)return;const i=r.indexOf(t);i>-1&&r.splice(i,1)}(i,s)},update(t){s.entries=u(e,t)}}):null},highlight:r=>e._highlight(t.def.name,r),drawn:()=>Object.freeze(function(e,t){const r=[];if(t&&t._declared)for(const[e,i]of t._declared)for(const t of i)r.push({id:`overlay:${e}:${t.id}`,kind:"overlay",label:t.label,owner:e,visible:!1!==t.visible});return[...p(e,t),..._(e),...r]}(i,e).map(e=>Object.freeze(e))),declare:r=>(e._declare(t.def.name,r),s),pointer:r=>e._onPointer(t.def.name,r),emit(e,i){r.events.fireEvent(`plugin:${t.def.name}:${e}`,[r,i])},get el(){return i.dom.baseEl}},n=w,o=m.filter(e=>n[e](s)),a=new Set(o),l=s;return l.capabilities=Object.freeze(o),l.can=e=>a.has(e),Object.freeze(s)}const w={layer:e=>"function"==typeof e.layer,derived:e=>"function"==typeof e.markDerived,reserve:e=>"function"==typeof e.reserve,pointer:e=>"function"==typeof e.pointer,"stroke-info":e=>!(!e.info||!e.info.stroke),claim:e=>"function"==typeof e.claim,drawn:e=>"function"==typeof e.drawn&&"function"==typeof e.declare,observations:()=>!0,"scale-orientation":()=>!0,highlight:e=>"function"==typeof e.highlight},S=a.__apex_CoreUtils;function O(e){const t=[];for(const r of Array.isArray(e)?e:[])!r||"string"!=typeof r.series&&"number"!=typeof r.series?console.warn("[apexcharts] highlight: each entry needs a series name or index."):Array.isArray(r.values)?t.push({series:r.series,values:r.values.map(e=>"number"==typeof e&&Number.isFinite(e)?e:null)}):console.warn(`[apexcharts] highlight: expected an array of values for series ${String(r.series)}, got ${typeof r.values}.`);return t}const A=class e{constructor(e,t){this.w=e,this.ctx=t,this.active=[],this._layers=new Map,this._currentScales=null,this._lastPluginsRef=null,this._lastData=null,this._updatedWired=!1,this._derived=null,this._reserved=null,this._reserveTimer=null,this._highlightTimer=null,this._pointerSubs=null,this._declared=null,this._pointerWired=null,this._onUpdated=this._onUpdated.bind(this),this._init()}_init(){(this.w.config.plugins||[]).map((e,t)=>({entry:e,order:null!=e.order?e.order:t})).sort((e,t)=>e.order-t.order).forEach(e=>this._activate(e.entry)),this._lastPluginsRef=this.w.config.plugins,this._wireUpdated()}_wireUpdated(){this._updatedWired||(this.ctx.addEventListener("updated",this._onUpdated),this._updatedWired=!0)}_onUpdated(){this._repairInitialSeries(),this.dispatch("afterUpdate",{pass:"update"})}_activate(e){const t=c(e.name);if(!t)return void console.error(`[apexcharts] plugin "${e.name}" is not registered.`);const r=null!=t.apiVersion?Math.trunc(t.apiVersion):1;if(!(r>=1)||r>7)return void console.error(`[apexcharts] plugin "${t.name}" targets Weave API v${t.apiVersion}, host is v7; skipped.`);const i={def:t,options:Object.freeze(n({},e.options||{})),handlers:new Map,disabled:!1,failures:0,api:null};i.api=x(this,i),this.active.push(i),this._guard(i,"setup",()=>t.setup(i.api))}dispatch(e,t){if("draw"===e&&(this._reconcile(),this._resetLayers()),this._lastData=null,!this.active.length)return;"afterParse"===e?this._currentScales=null:t&&"xyRatios"in t&&this._setScales(t.xyRatios);const r=t&&t.pass||"full",i=this;let s=null;for(const t of this.active){if(t.disabled)continue;const n=t.handlers.get(e);if(!n||!n.length)continue;const o={api:t.api,scales:this._currentScales,get data(){return s||(s=i._lastData||(i._lastData=i._dataSnapshot()))},set data(e){Object.defineProperty(this,"data",{value:e,writable:!0})},pass:r,hook:e};for(const r of n.slice())this._guard(t,e,()=>r(o))}}_guard(e,t,r){if(!e.disabled)try{r()}catch(r){console.error(`[apexcharts] plugin "${e.def.name}" threw in "${t}":`,r),e.failures=(e.failures||0)+1,e.failures>=3&&(e.disabled=!0,this._forget(e.def.name),console.error(`[apexcharts] plugin "${e.def.name}" disabled after repeated errors.`))}}_setScales(e){const t=this.w,r=t.globals,i=t.layout;if(!e||!r.axisCharts)return void(this._currentScales=null);const s=e.xRatio,n=e.yRatio||[],o=e=>null!=n[e]?n[e]:n[0],a=e=>null!=r.maxYArr[e]?r.maxYArr[e]:r.maxY,l=e=>null!=r.minYArr[e]?r.minYArr[e]:r.minY,c=!!r.isBarHorizontal,d=!!t.axisFlags.isRangeBar,h=r.dataPoints>0&&(!t.axisFlags.isXNumeric||c),u=c&&d?t.labelData.labels.length:r.dataPoints,f=c?i.gridHeight:i.gridWidth,g=h&&u>0?f/u:0,p=new Map;if(h){(d?t.labelData.labels:t.axisFlags.isXNumeric&&t.seriesData.seriesX[r.maxValsInArrayIndex]||[]).forEach((e,t)=>{p.has(e)||p.set(e,t)})}const _=h?e=>g*((p.has(e)?p.get(e):e)+.5):e=>(e-r.minX)/s,y=e=>{const i=r.seriesYAxisReverseMap&&r.seriesYAxisReverseMap[e];return t.config.yaxis[null!=i?i:e]||t.config.yaxis[0]},m=e=>{const t=y(e);return!(!t||!t.reversed)};let b=null;const v=c?(e,t=0)=>{const r=Math.abs(a(t)-l(t)),s=r?(e-l(t))/r*i.gridWidth:0;return m(t)?i.gridWidth-s:s}:(e,s=0)=>{const n=((e,i)=>{const s=y(i);return s&&s.logarithmic&&!r.invalidLogScale?(b||(b=new S(t)),b.getLogVal(s.logBase,e,i)):null})(e,s);return null!==n?m(s)?n*i.gridHeight:(1-n)*i.gridHeight:m(s)?(e-l(s))/o(s):(a(s)-e)/o(s)};this._currentScales={x:_,y:v,domainX:h?[-.5,u-.5]:[r.minX,r.maxX],domainY:(e=0)=>[l(e),a(e)],transposed:c,point:(e,t,r=0)=>c?{x:v(t,r),y:_(e)}:{x:_(e),y:v(t,r)},gridWidth:i.gridWidth,gridHeight:i.gridHeight,ratios:e}}_dataSnapshot(){const e=this.w,t=e.globals,r=e.seriesData.series||[],i=e.seriesData.seriesX||[],s=Array.isArray(e.config.series)?e.config.series:[];return r.map((r,n)=>{const o=Array.isArray(r)?r:[r],a=i[n]||[],l=o.map((e,t)=>({x:null!=a[t]?a[t]:t,y:e})),c=s[n],d=c&&"object"==typeof c&&Array.isArray(c.data)?c.data:[],h=e.seriesObservations?e.seriesObservations[n]:null,u=h?{values:h.values.slice(),byPoint:h.byPoint.map(e=>e?e.slice():null)}:null;return{name:t.seriesNames?t.seriesNames[n]:void 0,hidden:(t.collapsedSeriesIndices||[]).includes(n),color:t.colors?t.colors[n]:void 0,points:l,raw:d,observations:u}})}_categories(){const e=this.w,t=e.globals,r=e.config.xaxis&&Array.isArray(e.config.xaxis.categories)?e.config.xaxis.categories:[],i=Array.isArray(t.categoryLabels)?t.categoryLabels:[],s=Array.isArray(t.labels)?t.labels:[],n=r.length?r:i.length?i:s,o=e.seriesData.series||[];let a=0;for(let e=0;e<o.length;e++){const t=o[e];Array.isArray(t)&&t.length>a&&(a=t.length)}a||(a=n.length);const l=[];for(let e=0;e<a;e++){const t=n[e];l.push(String(null==t?e+1:t))}return l}_markDerived(e,t){this._derived||(this._derived=new Map);const r=Array.isArray(t)?t.map(e=>String(e)):[];r.length?this._derived.set(e,r):this._derived.delete(e),this._repairInitialSeries()}_onPointer(e,t){if("function"!=typeof t)return()=>{};this._pointerSubs||(this._pointerSubs=new Map);const r=this._pointerSubs.get(e)||[];return r.push(t),this._pointerSubs.set(e,r),this._wirePointer(),()=>{const r=this._pointerSubs&&this._pointerSubs.get(e);if(!r)return;const i=r.indexOf(t);i>-1&&r.splice(i,1)}}_wirePointer(){if(this._pointerWired)return;if(!this.ctx||"function"!=typeof this.ctx.addEventListener)return;const e=[["enter","dataPointMouseEnter"],["leave","dataPointMouseLeave"],["select","dataPointSelection"]];this._pointerWired=[];for(const[t,r]of e){const e=(e,r,i)=>{this._emitPointer(t,i,e)};this.ctx.addEventListener(r,e),this._pointerWired.push([r,e])}}_emitPointer(t,r,i){if(!this._pointerSubs||!this._pointerSubs.size)return;const s=r&&"number"==typeof r.seriesIndex?r.seriesIndex:-1,n=r&&"number"==typeof r.dataPointIndex?r.dataPointIndex:-1,o=this._categories()||[],a=this.w,l=a&&a.config&&a.config.series||[],c={type:t,seriesIndex:s,dataPointIndex:n,category:n>-1?o[n]:void 0,seriesName:e._seriesName(l,s),selected:"select"===t?e._isSelected(r,s,n):void 0,modifiers:e._modifiers(i)};for(const[e,t]of this._pointerSubs){const r=this.active.find(t=>t.def.name===e);if(r)for(const e of t.slice())this._guard(r,"pointer",()=>e(c))}}static _seriesName(e,t){if(t<0)return;const r=e[t];return r&&"object"==typeof r&&"string"==typeof r.name?r.name:void 0}static _isSelected(e,t,r){const i=e&&e.selectedDataPoints;if(!Array.isArray(i)||t<0)return;const s=i[t];return!!Array.isArray(s)&&s.indexOf(r)>-1}static _modifiers(e){return Object.freeze({shift:!(!e||!e.shiftKey),ctrl:!(!e||!e.ctrlKey),alt:!(!e||!e.altKey),meta:!(!e||!e.metaKey)})}_reserve(t,r){const i=e._normaliseBox(r),s=this._reserved?this._reserved.get(t):void 0;if(i){if(s&&s.left===i.left&&s.right===i.right&&s.top===i.top&&s.bottom===i.bottom)return;this._reserved||(this._reserved=new Map),this._reserved.set(t,i)}else{if(!s||!this._reserved)return;this._reserved.delete(t)}this._resizeForReservation()}static _normaliseBox(e){if(!e||"object"!=typeof e)return null;const t=e=>Number.isFinite(e)&&e>0?Math.round(e):0,r={left:t(e.left),right:t(e.right),top:t(e.top),bottom:t(e.bottom)};return r.left||r.right||r.top||r.bottom?r:null}reservedBox(){if(!this._reserved||0===this._reserved.size)return e.NO_RESERVATION;const t={left:0,right:0,top:0,bottom:0};for(const e of this._reserved.values())t.left+=e.left,t.right+=e.right,t.top+=e.top,t.bottom+=e.bottom;return t}_resizeForReservation(){null==this._reserveTimer&&(this._reserveTimer=setTimeout(()=>{this._reserveTimer=null;const e=this.w.globals;e.isDestroyed||(e.resized=!0,e.dataChanged=!1,this._update("a plugin reservation"))},0))}_update(e){try{Promise.resolve(this.ctx.update()).catch(t=>console.error(`[apexcharts] re-render for ${e} failed:`,t))}catch(e){}}_highlight(e,t){const r=this.w,i=this.ctx.highlightFilter;if(!i)return null;if(!r.globals.axisCharts)return null;if(!i.canDrawParts())return null;if(i.callerCarriesParts())return null;const s=function(e,t,r){const i=O(r);if(!i.length)return null;const s={owner:t,entries:i};return function(e){return e.weaveHighlights||(e.weaveHighlights={records:[]}),e.weaveHighlights}(e).records.push(s),s}(r,e,t);return s?(this._redrawForHighlight(),Object.freeze({release:()=>{!function(e,t){if(!e||!e.weaveHighlights||!t)return;const r=e.weaveHighlights.records,i=r.indexOf(t);i>-1&&r.splice(i,1)}(r,s),this._redrawForHighlight()},update:e=>{s.entries=O(e),this._redrawForHighlight()}})):null}_redrawForHighlight(){null==this._highlightTimer&&(this._highlightTimer=setTimeout(()=>{this._highlightTimer=null;const e=this.w.globals;e.isDestroyed||(e.dataChanged=!0,this._update("plugin highlight parts"))},0))}_derivedNames(){const e=new Set;if(!this._derived)return e;for(const t of this._derived.values())for(const r of t)e.add(r);return e}_repairInitialSeries(){const e=this._derivedNames();if(!e.size)return;const t=this.w.globals,r=t=>!e.has(String(t&&t.name)),i=e=>{if(!Array.isArray(e))return null;const t=e.filter(r);return t.length&&t.length!==e.length?t:null};try{const e=i(t._initialSeriesPeek);e&&(t.initialSeries=e);const r=t.initialConfig,s=r&&i(r.series);s&&(r.series=s)}catch(e){}}_token(e){const t=this.w,r=t.globals;switch(e){case"foreColor":return t.config.chart.foreColor;case"background":return t.config.chart.background;case"accent":case"primary":return r.colors?r.colors[0]:void 0;default:return/^series-\d+$/.test(e)&&r.colors?r.colors[Number(e.split("-")[1])]:void 0}}_layer(e,{z:t="front",className:r=""}={}){let i=this._layers.get(e);if(!i){i=this.ctx.graphics.group({class:`apexcharts-plugin-${e} ${r}`.trim()});const s=this.w.dom.elGraphical.node;"behind"===t?s.insertBefore(i.node,s.firstChild):s.appendChild(i.node),i.node.setAttribute("aria-hidden","true"),this._layers.set(e,i)}return function(e,t,r){const i=t=>(t&&e.add(t),t),s={get node(){return e.node},path(e={}){const{d:r="",stroke:s="#000",width:n=1,fill:o="none",opacity:a=1,dash:l=0,className:c=""}=e;return i(t.drawPath({d:r,stroke:s,strokeWidth:n,fill:o,fillOpacity:"none"===o?0:a,strokeOpacity:a,strokeDashArray:l,classes:c}))},line(e={}){const{x1:r,y1:s,x2:n,y2:o,stroke:a="#000",width:l=1,dash:c=0}=e;return i(t.drawLine(r,s,n,o,a,c,l))},rect(e={}){const{x:r=0,y:s=0,w:n=0,h:o=0,r:a=0,fill:l="#000",stroke:c=null,opacity:d=1}=e;return i(t.drawRect(r,s,n,o,a,l,d,null!=c?1:null,c))},circle(e={}){const{cx:r=0,cy:s=0,r:n=0,fill:o="#000",stroke:a=null}=e;return i(t.drawCircle(n,{cx:r,cy:s,fill:o,stroke:a||"none"}))},text(e={}){const{x:r=0,y:s=0,text:n="",color:o,size:a,anchor:l="start",weight:c}=e;return i(t.drawText({x:r,y:s,text:n,textAnchor:l,fontSize:a,foreColor:o,fontWeight:c}))},clear(){const t=e.node;for(;t.firstChild;)t.removeChild(t.firstChild);return r&&r(),s}};return s}(i,this.ctx.graphics,()=>this._undeclare(e))}_undeclare(e){this._declared&&this._declared.delete(e)}_resetLayers(){this._layers.forEach(e=>e.node.remove()),this._layers.clear(),this._declared=null}_declare(e,t){if(!t||"string"!=typeof t.id||!t.id)return void console.warn(`[apexcharts] plugin "${e}" declared something with no id; ignored.`);this._declared||(this._declared=new Map);const r=this._declared.get(e)||[],i={id:t.id,label:t.label?String(t.label):t.id,visible:!1!==t.visible},s=r.findIndex(e=>e.id===i.id);s>-1?r[s]=i:r.push(i),this._declared.set(e,r)}_reconcile(){const e=this.w.config.plugins||[];if(e===this._lastPluginsRef)return;this._lastPluginsRef=e;const t=new Map(e.map((e,t)=>[e.name,{entry:e,order:null!=e.order?e.order:t}]));for(let e=this.active.length-1;e>=0;e--){const r=this.active[e],i=t.get(r.def.name);i?r.options=Object.freeze(n({},i.entry.options||{})):(this._guard(r,"destroy",()=>r.def.destroy&&r.def.destroy(r.api)),this.active.splice(e,1),this._forget(r.def.name))}const r=new Set(this.active.map(e=>e.def.name)),i=[];t.forEach((e,t)=>{r.has(t)||i.push(e)}),i.sort((e,t)=>e.order-t.order).forEach(e=>this._activate(e.entry))}_forget(e){const t=this.w,r=function(e,t){if(!e.weaveClaims)return!1;let r=!1;for(const[i,s]of e.weaveClaims.byOption){const n=s.filter(e=>e.owner!==t);n.length!==s.length&&(e.weaveClaims.byOption.set(i,n),r=!0)}return r}(t,e),i=function(e,t){if(!e||!e.weaveHighlights)return!1;const r=e.weaveHighlights.records,i=r.filter(e=>e.owner!==t);return i.length!==r.length&&(e.weaveHighlights.records=i,!0)}(t,e);this._pointerSubs&&this._pointerSubs.delete(e),this._derived&&this._derived.delete(e),this._declared&&this._declared.delete(e);const s=!(!this._reserved||!this._reserved.has(e));this._reserve(e,null),!r&&!i||s||this._redrawForHighlight()}teardown(e){if(!e){this.dispatch("destroy");for(const e of this.active)this._guard(e,"destroy",()=>e.def.destroy&&e.def.destroy(e.api));for(const e of this.active)this._forget(e.def.name);if(this.active=[],this._derived=null,this._reserved=null,this._pointerSubs=null,this._declared=null,this._pointerWired){for(const[e,t]of this._pointerWired)this.ctx.removeEventListener&&this.ctx.removeEventListener(e,t);this._pointerWired=null}null!=this._reserveTimer&&(clearTimeout(this._reserveTimer),this._reserveTimer=null),null!=this._highlightTimer&&(clearTimeout(this._highlightTimer),this._highlightTimer=null),this._updatedWired&&(this.ctx.removeEventListener&&this.ctx.removeEventListener("updated",this._onUpdated),this._updatedWired=!1)}this._layers.clear()}};var P,j,k;P=A,j="NO_RESERVATION",k=Object.freeze({left:0,right:0,top:0,bottom:0}),s(P,"symbol"!=typeof j?j+"":j,k);let z=A;a.default.registerFeatures({weave:z}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>a.default});
@@ -16,7 +16,7 @@ var __spreadValues = (a, b) => {
16
16
  };
17
17
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
18
18
  /*!
19
- * ApexCharts v8.2.0
19
+ * ApexCharts v8.3.1
20
20
  * (c) 2018-2026 ApexCharts
21
21
  */
22
22
  import * as ApexCharts from "apexcharts/core";
@@ -872,19 +872,25 @@ const _WeaveHost = class _WeaveHost {
872
872
  this._setScales(extra.xyRatios);
873
873
  }
874
874
  const pass = extra && extra.pass || "full";
875
+ const host = this;
875
876
  let data = null;
876
877
  for (const record of this.active) {
877
878
  if (record.disabled) continue;
878
879
  const fns = record.handlers.get(hook);
879
880
  if (!fns || !fns.length) continue;
880
- if (data === null) {
881
- data = this._dataSnapshot();
882
- this._lastData = data;
883
- }
884
881
  const payload = {
885
882
  api: record.api,
886
883
  scales: this._currentScales,
887
- data,
884
+ // Built on first read and shared with api.data for the rest of this
885
+ // pass: a handler that never reads it costs no snapshot.
886
+ get data() {
887
+ return data || (data = host._lastData || (host._lastData = host._dataSnapshot()));
888
+ },
889
+ // A handler may still overwrite its own payload.data, as it could
890
+ // when this was a plain field.
891
+ set data(v) {
892
+ Object.defineProperty(this, "data", { value: v, writable: true });
893
+ },
888
894
  pass,
889
895
  hook
890
896
  };
@@ -1520,12 +1526,7 @@ const _WeaveHost = class _WeaveHost {
1520
1526
  * groups), so without this, fast-path redraws would duplicate plugin output.
1521
1527
  */
1522
1528
  _resetLayers() {
1523
- const el = this.w.dom.elGraphical;
1524
- const parent = el && el.node;
1525
- if (parent) {
1526
- const groups = parent.querySelectorAll('g[class*="apexcharts-plugin-"]');
1527
- Array.prototype.forEach.call(groups, (n) => n.remove());
1528
- }
1529
+ this._layers.forEach((g) => g.node.remove());
1529
1530
  this._layers.clear();
1530
1531
  this._declared = null;
1531
1532
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.2.0
2
+ * ApexCharts v8.3.1
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- !function(e){var t="undefined"!=typeof globalThis?globalThis:self,r=t.ApexCharts;if(r&&r.__internals)return e.call(t);if(r)throw new Error("ApexCharts: dist/features/weave.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 e.call(t);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/features/weave.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 i={file:"dist/features/weave.js",run:e,done:!1},s=t.__apexcharts_pending_addons__||(t.__apexcharts_pending_addons__=[]);s.push(i),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!i.done){var r=t.ApexCharts;if(r)if(r.__internals){i.done=!0;var n=s.indexOf(i);-1!==n&&s.splice(n,1);try{e.call(t),r.__drainsAddons||t.console.warn("ApexCharts: dist/features/weave.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(e){t.console.error("ApexCharts: dist/features/weave.js could not register with the ApexCharts script on this page: "+(e&&e.message))}}else t.console.error("ApexCharts: dist/features/weave.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 t.console.warn("ApexCharts: dist/features/weave.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 e,t;e=this,t=function(e){"use strict";var t=Object.defineProperty,r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,n=(e,r,i)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i,a=(e,t)=>{for(var a in t||(t={}))i.call(t,a)&&n(e,a,t[a]);if(r)for(var a of r(t))s.call(t,a)&&n(e,a,t[a]);return e};const o=globalThis.ApexCharts,l="__apexcharts_plugins__";function c(e){return function(){const e=globalThis;return e[l]||(e[l]={}),e[l]}()[e]||null}const d=Object.freeze({"stroke.dashArray":Object.freeze({type:"number"}),"dataLabels.enabledOnSeries":Object.freeze({type:"boolean"})});function h(e,t){const r=function(e){return e.weaveClaims||(e.weaveClaims={byOption:new Map}),e.weaveClaims}(e);return r.byOption.has(t)||r.byOption.set(t,[]),r.byOption.get(t)}function f(e,t){const r=d[e],i=[];for(const s of Array.isArray(t)?t:[])!s||"string"!=typeof s.series&&"number"!=typeof s.series?console.warn(`[apexcharts] claim on "${e}": each entry needs a series name or index.`):typeof s.value===r.type?i.push({series:s.series,value:s.value}):console.warn(`[apexcharts] claim on "${e}": expected a ${r.type} for series ${String(s.series)}, got ${typeof s.value}.`);return i}const u=["xaxis","yaxis","points","texts","images"];function p(e,t){const r=e.globals;return(r.collapsedSeriesIndices||[]).indexOf(t)<0&&(r.ancillaryCollapsedSeriesIndices||[]).indexOf(t)<0}function g(e,t){const r=t&&t._derived,i=e=>{if(!r)return"core";for(const[t,i]of r)if(i.indexOf(e)>-1)return t;return"core"};return(e.config.series||[]).map((t,r)=>{const s=t&&t.name?String(t.name):`Series ${r+1}`;return{id:`series:${r}`,kind:"series",label:s,owner:i(s),visible:p(e,r)}})}function _(e){const t=e.config.annotations||{},r=[];for(const e of u)(Array.isArray(t[e])?t[e]:[]).forEach((t,i)=>{t&&r.push({id:t.id?String(t.id):`annotation:${e}:${i}`,kind:"annotation",label:y(t,e,i),owner:t.owner?String(t.owner):"core",visible:!0})});return r}function y(e,t,r){const i=e.label&&e.label.text;return i?String(i):e.text?String(e.text):e.id?String(e.id):`${t} annotation ${r+1}`}const m=Object.freeze(["layer","derived","reserve","pointer","stroke-info","claim","drawn","observations","scale-orientation","highlight"]),v=["updateOptions","updateSeries","appendData","appendSeries","toggleSeries","showSeries","hideSeries","highlightSeries","isSeriesHidden","zoomX","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","dataURI","exportToCSV"];function b(e){const t={};return v.forEach(r=>{"function"==typeof e[r]&&(t[r]=e[r].bind(e))}),Object.freeze(t)}function x(e,t){const r=e.ctx,i=e.w,s={name:t.def.name,version:7,get options(){return t.options},on(e,r){const i=t.handlers;return i.has(e)||i.set(e,[]),i.get(e).push(r),s},off(e,r){const i=t.handlers.get(e);if(i){const e=i.indexOf(r);e>-1&&i.splice(e,1)}return s},store:{},layer:r=>e._layer(t.def.name,r||{}),get scales(){return e._currentScales},get data(){return e._lastData||(e._lastData=e._dataSnapshot())},theme:Object.freeze({get mode(){return i.config.theme.mode},get foreColor(){return i.config.chart.foreColor},seriesColor:e=>i.globals.colors[e],token:t=>e._token(t)}),chart:b(r),get info(){return Object.freeze({type:String(i.config.chart&&(i.config.chart.requestedType||i.config.chart.type)||"line"),axisChart:!0===i.globals.axisCharts,datetimeX:!(!i.config.xaxis||"datetime"!==i.config.xaxis.type),horizontalBars:!!(i.config.plotOptions&&i.config.plotOptions.bar&&i.config.plotOptions.bar.horizontal),dataLabels:Object.freeze({enabled:!(!i.config.dataLabels||!i.config.dataLabels.enabled),enabledOnSeries:Array.isArray(i.config.dataLabels&&i.config.dataLabels.enabledOnSeries)?i.config.dataLabels.enabledOnSeries.slice():null}),stroke:Object.freeze({dashArray:Array.isArray(i.config.stroke&&i.config.stroke.dashArray)?i.config.stroke.dashArray.slice():i.config.stroke&&i.config.stroke.dashArray||0}),title:String(i.config.title&&i.config.title.text||"")})},get categories(){return e._categories()},markDerived:r=>(e._markDerived(t.def.name,r),s),reserve:r=>(e._reserve(t.def.name,r),s),claim(e,r){const s=function(e,t,r,i){if(!Object.prototype.hasOwnProperty.call(d,r))return console.warn(`[apexcharts] "${r}" is not a claimable option. Claimable: ${Object.keys(d).join(", ")}.`),null;const s={owner:t,option:r,entries:f(r,i)};return h(e,r).push(s),s}(i,t.def.name,e,r);return s?Object.freeze({release(){!function(e,t){if(!e.weaveClaims||!t)return;const r=e.weaveClaims.byOption.get(t.option);if(!r)return;const i=r.indexOf(t);i>-1&&r.splice(i,1)}(i,s)},update(t){s.entries=f(e,t)}}):null},highlight:r=>e._highlight(t.def.name,r),drawn:()=>Object.freeze(function(e,t){const r=[];if(t&&t._declared)for(const[e,i]of t._declared)for(const t of i)r.push({id:`overlay:${e}:${t.id}`,kind:"overlay",label:t.label,owner:e,visible:!1!==t.visible});return[...g(e,t),..._(e),...r]}(i,e).map(e=>Object.freeze(e))),declare:r=>(e._declare(t.def.name,r),s),pointer:r=>e._onPointer(t.def.name,r),emit(e,i){r.events.fireEvent(`plugin:${t.def.name}:${e}`,[r,i])},get el(){return i.dom.baseEl}},n=w,a=m.filter(e=>n[e](s)),o=new Set(a),l=s;return l.capabilities=Object.freeze(a),l.can=e=>o.has(e),Object.freeze(s)}const w={layer:e=>"function"==typeof e.layer,derived:e=>"function"==typeof e.markDerived,reserve:e=>"function"==typeof e.reserve,pointer:e=>"function"==typeof e.pointer,"stroke-info":e=>!(!e.info||!e.info.stroke),claim:e=>"function"==typeof e.claim,drawn:e=>"function"==typeof e.drawn&&"function"==typeof e.declare,observations:()=>!0,"scale-orientation":()=>!0,highlight:e=>"function"==typeof e.highlight},A=globalThis.ApexCharts.__internals.__apex_CoreUtils;function S(e){const t=[];for(const r of Array.isArray(e)?e:[])!r||"string"!=typeof r.series&&"number"!=typeof r.series?console.warn("[apexcharts] highlight: each entry needs a series name or index."):Array.isArray(r.values)?t.push({series:r.series,values:r.values.map(e=>"number"==typeof e&&Number.isFinite(e)?e:null)}):console.warn(`[apexcharts] highlight: expected an array of values for series ${String(r.series)}, got ${typeof r.values}.`);return t}const O=class e{constructor(e,t){this.w=e,this.ctx=t,this.active=[],this._layers=new Map,this._currentScales=null,this._lastPluginsRef=null,this._lastData=null,this._updatedWired=!1,this._derived=null,this._reserved=null,this._reserveTimer=null,this._highlightTimer=null,this._pointerSubs=null,this._declared=null,this._pointerWired=null,this._onUpdated=this._onUpdated.bind(this),this._init()}_init(){(this.w.config.plugins||[]).map((e,t)=>({entry:e,order:null!=e.order?e.order:t})).sort((e,t)=>e.order-t.order).forEach(e=>this._activate(e.entry)),this._lastPluginsRef=this.w.config.plugins,this._wireUpdated()}_wireUpdated(){this._updatedWired||(this.ctx.addEventListener("updated",this._onUpdated),this._updatedWired=!0)}_onUpdated(){this._repairInitialSeries(),this.dispatch("afterUpdate",{pass:"update"})}_activate(e){const t=c(e.name);if(!t)return void console.error(`[apexcharts] plugin "${e.name}" is not registered.`);const r=null!=t.apiVersion?Math.trunc(t.apiVersion):1;if(!(r>=1)||r>7)return void console.error(`[apexcharts] plugin "${t.name}" targets Weave API v${t.apiVersion}, host is v7; skipped.`);const i={def:t,options:Object.freeze(a({},e.options||{})),handlers:new Map,disabled:!1,failures:0,api:null};i.api=x(this,i),this.active.push(i),this._guard(i,"setup",()=>t.setup(i.api))}dispatch(e,t){if("draw"===e&&(this._reconcile(),this._resetLayers()),this._lastData=null,!this.active.length)return;"afterParse"===e?this._currentScales=null:t&&"xyRatios"in t&&this._setScales(t.xyRatios);const r=t&&t.pass||"full";let i=null;for(const t of this.active){if(t.disabled)continue;const s=t.handlers.get(e);if(!s||!s.length)continue;null===i&&(i=this._dataSnapshot(),this._lastData=i);const n={api:t.api,scales:this._currentScales,data:i,pass:r,hook:e};for(const r of s.slice())this._guard(t,e,()=>r(n))}}_guard(e,t,r){if(!e.disabled)try{r()}catch(r){console.error(`[apexcharts] plugin "${e.def.name}" threw in "${t}":`,r),e.failures=(e.failures||0)+1,e.failures>=3&&(e.disabled=!0,this._forget(e.def.name),console.error(`[apexcharts] plugin "${e.def.name}" disabled after repeated errors.`))}}_setScales(e){const t=this.w,r=t.globals,i=t.layout;if(!e||!r.axisCharts)return void(this._currentScales=null);const s=e.xRatio,n=e.yRatio||[],a=e=>null!=n[e]?n[e]:n[0],o=e=>null!=r.maxYArr[e]?r.maxYArr[e]:r.maxY,l=e=>null!=r.minYArr[e]?r.minYArr[e]:r.minY,c=!!r.isBarHorizontal,d=!!t.axisFlags.isRangeBar,h=r.dataPoints>0&&(!t.axisFlags.isXNumeric||c),f=c&&d?t.labelData.labels.length:r.dataPoints,u=c?i.gridHeight:i.gridWidth,p=h&&f>0?u/f:0,g=new Map;h&&(d?t.labelData.labels:t.axisFlags.isXNumeric&&t.seriesData.seriesX[r.maxValsInArrayIndex]||[]).forEach((e,t)=>{g.has(e)||g.set(e,t)});const _=h?e=>p*((g.has(e)?g.get(e):e)+.5):e=>(e-r.minX)/s,y=e=>{const i=r.seriesYAxisReverseMap&&r.seriesYAxisReverseMap[e];return t.config.yaxis[null!=i?i:e]||t.config.yaxis[0]},m=e=>{const t=y(e);return!(!t||!t.reversed)};let v=null;const b=c?(e,t=0)=>{const r=Math.abs(o(t)-l(t)),s=r?(e-l(t))/r*i.gridWidth:0;return m(t)?i.gridWidth-s:s}:(e,s=0)=>{const n=((e,i)=>{const s=y(i);return s&&s.logarithmic&&!r.invalidLogScale?(v||(v=new A(t)),v.getLogVal(s.logBase,e,i)):null})(e,s);return null!==n?m(s)?n*i.gridHeight:(1-n)*i.gridHeight:m(s)?(e-l(s))/a(s):(o(s)-e)/a(s)};this._currentScales={x:_,y:b,domainX:h?[-.5,f-.5]:[r.minX,r.maxX],domainY:(e=0)=>[l(e),o(e)],transposed:c,point:(e,t,r=0)=>c?{x:b(t,r),y:_(e)}:{x:_(e),y:b(t,r)},gridWidth:i.gridWidth,gridHeight:i.gridHeight,ratios:e}}_dataSnapshot(){const e=this.w,t=e.globals,r=e.seriesData.series||[],i=e.seriesData.seriesX||[],s=Array.isArray(e.config.series)?e.config.series:[];return r.map((r,n)=>{const a=Array.isArray(r)?r:[r],o=i[n]||[],l=a.map((e,t)=>({x:null!=o[t]?o[t]:t,y:e})),c=s[n],d=c&&"object"==typeof c&&Array.isArray(c.data)?c.data:[],h=e.seriesObservations?e.seriesObservations[n]:null,f=h?{values:h.values.slice(),byPoint:h.byPoint.map(e=>e?e.slice():null)}:null;return{name:t.seriesNames?t.seriesNames[n]:void 0,hidden:(t.collapsedSeriesIndices||[]).includes(n),color:t.colors?t.colors[n]:void 0,points:l,raw:d,observations:f}})}_categories(){const e=this.w,t=e.globals,r=e.config.xaxis&&Array.isArray(e.config.xaxis.categories)?e.config.xaxis.categories:[],i=Array.isArray(t.categoryLabels)?t.categoryLabels:[],s=Array.isArray(t.labels)?t.labels:[],n=r.length?r:i.length?i:s,a=e.seriesData.series||[];let o=0;for(let e=0;e<a.length;e++){const t=a[e];Array.isArray(t)&&t.length>o&&(o=t.length)}o||(o=n.length);const l=[];for(let e=0;e<o;e++){const t=n[e];l.push(String(null==t?e+1:t))}return l}_markDerived(e,t){this._derived||(this._derived=new Map);const r=Array.isArray(t)?t.map(e=>String(e)):[];r.length?this._derived.set(e,r):this._derived.delete(e),this._repairInitialSeries()}_onPointer(e,t){if("function"!=typeof t)return()=>{};this._pointerSubs||(this._pointerSubs=new Map);const r=this._pointerSubs.get(e)||[];return r.push(t),this._pointerSubs.set(e,r),this._wirePointer(),()=>{const r=this._pointerSubs&&this._pointerSubs.get(e);if(!r)return;const i=r.indexOf(t);i>-1&&r.splice(i,1)}}_wirePointer(){if(this._pointerWired)return;if(!this.ctx||"function"!=typeof this.ctx.addEventListener)return;const e=[["enter","dataPointMouseEnter"],["leave","dataPointMouseLeave"],["select","dataPointSelection"]];this._pointerWired=[];for(const[t,r]of e){const e=(e,r,i)=>{this._emitPointer(t,i,e)};this.ctx.addEventListener(r,e),this._pointerWired.push([r,e])}}_emitPointer(t,r,i){if(!this._pointerSubs||!this._pointerSubs.size)return;const s=r&&"number"==typeof r.seriesIndex?r.seriesIndex:-1,n=r&&"number"==typeof r.dataPointIndex?r.dataPointIndex:-1,a=this._categories()||[],o=this.w,l=o&&o.config&&o.config.series||[],c={type:t,seriesIndex:s,dataPointIndex:n,category:n>-1?a[n]:void 0,seriesName:e._seriesName(l,s),selected:"select"===t?e._isSelected(r,s,n):void 0,modifiers:e._modifiers(i)};for(const[e,t]of this._pointerSubs){const r=this.active.find(t=>t.def.name===e);if(r)for(const e of t.slice())this._guard(r,"pointer",()=>e(c))}}static _seriesName(e,t){if(t<0)return;const r=e[t];return r&&"object"==typeof r&&"string"==typeof r.name?r.name:void 0}static _isSelected(e,t,r){const i=e&&e.selectedDataPoints;if(!Array.isArray(i)||t<0)return;const s=i[t];return!!Array.isArray(s)&&s.indexOf(r)>-1}static _modifiers(e){return Object.freeze({shift:!(!e||!e.shiftKey),ctrl:!(!e||!e.ctrlKey),alt:!(!e||!e.altKey),meta:!(!e||!e.metaKey)})}_reserve(t,r){const i=e._normaliseBox(r),s=this._reserved?this._reserved.get(t):void 0;if(i){if(s&&s.left===i.left&&s.right===i.right&&s.top===i.top&&s.bottom===i.bottom)return;this._reserved||(this._reserved=new Map),this._reserved.set(t,i)}else{if(!s||!this._reserved)return;this._reserved.delete(t)}this._resizeForReservation()}static _normaliseBox(e){if(!e||"object"!=typeof e)return null;const t=e=>Number.isFinite(e)&&e>0?Math.round(e):0,r={left:t(e.left),right:t(e.right),top:t(e.top),bottom:t(e.bottom)};return r.left||r.right||r.top||r.bottom?r:null}reservedBox(){if(!this._reserved||0===this._reserved.size)return e.NO_RESERVATION;const t={left:0,right:0,top:0,bottom:0};for(const e of this._reserved.values())t.left+=e.left,t.right+=e.right,t.top+=e.top,t.bottom+=e.bottom;return t}_resizeForReservation(){null==this._reserveTimer&&(this._reserveTimer=setTimeout(()=>{this._reserveTimer=null;const e=this.w.globals;e.isDestroyed||(e.resized=!0,e.dataChanged=!1,this._update("a plugin reservation"))},0))}_update(e){try{Promise.resolve(this.ctx.update()).catch(t=>console.error(`[apexcharts] re-render for ${e} failed:`,t))}catch(e){}}_highlight(e,t){const r=this.w,i=this.ctx.highlightFilter;if(!i)return null;if(!r.globals.axisCharts)return null;if(!i.canDrawParts())return null;if(i.callerCarriesParts())return null;const s=function(e,t,r){const i=S(r);if(!i.length)return null;const s={owner:t,entries:i};return function(e){return e.weaveHighlights||(e.weaveHighlights={records:[]}),e.weaveHighlights}(e).records.push(s),s}(r,e,t);return s?(this._redrawForHighlight(),Object.freeze({release:()=>{!function(e,t){if(!e||!e.weaveHighlights||!t)return;const r=e.weaveHighlights.records,i=r.indexOf(t);i>-1&&r.splice(i,1)}(r,s),this._redrawForHighlight()},update:e=>{s.entries=S(e),this._redrawForHighlight()}})):null}_redrawForHighlight(){null==this._highlightTimer&&(this._highlightTimer=setTimeout(()=>{this._highlightTimer=null;const e=this.w.globals;e.isDestroyed||(e.dataChanged=!0,this._update("plugin highlight parts"))},0))}_derivedNames(){const e=new Set;if(!this._derived)return e;for(const t of this._derived.values())for(const r of t)e.add(r);return e}_repairInitialSeries(){const e=this._derivedNames();if(!e.size)return;const t=this.w.globals,r=t=>!e.has(String(t&&t.name)),i=e=>{if(!Array.isArray(e))return null;const t=e.filter(r);return t.length&&t.length!==e.length?t:null};try{const e=i(t._initialSeriesPeek);e&&(t.initialSeries=e);const r=t.initialConfig,s=r&&i(r.series);s&&(r.series=s)}catch(e){}}_token(e){const t=this.w,r=t.globals;switch(e){case"foreColor":return t.config.chart.foreColor;case"background":return t.config.chart.background;case"accent":case"primary":return r.colors?r.colors[0]:void 0;default:return/^series-\d+$/.test(e)&&r.colors?r.colors[Number(e.split("-")[1])]:void 0}}_layer(e,{z:t="front",className:r=""}={}){let i=this._layers.get(e);if(!i){i=this.ctx.graphics.group({class:`apexcharts-plugin-${e} ${r}`.trim()});const s=this.w.dom.elGraphical.node;"behind"===t?s.insertBefore(i.node,s.firstChild):s.appendChild(i.node),i.node.setAttribute("aria-hidden","true"),this._layers.set(e,i)}return function(e,t,r){const i=t=>(t&&e.add(t),t),s={get node(){return e.node},path(e={}){const{d:r="",stroke:s="#000",width:n=1,fill:a="none",opacity:o=1,dash:l=0,className:c=""}=e;return i(t.drawPath({d:r,stroke:s,strokeWidth:n,fill:a,fillOpacity:"none"===a?0:o,strokeOpacity:o,strokeDashArray:l,classes:c}))},line(e={}){const{x1:r,y1:s,x2:n,y2:a,stroke:o="#000",width:l=1,dash:c=0}=e;return i(t.drawLine(r,s,n,a,o,c,l))},rect(e={}){const{x:r=0,y:s=0,w:n=0,h:a=0,r:o=0,fill:l="#000",stroke:c=null,opacity:d=1}=e;return i(t.drawRect(r,s,n,a,o,l,d,null!=c?1:null,c))},circle(e={}){const{cx:r=0,cy:s=0,r:n=0,fill:a="#000",stroke:o=null}=e;return i(t.drawCircle(n,{cx:r,cy:s,fill:a,stroke:o||"none"}))},text(e={}){const{x:r=0,y:s=0,text:n="",color:a,size:o,anchor:l="start",weight:c}=e;return i(t.drawText({x:r,y:s,text:n,textAnchor:l,fontSize:o,foreColor:a,fontWeight:c}))},clear(){const t=e.node;for(;t.firstChild;)t.removeChild(t.firstChild);return r&&r(),s}};return s}(i,this.ctx.graphics,()=>this._undeclare(e))}_undeclare(e){this._declared&&this._declared.delete(e)}_resetLayers(){const e=this.w.dom.elGraphical,t=e&&e.node;if(t){const e=t.querySelectorAll('g[class*="apexcharts-plugin-"]');Array.prototype.forEach.call(e,e=>e.remove())}this._layers.clear(),this._declared=null}_declare(e,t){if(!t||"string"!=typeof t.id||!t.id)return void console.warn(`[apexcharts] plugin "${e}" declared something with no id; ignored.`);this._declared||(this._declared=new Map);const r=this._declared.get(e)||[],i={id:t.id,label:t.label?String(t.label):t.id,visible:!1!==t.visible},s=r.findIndex(e=>e.id===i.id);s>-1?r[s]=i:r.push(i),this._declared.set(e,r)}_reconcile(){const e=this.w.config.plugins||[];if(e===this._lastPluginsRef)return;this._lastPluginsRef=e;const t=new Map(e.map((e,t)=>[e.name,{entry:e,order:null!=e.order?e.order:t}]));for(let e=this.active.length-1;e>=0;e--){const r=this.active[e],i=t.get(r.def.name);i?r.options=Object.freeze(a({},i.entry.options||{})):(this._guard(r,"destroy",()=>r.def.destroy&&r.def.destroy(r.api)),this.active.splice(e,1),this._forget(r.def.name))}const r=new Set(this.active.map(e=>e.def.name)),i=[];t.forEach((e,t)=>{r.has(t)||i.push(e)}),i.sort((e,t)=>e.order-t.order).forEach(e=>this._activate(e.entry))}_forget(e){const t=this.w,r=function(e,t){if(!e.weaveClaims)return!1;let r=!1;for(const[i,s]of e.weaveClaims.byOption){const n=s.filter(e=>e.owner!==t);n.length!==s.length&&(e.weaveClaims.byOption.set(i,n),r=!0)}return r}(t,e),i=function(e,t){if(!e||!e.weaveHighlights)return!1;const r=e.weaveHighlights.records,i=r.filter(e=>e.owner!==t);return i.length!==r.length&&(e.weaveHighlights.records=i,!0)}(t,e);this._pointerSubs&&this._pointerSubs.delete(e),this._derived&&this._derived.delete(e),this._declared&&this._declared.delete(e);const s=!(!this._reserved||!this._reserved.has(e));this._reserve(e,null),!r&&!i||s||this._redrawForHighlight()}teardown(e){if(!e){this.dispatch("destroy");for(const e of this.active)this._guard(e,"destroy",()=>e.def.destroy&&e.def.destroy(e.api));for(const e of this.active)this._forget(e.def.name);if(this.active=[],this._derived=null,this._reserved=null,this._pointerSubs=null,this._declared=null,this._pointerWired){for(const[e,t]of this._pointerWired)this.ctx.removeEventListener&&this.ctx.removeEventListener(e,t);this._pointerWired=null}null!=this._reserveTimer&&(clearTimeout(this._reserveTimer),this._reserveTimer=null),null!=this._highlightTimer&&(clearTimeout(this._highlightTimer),this._highlightTimer=null),this._updatedWired&&(this.ctx.removeEventListener&&this.ctx.removeEventListener("updated",this._onUpdated),this._updatedWired=!1)}this._layers.clear()}};var C,j,k;C=O,j="NO_RESERVATION",k=Object.freeze({left:0,right:0,top:0,bottom:0}),n(C,"symbol"!=typeof j?j+"":j,k);let P=O;o.registerFeatures({weave:P}),e.default=o,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ApexWeave={})});
5
+ !function(e){var t="undefined"!=typeof globalThis?globalThis:self,r=t.ApexCharts;if(r&&r.__internals)return e.call(t);if(r)throw new Error("ApexCharts: dist/features/weave.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 e.call(t);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/features/weave.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 i={file:"dist/features/weave.js",run:e,done:!1},s=t.__apexcharts_pending_addons__||(t.__apexcharts_pending_addons__=[]);s.push(i),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!i.done){var r=t.ApexCharts;if(r)if(r.__internals){i.done=!0;var n=s.indexOf(i);-1!==n&&s.splice(n,1);try{e.call(t),r.__drainsAddons||t.console.warn("ApexCharts: dist/features/weave.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(e){t.console.error("ApexCharts: dist/features/weave.js could not register with the ApexCharts script on this page: "+(e&&e.message))}}else t.console.error("ApexCharts: dist/features/weave.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 t.console.warn("ApexCharts: dist/features/weave.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 e,t;e=this,t=function(e){"use strict";var t=Object.defineProperty,r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,n=(e,r,i)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i,a=(e,t)=>{for(var a in t||(t={}))i.call(t,a)&&n(e,a,t[a]);if(r)for(var a of r(t))s.call(t,a)&&n(e,a,t[a]);return e};const o=globalThis.ApexCharts,l="__apexcharts_plugins__";function c(e){return function(){const e=globalThis;return e[l]||(e[l]={}),e[l]}()[e]||null}const d=Object.freeze({"stroke.dashArray":Object.freeze({type:"number"}),"dataLabels.enabledOnSeries":Object.freeze({type:"boolean"})});function h(e,t){const r=function(e){return e.weaveClaims||(e.weaveClaims={byOption:new Map}),e.weaveClaims}(e);return r.byOption.has(t)||r.byOption.set(t,[]),r.byOption.get(t)}function f(e,t){const r=d[e],i=[];for(const s of Array.isArray(t)?t:[])!s||"string"!=typeof s.series&&"number"!=typeof s.series?console.warn(`[apexcharts] claim on "${e}": each entry needs a series name or index.`):typeof s.value===r.type?i.push({series:s.series,value:s.value}):console.warn(`[apexcharts] claim on "${e}": expected a ${r.type} for series ${String(s.series)}, got ${typeof s.value}.`);return i}const u=["xaxis","yaxis","points","texts","images"];function p(e,t){const r=e.globals;return(r.collapsedSeriesIndices||[]).indexOf(t)<0&&(r.ancillaryCollapsedSeriesIndices||[]).indexOf(t)<0}function g(e,t){const r=t&&t._derived,i=e=>{if(!r)return"core";for(const[t,i]of r)if(i.indexOf(e)>-1)return t;return"core"};return(e.config.series||[]).map((t,r)=>{const s=t&&t.name?String(t.name):`Series ${r+1}`;return{id:`series:${r}`,kind:"series",label:s,owner:i(s),visible:p(e,r)}})}function _(e){const t=e.config.annotations||{},r=[];for(const e of u)(Array.isArray(t[e])?t[e]:[]).forEach((t,i)=>{t&&r.push({id:t.id?String(t.id):`annotation:${e}:${i}`,kind:"annotation",label:y(t,e,i),owner:t.owner?String(t.owner):"core",visible:!0})});return r}function y(e,t,r){const i=e.label&&e.label.text;return i?String(i):e.text?String(e.text):e.id?String(e.id):`${t} annotation ${r+1}`}const m=Object.freeze(["layer","derived","reserve","pointer","stroke-info","claim","drawn","observations","scale-orientation","highlight"]),v=["updateOptions","updateSeries","appendData","appendSeries","toggleSeries","showSeries","hideSeries","highlightSeries","isSeriesHidden","zoomX","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","dataURI","exportToCSV"];function b(e){const t={};return v.forEach(r=>{"function"==typeof e[r]&&(t[r]=e[r].bind(e))}),Object.freeze(t)}function x(e,t){const r=e.ctx,i=e.w,s={name:t.def.name,version:7,get options(){return t.options},on(e,r){const i=t.handlers;return i.has(e)||i.set(e,[]),i.get(e).push(r),s},off(e,r){const i=t.handlers.get(e);if(i){const e=i.indexOf(r);e>-1&&i.splice(e,1)}return s},store:{},layer:r=>e._layer(t.def.name,r||{}),get scales(){return e._currentScales},get data(){return e._lastData||(e._lastData=e._dataSnapshot())},theme:Object.freeze({get mode(){return i.config.theme.mode},get foreColor(){return i.config.chart.foreColor},seriesColor:e=>i.globals.colors[e],token:t=>e._token(t)}),chart:b(r),get info(){return Object.freeze({type:String(i.config.chart&&(i.config.chart.requestedType||i.config.chart.type)||"line"),axisChart:!0===i.globals.axisCharts,datetimeX:!(!i.config.xaxis||"datetime"!==i.config.xaxis.type),horizontalBars:!!(i.config.plotOptions&&i.config.plotOptions.bar&&i.config.plotOptions.bar.horizontal),dataLabels:Object.freeze({enabled:!(!i.config.dataLabels||!i.config.dataLabels.enabled),enabledOnSeries:Array.isArray(i.config.dataLabels&&i.config.dataLabels.enabledOnSeries)?i.config.dataLabels.enabledOnSeries.slice():null}),stroke:Object.freeze({dashArray:Array.isArray(i.config.stroke&&i.config.stroke.dashArray)?i.config.stroke.dashArray.slice():i.config.stroke&&i.config.stroke.dashArray||0}),title:String(i.config.title&&i.config.title.text||"")})},get categories(){return e._categories()},markDerived:r=>(e._markDerived(t.def.name,r),s),reserve:r=>(e._reserve(t.def.name,r),s),claim(e,r){const s=function(e,t,r,i){if(!Object.prototype.hasOwnProperty.call(d,r))return console.warn(`[apexcharts] "${r}" is not a claimable option. Claimable: ${Object.keys(d).join(", ")}.`),null;const s={owner:t,option:r,entries:f(r,i)};return h(e,r).push(s),s}(i,t.def.name,e,r);return s?Object.freeze({release(){!function(e,t){if(!e.weaveClaims||!t)return;const r=e.weaveClaims.byOption.get(t.option);if(!r)return;const i=r.indexOf(t);i>-1&&r.splice(i,1)}(i,s)},update(t){s.entries=f(e,t)}}):null},highlight:r=>e._highlight(t.def.name,r),drawn:()=>Object.freeze(function(e,t){const r=[];if(t&&t._declared)for(const[e,i]of t._declared)for(const t of i)r.push({id:`overlay:${e}:${t.id}`,kind:"overlay",label:t.label,owner:e,visible:!1!==t.visible});return[...g(e,t),..._(e),...r]}(i,e).map(e=>Object.freeze(e))),declare:r=>(e._declare(t.def.name,r),s),pointer:r=>e._onPointer(t.def.name,r),emit(e,i){r.events.fireEvent(`plugin:${t.def.name}:${e}`,[r,i])},get el(){return i.dom.baseEl}},n=w,a=m.filter(e=>n[e](s)),o=new Set(a),l=s;return l.capabilities=Object.freeze(a),l.can=e=>o.has(e),Object.freeze(s)}const w={layer:e=>"function"==typeof e.layer,derived:e=>"function"==typeof e.markDerived,reserve:e=>"function"==typeof e.reserve,pointer:e=>"function"==typeof e.pointer,"stroke-info":e=>!(!e.info||!e.info.stroke),claim:e=>"function"==typeof e.claim,drawn:e=>"function"==typeof e.drawn&&"function"==typeof e.declare,observations:()=>!0,"scale-orientation":()=>!0,highlight:e=>"function"==typeof e.highlight},A=globalThis.ApexCharts.__internals.__apex_CoreUtils;function S(e){const t=[];for(const r of Array.isArray(e)?e:[])!r||"string"!=typeof r.series&&"number"!=typeof r.series?console.warn("[apexcharts] highlight: each entry needs a series name or index."):Array.isArray(r.values)?t.push({series:r.series,values:r.values.map(e=>"number"==typeof e&&Number.isFinite(e)?e:null)}):console.warn(`[apexcharts] highlight: expected an array of values for series ${String(r.series)}, got ${typeof r.values}.`);return t}const O=class e{constructor(e,t){this.w=e,this.ctx=t,this.active=[],this._layers=new Map,this._currentScales=null,this._lastPluginsRef=null,this._lastData=null,this._updatedWired=!1,this._derived=null,this._reserved=null,this._reserveTimer=null,this._highlightTimer=null,this._pointerSubs=null,this._declared=null,this._pointerWired=null,this._onUpdated=this._onUpdated.bind(this),this._init()}_init(){(this.w.config.plugins||[]).map((e,t)=>({entry:e,order:null!=e.order?e.order:t})).sort((e,t)=>e.order-t.order).forEach(e=>this._activate(e.entry)),this._lastPluginsRef=this.w.config.plugins,this._wireUpdated()}_wireUpdated(){this._updatedWired||(this.ctx.addEventListener("updated",this._onUpdated),this._updatedWired=!0)}_onUpdated(){this._repairInitialSeries(),this.dispatch("afterUpdate",{pass:"update"})}_activate(e){const t=c(e.name);if(!t)return void console.error(`[apexcharts] plugin "${e.name}" is not registered.`);const r=null!=t.apiVersion?Math.trunc(t.apiVersion):1;if(!(r>=1)||r>7)return void console.error(`[apexcharts] plugin "${t.name}" targets Weave API v${t.apiVersion}, host is v7; skipped.`);const i={def:t,options:Object.freeze(a({},e.options||{})),handlers:new Map,disabled:!1,failures:0,api:null};i.api=x(this,i),this.active.push(i),this._guard(i,"setup",()=>t.setup(i.api))}dispatch(e,t){if("draw"===e&&(this._reconcile(),this._resetLayers()),this._lastData=null,!this.active.length)return;"afterParse"===e?this._currentScales=null:t&&"xyRatios"in t&&this._setScales(t.xyRatios);const r=t&&t.pass||"full",i=this;let s=null;for(const t of this.active){if(t.disabled)continue;const n=t.handlers.get(e);if(!n||!n.length)continue;const a={api:t.api,scales:this._currentScales,get data(){return s||(s=i._lastData||(i._lastData=i._dataSnapshot()))},set data(e){Object.defineProperty(this,"data",{value:e,writable:!0})},pass:r,hook:e};for(const r of n.slice())this._guard(t,e,()=>r(a))}}_guard(e,t,r){if(!e.disabled)try{r()}catch(r){console.error(`[apexcharts] plugin "${e.def.name}" threw in "${t}":`,r),e.failures=(e.failures||0)+1,e.failures>=3&&(e.disabled=!0,this._forget(e.def.name),console.error(`[apexcharts] plugin "${e.def.name}" disabled after repeated errors.`))}}_setScales(e){const t=this.w,r=t.globals,i=t.layout;if(!e||!r.axisCharts)return void(this._currentScales=null);const s=e.xRatio,n=e.yRatio||[],a=e=>null!=n[e]?n[e]:n[0],o=e=>null!=r.maxYArr[e]?r.maxYArr[e]:r.maxY,l=e=>null!=r.minYArr[e]?r.minYArr[e]:r.minY,c=!!r.isBarHorizontal,d=!!t.axisFlags.isRangeBar,h=r.dataPoints>0&&(!t.axisFlags.isXNumeric||c),f=c&&d?t.labelData.labels.length:r.dataPoints,u=c?i.gridHeight:i.gridWidth,p=h&&f>0?u/f:0,g=new Map;h&&(d?t.labelData.labels:t.axisFlags.isXNumeric&&t.seriesData.seriesX[r.maxValsInArrayIndex]||[]).forEach((e,t)=>{g.has(e)||g.set(e,t)});const _=h?e=>p*((g.has(e)?g.get(e):e)+.5):e=>(e-r.minX)/s,y=e=>{const i=r.seriesYAxisReverseMap&&r.seriesYAxisReverseMap[e];return t.config.yaxis[null!=i?i:e]||t.config.yaxis[0]},m=e=>{const t=y(e);return!(!t||!t.reversed)};let v=null;const b=c?(e,t=0)=>{const r=Math.abs(o(t)-l(t)),s=r?(e-l(t))/r*i.gridWidth:0;return m(t)?i.gridWidth-s:s}:(e,s=0)=>{const n=((e,i)=>{const s=y(i);return s&&s.logarithmic&&!r.invalidLogScale?(v||(v=new A(t)),v.getLogVal(s.logBase,e,i)):null})(e,s);return null!==n?m(s)?n*i.gridHeight:(1-n)*i.gridHeight:m(s)?(e-l(s))/a(s):(o(s)-e)/a(s)};this._currentScales={x:_,y:b,domainX:h?[-.5,f-.5]:[r.minX,r.maxX],domainY:(e=0)=>[l(e),o(e)],transposed:c,point:(e,t,r=0)=>c?{x:b(t,r),y:_(e)}:{x:_(e),y:b(t,r)},gridWidth:i.gridWidth,gridHeight:i.gridHeight,ratios:e}}_dataSnapshot(){const e=this.w,t=e.globals,r=e.seriesData.series||[],i=e.seriesData.seriesX||[],s=Array.isArray(e.config.series)?e.config.series:[];return r.map((r,n)=>{const a=Array.isArray(r)?r:[r],o=i[n]||[],l=a.map((e,t)=>({x:null!=o[t]?o[t]:t,y:e})),c=s[n],d=c&&"object"==typeof c&&Array.isArray(c.data)?c.data:[],h=e.seriesObservations?e.seriesObservations[n]:null,f=h?{values:h.values.slice(),byPoint:h.byPoint.map(e=>e?e.slice():null)}:null;return{name:t.seriesNames?t.seriesNames[n]:void 0,hidden:(t.collapsedSeriesIndices||[]).includes(n),color:t.colors?t.colors[n]:void 0,points:l,raw:d,observations:f}})}_categories(){const e=this.w,t=e.globals,r=e.config.xaxis&&Array.isArray(e.config.xaxis.categories)?e.config.xaxis.categories:[],i=Array.isArray(t.categoryLabels)?t.categoryLabels:[],s=Array.isArray(t.labels)?t.labels:[],n=r.length?r:i.length?i:s,a=e.seriesData.series||[];let o=0;for(let e=0;e<a.length;e++){const t=a[e];Array.isArray(t)&&t.length>o&&(o=t.length)}o||(o=n.length);const l=[];for(let e=0;e<o;e++){const t=n[e];l.push(String(null==t?e+1:t))}return l}_markDerived(e,t){this._derived||(this._derived=new Map);const r=Array.isArray(t)?t.map(e=>String(e)):[];r.length?this._derived.set(e,r):this._derived.delete(e),this._repairInitialSeries()}_onPointer(e,t){if("function"!=typeof t)return()=>{};this._pointerSubs||(this._pointerSubs=new Map);const r=this._pointerSubs.get(e)||[];return r.push(t),this._pointerSubs.set(e,r),this._wirePointer(),()=>{const r=this._pointerSubs&&this._pointerSubs.get(e);if(!r)return;const i=r.indexOf(t);i>-1&&r.splice(i,1)}}_wirePointer(){if(this._pointerWired)return;if(!this.ctx||"function"!=typeof this.ctx.addEventListener)return;const e=[["enter","dataPointMouseEnter"],["leave","dataPointMouseLeave"],["select","dataPointSelection"]];this._pointerWired=[];for(const[t,r]of e){const e=(e,r,i)=>{this._emitPointer(t,i,e)};this.ctx.addEventListener(r,e),this._pointerWired.push([r,e])}}_emitPointer(t,r,i){if(!this._pointerSubs||!this._pointerSubs.size)return;const s=r&&"number"==typeof r.seriesIndex?r.seriesIndex:-1,n=r&&"number"==typeof r.dataPointIndex?r.dataPointIndex:-1,a=this._categories()||[],o=this.w,l=o&&o.config&&o.config.series||[],c={type:t,seriesIndex:s,dataPointIndex:n,category:n>-1?a[n]:void 0,seriesName:e._seriesName(l,s),selected:"select"===t?e._isSelected(r,s,n):void 0,modifiers:e._modifiers(i)};for(const[e,t]of this._pointerSubs){const r=this.active.find(t=>t.def.name===e);if(r)for(const e of t.slice())this._guard(r,"pointer",()=>e(c))}}static _seriesName(e,t){if(t<0)return;const r=e[t];return r&&"object"==typeof r&&"string"==typeof r.name?r.name:void 0}static _isSelected(e,t,r){const i=e&&e.selectedDataPoints;if(!Array.isArray(i)||t<0)return;const s=i[t];return!!Array.isArray(s)&&s.indexOf(r)>-1}static _modifiers(e){return Object.freeze({shift:!(!e||!e.shiftKey),ctrl:!(!e||!e.ctrlKey),alt:!(!e||!e.altKey),meta:!(!e||!e.metaKey)})}_reserve(t,r){const i=e._normaliseBox(r),s=this._reserved?this._reserved.get(t):void 0;if(i){if(s&&s.left===i.left&&s.right===i.right&&s.top===i.top&&s.bottom===i.bottom)return;this._reserved||(this._reserved=new Map),this._reserved.set(t,i)}else{if(!s||!this._reserved)return;this._reserved.delete(t)}this._resizeForReservation()}static _normaliseBox(e){if(!e||"object"!=typeof e)return null;const t=e=>Number.isFinite(e)&&e>0?Math.round(e):0,r={left:t(e.left),right:t(e.right),top:t(e.top),bottom:t(e.bottom)};return r.left||r.right||r.top||r.bottom?r:null}reservedBox(){if(!this._reserved||0===this._reserved.size)return e.NO_RESERVATION;const t={left:0,right:0,top:0,bottom:0};for(const e of this._reserved.values())t.left+=e.left,t.right+=e.right,t.top+=e.top,t.bottom+=e.bottom;return t}_resizeForReservation(){null==this._reserveTimer&&(this._reserveTimer=setTimeout(()=>{this._reserveTimer=null;const e=this.w.globals;e.isDestroyed||(e.resized=!0,e.dataChanged=!1,this._update("a plugin reservation"))},0))}_update(e){try{Promise.resolve(this.ctx.update()).catch(t=>console.error(`[apexcharts] re-render for ${e} failed:`,t))}catch(e){}}_highlight(e,t){const r=this.w,i=this.ctx.highlightFilter;if(!i)return null;if(!r.globals.axisCharts)return null;if(!i.canDrawParts())return null;if(i.callerCarriesParts())return null;const s=function(e,t,r){const i=S(r);if(!i.length)return null;const s={owner:t,entries:i};return function(e){return e.weaveHighlights||(e.weaveHighlights={records:[]}),e.weaveHighlights}(e).records.push(s),s}(r,e,t);return s?(this._redrawForHighlight(),Object.freeze({release:()=>{!function(e,t){if(!e||!e.weaveHighlights||!t)return;const r=e.weaveHighlights.records,i=r.indexOf(t);i>-1&&r.splice(i,1)}(r,s),this._redrawForHighlight()},update:e=>{s.entries=S(e),this._redrawForHighlight()}})):null}_redrawForHighlight(){null==this._highlightTimer&&(this._highlightTimer=setTimeout(()=>{this._highlightTimer=null;const e=this.w.globals;e.isDestroyed||(e.dataChanged=!0,this._update("plugin highlight parts"))},0))}_derivedNames(){const e=new Set;if(!this._derived)return e;for(const t of this._derived.values())for(const r of t)e.add(r);return e}_repairInitialSeries(){const e=this._derivedNames();if(!e.size)return;const t=this.w.globals,r=t=>!e.has(String(t&&t.name)),i=e=>{if(!Array.isArray(e))return null;const t=e.filter(r);return t.length&&t.length!==e.length?t:null};try{const e=i(t._initialSeriesPeek);e&&(t.initialSeries=e);const r=t.initialConfig,s=r&&i(r.series);s&&(r.series=s)}catch(e){}}_token(e){const t=this.w,r=t.globals;switch(e){case"foreColor":return t.config.chart.foreColor;case"background":return t.config.chart.background;case"accent":case"primary":return r.colors?r.colors[0]:void 0;default:return/^series-\d+$/.test(e)&&r.colors?r.colors[Number(e.split("-")[1])]:void 0}}_layer(e,{z:t="front",className:r=""}={}){let i=this._layers.get(e);if(!i){i=this.ctx.graphics.group({class:`apexcharts-plugin-${e} ${r}`.trim()});const s=this.w.dom.elGraphical.node;"behind"===t?s.insertBefore(i.node,s.firstChild):s.appendChild(i.node),i.node.setAttribute("aria-hidden","true"),this._layers.set(e,i)}return function(e,t,r){const i=t=>(t&&e.add(t),t),s={get node(){return e.node},path(e={}){const{d:r="",stroke:s="#000",width:n=1,fill:a="none",opacity:o=1,dash:l=0,className:c=""}=e;return i(t.drawPath({d:r,stroke:s,strokeWidth:n,fill:a,fillOpacity:"none"===a?0:o,strokeOpacity:o,strokeDashArray:l,classes:c}))},line(e={}){const{x1:r,y1:s,x2:n,y2:a,stroke:o="#000",width:l=1,dash:c=0}=e;return i(t.drawLine(r,s,n,a,o,c,l))},rect(e={}){const{x:r=0,y:s=0,w:n=0,h:a=0,r:o=0,fill:l="#000",stroke:c=null,opacity:d=1}=e;return i(t.drawRect(r,s,n,a,o,l,d,null!=c?1:null,c))},circle(e={}){const{cx:r=0,cy:s=0,r:n=0,fill:a="#000",stroke:o=null}=e;return i(t.drawCircle(n,{cx:r,cy:s,fill:a,stroke:o||"none"}))},text(e={}){const{x:r=0,y:s=0,text:n="",color:a,size:o,anchor:l="start",weight:c}=e;return i(t.drawText({x:r,y:s,text:n,textAnchor:l,fontSize:o,foreColor:a,fontWeight:c}))},clear(){const t=e.node;for(;t.firstChild;)t.removeChild(t.firstChild);return r&&r(),s}};return s}(i,this.ctx.graphics,()=>this._undeclare(e))}_undeclare(e){this._declared&&this._declared.delete(e)}_resetLayers(){this._layers.forEach(e=>e.node.remove()),this._layers.clear(),this._declared=null}_declare(e,t){if(!t||"string"!=typeof t.id||!t.id)return void console.warn(`[apexcharts] plugin "${e}" declared something with no id; ignored.`);this._declared||(this._declared=new Map);const r=this._declared.get(e)||[],i={id:t.id,label:t.label?String(t.label):t.id,visible:!1!==t.visible},s=r.findIndex(e=>e.id===i.id);s>-1?r[s]=i:r.push(i),this._declared.set(e,r)}_reconcile(){const e=this.w.config.plugins||[];if(e===this._lastPluginsRef)return;this._lastPluginsRef=e;const t=new Map(e.map((e,t)=>[e.name,{entry:e,order:null!=e.order?e.order:t}]));for(let e=this.active.length-1;e>=0;e--){const r=this.active[e],i=t.get(r.def.name);i?r.options=Object.freeze(a({},i.entry.options||{})):(this._guard(r,"destroy",()=>r.def.destroy&&r.def.destroy(r.api)),this.active.splice(e,1),this._forget(r.def.name))}const r=new Set(this.active.map(e=>e.def.name)),i=[];t.forEach((e,t)=>{r.has(t)||i.push(e)}),i.sort((e,t)=>e.order-t.order).forEach(e=>this._activate(e.entry))}_forget(e){const t=this.w,r=function(e,t){if(!e.weaveClaims)return!1;let r=!1;for(const[i,s]of e.weaveClaims.byOption){const n=s.filter(e=>e.owner!==t);n.length!==s.length&&(e.weaveClaims.byOption.set(i,n),r=!0)}return r}(t,e),i=function(e,t){if(!e||!e.weaveHighlights)return!1;const r=e.weaveHighlights.records,i=r.filter(e=>e.owner!==t);return i.length!==r.length&&(e.weaveHighlights.records=i,!0)}(t,e);this._pointerSubs&&this._pointerSubs.delete(e),this._derived&&this._derived.delete(e),this._declared&&this._declared.delete(e);const s=!(!this._reserved||!this._reserved.has(e));this._reserve(e,null),!r&&!i||s||this._redrawForHighlight()}teardown(e){if(!e){this.dispatch("destroy");for(const e of this.active)this._guard(e,"destroy",()=>e.def.destroy&&e.def.destroy(e.api));for(const e of this.active)this._forget(e.def.name);if(this.active=[],this._derived=null,this._reserved=null,this._pointerSubs=null,this._declared=null,this._pointerWired){for(const[e,t]of this._pointerWired)this.ctx.removeEventListener&&this.ctx.removeEventListener(e,t);this._pointerWired=null}null!=this._reserveTimer&&(clearTimeout(this._reserveTimer),this._reserveTimer=null),null!=this._highlightTimer&&(clearTimeout(this._highlightTimer),this._highlightTimer=null),this._updatedWired&&(this.ctx.removeEventListener&&this.ctx.removeEventListener("updated",this._onUpdated),this._updatedWired=!1)}this._layers.clear()}};var C,j,k;C=O,j="NO_RESERVATION",k=Object.freeze({left:0,right:0,top:0,bottom:0}),n(C,"symbol"!=typeof j?j+"":j,k);let P=O;o.registerFeatures({weave:P}),e.default=o,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ApexWeave={})});