@undp/data-viz 2.4.1 → 2.5.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 (271) hide show
  1. package/dist/AreaChart.cjs +1 -1
  2. package/dist/AreaChart.cjs.map +1 -1
  3. package/dist/AreaChart.d.ts +11 -9
  4. package/dist/AreaChart.js +320 -322
  5. package/dist/AreaChart.js.map +1 -1
  6. package/dist/BarGraph.cjs +1 -1
  7. package/dist/BarGraph.cjs.map +1 -1
  8. package/dist/BarGraph.d.ts +15 -25
  9. package/dist/BarGraph.js +1694 -1694
  10. package/dist/BarGraph.js.map +1 -1
  11. package/dist/BasicStatCard.cjs +1 -1
  12. package/dist/BasicStatCard.cjs.map +1 -1
  13. package/dist/BasicStatCard.d.ts +13 -9
  14. package/dist/BasicStatCard.js +79 -81
  15. package/dist/BasicStatCard.js.map +1 -1
  16. package/dist/BeeSwarmChart.cjs +1 -1
  17. package/dist/BeeSwarmChart.cjs.map +1 -1
  18. package/dist/BeeSwarmChart.d.ts +11 -9
  19. package/dist/BeeSwarmChart.js +335 -336
  20. package/dist/BeeSwarmChart.js.map +1 -1
  21. package/dist/BiVariateChoroplethMap.cjs +1 -1
  22. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  23. package/dist/BiVariateChoroplethMap.d.ts +13 -3
  24. package/dist/BiVariateChoroplethMap.js +309 -304
  25. package/dist/BiVariateChoroplethMap.js.map +1 -1
  26. package/dist/BulletChart.cjs +1 -1
  27. package/dist/BulletChart.cjs.map +1 -1
  28. package/dist/BulletChart.d.ts +11 -5
  29. package/dist/BulletChart.js +560 -559
  30. package/dist/BulletChart.js.map +1 -1
  31. package/dist/ButterflyChart.cjs +1 -1
  32. package/dist/ButterflyChart.cjs.map +1 -1
  33. package/dist/ButterflyChart.d.ts +11 -9
  34. package/dist/ButterflyChart.js +348 -350
  35. package/dist/ButterflyChart.js.map +1 -1
  36. package/dist/ChoroplethMap.cjs +1 -1
  37. package/dist/ChoroplethMap.cjs.map +1 -1
  38. package/dist/ChoroplethMap.d.ts +11 -3
  39. package/dist/ChoroplethMap.js +314 -311
  40. package/dist/ChoroplethMap.js.map +1 -1
  41. package/dist/CirclePackingGraph.cjs +1 -1
  42. package/dist/CirclePackingGraph.d.ts +11 -9
  43. package/dist/CirclePackingGraph.js +1 -1
  44. package/dist/DataCards.cjs +1 -1
  45. package/dist/DataCards.d.ts +1 -1
  46. package/dist/DataCards.js +1 -1
  47. package/dist/DataTable.cjs +1 -1
  48. package/dist/DataTable.cjs.map +1 -1
  49. package/dist/DataTable.d.ts +4 -5
  50. package/dist/DataTable.js +114 -116
  51. package/dist/DataTable.js.map +1 -1
  52. package/dist/{DetailsModal-jmmKRMRM.cjs → DetailsModal-Du8Fr1QD.cjs} +2 -2
  53. package/dist/{DetailsModal-jmmKRMRM.cjs.map → DetailsModal-Du8Fr1QD.cjs.map} +1 -1
  54. package/dist/{DetailsModal-B2XBWR7w.js → DetailsModal-GqEbGHY2.js} +2 -2
  55. package/dist/{DetailsModal-B2XBWR7w.js.map → DetailsModal-GqEbGHY2.js.map} +1 -1
  56. package/dist/DifferenceLineChart.cjs +1 -1
  57. package/dist/DifferenceLineChart.cjs.map +1 -1
  58. package/dist/DifferenceLineChart.d.ts +11 -9
  59. package/dist/DifferenceLineChart.js +502 -504
  60. package/dist/DifferenceLineChart.js.map +1 -1
  61. package/dist/DonutChart.cjs +1 -1
  62. package/dist/DonutChart.cjs.map +1 -1
  63. package/dist/DonutChart.d.ts +14 -9
  64. package/dist/DonutChart.js +174 -179
  65. package/dist/DonutChart.js.map +1 -1
  66. package/dist/DotDensityMap.cjs +1 -1
  67. package/dist/DotDensityMap.cjs.map +1 -1
  68. package/dist/DotDensityMap.d.ts +1 -1
  69. package/dist/DotDensityMap.js +270 -267
  70. package/dist/DotDensityMap.js.map +1 -1
  71. package/dist/DualAxisLineChart.cjs +1 -1
  72. package/dist/DualAxisLineChart.cjs.map +1 -1
  73. package/dist/DualAxisLineChart.d.ts +13 -9
  74. package/dist/DualAxisLineChart.js +341 -351
  75. package/dist/DualAxisLineChart.js.map +1 -1
  76. package/dist/DumbbellChart.cjs +1 -1
  77. package/dist/DumbbellChart.cjs.map +1 -1
  78. package/dist/DumbbellChart.d.ts +11 -9
  79. package/dist/DumbbellChart.js +592 -593
  80. package/dist/DumbbellChart.js.map +1 -1
  81. package/dist/GeoHubCompareMaps.cjs +1 -1
  82. package/dist/GeoHubCompareMaps.d.ts +1 -1
  83. package/dist/GeoHubCompareMaps.js +1 -1
  84. package/dist/GeoHubMap.cjs +1 -1
  85. package/dist/GeoHubMap.d.ts +1 -1
  86. package/dist/GeoHubMap.js +1 -1
  87. package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
  88. package/dist/GeoHubMapWithLayerSelection.d.ts +1 -1
  89. package/dist/GeoHubMapWithLayerSelection.js +1 -1
  90. package/dist/GraphEl-BgkDbq50.cjs +2 -0
  91. package/dist/GraphEl-BgkDbq50.cjs.map +1 -0
  92. package/dist/GraphEl-Ch0uAeZw.js +1830 -0
  93. package/dist/GraphEl-Ch0uAeZw.js.map +1 -0
  94. package/dist/GriddedGraphs.cjs +1 -1
  95. package/dist/GriddedGraphs.d.ts +29 -16
  96. package/dist/GriddedGraphs.js +1 -1
  97. package/dist/GriddedGraphsFromConfig.d.ts +29 -16
  98. package/dist/HeatMap.cjs +1 -1
  99. package/dist/HeatMap.cjs.map +1 -1
  100. package/dist/HeatMap.d.ts +11 -9
  101. package/dist/HeatMap.js +203 -205
  102. package/dist/HeatMap.js.map +1 -1
  103. package/dist/Histogram.cjs +1 -1
  104. package/dist/Histogram.cjs.map +1 -1
  105. package/dist/Histogram.d.ts +11 -5
  106. package/dist/Histogram.js +88 -89
  107. package/dist/Histogram.js.map +1 -1
  108. package/dist/HybridMap.cjs +1 -1
  109. package/dist/HybridMap.cjs.map +1 -1
  110. package/dist/HybridMap.d.ts +11 -3
  111. package/dist/HybridMap.js +339 -336
  112. package/dist/HybridMap.js.map +1 -1
  113. package/dist/ImageDownloadButton.cjs +1 -1
  114. package/dist/ImageDownloadButton.js +1 -1
  115. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  116. package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
  117. package/dist/LineChartWithConfidenceInterval.d.ts +11 -9
  118. package/dist/LineChartWithConfidenceInterval.js +393 -395
  119. package/dist/LineChartWithConfidenceInterval.js.map +1 -1
  120. package/dist/LinearColorLegend.cjs +1 -1
  121. package/dist/LinearColorLegend.js +1 -1
  122. package/dist/MultiGraphDashboard.d.ts +29 -16
  123. package/dist/MultiGraphDashboardFromConfig.d.ts +29 -16
  124. package/dist/MultiGraphDashboardWideToLongFormat.d.ts +1 -1
  125. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.d.ts +1 -1
  126. package/dist/MultiLineAltChart.cjs +1 -1
  127. package/dist/MultiLineAltChart.cjs.map +1 -1
  128. package/dist/MultiLineAltChart.d.ts +11 -9
  129. package/dist/MultiLineAltChart.js +411 -413
  130. package/dist/MultiLineAltChart.js.map +1 -1
  131. package/dist/MultiLineChart.cjs +1 -1
  132. package/dist/MultiLineChart.cjs.map +1 -1
  133. package/dist/MultiLineChart.d.ts +11 -9
  134. package/dist/MultiLineChart.js +438 -440
  135. package/dist/MultiLineChart.js.map +1 -1
  136. package/dist/ParetoChart.cjs +1 -1
  137. package/dist/ParetoChart.cjs.map +1 -1
  138. package/dist/ParetoChart.d.ts +13 -13
  139. package/dist/ParetoChart.js +347 -355
  140. package/dist/ParetoChart.js.map +1 -1
  141. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +29 -16
  142. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +29 -16
  143. package/dist/PerformanceIntensiveScrollStory.d.ts +29 -16
  144. package/dist/RadarChart.cjs +1 -1
  145. package/dist/RadarChart.cjs.map +1 -1
  146. package/dist/RadarChart.d.ts +11 -5
  147. package/dist/RadarChart.js +213 -213
  148. package/dist/RadarChart.js.map +1 -1
  149. package/dist/SankeyChart.cjs +1 -1
  150. package/dist/SankeyChart.cjs.map +1 -1
  151. package/dist/SankeyChart.d.ts +11 -9
  152. package/dist/SankeyChart.js +448 -450
  153. package/dist/SankeyChart.js.map +1 -1
  154. package/dist/ScatterPlot.cjs +1 -1
  155. package/dist/ScatterPlot.cjs.map +1 -1
  156. package/dist/ScatterPlot.d.ts +15 -13
  157. package/dist/ScatterPlot.js +477 -483
  158. package/dist/ScatterPlot.js.map +1 -1
  159. package/dist/ScrollStory.d.ts +29 -16
  160. package/dist/SimpleLineChart.cjs +1 -1
  161. package/dist/SimpleLineChart.cjs.map +1 -1
  162. package/dist/SimpleLineChart.d.ts +11 -9
  163. package/dist/SimpleLineChart.js +362 -364
  164. package/dist/SimpleLineChart.js.map +1 -1
  165. package/dist/SingleGraphDashboard.cjs +1 -1
  166. package/dist/SingleGraphDashboard.d.ts +29 -16
  167. package/dist/SingleGraphDashboard.js +1 -1
  168. package/dist/SingleGraphDashboardFromConfig.d.ts +29 -16
  169. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +29 -16
  170. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +29 -16
  171. package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
  172. package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
  173. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +29 -16
  174. package/dist/SingleGraphDashboardThreeDGraphs.js +40 -39
  175. package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
  176. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +29 -16
  177. package/dist/SlopeChart.cjs +1 -1
  178. package/dist/SlopeChart.d.ts +1 -1
  179. package/dist/SlopeChart.js +2 -2
  180. package/dist/SparkLine.cjs +1 -1
  181. package/dist/SparkLine.d.ts +1 -1
  182. package/dist/SparkLine.js +1 -1
  183. package/dist/StatCardFromData.cjs +1 -1
  184. package/dist/StatCardFromData.cjs.map +1 -1
  185. package/dist/StatCardFromData.d.ts +11 -9
  186. package/dist/StatCardFromData.js +113 -116
  187. package/dist/StatCardFromData.js.map +1 -1
  188. package/dist/StripChart.cjs +1 -1
  189. package/dist/StripChart.cjs.map +1 -1
  190. package/dist/StripChart.d.ts +11 -9
  191. package/dist/StripChart.js +434 -435
  192. package/dist/StripChart.js.map +1 -1
  193. package/dist/ThreeDGlobe.cjs +1 -1
  194. package/dist/ThreeDGlobe.cjs.map +1 -1
  195. package/dist/ThreeDGlobe.d.ts +11 -3
  196. package/dist/ThreeDGlobe.js +143 -143
  197. package/dist/ThreeDGlobe.js.map +1 -1
  198. package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
  199. package/dist/ThresholdColorLegendWithMouseOver.js +1 -1
  200. package/dist/{Tooltip-Bj-s__cI.js → Tooltip-3EYDVa3w.js} +2 -2
  201. package/dist/{Tooltip-Bj-s__cI.js.map → Tooltip-3EYDVa3w.js.map} +1 -1
  202. package/dist/{Tooltip-Hr46paWP.cjs → Tooltip-C9F3uYG0.cjs} +2 -2
  203. package/dist/{Tooltip-Hr46paWP.cjs.map → Tooltip-C9F3uYG0.cjs.map} +1 -1
  204. package/dist/TreeMapGraph.cjs +1 -1
  205. package/dist/TreeMapGraph.cjs.map +1 -1
  206. package/dist/TreeMapGraph.d.ts +11 -9
  207. package/dist/TreeMapGraph.js +369 -371
  208. package/dist/TreeMapGraph.js.map +1 -1
  209. package/dist/Types.d.ts +29 -16
  210. package/dist/UnitChart.cjs +1 -1
  211. package/dist/UnitChart.cjs.map +1 -1
  212. package/dist/UnitChart.d.ts +11 -5
  213. package/dist/UnitChart.js +118 -119
  214. package/dist/UnitChart.js.map +1 -1
  215. package/dist/WaterfallChart.cjs +1 -1
  216. package/dist/WaterfallChart.cjs.map +1 -1
  217. package/dist/WaterfallChart.d.ts +11 -9
  218. package/dist/WaterfallChart.js +306 -308
  219. package/dist/WaterfallChart.js.map +1 -1
  220. package/dist/XTicksAndGridLines-B4UhDVyU.cjs +2 -0
  221. package/dist/XTicksAndGridLines-B4UhDVyU.cjs.map +1 -0
  222. package/dist/XTicksAndGridLines-CkYwVshF.js +40 -0
  223. package/dist/XTicksAndGridLines-CkYwVshF.js.map +1 -0
  224. package/dist/YTicksAndGridLines-BbujwxOB.js +40 -0
  225. package/dist/YTicksAndGridLines-BbujwxOB.js.map +1 -0
  226. package/dist/YTicksAndGridLines-sT3zdCs6.cjs +2 -0
  227. package/dist/YTicksAndGridLines-sT3zdCs6.cjs.map +1 -0
  228. package/dist/{imageDownload-Diofs_vY.js → imageDownload-BYsNEtMS.js} +11 -11
  229. package/dist/{imageDownload-Diofs_vY.js.map → imageDownload-BYsNEtMS.js.map} +1 -1
  230. package/dist/{imageDownload-61q6jyJW.cjs → imageDownload-CkMwA7Cw.cjs} +4 -4
  231. package/dist/{imageDownload-61q6jyJW.cjs.map → imageDownload-CkMwA7Cw.cjs.map} +1 -1
  232. package/dist/index-BPyj_6hG.js +375 -0
  233. package/dist/index-BPyj_6hG.js.map +1 -0
  234. package/dist/index-DuLvdHo2.cjs +2 -0
  235. package/dist/index-DuLvdHo2.cjs.map +1 -0
  236. package/dist/index.cjs +1 -1
  237. package/dist/index.d.ts +108 -245
  238. package/dist/index.js +3 -3
  239. package/dist/numberFormattingFunction-BUUV_luR.js +28 -0
  240. package/dist/numberFormattingFunction-BUUV_luR.js.map +1 -0
  241. package/dist/numberFormattingFunction-u2iNHL_c.cjs +2 -0
  242. package/dist/numberFormattingFunction-u2iNHL_c.cjs.map +1 -0
  243. package/dist/{string2HTML-ZoGd08P_.cjs → string2HTML-30nfIm8R.cjs} +2 -2
  244. package/dist/{string2HTML-ZoGd08P_.cjs.map → string2HTML-30nfIm8R.cjs.map} +1 -1
  245. package/dist/{string2HTML-BrFperRM.js → string2HTML-DL-pInUB.js} +2 -2
  246. package/dist/{string2HTML-BrFperRM.js.map → string2HTML-DL-pInUB.js.map} +1 -1
  247. package/dist/style.css +1 -1
  248. package/dist/utils.cjs +1 -1
  249. package/dist/utils.d.ts +1 -1
  250. package/dist/utils.js +2 -2
  251. package/package.json +2 -2
  252. package/dist/GraphEl-B73N4RIA.js +0 -1906
  253. package/dist/GraphEl-B73N4RIA.js.map +0 -1
  254. package/dist/GraphEl-Lt1og0C-.cjs +0 -2
  255. package/dist/GraphEl-Lt1og0C-.cjs.map +0 -1
  256. package/dist/XTicksAndGridLines-C5DuC5oY.cjs +0 -2
  257. package/dist/XTicksAndGridLines-C5DuC5oY.cjs.map +0 -1
  258. package/dist/XTicksAndGridLines-gdbGX2rm.js +0 -39
  259. package/dist/XTicksAndGridLines-gdbGX2rm.js.map +0 -1
  260. package/dist/YTicksAndGridLines-CsNSq9W9.js +0 -39
  261. package/dist/YTicksAndGridLines-CsNSq9W9.js.map +0 -1
  262. package/dist/YTicksAndGridLines-DFjm8RCc.cjs +0 -2
  263. package/dist/YTicksAndGridLines-DFjm8RCc.cjs.map +0 -1
  264. package/dist/index-B0Awa_de.js +0 -377
  265. package/dist/index-B0Awa_de.js.map +0 -1
  266. package/dist/index-CP8cmNzt.cjs +0 -2
  267. package/dist/index-CP8cmNzt.cjs.map +0 -1
  268. package/dist/numberFormattingFunction-Cn9R7CM9.cjs +0 -2
  269. package/dist/numberFormattingFunction-Cn9R7CM9.cjs.map +0 -1
  270. package/dist/numberFormattingFunction-DqMf_v1m.js +0 -28
  271. package/dist/numberFormattingFunction-DqMf_v1m.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"BiVariateChoroplethMap.js","sources":["../src/Components/Graphs/Maps/BiVariateMap/Graph.tsx","../src/Components/Graphs/Maps/BiVariateMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { useEffect, useMemo, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n geoPath,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleThreshold } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { FeatureCollection } from 'geojson';\r\nimport rewind from '@turf/rewind';\r\n\r\nimport {\r\n AnimateDataType,\r\n BivariateMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { ExpandIcon, X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n data: BivariateMapDataType[];\r\n mapData: FeatureCollection;\r\n xDomain: number[];\r\n yDomain: number[];\r\n width: number;\r\n height: number;\r\n colors: string[][];\r\n xColorLegendTitle: string;\r\n yColorLegendTitle: string;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds?: string[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n showColorScale: boolean;\r\n collapseColorScaleByDefault?: boolean;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n zoomAndCenterByHighlightedIds: boolean;\r\n projectionRotate: [number, number] | [number, number, number];\r\n rewindCoordinatesInMapData: boolean;\r\n overlayMapData?: FeatureCollection;\r\n overlayMapBorderColor?: string;\r\n overlayMapBorderWidth?: number;\r\n locale: string;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n xDomain,\r\n mapData,\r\n xColorLegendTitle,\r\n yDomain,\r\n yColorLegendTitle,\r\n width,\r\n height,\r\n colors,\r\n scale,\r\n centerPoint,\r\n mapBorderWidth,\r\n mapNoDataColor,\r\n mapBorderColor,\r\n tooltip,\r\n onSeriesMouseOver,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n showColorScale,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n collapseColorScaleByDefault,\r\n zoomAndCenterByHighlightedIds,\r\n projectionRotate,\r\n rewindCoordinatesInMapData,\r\n overlayMapData,\r\n overlayMapBorderColor,\r\n overlayMapBorderWidth,\r\n locale,\r\n } = props;\r\n const formattedMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData) return mapData;\r\n\r\n return rewind(mapData, { reverse: true }) as FeatureCollection;\r\n }, [mapData, rewindCoordinatesInMapData]);\r\n const formattedOverlayMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData || !overlayMapData) return overlayMapData;\r\n\r\n return rewind(overlayMapData, { reverse: true }) as FeatureCollection;\r\n }, [overlayMapData, rewindCoordinatesInMapData]);\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n const bounds = bbox({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds?.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n\r\n const center = centerOfMass({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds?.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n const lonDiff = (bounds[2] - bounds[0]) * 1.15;\r\n const latDiff = (bounds[3] - bounds[1]) * 1.15;\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n\r\n const pathGenerator = geoPath().projection(projection);\r\n const xRange = Array.from({ length: xDomain.length }, (_, i) => i);\r\n\r\n const yRange = Array.from({ length: yDomain.length }, (_, i) => i);\r\n const xScale = scaleThreshold<number, number>().domain(xDomain).range(xRange);\r\n const yScale = scaleThreshold<number, number>().domain(yDomain).range(yRange);\r\n\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n viewBox={`0 0 ${width} ${height}`}\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {formattedMapData.features.map((d, i: number) => {\r\n if (!d.properties?.[mapProperty]) return null;\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <motion.g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n <path\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = formattedMapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n if (index === -1) return null;\r\n const path = pathGenerator(formattedMapData.features[index]);\r\n if (!path) return null;\r\n const xColorCoord = !checkIfNullOrUndefined(d.x)\r\n ? xScale(d.x as number)\r\n : undefined;\r\n const yColorCoord = !checkIfNullOrUndefined(d.y)\r\n ? yScale(d.y as number)\r\n : undefined;\r\n const color =\r\n xColorCoord !== undefined && yColorCoord !== undefined\r\n ? colors[yColorCoord][xColorCoord]\r\n : mapNoDataColor;\r\n\r\n return (\r\n <motion.g\r\n className='undp-map-shapes'\r\n key={d.id}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedIds\r\n ? highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n <motion.path\r\n key={`${d.id}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n className={`${\r\n color === mapNoDataColor\r\n ? 'stroke-primary-gray-400 dark:stroke-primary-gray-500'\r\n : 'stroke-primary-white dark:stroke-primary-gray-650'\r\n }`}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? formattedMapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n .map((d, i) => (\r\n <path\r\n key={i}\r\n d={pathGenerator(d) || ''}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n ))\r\n : null}\r\n {formattedOverlayMapData?.features.map((d, i: number) => {\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <g key={i}>\r\n <path\r\n d={path}\r\n style={{\r\n stroke: overlayMapBorderColor || mapBorderColor,\r\n strokeWidth: overlayMapBorderWidth || mapBorderWidth + 1,\r\n fill: 'none',\r\n pointerEvents: 'none',\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </g>\r\n );\r\n })}\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{ width: '175px' }}\r\n >\r\n <div className='flex gap-1 items-center'>\r\n <svg width='136px' viewBox='0 0 136 136' className='shrink-0'>\r\n <g>\r\n {colors.map((d, i) => (\r\n <g key={i} transform={`translate(0,${100 - i * 25})`}>\r\n {d.map((el, j) => (\r\n <rect\r\n key={j}\r\n y={1}\r\n x={j * 25 + 1}\r\n fill={el}\r\n width={23}\r\n height={23}\r\n strokeWidth={selectedColor === el ? 2 : 0.25}\r\n style={{ cursor: 'pointer' }}\r\n onMouseOver={() => {\r\n setSelectedColor(el);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n />\r\n ))}\r\n </g>\r\n ))}\r\n <g transform='translate(0,125)'>\r\n {xDomain.map((el, j) => (\r\n <text key={j} y={10} x={(j + 1) * 25} fontSize={10} textAnchor='middle'>\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(\r\n el,\r\n undefined,\r\n undefined,\r\n undefined,\r\n undefined,\r\n locale,\r\n )}\r\n </text>\r\n ))}\r\n </g>\r\n {yDomain.map((el, j) => (\r\n <g\r\n key={j}\r\n transform={`translate(${\r\n Math.max(Math.min(xDomain.length + 1, 5), 4) * 25 + 10\r\n },${100 - j * 25})`}\r\n >\r\n <text\r\n x={0}\r\n transform='rotate(-90)'\r\n y={0}\r\n fontSize={10}\r\n textAnchor='middle'\r\n >\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(\r\n el,\r\n undefined,\r\n undefined,\r\n undefined,\r\n undefined,\r\n locale,\r\n )}\r\n </text>\r\n </g>\r\n ))}\r\n </g>\r\n </svg>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='leading-normal text-center shrink-0'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n writingMode: 'vertical-rl',\r\n height: '8.5rem',\r\n transform: 'rotate(180deg)',\r\n }}\r\n >\r\n {yColorLegendTitle}\r\n </P>\r\n </div>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='mt-1 leading-normal text-center'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n width: '8.5rem',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n }}\r\n >\r\n {xColorLegendTitle}\r\n </P>\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='p-1 border-0 rounded-[2px] text-primary-gray-700 bg-primary-gray-300 dark:bg-primary-gray-500 map-legend-button'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <ExpandIcon />\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 border text-primary-gray-700 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 border text-primary-gray-700 border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useEffect, useEffectEvent, useMemo, useRef, useState } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n BivariateMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n MapOverlayDataType,\r\n} from '@/Types';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects. */\r\n data: BivariateMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for the choropleth map. Array must be 5x5 */\r\n colors?: string[][];\r\n /** Title for the first color legend */\r\n xColorLegendTitle?: string;\r\n /** Title for the second color legend */\r\n yColorLegendTitle?: string;\r\n /** Domain of x-colors for the map */\r\n xDomain?: number[];\r\n /** Domain of y-colors for the map */\r\n yDomain?: number[];\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n mapData?: FeatureCollection | string;\r\n /** Detail if any other map needs to be overlayed over the main map */\r\n mapOverlay?: MapOverlayDataType;\r\n /** Defines if the coordinates in the map data should be rewinded or not. Try to change this is the visualization shows countries as holes instead of shapes. */\r\n rewindCoordinatesInMapData?: boolean;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Controls the rotation of the map projection, in degrees, applied before rendering. Useful for shifting the antimeridian to focus the map on different regions */\r\n projectionRotate?: [number, number] | [number, number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Toggle if the map is centered and zoomed to the highlighted ids. */\r\n zoomAndCenterByHighlightedIds?: boolean;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Locale for number formatting. Must matches what `Intl.NumberFormat` expects. */\r\n locale?: string;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function BiVariateChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json',\r\n colors = Colors.light.bivariateColors.colors05x05,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n xDomain,\r\n yDomain,\r\n xColorLegendTitle = 'X Color key',\r\n yColorLegendTitle = 'Y Color key',\r\n tooltip,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n showColorScale = true,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection = 'naturalEarth',\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n zoomAndCenterByHighlightedIds = false,\r\n projectionRotate = [0, 0],\r\n rewindCoordinatesInMapData = true,\r\n mapOverlay,\r\n locale = 'en',\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = useMemo(() => {\r\n const dates = [\r\n ...new Set(\r\n data\r\n .filter(d => d.date)\r\n .map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n ),\r\n ];\r\n dates.sort((a, b) => a - b);\r\n return dates;\r\n }, [data, timeline.dateFormat]);\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n const [mapShape, setMapShape] = useState<FeatureCollection | undefined>(undefined);\r\n const [overlayMapShape, setOverlayMapShape] = useState<FeatureCollection | undefined>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(entries[0].target.clientWidth || 620);\r\n setSvgHeight(entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, []);\r\n\r\n const onUpdateShape = useEffectEvent((shape: FeatureCollection) => {\r\n setMapShape(shape);\r\n });\r\n\r\n const onUpdateOverlayMapShape = useEffectEvent((shape: FeatureCollection | undefined) => {\r\n setOverlayMapShape(shape);\r\n });\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n onUpdateShape(d);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n useEffect(() => {\r\n if (!mapOverlay?.mapData) onUpdateOverlayMapShape(undefined);\r\n if (typeof mapOverlay?.mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapOverlay?.mapData);\r\n fetchData.then(d => {\r\n onUpdateOverlayMapShape(d as FeatureCollection);\r\n });\r\n } else {\r\n onUpdateOverlayMapShape(mapOverlay?.mapData);\r\n }\r\n }, [mapOverlay?.mapData]);\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n\r\n if (xDomain && yDomain)\r\n if (xDomain.length !== colors[0].length - 1 || yDomain.length !== colors.length - 1) {\r\n console.error(\"the xDomain and yDomain array length don't match to the color array length\");\r\n return null;\r\n }\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? `${d.date}` ===\r\n format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(el => el.properties?.NAME !== 'Antarctica'),\r\n }\r\n }\r\n xDomain={\r\n xDomain ||\r\n getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors[0].length,\r\n )\r\n }\r\n yDomain={\r\n yDomain ||\r\n getJenks(\r\n data.map(d => d.y as number | null | undefined),\r\n colors.length,\r\n )\r\n }\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={colors}\r\n xColorLegendTitle={xColorLegendTitle}\r\n yColorLegendTitle={yColorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n showColorScale={showColorScale}\r\n classNames={classNames}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n detailsOnClick={detailsOnClick}\r\n zoomInteraction={zoomInteraction}\r\n overlayMapData={overlayMapShape}\r\n overlayMapBorderColor={mapOverlay?.mapBorderColor}\r\n overlayMapBorderWidth={mapOverlay?.mapBorderWidth}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n zoomAndCenterByHighlightedIds={zoomAndCenterByHighlightedIds}\r\n projectionRotate={projectionRotate}\r\n rewindCoordinatesInMapData={rewindCoordinatesInMapData}\r\n locale={locale}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </GraphArea>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["Graph","props","data","xDomain","mapData","xColorLegendTitle","yDomain","yColorLegendTitle","width","height","colors","scale","centerPoint","mapBorderWidth","mapNoDataColor","mapBorderColor","tooltip","onSeriesMouseOver","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","showColorScale","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","zoomAndCenterByHighlightedIds","projectionRotate","rewindCoordinatesInMapData","overlayMapData","overlayMapBorderColor","overlayMapBorderWidth","locale","formattedMapData","useMemo","rewind","reverse","formattedOverlayMapData","showLegend","setShowLegend","useState","undefined","selectedColor","setSelectedColor","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","useRef","isInView","useInView","once","amount","mapG","zoomRef","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","filter","on","transform","attr","call","bounds","bbox","features","d","length","indexOf","properties","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","pathGenerator","geoPath","xRange","Array","from","_","i","yRange","xScale","scaleThreshold","domain","range","yScale","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","path","stroke","strokeWidth","fill","vectorEffect","AnimatePresence","index","findIndex","el","id","xColorCoord","checkIfNullOrUndefined","x","yColorCoord","y","color","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","pointerEvents","cn","colorLegend","X","j","cursor","numberFormattingFunction","max","P","display","WebkitLineClamp","WebkitBoxOrient","overflow","writingMode","ExpandIcon","Tooltip","DetailsModal","modal","BiVariateChoroplethMap","$","_c","graphTitle","t0","t1","sources","graphDescription","footNote","t2","t3","t4","t5","padding","t6","t7","backgroundColor","t8","t9","relativeHeight","isWorldMap","t10","t11","graphID","t12","t13","graphDownload","t14","dataDownload","t15","showAntarctica","t16","language","t17","minHeight","t18","theme","t19","ariaLabel","t20","t21","t22","t23","t24","t25","timeline","t26","t27","t28","t29","mapOverlay","t30","Colors","light","bivariateColors","colors05x05","graphNoData","grays","t31","t32","t33","enabled","autoplay","showOnlyActiveDate","t34","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t35","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","overlayMapShape","setOverlayMapShape","graphDiv","graphParentDiv","t36","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t37","shape","onUpdateShape","useEffectEvent","t38","shape_0","onUpdateOverlayMapShape","t39","fetchAndParseJSON","then","d_1","t40","t41","d_2","t42","t43","t44","t45","speed","interval","setInterval","clearInterval","t46","t47","getSliderMarks","markObj","console","error","t48","graphContainer","t49","t50","description","title","GraphHeader","_temp3","_temp4","_temp5","_temp6","_temp7","t51","Pause","Play","SliderUI","nextValue","nextValue_0","t52","GraphArea","d_8","format","_temp8","getJenks","_temp9","_temp0","Spinner","t53","footnote","source","GraphFooter","t54","GraphContainer","d_10","d_9","NAME","d_5","d_4","d_3","d_7","d_6","a","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAqFO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJC,MAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,SAAAA;AAA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ApI,SAAA6I,IAAA7I,SAAAmJ,IAAAnJ,SAAA4J,IAAA5J,SAAAmC,GAAAnC,SAAAnL,GAAAmL,SAAAgK,MAAAA,KAAAhK,EAAA,GAAA,GA5KjBgK;AA4KiB;AA3Td,SAAAN,GAAAQ,GAAA;AAAA,SA6OuB9P,EAAC6D;AAA+B;AA7OvD,SAAAwL,GAAAU,GAAA;AAAA,SAsOuB/P,EAAC2D;AAA+B;AAtOvD,SAAAwL,GAAA5L,GAAA;AAAA,SAgOsDA,EAAEpD,YAAiB6P,SAAK;AAAY;AAhO1F,SAAAxB,GAAAyB,GAAA;AAAA,SAgL4BjQ,MAAM9C;AAAS;AAhL3C,SAAAqR,GAAA2B,GAAA;AAAA,SA+K6ClQ,MAAM9C;AAAS;AA/K5D,SAAAoR,GAAA6B,GAAA;AAAA,SA+KyBnQ,EAAC7F;AAAK;AA/K/B,SAAAkU,GAAA+B,GAAA;AAAA,SA8K2CpQ,MAAM9C;AAAS;AA9K1D,SAAAkR,GAAAiC,GAAA;AAAA,SA8KuBrQ,EAAC7F;AAAK;AA9K7B,SAAA0Q,GAAAyF,GAAAC,GAAA;AAAA,SAqEkBD,IAAIC;AAAC;AArEvB,SAAA5F,GAAA3K,GAAA;AAAA,SAiEgBA,EAACuK;AAAK;"}
1
+ {"version":3,"file":"BiVariateChoroplethMap.js","sources":["../src/Components/Graphs/Maps/BiVariateMap/Graph.tsx","../src/Components/Graphs/Maps/BiVariateMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { RefObject, useEffect, useMemo, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n geoPath,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleThreshold } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { FeatureCollection } from 'geojson';\r\nimport rewind from '@turf/rewind';\r\n\r\nimport {\r\n AnimateDataType,\r\n BivariateMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n NumberFormatOptions,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { ExpandIcon, X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\nimport { ImageDownloadButton } from '@/Components/Actions/ImageDownloadButton';\r\n\r\ninterface Props {\r\n data: BivariateMapDataType[];\r\n mapData: FeatureCollection;\r\n xDomain: number[];\r\n yDomain: number[];\r\n width: number;\r\n height: number;\r\n colors: string[][];\r\n xColorLegendTitle: string;\r\n yColorLegendTitle: string;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds?: string[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n showColorScale: boolean;\r\n collapseColorScaleByDefault?: boolean;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n zoomAndCenterByHighlightedIds: boolean;\r\n projectionRotate: [number, number] | [number, number, number];\r\n rewindCoordinatesInMapData: boolean;\r\n overlayMapData?: FeatureCollection;\r\n overlayMapBorderColor?: string;\r\n overlayMapBorderWidth?: number;\r\n xNumberDisplayOptions?: Omit<NumberFormatOptions, 'suffix' | 'prefix'>;\r\n yNumberDisplayOptions?: Omit<NumberFormatOptions, 'suffix' | 'prefix'>;\r\n graphDownload?: RefObject<HTMLDivElement | null>;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n xDomain,\r\n mapData,\r\n xColorLegendTitle,\r\n yDomain,\r\n yColorLegendTitle,\r\n width,\r\n height,\r\n colors,\r\n scale,\r\n centerPoint,\r\n mapBorderWidth,\r\n mapNoDataColor,\r\n mapBorderColor,\r\n tooltip,\r\n onSeriesMouseOver,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n showColorScale,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n collapseColorScaleByDefault,\r\n zoomAndCenterByHighlightedIds,\r\n projectionRotate,\r\n rewindCoordinatesInMapData,\r\n overlayMapData,\r\n overlayMapBorderColor,\r\n overlayMapBorderWidth,\r\n xNumberDisplayOptions,\r\n yNumberDisplayOptions,\r\n graphDownload,\r\n } = props;\r\n const formattedMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData) return mapData;\r\n\r\n return rewind(mapData, { reverse: true }) as FeatureCollection;\r\n }, [mapData, rewindCoordinatesInMapData]);\r\n const formattedOverlayMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData || !overlayMapData) return overlayMapData;\r\n\r\n return rewind(overlayMapData, { reverse: true }) as FeatureCollection;\r\n }, [overlayMapData, rewindCoordinatesInMapData]);\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n const bounds = bbox({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds?.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n\r\n const center = centerOfMass({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds?.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n const lonDiff = (bounds[2] - bounds[0]) * 1.15;\r\n const latDiff = (bounds[3] - bounds[1]) * 1.15;\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n\r\n const pathGenerator = geoPath().projection(projection);\r\n const xRange = Array.from({ length: xDomain.length }, (_, i) => i);\r\n\r\n const yRange = Array.from({ length: yDomain.length }, (_, i) => i);\r\n const xScale = scaleThreshold<number, number>().domain(xDomain).range(xRange);\r\n const yScale = scaleThreshold<number, number>().domain(yDomain).range(yRange);\r\n\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n viewBox={`0 0 ${width} ${height}`}\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {formattedMapData.features.map((d, i: number) => {\r\n if (!d.properties?.[mapProperty]) return null;\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <motion.g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n <path\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = formattedMapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n if (index === -1) return null;\r\n const path = pathGenerator(formattedMapData.features[index]);\r\n if (!path) return null;\r\n const xColorCoord = !checkIfNullOrUndefined(d.x)\r\n ? xScale(d.x as number)\r\n : undefined;\r\n const yColorCoord = !checkIfNullOrUndefined(d.y)\r\n ? yScale(d.y as number)\r\n : undefined;\r\n const color =\r\n xColorCoord !== undefined && yColorCoord !== undefined\r\n ? colors[yColorCoord][xColorCoord]\r\n : mapNoDataColor;\r\n\r\n return (\r\n <motion.g\r\n className='undp-map-shapes'\r\n key={d.id}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? !highlightedIds || highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : dimmedOpacity\r\n : highlightedIds\r\n ? highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n <motion.path\r\n key={`${d.id}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n className={`${\r\n color === mapNoDataColor\r\n ? 'stroke-primary-gray-400 dark:stroke-primary-gray-500'\r\n : 'stroke-primary-white dark:stroke-primary-gray-650'\r\n }`}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? formattedMapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n .map((d, i) => (\r\n <path\r\n key={i}\r\n d={pathGenerator(d) || ''}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n ))\r\n : null}\r\n {formattedOverlayMapData?.features.map((d, i: number) => {\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <g key={i}>\r\n <path\r\n d={path}\r\n style={{\r\n stroke: overlayMapBorderColor || mapBorderColor,\r\n strokeWidth: overlayMapBorderWidth || mapBorderWidth + 1,\r\n fill: 'none',\r\n pointerEvents: 'none',\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </g>\r\n );\r\n })}\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{ width: '175px' }}\r\n >\r\n <div className='flex gap-1 items-center'>\r\n <svg width='136px' viewBox='0 0 136 136' className='shrink-0'>\r\n <g>\r\n {colors.map((d, i) => (\r\n <g key={i} transform={`translate(0,${100 - i * 25})`}>\r\n {d.map((el, j) => (\r\n <rect\r\n key={j}\r\n y={1}\r\n x={j * 25 + 1}\r\n fill={el}\r\n width={23}\r\n height={23}\r\n strokeWidth={selectedColor === el ? 2 : 0.25}\r\n style={{ cursor: 'pointer' }}\r\n onMouseOver={() => {\r\n setSelectedColor(el);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n />\r\n ))}\r\n </g>\r\n ))}\r\n <g transform='translate(0,125)'>\r\n {xDomain.map((el, j) => (\r\n <text key={j} y={10} x={(j + 1) * 25} fontSize={10} textAnchor='middle'>\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(\r\n el,\r\n undefined,\r\n xNumberDisplayOptions?.precision ?? 2,\r\n undefined,\r\n undefined,\r\n xNumberDisplayOptions?.locale || 'en',\r\n xNumberDisplayOptions?.padZeros || false,\r\n )}\r\n </text>\r\n ))}\r\n </g>\r\n {yDomain.map((el, j) => (\r\n <g\r\n key={j}\r\n transform={`translate(${\r\n Math.max(Math.min(xDomain.length + 1, 5), 4) * 25 + 10\r\n },${100 - j * 25})`}\r\n >\r\n <text\r\n x={0}\r\n transform='rotate(-90)'\r\n y={0}\r\n fontSize={10}\r\n textAnchor='middle'\r\n >\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(\r\n el,\r\n undefined,\r\n yNumberDisplayOptions?.precision ?? 2,\r\n undefined,\r\n undefined,\r\n yNumberDisplayOptions?.locale || 'en',\r\n yNumberDisplayOptions?.padZeros || false,\r\n )}\r\n </text>\r\n </g>\r\n ))}\r\n </g>\r\n </svg>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='leading-normal text-center shrink-0'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n writingMode: 'vertical-rl',\r\n height: '8.5rem',\r\n transform: 'rotate(180deg)',\r\n }}\r\n >\r\n {yColorLegendTitle}\r\n </P>\r\n </div>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='mt-1 leading-normal text-center'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n width: '8.5rem',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n }}\r\n >\r\n {xColorLegendTitle}\r\n </P>\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='p-1 border-0 rounded-[2px] text-primary-gray-700 bg-primary-gray-300 dark:bg-primary-gray-500 map-legend-button'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <ExpandIcon />\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col undp-viz-zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 border text-primary-gray-700 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 border text-primary-gray-700 border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n {graphDownload && (\r\n <div className='absolute right-4 top-4 flex flex-col image-download-button'>\r\n <ImageDownloadButton nodeID={graphDownload} buttonSmall />\r\n </div>\r\n )}\r\n </div>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useEffect, useEffectEvent, useMemo, useRef, useState } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n BivariateMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n MapOverlayDataType,\r\n NumberFormatOptions,\r\n} from '@/Types';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects. */\r\n data: BivariateMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for the choropleth map. Array must be 5x5 */\r\n colors?: string[][];\r\n /** Title for the first color legend */\r\n xColorLegendTitle?: string;\r\n /** Title for the second color legend */\r\n yColorLegendTitle?: string;\r\n /** Domain of x-colors for the map */\r\n xDomain?: number[];\r\n /** Domain of y-colors for the map */\r\n yDomain?: number[];\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n mapData?: FeatureCollection | string;\r\n /** Detail if any other map needs to be overlayed over the main map */\r\n mapOverlay?: MapOverlayDataType;\r\n /** Defines if the coordinates in the map data should be rewinded or not. Try to change this is the visualization shows countries as holes instead of shapes. */\r\n rewindCoordinatesInMapData?: boolean;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Controls the rotation of the map projection, in degrees, applied before rendering. Useful for shifting the antimeridian to focus the map on different regions */\r\n projectionRotate?: [number, number] | [number, number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Toggle if the map is centered and zoomed to the highlighted ids. */\r\n zoomAndCenterByHighlightedIds?: boolean;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Configuration options for controlling number formatting, localization, precision, and zero padding. */\r\n xNumberDisplayOptions?: Omit<NumberFormatOptions, 'suffix' | 'prefix'>;\r\n /** Configuration options for controlling number formatting, localization, precision, and zero padding. */\r\n yNumberDisplayOptions?: Omit<NumberFormatOptions, 'suffix' | 'prefix'>;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function BiVariateChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json',\r\n colors = Colors.light.bivariateColors.colors05x05,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n xDomain,\r\n yDomain,\r\n xColorLegendTitle = 'X Color key',\r\n yColorLegendTitle = 'Y Color key',\r\n tooltip,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n showColorScale = true,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection = 'naturalEarth',\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n zoomAndCenterByHighlightedIds = false,\r\n projectionRotate = [0, 0],\r\n rewindCoordinatesInMapData = true,\r\n mapOverlay,\r\n xNumberDisplayOptions,\r\n yNumberDisplayOptions,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = useMemo(() => {\r\n const dates = [\r\n ...new Set(\r\n data\r\n .filter(d => d.date)\r\n .map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n ),\r\n ];\r\n dates.sort((a, b) => a - b);\r\n return dates;\r\n }, [data, timeline.dateFormat]);\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n const [mapShape, setMapShape] = useState<FeatureCollection | undefined>(undefined);\r\n const [overlayMapShape, setOverlayMapShape] = useState<FeatureCollection | undefined>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(entries[0].target.clientWidth || 620);\r\n setSvgHeight(entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, []);\r\n\r\n const onUpdateShape = useEffectEvent((shape: FeatureCollection) => {\r\n setMapShape(shape);\r\n });\r\n\r\n const onUpdateOverlayMapShape = useEffectEvent((shape: FeatureCollection | undefined) => {\r\n setOverlayMapShape(shape);\r\n });\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n onUpdateShape(d);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n useEffect(() => {\r\n if (!mapOverlay?.mapData) onUpdateOverlayMapShape(undefined);\r\n if (typeof mapOverlay?.mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapOverlay?.mapData);\r\n fetchData.then(d => {\r\n onUpdateOverlayMapShape(d as FeatureCollection);\r\n });\r\n } else {\r\n onUpdateOverlayMapShape(mapOverlay?.mapData);\r\n }\r\n }, [mapOverlay?.mapData]);\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n\r\n if (xDomain && yDomain)\r\n if (xDomain.length !== colors[0].length - 1 || yDomain.length !== colors.length - 1) {\r\n console.error(\"the xDomain and yDomain array length don't match to the color array length\");\r\n return null;\r\n }\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? `${d.date}` ===\r\n format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(el => el.properties?.NAME !== 'Antarctica'),\r\n }\r\n }\r\n xDomain={\r\n xDomain ||\r\n getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors[0].length,\r\n )\r\n }\r\n yDomain={\r\n yDomain ||\r\n getJenks(\r\n data.map(d => d.y as number | null | undefined),\r\n colors.length,\r\n )\r\n }\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={colors}\r\n xColorLegendTitle={xColorLegendTitle}\r\n yColorLegendTitle={yColorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n showColorScale={showColorScale}\r\n classNames={classNames}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n detailsOnClick={detailsOnClick}\r\n zoomInteraction={zoomInteraction}\r\n overlayMapData={overlayMapShape}\r\n overlayMapBorderColor={mapOverlay?.mapBorderColor}\r\n overlayMapBorderWidth={mapOverlay?.mapBorderWidth}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n zoomAndCenterByHighlightedIds={zoomAndCenterByHighlightedIds}\r\n projectionRotate={projectionRotate}\r\n rewindCoordinatesInMapData={rewindCoordinatesInMapData}\r\n xNumberDisplayOptions={xNumberDisplayOptions}\r\n yNumberDisplayOptions={yNumberDisplayOptions}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </GraphArea>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["Graph","props","data","xDomain","mapData","xColorLegendTitle","yDomain","yColorLegendTitle","width","height","colors","scale","centerPoint","mapBorderWidth","mapNoDataColor","mapBorderColor","tooltip","onSeriesMouseOver","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","showColorScale","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","zoomAndCenterByHighlightedIds","projectionRotate","rewindCoordinatesInMapData","overlayMapData","overlayMapBorderColor","overlayMapBorderWidth","xNumberDisplayOptions","yNumberDisplayOptions","graphDownload","formattedMapData","useMemo","rewind","reverse","formattedOverlayMapData","showLegend","setShowLegend","useState","undefined","selectedColor","setSelectedColor","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","useRef","isInView","useInView","once","amount","mapG","zoomRef","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","filter","on","transform","attr","call","bounds","bbox","features","d","length","indexOf","properties","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","pathGenerator","geoPath","xRange","Array","from","_","i","yRange","xScale","scaleThreshold","domain","range","yScale","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","path","stroke","strokeWidth","fill","vectorEffect","AnimatePresence","index","findIndex","el","id","xColorCoord","checkIfNullOrUndefined","x","yColorCoord","y","color","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","pointerEvents","cn","colorLegend","X","j","cursor","numberFormattingFunction","precision","locale","padZeros","max","P","display","WebkitLineClamp","WebkitBoxOrient","overflow","writingMode","ExpandIcon","ImageDownloadButton","Tooltip","DetailsModal","modal","BiVariateChoroplethMap","$","_c","graphTitle","t0","t1","sources","graphDescription","footNote","t2","t3","t4","t5","padding","t6","t7","backgroundColor","t8","t9","relativeHeight","isWorldMap","t10","t11","graphID","t12","t13","t14","dataDownload","t15","showAntarctica","t16","language","t17","minHeight","t18","theme","t19","ariaLabel","t20","t21","t22","t23","t24","t25","timeline","t26","t27","t28","t29","mapOverlay","Colors","light","bivariateColors","colors05x05","graphNoData","grays","t30","t31","t32","enabled","autoplay","showOnlyActiveDate","t33","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t34","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","overlayMapShape","setOverlayMapShape","graphDiv","graphParentDiv","t35","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t36","shape","onUpdateShape","useEffectEvent","t37","shape_0","onUpdateOverlayMapShape","t38","fetchAndParseJSON","then","d_1","t39","t40","d_2","t41","t42","t43","t44","speed","interval","setInterval","clearInterval","t45","t46","getSliderMarks","markObj","console","error","t47","graphContainer","t48","t49","description","title","GraphHeader","_temp3","_temp4","_temp5","_temp6","_temp7","t50","Pause","Play","SliderUI","nextValue","nextValue_0","t51","GraphArea","d_8","format","_temp8","getJenks","_temp9","_temp0","Spinner","t52","footnote","source","GraphFooter","t53","GraphContainer","d_10","d_9","NAME","d_5","d_4","d_3","d_7","d_6","a","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAyFO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJC,MAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,qBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,oBAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,6BAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,YAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,cAAAA;AAAAA,IACAC,6BAAAA;AAAAA,IACAC,+BAAAA;AAAAA,IACAC,kBAAAA;AAAAA,IACAC,4BAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,uBAAAA;AAAAA,IACAC,uBAAAA;AAAAA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AAA+H,IAAA/H,SAAAiI,IAAAjI,SAAAkI,IAAAlI,SAAA2I,IAAA3I,SAAAiJ,IAAAjJ,SAAA0J,IAAA1J,SAAAkC,GAAAlC,SAAAzL,GAAAyL,SAAA8J,MAAAA,KAAA9J,EAAA,GAAA,GA7KjB8J;AA6KiB;AA7Td,SAAAN,GAAAQ,GAAA;AAAA,SA6OuBhQ,EAAC6D;AAA+B;AA7OvD,SAAA0L,GAAAU,GAAA;AAAA,SAsOuBjQ,EAAC2D;AAA+B;AAtOvD,SAAA0L,GAAA9L,GAAA;AAAA,SAgOsDA,EAAEpD,YAAiB+P,SAAK;AAAY;AAhO1F,SAAAxB,GAAAyB,GAAA;AAAA,SAgL4BnQ,MAAM9C;AAAS;AAhL3C,SAAAuR,GAAA2B,GAAA;AAAA,SA+K6CpQ,MAAM9C;AAAS;AA/K5D,SAAAsR,GAAA6B,GAAA;AAAA,SA+KyBrQ,EAAC/F;AAAK;AA/K/B,SAAAsU,GAAA+B,GAAA;AAAA,SA8K2CtQ,MAAM9C;AAAS;AA9K1D,SAAAoR,GAAAiC,GAAA;AAAA,SA8KuBvQ,EAAC/F;AAAK;AA9K7B,SAAA8Q,GAAAyF,GAAAC,GAAA;AAAA,SAsEkBD,IAAIC;AAAC;AAtEvB,SAAA5F,GAAA7K,GAAA;AAAA,SAkEgBA,EAACyK;AAAK;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-CHPV5EwG-D4pAp7u0.cjs"),F=require("react"),He=require("./index-Cno4Q0YE.cjs"),Ce=require("./parse-xYI9yrvL.cjs"),Le=require("./getSliderMarks-BzrpHrHS.cjs"),Te=require("./index-DQA8q5sC.cjs"),Ne=require("./index-CSNtgibC.cjs"),ze=require("./numberFormattingFunction-Cn9R7CM9.cjs"),De=require("./Tooltip-Hr46paWP.cjs"),y=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Fe=require("./Axis-BTaS9oPQ.cjs"),Ue=require("./AxisTitle-DP_evhbe.cjs"),Je=require("./XAxesLabels-C03jHniq.cjs"),Be=require("./ReferenceLine-CpU4G01Y.cjs"),Ke=require("./YTicksAndGridLines-DFjm8RCc.cjs"),Qe=require("./XTicksAndGridLines-C5DuC5oY.cjs"),Ze=require("./YAxesLabels-DeENFC2M.cjs"),Pe=require("./DetailsModal-jmmKRMRM.cjs"),Ge=require("./linear-CgUCbw9F.cjs"),We=require("./band-VYfcZeJ2.cjs"),Rt=require("./proxy-CqH8m8IQ.cjs"),Xe=require("./use-in-view-dnRv_qqF.cjs"),Ye=require("./index-FXfr51ZM.cjs"),Ee=require("./Colors.cjs"),_e=require("./EmptyState-CFmiFPHz.cjs"),qe=require("./GraphContainer-Cul9b74X.cjs"),ti=require("./GraphFooter.cjs"),ei=require("./GraphHeader.cjs"),ii=require("./ColorLegend.cjs"),$e=require("./ensureCompleteData-D9bQTiVS.cjs"),Se=require("./index-BhI7mBJx.cjs");function ni(e){const t=a.compilerRuntimeExports.c(164),{data:i,width:Ot,height:ae,barColor:Wt,suffix:It,prefix:N,barPadding:Xt,showLabels:Yt,showValues:se,showTicks:Nt,truncateBy:le,leftMargin:he,rightMargin:Ht,topMargin:re,bottomMargin:be,tooltip:bt,onSeriesMouseOver:vt,refValues:Vt,maxValue:j,minValue:wt,highlightedDataPoints:tt,onSeriesMouseClick:ut,labelOrder:k,maxBarThickness:Jt,minBarThickness:Et,resetSelectionOnDoubleClick:Kt,detailsOnClick:ct,barAxisTitle:U,valueColor:et,noOfTicks:Ct,styles:p,classNames:r,targetStyle:d,targetColor:B,qualitativeRangeColors:it,measureBarWidthFactor:g,animate:o,dimmedOpacity:m,precision:xt,customLayers:nt,naLabel:V,targetLineThickness:oe,hideAxisLine:ue,locale:jt}=e,P=he===void 0?20:he,At=Ht===void 0?20:Ht,pe=re===void 0?20:re,ge=be===void 0?25:be,ve=F.useRef(null);let ye;t[0]!==o.amount||t[1]!==o.once?(ye={once:o.once,amount:o.amount},t[0]=o.amount,t[1]=o.once,t[2]=ye):ye=t[2];const E=Xe.useInView(ve,ye),O=U?P+30:P;let zt;t[3]!==ge||t[4]!==At||t[5]!==O||t[6]!==pe?(zt={top:pe,bottom:ge,left:O,right:At},t[3]=ge,t[4]=At,t[5]=O,t[6]=pe,t[7]=zt):zt=t[7];const b=zt,[at,Mt]=F.useState(void 0),[st,ce]=F.useState(void 0),[Qt,xe]=F.useState(void 0),[Zt,me]=F.useState(void 0),f=Ot-b.left-b.right,mt=ae-b.top-b.bottom;let lt;t[8]!==i?(lt=Math.max(...i.filter(Ni).map(Ii))<0?0:Math.max(...i.filter(Oi).map(Ri)),t[8]=i,t[9]=lt):lt=t[9];const _t=lt;let Lt;t[10]!==i?(Lt=Math.max(...i.filter(ki).map(Mi))<0?0:Math.max(...i.filter(Ai).map(ji)),t[10]=i,t[11]=Lt):Lt=t[11];const qt=Lt;let $t;t[12]!==i?($t=Math.max(...i.map(vi)),t[12]=i,t[13]=$t):$t=t[13];const St=$t;let Tt;t[14]!==_t||t[15]!==j||t[16]!==St||t[17]!==qt?(Tt=y.checkIfNullOrUndefined(j)?Math.max(...[_t,qt,St].filter(Number.isFinite))<0?0:Math.max(...[_t,qt,St].filter(Number.isFinite)):j,t[14]=_t,t[15]=j,t[16]=St,t[17]=qt,t[18]=Tt):Tt=t[18];const Dt=Tt;let te;t[19]!==i?(te=Math.min(...i.filter(bi).map(yi))>=0?0:Math.min(...i.filter(gi).map(pi)),t[19]=i,t[20]=te):te=t[20];const Ft=te;let Ut;t[21]!==i?(Ut=Math.min(...i.filter(hi).map(fi))>=0?0:Math.min(...i.filter(di).map(mi)),t[21]=i,t[22]=Ut):Ut=t[22];const Bt=Ut;let dt;t[23]!==Ft||t[24]!==wt||t[25]!==Bt?(dt=y.checkIfNullOrUndefined(wt)?Math.min(...[Ft,Bt].filter(Number.isFinite))>=0?0:Math.min(...[Ft,Bt].filter(Number.isFinite)):wt,t[23]=Ft,t[24]=wt,t[25]=Bt,t[26]=dt):dt=t[26];const M=dt;let G;if(t[27]!==i||t[28]!==k){const c=new Set,s=i.map((A,ot)=>{const T=k?`${A.label}`:`${ot}`;return c.add(T),{...A,id:T}}),R=k?k.filter(A=>!c.has(A)):[];G=[...s,...R.map(xi)],t[27]=i,t[28]=k,t[29]=G}else G=t[29];const ft=G;let ht;t[30]!==ft||t[31]!==k?(ht=k??ft.map(ci),t[30]=ft,t[31]=k,t[32]=ht):ht=t[32];const pt=ht;let rt,W,C,X,Y,z,L,v,w,I,H,J,K,q;if(t[33]!==o||t[34]!==U||t[35]!==Wt||t[36]!==pt||t[37]!==Xt||t[38]!==r?.graphObjectValues||t[39]!==r?.xAxis?.axis||t[40]!==r?.xAxis?.labels||t[41]!==r?.yAxis?.gridLines||t[42]!==r?.yAxis?.labels||t[43]!==r?.yAxis?.title||t[44]!==nt||t[45]!==ft||t[46]!==ct||t[47]!==m||t[48]!==mt||t[49]!==f||t[50]!==ae||t[51]!==ue||t[52]!==tt||t[53]!==E||t[54]!==P||t[55]!==jt||t[56]!==b.bottom||t[57]!==b.left||t[58]!==b.right||t[59]!==b.top||t[60]!==Jt||t[61]!==g||t[62]!==Et||t[63]!==st||t[64]!==V||t[65]!==Ct||t[66]!==ut||t[67]!==vt||t[68]!==xt||t[69]!==N||t[70]!==it||t[71]!==Vt||t[72]!==Kt||t[73]!==Yt||t[74]!==Nt||t[75]!==se||t[76]!==p?.graphObjectValues||t[77]!==p?.xAxis?.axis||t[78]!==p?.xAxis?.labels||t[79]!==p?.yAxis?.gridLines||t[80]!==p?.yAxis?.labels||t[81]!==p?.yAxis?.title||t[82]!==It||t[83]!==B||t[84]!==oe||t[85]!==d||t[86]!==le||t[87]!==et||t[88]!==Ot||t[89]!==Dt||t[90]!==M){const c=Ge.linear().domain([M,Dt]).range([mt,0]).nice(),s=We.band().domain(pt).range([0,Et?Math.max(f,Et*pt.length):Jt?Math.min(f,Jt*pt.length):f]).paddingInner(Xt),R=c.ticks(Ct);W=Rt.motion.svg,I=`${Ot}px`,H=`${ae}px`,J=`0 0 ${Ot} ${ae}`,K="ltr",q=ve,Y=`translate(${b.left},${b.top})`;let A;t[105]!==jt||t[106]!==V||t[107]!==xt||t[108]!==N||t[109]!==Nt||t[110]!==It||t[111]!==M?(A=Nt?ze.numberFormattingFunction(M<0?0:M,V,xt,N,It,jt):void 0,t[105]=jt,t[106]=V,t[107]=xt,t[108]=N,t[109]=Nt,t[110]=It,t[111]=M,t[112]=A):A=t[112];const ot=r?.xAxis?.axis,T=r?.yAxis?.labels;let x;t[113]!==ot||t[114]!==T?(x={axis:ot,label:T},t[113]=ot,t[114]=T,t[115]=x):x=t[115];const D=p?.xAxis?.axis,de=p?.yAxis?.labels;let kt;t[116]!==D||t[117]!==de?(kt={axis:D,label:de},t[116]=D,t[117]=de,t[118]=kt):kt=t[118],z=a.jsxRuntimeExports.jsx(Fe.Axis,{hideAxisLine:ue,y1:c(M<0?0:M),y2:c(M<0?0:M),x1:0-P,x2:f+b.right,label:A,labelPos:{x:0-P,dx:0,dy:Dt<0?"1em":-5,y:c(M<0?0:M)},classNames:x,styles:kt}),L=Nt?a.jsxRuntimeExports.jsx(Ke.YTicksAndGridLines,{values:R.filter(ui),y:R.filter(oi).map(l=>c(l)),x1:0-P,x2:f+b.right,styles:{gridLines:p?.yAxis?.gridLines,labels:p?.yAxis?.labels},classNames:{gridLines:r?.yAxis?.gridLines,labels:r?.yAxis?.labels},suffix:It,prefix:N,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:xt,locale:jt}):null;const ee=0-P-15,Gt=mt/2,n=p?.yAxis?.title,_=r?.yAxis?.title;t[119]!==U||t[120]!==ee||t[121]!==Gt||t[122]!==n||t[123]!==_?(v=a.jsxRuntimeExports.jsx(Ue.AxisTitle,{x:ee,y:Gt,style:n,className:_,text:U,rotate90:!0}),t[119]=U,t[120]=ee,t[121]=Gt,t[122]=n,t[123]=_,t[124]=v):v=t[124],t[125]!==nt?(w=nt.filter(ri).map(li),t[125]=nt,t[126]=w):w=t[126],rt=Ye.AnimatePresence,C=ft.map(l=>y.checkIfNullOrUndefined(s(l.id))?null:a.jsxRuntimeExports.jsxs(Rt.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:yt=>{Mt(l),me(yt.clientY),xe(yt.clientX),vt?.(l)},onClick:()=>{(ut||ct)&&(Te.isEqual(st,l)&&Kt?(ce(void 0),ut?.(void 0)):(ce(l),ut?.(l)))},onMouseMove:yt=>{Mt(l),me(yt.clientY),xe(yt.clientX)},onMouseLeave:()=>{Mt(void 0),xe(void 0),me(void 0),vt?.(void 0)},exit:{opacity:0,transition:{duration:o.duration}},variants:{initial:{x:s(`${l.id}`),y:0,opacity:tt?tt.indexOf(l.label)!==-1?.85:m:.85},whileInView:{x:s(`${l.id}`),y:0,opacity:tt?tt.indexOf(l.label)!==-1?.85:m:.85,transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial",children:[l.qualitativeRange?l.qualitativeRange.map((yt,ie)=>a.jsxRuntimeExports.jsx(Rt.motion.rect,{x:0,exit:{height:0,y:c(0),transition:{duration:o.duration}},variants:{initial:{height:0,y:c(0),fill:it[ie]},whileInView:{height:Math.abs(c(Ne.sum(l.qualitativeRange.filter((we,ne)=>ne<=ie&&we)))-c(Ne.sum(l.qualitativeRange.filter((we,ne)=>ne<ie&&we)))),y:c(Ne.sum(l.qualitativeRange.filter((we,ne)=>ne<=ie&&we))),fill:it[ie],transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial",width:s.bandwidth()},ie)):null,l.target&&d==="background"?a.jsxRuntimeExports.jsx(Rt.motion.rect,{x:0,width:s.bandwidth(),exit:{height:0,y:c(0),fill:B,transition:{duration:o.duration}},variants:{initial:{height:0,fill:B,y:c(0)},whileInView:{height:Math.abs(c(l.target)-c(0)),fill:B,y:l.target>0?c(l.target):c(0),transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial"}):null,l.size?a.jsxRuntimeExports.jsx(Rt.motion.rect,{x:s.bandwidth()*((1-g)/2),width:s.bandwidth()*g,style:{fill:Wt},exit:{height:0,y:c(0),transition:{duration:o.duration}},variants:{initial:{height:0,y:c(0)},whileInView:{height:Math.abs(c(l.size)-c(0)),y:l.size>0?c(l.size):c(0),transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial"}):null,l.target&&d==="line"?a.jsxRuntimeExports.jsx(Rt.motion.rect,{x:0,width:s.bandwidth(),exit:{y:c(0),opacity:0,fill:B,transition:{duration:o.duration}},variants:{initial:{y:c(0),opacity:0,fill:B},whileInView:{y:c(l.target)-oe/2,opacity:1,fill:B,transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial",height:oe}):null,Yt?a.jsxRuntimeExports.jsx(Je.XAxesLabels,{value:`${l.label}`.length<le?`${l.label}`:`${`${l.label}`.substring(0,le)}...`,y:(l.size||0)<0?0:c(0)+5,x:0,width:s.bandwidth(),height:(l.size||0)<0?c(0)-5:b.bottom,style:p?.xAxis?.labels,className:r?.xAxis?.labels,alignment:(l.size||0)<0?"bottom":"top",animate:o,isInView:E}):null,se?a.jsxRuntimeExports.jsx(Rt.motion.text,{x:s.bandwidth()/2,style:{textAnchor:"middle",...p?.graphObjectValues||{}},className:a.mo("graph-value text-sm",!et&&Wt.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",r?.graphObjectValues),dy:l.size?l.size>=0?"-5px":"1em":"-5px",exit:{opacity:0,transition:{duration:o.duration}},variants:{initial:{y:c(0),opacity:0,fill:et||Wt},whileInView:{y:c(l.size||0),opacity:1,fill:et||Wt,transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial",children:ze.numberFormattingFunction(l.size,V,xt,N,It,jt)}):null]},l.label)),X=Vt?a.jsxRuntimeExports.jsx(a.jsxRuntimeExports.Fragment,{children:Vt.map((l,yt)=>a.jsxRuntimeExports.jsx(Be.RefLineY,{text:l.text,color:l.color,y:c(l.value),x1:0-P,x2:f+b.right,classNames:l.classNames,styles:l.styles,animate:o,isInView:E},yt))}):null,t[33]=o,t[34]=U,t[35]=Wt,t[36]=pt,t[37]=Xt,t[38]=r?.graphObjectValues,t[39]=r?.xAxis?.axis,t[40]=r?.xAxis?.labels,t[41]=r?.yAxis?.gridLines,t[42]=r?.yAxis?.labels,t[43]=r?.yAxis?.title,t[44]=nt,t[45]=ft,t[46]=ct,t[47]=m,t[48]=mt,t[49]=f,t[50]=ae,t[51]=ue,t[52]=tt,t[53]=E,t[54]=P,t[55]=jt,t[56]=b.bottom,t[57]=b.left,t[58]=b.right,t[59]=b.top,t[60]=Jt,t[61]=g,t[62]=Et,t[63]=st,t[64]=V,t[65]=Ct,t[66]=ut,t[67]=vt,t[68]=xt,t[69]=N,t[70]=it,t[71]=Vt,t[72]=Kt,t[73]=Yt,t[74]=Nt,t[75]=se,t[76]=p?.graphObjectValues,t[77]=p?.xAxis?.axis,t[78]=p?.xAxis?.labels,t[79]=p?.yAxis?.gridLines,t[80]=p?.yAxis?.labels,t[81]=p?.yAxis?.title,t[82]=It,t[83]=B,t[84]=oe,t[85]=d,t[86]=le,t[87]=et,t[88]=Ot,t[89]=Dt,t[90]=M,t[91]=rt,t[92]=W,t[93]=C,t[94]=X,t[95]=Y,t[96]=z,t[97]=L,t[98]=v,t[99]=w,t[100]=I,t[101]=H,t[102]=J,t[103]=K,t[104]=q}else rt=t[91],W=t[92],C=t[93],X=t[94],Y=t[95],z=t[96],L=t[97],v=t[98],w=t[99],I=t[100],H=t[101],J=t[102],K=t[103],q=t[104];let u;t[127]!==rt||t[128]!==C||t[129]!==X?(u=a.jsxRuntimeExports.jsxs(rt,{children:[C,X]}),t[127]=rt,t[128]=C,t[129]=X,t[130]=u):u=t[130];let Q;t[131]!==nt?(Q=nt.filter(si).map(ai),t[131]=nt,t[132]=Q):Q=t[132];let Z;t[133]!==Y||t[134]!==z||t[135]!==L||t[136]!==v||t[137]!==w||t[138]!==u||t[139]!==Q?(Z=a.jsxRuntimeExports.jsxs("g",{transform:Y,children:[z,L,v,w,u,Q]}),t[133]=Y,t[134]=z,t[135]=L,t[136]=v,t[137]=w,t[138]=u,t[139]=Q,t[140]=Z):Z=t[140];let $;t[141]!==W||t[142]!==I||t[143]!==H||t[144]!==J||t[145]!==K||t[146]!==q||t[147]!==Z?($=a.jsxRuntimeExports.jsx(W,{width:I,height:H,viewBox:J,direction:K,ref:q,children:Z}),t[141]=W,t[142]=I,t[143]=H,t[144]=J,t[145]=K,t[146]=q,t[147]=Z,t[148]=$):$=t[148];let gt;t[149]!==r?.tooltip||t[150]!==Qt||t[151]!==Zt||t[152]!==at||t[153]!==p?.tooltip||t[154]!==bt?(gt=at&&bt&&Qt&&Zt?a.jsxRuntimeExports.jsx(De.Tooltip,{data:at,body:bt,xPos:Qt,yPos:Zt,backgroundStyle:p?.tooltip,className:r?.tooltip}):null,t[149]=r?.tooltip,t[150]=Qt,t[151]=Zt,t[152]=at,t[153]=p?.tooltip,t[154]=bt,t[155]=gt):gt=t[155];let S;t[156]!==r?.modal||t[157]!==ct||t[158]!==st?(S=ct&&st!==void 0?a.jsxRuntimeExports.jsx(Pe.DetailsModal,{body:ct,data:st,setData:ce,className:r?.modal}):null,t[156]=r?.modal,t[157]=ct,t[158]=st,t[159]=S):S=t[159];let Pt;return t[160]!==$||t[161]!==gt||t[162]!==S?(Pt=a.jsxRuntimeExports.jsxs(a.jsxRuntimeExports.Fragment,{children:[$,gt,S]}),t[160]=$,t[161]=gt,t[162]=S,t[163]=Pt):Pt=t[163],Pt}function ai(e){return e.layer}function si(e){return e.position==="after"}function li(e){return e.layer}function ri(e){return e.position==="before"}function oi(e){return e!==0}function ui(e){return e!==0}function ci(e){return`${e.id}`}function xi(e){return{id:e,label:e,size:null,target:null,qualitativeRange:null}}function mi(e){return e.target}function di(e){return!y.checkIfNullOrUndefined(e.target)}function fi(e){return e.target}function hi(e){return!y.checkIfNullOrUndefined(e.target)}function pi(e){return e.size}function gi(e){return!y.checkIfNullOrUndefined(e.size)}function yi(e){return e.size}function bi(e){return!y.checkIfNullOrUndefined(e.size)}function vi(e){return Ne.sum((e.qualitativeRange||[]).filter(wi))||0}function wi(e){return!y.checkIfNullOrUndefined(e)}function ji(e){return e.target}function Ai(e){return!y.checkIfNullOrUndefined(e.size)}function Mi(e){return e.target}function ki(e){return!y.checkIfNullOrUndefined(e.target)}function Ri(e){return e.size}function Oi(e){return!y.checkIfNullOrUndefined(e.size)}function Ii(e){return e.size}function Ni(e){return!y.checkIfNullOrUndefined(e.size)}function Vi(e){const t=a.compilerRuntimeExports.c(154),{data:i,topMargin:Ot,bottomMargin:ae,leftMargin:Wt,rightMargin:It,barColor:N,suffix:Xt,prefix:Yt,barPadding:se,showValues:Nt,showTicks:le,truncateBy:he,width:Ht,height:re,showLabels:be,tooltip:bt,onSeriesMouseOver:vt,refValues:Vt,highlightedDataPoints:j,maxValue:wt,minValue:tt,onSeriesMouseClick:ut,labelOrder:k,rtl:Jt,maxBarThickness:Et,minBarThickness:Kt,resetSelectionOnDoubleClick:ct,detailsOnClick:U,barAxisTitle:et,valueColor:Ct,noOfTicks:p,styles:r,classNames:d,targetStyle:B,targetColor:it,qualitativeRangeColors:g,measureBarWidthFactor:o,animate:m,dimmedOpacity:xt,precision:nt,customLayers:V,naLabel:oe,targetLineThickness:ue,hideAxisLine:jt,locale:P}=e,At=Ot===void 0?25:Ot,pe=ae===void 0?10:ae,ge=Wt===void 0?100:Wt,ve=It===void 0?40:It,ye=F.useRef(null);let E;t[0]!==m.amount||t[1]!==m.once?(E={once:m.once,amount:m.amount},t[0]=m.amount,t[1]=m.once,t[2]=E):E=t[2];const O=Xe.useInView(ye,E),[zt,b]=F.useState(void 0),[at,Mt]=F.useState(void 0),[st,ce]=F.useState(void 0),[Qt,xe]=F.useState(void 0),Zt=et?At+25:At;let me;t[3]!==pe||t[4]!==ge||t[5]!==ve||t[6]!==Zt?(me={top:Zt,bottom:pe,left:ge,right:ve},t[3]=pe,t[4]=ge,t[5]=ve,t[6]=Zt,t[7]=me):me=t[7];const f=me,mt=Ht-f.left-f.right,lt=re-f.top-f.bottom;let _t;t[8]!==i?(_t=Math.max(...i.filter(nn).map(en))<0?0:Math.max(...i.filter(tn).map(_i)),t[8]=i,t[9]=_t):_t=t[9];const Lt=_t;let qt;t[10]!==i?(qt=Math.max(...i.filter(Zi).map(Qi))<0?0:Math.max(...i.filter(Ki).map(Ji)),t[10]=i,t[11]=qt):qt=t[11];const $t=qt;let St;t[12]!==i?(St=Math.max(...i.map(Yi)),t[12]=i,t[13]=St):St=t[13];const Tt=St;let Dt;t[14]!==Lt||t[15]!==wt||t[16]!==Tt||t[17]!==$t?(Dt=y.checkIfNullOrUndefined(wt)?Math.max(...[Lt,$t,Tt].filter(Number.isFinite))<0?0:Math.max(...[Lt,$t,Tt].filter(Number.isFinite)):wt,t[14]=Lt,t[15]=wt,t[16]=Tt,t[17]=$t,t[18]=Dt):Dt=t[18];const te=Dt;let Ft;t[19]!==i?(Ft=Math.min(...i.filter(Xi).map(Wi))>=0?0:Math.min(...i.filter(Gi).map(Pi)),t[19]=i,t[20]=Ft):Ft=t[20];const Ut=Ft;let Bt;t[21]!==i?(Bt=Math.min(...i.filter(Bi).map(Ui))>=0?0:Math.min(...i.filter(Fi).map(Di)),t[21]=i,t[22]=Bt):Bt=t[22];const dt=Bt;let M;t[23]!==Ut||t[24]!==tt||t[25]!==dt?(M=y.checkIfNullOrUndefined(tt)?Math.min(...[Ut,dt].filter(Number.isFinite))>=0?0:Math.min(...[Ut,dt].filter(Number.isFinite)):tt,t[23]=Ut,t[24]=tt,t[25]=dt,t[26]=M):M=t[26];const G=M;let ft;if(t[27]!==i||t[28]!==k){const s=new Set,R=i.map((ot,T)=>{const x=k?`${ot.label}`:`${T}`;return s.add(x),{...ot,id:x}}),A=k?k.filter(ot=>!s.has(ot)):[];ft=[...R,...A.map(Ti)],t[27]=i,t[28]=k,t[29]=ft}else ft=t[29];const ht=ft;let pt;t[30]!==ht||t[31]!==k?(pt=k??ht.map(Si),t[30]=ht,t[31]=k,t[32]=pt):pt=t[32];const rt=pt;let W,C,X,Y,z,L,v,w,I,H,J,K,q,u;if(t[33]!==m||t[34]!==et||t[35]!==N||t[36]!==rt||t[37]!==se||t[38]!==d?.graphObjectValues||t[39]!==d?.xAxis?.gridLines||t[40]!==d?.xAxis?.labels||t[41]!==d?.xAxis?.title||t[42]!==d?.yAxis?.axis||t[43]!==d?.yAxis?.labels||t[44]!==V||t[45]!==ht||t[46]!==U||t[47]!==xt||t[48]!==lt||t[49]!==mt||t[50]!==re||t[51]!==jt||t[52]!==j||t[53]!==O||t[54]!==P||t[55]!==f.bottom||t[56]!==f.left||t[57]!==f.top||t[58]!==Et||t[59]!==o||t[60]!==Kt||t[61]!==at||t[62]!==oe||t[63]!==p||t[64]!==ut||t[65]!==vt||t[66]!==nt||t[67]!==Yt||t[68]!==g||t[69]!==Vt||t[70]!==ct||t[71]!==Jt||t[72]!==be||t[73]!==le||t[74]!==Nt||t[75]!==r?.graphObjectValues||t[76]!==r?.xAxis?.gridLines||t[77]!==r?.xAxis?.labels||t[78]!==r?.xAxis?.title||t[79]!==r?.yAxis?.axis||t[80]!==r?.yAxis?.labels||t[81]!==Xt||t[82]!==it||t[83]!==ue||t[84]!==B||t[85]!==At||t[86]!==he||t[87]!==Ct||t[88]!==Ht||t[89]!==te||t[90]!==G){const s=Ge.linear().domain([G,te]).range([0,mt]).nice(),R=We.band().domain(rt).range([0,Kt?Math.max(lt,Kt*rt.length):Et?Math.min(lt,Et*rt.length):lt]).paddingInner(se),A=s.ticks(p);C=Rt.motion.svg,H=`${Ht}px`,J=`${re}px`,K=`0 0 ${Ht} ${re}`,q="ltr",u=ye,z=`translate(${f.left},${f.top})`,L=le?a.jsxRuntimeExports.jsx(Qe.XTicksAndGridLines,{values:A.filter($i),x:A.filter(qi).map(n=>s(n)),y1:0-At,y2:lt+f.bottom,styles:{gridLines:r?.xAxis?.gridLines,labels:r?.xAxis?.labels},classNames:{gridLines:d?.xAxis?.gridLines,labels:d?.xAxis?.labels},suffix:Xt,prefix:Yt,labelType:"secondary",showGridLines:!0,precision:nt,locale:P}):null;const ot=mt/2,T=0-f.top+15,x=r?.xAxis?.title,D=d?.xAxis?.title;t[105]!==et||t[106]!==ot||t[107]!==T||t[108]!==x||t[109]!==D?(v=a.jsxRuntimeExports.jsx(Ue.AxisTitle,{x:ot,y:T,style:x,className:D,text:et}),t[105]=et,t[106]=ot,t[107]=T,t[108]=x,t[109]=D,t[110]=v):v=t[110];const de=d?.yAxis?.axis;let kt;t[111]!==de?(kt={axis:de},t[111]=de,t[112]=kt):kt=t[112];const ee=r?.yAxis?.axis;let Gt;t[113]!==ee?(Gt={axis:ee},t[113]=ee,t[114]=Gt):Gt=t[114],w=a.jsxRuntimeExports.jsx(Fe.Axis,{hideAxisLine:jt,x1:s(G<0?0:G),x2:s(G<0?0:G),y1:-2.5,y2:lt+f.bottom,classNames:kt,styles:Gt}),t[115]!==V?(I=V.filter(Li).map(zi),t[115]=V,t[116]=I):I=t[116],W=Ye.AnimatePresence,X=ht.map(n=>y.checkIfNullOrUndefined(R(n.id))?null:a.jsxRuntimeExports.jsxs(Rt.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:_=>{b(n),xe(_.clientY),ce(_.clientX),vt?.(n)},onClick:()=>{(ut||U)&&(Te.isEqual(at,n)&&ct?(Mt(void 0),ut?.(void 0)):(Mt(n),ut?.(n)))},onMouseMove:_=>{b(n),xe(_.clientY),ce(_.clientX)},onMouseLeave:()=>{b(void 0),ce(void 0),xe(void 0),vt?.(void 0)},exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{x:0,y:R(`${n.id}`),opacity:j?j.indexOf(n.label)!==-1?.85:xt:.85},whileInView:{x:0,y:R(`${n.id}`),opacity:j?j.indexOf(n.label)!==-1?.85:xt:.85,transition:{duration:m.duration}}},initial:"initial",animate:O?"whileInView":"initial",children:[n.qualitativeRange?n.qualitativeRange.map((_,l)=>a.jsxRuntimeExports.jsx(Rt.motion.rect,{exit:{width:0,x:s(0),transition:{duration:m.duration}},variants:{initial:{x:s(0),width:0,fill:g[l]},whileInView:{x:s(l===0?0:Ne.sum(n.qualitativeRange.filter((yt,ie)=>ie<l&&yt))),width:s(_),fill:g[l],transition:{duration:m.duration}}},initial:"initial",animate:O?"whileInView":"initial",y:0,height:R.bandwidth()},l)):null,n.target&&B==="background"?a.jsxRuntimeExports.jsx(Rt.motion.rect,{y:0,x:n.target>=0?s(0):s(n.target),height:R.bandwidth(),exit:{width:0,x:s(0),fill:it,transition:{duration:m.duration}},variants:{initial:{x:s(0),fill:it,width:0},whileInView:{x:n.target>=0?s(0):s(n.target),fill:it,width:n.target>=0?s(n.target)-s(0):s(0)-s(n.target),transition:{duration:m.duration}}},initial:"initial",animate:O?"whileInView":"initial"}):null,n.size?a.jsxRuntimeExports.jsx(Rt.motion.rect,{y:R.bandwidth()*((1-o)/2),style:{fill:N},height:R.bandwidth()*o,exit:{width:0,x:s(0),transition:{duration:m.duration}},variants:{initial:{x:s(0),width:0},whileInView:{x:n.size>=0?s(0):s(n.size),width:n.size>=0?s(n.size)-s(0):s(0)-s(n.size),transition:{duration:m.duration}}},initial:"initial",animate:O?"whileInView":"initial"}):null,n.target&&B==="line"?a.jsxRuntimeExports.jsx(Rt.motion.rect,{y:0,height:R.bandwidth(),width:ue,exit:{opacity:0,x:s(0),fill:it,transition:{duration:m.duration}},variants:{initial:{x:s(0),opacity:0,fill:it},whileInView:{x:s(n.target)-ue/2,opacity:1,fill:it,transition:{duration:m.duration}}},initial:"initial",animate:O?"whileInView":"initial"}):null,be?a.jsxRuntimeExports.jsx(Ze.YAxesLabels,{value:`${n.label}`.length<he?`${n.label}`:`${`${n.label}`.substring(0,he)}...`,y:0,x:(n.size||0)<0?s(0):0-f.left,width:(n.size||0)<0?Ht-s(0):s(0)+f.left,height:R.bandwidth(),alignment:n.size&&n.size<0?"left":"right",style:r?.yAxis?.labels,className:d?.yAxis?.labels,animate:m,isInView:O}):null,Nt?a.jsxRuntimeExports.jsx(Rt.motion.text,{y:R.bandwidth()/2,style:{textAnchor:n.size&&n.size<0?"end":"start",...r?.graphObjectValues||{}},className:a.mo("graph-value text-sm",!Ct&&N.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",d?.graphObjectValues),dx:n.size&&n.size<0?-5:5,dy:"0.33em",exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{x:s(0),opacity:0,fill:Ct||N},whileInView:{x:n.size?s(n.size):s(0),opacity:1,fill:Ct||N,transition:{duration:m.duration}}},initial:"initial",animate:O?"whileInView":"initial",children:ze.numberFormattingFunction(n.size,oe,nt,Yt,Xt,P)}):null]},n.label)),Y=Vt?a.jsxRuntimeExports.jsx(a.jsxRuntimeExports.Fragment,{children:Vt.map((n,_)=>a.jsxRuntimeExports.jsx(Be.RefLineX,{text:n.text,color:n.color,x:s(n.value),y1:0-f.top,y2:lt+f.bottom,textSide:s(n.value)>mt*.75||Jt?"left":"right",classNames:n.classNames,styles:n.styles,animate:m,isInView:O},_))}):null,t[33]=m,t[34]=et,t[35]=N,t[36]=rt,t[37]=se,t[38]=d?.graphObjectValues,t[39]=d?.xAxis?.gridLines,t[40]=d?.xAxis?.labels,t[41]=d?.xAxis?.title,t[42]=d?.yAxis?.axis,t[43]=d?.yAxis?.labels,t[44]=V,t[45]=ht,t[46]=U,t[47]=xt,t[48]=lt,t[49]=mt,t[50]=re,t[51]=jt,t[52]=j,t[53]=O,t[54]=P,t[55]=f.bottom,t[56]=f.left,t[57]=f.top,t[58]=Et,t[59]=o,t[60]=Kt,t[61]=at,t[62]=oe,t[63]=p,t[64]=ut,t[65]=vt,t[66]=nt,t[67]=Yt,t[68]=g,t[69]=Vt,t[70]=ct,t[71]=Jt,t[72]=be,t[73]=le,t[74]=Nt,t[75]=r?.graphObjectValues,t[76]=r?.xAxis?.gridLines,t[77]=r?.xAxis?.labels,t[78]=r?.xAxis?.title,t[79]=r?.yAxis?.axis,t[80]=r?.yAxis?.labels,t[81]=Xt,t[82]=it,t[83]=ue,t[84]=B,t[85]=At,t[86]=he,t[87]=Ct,t[88]=Ht,t[89]=te,t[90]=G,t[91]=W,t[92]=C,t[93]=X,t[94]=Y,t[95]=z,t[96]=L,t[97]=v,t[98]=w,t[99]=I,t[100]=H,t[101]=J,t[102]=K,t[103]=q,t[104]=u}else W=t[91],C=t[92],X=t[93],Y=t[94],z=t[95],L=t[96],v=t[97],w=t[98],I=t[99],H=t[100],J=t[101],K=t[102],q=t[103],u=t[104];let Q;t[117]!==W||t[118]!==X||t[119]!==Y?(Q=a.jsxRuntimeExports.jsxs(W,{children:[X,Y]}),t[117]=W,t[118]=X,t[119]=Y,t[120]=Q):Q=t[120];let Z;t[121]!==V?(Z=V.filter(Ci).map(Ei),t[121]=V,t[122]=Z):Z=t[122];let $;t[123]!==z||t[124]!==L||t[125]!==v||t[126]!==w||t[127]!==I||t[128]!==Q||t[129]!==Z?($=a.jsxRuntimeExports.jsxs("g",{transform:z,children:[L,v,w,I,Q,Z]}),t[123]=z,t[124]=L,t[125]=v,t[126]=w,t[127]=I,t[128]=Q,t[129]=Z,t[130]=$):$=t[130];let gt;t[131]!==C||t[132]!==H||t[133]!==J||t[134]!==K||t[135]!==q||t[136]!==u||t[137]!==$?(gt=a.jsxRuntimeExports.jsx(C,{width:H,height:J,viewBox:K,direction:q,ref:u,children:$}),t[131]=C,t[132]=H,t[133]=J,t[134]=K,t[135]=q,t[136]=u,t[137]=$,t[138]=gt):gt=t[138];let S;t[139]!==d?.tooltip||t[140]!==st||t[141]!==Qt||t[142]!==zt||t[143]!==r?.tooltip||t[144]!==bt?(S=zt&&bt&&st&&Qt?a.jsxRuntimeExports.jsx(De.Tooltip,{data:zt,body:bt,xPos:st,yPos:Qt,backgroundStyle:r?.tooltip,className:d?.tooltip}):null,t[139]=d?.tooltip,t[140]=st,t[141]=Qt,t[142]=zt,t[143]=r?.tooltip,t[144]=bt,t[145]=S):S=t[145];let Pt;t[146]!==d?.modal||t[147]!==U||t[148]!==at?(Pt=U&&at!==void 0?a.jsxRuntimeExports.jsx(Pe.DetailsModal,{body:U,data:at,setData:Mt,className:d?.modal}):null,t[146]=d?.modal,t[147]=U,t[148]=at,t[149]=Pt):Pt=t[149];let c;return t[150]!==gt||t[151]!==S||t[152]!==Pt?(c=a.jsxRuntimeExports.jsxs(a.jsxRuntimeExports.Fragment,{children:[gt,S,Pt]}),t[150]=gt,t[151]=S,t[152]=Pt,t[153]=c):c=t[153],c}function Ei(e){return e.layer}function Ci(e){return e.position==="after"}function zi(e){return e.layer}function Li(e){return e.position==="before"}function qi(e){return e!==0}function $i(e){return e!==0}function Si(e){return`${e.id}`}function Ti(e){return{id:e,label:e,size:null,target:null,qualitativeRange:null}}function Di(e){return e.target}function Fi(e){return!y.checkIfNullOrUndefined(e.target)}function Ui(e){return e.target}function Bi(e){return!y.checkIfNullOrUndefined(e.target)}function Pi(e){return e.size}function Gi(e){return!y.checkIfNullOrUndefined(e.size)}function Wi(e){return e.size}function Xi(e){return!y.checkIfNullOrUndefined(e.size)}function Yi(e){return Ne.sum((e.qualitativeRange||[]).filter(Hi))||0}function Hi(e){return!y.checkIfNullOrUndefined(e)}function Ji(e){return e.target}function Ki(e){return!y.checkIfNullOrUndefined(e.target)}function Qi(e){return e.target}function Zi(e){return!y.checkIfNullOrUndefined(e.target)}function _i(e){return e.size}function tn(e){return!y.checkIfNullOrUndefined(e.size)}function en(e){return e.size}function nn(e){return!y.checkIfNullOrUndefined(e.size)}function an(e){const t=a.compilerRuntimeExports.c(136),{data:i,graphTitle:Ot,barColor:ae,barPadding:Wt,showTicks:It,leftMargin:N,rightMargin:Xt,topMargin:Yt,bottomMargin:se,truncateBy:Nt,showLabels:le,showValues:he,backgroundColor:Ht,suffix:re,prefix:be,sources:bt,graphDescription:vt,height:Vt,width:j,footNote:wt,colorDomain:tt,colorLegendTitle:ut,padding:k,relativeHeight:Jt,tooltip:Et,onSeriesMouseOver:Kt,refValues:ct,showColorScale:U,graphID:et,maxValue:Ct,minValue:p,highlightedDataPoints:r,onSeriesMouseClick:d,valueColor:B,orientation:it,styles:g,classNames:o,qualitativeRangeColors:m,targetColor:xt,filterNA:nt,targetStyle:V,measureBarWidthFactor:oe,animate:ue,dimmedOpacity:jt,precision:P,customLayers:At,naLabel:pe,graphDownload:ge,dataDownload:ve,language:ye,theme:E,sortData:O,labelOrder:zt,minHeight:b,maxBarThickness:at,maxNumberOfBars:Mt,minBarThickness:st,ariaLabel:ce,resetSelectionOnDoubleClick:Qt,detailsOnClick:xe,barAxisTitle:Zt,noOfTicks:me,targetLineThickness:f,timeline:mt,hideAxisLine:lt,locale:_t}=e,Lt=ae===void 0?Ee.Colors.primaryColors["blue-600"]:ae,qt=Wt===void 0?.25:Wt,$t=It===void 0?!0:It,St=Nt===void 0?999:Nt,Tt=le===void 0?!0:le,Dt=he===void 0?!0:he,te=Ht===void 0?!1:Ht,Ft=re===void 0?"":re,Ut=be===void 0?"":be,Bt=U===void 0?!0:U,dt=it===void 0?"vertical":it,M=xt===void 0?Ee.Colors.light.grays["gray-700"]:xt,G=nt===void 0?!0:nt,ft=V===void 0?"line":V,ht=oe===void 0?.4:oe,pt=ue===void 0?!1:ue,rt=jt===void 0?.3:jt,W=P===void 0?2:P;let C;t[0]!==At?(C=At===void 0?[]:At,t[0]=At,t[1]=C):C=t[1];const X=C,Y=pe===void 0?"NA":pe,z=ge===void 0?!1:ge,L=ve===void 0?!1:ve,v=ye===void 0?"en":ye,w=E===void 0?"light":E,I=b===void 0?0:b,H=Qt===void 0?!0:Qt,J=me===void 0?5:me,K=f===void 0?2:f;let q;t[2]!==mt?(q=mt===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:mt,t[2]=mt,t[3]=q):q=t[3];const u=q,Q=lt===void 0?!1:lt,Z=_t===void 0?"en":_t,[$,gt]=F.useState(0),[S,Pt]=F.useState(0),c=F.useRef(null),s=F.useRef(null),R=dt==="horizontal"?Vi:ni,[A,ot]=F.useState(u.autoplay);let T;if(t[4]!==i||t[5]!==u.dateFormat){let h;t[7]!==u.dateFormat?(h=fe=>Ce.parse(`${fe.date}`,u.dateFormat||"yyyy",new Date).getTime(),t[7]=u.dateFormat,t[8]=h):h=t[8],T=[...new Set(i.filter(mn).map(h))],T.sort(xn),t[4]=i,t[5]=u.dateFormat,t[6]=T}else T=t[6];const x=T,[D,de]=F.useState(u.autoplay?0:x.length-1);let kt,ee;t[9]===Symbol.for("react.memo_cache_sentinel")?(kt=()=>{const h=new ResizeObserver(fe=>{gt(fe[0].target.clientWidth||620),Pt(fe[0].target.clientHeight||480)});return c.current&&h.observe(c.current),()=>h.disconnect()},ee=[],t[9]=kt,t[10]=ee):(kt=t[9],ee=t[10]),F.useEffect(kt,ee);let Gt,n;t[11]!==A||t[12]!==u.speed||t[13]!==x?(Gt=()=>{const h=setInterval(()=>{de(fe=>fe<x.length-1?fe+1:0)},(u.speed||2)*1e3);return A||clearInterval(h),()=>clearInterval(h)},n=[x,A,u.speed],t[11]=A,t[12]=u.speed,t[13]=x,t[14]=Gt,t[15]=n):(Gt=t[14],n=t[15]),F.useEffect(Gt,n);const _=u.dateFormat||"yyyy";let l;t[16]!==D||t[17]!==_||t[18]!==u.showOnlyActiveDate||t[19]!==x?(l=Le.getSliderMarks(x,D,u.showOnlyActiveDate,_),t[16]=D,t[17]=_,t[18]=u.showOnlyActiveDate,t[19]=x,t[20]=l):l=t[20];const yt=l,ie=o?.graphContainer,we=g?.graphContainer;let ne;t[21]!==o?.description||t[22]!==o?.title||t[23]!==i||t[24]!==L||t[25]!==vt||t[26]!==z||t[27]!==Ot||t[28]!==g?.description||t[29]!==g?.title||t[30]!==j?(ne=Ot||vt||z||L?a.jsxRuntimeExports.jsx(ei.GraphHeader,{styles:{title:g?.title,description:g?.description},classNames:{title:o?.title,description:o?.description},graphTitle:Ot,graphDescription:vt,width:j,graphDownload:z?s:void 0,dataDownload:L?i.map(cn).filter(un).length>0?i.map(on).filter(rn):i.filter(ln):null}):null,t[21]=o?.description,t[22]=o?.title,t[23]=i,t[24]=L,t[25]=vt,t[26]=z,t[27]=Ot,t[28]=g?.description,t[29]=g?.title,t[30]=j,t[31]=ne):ne=t[31];let je;t[32]!==D||t[33]!==yt||t[34]!==A||t[35]!==u.enabled||t[36]!==x?(je=u.enabled&&x.length>0&&yt?a.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[a.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{ot(!A)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":A?"Click to pause animation":"Click to play animation",children:A?a.jsxRuntimeExports.jsx(Se.Pause,{}):a.jsxRuntimeExports.jsx(Se.Play,{})}),a.jsxRuntimeExports.jsx(Le.Nr,{min:x[0],max:x[x.length-1],marks:yt,step:null,defaultValue:x[x.length-1],value:x[D],onChangeComplete:h=>{de(x.indexOf(h))},onChange:h=>{de(x.indexOf(h))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,t[32]=D,t[33]=yt,t[34]=A,t[35]=u.enabled,t[36]=x,t[37]=je):je=t[37];let Ae;t[38]!==o?.colorLegend||t[39]!==tt||t[40]!==ut||t[41]!==i||t[42]!==m||t[43]!==Bt||t[44]!==w||t[45]!==j?(Ae=Bt&&i.filter(sn).length!==0&&tt&&i.length>0?a.jsxRuntimeExports.jsx(ii.ColorLegend,{width:j,colorLegendTitle:ut,colors:m||Ee.Colors[w].sequentialColors.positiveColorsx10,colorDomain:tt,showNAColor:!1,className:o?.colorLegend}):null,t[38]=o?.colorLegend,t[39]=tt,t[40]=ut,t[41]=i,t[42]=m,t[43]=Bt,t[44]=w,t[45]=j,t[46]=Ae):Ae=t[46];let Me;t[47]!==i.length?(Me=i.length===0&&a.jsxRuntimeExports.jsx(_e.EmptyState,{}),t[47]=i.length,t[48]=Me):Me=t[48];let ke;t[49]!==R||t[50]!==pt||t[51]!==Zt||t[52]!==Lt||t[53]!==qt||t[54]!==se||t[55]!==o||t[56]!==X||t[57]!==i||t[58]!==xe||t[59]!==rt||t[60]!==G||t[61]!==Q||t[62]!==r||t[63]!==D||t[64]!==zt||t[65]!==v||t[66]!==N||t[67]!==Z||t[68]!==at||t[69]!==Mt||t[70]!==Ct||t[71]!==ht||t[72]!==st||t[73]!==p||t[74]!==Y||t[75]!==J||t[76]!==d||t[77]!==Kt||t[78]!==dt||t[79]!==W||t[80]!==Ut||t[81]!==m||t[82]!==ct||t[83]!==H||t[84]!==Xt||t[85]!==Tt||t[86]!==$t||t[87]!==Dt||t[88]!==O||t[89]!==g||t[90]!==Ft||t[91]!==S||t[92]!==$||t[93]!==M||t[94]!==K||t[95]!==ft||t[96]!==w||t[97]!==u.dateFormat||t[98]!==u.enabled||t[99]!==Et||t[100]!==Yt||t[101]!==St||t[102]!==x||t[103]!==B?(ke=$&&S&&i.length>0?a.jsxRuntimeExports.jsx(R,{hideAxisLine:Q,data:O?He.orderBy($e.ensureCompleteDataForBulletChart(i,u.dateFormat||"yyyy").filter(h=>u.enabled?`${h.date}`===Ce.format(new Date(x[D]),u.dateFormat||"yyyy"):h).filter(h=>G?!y.checkIfNullOrUndefined(h.size):h),[h=>h.size===void 0?O==="asc"?(dt==="horizontal"?1:-1)*(1/0):(dt==="horizontal"?-1:1)*(1/0):h.size],[O]).filter((h,fe)=>Mt?fe<Mt:!0):$e.ensureCompleteDataForBulletChart(i,u.dateFormat||"yyyy").filter(h=>u.enabled?`${h.date}`===Ce.format(new Date(x[D]),u.dateFormat||"yyyy"):h).filter(h=>G?!y.checkIfNullOrUndefined(h.size):h).filter((h,fe)=>Mt?fe<Mt:!0),barColor:Lt,targetColor:M,width:$,refValues:ct,height:S,suffix:Ft,prefix:Ut,barPadding:qt,showLabels:Tt,showValues:Dt,showTicks:$t,truncateBy:St,leftMargin:N,rightMargin:Xt,qualitativeRangeColors:m||Ee.Colors[w].sequentialColors.positiveColorsx10,topMargin:Yt,bottomMargin:se,tooltip:Et,onSeriesMouseOver:Kt,maxValue:Ct,minValue:p,highlightedDataPoints:r,onSeriesMouseClick:d,labelOrder:zt,maxBarThickness:at,minBarThickness:st,resetSelectionOnDoubleClick:H,detailsOnClick:xe,barAxisTitle:Zt,noOfTicks:J,valueColor:B,styles:g,classNames:o,targetStyle:ft,dimmedOpacity:rt,measureBarWidthFactor:ht,animate:pt===!0?{duration:.5,once:!0,amount:.5}:pt||{duration:0,once:!0,amount:0},precision:W,customLayers:X,naLabel:Y,targetLineThickness:K,rtl:v==="ar"||v==="he",locale:Z}):null,t[49]=R,t[50]=pt,t[51]=Zt,t[52]=Lt,t[53]=qt,t[54]=se,t[55]=o,t[56]=X,t[57]=i,t[58]=xe,t[59]=rt,t[60]=G,t[61]=Q,t[62]=r,t[63]=D,t[64]=zt,t[65]=v,t[66]=N,t[67]=Z,t[68]=at,t[69]=Mt,t[70]=Ct,t[71]=ht,t[72]=st,t[73]=p,t[74]=Y,t[75]=J,t[76]=d,t[77]=Kt,t[78]=dt,t[79]=W,t[80]=Ut,t[81]=m,t[82]=ct,t[83]=H,t[84]=Xt,t[85]=Tt,t[86]=$t,t[87]=Dt,t[88]=O,t[89]=g,t[90]=Ft,t[91]=S,t[92]=$,t[93]=M,t[94]=K,t[95]=ft,t[96]=w,t[97]=u.dateFormat,t[98]=u.enabled,t[99]=Et,t[100]=Yt,t[101]=St,t[102]=x,t[103]=B,t[104]=ke):ke=t[104];let Re;t[105]!==Me||t[106]!==ke?(Re=a.jsxRuntimeExports.jsxs(qe.GraphArea,{ref:c,children:[Me,ke]}),t[105]=Me,t[106]=ke,t[107]=Re):Re=t[107];let Oe;t[108]!==Ae||t[109]!==Re?(Oe=a.jsxRuntimeExports.jsxs("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:[Ae,Re]}),t[108]=Ae,t[109]=Re,t[110]=Oe):Oe=t[110];let Ie;t[111]!==o?.footnote||t[112]!==o?.source||t[113]!==wt||t[114]!==bt||t[115]!==g?.footnote||t[116]!==g?.source||t[117]!==j?(Ie=bt||wt?a.jsxRuntimeExports.jsx(ti.GraphFooter,{styles:{footnote:g?.footnote,source:g?.source},classNames:{footnote:o?.footnote,source:o?.source},sources:bt,footNote:wt,width:j}):null,t[111]=o?.footnote,t[112]=o?.source,t[113]=wt,t[114]=bt,t[115]=g?.footnote,t[116]=g?.source,t[117]=j,t[118]=Ie):Ie=t[118];let Ve;return t[119]!==ce||t[120]!==te||t[121]!==et||t[122]!==Vt||t[123]!==v||t[124]!==I||t[125]!==k||t[126]!==Jt||t[127]!==ie||t[128]!==we||t[129]!==ne||t[130]!==je||t[131]!==Oe||t[132]!==Ie||t[133]!==w||t[134]!==j?(Ve=a.jsxRuntimeExports.jsxs(qe.GraphContainer,{className:ie,style:we,id:et,ref:s,"aria-label":ce,backgroundColor:te,theme:w,language:v,minHeight:I,width:j,height:Vt,relativeHeight:Jt,padding:k,children:[ne,je,Oe,Ie]}),t[119]=ce,t[120]=te,t[121]=et,t[122]=Vt,t[123]=v,t[124]=I,t[125]=k,t[126]=Jt,t[127]=ie,t[128]=we,t[129]=ne,t[130]=je,t[131]=Oe,t[132]=Ie,t[133]=w,t[134]=j,t[135]=Ve):Ve=t[135],Ve}function sn(e){return e.qualitativeRange}function ln(e){return e!==void 0}function rn(e){return e!==void 0}function on(e){return e.data}function un(e){return e!==void 0}function cn(e){return e.data}function xn(e,t){return e-t}function mn(e){return e.date}exports.BulletChart=an;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-CHPV5EwG-D4pAp7u0.cjs"),F=require("react"),We=require("./index-Cno4Q0YE.cjs"),Ne=require("./parse-xYI9yrvL.cjs"),Ee=require("./getSliderMarks-BzrpHrHS.cjs"),qe=require("./index-DQA8q5sC.cjs"),Re=require("./index-CSNtgibC.cjs"),Ve=require("./numberFormattingFunction-u2iNHL_c.cjs"),$e=require("./Tooltip-C9F3uYG0.cjs"),b=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Se=require("./Axis-BTaS9oPQ.cjs"),De=require("./AxisTitle-DP_evhbe.cjs"),Xe=require("./XAxesLabels-C03jHniq.cjs"),Te=require("./ReferenceLine-CpU4G01Y.cjs"),Ye=require("./YTicksAndGridLines-sT3zdCs6.cjs"),He=require("./XTicksAndGridLines-B4UhDVyU.cjs"),Ze=require("./YAxesLabels-DeENFC2M.cjs"),Fe=require("./DetailsModal-Du8Fr1QD.cjs"),Ue=require("./linear-CgUCbw9F.cjs"),Be=require("./band-VYfcZeJ2.cjs"),Rt=require("./proxy-CqH8m8IQ.cjs"),Pe=require("./use-in-view-dnRv_qqF.cjs"),Ge=require("./index-FXfr51ZM.cjs"),Ie=require("./Colors.cjs"),Je=require("./EmptyState-CFmiFPHz.cjs"),Ce=require("./GraphContainer-Cul9b74X.cjs"),Ke=require("./GraphFooter.cjs"),Qe=require("./GraphHeader.cjs"),_e=require("./ColorLegend.cjs"),ze=require("./ensureCompleteData-D9bQTiVS.cjs"),Le=require("./index-BhI7mBJx.cjs");function ti(e){const t=l.compilerRuntimeExports.c(166),{data:i,width:Ot,height:re,barColor:Ht,suffix:It,prefix:C,barPadding:Zt,showLabels:Jt,showValues:oe,showTicks:Nt,truncateBy:ue,leftMargin:ge,rightMargin:Kt,topMargin:ce,bottomMargin:we,tooltip:wt,onSeriesMouseOver:jt,refValues:Vt,maxValue:w,minValue:At,highlightedDataPoints:et,onSeriesMouseClick:xt,labelOrder:M,maxBarThickness:Qt,minBarThickness:Et,resetSelectionOnDoubleClick:_t,detailsOnClick:mt,barAxisTitle:U,valueColor:it,noOfTicks:Ct,styles:p,classNames:r,targetStyle:d,targetColor:B,qualitativeRangeColors:nt,measureBarWidthFactor:y,animate:o,dimmedOpacity:m,precision:dt,customLayers:at,naLabel:z,targetLineThickness:xe,hideAxisLine:me,locale:Mt,padZeros:P}=e,G=ge===void 0?20:ge,te=Kt===void 0?20:Kt,ye=ce===void 0?20:ce,be=we===void 0?25:we,je=F.useRef(null);let zt;t[0]!==o.amount||t[1]!==o.once?(zt={once:o.once,amount:o.amount},t[0]=o.amount,t[1]=o.once,t[2]=zt):zt=t[2];const N=Pe.useInView(je,zt),W=U?G+30:G;let Lt;t[3]!==be||t[4]!==te||t[5]!==W||t[6]!==ye?(Lt={top:ye,bottom:be,left:W,right:te},t[3]=be,t[4]=te,t[5]=W,t[6]=ye,t[7]=Lt):Lt=t[7];const g=Lt,[st,de]=F.useState(void 0),[ft,fe]=F.useState(void 0),[qt,ve]=F.useState(void 0),[he,$t]=F.useState(void 0),f=Ot-g.left-g.right,I=re-g.top-g.bottom;let X;t[8]!==i?(X=Math.max(...i.filter(Ri).map(ki))<0?0:Math.max(...i.filter(Mi).map(Ai)),t[8]=i,t[9]=X):X=t[9];const St=X;let Dt;t[10]!==i?(Dt=Math.max(...i.filter(ji).map(wi))<0?0:Math.max(...i.filter(vi).map(bi)),t[10]=i,t[11]=Dt):Dt=t[11];const Tt=Dt;let Ft;t[12]!==i?(Ft=Math.max(...i.map(gi)),t[12]=i,t[13]=Ft):Ft=t[13];const Ut=Ft;let Bt;t[14]!==St||t[15]!==w||t[16]!==Ut||t[17]!==Tt?(Bt=b.checkIfNullOrUndefined(w)?Math.max(...[St,Tt,Ut].filter(Number.isFinite))<0?0:Math.max(...[St,Tt,Ut].filter(Number.isFinite)):w,t[14]=St,t[15]=w,t[16]=Ut,t[17]=Tt,t[18]=Bt):Bt=t[18];const Pt=Bt;let ee;t[19]!==i?(ee=Math.min(...i.filter(pi).map(hi))>=0?0:Math.min(...i.filter(fi).map(di)),t[19]=i,t[20]=ee):ee=t[20];const Gt=ee;let ht;t[21]!==i?(ht=Math.min(...i.filter(mi).map(xi))>=0?0:Math.min(...i.filter(ci).map(ui)),t[21]=i,t[22]=ht):ht=t[22];const Wt=ht;let kt;t[23]!==Gt||t[24]!==At||t[25]!==Wt?(kt=b.checkIfNullOrUndefined(At)?Math.min(...[Gt,Wt].filter(Number.isFinite))>=0?0:Math.min(...[Gt,Wt].filter(Number.isFinite)):At,t[23]=Gt,t[24]=At,t[25]=Wt,t[26]=kt):kt=t[26];const A=kt;let lt;if(t[27]!==i||t[28]!==M){const x=new Set,a=i.map((v,T)=>{const Q=M?`${v.label}`:`${T}`;return x.add(Q),{...v,id:Q}}),c=M?M.filter(v=>!x.has(v)):[];lt=[...a,...c.map(oi)],t[27]=i,t[28]=M,t[29]=lt}else lt=t[29];const rt=lt;let pt;t[30]!==rt||t[31]!==M?(pt=M??rt.map(ri),t[30]=rt,t[31]=M,t[32]=pt):pt=t[32];const gt=pt;let ot,Y,L,q,k,j,H,R,V,E,$,u,Z,S;if(t[33]!==o||t[34]!==U||t[35]!==Ht||t[36]!==gt||t[37]!==Zt||t[38]!==r?.graphObjectValues||t[39]!==r?.xAxis?.axis||t[40]!==r?.xAxis?.labels||t[41]!==r?.yAxis?.gridLines||t[42]!==r?.yAxis?.labels||t[43]!==r?.yAxis?.title||t[44]!==at||t[45]!==rt||t[46]!==mt||t[47]!==m||t[48]!==I||t[49]!==f||t[50]!==re||t[51]!==me||t[52]!==et||t[53]!==N||t[54]!==G||t[55]!==Mt||t[56]!==g.bottom||t[57]!==g.left||t[58]!==g.right||t[59]!==g.top||t[60]!==Qt||t[61]!==y||t[62]!==Et||t[63]!==ft||t[64]!==z||t[65]!==Ct||t[66]!==xt||t[67]!==jt||t[68]!==P||t[69]!==dt||t[70]!==C||t[71]!==nt||t[72]!==Vt||t[73]!==_t||t[74]!==Jt||t[75]!==Nt||t[76]!==oe||t[77]!==p?.graphObjectValues||t[78]!==p?.xAxis?.axis||t[79]!==p?.xAxis?.labels||t[80]!==p?.yAxis?.gridLines||t[81]!==p?.yAxis?.labels||t[82]!==p?.yAxis?.title||t[83]!==It||t[84]!==B||t[85]!==xe||t[86]!==d||t[87]!==ue||t[88]!==it||t[89]!==Ot||t[90]!==Pt||t[91]!==A){const x=Ue.linear().domain([A,Pt]).range([I,0]).nice(),a=Be.band().domain(gt).range([0,Et?Math.max(f,Et*gt.length):Qt?Math.min(f,Qt*gt.length):f]).paddingInner(Zt),c=x.ticks(Ct);Y=Rt.motion.svg,E=`${Ot}px`,$=`${re}px`,u=`0 0 ${Ot} ${re}`,Z="ltr",S=je,k=`translate(${g.left},${g.top})`;let v;t[106]!==Mt||t[107]!==z||t[108]!==P||t[109]!==dt||t[110]!==C||t[111]!==Nt||t[112]!==It||t[113]!==A?(v=Nt?Ve.numberFormattingFunction(A<0?0:A,z,dt,C,It,Mt,P):void 0,t[106]=Mt,t[107]=z,t[108]=P,t[109]=dt,t[110]=C,t[111]=Nt,t[112]=It,t[113]=A,t[114]=v):v=t[114];const T=r?.xAxis?.axis,Q=r?.yAxis?.labels;let ct;t[115]!==T||t[116]!==Q?(ct={axis:T,label:Q},t[115]=T,t[116]=Q,t[117]=ct):ct=t[117];const ie=p?.xAxis?.axis,ne=p?.yAxis?.labels;let Xt;t[118]!==ie||t[119]!==ne?(Xt={axis:ie,label:ne},t[118]=ie,t[119]=ne,t[120]=Xt):Xt=t[120],j=l.jsxRuntimeExports.jsx(Se.Axis,{hideAxisLine:me,y1:x(A<0?0:A),y2:x(A<0?0:A),x1:0-G,x2:f+g.right,label:v,labelPos:{x:0-G,dx:0,dy:Pt<0?"1em":-5,y:x(A<0?0:A)},classNames:ct,styles:Xt}),H=Nt?l.jsxRuntimeExports.jsx(Ye.YTicksAndGridLines,{values:c.filter(li),y:c.filter(si).map(s=>x(s)),x1:0-G,x2:f+g.right,styles:{gridLines:p?.yAxis?.gridLines,labels:p?.yAxis?.labels},classNames:{gridLines:r?.yAxis?.gridLines,labels:r?.yAxis?.labels},suffix:It,prefix:C,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:dt,locale:Mt,padZeros:P}):null;const ae=0-G-15,Yt=I/2,n=p?.yAxis?.title,_=r?.yAxis?.title;t[121]!==U||t[122]!==ae||t[123]!==Yt||t[124]!==n||t[125]!==_?(R=l.jsxRuntimeExports.jsx(De.AxisTitle,{x:ae,y:Yt,style:n,className:_,text:U,rotate90:!0}),t[121]=U,t[122]=ae,t[123]=Yt,t[124]=n,t[125]=_,t[126]=R):R=t[126],t[127]!==at?(V=at.filter(ai).map(ni),t[127]=at,t[128]=V):V=t[128],ot=Ge.AnimatePresence,L=rt.map(s=>b.checkIfNullOrUndefined(a(s.id))?null:l.jsxRuntimeExports.jsxs(Rt.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:tt=>{de(s),$t(tt.clientY),ve(tt.clientX),jt?.(s)},onClick:()=>{(xt||mt)&&(qe.isEqual(ft,s)&&_t?(fe(void 0),xt?.(void 0)):(fe(s),xt?.(s)))},onMouseMove:tt=>{de(s),$t(tt.clientY),ve(tt.clientX)},onMouseLeave:()=>{de(void 0),ve(void 0),$t(void 0),jt?.(void 0)},exit:{opacity:0,transition:{duration:o.duration}},variants:{initial:{x:a(`${s.id}`),y:0,opacity:et?et.indexOf(s.label)!==-1?.85:m:.85},whileInView:{x:a(`${s.id}`),y:0,opacity:et?et.indexOf(s.label)!==-1?.85:m:.85,transition:{duration:o.duration}}},initial:"initial",animate:N?"whileInView":"initial",children:[s.qualitativeRange?s.qualitativeRange.map((tt,vt)=>l.jsxRuntimeExports.jsx(Rt.motion.rect,{x:0,exit:{height:0,y:x(0),transition:{duration:o.duration}},variants:{initial:{height:0,y:x(0),fill:nt[vt]},whileInView:{height:Math.abs(x(Re.sum(s.qualitativeRange.filter((se,le)=>le<=vt&&se)))-x(Re.sum(s.qualitativeRange.filter((se,le)=>le<vt&&se)))),y:x(Re.sum(s.qualitativeRange.filter((se,le)=>le<=vt&&se))),fill:nt[vt],transition:{duration:o.duration}}},initial:"initial",animate:N?"whileInView":"initial",width:a.bandwidth()},vt)):null,s.target&&d==="background"?l.jsxRuntimeExports.jsx(Rt.motion.rect,{x:0,width:a.bandwidth(),exit:{height:0,y:x(0),fill:B,transition:{duration:o.duration}},variants:{initial:{height:0,fill:B,y:x(0)},whileInView:{height:Math.abs(x(s.target)-x(0)),fill:B,y:s.target>0?x(s.target):x(0),transition:{duration:o.duration}}},initial:"initial",animate:N?"whileInView":"initial"}):null,s.size?l.jsxRuntimeExports.jsx(Rt.motion.rect,{x:a.bandwidth()*((1-y)/2),width:a.bandwidth()*y,style:{fill:Ht},exit:{height:0,y:x(0),transition:{duration:o.duration}},variants:{initial:{height:0,y:x(0)},whileInView:{height:Math.abs(x(s.size)-x(0)),y:s.size>0?x(s.size):x(0),transition:{duration:o.duration}}},initial:"initial",animate:N?"whileInView":"initial"}):null,s.target&&d==="line"?l.jsxRuntimeExports.jsx(Rt.motion.rect,{x:0,width:a.bandwidth(),exit:{y:x(0),opacity:0,fill:B,transition:{duration:o.duration}},variants:{initial:{y:x(0),opacity:0,fill:B},whileInView:{y:x(s.target)-xe/2,opacity:1,fill:B,transition:{duration:o.duration}}},initial:"initial",animate:N?"whileInView":"initial",height:xe}):null,Jt?l.jsxRuntimeExports.jsx(Xe.XAxesLabels,{value:`${s.label}`.length<ue?`${s.label}`:`${`${s.label}`.substring(0,ue)}...`,y:(s.size||0)<0?0:x(0)+5,x:0,width:a.bandwidth(),height:(s.size||0)<0?x(0)-5:g.bottom,style:p?.xAxis?.labels,className:r?.xAxis?.labels,alignment:(s.size||0)<0?"bottom":"top",animate:o,isInView:N}):null,oe?l.jsxRuntimeExports.jsx(Rt.motion.text,{x:a.bandwidth()/2,style:{textAnchor:"middle",...p?.graphObjectValues||{}},className:l.mo("graph-value text-sm",!it&&Ht.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",r?.graphObjectValues),dy:s.size?s.size>=0?"-5px":"1em":"-5px",exit:{opacity:0,transition:{duration:o.duration}},variants:{initial:{y:x(0),opacity:0,fill:it||Ht},whileInView:{y:x(s.size||0),opacity:1,fill:it||Ht,transition:{duration:o.duration}}},initial:"initial",animate:N?"whileInView":"initial",children:Ve.numberFormattingFunction(s.size,z,dt,C,It,Mt,P)}):null]},s.label)),q=Vt?l.jsxRuntimeExports.jsx(l.jsxRuntimeExports.Fragment,{children:Vt.map((s,tt)=>l.jsxRuntimeExports.jsx(Te.RefLineY,{text:s.text,color:s.color,y:x(s.value),x1:0-G,x2:f+g.right,classNames:s.classNames,styles:s.styles,animate:o,isInView:N},tt))}):null,t[33]=o,t[34]=U,t[35]=Ht,t[36]=gt,t[37]=Zt,t[38]=r?.graphObjectValues,t[39]=r?.xAxis?.axis,t[40]=r?.xAxis?.labels,t[41]=r?.yAxis?.gridLines,t[42]=r?.yAxis?.labels,t[43]=r?.yAxis?.title,t[44]=at,t[45]=rt,t[46]=mt,t[47]=m,t[48]=I,t[49]=f,t[50]=re,t[51]=me,t[52]=et,t[53]=N,t[54]=G,t[55]=Mt,t[56]=g.bottom,t[57]=g.left,t[58]=g.right,t[59]=g.top,t[60]=Qt,t[61]=y,t[62]=Et,t[63]=ft,t[64]=z,t[65]=Ct,t[66]=xt,t[67]=jt,t[68]=P,t[69]=dt,t[70]=C,t[71]=nt,t[72]=Vt,t[73]=_t,t[74]=Jt,t[75]=Nt,t[76]=oe,t[77]=p?.graphObjectValues,t[78]=p?.xAxis?.axis,t[79]=p?.xAxis?.labels,t[80]=p?.yAxis?.gridLines,t[81]=p?.yAxis?.labels,t[82]=p?.yAxis?.title,t[83]=It,t[84]=B,t[85]=xe,t[86]=d,t[87]=ue,t[88]=it,t[89]=Ot,t[90]=Pt,t[91]=A,t[92]=ot,t[93]=Y,t[94]=L,t[95]=q,t[96]=k,t[97]=j,t[98]=H,t[99]=R,t[100]=V,t[101]=E,t[102]=$,t[103]=u,t[104]=Z,t[105]=S}else ot=t[92],Y=t[93],L=t[94],q=t[95],k=t[96],j=t[97],H=t[98],R=t[99],V=t[100],E=t[101],$=t[102],u=t[103],Z=t[104],S=t[105];let yt;t[129]!==ot||t[130]!==L||t[131]!==q?(yt=l.jsxRuntimeExports.jsxs(ot,{children:[L,q]}),t[129]=ot,t[130]=L,t[131]=q,t[132]=yt):yt=t[132];let D;t[133]!==at?(D=at.filter(ii).map(ei),t[133]=at,t[134]=D):D=t[134];let bt;t[135]!==k||t[136]!==j||t[137]!==H||t[138]!==R||t[139]!==V||t[140]!==yt||t[141]!==D?(bt=l.jsxRuntimeExports.jsxs("g",{transform:k,children:[j,H,R,V,yt,D]}),t[135]=k,t[136]=j,t[137]=H,t[138]=R,t[139]=V,t[140]=yt,t[141]=D,t[142]=bt):bt=t[142];let J;t[143]!==Y||t[144]!==E||t[145]!==$||t[146]!==u||t[147]!==Z||t[148]!==S||t[149]!==bt?(J=l.jsxRuntimeExports.jsx(Y,{width:E,height:$,viewBox:u,direction:Z,ref:S,children:bt}),t[143]=Y,t[144]=E,t[145]=$,t[146]=u,t[147]=Z,t[148]=S,t[149]=bt,t[150]=J):J=t[150];let ut;t[151]!==r?.tooltip||t[152]!==qt||t[153]!==he||t[154]!==st||t[155]!==p?.tooltip||t[156]!==wt?(ut=st&&wt&&qt&&he?l.jsxRuntimeExports.jsx($e.Tooltip,{data:st,body:wt,xPos:qt,yPos:he,backgroundStyle:p?.tooltip,className:r?.tooltip}):null,t[151]=r?.tooltip,t[152]=qt,t[153]=he,t[154]=st,t[155]=p?.tooltip,t[156]=wt,t[157]=ut):ut=t[157];let K;t[158]!==r?.modal||t[159]!==mt||t[160]!==ft?(K=mt&&ft!==void 0?l.jsxRuntimeExports.jsx(Fe.DetailsModal,{body:mt,data:ft,setData:fe,className:r?.modal}):null,t[158]=r?.modal,t[159]=mt,t[160]=ft,t[161]=K):K=t[161];let O;return t[162]!==J||t[163]!==ut||t[164]!==K?(O=l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[J,ut,K]}),t[162]=J,t[163]=ut,t[164]=K,t[165]=O):O=t[165],O}function ei(e){return e.layer}function ii(e){return e.position==="after"}function ni(e){return e.layer}function ai(e){return e.position==="before"}function si(e){return e!==0}function li(e){return e!==0}function ri(e){return`${e.id}`}function oi(e){return{id:e,label:e,size:null,target:null,qualitativeRange:null}}function ui(e){return e.target}function ci(e){return!b.checkIfNullOrUndefined(e.target)}function xi(e){return e.target}function mi(e){return!b.checkIfNullOrUndefined(e.target)}function di(e){return e.size}function fi(e){return!b.checkIfNullOrUndefined(e.size)}function hi(e){return e.size}function pi(e){return!b.checkIfNullOrUndefined(e.size)}function gi(e){return Re.sum((e.qualitativeRange||[]).filter(yi))||0}function yi(e){return!b.checkIfNullOrUndefined(e)}function bi(e){return e.target}function vi(e){return!b.checkIfNullOrUndefined(e.size)}function wi(e){return e.target}function ji(e){return!b.checkIfNullOrUndefined(e.target)}function Ai(e){return e.size}function Mi(e){return!b.checkIfNullOrUndefined(e.size)}function ki(e){return e.size}function Ri(e){return!b.checkIfNullOrUndefined(e.size)}function Oi(e){const t=l.compilerRuntimeExports.c(155),{data:i,topMargin:Ot,bottomMargin:re,leftMargin:Ht,rightMargin:It,barColor:C,suffix:Zt,prefix:Jt,barPadding:oe,showValues:Nt,showTicks:ue,truncateBy:ge,width:Kt,height:ce,showLabels:we,tooltip:wt,onSeriesMouseOver:jt,refValues:Vt,highlightedDataPoints:w,maxValue:At,minValue:et,onSeriesMouseClick:xt,labelOrder:M,rtl:Qt,maxBarThickness:Et,minBarThickness:_t,resetSelectionOnDoubleClick:mt,detailsOnClick:U,barAxisTitle:it,valueColor:Ct,noOfTicks:p,styles:r,classNames:d,targetStyle:B,targetColor:nt,qualitativeRangeColors:y,measureBarWidthFactor:o,animate:m,dimmedOpacity:dt,precision:at,customLayers:z,naLabel:xe,targetLineThickness:me,hideAxisLine:Mt,locale:P,padZeros:G}=e,te=Ot===void 0?25:Ot,ye=re===void 0?10:re,be=Ht===void 0?100:Ht,je=It===void 0?40:It,zt=F.useRef(null);let N;t[0]!==m.amount||t[1]!==m.once?(N={once:m.once,amount:m.amount},t[0]=m.amount,t[1]=m.once,t[2]=N):N=t[2];const W=Pe.useInView(zt,N),[Lt,g]=F.useState(void 0),[st,de]=F.useState(void 0),[ft,fe]=F.useState(void 0),[qt,ve]=F.useState(void 0),he=it?te+25:te;let $t;t[3]!==ye||t[4]!==be||t[5]!==je||t[6]!==he?($t={top:he,bottom:ye,left:be,right:je},t[3]=ye,t[4]=be,t[5]=je,t[6]=he,t[7]=$t):$t=t[7];const f=$t,I=Kt-f.left-f.right,X=ce-f.top-f.bottom;let St;t[8]!==i?(St=Math.max(...i.filter(_i).map(Qi))<0?0:Math.max(...i.filter(Ki).map(Ji)),t[8]=i,t[9]=St):St=t[9];const Dt=St;let Tt;t[10]!==i?(Tt=Math.max(...i.filter(Zi).map(Hi))<0?0:Math.max(...i.filter(Yi).map(Xi)),t[10]=i,t[11]=Tt):Tt=t[11];const Ft=Tt;let Ut;t[12]!==i?(Ut=Math.max(...i.map(Gi)),t[12]=i,t[13]=Ut):Ut=t[13];const Bt=Ut;let Pt;t[14]!==Dt||t[15]!==At||t[16]!==Bt||t[17]!==Ft?(Pt=b.checkIfNullOrUndefined(At)?Math.max(...[Dt,Ft,Bt].filter(Number.isFinite))<0?0:Math.max(...[Dt,Ft,Bt].filter(Number.isFinite)):At,t[14]=Dt,t[15]=At,t[16]=Bt,t[17]=Ft,t[18]=Pt):Pt=t[18];const ee=Pt;let Gt;t[19]!==i?(Gt=Math.min(...i.filter(Pi).map(Bi))>=0?0:Math.min(...i.filter(Ui).map(Fi)),t[19]=i,t[20]=Gt):Gt=t[20];const ht=Gt;let Wt;t[21]!==i?(Wt=Math.min(...i.filter(Ti).map(Di))>=0?0:Math.min(...i.filter(Si).map($i)),t[21]=i,t[22]=Wt):Wt=t[22];const kt=Wt;let A;t[23]!==ht||t[24]!==et||t[25]!==kt?(A=b.checkIfNullOrUndefined(et)?Math.min(...[ht,kt].filter(Number.isFinite))>=0?0:Math.min(...[ht,kt].filter(Number.isFinite)):et,t[23]=ht,t[24]=et,t[25]=kt,t[26]=A):A=t[26];const lt=A;let rt;if(t[27]!==i||t[28]!==M){const a=new Set,c=i.map((T,Q)=>{const ct=M?`${T.label}`:`${Q}`;return a.add(ct),{...T,id:ct}}),v=M?M.filter(T=>!a.has(T)):[];rt=[...c,...v.map(qi)],t[27]=i,t[28]=M,t[29]=rt}else rt=t[29];const pt=rt;let gt;t[30]!==pt||t[31]!==M?(gt=M??pt.map(Li),t[30]=pt,t[31]=M,t[32]=gt):gt=t[32];const ot=gt;let Y,L,q,k,j,H,R,V,E,$,u,Z,S,yt;if(t[33]!==m||t[34]!==it||t[35]!==C||t[36]!==ot||t[37]!==oe||t[38]!==d?.graphObjectValues||t[39]!==d?.xAxis?.gridLines||t[40]!==d?.xAxis?.labels||t[41]!==d?.xAxis?.title||t[42]!==d?.yAxis?.axis||t[43]!==d?.yAxis?.labels||t[44]!==z||t[45]!==pt||t[46]!==U||t[47]!==dt||t[48]!==X||t[49]!==I||t[50]!==ce||t[51]!==Mt||t[52]!==w||t[53]!==W||t[54]!==P||t[55]!==f.bottom||t[56]!==f.left||t[57]!==f.top||t[58]!==Et||t[59]!==o||t[60]!==_t||t[61]!==st||t[62]!==xe||t[63]!==p||t[64]!==xt||t[65]!==jt||t[66]!==G||t[67]!==at||t[68]!==Jt||t[69]!==y||t[70]!==Vt||t[71]!==mt||t[72]!==Qt||t[73]!==we||t[74]!==ue||t[75]!==Nt||t[76]!==r?.graphObjectValues||t[77]!==r?.xAxis?.gridLines||t[78]!==r?.xAxis?.labels||t[79]!==r?.xAxis?.title||t[80]!==r?.yAxis?.axis||t[81]!==r?.yAxis?.labels||t[82]!==Zt||t[83]!==nt||t[84]!==me||t[85]!==B||t[86]!==te||t[87]!==ge||t[88]!==Ct||t[89]!==Kt||t[90]!==ee||t[91]!==lt){const a=Ue.linear().domain([lt,ee]).range([0,I]).nice(),c=Be.band().domain(ot).range([0,_t?Math.max(X,_t*ot.length):Et?Math.min(X,Et*ot.length):X]).paddingInner(oe),v=a.ticks(p);L=Rt.motion.svg,$=`${Kt}px`,u=`${ce}px`,Z=`0 0 ${Kt} ${ce}`,S="ltr",yt=zt,j=`translate(${f.left},${f.top})`,H=ue?l.jsxRuntimeExports.jsx(He.XTicksAndGridLines,{values:v.filter(zi),x:v.filter(Ci).map(n=>a(n)),y1:0-te,y2:X+f.bottom,styles:{gridLines:r?.xAxis?.gridLines,labels:r?.xAxis?.labels},classNames:{gridLines:d?.xAxis?.gridLines,labels:d?.xAxis?.labels},suffix:Zt,prefix:Jt,labelType:"secondary",showGridLines:!0,precision:at,locale:P,padZeros:G}):null;const T=I/2,Q=0-f.top+15,ct=r?.xAxis?.title,ie=d?.xAxis?.title;t[106]!==it||t[107]!==T||t[108]!==Q||t[109]!==ct||t[110]!==ie?(R=l.jsxRuntimeExports.jsx(De.AxisTitle,{x:T,y:Q,style:ct,className:ie,text:it}),t[106]=it,t[107]=T,t[108]=Q,t[109]=ct,t[110]=ie,t[111]=R):R=t[111];const ne=d?.yAxis?.axis;let Xt;t[112]!==ne?(Xt={axis:ne},t[112]=ne,t[113]=Xt):Xt=t[113];const ae=r?.yAxis?.axis;let Yt;t[114]!==ae?(Yt={axis:ae},t[114]=ae,t[115]=Yt):Yt=t[115],V=l.jsxRuntimeExports.jsx(Se.Axis,{hideAxisLine:Mt,x1:a(lt<0?0:lt),x2:a(lt<0?0:lt),y1:-2.5,y2:X+f.bottom,classNames:Xt,styles:Yt}),t[116]!==z?(E=z.filter(Ei).map(Vi),t[116]=z,t[117]=E):E=t[117],Y=Ge.AnimatePresence,q=pt.map(n=>b.checkIfNullOrUndefined(c(n.id))?null:l.jsxRuntimeExports.jsxs(Rt.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:_=>{g(n),ve(_.clientY),fe(_.clientX),jt?.(n)},onClick:()=>{(xt||U)&&(qe.isEqual(st,n)&&mt?(de(void 0),xt?.(void 0)):(de(n),xt?.(n)))},onMouseMove:_=>{g(n),ve(_.clientY),fe(_.clientX)},onMouseLeave:()=>{g(void 0),fe(void 0),ve(void 0),jt?.(void 0)},exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{x:0,y:c(`${n.id}`),opacity:w?w.indexOf(n.label)!==-1?.85:dt:.85},whileInView:{x:0,y:c(`${n.id}`),opacity:w?w.indexOf(n.label)!==-1?.85:dt:.85,transition:{duration:m.duration}}},initial:"initial",animate:W?"whileInView":"initial",children:[n.qualitativeRange?n.qualitativeRange.map((_,s)=>l.jsxRuntimeExports.jsx(Rt.motion.rect,{exit:{width:0,x:a(0),transition:{duration:m.duration}},variants:{initial:{x:a(0),width:0,fill:y[s]},whileInView:{x:a(s===0?0:Re.sum(n.qualitativeRange.filter((tt,vt)=>vt<s&&tt))),width:a(_),fill:y[s],transition:{duration:m.duration}}},initial:"initial",animate:W?"whileInView":"initial",y:0,height:c.bandwidth()},s)):null,n.target&&B==="background"?l.jsxRuntimeExports.jsx(Rt.motion.rect,{y:0,x:n.target>=0?a(0):a(n.target),height:c.bandwidth(),exit:{width:0,x:a(0),fill:nt,transition:{duration:m.duration}},variants:{initial:{x:a(0),fill:nt,width:0},whileInView:{x:n.target>=0?a(0):a(n.target),fill:nt,width:n.target>=0?a(n.target)-a(0):a(0)-a(n.target),transition:{duration:m.duration}}},initial:"initial",animate:W?"whileInView":"initial"}):null,n.size?l.jsxRuntimeExports.jsx(Rt.motion.rect,{y:c.bandwidth()*((1-o)/2),style:{fill:C},height:c.bandwidth()*o,exit:{width:0,x:a(0),transition:{duration:m.duration}},variants:{initial:{x:a(0),width:0},whileInView:{x:n.size>=0?a(0):a(n.size),width:n.size>=0?a(n.size)-a(0):a(0)-a(n.size),transition:{duration:m.duration}}},initial:"initial",animate:W?"whileInView":"initial"}):null,n.target&&B==="line"?l.jsxRuntimeExports.jsx(Rt.motion.rect,{y:0,height:c.bandwidth(),width:me,exit:{opacity:0,x:a(0),fill:nt,transition:{duration:m.duration}},variants:{initial:{x:a(0),opacity:0,fill:nt},whileInView:{x:a(n.target)-me/2,opacity:1,fill:nt,transition:{duration:m.duration}}},initial:"initial",animate:W?"whileInView":"initial"}):null,we?l.jsxRuntimeExports.jsx(Ze.YAxesLabels,{value:`${n.label}`.length<ge?`${n.label}`:`${`${n.label}`.substring(0,ge)}...`,y:0,x:(n.size||0)<0?a(0):0-f.left,width:(n.size||0)<0?Kt-a(0):a(0)+f.left,height:c.bandwidth(),alignment:n.size&&n.size<0?"left":"right",style:r?.yAxis?.labels,className:d?.yAxis?.labels,animate:m,isInView:W}):null,Nt?l.jsxRuntimeExports.jsx(Rt.motion.text,{y:c.bandwidth()/2,style:{textAnchor:n.size&&n.size<0?"end":"start",...r?.graphObjectValues||{}},className:l.mo("graph-value text-sm",!Ct&&C.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",d?.graphObjectValues),dx:n.size&&n.size<0?-5:5,dy:"0.33em",exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{x:a(0),opacity:0,fill:Ct||C},whileInView:{x:n.size?a(n.size):a(0),opacity:1,fill:Ct||C,transition:{duration:m.duration}}},initial:"initial",animate:W?"whileInView":"initial",children:Ve.numberFormattingFunction(n.size,xe,at,Jt,Zt,P,G)}):null]},n.label)),k=Vt?l.jsxRuntimeExports.jsx(l.jsxRuntimeExports.Fragment,{children:Vt.map((n,_)=>l.jsxRuntimeExports.jsx(Te.RefLineX,{text:n.text,color:n.color,x:a(n.value),y1:0-f.top,y2:X+f.bottom,textSide:a(n.value)>I*.75||Qt?"left":"right",classNames:n.classNames,styles:n.styles,animate:m,isInView:W},_))}):null,t[33]=m,t[34]=it,t[35]=C,t[36]=ot,t[37]=oe,t[38]=d?.graphObjectValues,t[39]=d?.xAxis?.gridLines,t[40]=d?.xAxis?.labels,t[41]=d?.xAxis?.title,t[42]=d?.yAxis?.axis,t[43]=d?.yAxis?.labels,t[44]=z,t[45]=pt,t[46]=U,t[47]=dt,t[48]=X,t[49]=I,t[50]=ce,t[51]=Mt,t[52]=w,t[53]=W,t[54]=P,t[55]=f.bottom,t[56]=f.left,t[57]=f.top,t[58]=Et,t[59]=o,t[60]=_t,t[61]=st,t[62]=xe,t[63]=p,t[64]=xt,t[65]=jt,t[66]=G,t[67]=at,t[68]=Jt,t[69]=y,t[70]=Vt,t[71]=mt,t[72]=Qt,t[73]=we,t[74]=ue,t[75]=Nt,t[76]=r?.graphObjectValues,t[77]=r?.xAxis?.gridLines,t[78]=r?.xAxis?.labels,t[79]=r?.xAxis?.title,t[80]=r?.yAxis?.axis,t[81]=r?.yAxis?.labels,t[82]=Zt,t[83]=nt,t[84]=me,t[85]=B,t[86]=te,t[87]=ge,t[88]=Ct,t[89]=Kt,t[90]=ee,t[91]=lt,t[92]=Y,t[93]=L,t[94]=q,t[95]=k,t[96]=j,t[97]=H,t[98]=R,t[99]=V,t[100]=E,t[101]=$,t[102]=u,t[103]=Z,t[104]=S,t[105]=yt}else Y=t[92],L=t[93],q=t[94],k=t[95],j=t[96],H=t[97],R=t[98],V=t[99],E=t[100],$=t[101],u=t[102],Z=t[103],S=t[104],yt=t[105];let D;t[118]!==Y||t[119]!==q||t[120]!==k?(D=l.jsxRuntimeExports.jsxs(Y,{children:[q,k]}),t[118]=Y,t[119]=q,t[120]=k,t[121]=D):D=t[121];let bt;t[122]!==z?(bt=z.filter(Ni).map(Ii),t[122]=z,t[123]=bt):bt=t[123];let J;t[124]!==j||t[125]!==H||t[126]!==R||t[127]!==V||t[128]!==E||t[129]!==D||t[130]!==bt?(J=l.jsxRuntimeExports.jsxs("g",{transform:j,children:[H,R,V,E,D,bt]}),t[124]=j,t[125]=H,t[126]=R,t[127]=V,t[128]=E,t[129]=D,t[130]=bt,t[131]=J):J=t[131];let ut;t[132]!==L||t[133]!==$||t[134]!==u||t[135]!==Z||t[136]!==S||t[137]!==yt||t[138]!==J?(ut=l.jsxRuntimeExports.jsx(L,{width:$,height:u,viewBox:Z,direction:S,ref:yt,children:J}),t[132]=L,t[133]=$,t[134]=u,t[135]=Z,t[136]=S,t[137]=yt,t[138]=J,t[139]=ut):ut=t[139];let K;t[140]!==d?.tooltip||t[141]!==ft||t[142]!==qt||t[143]!==Lt||t[144]!==r?.tooltip||t[145]!==wt?(K=Lt&&wt&&ft&&qt?l.jsxRuntimeExports.jsx($e.Tooltip,{data:Lt,body:wt,xPos:ft,yPos:qt,backgroundStyle:r?.tooltip,className:d?.tooltip}):null,t[140]=d?.tooltip,t[141]=ft,t[142]=qt,t[143]=Lt,t[144]=r?.tooltip,t[145]=wt,t[146]=K):K=t[146];let O;t[147]!==d?.modal||t[148]!==U||t[149]!==st?(O=U&&st!==void 0?l.jsxRuntimeExports.jsx(Fe.DetailsModal,{body:U,data:st,setData:de,className:d?.modal}):null,t[147]=d?.modal,t[148]=U,t[149]=st,t[150]=O):O=t[150];let x;return t[151]!==ut||t[152]!==K||t[153]!==O?(x=l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[ut,K,O]}),t[151]=ut,t[152]=K,t[153]=O,t[154]=x):x=t[154],x}function Ii(e){return e.layer}function Ni(e){return e.position==="after"}function Vi(e){return e.layer}function Ei(e){return e.position==="before"}function Ci(e){return e!==0}function zi(e){return e!==0}function Li(e){return`${e.id}`}function qi(e){return{id:e,label:e,size:null,target:null,qualitativeRange:null}}function $i(e){return e.target}function Si(e){return!b.checkIfNullOrUndefined(e.target)}function Di(e){return e.target}function Ti(e){return!b.checkIfNullOrUndefined(e.target)}function Fi(e){return e.size}function Ui(e){return!b.checkIfNullOrUndefined(e.size)}function Bi(e){return e.size}function Pi(e){return!b.checkIfNullOrUndefined(e.size)}function Gi(e){return Re.sum((e.qualitativeRange||[]).filter(Wi))||0}function Wi(e){return!b.checkIfNullOrUndefined(e)}function Xi(e){return e.target}function Yi(e){return!b.checkIfNullOrUndefined(e.target)}function Hi(e){return e.target}function Zi(e){return!b.checkIfNullOrUndefined(e.target)}function Ji(e){return e.size}function Ki(e){return!b.checkIfNullOrUndefined(e.size)}function Qi(e){return e.size}function _i(e){return!b.checkIfNullOrUndefined(e.size)}function tn(e){const t=l.compilerRuntimeExports.c(137),{data:i,graphTitle:Ot,barColor:re,barPadding:Ht,showTicks:It,leftMargin:C,rightMargin:Zt,topMargin:Jt,bottomMargin:oe,truncateBy:Nt,showLabels:ue,showValues:ge,backgroundColor:Kt,suffix:ce,prefix:we,sources:wt,graphDescription:jt,height:Vt,width:w,footNote:At,colorDomain:et,colorLegendTitle:xt,padding:M,relativeHeight:Qt,tooltip:Et,onSeriesMouseOver:_t,refValues:mt,showColorScale:U,graphID:it,maxValue:Ct,minValue:p,highlightedDataPoints:r,onSeriesMouseClick:d,valueColor:B,orientation:nt,styles:y,classNames:o,qualitativeRangeColors:m,targetColor:dt,filterNA:at,targetStyle:z,measureBarWidthFactor:xe,animate:me,dimmedOpacity:Mt,customLayers:P,naLabel:G,graphDownload:te,dataDownload:ye,language:be,theme:je,sortData:zt,labelOrder:N,minHeight:W,maxBarThickness:Lt,maxNumberOfBars:g,minBarThickness:st,ariaLabel:de,resetSelectionOnDoubleClick:ft,detailsOnClick:fe,barAxisTitle:qt,noOfTicks:ve,targetLineThickness:he,timeline:$t,hideAxisLine:f,numberDisplayOptions:I}=e,X=re===void 0?Ie.Colors.primaryColors["blue-600"]:re,St=Ht===void 0?.25:Ht,Dt=It===void 0?!0:It,Tt=Nt===void 0?999:Nt,Ft=ue===void 0?!0:ue,Ut=ge===void 0?!0:ge,Bt=Kt===void 0?!1:Kt,Pt=ce===void 0?"":ce,ee=we===void 0?"":we,Gt=U===void 0?!0:U,ht=nt===void 0?"vertical":nt,Wt=dt===void 0?Ie.Colors.light.grays["gray-700"]:dt,kt=at===void 0?!0:at,A=z===void 0?"line":z,lt=xe===void 0?.4:xe,rt=me===void 0?!1:me,pt=Mt===void 0?.3:Mt;let gt;t[0]!==P?(gt=P===void 0?[]:P,t[0]=P,t[1]=gt):gt=t[1];const ot=gt,Y=G===void 0?"NA":G,L=te===void 0?!1:te,q=ye===void 0?!1:ye,k=be===void 0?"en":be,j=je===void 0?"light":je,H=W===void 0?0:W,R=ft===void 0?!0:ft,V=ve===void 0?5:ve,E=he===void 0?2:he;let $;t[2]!==$t?($=$t===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:$t,t[2]=$t,t[3]=$):$=t[3];const u=$,Z=f===void 0?!1:f,[S,yt]=F.useState(0),[D,bt]=F.useState(0),J=F.useRef(null),ut=F.useRef(null),K=ht==="horizontal"?Oi:ti,[O,x]=F.useState(u.autoplay);let a;if(t[4]!==i||t[5]!==u.dateFormat){let h;t[7]!==u.dateFormat?(h=pe=>Ne.parse(`${pe.date}`,u.dateFormat||"yyyy",new Date).getTime(),t[7]=u.dateFormat,t[8]=h):h=t[8],a=[...new Set(i.filter(un).map(h))],a.sort(on),t[4]=i,t[5]=u.dateFormat,t[6]=a}else a=t[6];const c=a,[v,T]=F.useState(u.autoplay?0:c.length-1);let Q,ct;t[9]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>{const h=new ResizeObserver(pe=>{yt(pe[0].target.clientWidth||620),bt(pe[0].target.clientHeight||480)});return J.current&&h.observe(J.current),()=>h.disconnect()},ct=[],t[9]=Q,t[10]=ct):(Q=t[9],ct=t[10]),F.useEffect(Q,ct);let ie,ne;t[11]!==O||t[12]!==u.speed||t[13]!==c?(ie=()=>{const h=setInterval(()=>{T(pe=>pe<c.length-1?pe+1:0)},(u.speed||2)*1e3);return O||clearInterval(h),()=>clearInterval(h)},ne=[c,O,u.speed],t[11]=O,t[12]=u.speed,t[13]=c,t[14]=ie,t[15]=ne):(ie=t[14],ne=t[15]),F.useEffect(ie,ne);const Xt=u.dateFormat||"yyyy";let ae;t[16]!==v||t[17]!==Xt||t[18]!==u.showOnlyActiveDate||t[19]!==c?(ae=Ee.getSliderMarks(c,v,u.showOnlyActiveDate,Xt),t[16]=v,t[17]=Xt,t[18]=u.showOnlyActiveDate,t[19]=c,t[20]=ae):ae=t[20];const Yt=ae,n=o?.graphContainer,_=y?.graphContainer;let s;t[21]!==o?.description||t[22]!==o?.title||t[23]!==i||t[24]!==q||t[25]!==jt||t[26]!==L||t[27]!==Ot||t[28]!==y?.description||t[29]!==y?.title||t[30]!==w?(s=Ot||jt||L||q?l.jsxRuntimeExports.jsx(Qe.GraphHeader,{styles:{title:y?.title,description:y?.description},classNames:{title:o?.title,description:o?.description},graphTitle:Ot,graphDescription:jt,width:w,graphDownload:L?ut:void 0,dataDownload:q?i.map(rn).filter(ln).length>0?i.map(sn).filter(an):i.filter(nn):null}):null,t[21]=o?.description,t[22]=o?.title,t[23]=i,t[24]=q,t[25]=jt,t[26]=L,t[27]=Ot,t[28]=y?.description,t[29]=y?.title,t[30]=w,t[31]=s):s=t[31];let tt;t[32]!==v||t[33]!==Yt||t[34]!==O||t[35]!==u.enabled||t[36]!==c?(tt=u.enabled&&c.length>0&&Yt?l.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[l.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{x(!O)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":O?"Click to pause animation":"Click to play animation",children:O?l.jsxRuntimeExports.jsx(Le.Pause,{}):l.jsxRuntimeExports.jsx(Le.Play,{})}),l.jsxRuntimeExports.jsx(Ee.Nr,{min:c[0],max:c[c.length-1],marks:Yt,step:null,defaultValue:c[c.length-1],value:c[v],onChangeComplete:h=>{T(c.indexOf(h))},onChange:h=>{T(c.indexOf(h))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,t[32]=v,t[33]=Yt,t[34]=O,t[35]=u.enabled,t[36]=c,t[37]=tt):tt=t[37];let vt;t[38]!==o?.colorLegend||t[39]!==et||t[40]!==xt||t[41]!==i||t[42]!==m||t[43]!==Gt||t[44]!==j||t[45]!==w?(vt=Gt&&i.filter(en).length!==0&&et&&i.length>0?l.jsxRuntimeExports.jsx(_e.ColorLegend,{width:w,colorLegendTitle:xt,colors:m||Ie.Colors[j].sequentialColors.positiveColorsx10,colorDomain:et,showNAColor:!1,className:o?.colorLegend}):null,t[38]=o?.colorLegend,t[39]=et,t[40]=xt,t[41]=i,t[42]=m,t[43]=Gt,t[44]=j,t[45]=w,t[46]=vt):vt=t[46];let se;t[47]!==i.length?(se=i.length===0&&l.jsxRuntimeExports.jsx(Je.EmptyState,{}),t[47]=i.length,t[48]=se):se=t[48];let le;t[49]!==K||t[50]!==rt||t[51]!==qt||t[52]!==X||t[53]!==St||t[54]!==oe||t[55]!==o||t[56]!==ot||t[57]!==i||t[58]!==fe||t[59]!==pt||t[60]!==kt||t[61]!==Z||t[62]!==r||t[63]!==v||t[64]!==N||t[65]!==k||t[66]!==C||t[67]!==Lt||t[68]!==g||t[69]!==Ct||t[70]!==lt||t[71]!==st||t[72]!==p||t[73]!==Y||t[74]!==V||t[75]!==I?.locale||t[76]!==I?.padZeros||t[77]!==I?.precision||t[78]!==d||t[79]!==_t||t[80]!==ht||t[81]!==ee||t[82]!==m||t[83]!==mt||t[84]!==R||t[85]!==Zt||t[86]!==Ft||t[87]!==Dt||t[88]!==Ut||t[89]!==zt||t[90]!==y||t[91]!==Pt||t[92]!==D||t[93]!==S||t[94]!==Wt||t[95]!==E||t[96]!==A||t[97]!==j||t[98]!==u.dateFormat||t[99]!==u.enabled||t[100]!==Et||t[101]!==Jt||t[102]!==Tt||t[103]!==c||t[104]!==B?(le=S&&D&&i.length>0?l.jsxRuntimeExports.jsx(K,{hideAxisLine:Z,data:zt?We.orderBy(ze.ensureCompleteDataForBulletChart(i,u.dateFormat||"yyyy").filter(h=>u.enabled?`${h.date}`===Ne.format(new Date(c[v]),u.dateFormat||"yyyy"):h).filter(h=>kt?!b.checkIfNullOrUndefined(h.size):h),[h=>h.size===void 0?zt==="asc"?(ht==="horizontal"?1:-1)*(1/0):(ht==="horizontal"?-1:1)*(1/0):h.size],[zt]).filter((h,pe)=>g?pe<g:!0):ze.ensureCompleteDataForBulletChart(i,u.dateFormat||"yyyy").filter(h=>u.enabled?`${h.date}`===Ne.format(new Date(c[v]),u.dateFormat||"yyyy"):h).filter(h=>kt?!b.checkIfNullOrUndefined(h.size):h).filter((h,pe)=>g?pe<g:!0),barColor:X,targetColor:Wt,width:S,refValues:mt,height:D,suffix:Pt,prefix:ee,barPadding:St,showLabels:Ft,showValues:Ut,showTicks:Dt,truncateBy:Tt,leftMargin:C,rightMargin:Zt,qualitativeRangeColors:m||Ie.Colors[j].sequentialColors.positiveColorsx10,topMargin:Jt,bottomMargin:oe,tooltip:Et,onSeriesMouseOver:_t,maxValue:Ct,minValue:p,highlightedDataPoints:r,onSeriesMouseClick:d,labelOrder:N,maxBarThickness:Lt,minBarThickness:st,resetSelectionOnDoubleClick:R,detailsOnClick:fe,barAxisTitle:qt,noOfTicks:V,valueColor:B,styles:y,classNames:o,targetStyle:A,dimmedOpacity:pt,measureBarWidthFactor:lt,animate:rt===!0?{duration:.5,once:!0,amount:.5}:rt||{duration:0,once:!0,amount:0},customLayers:ot,naLabel:Y,targetLineThickness:E,rtl:k==="ar"||k==="he",locale:I?.locale||"en",padZeros:I?.padZeros||!1,precision:I?.precision??2}):null,t[49]=K,t[50]=rt,t[51]=qt,t[52]=X,t[53]=St,t[54]=oe,t[55]=o,t[56]=ot,t[57]=i,t[58]=fe,t[59]=pt,t[60]=kt,t[61]=Z,t[62]=r,t[63]=v,t[64]=N,t[65]=k,t[66]=C,t[67]=Lt,t[68]=g,t[69]=Ct,t[70]=lt,t[71]=st,t[72]=p,t[73]=Y,t[74]=V,t[75]=I?.locale,t[76]=I?.padZeros,t[77]=I?.precision,t[78]=d,t[79]=_t,t[80]=ht,t[81]=ee,t[82]=m,t[83]=mt,t[84]=R,t[85]=Zt,t[86]=Ft,t[87]=Dt,t[88]=Ut,t[89]=zt,t[90]=y,t[91]=Pt,t[92]=D,t[93]=S,t[94]=Wt,t[95]=E,t[96]=A,t[97]=j,t[98]=u.dateFormat,t[99]=u.enabled,t[100]=Et,t[101]=Jt,t[102]=Tt,t[103]=c,t[104]=B,t[105]=le):le=t[105];let Ae;t[106]!==se||t[107]!==le?(Ae=l.jsxRuntimeExports.jsxs(Ce.GraphArea,{ref:J,children:[se,le]}),t[106]=se,t[107]=le,t[108]=Ae):Ae=t[108];let Me;t[109]!==vt||t[110]!==Ae?(Me=l.jsxRuntimeExports.jsxs("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:[vt,Ae]}),t[109]=vt,t[110]=Ae,t[111]=Me):Me=t[111];let ke;t[112]!==o?.footnote||t[113]!==o?.source||t[114]!==At||t[115]!==wt||t[116]!==y?.footnote||t[117]!==y?.source||t[118]!==w?(ke=wt||At?l.jsxRuntimeExports.jsx(Ke.GraphFooter,{styles:{footnote:y?.footnote,source:y?.source},classNames:{footnote:o?.footnote,source:o?.source},sources:wt,footNote:At,width:w}):null,t[112]=o?.footnote,t[113]=o?.source,t[114]=At,t[115]=wt,t[116]=y?.footnote,t[117]=y?.source,t[118]=w,t[119]=ke):ke=t[119];let Oe;return t[120]!==de||t[121]!==Bt||t[122]!==it||t[123]!==Vt||t[124]!==k||t[125]!==H||t[126]!==M||t[127]!==Qt||t[128]!==n||t[129]!==_||t[130]!==s||t[131]!==tt||t[132]!==Me||t[133]!==ke||t[134]!==j||t[135]!==w?(Oe=l.jsxRuntimeExports.jsxs(Ce.GraphContainer,{className:n,style:_,id:it,ref:ut,"aria-label":de,backgroundColor:Bt,theme:j,language:k,minHeight:H,width:w,height:Vt,relativeHeight:Qt,padding:M,children:[s,tt,Me,ke]}),t[120]=de,t[121]=Bt,t[122]=it,t[123]=Vt,t[124]=k,t[125]=H,t[126]=M,t[127]=Qt,t[128]=n,t[129]=_,t[130]=s,t[131]=tt,t[132]=Me,t[133]=ke,t[134]=j,t[135]=w,t[136]=Oe):Oe=t[136],Oe}function en(e){return e.qualitativeRange}function nn(e){return e!==void 0}function an(e){return e!==void 0}function sn(e){return e.data}function ln(e){return e!==void 0}function rn(e){return e.data}function on(e,t){return e-t}function un(e){return e.date}exports.BulletChart=tn;
2
2
  //# sourceMappingURL=BulletChart.cjs.map