@undp/data-viz 2.1.3 → 2.1.5

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 (154) hide show
  1. package/dist/AreaChart.cjs +1 -1
  2. package/dist/AreaChart.cjs.map +1 -1
  3. package/dist/AreaChart.js +279 -272
  4. package/dist/AreaChart.js.map +1 -1
  5. package/dist/BarGraph.cjs +1 -1
  6. package/dist/BarGraph.cjs.map +1 -1
  7. package/dist/BarGraph.d.ts +2 -0
  8. package/dist/BarGraph.js +1795 -1724
  9. package/dist/BarGraph.js.map +1 -1
  10. package/dist/BeeSwarmChart.cjs +1 -1
  11. package/dist/BeeSwarmChart.cjs.map +1 -1
  12. package/dist/BeeSwarmChart.js +312 -305
  13. package/dist/BeeSwarmChart.js.map +1 -1
  14. package/dist/BiVariateChoroplethMap.cjs +1 -1
  15. package/dist/BiVariateChoroplethMap.js +1 -1
  16. package/dist/BulletChart.cjs +1 -1
  17. package/dist/BulletChart.cjs.map +1 -1
  18. package/dist/BulletChart.js +298 -287
  19. package/dist/BulletChart.js.map +1 -1
  20. package/dist/ButterflyChart.cjs +1 -1
  21. package/dist/ButterflyChart.cjs.map +1 -1
  22. package/dist/ButterflyChart.js +224 -217
  23. package/dist/ButterflyChart.js.map +1 -1
  24. package/dist/ChoroplethMap.cjs +1 -1
  25. package/dist/ChoroplethMap.js +1 -1
  26. package/dist/CirclePackingGraph.cjs +1 -1
  27. package/dist/CirclePackingGraph.js +2 -2
  28. package/dist/DifferenceLineChart.cjs +1 -1
  29. package/dist/DifferenceLineChart.cjs.map +1 -1
  30. package/dist/DifferenceLineChart.js +404 -397
  31. package/dist/DifferenceLineChart.js.map +1 -1
  32. package/dist/DonutChart.cjs +1 -1
  33. package/dist/DonutChart.cjs.map +1 -1
  34. package/dist/DonutChart.js +116 -113
  35. package/dist/DonutChart.js.map +1 -1
  36. package/dist/DotDensityMap.cjs +1 -1
  37. package/dist/DotDensityMap.js +1 -1
  38. package/dist/DualAxisLineChart.cjs +1 -1
  39. package/dist/DualAxisLineChart.cjs.map +1 -1
  40. package/dist/DualAxisLineChart.js +320 -313
  41. package/dist/DualAxisLineChart.js.map +1 -1
  42. package/dist/DumbbellChart.cjs +1 -1
  43. package/dist/DumbbellChart.cjs.map +1 -1
  44. package/dist/DumbbellChart.js +298 -291
  45. package/dist/DumbbellChart.js.map +1 -1
  46. package/dist/{EmptyState-BZo1BbAn.js → EmptyState-C7ZXkZWd.js} +4 -4
  47. package/dist/EmptyState-C7ZXkZWd.js.map +1 -0
  48. package/dist/EmptyState-gLDRXBHm.cjs +2 -0
  49. package/dist/EmptyState-gLDRXBHm.cjs.map +1 -0
  50. package/dist/GraphEl-BixTEyKW.cjs +2 -0
  51. package/dist/GraphEl-BixTEyKW.cjs.map +1 -0
  52. package/dist/{GraphEl-CRrAlbcr.js → GraphEl-Dyu_EIQb.js} +3 -2
  53. package/dist/GraphEl-Dyu_EIQb.js.map +1 -0
  54. package/dist/GriddedGraphs.cjs +1 -1
  55. package/dist/GriddedGraphs.js +2 -2
  56. package/dist/GriddedGraphsFromConfig.cjs +1 -1
  57. package/dist/GriddedGraphsFromConfig.js +1 -1
  58. package/dist/HeatMap.cjs +1 -1
  59. package/dist/HeatMap.cjs.map +1 -1
  60. package/dist/HeatMap.js +179 -172
  61. package/dist/HeatMap.js.map +1 -1
  62. package/dist/Histogram.cjs +1 -1
  63. package/dist/Histogram.js +2 -2
  64. package/dist/HybridMap.cjs +1 -1
  65. package/dist/HybridMap.js +1 -1
  66. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  67. package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
  68. package/dist/LineChartWithConfidenceInterval.js +368 -361
  69. package/dist/LineChartWithConfidenceInterval.js.map +1 -1
  70. package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
  71. package/dist/MultiGraphDashboardFromConfig.js +1 -1
  72. package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
  73. package/dist/MultiGraphDashboardWideToLongFormat.js +1 -1
  74. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
  75. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +1 -1
  76. package/dist/MultiLineAltChart.cjs +1 -1
  77. package/dist/MultiLineAltChart.cjs.map +1 -1
  78. package/dist/MultiLineAltChart.js +327 -320
  79. package/dist/MultiLineAltChart.js.map +1 -1
  80. package/dist/MultiLineChart.cjs +1 -1
  81. package/dist/MultiLineChart.cjs.map +1 -1
  82. package/dist/MultiLineChart.js +374 -367
  83. package/dist/MultiLineChart.js.map +1 -1
  84. package/dist/ParetoChart.cjs +1 -1
  85. package/dist/ParetoChart.cjs.map +1 -1
  86. package/dist/ParetoChart.js +385 -378
  87. package/dist/ParetoChart.js.map +1 -1
  88. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
  89. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +1 -1
  90. package/dist/RadarChart.cjs +1 -1
  91. package/dist/RadarChart.cjs.map +1 -1
  92. package/dist/RadarChart.js +34 -33
  93. package/dist/RadarChart.js.map +1 -1
  94. package/dist/SankeyChart.cjs +1 -1
  95. package/dist/SankeyChart.cjs.map +1 -1
  96. package/dist/SankeyChart.js +176 -169
  97. package/dist/SankeyChart.js.map +1 -1
  98. package/dist/ScatterPlot.cjs +1 -1
  99. package/dist/ScatterPlot.cjs.map +1 -1
  100. package/dist/ScatterPlot.js +366 -359
  101. package/dist/ScatterPlot.js.map +1 -1
  102. package/dist/SimpleLineChart.cjs +1 -1
  103. package/dist/SimpleLineChart.cjs.map +1 -1
  104. package/dist/SimpleLineChart.js +285 -278
  105. package/dist/SimpleLineChart.js.map +1 -1
  106. package/dist/SingleGraphDashboard.cjs +1 -1
  107. package/dist/SingleGraphDashboard.js +2 -2
  108. package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
  109. package/dist/SingleGraphDashboardFromConfig.js +1 -1
  110. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
  111. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +1 -1
  112. package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
  113. package/dist/SingleGraphDashboardThreeDGraphs.js +1 -1
  114. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
  115. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +1 -1
  116. package/dist/SlopeChart.cjs +1 -1
  117. package/dist/SlopeChart.cjs.map +1 -1
  118. package/dist/SlopeChart.js +243 -236
  119. package/dist/SlopeChart.js.map +1 -1
  120. package/dist/Spinner-CQZcjzwd.cjs +2 -0
  121. package/dist/Spinner-CQZcjzwd.cjs.map +1 -0
  122. package/dist/{Spinner-D7rnnwnA.js → Spinner-DVBnY6Vg.js} +5 -5
  123. package/dist/Spinner-DVBnY6Vg.js.map +1 -0
  124. package/dist/StripChart.cjs +1 -1
  125. package/dist/StripChart.cjs.map +1 -1
  126. package/dist/StripChart.js +293 -286
  127. package/dist/StripChart.js.map +1 -1
  128. package/dist/ThreeDGlobe.cjs +1 -1
  129. package/dist/ThreeDGlobe.js +1 -1
  130. package/dist/TreeMapGraph.cjs +1 -1
  131. package/dist/TreeMapGraph.cjs.map +1 -1
  132. package/dist/TreeMapGraph.js +222 -215
  133. package/dist/TreeMapGraph.js.map +1 -1
  134. package/dist/index-R1gTfap5.js +337 -0
  135. package/dist/index-R1gTfap5.js.map +1 -0
  136. package/dist/index-WML2dCZ0.cjs +2 -0
  137. package/dist/{index-CF5hnGvG.cjs.map → index-WML2dCZ0.cjs.map} +1 -1
  138. package/dist/index.cjs +1 -1
  139. package/dist/index.d.ts +2 -0
  140. package/dist/index.js +1 -1
  141. package/dist/style.css +1 -1
  142. package/package.json +2 -2
  143. package/dist/EmptyState-BZo1BbAn.js.map +0 -1
  144. package/dist/EmptyState-sAEZ_5rU.cjs +0 -2
  145. package/dist/EmptyState-sAEZ_5rU.cjs.map +0 -1
  146. package/dist/GraphEl-BLMih7RN.cjs +0 -2
  147. package/dist/GraphEl-BLMih7RN.cjs.map +0 -1
  148. package/dist/GraphEl-CRrAlbcr.js.map +0 -1
  149. package/dist/Spinner-D7rnnwnA.js.map +0 -1
  150. package/dist/Spinner-DRMBUsX7.cjs +0 -2
  151. package/dist/Spinner-DRMBUsX7.cjs.map +0 -1
  152. package/dist/index-CF5hnGvG.cjs +0 -2
  153. package/dist/index-DPGq3eIL.js +0 -330
  154. package/dist/index-DPGq3eIL.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"DonutChart.js","sources":["../node_modules/d3-shape/src/math.js","../node_modules/d3-shape/src/descending.js","../node_modules/d3-shape/src/identity.js","../node_modules/d3-shape/src/pie.js","../src/Utils/getArc.ts","../src/Components/Graphs/DonutChart/Graph.tsx","../src/Components/Graphs/DonutChart/index.tsx"],"sourcesContent":["export const abs = Math.abs;\nexport const atan2 = Math.atan2;\nexport const cos = Math.cos;\nexport const max = Math.max;\nexport const min = Math.min;\nexport const sin = Math.sin;\nexport const sqrt = Math.sqrt;\n\nexport const epsilon = 1e-12;\nexport const pi = Math.PI;\nexport const halfPi = pi / 2;\nexport const tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","export default function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n","export default function(d) {\n return d;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport descending from \"./descending.js\";\nimport identity from \"./identity.js\";\nimport {tau} from \"./math.js\";\n\nexport default function() {\n var value = identity,\n sortValues = descending,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = (data = array(data)).length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data's order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\n}\n","const polarToCartesian = (\r\n centerX: number,\r\n centerY: number,\r\n radius: number,\r\n angleInRadians: number,\r\n) => {\r\n return {\r\n x: centerX + radius * Math.cos(angleInRadians),\r\n y: centerY + radius * Math.sin(angleInRadians),\r\n };\r\n};\r\n\r\nexport function getArc(\r\n x: number,\r\n y: number,\r\n radius: number,\r\n startAngleInRadians: number,\r\n endAngleInRadians: number,\r\n) {\r\n const start = polarToCartesian(x, y, radius, startAngleInRadians);\r\n const end = polarToCartesian(x, y, radius, endAngleInRadians);\r\n const largeArcFlag = endAngleInRadians - startAngleInRadians <= Math.PI ? '0' : '1';\r\n const d = ['M', start.x, start.y, 'A', radius, radius, 0, largeArcFlag, 1, end.x, end.y].join(\r\n ' ',\r\n );\r\n return d;\r\n}\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport isEqual from 'fast-deep-equal';\r\nimport { pie } from 'd3-shape';\r\nimport { useRef, useState } from 'react';\r\nimport { H2, P } from '@undp/design-system-react/Typography';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\n\r\nimport { AnimateDataType, ClassNameObject, DonutChartDataType, StyleObject } from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\nimport { getArc } from '@/Utils/getArc';\r\n\r\ninterface Props {\r\n mainText?: string | { label: string; suffix?: string; prefix?: string };\r\n radius: number;\r\n colors: string[];\r\n subNote?: string;\r\n strokeWidth: number;\r\n data: DonutChartDataType[];\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n onSeriesMouseOver?: (_d: any) => void;\r\n onSeriesMouseClick?: (_d: any) => void;\r\n colorDomain: string[];\r\n resetSelectionOnDoubleClick: boolean;\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n precision: number;\r\n animate: AnimateDataType;\r\n trackColor: string;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n mainText,\r\n data,\r\n radius,\r\n colors,\r\n subNote,\r\n strokeWidth,\r\n tooltip,\r\n onSeriesMouseOver,\r\n onSeriesMouseClick,\r\n colorDomain,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n precision,\r\n animate,\r\n trackColor,\r\n } = props;\r\n const svgRef = useRef(null);\r\n const isInView = useInView(svgRef, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const pieData = pie()\r\n .sort(null)\r\n .startAngle(0)\r\n .value((d: any) => d.size);\r\n\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n return (\r\n <>\r\n <motion.svg\r\n ref={svgRef}\r\n width={`${radius * 2}px`}\r\n height={`${radius * 2}px`}\r\n viewBox={`0 0 ${radius * 2} ${radius * 2}`}\r\n direction='ltr'\r\n className='mx-auto'\r\n >\r\n <motion.g transform={`translate(${radius} ${radius})`}>\r\n {mainText || subNote ? (\r\n <foreignObject\r\n y={0 - (radius - strokeWidth)}\r\n x={0 - (radius - strokeWidth)}\r\n width={2 * (radius - strokeWidth)}\r\n height={2 * (radius - strokeWidth)}\r\n >\r\n <div className='flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-4'>\r\n {mainText ? (\r\n <H2\r\n marginBottom='none'\r\n className='donut-main-text text-primary-gray-700 dark:text-primary-gray-100 leading-none text-center'\r\n >\r\n {typeof mainText === 'string'\r\n ? mainText\r\n : data.findIndex(d => d.label === mainText.label) !== -1\r\n ? numberFormattingFunction(\r\n data[data.findIndex(d => d.label === mainText.label)].size,\r\n 'NA',\r\n precision,\r\n mainText.prefix,\r\n mainText.suffix,\r\n )\r\n : 'NA'}\r\n </H2>\r\n ) : null}\r\n {subNote ? (\r\n <P\r\n marginBottom='none'\r\n size='base'\r\n leading='none'\r\n className='donut-sub-note text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold'\r\n >\r\n {subNote}\r\n </P>\r\n ) : typeof mainText === 'string' || !mainText ? null : (\r\n <P\r\n size='base'\r\n marginBottom='none'\r\n leading='none'\r\n className='donut-label text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold'\r\n >\r\n {mainText.label}\r\n </P>\r\n )}\r\n </div>\r\n </foreignObject>\r\n ) : null}\r\n <circle\r\n cx={0}\r\n cy={0}\r\n r={radius - strokeWidth / 2}\r\n fill='none'\r\n stroke={trackColor}\r\n strokeWidth={strokeWidth}\r\n />\r\n <AnimatePresence>\r\n {pieData(data as any).map((d, i) => (\r\n <motion.path\r\n key={i}\r\n variants={{\r\n initial: {\r\n pathLength: 0,\r\n d: getArc(\r\n 0,\r\n 0,\r\n radius - strokeWidth / 2,\r\n d.startAngle - Math.PI / 2,\r\n d.endAngle - Math.PI / 2,\r\n ),\r\n opacity: mouseOverData\r\n ? mouseOverData.label === (d.data as any).label\r\n ? 1\r\n : 0.3\r\n : 1,\r\n },\r\n whileInView: {\r\n pathLength: 1,\r\n d: getArc(\r\n 0,\r\n 0,\r\n radius - strokeWidth / 2,\r\n d.startAngle - Math.PI / 2,\r\n d.endAngle - Math.PI / 2,\r\n ),\r\n opacity: mouseOverData\r\n ? mouseOverData.label === (d.data as any).label\r\n ? 1\r\n : 0.3\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 style={{\r\n stroke:\r\n colorDomain.indexOf((d.data as any).label) !== -1\r\n ? colors[colorDomain.indexOf((d.data as any).label) % colors.length]\r\n : Colors.gray,\r\n strokeWidth,\r\n fill: 'none',\r\n }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d.data);\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.data) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d.data);\r\n if (onSeriesMouseClick) onSeriesMouseClick(d.data);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d.data);\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 ))}\r\n </AnimatePresence>\r\n </motion.g>\r\n </motion.svg>\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, useRef, useState } from 'react';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport orderBy from 'lodash.orderby';\r\nimport { Spacer } from '@undp/design-system-react/Spacer';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n DonutChartDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\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: DonutChartDataType[];\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 /** Array of colors for each segment */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: 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 /** Radius of the donut chart */\r\n radius?: number;\r\n\r\n // Values and Ticks\r\n /** Prefix for values */\r\n prefix?: string;\r\n /** Suffix for values */\r\n suffix?: string;\r\n\r\n // Graph Parameters\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Max width of the color scale as a css property */\r\n colorScaleMaxWidth?: string;\r\n /** Stroke width of the arcs and circle of the donut */\r\n strokeWidth?: number;\r\n /** Sorting order for data. This is overwritten by labelOrder prop */\r\n sortData?: 'asc' | 'desc';\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Large text at the center of the donut chart. If the type is an object then the text is the value in the data for the label mentioned in the object */\r\n mainText?: string | { label: string; suffix?: string; prefix?: string };\r\n /** Small text at the center of the donut chart */\r\n subNote?: string;\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\r\n /** Track color (i.e. the color of the donut chart's background) of the donut chart */\r\n trackColor?: 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 DonutChart(props: Props) {\r\n const {\r\n mainText,\r\n graphTitle,\r\n colors = Colors.light.categoricalColors.colors,\r\n suffix = '',\r\n sources,\r\n prefix = '',\r\n strokeWidth = 50,\r\n graphDescription,\r\n subNote,\r\n footNote,\r\n radius,\r\n data,\r\n showColorScale = true,\r\n padding,\r\n backgroundColor = false,\r\n tooltip,\r\n onSeriesMouseOver,\r\n graphID,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n colorDomain,\r\n sortData,\r\n language = 'en',\r\n theme = 'light',\r\n width,\r\n height,\r\n minHeight = 0,\r\n relativeHeight,\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n colorScaleMaxWidth,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n precision = 2,\r\n animate = false,\r\n trackColor = Colors.light.grays['gray-200'],\r\n } = props;\r\n\r\n const [graphRadius, setGraphRadius] = useState(0);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setGraphRadius(\r\n (Math.min(\r\n ...[\r\n entries[0].target.clientWidth || 620,\r\n entries[0].target.clientHeight || 480,\r\n radius || Infinity,\r\n ],\r\n ) || 420) / 2,\r\n );\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [radius]);\r\n\r\n const sortedData = sortData ? orderBy(data, ['size'], [sortData]) : data;\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 {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale ? (\r\n <div\r\n className={cn(\r\n 'leading-0 flex mb-0 ml-auto mr-auto justify-center gap-x-3 gap-y-0 flex-wrap',\r\n classNames?.colorLegend,\r\n )}\r\n style={{ maxWidth: colorScaleMaxWidth }}\r\n aria-label='Color legend'\r\n >\r\n {sortedData.map((d, i) => (\r\n <div className='flex gap-2 items-center pb-3' key={i}>\r\n <div\r\n className='w-3 h-3 rounded-full'\r\n style={{\r\n backgroundColor:\r\n (colorDomain || sortedData.map(el => el.label)).indexOf(d.label) !== -1\r\n ? (colors || Colors[theme].categoricalColors.colors)[\r\n (colorDomain || sortedData.map(el => el.label)).indexOf(d.label) %\r\n (colors || Colors[theme].categoricalColors.colors).length\r\n ]\r\n : Colors.gray,\r\n }}\r\n />\r\n <P\r\n marginBottom='none'\r\n size='sm'\r\n className='text-primary-gray-700 dark:text-primary-gray-100'\r\n >\r\n {d.label}:{' '}\r\n <span className='font-bold' style={{ fontSize: 'inherit' }}>\r\n {numberFormattingFunction(d.size, 'NA', precision, prefix, suffix)}\r\n </span>\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n ) : null}\r\n <Spacer size='lg' />\r\n <GraphArea ref={graphDiv}>\r\n {graphRadius ? (\r\n <Graph\r\n mainText={mainText}\r\n data={sortedData}\r\n colors={colors}\r\n radius={graphRadius}\r\n subNote={subNote}\r\n strokeWidth={strokeWidth}\r\n tooltip={tooltip}\r\n colorDomain={colorDomain || sortedData.map(d => d.label)}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n detailsOnClick={detailsOnClick}\r\n precision={precision}\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 trackColor={trackColor}\r\n />\r\n ) : null}\r\n </GraphArea>\r\n </>\r\n )}\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":["pi","tau","descending","a","b","identity","d","pie","value","sortValues","sort","startAngle","constant","endAngle","padAngle","data","i","n","array","j","k","sum","index","arcs","a0","da","a1","p","pa","v","_","polarToCartesian","centerX","centerY","radius","angleInRadians","x","Math","cos","y","sin","getArc","startAngleInRadians","endAngleInRadians","start","end","largeArcFlag","PI","join","Graph","props","$","_c","mainText","colors","subNote","strokeWidth","tooltip","onSeriesMouseOver","onSeriesMouseClick","colorDomain","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","precision","animate","trackColor","svgRef","useRef","t0","amount","once","isInView","useInView","pieData","_temp","mouseOverData","setMouseOverData","useState","undefined","mouseClickData","setMouseClickData","eventX","setEventX","eventY","setEventY","t1","motion","t2","t3","t4","t5","t6","t7","t8","t9","jsx","jsxs","H2","findIndex","d_1","label","numberFormattingFunction","d_0","size","prefix","suffix","P","t10","t11","T0","AnimatePresence","t12","duration","d_2","initial","pathLength","opacity","whileInView","transition","stroke","indexOf","length","Colors","gray","fill","event","clientY","clientX","isEqual","event_0","t13","map","t14","t15","g","t16","svg","t17","Tooltip","t18","modal","DetailsModal","t19","Fragment","DonutChart","graphTitle","light","categoricalColors","sources","graphDescription","footNote","showColorScale","padding","backgroundColor","graphID","graphDownload","dataDownload","sortData","language","theme","width","height","minHeight","relativeHeight","ariaLabel","colorScaleMaxWidth","grays","graphRadius","setGraphRadius","graphDiv","graphParentDiv","useEffect","resizeObserver","ResizeObserver","entries","min","target","clientWidth","clientHeight","Infinity","current","observe","disconnect","sortedData","orderBy","GraphContainer","graphContainer","GraphHeader","title","description","filter","EmptyState","cn","colorLegend","maxWidth","el","fontSize","Spacer","GraphArea","GraphFooter","footnote","source"],"mappings":";;;;;;;;;;;;;;;;;;AASO,MAAMA,KAAK,KAAK,IAEVC,KAAM,IAAID;ACXR,SAAAE,GAASC,GAAGC,G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AUC,QAAQ5I,GAAQ4I;AAAAA,IAAAA,GACtD,YAAY;AAAA,MACVD,UAAU1I,GAAY0I;AAAAA,MACtBC,QAAQ3I,GAAY2I;AAAAA,IAAAA,GAEtB,SAAArD,GACA,UAAAE,GACA,OAAAU,EAAA,CAAa,IAEb;AAAA,EAAA,GACN;AAEJ;","x_google_ignoreList":[0,1,2,3]}
1
+ {"version":3,"file":"DonutChart.js","sources":["../node_modules/d3-shape/src/math.js","../node_modules/d3-shape/src/descending.js","../node_modules/d3-shape/src/identity.js","../node_modules/d3-shape/src/pie.js","../src/Utils/getArc.ts","../src/Components/Graphs/DonutChart/Graph.tsx","../src/Components/Graphs/DonutChart/index.tsx"],"sourcesContent":["export const abs = Math.abs;\nexport const atan2 = Math.atan2;\nexport const cos = Math.cos;\nexport const max = Math.max;\nexport const min = Math.min;\nexport const sin = Math.sin;\nexport const sqrt = Math.sqrt;\n\nexport const epsilon = 1e-12;\nexport const pi = Math.PI;\nexport const halfPi = pi / 2;\nexport const tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","export default function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n","export default function(d) {\n return d;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport descending from \"./descending.js\";\nimport identity from \"./identity.js\";\nimport {tau} from \"./math.js\";\n\nexport default function() {\n var value = identity,\n sortValues = descending,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = (data = array(data)).length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data's order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\n}\n","const polarToCartesian = (\r\n centerX: number,\r\n centerY: number,\r\n radius: number,\r\n angleInRadians: number,\r\n) => {\r\n return {\r\n x: centerX + radius * Math.cos(angleInRadians),\r\n y: centerY + radius * Math.sin(angleInRadians),\r\n };\r\n};\r\n\r\nexport function getArc(\r\n x: number,\r\n y: number,\r\n radius: number,\r\n startAngleInRadians: number,\r\n endAngleInRadians: number,\r\n) {\r\n const start = polarToCartesian(x, y, radius, startAngleInRadians);\r\n const end = polarToCartesian(\r\n x,\r\n y,\r\n radius,\r\n endAngleInRadians === 2 * Math.PI ? 1.9999999999 * Math.PI : endAngleInRadians,\r\n );\r\n const largeArcFlag = endAngleInRadians - startAngleInRadians <= Math.PI ? '0' : '1';\r\n const d = ['M', start.x, start.y, 'A', radius, radius, 0, largeArcFlag, 1, end.x, end.y].join(\r\n ' ',\r\n );\r\n return d;\r\n}\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport isEqual from 'fast-deep-equal';\r\nimport { pie } from 'd3-shape';\r\nimport { useRef, useState } from 'react';\r\nimport { H2, P } from '@undp/design-system-react/Typography';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\n\r\nimport { AnimateDataType, ClassNameObject, DonutChartDataType, StyleObject } from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\nimport { getArc } from '@/Utils/getArc';\r\n\r\ninterface Props {\r\n mainText?: string | { label: string; suffix?: string; prefix?: string };\r\n radius: number;\r\n colors: string[];\r\n subNote?: string;\r\n strokeWidth: number;\r\n data: DonutChartDataType[];\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n onSeriesMouseOver?: (_d: any) => void;\r\n onSeriesMouseClick?: (_d: any) => void;\r\n colorDomain: string[];\r\n resetSelectionOnDoubleClick: boolean;\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n precision: number;\r\n animate: AnimateDataType;\r\n trackColor: string;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n mainText,\r\n data,\r\n radius,\r\n colors,\r\n subNote,\r\n strokeWidth,\r\n tooltip,\r\n onSeriesMouseOver,\r\n onSeriesMouseClick,\r\n colorDomain,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n precision,\r\n animate,\r\n trackColor,\r\n } = props;\r\n const svgRef = useRef(null);\r\n const isInView = useInView(svgRef, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const pieData = pie()\r\n .sort(null)\r\n .startAngle(0)\r\n .value((d: any) => d.size);\r\n\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n return (\r\n <>\r\n <motion.svg\r\n ref={svgRef}\r\n width={`${radius * 2}px`}\r\n height={`${radius * 2}px`}\r\n viewBox={`0 0 ${radius * 2} ${radius * 2}`}\r\n direction='ltr'\r\n className='mx-auto'\r\n >\r\n <motion.g transform={`translate(${radius} ${radius})`}>\r\n {mainText || subNote ? (\r\n <foreignObject\r\n y={0 - (radius - strokeWidth)}\r\n x={0 - (radius - strokeWidth)}\r\n width={2 * (radius - strokeWidth)}\r\n height={2 * (radius - strokeWidth)}\r\n >\r\n <div className='flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-4'>\r\n {mainText ? (\r\n <H2\r\n marginBottom='none'\r\n className='donut-main-text text-primary-gray-700 dark:text-primary-gray-100 leading-none text-center'\r\n >\r\n {typeof mainText === 'string'\r\n ? mainText\r\n : data.findIndex(d => d.label === mainText.label) !== -1\r\n ? numberFormattingFunction(\r\n data[data.findIndex(d => d.label === mainText.label)].size,\r\n 'NA',\r\n precision,\r\n mainText.prefix,\r\n mainText.suffix,\r\n )\r\n : 'NA'}\r\n </H2>\r\n ) : null}\r\n {subNote ? (\r\n <P\r\n marginBottom='none'\r\n size='base'\r\n leading='none'\r\n className='donut-sub-note text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold'\r\n >\r\n {subNote}\r\n </P>\r\n ) : typeof mainText === 'string' || !mainText ? null : (\r\n <P\r\n size='base'\r\n marginBottom='none'\r\n leading='none'\r\n className='donut-label text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold'\r\n >\r\n {mainText.label}\r\n </P>\r\n )}\r\n </div>\r\n </foreignObject>\r\n ) : null}\r\n <circle\r\n cx={0}\r\n cy={0}\r\n r={radius - strokeWidth / 2}\r\n fill='none'\r\n stroke={trackColor}\r\n strokeWidth={strokeWidth}\r\n />\r\n <AnimatePresence>\r\n {pieData(data as any).map((d, i) => (\r\n <motion.path\r\n key={i}\r\n variants={{\r\n initial: {\r\n pathLength: 0,\r\n d: getArc(\r\n 0,\r\n 0,\r\n radius - strokeWidth / 2,\r\n d.startAngle - Math.PI / 2,\r\n d.endAngle - Math.PI / 2,\r\n ),\r\n opacity: mouseOverData\r\n ? mouseOverData.label === (d.data as any).label\r\n ? 1\r\n : 0.3\r\n : 1,\r\n },\r\n whileInView: {\r\n pathLength: 1,\r\n d: getArc(\r\n 0,\r\n 0,\r\n radius - strokeWidth / 2,\r\n d.startAngle - Math.PI / 2,\r\n d.endAngle - Math.PI / 2,\r\n ),\r\n opacity: mouseOverData\r\n ? mouseOverData.label === (d.data as any).label\r\n ? 1\r\n : 0.3\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 style={{\r\n stroke:\r\n colorDomain.indexOf((d.data as any).label) !== -1\r\n ? colors[colorDomain.indexOf((d.data as any).label) % colors.length]\r\n : Colors.gray,\r\n strokeWidth,\r\n fill: 'none',\r\n }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d.data);\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.data) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d.data);\r\n if (onSeriesMouseClick) onSeriesMouseClick(d.data);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d.data);\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 ))}\r\n </AnimatePresence>\r\n </motion.g>\r\n </motion.svg>\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, useRef, useState } from 'react';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport orderBy from 'lodash.orderby';\r\nimport { Spacer } from '@undp/design-system-react/Spacer';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n DonutChartDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\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: DonutChartDataType[];\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 /** Array of colors for each segment */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: 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 /** Radius of the donut chart */\r\n radius?: number;\r\n\r\n // Values and Ticks\r\n /** Prefix for values */\r\n prefix?: string;\r\n /** Suffix for values */\r\n suffix?: string;\r\n\r\n // Graph Parameters\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Max width of the color scale as a css property */\r\n colorScaleMaxWidth?: string;\r\n /** Stroke width of the arcs and circle of the donut */\r\n strokeWidth?: number;\r\n /** Sorting order for data. This is overwritten by labelOrder prop */\r\n sortData?: 'asc' | 'desc';\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Large text at the center of the donut chart. If the type is an object then the text is the value in the data for the label mentioned in the object */\r\n mainText?: string | { label: string; suffix?: string; prefix?: string };\r\n /** Small text at the center of the donut chart */\r\n subNote?: string;\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\r\n /** Track color (i.e. the color of the donut chart's background) of the donut chart */\r\n trackColor?: 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 DonutChart(props: Props) {\r\n const {\r\n mainText,\r\n graphTitle,\r\n colors = Colors.light.categoricalColors.colors,\r\n suffix = '',\r\n sources,\r\n prefix = '',\r\n strokeWidth = 50,\r\n graphDescription,\r\n subNote,\r\n footNote,\r\n radius,\r\n data,\r\n showColorScale = true,\r\n padding,\r\n backgroundColor = false,\r\n tooltip,\r\n onSeriesMouseOver,\r\n graphID,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n colorDomain,\r\n sortData,\r\n language = 'en',\r\n theme = 'light',\r\n width,\r\n height,\r\n minHeight = 0,\r\n relativeHeight,\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n colorScaleMaxWidth,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n precision = 2,\r\n animate = false,\r\n trackColor = Colors.light.grays['gray-200'],\r\n } = props;\r\n\r\n const [graphRadius, setGraphRadius] = useState(0);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setGraphRadius(\r\n (Math.min(\r\n ...[entries[0].target.clientWidth || 620, entries[0].target.clientHeight || 480],\r\n ) || 420) / 2,\r\n );\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 sortedData = sortData ? orderBy(data, ['size'], [sortData]) : data;\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 {showColorScale && data.length > 0 ? (\r\n <>\r\n <div\r\n className={cn(\r\n 'leading-0 flex mb-0 ml-auto mr-auto justify-center gap-x-3 gap-y-0 flex-wrap',\r\n classNames?.colorLegend,\r\n )}\r\n style={{ maxWidth: colorScaleMaxWidth }}\r\n aria-label='Color legend'\r\n >\r\n {sortedData.map((d, i) => (\r\n <div className='flex gap-2 items-center pb-3' key={i}>\r\n <div\r\n className='w-3 h-3 rounded-full'\r\n style={{\r\n backgroundColor:\r\n (colorDomain || sortedData.map(el => el.label)).indexOf(d.label) !== -1\r\n ? (colors || Colors[theme].categoricalColors.colors)[\r\n (colorDomain || sortedData.map(el => el.label)).indexOf(d.label) %\r\n (colors || Colors[theme].categoricalColors.colors).length\r\n ]\r\n : Colors.gray,\r\n }}\r\n />\r\n <P\r\n marginBottom='none'\r\n size='sm'\r\n className='text-primary-gray-700 dark:text-primary-gray-100'\r\n >\r\n {d.label}:{' '}\r\n <span className='font-bold' style={{ fontSize: 'inherit' }}>\r\n {numberFormattingFunction(d.size, 'NA', precision, prefix, suffix)}\r\n </span>\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n <Spacer size='lg' />\r\n </>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {data.length === 0 && <EmptyState />}\r\n {graphRadius && data.length > 0 ? (\r\n <Graph\r\n mainText={mainText}\r\n data={sortedData}\r\n colors={colors}\r\n radius={radius || graphRadius}\r\n subNote={subNote}\r\n strokeWidth={strokeWidth}\r\n tooltip={tooltip}\r\n colorDomain={colorDomain || sortedData.map(d => d.label)}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n detailsOnClick={detailsOnClick}\r\n precision={precision}\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 trackColor={trackColor}\r\n />\r\n ) : null}\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":["pi","tau","descending","a","b","identity","d","pie","value","sortValues","sort","startAngle","constant","endAngle","padAngle","data","i","n","array","j","k","sum","index","arcs","a0","da","a1","p","pa","v","_","polarToCartesian","centerX","centerY","radius","angleInRadians","x","Math","cos","y","sin","getArc","startAngleInRadians","endAngleInRadians","start","end","PI","largeArcFlag","join","Graph","props","$","_c","mainText","colors","subNote","strokeWidth","tooltip","onSeriesMouseOver","onSeriesMouseClick","colorDomain","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","precision","animate","trackColor","svgRef","useRef","t0","amount","once","isInView","useInView","pieData","_temp","mouseOverData","setMouseOverData","useState","undefined","mouseClickData","setMouseClickData","eventX","setEventX","eventY","setEventY","t1","motion","t2","t3","t4","t5","t6","t7","t8","t9","jsx","jsxs","H2","findIndex","d_1","label","numberFormattingFunction","d_0","size","prefix","suffix","P","t10","t11","T0","AnimatePresence","t12","duration","d_2","initial","pathLength","opacity","whileInView","transition","stroke","indexOf","length","Colors","gray","fill","event","clientY","clientX","isEqual","event_0","t13","map","t14","t15","g","t16","svg","t17","Tooltip","t18","modal","DetailsModal","t19","Fragment","DonutChart","graphTitle","light","categoricalColors","sources","graphDescription","footNote","showColorScale","padding","backgroundColor","graphID","graphDownload","dataDownload","sortData","language","theme","width","height","minHeight","relativeHeight","ariaLabel","colorScaleMaxWidth","grays","graphRadius","setGraphRadius","graphDiv","graphParentDiv","useEffect","resizeObserver","ResizeObserver","entries","min","target","clientWidth","clientHeight","current","observe","disconnect","sortedData","orderBy","GraphContainer","graphContainer","GraphHeader","title","description","filter","cn","colorLegend","maxWidth","el","fontSize","Spacer","GraphArea","EmptyState","GraphFooter","footnote","source"],"mappings":";;;;;;;;;;;;;;;;;;AASO,MAAMA,KAAK,KAAK,IAEVC,KAAM,IAAID;ACXR,SAAAE,GAASC,GAAGC,GAAG;AAC5B,SAAOA,IAAID,IAAI,KAAKC,IAAID,IAAI,IAAIC,KAAKD,I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I,GAAQ0I;AAAAA,MAAUC,QAAQ3I,GAAQ2I;AAAAA,IAAAA,GACtD,YAAY;AAAA,MACVD,UAAUzI,GAAYyI;AAAAA,MACtBC,QAAQ1I,GAAY0I;AAAAA,IAAAA,GAEtB,SAAApD,GACA,UAAAE,GACA,OAAAU,EAAA,CAAa,IAEb;AAAA,EAAA,GACN;AAEJ;","x_google_ignoreList":[0,1,2,3]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-CTPQjnHt.cjs"),c=require("react"),ct=require("./parse-hMnG_lRV.cjs"),ut=require("./getSliderMarks-BmADcPQt.cjs"),ft=require("./Spinner-DRMBUsX7.cjs"),gt=require("./index-DQA8q5sC.cjs"),U=require("./zoom-DPw8bba-.cjs"),yt=require("./Typography-DX7PlgQU.cjs"),vt=require("./index-DxXnJ8Ti.cjs"),bt=require("./Tooltip-uUdw6wJL.cjs"),$=require("./Colors.cjs"),st=require("./index-DRXx7m-C.cjs"),jt=require("./DetailsModal-BN0HDFlV.cjs"),Et=require("./pow-DgrUorRi.cjs"),it=require("./select-Bnfk0lJx.cjs"),wt=require("./use-in-view-QcfiW0w3.cjs"),Ye=require("./proxy-BxvUI_9l.cjs"),Dt=require("./index-DG2bgAva.cjs"),Ct=require("./GraphFooter.cjs"),Rt=require("./GraphHeader.cjs"),kt=require("./fetchAndParseData-l5HGMAEs.cjs"),St=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Nt=require("./uniqBy-O05lp2S5.cjs"),dt=require("./GraphContainer-d8A46BK2.cjs");function Ot(a){const{data:e,colors:r,mapData:X,colorLegendTitle:P,colorDomain:j,radius:k,height:x,width:p,scale:h,centerPoint:_,tooltip:Y,showLabels:he,mapBorderWidth:xe,mapBorderColor:fe,mapNoDataColor:K,onSeriesMouseOver:Z,showColorScale:qe,zoomScaleExtend:Me,zoomTranslateExtend:$e,highlightedDataPoints:ge,onSeriesMouseClick:J,resetSelectionOnDoubleClick:ye,detailsOnClick:v,styles:ve,classNames:Q,mapProjection:A,zoomInteraction:R,animate:E,dimmedOpacity:ee,customLayers:F,maxRadiusValue:be,collapseColorScaleByDefault:je}=a,[Ee,we]=c.useState(void 0),[Pe,De]=c.useState(je===void 0?!(p<680):!je),te=c.useRef(null),[W,oe]=c.useState(void 0),[re,u]=c.useState(void 0),[m,T]=c.useState(void 0),[Ce,ae]=c.useState(void 0),z=c.useRef(null),I=wt.useInView(z,{once:E.once,amount:E.amount}),G=c.useRef(null),D=e.filter(t=>t.radius===void 0||t.radius===null).length!==e.length?Et.sqrt().domain([0,be]).range([.25,k]).nice():void 0;c.useEffect(()=>{const t=it.select(G.current),f=it.select(z.current),n=s=>{if(R==="noZoom")return!1;if(R==="button")return!s.type.includes("wheel");const w=s.type==="wheel",b=s.type.startsWith("touch"),y=s.type==="mousedown"||s.type==="mousemove";return b?!0:w?R==="scroll"?!0:s.ctrlKey:y&&!s.button&&!s.ctrlKey},C=U.zoom().scaleExtent(Me).translateExtent($e||[[-20,-20],[p+20,x+20]]).filter(n).on("zoom",({transform:s})=>{t.attr("transform",s)});f.call(C),te.current=C},[x,p,R]);const L=U.turf_bbox_default(X),g=vt.turf_center_of_mass_default(X),ne=L[2]-L[0],Re=L[3]-L[1],ke=p*190/960*360/ne,Se=x*190/678*180/Re,S=h*Math.min(ke,Se),B=A==="mercator"?U.geoMercator().rotate([0,0]).center(_||g.geometry.coordinates).translate([p/2,x/2]).scale(S):A==="equalEarth"?U.geoEqualEarth().rotate([0,0]).center(_||g.geometry.coordinates).translate([p/2,x/2]).scale(S):A==="naturalEarth"?U.geoNaturalEarth1().rotate([0,0]).center(_||g.geometry.coordinates).translate([p/2,x/2]).scale(S):A==="orthographic"?U.geoOrthographic().rotate([0,0]).center(_||g.geometry.coordinates).translate([p/2,x/2]).scale(S):U.geoAlbersUsa().rotate([0,0]).center(_||g.geometry.coordinates).translate([p/2,x/2]).scale(S),ie=t=>{if(!z.current||!te.current)return;it.select(z.current).call(te.current.scaleBy,t==="in"?1.2:1/1.2)};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx(Ye.motion.svg,{width:`${p}px`,height:`${x}px`,viewBox:`0 0 ${p} ${x}`,ref:z,direction:"ltr",children:o.jsxRuntimeExports.jsxs("g",{ref:G,children:[F.filter(t=>t.position==="before").map(t=>t.layer),X.features.map((t,f)=>o.jsxRuntimeExports.jsx("g",{children:t.geometry.type==="MultiPolygon"?t.geometry.coordinates.map((n,C)=>{let s="";return n.forEach(w=>{let b=" M";w.forEach((y,se)=>{const V=B([y[0],y[1]]);se!==w.length-1?b=`${b}${V[0]} ${V[1]}L`:b=`${b}${V[0]} ${V[1]}`}),s+=b}),o.jsxRuntimeExports.jsx("path",{d:s,style:{stroke:fe,strokeWidth:xe,fill:K}},C)}):t.geometry.coordinates.map((n,C)=>{let s="M";return n.forEach((w,b)=>{const y=B([w[0],w[1]]);b!==n.length-1?s=`${s}${y[0]} ${y[1]}L`:s=`${s}${y[0]} ${y[1]}`}),o.jsxRuntimeExports.jsx("path",{d:s,style:{stroke:fe,strokeWidth:xe,fill:K}},C)})},f)),o.jsxRuntimeExports.jsx(Dt.AnimatePresence,{children:e.map(t=>{const f=e.filter(n=>n.color).length===0?r[0]:t.color?r[j.indexOf(`${t.color}`)]:$.Colors.gray;return o.jsxRuntimeExports.jsxs(Ye.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:Ee?Ee===f?1:ee:ge.length!==0?ge.indexOf(t.label||"")!==-1?1:ee:1,transition:{duration:E.duration}}},initial:"initial",animate:I?"whileInView":"initial",exit:{opacity:0,transition:{duration:E.duration}},onMouseEnter:n=>{u(t),ae(n.clientY),T(n.clientX),Z?.(t)},onMouseMove:n=>{u(t),ae(n.clientY),T(n.clientX)},onMouseLeave:()=>{u(void 0),T(void 0),ae(void 0),Z?.(void 0)},onClick:()=>{(J||v)&&(gt.isEqual(W,t)&&ye?(oe(void 0),J?.(void 0)):(oe(t),J?.(t)))},transform:`translate(${B([t.long,t.lat])[0]},${B([t.long,t.lat])[1]})`,children:[o.jsxRuntimeExports.jsx(Ye.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[j.indexOf(`${t.color}`)]:$.Colors.gray,stroke:e.filter(n=>n.color).length===0?r[0]:t.color?r[j.indexOf(`${t.color}`)]:$.Colors.gray},whileInView:{r:D?D(t.radius||0):k,fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[j.indexOf(`${t.color}`)]:$.Colors.gray,stroke:e.filter(n=>n.color).length===0?r[0]:t.color?r[j.indexOf(`${t.color}`)]:$.Colors.gray,transition:{duration:E.duration}}},initial:"initial",animate:I?"whileInView":"initial",exit:{r:0,transition:{duration:E.duration}},style:{fillOpacity:.8}}),he&&t.label?o.jsxRuntimeExports.jsx(Ye.motion.text,{variants:{initial:{opacity:0,x:D?D(t.radius||0):k},whileInView:{opacity:1,x:D?D(t.radius||0):k,transition:{duration:E.duration}}},initial:"initial",animate:I?"whileInView":"initial",exit:{opacity:0,transition:{duration:E.duration}},y:0,className:"fill-primary-gray-600 dark:fill-primary-gray-300 text-sm",style:{textAnchor:"start"},dx:4,dy:5,children:t.label}):null]},t.label||`${t.lat}-${t.long}`)})}),F.filter(t=>t.position==="after").map(t=>t.layer)]})}),e.filter(t=>t.color).length===0||qe===!1?null:o.jsxRuntimeExports.jsx("div",{className:o.mo("absolute left-4 bottom-4 map-color-legend",Q?.colorLegend),children:Pe?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{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]",onClick:()=>{De(!1)},children:o.jsxRuntimeExports.jsx(st.X,{})}),o.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)"},children:[P&&P!==""?o.jsxRuntimeExports.jsx("p",{className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:P}):null,o.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:j.map((t,f)=>o.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{we(r[f%r.length])},onMouseLeave:()=>{we(void 0)},children:[o.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:r[f%r.length]}}),o.jsxRuntimeExports.jsx(yt.j,{size:"sm",marginBottom:"none",leading:"none",children:t})]},f))})]})]}):o.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{De(!0)},children:o.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),R==="button"&&o.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[o.jsxRuntimeExports.jsx("button",{onClick:()=>ie("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),o.jsxRuntimeExports.jsx("button",{onClick:()=>ie("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border 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",children:"–"})]})]}),v&&W!==void 0?o.jsxRuntimeExports.jsx(jt.DetailsModal,{body:v,data:W,setData:oe,className:Q?.modal}):null,re&&Y&&m&&Ce?o.jsxRuntimeExports.jsx(bt.Tooltip,{data:re,body:Y,xPos:m,yPos:Ce,backgroundStyle:ve?.tooltip,className:Q?.tooltip}):null]})}function qt(a){const e=o.compilerRuntimeExports.c(117),{data:r,mapData:X,graphTitle:P,colors:j,sources:k,graphDescription:x,height:p,width:h,footNote:_,colorLegendTitle:Y,colorDomain:he,radius:xe,scale:fe,centerPoint:K,padding:Z,mapBorderWidth:qe,mapNoDataColor:Me,backgroundColor:$e,showLabels:ge,mapBorderColor:J,tooltip:ye,relativeHeight:v,onSeriesMouseOver:ve,isWorldMap:Q,showColorScale:A,zoomScaleExtend:R,zoomTranslateExtend:E,graphID:ee,highlightedDataPoints:F,onSeriesMouseClick:be,graphDownload:je,dataDownload:Ee,showAntarctica:we,language:Pe,minHeight:De,theme:te,ariaLabel:W,resetSelectionOnDoubleClick:oe,detailsOnClick:re,styles:u,classNames:m,mapProjection:T,zoomInteraction:Ce,animate:ae,dimmedOpacity:z,customLayers:I,maxRadiusValue:G,timeline:D,collapseColorScaleByDefault:L}=a,g=X===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json":X,ne=_===void 0?"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.":_,Re=xe===void 0?5:xe,ke=fe===void 0?.95:fe,Se=qe===void 0?.5:qe,S=Me===void 0?$.Colors.light.graphNoData:Me,B=$e===void 0?!1:$e,ie=ge===void 0?!1:ge,t=J===void 0?$.Colors.light.grays["gray-500"]:J,f=Q===void 0?!0:Q,n=A===void 0?!0:A;let C;e[0]!==R?(C=R===void 0?[.8,6]:R,e[0]=R,e[1]=C):C=e[1];const s=C;let w;e[2]!==F?(w=F===void 0?[]:F,e[2]=F,e[3]=w):w=e[3];const b=w,y=je===void 0?!1:je,se=Ee===void 0?!1:Ee,V=we===void 0?!1:we,Ke=Pe===void 0?"en":Pe,N=De===void 0?0:De,le=te===void 0?"light":te,Ze=oe===void 0?!0:oe,Je=Ce===void 0?"button":Ce,_e=ae===void 0?!1:ae,Qe=z===void 0?.3:z;let ze;e[4]!==I?(ze=I===void 0?[]:I,e[4]=I,e[5]=ze):ze=e[5];const et=ze;let Ie;e[6]!==D?(Ie=D===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:D,e[6]=D,e[7]=Ie):Ie=e[7];const i=Ie,[H,mt]=c.useState(0),[Ne,pt]=c.useState(0),[O,ht]=c.useState(i.autoplay);let Oe;if(e[8]!==r||e[9]!==i.dateFormat){let d;e[11]!==i.dateFormat?(d=M=>ct.parse(`${M.date}`,i.dateFormat||"yyyy",new Date).getTime(),e[11]=i.dateFormat,e[12]=d):d=e[12],Oe=[...new Set(r.filter(Wt).map(d))],Oe.sort(Ft),e[8]=r,e[9]=i.dateFormat,e[10]=Oe}else Oe=e[10];const l=Oe,[q,tt]=c.useState(i.autoplay?0:l.length-1),[ce,xt]=c.useState(void 0),ot=c.useRef(null),lt=c.useRef(null);let Le,Be;e[13]===Symbol.for("react.memo_cache_sentinel")?(Le=()=>{const d=new ResizeObserver(M=>{mt(M[0].target.clientWidth||620),pt(M[0].target.clientHeight||480)});return ot.current&&d.observe(ot.current),()=>d.disconnect()},Be=[],e[13]=Le,e[14]=Be):(Le=e[13],Be=e[14]),c.useEffect(Le,Be);let Ve;e[15]===Symbol.for("react.memo_cache_sentinel")?(Ve=d=>{xt(d)},e[15]=Ve):Ve=e[15];const Ae=c.useEffectEvent(Ve);let Fe;e[16]!==g||e[17]!==Ae?(Fe=()=>{typeof g=="string"?kt.fetchAndParseJSON(g).then(M=>{Ae(M)}):Ae(g)},e[16]=g,e[17]=Ae,e[18]=Fe):Fe=e[18];let We;e[19]!==g?(We=[g],e[19]=g,e[20]=We):We=e[20],c.useEffect(Fe,We);let Te,Ge;e[21]!==O||e[22]!==i.speed||e[23]!==l?(Te=()=>{const d=setInterval(()=>{tt(M=>M<l.length-1?M+1:0)},(i.speed||2)*1e3);return O||clearInterval(d),()=>clearInterval(d)},Ge=[l,O,i.speed],e[21]=O,e[22]=i.speed,e[23]=l,e[24]=Te,e[25]=Ge):(Te=e[24],Ge=e[25]),c.useEffect(Te,Ge);const rt=i.dateFormat||"yyyy";let He;e[26]!==q||e[27]!==rt||e[28]!==i.showOnlyActiveDate||e[29]!==l?(He=ut.getSliderMarks(l,q,i.showOnlyActiveDate,rt),e[26]=q,e[27]=rt,e[28]=i.showOnlyActiveDate,e[29]=l,e[30]=He):He=e[30];const Ue=He,at=m?.graphContainer,nt=u?.graphContainer;let ue;e[31]!==m?.description||e[32]!==m?.title||e[33]!==r||e[34]!==se||e[35]!==x||e[36]!==y||e[37]!==P||e[38]!==u?.description||e[39]!==u?.title||e[40]!==h?(ue=P||x||y||se?o.jsxRuntimeExports.jsx(Rt.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:m?.title,description:m?.description},graphTitle:P,graphDescription:x,width:h,graphDownload:y?lt:void 0,dataDownload:se?r.map(At).filter(Vt).length>0?r.map(Bt).filter(Lt):r.filter(It):null}):null,e[31]=m?.description,e[32]=m?.title,e[33]=r,e[34]=se,e[35]=x,e[36]=y,e[37]=P,e[38]=u?.description,e[39]=u?.title,e[40]=h,e[41]=ue):ue=e[41];let de;e[42]!==q||e[43]!==Ue||e[44]!==O||e[45]!==i.enabled||e[46]!==l?(de=i.enabled&&l.length>0&&Ue?o.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[o.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{ht(!O)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":O?"Click to pause animation":"Click to play animation",children:O?o.jsxRuntimeExports.jsx(st.Pause,{}):o.jsxRuntimeExports.jsx(st.Play,{})}),o.jsxRuntimeExports.jsx(ut.Nr,{min:l[0],max:l[l.length-1],marks:Ue,step:null,defaultValue:l[l.length-1],value:l[q],onChangeComplete:d=>{tt(l.indexOf(d))},onChange:d=>{tt(l.indexOf(d))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[42]=q,e[43]=Ue,e[44]=O,e[45]=i.enabled,e[46]=l,e[47]=de):de=e[47];let me;e[48]!==_e||e[49]!==K||e[50]!==m||e[51]!==L||e[52]!==he||e[53]!==Y||e[54]!==j||e[55]!==et||e[56]!==r||e[57]!==re||e[58]!==Qe||e[59]!==p||e[60]!==b||e[61]!==q||e[62]!==f||e[63]!==t||e[64]!==Se||e[65]!==S||e[66]!==T||e[67]!==ce||e[68]!==G||e[69]!==N||e[70]!==be||e[71]!==ve||e[72]!==Re||e[73]!==v||e[74]!==Ze||e[75]!==ke||e[76]!==V||e[77]!==n||e[78]!==ie||e[79]!==u||e[80]!==Ne||e[81]!==H||e[82]!==le||e[83]!==i.dateFormat||e[84]!==i.enabled||e[85]!==ye||e[86]!==l||e[87]!==h||e[88]!==Je||e[89]!==s||e[90]!==E?(me=o.jsxRuntimeExports.jsx(dt.GraphArea,{ref:ot,children:H&&Ne&&ce?o.jsxRuntimeExports.jsx(Ot,{data:r.filter(d=>i.enabled?d.date===ct.format(new Date(l[q]),i.dateFormat||"yyyy"):d),mapData:V?ce:{...ce,features:ce.features.filter(zt)},colorDomain:r.filter(_t).length===0?[]:he||Nt.uniqBy(r,"color",!0),width:H,height:Ne,scale:ke,centerPoint:K,colors:r.filter(Pt).length===0?j?[j]:[$.Colors.primaryColors["blue-600"]]:j||$.Colors[le].categoricalColors.colors,colorLegendTitle:Y,radius:Re,mapBorderWidth:Se,mapNoDataColor:S,mapBorderColor:t,tooltip:ye,onSeriesMouseOver:ve,showLabels:ie,isWorldMap:f,showColorScale:n,zoomScaleExtend:s,zoomTranslateExtend:E,onSeriesMouseClick:be,highlightedDataPoints:b,resetSelectionOnDoubleClick:Ze,styles:u,classNames:m,zoomInteraction:Je,detailsOnClick:re,mapProjection:T||(f?"naturalEarth":"mercator"),animate:_e===!0?{duration:.5,once:!0,amount:.5}:_e||{duration:0,once:!0,amount:0},dimmedOpacity:Qe,customLayers:et,maxRadiusValue:St.checkIfNullOrUndefined(G)?Math.max(...r.map($t).filter(Mt)):G,collapseColorScaleByDefault:L}):o.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(N,p||(v?N?(h||H)*v>N?(h||H)*v:N:(h||H)*v:Ne))}px`},className:"flex items-center justify-center",children:o.jsxRuntimeExports.jsx(ft.w,{"aria-label":"Loading graph"})})}),e[48]=_e,e[49]=K,e[50]=m,e[51]=L,e[52]=he,e[53]=Y,e[54]=j,e[55]=et,e[56]=r,e[57]=re,e[58]=Qe,e[59]=p,e[60]=b,e[61]=q,e[62]=f,e[63]=t,e[64]=Se,e[65]=S,e[66]=T,e[67]=ce,e[68]=G,e[69]=N,e[70]=be,e[71]=ve,e[72]=Re,e[73]=v,e[74]=Ze,e[75]=ke,e[76]=V,e[77]=n,e[78]=ie,e[79]=u,e[80]=Ne,e[81]=H,e[82]=le,e[83]=i.dateFormat,e[84]=i.enabled,e[85]=ye,e[86]=l,e[87]=h,e[88]=Je,e[89]=s,e[90]=E,e[91]=me):me=e[91];let pe;e[92]!==m?.footnote||e[93]!==m?.source||e[94]!==ne||e[95]!==k||e[96]!==u?.footnote||e[97]!==u?.source||e[98]!==h?(pe=k||ne?o.jsxRuntimeExports.jsx(Ct.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},classNames:{footnote:m?.footnote,source:m?.source},sources:k,footNote:ne,width:h}):null,e[92]=m?.footnote,e[93]=m?.source,e[94]=ne,e[95]=k,e[96]=u?.footnote,e[97]=u?.source,e[98]=h,e[99]=pe):pe=e[99];let Xe;return e[100]!==W||e[101]!==B||e[102]!==ee||e[103]!==p||e[104]!==Ke||e[105]!==N||e[106]!==Z||e[107]!==v||e[108]!==at||e[109]!==nt||e[110]!==ue||e[111]!==de||e[112]!==me||e[113]!==pe||e[114]!==le||e[115]!==h?(Xe=o.jsxRuntimeExports.jsxs(dt.GraphContainer,{className:at,style:nt,id:ee,ref:lt,"aria-label":W,backgroundColor:B,theme:le,language:Ke,minHeight:N,width:h,height:p,relativeHeight:v,padding:Z,children:[ue,de,me,pe]}),e[100]=W,e[101]=B,e[102]=ee,e[103]=p,e[104]=Ke,e[105]=N,e[106]=Z,e[107]=v,e[108]=at,e[109]=nt,e[110]=ue,e[111]=de,e[112]=me,e[113]=pe,e[114]=le,e[115]=h,e[116]=Xe):Xe=e[116],Xe}function Mt(a){return a!=null}function $t(a){return a.radius}function Pt(a){return a.color}function _t(a){return a.color}function zt(a){return a.properties.NAME!=="Antarctica"}function It(a){return a!==void 0}function Lt(a){return a!==void 0}function Bt(a){return a.data}function Vt(a){return a!==void 0}function At(a){return a.data}function Ft(a,e){return a-e}function Wt(a){return a.date}exports.DotDensityMap=qt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-CTPQjnHt.cjs"),c=require("react"),ct=require("./parse-hMnG_lRV.cjs"),ut=require("./getSliderMarks-BmADcPQt.cjs"),ft=require("./Spinner-CQZcjzwd.cjs"),gt=require("./index-DQA8q5sC.cjs"),U=require("./zoom-DPw8bba-.cjs"),yt=require("./Typography-DX7PlgQU.cjs"),vt=require("./index-DxXnJ8Ti.cjs"),bt=require("./Tooltip-uUdw6wJL.cjs"),$=require("./Colors.cjs"),st=require("./index-DRXx7m-C.cjs"),jt=require("./DetailsModal-BN0HDFlV.cjs"),Et=require("./pow-DgrUorRi.cjs"),it=require("./select-Bnfk0lJx.cjs"),wt=require("./use-in-view-QcfiW0w3.cjs"),Ye=require("./proxy-BxvUI_9l.cjs"),Dt=require("./index-DG2bgAva.cjs"),Ct=require("./GraphFooter.cjs"),Rt=require("./GraphHeader.cjs"),kt=require("./fetchAndParseData-l5HGMAEs.cjs"),St=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Nt=require("./uniqBy-O05lp2S5.cjs"),dt=require("./GraphContainer-d8A46BK2.cjs");function Ot(a){const{data:e,colors:r,mapData:X,colorLegendTitle:P,colorDomain:j,radius:k,height:x,width:p,scale:h,centerPoint:_,tooltip:Y,showLabels:he,mapBorderWidth:xe,mapBorderColor:fe,mapNoDataColor:K,onSeriesMouseOver:Z,showColorScale:qe,zoomScaleExtend:Me,zoomTranslateExtend:$e,highlightedDataPoints:ge,onSeriesMouseClick:J,resetSelectionOnDoubleClick:ye,detailsOnClick:v,styles:ve,classNames:Q,mapProjection:A,zoomInteraction:R,animate:E,dimmedOpacity:ee,customLayers:F,maxRadiusValue:be,collapseColorScaleByDefault:je}=a,[Ee,we]=c.useState(void 0),[Pe,De]=c.useState(je===void 0?!(p<680):!je),te=c.useRef(null),[W,oe]=c.useState(void 0),[re,u]=c.useState(void 0),[m,T]=c.useState(void 0),[Ce,ae]=c.useState(void 0),z=c.useRef(null),I=wt.useInView(z,{once:E.once,amount:E.amount}),G=c.useRef(null),D=e.filter(t=>t.radius===void 0||t.radius===null).length!==e.length?Et.sqrt().domain([0,be]).range([.25,k]).nice():void 0;c.useEffect(()=>{const t=it.select(G.current),f=it.select(z.current),n=s=>{if(R==="noZoom")return!1;if(R==="button")return!s.type.includes("wheel");const w=s.type==="wheel",b=s.type.startsWith("touch"),y=s.type==="mousedown"||s.type==="mousemove";return b?!0:w?R==="scroll"?!0:s.ctrlKey:y&&!s.button&&!s.ctrlKey},C=U.zoom().scaleExtent(Me).translateExtent($e||[[-20,-20],[p+20,x+20]]).filter(n).on("zoom",({transform:s})=>{t.attr("transform",s)});f.call(C),te.current=C},[x,p,R]);const L=U.turf_bbox_default(X),g=vt.turf_center_of_mass_default(X),ne=L[2]-L[0],Re=L[3]-L[1],ke=p*190/960*360/ne,Se=x*190/678*180/Re,S=h*Math.min(ke,Se),B=A==="mercator"?U.geoMercator().rotate([0,0]).center(_||g.geometry.coordinates).translate([p/2,x/2]).scale(S):A==="equalEarth"?U.geoEqualEarth().rotate([0,0]).center(_||g.geometry.coordinates).translate([p/2,x/2]).scale(S):A==="naturalEarth"?U.geoNaturalEarth1().rotate([0,0]).center(_||g.geometry.coordinates).translate([p/2,x/2]).scale(S):A==="orthographic"?U.geoOrthographic().rotate([0,0]).center(_||g.geometry.coordinates).translate([p/2,x/2]).scale(S):U.geoAlbersUsa().rotate([0,0]).center(_||g.geometry.coordinates).translate([p/2,x/2]).scale(S),ie=t=>{if(!z.current||!te.current)return;it.select(z.current).call(te.current.scaleBy,t==="in"?1.2:1/1.2)};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx(Ye.motion.svg,{width:`${p}px`,height:`${x}px`,viewBox:`0 0 ${p} ${x}`,ref:z,direction:"ltr",children:o.jsxRuntimeExports.jsxs("g",{ref:G,children:[F.filter(t=>t.position==="before").map(t=>t.layer),X.features.map((t,f)=>o.jsxRuntimeExports.jsx("g",{children:t.geometry.type==="MultiPolygon"?t.geometry.coordinates.map((n,C)=>{let s="";return n.forEach(w=>{let b=" M";w.forEach((y,se)=>{const V=B([y[0],y[1]]);se!==w.length-1?b=`${b}${V[0]} ${V[1]}L`:b=`${b}${V[0]} ${V[1]}`}),s+=b}),o.jsxRuntimeExports.jsx("path",{d:s,style:{stroke:fe,strokeWidth:xe,fill:K}},C)}):t.geometry.coordinates.map((n,C)=>{let s="M";return n.forEach((w,b)=>{const y=B([w[0],w[1]]);b!==n.length-1?s=`${s}${y[0]} ${y[1]}L`:s=`${s}${y[0]} ${y[1]}`}),o.jsxRuntimeExports.jsx("path",{d:s,style:{stroke:fe,strokeWidth:xe,fill:K}},C)})},f)),o.jsxRuntimeExports.jsx(Dt.AnimatePresence,{children:e.map(t=>{const f=e.filter(n=>n.color).length===0?r[0]:t.color?r[j.indexOf(`${t.color}`)]:$.Colors.gray;return o.jsxRuntimeExports.jsxs(Ye.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:Ee?Ee===f?1:ee:ge.length!==0?ge.indexOf(t.label||"")!==-1?1:ee:1,transition:{duration:E.duration}}},initial:"initial",animate:I?"whileInView":"initial",exit:{opacity:0,transition:{duration:E.duration}},onMouseEnter:n=>{u(t),ae(n.clientY),T(n.clientX),Z?.(t)},onMouseMove:n=>{u(t),ae(n.clientY),T(n.clientX)},onMouseLeave:()=>{u(void 0),T(void 0),ae(void 0),Z?.(void 0)},onClick:()=>{(J||v)&&(gt.isEqual(W,t)&&ye?(oe(void 0),J?.(void 0)):(oe(t),J?.(t)))},transform:`translate(${B([t.long,t.lat])[0]},${B([t.long,t.lat])[1]})`,children:[o.jsxRuntimeExports.jsx(Ye.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[j.indexOf(`${t.color}`)]:$.Colors.gray,stroke:e.filter(n=>n.color).length===0?r[0]:t.color?r[j.indexOf(`${t.color}`)]:$.Colors.gray},whileInView:{r:D?D(t.radius||0):k,fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[j.indexOf(`${t.color}`)]:$.Colors.gray,stroke:e.filter(n=>n.color).length===0?r[0]:t.color?r[j.indexOf(`${t.color}`)]:$.Colors.gray,transition:{duration:E.duration}}},initial:"initial",animate:I?"whileInView":"initial",exit:{r:0,transition:{duration:E.duration}},style:{fillOpacity:.8}}),he&&t.label?o.jsxRuntimeExports.jsx(Ye.motion.text,{variants:{initial:{opacity:0,x:D?D(t.radius||0):k},whileInView:{opacity:1,x:D?D(t.radius||0):k,transition:{duration:E.duration}}},initial:"initial",animate:I?"whileInView":"initial",exit:{opacity:0,transition:{duration:E.duration}},y:0,className:"fill-primary-gray-600 dark:fill-primary-gray-300 text-sm",style:{textAnchor:"start"},dx:4,dy:5,children:t.label}):null]},t.label||`${t.lat}-${t.long}`)})}),F.filter(t=>t.position==="after").map(t=>t.layer)]})}),e.filter(t=>t.color).length===0||qe===!1?null:o.jsxRuntimeExports.jsx("div",{className:o.mo("absolute left-4 bottom-4 map-color-legend",Q?.colorLegend),children:Pe?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{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]",onClick:()=>{De(!1)},children:o.jsxRuntimeExports.jsx(st.X,{})}),o.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)"},children:[P&&P!==""?o.jsxRuntimeExports.jsx("p",{className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:P}):null,o.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:j.map((t,f)=>o.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{we(r[f%r.length])},onMouseLeave:()=>{we(void 0)},children:[o.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:r[f%r.length]}}),o.jsxRuntimeExports.jsx(yt.j,{size:"sm",marginBottom:"none",leading:"none",children:t})]},f))})]})]}):o.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{De(!0)},children:o.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),R==="button"&&o.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[o.jsxRuntimeExports.jsx("button",{onClick:()=>ie("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),o.jsxRuntimeExports.jsx("button",{onClick:()=>ie("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border 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",children:"–"})]})]}),v&&W!==void 0?o.jsxRuntimeExports.jsx(jt.DetailsModal,{body:v,data:W,setData:oe,className:Q?.modal}):null,re&&Y&&m&&Ce?o.jsxRuntimeExports.jsx(bt.Tooltip,{data:re,body:Y,xPos:m,yPos:Ce,backgroundStyle:ve?.tooltip,className:Q?.tooltip}):null]})}function qt(a){const e=o.compilerRuntimeExports.c(117),{data:r,mapData:X,graphTitle:P,colors:j,sources:k,graphDescription:x,height:p,width:h,footNote:_,colorLegendTitle:Y,colorDomain:he,radius:xe,scale:fe,centerPoint:K,padding:Z,mapBorderWidth:qe,mapNoDataColor:Me,backgroundColor:$e,showLabels:ge,mapBorderColor:J,tooltip:ye,relativeHeight:v,onSeriesMouseOver:ve,isWorldMap:Q,showColorScale:A,zoomScaleExtend:R,zoomTranslateExtend:E,graphID:ee,highlightedDataPoints:F,onSeriesMouseClick:be,graphDownload:je,dataDownload:Ee,showAntarctica:we,language:Pe,minHeight:De,theme:te,ariaLabel:W,resetSelectionOnDoubleClick:oe,detailsOnClick:re,styles:u,classNames:m,mapProjection:T,zoomInteraction:Ce,animate:ae,dimmedOpacity:z,customLayers:I,maxRadiusValue:G,timeline:D,collapseColorScaleByDefault:L}=a,g=X===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json":X,ne=_===void 0?"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.":_,Re=xe===void 0?5:xe,ke=fe===void 0?.95:fe,Se=qe===void 0?.5:qe,S=Me===void 0?$.Colors.light.graphNoData:Me,B=$e===void 0?!1:$e,ie=ge===void 0?!1:ge,t=J===void 0?$.Colors.light.grays["gray-500"]:J,f=Q===void 0?!0:Q,n=A===void 0?!0:A;let C;e[0]!==R?(C=R===void 0?[.8,6]:R,e[0]=R,e[1]=C):C=e[1];const s=C;let w;e[2]!==F?(w=F===void 0?[]:F,e[2]=F,e[3]=w):w=e[3];const b=w,y=je===void 0?!1:je,se=Ee===void 0?!1:Ee,V=we===void 0?!1:we,Ke=Pe===void 0?"en":Pe,N=De===void 0?0:De,le=te===void 0?"light":te,Ze=oe===void 0?!0:oe,Je=Ce===void 0?"button":Ce,_e=ae===void 0?!1:ae,Qe=z===void 0?.3:z;let ze;e[4]!==I?(ze=I===void 0?[]:I,e[4]=I,e[5]=ze):ze=e[5];const et=ze;let Ie;e[6]!==D?(Ie=D===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:D,e[6]=D,e[7]=Ie):Ie=e[7];const i=Ie,[H,mt]=c.useState(0),[Ne,pt]=c.useState(0),[O,ht]=c.useState(i.autoplay);let Oe;if(e[8]!==r||e[9]!==i.dateFormat){let d;e[11]!==i.dateFormat?(d=M=>ct.parse(`${M.date}`,i.dateFormat||"yyyy",new Date).getTime(),e[11]=i.dateFormat,e[12]=d):d=e[12],Oe=[...new Set(r.filter(Wt).map(d))],Oe.sort(Ft),e[8]=r,e[9]=i.dateFormat,e[10]=Oe}else Oe=e[10];const l=Oe,[q,tt]=c.useState(i.autoplay?0:l.length-1),[ce,xt]=c.useState(void 0),ot=c.useRef(null),lt=c.useRef(null);let Le,Be;e[13]===Symbol.for("react.memo_cache_sentinel")?(Le=()=>{const d=new ResizeObserver(M=>{mt(M[0].target.clientWidth||620),pt(M[0].target.clientHeight||480)});return ot.current&&d.observe(ot.current),()=>d.disconnect()},Be=[],e[13]=Le,e[14]=Be):(Le=e[13],Be=e[14]),c.useEffect(Le,Be);let Ve;e[15]===Symbol.for("react.memo_cache_sentinel")?(Ve=d=>{xt(d)},e[15]=Ve):Ve=e[15];const Ae=c.useEffectEvent(Ve);let Fe;e[16]!==g||e[17]!==Ae?(Fe=()=>{typeof g=="string"?kt.fetchAndParseJSON(g).then(M=>{Ae(M)}):Ae(g)},e[16]=g,e[17]=Ae,e[18]=Fe):Fe=e[18];let We;e[19]!==g?(We=[g],e[19]=g,e[20]=We):We=e[20],c.useEffect(Fe,We);let Te,Ge;e[21]!==O||e[22]!==i.speed||e[23]!==l?(Te=()=>{const d=setInterval(()=>{tt(M=>M<l.length-1?M+1:0)},(i.speed||2)*1e3);return O||clearInterval(d),()=>clearInterval(d)},Ge=[l,O,i.speed],e[21]=O,e[22]=i.speed,e[23]=l,e[24]=Te,e[25]=Ge):(Te=e[24],Ge=e[25]),c.useEffect(Te,Ge);const rt=i.dateFormat||"yyyy";let He;e[26]!==q||e[27]!==rt||e[28]!==i.showOnlyActiveDate||e[29]!==l?(He=ut.getSliderMarks(l,q,i.showOnlyActiveDate,rt),e[26]=q,e[27]=rt,e[28]=i.showOnlyActiveDate,e[29]=l,e[30]=He):He=e[30];const Ue=He,at=m?.graphContainer,nt=u?.graphContainer;let ue;e[31]!==m?.description||e[32]!==m?.title||e[33]!==r||e[34]!==se||e[35]!==x||e[36]!==y||e[37]!==P||e[38]!==u?.description||e[39]!==u?.title||e[40]!==h?(ue=P||x||y||se?o.jsxRuntimeExports.jsx(Rt.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:m?.title,description:m?.description},graphTitle:P,graphDescription:x,width:h,graphDownload:y?lt:void 0,dataDownload:se?r.map(At).filter(Vt).length>0?r.map(Bt).filter(Lt):r.filter(It):null}):null,e[31]=m?.description,e[32]=m?.title,e[33]=r,e[34]=se,e[35]=x,e[36]=y,e[37]=P,e[38]=u?.description,e[39]=u?.title,e[40]=h,e[41]=ue):ue=e[41];let de;e[42]!==q||e[43]!==Ue||e[44]!==O||e[45]!==i.enabled||e[46]!==l?(de=i.enabled&&l.length>0&&Ue?o.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[o.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{ht(!O)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":O?"Click to pause animation":"Click to play animation",children:O?o.jsxRuntimeExports.jsx(st.Pause,{}):o.jsxRuntimeExports.jsx(st.Play,{})}),o.jsxRuntimeExports.jsx(ut.Nr,{min:l[0],max:l[l.length-1],marks:Ue,step:null,defaultValue:l[l.length-1],value:l[q],onChangeComplete:d=>{tt(l.indexOf(d))},onChange:d=>{tt(l.indexOf(d))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[42]=q,e[43]=Ue,e[44]=O,e[45]=i.enabled,e[46]=l,e[47]=de):de=e[47];let me;e[48]!==_e||e[49]!==K||e[50]!==m||e[51]!==L||e[52]!==he||e[53]!==Y||e[54]!==j||e[55]!==et||e[56]!==r||e[57]!==re||e[58]!==Qe||e[59]!==p||e[60]!==b||e[61]!==q||e[62]!==f||e[63]!==t||e[64]!==Se||e[65]!==S||e[66]!==T||e[67]!==ce||e[68]!==G||e[69]!==N||e[70]!==be||e[71]!==ve||e[72]!==Re||e[73]!==v||e[74]!==Ze||e[75]!==ke||e[76]!==V||e[77]!==n||e[78]!==ie||e[79]!==u||e[80]!==Ne||e[81]!==H||e[82]!==le||e[83]!==i.dateFormat||e[84]!==i.enabled||e[85]!==ye||e[86]!==l||e[87]!==h||e[88]!==Je||e[89]!==s||e[90]!==E?(me=o.jsxRuntimeExports.jsx(dt.GraphArea,{ref:ot,children:H&&Ne&&ce?o.jsxRuntimeExports.jsx(Ot,{data:r.filter(d=>i.enabled?d.date===ct.format(new Date(l[q]),i.dateFormat||"yyyy"):d),mapData:V?ce:{...ce,features:ce.features.filter(zt)},colorDomain:r.filter(_t).length===0?[]:he||Nt.uniqBy(r,"color",!0),width:H,height:Ne,scale:ke,centerPoint:K,colors:r.filter(Pt).length===0?j?[j]:[$.Colors.primaryColors["blue-600"]]:j||$.Colors[le].categoricalColors.colors,colorLegendTitle:Y,radius:Re,mapBorderWidth:Se,mapNoDataColor:S,mapBorderColor:t,tooltip:ye,onSeriesMouseOver:ve,showLabels:ie,isWorldMap:f,showColorScale:n,zoomScaleExtend:s,zoomTranslateExtend:E,onSeriesMouseClick:be,highlightedDataPoints:b,resetSelectionOnDoubleClick:Ze,styles:u,classNames:m,zoomInteraction:Je,detailsOnClick:re,mapProjection:T||(f?"naturalEarth":"mercator"),animate:_e===!0?{duration:.5,once:!0,amount:.5}:_e||{duration:0,once:!0,amount:0},dimmedOpacity:Qe,customLayers:et,maxRadiusValue:St.checkIfNullOrUndefined(G)?Math.max(...r.map($t).filter(Mt)):G,collapseColorScaleByDefault:L}):o.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(N,p||(v?N?(h||H)*v>N?(h||H)*v:N:(h||H)*v:Ne))}px`},className:"flex items-center justify-center",children:o.jsxRuntimeExports.jsx(ft.w,{"aria-label":"Loading graph"})})}),e[48]=_e,e[49]=K,e[50]=m,e[51]=L,e[52]=he,e[53]=Y,e[54]=j,e[55]=et,e[56]=r,e[57]=re,e[58]=Qe,e[59]=p,e[60]=b,e[61]=q,e[62]=f,e[63]=t,e[64]=Se,e[65]=S,e[66]=T,e[67]=ce,e[68]=G,e[69]=N,e[70]=be,e[71]=ve,e[72]=Re,e[73]=v,e[74]=Ze,e[75]=ke,e[76]=V,e[77]=n,e[78]=ie,e[79]=u,e[80]=Ne,e[81]=H,e[82]=le,e[83]=i.dateFormat,e[84]=i.enabled,e[85]=ye,e[86]=l,e[87]=h,e[88]=Je,e[89]=s,e[90]=E,e[91]=me):me=e[91];let pe;e[92]!==m?.footnote||e[93]!==m?.source||e[94]!==ne||e[95]!==k||e[96]!==u?.footnote||e[97]!==u?.source||e[98]!==h?(pe=k||ne?o.jsxRuntimeExports.jsx(Ct.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},classNames:{footnote:m?.footnote,source:m?.source},sources:k,footNote:ne,width:h}):null,e[92]=m?.footnote,e[93]=m?.source,e[94]=ne,e[95]=k,e[96]=u?.footnote,e[97]=u?.source,e[98]=h,e[99]=pe):pe=e[99];let Xe;return e[100]!==W||e[101]!==B||e[102]!==ee||e[103]!==p||e[104]!==Ke||e[105]!==N||e[106]!==Z||e[107]!==v||e[108]!==at||e[109]!==nt||e[110]!==ue||e[111]!==de||e[112]!==me||e[113]!==pe||e[114]!==le||e[115]!==h?(Xe=o.jsxRuntimeExports.jsxs(dt.GraphContainer,{className:at,style:nt,id:ee,ref:lt,"aria-label":W,backgroundColor:B,theme:le,language:Ke,minHeight:N,width:h,height:p,relativeHeight:v,padding:Z,children:[ue,de,me,pe]}),e[100]=W,e[101]=B,e[102]=ee,e[103]=p,e[104]=Ke,e[105]=N,e[106]=Z,e[107]=v,e[108]=at,e[109]=nt,e[110]=ue,e[111]=de,e[112]=me,e[113]=pe,e[114]=le,e[115]=h,e[116]=Xe):Xe=e[116],Xe}function Mt(a){return a!=null}function $t(a){return a.radius}function Pt(a){return a.color}function _t(a){return a.color}function zt(a){return a.properties.NAME!=="Antarctica"}function It(a){return a!==void 0}function Lt(a){return a!==void 0}function Bt(a){return a.data}function Vt(a){return a!==void 0}function At(a){return a.data}function Ft(a,e){return a-e}function Wt(a){return a.date}exports.DotDensityMap=qt;
2
2
  //# sourceMappingURL=DotDensityMap.cjs.map
@@ -2,7 +2,7 @@ import { j as o, m as pe, c as fe } from "./index-CHPV5EwG-Curnpaqc.js";
2
2
  import { useState as C, useRef as Mt, useEffect as Kt, useEffectEvent as he } from "react";
3
3
  import { f as ge, p as ye } from "./parse-DlCRUFh_.js";
4
4
  import { g as xe, N as ve } from "./getSliderMarks-HIDJ0_Cd.js";
5
- import { w as be } from "./Spinner-D7rnnwnA.js";
5
+ import { w as be } from "./Spinner-DVBnY6Vg.js";
6
6
  import { i as we } from "./index-Bwrro8-q.js";
7
7
  import { z as De, t as je, g as ke, a as Ce, b as Ne, c as Se, d as Oe } from "./zoom-C9MFjAaV.js";
8
8
  import { j as $e } from "./Typography-PxtFcnJb.js";
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-CTPQjnHt.cjs"),E=require("react"),Vt=require("./parse-hMnG_lRV.cjs"),be=require("./index-Cno4Q0YE.cjs"),ae=require("./numberFormattingFunction-02t-wJta.cjs"),ke=require("./Tooltip-uUdw6wJL.cjs"),L=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Ne=require("./XTicksAndGridLines-B6CELS7q.cjs"),he=require("./Axis-DxRV2yMi.cjs"),ve=require("./AxisTitle-sS5bLLR7.cjs"),Oe=require("./index-B_sAFsEV.cjs"),Ie=require("./time-CZd5YLSP.cjs"),je=require("./linear-BwPAspcq.cjs"),ye=require("./line-DaEMhXmx.cjs"),ce=require("./step-BZ3C8QFW.cjs"),Le=require("./select-Bnfk0lJx.cjs"),Se=require("./init-DU0ybBc_.cjs"),De=require("./pointer-Dkq5NV1q.cjs"),qe=require("./use-in-view-QcfiW0w3.cjs"),ct=require("./proxy-BxvUI_9l.cjs"),Me=require("./GraphFooter.cjs"),Te=require("./GraphHeader.cjs"),Ce=require("./ColorLegend.cjs"),Ae=require("./Colors.cjs"),Ve=require("./EmptyState-sAEZ_5rU.cjs"),we=require("./GraphContainer-d8A46BK2.cjs"),Fe=require("./getNoOfTicks-C_1CFXv_.cjs");function $e(e){const t=n.compilerRuntimeExports.c(117),{data:b,width:B,height:z,lineColors:o,labels:v,sameAxes:j,dateFormat:p,showValues:Rt,noOfXTicks:zt,rightMargin:Jt,leftMargin:Ft,topMargin:J,bottomMargin:bt,tooltip:ut,highlightAreaSettings:kt,onSeriesMouseOver:Nt,animate:s,strokeWidth:V,showDots:xt,noOfYTicks:mt,lineSuffixes:F,linePrefixes:K,minDate:pt,maxDate:Ot,curveType:Q,styles:a,classNames:c,precision:Z,customLayers:$,showAxisLabels:P}=e,$t=E.useRef(null);let ft;t[0]!==s.amount||t[1]!==s.once?(ft={once:s.once,amount:s.amount},t[0]=s.amount,t[1]=s.once,t[2]=ft):ft=t[2];const d=qe.useInView($t,ft),[y,Pt]=E.useState(!1);let dt,_;t[3]!==s.duration||t[4]!==y||t[5]!==d?(dt=()=>{if(d&&!y){const i=setTimeout(()=>{Pt(!0)},(s.duration+.5)*1e3);return()=>clearTimeout(i)}},_=[d,y,s.duration],t[3]=s.duration,t[4]=y,t[5]=d,t[6]=dt,t[7]=_):(dt=t[6],_=t[7]),E.useEffect(dt,_);const Gt=Q==="linear"?ye.curveLinear:Q==="step"?ce.curveStep:Q==="stepAfter"?ce.stepAfter:Q==="stepBefore"?ce.stepBefore:ce.monotoneX,[k,It]=E.useState(void 0),[ht,f]=E.useState(void 0),[m,Ht]=E.useState(void 0),tt=Ft+50,Lt=Jt+65;let et;t[8]!==bt||t[9]!==tt||t[10]!==Lt||t[11]!==J?(et={top:J,bottom:bt,left:tt,right:Lt},t[8]=bt,t[9]=tt,t[10]=Lt,t[11]=J,t[12]=et):et=t[12];const h=et,G=E.useRef(null);let H;t[13]!==p?(H=i=>({...i,date:Vt.parse(`${i.date}`,p,new Date)}),t[13]=p,t[14]=H):H=t[14];const r=be.orderBy(b.map(H),["date"],["asc"]);let it;if(t[15]!==p||t[16]!==kt){let i;t[18]!==p?(i=w=>({...w,coordinates:[w.coordinates[0]===null?null:Vt.parse(`${w.coordinates[0]}`,p,new Date),w.coordinates[1]===null?null:Vt.parse(`${w.coordinates[1]}`,p,new Date)]}),t[18]=p,t[19]=i):i=t[19],it=kt.map(i),t[15]=p,t[16]=kt,t[17]=it}else it=t[17];const yt=it,u=B-h.left-h.right,l=z-h.top-h.bottom,Ut=pt?Vt.parse(`${pt}`,p,new Date):r[0].date,St=Ot?Vt.parse(`${Ot}`,p,new Date):r[r.length-1].date,gt=Math.min(...r.map(yi).filter(hi))!==1/0?Math.min(...r.map(di).filter(fi))>0?0:Math.min(...r.map(pi).filter(mi)):0,nt=Math.min(...r.map(xi).filter(ui))!==1/0?Math.min(...r.map(ci).filter(ai))>0?0:Math.min(...r.map(li).filter(ri)):0,st=Math.max(...r.map(oi).filter(si))!==1/0?Math.max(...r.map(ni).filter(ii)):0,U=Math.max(...r.map(ei).filter(ti))!==1/0?Math.max(...r.map(_e).filter(Ze)):0,Dt=gt<nt?gt:nt,W=st>U?st:U,x=Ie.time().domain([Ut,St]).range([0,u]),R=je.linear().domain([j?Dt:gt,j?W>0?W:0:st>0?st:0]).range([l,0]).nice(),g=je.linear().domain([j?Dt:nt,j?W>0?W:0:U>0?U:0]).range([l,0]).nice(),qt=ye.line().defined(Qe).x(i=>x(i.date)).y(i=>R(i.y1)).curve(Gt),vt=ye.line().defined(Ke).x(i=>x(i.date)).y(i=>g(i.y2)).curve(Gt),Wt=R.ticks(mt),Xt=g.ticks(mt),Mt=x.ticks(zt);E.useEffect(()=>{const i=de=>{const ge=r[Se.bisectCenter(r.map(Je),x.invert(De.pointer(de)[0]),0)];It(ge||r[r.length-1]),Nt?.(ge||r[r.length-1]),Ht(de.clientY),f(de.clientX)},w=()=>{It(void 0),f(void 0),Ht(void 0),Nt?.(void 0)};Le.select(G.current).on("mousemove",i).on("mouseout",w)},[x,r,Nt]);let ot;t[20]!==s||t[21]!==l||t[22]!==u||t[23]!==yt||t[24]!==d||t[25]!==x?(ot=n.jsxRuntimeExports.jsx(Oe.HighlightArea,{areaSettings:yt,width:u,height:l,scale:x,animate:s,isInView:d}),t[20]=s,t[21]=l,t[22]=u,t[23]=yt,t[24]=d,t[25]=x,t[26]=ot):ot=t[26];const jt=c?.xAxis?.axis;let S;t[27]!==jt?(S={axis:jt},t[27]=jt,t[28]=S):S=t[28];let N;t[29]!==a?.xAxis?.axis?(N=a?.xAxis?.axis||{},t[29]=a?.xAxis?.axis,t[30]=N):N=t[30];let D;t[31]!==o[0]||t[32]!==N?(D={axis:{stroke:o[0],...N}},t[31]=o[0],t[32]=N,t[33]=D):D=t[33];let rt;t[34]!==l||t[35]!==S||t[36]!==D?(rt=n.jsxRuntimeExports.jsx(he.Axis,{y1:0,y2:l,x1:-15,x2:-15,classNames:S,styles:D}),t[34]=l,t[35]=S,t[36]=D,t[37]=rt):rt=t[37];let q;t[38]!==c?.yAxis?.title||t[39]!==l||t[40]!==v||t[41]!==o[0]||t[42]!==h.left||t[43]!==P||t[44]!==a?.yAxis?.title?(q=P?n.jsxRuntimeExports.jsx(ve.AxisTitle,{x:10-h.left,y:l/2,style:{fill:o[0],...a?.yAxis?.title||{}},className:c?.yAxis?.title,text:v[0].length>100?`${v[0].substring(0,100)}...`:v[0],rotate90:!0}):null,t[38]=c?.yAxis?.title,t[39]=l,t[40]=v,t[41]=o[0],t[42]=h.left,t[43]=P,t[44]=a?.yAxis?.title,t[45]=q):q=t[45];const Yt=u+15,lt=u+15,Bt=c?.xAxis?.axis;let M;t[46]!==Bt?(M={axis:Bt},t[46]=Bt,t[47]=M):M=t[47];let X;t[48]!==a?.xAxis?.axis?(X=a?.xAxis?.axis||{},t[48]=a?.xAxis?.axis,t[49]=X):X=t[49];let O;t[50]!==o[1]||t[51]!==X?(O={axis:{stroke:o[1],...X}},t[50]=o[1],t[51]=X,t[52]=O):O=t[52];let Y;t[53]!==l||t[54]!==Yt||t[55]!==lt||t[56]!==M||t[57]!==O?(Y=n.jsxRuntimeExports.jsx(he.Axis,{y1:0,y2:l,x1:Yt,x2:lt,classNames:M,styles:O}),t[53]=l,t[54]=Yt,t[55]=lt,t[56]=M,t[57]=O,t[58]=Y):Y=t[58];let at;t[59]!==c?.yAxis?.title||t[60]!==l||t[61]!==u||t[62]!==v||t[63]!==o[1]||t[64]!==h.right||t[65]!==P||t[66]!==a?.yAxis?.title?(at=P?n.jsxRuntimeExports.jsx(ve.AxisTitle,{x:u+h.right-15,y:l/2,style:{fill:o[1],...a?.yAxis?.title||{}},className:c?.yAxis?.title,text:v[1].length>100?`${v[1].substring(0,100)}...`:v[1],rotate90:!0}):null,t[59]=c?.yAxis?.title,t[60]=l,t[61]=u,t[62]=v,t[63]=o[1],t[64]=h.right,t[65]=P,t[66]=a?.yAxis?.title,t[67]=at):at=t[67];const At=u+15,T=c?.xAxis?.axis;let A;t[68]!==T?(A={axis:T},t[68]=T,t[69]=A):A=t[69];const C=a?.xAxis?.axis;let I;t[70]!==C?(I={axis:C},t[70]=C,t[71]=I):I=t[71];let wt;t[72]!==l||t[73]!==At||t[74]!==A||t[75]!==I?(wt=n.jsxRuntimeExports.jsx(he.Axis,{y1:l,y2:l,x1:-15,x2:At,classNames:A,styles:I}),t[72]=l,t[73]=At,t[74]=A,t[75]=I,t[76]=wt):wt=t[76];let Et;t[77]!==p?(Et=i=>Vt.format(i,p),t[77]=p,t[78]=Et):Et=t[78];const Ee=Mt.map(Et),Re=Mt.map(i=>x(i)),ue=a?.xAxis?.gridLines,xe=a?.xAxis?.labels;let Kt;t[79]!==ue||t[80]!==xe?(Kt={gridLines:ue,labels:xe},t[79]=ue,t[80]=xe,t[81]=Kt):Kt=t[81];const me=c?.xAxis?.gridLines;let Tt;t[82]!==me?(Tt=n.mo("opacity-0",me),t[82]=me,t[83]=Tt):Tt=t[83];const pe=c?.xAxis?.labels;let Ct;t[84]!==pe?(Ct=n.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",pe),t[84]=pe,t[85]=Ct):Ct=t[85];let Qt;t[86]!==Tt||t[87]!==Ct?(Qt={gridLines:Tt,labels:Ct},t[86]=Tt,t[87]=Ct,t[88]=Qt):Qt=t[88];let Zt;t[89]!==$?(Zt=$.filter(ze).map(Be),t[89]=$,t[90]=Zt):Zt=t[90];let _t;t[91]!==o[0]||t[92]!==V?(_t={stroke:o[0],strokeWidth:V,fill:"none"},t[91]=o[0],t[92]=V,t[93]=_t):_t=t[93];let te;t[94]!==s.duration?(te={opacity:0,transition:{duration:s.duration}},t[94]=s.duration,t[95]=te):te=t[95];let ee;t[96]!==o[1]||t[97]!==V?(ee={stroke:o[1],strokeWidth:V,fill:"none"},t[96]=o[1],t[97]=V,t[98]=ee):ee=t[98];let ie;t[99]!==s.duration?(ie={opacity:0,transition:{duration:s.duration}},t[99]=s.duration,t[100]=ie):ie=t[100];const fe=r.map((i,w)=>n.jsxRuntimeExports.jsxs(ct.motion.g,{children:[L.checkIfNullOrUndefined(i.y1)?null:n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[xt?n.jsxRuntimeExports.jsx(ct.motion.circle,{r:u/r.length<5?0:u/r.length<20?2:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:x(i.date),cy:R(i.y1),fill:o[0]},whileInView:{opacity:1,fill:o[0],transition:{duration:y?s.duration:.5,delay:y?0:s.duration},cx:x(i.date),cy:R(i.y1)}},initial:"initial",animate:d?"whileInView":"initial"}):null,Rt?n.jsxRuntimeExports.jsx(ct.motion.text,{dy:L.checkIfNullOrUndefined(i.y2)||i.y2<i.y1?-8:"1em",style:{textAnchor:"middle",...a?.graphObjectValues||{}},className:n.mo("graph-value graph-value-line-1 text-xs font-bold",c?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:x(i.date),y:g(i.y1),fill:o[0]},whileInView:{opacity:1,x:x(i.date),fill:o[0],y:g(i.y1),transition:{duration:y?s.duration:.5,delay:y?0:s.duration}}},initial:"initial",animate:d?"whileInView":"initial",children:ae.numberFormattingFunction(i.y1,"NA",Z,K[0],F[0])}):null]}),L.checkIfNullOrUndefined(i.y2)?null:n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[xt?n.jsxRuntimeExports.jsx(ct.motion.circle,{r:u/r.length<5?0:u/r.length<20?2:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:x(i.date),cy:g(i.y2),fill:o[1]},whileInView:{opacity:1,transition:{duration:y?s.duration:.5,delay:y?0:s.duration},fill:o[1],cx:x(i.date),cy:g(i.y2)}},initial:"initial",animate:d?"whileInView":"initial"}):null,Rt?n.jsxRuntimeExports.jsx(ct.motion.text,{dy:L.checkIfNullOrUndefined(i.y1)||i.y1<i.y2?-8:"1em",style:{textAnchor:"middle",...a?.graphObjectValues||{}},className:n.mo("graph-value graph-value-line-2 text-xs font-bold",c?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:x(i.date),y:g(i.y2),fill:o[1]},whileInView:{opacity:1,x:x(i.date),y:g(i.y2),fill:o[1],transition:{duration:y?s.duration:.5,delay:y?0:s.duration}}},initial:"initial",animate:d?"whileInView":"initial",children:ae.numberFormattingFunction(i.y2,"NA",Z,K[1],F[1])}):null]})]},w));let ne;t[101]!==fe?(ne=n.jsxRuntimeExports.jsx("g",{children:fe}),t[101]=fe,t[102]=ne):ne=t[102];let se;t[103]!==$?(se=$.filter(Ge).map(Pe),t[103]=$,t[104]=se):se=t[104];let oe;t[105]===Symbol.for("react.memo_cache_sentinel")?(oe={fill:"none",pointerEvents:"all"},t[105]=oe):oe=t[105];let re;t[106]!==G||t[107]!==l||t[108]!==u?(re=n.jsxRuntimeExports.jsx("rect",{ref:G,style:oe,width:u,height:l}),t[106]=G,t[107]=l,t[108]=u,t[109]=re):re=t[109];let le;return t[110]!==c?.tooltip||t[111]!==ht||t[112]!==m||t[113]!==k||t[114]!==a?.tooltip||t[115]!==ut?(le=k&&ut&&ht&&m?n.jsxRuntimeExports.jsx(ke.Tooltip,{data:k,body:ut,xPos:ht,yPos:m,backgroundStyle:a?.tooltip,className:c?.tooltip}):null,t[110]=c?.tooltip,t[111]=ht,t[112]=m,t[113]=k,t[114]=a?.tooltip,t[115]=ut,t[116]=le):le=t[116],n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(ct.motion.svg,{width:`${B}px`,height:`${z}px`,viewBox:`0 0 ${B} ${z}`,direction:"ltr",ref:$t,children:n.jsxRuntimeExports.jsxs("g",{transform:`translate(${h.left},${h.top})`,children:[ot,n.jsxRuntimeExports.jsxs("g",{children:[Wt.map((i,w)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("line",{y1:R(i),y2:R(i),x1:-15,x2:-20,style:{stroke:o[0],strokeWidth:1,...a?.yAxis?.gridLines||{}},className:c?.yAxis?.gridLines}),n.jsxRuntimeExports.jsx("text",{x:-25,y:R(i),dy:"0.33em",className:n.mo("text-xs",c?.yAxis?.labels),style:{textAnchor:"end",fill:o[0],...a?.yAxis?.labels||{}},children:ae.numberFormattingFunction(i,"NA",Z,K[0],F[0])})]},w)),rt,q]}),n.jsxRuntimeExports.jsxs("g",{children:[Xt.map((i,w)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("line",{y1:g(i),y2:g(i),x1:u+15,x2:u+20,style:{stroke:o[1],strokeWidth:1,...a?.yAxis?.gridLines||{}},className:c?.yAxis?.gridLines}),n.jsxRuntimeExports.jsx("text",{x:u+25,y:g(i),dy:"0.33em",dx:-2,style:{textAnchor:"start",fill:o[1],...a?.yAxis?.labels||{}},className:n.mo("text-xs",c?.yAxis?.labels),children:ae.numberFormattingFunction(i,"NA",Z,K[1],F[1])})]},w)),Y,at]}),n.jsxRuntimeExports.jsxs("g",{children:[wt,n.jsxRuntimeExports.jsx(Ne.XTicksAndGridLines,{values:Ee,x:Re,y1:0,y2:l,styles:Kt,classNames:Qt,labelType:"primary",showGridLines:!0,precision:Z})]}),Zt,n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx(ct.motion.path,{style:_t,exit:te,variants:{initial:{pathLength:0,d:qt(r.filter(Ye))||"",opacity:1},whileInView:{pathLength:1,d:qt(r.filter(Xe))||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:d?"whileInView":"initial"}),n.jsxRuntimeExports.jsx(ct.motion.path,{d:vt(r.filter(We))||"",style:ee,exit:ie,variants:{initial:{pathLength:0,d:vt(r.filter(Ue))||"",opacity:1},whileInView:{pathLength:1,d:vt(r.filter(He))||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:d?"whileInView":"initial"}),k?n.jsxRuntimeExports.jsx("line",{y1:0,y2:l,x1:x(k.date),x2:x(k.date),className:n.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",c?.mouseOverLine),style:a?.mouseOverLine}):null]}),ne,se,re]})}),le]})}function Pe(e){return e.layer}function Ge(e){return e.position==="after"}function He(e){return!L.checkIfNullOrUndefined(e.y2)}function Ue(e){return!L.checkIfNullOrUndefined(e.y2)}function We(e){return!L.checkIfNullOrUndefined(e.y2)}function Xe(e){return!L.checkIfNullOrUndefined(e.y1)}function Ye(e){return!L.checkIfNullOrUndefined(e.y1)}function Be(e){return e.layer}function ze(e){return e.position==="before"}function Je(e){return e.date}function Ke(e){return!L.checkIfNullOrUndefined(e.y2)}function Qe(e){return!L.checkIfNullOrUndefined(e.y1)}function Ze(e){return e!=null}function _e(e){return e.y2}function ti(e){return e!=null}function ei(e){return e.y2}function ii(e){return e!=null}function ni(e){return e.y1}function si(e){return e!=null}function oi(e){return e.y1}function ri(e){return e!=null}function li(e){return e.y2}function ai(e){return e!=null}function ci(e){return e.y2}function ui(e){return e!=null}function xi(e){return e.y2}function mi(e){return e!=null}function pi(e){return e.y1}function fi(e){return e!=null}function di(e){return e.y2}function hi(e){return e!=null}function yi(e){return e.y1}function gi(e){const t=n.compilerRuntimeExports.c(80),{data:b,graphTitle:B,sources:z,graphDescription:o,height:v,width:j,footNote:p,noOfXTicks:Rt,dateFormat:zt,showValues:Jt,padding:Ft,lineColors:J,sameAxes:bt,backgroundColor:ut,leftMargin:kt,rightMargin:Nt,topMargin:s,bottomMargin:V,labels:xt,lineSuffixes:mt,linePrefixes:F,tooltip:K,highlightAreaSettings:pt,relativeHeight:Ot,onSeriesMouseOver:Q,graphID:a,graphDownload:c,dataDownload:Z,animate:$,strokeWidth:P,showDots:$t,language:ft,showColorScale:d,minHeight:y,colorLegendTitle:Pt,theme:dt,ariaLabel:_,noOfYTicks:Gt,maxDate:k,minDate:It,curveType:ht,styles:f,classNames:m,precision:Ht,customLayers:tt,showAxisLabels:Lt}=e,et=zt===void 0?"yyyy":zt,h=Jt===void 0?!1:Jt;let G;t[0]!==J?(G=J===void 0?[Ae.Colors.light.categoricalColors.colors[0],Ae.Colors.light.categoricalColors.colors[1]]:J,t[0]=J,t[1]=G):G=t[1];const H=G,r=bt===void 0?!1:bt,it=ut===void 0?!1:ut,yt=kt===void 0?80:kt,u=Nt===void 0?80:Nt,l=s===void 0?20:s,Ut=V===void 0?25:V;let St;t[2]!==mt?(St=mt===void 0?["",""]:mt,t[2]=mt,t[3]=St):St=t[3];const gt=St;let nt;t[4]!==F?(nt=F===void 0?["",""]:F,t[4]=F,t[5]=nt):nt=t[5];const st=nt;let U;t[6]!==pt?(U=pt===void 0?[]:pt,t[6]=pt,t[7]=U):U=t[7];const Dt=U,W=c===void 0?!1:c,x=Z===void 0?!1:Z,R=$===void 0?!1:$,g=P===void 0?2:P,qt=$t===void 0?!0:$t,vt=ft===void 0?"en":ft,Wt=d===void 0?!0:d,Xt=y===void 0?0:y,Mt=dt===void 0?"light":dt,ot=Gt===void 0?5:Gt,jt=ht===void 0?"curve":ht,S=Ht===void 0?2:Ht;let N;t[8]!==tt?(N=tt===void 0?[]:tt,t[8]=tt,t[9]=N):N=t[9];const D=N,rt=Lt===void 0?!0:Lt,[q,Yt]=E.useState(0),[lt,Bt]=E.useState(0),M=E.useRef(null),X=E.useRef(null);let O,Y;t[10]===Symbol.for("react.memo_cache_sentinel")?(O=()=>{const wt=new ResizeObserver(Et=>{Yt(Et[0].target.clientWidth||620),Bt(Et[0].target.clientHeight||480)});return M.current&&wt.observe(M.current),()=>wt.disconnect()},Y=[],t[10]=O,t[11]=Y):(O=t[10],Y=t[11]),E.useEffect(O,Y);const at=m?.graphContainer,At=f?.graphContainer;let T;t[12]!==m?.description||t[13]!==m?.title||t[14]!==b||t[15]!==x||t[16]!==o||t[17]!==W||t[18]!==B||t[19]!==f?.description||t[20]!==f?.title||t[21]!==j?(T=B||o||W||x?n.jsxRuntimeExports.jsx(Te.GraphHeader,{styles:{title:f?.title,description:f?.description},classNames:{title:m?.title,description:m?.description},graphTitle:B,graphDescription:o,width:j,graphDownload:W?X:void 0,dataDownload:x?b.map(Ei).filter(wi).length>0?b.map(Ai).filter(ji):b.filter(vi):null}):null,t[12]=m?.description,t[13]=m?.title,t[14]=b,t[15]=x,t[16]=o,t[17]=W,t[18]=B,t[19]=f?.description,t[20]=f?.title,t[21]=j,t[22]=T):T=t[22];let A;t[23]!==R||t[24]!==Ut||t[25]!==m||t[26]!==Pt||t[27]!==jt||t[28]!==D||t[29]!==b||t[30]!==et||t[31]!==Dt||t[32]!==xt||t[33]!==yt||t[34]!==H||t[35]!==st||t[36]!==gt||t[37]!==k||t[38]!==It||t[39]!==Rt||t[40]!==ot||t[41]!==Q||t[42]!==S||t[43]!==u||t[44]!==r||t[45]!==rt||t[46]!==Wt||t[47]!==qt||t[48]!==h||t[49]!==g||t[50]!==f||t[51]!==lt||t[52]!==q||t[53]!==K||t[54]!==l?(A=b.length===0?n.jsxRuntimeExports.jsx(Ve.EmptyState,{}):n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[Wt?n.jsxRuntimeExports.jsx(Ce.ColorLegend,{colorDomain:xt,colorLegendTitle:Pt,colors:H,showNAColor:!1,className:m?.colorLegend}):null,n.jsxRuntimeExports.jsx(we.GraphArea,{ref:M,children:q&&lt?n.jsxRuntimeExports.jsx($e,{data:b,sameAxes:r,lineColors:H,width:q,height:lt,dateFormat:et,showValues:h,noOfXTicks:Rt??Fe.getNoOfTicks(q),leftMargin:yt,rightMargin:u,topMargin:l,bottomMargin:Ut,labels:xt,highlightAreaSettings:Dt,tooltip:K,onSeriesMouseOver:Q,animate:R===!0?{duration:.5,once:!0,amount:.5}:R||{duration:0,once:!0,amount:0},strokeWidth:g,showDots:qt,noOfYTicks:ot,lineSuffixes:gt,linePrefixes:st,minDate:It,maxDate:k,curveType:jt,styles:f,classNames:m,precision:S,customLayers:D,showAxisLabels:rt}):null})]}),t[23]=R,t[24]=Ut,t[25]=m,t[26]=Pt,t[27]=jt,t[28]=D,t[29]=b,t[30]=et,t[31]=Dt,t[32]=xt,t[33]=yt,t[34]=H,t[35]=st,t[36]=gt,t[37]=k,t[38]=It,t[39]=Rt,t[40]=ot,t[41]=Q,t[42]=S,t[43]=u,t[44]=r,t[45]=rt,t[46]=Wt,t[47]=qt,t[48]=h,t[49]=g,t[50]=f,t[51]=lt,t[52]=q,t[53]=K,t[54]=l,t[55]=A):A=t[55];let C;t[56]!==m?.footnote||t[57]!==m?.source||t[58]!==p||t[59]!==z||t[60]!==f?.footnote||t[61]!==f?.source||t[62]!==j?(C=z||p?n.jsxRuntimeExports.jsx(Me.GraphFooter,{styles:{footnote:f?.footnote,source:f?.source},classNames:{footnote:m?.footnote,source:m?.source},sources:z,footNote:p,width:j}):null,t[56]=m?.footnote,t[57]=m?.source,t[58]=p,t[59]=z,t[60]=f?.footnote,t[61]=f?.source,t[62]=j,t[63]=C):C=t[63];let I;return t[64]!==_||t[65]!==it||t[66]!==a||t[67]!==v||t[68]!==vt||t[69]!==Xt||t[70]!==Ft||t[71]!==Ot||t[72]!==at||t[73]!==At||t[74]!==T||t[75]!==A||t[76]!==C||t[77]!==Mt||t[78]!==j?(I=n.jsxRuntimeExports.jsxs(we.GraphContainer,{className:at,style:At,id:a,ref:X,"aria-label":_,backgroundColor:it,theme:Mt,language:vt,minHeight:Xt,width:j,height:v,relativeHeight:Ot,padding:Ft,children:[T,A,C]}),t[64]=_,t[65]=it,t[66]=a,t[67]=v,t[68]=vt,t[69]=Xt,t[70]=Ft,t[71]=Ot,t[72]=at,t[73]=At,t[74]=T,t[75]=A,t[76]=C,t[77]=Mt,t[78]=j,t[79]=I):I=t[79],I}function vi(e){return e!==void 0}function ji(e){return e!==void 0}function Ai(e){return e.data}function wi(e){return e!==void 0}function Ei(e){return e.data}exports.DualAxisLineChart=gi;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-CTPQjnHt.cjs"),b=require("react"),Ft=require("./parse-hMnG_lRV.cjs"),be=require("./index-Cno4Q0YE.cjs"),xe=require("./numberFormattingFunction-02t-wJta.cjs"),ke=require("./Tooltip-uUdw6wJL.cjs"),q=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Ne=require("./XTicksAndGridLines-B6CELS7q.cjs"),ge=require("./Axis-DxRV2yMi.cjs"),Ae=require("./AxisTitle-sS5bLLR7.cjs"),Oe=require("./index-B_sAFsEV.cjs"),Le=require("./time-CZd5YLSP.cjs"),we=require("./linear-BwPAspcq.cjs"),ve=require("./line-DaEMhXmx.cjs"),me=require("./step-BZ3C8QFW.cjs"),Ie=require("./select-Bnfk0lJx.cjs"),Se=require("./init-DU0ybBc_.cjs"),De=require("./pointer-Dkq5NV1q.cjs"),qe=require("./use-in-view-QcfiW0w3.cjs"),mt=require("./proxy-BxvUI_9l.cjs"),Me=require("./GraphFooter.cjs"),Te=require("./GraphHeader.cjs"),Ce=require("./ColorLegend.cjs"),Ee=require("./Colors.cjs"),Ve=require("./EmptyState-gLDRXBHm.cjs"),Re=require("./GraphContainer-d8A46BK2.cjs"),$e=require("./getNoOfTicks-C_1CFXv_.cjs");function Fe(e){const t=n.compilerRuntimeExports.c(117),{data:v,width:K,height:Q,lineColors:o,labels:j,sameAxes:A,dateFormat:f,showValues:Rt,noOfXTicks:Kt,rightMargin:Qt,leftMargin:Pt,topMargin:Z,bottomMargin:bt,tooltip:ft,highlightAreaSettings:kt,onSeriesMouseOver:Nt,animate:s,strokeWidth:G,showDots:M,noOfYTicks:pt,lineSuffixes:H,linePrefixes:_,minDate:dt,maxDate:Ot,curveType:tt,styles:a,classNames:c,precision:et,customLayers:U,showAxisLabels:W}=e,Gt=b.useRef(null);let ht;t[0]!==s.amount||t[1]!==s.once?(ht={once:s.once,amount:s.amount},t[0]=s.amount,t[1]=s.once,t[2]=ht):ht=t[2];const d=qe.useInView(Gt,ht),[y,Ht]=b.useState(!1);let yt,it;t[3]!==s.duration||t[4]!==y||t[5]!==d?(yt=()=>{if(d&&!y){const i=setTimeout(()=>{Ht(!0)},(s.duration+.5)*1e3);return()=>clearTimeout(i)}},it=[d,y,s.duration],t[3]=s.duration,t[4]=y,t[5]=d,t[6]=yt,t[7]=it):(yt=t[6],it=t[7]),b.useEffect(yt,it);const Ut=tt==="linear"?ve.curveLinear:tt==="step"?me.curveStep:tt==="stepAfter"?me.stepAfter:tt==="stepBefore"?me.stepBefore:me.monotoneX,[N,Lt]=b.useState(void 0),[gt,p]=b.useState(void 0),[u,Wt]=b.useState(void 0),nt=Pt+50,It=Qt+65;let st;t[8]!==bt||t[9]!==nt||t[10]!==It||t[11]!==Z?(st={top:Z,bottom:bt,left:nt,right:It},t[8]=bt,t[9]=nt,t[10]=It,t[11]=Z,t[12]=st):st=t[12];const h=st,X=b.useRef(null);let O;t[13]!==f?(O=i=>({...i,date:Ft.parse(`${i.date}`,f,new Date)}),t[13]=f,t[14]=O):O=t[14];const r=be.orderBy(v.map(O),["date"],["asc"]);let ot;if(t[15]!==f||t[16]!==kt){let i;t[18]!==f?(i=R=>({...R,coordinates:[R.coordinates[0]===null?null:Ft.parse(`${R.coordinates[0]}`,f,new Date),R.coordinates[1]===null?null:Ft.parse(`${R.coordinates[1]}`,f,new Date)]}),t[18]=f,t[19]=i):i=t[19],ot=kt.map(i),t[15]=f,t[16]=kt,t[17]=ot}else ot=t[17];const vt=ot,x=K-h.left-h.right,l=Q-h.top-h.bottom,Xt=dt?Ft.parse(`${dt}`,f,new Date):r[0].date,St=Ot?Ft.parse(`${Ot}`,f,new Date):r[r.length-1].date,jt=Math.min(...r.map(yi).filter(hi))!==1/0?Math.min(...r.map(di).filter(pi))>0?0:Math.min(...r.map(fi).filter(mi)):0,rt=Math.min(...r.map(xi).filter(ui))!==1/0?Math.min(...r.map(ci).filter(ai))>0?0:Math.min(...r.map(li).filter(ri)):0,lt=Math.max(...r.map(oi).filter(si))!==1/0?Math.max(...r.map(ni).filter(ii)):0,Y=Math.max(...r.map(ei).filter(ti))!==1/0?Math.max(...r.map(_e).filter(Ze)):0,Dt=jt<rt?jt:rt,B=lt>Y?lt:Y,m=Le.time().domain([Xt,St]).range([0,x]),k=we.linear().domain([A?Dt:jt,A?B>0?B:0:lt>0?lt:0]).range([l,0]).nice(),g=we.linear().domain([A?Dt:rt,A?B>0?B:0:Y>0?Y:0]).range([l,0]).nice(),qt=ve.line().defined(Qe).x(i=>m(i.date)).y(i=>k(i.y1)).curve(Ut),At=ve.line().defined(Ke).x(i=>m(i.date)).y(i=>g(i.y2)).curve(Ut),Yt=k.ticks(pt),Bt=g.ticks(pt),Mt=m.ticks(Kt);b.useEffect(()=>{const i=ye=>{const je=r[Se.bisectCenter(r.map(Je),m.invert(De.pointer(ye)[0]),0)];Lt(je||r[r.length-1]),Nt?.(je||r[r.length-1]),Wt(ye.clientY),p(ye.clientX)},R=()=>{Lt(void 0),p(void 0),Wt(void 0),Nt?.(void 0)};Ie.select(X.current).on("mousemove",i).on("mouseout",R)},[m,r,Nt]);let at;t[20]!==s||t[21]!==l||t[22]!==x||t[23]!==vt||t[24]!==d||t[25]!==m?(at=n.jsxRuntimeExports.jsx(Oe.HighlightArea,{areaSettings:vt,width:x,height:l,scale:m,animate:s,isInView:d}),t[20]=s,t[21]=l,t[22]=x,t[23]=vt,t[24]=d,t[25]=m,t[26]=at):at=t[26];const wt=c?.xAxis?.axis;let T;t[27]!==wt?(T={axis:wt},t[27]=wt,t[28]=T):T=t[28];let L;t[29]!==a?.xAxis?.axis?(L=a?.xAxis?.axis||{},t[29]=a?.xAxis?.axis,t[30]=L):L=t[30];let C;t[31]!==o[0]||t[32]!==L?(C={axis:{stroke:o[0],...L}},t[31]=o[0],t[32]=L,t[33]=C):C=t[33];let ct;t[34]!==l||t[35]!==T||t[36]!==C?(ct=n.jsxRuntimeExports.jsx(ge.Axis,{y1:0,y2:l,x1:-15,x2:-15,classNames:T,styles:C}),t[34]=l,t[35]=T,t[36]=C,t[37]=ct):ct=t[37];let V;t[38]!==c?.yAxis?.title||t[39]!==l||t[40]!==j||t[41]!==o[0]||t[42]!==h.left||t[43]!==W||t[44]!==a?.yAxis?.title?(V=W?n.jsxRuntimeExports.jsx(Ae.AxisTitle,{x:10-h.left,y:l/2,style:{fill:o[0],...a?.yAxis?.title||{}},className:c?.yAxis?.title,text:j[0].length>100?`${j[0].substring(0,100)}...`:j[0],rotate90:!0}):null,t[38]=c?.yAxis?.title,t[39]=l,t[40]=j,t[41]=o[0],t[42]=h.left,t[43]=W,t[44]=a?.yAxis?.title,t[45]=V):V=t[45];const zt=x+15,ut=x+15,Jt=c?.xAxis?.axis;let $;t[46]!==Jt?($={axis:Jt},t[46]=Jt,t[47]=$):$=t[47];let z;t[48]!==a?.xAxis?.axis?(z=a?.xAxis?.axis||{},t[48]=a?.xAxis?.axis,t[49]=z):z=t[49];let I;t[50]!==o[1]||t[51]!==z?(I={axis:{stroke:o[1],...z}},t[50]=o[1],t[51]=z,t[52]=I):I=t[52];let J;t[53]!==l||t[54]!==zt||t[55]!==ut||t[56]!==$||t[57]!==I?(J=n.jsxRuntimeExports.jsx(ge.Axis,{y1:0,y2:l,x1:zt,x2:ut,classNames:$,styles:I}),t[53]=l,t[54]=zt,t[55]=ut,t[56]=$,t[57]=I,t[58]=J):J=t[58];let xt;t[59]!==c?.yAxis?.title||t[60]!==l||t[61]!==x||t[62]!==j||t[63]!==o[1]||t[64]!==h.right||t[65]!==W||t[66]!==a?.yAxis?.title?(xt=W?n.jsxRuntimeExports.jsx(Ae.AxisTitle,{x:x+h.right-15,y:l/2,style:{fill:o[1],...a?.yAxis?.title||{}},className:c?.yAxis?.title,text:j[1].length>100?`${j[1].substring(0,100)}...`:j[1],rotate90:!0}):null,t[59]=c?.yAxis?.title,t[60]=l,t[61]=x,t[62]=j,t[63]=o[1],t[64]=h.right,t[65]=W,t[66]=a?.yAxis?.title,t[67]=xt):xt=t[67];const Et=x+15,F=c?.xAxis?.axis;let w;t[68]!==F?(w={axis:F},t[68]=F,t[69]=w):w=t[69];const P=a?.xAxis?.axis;let E;t[70]!==P?(E={axis:P},t[70]=P,t[71]=E):E=t[71];let S;t[72]!==l||t[73]!==Et||t[74]!==w||t[75]!==E?(S=n.jsxRuntimeExports.jsx(ge.Axis,{y1:l,y2:l,x1:-15,x2:Et,classNames:w,styles:E}),t[72]=l,t[73]=Et,t[74]=w,t[75]=E,t[76]=S):S=t[76];let D;t[77]!==f?(D=i=>Ft.format(i,f),t[77]=f,t[78]=D):D=t[78];const Tt=Mt.map(D),Zt=Mt.map(i=>m(i)),Ct=a?.xAxis?.gridLines,fe=a?.xAxis?.labels;let _t;t[79]!==Ct||t[80]!==fe?(_t={gridLines:Ct,labels:fe},t[79]=Ct,t[80]=fe,t[81]=_t):_t=t[81];const pe=c?.xAxis?.gridLines;let Vt;t[82]!==pe?(Vt=n.mo("opacity-0",pe),t[82]=pe,t[83]=Vt):Vt=t[83];const de=c?.xAxis?.labels;let $t;t[84]!==de?($t=n.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",de),t[84]=de,t[85]=$t):$t=t[85];let te;t[86]!==Vt||t[87]!==$t?(te={gridLines:Vt,labels:$t},t[86]=Vt,t[87]=$t,t[88]=te):te=t[88];let ee;t[89]!==U?(ee=U.filter(ze).map(Be),t[89]=U,t[90]=ee):ee=t[90];let ie;t[91]!==o[0]||t[92]!==G?(ie={stroke:o[0],strokeWidth:G,fill:"none"},t[91]=o[0],t[92]=G,t[93]=ie):ie=t[93];let ne;t[94]!==s.duration?(ne={opacity:0,transition:{duration:s.duration}},t[94]=s.duration,t[95]=ne):ne=t[95];let se;t[96]!==o[1]||t[97]!==G?(se={stroke:o[1],strokeWidth:G,fill:"none"},t[96]=o[1],t[97]=G,t[98]=se):se=t[98];let oe;t[99]!==s.duration?(oe={opacity:0,transition:{duration:s.duration}},t[99]=s.duration,t[100]=oe):oe=t[100];const he=r.map((i,R)=>n.jsxRuntimeExports.jsxs(mt.motion.g,{children:[q.checkIfNullOrUndefined(i.y1)?null:n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[M?n.jsxRuntimeExports.jsx(mt.motion.circle,{r:x/r.length<5?0:x/r.length<20?2:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:m(i.date),cy:k(i.y1),fill:o[0]},whileInView:{opacity:1,fill:o[0],transition:{duration:y?s.duration:.5,delay:y?0:s.duration},cx:m(i.date),cy:k(i.y1)}},initial:"initial",animate:d?"whileInView":"initial"}):null,Rt?n.jsxRuntimeExports.jsx(mt.motion.text,{dy:q.checkIfNullOrUndefined(i.y2)||i.y2<i.y1?-8:"1em",style:{textAnchor:"middle",...a?.graphObjectValues||{}},className:n.mo("graph-value graph-value-line-1 text-xs font-bold",c?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:m(i.date),y:g(i.y1),fill:o[0]},whileInView:{opacity:1,x:m(i.date),fill:o[0],y:g(i.y1),transition:{duration:y?s.duration:.5,delay:y?0:s.duration}}},initial:"initial",animate:d?"whileInView":"initial",children:xe.numberFormattingFunction(i.y1,"NA",et,_[0],H[0])}):null]}),q.checkIfNullOrUndefined(i.y2)?null:n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[M?n.jsxRuntimeExports.jsx(mt.motion.circle,{r:x/r.length<5?0:x/r.length<20?2:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:m(i.date),cy:g(i.y2),fill:o[1]},whileInView:{opacity:1,transition:{duration:y?s.duration:.5,delay:y?0:s.duration},fill:o[1],cx:m(i.date),cy:g(i.y2)}},initial:"initial",animate:d?"whileInView":"initial"}):null,Rt?n.jsxRuntimeExports.jsx(mt.motion.text,{dy:q.checkIfNullOrUndefined(i.y1)||i.y1<i.y2?-8:"1em",style:{textAnchor:"middle",...a?.graphObjectValues||{}},className:n.mo("graph-value graph-value-line-2 text-xs font-bold",c?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:m(i.date),y:g(i.y2),fill:o[1]},whileInView:{opacity:1,x:m(i.date),y:g(i.y2),fill:o[1],transition:{duration:y?s.duration:.5,delay:y?0:s.duration}}},initial:"initial",animate:d?"whileInView":"initial",children:xe.numberFormattingFunction(i.y2,"NA",et,_[1],H[1])}):null]})]},R));let re;t[101]!==he?(re=n.jsxRuntimeExports.jsx("g",{children:he}),t[101]=he,t[102]=re):re=t[102];let le;t[103]!==U?(le=U.filter(Ge).map(Pe),t[103]=U,t[104]=le):le=t[104];let ae;t[105]===Symbol.for("react.memo_cache_sentinel")?(ae={fill:"none",pointerEvents:"all"},t[105]=ae):ae=t[105];let ce;t[106]!==X||t[107]!==l||t[108]!==x?(ce=n.jsxRuntimeExports.jsx("rect",{ref:X,style:ae,width:x,height:l}),t[106]=X,t[107]=l,t[108]=x,t[109]=ce):ce=t[109];let ue;return t[110]!==c?.tooltip||t[111]!==gt||t[112]!==u||t[113]!==N||t[114]!==a?.tooltip||t[115]!==ft?(ue=N&&ft&&gt&&u?n.jsxRuntimeExports.jsx(ke.Tooltip,{data:N,body:ft,xPos:gt,yPos:u,backgroundStyle:a?.tooltip,className:c?.tooltip}):null,t[110]=c?.tooltip,t[111]=gt,t[112]=u,t[113]=N,t[114]=a?.tooltip,t[115]=ft,t[116]=ue):ue=t[116],n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(mt.motion.svg,{width:`${K}px`,height:`${Q}px`,viewBox:`0 0 ${K} ${Q}`,direction:"ltr",ref:Gt,children:n.jsxRuntimeExports.jsxs("g",{transform:`translate(${h.left},${h.top})`,children:[at,n.jsxRuntimeExports.jsxs("g",{children:[Yt.map((i,R)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("line",{y1:k(i),y2:k(i),x1:-15,x2:-20,style:{stroke:o[0],strokeWidth:1,...a?.yAxis?.gridLines||{}},className:c?.yAxis?.gridLines}),n.jsxRuntimeExports.jsx("text",{x:-25,y:k(i),dy:"0.33em",className:n.mo("text-xs",c?.yAxis?.labels),style:{textAnchor:"end",fill:o[0],...a?.yAxis?.labels||{}},children:xe.numberFormattingFunction(i,"NA",et,_[0],H[0])})]},R)),ct,V]}),n.jsxRuntimeExports.jsxs("g",{children:[Bt.map((i,R)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("line",{y1:g(i),y2:g(i),x1:x+15,x2:x+20,style:{stroke:o[1],strokeWidth:1,...a?.yAxis?.gridLines||{}},className:c?.yAxis?.gridLines}),n.jsxRuntimeExports.jsx("text",{x:x+25,y:g(i),dy:"0.33em",dx:-2,style:{textAnchor:"start",fill:o[1],...a?.yAxis?.labels||{}},className:n.mo("text-xs",c?.yAxis?.labels),children:xe.numberFormattingFunction(i,"NA",et,_[1],H[1])})]},R)),J,xt]}),n.jsxRuntimeExports.jsxs("g",{children:[S,n.jsxRuntimeExports.jsx(Ne.XTicksAndGridLines,{values:Tt,x:Zt,y1:0,y2:l,styles:_t,classNames:te,labelType:"primary",showGridLines:!0,precision:et})]}),ee,n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx(mt.motion.path,{style:ie,exit:ne,variants:{initial:{pathLength:0,d:qt(r.filter(Ye))||"",opacity:1},whileInView:{pathLength:1,d:qt(r.filter(Xe))||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:d?"whileInView":"initial"}),n.jsxRuntimeExports.jsx(mt.motion.path,{d:At(r.filter(We))||"",style:se,exit:oe,variants:{initial:{pathLength:0,d:At(r.filter(Ue))||"",opacity:1},whileInView:{pathLength:1,d:At(r.filter(He))||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:d?"whileInView":"initial"}),N?n.jsxRuntimeExports.jsx("line",{y1:0,y2:l,x1:m(N.date),x2:m(N.date),className:n.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",c?.mouseOverLine),style:a?.mouseOverLine}):null]}),re,le,ce]})}),ue]})}function Pe(e){return e.layer}function Ge(e){return e.position==="after"}function He(e){return!q.checkIfNullOrUndefined(e.y2)}function Ue(e){return!q.checkIfNullOrUndefined(e.y2)}function We(e){return!q.checkIfNullOrUndefined(e.y2)}function Xe(e){return!q.checkIfNullOrUndefined(e.y1)}function Ye(e){return!q.checkIfNullOrUndefined(e.y1)}function Be(e){return e.layer}function ze(e){return e.position==="before"}function Je(e){return e.date}function Ke(e){return!q.checkIfNullOrUndefined(e.y2)}function Qe(e){return!q.checkIfNullOrUndefined(e.y1)}function Ze(e){return e!=null}function _e(e){return e.y2}function ti(e){return e!=null}function ei(e){return e.y2}function ii(e){return e!=null}function ni(e){return e.y1}function si(e){return e!=null}function oi(e){return e.y1}function ri(e){return e!=null}function li(e){return e.y2}function ai(e){return e!=null}function ci(e){return e.y2}function ui(e){return e!=null}function xi(e){return e.y2}function mi(e){return e!=null}function fi(e){return e.y1}function pi(e){return e!=null}function di(e){return e.y2}function hi(e){return e!=null}function yi(e){return e.y1}function gi(e){const t=n.compilerRuntimeExports.c(90),{data:v,graphTitle:K,sources:Q,graphDescription:o,height:j,width:A,footNote:f,noOfXTicks:Rt,dateFormat:Kt,showValues:Qt,padding:Pt,lineColors:Z,sameAxes:bt,backgroundColor:ft,leftMargin:kt,rightMargin:Nt,topMargin:s,bottomMargin:G,labels:M,lineSuffixes:pt,linePrefixes:H,tooltip:_,highlightAreaSettings:dt,relativeHeight:Ot,onSeriesMouseOver:tt,graphID:a,graphDownload:c,dataDownload:et,animate:U,strokeWidth:W,showDots:Gt,language:ht,showColorScale:d,minHeight:y,colorLegendTitle:Ht,theme:yt,ariaLabel:it,noOfYTicks:Ut,maxDate:N,minDate:Lt,curveType:gt,styles:p,classNames:u,precision:Wt,customLayers:nt,showAxisLabels:It}=e,st=Kt===void 0?"yyyy":Kt,h=Qt===void 0?!1:Qt;let X;t[0]!==Z?(X=Z===void 0?[Ee.Colors.light.categoricalColors.colors[0],Ee.Colors.light.categoricalColors.colors[1]]:Z,t[0]=Z,t[1]=X):X=t[1];const O=X,r=bt===void 0?!1:bt,ot=ft===void 0?!1:ft,vt=kt===void 0?80:kt,x=Nt===void 0?80:Nt,l=s===void 0?20:s,Xt=G===void 0?25:G;let St;t[2]!==pt?(St=pt===void 0?["",""]:pt,t[2]=pt,t[3]=St):St=t[3];const jt=St;let rt;t[4]!==H?(rt=H===void 0?["",""]:H,t[4]=H,t[5]=rt):rt=t[5];const lt=rt;let Y;t[6]!==dt?(Y=dt===void 0?[]:dt,t[6]=dt,t[7]=Y):Y=t[7];const Dt=Y,B=c===void 0?!1:c,m=et===void 0?!1:et,k=U===void 0?!1:U,g=W===void 0?2:W,qt=Gt===void 0?!0:Gt,At=ht===void 0?"en":ht,Yt=d===void 0?!0:d,Bt=y===void 0?0:y,Mt=yt===void 0?"light":yt,at=Ut===void 0?5:Ut,wt=gt===void 0?"curve":gt,T=Wt===void 0?2:Wt;let L;t[8]!==nt?(L=nt===void 0?[]:nt,t[8]=nt,t[9]=L):L=t[9];const C=L,ct=It===void 0?!0:It,[V,zt]=b.useState(0),[ut,Jt]=b.useState(0),$=b.useRef(null),z=b.useRef(null);let I,J;t[10]===Symbol.for("react.memo_cache_sentinel")?(I=()=>{const Zt=new ResizeObserver(Ct=>{zt(Ct[0].target.clientWidth||620),Jt(Ct[0].target.clientHeight||480)});return $.current&&Zt.observe($.current),()=>Zt.disconnect()},J=[],t[10]=I,t[11]=J):(I=t[10],J=t[11]),b.useEffect(I,J);const xt=u?.graphContainer,Et=p?.graphContainer;let F;t[12]!==u?.description||t[13]!==u?.title||t[14]!==v||t[15]!==m||t[16]!==o||t[17]!==B||t[18]!==K||t[19]!==p?.description||t[20]!==p?.title||t[21]!==A?(F=K||o||B||m?n.jsxRuntimeExports.jsx(Te.GraphHeader,{styles:{title:p?.title,description:p?.description},classNames:{title:u?.title,description:u?.description},graphTitle:K,graphDescription:o,width:A,graphDownload:B?z:void 0,dataDownload:m?v.map(Ei).filter(wi).length>0?v.map(Ai).filter(ji):v.filter(vi):null}):null,t[12]=u?.description,t[13]=u?.title,t[14]=v,t[15]=m,t[16]=o,t[17]=B,t[18]=K,t[19]=p?.description,t[20]=p?.title,t[21]=A,t[22]=F):F=t[22];let w;t[23]!==u?.colorLegend||t[24]!==Ht||t[25]!==M||t[26]!==O||t[27]!==Yt?(w=Yt&&M.length>0?n.jsxRuntimeExports.jsx(Ce.ColorLegend,{colorDomain:M,colorLegendTitle:Ht,colors:O,showNAColor:!1,className:u?.colorLegend}):null,t[23]=u?.colorLegend,t[24]=Ht,t[25]=M,t[26]=O,t[27]=Yt,t[28]=w):w=t[28];let P;t[29]!==v.length?(P=v.length===0&&n.jsxRuntimeExports.jsx(Ve.EmptyState,{}),t[29]=v.length,t[30]=P):P=t[30];let E;t[31]!==k||t[32]!==Xt||t[33]!==u||t[34]!==wt||t[35]!==C||t[36]!==v||t[37]!==st||t[38]!==Dt||t[39]!==M||t[40]!==vt||t[41]!==O||t[42]!==lt||t[43]!==jt||t[44]!==N||t[45]!==Lt||t[46]!==Rt||t[47]!==at||t[48]!==tt||t[49]!==T||t[50]!==x||t[51]!==r||t[52]!==ct||t[53]!==qt||t[54]!==h||t[55]!==g||t[56]!==p||t[57]!==ut||t[58]!==V||t[59]!==_||t[60]!==l?(E=V&&ut&&v.length>0?n.jsxRuntimeExports.jsx(Fe,{data:v,sameAxes:r,lineColors:O,width:V,height:ut,dateFormat:st,showValues:h,noOfXTicks:Rt??$e.getNoOfTicks(V),leftMargin:vt,rightMargin:x,topMargin:l,bottomMargin:Xt,labels:M,highlightAreaSettings:Dt,tooltip:_,onSeriesMouseOver:tt,animate:k===!0?{duration:.5,once:!0,amount:.5}:k||{duration:0,once:!0,amount:0},strokeWidth:g,showDots:qt,noOfYTicks:at,lineSuffixes:jt,linePrefixes:lt,minDate:Lt,maxDate:N,curveType:wt,styles:p,classNames:u,precision:T,customLayers:C,showAxisLabels:ct}):null,t[31]=k,t[32]=Xt,t[33]=u,t[34]=wt,t[35]=C,t[36]=v,t[37]=st,t[38]=Dt,t[39]=M,t[40]=vt,t[41]=O,t[42]=lt,t[43]=jt,t[44]=N,t[45]=Lt,t[46]=Rt,t[47]=at,t[48]=tt,t[49]=T,t[50]=x,t[51]=r,t[52]=ct,t[53]=qt,t[54]=h,t[55]=g,t[56]=p,t[57]=ut,t[58]=V,t[59]=_,t[60]=l,t[61]=E):E=t[61];let S;t[62]!==P||t[63]!==E?(S=n.jsxRuntimeExports.jsxs(Re.GraphArea,{ref:$,children:[P,E]}),t[62]=P,t[63]=E,t[64]=S):S=t[64];let D;t[65]!==u?.footnote||t[66]!==u?.source||t[67]!==f||t[68]!==Q||t[69]!==p?.footnote||t[70]!==p?.source||t[71]!==A?(D=Q||f?n.jsxRuntimeExports.jsx(Me.GraphFooter,{styles:{footnote:p?.footnote,source:p?.source},classNames:{footnote:u?.footnote,source:u?.source},sources:Q,footNote:f,width:A}):null,t[65]=u?.footnote,t[66]=u?.source,t[67]=f,t[68]=Q,t[69]=p?.footnote,t[70]=p?.source,t[71]=A,t[72]=D):D=t[72];let Tt;return t[73]!==it||t[74]!==ot||t[75]!==a||t[76]!==j||t[77]!==At||t[78]!==Bt||t[79]!==Pt||t[80]!==Ot||t[81]!==xt||t[82]!==Et||t[83]!==F||t[84]!==w||t[85]!==S||t[86]!==D||t[87]!==Mt||t[88]!==A?(Tt=n.jsxRuntimeExports.jsxs(Re.GraphContainer,{className:xt,style:Et,id:a,ref:z,"aria-label":it,backgroundColor:ot,theme:Mt,language:At,minHeight:Bt,width:A,height:j,relativeHeight:Ot,padding:Pt,children:[F,w,S,D]}),t[73]=it,t[74]=ot,t[75]=a,t[76]=j,t[77]=At,t[78]=Bt,t[79]=Pt,t[80]=Ot,t[81]=xt,t[82]=Et,t[83]=F,t[84]=w,t[85]=S,t[86]=D,t[87]=Mt,t[88]=A,t[89]=Tt):Tt=t[89],Tt}function vi(e){return e!==void 0}function ji(e){return e!==void 0}function Ai(e){return e.data}function wi(e){return e!==void 0}function Ei(e){return e.data}exports.DualAxisLineChart=gi;
2
2
  //# sourceMappingURL=DualAxisLineChart.cjs.map