@undp/data-viz 1.2.7 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AreaChart.d.ts +224 -0
- package/dist/AreaChart.js +2 -0
- package/dist/AreaChart.js.map +1 -0
- package/dist/Axis-BlyBRMNw.cjs +2 -0
- package/dist/Axis-BlyBRMNw.cjs.map +1 -0
- package/dist/Axis-CvK-w3E2.js +44 -0
- package/dist/Axis-CvK-w3E2.js.map +1 -0
- package/dist/AxisTitle-BY8MI9jC.cjs +2 -0
- package/dist/AxisTitle-BY8MI9jC.cjs.map +1 -0
- package/dist/AxisTitle-BeMxcw5I.js +21 -0
- package/dist/AxisTitle-BeMxcw5I.js.map +1 -0
- package/dist/BarGraph.d.ts +460 -0
- package/dist/BarGraph.js +2 -0
- package/dist/BarGraph.js.map +1 -0
- package/dist/BasicStatCard.d.ts +106 -0
- package/dist/BasicStatCard.js +2 -0
- package/dist/BasicStatCard.js.map +1 -0
- package/dist/BeeSwarmChart.d.ts +189 -0
- package/dist/BeeSwarmChart.js +2 -0
- package/dist/BeeSwarmChart.js.map +1 -0
- package/dist/BiVariateChoroplethMap.d.ts +189 -0
- package/dist/BiVariateChoroplethMap.js +2 -0
- package/dist/BiVariateChoroplethMap.js.map +1 -0
- package/dist/BulletChart.d.ts +219 -0
- package/dist/BulletChart.js +2 -0
- package/dist/BulletChart.js.map +1 -0
- package/dist/ButterflyChart.d.ts +201 -0
- package/dist/ButterflyChart.js +2 -0
- package/dist/ButterflyChart.js.map +1 -0
- package/dist/ChoroplethMap.d.ts +190 -0
- package/dist/ChoroplethMap.js +2 -0
- package/dist/ChoroplethMap.js.map +1 -0
- package/dist/CirclePackingGraph.d.ts +161 -0
- package/dist/CirclePackingGraph.js +2 -0
- package/dist/CirclePackingGraph.js.map +1 -0
- package/dist/ColorLegend.d.ts +17 -0
- package/dist/ColorLegend.js +2 -0
- package/dist/ColorLegend.js.map +1 -0
- package/dist/ColorLegendWithMouseOver.d.ts +16 -0
- package/dist/ColorLegendWithMouseOver.js +2 -0
- package/dist/ColorLegendWithMouseOver.js.map +1 -0
- package/dist/Colors.d.ts +174 -0
- package/dist/Colors.js +2 -0
- package/dist/Colors.js.map +1 -0
- package/dist/CopyTextButton.d.ts +13 -0
- package/dist/CopyTextButton.js +17 -0
- package/dist/CopyTextButton.js.map +1 -0
- package/dist/CsvDownloadButton.d.ts +22 -0
- package/dist/CsvDownloadButton.js +23 -0
- package/dist/CsvDownloadButton.js.map +1 -0
- package/dist/DataCards.d.ts +131 -0
- package/dist/DataCards.js +2 -0
- package/dist/DataCards.js.map +1 -0
- package/dist/DataTable.d.ts +122 -0
- package/dist/DataTable.js +2 -0
- package/dist/DataTable.js.map +1 -0
- package/dist/DifferenceLineChart.d.ts +237 -0
- package/dist/DifferenceLineChart.js +2 -0
- package/dist/DifferenceLineChart.js.map +1 -0
- package/dist/DonutChart.d.ts +148 -0
- package/dist/DonutChart.js +2 -0
- package/dist/DonutChart.js.map +1 -0
- package/dist/DotDensityMap.d.ts +191 -0
- package/dist/DotDensityMap.js +2 -0
- package/dist/DotDensityMap.js.map +1 -0
- package/dist/DropdownSelect-CuzV7gdj.cjs +29 -0
- package/dist/DropdownSelect-CuzV7gdj.cjs.map +1 -0
- package/dist/DropdownSelect-DmZsXrhY.js +2698 -0
- package/dist/DropdownSelect-DmZsXrhY.js.map +1 -0
- package/dist/DualAxisLineChart.d.ts +180 -0
- package/dist/DualAxisLineChart.js +2 -0
- package/dist/DualAxisLineChart.js.map +1 -0
- package/dist/DumbbellChart.d.ts +224 -0
- package/dist/DumbbellChart.js +2 -0
- package/dist/DumbbellChart.js.map +1 -0
- package/dist/EmptyState-BQguKAp5.cjs +2 -0
- package/dist/EmptyState-BQguKAp5.cjs.map +1 -0
- package/dist/EmptyState-b2Ln487i.js +22 -0
- package/dist/EmptyState-b2Ln487i.js.map +1 -0
- package/dist/ExcelDownloadButton.d.ts +22 -0
- package/dist/ExcelDownloadButton.js +2 -0
- package/dist/ExcelDownloadButton.js.map +1 -0
- package/dist/FootNote.d.ts +12 -0
- package/dist/FootNote.js +2 -0
- package/dist/FootNote.js.map +1 -0
- package/dist/GeoHubCompareMaps.d.ts +103 -0
- package/dist/GeoHubCompareMaps.js +2 -0
- package/dist/GeoHubCompareMaps.js.map +1 -0
- package/dist/GeoHubMap.d.ts +118 -0
- package/dist/GeoHubMap.js +2 -0
- package/dist/GeoHubMap.js.map +1 -0
- package/dist/GeoHubMapWithLayerSelection.d.ts +117 -0
- package/dist/GeoHubMapWithLayerSelection.js +2 -0
- package/dist/GeoHubMapWithLayerSelection.js.map +1 -0
- package/dist/GraphDescription.d.ts +12 -0
- package/dist/GraphDescription.js +2 -0
- package/dist/GraphDescription.js.map +1 -0
- package/dist/GraphFooter.d.ts +24 -0
- package/dist/GraphFooter.js +2 -0
- package/dist/GraphFooter.js.map +1 -0
- package/dist/GraphHeader.d.ts +22 -0
- package/dist/GraphHeader.js +2 -0
- package/dist/GraphHeader.js.map +1 -0
- package/dist/GraphTitle.d.ts +13 -0
- package/dist/GraphTitle.js +2 -0
- package/dist/GraphTitle.js.map +1 -0
- package/dist/GriddedGraphs.d.ts +540 -0
- package/dist/GriddedGraphs.js +2 -0
- package/dist/GriddedGraphs.js.map +1 -0
- package/dist/GriddedGraphsFromConfig.d.ts +543 -0
- package/dist/GriddedGraphsFromConfig.js +2 -0
- package/dist/GriddedGraphsFromConfig.js.map +1 -0
- package/dist/HeatMap.d.ts +166 -0
- package/dist/HeatMap.js +2 -0
- package/dist/HeatMap.js.map +1 -0
- package/dist/Histogram.d.ts +165 -0
- package/dist/Histogram.js +2 -0
- package/dist/Histogram.js.map +1 -0
- package/dist/ImageDownloadButton.d.ts +15 -0
- package/dist/ImageDownloadButton.js +2 -0
- package/dist/ImageDownloadButton.js.map +1 -0
- package/dist/LineChartWithConfidenceInterval.d.ts +250 -0
- package/dist/LineChartWithConfidenceInterval.js +2 -0
- package/dist/LineChartWithConfidenceInterval.js.map +1 -0
- package/dist/LinearColorLegend.d.ts +13 -0
- package/dist/LinearColorLegend.js +2 -0
- package/dist/LinearColorLegend.js.map +1 -0
- package/dist/Modal-C9txyGOk.js +723 -0
- package/dist/Modal-C9txyGOk.js.map +1 -0
- package/dist/Modal-cQF2UQIa.cjs +46 -0
- package/dist/Modal-cQF2UQIa.cjs.map +1 -0
- package/dist/MultiGraphDashboard.d.ts +558 -0
- package/dist/MultiGraphDashboard.js +2 -0
- package/dist/MultiGraphDashboard.js.map +1 -0
- package/dist/MultiGraphDashboardFromConfig.d.ts +562 -0
- package/dist/MultiGraphDashboardFromConfig.js +2 -0
- package/dist/MultiGraphDashboardFromConfig.js.map +1 -0
- package/dist/MultiGraphDashboardWideToLongFormat.d.ts +128 -0
- package/dist/MultiGraphDashboardWideToLongFormat.js +2 -0
- package/dist/MultiGraphDashboardWideToLongFormat.js.map +1 -0
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.d.ts +133 -0
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +2 -0
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js.map +1 -0
- package/dist/MultiLineAltChart.d.ts +244 -0
- package/dist/MultiLineAltChart.js +2 -0
- package/dist/MultiLineAltChart.js.map +1 -0
- package/dist/MultiLineChart.d.ts +246 -0
- package/dist/MultiLineChart.js +2 -0
- package/dist/MultiLineChart.js.map +1 -0
- package/dist/ParetoChart.d.ts +178 -0
- package/dist/ParetoChart.js +2 -0
- package/dist/ParetoChart.js.map +1 -0
- package/dist/RadarChart.d.ts +176 -0
- package/dist/RadarChart.js +2 -0
- package/dist/RadarChart.js.map +1 -0
- package/dist/ReferenceLine-BgDdQbDI.js +129 -0
- package/dist/ReferenceLine-BgDdQbDI.js.map +1 -0
- package/dist/ReferenceLine-Bsb5jeE4.cjs +2 -0
- package/dist/ReferenceLine-Bsb5jeE4.cjs.map +1 -0
- package/dist/RegressionLine-BfpCuD7B.cjs +2 -0
- package/dist/RegressionLine-BfpCuD7B.cjs.map +1 -0
- package/dist/RegressionLine-cSljpHaE.js +49 -0
- package/dist/RegressionLine-cSljpHaE.js.map +1 -0
- package/dist/SVGDownloadButton.d.ts +15 -0
- package/dist/SVGDownloadButton.js +2 -0
- package/dist/SVGDownloadButton.js.map +1 -0
- package/dist/SankeyChart.d.ts +178 -0
- package/dist/SankeyChart.js +2 -0
- package/dist/SankeyChart.js.map +1 -0
- package/dist/ScatterPlot.d.ts +266 -0
- package/dist/ScatterPlot.js +2 -0
- package/dist/ScatterPlot.js.map +1 -0
- package/dist/ScrollStory.d.ts +491 -0
- package/dist/ScrollStory.js +2 -0
- package/dist/ScrollStory.js.map +1 -0
- package/dist/SimpleLineChart.d.ts +230 -0
- package/dist/SimpleLineChart.js +2 -0
- package/dist/SimpleLineChart.js.map +1 -0
- package/dist/SingleGraphDashboard.d.ts +545 -0
- package/dist/SingleGraphDashboard.js +2 -0
- package/dist/SingleGraphDashboard.js.map +1 -0
- package/dist/SingleGraphDashboardFromConfig.d.ts +547 -0
- package/dist/SingleGraphDashboardFromConfig.js +2 -0
- package/dist/SingleGraphDashboardFromConfig.js.map +1 -0
- package/dist/SlopeChart.d.ts +167 -0
- package/dist/SlopeChart.js +2 -0
- package/dist/SlopeChart.js.map +1 -0
- package/dist/Source.d.ts +16 -0
- package/dist/Source.js +2 -0
- package/dist/Source.js.map +1 -0
- package/dist/SparkLine.d.ts +139 -0
- package/dist/SparkLine.js +2 -0
- package/dist/SparkLine.js.map +1 -0
- package/dist/Spinner-DN3s4S0H.js +17 -0
- package/dist/Spinner-DN3s4S0H.js.map +1 -0
- package/dist/Spinner-UmN-KPe9.cjs +2 -0
- package/dist/Spinner-UmN-KPe9.cjs.map +1 -0
- package/dist/StatCardFromData.d.ts +115 -0
- package/dist/StatCardFromData.js +2 -0
- package/dist/StatCardFromData.js.map +1 -0
- package/dist/StripChart.d.ts +178 -0
- package/dist/StripChart.js +2 -0
- package/dist/StripChart.js.map +1 -0
- package/dist/ThreeDGlobe.d.ts +158 -0
- package/dist/ThreeDGlobe.js +2 -0
- package/dist/ThreeDGlobe.js.map +1 -0
- package/dist/ThresholdColorLegendWithMouseOver.d.ts +16 -0
- package/dist/ThresholdColorLegendWithMouseOver.js +2 -0
- package/dist/ThresholdColorLegendWithMouseOver.js.map +1 -0
- package/dist/Tooltip-BM18N_3l.cjs +2 -0
- package/dist/Tooltip-BM18N_3l.cjs.map +1 -0
- package/dist/Tooltip-CzZ1wFyF.js +47 -0
- package/dist/Tooltip-CzZ1wFyF.js.map +1 -0
- package/dist/TreeMapGraph.d.ts +158 -0
- package/dist/TreeMapGraph.js +2 -0
- package/dist/TreeMapGraph.js.map +1 -0
- package/dist/Types.d.ts +883 -0
- package/dist/Types.js +2 -0
- package/dist/Types.js.map +1 -0
- package/dist/Typography-CDR-DAHH.cjs +2 -0
- package/dist/Typography-CDR-DAHH.cjs.map +1 -0
- package/dist/Typography-XJoSE-By.js +58 -0
- package/dist/Typography-XJoSE-By.js.map +1 -0
- package/dist/UnitChart.d.ts +132 -0
- package/dist/UnitChart.js +2 -0
- package/dist/UnitChart.js.map +1 -0
- package/dist/XAxesLabels-C9REbQQs.cjs +2 -0
- package/dist/XAxesLabels-C9REbQQs.cjs.map +1 -0
- package/dist/XAxesLabels-DVw7Lvuz.js +58 -0
- package/dist/XAxesLabels-DVw7Lvuz.js.map +1 -0
- package/dist/XTicksAndGridLines-CUefTINd.js +57 -0
- package/dist/XTicksAndGridLines-CUefTINd.js.map +1 -0
- package/dist/XTicksAndGridLines-DuK35ROS.cjs +2 -0
- package/dist/XTicksAndGridLines-DuK35ROS.cjs.map +1 -0
- package/dist/YAxesLabels-CYVY053X.js +53 -0
- package/dist/YAxesLabels-CYVY053X.js.map +1 -0
- package/dist/YAxesLabels-DhBdLk3Z.cjs +2 -0
- package/dist/YAxesLabels-DhBdLk3Z.cjs.map +1 -0
- package/dist/YTicksAndGridLines-BJRXuBdC.js +57 -0
- package/dist/YTicksAndGridLines-BJRXuBdC.js.map +1 -0
- package/dist/YTicksAndGridLines-CtLvzExe.cjs +2 -0
- package/dist/YTicksAndGridLines-CtLvzExe.cjs.map +1 -0
- package/dist/_commonjsHelpers-DKOUU3wS.cjs +2 -0
- package/dist/_commonjsHelpers-DKOUU3wS.cjs.map +1 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +9 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js.map +1 -0
- package/dist/area-BE2wo7fv.js +53 -0
- package/dist/area-BE2wo7fv.js.map +1 -0
- package/dist/area-D3Qx7k7K.cjs +2 -0
- package/dist/area-D3Qx7k7K.cjs.map +1 -0
- package/dist/array-B7TkkRH0.js +89 -0
- package/dist/array-B7TkkRH0.js.map +1 -0
- package/dist/array-DKbXV8lR.cjs +2 -0
- package/dist/array-DKbXV8lR.cjs.map +1 -0
- package/dist/band-BEjh2CHI.js +47 -0
- package/dist/band-BEjh2CHI.js.map +1 -0
- package/dist/band-CAApY4Pd.cjs +2 -0
- package/dist/band-CAApY4Pd.cjs.map +1 -0
- package/dist/checkIfMultiple-CaefP4X2.js +2264 -0
- package/dist/checkIfMultiple-CaefP4X2.js.map +1 -0
- package/dist/checkIfMultiple-D3h8to1T.cjs +12 -0
- package/dist/checkIfMultiple-D3h8to1T.cjs.map +1 -0
- package/dist/checkIfNullOrUndefined.d.ts +15 -0
- package/dist/checkIfNullOrUndefined.js +2 -0
- package/dist/checkIfNullOrUndefined.js.map +1 -0
- package/dist/customArea-B47Ew5cT.cjs +2 -0
- package/dist/customArea-B47Ew5cT.cjs.map +1 -0
- package/dist/customArea-I3MsoqIl.js +176 -0
- package/dist/customArea-I3MsoqIl.js.map +1 -0
- package/dist/defaultLocale-BEa-49Qz.js +172 -0
- package/dist/defaultLocale-BEa-49Qz.js.map +1 -0
- package/dist/defaultLocale-DIVzfLaQ.cjs +2 -0
- package/dist/defaultLocale-DIVzfLaQ.cjs.map +1 -0
- package/dist/delaunay-C1uAf38t.js +684 -0
- package/dist/delaunay-C1uAf38t.js.map +1 -0
- package/dist/delaunay-rcy0HhZi.cjs +2 -0
- package/dist/delaunay-rcy0HhZi.cjs.map +1 -0
- package/dist/ensureCompleteData-BBDZbDCE.js +102 -0
- package/dist/ensureCompleteData-BBDZbDCE.js.map +1 -0
- package/dist/ensureCompleteData-DqWQ2Zbi.cjs +2 -0
- package/dist/ensureCompleteData-DqWQ2Zbi.cjs.map +1 -0
- package/dist/excelDownload.d.ts +31 -0
- package/dist/excelDownload.js +2 -0
- package/dist/excelDownload.js.map +1 -0
- package/dist/fetchAndParseData.d.ts +84 -0
- package/dist/fetchAndParseData.js +16 -0
- package/dist/fetchAndParseData.js.map +1 -0
- package/dist/filterData-B8ocT57s.js +14 -0
- package/dist/filterData-B8ocT57s.js.map +1 -0
- package/dist/filterData-DN6py7y_.cjs +2 -0
- package/dist/filterData-DN6py7y_.cjs.map +1 -0
- package/dist/generateCodes.d.ts +25 -0
- package/dist/generateCodes.js +2 -0
- package/dist/generateCodes.js.map +1 -0
- package/dist/generateRandomString-B5zBiJzS.cjs +2 -0
- package/dist/generateRandomString-B5zBiJzS.cjs.map +1 -0
- package/dist/generateRandomString-za3IQGfQ.js +11 -0
- package/dist/generateRandomString-za3IQGfQ.js.map +1 -0
- package/dist/getJenks.d.ts +17 -0
- package/dist/getJenks.js +2 -0
- package/dist/getJenks.js.map +1 -0
- package/dist/getPercentileValue.d.ts +13 -0
- package/dist/getPercentileValue.js +2 -0
- package/dist/getPercentileValue.js.map +1 -0
- package/dist/getQueryParamsFromLink.d.ts +18 -0
- package/dist/getQueryParamsFromLink.js +2 -0
- package/dist/getQueryParamsFromLink.js.map +1 -0
- package/dist/getSchema.d.ts +3256 -0
- package/dist/getSchema.js +2 -0
- package/dist/getSchema.js.map +1 -0
- package/dist/getSliderMarks-CWajGCGq.js +719 -0
- package/dist/getSliderMarks-CWajGCGq.js.map +1 -0
- package/dist/getSliderMarks-DDJ1CdhL.cjs +6 -0
- package/dist/getSliderMarks-DDJ1CdhL.cjs.map +1 -0
- package/dist/getTextColorBasedOnBgColor.d.ts +13 -0
- package/dist/getTextColorBasedOnBgColor.js +2 -0
- package/dist/getTextColorBasedOnBgColor.js.map +1 -0
- package/dist/getUniqValue.d.ts +18 -0
- package/dist/getUniqValue.js +2 -0
- package/dist/getUniqValue.js.map +1 -0
- package/dist/graphList.d.ts +9 -0
- package/dist/graphList.js +2 -0
- package/dist/graphList.js.map +1 -0
- package/dist/imageDownload.d.ts +16 -0
- package/dist/imageDownload.js +3 -0
- package/dist/imageDownload.js.map +1 -0
- package/dist/index-01r5X3Gr-9jE0ObrK.cjs +2 -0
- package/dist/index-01r5X3Gr-9jE0ObrK.cjs.map +1 -0
- package/dist/index-01r5X3Gr-kH7FxQ7P.js +451 -0
- package/dist/index-01r5X3Gr-kH7FxQ7P.js.map +1 -0
- package/dist/index-27yTRcko.js +35 -0
- package/dist/index-27yTRcko.js.map +1 -0
- package/dist/index-B0rbzOoC.cjs +2 -0
- package/dist/index-B0rbzOoC.cjs.map +1 -0
- package/dist/index-BGMGC-HN.cjs +22 -0
- package/dist/index-BGMGC-HN.cjs.map +1 -0
- package/dist/index-BHm2KTjD-2e-Fu8L-.js +702 -0
- package/dist/index-BHm2KTjD-2e-Fu8L-.js.map +1 -0
- package/dist/index-BHm2KTjD-D8FylaKc.cjs +44 -0
- package/dist/index-BHm2KTjD-D8FylaKc.cjs.map +1 -0
- package/dist/index-BIPNFFja.js +506 -0
- package/dist/index-BIPNFFja.js.map +1 -0
- package/dist/index-BLizQDlg.js +658 -0
- package/dist/index-BLizQDlg.js.map +1 -0
- package/dist/index-BXns0-ng.cjs +2 -0
- package/dist/index-BXns0-ng.cjs.map +1 -0
- package/dist/index-BYroABPm.cjs +2 -0
- package/dist/index-BYroABPm.cjs.map +1 -0
- package/dist/index-BczVvEBZ.cjs +2 -0
- package/dist/index-BczVvEBZ.cjs.map +1 -0
- package/dist/index-BzeLQvXk.cjs +2 -0
- package/dist/index-BzeLQvXk.cjs.map +1 -0
- package/dist/index-C1rRk_50.js +273 -0
- package/dist/index-C1rRk_50.js.map +1 -0
- package/dist/index-C21TvELx.cjs +2 -0
- package/dist/index-C21TvELx.cjs.map +1 -0
- package/dist/index-CEc_9zWy.cjs +2 -0
- package/dist/index-CEc_9zWy.cjs.map +1 -0
- package/dist/index-CZbIGs8q.cjs +2 -0
- package/dist/index-CZbIGs8q.cjs.map +1 -0
- package/dist/index-CaAIPGZo.js +631 -0
- package/dist/index-CaAIPGZo.js.map +1 -0
- package/dist/index-CbVeVrla.cjs +2 -0
- package/dist/index-CbVeVrla.cjs.map +1 -0
- package/dist/index-CqzhBPuO-CfQywbdq.js +41 -0
- package/dist/index-CqzhBPuO-CfQywbdq.js.map +1 -0
- package/dist/index-CqzhBPuO-raKZqS7l.cjs +2 -0
- package/dist/index-CqzhBPuO-raKZqS7l.cjs.map +1 -0
- package/dist/index-D7ltPi18.js +26 -0
- package/dist/index-D7ltPi18.js.map +1 -0
- package/dist/index-DSnvdkHZ.js +495 -0
- package/dist/index-DSnvdkHZ.js.map +1 -0
- package/dist/index-DXmF_0ez.js +308 -0
- package/dist/index-DXmF_0ez.js.map +1 -0
- package/dist/index-Db-Yg_Ud.js +120 -0
- package/dist/index-Db-Yg_Ud.js.map +1 -0
- package/dist/index-Ds0uHjK9.cjs +2 -0
- package/dist/index-Ds0uHjK9.cjs.map +1 -0
- package/dist/index-DxagiOHo.js +707 -0
- package/dist/index-DxagiOHo.js.map +1 -0
- package/dist/index-DzdwZ2OA.js +77 -0
- package/dist/index-DzdwZ2OA.js.map +1 -0
- package/dist/index-UV9hjG_S.js +53 -0
- package/dist/index-UV9hjG_S.js.map +1 -0
- package/dist/index-a2C2Bqn2.cjs +10 -0
- package/dist/index-a2C2Bqn2.cjs.map +1 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +1 -52484
- package/dist/index.js.map +1 -1
- package/dist/init-BhZylTFx.js +63 -0
- package/dist/init-BhZylTFx.js.map +1 -0
- package/dist/init-DU0ybBc_.cjs +2 -0
- package/dist/init-DU0ybBc_.cjs.map +1 -0
- package/dist/line-CPfhohvF.js +68 -0
- package/dist/line-CPfhohvF.js.map +1 -0
- package/dist/line-DHV4JwCR.cjs +2 -0
- package/dist/line-DHV4JwCR.cjs.map +1 -0
- package/dist/linear-BVckp9RD.cjs +2 -0
- package/dist/linear-BVckp9RD.cjs.map +1 -0
- package/dist/linear-DUdu7l2G.js +221 -0
- package/dist/linear-DUdu7l2G.js.map +1 -0
- package/dist/numberFormattingFunction.d.ts +22 -0
- package/dist/numberFormattingFunction.js +2 -0
- package/dist/numberFormattingFunction.js.map +1 -0
- package/dist/ordinal-BOeNbyae.cjs +2 -0
- package/dist/ordinal-BOeNbyae.cjs.map +1 -0
- package/dist/ordinal-w9Lu4Stb.js +62 -0
- package/dist/ordinal-w9Lu4Stb.js.map +1 -0
- package/dist/parse-DlCRUFh_.js +2768 -0
- package/dist/parse-DlCRUFh_.js.map +1 -0
- package/dist/parse-hMnG_lRV.cjs +2 -0
- package/dist/parse-hMnG_lRV.cjs.map +1 -0
- package/dist/pointer-CWRWOsrb.js +23 -0
- package/dist/pointer-CWRWOsrb.js.map +1 -0
- package/dist/pointer-Dkq5NV1q.cjs +2 -0
- package/dist/pointer-Dkq5NV1q.cjs.map +1 -0
- package/dist/pow-B5-jkdHU.cjs +2 -0
- package/dist/pow-B5-jkdHU.cjs.map +1 -0
- package/dist/pow-e8zx3AQJ.js +35 -0
- package/dist/pow-e8zx3AQJ.js.map +1 -0
- package/dist/removeOutliers.d.ts +16 -0
- package/dist/removeOutliers.js +2 -0
- package/dist/removeOutliers.js.map +1 -0
- package/dist/select-Bnfk0lJx.cjs +2 -0
- package/dist/select-Bnfk0lJx.cjs.map +1 -0
- package/dist/select-DKy99ogv.js +584 -0
- package/dist/select-DKy99ogv.js.map +1 -0
- package/dist/simple-statistics-flVzqVtt.js +65 -0
- package/dist/simple-statistics-flVzqVtt.js.map +1 -0
- package/dist/simple-statistics-xm8c0LQQ.cjs +2 -0
- package/dist/simple-statistics-xm8c0LQQ.cjs.map +1 -0
- package/dist/step-BZ3C8QFW.cjs +2 -0
- package/dist/step-BZ3C8QFW.cjs.map +1 -0
- package/dist/step-BrDul-H4.js +119 -0
- package/dist/step-BrDul-H4.js.map +1 -0
- package/dist/string-B8KlVSPX.js +364 -0
- package/dist/string-B8KlVSPX.js.map +1 -0
- package/dist/string-CRoCZCYa.cjs +2 -0
- package/dist/string-CRoCZCYa.cjs.map +1 -0
- package/dist/string2HTML-BX0oNw83.js +758 -0
- package/dist/string2HTML-BX0oNw83.js.map +1 -0
- package/dist/string2HTML-X4ZYX5jI.cjs +3 -0
- package/dist/string2HTML-X4ZYX5jI.cjs.map +1 -0
- package/dist/style.css +1 -1
- package/dist/svgDownload.d.ts +16 -0
- package/dist/svgDownload.js +2 -0
- package/dist/svgDownload.js.map +1 -0
- package/dist/threshold-DFfqcDMa.js +23 -0
- package/dist/threshold-DFfqcDMa.js.map +1 -0
- package/dist/threshold-DNsSUf8Q.cjs +2 -0
- package/dist/threshold-DNsSUf8Q.cjs.map +1 -0
- package/dist/time-Byw_jYQ7.cjs +2 -0
- package/dist/time-Byw_jYQ7.cjs.map +1 -0
- package/dist/time-BzJP5SPC.js +715 -0
- package/dist/time-BzJP5SPC.js.map +1 -0
- package/dist/timer-B39XOBYL.js +124 -0
- package/dist/timer-B39XOBYL.js.map +1 -0
- package/dist/timer-CKyBCVzT.cjs +2 -0
- package/dist/timer-CKyBCVzT.cjs.map +1 -0
- package/dist/toConsumableArray-BSMMWi3w-Cu4vcE-m.js +139 -0
- package/dist/toConsumableArray-BSMMWi3w-Cu4vcE-m.js.map +1 -0
- package/dist/toConsumableArray-BSMMWi3w-DJL7-zAp.cjs +4 -0
- package/dist/toConsumableArray-BSMMWi3w-DJL7-zAp.cjs.map +1 -0
- package/dist/transformColumnsToArray.d.ts +38 -0
- package/dist/transformColumnsToArray.js +2 -0
- package/dist/transformColumnsToArray.js.map +1 -0
- package/dist/transformDataForAggregation.d.ts +38 -0
- package/dist/transformDataForAggregation.js +2 -0
- package/dist/transformDataForAggregation.js.map +1 -0
- package/dist/transformDataForGraph.d.ts +47 -0
- package/dist/transformDataForGraph.js +2 -0
- package/dist/transformDataForGraph.js.map +1 -0
- package/dist/transformDataForGraphFromFile.d.ts +66 -0
- package/dist/transformDataForGraphFromFile.js +2 -0
- package/dist/transformDataForGraphFromFile.js.map +1 -0
- package/dist/use-in-view-CZPXmTZM.js +4645 -0
- package/dist/use-in-view-CZPXmTZM.js.map +1 -0
- package/dist/use-in-view-Dl1CsAIo.cjs +2 -0
- package/dist/use-in-view-Dl1CsAIo.cjs.map +1 -0
- package/dist/validateSchema.d.ts +68 -0
- package/dist/validateSchema.js +2 -0
- package/dist/validateSchema.js.map +1 -0
- package/dist/x-Dft9NVe_-DcB7wtv5.js +61 -0
- package/dist/x-Dft9NVe_-DcB7wtv5.js.map +1 -0
- package/dist/x-Dft9NVe_-LeyJu02C.cjs +27 -0
- package/dist/x-Dft9NVe_-LeyJu02C.cjs.map +1 -0
- package/dist/y-D0sAaVii.js +421 -0
- package/dist/y-D0sAaVii.js.map +1 -0
- package/dist/y-QcCbqrzx.cjs +2 -0
- package/dist/y-QcCbqrzx.cjs.map +1 -0
- package/dist/zoom-Lo7IAUfC.cjs +2 -0
- package/dist/zoom-Lo7IAUfC.cjs.map +1 -0
- package/dist/zoom-_lqdiGoI.js +1983 -0
- package/dist/zoom-_lqdiGoI.js.map +1 -0
- package/package.json +415 -4
- package/dist/index.cjs +0 -68
- package/dist/index.cjs.map +0 -1
package/dist/index.cjs
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";var _w=Object.create;var jd=Object.defineProperty;var Ow=Object.getOwnPropertyDescriptor;var Nw=Object.getOwnPropertyNames;var Iw=Object.getPrototypeOf,$w=Object.prototype.hasOwnProperty;var Lw=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Nw(e))!$w.call(t,r)&&r!==n&&jd(t,r,{get:()=>e[r],enumerable:!(i=Ow(e,r))||i.enumerable});return t};var Fc=(t,e,n)=>(n=t!=null?_w(Iw(t)):{},Lw(e||!t||!t.__esModule?jd(n,"default",{value:t,enumerable:!0}):n,t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),Ce=require("@undp/design-system-react"),Pw=require("react-dom"),Qi=require("handlebars"),Ew=require("math-expression-evaluator"),Rc=require("marked"),Vw=require("react-globe.gl"),Fw=require("three"),hi=require("maplibre-gl"),Rw=require("pmtiles"),ps=require("@dnd-kit/core"),Bw=require("@dnd-kit/modifiers"),Hw=require("file-saver"),Ww=require("xlsx"),zw=require("dom-to-svg");function Us(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const Bh=Us(k),Gw=Us(Fw),Oa=Us(hi),Sc=Us(Rw),Bc=Us(Ww);var Ot=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var cl={exports:{}},ns={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Ad;function Yw(){if(Ad)return ns;Ad=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(i,r,a){var o=null;if(a!==void 0&&(o=""+a),r.key!==void 0&&(o=""+r.key),"key"in r){a={};for(var s in r)s!=="key"&&(a[s]=r[s])}else a=r;return r=a.ref,{$$typeof:t,type:i,key:o,ref:r!==void 0?r:null,props:a}}return ns.Fragment=e,ns.jsx=n,ns.jsxs=n,ns}var is={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var _d;function qw(){return _d||(_d=1,process.env.NODE_ENV!=="production"&&function(){function t(C){if(C==null)return null;if(typeof C=="function")return C.$$typeof===$?null:C.displayName||C.name||null;if(typeof C=="string")return C;switch(C){case y:return"Fragment";case m:return"Profiler";case v:return"StrictMode";case S:return"Suspense";case P:return"SuspenseList";case x:return"Activity"}if(typeof C=="object")switch(typeof C.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),C.$$typeof){case p:return"Portal";case j:return(C.displayName||"Context")+".Provider";case I:return(C._context.displayName||"Context")+".Consumer";case w:var A=C.render;return C=C.displayName,C||(C=A.displayName||A.name||"",C=C!==""?"ForwardRef("+C+")":"ForwardRef"),C;case W:return A=C.displayName||null,A!==null?A:t(C.type)||"Memo";case D:A=C._payload,C=C._init;try{return t(C(A))}catch{}}return null}function e(C){return""+C}function n(C){try{e(C);var A=!1}catch{A=!0}if(A){A=console;var M=A.error,O=typeof Symbol=="function"&&Symbol.toStringTag&&C[Symbol.toStringTag]||C.constructor.name||"Object";return M.call(A,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",O),e(C)}}function i(C){if(C===y)return"<>";if(typeof C=="object"&&C!==null&&C.$$typeof===D)return"<...>";try{var A=t(C);return A?"<"+A+">":"<...>"}catch{return"<...>"}}function r(){var C=V.A;return C===null?null:C.getOwner()}function a(){return Error("react-stack-top-frame")}function o(C){if(q.call(C,"key")){var A=Object.getOwnPropertyDescriptor(C,"key").get;if(A&&A.isReactWarning)return!1}return C.key!==void 0}function s(C,A){function M(){_||(_=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",A))}M.isReactWarning=!0,Object.defineProperty(C,"key",{get:M,configurable:!0})}function c(){var C=t(this.type);return b[C]||(b[C]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),C=this.props.ref,C!==void 0?C:null}function u(C,A,M,O,K,Q,se,T){return M=Q.ref,C={$$typeof:g,type:C,key:A,props:Q,_owner:K},(M!==void 0?M:null)!==null?Object.defineProperty(C,"ref",{enumerable:!1,get:c}):Object.defineProperty(C,"ref",{enumerable:!1,value:null}),C._store={},Object.defineProperty(C._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(C,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(C,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:se}),Object.defineProperty(C,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:T}),Object.freeze&&(Object.freeze(C.props),Object.freeze(C)),C}function h(C,A,M,O,K,Q,se,T){var Z=A.children;if(Z!==void 0)if(O)if(ae(Z)){for(O=0;O<Z.length;O++)f(Z[O]);Object.freeze&&Object.freeze(Z)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else f(Z);if(q.call(A,"key")){Z=t(C);var ie=Object.keys(A).filter(function(he){return he!=="key"});O=0<ie.length?"{key: someKey, "+ie.join(": ..., ")+": ...}":"{key: someKey}",z[Z+O]||(ie=0<ie.length?"{"+ie.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
-
let props = %s;
|
|
19
|
-
<%s {...props} />
|
|
20
|
-
React keys must be passed directly to JSX without using spread:
|
|
21
|
-
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,O,Z,ie,Z),z[Z+O]=!0)}if(Z=null,M!==void 0&&(n(M),Z=""+M),o(A)&&(n(A.key),Z=""+A.key),"key"in A){M={};for(var ue in A)ue!=="key"&&(M[ue]=A[ue])}else M=A;return Z&&s(M,typeof C=="function"?C.displayName||C.name||"Unknown":C),u(C,Z,Q,K,r(),M,se,T)}function f(C){typeof C=="object"&&C!==null&&C.$$typeof===g&&C._store&&(C._store.validated=1)}var d=k,g=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),j=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),$=Symbol.for("react.client.reference"),V=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=Object.prototype.hasOwnProperty,ae=Array.isArray,G=console.createTask?console.createTask:function(){return null};d={react_stack_bottom_frame:function(C){return C()}};var _,b={},B=d.react_stack_bottom_frame.bind(d,a)(),X=G(i(a)),z={};is.Fragment=y,is.jsx=function(C,A,M,O,K){var Q=1e4>V.recentlyCreatedOwnerStacks++;return h(C,A,M,!1,O,K,Q?Error("react-stack-top-frame"):B,Q?G(i(C)):X)},is.jsxs=function(C,A,M,O,K){var Q=1e4>V.recentlyCreatedOwnerStacks++;return h(C,A,M,!0,O,K,Q?Error("react-stack-top-frame"):B,Q?G(i(C)):X)}}()),is}var Od;function Uw(){return Od||(Od=1,process.env.NODE_ENV==="production"?cl.exports=Yw():cl.exports=qw()),cl.exports}var l=Uw(),ms={exports:{}};ms.exports;var Nd;function Xw(){return Nd||(Nd=1,function(t,e){var n=200,i="Expected a function",r="__lodash_hash_undefined__",a=1,o=2,s=1/0,c=9007199254740991,u="[object Arguments]",h="[object Array]",f="[object Boolean]",d="[object Date]",g="[object Error]",p="[object Function]",y="[object GeneratorFunction]",v="[object Map]",m="[object Number]",I="[object Object]",j="[object Promise]",w="[object RegExp]",S="[object Set]",P="[object String]",W="[object Symbol]",D="[object WeakMap]",x="[object ArrayBuffer]",$="[object DataView]",V="[object Float32Array]",q="[object Float64Array]",ae="[object Int8Array]",G="[object Int16Array]",_="[object Int32Array]",b="[object Uint8Array]",B="[object Uint8ClampedArray]",X="[object Uint16Array]",z="[object Uint32Array]",C=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,A=/^\w*$/,M=/^\./,O=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,K=/[\\^$.*+?()[\]{}|]/g,Q=/\\(\\)?/g,se=/^\[object .+?Constructor\]$/,T=/^(?:0|[1-9]\d*)$/,Z={};Z[V]=Z[q]=Z[ae]=Z[G]=Z[_]=Z[b]=Z[B]=Z[X]=Z[z]=!0,Z[u]=Z[h]=Z[x]=Z[f]=Z[$]=Z[d]=Z[g]=Z[p]=Z[v]=Z[m]=Z[I]=Z[w]=Z[S]=Z[P]=Z[D]=!1;var ie=typeof Ot=="object"&&Ot&&Ot.Object===Object&&Ot,ue=typeof self=="object"&&self&&self.Object===Object&&self,he=ie||ue||Function("return this")(),Y=e&&!e.nodeType&&e,ge=Y&&!0&&t&&!t.nodeType&&t,oe=ge&&ge.exports===Y,ce=oe&&ie.process,N=function(){try{return ce&&ce.binding("util")}catch{}}(),U=N&&N.isTypedArray;function ve(L,pe){var E=L?L.length:0;return!!E&&le(L,pe,0)>-1}function J(L,pe){for(var E=-1,fe=L?L.length:0;++E<fe;)if(pe(L[E],E,L))return!0;return!1}function R(L,pe,E,fe){for(var Te=L.length,Ne=E+-1;++Ne<Te;)if(pe(L[Ne],Ne,L))return Ne;return-1}function le(L,pe,E){if(pe!==pe)return R(L,ee,E);for(var fe=E-1,Te=L.length;++fe<Te;)if(L[fe]===pe)return fe;return-1}function ee(L){return L!==L}function de(L){return function(pe){return pe?.[L]}}function te(L,pe){for(var E=-1,fe=Array(L);++E<L;)fe[E]=pe(E);return fe}function Me(L){return function(pe){return L(pe)}}function be(L,pe){return L.has(pe)}function ne(L,pe){return L?.[pe]}function De(L){var pe=!1;if(L!=null&&typeof L.toString!="function")try{pe=!!(L+"")}catch{}return pe}function xe(L){var pe=-1,E=Array(L.size);return L.forEach(function(fe,Te){E[++pe]=[Te,fe]}),E}function Ae(L,pe){return function(E){return L(pe(E))}}function ke(L){var pe=-1,E=Array(L.size);return L.forEach(function(fe){E[++pe]=fe}),E}var me=Array.prototype,Se=Function.prototype,Le=Object.prototype,F=he["__core-js_shared__"],Ie=function(){var L=/[^.]+$/.exec(F&&F.keys&&F.keys.IE_PROTO||"");return L?"Symbol(src)_1."+L:""}(),Ve=Se.toString,H=Le.hasOwnProperty,Oe=Le.toString,Ee=RegExp("^"+Ve.call(H).replace(K,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),it=he.Symbol,Tt=he.Uint8Array,sn=Le.propertyIsEnumerable,vn=me.splice,ln=Ae(Object.keys,Object),Ut=pn(he,"DataView"),jt=pn(he,"Map"),gn=pn(he,"Promise"),Xt=pn(he,"Set"),Hn=pn(he,"WeakMap"),Tn=pn(Object,"create"),zi=Kt(Ut),xi=Kt(jt),Gi=Kt(gn),Wn=Kt(Xt),ai=Kt(Hn),oi=it?it.prototype:void 0,Ni=oi?oi.valueOf:void 0,or=oi?oi.toString:void 0;function nn(L){var pe=-1,E=L?L.length:0;for(this.clear();++pe<E;){var fe=L[pe];this.set(fe[0],fe[1])}}function kn(){this.__data__=Tn?Tn(null):{}}function jn(L){return this.has(L)&&delete this.__data__[L]}function na(L){var pe=this.__data__;if(Tn){var E=pe[L];return E===r?void 0:E}return H.call(pe,L)?pe[L]:void 0}function ia(L){var pe=this.__data__;return Tn?pe[L]!==void 0:H.call(pe,L)}function ra(L,pe){var E=this.__data__;return E[L]=Tn&&pe===void 0?r:pe,this}nn.prototype.clear=kn,nn.prototype.delete=jn,nn.prototype.get=na,nn.prototype.has=ia,nn.prototype.set=ra;function It(L){var pe=-1,E=L?L.length:0;for(this.clear();++pe<E;){var fe=L[pe];this.set(fe[0],fe[1])}}function An(){this.__data__=[]}function _n(L){var pe=this.__data__,E=In(pe,L);if(E<0)return!1;var fe=pe.length-1;return E==fe?pe.pop():vn.call(pe,E,1),!0}function aa(L){var pe=this.__data__,E=In(pe,L);return E<0?void 0:pe[E][1]}function oa(L){return In(this.__data__,L)>-1}function sa(L,pe){var E=this.__data__,fe=In(E,L);return fe<0?E.push([L,pe]):E[fe][1]=pe,this}It.prototype.clear=An,It.prototype.delete=_n,It.prototype.get=aa,It.prototype.has=oa,It.prototype.set=sa;function $t(L){var pe=-1,E=L?L.length:0;for(this.clear();++pe<E;){var fe=L[pe];this.set(fe[0],fe[1])}}function Yi(){this.__data__={hash:new nn,map:new(jt||It),string:new nn}}function qi(L){return Gn(this,L).delete(L)}function la(L){return Gn(this,L).get(L)}function On(L){return Gn(this,L).has(L)}function Nn(L,pe){return Gn(this,L).set(L,pe),this}$t.prototype.clear=Yi,$t.prototype.delete=qi,$t.prototype.get=la,$t.prototype.has=On,$t.prototype.set=Nn;function zn(L){var pe=-1,E=L?L.length:0;for(this.__data__=new $t;++pe<E;)this.add(L[pe])}function ca(L){return this.__data__.set(L,r),this}function ua(L){return this.__data__.has(L)}zn.prototype.add=zn.prototype.push=ca,zn.prototype.has=ua;function Lt(L){this.__data__=new It(L)}function ha(){this.__data__=new It}function Ui(L){return this.__data__.delete(L)}function Xi(L){return this.__data__.get(L)}function fa(L){return this.__data__.has(L)}function da(L,pe){var E=this.__data__;if(E instanceof It){var fe=E.__data__;if(!jt||fe.length<n-1)return fe.push([L,pe]),this;E=this.__data__=new $t(fe)}return E.set(L,pe),this}Lt.prototype.clear=ha,Lt.prototype.delete=Ui,Lt.prototype.get=Xi,Lt.prototype.has=fa,Lt.prototype.set=da;function ga(L,pe){var E=Rt(L)||dr(L)?te(L.length,String):[],fe=E.length,Te=!!fe;for(var Ne in L)H.call(L,Ne)&&!(Te&&(Ne=="length"||Yn(Ne,fe)))&&E.push(Ne);return E}function In(L,pe){for(var E=L.length;E--;)if(cn(L[E][0],pe))return E;return-1}function Lr(L,pe){pe=zt(pe,L)?[pe]:cr(pe);for(var E=0,fe=pe.length;L!=null&&E<fe;)L=L[Xn(pe[E++])];return E&&E==fe?L:void 0}function pa(L){return Oe.call(L)}function Ii(L,pe){return L!=null&&pe in Object(L)}function sr(L,pe,E,fe,Te){return L===pe?!0:L==null||pe==null||!wn(L)&&!Qt(pe)?L!==L&&pe!==pe:Pr(L,pe,sr,E,fe,Te)}function Pr(L,pe,E,fe,Te,Ne){var Be=Rt(L),Re=Rt(pe),Ge=h,Ue=h;Be||(Ge=At(L),Ge=Ge==u?I:Ge),Re||(Ue=At(pe),Ue=Ue==u?I:Ue);var re=Ge==I&&!De(L),we=Ue==I&&!De(pe),_e=Ge==Ue;if(_e&&!re)return Ne||(Ne=new Lt),Be||vi(L)?ur(L,pe,E,fe,Te,Ne):Ma(L,pe,Ge,E,fe,Te,Ne);if(!(Te&o)){var Fe=re&&H.call(L,"__wrapped__"),We=we&&H.call(pe,"__wrapped__");if(Fe||We){var He=Fe?L.value():L,Ye=We?pe.value():pe;return Ne||(Ne=new Lt),E(He,Ye,fe,Te,Ne)}}return _e?(Ne||(Ne=new Lt),Ta(L,pe,E,fe,Te,Ne)):!1}function ma(L,pe,E,fe){var Te=E.length,Ne=Te;if(L==null)return!Ne;for(L=Object(L);Te--;){var Be=E[Te];if(Be[2]?Be[1]!==L[Be[0]]:!(Be[0]in L))return!1}for(;++Te<Ne;){Be=E[Te];var Re=Be[0],Ge=L[Re],Ue=Be[1];if(Be[2]){if(Ge===void 0&&!(Re in L))return!1}else{var re=new Lt,we;if(!(we===void 0?sr(Ue,Ge,fe,a|o,re):we))return!1}}return!0}function ya(L){if(!wn(L)||Fr(L))return!1;var pe=un(L)||De(L)?Ee:se;return pe.test(Kt(L))}function lr(L){return Qt(L)&&Kn(L.length)&&!!Z[Oe.call(L)]}function xa(L){return typeof L=="function"?L:L==null?Aa:typeof L=="object"?Rt(L)?ba(L[0],L[1]):wa(L):ye(L)}function va(L){if(!si(L))return ln(L);var pe=[];for(var E in Object(L))H.call(L,E)&&E!="constructor"&&pe.push(E);return pe}function wa(L){var pe=Vr(L);return pe.length==1&&pe[0][2]?qn(pe[0][0],pe[0][1]):function(E){return E===L||ma(E,L,pe)}}function ba(L,pe){return zt(L)&&hr(pe)?qn(Xn(L),pe):function(E){var fe=ci(E,L);return fe===void 0&&fe===pe?Qn(E,L):sr(pe,fe,void 0,a|o)}}function Ca(L){return function(pe){return Lr(pe,L)}}function Er(L){if(typeof L=="string")return L;if(li(L))return or?or.call(L):"";var pe=L+"";return pe=="0"&&1/L==-s?"-0":pe}function Sa(L,pe,E){var fe=-1,Te=ve,Ne=L.length,Be=!0,Re=[],Ge=Re;if(Ne>=n){var Ue=pe?null:Da(L);if(Ue)return ke(Ue);Be=!1,Te=be,Ge=new zn}else Ge=pe?[]:Re;e:for(;++fe<Ne;){var re=L[fe],we=pe?pe(re):re;if(re=re!==0?re:0,Be&&we===we){for(var _e=Ge.length;_e--;)if(Ge[_e]===we)continue e;pe&&Ge.push(we),Re.push(re)}else Te(Ge,we,E)||(Ge!==Re&&Ge.push(we),Re.push(re))}return Re}function cr(L){return Rt(L)?L:Un(L)}var Da=Xt&&1/ke(new Xt([,-0]))[1]==s?function(L){return new Xt(L)}:Rr;function ur(L,pe,E,fe,Te,Ne){var Be=Te&o,Re=L.length,Ge=pe.length;if(Re!=Ge&&!(Be&&Ge>Re))return!1;var Ue=Ne.get(L);if(Ue&&Ne.get(pe))return Ue==pe;var re=-1,we=!0,_e=Te&a?new zn:void 0;for(Ne.set(L,pe),Ne.set(pe,L);++re<Re;){var Fe=L[re],We=pe[re];if(fe)var He=Be?fe(We,Fe,re,pe,L,Ne):fe(Fe,We,re,L,pe,Ne);if(He!==void 0){if(He)continue;we=!1;break}if(_e){if(!J(pe,function(Ye,Ze){if(!_e.has(Ze)&&(Fe===Ye||E(Fe,Ye,fe,Te,Ne)))return _e.add(Ze)})){we=!1;break}}else if(!(Fe===We||E(Fe,We,fe,Te,Ne))){we=!1;break}}return Ne.delete(L),Ne.delete(pe),we}function Ma(L,pe,E,fe,Te,Ne,Be){switch(E){case $:if(L.byteLength!=pe.byteLength||L.byteOffset!=pe.byteOffset)return!1;L=L.buffer,pe=pe.buffer;case x:return!(L.byteLength!=pe.byteLength||!fe(new Tt(L),new Tt(pe)));case f:case d:case m:return cn(+L,+pe);case g:return L.name==pe.name&&L.message==pe.message;case w:case P:return L==pe+"";case v:var Re=xe;case S:var Ge=Ne&o;if(Re||(Re=ke),L.size!=pe.size&&!Ge)return!1;var Ue=Be.get(L);if(Ue)return Ue==pe;Ne|=a,Be.set(L,pe);var re=ur(Re(L),Re(pe),fe,Te,Ne,Be);return Be.delete(L),re;case W:if(Ni)return Ni.call(L)==Ni.call(pe)}return!1}function Ta(L,pe,E,fe,Te,Ne){var Be=Te&o,Re=bn(L),Ge=Re.length,Ue=bn(pe),re=Ue.length;if(Ge!=re&&!Be)return!1;for(var we=Ge;we--;){var _e=Re[we];if(!(Be?_e in pe:H.call(pe,_e)))return!1}var Fe=Ne.get(L);if(Fe&&Ne.get(pe))return Fe==pe;var We=!0;Ne.set(L,pe),Ne.set(pe,L);for(var He=Be;++we<Ge;){_e=Re[we];var Ye=L[_e],Ze=pe[_e];if(fe)var Ke=Be?fe(Ze,Ye,_e,pe,L,Ne):fe(Ye,Ze,_e,L,pe,Ne);if(!(Ke===void 0?Ye===Ze||E(Ye,Ze,fe,Te,Ne):Ke)){We=!1;break}He||(He=_e=="constructor")}if(We&&!He){var nt=L.constructor,Bt=pe.constructor;nt!=Bt&&"constructor"in L&&"constructor"in pe&&!(typeof nt=="function"&&nt instanceof nt&&typeof Bt=="function"&&Bt instanceof Bt)&&(We=!1)}return Ne.delete(L),Ne.delete(pe),We}function Gn(L,pe){var E=L.__data__;return ja(pe)?E[typeof pe=="string"?"string":"hash"]:E.map}function Vr(L){for(var pe=bn(L),E=pe.length;E--;){var fe=pe[E],Te=L[fe];pe[E]=[fe,Te,hr(Te)]}return pe}function pn(L,pe){var E=ne(L,pe);return ya(E)?E:void 0}var At=pa;(Ut&&At(new Ut(new ArrayBuffer(1)))!=$||jt&&At(new jt)!=v||gn&&At(gn.resolve())!=j||Xt&&At(new Xt)!=S||Hn&&At(new Hn)!=D)&&(At=function(L){var pe=Oe.call(L),E=pe==I?L.constructor:void 0,fe=E?Kt(E):void 0;if(fe)switch(fe){case zi:return $;case xi:return v;case Gi:return j;case Wn:return S;case ai:return D}return pe});function ka(L,pe,E){pe=zt(pe,L)?[pe]:cr(pe);for(var fe,Te=-1,Be=pe.length;++Te<Be;){var Ne=Xn(pe[Te]);if(!(fe=L!=null&&E(L,Ne)))break;L=L[Ne]}if(fe)return fe;var Be=L?L.length:0;return!!Be&&Kn(Be)&&Yn(Ne,Be)&&(Rt(L)||dr(L))}function Yn(L,pe){return pe=pe??c,!!pe&&(typeof L=="number"||T.test(L))&&L>-1&&L%1==0&&L<pe}function zt(L,pe){if(Rt(L))return!1;var E=typeof L;return E=="number"||E=="symbol"||E=="boolean"||L==null||li(L)?!0:A.test(L)||!C.test(L)||pe!=null&&L in Object(pe)}function ja(L){var pe=typeof L;return pe=="string"||pe=="number"||pe=="symbol"||pe=="boolean"?L!=="__proto__":L===null}function Fr(L){return!!Ie&&Ie in L}function si(L){var pe=L&&L.constructor,E=typeof pe=="function"&&pe.prototype||Le;return L===E}function hr(L){return L===L&&!wn(L)}function qn(L,pe){return function(E){return E==null?!1:E[L]===pe&&(pe!==void 0||L in Object(E))}}var Un=$n(function(L){L=wi(L);var pe=[];return M.test(L)&&pe.push(""),L.replace(O,function(E,fe,Te,Ne){pe.push(Te?Ne.replace(Q,"$1"):fe||E)}),pe});function Xn(L){if(typeof L=="string"||li(L))return L;var pe=L+"";return pe=="0"&&1/L==-s?"-0":pe}function Kt(L){if(L!=null){try{return Ve.call(L)}catch{}try{return L+""}catch{}}return""}function fr(L,pe){return L&&L.length?Sa(L,xa(pe)):[]}function $n(L,pe){if(typeof L!="function"||pe&&typeof pe!="function")throw new TypeError(i);var E=function(){var fe=arguments,Te=pe?pe.apply(this,fe):fe[0],Ne=E.cache;if(Ne.has(Te))return Ne.get(Te);var Be=L.apply(this,fe);return E.cache=Ne.set(Te,Be),Be};return E.cache=new($n.Cache||$t),E}$n.Cache=$t;function cn(L,pe){return L===pe||L!==L&&pe!==pe}function dr(L){return gr(L)&&H.call(L,"callee")&&(!sn.call(L,"callee")||Oe.call(L)==u)}var Rt=Array.isArray;function $i(L){return L!=null&&Kn(L.length)&&!un(L)}function gr(L){return Qt(L)&&$i(L)}function un(L){var pe=wn(L)?Oe.call(L):"";return pe==p||pe==y}function Kn(L){return typeof L=="number"&&L>-1&&L%1==0&&L<=c}function wn(L){var pe=typeof L;return!!L&&(pe=="object"||pe=="function")}function Qt(L){return!!L&&typeof L=="object"}function li(L){return typeof L=="symbol"||Qt(L)&&Oe.call(L)==W}var vi=U?Me(U):lr;function wi(L){return L==null?"":Er(L)}function ci(L,pe,E){var fe=L==null?void 0:Lr(L,pe);return fe===void 0?E:fe}function Qn(L,pe){return L!=null&&ka(L,pe,Ii)}function bn(L){return $i(L)?ga(L):va(L)}function Aa(L){return L}function Rr(){}function ye(L){return zt(L)?de(Xn(L)):Ca(L)}t.exports=fr}(ms,ms.exports)),ms.exports}var Kw=Xw();const Xe=rr(Kw);var ys={exports:{}};ys.exports;var Id;function Qw(){return Id||(Id=1,function(t,e){var n=200,i="Expected a function",r="__lodash_hash_undefined__",a=1,o=2,s=9007199254740991,c="[object Arguments]",u="[object Array]",h="[object Boolean]",f="[object Date]",d="[object Error]",g="[object Function]",p="[object GeneratorFunction]",y="[object Map]",v="[object Number]",m="[object Object]",I="[object Promise]",j="[object RegExp]",w="[object Set]",S="[object String]",P="[object Symbol]",W="[object WeakMap]",D="[object ArrayBuffer]",x="[object DataView]",$="[object Float32Array]",V="[object Float64Array]",q="[object Int8Array]",ae="[object Int16Array]",G="[object Int32Array]",_="[object Uint8Array]",b="[object Uint8ClampedArray]",B="[object Uint16Array]",X="[object Uint32Array]",z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,C=/^\w*$/,A=/^\./,M=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O=/[\\^$.*+?()[\]{}|]/g,K=/\\(\\)?/g,Q=/^\[object .+?Constructor\]$/,se=/^(?:0|[1-9]\d*)$/,T={};T[$]=T[V]=T[q]=T[ae]=T[G]=T[_]=T[b]=T[B]=T[X]=!0,T[c]=T[u]=T[D]=T[h]=T[x]=T[f]=T[d]=T[g]=T[y]=T[v]=T[m]=T[j]=T[w]=T[S]=T[W]=!1;var Z=typeof Ot=="object"&&Ot&&Ot.Object===Object&&Ot,ie=typeof self=="object"&&self&&self.Object===Object&&self,ue=Z||ie||Function("return this")(),he=e&&!e.nodeType&&e,Y=he&&!0&&t&&!t.nodeType&&t,ge=Y&&Y.exports===he,oe=ge&&Z.process,ce=function(){try{return oe&&oe.binding("util")}catch{}}(),N=ce&&ce.isTypedArray;function U(re,we,_e){switch(_e.length){case 0:return re.call(we);case 1:return re.call(we,_e[0]);case 2:return re.call(we,_e[0],_e[1]);case 3:return re.call(we,_e[0],_e[1],_e[2])}return re.apply(we,_e)}function ve(re,we){for(var _e=-1,Fe=re?re.length:0,We=Array(Fe);++_e<Fe;)We[_e]=we(re[_e],_e,re);return We}function J(re,we){for(var _e=-1,Fe=we.length,We=re.length;++_e<Fe;)re[We+_e]=we[_e];return re}function R(re,we){for(var _e=-1,Fe=re?re.length:0;++_e<Fe;)if(we(re[_e],_e,re))return!0;return!1}function le(re){return function(we){return we?.[re]}}function ee(re,we){var _e=re.length;for(re.sort(we);_e--;)re[_e]=re[_e].value;return re}function de(re,we){for(var _e=-1,Fe=Array(re);++_e<re;)Fe[_e]=we(_e);return Fe}function te(re){return function(we){return re(we)}}function Me(re,we){return re?.[we]}function be(re){var we=!1;if(re!=null&&typeof re.toString!="function")try{we=!!(re+"")}catch{}return we}function ne(re){var we=-1,_e=Array(re.size);return re.forEach(function(Fe,We){_e[++we]=[We,Fe]}),_e}function De(re,we){return function(_e){return re(we(_e))}}function xe(re){var we=-1,_e=Array(re.size);return re.forEach(function(Fe){_e[++we]=Fe}),_e}var Ae=Array.prototype,ke=Function.prototype,me=Object.prototype,Se=ue["__core-js_shared__"],Le=function(){var re=/[^.]+$/.exec(Se&&Se.keys&&Se.keys.IE_PROTO||"");return re?"Symbol(src)_1."+re:""}(),F=ke.toString,Ie=me.hasOwnProperty,Ve=me.toString,H=RegExp("^"+F.call(Ie).replace(O,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Oe=ue.Symbol,Ee=ue.Uint8Array,it=me.propertyIsEnumerable,Tt=Ae.splice,sn=Oe?Oe.isConcatSpreadable:void 0,vn=De(Object.keys,Object),ln=Math.max,Ut=qn(ue,"DataView"),jt=qn(ue,"Map"),gn=qn(ue,"Promise"),Xt=qn(ue,"Set"),Hn=qn(ue,"WeakMap"),Tn=qn(Object,"create"),zi=Qt(Ut),xi=Qt(jt),Gi=Qt(gn),Wn=Qt(Xt),ai=Qt(Hn),oi=Oe?Oe.prototype:void 0,Ni=oi?oi.valueOf:void 0,or=oi?oi.toString:void 0;function nn(re){var we=-1,_e=re?re.length:0;for(this.clear();++we<_e;){var Fe=re[we];this.set(Fe[0],Fe[1])}}function kn(){this.__data__=Tn?Tn(null):{}}function jn(re){return this.has(re)&&delete this.__data__[re]}function na(re){var we=this.__data__;if(Tn){var _e=we[re];return _e===r?void 0:_e}return Ie.call(we,re)?we[re]:void 0}function ia(re){var we=this.__data__;return Tn?we[re]!==void 0:Ie.call(we,re)}function ra(re,we){var _e=this.__data__;return _e[re]=Tn&&we===void 0?r:we,this}nn.prototype.clear=kn,nn.prototype.delete=jn,nn.prototype.get=na,nn.prototype.has=ia,nn.prototype.set=ra;function It(re){var we=-1,_e=re?re.length:0;for(this.clear();++we<_e;){var Fe=re[we];this.set(Fe[0],Fe[1])}}function An(){this.__data__=[]}function _n(re){var we=this.__data__,_e=In(we,re);if(_e<0)return!1;var Fe=we.length-1;return _e==Fe?we.pop():Tt.call(we,_e,1),!0}function aa(re){var we=this.__data__,_e=In(we,re);return _e<0?void 0:we[_e][1]}function oa(re){return In(this.__data__,re)>-1}function sa(re,we){var _e=this.__data__,Fe=In(_e,re);return Fe<0?_e.push([re,we]):_e[Fe][1]=we,this}It.prototype.clear=An,It.prototype.delete=_n,It.prototype.get=aa,It.prototype.has=oa,It.prototype.set=sa;function $t(re){var we=-1,_e=re?re.length:0;for(this.clear();++we<_e;){var Fe=re[we];this.set(Fe[0],Fe[1])}}function Yi(){this.__data__={hash:new nn,map:new(jt||It),string:new nn}}function qi(re){return si(this,re).delete(re)}function la(re){return si(this,re).get(re)}function On(re){return si(this,re).has(re)}function Nn(re,we){return si(this,re).set(re,we),this}$t.prototype.clear=Yi,$t.prototype.delete=qi,$t.prototype.get=la,$t.prototype.has=On,$t.prototype.set=Nn;function zn(re){var we=-1,_e=re?re.length:0;for(this.__data__=new $t;++we<_e;)this.add(re[we])}function ca(re){return this.__data__.set(re,r),this}function ua(re){return this.__data__.has(re)}zn.prototype.add=zn.prototype.push=ca,zn.prototype.has=ua;function Lt(re){this.__data__=new It(re)}function ha(){this.__data__=new It}function Ui(re){return this.__data__.delete(re)}function Xi(re){return this.__data__.get(re)}function fa(re){return this.__data__.has(re)}function da(re,we){var _e=this.__data__;if(_e instanceof It){var Fe=_e.__data__;if(!jt||Fe.length<n-1)return Fe.push([re,we]),this;_e=this.__data__=new $t(Fe)}return _e.set(re,we),this}Lt.prototype.clear=ha,Lt.prototype.delete=Ui,Lt.prototype.get=Xi,Lt.prototype.has=fa,Lt.prototype.set=da;function ga(re,we){var _e=Qn(re)||ci(re)?de(re.length,String):[],Fe=_e.length,We=!!Fe;for(var He in re)Ie.call(re,He)&&!(We&&(He=="length"||fr(He,Fe)))&&_e.push(He);return _e}function In(re,we){for(var _e=re.length;_e--;)if(wi(re[_e][0],we))return _e;return-1}var Lr=ka(sr);function pa(re,we,_e,Fe,We){var He=-1,Ye=re.length;for(_e||(_e=Kt),We||(We=[]);++He<Ye;){var Ze=re[He];_e(Ze)?J(We,Ze):We[We.length]=Ze}return We}var Ii=Yn();function sr(re,we){return re&&Ii(re,we,Re)}function Pr(re,we){we=cn(we,re)?[we]:Vr(we);for(var _e=0,Fe=we.length;re!=null&&_e<Fe;)re=re[wn(we[_e++])];return _e&&_e==Fe?re:void 0}function ma(re){return Ve.call(re)}function ya(re,we){return re!=null&&we in Object(re)}function lr(re,we,_e,Fe,We){return re===we?!0:re==null||we==null||!L(re)&&!pe(we)?re!==re&&we!==we:xa(re,we,lr,_e,Fe,We)}function xa(re,we,_e,Fe,We,He){var Ye=Qn(re),Ze=Qn(we),Ke=u,nt=u;Ye||(Ke=Un(re),Ke=Ke==c?m:Ke),Ze||(nt=Un(we),nt=nt==c?m:nt);var Bt=Ke==m&&!be(re),rn=nt==m&&!be(we),Zt=Ke==nt;if(Zt&&!Bt)return He||(He=new Lt),Ye||fe(re)?zt(re,we,_e,Fe,We,He):ja(re,we,Ke,_e,Fe,We,He);if(!(We&o)){var bi=Bt&&Ie.call(re,"__wrapped__"),Ci=rn&&Ie.call(we,"__wrapped__");if(bi||Ci){var Br=bi?re.value():re,pr=Ci?we.value():we;return He||(He=new Lt),_e(Br,pr,Fe,We,He)}}return Zt?(He||(He=new Lt),Fr(re,we,_e,Fe,We,He)):!1}function va(re,we,_e,Fe){var We=_e.length,He=We;if(re==null)return!He;for(re=Object(re);We--;){var Ye=_e[We];if(Ye[2]?Ye[1]!==re[Ye[0]]:!(Ye[0]in re))return!1}for(;++We<He;){Ye=_e[We];var Ze=Ye[0],Ke=re[Ze],nt=Ye[1];if(Ye[2]){if(Ke===void 0&&!(Ze in re))return!1}else{var Bt=new Lt,rn;if(!(rn===void 0?lr(nt,Ke,Fe,a|o,Bt):rn))return!1}}return!0}function wa(re){if(!L(re)||Rt(re))return!1;var we=Rr(re)||be(re)?H:Q;return we.test(Qt(re))}function ba(re){return pe(re)&&ye(re.length)&&!!T[Ve.call(re)]}function Ca(re){return typeof re=="function"?re:re==null?Ge:typeof re=="object"?Qn(re)?Da(re[0],re[1]):cr(re):Ue(re)}function Er(re){if(!$i(re))return vn(re);var we=[];for(var _e in Object(re))Ie.call(re,_e)&&_e!="constructor"&&we.push(_e);return we}function Sa(re,we){var _e=-1,Fe=bn(re)?Array(re.length):[];return Lr(re,function(We,He,Ye){Fe[++_e]=we(We,He,Ye)}),Fe}function cr(re){var we=hr(re);return we.length==1&&we[0][2]?un(we[0][0],we[0][1]):function(_e){return _e===re||va(_e,re,we)}}function Da(re,we){return cn(re)&&gr(we)?un(wn(re),we):function(_e){var Fe=Ne(_e,re);return Fe===void 0&&Fe===we?Be(_e,re):lr(we,Fe,void 0,a|o)}}function ur(re,we,_e){var Fe=-1;we=ve(we.length?we:[Ge],te(Ca));var We=Sa(re,function(He,Ye,Ze){var Ke=ve(we,function(nt){return nt(He)});return{criteria:Ke,index:++Fe,value:He}});return ee(We,function(He,Ye){return At(He,Ye,_e)})}function Ma(re){return function(we){return Pr(we,re)}}function Ta(re,we){return we=ln(we===void 0?re.length-1:we,0),function(){for(var _e=arguments,Fe=-1,We=ln(_e.length-we,0),He=Array(We);++Fe<We;)He[Fe]=_e[we+Fe];Fe=-1;for(var Ye=Array(we+1);++Fe<we;)Ye[Fe]=_e[Fe];return Ye[we]=He,U(re,this,Ye)}}function Gn(re){if(typeof re=="string")return re;if(E(re))return or?or.call(re):"";var we=re+"";return we=="0"&&1/re==-1/0?"-0":we}function Vr(re){return Qn(re)?re:Kn(re)}function pn(re,we){if(re!==we){var _e=re!==void 0,Fe=re===null,We=re===re,He=E(re),Ye=we!==void 0,Ze=we===null,Ke=we===we,nt=E(we);if(!Ze&&!nt&&!He&&re>we||He&&Ye&&Ke&&!Ze&&!nt||Fe&&Ye&&Ke||!_e&&Ke||!We)return 1;if(!Fe&&!He&&!nt&&re<we||nt&&_e&&We&&!Fe&&!He||Ze&&_e&&We||!Ye&&We||!Ke)return-1}return 0}function At(re,we,_e){for(var Fe=-1,We=re.criteria,He=we.criteria,Ye=We.length,Ze=_e.length;++Fe<Ye;){var Ke=pn(We[Fe],He[Fe]);if(Ke){if(Fe>=Ze)return Ke;var nt=_e[Fe];return Ke*(nt=="desc"?-1:1)}}return re.index-we.index}function ka(re,we){return function(_e,Fe){if(_e==null)return _e;if(!bn(_e))return re(_e,Fe);for(var We=_e.length,He=-1,Ye=Object(_e);++He<We&&Fe(Ye[He],He,Ye)!==!1;);return _e}}function Yn(re){return function(we,_e,Fe){for(var We=-1,He=Object(we),Ye=Fe(we),Ze=Ye.length;Ze--;){var Ke=Ye[++We];if(_e(He[Ke],Ke,He)===!1)break}return we}}function zt(re,we,_e,Fe,We,He){var Ye=We&o,Ze=re.length,Ke=we.length;if(Ze!=Ke&&!(Ye&&Ke>Ze))return!1;var nt=He.get(re);if(nt&&He.get(we))return nt==we;var Bt=-1,rn=!0,Zt=We&a?new zn:void 0;for(He.set(re,we),He.set(we,re);++Bt<Ze;){var bi=re[Bt],Ci=we[Bt];if(Fe)var Br=Ye?Fe(Ci,bi,Bt,we,re,He):Fe(bi,Ci,Bt,re,we,He);if(Br!==void 0){if(Br)continue;rn=!1;break}if(Zt){if(!R(we,function(pr,_a){if(!Zt.has(_a)&&(bi===pr||_e(bi,pr,Fe,We,He)))return Zt.add(_a)})){rn=!1;break}}else if(!(bi===Ci||_e(bi,Ci,Fe,We,He))){rn=!1;break}}return He.delete(re),He.delete(we),rn}function ja(re,we,_e,Fe,We,He,Ye){switch(_e){case x:if(re.byteLength!=we.byteLength||re.byteOffset!=we.byteOffset)return!1;re=re.buffer,we=we.buffer;case D:return!(re.byteLength!=we.byteLength||!Fe(new Ee(re),new Ee(we)));case h:case f:case v:return wi(+re,+we);case d:return re.name==we.name&&re.message==we.message;case j:case S:return re==we+"";case y:var Ze=ne;case w:var Ke=He&o;if(Ze||(Ze=xe),re.size!=we.size&&!Ke)return!1;var nt=Ye.get(re);if(nt)return nt==we;He|=a,Ye.set(re,we);var Bt=zt(Ze(re),Ze(we),Fe,We,He,Ye);return Ye.delete(re),Bt;case P:if(Ni)return Ni.call(re)==Ni.call(we)}return!1}function Fr(re,we,_e,Fe,We,He){var Ye=We&o,Ze=Re(re),Ke=Ze.length,nt=Re(we),Bt=nt.length;if(Ke!=Bt&&!Ye)return!1;for(var rn=Ke;rn--;){var Zt=Ze[rn];if(!(Ye?Zt in we:Ie.call(we,Zt)))return!1}var bi=He.get(re);if(bi&&He.get(we))return bi==we;var Ci=!0;He.set(re,we),He.set(we,re);for(var Br=Ye;++rn<Ke;){Zt=Ze[rn];var pr=re[Zt],_a=we[Zt];if(Fe)var kd=Ye?Fe(_a,pr,Zt,we,re,He):Fe(pr,_a,Zt,re,we,He);if(!(kd===void 0?pr===_a||_e(pr,_a,Fe,We,He):kd)){Ci=!1;break}Br||(Br=Zt=="constructor")}if(Ci&&!Br){var sl=re.constructor,ll=we.constructor;sl!=ll&&"constructor"in re&&"constructor"in we&&!(typeof sl=="function"&&sl instanceof sl&&typeof ll=="function"&&ll instanceof ll)&&(Ci=!1)}return He.delete(re),He.delete(we),Ci}function si(re,we){var _e=re.__data__;return dr(we)?_e[typeof we=="string"?"string":"hash"]:_e.map}function hr(re){for(var we=Re(re),_e=we.length;_e--;){var Fe=we[_e],We=re[Fe];we[_e]=[Fe,We,gr(We)]}return we}function qn(re,we){var _e=Me(re,we);return wa(_e)?_e:void 0}var Un=ma;(Ut&&Un(new Ut(new ArrayBuffer(1)))!=x||jt&&Un(new jt)!=y||gn&&Un(gn.resolve())!=I||Xt&&Un(new Xt)!=w||Hn&&Un(new Hn)!=W)&&(Un=function(re){var we=Ve.call(re),_e=we==m?re.constructor:void 0,Fe=_e?Qt(_e):void 0;if(Fe)switch(Fe){case zi:return x;case xi:return y;case Gi:return I;case Wn:return w;case ai:return W}return we});function Xn(re,we,_e){we=cn(we,re)?[we]:Vr(we);for(var Fe,We=-1,Ye=we.length;++We<Ye;){var He=wn(we[We]);if(!(Fe=re!=null&&_e(re,He)))break;re=re[He]}if(Fe)return Fe;var Ye=re?re.length:0;return!!Ye&&ye(Ye)&&fr(He,Ye)&&(Qn(re)||ci(re))}function Kt(re){return Qn(re)||ci(re)||!!(sn&&re&&re[sn])}function fr(re,we){return we=we??s,!!we&&(typeof re=="number"||se.test(re))&&re>-1&&re%1==0&&re<we}function $n(re,we,_e){if(!L(_e))return!1;var Fe=typeof we;return(Fe=="number"?bn(_e)&&fr(we,_e.length):Fe=="string"&&we in _e)?wi(_e[we],re):!1}function cn(re,we){if(Qn(re))return!1;var _e=typeof re;return _e=="number"||_e=="symbol"||_e=="boolean"||re==null||E(re)?!0:C.test(re)||!z.test(re)||we!=null&&re in Object(we)}function dr(re){var we=typeof re;return we=="string"||we=="number"||we=="symbol"||we=="boolean"?re!=="__proto__":re===null}function Rt(re){return!!Le&&Le in re}function $i(re){var we=re&&re.constructor,_e=typeof we=="function"&&we.prototype||me;return re===_e}function gr(re){return re===re&&!L(re)}function un(re,we){return function(_e){return _e==null?!1:_e[re]===we&&(we!==void 0||re in Object(_e))}}var Kn=vi(function(re){re=Te(re);var we=[];return A.test(re)&&we.push(""),re.replace(M,function(_e,Fe,We,He){we.push(We?He.replace(K,"$1"):Fe||_e)}),we});function wn(re){if(typeof re=="string"||E(re))return re;var we=re+"";return we=="0"&&1/re==-1/0?"-0":we}function Qt(re){if(re!=null){try{return F.call(re)}catch{}try{return re+""}catch{}}return""}var li=Ta(function(re,we){if(re==null)return[];var _e=we.length;return _e>1&&$n(re,we[0],we[1])?we=[]:_e>2&&$n(we[0],we[1],we[2])&&(we=[we[0]]),ur(re,pa(we),[])});function vi(re,we){if(typeof re!="function"||we&&typeof we!="function")throw new TypeError(i);var _e=function(){var Fe=arguments,We=we?we.apply(this,Fe):Fe[0],He=_e.cache;if(He.has(We))return He.get(We);var Ye=re.apply(this,Fe);return _e.cache=He.set(We,Ye),Ye};return _e.cache=new(vi.Cache||$t),_e}vi.Cache=$t;function wi(re,we){return re===we||re!==re&&we!==we}function ci(re){return Aa(re)&&Ie.call(re,"callee")&&(!it.call(re,"callee")||Ve.call(re)==c)}var Qn=Array.isArray;function bn(re){return re!=null&&ye(re.length)&&!Rr(re)}function Aa(re){return pe(re)&&bn(re)}function Rr(re){var we=L(re)?Ve.call(re):"";return we==g||we==p}function ye(re){return typeof re=="number"&&re>-1&&re%1==0&&re<=s}function L(re){var we=typeof re;return!!re&&(we=="object"||we=="function")}function pe(re){return!!re&&typeof re=="object"}function E(re){return typeof re=="symbol"||pe(re)&&Ve.call(re)==P}var fe=N?te(N):ba;function Te(re){return re==null?"":Gn(re)}function Ne(re,we,_e){var Fe=re==null?void 0:Pr(re,we);return Fe===void 0?_e:Fe}function Be(re,we){return re!=null&&Xn(re,we,ya)}function Re(re){return bn(re)?ga(re):Er(re)}function Ge(re){return re}function Ue(re){return cn(re)?le(wn(re)):Ma(re)}t.exports=li}(ys,ys.exports)),ys.exports}var Zw=Qw();const tt=rr(Zw),Jw={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},eb=(t,e,n)=>{let i;const r=Jw[t];return typeof r=="string"?i=r:e===1?i=r.one:i=r.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function Hc(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const tb={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},nb={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ib={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},rb={date:Hc({formats:tb,defaultWidth:"full"}),time:Hc({formats:nb,defaultWidth:"full"}),dateTime:Hc({formats:ib,defaultWidth:"full"})},ab={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ob=(t,e,n,i)=>ab[t];function rs(t){return(e,n)=>{const i=n?.context?String(n.context):"standalone";let r;if(i==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,s=n?.width?String(n.width):o;r=t.formattingValues[s]||t.formattingValues[o]}else{const o=t.defaultWidth,s=n?.width?String(n.width):t.defaultWidth;r=t.values[s]||t.values[o]}const a=t.argumentCallback?t.argumentCallback(e):e;return r[a]}}const sb={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},cb={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ub={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},hb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},fb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},db=(t,e)=>{const n=Number(t),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},gb={ordinalNumber:db,era:rs({values:sb,defaultWidth:"wide"}),quarter:rs({values:lb,defaultWidth:"wide",argumentCallback:t=>t-1}),month:rs({values:cb,defaultWidth:"wide"}),day:rs({values:ub,defaultWidth:"wide"}),dayPeriod:rs({values:hb,defaultWidth:"wide",formattingValues:fb,defaultFormattingWidth:"wide"})};function as(t){return(e,n={})=>{const i=n.width,r=i&&t.matchPatterns[i]||t.matchPatterns[t.defaultMatchWidth],a=e.match(r);if(!a)return null;const o=a[0],s=i&&t.parsePatterns[i]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(s)?mb(s,f=>f.test(o)):pb(s,f=>f.test(o));let u;u=t.valueCallback?t.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const h=e.slice(o.length);return{value:u,rest:h}}}function pb(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function mb(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function yb(t){return(e,n={})=>{const i=e.match(t.matchPattern);if(!i)return null;const r=i[0],a=e.match(t.parsePattern);if(!a)return null;let o=t.valueCallback?t.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;const s=e.slice(r.length);return{value:o,rest:s}}}const xb=/^(\d+)(th|st|nd|rd)?/i,vb=/\d+/i,wb={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},bb={any:[/^b/i,/^(a|c)/i]},Cb={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Sb={any:[/1/i,/2/i,/3/i,/4/i]},Db={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Mb={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Tb={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},kb={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},jb={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ab={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_b={ordinalNumber:yb({matchPattern:xb,parsePattern:vb,valueCallback:t=>parseInt(t,10)}),era:as({matchPatterns:wb,defaultMatchWidth:"wide",parsePatterns:bb,defaultParseWidth:"any"}),quarter:as({matchPatterns:Cb,defaultMatchWidth:"wide",parsePatterns:Sb,defaultParseWidth:"any",valueCallback:t=>t+1}),month:as({matchPatterns:Db,defaultMatchWidth:"wide",parsePatterns:Mb,defaultParseWidth:"any"}),day:as({matchPatterns:Tb,defaultMatchWidth:"wide",parsePatterns:kb,defaultParseWidth:"any"}),dayPeriod:as({matchPatterns:jb,defaultMatchWidth:"any",parsePatterns:Ab,defaultParseWidth:"any"})},r0={code:"en-US",formatDistance:eb,formatLong:rb,formatRelative:ob,localize:gb,match:_b,options:{weekStartsOn:0,firstWeekContainsDate:1}};let Ob={};function Xo(){return Ob}const a0=6048e5,Nb=864e5,Ib=6e4,$b=36e5,Lb=1e3,$d=Symbol.for("constructDateFrom");function fn(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&$d in t?t[$d](e):t instanceof Date?new t.constructor(e):new Date(e)}function Jt(t,e){return fn(e||t,t)}function zl(t){const e=Jt(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function Pb(t,...e){const n=fn.bind(null,e.find(i=>typeof i=="object"));return e.map(n)}function Ld(t,e){const n=Jt(t,e?.in);return n.setHours(0,0,0,0),n}function Eb(t,e,n){const[i,r]=Pb(n?.in,t,e),a=Ld(i),o=Ld(r),s=+a-zl(a),c=+o-zl(o);return Math.round((s-c)/Nb)}function Vb(t,e){const n=Jt(t,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Fb(t,e){const n=Jt(t,e?.in);return Eb(n,Vb(n))+1}function Yr(t,e){const n=Xo(),i=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=Jt(t,e?.in),a=r.getDay(),o=(a<i?7:0)+a-i;return r.setDate(r.getDate()-o),r.setHours(0,0,0,0),r}function Io(t,e){return Yr(t,{...e,weekStartsOn:1})}function o0(t,e){const n=Jt(t,e?.in),i=n.getFullYear(),r=fn(n,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const a=Io(r),o=fn(n,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const s=Io(o);return n.getTime()>=a.getTime()?i+1:n.getTime()>=s.getTime()?i:i-1}function Rb(t,e){const n=o0(t,e),i=fn(t,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Io(i)}function s0(t,e){const n=Jt(t,e?.in),i=+Io(n)-+Rb(n);return Math.round(i/a0)+1}function Hh(t,e){const n=Jt(t,e?.in),i=n.getFullYear(),r=Xo(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=fn(e?.in||t,0);o.setFullYear(i+1,0,a),o.setHours(0,0,0,0);const s=Yr(o,e),c=fn(e?.in||t,0);c.setFullYear(i,0,a),c.setHours(0,0,0,0);const u=Yr(c,e);return+n>=+s?i+1:+n>=+u?i:i-1}function Bb(t,e){const n=Xo(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Hh(t,e),a=fn(e?.in||t,0);return a.setFullYear(r,0,i),a.setHours(0,0,0,0),Yr(a,e)}function l0(t,e){const n=Jt(t,e?.in),i=+Yr(n,e)-+Bb(n,e);return Math.round(i/a0)+1}function St(t,e){const n=t<0?"-":"",i=Math.abs(t).toString().padStart(e,"0");return n+i}const Hr={y(t,e){const n=t.getFullYear(),i=n>0?n:1-n;return St(e==="yy"?i%100:i,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):St(n+1,2)},d(t,e){return St(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return St(t.getHours()%12||12,e.length)},H(t,e){return St(t.getHours(),e.length)},m(t,e){return St(t.getMinutes(),e.length)},s(t,e){return St(t.getSeconds(),e.length)},S(t,e){const n=e.length,i=t.getMilliseconds(),r=Math.trunc(i*Math.pow(10,n-3));return St(r,e.length)}},ho={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Pd={G:function(t,e,n){const i=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const i=t.getFullYear(),r=i>0?i:1-i;return n.ordinalNumber(r,{unit:"year"})}return Hr.y(t,e)},Y:function(t,e,n,i){const r=Hh(t,i),a=r>0?r:1-r;if(e==="YY"){const o=a%100;return St(o,2)}return e==="Yo"?n.ordinalNumber(a,{unit:"year"}):St(a,e.length)},R:function(t,e){const n=o0(t);return St(n,e.length)},u:function(t,e){const n=t.getFullYear();return St(n,e.length)},Q:function(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return St(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return St(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,e,n){const i=t.getMonth();switch(e){case"M":case"MM":return Hr.M(t,e);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(t,e,n){const i=t.getMonth();switch(e){case"L":return String(i+1);case"LL":return St(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(t,e,n,i){const r=l0(t,i);return e==="wo"?n.ordinalNumber(r,{unit:"week"}):St(r,e.length)},I:function(t,e,n){const i=s0(t);return e==="Io"?n.ordinalNumber(i,{unit:"week"}):St(i,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Hr.d(t,e)},D:function(t,e,n){const i=Fb(t);return e==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):St(i,e.length)},E:function(t,e,n){const i=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(t,e,n,i){const r=t.getDay(),a=(r-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return St(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,n,i){const r=t.getDay(),a=(r-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return St(a,e.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,n){const i=t.getDay(),r=i===0?7:i;switch(e){case"i":return String(r);case"ii":return St(r,e.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(t,e,n){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){const i=t.getHours();let r;switch(i===12?r=ho.noon:i===0?r=ho.midnight:r=i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){const i=t.getHours();let r;switch(i>=17?r=ho.evening:i>=12?r=ho.afternoon:i>=4?r=ho.morning:r=ho.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let i=t.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Hr.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Hr.H(t,e)},K:function(t,e,n){const i=t.getHours()%12;return e==="Ko"?n.ordinalNumber(i,{unit:"hour"}):St(i,e.length)},k:function(t,e,n){let i=t.getHours();return i===0&&(i=24),e==="ko"?n.ordinalNumber(i,{unit:"hour"}):St(i,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Hr.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Hr.s(t,e)},S:function(t,e){return Hr.S(t,e)},X:function(t,e,n){const i=t.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return Vd(i);case"XXXX":case"XX":return La(i);case"XXXXX":case"XXX":default:return La(i,":")}},x:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"x":return Vd(i);case"xxxx":case"xx":return La(i);case"xxxxx":case"xxx":default:return La(i,":")}},O:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ed(i,":");case"OOOO":default:return"GMT"+La(i,":")}},z:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ed(i,":");case"zzzz":default:return"GMT"+La(i,":")}},t:function(t,e,n){const i=Math.trunc(+t/1e3);return St(i,e.length)},T:function(t,e,n){return St(+t,e.length)}};function Ed(t,e=""){const n=t>0?"-":"+",i=Math.abs(t),r=Math.trunc(i/60),a=i%60;return a===0?n+String(r):n+String(r)+e+St(a,2)}function Vd(t,e){return t%60===0?(t>0?"-":"+")+St(Math.abs(t)/60,2):La(t,e)}function La(t,e=""){const n=t>0?"-":"+",i=Math.abs(t),r=St(Math.trunc(i/60),2),a=St(i%60,2);return n+r+e+a}const Fd=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},c0=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Hb=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return Fd(t,e);let a;switch(i){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;case"PPPP":default:a=e.dateTime({width:"full"});break}return a.replace("{{date}}",Fd(i,e)).replace("{{time}}",c0(r,e))},Hu={p:c0,P:Hb},Wb=/^D+$/,zb=/^Y+$/,Gb=["D","DD","YY","YYYY"];function u0(t){return Wb.test(t)}function h0(t){return zb.test(t)}function Wu(t,e,n){const i=Yb(t,e,n);if(console.warn(i),Gb.includes(t))throw new RangeError(i)}function Yb(t,e,n){const i=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function qb(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Ub(t){return!(!qb(t)&&typeof t!="number"||isNaN(+Jt(t)))}const Xb=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Kb=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Qb=/^'([^]*?)'?$/,Zb=/''/g,Jb=/[a-zA-Z]/;function ft(t,e,n){const i=Xo(),r=i.locale??r0,a=i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=i.weekStartsOn??i.locale?.options?.weekStartsOn??0,s=Jt(t,n?.in);if(!Ub(s))throw new RangeError("Invalid time value");let c=e.match(Kb).map(h=>{const f=h[0];if(f==="p"||f==="P"){const d=Hu[f];return d(h,r.formatLong)}return h}).join("").match(Xb).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const f=h[0];if(f==="'")return{isToken:!1,value:e1(h)};if(Pd[f])return{isToken:!0,value:h};if(f.match(Jb))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:h}});r.localize.preprocessor&&(c=r.localize.preprocessor(s,c));const u={firstWeekContainsDate:a,weekStartsOn:o,locale:r};return c.map(h=>{if(!h.isToken)return h.value;const f=h.value;(h0(f)||u0(f))&&Wu(f,e,String(t));const d=Pd[f[0]];return d(s,f,r.localize,u)}).join("")}function e1(t){const e=t.match(Qb);return e?e[1].replace(Zb,"'"):t}function t1(){return Object.assign({},Xo())}function n1(t,e){const n=i1(e)?new e(0):fn(e,0);return n.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),n.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),n}function i1(t){return typeof t=="function"&&t.prototype?.constructor===t}const r1=10;class f0{subPriority=0;validate(e,n){return!0}}class a1 extends f0{constructor(e,n,i,r,a){super(),this.value=e,this.validateValue=n,this.setValue=i,this.priority=r,a&&(this.subPriority=a)}validate(e,n){return this.validateValue(e,this.value,n)}set(e,n,i){return this.setValue(e,n,this.value,i)}}class o1 extends f0{priority=r1;subPriority=-1;constructor(e,n){super(),this.context=e||(i=>fn(n,i))}set(e,n){return n.timestampIsSet?e:fn(e,n1(e,this.context))}}class yt{run(e,n,i,r){const a=this.parse(e,n,i,r);return a?{setter:new a1(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(e,n,i){return!0}}class s1 extends yt{priority=140;parse(e,n,i){switch(n){case"G":case"GG":case"GGG":return i.era(e,{width:"abbreviated"})||i.era(e,{width:"narrow"});case"GGGGG":return i.era(e,{width:"narrow"});case"GGGG":default:return i.era(e,{width:"wide"})||i.era(e,{width:"abbreviated"})||i.era(e,{width:"narrow"})}}set(e,n,i){return n.era=i,e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]}const Yt={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Zi={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function qt(t,e){return t&&{value:e(t.value),rest:t.rest}}function Et(t,e){const n=e.match(t);return n?{value:parseInt(n[0],10),rest:e.slice(n[0].length)}:null}function Ji(t,e){const n=e.match(t);if(!n)return null;if(n[0]==="Z")return{value:0,rest:e.slice(1)};const i=n[1]==="+"?1:-1,r=n[2]?parseInt(n[2],10):0,a=n[3]?parseInt(n[3],10):0,o=n[5]?parseInt(n[5],10):0;return{value:i*(r*$b+a*Ib+o*Lb),rest:e.slice(n[0].length)}}function d0(t){return Et(Yt.anyDigitsSigned,t)}function Wt(t,e){switch(t){case 1:return Et(Yt.singleDigit,e);case 2:return Et(Yt.twoDigits,e);case 3:return Et(Yt.threeDigits,e);case 4:return Et(Yt.fourDigits,e);default:return Et(new RegExp("^\\d{1,"+t+"}"),e)}}function Gl(t,e){switch(t){case 1:return Et(Yt.singleDigitSigned,e);case 2:return Et(Yt.twoDigitsSigned,e);case 3:return Et(Yt.threeDigitsSigned,e);case 4:return Et(Yt.fourDigitsSigned,e);default:return Et(new RegExp("^-?\\d{1,"+t+"}"),e)}}function Wh(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function g0(t,e){const n=e>0,i=n?e:1-e;let r;if(i<=50)r=t||100;else{const a=i+50,o=Math.trunc(a/100)*100,s=t>=a%100;r=t+o-(s?100:0)}return n?r:1-r}function p0(t){return t%400===0||t%4===0&&t%100!==0}class l1 extends yt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,n,i){const r=a=>({year:a,isTwoDigitYear:n==="yy"});switch(n){case"y":return qt(Wt(4,e),r);case"yo":return qt(i.ordinalNumber(e,{unit:"year"}),r);default:return qt(Wt(n.length,e),r)}}validate(e,n){return n.isTwoDigitYear||n.year>0}set(e,n,i){const r=e.getFullYear();if(i.isTwoDigitYear){const o=g0(i.year,r);return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}const a=!("era"in n)||n.era===1?i.year:1-i.year;return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}}class c1 extends yt{priority=130;parse(e,n,i){const r=a=>({year:a,isTwoDigitYear:n==="YY"});switch(n){case"Y":return qt(Wt(4,e),r);case"Yo":return qt(i.ordinalNumber(e,{unit:"year"}),r);default:return qt(Wt(n.length,e),r)}}validate(e,n){return n.isTwoDigitYear||n.year>0}set(e,n,i,r){const a=Hh(e,r);if(i.isTwoDigitYear){const s=g0(i.year,a);return e.setFullYear(s,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Yr(e,r)}const o=!("era"in n)||n.era===1?i.year:1-i.year;return e.setFullYear(o,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Yr(e,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class u1 extends yt{priority=130;parse(e,n){return Gl(n==="R"?4:n.length,e)}set(e,n,i){const r=fn(e,0);return r.setFullYear(i,0,4),r.setHours(0,0,0,0),Io(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class h1 extends yt{priority=130;parse(e,n){return Gl(n==="u"?4:n.length,e)}set(e,n,i){return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class f1 extends yt{priority=120;parse(e,n,i){switch(n){case"Q":case"QQ":return Wt(n.length,e);case"Qo":return i.ordinalNumber(e,{unit:"quarter"});case"QQQ":return i.quarter(e,{width:"abbreviated",context:"formatting"})||i.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(e,{width:"wide",context:"formatting"})||i.quarter(e,{width:"abbreviated",context:"formatting"})||i.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=1&&n<=4}set(e,n,i){return e.setMonth((i-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class d1 extends yt{priority=120;parse(e,n,i){switch(n){case"q":case"qq":return Wt(n.length,e);case"qo":return i.ordinalNumber(e,{unit:"quarter"});case"qqq":return i.quarter(e,{width:"abbreviated",context:"standalone"})||i.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(e,{width:"wide",context:"standalone"})||i.quarter(e,{width:"abbreviated",context:"standalone"})||i.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,n){return n>=1&&n<=4}set(e,n,i){return e.setMonth((i-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class g1 extends yt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,n,i){const r=a=>a-1;switch(n){case"M":return qt(Et(Yt.month,e),r);case"MM":return qt(Wt(2,e),r);case"Mo":return qt(i.ordinalNumber(e,{unit:"month"}),r);case"MMM":return i.month(e,{width:"abbreviated",context:"formatting"})||i.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(e,{width:"wide",context:"formatting"})||i.month(e,{width:"abbreviated",context:"formatting"})||i.month(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=0&&n<=11}set(e,n,i){return e.setMonth(i,1),e.setHours(0,0,0,0),e}}class p1 extends yt{priority=110;parse(e,n,i){const r=a=>a-1;switch(n){case"L":return qt(Et(Yt.month,e),r);case"LL":return qt(Wt(2,e),r);case"Lo":return qt(i.ordinalNumber(e,{unit:"month"}),r);case"LLL":return i.month(e,{width:"abbreviated",context:"standalone"})||i.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(e,{width:"wide",context:"standalone"})||i.month(e,{width:"abbreviated",context:"standalone"})||i.month(e,{width:"narrow",context:"standalone"})}}validate(e,n){return n>=0&&n<=11}set(e,n,i){return e.setMonth(i,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function m1(t,e,n){const i=Jt(t,n?.in),r=l0(i,n)-e;return i.setDate(i.getDate()-r*7),Jt(i,n?.in)}class y1 extends yt{priority=100;parse(e,n,i){switch(n){case"w":return Et(Yt.week,e);case"wo":return i.ordinalNumber(e,{unit:"week"});default:return Wt(n.length,e)}}validate(e,n){return n>=1&&n<=53}set(e,n,i,r){return Yr(m1(e,i,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function x1(t,e,n){const i=Jt(t,n?.in),r=s0(i,n)-e;return i.setDate(i.getDate()-r*7),i}class v1 extends yt{priority=100;parse(e,n,i){switch(n){case"I":return Et(Yt.week,e);case"Io":return i.ordinalNumber(e,{unit:"week"});default:return Wt(n.length,e)}}validate(e,n){return n>=1&&n<=53}set(e,n,i){return Io(x1(e,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const w1=[31,28,31,30,31,30,31,31,30,31,30,31],b1=[31,29,31,30,31,30,31,31,30,31,30,31];class C1 extends yt{priority=90;subPriority=1;parse(e,n,i){switch(n){case"d":return Et(Yt.date,e);case"do":return i.ordinalNumber(e,{unit:"date"});default:return Wt(n.length,e)}}validate(e,n){const i=e.getFullYear(),r=p0(i),a=e.getMonth();return r?n>=1&&n<=b1[a]:n>=1&&n<=w1[a]}set(e,n,i){return e.setDate(i),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class S1 extends yt{priority=90;subpriority=1;parse(e,n,i){switch(n){case"D":case"DD":return Et(Yt.dayOfYear,e);case"Do":return i.ordinalNumber(e,{unit:"date"});default:return Wt(n.length,e)}}validate(e,n){const i=e.getFullYear();return p0(i)?n>=1&&n<=366:n>=1&&n<=365}set(e,n,i){return e.setMonth(0,i),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function m0(t,e,n){const i=Jt(t,n?.in);return isNaN(e)?fn(n?.in||t,NaN):(e&&i.setDate(i.getDate()+e),i)}function zh(t,e,n){const i=Xo(),r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,a=Jt(t,n?.in),o=a.getDay(),c=(e%7+7)%7,u=7-r,h=e<0||e>6?e-(o+u)%7:(c+u)%7-(o+u)%7;return m0(a,h,n)}class D1 extends yt{priority=90;parse(e,n,i){switch(n){case"E":case"EE":case"EEE":return i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return i.day(e,{width:"wide",context:"formatting"})||i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=0&&n<=6}set(e,n,i,r){return e=zh(e,i,r),e.setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]}class M1 extends yt{priority=90;parse(e,n,i,r){const a=o=>{const s=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+s};switch(n){case"e":case"ee":return qt(Wt(n.length,e),a);case"eo":return qt(i.ordinalNumber(e,{unit:"day"}),a);case"eee":return i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"});case"eeeee":return i.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return i.day(e,{width:"wide",context:"formatting"})||i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=0&&n<=6}set(e,n,i,r){return e=zh(e,i,r),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class T1 extends yt{priority=90;parse(e,n,i,r){const a=o=>{const s=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+s};switch(n){case"c":case"cc":return qt(Wt(n.length,e),a);case"co":return qt(i.ordinalNumber(e,{unit:"day"}),a);case"ccc":return i.day(e,{width:"abbreviated",context:"standalone"})||i.day(e,{width:"short",context:"standalone"})||i.day(e,{width:"narrow",context:"standalone"});case"ccccc":return i.day(e,{width:"narrow",context:"standalone"});case"cccccc":return i.day(e,{width:"short",context:"standalone"})||i.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return i.day(e,{width:"wide",context:"standalone"})||i.day(e,{width:"abbreviated",context:"standalone"})||i.day(e,{width:"short",context:"standalone"})||i.day(e,{width:"narrow",context:"standalone"})}}validate(e,n){return n>=0&&n<=6}set(e,n,i,r){return e=zh(e,i,r),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function k1(t,e){const n=Jt(t,e?.in).getDay();return n===0?7:n}function j1(t,e,n){const i=Jt(t,n?.in),r=k1(i,n),a=e-r;return m0(i,a,n)}class A1 extends yt{priority=90;parse(e,n,i){const r=a=>a===0?7:a;switch(n){case"i":case"ii":return Wt(n.length,e);case"io":return i.ordinalNumber(e,{unit:"day"});case"iii":return qt(i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return qt(i.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return qt(i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return qt(i.day(e,{width:"wide",context:"formatting"})||i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"}),r)}}validate(e,n){return n>=1&&n<=7}set(e,n,i){return e=j1(e,i),e.setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class _1 extends yt{priority=80;parse(e,n,i){switch(n){case"a":case"aa":case"aaa":return i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(e,{width:"wide",context:"formatting"})||i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,n,i){return e.setHours(Wh(i),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]}class O1 extends yt{priority=80;parse(e,n,i){switch(n){case"b":case"bb":case"bbb":return i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(e,{width:"wide",context:"formatting"})||i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,n,i){return e.setHours(Wh(i),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]}class N1 extends yt{priority=80;parse(e,n,i){switch(n){case"B":case"BB":case"BBB":return i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(e,{width:"wide",context:"formatting"})||i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,n,i){return e.setHours(Wh(i),0,0,0),e}incompatibleTokens=["a","b","t","T"]}class I1 extends yt{priority=70;parse(e,n,i){switch(n){case"h":return Et(Yt.hour12h,e);case"ho":return i.ordinalNumber(e,{unit:"hour"});default:return Wt(n.length,e)}}validate(e,n){return n>=1&&n<=12}set(e,n,i){const r=e.getHours()>=12;return r&&i<12?e.setHours(i+12,0,0,0):!r&&i===12?e.setHours(0,0,0,0):e.setHours(i,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]}class $1 extends yt{priority=70;parse(e,n,i){switch(n){case"H":return Et(Yt.hour23h,e);case"Ho":return i.ordinalNumber(e,{unit:"hour"});default:return Wt(n.length,e)}}validate(e,n){return n>=0&&n<=23}set(e,n,i){return e.setHours(i,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]}class L1 extends yt{priority=70;parse(e,n,i){switch(n){case"K":return Et(Yt.hour11h,e);case"Ko":return i.ordinalNumber(e,{unit:"hour"});default:return Wt(n.length,e)}}validate(e,n){return n>=0&&n<=11}set(e,n,i){return e.getHours()>=12&&i<12?e.setHours(i+12,0,0,0):e.setHours(i,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]}class P1 extends yt{priority=70;parse(e,n,i){switch(n){case"k":return Et(Yt.hour24h,e);case"ko":return i.ordinalNumber(e,{unit:"hour"});default:return Wt(n.length,e)}}validate(e,n){return n>=1&&n<=24}set(e,n,i){const r=i<=24?i%24:i;return e.setHours(r,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]}class E1 extends yt{priority=60;parse(e,n,i){switch(n){case"m":return Et(Yt.minute,e);case"mo":return i.ordinalNumber(e,{unit:"minute"});default:return Wt(n.length,e)}}validate(e,n){return n>=0&&n<=59}set(e,n,i){return e.setMinutes(i,0,0),e}incompatibleTokens=["t","T"]}class V1 extends yt{priority=50;parse(e,n,i){switch(n){case"s":return Et(Yt.second,e);case"so":return i.ordinalNumber(e,{unit:"second"});default:return Wt(n.length,e)}}validate(e,n){return n>=0&&n<=59}set(e,n,i){return e.setSeconds(i,0),e}incompatibleTokens=["t","T"]}class F1 extends yt{priority=30;parse(e,n){const i=r=>Math.trunc(r*Math.pow(10,-n.length+3));return qt(Wt(n.length,e),i)}set(e,n,i){return e.setMilliseconds(i),e}incompatibleTokens=["t","T"]}class R1 extends yt{priority=10;parse(e,n){switch(n){case"X":return Ji(Zi.basicOptionalMinutes,e);case"XX":return Ji(Zi.basic,e);case"XXXX":return Ji(Zi.basicOptionalSeconds,e);case"XXXXX":return Ji(Zi.extendedOptionalSeconds,e);case"XXX":default:return Ji(Zi.extended,e)}}set(e,n,i){return n.timestampIsSet?e:fn(e,e.getTime()-zl(e)-i)}incompatibleTokens=["t","T","x"]}class B1 extends yt{priority=10;parse(e,n){switch(n){case"x":return Ji(Zi.basicOptionalMinutes,e);case"xx":return Ji(Zi.basic,e);case"xxxx":return Ji(Zi.basicOptionalSeconds,e);case"xxxxx":return Ji(Zi.extendedOptionalSeconds,e);case"xxx":default:return Ji(Zi.extended,e)}}set(e,n,i){return n.timestampIsSet?e:fn(e,e.getTime()-zl(e)-i)}incompatibleTokens=["t","T","X"]}class H1 extends yt{priority=40;parse(e){return d0(e)}set(e,n,i){return[fn(e,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class W1 extends yt{priority=20;parse(e){return d0(e)}set(e,n,i){return[fn(e,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const z1={G:new s1,y:new l1,Y:new c1,R:new u1,u:new h1,Q:new f1,q:new d1,M:new g1,L:new p1,w:new y1,I:new v1,d:new C1,D:new S1,E:new D1,e:new M1,c:new T1,i:new A1,a:new _1,b:new O1,B:new N1,h:new I1,H:new $1,K:new L1,k:new P1,m:new E1,s:new V1,S:new F1,X:new R1,x:new B1,t:new H1,T:new W1},G1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Y1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,q1=/^'([^]*?)'?$/,U1=/''/g,X1=/\S/,K1=/[a-zA-Z]/;function ze(t,e,n,i){const r=()=>fn(n,NaN),a=t1(),o=a.locale??r0,s=a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,c=a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(!e)return t?r():Jt(n,i?.in);const u={firstWeekContainsDate:s,weekStartsOn:c,locale:o},h=[new o1(i?.in,n)],f=e.match(Y1).map(v=>{const m=v[0];if(m in Hu){const I=Hu[m];return I(v,o.formatLong)}return v}).join("").match(G1),d=[];for(let v of f){h0(v)&&Wu(v,e,t),u0(v)&&Wu(v,e,t);const m=v[0],I=z1[m];if(I){const{incompatibleTokens:j}=I;if(Array.isArray(j)){const S=d.find(P=>j.includes(P.token)||P.token===m);if(S)throw new RangeError(`The format string mustn't contain \`${S.fullToken}\` and \`${v}\` at the same time`)}else if(I.incompatibleTokens==="*"&&d.length>0)throw new RangeError(`The format string mustn't contain \`${v}\` and any other token at the same time`);d.push({token:m,fullToken:v});const w=I.run(t,v,o.match,u);if(!w)return r();h.push(w.setter),t=w.rest}else{if(m.match(K1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");if(v==="''"?v="'":m==="'"&&(v=Q1(v)),t.indexOf(v)===0)t=t.slice(v.length);else return r()}}if(t.length>0&&X1.test(t))return r();const g=h.map(v=>v.priority).sort((v,m)=>m-v).filter((v,m,I)=>I.indexOf(v)===m).map(v=>h.filter(m=>m.priority===v).sort((m,I)=>I.subPriority-m.subPriority)).map(v=>v[0]);let p=Jt(n,i?.in);if(isNaN(+p))return r();const y={};for(const v of g){if(!v.validate(p,u))return r();const m=v.set(p,y,u);Array.isArray(m)?(p=m[0],Object.assign(y,m[1])):p=m}return p}function Q1(t){return t.match(q1)[1].replace(U1,"'")}function an(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Z1(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Gh(t){let e,n,i;t.length!==2?(e=an,n=(s,c)=>an(t(s),c),i=(s,c)=>t(s)-c):(e=t===an||t===Z1?t:J1,n=t,i=t);function r(s,c,u=0,h=s.length){if(u<h){if(e(c,c)!==0)return h;do{const f=u+h>>>1;n(s[f],c)<0?u=f+1:h=f}while(u<h)}return u}function a(s,c,u=0,h=s.length){if(u<h){if(e(c,c)!==0)return h;do{const f=u+h>>>1;n(s[f],c)<=0?u=f+1:h=f}while(u<h)}return u}function o(s,c,u=0,h=s.length){const f=r(s,c,u,h-1);return f>u&&i(s[f-1],c)>-i(s[f],c)?f-1:f}return{left:r,center:o,right:a}}function J1(){return 0}function eC(t){return t===null?NaN:+t}const tC=Gh(an),Yh=tC.right,Qr=Gh(eC).center;function nC(t,e){let n=0;for(let i of t)i!=null&&(i=+i)>=i&&++n;return n}function Fa(t,e){let n,i;if(e===void 0)for(const r of t)r!=null&&(n===void 0?r>=r&&(n=i=r):(n>r&&(n=r),i<r&&(i=r)));else{let r=-1;for(let a of t)(a=e(a,++r,t))!=null&&(n===void 0?a>=a&&(n=i=a):(n>a&&(n=a),i<a&&(i=a)))}return[n,i]}class iC{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const n=this._partials;let i=0;for(let r=0;r<this._n&&r<32;r++){const a=n[r],o=e+a,s=Math.abs(e)<Math.abs(a)?e-(o-a):a-(o-e);s&&(n[i++]=s),e=o}return n[i]=e,this._n=i+1,this}valueOf(){const e=this._partials;let n=this._n,i,r,a,o=0;if(n>0){for(o=e[--n];n>0&&(i=o,r=e[--n],o=i+r,a=r-(o-i),!a););n>0&&(a<0&&e[n-1]<0||a>0&&e[n-1]>0)&&(r=a*2,i=o+r,r==i-o&&(o=i))}return o}}class Rd extends Map{constructor(e,n=oC){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[i,r]of e)this.set(i,r)}get(e){return super.get(Bd(this,e))}has(e){return super.has(Bd(this,e))}set(e,n){return super.set(rC(this,e),n)}delete(e){return super.delete(aC(this,e))}}function Bd({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):n}function rC({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}function aC({_intern:t,_key:e},n){const i=e(n);return t.has(i)&&(n=t.get(n),t.delete(i)),n}function oC(t){return t!==null&&typeof t=="object"?t.valueOf():t}function sC(t){return t}function lC(t,e){return Array.from(e,n=>t[n])}function di(t,...e){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&n.length!==2||e.length>1){const i=Uint32Array.from(t,(r,a)=>a);return e.length>1?(e=e.map(r=>t.map(r)),i.sort((r,a)=>{for(const o of e){const s=zu(o[r],o[a]);if(s)return s}})):(n=t.map(n),i.sort((r,a)=>zu(n[r],n[a]))),lC(t,i)}return t.sort(cC(n))}function cC(t=an){if(t===an)return zu;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const i=t(e,n);return i||i===0?i:(t(n,n)===0)-(t(e,e)===0)}}function zu(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}var uC=Array.prototype,hC=uC.slice;function Wc(t){return()=>t}const fC=Math.sqrt(50),dC=Math.sqrt(10),gC=Math.sqrt(2);function Yl(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(i)),a=i/Math.pow(10,r),o=a>=fC?10:a>=dC?5:a>=gC?2:1;let s,c,u;return r<0?(u=Math.pow(10,-r)/o,s=Math.round(t*u),c=Math.round(e*u),s/u<t&&++s,c/u>e&&--c,u=-u):(u=Math.pow(10,r)*o,s=Math.round(t/u),c=Math.round(e/u),s*u<t&&++s,c*u>e&&--c),c<s&&.5<=n&&n<2?Yl(t,e,n*2):[s,c,u]}function y0(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const i=e<t,[r,a,o]=i?Yl(e,t,n):Yl(t,e,n);if(!(a>=r))return[];const s=a-r+1,c=new Array(s);if(i)if(o<0)for(let u=0;u<s;++u)c[u]=(a-u)/-o;else for(let u=0;u<s;++u)c[u]=(a-u)*o;else if(o<0)for(let u=0;u<s;++u)c[u]=(r+u)/-o;else for(let u=0;u<s;++u)c[u]=(r+u)*o;return c}function $o(t,e,n){return e=+e,t=+t,n=+n,Yl(t,e,n)[2]}function Gu(t,e,n){e=+e,t=+t,n=+n;const i=e<t,r=i?$o(e,t,n):$o(t,e,n);return(i?-1:1)*(r<0?1/-r:r)}function pC(t,e,n){let i;for(;;){const r=$o(t,e,n);if(r===i||r===0||!isFinite(r))return[t,e];r>0?(t=Math.floor(t/r)*r,e=Math.ceil(e/r)*r):r<0&&(t=Math.ceil(t*r)/r,e=Math.floor(e*r)/r),i=r}}function mC(t){return Math.max(1,Math.ceil(Math.log(nC(t))/Math.LN2)+1)}function yC(){var t=sC,e=Fa,n=mC;function i(r){Array.isArray(r)||(r=Array.from(r));var a,o=r.length,s,c,u=new Array(o);for(a=0;a<o;++a)u[a]=t(r[a],a,r);var h=e(u),f=h[0],d=h[1],g=n(u,f,d);if(!Array.isArray(g)){const j=d,w=+g;if(e===Fa&&([f,d]=pC(f,d,w)),g=y0(f,d,w),g[0]<=f&&(c=$o(f,d,w)),g[g.length-1]>=d)if(j>=d&&e===Fa){const S=$o(f,d,w);isFinite(S)&&(S>0?d=(Math.floor(d/S)+1)*S:S<0&&(d=(Math.ceil(d*-S)+1)/-S))}else g.pop()}for(var p=g.length,y=0,v=p;g[y]<=f;)++y;for(;g[v-1]>d;)--v;(y||v<p)&&(g=g.slice(y,v),p=v-y);var m=new Array(p+1),I;for(a=0;a<=p;++a)I=m[a]=[],I.x0=a>0?g[a-1]:f,I.x1=a<p?g[a]:d;if(isFinite(c)){if(c>0)for(a=0;a<o;++a)(s=u[a])!=null&&f<=s&&s<=d&&m[Math.min(p,Math.floor((s-f)/c))].push(r[a]);else if(c<0){for(a=0;a<o;++a)if((s=u[a])!=null&&f<=s&&s<=d){const j=Math.floor((f-s)*c);m[Math.min(p,j+(g[j]<=s))].push(r[a])}}}else for(a=0;a<o;++a)(s=u[a])!=null&&f<=s&&s<=d&&m[Yh(g,s,0,p)].push(r[a]);return m}return i.value=function(r){return arguments.length?(t=typeof r=="function"?r:Wc(r),i):t},i.domain=function(r){return arguments.length?(e=typeof r=="function"?r:Wc([r[0],r[1]]),i):e},i.thresholds=function(r){return arguments.length?(n=typeof r=="function"?r:Wc(Array.isArray(r)?hC.call(r):r),i):n},i}function*xC(t){for(const e of t)yield*e}function x0(t){return Array.from(xC(t))}function vC(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((e-t)/n))|0,a=new Array(r);++i<r;)a[i]=t+i*n;return a}var zc,Hd;function wC(){return Hd||(Hd=1,zc=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var i,r,a;if(Array.isArray(e)){if(i=e.length,i!=n.length)return!1;for(r=i;r--!==0;)if(!t(e[r],n[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(a=Object.keys(e),i=a.length,i!==Object.keys(n).length)return!1;for(r=i;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[r]))return!1;for(r=i;r--!==0;){var o=a[r];if(!t(e[o],n[o]))return!1}return!0}return e!==e&&n!==n}),zc}var bC=wC();const dt=rr(bC);function Ko(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const Wd=Symbol("implicit");function Xs(){var t=new Rd,e=[],n=[],i=Wd;function r(a){let o=t.get(a);if(o===void 0){if(i!==Wd)return i;t.set(a,o=e.push(a)-1)}return n[o%n.length]}return r.domain=function(a){if(!arguments.length)return e.slice();e=[],t=new Rd;for(const o of a)t.has(o)||t.set(o,e.push(o)-1);return r},r.range=function(a){return arguments.length?(n=Array.from(a),r):n.slice()},r.unknown=function(a){return arguments.length?(i=a,r):i},r.copy=function(){return Xs(e,n).unknown(i)},Ko.apply(r,arguments),r}function xn(){var t=Xs().unknown(void 0),e=t.domain,n=t.range,i=0,r=1,a,o,s=!1,c=0,u=0,h=.5;delete t.unknown;function f(){var d=e().length,g=r<i,p=g?r:i,y=g?i:r;a=(y-p)/Math.max(1,d-c+u*2),s&&(a=Math.floor(a)),p+=(y-p-a*(d-c))*h,o=a*(1-c),s&&(p=Math.round(p),o=Math.round(o));var v=vC(d).map(function(m){return p+a*m});return n(g?v.reverse():v)}return t.domain=function(d){return arguments.length?(e(d),f()):e()},t.range=function(d){return arguments.length?([i,r]=d,i=+i,r=+r,f()):[i,r]},t.rangeRound=function(d){return[i,r]=d,i=+i,r=+r,s=!0,f()},t.bandwidth=function(){return o},t.step=function(){return a},t.round=function(d){return arguments.length?(s=!!d,f()):s},t.padding=function(d){return arguments.length?(c=Math.min(1,u=+d),f()):c},t.paddingInner=function(d){return arguments.length?(c=Math.min(1,d),f()):c},t.paddingOuter=function(d){return arguments.length?(u=+d,f()):u},t.align=function(d){return arguments.length?(h=Math.max(0,Math.min(1,d)),f()):h},t.copy=function(){return xn(e(),[i,r]).round(s).paddingInner(c).paddingOuter(u).align(h)},Ko.apply(f(),arguments)}function qh(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function v0(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Ks(){}var Is=.7,ql=1/Is,Ao="\\s*([+-]?\\d+)\\s*",$s="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",tr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",CC=/^#([0-9a-f]{3,8})$/,SC=new RegExp(`^rgb\\(${Ao},${Ao},${Ao}\\)$`),DC=new RegExp(`^rgb\\(${tr},${tr},${tr}\\)$`),MC=new RegExp(`^rgba\\(${Ao},${Ao},${Ao},${$s}\\)$`),TC=new RegExp(`^rgba\\(${tr},${tr},${tr},${$s}\\)$`),kC=new RegExp(`^hsl\\(${$s},${tr},${tr}\\)$`),jC=new RegExp(`^hsla\\(${$s},${tr},${tr},${$s}\\)$`),zd={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};qh(Ks,qa,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Gd,formatHex:Gd,formatHex8:AC,formatHsl:_C,formatRgb:Yd,toString:Yd});function Gd(){return this.rgb().formatHex()}function AC(){return this.rgb().formatHex8()}function _C(){return w0(this).formatHsl()}function Yd(){return this.rgb().formatRgb()}function qa(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=CC.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?qd(e):n===3?new Jn(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?ul(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?ul(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=SC.exec(t))?new Jn(e[1],e[2],e[3],1):(e=DC.exec(t))?new Jn(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=MC.exec(t))?ul(e[1],e[2],e[3],e[4]):(e=TC.exec(t))?ul(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=kC.exec(t))?Kd(e[1],e[2]/100,e[3]/100,1):(e=jC.exec(t))?Kd(e[1],e[2]/100,e[3]/100,e[4]):zd.hasOwnProperty(t)?qd(zd[t]):t==="transparent"?new Jn(NaN,NaN,NaN,0):null}function qd(t){return new Jn(t>>16&255,t>>8&255,t&255,1)}function ul(t,e,n,i){return i<=0&&(t=e=n=NaN),new Jn(t,e,n,i)}function OC(t){return t instanceof Ks||(t=qa(t)),t?(t=t.rgb(),new Jn(t.r,t.g,t.b,t.opacity)):new Jn}function Yu(t,e,n,i){return arguments.length===1?OC(t):new Jn(t,e,n,i??1)}function Jn(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}qh(Jn,Yu,v0(Ks,{brighter(t){return t=t==null?ql:Math.pow(ql,t),new Jn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Is:Math.pow(Is,t),new Jn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Jn(za(this.r),za(this.g),za(this.b),Ul(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ud,formatHex:Ud,formatHex8:NC,formatRgb:Xd,toString:Xd}));function Ud(){return`#${Ra(this.r)}${Ra(this.g)}${Ra(this.b)}`}function NC(){return`#${Ra(this.r)}${Ra(this.g)}${Ra(this.b)}${Ra((isNaN(this.opacity)?1:this.opacity)*255)}`}function Xd(){const t=Ul(this.opacity);return`${t===1?"rgb(":"rgba("}${za(this.r)}, ${za(this.g)}, ${za(this.b)}${t===1?")":`, ${t})`}`}function Ul(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function za(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ra(t){return t=za(t),(t<16?"0":"")+t.toString(16)}function Kd(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ei(t,e,n,i)}function w0(t){if(t instanceof Ei)return new Ei(t.h,t.s,t.l,t.opacity);if(t instanceof Ks||(t=qa(t)),!t)return new Ei;if(t instanceof Ei)return t;t=t.rgb();var e=t.r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),a=Math.max(e,n,i),o=NaN,s=a-r,c=(a+r)/2;return s?(e===a?o=(n-i)/s+(n<i)*6:n===a?o=(i-e)/s+2:o=(e-n)/s+4,s/=c<.5?a+r:2-a-r,o*=60):s=c>0&&c<1?0:o,new Ei(o,s,c,t.opacity)}function IC(t,e,n,i){return arguments.length===1?w0(t):new Ei(t,e,n,i??1)}function Ei(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}qh(Ei,IC,v0(Ks,{brighter(t){return t=t==null?ql:Math.pow(ql,t),new Ei(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Is:Math.pow(Is,t),new Ei(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Jn(Gc(t>=240?t-240:t+120,r,i),Gc(t,r,i),Gc(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new Ei(Qd(this.h),hl(this.s),hl(this.l),Ul(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Ul(this.opacity);return`${t===1?"hsl(":"hsla("}${Qd(this.h)}, ${hl(this.s)*100}%, ${hl(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Qd(t){return t=(t||0)%360,t<0?t+360:t}function hl(t){return Math.max(0,Math.min(1,t||0))}function Gc(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Uh=t=>()=>t;function $C(t,e){return function(n){return t+n*e}}function LC(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}function PC(t){return(t=+t)==1?b0:function(e,n){return n-e?LC(e,n,t):Uh(isNaN(e)?n:e)}}function b0(t,e){var n=e-t;return n?$C(t,n):Uh(isNaN(t)?e:t)}const Xl=function t(e){var n=PC(e);function i(r,a){var o=n((r=Yu(r)).r,(a=Yu(a)).r),s=n(r.g,a.g),c=n(r.b,a.b),u=b0(r.opacity,a.opacity);return function(h){return r.r=o(h),r.g=s(h),r.b=c(h),r.opacity=u(h),r+""}}return i.gamma=t,i}(1);function EC(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,i=e.slice(),r;return function(a){for(r=0;r<n;++r)i[r]=t[r]*(1-a)+e[r]*a;return i}}function VC(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function FC(t,e){var n=e?e.length:0,i=t?Math.min(n,t.length):0,r=new Array(i),a=new Array(n),o;for(o=0;o<i;++o)r[o]=Xh(t[o],e[o]);for(;o<n;++o)a[o]=e[o];return function(s){for(o=0;o<i;++o)a[o]=r[o](s);return a}}function RC(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function Pi(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function BC(t,e){var n={},i={},r;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(r in e)r in t?n[r]=Xh(t[r],e[r]):i[r]=e[r];return function(a){for(r in n)i[r]=n[r](a);return i}}var qu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yc=new RegExp(qu.source,"g");function HC(t){return function(){return t}}function WC(t){return function(e){return t(e)+""}}function C0(t,e){var n=qu.lastIndex=Yc.lastIndex=0,i,r,a,o=-1,s=[],c=[];for(t=t+"",e=e+"";(i=qu.exec(t))&&(r=Yc.exec(e));)(a=r.index)>n&&(a=e.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(i=i[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,c.push({i:o,x:Pi(i,r)})),n=Yc.lastIndex;return n<e.length&&(a=e.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?WC(c[0].x):HC(e):(e=c.length,function(u){for(var h=0,f;h<e;++h)s[(f=c[h]).i]=f.x(u);return s.join("")})}function Xh(t,e){var n=typeof e,i;return e==null||n==="boolean"?Uh(e):(n==="number"?Pi:n==="string"?(i=qa(e))?(e=i,Xl):C0:e instanceof qa?Xl:e instanceof Date?RC:VC(e)?EC:Array.isArray(e)?FC:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?BC:Pi)(t,e)}function zC(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var Zd=180/Math.PI,Uu={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function S0(t,e,n,i,r,a){var o,s,c;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(c=t*n+e*i)&&(n-=t*c,i-=e*c),(s=Math.sqrt(n*n+i*i))&&(n/=s,i/=s,c/=s),t*i<e*n&&(t=-t,e=-e,c=-c,o=-o),{translateX:r,translateY:a,rotate:Math.atan2(e,t)*Zd,skewX:Math.atan(c)*Zd,scaleX:o,scaleY:s}}var fl;function GC(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Uu:S0(e.a,e.b,e.c,e.d,e.e,e.f)}function YC(t){return t==null||(fl||(fl=document.createElementNS("http://www.w3.org/2000/svg","g")),fl.setAttribute("transform",t),!(t=fl.transform.baseVal.consolidate()))?Uu:(t=t.matrix,S0(t.a,t.b,t.c,t.d,t.e,t.f))}function D0(t,e,n,i){function r(u){return u.length?u.pop()+" ":""}function a(u,h,f,d,g,p){if(u!==f||h!==d){var y=g.push("translate(",null,e,null,n);p.push({i:y-4,x:Pi(u,f)},{i:y-2,x:Pi(h,d)})}else(f||d)&&g.push("translate("+f+e+d+n)}function o(u,h,f,d){u!==h?(u-h>180?h+=360:h-u>180&&(u+=360),d.push({i:f.push(r(f)+"rotate(",null,i)-2,x:Pi(u,h)})):h&&f.push(r(f)+"rotate("+h+i)}function s(u,h,f,d){u!==h?d.push({i:f.push(r(f)+"skewX(",null,i)-2,x:Pi(u,h)}):h&&f.push(r(f)+"skewX("+h+i)}function c(u,h,f,d,g,p){if(u!==f||h!==d){var y=g.push(r(g)+"scale(",null,",",null,")");p.push({i:y-4,x:Pi(u,f)},{i:y-2,x:Pi(h,d)})}else(f!==1||d!==1)&&g.push(r(g)+"scale("+f+","+d+")")}return function(u,h){var f=[],d=[];return u=t(u),h=t(h),a(u.translateX,u.translateY,h.translateX,h.translateY,f,d),o(u.rotate,h.rotate,f,d),s(u.skewX,h.skewX,f,d),c(u.scaleX,u.scaleY,h.scaleX,h.scaleY,f,d),u=h=null,function(g){for(var p=-1,y=d.length,v;++p<y;)f[(v=d[p]).i]=v.x(g);return f.join("")}}}var qC=D0(GC,"px, ","px)","deg)"),UC=D0(YC,", ",")",")"),XC=1e-12;function Jd(t){return((t=Math.exp(t))+1/t)/2}function KC(t){return((t=Math.exp(t))-1/t)/2}function QC(t){return((t=Math.exp(2*t))-1)/(t+1)}const ZC=function t(e,n,i){function r(a,o){var s=a[0],c=a[1],u=a[2],h=o[0],f=o[1],d=o[2],g=h-s,p=f-c,y=g*g+p*p,v,m;if(y<XC)m=Math.log(d/u)/e,v=function(W){return[s+W*g,c+W*p,u*Math.exp(e*W*m)]};else{var I=Math.sqrt(y),j=(d*d-u*u+i*y)/(2*u*n*I),w=(d*d-u*u-i*y)/(2*d*n*I),S=Math.log(Math.sqrt(j*j+1)-j),P=Math.log(Math.sqrt(w*w+1)-w);m=(P-S)/e,v=function(W){var D=W*m,x=Jd(S),$=u/(n*I)*(x*QC(e*D+S)-KC(S));return[s+$*g,c+$*p,u*x/Jd(e*D+S)]}}return v.duration=m*1e3*e/Math.SQRT2,v}return r.rho=function(a){var o=Math.max(.001,+a),s=o*o,c=s*s;return t(o,s,c)},r}(Math.SQRT2,2,4);function JC(t){return function(){return t}}function eS(t){return+t}var eg=[0,1];function er(t){return t}function Xu(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:JC(isNaN(e)?NaN:.5)}function tS(t,e){var n;return t>e&&(n=t,t=e,e=n),function(i){return Math.max(t,Math.min(e,i))}}function nS(t,e,n){var i=t[0],r=t[1],a=e[0],o=e[1];return r<i?(i=Xu(r,i),a=n(o,a)):(i=Xu(i,r),a=n(a,o)),function(s){return a(i(s))}}function iS(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),a=new Array(i),o=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<i;)r[o]=Xu(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(s){var c=Yh(t,s,1,i)-1;return a[c](r[c](s))}}function Kh(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function M0(){var t=eg,e=eg,n=Xh,i,r,a,o=er,s,c,u;function h(){var d=Math.min(t.length,e.length);return o!==er&&(o=tS(t[0],t[d-1])),s=d>2?iS:nS,c=u=null,f}function f(d){return d==null||isNaN(d=+d)?a:(c||(c=s(t.map(i),e,n)))(i(o(d)))}return f.invert=function(d){return o(r((u||(u=s(e,t.map(i),Pi)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,eS),h()):t.slice()},f.range=function(d){return arguments.length?(e=Array.from(d),h()):e.slice()},f.rangeRound=function(d){return e=Array.from(d),n=zC,h()},f.clamp=function(d){return arguments.length?(o=d?!0:er,h()):o!==er},f.interpolate=function(d){return arguments.length?(n=d,h()):n},f.unknown=function(d){return arguments.length?(a=d,f):a},function(d,g){return i=d,r=g,h()}}function T0(){return M0()(er,er)}function rS(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Kl(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function Lo(t){return t=Kl(Math.abs(t)),t?t[1]:NaN}function aS(t,e){return function(n,i){for(var r=n.length,a=[],o=0,s=t[0],c=0;r>0&&s>0&&(c+s+1>i&&(s=Math.max(1,i-c)),a.push(n.substring(r-=s,r+s)),!((c+=s+1)>i));)s=t[o=(o+1)%t.length];return a.reverse().join(e)}}function oS(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var sS=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ql(t){if(!(e=sS.exec(t)))throw new Error("invalid format: "+t);var e;return new Qh({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Ql.prototype=Qh.prototype;function Qh(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Qh.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function lS(t){e:for(var e=t.length,n=1,i=-1,r;n<e;++n)switch(t[n]){case".":i=r=n;break;case"0":i===0&&(i=n),r=n;break;default:if(!+t[n])break e;i>0&&(i=0);break}return i>0?t.slice(0,i)+t.slice(r+1):t}var k0;function cS(t,e){var n=Kl(t,e);if(!n)return t+"";var i=n[0],r=n[1],a=r-(k0=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,o=i.length;return a===o?i:a>o?i+new Array(a-o+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+Kl(t,Math.max(0,e+a-1))[0]}function tg(t,e){var n=Kl(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const ng={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:rS,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>tg(t*100,e),r:tg,s:cS,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function ig(t){return t}var rg=Array.prototype.map,ag=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function uS(t){var e=t.grouping===void 0||t.thousands===void 0?ig:aS(rg.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",i=t.currency===void 0?"":t.currency[1]+"",r=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?ig:oS(rg.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function u(f){f=Ql(f);var d=f.fill,g=f.align,p=f.sign,y=f.symbol,v=f.zero,m=f.width,I=f.comma,j=f.precision,w=f.trim,S=f.type;S==="n"?(I=!0,S="g"):ng[S]||(j===void 0&&(j=12),w=!0,S="g"),(v||d==="0"&&g==="=")&&(v=!0,d="0",g="=");var P=y==="$"?n:y==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",W=y==="$"?i:/[%p]/.test(S)?o:"",D=ng[S],x=/[defgprs%]/.test(S);j=j===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,j)):Math.max(0,Math.min(20,j));function $(V){var q=P,ae=W,G,_,b;if(S==="c")ae=D(V)+ae,V="";else{V=+V;var B=V<0||1/V<0;if(V=isNaN(V)?c:D(Math.abs(V),j),w&&(V=lS(V)),B&&+V==0&&p!=="+"&&(B=!1),q=(B?p==="("?p:s:p==="-"||p==="("?"":p)+q,ae=(S==="s"?ag[8+k0/3]:"")+ae+(B&&p==="("?")":""),x){for(G=-1,_=V.length;++G<_;)if(b=V.charCodeAt(G),48>b||b>57){ae=(b===46?r+V.slice(G+1):V.slice(G))+ae,V=V.slice(0,G);break}}}I&&!v&&(V=e(V,1/0));var X=q.length+V.length+ae.length,z=X<m?new Array(m-X+1).join(d):"";switch(I&&v&&(V=e(z+V,z.length?m-ae.length:1/0),z=""),g){case"<":V=q+V+ae+z;break;case"=":V=q+z+V+ae;break;case"^":V=z.slice(0,X=z.length>>1)+q+V+ae+z.slice(X);break;default:V=z+q+V+ae;break}return a(V)}return $.toString=function(){return f+""},$}function h(f,d){var g=u((f=Ql(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(Lo(d)/3)))*3,y=Math.pow(10,-p),v=ag[8+p/3];return function(m){return g(y*m)+v}}return{format:u,formatPrefix:h}}var dl,Zh,j0;hS({thousands:",",grouping:[3],currency:["$",""]});function hS(t){return dl=uS(t),Zh=dl.format,j0=dl.formatPrefix,dl}function fS(t){return Math.max(0,-Lo(Math.abs(t)))}function dS(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Lo(e)/3)))*3-Lo(Math.abs(t)))}function gS(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Lo(e)-Lo(t))+1}function pS(t,e,n,i){var r=Gu(t,e,n),a;switch(i=Ql(i??",f"),i.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return i.precision==null&&!isNaN(a=dS(r,o))&&(i.precision=a),j0(i,o)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(a=gS(r,Math.max(Math.abs(t),Math.abs(e))))&&(i.precision=a-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(a=fS(r))&&(i.precision=a-(i.type==="%")*2);break}}return Zh(i)}function A0(t){var e=t.domain;return t.ticks=function(n){var i=e();return y0(i[0],i[i.length-1],n??10)},t.tickFormat=function(n,i){var r=e();return pS(r[0],r[r.length-1],n??10,i)},t.nice=function(n){n==null&&(n=10);var i=e(),r=0,a=i.length-1,o=i[r],s=i[a],c,u,h=10;for(s<o&&(u=o,o=s,s=u,u=r,r=a,a=u);h-- >0;){if(u=$o(o,s,n),u===c)return i[r]=o,i[a]=s,e(i);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;c=u}return t},t}function ut(){var t=T0();return t.copy=function(){return Kh(t,ut())},Ko.apply(t,arguments),A0(t)}function mS(t,e){t=t.slice();var n=0,i=t.length-1,r=t[n],a=t[i],o;return a<r&&(o=n,n=i,i=o,o=r,r=a,a=o),t[n]=e.floor(r),t[i]=e.ceil(a),t}function og(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function yS(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function xS(t){return t<0?-t*t:t*t}function vS(t){var e=t(er,er),n=1;function i(){return n===1?t(er,er):n===.5?t(yS,xS):t(og(n),og(1/n))}return e.exponent=function(r){return arguments.length?(n=+r,i()):n},A0(e)}function _0(){var t=vS(M0());return t.copy=function(){return Kh(t,_0()).exponent(t.exponent())},Ko.apply(t,arguments),t}function Qs(){return _0.apply(null,arguments).exponent(.5)}function Po(){var t=[.5],e=[0,1],n,i=1;function r(a){return a!=null&&a<=a?e[Yh(t,a,0,i)]:n}return r.domain=function(a){return arguments.length?(t=Array.from(a),i=Math.min(t.length,e.length-1),r):t.slice()},r.range=function(a){return arguments.length?(e=Array.from(a),i=Math.min(t.length,e.length-1),r):e.slice()},r.invertExtent=function(a){var o=e.indexOf(a);return[t[o-1],t[o]]},r.unknown=function(a){return arguments.length?(n=a,r):n},r.copy=function(){return Po().domain(t).range(e).unknown(n)},Ko.apply(r,arguments)}const qc=new Date,Uc=new Date;function on(t,e,n,i){function r(a){return t(a=arguments.length===0?new Date:new Date(+a)),a}return r.floor=a=>(t(a=new Date(+a)),a),r.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),r.round=a=>{const o=r(a),s=r.ceil(a);return a-o<s-a?o:s},r.offset=(a,o)=>(e(a=new Date(+a),o==null?1:Math.floor(o)),a),r.range=(a,o,s)=>{const c=[];if(a=r.ceil(a),s=s==null?1:Math.floor(s),!(a<o)||!(s>0))return c;let u;do c.push(u=new Date(+a)),e(a,s),t(a);while(u<a&&a<o);return c},r.filter=a=>on(o=>{if(o>=o)for(;t(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;e(o,-1),!a(o););else for(;--s>=0;)for(;e(o,1),!a(o););}),n&&(r.count=(a,o)=>(qc.setTime(+a),Uc.setTime(+o),t(qc),t(Uc),Math.floor(n(qc,Uc))),r.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?r.filter(i?o=>i(o)%a===0:o=>r.count(0,o)%a===0):r)),r}const Zl=on(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Zl.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?on(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Zl);Zl.range;const yr=1e3,Ti=yr*60,xr=Ti*60,br=xr*24,Jh=br*7,sg=br*30,Xc=br*365,vo=on(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*yr)},(t,e)=>(e-t)/yr,t=>t.getUTCSeconds());vo.range;const ef=on(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*yr)},(t,e)=>{t.setTime(+t+e*Ti)},(t,e)=>(e-t)/Ti,t=>t.getMinutes());ef.range;const wS=on(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Ti)},(t,e)=>(e-t)/Ti,t=>t.getUTCMinutes());wS.range;const tf=on(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*yr-t.getMinutes()*Ti)},(t,e)=>{t.setTime(+t+e*xr)},(t,e)=>(e-t)/xr,t=>t.getHours());tf.range;const bS=on(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*xr)},(t,e)=>(e-t)/xr,t=>t.getUTCHours());bS.range;const Zs=on(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Ti)/br,t=>t.getDate()-1);Zs.range;const nf=on(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/br,t=>t.getUTCDate()-1);nf.range;const CS=on(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/br,t=>Math.floor(t/br));CS.range;function to(t){return on(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Ti)/Jh)}const Dc=to(0),Jl=to(1),SS=to(2),DS=to(3),Eo=to(4),MS=to(5),TS=to(6);Dc.range;Jl.range;SS.range;DS.range;Eo.range;MS.range;TS.range;function no(t){return on(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Jh)}const O0=no(0),ec=no(1),kS=no(2),jS=no(3),Vo=no(4),AS=no(5),_S=no(6);O0.range;ec.range;kS.range;jS.range;Vo.range;AS.range;_S.range;const rf=on(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());rf.range;const OS=on(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());OS.range;const Cr=on(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Cr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:on(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});Cr.range;const Ua=on(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Ua.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:on(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});Ua.range;function NS(t,e,n,i,r,a){const o=[[vo,1,yr],[vo,5,5*yr],[vo,15,15*yr],[vo,30,30*yr],[a,1,Ti],[a,5,5*Ti],[a,15,15*Ti],[a,30,30*Ti],[r,1,xr],[r,3,3*xr],[r,6,6*xr],[r,12,12*xr],[i,1,br],[i,2,2*br],[n,1,Jh],[e,1,sg],[e,3,3*sg],[t,1,Xc]];function s(u,h,f){const d=h<u;d&&([u,h]=[h,u]);const g=f&&typeof f.range=="function"?f:c(u,h,f),p=g?g.range(u,+h+1):[];return d?p.reverse():p}function c(u,h,f){const d=Math.abs(h-u)/f,g=Gh(([,,v])=>v).right(o,d);if(g===o.length)return t.every(Gu(u/Xc,h/Xc,f));if(g===0)return Zl.every(Math.max(Gu(u,h,f),1));const[p,y]=o[d/o[g-1][2]<o[g][2]/d?g-1:g];return p.every(y)}return[s,c]}const[IS,$S]=NS(Cr,rf,Dc,Zs,tf,ef);function Kc(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Qc(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function os(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function LS(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,a=t.days,o=t.shortDays,s=t.months,c=t.shortMonths,u=ss(r),h=ls(r),f=ss(a),d=ls(a),g=ss(o),p=ls(o),y=ss(s),v=ls(s),m=ss(c),I=ls(c),j={a:B,A:X,b:z,B:C,c:null,d:dg,e:dg,f:rD,g:gD,G:mD,H:tD,I:nD,j:iD,L:N0,m:aD,M:oD,p:A,q:M,Q:mg,s:yg,S:sD,u:lD,U:cD,V:uD,w:hD,W:fD,x:null,X:null,y:dD,Y:pD,Z:yD,"%":pg},w={a:O,A:K,b:Q,B:se,c:null,d:gg,e:gg,f:bD,g:OD,G:ID,H:xD,I:vD,j:wD,L:$0,m:CD,M:SD,p:T,q:Z,Q:mg,s:yg,S:DD,u:MD,U:TD,V:kD,w:jD,W:AD,x:null,X:null,y:_D,Y:ND,Z:$D,"%":pg},S={a:$,A:V,b:q,B:ae,c:G,d:hg,e:hg,f:QS,g:ug,G:cg,H:fg,I:fg,j:qS,L:KS,m:YS,M:US,p:x,q:GS,Q:JS,s:eD,S:XS,u:RS,U:BS,V:HS,w:FS,W:WS,x:_,X:b,y:ug,Y:cg,Z:zS,"%":ZS};j.x=P(n,j),j.X=P(i,j),j.c=P(e,j),w.x=P(n,w),w.X=P(i,w),w.c=P(e,w);function P(ie,ue){return function(he){var Y=[],ge=-1,oe=0,ce=ie.length,N,U,ve;for(he instanceof Date||(he=new Date(+he));++ge<ce;)ie.charCodeAt(ge)===37&&(Y.push(ie.slice(oe,ge)),(U=lg[N=ie.charAt(++ge)])!=null?N=ie.charAt(++ge):U=N==="e"?" ":"0",(ve=ue[N])&&(N=ve(he,U)),Y.push(N),oe=ge+1);return Y.push(ie.slice(oe,ge)),Y.join("")}}function W(ie,ue){return function(he){var Y=os(1900,void 0,1),ge=D(Y,ie,he+="",0),oe,ce;if(ge!=he.length)return null;if("Q"in Y)return new Date(Y.Q);if("s"in Y)return new Date(Y.s*1e3+("L"in Y?Y.L:0));if(ue&&!("Z"in Y)&&(Y.Z=0),"p"in Y&&(Y.H=Y.H%12+Y.p*12),Y.m===void 0&&(Y.m="q"in Y?Y.q:0),"V"in Y){if(Y.V<1||Y.V>53)return null;"w"in Y||(Y.w=1),"Z"in Y?(oe=Qc(os(Y.y,0,1)),ce=oe.getUTCDay(),oe=ce>4||ce===0?ec.ceil(oe):ec(oe),oe=nf.offset(oe,(Y.V-1)*7),Y.y=oe.getUTCFullYear(),Y.m=oe.getUTCMonth(),Y.d=oe.getUTCDate()+(Y.w+6)%7):(oe=Kc(os(Y.y,0,1)),ce=oe.getDay(),oe=ce>4||ce===0?Jl.ceil(oe):Jl(oe),oe=Zs.offset(oe,(Y.V-1)*7),Y.y=oe.getFullYear(),Y.m=oe.getMonth(),Y.d=oe.getDate()+(Y.w+6)%7)}else("W"in Y||"U"in Y)&&("w"in Y||(Y.w="u"in Y?Y.u%7:"W"in Y?1:0),ce="Z"in Y?Qc(os(Y.y,0,1)).getUTCDay():Kc(os(Y.y,0,1)).getDay(),Y.m=0,Y.d="W"in Y?(Y.w+6)%7+Y.W*7-(ce+5)%7:Y.w+Y.U*7-(ce+6)%7);return"Z"in Y?(Y.H+=Y.Z/100|0,Y.M+=Y.Z%100,Qc(Y)):Kc(Y)}}function D(ie,ue,he,Y){for(var ge=0,oe=ue.length,ce=he.length,N,U;ge<oe;){if(Y>=ce)return-1;if(N=ue.charCodeAt(ge++),N===37){if(N=ue.charAt(ge++),U=S[N in lg?ue.charAt(ge++):N],!U||(Y=U(ie,he,Y))<0)return-1}else if(N!=he.charCodeAt(Y++))return-1}return Y}function x(ie,ue,he){var Y=u.exec(ue.slice(he));return Y?(ie.p=h.get(Y[0].toLowerCase()),he+Y[0].length):-1}function $(ie,ue,he){var Y=g.exec(ue.slice(he));return Y?(ie.w=p.get(Y[0].toLowerCase()),he+Y[0].length):-1}function V(ie,ue,he){var Y=f.exec(ue.slice(he));return Y?(ie.w=d.get(Y[0].toLowerCase()),he+Y[0].length):-1}function q(ie,ue,he){var Y=m.exec(ue.slice(he));return Y?(ie.m=I.get(Y[0].toLowerCase()),he+Y[0].length):-1}function ae(ie,ue,he){var Y=y.exec(ue.slice(he));return Y?(ie.m=v.get(Y[0].toLowerCase()),he+Y[0].length):-1}function G(ie,ue,he){return D(ie,e,ue,he)}function _(ie,ue,he){return D(ie,n,ue,he)}function b(ie,ue,he){return D(ie,i,ue,he)}function B(ie){return o[ie.getDay()]}function X(ie){return a[ie.getDay()]}function z(ie){return c[ie.getMonth()]}function C(ie){return s[ie.getMonth()]}function A(ie){return r[+(ie.getHours()>=12)]}function M(ie){return 1+~~(ie.getMonth()/3)}function O(ie){return o[ie.getUTCDay()]}function K(ie){return a[ie.getUTCDay()]}function Q(ie){return c[ie.getUTCMonth()]}function se(ie){return s[ie.getUTCMonth()]}function T(ie){return r[+(ie.getUTCHours()>=12)]}function Z(ie){return 1+~~(ie.getUTCMonth()/3)}return{format:function(ie){var ue=P(ie+="",j);return ue.toString=function(){return ie},ue},parse:function(ie){var ue=W(ie+="",!1);return ue.toString=function(){return ie},ue},utcFormat:function(ie){var ue=P(ie+="",w);return ue.toString=function(){return ie},ue},utcParse:function(ie){var ue=W(ie+="",!0);return ue.toString=function(){return ie},ue}}}var lg={"-":"",_:" ",0:"0"},dn=/^\s*\d+/,PS=/^%/,ES=/[\\^$*+?|[\]().{}]/g;function gt(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",a=r.length;return i+(a<n?new Array(n-a+1).join(e)+r:r)}function VS(t){return t.replace(ES,"\\$&")}function ss(t){return new RegExp("^(?:"+t.map(VS).join("|")+")","i")}function ls(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function FS(t,e,n){var i=dn.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function RS(t,e,n){var i=dn.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function BS(t,e,n){var i=dn.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function HS(t,e,n){var i=dn.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function WS(t,e,n){var i=dn.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function cg(t,e,n){var i=dn.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function ug(t,e,n){var i=dn.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function zS(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function GS(t,e,n){var i=dn.exec(e.slice(n,n+1));return i?(t.q=i[0]*3-3,n+i[0].length):-1}function YS(t,e,n){var i=dn.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function hg(t,e,n){var i=dn.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function qS(t,e,n){var i=dn.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function fg(t,e,n){var i=dn.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function US(t,e,n){var i=dn.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function XS(t,e,n){var i=dn.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function KS(t,e,n){var i=dn.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function QS(t,e,n){var i=dn.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function ZS(t,e,n){var i=PS.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function JS(t,e,n){var i=dn.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function eD(t,e,n){var i=dn.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function dg(t,e){return gt(t.getDate(),e,2)}function tD(t,e){return gt(t.getHours(),e,2)}function nD(t,e){return gt(t.getHours()%12||12,e,2)}function iD(t,e){return gt(1+Zs.count(Cr(t),t),e,3)}function N0(t,e){return gt(t.getMilliseconds(),e,3)}function rD(t,e){return N0(t,e)+"000"}function aD(t,e){return gt(t.getMonth()+1,e,2)}function oD(t,e){return gt(t.getMinutes(),e,2)}function sD(t,e){return gt(t.getSeconds(),e,2)}function lD(t){var e=t.getDay();return e===0?7:e}function cD(t,e){return gt(Dc.count(Cr(t)-1,t),e,2)}function I0(t){var e=t.getDay();return e>=4||e===0?Eo(t):Eo.ceil(t)}function uD(t,e){return t=I0(t),gt(Eo.count(Cr(t),t)+(Cr(t).getDay()===4),e,2)}function hD(t){return t.getDay()}function fD(t,e){return gt(Jl.count(Cr(t)-1,t),e,2)}function dD(t,e){return gt(t.getFullYear()%100,e,2)}function gD(t,e){return t=I0(t),gt(t.getFullYear()%100,e,2)}function pD(t,e){return gt(t.getFullYear()%1e4,e,4)}function mD(t,e){var n=t.getDay();return t=n>=4||n===0?Eo(t):Eo.ceil(t),gt(t.getFullYear()%1e4,e,4)}function yD(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+gt(e/60|0,"0",2)+gt(e%60,"0",2)}function gg(t,e){return gt(t.getUTCDate(),e,2)}function xD(t,e){return gt(t.getUTCHours(),e,2)}function vD(t,e){return gt(t.getUTCHours()%12||12,e,2)}function wD(t,e){return gt(1+nf.count(Ua(t),t),e,3)}function $0(t,e){return gt(t.getUTCMilliseconds(),e,3)}function bD(t,e){return $0(t,e)+"000"}function CD(t,e){return gt(t.getUTCMonth()+1,e,2)}function SD(t,e){return gt(t.getUTCMinutes(),e,2)}function DD(t,e){return gt(t.getUTCSeconds(),e,2)}function MD(t){var e=t.getUTCDay();return e===0?7:e}function TD(t,e){return gt(O0.count(Ua(t)-1,t),e,2)}function L0(t){var e=t.getUTCDay();return e>=4||e===0?Vo(t):Vo.ceil(t)}function kD(t,e){return t=L0(t),gt(Vo.count(Ua(t),t)+(Ua(t).getUTCDay()===4),e,2)}function jD(t){return t.getUTCDay()}function AD(t,e){return gt(ec.count(Ua(t)-1,t),e,2)}function _D(t,e){return gt(t.getUTCFullYear()%100,e,2)}function OD(t,e){return t=L0(t),gt(t.getUTCFullYear()%100,e,2)}function ND(t,e){return gt(t.getUTCFullYear()%1e4,e,4)}function ID(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Vo(t):Vo.ceil(t),gt(t.getUTCFullYear()%1e4,e,4)}function $D(){return"+0000"}function pg(){return"%"}function mg(t){return+t}function yg(t){return Math.floor(+t/1e3)}var fo,P0;LD({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function LD(t){return fo=LS(t),P0=fo.format,fo.parse,fo.utcFormat,fo.utcParse,fo}function PD(t){return new Date(t)}function ED(t){return t instanceof Date?+t:+new Date(+t)}function E0(t,e,n,i,r,a,o,s,c,u){var h=T0(),f=h.invert,d=h.domain,g=u(".%L"),p=u(":%S"),y=u("%I:%M"),v=u("%I %p"),m=u("%a %d"),I=u("%b %d"),j=u("%B"),w=u("%Y");function S(P){return(c(P)<P?g:s(P)<P?p:o(P)<P?y:a(P)<P?v:i(P)<P?r(P)<P?m:I:n(P)<P?j:w)(P)}return h.invert=function(P){return new Date(f(P))},h.domain=function(P){return arguments.length?d(Array.from(P,ED)):d().map(PD)},h.ticks=function(P){var W=d();return t(W[0],W[W.length-1],P??10)},h.tickFormat=function(P,W){return W==null?S:u(W)},h.nice=function(P){var W=d();return(!P||typeof P.range!="function")&&(P=e(W[0],W[W.length-1],P??10)),P?d(mS(W,P)):h},h.copy=function(){return Kh(h,E0(t,e,n,i,r,a,o,s,c,u))},h}function Zr(){return Ko.apply(E0(IS,$S,Cr,rf,Dc,Zs,tf,ef,vo,P0).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}const af=k.createContext({});function of(t){const e=k.useRef(null);return e.current===null&&(e.current=t()),e.current}const sf=typeof window<"u",V0=sf?k.useLayoutEffect:k.useEffect,Mc=k.createContext(null),lf=k.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class VD extends Bh.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const i=n.offsetParent,r=i instanceof HTMLElement&&i.offsetWidth||0,a=this.props.sizeRef.current;a.height=n.offsetHeight||0,a.width=n.offsetWidth||0,a.top=n.offsetTop,a.left=n.offsetLeft,a.right=r-a.width-a.left}return null}componentDidUpdate(){}render(){return this.props.children}}function FD({children:t,isPresent:e,anchorX:n}){const i=k.useId(),r=k.useRef(null),a=k.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=k.useContext(lf);return k.useInsertionEffect(()=>{const{width:s,height:c,top:u,left:h,right:f}=a.current;if(e||!r.current||!s||!c)return;const d=n==="left"?`left: ${h}`:`right: ${f}`;r.current.dataset.motionPopId=i;const g=document.createElement("style");return o&&(g.nonce=o),document.head.appendChild(g),g.sheet&&g.sheet.insertRule(`
|
|
23
|
-
[data-motion-pop-id="${i}"] {
|
|
24
|
-
position: absolute !important;
|
|
25
|
-
width: ${s}px !important;
|
|
26
|
-
height: ${c}px !important;
|
|
27
|
-
${d}px !important;
|
|
28
|
-
top: ${u}px !important;
|
|
29
|
-
}
|
|
30
|
-
`),()=>{document.head.contains(g)&&document.head.removeChild(g)}},[e]),l.jsx(VD,{isPresent:e,childRef:r,sizeRef:a,children:Bh.cloneElement(t,{ref:r})})}const RD=({children:t,initial:e,isPresent:n,onExitComplete:i,custom:r,presenceAffectsLayout:a,mode:o,anchorX:s})=>{const c=of(BD),u=k.useId();let h=!0,f=k.useMemo(()=>(h=!1,{id:u,initial:e,isPresent:n,custom:r,onExitComplete:d=>{c.set(d,!0);for(const g of c.values())if(!g)return;i&&i()},register:d=>(c.set(d,!1),()=>c.delete(d))}),[n,c,i]);return a&&h&&(f={...f}),k.useMemo(()=>{c.forEach((d,g)=>c.set(g,!1))},[n]),Bh.useEffect(()=>{!n&&!c.size&&i&&i()},[n]),o==="popLayout"&&(t=l.jsx(FD,{isPresent:n,anchorX:s,children:t})),l.jsx(Mc.Provider,{value:f,children:t})};function BD(){return new Map}function F0(t=!0){const e=k.useContext(Mc);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=e,a=k.useId();k.useEffect(()=>{if(t)return r(a)},[t]);const o=k.useCallback(()=>t&&i&&i(a),[a,i,t]);return!n&&i?[!1,o]:[!0]}const gl=t=>t.key||"";function xg(t){const e=[];return k.Children.forEach(t,n=>{k.isValidElement(n)&&e.push(n)}),e}const mt=({children:t,custom:e,initial:n=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:a="sync",propagate:o=!1,anchorX:s="left"})=>{const[c,u]=F0(o),h=k.useMemo(()=>xg(t),[t]),f=o&&!c?[]:h.map(gl),d=k.useRef(!0),g=k.useRef(h),p=of(()=>new Map),[y,v]=k.useState(h),[m,I]=k.useState(h);V0(()=>{d.current=!1,g.current=h;for(let S=0;S<m.length;S++){const P=gl(m[S]);f.includes(P)?p.delete(P):p.get(P)!==!0&&p.set(P,!1)}},[m,f.length,f.join("-")]);const j=[];if(h!==y){let S=[...h];for(let P=0;P<m.length;P++){const W=m[P],D=gl(W);f.includes(D)||(S.splice(P,0,W),j.push(W))}return a==="wait"&&j.length&&(S=j),I(xg(S)),v(h),null}process.env.NODE_ENV!=="production"&&a==="wait"&&m.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:w}=k.useContext(af);return l.jsx(l.Fragment,{children:m.map(S=>{const P=gl(S),W=o&&!c?!1:h===m||f.includes(P),D=()=>{if(p.has(P))p.set(P,!0);else return;let x=!0;p.forEach($=>{$||(x=!1)}),x&&(w?.(),I(g.current),o&&u?.(),i&&i())};return l.jsx(RD,{isPresent:W,initial:!d.current||n?void 0:!1,custom:e,presenceAffectsLayout:r,mode:a,onExitComplete:W?void 0:D,anchorX:s,children:S},P)})})},pl=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],vg={value:null};function HD(t,e){let n=new Set,i=new Set,r=!1,a=!1;const o=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1},c=0;function u(f){o.has(f)&&(h.schedule(f),t()),c++,f(s)}const h={schedule:(f,d=!1,g=!1)=>{const y=g&&r?n:i;return d&&o.add(f),y.has(f)||y.add(f),f},cancel:f=>{i.delete(f),o.delete(f)},process:f=>{if(s=f,r){a=!0;return}r=!0,[n,i]=[i,n],n.forEach(u),e&&vg.value&&vg.value.frameloop[e].push(c),c=0,n.clear(),r=!1,a&&(a=!1,h.process(f))}};return h}const Sr={},WD=40;function R0(t,e){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=pl.reduce((j,w)=>(j[w]=HD(a,e?w:void 0),j),{}),{setup:s,read:c,resolveKeyframes:u,preUpdate:h,update:f,preRender:d,render:g,postRender:p}=o,y=()=>{const j=Sr.useManualTiming?r.timestamp:performance.now();n=!1,Sr.useManualTiming||(r.delta=i?1e3/60:Math.max(Math.min(j-r.timestamp,WD),1)),r.timestamp=j,r.isProcessing=!0,s.process(r),c.process(r),u.process(r),h.process(r),f.process(r),d.process(r),g.process(r),p.process(r),r.isProcessing=!1,n&&e&&(i=!1,t(y))},v=()=>{n=!0,i=!0,r.isProcessing||t(y)};return{schedule:pl.reduce((j,w)=>{const S=o[w];return j[w]=(P,W=!1,D=!1)=>(n||v(),S.schedule(P,W,D)),j},{}),cancel:j=>{for(let w=0;w<pl.length;w++)o[pl[w]].cancel(j)},state:r,steps:o}}const ji=t=>t,{schedule:Ft,cancel:qr,state:mn,steps:Zc}=R0(typeof requestAnimationFrame<"u"?requestAnimationFrame:ji,!0),B0=k.createContext({strict:!1}),wg={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Fo={};for(const t in wg)Fo[t]={isEnabled:e=>wg[t].some(n=>!!e[n])};function zD(t){for(const e in t)Fo[e]={...Fo[e],...t[e]}}const GD=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function tc(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||GD.has(t)}let H0=t=>!tc(t);function YD(t){t&&(H0=e=>e.startsWith("on")?!tc(e):t(e))}try{YD(require("@emotion/is-prop-valid").default)}catch{}function qD(t,e,n){const i={};for(const r in t)r==="values"&&typeof t.values=="object"||(H0(r)||n===!0&&tc(r)||!e&&!tc(r)||t.draggable&&r.startsWith("onDrag"))&&(i[r]=t[r]);return i}const bg=new Set;function cf(t,e,n){t||bg.has(e)||(console.warn(e),bg.add(e))}function UD(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...i)=>(process.env.NODE_ENV!=="production"&&cf(!1,"motion() is deprecated. Use motion.create() instead."),t(...i));return new Proxy(n,{get:(i,r)=>r==="create"?t:(e.has(r)||e.set(r,t(r)),e.get(r))})}const Tc=k.createContext({});function kc(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Ls(t){return typeof t=="string"||Array.isArray(t)}const uf=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],hf=["initial",...uf];function jc(t){return kc(t.animate)||hf.some(e=>Ls(t[e]))}function W0(t){return!!(jc(t)||t.variants)}function XD(t,e){if(jc(t)){const{initial:n,animate:i}=t;return{initial:n===!1||Ls(n)?n:void 0,animate:Ls(i)?i:void 0}}return t.inherit!==!1?e:{}}function KD(t){const{initial:e,animate:n}=XD(t,k.useContext(Tc));return k.useMemo(()=>({initial:e,animate:n}),[Cg(e),Cg(n)])}function Cg(t){return Array.isArray(t)?t.join(" "):t}const QD=Symbol.for("motionComponentSymbol");function wo(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function ZD(t,e,n){return k.useCallback(i=>{i&&t.onMount&&t.onMount(i),e&&(i?e.mount(i):e.unmount()),n&&(typeof n=="function"?n(i):wo(n)&&(n.current=i))},[e])}const ff=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),JD="framerAppearId",z0="data-"+ff(JD),G0=k.createContext({}),{schedule:df}=R0(queueMicrotask,!1);function eM(t,e,n,i,r){const{visualElement:a}=k.useContext(Tc),o=k.useContext(B0),s=k.useContext(Mc),c=k.useContext(lf).reducedMotion,u=k.useRef(null);i=i||o.renderer,!u.current&&i&&(u.current=i(t,{visualState:e,parent:a,props:n,presenceContext:s,blockInitialAnimation:s?s.initial===!1:!1,reducedMotionConfig:c}));const h=u.current,f=k.useContext(G0);h&&!h.projection&&r&&(h.type==="html"||h.type==="svg")&&tM(u.current,n,r,f);const d=k.useRef(!1);k.useInsertionEffect(()=>{h&&d.current&&h.update(n,s)});const g=n[z0],p=k.useRef(!!g&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return V0(()=>{h&&(d.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),df.render(h.render),p.current&&h.animationState&&h.animationState.animateChanges())}),k.useEffect(()=>{h&&(!p.current&&h.animationState&&h.animationState.animateChanges(),p.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),p.current=!1))}),h}function tM(t,e,n,i){const{layoutId:r,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:u,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Y0(t.parent)),t.projection.setOptions({layoutId:r,layout:a,alwaysMeasureLayout:!!o||s&&wo(s),visualElement:t,animationType:typeof a=="string"?a:"both",initialPromotionConfig:i,crossfade:h,layoutScroll:c,layoutRoot:u})}function Y0(t){if(t)return t.options.allowProjection!==!1?t.projection:Y0(t.parent)}let Qo=()=>{},Dr=()=>{};process.env.NODE_ENV!=="production"&&(Qo=(t,e)=>{!t&&typeof console<"u"&&console.warn(e)},Dr=(t,e)=>{if(!t)throw new Error(e)});function nM({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:i,Component:r}){t&&zD(t);function a(s,c){let u;const h={...k.useContext(lf),...s,layoutId:iM(s)},{isStatic:f}=h,d=KD(s),g=i(s,f);if(!f&&sf){rM(h,t);const p=aM(h);u=p.MeasureLayout,d.visualElement=eM(r,g,h,e,p.ProjectionNode)}return l.jsxs(Tc.Provider,{value:d,children:[u&&d.visualElement?l.jsx(u,{visualElement:d.visualElement,...h}):null,n(r,s,ZD(g,d.visualElement,c),g,f,d.visualElement)]})}a.displayName=`motion.${typeof r=="string"?r:`create(${r.displayName??r.name??""})`}`;const o=k.forwardRef(a);return o[QD]=r,o}function iM({layoutId:t}){const e=k.useContext(af).id;return e&&t!==void 0?e+"-"+t:t}function rM(t,e){const n=k.useContext(B0).strict;if(process.env.NODE_ENV!=="production"&&e&&n){const i="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?Qo(!1,i):Dr(!1,i)}}function aM(t){const{drag:e,layout:n}=Fo;if(!e&&!n)return{};const i={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const q0=t=>e=>typeof e=="string"&&e.startsWith(t),gf=q0("--"),oM=q0("var(--"),pf=t=>oM(t)?sM.test(t.split("/*")[0].trim()):!1,sM=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ps={};function lM(t){for(const e in t)Ps[e]=t[e],gf(e)&&(Ps[e].isCSSVariable=!0)}const Zo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Jo=new Set(Zo);function U0(t,{layout:e,layoutId:n}){return Jo.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Ps[t]||t==="opacity")}const X0=(t,e)=>e&&typeof t=="number"?e.transform(t):t,Mr=(t,e,n)=>n>e?e:n<t?t:n,es={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Es={...es,transform:t=>Mr(0,1,t)},ml={...es,default:1},Sg={...es,transform:Math.round},Js=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Wr=Js("deg"),nr=Js("%"),Je=Js("px"),cM=Js("vh"),uM=Js("vw"),Dg={...nr,parse:t=>nr.parse(t)/100,transform:t=>nr.transform(t*100)},hM={rotate:Wr,rotateX:Wr,rotateY:Wr,rotateZ:Wr,scale:ml,scaleX:ml,scaleY:ml,scaleZ:ml,skew:Wr,skewX:Wr,skewY:Wr,distance:Je,translateX:Je,translateY:Je,translateZ:Je,x:Je,y:Je,z:Je,perspective:Je,transformPerspective:Je,opacity:Es,originX:Dg,originY:Dg,originZ:Je},mf={borderWidth:Je,borderTopWidth:Je,borderRightWidth:Je,borderBottomWidth:Je,borderLeftWidth:Je,borderRadius:Je,radius:Je,borderTopLeftRadius:Je,borderTopRightRadius:Je,borderBottomRightRadius:Je,borderBottomLeftRadius:Je,width:Je,maxWidth:Je,height:Je,maxHeight:Je,top:Je,right:Je,bottom:Je,left:Je,padding:Je,paddingTop:Je,paddingRight:Je,paddingBottom:Je,paddingLeft:Je,margin:Je,marginTop:Je,marginRight:Je,marginBottom:Je,marginLeft:Je,backgroundPositionX:Je,backgroundPositionY:Je,...hM,zIndex:Sg,fillOpacity:Es,strokeOpacity:Es,numOctaves:Sg},fM={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},dM=Zo.length;function gM(t,e,n){let i="",r=!0;for(let a=0;a<dM;a++){const o=Zo[a],s=t[o];if(s===void 0)continue;let c=!0;if(typeof s=="number"?c=s===(o.startsWith("scale")?1:0):c=parseFloat(s)===0,!c||n){const u=X0(s,mf[o]);if(!c){r=!1;const h=fM[o]||o;i+=`${h}(${u}) `}n&&(e[o]=u)}}return i=i.trim(),n?i=n(e,r?"":i):r&&(i="none"),i}function yf(t,e,n){const{style:i,vars:r,transformOrigin:a}=t;let o=!1,s=!1;for(const c in e){const u=e[c];if(Jo.has(c)){o=!0;continue}else if(gf(c)){r[c]=u;continue}else{const h=X0(u,mf[c]);c.startsWith("origin")?(s=!0,a[c]=h):i[c]=h}}if(e.transform||(o||n?i.transform=gM(e,t.transform,n):i.transform&&(i.transform="none")),s){const{originX:c="50%",originY:u="50%",originZ:h=0}=a;i.transformOrigin=`${c} ${u} ${h}`}}const xf=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Mn=t=>!!(t&&t.getVelocity);function K0(t,e,n){for(const i in e)!Mn(e[i])&&!U0(i,n)&&(t[i]=e[i])}function pM({transformTemplate:t},e){return k.useMemo(()=>{const n=xf();return yf(n,e,t),Object.assign({},n.vars,n.style)},[e])}function mM(t,e){const n=t.style||{},i={};return K0(i,n,t),Object.assign(i,pM(t,e)),i}function yM(t,e){const n={},i=mM(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const xM={offset:"stroke-dashoffset",array:"stroke-dasharray"},vM={offset:"strokeDashoffset",array:"strokeDasharray"};function wM(t,e,n=1,i=0,r=!0){t.pathLength=1;const a=r?xM:vM;t[a.offset]=Je.transform(-i);const o=Je.transform(e),s=Je.transform(n);t[a.array]=`${o} ${s}`}function Q0(t,{attrX:e,attrY:n,attrScale:i,pathLength:r,pathSpacing:a=1,pathOffset:o=0,...s},c,u,h){if(yf(t,s,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:d}=t;f.transform&&(d.transform=f.transform,delete f.transform),(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=h?.transformBox??"fill-box",delete f.transformBox),e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),i!==void 0&&(f.scale=i),r!==void 0&&wM(f,r,a,o,!1)}const Z0=()=>({...xf(),attrs:{}}),J0=t=>typeof t=="string"&&t.toLowerCase()==="svg";function bM(t,e,n,i){const r=k.useMemo(()=>{const a=Z0();return Q0(a,e,J0(i),t.transformTemplate,t.style),{...a.attrs,style:{...a.style}}},[e]);if(t.style){const a={};K0(a,t.style,t),r.style={...a,...r.style}}return r}const CM=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function vf(t){return typeof t!="string"||t.includes("-")?!1:!!(CM.indexOf(t)>-1||/[A-Z]/u.test(t))}function SM(t=!1){return(n,i,r,{latestValues:a},o)=>{const c=(vf(n)?bM:yM)(i,a,o,n),u=qD(i,typeof n=="string",t),h=n!==k.Fragment?{...u,...c,ref:r}:{},{children:f}=i,d=k.useMemo(()=>Mn(f)?f.get():f,[f]);return k.createElement(n,{...h,children:d})}}function Mg(t){const e=[{},{}];return t?.values.forEach((n,i)=>{e[0][i]=n.get(),e[1][i]=n.getVelocity()}),e}function wf(t,e,n,i){if(typeof e=="function"){const[r,a]=Mg(i);e=e(n!==void 0?n:t.custom,r,a)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[r,a]=Mg(i);e=e(n!==void 0?n:t.custom,r,a)}return e}function Nl(t){return Mn(t)?t.get():t}function DM({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,r){return{latestValues:MM(n,i,r,t),renderState:e()}}const ey=t=>(e,n)=>{const i=k.useContext(Tc),r=k.useContext(Mc),a=()=>DM(t,e,i,r);return n?a():of(a)};function MM(t,e,n,i){const r={},a=i(t,{});for(const d in a)r[d]=Nl(a[d]);let{initial:o,animate:s}=t;const c=jc(t),u=W0(t);e&&u&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),s===void 0&&(s=e.animate));let h=n?n.initial===!1:!1;h=h||o===!1;const f=h?s:o;if(f&&typeof f!="boolean"&&!kc(f)){const d=Array.isArray(f)?f:[f];for(let g=0;g<d.length;g++){const p=wf(t,d[g]);if(p){const{transitionEnd:y,transition:v,...m}=p;for(const I in m){let j=m[I];if(Array.isArray(j)){const w=h?j.length-1:0;j=j[w]}j!==null&&(r[I]=j)}for(const I in y)r[I]=y[I]}}}return r}function bf(t,e,n){const{style:i}=t,r={};for(const a in i)(Mn(i[a])||e.style&&Mn(e.style[a])||U0(a,t)||n?.getValue(a)?.liveStyle!==void 0)&&(r[a]=i[a]);return r}const TM={useVisualState:ey({scrapeMotionValuesFromProps:bf,createRenderState:xf})};function ty(t,e,n){const i=bf(t,e,n);for(const r in t)if(Mn(t[r])||Mn(e[r])){const a=Zo.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[a]=t[r]}return i}const kM={useVisualState:ey({scrapeMotionValuesFromProps:ty,createRenderState:Z0})};function jM(t,e){return function(i,{forwardMotionProps:r}={forwardMotionProps:!1}){const o={...vf(i)?kM:TM,preloadedFeatures:t,useRender:SM(r),createVisualElement:e,Component:i};return nM(o)}}function Vs(t,e,n){const i=t.getProps();return wf(i,e,n!==void 0?n:i.custom,t)}const Ku=t=>Array.isArray(t);let Il;function AM(){Il=void 0}const ei={now:()=>(Il===void 0&&ei.set(mn.isProcessing||Sr.useManualTiming?mn.timestamp:performance.now()),Il),set:t=>{Il=t,queueMicrotask(AM)}};function Cf(t,e){t.indexOf(e)===-1&&t.push(e)}function Sf(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Df{constructor(){this.subscriptions=[]}add(e){return Cf(this.subscriptions,e),()=>Sf(this.subscriptions,e)}notify(e,n,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,n,i);else for(let a=0;a<r;a++){const o=this.subscriptions[a];o&&o(e,n,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function ny(t,e){return e?t*(1e3/e):0}const Tg=30,_M=t=>!isNaN(parseFloat(t));class OM{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,r=!0)=>{const a=ei.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty();r&&this.events.renderRequest?.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=ei.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=_M(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&cf(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Df);const i=this.events[e].add(n);return e==="change"?()=>{i(),Ft.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=ei.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Tg)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Tg);return ny(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ro(t,e){return new OM(t,e)}function NM(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ro(n))}function IM(t){return Ku(t)?t[t.length-1]||0:t}function $M(t,e){const n=Vs(t,e);let{transitionEnd:i={},transition:r={},...a}=n||{};a={...a,...i};for(const o in a){const s=IM(a[o]);NM(t,o,s)}}function LM(t){return!!(Mn(t)&&t.add)}function Qu(t,e){const n=t.getValue("willChange");if(LM(n))return n.add(e);if(!n&&Sr.WillChange){const i=new Sr.WillChange("auto");t.addValue("willChange",i),i.add(e)}}function iy(t){return t.props[z0]}const PM=t=>t!==null;function EM(t,{repeat:e,repeatType:n="loop"},i){const r=t.filter(PM),a=e&&n!=="loop"&&e%2===1?0:r.length-1;return r[a]}const VM={type:"spring",stiffness:500,damping:25,restSpeed:10},FM=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),RM={type:"keyframes",duration:.8},BM={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},HM=(t,{keyframes:e})=>e.length>2?RM:Jo.has(t)?t.startsWith("scale")?FM(e[1]):VM:BM;function WM({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:r,repeat:a,repeatType:o,repeatDelay:s,from:c,elapsed:u,...h}){return!!Object.keys(h).length}function Mf(t,e){return t?.[e]??t?.default??t}const Vi=t=>t*1e3,ir=t=>t/1e3,Ms=t=>Math.round(t*1e5)/1e5,Tf=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function zM(t){return t==null}const GM=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,kf=(t,e)=>n=>!!(typeof n=="string"&&GM.test(n)&&n.startsWith(t)||e&&!zM(n)&&Object.prototype.hasOwnProperty.call(n,e)),ry=(t,e,n)=>i=>{if(typeof i!="string")return i;const[r,a,o,s]=i.match(Tf);return{[t]:parseFloat(r),[e]:parseFloat(a),[n]:parseFloat(o),alpha:s!==void 0?parseFloat(s):1}},YM=t=>Mr(0,255,t),Jc={...es,transform:t=>Math.round(YM(t))},Ba={test:kf("rgb","red"),parse:ry("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Jc.transform(t)+", "+Jc.transform(e)+", "+Jc.transform(n)+", "+Ms(Es.transform(i))+")"};function qM(t){let e="",n="",i="",r="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),r=t.substring(4,5),e+=e,n+=n,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const Zu={test:kf("#"),parse:qM,transform:Ba.transform},bo={test:kf("hsl","hue"),parse:ry("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+nr.transform(Ms(e))+", "+nr.transform(Ms(n))+", "+Ms(Es.transform(i))+")"},Dn={test:t=>Ba.test(t)||Zu.test(t)||bo.test(t),parse:t=>Ba.test(t)?Ba.parse(t):bo.test(t)?bo.parse(t):Zu.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Ba.transform(t):bo.transform(t)},UM=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function XM(t){return isNaN(t)&&typeof t=="string"&&(t.match(Tf)?.length||0)+(t.match(UM)?.length||0)>0}const ay="number",oy="color",KM="var",QM="var(",kg="${}",ZM=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Fs(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},r=[];let a=0;const s=e.replace(ZM,c=>(Dn.test(c)?(i.color.push(a),r.push(oy),n.push(Dn.parse(c))):c.startsWith(QM)?(i.var.push(a),r.push(KM),n.push(c)):(i.number.push(a),r.push(ay),n.push(parseFloat(c))),++a,kg)).split(kg);return{values:n,split:s,indexes:i,types:r}}function sy(t){return Fs(t).values}function ly(t){const{split:e,types:n}=Fs(t),i=e.length;return r=>{let a="";for(let o=0;o<i;o++)if(a+=e[o],r[o]!==void 0){const s=n[o];s===ay?a+=Ms(r[o]):s===oy?a+=Dn.transform(r[o]):a+=r[o]}return a}}const JM=t=>typeof t=="number"?0:t;function eT(t){const e=sy(t);return ly(t)(e.map(JM))}const Ur={test:XM,parse:sy,createTransformer:ly,getAnimatableNone:eT};function eu(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function tT({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,e/=100,n/=100;let r=0,a=0,o=0;if(!e)r=a=o=n;else{const s=n<.5?n*(1+e):n+e-n*e,c=2*n-s;r=eu(c,s,t+1/3),a=eu(c,s,t),o=eu(c,s,t-1/3)}return{red:Math.round(r*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:i}}function nc(t,e){return n=>n>0?e:t}const Vt=(t,e,n)=>t+(e-t)*n,tu=(t,e,n)=>{const i=t*t,r=n*(e*e-i)+i;return r<0?0:Math.sqrt(r)},nT=[Zu,Ba,bo],iT=t=>nT.find(e=>e.test(t));function jg(t){const e=iT(t);if(Qo(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return!1;let n=e.parse(t);return e===bo&&(n=tT(n)),n}const Ag=(t,e)=>{const n=jg(t),i=jg(e);if(!n||!i)return nc(t,e);const r={...n};return a=>(r.red=tu(n.red,i.red,a),r.green=tu(n.green,i.green,a),r.blue=tu(n.blue,i.blue,a),r.alpha=Vt(n.alpha,i.alpha,a),Ba.transform(r))},Ju=new Set(["none","hidden"]);function rT(t,e){return Ju.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}const aT=(t,e)=>n=>e(t(n)),el=(...t)=>t.reduce(aT);function oT(t,e){return n=>Vt(t,e,n)}function jf(t){return typeof t=="number"?oT:typeof t=="string"?pf(t)?nc:Dn.test(t)?Ag:cT:Array.isArray(t)?cy:typeof t=="object"?Dn.test(t)?Ag:sT:nc}function cy(t,e){const n=[...t],i=n.length,r=t.map((a,o)=>jf(a)(a,e[o]));return a=>{for(let o=0;o<i;o++)n[o]=r[o](a);return n}}function sT(t,e){const n={...t,...e},i={};for(const r in n)t[r]!==void 0&&e[r]!==void 0&&(i[r]=jf(t[r])(t[r],e[r]));return r=>{for(const a in i)n[a]=i[a](r);return n}}function lT(t,e){const n=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const a=e.types[r],o=t.indexes[a][i[a]],s=t.values[o]??0;n[r]=s,i[a]++}return n}const cT=(t,e)=>{const n=Ur.createTransformer(e),i=Fs(t),r=Fs(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?Ju.has(t)&&!r.values.length||Ju.has(e)&&!i.values.length?rT(t,e):el(cy(lT(i,r),r.values),n):(Qo(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),nc(t,e))};function uy(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Vt(t,e,n):jf(t)(t,e)}const uT=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Ft.update(e,n),stop:()=>qr(e),now:()=>mn.isProcessing?mn.timestamp:ei.now()}},hy=(t,e,n=10)=>{let i="";const r=Math.max(Math.round(e/n),2);for(let a=0;a<r;a++)i+=t(a/(r-1))+", ";return`linear(${i.substring(0,i.length-2)})`},ic=2e4;function Af(t){let e=0;const n=50;let i=t.next(e);for(;!i.done&&e<ic;)e+=n,i=t.next(e);return e>=ic?1/0:e}function hT(t,e=100,n){const i=n({...t,keyframes:[0,e]}),r=Math.min(Af(i),ic);return{type:"keyframes",ease:a=>i.next(r*a).value/e,duration:ir(r)}}const fT=5;function fy(t,e,n){const i=Math.max(e-fT,0);return ny(n-t(i),e-i)}const Pt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},nu=.001;function dT({duration:t=Pt.duration,bounce:e=Pt.bounce,velocity:n=Pt.velocity,mass:i=Pt.mass}){let r,a;Qo(t<=Vi(Pt.maxDuration),"Spring duration must be 10 seconds or less");let o=1-e;o=Mr(Pt.minDamping,Pt.maxDamping,o),t=Mr(Pt.minDuration,Pt.maxDuration,ir(t)),o<1?(r=u=>{const h=u*o,f=h*t,d=h-n,g=eh(u,o),p=Math.exp(-f);return nu-d/g*p},a=u=>{const f=u*o*t,d=f*n+n,g=Math.pow(o,2)*Math.pow(u,2)*t,p=Math.exp(-f),y=eh(Math.pow(u,2),o);return(-r(u)+nu>0?-1:1)*((d-g)*p)/y}):(r=u=>{const h=Math.exp(-u*t),f=(u-n)*t+1;return-nu+h*f},a=u=>{const h=Math.exp(-u*t),f=(n-u)*(t*t);return h*f});const s=5/t,c=pT(r,a,s);if(t=Vi(t),isNaN(c))return{stiffness:Pt.stiffness,damping:Pt.damping,duration:t};{const u=Math.pow(c,2)*i;return{stiffness:u,damping:o*2*Math.sqrt(i*u),duration:t}}}const gT=12;function pT(t,e,n){let i=n;for(let r=1;r<gT;r++)i=i-t(i)/e(i);return i}function eh(t,e){return t*Math.sqrt(1-e*e)}const mT=["duration","bounce"],yT=["stiffness","damping","mass"];function _g(t,e){return e.some(n=>t[n]!==void 0)}function xT(t){let e={velocity:Pt.velocity,stiffness:Pt.stiffness,damping:Pt.damping,mass:Pt.mass,isResolvedFromDuration:!1,...t};if(!_g(t,yT)&&_g(t,mT))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,a=2*Mr(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:Pt.mass,stiffness:r,damping:a}}else{const n=dT(t);e={...e,...n,mass:Pt.mass},e.isResolvedFromDuration=!0}return e}function rc(t=Pt.visualDuration,e=Pt.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:r}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:u,mass:h,duration:f,velocity:d,isResolvedFromDuration:g}=xT({...n,velocity:-ir(n.velocity||0)}),p=d||0,y=u/(2*Math.sqrt(c*h)),v=o-a,m=ir(Math.sqrt(c/h)),I=Math.abs(v)<5;i||(i=I?Pt.restSpeed.granular:Pt.restSpeed.default),r||(r=I?Pt.restDelta.granular:Pt.restDelta.default);let j;if(y<1){const S=eh(m,y);j=P=>{const W=Math.exp(-y*m*P);return o-W*((p+y*m*v)/S*Math.sin(S*P)+v*Math.cos(S*P))}}else if(y===1)j=S=>o-Math.exp(-m*S)*(v+(p+m*v)*S);else{const S=m*Math.sqrt(y*y-1);j=P=>{const W=Math.exp(-y*m*P),D=Math.min(S*P,300);return o-W*((p+y*m*v)*Math.sinh(D)+S*v*Math.cosh(D))/S}}const w={calculatedDuration:g&&f||null,next:S=>{const P=j(S);if(g)s.done=S>=f;else{let W=S===0?p:0;y<1&&(W=S===0?Vi(p):fy(j,S,P));const D=Math.abs(W)<=i,x=Math.abs(o-P)<=r;s.done=D&&x}return s.value=s.done?o:P,s},toString:()=>{const S=Math.min(Af(w),ic),P=hy(W=>w.next(S*W).value,S,30);return S+"ms "+P},toTransition:()=>{}};return w}rc.applyToOptions=t=>{const e=hT(t,100,rc);return t.ease=e.ease,t.duration=Vi(e.duration),t.type="keyframes",t};function th({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:u=.5,restSpeed:h}){const f=t[0],d={done:!1,value:f},g=D=>s!==void 0&&D<s||c!==void 0&&D>c,p=D=>s===void 0?c:c===void 0||Math.abs(s-D)<Math.abs(c-D)?s:c;let y=n*e;const v=f+y,m=o===void 0?v:o(v);m!==v&&(y=m-f);const I=D=>-y*Math.exp(-D/i),j=D=>m+I(D),w=D=>{const x=I(D),$=j(D);d.done=Math.abs(x)<=u,d.value=d.done?m:$};let S,P;const W=D=>{g(d.value)&&(S=D,P=rc({keyframes:[d.value,p(d.value)],velocity:fy(j,D,d.value),damping:r,stiffness:a,restDelta:u,restSpeed:h}))};return W(0),{calculatedDuration:null,next:D=>{let x=!1;return!P&&S===void 0&&(x=!0,w(D),W(D)),S!==void 0&&D>=S?P.next(D-S):(!x&&w(D),d)}}}const Rs=(t,e,n)=>{const i=e-t;return i===0?1:(n-t)/i};function vT(t,e,n){const i=[],r=n||Sr.mix||uy,a=t.length-1;for(let o=0;o<a;o++){let s=r(t[o],t[o+1]);if(e){const c=Array.isArray(e)?e[o]||ji:e;s=el(c,s)}i.push(s)}return i}function wT(t,e,{clamp:n=!0,ease:i,mixer:r}={}){const a=t.length;if(Dr(a===e.length,"Both input and output ranges must be the same length"),a===1)return()=>e[0];if(a===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[a-1]&&(t=[...t].reverse(),e=[...e].reverse());const s=vT(e,i,r),c=s.length,u=h=>{if(o&&h<t[0])return e[0];let f=0;if(c>1)for(;f<t.length-2&&!(h<t[f+1]);f++);const d=Rs(t[f],t[f+1],h);return s[f](d)};return n?h=>u(Mr(t[0],t[a-1],h)):u}function bT(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const r=Rs(0,e,i);t.push(Vt(n,1,r))}}function CT(t){const e=[0];return bT(e,t.length-1),e}function ST(t,e){return t.map(n=>n*e)}const dy=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,DT=1e-7,MT=12;function TT(t,e,n,i,r){let a,o,s=0;do o=e+(n-e)/2,a=dy(o,i,r)-t,a>0?n=o:e=o;while(Math.abs(a)>DT&&++s<MT);return o}function tl(t,e,n,i){if(t===e&&n===i)return ji;const r=a=>TT(a,0,1,t,n);return a=>a===0||a===1?a:dy(r(a),e,i)}const kT=tl(.42,0,1,1),jT=tl(0,0,.58,1),gy=tl(.42,0,.58,1),AT=t=>Array.isArray(t)&&typeof t[0]!="number",py=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,my=t=>e=>1-t(1-e),yy=tl(.33,1.53,.69,.99),_f=my(yy),xy=py(_f),vy=t=>(t*=2)<1?.5*_f(t):.5*(2-Math.pow(2,-10*(t-1))),Of=t=>1-Math.sin(Math.acos(t)),wy=my(Of),by=py(Of),Cy=t=>Array.isArray(t)&&typeof t[0]=="number",Og={linear:ji,easeIn:kT,easeInOut:gy,easeOut:jT,circIn:Of,circInOut:by,circOut:wy,backIn:_f,backInOut:xy,backOut:yy,anticipate:vy},_T=t=>typeof t=="string",Ng=t=>{if(Cy(t)){Dr(t.length===4,"Cubic bezier arrays must contain four numerical values.");const[e,n,i,r]=t;return tl(e,n,i,r)}else if(_T(t))return Dr(Og[t]!==void 0,`Invalid easing type '${t}'`),Og[t];return t};function OT(t,e){return t.map(()=>e||gy).splice(0,t.length-1)}function Co({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const r=AT(i)?i.map(Ng):Ng(i),a={done:!1,value:e[0]},o=ST(n&&n.length===e.length?n:CT(e),t),s=wT(o,e,{ease:Array.isArray(r)?r:OT(e,r)});return{calculatedDuration:t,next:c=>(a.value=s(c),a.done=c>=t,a)}}const NT=t=>t!==null;function Nf(t,{repeat:e,repeatType:n="loop"},i,r=1){const a=t.filter(NT),s=r<0||e&&n!=="loop"&&e%2===1?0:a.length-1;return!s||i===void 0?a[s]:i}const IT={decay:th,inertia:th,tween:Co,keyframes:Co,spring:rc};function Sy(t){typeof t.type=="string"&&(t.type=IT[t.type])}class If{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const $T=t=>t/100;class $f extends If{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=(n=!0)=>{if(n){const{motionValue:i}=this.options;i&&i.updatedAt!==ei.now()&&this.tick(ei.now())}this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Sy(e);const{type:n=Co,repeat:i=0,repeatDelay:r=0,repeatType:a,velocity:o=0}=e;let{keyframes:s}=e;const c=n||Co;process.env.NODE_ENV!=="production"&&c!==Co&&Dr(s.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${s}`),c!==Co&&typeof s[0]!="number"&&(this.mixKeyframes=el($T,uy(s[0],s[1])),s=[0,100]);const u=c({...e,keyframes:s});a==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...s].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Af(u));const{calculatedDuration:h}=u;this.calculatedDuration=h,this.resolvedDuration=h+r,this.totalDuration=this.resolvedDuration*(i+1)-r,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:i,totalDuration:r,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:s,calculatedDuration:c}=this;if(this.startTime===null)return i.next(0);const{delay:u=0,keyframes:h,repeat:f,repeatType:d,repeatDelay:g,type:p,onUpdate:y,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const m=this.currentTime-u*(this.playbackSpeed>=0?1:-1),I=this.playbackSpeed>=0?m<0:m>r;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let j=this.currentTime,w=i;if(f){const D=Math.min(this.currentTime,r)/s;let x=Math.floor(D),$=D%1;!$&&D>=1&&($=1),$===1&&x--,x=Math.min(x,f+1),!!(x%2)&&(d==="reverse"?($=1-$,g&&($-=g/s)):d==="mirror"&&(w=o)),j=Mr(0,1,$)*s}const S=I?{done:!1,value:h[0]}:w.next(j);a&&(S.value=a(S.value));let{done:P}=S;!I&&c!==null&&(P=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const W=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return W&&p!==th&&(S.value=Nf(h,this.options,v,this.speed)),y&&y(S.value),W&&this.finish(),S}then(e,n){return this.finished.then(e,n)}get duration(){return ir(this.calculatedDuration)}get time(){return ir(this.currentTime)}set time(e){e=Vi(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(ei.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=ir(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=uT,startTime:n}=this.options;this.driver||(this.driver=e(r=>this.tick(r))),this.options.onPlay?.();const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=n??i),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ei.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function LT(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Ha=t=>t*180/Math.PI,nh=t=>{const e=Ha(Math.atan2(t[1],t[0]));return ih(e)},PT={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:nh,rotateZ:nh,skewX:t=>Ha(Math.atan(t[1])),skewY:t=>Ha(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ih=t=>(t=t%360,t<0&&(t+=360),t),Ig=nh,$g=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Lg=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),ET={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:$g,scaleY:Lg,scale:t=>($g(t)+Lg(t))/2,rotateX:t=>ih(Ha(Math.atan2(t[6],t[5]))),rotateY:t=>ih(Ha(Math.atan2(-t[2],t[0]))),rotateZ:Ig,rotate:Ig,skewX:t=>Ha(Math.atan(t[4])),skewY:t=>Ha(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function rh(t){return t.includes("scale")?1:0}function ah(t,e){if(!t||t==="none")return rh(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,r;if(n)i=ET,r=n;else{const s=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=PT,r=s}if(!r)return rh(e);const a=i[e],o=r[1].split(",").map(FT);return typeof a=="function"?a(o):o[a]}const VT=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return ah(n,e)};function FT(t){return parseFloat(t.trim())}const Pg=t=>t===es||t===Je,RT=new Set(["x","y","z"]),BT=Zo.filter(t=>!RT.has(t));function HT(t){const e=[];return BT.forEach(n=>{const i=t.getValue(n);i!==void 0&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}const Ga={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>ah(e,"x"),y:(t,{transform:e})=>ah(e,"y")};Ga.translateX=Ga.x;Ga.translateY=Ga.y;const Ya=new Set;let oh=!1,sh=!1,lh=!1;function Dy(){if(sh){const t=Array.from(Ya).filter(i=>i.needsMeasurement),e=new Set(t.map(i=>i.element)),n=new Map;e.forEach(i=>{const r=HT(i);r.length&&(n.set(i,r),i.render())}),t.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const r=n.get(i);r&&r.forEach(([a,o])=>{i.getValue(a)?.set(o)})}),t.forEach(i=>i.measureEndState()),t.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}sh=!1,oh=!1,Ya.forEach(t=>t.complete(lh)),Ya.clear()}function My(){Ya.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(sh=!0)})}function WT(){lh=!0,My(),Dy(),lh=!1}class Lf{constructor(e,n,i,r,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=i,this.motionValue=r,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Ya.add(this),oh||(oh=!0,Ft.read(My),Ft.resolveKeyframes(Dy))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:i,motionValue:r}=this;if(e[0]===null){const a=r?.get(),o=e[e.length-1];if(a!==void 0)e[0]=a;else if(i&&n){const s=i.readValue(n,o);s!=null&&(e[0]=s)}e[0]===void 0&&(e[0]=o),r&&a===void 0&&r.set(e[0])}LT(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Ya.delete(this)}cancel(){this.state==="scheduled"&&(Ya.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const zT=t=>t.startsWith("--");function GT(t,e,n){zT(e)?t.style.setProperty(e,n):t.style[e]=n}function Pf(t){let e;return()=>(e===void 0&&(e=t()),e)}const YT=Pf(()=>window.ScrollTimeline!==void 0),qT={};function UT(t,e){const n=Pf(t);return()=>qT[e]??n()}const Ty=UT(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),xs=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Eg={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:xs([0,.65,.55,1]),circOut:xs([.55,0,1,.45]),backIn:xs([.31,.01,.66,-.59]),backOut:xs([.33,1.53,.69,.99])};function ky(t,e){if(t)return typeof t=="function"?Ty()?hy(t,e):"ease-out":Cy(t)?xs(t):Array.isArray(t)?t.map(n=>ky(n,e)||Eg.easeOut):Eg[t]}function XT(t,e,n,{delay:i=0,duration:r=300,repeat:a=0,repeatType:o="loop",ease:s="easeOut",times:c}={},u=void 0){const h={[e]:n};c&&(h.offset=c);const f=ky(s,r);Array.isArray(f)&&(h.easing=f);const d={delay:i,duration:r,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return u&&(d.pseudoElement=u),t.animate(h,d)}function jy(t){return typeof t=="function"&&"applyToOptions"in t}function KT({type:t,...e}){return jy(t)&&Ty()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class QT extends If{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:i,keyframes:r,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:s,onComplete:c}=e;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=e,Dr(typeof e.type!="string",`animateMini doesn't support "type" as a string. Did you mean to import { spring } from "motion"?`);const u=KT(e);this.animation=XT(n,i,r,u,a),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const h=Nf(r,this.options,s,this.speed);this.updateMotionValue?this.updateMotionValue(h):GT(n,i,h),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return ir(Number(e))}get time(){return ir(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=Vi(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&YT()?(this.animation.timeline=e,ji):n(this)}}const Ay={anticipate:vy,backInOut:xy,circInOut:by};function ZT(t){return t in Ay}function JT(t){typeof t.ease=="string"&&ZT(t.ease)&&(t.ease=Ay[t.ease])}const Vg=10;class ek extends QT{constructor(e){JT(e),Sy(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:i,onComplete:r,element:a,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const s=new $f({...o,autoplay:!1}),c=Vi(this.finishedTime??this.time);n.setWithVelocity(s.sample(c-Vg).value,s.sample(c).value,Vg),s.stop()}}const Fg=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Ur.test(t)||t==="0")&&!t.startsWith("url("));function tk(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function nk(t,e,n,i){const r=t[0];if(r===null)return!1;if(e==="display"||e==="visibility")return!0;const a=t[t.length-1],o=Fg(r,e),s=Fg(a,e);return Qo(o===s,`You are trying to animate ${e} from "${r}" to "${a}". ${r} is not an animatable value - to enable this animation set ${r} to a value animatable to ${a} via the \`style\` property.`),!o||!s?!1:tk(t)||(n==="spring"||jy(n))&&i}const ik=new Set(["opacity","clipPath","filter","transform"]),rk=Pf(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ak(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:r,damping:a,type:o}=t;if(!e||!e.owner||!(e.owner.current instanceof HTMLElement))return!1;const{onUpdate:s,transformTemplate:c}=e.owner.getProps();return rk()&&n&&ik.has(n)&&(n!=="transform"||!c)&&!s&&!i&&r!=="mirror"&&a!==0&&o!=="inertia"}const ok=40;class sk extends If{constructor({autoplay:e=!0,delay:n=0,type:i="keyframes",repeat:r=0,repeatDelay:a=0,repeatType:o="loop",keyframes:s,name:c,motionValue:u,element:h,...f}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ei.now();const d={autoplay:e,delay:n,type:i,repeat:r,repeatDelay:a,repeatType:o,name:c,motionValue:u,element:h,...f},g=h?.KeyframeResolver||Lf;this.keyframeResolver=new g(s,(p,y,v)=>this.onKeyframesResolved(p,y,d,!v),c,u,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,r){this.keyframeResolver=void 0;const{name:a,type:o,velocity:s,delay:c,isHandoff:u,onUpdate:h}=i;this.resolvedAt=ei.now(),nk(e,a,o,s)||((Sr.instantAnimations||!c)&&h?.(Nf(e,i,n)),e[0]=e[e.length-1],i.duration=0,i.repeat=0);const d={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>ok?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},g=!u&&ak(d)?new ek({...d,element:d.motionValue.owner.current}):new $f(d);g.finished.then(()=>this.notifyFinished()).catch(ji),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),WT()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const Ef=(t,e,n,i={},r,a)=>o=>{const s=Mf(i,t)||{},c=s.delay||i.delay||0;let{elapsed:u=0}=i;u=u-Vi(c);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...s,delay:-u,onUpdate:d=>{e.set(d),s.onUpdate&&s.onUpdate(d)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:t,motionValue:e,element:a?void 0:r};WM(s)||Object.assign(h,HM(t,h)),h.duration&&(h.duration=Vi(h.duration)),h.repeatDelay&&(h.repeatDelay=Vi(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let f=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(h.duration=0,h.delay===0&&(f=!0)),(Sr.instantAnimations||Sr.skipAnimations)&&(f=!0,h.duration=0,h.delay=0),h.allowFlatten=!s.type&&!s.ease,f&&!a&&e.get()!==void 0){const d=EM(h.keyframes,s);if(d!==void 0){Ft.update(()=>{h.onUpdate(d),h.onComplete()});return}}return s.isSync?new $f(h):new sk(h)},_y=new Set(["width","height","top","left","right","bottom",...Zo]);function lk({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,i}function Oy(t,e,{delay:n=0,transitionOverride:i,type:r}={}){let{transition:a=t.getDefaultTransition(),transitionEnd:o,...s}=e;i&&(a=i);const c=[],u=r&&t.animationState&&t.animationState.getState()[r];for(const h in s){const f=t.getValue(h,t.latestValues[h]??null),d=s[h];if(d===void 0||u&&lk(u,h))continue;const g={delay:n,...Mf(a||{},h)},p=f.get();if(p!==void 0&&!f.isAnimating&&!Array.isArray(d)&&d===p&&!g.velocity)continue;let y=!1;if(window.MotionHandoffAnimation){const m=iy(t);if(m){const I=window.MotionHandoffAnimation(m,h,Ft);I!==null&&(g.startTime=I,y=!0)}}Qu(t,h),f.start(Ef(h,f,d,t.shouldReduceMotion&&_y.has(h)?{type:!1}:g,t,y));const v=f.animation;v&&c.push(v)}return o&&Promise.all(c).then(()=>{Ft.update(()=>{o&&$M(t,o)})}),c}function ch(t,e,n={}){const i=Vs(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const a=i?()=>Promise.all(Oy(t,i,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:h,staggerDirection:f}=r;return ck(t,e,u+c,h,f,n)}:()=>Promise.resolve(),{when:s}=r;if(s){const[c,u]=s==="beforeChildren"?[a,o]:[o,a];return c().then(()=>u())}else return Promise.all([a(),o(n.delay)])}function ck(t,e,n=0,i=0,r=1,a){const o=[],s=(t.variantChildren.size-1)*i,c=r===1?(u=0)=>u*i:(u=0)=>s-u*i;return Array.from(t.variantChildren).sort(uk).forEach((u,h)=>{u.notify("AnimationStart",e),o.push(ch(u,e,{...a,delay:n+c(h)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(o)}function uk(t,e){return t.sortNodePosition(e)}function hk(t,e,n={}){t.notify("AnimationStart",e);let i;if(Array.isArray(e)){const r=e.map(a=>ch(t,a,n));i=Promise.all(r)}else if(typeof e=="string")i=ch(t,e,n);else{const r=typeof e=="function"?Vs(t,e,n.custom):e;i=Promise.all(Oy(t,r,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}function Ny(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const fk=hf.length;function Iy(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Iy(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<fk;n++){const i=hf[n],r=t.props[i];(Ls(r)||r===!1)&&(e[i]=r)}return e}const dk=[...uf].reverse(),gk=uf.length;function pk(t){return e=>Promise.all(e.map(({animation:n,options:i})=>hk(t,n,i)))}function mk(t){let e=pk(t),n=Rg(),i=!0;const r=c=>(u,h)=>{const f=Vs(t,h,c==="exit"?t.presenceContext?.custom:void 0);if(f){const{transition:d,transitionEnd:g,...p}=f;u={...u,...p,...g}}return u};function a(c){e=c(t)}function o(c){const{props:u}=t,h=Iy(t.parent)||{},f=[],d=new Set;let g={},p=1/0;for(let v=0;v<gk;v++){const m=dk[v],I=n[m],j=u[m]!==void 0?u[m]:h[m],w=Ls(j),S=m===c?I.isActive:null;S===!1&&(p=v);let P=j===h[m]&&j!==u[m]&&w;if(P&&i&&t.manuallyAnimateOnMount&&(P=!1),I.protectedKeys={...g},!I.isActive&&S===null||!j&&!I.prevProp||kc(j)||typeof j=="boolean")continue;const W=yk(I.prevProp,j);let D=W||m===c&&I.isActive&&!P&&w||v>p&&w,x=!1;const $=Array.isArray(j)?j:[j];let V=$.reduce(r(m),{});S===!1&&(V={});const{prevResolvedValues:q={}}=I,ae={...q,...V},G=B=>{D=!0,d.has(B)&&(x=!0,d.delete(B)),I.needsAnimating[B]=!0;const X=t.getValue(B);X&&(X.liveStyle=!1)};for(const B in ae){const X=V[B],z=q[B];if(g.hasOwnProperty(B))continue;let C=!1;Ku(X)&&Ku(z)?C=!Ny(X,z):C=X!==z,C?X!=null?G(B):d.add(B):X!==void 0&&d.has(B)?G(B):I.protectedKeys[B]=!0}I.prevProp=j,I.prevResolvedValues=V,I.isActive&&(g={...g,...V}),i&&t.blockInitialAnimation&&(D=!1),D&&(!(P&&W)||x)&&f.push(...$.map(B=>({animation:B,options:{type:m}})))}if(d.size){const v={};if(typeof u.initial!="boolean"){const m=Vs(t,Array.isArray(u.initial)?u.initial[0]:u.initial);m&&m.transition&&(v.transition=m.transition)}d.forEach(m=>{const I=t.getBaseTarget(m),j=t.getValue(m);j&&(j.liveStyle=!0),v[m]=I??null}),f.push({animation:v})}let y=!!f.length;return i&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(y=!1),i=!1,y?e(f):Promise.resolve()}function s(c,u){if(n[c].isActive===u)return Promise.resolve();t.variantChildren?.forEach(f=>f.animationState?.setActive(c,u)),n[c].isActive=u;const h=o(c);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:o,setActive:s,setAnimateFunction:a,getState:()=>n,reset:()=>{n=Rg(),i=!0}}}function yk(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Ny(e,t):!1}function Na(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Rg(){return{animate:Na(!0),whileInView:Na(),whileHover:Na(),whileTap:Na(),whileDrag:Na(),whileFocus:Na(),exit:Na()}}class Jr{constructor(e){this.isMounted=!1,this.node=e}update(){}}class xk extends Jr{constructor(e){super(e),e.animationState||(e.animationState=mk(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();kc(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let vk=0;class wk extends Jr{constructor(){super(...arguments),this.id=vk++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;const r=this.node.animationState.setActive("exit",!e);n&&!e&&r.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const bk={animation:{Feature:xk},exit:{Feature:wk}};function Bs(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}const Vf=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function nl(t){return{point:{x:t.pageX,y:t.pageY}}}const Ck=t=>e=>Vf(e)&&t(e,nl(e));function Ts(t,e,n,i){return Bs(t,e,Ck(n),i)}function $y({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Sk({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Dk(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}const Ly=1e-4,Mk=1-Ly,Tk=1+Ly,Py=.01,kk=0-Py,jk=0+Py;function Fn(t){return t.max-t.min}function Ak(t,e,n){return Math.abs(t-e)<=n}function Bg(t,e,n,i=.5){t.origin=i,t.originPoint=Vt(e.min,e.max,t.origin),t.scale=Fn(n)/Fn(e),t.translate=Vt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Mk&&t.scale<=Tk||isNaN(t.scale))&&(t.scale=1),(t.translate>=kk&&t.translate<=jk||isNaN(t.translate))&&(t.translate=0)}function ks(t,e,n,i){Bg(t.x,e.x,n.x,i?i.originX:void 0),Bg(t.y,e.y,n.y,i?i.originY:void 0)}function Hg(t,e,n){t.min=n.min+e.min,t.max=t.min+Fn(e)}function _k(t,e,n){Hg(t.x,e.x,n.x),Hg(t.y,e.y,n.y)}function Wg(t,e,n){t.min=e.min-n.min,t.max=t.min+Fn(e)}function js(t,e,n){Wg(t.x,e.x,n.x),Wg(t.y,e.y,n.y)}const zg=()=>({translate:0,scale:1,origin:0,originPoint:0}),So=()=>({x:zg(),y:zg()}),Gg=()=>({min:0,max:0}),Gt=()=>({x:Gg(),y:Gg()});function Mi(t){return[t("x"),t("y")]}function iu(t){return t===void 0||t===1}function uh({scale:t,scaleX:e,scaleY:n}){return!iu(t)||!iu(e)||!iu(n)}function Pa(t){return uh(t)||Ey(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ey(t){return Yg(t.x)||Yg(t.y)}function Yg(t){return t&&t!=="0%"}function ac(t,e,n){const i=t-n,r=e*i;return n+r}function qg(t,e,n,i,r){return r!==void 0&&(t=ac(t,r,i)),ac(t,n,i)+e}function hh(t,e=0,n=1,i,r){t.min=qg(t.min,e,n,i,r),t.max=qg(t.max,e,n,i,r)}function Vy(t,{x:e,y:n}){hh(t.x,e.translate,e.scale,e.originPoint),hh(t.y,n.translate,n.scale,n.originPoint)}const Ug=.999999999999,Xg=1.0000000000001;function Ok(t,e,n,i=!1){const r=n.length;if(!r)return;e.x=e.y=1;let a,o;for(let s=0;s<r;s++){a=n[s],o=a.projectionDelta;const{visualElement:c}=a.options;c&&c.props.style&&c.props.style.display==="contents"||(i&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Mo(t,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Vy(t,o)),i&&Pa(a.latestValues)&&Mo(t,a.latestValues))}e.x<Xg&&e.x>Ug&&(e.x=1),e.y<Xg&&e.y>Ug&&(e.y=1)}function Do(t,e){t.min=t.min+e,t.max=t.max+e}function Kg(t,e,n,i,r=.5){const a=Vt(t.min,t.max,r);hh(t,e,n,a,i)}function Mo(t,e){Kg(t.x,e.x,e.scaleX,e.scale,e.originX),Kg(t.y,e.y,e.scaleY,e.scale,e.originY)}function Fy(t,e){return $y(Dk(t.getBoundingClientRect(),e))}function Nk(t,e,n){const i=Fy(t,n),{scroll:r}=e;return r&&(Do(i.x,r.offset.x),Do(i.y,r.offset.y)),i}const Ry=({current:t})=>t?t.ownerDocument.defaultView:null,Qg=(t,e)=>Math.abs(t-e);function Ik(t,e){const n=Qg(t.x,e.x),i=Qg(t.y,e.y);return Math.sqrt(n**2+i**2)}class By{constructor(e,n,{transformPagePoint:i,contextWindow:r,dragSnapToOrigin:a=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=au(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,g=Ik(f.offset,{x:0,y:0})>=3;if(!d&&!g)return;const{point:p}=f,{timestamp:y}=mn;this.history.push({...p,timestamp:y});const{onStart:v,onMove:m}=this.handlers;d||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,f)},this.handlePointerMove=(f,d)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=ru(d,this.transformPagePoint),Ft.update(this.updatePoint,!0)},this.handlePointerUp=(f,d)=>{this.end();const{onEnd:g,onSessionEnd:p,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=au(f.type==="pointercancel"?this.lastMoveEventInfo:ru(d,this.transformPagePoint),this.history);this.startEvent&&g&&g(f,v),p&&p(f,v)},!Vf(e))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=i,this.contextWindow=r||window;const o=nl(e),s=ru(o,this.transformPagePoint),{point:c}=s,{timestamp:u}=mn;this.history=[{...c,timestamp:u}];const{onSessionStart:h}=n;h&&h(e,au(s,this.history)),this.removeListeners=el(Ts(this.contextWindow,"pointermove",this.handlePointerMove),Ts(this.contextWindow,"pointerup",this.handlePointerUp),Ts(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),qr(this.updatePoint)}}function ru(t,e){return e?{point:e(t.point)}:t}function Zg(t,e){return{x:t.x-e.x,y:t.y-e.y}}function au({point:t},e){return{point:t,delta:Zg(t,Hy(e)),offset:Zg(t,$k(e)),velocity:Lk(e,.1)}}function $k(t){return t[0]}function Hy(t){return t[t.length-1]}function Lk(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const r=Hy(t);for(;n>=0&&(i=t[n],!(r.timestamp-i.timestamp>Vi(e)));)n--;if(!i)return{x:0,y:0};const a=ir(r.timestamp-i.timestamp);if(a===0)return{x:0,y:0};const o={x:(r.x-i.x)/a,y:(r.y-i.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Pk(t,{min:e,max:n},i){return e!==void 0&&t<e?t=i?Vt(e,t,i.min):Math.max(t,e):n!==void 0&&t>n&&(t=i?Vt(n,t,i.max):Math.min(t,n)),t}function Jg(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Ek(t,{top:e,left:n,bottom:i,right:r}){return{x:Jg(t.x,n,r),y:Jg(t.y,e,i)}}function ep(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}function Vk(t,e){return{x:ep(t.x,e.x),y:ep(t.y,e.y)}}function Fk(t,e){let n=.5;const i=Fn(t),r=Fn(e);return r>i?n=Rs(e.min,e.max-i,t.min):i>r&&(n=Rs(t.min,t.max-r,e.min)),Mr(0,1,n)}function Rk(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const fh=.35;function Bk(t=fh){return t===!1?t=0:t===!0&&(t=fh),{x:tp(t,"left","right"),y:tp(t,"top","bottom")}}function tp(t,e,n){return{min:np(t,e),max:np(t,n)}}function np(t,e){return typeof t=="number"?t:t[e]||0}const Li={x:!1,y:!1};function Wy(){return Li.x||Li.y}function Hk(t){return t==="x"||t==="y"?Li[t]?null:(Li[t]=!0,()=>{Li[t]=!1}):Li.x||Li.y?null:(Li.x=Li.y=!0,()=>{Li.x=Li.y=!1})}const Wk=new WeakMap;class zk{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Gt(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=h=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(nl(h).point)},a=(h,f)=>{const{drag:d,dragPropagation:g,onDragStart:p}=this.getProps();if(d&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Hk(d),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Mi(v=>{let m=this.getAxisMotionValue(v).get()||0;if(nr.test(m)){const{projection:I}=this.visualElement;if(I&&I.layout){const j=I.layout.layoutBox[v];j&&(m=Fn(j)*(parseFloat(m)/100))}}this.originPoint[v]=m}),p&&Ft.postRender(()=>p(h,f)),Qu(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},o=(h,f)=>{const{dragPropagation:d,dragDirectionLock:g,onDirectionLock:p,onDrag:y}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:v}=f;if(g&&this.currentDirection===null){this.currentDirection=Gk(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),y&&y(h,f)},s=(h,f)=>this.stop(h,f),c=()=>Mi(h=>this.getAnimationState(h)==="paused"&&this.getAxisMotionValue(h).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new By(e,{onSessionStart:r,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Ry(this.visualElement)})}stop(e,n){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:r}=n;this.startAnimation(r);const{onDragEnd:a}=this.getProps();a&&Ft.postRender(()=>a(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,i){const{drag:r}=this.getProps();if(!i||!yl(e,r,this.currentDirection))return;const a=this.getAxisMotionValue(e);let o=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(o=Pk(o,this.constraints[e],this.elastic[e])),a.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&wo(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&i?this.constraints=Ek(i.layoutBox,e):this.constraints=!1,this.elastic=Bk(n),r!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Mi(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=Rk(i.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!wo(e))return!1;const i=e.current;Dr(i!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const a=Nk(i,r.root,this.visualElement.getTransformPagePoint());let o=Vk(r.layout.layoutBox,a);if(n){const s=n(Sk(o));this.hasMutatedConstraints=!!s,s&&(o=$y(s))}return o}startAnimation(e){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),c=this.constraints||{},u=Mi(h=>{if(!yl(h,n,this.currentDirection))return;let f=c&&c[h]||{};o&&(f={min:0,max:0});const d=r?200:1e6,g=r?40:1e7,p={type:"inertia",velocity:i?e[h]:0,bounceStiffness:d,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...a,...f};return this.startAxisValueAnimation(h,p)});return Promise.all(u).then(s)}startAxisValueAnimation(e,n){const i=this.getAxisMotionValue(e);return Qu(this.visualElement,e),i.start(Ef(e,i,0,n,this.visualElement,!1))}stopAnimation(){Mi(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Mi(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps(),r=i[n];return r||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){Mi(n=>{const{drag:i}=this.getProps();if(!yl(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,a=this.getAxisMotionValue(n);if(r&&r.layout){const{min:o,max:s}=r.layout.layoutBox[n];a.set(e[n]-Vt(o,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!wo(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Mi(o=>{const s=this.getAxisMotionValue(o);if(s&&this.constraints!==!1){const c=s.get();r[o]=Fk({min:c,max:c},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),Mi(o=>{if(!yl(o,e,null))return;const s=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];s.set(Vt(c,u,r[o]))})}addListeners(){if(!this.visualElement.current)return;Wk.set(this.visualElement,this);const e=this.visualElement.current,n=Ts(e,"pointerdown",c=>{const{drag:u,dragListener:h=!0}=this.getProps();u&&h&&this.start(c)}),i=()=>{const{dragConstraints:c}=this.getProps();wo(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,a=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Ft.read(i);const o=Bs(window,"resize",()=>this.scalePositionWithinConstraints()),s=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Mi(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=c[h].translate,f.set(f.get()+c[h].translate))}),this.visualElement.render())});return()=>{o(),n(),a(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:a=!1,dragElastic:o=fh,dragMomentum:s=!0}=e;return{...e,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:a,dragElastic:o,dragMomentum:s}}}function yl(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Gk(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Yk extends Jr{constructor(e){super(e),this.removeGroupControls=ji,this.removeListeners=ji,this.controls=new zk(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ji}unmount(){this.removeGroupControls(),this.removeListeners()}}const ip=t=>(e,n)=>{t&&Ft.postRender(()=>t(e,n))};class qk extends Jr{constructor(){super(...arguments),this.removePointerDownListener=ji}onPointerDown(e){this.session=new By(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ry(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:ip(e),onStart:ip(n),onMove:i,onEnd:(a,o)=>{delete this.session,r&&Ft.postRender(()=>r(a,o))}}}mount(){this.removePointerDownListener=Ts(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const $l={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function rp(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const cs={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Je.test(t))t=parseFloat(t);else return t;const n=rp(t,e.target.x),i=rp(t,e.target.y);return`${n}% ${i}%`}},Uk={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,r=Ur.parse(t);if(r.length>5)return i;const a=Ur.createTransformer(t),o=typeof r[0]!="number"?1:0,s=n.x.scale*e.x,c=n.y.scale*e.y;r[0+o]/=s,r[1+o]/=c;const u=Vt(s,c,.5);return typeof r[2+o]=="number"&&(r[2+o]/=u),typeof r[3+o]=="number"&&(r[3+o]/=u),a(r)}};class Xk extends k.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:a}=e;lM(Kk),a&&(n.group&&n.group.add(a),i&&i.register&&r&&i.register(a),a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),$l.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:i,drag:r,isPresent:a}=this.props,{projection:o}=i;return o&&(o.isPresent=a,r||e.layoutDependency!==n||n===void 0||e.isPresent!==a?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||Ft.postRender(()=>{const s=o.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),df.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function zy(t){const[e,n]=F0(),i=k.useContext(af);return l.jsx(Xk,{...t,layoutGroup:i,switchLayoutGroup:k.useContext(G0),isPresent:e,safeToRemove:n})}const Kk={borderRadius:{...cs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:cs,borderTopRightRadius:cs,borderBottomLeftRadius:cs,borderBottomRightRadius:cs,boxShadow:Uk};function Qk(t,e,n){const i=Mn(t)?t:Ro(t);return i.start(Ef("",i,e,n)),i.animation}function Zk(t){return t instanceof SVGElement&&t.tagName!=="svg"}const Jk=(t,e)=>t.depth-e.depth;class ej{constructor(){this.children=[],this.isDirty=!1}add(e){Cf(this.children,e),this.isDirty=!0}remove(e){Sf(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Jk),this.isDirty=!1,this.children.forEach(e)}}function tj(t,e){const n=ei.now(),i=({timestamp:r})=>{const a=r-n;a>=e&&(qr(i),t(a-e))};return Ft.setup(i,!0),()=>qr(i)}const Gy=["TopLeft","TopRight","BottomLeft","BottomRight"],nj=Gy.length,ap=t=>typeof t=="string"?parseFloat(t):t,op=t=>typeof t=="number"||Je.test(t);function ij(t,e,n,i,r,a){r?(t.opacity=Vt(0,n.opacity??1,rj(i)),t.opacityExit=Vt(e.opacity??1,0,aj(i))):a&&(t.opacity=Vt(e.opacity??1,n.opacity??1,i));for(let o=0;o<nj;o++){const s=`border${Gy[o]}Radius`;let c=sp(e,s),u=sp(n,s);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||op(c)===op(u)?(t[s]=Math.max(Vt(ap(c),ap(u),i),0),(nr.test(u)||nr.test(c))&&(t[s]+="%")):t[s]=u}(e.rotate||n.rotate)&&(t.rotate=Vt(e.rotate||0,n.rotate||0,i))}function sp(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const rj=Yy(0,.5,wy),aj=Yy(.5,.95,ji);function Yy(t,e,n){return i=>i<t?0:i>e?1:n(Rs(t,e,i))}function lp(t,e){t.min=e.min,t.max=e.max}function Si(t,e){lp(t.x,e.x),lp(t.y,e.y)}function cp(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function up(t,e,n,i,r){return t-=e,t=ac(t,1/n,i),r!==void 0&&(t=ac(t,1/r,i)),t}function oj(t,e=0,n=1,i=.5,r,a=t,o=t){if(nr.test(e)&&(e=parseFloat(e),e=Vt(o.min,o.max,e/100)-o.min),typeof e!="number")return;let s=Vt(a.min,a.max,i);t===a&&(s-=e),t.min=up(t.min,e,n,s,r),t.max=up(t.max,e,n,s,r)}function hp(t,e,[n,i,r],a,o){oj(t,e[n],e[i],e[r],e.scale,a,o)}const sj=["x","scaleX","originX"],lj=["y","scaleY","originY"];function fp(t,e,n,i){hp(t.x,e,sj,n?n.x:void 0,i?i.x:void 0),hp(t.y,e,lj,n?n.y:void 0,i?i.y:void 0)}function dp(t){return t.translate===0&&t.scale===1}function qy(t){return dp(t.x)&&dp(t.y)}function gp(t,e){return t.min===e.min&&t.max===e.max}function cj(t,e){return gp(t.x,e.x)&&gp(t.y,e.y)}function pp(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Uy(t,e){return pp(t.x,e.x)&&pp(t.y,e.y)}function mp(t){return Fn(t.x)/Fn(t.y)}function yp(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class uj{constructor(){this.members=[]}add(e){Cf(this.members,e),e.scheduleRender()}remove(e){if(Sf(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(r=>e===r);if(n===0)return!1;let i;for(let r=n;r>=0;r--){const a=this.members[r];if(a.isPresent!==!1){i=a;break}}return i?(this.promote(i),!0):!1}promote(e,n){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,n&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:i}=e;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function hj(t,e,n){let i="";const r=t.x.translate/e.x,a=t.y.translate/e.y,o=n?.z||0;if((r||a||o)&&(i=`translate3d(${r}px, ${a}px, ${o}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:h,rotateX:f,rotateY:d,skewX:g,skewY:p}=n;u&&(i=`perspective(${u}px) ${i}`),h&&(i+=`rotate(${h}deg) `),f&&(i+=`rotateX(${f}deg) `),d&&(i+=`rotateY(${d}deg) `),g&&(i+=`skewX(${g}deg) `),p&&(i+=`skewY(${p}deg) `)}const s=t.x.scale*e.x,c=t.y.scale*e.y;return(s!==1||c!==1)&&(i+=`scale(${s}, ${c})`),i||"none"}const ou=["","X","Y","Z"],fj={visibility:"hidden"},dj=1e3;let gj=0;function su(t,e,n,i){const{latestValues:r}=e;r[t]&&(n[t]=r[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Xy(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=iy(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:a}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Ft,!(r||a))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Xy(i)}function Ky({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(o={},s=e?.()){this.id=gj++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(yj),this.nodes.forEach(Cj),this.nodes.forEach(Sj),this.nodes.forEach(xj)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new ej)}addEventListener(o,s){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Df),this.eventHandlers.get(o).add(s)}notifyListeners(o,...s){const c=this.eventHandlers.get(o);c&&c.notify(...s)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Zk(o),this.instance=o;const{layoutId:s,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||s)&&(this.isLayoutDirty=!0),t){let h;const f=()=>this.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=tj(f,250),$l.hasAnimatedSinceResize&&($l.hasAnimatedSinceResize=!1,this.nodes.forEach(vp))})}s&&this.root.registerSharedNode(s,this),this.options.animate!==!1&&u&&(s||c)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:f,hasRelativeLayoutChanged:d,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||jj,{onLayoutAnimationStart:y,onLayoutAnimationComplete:v}=u.getProps(),m=!this.targetLayout||!Uy(this.targetLayout,g),I=!f&&d;if(this.options.layoutRoot||this.resumeFrom||I||f&&(m||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,I);const j={...Mf(p,"layout"),onPlay:y,onComplete:v};(u.shouldReduceMotion||this.options.layoutRoot)&&(j.delay=0,j.type=!1),this.startAnimation(j)}else f||vp(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),qr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Dj),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Xy(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const f=this.path[h];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:s,layout:c}=this.options;if(s===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(xp);return}this.isUpdating||this.nodes.forEach(wj),this.isUpdating=!1,this.nodes.forEach(bj),this.nodes.forEach(pj),this.nodes.forEach(mj),this.clearAllSnapshots();const s=ei.now();mn.delta=Mr(0,1e3/60,s-mn.timestamp),mn.timestamp=s,mn.isProcessing=!0,Zc.update.process(mn),Zc.preRender.process(mn),Zc.render.process(mn),mn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,df.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(vj),this.sharedNodes.forEach(Mj)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ft.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ft.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Fn(this.snapshot.measuredBox.x)&&!Fn(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Gt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:s}=this.options;s&&s.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let s=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(s=!1),s&&this.instance){const c=i(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!r)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,s=this.projectionDelta&&!qy(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,h=u!==this.prevTransformTemplateValue;o&&this.instance&&(s||Pa(this.latestValues)||h)&&(r(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const s=this.measurePageBox();let c=this.removeElementScroll(s);return o&&(c=this.removeTransform(c)),Aj(c),{animationId:this.root.animationId,measuredBox:s,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return Gt();const s=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(_j))){const{scroll:u}=this.root;u&&(Do(s.x,u.offset.x),Do(s.y,u.offset.y))}return s}removeElementScroll(o){const s=Gt();if(Si(s,o),this.scroll?.wasRoot)return s;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:h,options:f}=u;u!==this.root&&h&&f.layoutScroll&&(h.wasRoot&&Si(s,o),Do(s.x,h.offset.x),Do(s.y,h.offset.y))}return s}applyTransform(o,s=!1){const c=Gt();Si(c,o);for(let u=0;u<this.path.length;u++){const h=this.path[u];!s&&h.options.layoutScroll&&h.scroll&&h!==h.root&&Mo(c,{x:-h.scroll.offset.x,y:-h.scroll.offset.y}),Pa(h.latestValues)&&Mo(c,h.latestValues)}return Pa(this.latestValues)&&Mo(c,this.latestValues),c}removeTransform(o){const s=Gt();Si(s,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!Pa(u.latestValues))continue;uh(u.latestValues)&&u.updateSnapshot();const h=Gt(),f=u.measurePageBox();Si(h,f),fp(s,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,h)}return Pa(this.latestValues)&&fp(s,this.latestValues),s}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==mn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const s=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=s.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=s.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=s.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==s;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:f}=this.options;if(!(!this.layout||!(h||f))){if(this.resolvedRelativeTargetAt=mn.timestamp,!this.targetDelta&&!this.relativeTarget){const d=this.getClosestProjectingParent();d&&d.layout&&this.animationProgress!==1?(this.relativeParent=d,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Gt(),this.relativeTargetOrigin=Gt(),js(this.relativeTargetOrigin,this.layout.layoutBox,d.layout.layoutBox),Si(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Gt(),this.targetWithTransforms=Gt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),_k(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Si(this.target,this.layout.layoutBox),Vy(this.target,this.targetDelta)):Si(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const d=this.getClosestProjectingParent();d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?(this.relativeParent=d,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Gt(),this.relativeTargetOrigin=Gt(),js(this.relativeTargetOrigin,this.target,d.target),Si(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||uh(this.parent.latestValues)||Ey(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const o=this.getLead(),s=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),s&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===mn.timestamp&&(c=!1),c)return;const{layout:u,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||h))return;Si(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;Ok(this.layoutCorrected,this.treeScale,this.path,s),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Gt());const{target:g}=o;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(cp(this.prevProjectionDelta.x,this.projectionDelta.x),cp(this.prevProjectionDelta.y,this.projectionDelta.y)),ks(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==d||!yp(this.projectionDelta.x,this.prevProjectionDelta.x)||!yp(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const s=this.getStack();s&&s.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=So(),this.projectionDelta=So(),this.projectionDeltaWithTransform=So()}setAnimationOrigin(o,s=!1){const c=this.snapshot,u=c?c.latestValues:{},h={...this.latestValues},f=So();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!s;const d=Gt(),g=c?c.source:void 0,p=this.layout?this.layout.source:void 0,y=g!==p,v=this.getStack(),m=!v||v.members.length<=1,I=!!(y&&!m&&this.options.crossfade===!0&&!this.path.some(kj));this.animationProgress=0;let j;this.mixTargetDelta=w=>{const S=w/1e3;wp(f.x,o.x,S),wp(f.y,o.y,S),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(js(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Tj(this.relativeTarget,this.relativeTargetOrigin,d,S),j&&cj(this.relativeTarget,j)&&(this.isProjectionDirty=!1),j||(j=Gt()),Si(j,this.relativeTarget)),y&&(this.animationValues=h,ij(h,u,this.latestValues,S,I,m)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(!1),this.resumingFrom?.currentAnimation?.stop(!1),this.pendingAnimation&&(qr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ft.update(()=>{$l.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ro(0)),this.currentAnimation=Qk(this.motionValue,[0,1e3],{...o,isSync:!0,onUpdate:s=>{this.mixTargetDelta(s),o.onUpdate&&o.onUpdate(s)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(dj),this.currentAnimation.stop(!1)),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:s,target:c,layout:u,latestValues:h}=o;if(!(!s||!c||!u)){if(this!==o&&this.layout&&u&&Qy(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Gt();const f=Fn(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const d=Fn(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+d}Si(s,c),Mo(s,h),ks(this.projectionDeltaWithTransform,this.layoutCorrected,s,h)}}registerSharedNode(o,s){this.sharedNodes.has(o)||this.sharedNodes.set(o,new uj),this.sharedNodes.get(o).add(s);const u=s.options.initialPromotionConfig;s.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(s):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:s,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let s=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(s=!0),!s)return;const u={};c.z&&su("z",o,u,this.animationValues);for(let h=0;h<ou.length;h++)su(`rotate${ou[h]}`,o,u,this.animationValues),su(`skew${ou[h]}`,o,u,this.animationValues);o.render();for(const h in u)o.setStaticValue(h,u[h]),this.animationValues&&(this.animationValues[h]=u[h]);o.scheduleRender()}getProjectionStyles(o){if(!this.instance||this.isSVG)return;if(!this.isVisible)return fj;const s={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,s.opacity="",s.pointerEvents=Nl(o?.pointerEvents)||"",s.transform=c?c(this.latestValues,""):"none",s;const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){const g={};return this.options.layoutId&&(g.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,g.pointerEvents=Nl(o?.pointerEvents)||""),this.hasProjected&&!Pa(this.latestValues)&&(g.transform=c?c({},""):"none",this.hasProjected=!1),g}const h=u.animationValues||u.latestValues;this.applyTransformsToTarget(),s.transform=hj(this.projectionDeltaWithTransform,this.treeScale,h),c&&(s.transform=c(h,s.transform));const{x:f,y:d}=this.projectionDelta;s.transformOrigin=`${f.origin*100}% ${d.origin*100}% 0`,u.animationValues?s.opacity=u===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:s.opacity=u===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const g in Ps){if(h[g]===void 0)continue;const{correct:p,applyTo:y,isCSSVariable:v}=Ps[g],m=s.transform==="none"?h[g]:p(h[g],u);if(y){const I=y.length;for(let j=0;j<I;j++)s[y[j]]=m}else v?this.options.visualElement.renderState.vars[g]=m:s[g]=m}return this.options.layoutId&&(s.pointerEvents=u===this?Nl(o?.pointerEvents)||"":"none"),s}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop(!1)),this.root.nodes.forEach(xp),this.root.sharedNodes.clear()}}}function pj(t){t.updateLayout()}function mj(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:r}=t.options,a=e.source!==t.layout.source;r==="size"?Mi(h=>{const f=a?e.measuredBox[h]:e.layoutBox[h],d=Fn(f);f.min=n[h].min,f.max=f.min+d}):Qy(r,e.layoutBox,n)&&Mi(h=>{const f=a?e.measuredBox[h]:e.layoutBox[h],d=Fn(n[h]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+d)});const o=So();ks(o,n,e.layoutBox);const s=So();a?ks(s,t.applyTransform(i,!0),e.measuredBox):ks(s,n,e.layoutBox);const c=!qy(o);let u=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:d}=h;if(f&&d){const g=Gt();js(g,e.layoutBox,f.layoutBox);const p=Gt();js(p,n,d.layoutBox),Uy(g,p)||(u=!0),h.options.layoutRoot&&(t.relativeTarget=p,t.relativeTargetOrigin=g,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function yj(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function xj(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function vj(t){t.clearSnapshot()}function xp(t){t.clearMeasurements()}function wj(t){t.isLayoutDirty=!1}function bj(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function vp(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Cj(t){t.resolveTargetDelta()}function Sj(t){t.calcProjection()}function Dj(t){t.resetSkewAndRotation()}function Mj(t){t.removeLeadSnapshot()}function wp(t,e,n){t.translate=Vt(e.translate,0,n),t.scale=Vt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function bp(t,e,n,i){t.min=Vt(e.min,n.min,i),t.max=Vt(e.max,n.max,i)}function Tj(t,e,n,i){bp(t.x,e.x,n.x,i),bp(t.y,e.y,n.y,i)}function kj(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const jj={duration:.45,ease:[.4,0,.1,1]},Cp=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Sp=Cp("applewebkit/")&&!Cp("chrome/")?Math.round:ji;function Dp(t){t.min=Sp(t.min),t.max=Sp(t.max)}function Aj(t){Dp(t.x),Dp(t.y)}function Qy(t,e,n){return t==="position"||t==="preserve-aspect"&&!Ak(mp(e),mp(n),.2)}function _j(t){return t!==t.root&&t.scroll?.wasRoot}const Oj=Ky({attachResizeListener:(t,e)=>Bs(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),lu={current:void 0},Zy=Ky({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!lu.current){const t=new Oj({});t.mount(window),t.setOptions({layoutScroll:!0}),lu.current=t}return lu.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Nj={pan:{Feature:qk},drag:{Feature:Yk,ProjectionNode:Zy,MeasureLayout:zy}};function Jy(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){const r=document.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}function ex(t,e){const n=Jy(t),i=new AbortController,r={passive:!0,...e,signal:i.signal};return[n,r,()=>i.abort()]}function Mp(t){return!(t.pointerType==="touch"||Wy())}function Ij(t,e,n={}){const[i,r,a]=ex(t,n),o=s=>{if(!Mp(s))return;const{target:c}=s,u=e(c,s);if(typeof u!="function"||!c)return;const h=f=>{Mp(f)&&(u(f),c.removeEventListener("pointerleave",h))};c.addEventListener("pointerleave",h,r)};return i.forEach(s=>{s.addEventListener("pointerenter",o,r)}),a}function Tp(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,a=i[r];a&&Ft.postRender(()=>a(e,nl(e)))}class $j extends Jr{mount(){const{current:e}=this.node;e&&(this.unmount=Ij(e,(n,i)=>(Tp(this.node,i,"Start"),r=>Tp(this.node,r,"End"))))}unmount(){}}class Lj extends Jr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=el(Bs(this.node.current,"focus",()=>this.onFocus()),Bs(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const tx=(t,e)=>e?t===e?!0:tx(t,e.parentElement):!1,Pj=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ej(t){return Pj.has(t.tagName)||t.tabIndex!==-1}const Ll=new WeakSet;function kp(t){return e=>{e.key==="Enter"&&t(e)}}function cu(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Vj=(t,e)=>{const n=t.currentTarget;if(!n)return;const i=kp(()=>{if(Ll.has(n))return;cu(n,"down");const r=kp(()=>{cu(n,"up")}),a=()=>cu(n,"cancel");n.addEventListener("keyup",r,e),n.addEventListener("blur",a,e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)};function jp(t){return Vf(t)&&!Wy()}function Fj(t,e,n={}){const[i,r,a]=ex(t,n),o=s=>{const c=s.currentTarget;if(!jp(s))return;Ll.add(c);const u=e(c,s),h=(g,p)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",d),Ll.has(c)&&Ll.delete(c),jp(g)&&typeof u=="function"&&u(g,{success:p})},f=g=>{h(g,c===window||c===document||n.useGlobalTarget||tx(c,g.target))},d=g=>{h(g,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",d,r)};return i.forEach(s=>{(n.useGlobalTarget?window:s).addEventListener("pointerdown",o,r),s instanceof HTMLElement&&(s.addEventListener("focus",u=>Vj(u,r)),!Ej(s)&&!s.hasAttribute("tabindex")&&(s.tabIndex=0))}),a}function Ap(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),a=i[r];a&&Ft.postRender(()=>a(e,nl(e)))}class Rj extends Jr{mount(){const{current:e}=this.node;e&&(this.unmount=Fj(e,(n,i)=>(Ap(this.node,i,"Start"),(r,{success:a})=>Ap(this.node,r,a?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const dh=new WeakMap,uu=new WeakMap,Bj=t=>{const e=dh.get(t.target);e&&e(t)},Hj=t=>{t.forEach(Bj)};function Wj({root:t,...e}){const n=t||document;uu.has(n)||uu.set(n,{});const i=uu.get(n),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(Hj,{root:t,...e})),i[r]}function zj(t,e,n){const i=Wj(e);return dh.set(t,n),i.observe(t),()=>{dh.delete(t),i.unobserve(t)}}const Gj={some:0,all:1};class Yj extends Jr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:a}=e,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:Gj[r]},s=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:h,onViewportLeave:f}=this.node.getProps(),d=u?h:f;d&&d(c)};return zj(this.node.current,o,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(qj(e,n))&&this.startObserver()}unmount(){}}function qj({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Uj={inView:{Feature:Yj},tap:{Feature:Rj},focus:{Feature:Lj},hover:{Feature:$j}},Xj={layout:{ProjectionNode:Zy,MeasureLayout:zy}},gh={current:null},nx={current:!1};function Kj(){if(nx.current=!0,!!sf)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>gh.current=t.matches;t.addListener(e),e()}else gh.current=!1}const Qj=new WeakMap;function Zj(t,e,n){for(const i in e){const r=e[i],a=n[i];if(Mn(r))t.addValue(i,r);else if(Mn(a))t.addValue(i,Ro(r,{owner:t}));else if(a!==r)if(t.hasValue(i)){const o=t.getValue(i);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=t.getStaticValue(i);t.addValue(i,Ro(o!==void 0?o:r,{owner:t}))}}for(const i in n)e[i]===void 0&&t.removeValue(i);return e}const ix=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),rx=t=>/^0[^.\s]+$/u.test(t),Jj={test:t=>t==="auto",parse:t=>t},ax=t=>e=>e.test(t),ox=[es,Je,nr,Wr,uM,cM,Jj],_p=t=>ox.find(ax(t)),eA=[...ox,Dn,Ur],tA=t=>eA.find(ax(t)),nA=new Set(["brightness","contrast","saturate","opacity"]);function iA(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[i]=n.match(Tf)||[];if(!i)return t;const r=n.replace(i,"");let a=nA.has(e)?1:0;return i!==n&&(a*=100),e+"("+a+r+")"}const rA=/\b([a-z-]*)\(.*?\)/gu,ph={...Ur,getAnimatableNone:t=>{const e=t.match(rA);return e?e.map(iA).join(" "):t}},aA={...mf,color:Dn,backgroundColor:Dn,outlineColor:Dn,fill:Dn,stroke:Dn,borderColor:Dn,borderTopColor:Dn,borderRightColor:Dn,borderBottomColor:Dn,borderLeftColor:Dn,filter:ph,WebkitFilter:ph},sx=t=>aA[t];function lx(t,e){let n=sx(t);return n!==ph&&(n=Ur),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Op=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class oA{scrapeMotionValuesFromProps(e,n,i){return{}}constructor({parent:e,props:n,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Lf,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=ei.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,Ft.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=jc(n),this.isVariantNode=W0(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const g=f[d];c[d]!==void 0&&Mn(g)&&g.set(c[d],!1)}}mount(e){this.current=e,Qj.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),nx.current||Kj(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:gh.current,process.env.NODE_ENV!=="production"&&cf(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),qr(this.notifyUpdate),qr(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const i=Jo.has(e);i&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",s=>{this.latestValues[e]=s,this.props.onUpdate&&Ft.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),a=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{r(),a(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Fo){const n=Fo[e];if(!n)continue;const{isEnabled:i,Feature:r}=n;if(!this.features[e]&&r&&i(this.props)&&(this.features[e]=new r(this)),this.features[e]){const a=this.features[e];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Gt()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;i<Op.length;i++){const r=Op[i];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const a="on"+r,o=e[a];o&&(this.propEventSubscriptions[r]=this.on(r,o))}this.prevMotionValues=Zj(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const i=this.values.get(e);n!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&n!==void 0&&(i=Ro(n===null?void 0:n,{owner:this}),this.addValue(e,i)),i}readValue(e,n){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(ix(i)||rx(i))?i=parseFloat(i):!tA(i)&&Ur.test(n)&&(i=lx(e,n)),this.setBaseTarget(e,Mn(i)?i.get():i)),Mn(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const a=wf(this.props,n,this.presenceContext?.custom);a&&(i=a[e])}if(n&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!Mn(r)?r:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Df),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}const sA=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function lA(t){const e=sA.exec(t);if(!e)return[,];const[,n,i,r]=e;return[`--${n??i}`,r]}const cA=4;function cx(t,e,n=1){Dr(n<=cA,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[i,r]=lA(t);if(!i)return;const a=window.getComputedStyle(e).getPropertyValue(i);if(a){const o=a.trim();return ix(o)?parseFloat(o):o}return pf(r)?cx(r,e,n+1):r}function uA(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||rx(t):!0}const hA=new Set(["auto","none","0"]);function fA(t,e,n){let i=0,r;for(;i<t.length&&!r;){const a=t[i];typeof a=="string"&&!hA.has(a)&&Fs(a).values.length&&(r=t[i]),i++}if(r&&n)for(const a of e)t[a]=lx(n,r)}class dA extends Lf{constructor(e,n,i,r,a){super(e,n,i,r,a,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let u=e[c];if(typeof u=="string"&&(u=u.trim(),pf(u))){const h=cx(u,n.current);h!==void 0&&(e[c]=h),c===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!_y.has(i)||e.length!==2)return;const[r,a]=e,o=_p(r),s=_p(a);if(o!==s)if(Pg(o)&&Pg(s))for(let c=0;c<e.length;c++){const u=e[c];typeof u=="string"&&(e[c]=parseFloat(u))}else Ga[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,i=[];for(let r=0;r<e.length;r++)(e[r]===null||uA(e[r]))&&i.push(r);i.length&&fA(e,i,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ga[i](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&e.getValue(i,r).jump(r,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const r=e.getValue(n);r&&r.jump(this.measuredOrigin,!1);const a=i.length-1,o=i[a];i[a]=Ga[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([s,c])=>{e.getValue(s).set(c)}),this.resolveNoneKeyframes()}}class ux extends oA{constructor(){super(...arguments),this.KeyframeResolver=dA}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:i}){delete n[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Mn(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function hx(t,{style:e,vars:n},i,r){Object.assign(t.style,e,r&&r.getProjectionStyles(i));for(const a in n)t.style.setProperty(a,n[a])}function gA(t){return window.getComputedStyle(t)}class pA extends ux{constructor(){super(...arguments),this.type="html",this.renderInstance=hx}readValueFromInstance(e,n){if(Jo.has(n))return this.projection?.isProjecting?rh(n):VT(e,n);{const i=gA(e),r=(gf(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Fy(e,n)}build(e,n,i){yf(e,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,n,i){return bf(e,n,i)}}const fx=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function mA(t,e,n,i){hx(t,e,void 0,i);for(const r in e.attrs)t.setAttribute(fx.has(r)?r:ff(r),e.attrs[r])}class yA extends ux{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Gt}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Jo.has(n)){const i=sx(n);return i&&i.default||0}return n=fx.has(n)?n:ff(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,i){return ty(e,n,i)}build(e,n,i){Q0(e,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(e,n,i,r){mA(e,n,i,r)}mount(e){this.isSVGTag=J0(e.tagName),super.mount(e)}}const xA=(t,e)=>vf(t)?new yA(e):new pA(e,{allowProjection:t!==k.Fragment}),vA=jM({...bk,...Uj,...Nj,...Xj},xA),$e=UD(vA),wA={some:0,all:1};function bA(t,e,{root:n,margin:i,amount:r="some"}={}){const a=Jy(t),o=new WeakMap,s=u=>{u.forEach(h=>{const f=o.get(h.target);if(h.isIntersecting!==!!f)if(h.isIntersecting){const d=e(h.target,h);typeof d=="function"?o.set(h.target,d):c.unobserve(h.target)}else typeof f=="function"&&(f(h),o.delete(h.target))})},c=new IntersectionObserver(s,{root:n,rootMargin:i,threshold:typeof r=="number"?r:wA[r]});return a.forEach(u=>c.observe(u)),()=>c.disconnect()}function ct(t,{root:e,margin:n,amount:i,once:r=!1,initial:a=!1}={}){const[o,s]=k.useState(a);return k.useEffect(()=>{if(!t.current||r&&o)return;const c=()=>(s(!0),r?void 0:()=>s(!1)),u={root:e&&e.current||void 0,margin:n,amount:i};return bA(t.current,c,u)},[e,t,n,r,i]),o}function je(t){return t==null}function qe(t,e,n,i,r){if(typeof t=="string")return`${i||""}${t}${r||""}`;const a=o=>{const s=["","K","M","B","T"],c=Math.floor(Math.log10(Math.abs(o))/3);return c===0?o.toString():(o/10**(c*3)).toFixed(n===0?0:n||2).replace(/(\.\d*?[1-9])0+$|\.0*$/,"$1")+s[c]};return je(t)?e||"NA":t<1e4&&t>-1e4&&Math.round(t)===t?`${i||""}${t}${r||""}`:`${i||""}${Math.abs(t)<1e3?t.toFixed(n===0?0:n||2).replace(/(\.\d*?[1-9])0+$|\.0*$/,"$1"):a(t)}${r||""}`}var xl={exports:{}},_t={},vl={exports:{}},Ia={},Np;function dx(){if(Np)return Ia;Np=1;function t(){var a={};return a["align-content"]=!1,a["align-items"]=!1,a["align-self"]=!1,a["alignment-adjust"]=!1,a["alignment-baseline"]=!1,a.all=!1,a["anchor-point"]=!1,a.animation=!1,a["animation-delay"]=!1,a["animation-direction"]=!1,a["animation-duration"]=!1,a["animation-fill-mode"]=!1,a["animation-iteration-count"]=!1,a["animation-name"]=!1,a["animation-play-state"]=!1,a["animation-timing-function"]=!1,a.azimuth=!1,a["backface-visibility"]=!1,a.background=!0,a["background-attachment"]=!0,a["background-clip"]=!0,a["background-color"]=!0,a["background-image"]=!0,a["background-origin"]=!0,a["background-position"]=!0,a["background-repeat"]=!0,a["background-size"]=!0,a["baseline-shift"]=!1,a.binding=!1,a.bleed=!1,a["bookmark-label"]=!1,a["bookmark-level"]=!1,a["bookmark-state"]=!1,a.border=!0,a["border-bottom"]=!0,a["border-bottom-color"]=!0,a["border-bottom-left-radius"]=!0,a["border-bottom-right-radius"]=!0,a["border-bottom-style"]=!0,a["border-bottom-width"]=!0,a["border-collapse"]=!0,a["border-color"]=!0,a["border-image"]=!0,a["border-image-outset"]=!0,a["border-image-repeat"]=!0,a["border-image-slice"]=!0,a["border-image-source"]=!0,a["border-image-width"]=!0,a["border-left"]=!0,a["border-left-color"]=!0,a["border-left-style"]=!0,a["border-left-width"]=!0,a["border-radius"]=!0,a["border-right"]=!0,a["border-right-color"]=!0,a["border-right-style"]=!0,a["border-right-width"]=!0,a["border-spacing"]=!0,a["border-style"]=!0,a["border-top"]=!0,a["border-top-color"]=!0,a["border-top-left-radius"]=!0,a["border-top-right-radius"]=!0,a["border-top-style"]=!0,a["border-top-width"]=!0,a["border-width"]=!0,a.bottom=!1,a["box-decoration-break"]=!0,a["box-shadow"]=!0,a["box-sizing"]=!0,a["box-snap"]=!0,a["box-suppress"]=!0,a["break-after"]=!0,a["break-before"]=!0,a["break-inside"]=!0,a["caption-side"]=!1,a.chains=!1,a.clear=!0,a.clip=!1,a["clip-path"]=!1,a["clip-rule"]=!1,a.color=!0,a["color-interpolation-filters"]=!0,a["column-count"]=!1,a["column-fill"]=!1,a["column-gap"]=!1,a["column-rule"]=!1,a["column-rule-color"]=!1,a["column-rule-style"]=!1,a["column-rule-width"]=!1,a["column-span"]=!1,a["column-width"]=!1,a.columns=!1,a.contain=!1,a.content=!1,a["counter-increment"]=!1,a["counter-reset"]=!1,a["counter-set"]=!1,a.crop=!1,a.cue=!1,a["cue-after"]=!1,a["cue-before"]=!1,a.cursor=!1,a.direction=!1,a.display=!0,a["display-inside"]=!0,a["display-list"]=!0,a["display-outside"]=!0,a["dominant-baseline"]=!1,a.elevation=!1,a["empty-cells"]=!1,a.filter=!1,a.flex=!1,a["flex-basis"]=!1,a["flex-direction"]=!1,a["flex-flow"]=!1,a["flex-grow"]=!1,a["flex-shrink"]=!1,a["flex-wrap"]=!1,a.float=!1,a["float-offset"]=!1,a["flood-color"]=!1,a["flood-opacity"]=!1,a["flow-from"]=!1,a["flow-into"]=!1,a.font=!0,a["font-family"]=!0,a["font-feature-settings"]=!0,a["font-kerning"]=!0,a["font-language-override"]=!0,a["font-size"]=!0,a["font-size-adjust"]=!0,a["font-stretch"]=!0,a["font-style"]=!0,a["font-synthesis"]=!0,a["font-variant"]=!0,a["font-variant-alternates"]=!0,a["font-variant-caps"]=!0,a["font-variant-east-asian"]=!0,a["font-variant-ligatures"]=!0,a["font-variant-numeric"]=!0,a["font-variant-position"]=!0,a["font-weight"]=!0,a.grid=!1,a["grid-area"]=!1,a["grid-auto-columns"]=!1,a["grid-auto-flow"]=!1,a["grid-auto-rows"]=!1,a["grid-column"]=!1,a["grid-column-end"]=!1,a["grid-column-start"]=!1,a["grid-row"]=!1,a["grid-row-end"]=!1,a["grid-row-start"]=!1,a["grid-template"]=!1,a["grid-template-areas"]=!1,a["grid-template-columns"]=!1,a["grid-template-rows"]=!1,a["hanging-punctuation"]=!1,a.height=!0,a.hyphens=!1,a.icon=!1,a["image-orientation"]=!1,a["image-resolution"]=!1,a["ime-mode"]=!1,a["initial-letters"]=!1,a["inline-box-align"]=!1,a["justify-content"]=!1,a["justify-items"]=!1,a["justify-self"]=!1,a.left=!1,a["letter-spacing"]=!0,a["lighting-color"]=!0,a["line-box-contain"]=!1,a["line-break"]=!1,a["line-grid"]=!1,a["line-height"]=!1,a["line-snap"]=!1,a["line-stacking"]=!1,a["line-stacking-ruby"]=!1,a["line-stacking-shift"]=!1,a["line-stacking-strategy"]=!1,a["list-style"]=!0,a["list-style-image"]=!0,a["list-style-position"]=!0,a["list-style-type"]=!0,a.margin=!0,a["margin-bottom"]=!0,a["margin-left"]=!0,a["margin-right"]=!0,a["margin-top"]=!0,a["marker-offset"]=!1,a["marker-side"]=!1,a.marks=!1,a.mask=!1,a["mask-box"]=!1,a["mask-box-outset"]=!1,a["mask-box-repeat"]=!1,a["mask-box-slice"]=!1,a["mask-box-source"]=!1,a["mask-box-width"]=!1,a["mask-clip"]=!1,a["mask-image"]=!1,a["mask-origin"]=!1,a["mask-position"]=!1,a["mask-repeat"]=!1,a["mask-size"]=!1,a["mask-source-type"]=!1,a["mask-type"]=!1,a["max-height"]=!0,a["max-lines"]=!1,a["max-width"]=!0,a["min-height"]=!0,a["min-width"]=!0,a["move-to"]=!1,a["nav-down"]=!1,a["nav-index"]=!1,a["nav-left"]=!1,a["nav-right"]=!1,a["nav-up"]=!1,a["object-fit"]=!1,a["object-position"]=!1,a.opacity=!1,a.order=!1,a.orphans=!1,a.outline=!1,a["outline-color"]=!1,a["outline-offset"]=!1,a["outline-style"]=!1,a["outline-width"]=!1,a.overflow=!1,a["overflow-wrap"]=!1,a["overflow-x"]=!1,a["overflow-y"]=!1,a.padding=!0,a["padding-bottom"]=!0,a["padding-left"]=!0,a["padding-right"]=!0,a["padding-top"]=!0,a.page=!1,a["page-break-after"]=!1,a["page-break-before"]=!1,a["page-break-inside"]=!1,a["page-policy"]=!1,a.pause=!1,a["pause-after"]=!1,a["pause-before"]=!1,a.perspective=!1,a["perspective-origin"]=!1,a.pitch=!1,a["pitch-range"]=!1,a["play-during"]=!1,a.position=!1,a["presentation-level"]=!1,a.quotes=!1,a["region-fragment"]=!1,a.resize=!1,a.rest=!1,a["rest-after"]=!1,a["rest-before"]=!1,a.richness=!1,a.right=!1,a.rotation=!1,a["rotation-point"]=!1,a["ruby-align"]=!1,a["ruby-merge"]=!1,a["ruby-position"]=!1,a["shape-image-threshold"]=!1,a["shape-outside"]=!1,a["shape-margin"]=!1,a.size=!1,a.speak=!1,a["speak-as"]=!1,a["speak-header"]=!1,a["speak-numeral"]=!1,a["speak-punctuation"]=!1,a["speech-rate"]=!1,a.stress=!1,a["string-set"]=!1,a["tab-size"]=!1,a["table-layout"]=!1,a["text-align"]=!0,a["text-align-last"]=!0,a["text-combine-upright"]=!0,a["text-decoration"]=!0,a["text-decoration-color"]=!0,a["text-decoration-line"]=!0,a["text-decoration-skip"]=!0,a["text-decoration-style"]=!0,a["text-emphasis"]=!0,a["text-emphasis-color"]=!0,a["text-emphasis-position"]=!0,a["text-emphasis-style"]=!0,a["text-height"]=!0,a["text-indent"]=!0,a["text-justify"]=!0,a["text-orientation"]=!0,a["text-overflow"]=!0,a["text-shadow"]=!0,a["text-space-collapse"]=!0,a["text-transform"]=!0,a["text-underline-position"]=!0,a["text-wrap"]=!0,a.top=!1,a.transform=!1,a["transform-origin"]=!1,a["transform-style"]=!1,a.transition=!1,a["transition-delay"]=!1,a["transition-duration"]=!1,a["transition-property"]=!1,a["transition-timing-function"]=!1,a["unicode-bidi"]=!1,a["vertical-align"]=!1,a.visibility=!1,a["voice-balance"]=!1,a["voice-duration"]=!1,a["voice-family"]=!1,a["voice-pitch"]=!1,a["voice-range"]=!1,a["voice-rate"]=!1,a["voice-stress"]=!1,a["voice-volume"]=!1,a.volume=!1,a["white-space"]=!1,a.widows=!1,a.width=!0,a["will-change"]=!1,a["word-break"]=!0,a["word-spacing"]=!0,a["word-wrap"]=!0,a["wrap-flow"]=!1,a["wrap-through"]=!1,a["writing-mode"]=!1,a["z-index"]=!1,a}function e(a,o,s){}function n(a,o,s){}var i=/javascript\s*\:/img;function r(a,o){return i.test(o)?"":o}return Ia.whiteList=t(),Ia.getDefaultWhiteList=t,Ia.onAttr=e,Ia.onIgnoreAttr=n,Ia.safeAttrValue=r,Ia}var hu,Ip;function gx(){return Ip||(Ip=1,hu={indexOf:function(t,e){var n,i;if(Array.prototype.indexOf)return t.indexOf(e);for(n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1},forEach:function(t,e,n){var i,r;if(Array.prototype.forEach)return t.forEach(e,n);for(i=0,r=t.length;i<r;i++)e.call(n,t[i],i,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(t){return String.prototype.trimRight?t.trimRight():t.replace(/(\s*$)/g,"")}}),hu}var fu,$p;function CA(){if($p)return fu;$p=1;var t=gx();function e(n,i){n=t.trimRight(n),n[n.length-1]!==";"&&(n+=";");var r=n.length,a=!1,o=0,s=0,c="";function u(){if(!a){var d=t.trim(n.slice(o,s)),g=d.indexOf(":");if(g!==-1){var p=t.trim(d.slice(0,g)),y=t.trim(d.slice(g+1));if(p){var v=i(o,c.length,p,y,d);v&&(c+=v+"; ")}}}o=s+1}for(;s<r;s++){var h=n[s];if(h==="/"&&n[s+1]==="*"){var f=n.indexOf("*/",s+2);if(f===-1)break;s=f+1,o=s+1,a=!1}else h==="("?a=!0:h===")"?a=!1:h===";"?a||u():h===`
|
|
31
|
-
`&&u()}return t.trim(c)}return fu=e,fu}var du,Lp;function SA(){if(Lp)return du;Lp=1;var t=dx(),e=CA();gx();function n(a){return a==null}function i(a){var o={};for(var s in a)o[s]=a[s];return o}function r(a){a=i(a||{}),a.whiteList=a.whiteList||t.whiteList,a.onAttr=a.onAttr||t.onAttr,a.onIgnoreAttr=a.onIgnoreAttr||t.onIgnoreAttr,a.safeAttrValue=a.safeAttrValue||t.safeAttrValue,this.options=a}return r.prototype.process=function(a){if(a=a||"",a=a.toString(),!a)return"";var o=this,s=o.options,c=s.whiteList,u=s.onAttr,h=s.onIgnoreAttr,f=s.safeAttrValue,d=e(a,function(g,p,y,v,m){var I=c[y],j=!1;if(I===!0?j=I:typeof I=="function"?j=I(v):I instanceof RegExp&&(j=I.test(v)),j!==!0&&(j=!1),v=f(y,v),!!v){var w={position:p,sourcePosition:g,source:m,isWhite:j};if(j){var S=u(y,v,w);return n(S)?y+":"+v:S}else{var S=h(y,v,w);if(!n(S))return S}}});return d},du=r,du}var Pp;function mh(){return Pp||(Pp=1,function(t,e){var n=dx(),i=SA();function r(o,s){var c=new i(s);return c.process(o)}e=t.exports=r,e.FilterCSS=i;for(var a in n)e[a]=n[a];typeof window<"u"&&(window.filterCSS=t.exports)}(vl,vl.exports)),vl.exports}var gu,Ep;function Ff(){return Ep||(Ep=1,gu={indexOf:function(t,e){var n,i;if(Array.prototype.indexOf)return t.indexOf(e);for(n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1},forEach:function(t,e,n){var i,r;if(Array.prototype.forEach)return t.forEach(e,n);for(i=0,r=t.length;i<r;i++)e.call(n,t[i],i,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(t){var e=/\s|\n|\t/,n=e.exec(t);return n?n.index:-1}}),gu}var Vp;function px(){if(Vp)return _t;Vp=1;var t=mh().FilterCSS,e=mh().getDefaultWhiteList,n=Ff();function i(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var r=new t;function a(b,B,X){}function o(b,B,X){}function s(b,B,X){}function c(b,B,X){}function u(b){return b.replace(f,"<").replace(d,">")}function h(b,B,X,z){if(X=$(X),B==="href"||B==="src"){if(X=n.trim(X),X==="#")return"#";if(!(X.substr(0,7)==="http://"||X.substr(0,8)==="https://"||X.substr(0,7)==="mailto:"||X.substr(0,4)==="tel:"||X.substr(0,11)==="data:image/"||X.substr(0,6)==="ftp://"||X.substr(0,2)==="./"||X.substr(0,3)==="../"||X[0]==="#"||X[0]==="/"))return""}else if(B==="background"){if(I.lastIndex=0,I.test(X))return""}else if(B==="style"){if(j.lastIndex=0,j.test(X)||(w.lastIndex=0,w.test(X)&&(I.lastIndex=0,I.test(X))))return"";z!==!1&&(z=z||r,X=z.process(X))}return X=V(X),X}var f=/</g,d=/>/g,g=/"/g,p=/"/g,y=/&#([a-zA-Z0-9]*);?/gim,v=/:?/gim,m=/&newline;?/gim,I=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,j=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,w=/u\s*r\s*l\s*\(.*/gi;function S(b){return b.replace(g,""")}function P(b){return b.replace(p,'"')}function W(b){return b.replace(y,function(X,z){return z[0]==="x"||z[0]==="X"?String.fromCharCode(parseInt(z.substr(1),16)):String.fromCharCode(parseInt(z,10))})}function D(b){return b.replace(v,":").replace(m," ")}function x(b){for(var B="",X=0,z=b.length;X<z;X++)B+=b.charCodeAt(X)<32?" ":b.charAt(X);return n.trim(B)}function $(b){return b=P(b),b=W(b),b=D(b),b=x(b),b}function V(b){return b=S(b),b=u(b),b}function q(){return""}function ae(b,B){typeof B!="function"&&(B=function(){});var X=!Array.isArray(b);function z(M){return X?!0:n.indexOf(b,M)!==-1}var C=[],A=!1;return{onIgnoreTag:function(M,O,K){if(z(M))if(K.isClosing){var Q="[/removed]",se=K.position+Q.length;return C.push([A!==!1?A:K.position,se]),A=!1,Q}else return A||(A=K.position),"[removed]";else return B(M,O,K)},remove:function(M){var O="",K=0;return n.forEach(C,function(Q){O+=M.slice(K,Q[0]),K=Q[1]}),O+=M.slice(K),O}}}function G(b){for(var B="",X=0;X<b.length;){var z=b.indexOf("<!--",X);if(z===-1){B+=b.slice(X);break}B+=b.slice(X,z);var C=b.indexOf("-->",z);if(C===-1)break;X=C+3}return B}function _(b){var B=b.split("");return B=B.filter(function(X){var z=X.charCodeAt(0);return z===127?!1:z<=31?z===10||z===13:!0}),B.join("")}return _t.whiteList=i(),_t.getDefaultWhiteList=i,_t.onTag=a,_t.onIgnoreTag=o,_t.onTagAttr=s,_t.onIgnoreTagAttr=c,_t.safeAttrValue=h,_t.escapeHtml=u,_t.escapeQuote=S,_t.unescapeQuote=P,_t.escapeHtmlEntities=W,_t.escapeDangerHtml5Entities=D,_t.clearNonPrintableCharacter=x,_t.friendlyAttrValue=$,_t.escapeAttrValue=V,_t.onIgnoreTagStripAll=q,_t.StripTagBody=ae,_t.stripCommentTag=G,_t.stripBlankChar=_,_t.attributeWrapSign='"',_t.cssFilter=r,_t.getDefaultCSSWhiteList=e,_t}var wl={},Fp;function mx(){if(Fp)return wl;Fp=1;var t=Ff();function e(f){var d=t.spaceIndex(f),g;return d===-1?g=f.slice(1,-1):g=f.slice(1,d+1),g=t.trim(g).toLowerCase(),g.slice(0,1)==="/"&&(g=g.slice(1)),g.slice(-1)==="/"&&(g=g.slice(0,-1)),g}function n(f){return f.slice(0,2)==="</"}function i(f,d,g){var p="",y=0,v=!1,m=!1,I=0,j=f.length,w="",S="";e:for(I=0;I<j;I++){var P=f.charAt(I);if(v===!1){if(P==="<"){v=I;continue}}else if(m===!1){if(P==="<"){p+=g(f.slice(y,I)),v=I,y=I;continue}if(P===">"||I===j-1){p+=g(f.slice(y,v)),S=f.slice(v,I+1),w=e(S),p+=d(v,p.length,w,S,n(S)),y=I+1,v=!1;continue}if(P==='"'||P==="'")for(var W=1,D=f.charAt(I-W);D.trim()===""||D==="=";){if(D==="="){m=P;continue e}D=f.charAt(I-++W)}}else if(P===m){m=!1;continue}}return y<j&&(p+=g(f.substr(y))),p}var r=/[^a-zA-Z0-9\\_:.-]/gim;function a(f,d){var g=0,p=0,y=[],v=!1,m=f.length;function I(W,D){if(W=t.trim(W),W=W.replace(r,"").toLowerCase(),!(W.length<1)){var x=d(W,D||"");x&&y.push(x)}}for(var j=0;j<m;j++){var w=f.charAt(j),S,P;if(v===!1&&w==="="){v=f.slice(g,j),g=j+1,p=f.charAt(g)==='"'||f.charAt(g)==="'"?g:s(f,j+1);continue}if(v!==!1&&j===p){if(P=f.indexOf(w,j+1),P===-1)break;S=t.trim(f.slice(p+1,P)),I(v,S),v=!1,j=P,g=j+1;continue}if(/\s|\n|\t/.test(w))if(f=f.replace(/\s|\n|\t/g," "),v===!1)if(P=o(f,j),P===-1){S=t.trim(f.slice(g,j)),I(S),v=!1,g=j+1;continue}else{j=P-1;continue}else if(P=c(f,j-1),P===-1){S=t.trim(f.slice(g,j)),S=h(S),I(v,S),v=!1,g=j+1;continue}else continue}return g<f.length&&(v===!1?I(f.slice(g)):I(v,h(t.trim(f.slice(g))))),t.trim(y.join(" "))}function o(f,d){for(;d<f.length;d++){var g=f[d];if(g!==" ")return g==="="?d:-1}}function s(f,d){for(;d<f.length;d++){var g=f[d];if(g!==" ")return g==="'"||g==='"'?d:-1}}function c(f,d){for(;d>0;d--){var g=f[d];if(g!==" ")return g==="="?d:-1}}function u(f){return f[0]==='"'&&f[f.length-1]==='"'||f[0]==="'"&&f[f.length-1]==="'"}function h(f){return u(f)?f.substr(1,f.length-2):f}return wl.parseTag=i,wl.parseAttr=a,wl}var pu,Rp;function DA(){if(Rp)return pu;Rp=1;var t=mh().FilterCSS,e=px(),n=mx(),i=n.parseTag,r=n.parseAttr,a=Ff();function o(f){return f==null}function s(f){var d=a.spaceIndex(f);if(d===-1)return{html:"",closing:f[f.length-2]==="/"};f=a.trim(f.slice(d+1,-1));var g=f[f.length-1]==="/";return g&&(f=a.trim(f.slice(0,-1))),{html:f,closing:g}}function c(f){var d={};for(var g in f)d[g]=f[g];return d}function u(f){var d={};for(var g in f)Array.isArray(f[g])?d[g.toLowerCase()]=f[g].map(function(p){return p.toLowerCase()}):d[g.toLowerCase()]=f[g];return d}function h(f){f=c(f||{}),f.stripIgnoreTag&&(f.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),f.onIgnoreTag=e.onIgnoreTagStripAll),f.whiteList||f.allowList?f.whiteList=u(f.whiteList||f.allowList):f.whiteList=e.whiteList,this.attributeWrapSign=f.singleQuotedAttributeValue===!0?"'":e.attributeWrapSign,f.onTag=f.onTag||e.onTag,f.onTagAttr=f.onTagAttr||e.onTagAttr,f.onIgnoreTag=f.onIgnoreTag||e.onIgnoreTag,f.onIgnoreTagAttr=f.onIgnoreTagAttr||e.onIgnoreTagAttr,f.safeAttrValue=f.safeAttrValue||e.safeAttrValue,f.escapeHtml=f.escapeHtml||e.escapeHtml,this.options=f,f.css===!1?this.cssFilter=!1:(f.css=f.css||{},this.cssFilter=new t(f.css))}return h.prototype.process=function(f){if(f=f||"",f=f.toString(),!f)return"";var d=this,g=d.options,p=g.whiteList,y=g.onTag,v=g.onIgnoreTag,m=g.onTagAttr,I=g.onIgnoreTagAttr,j=g.safeAttrValue,w=g.escapeHtml,S=d.attributeWrapSign,P=d.cssFilter;g.stripBlankChar&&(f=e.stripBlankChar(f)),g.allowCommentTag||(f=e.stripCommentTag(f));var W=!1;g.stripIgnoreTagBody&&(W=e.StripTagBody(g.stripIgnoreTagBody,v),v=W.onIgnoreTag);var D=i(f,function(x,$,V,q,ae){var G={sourcePosition:x,position:$,isClosing:ae,isWhite:Object.prototype.hasOwnProperty.call(p,V)},_=y(V,q,G);if(!o(_))return _;if(G.isWhite){if(G.isClosing)return"</"+V+">";var b=s(q),B=p[V],X=r(b.html,function(z,C){var A=a.indexOf(B,z)!==-1,M=m(V,z,C,A);return o(M)?A?(C=j(V,z,C,P),C?z+"="+S+C+S:z):(M=I(V,z,C,A),o(M)?void 0:M):M});return q="<"+V,X&&(q+=" "+X),b.closing&&(q+=" /"),q+=">",q}else return _=v(V,q,G),o(_)?w(q):_},w);return W&&(D=W.remove(D)),D},pu=h,pu}var Bp;function MA(){return Bp||(Bp=1,function(t,e){var n=px(),i=mx(),r=DA();function a(s,c){var u=new r(c);return u.process(s)}e=t.exports=a,e.filterXSS=a,e.FilterXSS=r,function(){for(var s in n)e[s]=n[s];for(var c in i)e[c]=i[c]}(),typeof window<"u"&&(window.filterXSS=t.exports);function o(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}o()&&(self.filterXSS=t.exports)}(xl,xl.exports)),xl.exports}var TA=MA();const Hp=rr(TA);function kA(t,e){const n=new Rc.marked.Renderer,i=new Ew;return n.link=({href:a,title:o,text:s})=>{const c=a.startsWith("/")?"_self":"_blank";return`<a href="${a}" target="${c}" title="${o||""}">${s}</a>`},Qi.registerHelper("formatNumber",a=>typeof a=="string"?a:qe(a,"-")),Qi.registerHelper("mathExpression",a=>{const s=Qi.compile(a)(t);return i.eval(s)}),Qi.registerHelper("mathExpressionWithFormatting",a=>{const s=Qi.compile(a)(t),c=i.eval(s);return qe(c,"-")}),Rc.marked.setOptions({renderer:n}),Qi.registerHelper("markdown",a=>Rc.marked.parse(a||"")),Qi.compile(e)(t)}function jA(t){return t.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'")}function lt(t,e){const n={whiteList:{b:["class","id","style"],i:["class","id","style"],strong:["class","id","style"],em:["class","id","style"],u:["class","id","style"],small:["class","id","style"],sub:["class","id","style"],sup:["class","id","style"],mark:["class","id","style"],br:["class","id","style"],hr:["class","id","style"],p:["class","id","style"],div:["class","id","style"],span:["class","id","style"],blockquote:["class","id","style"],pre:["class","id","style"],code:["class","id","style"],h1:["class","id","style"],h2:["class","id","style"],h3:["class","id","style"],h4:["class","id","style"],h5:["class","id","style"],h6:["class","id","style"],ul:["class","id","style"],ol:["class","id","style"],li:["class","id","style"],dl:["class","id","style"],dt:["class","id","style"],dd:["class","id","style"],table:["class","id","style"],thead:["class","id","style"],tbody:["class","id","style"],tfoot:["class","id","style"],tr:["class","id","style"],th:["class","id","style"],td:["class","id","style"],caption:["class","id","style"],img:["class","id","style","src","alt","width","height"],figure:["class","id","style"],figcaption:["class","id","style"],a:["class","id","style","href","title"],abbr:["class","id","style","title"],cite:["class","id","style"],dfn:["class","id","style"],kbd:["class","id","style"],samp:["class","id","style"]},css:{whiteList:{color:!0,background:!0,"background-color":!0,"background-image":!0,"font-size":!0,"font-weight":!0,"text-transform":!0,"font-style":!0,"font-family":!0,"text-align":!0,margin:!0,padding:!0,border:!0,overflow:!0,"overflow-x":!0,"overflow-y":!0,"border-radius":!0,"border-color":!0,display:!0,flex:!0,"flex-direction":!0,"flex-wrap":!0,"flex-flow":!0,"flex-shrink":!0,"flex-grow":!0,order:!0,"flex-basis":!0,"align-self":!0,gap:!0,"row-gap":!0,"column-gap":!0,"justify-content":!0,"align-items":!0,"align-content":!0,width:!0,height:!0,position:!0,top:!0,left:!0,right:!0,bottom:!0,"padding-top":!0,"padding-left":!0,"padding-right":!0,"padding-bottom":!0,"margin-top":!0,"margin-left":!0,"margin-right":!0,"margin-bottom":!0,"border-top":!0,"border-left":!0,"border-right":!0,"border-bottom":!0,"z-index":!0,"word-wrap":!0,visibility:!0,opacity:!0,filter:!0,transform:!0,transition:!0,cursor:!0,clip:!0,hyphens:!0,direction:!0,"word-break":!0,"max-width":!0,"min-width":!0,"max-height":!0,"min-height":!0,fill:!0,"clip-path":!0,"border-width":!0,"border-style":!0,"box-sizing":!0,"grid-template-rows":!0,"grid-template-columns":!0,"font-variant":!0,"letter-spacing":!0,"line-height":!0,"text-decoration":!0,"text-indent":!0,"white-space":!0,"word-spacing":!0,"box-shadow":!0,"transition-property":!0,"transition-duration":!0,"transition-timing-function":!0,"animation-name":!0,"animation-duration":!0}}};if(!e)return Hp(t,n);const i=Hp(kA(e,t),n);return jA(i)}function st(t){const{body:e,xPos:n,yPos:i,data:r,backgroundStyle:a={maxWidth:"24rem",wordWrap:"break-word"},className:o}=t;return Pw.createPortal(l.jsx("div",{className:"undp-container",children:l.jsx("div",{className:Ce.cn("graph-tooltip block p-2 fixed z-[1000] bg-primary-gray-200 dark:bg-primary-gray-600 border border-primary-gray-300 dark:border-primary-gray-500",o),style:{...a,top:`${i<window.innerHeight/2?i-10:i+10}px`,left:`${n>window.innerWidth/2?n-10:n+10}px`,transform:`translate(${n>window.innerWidth/2?"-100%":"0%"},${i>window.innerHeight/2?"-100%":"0%"})`},children:l.jsx("div",{className:"text-sm leading-normal text-primary-black dark:text-primary-gray-100 m-0",dangerouslySetInnerHTML:typeof e=="string"?{__html:lt(e,r)}:void 0,children:typeof e=="function"?e(r):null})})}),document.body)}const Pe={gray:"#D4D6D8",graphMainColor:"#0468B1",primaryColors:{"blue-100":"#B5D5F5","blue-200":"#94C4F5","blue-300":"#6BABEB","blue-400":"#4F95DD","blue-500":"#3288CE","blue-600":"#0468B1","blue-700":"#1F5A95"},genderColors:{male:"#02A38A",female:"#757AF0"},locationColors:{urban:"#0468B1",rural:"#5DD4F0"},alerts:{lightYellow:"#FFE17E",yellow:"#FFEB00",darkYellow:"#FBC412",lightRed:"#FFBCB7",red:"#EE402D",darkRed:"#D12800",lightGreen:"#B8ECB6",green:"#6DE354",darkGreen:"#59BA47",lightAzure:"#A2DAF3",azure:"#60D4F2",darkAzure:"#00C1FF"},sdgColors:{sdg1:"#E5243B",sdg2:"#DDA63A",sdg3:"#4C9F38",sdg4:"#C5192D",sdg5:"#FF3A21",sdg6:"#26BDE2",sdg7:"#FCC30B",sdg8:"#A21942",sdg9:"#FD6925",sdg10:"#DD1367",sdg11:"#FD9D24",sdg12:"#BF8B2E",sdg13:"#3F7E44",sdg14:"#0A97D9",sdg15:"#56C02B",sdg16:"#00689D",sdg17:"#19486A"},light:{graphBackgroundColor:"#F7F7F7",graphNoData:"#FFFFFF",grays:{white:"#FFFFFF","gray-100":"#FAFAFA","gray-200":"#F7F7F7","gray-300":"#EDEFF0","gray-400":"#D4D6D8","gray-500":"#A9B1B7","gray-550":"#879099","gray-600":"#55606E","gray-700":"#232E3D",black:"#000000"},categoricalColors:{colors:["#0468B1","#5DD4F0","#02A38A","#E78625","#E0529E","#757AF0","#A0C236","#FBC412","#BF8B2E","#A9B1B7"]},sequentialColors:{negativeColorsx04:["#F6B666","#EB8033","#D64513","#A71C04"],negativeColorsx05:["#FBD68A","#F39E4B","#E16424","#C12705","#850E02"],negativeColorsx06:["#FFF4AC","#F7BD6D","#EC8234","#D54211","#A01903","#650000"],negativeColorsx07:["#FFF4AC","#F8C678","#F29641","#E16424","#C92B06","#961503","#650000"],negativeColorsx08:["#FFF4AC","#F9CD7F","#F4A451","#E97A30","#D94C17","#BB2505","#8F1202","#650000"],negativeColorsx09:["#FFF4AC","#FAD285","#F5AE5D","#EE8938","#E16424","#D2390C","#ad190d","#891002","#650000"],negativeColorsx10:["#FFF4AC","#FBD68A","#F6B666","#F29641","#E7752D","#DB521A","#C92B06","#A71C04","#850E02","#650000"],positiveColorsx04:["#BADA81","#7FC45F","#58A85A","#308C56"],positiveColorsx05:["#DDE797","#9FD071","#6CB65D","#429858","#187B54"],positiveColorsx06:["#FFF4AC","#C1DD85","#81C55F","#56A75A","#2C8956","#006A51"],positiveColorsx07:["#FFF4AC","#CBE18C","#96CD6B","#6CB65D","#489D59","#248455","#006A51"],positiveColorsx08:["#FFF4AC","#D3E491","#A6D374","#7BC05E","#5CAB5B","#3E9558","#1F8054","#006A51"],positiveColorsx09:["#FFF4AC","#D8E694","#B1D77C","#88C862","#6CB65D","#51A35A","#369057","#1B7D54","#006A51"],positiveColorsx10:["#FFF4AC","#DDE797","#BADA81","#96CD6B","#78BE5E","#60AD5B","#489D59","#308C56","#187B54","#006A51"],neutralColorsx04:["#FFF4AC","#5FCDA1","#0091A9","#005396"],neutralColorsx05:["#FFF4AC","#7BD4A3","#00A5A1","#006CB3","#003F80"],neutralColorsx06:["#FFF4AC","#98DBA5","#16BB9C","#008FA9","#0063A8","#003F80"],neutralColorsx07:["#FFF4AC","#AADFA6","#47C79F","#00A5A1","#007FAF","#005DA1","#003F80"],neutralColorsx08:["#FFF4AC","#B7E2A7","#66CFA2","#00B59B","#0095A7","#0074B3","#00589D","#003F80"],neutralColorsx09:["#FFF4AC","#C1E5A8","#7CD4A3","#29C09D","#00A5A1","#0089AB","#006CB3","#005599","#003F80"],neutralColorsx10:["#FFF4AC","#C8E7A8","#8CD8A4","#47C79F","#00B29C","#0099A5","#007FAF","#0067AD","#005396","#003F80"]},divergentColors:{colorsx04:["#d9382d","#eea57d","#89bfdc","#347cbc"],colorsx05:["#d9382d","#eea57d","#ffffbf","#89bfdc","#347cbc"],colorsx06:["#d9382d","#e88666","#f6d39e","#bae0e1","#70a8cc","#347cbc"],colorsx07:["#d9382d","#e88666","#f6d39e","#ffffbf","#bae0e1","#70a8cc","#347cbc"],colorsx08:["#d9382d","#e47559","#eea57d","#f6d39e","#bae0e1","#89bfdc","#5f9dcc","#347cbc"],colorsx09:["#d9382d","#e47559","#eea57d","#f6d39e","#ffffbf","#bae0e1","#89bfdc","#5f9dcc","#347cbc"],colorsx10:["#aa1d09","#d9382d","#e47559","#eea57d","#f6d39e","#bae0e1","#89bfdc","#5f9dcc","#347cbc","#095aab"],colorsx11:["#aa1d09","#d9382d","#e47559","#eea57d","#f6d39e","#ffffbf","#bae0e1","#89bfdc","#5f9dcc","#347cbc","#095aab"]},bivariateColors:{colors03x03:[["#e5e5e5","#7FDCF9","#0BC6FF"],["#F99FBA","#9697D3","#3690EB"],["#F4618D","#A961B3","#5C61DA"]],colors04x04:[["#e5e5e5","#BAE7F6","#7FDCF9","#41D0FC"],["#F6C5D4","#BFBEDD","#88B8E5","#57B2ED"],["#F99FBA","#C89BC6","#9697D3","#6494DF"],["#F782A5","#D180B3","#9F7DC5","#727AD4"]],colors05x04:[["#e5e5e5","#BAE7F6","#7FDCF9","#41D0FC"],["#F6C5D4","#BFBEDD","#88B8E5","#57B2ED"],["#F99FBA","#C89BC6","#9697D3","#6494DF"],["#F782A5","#D180B3","#9F7DC5","#727AD4"],["#F4618D","#D2619F","#A961B3","#8061C8"]],colors04x05:[["#e5e5e5","#BAE7F6","#7FDCF9","#41D0FC","#0BC6FF"],["#F6C5D4","#BFBEDD","#88B8E5","#57B2ED","#21ABF5"],["#F99FBA","#C89BC6","#9697D3","#6494DF","#3690EB"],["#F782A5","#D180B3","#9F7DC5","#727AD4","#4978E3"]],colors05x05:[["#e5e5e5","#BAE7F6","#7FDCF9","#41D0FC","#0BC6FF"],["#F6C5D4","#BFBEDD","#88B8E5","#57B2ED","#21ABF5"],["#F99FBA","#C89BC6","#9697D3","#6494DF","#3690EB"],["#F782A5","#D180B3","#9F7DC5","#727AD4","#4978E3"],["#F4618D","#D2619F","#A961B3","#8061C8","#5C61DA"]]}},dark:{graphBackgroundColor:"#232E3D",graphNoData:"#FFFFFF",grays:{white:"#232E3D","gray-100":"#394250","gray-200":"#47505C","gray-300":"#57606D","gray-400":"#78808A","gray-500":"#AAB1B6","gray-550":"#AAB1B6","gray-600":"#D4D6D8","gray-700":"#EAEBEC",black:"#FFFFFF"},categoricalColors:{colors:["#0468B1","#5DD4F0","#02A38A","#E78625","#E0529E","#757AF0","#A0C236","#FBC412","#BF8B2E","#A9B1B7"]},sequentialColors:{negativeColorsx04:["#A71C04","#D64513","#EB8033","#F6B666"],negativeColorsx05:["#850E02","#C12705","#E16424","#F39E4B","#FBD68A"],negativeColorsx06:["#650000","#A01903","#D54211","#EC8234","#F7BD6D","#FFF4AC"],negativeColorsx07:["#650000","#961503","#C92B06","#E16424","#F29641","#F8C678","#FFF4AC"],negativeColorsx08:["#650000","#8F1202","#BB2505","#D94C17","#E97A30","#F4A451","#F9CD7F","#FFF4AC"],negativeColorsx09:["#650000","#891002","#ad190d","#D2390C","#E16424","#EE8938","#F5AE5D","#FAD285","#FFF4AC"],negativeColorsx10:["#650000","#850E02","#A71C04","#C92B06","#DB521A","#E7752D","#F29641","#F6B666","#FBD68A","#FFF4AC"],positiveColorsx04:["#308C56","#58A85A","#7FC45F","#BADA81"],positiveColorsx05:["#187B54","#429858","#6CB65D","#9FD071","#DDE797"],positiveColorsx06:["#006A51","#2C8956","#56A75A","#81C55F","#C1DD85","#FFF4AC"],positiveColorsx07:["#006A51","#248455","#489D59","#6CB65D","#96CD6B","#CBE18C","#FFF4AC"],positiveColorsx08:["#006A51","#1F8054","#3E9558","#5CAB5B","#7BC05E","#A6D374","#D3E491","#FFF4AC"],positiveColorsx09:["#006A51","#1B7D54","#369057","#51A35A","#6CB65D","#88C862","#B1D77C","#D8E694","#FFF4AC"],positiveColorsx10:["#006A51","#187B54","#308C56","#489D59","#60AD5B","#78BE5E","#96CD6B","#BADA81","#DDE797","#FFF4AC"],neutralColorsx04:["#005396","#0091A9","#5FCDA1","#FFF4AC"],neutralColorsx05:["#003F80","#006CB3","#00A5A1","#7BD4A3","#FFF4AC"],neutralColorsx06:["#003F80","#0063A8","#008FA9","#16BB9C","#98DBA5","#FFF4AC"],neutralColorsx07:["#003F80","#005DA1","#007FAF","#00A5A1","#47C79F","#AADFA6","#FFF4AC"],neutralColorsx08:["#003F80","#00589D","#0074B3","#0095A7","#00B59B","#66CFA2","#B7E2A7","#FFF4AC"],neutralColorsx09:["#003F80","#005599","#006CB3","#0089AB","#00A5A1","#29C09D","#7CD4A3","#C1E5A8","#FFF4AC"],neutralColorsx10:["#003F80","#005396","#0067AD","#007FAF","#0099A5","#00B29C","#47C79F","#8CD8A4","#C8E7A8","#FFF4AC"]},divergentColors:{colorsx04:["#347cbc","#89bfdc","#eea57d","#d9382d"],colorsx05:["#347cbc","#89bfdc","#ffffbf","#eea57d","#d9382d"],colorsx06:["#347cbc","#70a8cc","#bae0e1","#f6d39e","#e88666","#d9382d"],colorsx07:["#347cbc","#70a8cc","#bae0e1","#ffffbf","#f6d39e","#e88666","#d9382d"],colorsx08:["#347cbc","#5f9dcc","#89bfdc","#bae0e1","#f6d39e","#eea57d","#e47559","#d9382d"],colorsx09:["#347cbc","#5f9dcc","#89bfdc","#bae0e1","#ffffbf","#f6d39e","#eea57d","#e47559","#d9382d"],colorsx10:["#095aab","#347cbc","#5f9dcc","#89bfdc","#bae0e1","#f6d39e","#eea57d","#e47559","#d9382d","#aa1d09"],colorsx11:["#095aab","#347cbc","#5f9dcc","#89bfdc","#bae0e1","#ffffbf","#f6d39e","#eea57d","#e47559","#d9382d","#aa1d09"]},bivariateColors:{colors03x03:[["#e5e5e5","#7FDCF9","#0BC6FF"],["#F99FBA","#9697D3","#3690EB"],["#F4618D","#A961B3","#5C61DA"]],colors04x04:[["#e5e5e5","#BAE7F6","#7FDCF9","#41D0FC"],["#F6C5D4","#BFBEDD","#88B8E5","#57B2ED"],["#F99FBA","#C89BC6","#9697D3","#6494DF"],["#F782A5","#D180B3","#9F7DC5","#727AD4"]],colors05x04:[["#e5e5e5","#BAE7F6","#7FDCF9","#41D0FC"],["#F6C5D4","#BFBEDD","#88B8E5","#57B2ED"],["#F99FBA","#C89BC6","#9697D3","#6494DF"],["#F782A5","#D180B3","#9F7DC5","#727AD4"],["#F4618D","#D2619F","#A961B3","#8061C8"]],colors04x05:[["#e5e5e5","#BAE7F6","#7FDCF9","#41D0FC","#0BC6FF"],["#F6C5D4","#BFBEDD","#88B8E5","#57B2ED","#21ABF5"],["#F99FBA","#C89BC6","#9697D3","#6494DF","#3690EB"],["#F782A5","#D180B3","#9F7DC5","#727AD4","#4978E3"]],colors05x05:[["#e5e5e5","#BAE7F6","#7FDCF9","#41D0FC","#0BC6FF"],["#F6C5D4","#BFBEDD","#88B8E5","#57B2ED","#21ABF5"],["#F99FBA","#C89BC6","#9697D3","#6494DF","#3690EB"],["#F782A5","#D180B3","#9F7DC5","#727AD4","#4978E3"],["#F4618D","#D2619F","#A961B3","#8061C8","#5C61DA"]]}}};function Rn(t){const{values:e,x:n,y1:i,y2:r,styles:a,classNames:o,prefix:s,suffix:c,labelType:u,showGridLines:h,precision:f,leftLabel:d=!1}=t;return!e&&!h?null:l.jsx(l.Fragment,{children:n.map((g,p)=>l.jsxs("g",{children:[h?l.jsx("line",{x1:g,x2:g,y1:i,y2:r,className:Ce.cn("undp-tick-line stroke-primary-gray-500 dark:stroke-primary-gray-550",o?.gridLines),style:a?.gridLines}):null,e?l.jsx("text",{x:g,y:u==="primary"?r:i,dy:u==="primary"?"1em":"0.75em",dx:u==="primary"?0:g<0||d?-3:3,style:{textAnchor:u==="primary"?"middle":g<0||d?"end":"start",...a?.labels||{}},className:Ce.cn(u==="primary"?"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs":"fill-primary-gray-550 dark:fill-primary-gray-500 text-xs",o?.labels),children:typeof e[p]=="string"?e[p]:qe(e[p],"NA",f,s,c)}):null]},p))})}function io(t){const{value:e,y:n,x:i,style:r,className:a,width:o,height:s,alignment:c="right",animate:u,isInView:h}=t;return l.jsx($e.foreignObject,{width:o,height:s,x:i,variants:{initial:{y:n},whileInView:{y:n,transition:{duration:u.duration}}},initial:"initial",animate:h?"whileInView":"initial",exit:{opacity:0,transition:{duration:u.duration}},children:l.jsx("div",{className:"flex flex-col justify-center h-inherit",children:l.jsx("p",{className:Ce.cn("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 leading-none",`text-${c}`,a),style:r,children:e})})})}function Nt(t){const{text:e,x:n,y:i,className:r,style:a,rotate90:o}=t;return e?l.jsx("text",{transform:`translate(${n}, ${i})${o?" rotate(-90)":""}`,style:{textAnchor:"middle",...a||{}},className:Ce.cn("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",r),children:e}):null}function Dt(t){const{label:e,x2:n,y2:i,x1:r,y1:a,classNames:o,styles:s,labelPos:c}=t;return l.jsxs(l.Fragment,{children:[l.jsx("line",{y1:a,y2:i,x1:r,x2:n,style:s?.axis,className:Ce.cn("stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300",o?.axis)}),je(e)?null:l.jsx("text",{x:c?.x,y:c?.y,style:{textAnchor:"start",...s?.label||""},className:Ce.cn("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",o?.label),dy:c?.dy,dx:c?.dx,children:e})]})}function gi(t){const{text:e,x1:n,x2:i,y:r,classNames:a,styles:o,color:s,animate:c,isInView:u}=t;return e?l.jsxs($e.g,{exit:{opacity:0,transition:{duration:c.duration}},variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:c.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:[l.jsx("line",{className:Ce.cn("undp-ref-line",s?void 0:"stroke-primary-gray-700 dark:stroke-primary-gray-300",a?.line),style:{...s&&{stroke:s},...o?.line||{}},y1:r,y2:r,x1:n,x2:i}),l.jsx("text",{x:i,y:r,style:{...s&&{fill:s},textAnchor:"end",...o?.text||{}},className:Ce.cn("text-xs font-bold",s?void 0:" fill-primary-gray-700 dark:fill-primary-gray-300",a?.text),dy:-5,children:e})]},`${n}-${i}-${r}`):null}function Tr(t){const{text:e,y1:n,y2:i,x:r,classNames:a,styles:o,color:s,textSide:c,animate:u,isInView:h}=t;return e?l.jsxs($e.g,{exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:u.duration}}},initial:"initial",animate:h?"whileInView":"initial",children:[l.jsx("line",{className:Ce.cn("undp-ref-line",s?void 0:"stroke-primary-gray-700 dark:stroke-primary-gray-300",a?.line),style:{...s&&{stroke:s},...o?.line||{}},y1:n,y2:i,x1:r,x2:r}),l.jsx("text",{x:r,y:n,style:{...s&&{fill:s},textAnchor:c==="left"?"end":"start",...o?.text||{}},className:Ce.cn("text-xs font-bold",s?void 0:"fill-primary-gray-700 dark:fill-primary-gray-300",a?.text),dy:12.5,dx:c==="left"?-5:5,children:e})]},`${n}-${i}-${r}`):null}function AA(t){const{data:e,barColor:n,suffix:i,prefix:r,barPadding:a,showValues:o,showTicks:s,leftMargin:c,truncateBy:u,width:h,height:f,colorDomain:d,rightMargin:g,topMargin:p,bottomMargin:y,showLabels:v,tooltip:m,onSeriesMouseOver:I,refValues:j,selectedColor:w,highlightedDataPoints:S,maxValue:P,minValue:W,onSeriesMouseClick:D,labelOrder:x,rtl:$,maxBarThickness:V,minBarThickness:q,resetSelectionOnDoubleClick:ae,detailsOnClick:G,barAxisTitle:_,valueColor:b,noOfTicks:B,styles:X,classNames:z,animate:C,dimmedOpacity:A,precision:M,customLayers:O,naLabel:K}=t,Q=k.useRef(null),se=ct(Q,{once:C.once,amount:C.amount}),[T,Z]=k.useState(void 0),[ie,ue]=k.useState(void 0),[he,Y]=k.useState(void 0),[ge,oe]=k.useState(void 0),ce={top:_?p+25:p,bottom:y,left:c,right:g},N=h-ce.left-ce.right,U=f-ce.top-ce.bottom,ve=e.map((de,te)=>({...de,id:x?`${de.label}`:`${te}`})),J=ut().domain([W,P]).range([0,N]).nice(),R=x||ve.map(de=>`${de.id}`),le=xn().domain(R).range([0,q?Math.max(U,q*R.length):V?Math.min(U,V*R.length):U]).paddingInner(a),ee=J.ticks(B);return l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{ref:Q,width:`${h}px`,height:`${f}px`,viewBox:`0 0 ${h} ${f}`,direction:"ltr",children:l.jsxs("g",{transform:`translate(${ce.left},${ce.top})`,children:[s?l.jsx(Rn,{values:ee.filter(de=>de!==0),x:ee.filter(de=>de!==0).map(de=>J(de)),y1:0-p,y2:U+ce.bottom,styles:{gridLines:X?.xAxis?.gridLines,labels:X?.xAxis?.labels},classNames:{gridLines:z?.xAxis?.gridLines,labels:z?.xAxis?.labels},suffix:i,prefix:r,labelType:"secondary",showGridLines:!0,precision:M}):null,l.jsx(Nt,{x:N/2,y:0-ce.top+15,style:X?.xAxis?.title,className:z?.xAxis?.title,text:_}),O.filter(de=>de.position==="before").map(de=>de.layer),l.jsxs(mt,{children:[ve.map(de=>je(le(de.id))?null:l.jsxs($e.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:w?de.color&&n[d.indexOf(de.color)]===w?1:A:S.length!==0?S.indexOf(de.label)!==-1?.85:A:.85},whileInView:{opacity:w?de.color&&n[d.indexOf(de.color)]===w?1:A:S.length!==0?S.indexOf(de.label)!==-1?.85:A:.85,transition:{duration:C.duration}}},initial:"initial",animate:se?"whileInView":"initial",exit:{opacity:0,transition:{duration:C.duration}},onMouseEnter:te=>{Z(de),oe(te.clientY),Y(te.clientX),I?.(de)},onClick:()=>{(D||G)&&(dt(ie,de)&&ae?(ue(void 0),D?.(void 0)):(ue(de),D?.(de)))},onMouseMove:te=>{Z(de),oe(te.clientY),Y(te.clientX)},onMouseLeave:()=>{Z(void 0),Y(void 0),oe(void 0),I?.(void 0)},children:[de.size?l.jsx($e.rect,{variants:{initial:{width:0,x:J(0),y:le(`${de.id}`),fill:e.filter(te=>te.color).length===0?n[0]:de.color?n[d.indexOf(de.color)]:Pe.gray},whileInView:{width:de.size>=0?J(de.size)-J(0):J(0)-J(de.size),x:de.size>=0?J(0):J(de.size),y:le(`${de.id}`),fill:e.filter(te=>te.color).length===0?n[0]:de.color?n[d.indexOf(de.color)]:Pe.gray,transition:{duration:C.duration}}},initial:"initial",animate:se?"whileInView":"initial",exit:{width:0,x:J(0),transition:{duration:C.duration}},height:le.bandwidth()}):null,v?l.jsx(io,{value:`${de.label}`.length<u?`${de.label}`:`${`${de.label}`.substring(0,u)}...`,y:le(de.id)||0,x:(de.size||0)<0?J(0):0-ce.left,width:(de.size||0)<0?h-J(0):J(0)+ce.left,height:le.bandwidth(),alignment:de.size&&de.size<0?"left":"right",style:X?.yAxis?.labels,className:z?.yAxis?.labels,animate:C,isInView:se}):null,o?l.jsx($e.text,{style:{textAnchor:de.size&&de.size<0?"end":"start",...X?.graphObjectValues||{}},className:Ce.cn("graph-value text-sm",!b&&n.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",z?.graphObjectValues),dx:de.size&&de.size<0?-5:5,dy:"0.33em",variants:{initial:{x:J(0),y:le(`${de.id}`)+le.bandwidth()/2,opacity:0,fill:b||(e.filter(te=>te.color).length===0?n[0]:de.color?n[d.indexOf(de.color)]:Pe.gray)},whileInView:{x:de.size?J(de.size):J(0),opacity:1,y:le(`${de.id}`)+le.bandwidth()/2,fill:b||(e.filter(te=>te.color).length===0?n[0]:de.color?n[d.indexOf(de.color)]:Pe.gray),transition:{duration:C.duration}}},initial:"initial",animate:se?"whileInView":"initial",exit:{opacity:0,transition:{duration:C.duration}},children:qe(de.size,K,M,r,i)}):null]},de.label)),l.jsx(Dt,{x1:J(W<0?0:W),x2:J(W<0?0:W),y1:-2.5,y2:U+ce.bottom,classNames:{axis:z?.yAxis?.axis},styles:{axis:X?.yAxis?.axis}}),j?l.jsx(l.Fragment,{children:j.map((de,te)=>l.jsx(Tr,{text:de.text,color:de.color,x:J(de.value),y1:0-ce.top,y2:U+ce.bottom,textSide:J(de.value)>N*.75||$?"left":"right",classNames:de.classNames,styles:de.styles,animate:C,isInView:se},te))}):null]}),O.filter(de=>de.position==="after").map(de=>de.layer)]})}),T&&m&&he&&ge?l.jsx(st,{data:T,body:m,xPos:he,yPos:ge,backgroundStyle:X?.tooltip,className:z?.tooltip}):null,G&&ie!==void 0?l.jsx(Ce.Modal,{open:ie!==void 0,onClose:()=>{ue(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof G=="string"?{__html:lt(G,ie)}:void 0,children:typeof G=="function"?G(ie):null})}):null]})}function yx(t){const{text:e,style:n={},className:i}=t;return typeof e=="string"?e.trim()===""?null:l.jsx(Ce.P,{size:"sm",marginBottom:"none",className:Ce.cn("text-primary-gray-550 dark:text-primary-gray-40",i),"aria-label":"Graph footnote",style:n,children:e}):k.isValidElement(e)?l.jsx("div",{className:i,style:n,children:e}):(console.error("FootNote: Invalid text type. Expected string or React element."),null)}function xx(t){const{sources:e,style:n={},className:i}=t;return l.jsxs(Ce.P,{size:"sm",marginBottom:"none","aria-label":"Data sources",className:Ce.cn("text-primary-gray-550 dark:text-primary-gray-400",i),style:n,children:["Source:"," ",e.map((r,a)=>l.jsx("span",{className:Ce.cn("text-primary-gray-550 dark:text-primary-gray-400",i),style:{fontFamily:"inherit"},children:r.link?l.jsx(Ce.A,{className:Ce.cn("text-primary-gray-550 dark:text-primary-gray-400",i),href:r.link,target:"_blank",rel:"noreferrer",children:r.source}):r.source},a))]})}function et(t){const{sources:e,footNote:n,width:i,styles:r,classNames:a}=t;return(e===void 0||(e||[]).length===0)&&n===void 0?null:l.jsxs("div",{className:"flex gap-2 flex-col",style:{maxWidth:i?`${i}px`:"none"},"aria-label":"Graph footer",children:[e?l.jsx(xx,{sources:e,style:r?.source,className:a?.source}):null,n?l.jsx(yx,{text:n,style:r?.footnote,className:a?.footnote}):null]})}const _A=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent),vx=t=>Array.isArray(t)&&t.every(e=>typeof e=="object"&&!(e instanceof Array)),OA=t=>Array.isArray(t)&&t.every(e=>Array.isArray(e)),NA=t=>Array.from(t.map(e=>Object.keys(e)).reduce((e,n)=>new Set([...e,...n]),[])),IA=(t,e)=>{e=e||NA(t);let n=e,i=e;vx(e)&&(n=e.map(a=>a.label),i=e.map(a=>a.key));const r=t.map(a=>i.map(o=>$A(o,a)));return[n,...r]},$A=(t,e)=>{const n=t.replace(/\[([^\]]+)]/g,".$1").split(".").reduce(function(i,r,a,o){const s=i[r];if(s==null)o.splice(1);else return s},e);return n===void 0?t in e?e[t]:"":n},LA=t=>typeof t>"u"||t===null?"":t,wx=(t,e=",",n='"')=>t.filter(i=>i).map(i=>i.map(r=>LA(r)).map(r=>`${n}${r}${n}`).join(e)).join(`
|
|
32
|
-
`),PA=(t,e,n,i)=>wx(e?[e,...t]:t,n,i),EA=(t,e,n,i)=>wx(IA(t,e),n,i),VA=(t,e,n,i)=>e?`${e.join(n)}
|
|
33
|
-
${t}`:t.replace(/"/g,'""'),bx=(t,e,n,i)=>{if(vx(t))return EA(t,e,n,i);if(OA(t))return PA(t,e,n,i);if(typeof t=="string")return VA(t,e,n);throw new TypeError('Data should be a "String", "Array of arrays" OR "Array of objects" ')},Cx=(t,e,n,i,r)=>{const a=bx(t,n,i,r),o=_A()?"application/csv":"text/csv",s=new Blob([e?"\uFEFF":"",a],{type:o}),c=`data:${o};charset=utf-8,${e?"\uFEFF":""}${a}`,u=window.URL||window.webkitURL;return typeof u.createObjectURL>"u"?c:u.createObjectURL(s)};var bl={exports:{}},Cl={exports:{}},vt={};/** @license React v16.13.1
|
|
34
|
-
* react-is.production.min.js
|
|
35
|
-
*
|
|
36
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
37
|
-
*
|
|
38
|
-
* This source code is licensed under the MIT license found in the
|
|
39
|
-
* LICENSE file in the root directory of this source tree.
|
|
40
|
-
*/var Wp;function FA(){if(Wp)return vt;Wp=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,i=t?Symbol.for("react.fragment"):60107,r=t?Symbol.for("react.strict_mode"):60108,a=t?Symbol.for("react.profiler"):60114,o=t?Symbol.for("react.provider"):60109,s=t?Symbol.for("react.context"):60110,c=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,h=t?Symbol.for("react.forward_ref"):60112,f=t?Symbol.for("react.suspense"):60113,d=t?Symbol.for("react.suspense_list"):60120,g=t?Symbol.for("react.memo"):60115,p=t?Symbol.for("react.lazy"):60116,y=t?Symbol.for("react.block"):60121,v=t?Symbol.for("react.fundamental"):60117,m=t?Symbol.for("react.responder"):60118,I=t?Symbol.for("react.scope"):60119;function j(S){if(typeof S=="object"&&S!==null){var P=S.$$typeof;switch(P){case e:switch(S=S.type,S){case c:case u:case i:case a:case r:case f:return S;default:switch(S=S&&S.$$typeof,S){case s:case h:case p:case g:case o:return S;default:return P}}case n:return P}}}function w(S){return j(S)===u}return vt.AsyncMode=c,vt.ConcurrentMode=u,vt.ContextConsumer=s,vt.ContextProvider=o,vt.Element=e,vt.ForwardRef=h,vt.Fragment=i,vt.Lazy=p,vt.Memo=g,vt.Portal=n,vt.Profiler=a,vt.StrictMode=r,vt.Suspense=f,vt.isAsyncMode=function(S){return w(S)||j(S)===c},vt.isConcurrentMode=w,vt.isContextConsumer=function(S){return j(S)===s},vt.isContextProvider=function(S){return j(S)===o},vt.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===e},vt.isForwardRef=function(S){return j(S)===h},vt.isFragment=function(S){return j(S)===i},vt.isLazy=function(S){return j(S)===p},vt.isMemo=function(S){return j(S)===g},vt.isPortal=function(S){return j(S)===n},vt.isProfiler=function(S){return j(S)===a},vt.isStrictMode=function(S){return j(S)===r},vt.isSuspense=function(S){return j(S)===f},vt.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===i||S===u||S===a||S===r||S===f||S===d||typeof S=="object"&&S!==null&&(S.$$typeof===p||S.$$typeof===g||S.$$typeof===o||S.$$typeof===s||S.$$typeof===h||S.$$typeof===v||S.$$typeof===m||S.$$typeof===I||S.$$typeof===y)},vt.typeOf=j,vt}var wt={};/** @license React v16.13.1
|
|
41
|
-
* react-is.development.js
|
|
42
|
-
*
|
|
43
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
44
|
-
*
|
|
45
|
-
* This source code is licensed under the MIT license found in the
|
|
46
|
-
* LICENSE file in the root directory of this source tree.
|
|
47
|
-
*/var zp;function RA(){return zp||(zp=1,process.env.NODE_ENV!=="production"&&function(){var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,i=t?Symbol.for("react.fragment"):60107,r=t?Symbol.for("react.strict_mode"):60108,a=t?Symbol.for("react.profiler"):60114,o=t?Symbol.for("react.provider"):60109,s=t?Symbol.for("react.context"):60110,c=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,h=t?Symbol.for("react.forward_ref"):60112,f=t?Symbol.for("react.suspense"):60113,d=t?Symbol.for("react.suspense_list"):60120,g=t?Symbol.for("react.memo"):60115,p=t?Symbol.for("react.lazy"):60116,y=t?Symbol.for("react.block"):60121,v=t?Symbol.for("react.fundamental"):60117,m=t?Symbol.for("react.responder"):60118,I=t?Symbol.for("react.scope"):60119;function j(Y){return typeof Y=="string"||typeof Y=="function"||Y===i||Y===u||Y===a||Y===r||Y===f||Y===d||typeof Y=="object"&&Y!==null&&(Y.$$typeof===p||Y.$$typeof===g||Y.$$typeof===o||Y.$$typeof===s||Y.$$typeof===h||Y.$$typeof===v||Y.$$typeof===m||Y.$$typeof===I||Y.$$typeof===y)}function w(Y){if(typeof Y=="object"&&Y!==null){var ge=Y.$$typeof;switch(ge){case e:var oe=Y.type;switch(oe){case c:case u:case i:case a:case r:case f:return oe;default:var ce=oe&&oe.$$typeof;switch(ce){case s:case h:case p:case g:case o:return ce;default:return ge}}case n:return ge}}}var S=c,P=u,W=s,D=o,x=e,$=h,V=i,q=p,ae=g,G=n,_=a,b=r,B=f,X=!1;function z(Y){return X||(X=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),C(Y)||w(Y)===c}function C(Y){return w(Y)===u}function A(Y){return w(Y)===s}function M(Y){return w(Y)===o}function O(Y){return typeof Y=="object"&&Y!==null&&Y.$$typeof===e}function K(Y){return w(Y)===h}function Q(Y){return w(Y)===i}function se(Y){return w(Y)===p}function T(Y){return w(Y)===g}function Z(Y){return w(Y)===n}function ie(Y){return w(Y)===a}function ue(Y){return w(Y)===r}function he(Y){return w(Y)===f}wt.AsyncMode=S,wt.ConcurrentMode=P,wt.ContextConsumer=W,wt.ContextProvider=D,wt.Element=x,wt.ForwardRef=$,wt.Fragment=V,wt.Lazy=q,wt.Memo=ae,wt.Portal=G,wt.Profiler=_,wt.StrictMode=b,wt.Suspense=B,wt.isAsyncMode=z,wt.isConcurrentMode=C,wt.isContextConsumer=A,wt.isContextProvider=M,wt.isElement=O,wt.isForwardRef=K,wt.isFragment=Q,wt.isLazy=se,wt.isMemo=T,wt.isPortal=Z,wt.isProfiler=ie,wt.isStrictMode=ue,wt.isSuspense=he,wt.isValidElementType=j,wt.typeOf=w}()),wt}var Gp;function Sx(){return Gp||(Gp=1,process.env.NODE_ENV==="production"?Cl.exports=FA():Cl.exports=RA()),Cl.exports}/*
|
|
48
|
-
object-assign
|
|
49
|
-
(c) Sindre Sorhus
|
|
50
|
-
@license MIT
|
|
51
|
-
*/var mu,Yp;function BA(){if(Yp)return mu;Yp=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function i(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function r(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var o={},s=0;s<10;s++)o["_"+String.fromCharCode(s)]=s;var c=Object.getOwnPropertyNames(o).map(function(h){return o[h]});if(c.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(h){u[h]=h}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return mu=r()?Object.assign:function(a,o){for(var s,c=i(a),u,h=1;h<arguments.length;h++){s=Object(arguments[h]);for(var f in s)e.call(s,f)&&(c[f]=s[f]);if(t){u=t(s);for(var d=0;d<u.length;d++)n.call(s,u[d])&&(c[u[d]]=s[u[d]])}}return c},mu}var yu,qp;function Rf(){if(qp)return yu;qp=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return yu=t,yu}var xu,Up;function Dx(){return Up||(Up=1,xu=Function.call.bind(Object.prototype.hasOwnProperty)),xu}var vu,Xp;function HA(){if(Xp)return vu;Xp=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var e=Rf(),n={},i=Dx();t=function(a){var o="Warning: "+a;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function r(a,o,s,c,u){if(process.env.NODE_ENV!=="production"){for(var h in a)if(i(a,h)){var f;try{if(typeof a[h]!="function"){var d=Error((c||"React class")+": "+s+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[h]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}f=a[h](o,h,c,s,null,e)}catch(p){f=p}if(f&&!(f instanceof Error)&&t((c||"React class")+": type specification of "+s+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var g=u?u():"";t("Failed "+s+" type: "+f.message+(g??""))}}}}return r.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},vu=r,vu}var wu,Kp;function WA(){if(Kp)return wu;Kp=1;var t=Sx(),e=BA(),n=Rf(),i=Dx(),r=HA(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(s){var c="Warning: "+s;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function o(){return null}return wu=function(s,c){var u=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function f(C){var A=C&&(u&&C[u]||C[h]);if(typeof A=="function")return A}var d="<<anonymous>>",g={array:m("array"),bigint:m("bigint"),bool:m("boolean"),func:m("function"),number:m("number"),object:m("object"),string:m("string"),symbol:m("symbol"),any:I(),arrayOf:j,element:w(),elementType:S(),instanceOf:P,node:$(),objectOf:D,oneOf:W,oneOfType:x,shape:q,exact:ae};function p(C,A){return C===A?C!==0||1/C===1/A:C!==C&&A!==A}function y(C,A){this.message=C,this.data=A&&typeof A=="object"?A:{},this.stack=""}y.prototype=Error.prototype;function v(C){if(process.env.NODE_ENV!=="production")var A={},M=0;function O(Q,se,T,Z,ie,ue,he){if(Z=Z||d,ue=ue||T,he!==n){if(c){var Y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw Y.name="Invariant Violation",Y}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ge=Z+":"+T;!A[ge]&&M<3&&(a("You are manually calling a React.PropTypes validation function for the `"+ue+"` prop on `"+Z+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),A[ge]=!0,M++)}}return se[T]==null?Q?se[T]===null?new y("The "+ie+" `"+ue+"` is marked as required "+("in `"+Z+"`, but its value is `null`.")):new y("The "+ie+" `"+ue+"` is marked as required in "+("`"+Z+"`, but its value is `undefined`.")):null:C(se,T,Z,ie,ue)}var K=O.bind(null,!1);return K.isRequired=O.bind(null,!0),K}function m(C){function A(M,O,K,Q,se,T){var Z=M[O],ie=b(Z);if(ie!==C){var ue=B(Z);return new y("Invalid "+Q+" `"+se+"` of type "+("`"+ue+"` supplied to `"+K+"`, expected ")+("`"+C+"`."),{expectedType:C})}return null}return v(A)}function I(){return v(o)}function j(C){function A(M,O,K,Q,se){if(typeof C!="function")return new y("Property `"+se+"` of component `"+K+"` has invalid PropType notation inside arrayOf.");var T=M[O];if(!Array.isArray(T)){var Z=b(T);return new y("Invalid "+Q+" `"+se+"` of type "+("`"+Z+"` supplied to `"+K+"`, expected an array."))}for(var ie=0;ie<T.length;ie++){var ue=C(T,ie,K,Q,se+"["+ie+"]",n);if(ue instanceof Error)return ue}return null}return v(A)}function w(){function C(A,M,O,K,Q){var se=A[M];if(!s(se)){var T=b(se);return new y("Invalid "+K+" `"+Q+"` of type "+("`"+T+"` supplied to `"+O+"`, expected a single ReactElement."))}return null}return v(C)}function S(){function C(A,M,O,K,Q){var se=A[M];if(!t.isValidElementType(se)){var T=b(se);return new y("Invalid "+K+" `"+Q+"` of type "+("`"+T+"` supplied to `"+O+"`, expected a single ReactElement type."))}return null}return v(C)}function P(C){function A(M,O,K,Q,se){if(!(M[O]instanceof C)){var T=C.name||d,Z=z(M[O]);return new y("Invalid "+Q+" `"+se+"` of type "+("`"+Z+"` supplied to `"+K+"`, expected ")+("instance of `"+T+"`."))}return null}return v(A)}function W(C){if(!Array.isArray(C))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),o;function A(M,O,K,Q,se){for(var T=M[O],Z=0;Z<C.length;Z++)if(p(T,C[Z]))return null;var ie=JSON.stringify(C,function(he,Y){var ge=B(Y);return ge==="symbol"?String(Y):Y});return new y("Invalid "+Q+" `"+se+"` of value `"+String(T)+"` "+("supplied to `"+K+"`, expected one of "+ie+"."))}return v(A)}function D(C){function A(M,O,K,Q,se){if(typeof C!="function")return new y("Property `"+se+"` of component `"+K+"` has invalid PropType notation inside objectOf.");var T=M[O],Z=b(T);if(Z!=="object")return new y("Invalid "+Q+" `"+se+"` of type "+("`"+Z+"` supplied to `"+K+"`, expected an object."));for(var ie in T)if(i(T,ie)){var ue=C(T,ie,K,Q,se+"."+ie,n);if(ue instanceof Error)return ue}return null}return v(A)}function x(C){if(!Array.isArray(C))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var A=0;A<C.length;A++){var M=C[A];if(typeof M!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+X(M)+" at index "+A+"."),o}function O(K,Q,se,T,Z){for(var ie=[],ue=0;ue<C.length;ue++){var he=C[ue],Y=he(K,Q,se,T,Z,n);if(Y==null)return null;Y.data&&i(Y.data,"expectedType")&&ie.push(Y.data.expectedType)}var ge=ie.length>0?", expected one of type ["+ie.join(", ")+"]":"";return new y("Invalid "+T+" `"+Z+"` supplied to "+("`"+se+"`"+ge+"."))}return v(O)}function $(){function C(A,M,O,K,Q){return G(A[M])?null:new y("Invalid "+K+" `"+Q+"` supplied to "+("`"+O+"`, expected a ReactNode."))}return v(C)}function V(C,A,M,O,K){return new y((C||"React class")+": "+A+" type `"+M+"."+O+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+K+"`.")}function q(C){function A(M,O,K,Q,se){var T=M[O],Z=b(T);if(Z!=="object")return new y("Invalid "+Q+" `"+se+"` of type `"+Z+"` "+("supplied to `"+K+"`, expected `object`."));for(var ie in C){var ue=C[ie];if(typeof ue!="function")return V(K,Q,se,ie,B(ue));var he=ue(T,ie,K,Q,se+"."+ie,n);if(he)return he}return null}return v(A)}function ae(C){function A(M,O,K,Q,se){var T=M[O],Z=b(T);if(Z!=="object")return new y("Invalid "+Q+" `"+se+"` of type `"+Z+"` "+("supplied to `"+K+"`, expected `object`."));var ie=e({},M[O],C);for(var ue in ie){var he=C[ue];if(i(C,ue)&&typeof he!="function")return V(K,Q,se,ue,B(he));if(!he)return new y("Invalid "+Q+" `"+se+"` key `"+ue+"` supplied to `"+K+"`.\nBad object: "+JSON.stringify(M[O],null," ")+`
|
|
52
|
-
Valid keys: `+JSON.stringify(Object.keys(C),null," "));var Y=he(T,ue,K,Q,se+"."+ue,n);if(Y)return Y}return null}return v(A)}function G(C){switch(typeof C){case"number":case"string":case"undefined":return!0;case"boolean":return!C;case"object":if(Array.isArray(C))return C.every(G);if(C===null||s(C))return!0;var A=f(C);if(A){var M=A.call(C),O;if(A!==C.entries){for(;!(O=M.next()).done;)if(!G(O.value))return!1}else for(;!(O=M.next()).done;){var K=O.value;if(K&&!G(K[1]))return!1}}else return!1;return!0;default:return!1}}function _(C,A){return C==="symbol"?!0:A?A["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&A instanceof Symbol:!1}function b(C){var A=typeof C;return Array.isArray(C)?"array":C instanceof RegExp?"object":_(A,C)?"symbol":A}function B(C){if(typeof C>"u"||C===null)return""+C;var A=b(C);if(A==="object"){if(C instanceof Date)return"date";if(C instanceof RegExp)return"regexp"}return A}function X(C){var A=B(C);switch(A){case"array":case"object":return"an "+A;case"boolean":case"date":case"regexp":return"a "+A;default:return A}}function z(C){return!C.constructor||!C.constructor.name?d:C.constructor.name}return g.checkPropTypes=r,g.resetWarningCache=r.resetWarningCache,g.PropTypes=g,g},wu}var bu,Qp;function zA(){if(Qp)return bu;Qp=1;var t=Rf();function e(){}function n(){}return n.resetWarningCache=e,bu=function(){function i(o,s,c,u,h,f){if(f!==t){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}i.isRequired=i;function r(){return i}var a={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:r,element:i,elementType:i,instanceOf:r,node:i,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:e};return a.PropTypes=a,a},bu}var Zp;function GA(){if(Zp)return bl.exports;if(Zp=1,process.env.NODE_ENV!=="production"){var t=Sx(),e=!0;bl.exports=WA()(t.isElement,e)}else bl.exports=zA()();return bl.exports}var Di=GA();const Mx={data:Di.oneOfType([Di.string,Di.array,Di.func]).isRequired,headers:Di.array,target:Di.string,separator:Di.string,filename:Di.string,uFEFF:Di.bool,onClick:Di.func,asyncOnClick:Di.bool,enclosingCharacter:Di.string},Tx={separator:",",filename:"generatedBy_react-csv.csv",uFEFF:!0,asyncOnClick:!1,enclosingCharacter:'"'},YA={target:"_blank"};class GE extends k.Component{static defaultProps=Object.assign(Tx,YA);static propTypes=Mx;constructor(e){super(e),this.state={}}buildURI(){return Cx(...arguments)}componentDidMount(){const{data:e,headers:n,separator:i,enclosingCharacter:r,uFEFF:a,target:o,specs:s,replace:c}=this.props;this.state.page=window.open(this.buildURI(e,a,n,i,r),o,s,c)}getWindow(){return this.state.page}render(){return null}}let qA=class extends k.Component{static defaultProps=Tx;static propTypes=Mx;constructor(e){super(e),this.buildURI=this.buildURI.bind(this)}buildURI(){return Cx(...arguments)}handleLegacy(e,n=!1){if(window.navigator.msSaveOrOpenBlob){e.preventDefault();const{data:i,headers:r,separator:a,filename:o,enclosingCharacter:s,uFEFF:c}=this.props,u=n&&typeof i=="function"?i():i;let h=new Blob([c?"\uFEFF":"",bx(u,r,a,s)]);return window.navigator.msSaveBlob(h,o),!1}}handleAsyncClick(e){const n=i=>{if(i===!1){e.preventDefault();return}this.handleLegacy(e,!0)};this.props.onClick(e,n)}handleSyncClick(e){if(this.props.onClick(e)===!1){e.preventDefault();return}this.handleLegacy(e)}handleClick(){return e=>{if(typeof this.props.onClick=="function")return this.props.asyncOnClick?this.handleAsyncClick(e):this.handleSyncClick(e);this.handleLegacy(e)}}render(){const{data:e,headers:n,separator:i,filename:r,uFEFF:a,children:o,onClick:s,asyncOnClick:c,enclosingCharacter:u,...h}=this.props,d=typeof window>"u"?"":this.buildURI(e,a,n,i,u);return l.jsx("a",{download:r,...h,ref:g=>this.link=g,target:"_self",href:d,onClick:this.handleClick(),children:o})}};const UA=qA;function Bf(){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",className:"stroke-primary-black dark:stroke-primary-white",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),l.jsx("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),l.jsx("path",{d:"M12 18v-6"}),l.jsx("path",{d:"m9 15 3 3 3-3"})]})}function kx(){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",className:"stroke-primary-black dark:stroke-primary-white",fill:"none",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21"}),l.jsx("path",{d:"m14 19 3 3v-5.5"}),l.jsx("path",{d:"m17 22 3-3"}),l.jsx("circle",{cx:"9",cy:"9",r:"2"})]})}function XA(){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",className:"stroke-primary-black dark:stroke-primary-white",fill:"none",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),l.jsx("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]})}function ea(){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",className:"stroke-primary-gray-600 dark:stroke-primary-white",fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"M18 6 6 18"}),l.jsx("path",{d:"m6 6 12 12"})]})}function KA(){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",className:"stroke-primary-black dark:stroke-primary-white",fill:"none",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"m3 16 4 4 4-4"}),l.jsx("path",{d:"M7 20V4"}),l.jsx("path",{d:"m21 8-4-4-4 4"}),l.jsx("path",{d:"M17 4v16"})]})}function QA(){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",className:"stroke-primary-black dark:stroke-primary-white",fill:"none",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"m3 16 4 4 4-4"}),l.jsx("path",{d:"M7 20V4"}),l.jsx("path",{d:"M11 4h10"}),l.jsx("path",{d:"M11 8h7"}),l.jsx("path",{d:"M11 12h4"})]})}function ZA(){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",className:"stroke-primary-black dark:stroke-primary-white",fill:"none",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"m3 16 4 4 4-4"}),l.jsx("path",{d:"M7 20V4"}),l.jsx("path",{d:"M11 4h4"}),l.jsx("path",{d:"M11 8h7"}),l.jsx("path",{d:"M11 12h10"})]})}function JA(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",className:"stroke-primary-black dark:stroke-primary-white",fill:"none",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})})}function e2(){return l.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("path",{d:"M16.926 9L14 12.46V21L10 19V12.46L2 3H14.5",className:"stroke-primary-black dark:stroke-primary-white",fill:"none",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),l.jsx("circle",{cx:"20",cy:"4",r:"3",className:"stroke-primary-black dark:stroke-primary-white fill-primary-black dark:fill-primary-white",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]})}function t2(){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",className:"stroke-primary-white dark:stroke-primary-white",fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"m9 7-5 5 5 5"}),l.jsx("path",{d:"m15 7 5 5-5 5"})]})}function pi(){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:[l.jsx("circle",{cx:24,cy:24,r:24,className:"fill-primary-gray-300 dark:fill-primary-gray-600"}),l.jsx("polygon",{points:"6 3 20 12 6 21 6 3",className:"fill-accent-dark-red dark:fill-accent-red",transform:"translate(10,10) scale(1.25)"})]})}function mi(){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:[l.jsx("circle",{cx:24,cy:24,r:24,className:"fill-primary-gray-300 dark:fill-primary-gray-600"}),l.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",className:"fill-accent-dark-red dark:fill-accent-red",transform:"translate(10,10) scale(1.25)"}),l.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",className:"fill-accent-dark-red dark:fill-accent-red",transform:"translate(10,10) scale(1.25)"})]})}function n2(){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"stroke-primary-gray-500 dark:stroke-primary-gray-550",children:[l.jsx("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}),l.jsx("path",{d:"M12 9v4"}),l.jsx("path",{d:"M12 17h.01"})]})}const i2=t=>t?t.map(e=>{const n={...e};return Object.entries(n).forEach(([i,r])=>{Array.isArray(r)&&(n[i]=`${r.join(",")}`),typeof r=="string"&&(n[i]=`${r.replaceAll('"',"'")}`)}),n}):{};function Hf(t){const{buttonContent:e,buttonType:n="tertiary",csvData:i,fileName:r="data",headers:a,separator:o=",",buttonSmall:s=!1,className:c}=t;return l.jsx(UA,{headers:a,enclosingCharacter:'"',separator:o,data:i2(i),filename:`${r}.csv`,asyncOnClick:!0,target:"_blank",style:{backgroundImage:"none",textDecoration:"none"},"aria-label":"Click to download the data as csv",children:l.jsx(Ce.Button,{variant:n,className:`undp-viz-download-button no-underline ${s?"p-2":"py-4 px-6"} ${c} border border-primary-gray-400 dark:border-primary-gray-550`,children:e||l.jsx(Bf,{})})})}function r2(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const n=document.implementation.createHTMLDocument(),i=n.createElement("base"),r=n.createElement("a");return n.head.appendChild(i),n.body.appendChild(r),e&&(i.href=e),r.href=t,r.href}const a2=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function zr(t){const e=[];for(let n=0,i=t.length;n<i;n++)e.push(t[n]);return e}let go=null;function jx(t={}){return go||(t.includeStyleProperties?(go=t.includeStyleProperties,go):(go=zr(window.getComputedStyle(document.documentElement)),go))}function oc(t,e){const i=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(e);return i?parseFloat(i.replace("px","")):0}function o2(t){const e=oc(t,"border-left-width"),n=oc(t,"border-right-width");return t.clientWidth+e+n}function s2(t){const e=oc(t,"border-top-width"),n=oc(t,"border-bottom-width");return t.clientHeight+e+n}function Ax(t,e={}){const n=e.width||o2(t),i=e.height||s2(t);return{width:n,height:i}}function l2(){let t,e;try{e=process}catch{}const n=e&&e.env?e.env.devicePixelRatio:null;return n&&(t=parseInt(n,10),Number.isNaN(t)&&(t=1)),t||window.devicePixelRatio||1}const ui=16384;function c2(t){(t.width>ui||t.height>ui)&&(t.width>ui&&t.height>ui?t.width>t.height?(t.height*=ui/t.width,t.width=ui):(t.width*=ui/t.height,t.height=ui):t.width>ui?(t.height*=ui/t.width,t.width=ui):(t.width*=ui/t.height,t.height=ui))}function sc(t){return new Promise((e,n)=>{const i=new Image;i.onload=()=>{i.decode().then(()=>{requestAnimationFrame(()=>e(i))})},i.onerror=n,i.crossOrigin="anonymous",i.decoding="async",i.src=t})}async function u2(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function h2(t,e,n){const i="http://www.w3.org/2000/svg",r=document.createElementNS(i,"svg"),a=document.createElementNS(i,"foreignObject");return r.setAttribute("width",`${e}`),r.setAttribute("height",`${n}`),r.setAttribute("viewBox",`0 0 ${e} ${n}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),r.appendChild(a),a.appendChild(t),u2(r)}const ni=(t,e)=>{if(t instanceof e)return!0;const n=Object.getPrototypeOf(t);return n===null?!1:n.constructor.name===e.name||ni(n,e)};function f2(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function d2(t,e){return jx(e).map(n=>{const i=t.getPropertyValue(n),r=t.getPropertyPriority(n);return`${n}: ${i}${r?" !important":""};`}).join(" ")}function g2(t,e,n,i){const r=`.${t}:${e}`,a=n.cssText?f2(n):d2(n,i);return document.createTextNode(`${r}{${a}}`)}function Jp(t,e,n,i){const r=window.getComputedStyle(t,n),a=r.getPropertyValue("content");if(a===""||a==="none")return;const o=a2();try{e.className=`${e.className} ${o}`}catch{return}const s=document.createElement("style");s.appendChild(g2(o,n,r,i)),e.appendChild(s)}function p2(t,e,n){Jp(t,e,":before",n),Jp(t,e,":after",n)}const em="application/font-woff",tm="image/jpeg",m2={woff:em,woff2:em,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:tm,jpeg:tm,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function y2(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function Wf(t){const e=y2(t).toLowerCase();return m2[e]||""}function x2(t){return t.split(/,/)[1]}function yh(t){return t.search(/^(data:)/)!==-1}function v2(t,e){return`data:${e};base64,${t}`}async function _x(t,e,n){const i=await fetch(t,e);if(i.status===404)throw new Error(`Resource "${i.url}" not found`);const r=await i.blob();return new Promise((a,o)=>{const s=new FileReader;s.onerror=o,s.onloadend=()=>{try{a(n({res:i,result:s.result}))}catch(c){o(c)}},s.readAsDataURL(r)})}const Cu={};function w2(t,e,n){let i=t.replace(/\?.*/,"");return n&&(i=t),/ttf|otf|eot|woff2?/i.test(i)&&(i=i.replace(/.*\//,"")),e?`[${e}]${i}`:i}async function zf(t,e,n){const i=w2(t,e,n.includeQueryParams);if(Cu[i]!=null)return Cu[i];n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let r;try{const a=await _x(t,n.fetchRequestInit,({res:o,result:s})=>(e||(e=o.headers.get("Content-Type")||""),x2(s)));r=v2(a,e)}catch(a){r=n.imagePlaceholder||"";let o=`Failed to fetch resource: ${t}`;a&&(o=typeof a=="string"?a:a.message),o&&console.warn(o)}return Cu[i]=r,r}async function b2(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):sc(e)}async function C2(t,e){if(t.currentSrc){const a=document.createElement("canvas"),o=a.getContext("2d");a.width=t.clientWidth,a.height=t.clientHeight,o?.drawImage(t,0,0,a.width,a.height);const s=a.toDataURL();return sc(s)}const n=t.poster,i=Wf(n),r=await zf(n,i,e);return sc(r)}async function S2(t,e){var n;try{if(!((n=t?.contentDocument)===null||n===void 0)&&n.body)return await Ac(t.contentDocument.body,e,!0)}catch{}return t.cloneNode(!1)}async function D2(t,e){return ni(t,HTMLCanvasElement)?b2(t):ni(t,HTMLVideoElement)?C2(t,e):ni(t,HTMLIFrameElement)?S2(t,e):t.cloneNode(Ox(t))}const M2=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT",Ox=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SVG";async function T2(t,e,n){var i,r;if(Ox(e))return e;let a=[];return M2(t)&&t.assignedNodes?a=zr(t.assignedNodes()):ni(t,HTMLIFrameElement)&&(!((i=t.contentDocument)===null||i===void 0)&&i.body)?a=zr(t.contentDocument.body.childNodes):a=zr(((r=t.shadowRoot)!==null&&r!==void 0?r:t).childNodes),a.length===0||ni(t,HTMLVideoElement)||await a.reduce((o,s)=>o.then(()=>Ac(s,n)).then(c=>{c&&e.appendChild(c)}),Promise.resolve()),e}function k2(t,e,n){const i=e.style;if(!i)return;const r=window.getComputedStyle(t);r.cssText?(i.cssText=r.cssText,i.transformOrigin=r.transformOrigin):jx(n).forEach(a=>{let o=r.getPropertyValue(a);a==="font-size"&&o.endsWith("px")&&(o=`${Math.floor(parseFloat(o.substring(0,o.length-2)))-.1}px`),ni(t,HTMLIFrameElement)&&a==="display"&&o==="inline"&&(o="block"),a==="d"&&e.getAttribute("d")&&(o=`path(${e.getAttribute("d")})`),i.setProperty(a,o,r.getPropertyPriority(a))})}function j2(t,e){ni(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),ni(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function A2(t,e){if(ni(t,HTMLSelectElement)){const n=e,i=Array.from(n.children).find(r=>t.value===r.getAttribute("value"));i&&i.setAttribute("selected","")}}function _2(t,e,n){return ni(e,Element)&&(k2(t,e,n),p2(t,e,n),j2(t,e),A2(t,e)),e}async function O2(t,e){const n=t.querySelectorAll?t.querySelectorAll("use"):[];if(n.length===0)return t;const i={};for(let a=0;a<n.length;a++){const s=n[a].getAttribute("xlink:href");if(s){const c=t.querySelector(s),u=document.querySelector(s);!c&&u&&!i[s]&&(i[s]=await Ac(u,e,!0))}}const r=Object.values(i);if(r.length){const a="http://www.w3.org/1999/xhtml",o=document.createElementNS(a,"svg");o.setAttribute("xmlns",a),o.style.position="absolute",o.style.width="0",o.style.height="0",o.style.overflow="hidden",o.style.display="none";const s=document.createElementNS(a,"defs");o.appendChild(s);for(let c=0;c<r.length;c++)s.appendChild(r[c]);t.appendChild(o)}return t}async function Ac(t,e,n){return!n&&e.filter&&!e.filter(t)?null:Promise.resolve(t).then(i=>D2(i,e)).then(i=>T2(t,i,e)).then(i=>_2(t,i,e)).then(i=>O2(i,e))}const Nx=/url\((['"]?)([^'"]+?)\1\)/g,N2=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,I2=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function $2(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function L2(t){const e=[];return t.replace(Nx,(n,i,r)=>(e.push(r),n)),e.filter(n=>!yh(n))}async function P2(t,e,n,i,r){try{const a=n?r2(e,n):e,o=Wf(e);let s;return r||(s=await zf(a,o,i)),t.replace($2(e),`$1${s}$3`)}catch{}return t}function E2(t,{preferredFontFormat:e}){return e?t.replace(I2,n=>{for(;;){const[i,,r]=N2.exec(n)||[];if(!r)return"";if(r===e)return`src: ${i};`}}):t}function Ix(t){return t.search(Nx)!==-1}async function $x(t,e,n){if(!Ix(t))return t;const i=E2(t,n);return L2(i).reduce((a,o)=>a.then(s=>P2(s,o,e,n)),Promise.resolve(i))}async function po(t,e,n){var i;const r=(i=e.style)===null||i===void 0?void 0:i.getPropertyValue(t);if(r){const a=await $x(r,null,n);return e.style.setProperty(t,a,e.style.getPropertyPriority(t)),!0}return!1}async function V2(t,e){await po("background",t,e)||await po("background-image",t,e),await po("mask",t,e)||await po("-webkit-mask",t,e)||await po("mask-image",t,e)||await po("-webkit-mask-image",t,e)}async function F2(t,e){const n=ni(t,HTMLImageElement);if(!(n&&!yh(t.src))&&!(ni(t,SVGImageElement)&&!yh(t.href.baseVal)))return;const i=n?t.src:t.href.baseVal,r=await zf(i,Wf(i),e);await new Promise((a,o)=>{t.onload=a,t.onerror=e.onImageErrorHandler?(...c)=>{try{a(e.onImageErrorHandler(...c))}catch(u){o(u)}}:o;const s=t;s.decode&&(s.decode=a),s.loading==="lazy"&&(s.loading="eager"),n?(t.srcset="",t.src=r):t.href.baseVal=r})}async function R2(t,e){const i=zr(t.childNodes).map(r=>Lx(r,e));await Promise.all(i).then(()=>t)}async function Lx(t,e){ni(t,Element)&&(await V2(t,e),await F2(t,e),await R2(t,e))}function B2(t,e){const{style:n}=t;e.backgroundColor&&(n.backgroundColor=e.backgroundColor),e.width&&(n.width=`${e.width}px`),e.height&&(n.height=`${e.height}px`);const i=e.style;return i!=null&&Object.keys(i).forEach(r=>{n[r]=i[r]}),t}const nm={};async function im(t){let e=nm[t];if(e!=null)return e;const i=await(await fetch(t)).text();return e={url:t,cssText:i},nm[t]=e,e}async function rm(t,e){let n=t.cssText;const i=/url\(["']?([^"')]+)["']?\)/g,a=(n.match(/url\([^)]+\)/g)||[]).map(async o=>{let s=o.replace(i,"$1");return s.startsWith("https://")||(s=new URL(s,t.url).href),_x(s,e.fetchRequestInit,({result:c})=>(n=n.replace(o,`url(${c})`),[o,c]))});return Promise.all(a).then(()=>n)}function am(t){if(t==null)return[];const e=[],n=/(\/\*[\s\S]*?\*\/)/gi;let i=t.replace(n,"");const r=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const c=r.exec(i);if(c===null)break;e.push(c[0])}i=i.replace(r,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",s=new RegExp(o,"gi");for(;;){let c=a.exec(i);if(c===null){if(c=s.exec(i),c===null)break;a.lastIndex=s.lastIndex}else s.lastIndex=a.lastIndex;e.push(c[0])}return e}async function H2(t,e){const n=[],i=[];return t.forEach(r=>{if("cssRules"in r)try{zr(r.cssRules||[]).forEach((a,o)=>{if(a.type===CSSRule.IMPORT_RULE){let s=o+1;const c=a.href,u=im(c).then(h=>rm(h,e)).then(h=>am(h).forEach(f=>{try{r.insertRule(f,f.startsWith("@import")?s+=1:r.cssRules.length)}catch(d){console.error("Error inserting rule from remote css",{rule:f,error:d})}})).catch(h=>{console.error("Error loading remote css",h.toString())});i.push(u)}})}catch(a){const o=t.find(s=>s.href==null)||document.styleSheets[0];r.href!=null&&i.push(im(r.href).then(s=>rm(s,e)).then(s=>am(s).forEach(c=>{o.insertRule(c,o.cssRules.length)})).catch(s=>{console.error("Error loading remote stylesheet",s)})),console.error("Error inlining remote css file",a)}}),Promise.all(i).then(()=>(t.forEach(r=>{if("cssRules"in r)try{zr(r.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${r.href}`,a)}}),n))}function W2(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>Ix(e.style.getPropertyValue("src")))}async function z2(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=zr(t.ownerDocument.styleSheets),i=await H2(n,e);return W2(i)}function Px(t){return t.trim().replace(/["']/g,"")}function G2(t){const e=new Set;function n(i){(i.style.fontFamily||getComputedStyle(i).fontFamily).split(",").forEach(a=>{e.add(Px(a))}),Array.from(i.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(t),e}async function Y2(t,e){const n=await z2(t,e),i=G2(t);return(await Promise.all(n.filter(a=>i.has(Px(a.style.fontFamily))).map(a=>{const o=a.parentStyleSheet?a.parentStyleSheet.href:null;return $x(a.cssText,o,e)}))).join(`
|
|
53
|
-
`)}async function q2(t,e){const n=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await Y2(t,e);if(n){const i=document.createElement("style"),r=document.createTextNode(n);i.appendChild(r),t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)}}async function U2(t,e={}){const{width:n,height:i}=Ax(t,e),r=await Ac(t,e,!0);return await q2(r,e),await Lx(r,e),B2(r,e),await h2(r,n,i)}async function X2(t,e={}){const{width:n,height:i}=Ax(t,e),r=await U2(t,e),a=await sc(r),o=document.createElement("canvas"),s=o.getContext("2d"),c=e.pixelRatio||l2(),u=e.canvasWidth||n,h=e.canvasHeight||i;return o.width=u*c,o.height=h*c,e.skipAutoScale||c2(o),o.style.width=`${u}`,o.style.height=`${h}`,e.backgroundColor&&(s.fillStyle=e.backgroundColor,s.fillRect(0,0,o.width,o.height)),s.drawImage(a,0,0,o.width,o.height),o}async function K2(t,e={}){return(await X2(t,e)).toDataURL()}function xh(t,e){K2(t,{quality:1,pixelRatio:2,skipAutoScale:!0,style:{margin:"0"},filter:n=>!n.classList?.contains("undp-viz-download-button")}).then(n=>{const i=document.createElement("a");i.download=`${e}.png`,i.href=n,i.click()}).catch(n=>{console.error("Error generating image:",n)})}function Ex(t){const{nodeID:e,filename:n="image",buttonContent:i,buttonType:r="tertiary",buttonSmall:a,className:o=""}=t;return l.jsx(Ce.Button,{variant:r,className:`undp-viz-download-button ${a?"p-2":"py-4 px-6"} ${o} border border-primary-gray-400 dark:border-primary-gray-550`,onClick:()=>{typeof e=="string"?document.getElementById(e)?xh(document.getElementById(e),n):console.error("Cannot find the html element"):xh(e,n)},"aria-label":"Click to download the graph as image",children:i||l.jsx(kx,{})})}function Vx(t){const{text:e,style:n,className:i}=t;return typeof e=="string"?e.trim()===""?null:l.jsx(Ce.P,{size:"sm",marginBottom:"none",className:Ce.cn("text-primary-gray-550 dark:text-primary-gray-400",i),"aria-label":"Graph description",style:n,children:e}):k.isValidElement(e)?l.jsx("div",{className:i,style:n,children:e}):(console.error("GraphDescription: Invalid text type. Expected string or React element."),null)}function Fx(t){const{text:e,isDashboard:n,style:i,className:r}=t;return typeof e=="string"?e.trim()===""?null:n?l.jsx(Ce.H5,{marginBottom:"base",className:Ce.cn("font-bold pb-3 text-primary-black dark:text-primary-gray-100",r),"aria-label":"Dashboard title",style:i,children:e}):l.jsx(Ce.P,{marginBottom:"none",className:Ce.cn("text-primary-black dark:text-primary-gray-100",r),"aria-label":"Graph title",style:i,children:e}):k.isValidElement(e)?l.jsx("div",{className:r,style:i,children:e}):(console.error("GraphTitle: Invalid text type. Expected string or React element."),null)}function Qe(t){const{graphTitle:e,graphDescription:n,width:i,graphDownload:r,dataDownload:a,isDashboard:o,styles:s,classNames:c}=t;return l.jsxs("div",{className:`flex gap-2 justify-between ${n&&e?"items-start":"items-center"}`,style:{maxWidth:i?`${i}px`:"none"},"aria-label":"Graph header",children:[l.jsxs("div",{className:"flex-col flex gap-1",children:[e?l.jsx(Fx,{text:e,isDashboard:o,style:s?.title,className:c?.title}):null,n?l.jsx(Vx,{text:n,style:s?.description,className:c?.description}):null]}),r||a?l.jsxs("div",{className:"flex gap-3",children:[r?l.jsx(Ex,{nodeID:r,buttonSmall:!0}):null,a&&a.length>0?l.jsx(Hf,{csvData:a,buttonSmall:!0,headers:Object.keys(a[0]).map(u=>({label:u,key:u}))}):null]}):null]})}function tn(t){const{colorLegendTitle:e,colorDomain:n,colors:i,setSelectedColor:r,showNAColor:a,width:o,isCenter:s,className:c}=t;return l.jsx("div",{className:Ce.cn("flex leading-0",s&&"justify-center",c),style:{maxWidth:o?`${o}px`:"none"},"aria-label":"Color legend",children:l.jsxs("div",{children:[e&&e!==""?l.jsx(Ce.P,{size:"sm",marginBottom:"2xs",className:s?"text-center":"",children:e}):null,l.jsxs("div",{className:"flex flex-wrap gap-3.5 mb-0",children:[n.map((u,h)=>l.jsxs("div",{className:"flex items-center gap-1 cursor-pointer",onMouseEnter:()=>{r(i[h%i.length])},onMouseLeave:()=>{r(void 0)},children:[l.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:i[h%i.length]}}),u===""?null:l.jsx(Ce.P,{size:"sm",marginBottom:"none",children:u})]},h)),a?l.jsxs("div",{onMouseEnter:()=>{r(Pe.gray)},onMouseLeave:()=>{r(void 0)},className:"flex items-center gap-1 cursor-pointer",children:[l.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:Pe.gray}}),l.jsx(Ce.P,{size:"sm",marginBottom:"none",children:"NA"})]}):null]})]})})}function xt(){return l.jsxs("div",{className:"flex w-full flex-col justify-center grow items-center gap-2 p-6",children:[l.jsx(n2,{}),l.jsx(Ce.P,{marginBottom:"none",leading:"none",size:"lg",className:"text-primary-gray-550 dark:text-primary-gray-550",children:"No data available"})]})}function yi(t,e,n,i){const r={};return t.forEach((a,o)=>{r[`${a}`]={style:{color:o===e?"#232E3D":"#A9B1B7",fontWeight:o===e?"bold":"normal",display:o===e||!n?"inline":"none"},label:ft(new Date(a),i||"yyyy")}}),r}function _o(t,e){const n=Array.from(new Set(t.map(s=>s.label))),i=Array.from(new Set(t.map(s=>s.date))).filter(s=>s!==void 0);if(i.length===0)return t;const r=new Set(t.map(s=>`${s.label}-${s.date}`)),a=t.reduce((s,c)=>(s[c.label]||(s[c.label]=c.color),s),{}),o=[...t];return n.forEach(s=>{i.forEach(c=>{r.has(`${s}-${c}`)||o.push({label:s,color:a[s],size:void 0,date:c})})}),tt(o,s=>ze(`${s.date}`,e||"yyyy",new Date))}function Gr(t,e){const n=Array.from(new Set(t.map(o=>o.label))),i=Array.from(new Set(t.map(o=>o.date))).filter(o=>o!==void 0);if(i.length===0)return t;const r=new Set(t.map(o=>`${o.label}-${o.date}`)),a=[...t];return n.forEach(o=>{i.forEach(s=>{r.has(`${o}-${s}`)||a.push({label:o,size:t[0].size.map(c=>null),date:s})})}),tt(a,o=>ze(`${o.date}`,e||"yyyy",new Date))}function Q2(t,e){const n=Array.from(new Set(t.map(o=>o.label))),i=Array.from(new Set(t.map(o=>o.date))).filter(o=>o!==void 0);if(i.length===0)return t;const r=new Set(t.map(o=>`${o.label}-${o.date}`)),a=[...t];return n.forEach(o=>{i.forEach(s=>{r.has(`${o}-${s}`)||a.push({label:o,leftBar:void 0,rightBar:void 0,date:s})})}),tt(a,o=>ze(`${o.date}`,e,new Date))}function Z2(t,e){const n=Array.from(new Set(t.map(s=>s.label))),i=Array.from(new Set(t.map(s=>s.date))).filter(s=>s!==void 0);if(i.length===0)return t;const r=new Set(t.map(s=>`${s.label}-${s.date}`)),a=t.reduce((s,c)=>(s[c.label]||(s[c.label]=c.color),s),{}),o=[...t];return n.forEach(s=>{i.forEach(c=>{r.has(`${s}-${c}`)||o.push({label:s,color:a[s],x:void 0,y:void 0,radius:void 0,date:c})})}),tt(o,s=>ze(`${s.date}`,e,new Date))}function Oo(t,e){const n=Array.from(new Set(t.map(o=>o.label))),i=Array.from(new Set(t.map(o=>o.date))).filter(o=>o!==void 0);if(i.length===0)return t;const r=new Set(t.map(o=>`${o.label}-${o.date}`)),a=[...t];return n.forEach(o=>{i.forEach(s=>{r.has(`${o}-${s}`)||a.push({label:o,x:t[0].x.map(c=>null),date:s})})}),tt(a,o=>ze(`${o.date}`,e||"yyyy",new Date))}function J2(t){const{data:e,graphTitle:n,colors:i,suffix:r="",sources:a,prefix:o="",graphDescription:s,barPadding:c=.25,showValues:u=!0,showTicks:h=!0,leftMargin:f=100,rightMargin:d=40,truncateBy:g=999,height:p,width:y,footNote:v,colorDomain:m,colorLegendTitle:I,highlightedDataPoints:j=[],padding:w,backgroundColor:S=!1,topMargin:P=25,bottomMargin:W=10,showLabels:D=!0,relativeHeight:x,tooltip:$,onSeriesMouseOver:V,refValues:q,showColorScale:ae=!0,graphID:G,maxValue:_,minValue:b,onSeriesMouseClick:B,graphDownload:X=!1,dataDownload:z=!1,sortData:C,labelOrder:A,language:M="en",showNAColor:O=!0,minHeight:K=0,theme:Q="light",maxBarThickness:se,maxNumberOfBars:T,minBarThickness:Z,ariaLabel:ie,resetSelectionOnDoubleClick:ue=!0,detailsOnClick:he,barAxisTitle:Y,noOfTicks:ge=5,valueColor:oe,styles:ce,classNames:N,filterNA:U=!0,animate:ve=!1,dimmedOpacity:J=.3,precision:R=2,customLayers:le=[],timeline:ee={enabled:!1,autoplay:!1,showOnlyActiveDate:!0},naLabel:de="NA"}=t,[te,Me]=k.useState(0),[be,ne]=k.useState(0),[De,xe]=k.useState(ee.autoplay),Ae=di(Xe(e.filter(H=>H.date!==void 0&&H.date!==null),H=>H.date).map(H=>ze(`${H.date}`,ee.dateFormat||"yyyy",new Date).getTime()),(H,Oe)=>an(H,Oe)),[ke,me]=k.useState(ee.autoplay?0:Ae.length-1),[Se,Le]=k.useState(void 0),F=k.useRef(null),Ie=k.useRef(null);k.useEffect(()=>{const H=new ResizeObserver(Oe=>{Me(y||Oe[0].target.clientWidth||620),ne(p||Oe[0].target.clientHeight||480)});return F.current&&(ne(F.current.clientHeight||480),Me(F.current.clientWidth||620),y||H.observe(F.current)),()=>H.disconnect()},[y,p]),k.useEffect(()=>{const H=setInterval(()=>{me(Oe=>Oe<Ae.length-1?Oe+1:0)},(ee.speed||2)*1e3);return De||clearInterval(H),()=>clearInterval(H)},[Ae,De,ee.speed]);const Ve=yi(Ae,ke,ee.showOnlyActiveDate,ee.dateFormat||"yyyy");return l.jsx("div",{className:`${Q||"light"} flex ${y?"w-fit grow-0":"w-full grow"}`,dir:M==="he"||M==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${S?S===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${M||"en"}`,N?.graphContainer),style:{...ce?.graphContainer||{},...S&&S!==!0?{backgroundColor:S}:{}},id:G,ref:Ie,"aria-label":ie||`${n?`The graph shows ${n}. `:""}This is a bar chart. ${s?` ${s}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:S?w||"1rem":w||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||s||X||z?l.jsx(Qe,{styles:{title:ce?.title,description:ce?.description},classNames:{title:N?.title,description:N?.description},graphTitle:n,graphDescription:s,width:y,graphDownload:X?Ie.current:void 0,dataDownload:z?e.map(H=>H.data).filter(H=>H!==void 0).length>0?e.map(H=>H.data).filter(H=>H!==void 0):e.filter(H=>H!==void 0):null}):null,ee.enabled&&Ae.length>0&&Ve?l.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[l.jsx("button",{type:"button",onClick:()=>{xe(!De)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":De?"Click to pause animation":"Click to play animation",children:De?l.jsx(mi,{}):l.jsx(pi,{})}),l.jsx(Ce.SliderUI,{min:Ae[0],max:Ae[Ae.length-1],marks:Ve,step:null,defaultValue:Ae[Ae.length-1],value:Ae[ke],onChangeComplete:H=>{me(Ae.indexOf(H))},onChange:H=>{me(Ae.indexOf(H))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[ae&&e.filter(H=>H.color).length!==0?l.jsx(tn,{width:y,colorLegendTitle:I,colors:i||Pe[Q].categoricalColors.colors,colorDomain:m||Xe(e.filter(H=>H.color),"color").map(H=>H.color),setSelectedColor:Le,showNAColor:O}):null,l.jsx("div",{className:"flex grow flex-col justify-center w-full leading-0",ref:F,"aria-label":"Graph area",children:(y||te)&&(p||be)?l.jsx(AA,{data:C==="asc"?tt(_o(e,ee.dateFormat||"yyyy").filter(H=>ee.enabled?H.date===ft(new Date(Ae[ke]),ee.dateFormat||"yyyy"):H).filter(H=>U?!je(H.size):H),H=>H.size).filter((H,Oe)=>T?Oe<T:!0):C==="desc"?tt(_o(e,ee.dateFormat||"yyyy").filter(H=>ee.enabled?H.date===ft(new Date(Ae[ke]),ee.dateFormat||"yyyy"):H).filter(H=>U?!je(H.size):H),H=>H.size).reverse().filter((H,Oe)=>T?Oe<T:!0):_o(e,ee.dateFormat||"yyyy").filter(H=>ee.enabled?H.date===ft(new Date(Ae[ke]),ee.dateFormat||"yyyy"):H).filter(H=>U?!je(H.size):H).filter((H,Oe)=>T?Oe<T:!0),barColor:e.filter(H=>H.color).length===0?i?[i]:[Pe.primaryColors["blue-600"]]:i||Pe[Q].categoricalColors.colors,colorDomain:e.filter(H=>H.color).length===0?[]:m||Xe(e.filter(H=>H.color),"color").map(H=>H.color),width:y||te,selectedColor:Se,height:Math.max(K,p||(x?K?(y||te)*x>K?(y||te)*x:K:(y||te)*x:be)),suffix:r,prefix:o,barPadding:c,showValues:u,showTicks:h,leftMargin:f,rightMargin:d,topMargin:P,bottomMargin:W,truncateBy:g,showLabels:D,tooltip:$,onSeriesMouseOver:V,refValues:q,maxValue:je(_)?Math.max(...e.filter(H=>!je(H.size)).map(H=>H.size))<0?0:Math.max(...e.filter(H=>!je(H.size)).map(H=>H.size)):_,minValue:je(b)?Math.min(...e.filter(H=>!je(H.size)).map(H=>H.size))>=0?0:Math.min(...e.filter(H=>!je(H.size)).map(H=>H.size)):b,highlightedDataPoints:j,onSeriesMouseClick:B,labelOrder:A,rtl:M==="he"||M==="ar",maxBarThickness:se,minBarThickness:Z,resetSelectionOnDoubleClick:ue,detailsOnClick:he,barAxisTitle:Y,noOfTicks:ge,valueColor:oe,classNames:N,styles:ce,animate:ve===!0?{duration:.5,once:!0,amount:.5}:ve||{duration:0,once:!0,amount:0},dimmedOpacity:J,precision:R,customLayers:le,naLabel:de}):null})]})}),a||v?l.jsx(et,{sources:a,footNote:v,width:y,styles:{footnote:ce?.footnote,source:ce?.source},classNames:{footnote:N?.footnote,source:N?.source}}):null]})})})})}function e_(t){const{data:e,barColors:n,barPadding:i,showTicks:r,leftMargin:a,truncateBy:o,width:s,height:c,suffix:u,prefix:h,showValues:f,rightMargin:d,topMargin:g,bottomMargin:p,showLabels:y,tooltip:v,onSeriesMouseOver:m,refValues:I,maxValue:j,minValue:w,onSeriesMouseClick:S,selectedColor:P,rtl:W,labelOrder:D,maxBarThickness:x,resetSelectionOnDoubleClick:$,detailsOnClick:V,barAxisTitle:q,valueColor:ae,noOfTicks:G,styles:_,classNames:b,animate:B,colorDomain:X,precision:z,customLayers:C,naLabel:A}=t,M=k.useRef(null),O=ct(M,{once:B.once,amount:B.amount}),K={top:q?g+25:g,bottom:p,left:a,right:d},[Q,se]=k.useState(void 0),[T,Z]=k.useState(void 0),[ie,ue]=k.useState(void 0),[he,Y]=k.useState(void 0),ge=s-K.left-K.right,oe=c-K.top-K.bottom,ce=e.map((le,ee)=>({...le,id:D?`${le.label}`:`${ee}`})),N=D||ce.map(le=>`${le.id}`),U=ut().domain([w,j]).range([0,ge]).nice(),ve=xn().domain(N).range([0,x?Math.min(oe,x*N.length):oe]).paddingInner(i),J=xn().domain(e[0].size.map((le,ee)=>`${ee}`)).range([0,ve.bandwidth()]).paddingInner(.1),R=U.ticks(G);return l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{ref:M,width:`${s}px`,height:`${c}px`,viewBox:`0 0 ${s} ${c}`,direction:"ltr",children:l.jsxs("g",{transform:`translate(${K.left},${K.top})`,children:[r?l.jsx(Rn,{values:R.filter(le=>le!==0),x:R.filter(le=>le!==0).map(le=>U(le)),y1:0-g,y2:oe+K.bottom,styles:{gridLines:_?.xAxis?.gridLines,labels:_?.xAxis?.labels},classNames:{gridLines:b?.xAxis?.gridLines,labels:b?.xAxis?.labels},suffix:u,prefix:h,labelType:"secondary",showGridLines:!0,precision:z}):null,l.jsx(Nt,{x:ge/2,y:0-K.top+15,style:_?.xAxis?.title,className:b?.xAxis?.title,text:q}),C.filter(le=>le.position==="before").map(le=>le.layer),l.jsxs(mt,{children:[ce.map(le=>je(ve(le.id))?null:l.jsxs($e.g,{variants:{initial:{x:0,y:ve(`${le.id}`)},whileInView:{x:0,y:ve(`${le.id}`),transition:{duration:B.duration}}},initial:"initial",animate:O?"whileInView":"initial",exit:{opacity:0,transition:{duration:B.duration}},children:[le.size.map((ee,de)=>l.jsxs($e.g,{className:"undp-viz-g-with-hover",opacity:P?n[de]===P?1:.3:.85,onMouseEnter:te=>{se({...le,sizeIndex:de}),Y(te.clientY),ue(te.clientX),m?.({...le,sizeIndex:de})},onMouseMove:te=>{se({...le,sizeIndex:de}),Y(te.clientY),ue(te.clientX)},onMouseLeave:()=>{se(void 0),ue(void 0),Y(void 0),m?.(void 0)},onClick:()=>{(S||V)&&(dt(T,{...le,sizeIndex:de})&&$?(Z(void 0),S?.(void 0)):(Z({...le,sizeIndex:de}),S&&S({...le,sizeIndex:de})))},children:[je(ee)?null:l.jsx($e.rect,{y:J(`${de}`),variants:{initial:{width:0,x:U(0),fill:n[de]},whileInView:{width:je(ee)?0:ee>=0?U(ee)-U(0):U(0)-U(ee),x:ee>=0?U(0):U(ee),fill:n[de],transition:{duration:B.duration}}},exit:{width:0,x:U(0),transition:{duration:B.duration}},height:J.bandwidth(),initial:"initial",animate:O?"whileInView":"initial"}),f?l.jsx($e.text,{y:J(`${de}`)+J.bandwidth()/2,style:{fill:ae||n[de],textAnchor:ee&&ee<0?"end":"start",..._?.graphObjectValues||{}},className:Ce.cn("graph-value text-sm",b?.graphObjectValues),dx:ee&&ee<0?-5:5,dy:"0.33em",variants:{initial:{x:U(0),opacity:0},whileInView:{x:U(ee||0),opacity:1,transition:{duration:B.duration}}},initial:"initial",animate:O?"whileInView":"initial",exit:{opacity:0,transition:{duration:B.duration}},children:qe(ee,A,z,h,u)}):null]},`${le.label}-${X[de]||de}`)),y?l.jsx(io,{value:`${le.label}`.length<o?`${le.label}`:`${`${le.label}`.substring(0,o)}...`,y:0,x:0-K.left,width:U(w<0?0:w)+K.left,height:ve.bandwidth(),style:_?.yAxis?.labels,className:b?.yAxis?.labels,animate:B,isInView:O}):null]},le.label)),l.jsx(Dt,{x1:U(w<0?0:w),x2:U(w<0?0:w),y1:-2.5,y2:oe+K.bottom,classNames:{axis:b?.yAxis?.axis},styles:{axis:_?.yAxis?.axis}}),I?l.jsx(l.Fragment,{children:I.map((le,ee)=>l.jsx(Tr,{text:le.text,color:le.color,x:U(le.value),y1:0-K.top,y2:oe+K.bottom,textSide:U(le.value)>ge*.75||W?"left":"right",classNames:le.classNames,styles:le.styles,animate:B,isInView:O},ee))}):null]}),C.filter(le=>le.position==="after").map(le=>le.layer)]})}),Q&&v&&ie&&he?l.jsx(st,{data:Q,body:v,xPos:ie,yPos:he,backgroundStyle:_?.tooltip,className:b?.tooltip}):null,V&&T!==void 0?l.jsx(Ce.Modal,{open:T!==void 0,onClose:()=>{Z(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof V=="string"?{__html:lt(V,T)}:void 0,children:typeof V=="function"?V(T):null})}):null]})}function t_(t){const{data:e,graphTitle:n,colors:i=Pe.light.categoricalColors.colors,sources:r,graphDescription:a,barPadding:o=.25,showTicks:s=!0,truncateBy:c=999,height:u,width:h,footNote:f,colorDomain:d,colorLegendTitle:g,suffix:p="",prefix:y="",showValues:v=!0,showColorScale:m=!0,padding:I,backgroundColor:j=!1,leftMargin:w=100,rightMargin:S=40,topMargin:P=25,bottomMargin:W=10,showLabels:D=!0,relativeHeight:x,tooltip:$,onSeriesMouseOver:V,refValues:q,graphID:ae,maxValue:G,minValue:_,onSeriesMouseClick:b,graphDownload:B=!1,dataDownload:X=!1,language:z="en",labelOrder:C,minHeight:A=0,theme:M="light",maxBarThickness:O,ariaLabel:K,resetSelectionOnDoubleClick:Q=!0,detailsOnClick:se,barAxisTitle:T,noOfTicks:Z=5,valueColor:ie,styles:ue,classNames:he,filterNA:Y=!0,animate:ge=!1,precision:oe=2,customLayers:ce=[],timeline:N={enabled:!1,autoplay:!1,showOnlyActiveDate:!0},naLabel:U="NA"}=t,[ve,J]=k.useState(0),[R,le]=k.useState(0),[ee,de]=k.useState(N.autoplay),te=di(Xe(e.filter(me=>me.date!==void 0&&me.date!==null),me=>me.date).map(me=>ze(`${me.date}`,N.dateFormat||"yyyy",new Date).getTime()),(me,Se)=>an(me,Se)),[Me,be]=k.useState(N.autoplay?0:te.length-1),[ne,De]=k.useState(void 0),xe=k.useRef(null),Ae=k.useRef(null);k.useEffect(()=>{const me=new ResizeObserver(Se=>{J(h||Se[0].target.clientWidth||620),le(u||Se[0].target.clientHeight||480)});return xe.current&&(le(xe.current.clientHeight||480),J(xe.current.clientWidth||620),h||me.observe(xe.current)),()=>me.disconnect()},[h,u]),k.useEffect(()=>{const me=setInterval(()=>{be(Se=>Se<te.length-1?Se+1:0)},(N.speed||2)*1e3);return ee||clearInterval(me),()=>clearInterval(me)},[te,ee,N.speed]);const ke=yi(te,Me,N.showOnlyActiveDate,N.dateFormat||"yyyy");return l.jsx("div",{className:`${M||"light"} flex ${h?"w-fit grow-0":"w-full grow"}`,dir:z==="he"||z==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${j?j===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${z||"en"}`,he?.graphContainer),style:{...ue?.graphContainer||{},...j&&j!==!0?{backgroundColor:j}:{}},id:ae,ref:Ae,"aria-label":K||`${n?`The graph shows ${n}. `:""}This is a grouped bar chart. ${a?` ${a}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:j?I||"1rem":I||0},children:l.jsxs("div",{className:"flex flex-col gap-4 w-full grow justify-between",children:[n||a||B||X?l.jsx(Qe,{styles:{title:ue?.title,description:ue?.description},classNames:{title:he?.title,description:he?.description},graphTitle:n,graphDescription:a,width:h,graphDownload:B?Ae.current:void 0,dataDownload:X?e.map(me=>me.data).filter(me=>me!==void 0).length>0?e.map(me=>me.data).filter(me=>me!==void 0):e.filter(me=>me!==void 0):null}):null,N.enabled&&te.length>0&&ke?l.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[l.jsx("button",{type:"button",onClick:()=>{de(!ee)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":ee?"Click to pause animation":"Click to play animation",children:ee?l.jsx(mi,{}):l.jsx(pi,{})}),l.jsx(Ce.SliderUI,{min:te[0],max:te[te.length-1],marks:ke,step:null,defaultValue:te[te.length-1],value:te[Me],onChangeComplete:me=>{be(te.indexOf(me))},onChange:me=>{be(te.indexOf(me))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[m?l.jsx(tn,{width:h,colorDomain:d,colors:i,colorLegendTitle:g,setSelectedColor:De,showNAColor:!1}):null,l.jsx("div",{className:"w-full grow leading-0",ref:xe,"aria-label":"Graph area",children:(h||ve)&&(u||R)?l.jsx(e_,{data:Gr(e,N.dateFormat||"yyyy").filter(me=>N.enabled?me.date===ft(new Date(te[Me]),N.dateFormat||"yyyy"):me).filter(me=>Y?!me.size.every(Se=>Se==null):me),barColors:i,width:h||ve,height:Math.max(A,u||(x?A?(h||ve)*x>A?(h||ve)*x:A:(h||ve)*x:R)),suffix:p,prefix:y,showValues:v,barPadding:o,showTicks:s,leftMargin:w,rightMargin:S,topMargin:P,bottomMargin:W,truncateBy:c,showLabels:D,tooltip:$,onSeriesMouseOver:V,refValues:q,maxValue:je(G)?Math.max(...e.map(me=>Math.max(...me.size.filter(Se=>!je(Se)))))<0?0:Math.max(...e.map(me=>Math.max(...me.size.filter(Se=>!je(Se))))):G,minValue:je(_)?Math.min(...e.map(me=>Math.min(...me.size.filter(Se=>!je(Se)))))>=0?0:Math.min(...e.map(me=>Math.min(...me.size.filter(Se=>!je(Se))))):_,onSeriesMouseClick:b,selectedColor:ne,labelOrder:C,rtl:z==="he"||z==="ar",maxBarThickness:O,resetSelectionOnDoubleClick:Q,detailsOnClick:se,barAxisTitle:T,noOfTicks:Z,valueColor:ie,styles:ue,classNames:he,colorDomain:d,animate:ge===!0?{duration:.5,once:!0,amount:.5}:ge||{duration:0,once:!0,amount:0},precision:oe,customLayers:ce,naLabel:U}):null})]})}),r||f?l.jsx(et,{styles:{footnote:ue?.footnote,source:ue?.source},classNames:{footnote:he?.footnote,source:he?.source},sources:r,footNote:f,width:h}):null]})})})})}var Su,om;function n_(){if(om)return Su;om=1;function t(i,r){for(var a,o=-1,s=i.length;++o<s;){var c=r(i[o]);c!==void 0&&(a=a===void 0?c:a+c)}return a}function e(i){return i}function n(i){return i&&i.length?t(i,e):0}return Su=n,Su}var i_=n_();const rt=rr(i_);function r_(t){const n=/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/.exec(t);if(n){const i=parseInt(n[1],10),r=parseInt(n[2],10),a=parseInt(n[3],10);return{r:i,g:r,b:a}}throw new Error("Invalid RGB string format")}function a_(t){const e=t.replace(/^#/,""),n=parseInt(e.substring(0,2),16),i=parseInt(e.substring(2,4),16),r=parseInt(e.substring(4,6),16);return{r:n,g:i,b:r}}function o_(t,e,n){const i=t/255,r=e/255,a=n/255,o=i<=.03928?i/12.92:((i+.055)/1.055)**2.4,s=r<=.03928?r/12.92:((r+.055)/1.055)**2.4,c=a<=.03928?a/12.92:((a+.055)/1.055)**2.4;return .2126*o+.7152*s+.0722*c}const yn=t=>{try{const e=t[0]==="r"?r_(t):a_(t);return o_(e.r,e.g,e.b)>.4?"#000":"#fff"}catch{return"#fff"}};function s_(t){const{data:e,barColors:n,barPadding:i,showTicks:r,leftMargin:a,rightMargin:o,truncateBy:s,width:c,height:u,topMargin:h,bottomMargin:f,tooltip:d,onSeriesMouseOver:g,showLabels:p,suffix:y,prefix:v,showValues:m,refValues:I,maxValue:j,onSeriesMouseClick:w,selectedColor:S,rtl:P,labelOrder:W,maxBarThickness:D,minBarThickness:x,resetSelectionOnDoubleClick:$,detailsOnClick:V,barAxisTitle:q,valueColor:ae,noOfTicks:G,styles:_,classNames:b,animate:B,colorDomain:X,precision:z,customLayers:C,naLabel:A}=t,M=k.useRef(null),O=ct(M,{once:B.once,amount:B.amount}),K={top:q?h+25:h,bottom:f,left:a,right:o},[Q,se]=k.useState(void 0),[T,Z]=k.useState(void 0),[ie,ue]=k.useState(void 0),[he,Y]=k.useState(void 0),ge=c-K.left-K.right,oe=u-K.top-K.bottom,ce=e.map((R,le)=>({...R,id:W?`${R.label}`:`${le}`})),N=W||ce.map(R=>`${R.id}`),U=ut().domain([0,j]).range([0,ge]).nice(),ve=xn().domain(N).range([0,x?Math.max(oe,x*N.length):D?Math.min(oe,D*N.length):oe]).paddingInner(i),J=U.ticks(G);return l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{ref:M,width:`${c}px`,height:`${u}px`,viewBox:`0 0 ${c} ${u}`,direction:"ltr",children:l.jsxs("g",{transform:`translate(${K.left},${K.top})`,children:[r?l.jsx(Rn,{values:J.filter(R=>R!==0),x:J.filter(R=>R!==0).map(R=>U(R)),y1:0-h,y2:oe+K.bottom,styles:{gridLines:_?.xAxis?.gridLines,labels:_?.xAxis?.labels},classNames:{gridLines:b?.xAxis?.gridLines,labels:b?.xAxis?.labels},suffix:y,prefix:v,labelType:"secondary",showGridLines:!0,precision:z}):null,l.jsx(Nt,{x:ge/2,y:0-K.top+15,style:_?.xAxis?.title,className:b?.xAxis?.title,text:q}),C.filter(R=>R.position==="before").map(R=>R.layer),l.jsxs(mt,{children:[ce.map(R=>je(ve(R.id))?null:l.jsxs($e.g,{className:"undp-viz-low-opacity undp-viz-g-with-hover",variants:{initial:{x:0,y:ve(`${R.id}`)},whileInView:{x:0,y:ve(`${R.id}`),transition:{duration:B.duration}}},initial:"initial",animate:O?"whileInView":"initial",exit:{opacity:0,transition:{duration:B.duration}},children:[R.size.map((le,ee)=>l.jsxs($e.g,{opacity:S?n[ee]===S?1:.3:1,onMouseEnter:de=>{se({...R,sizeIndex:ee}),Y(de.clientY),ue(de.clientX),g?.({...R,sizeIndex:ee})},onMouseMove:de=>{se({...R,sizeIndex:ee}),Y(de.clientY),ue(de.clientX)},onMouseLeave:()=>{se(void 0),ue(void 0),Y(void 0),g?.(void 0)},onClick:()=>{(w||V)&&(dt(T,{...R,sizeIndex:ee})&&$?(Z(void 0),w?.(void 0)):(Z({...R,sizeIndex:ee}),w&&w({...R,sizeIndex:ee})))},children:[le?l.jsx($e.rect,{y:0,style:{fill:n[ee]},height:ve.bandwidth(),exit:{width:0,x:U(0),transition:{duration:B.duration}},variants:{initial:{width:0,x:U(0),fill:n[ee]},whileInView:{width:U(le||0),x:U(ee===0?0:rt(R.size.filter((de,te)=>te<ee&&de))),fill:n[ee],transition:{duration:B.duration}}},initial:"initial",animate:O?"whileInView":"initial"},ee):null,m?l.jsx($e.text,{y:ve.bandwidth()/2,style:{textAnchor:"middle",..._?.graphObjectValues||{}},dy:"0.33em",className:Ce.cn("graph-value text-sm",b?.graphObjectValues),exit:{opacity:0,transition:{duration:B.duration}},variants:{initial:{x:U(0),opacity:0,fill:yn(n[ee])},whileInView:{x:U(ee===0?0:rt(R.size.filter((de,te)=>te<ee&&de)))+U(le||0)/2,opacity:le&&U(le)/qe(le,A,z,v,y).length>12?1:0,fill:yn(n[ee]),transition:{duration:B.duration}}},initial:"initial",animate:O?"whileInView":"initial",children:qe(le,A,z,v,y)}):null]},`${R.label}-${X[ee]||ee}`)),p?l.jsx(io,{value:`${R.label}`.length<s?`${R.label}`:`${`${R.label}`.substring(0,s)}...`,y:0,x:0-K.left,width:0+K.left,height:ve.bandwidth(),style:_?.yAxis?.labels,className:b?.yAxis?.labels,animate:B,isInView:O}):null,m?l.jsx($e.text,{className:Ce.cn("graph-value graph-value-total text-sm",ae?"":" fill-primary-gray-700 dark:fill-primary-gray-300",b?.graphObjectValues),style:{...ae?{fill:ae}:{},textAnchor:"start",..._?.graphObjectValues||{}},y:ve.bandwidth()/2,dx:5,dy:"0.33em",variants:{initial:{x:U(0),opacity:0},whileInView:{x:U(rt(R.size.map(le=>le||0))),opacity:1,transition:{duration:B.duration}}},exit:{opacity:0,transition:{duration:B.duration}},initial:"initial",animate:O?"whileInView":"initial",children:qe(rt(R.size.filter(le=>le)),A,z,v,y)}):null]},R.label)),l.jsx(Dt,{x1:U(0),x2:U(0),y1:-2.5,y2:oe+K.bottom,classNames:{axis:b?.yAxis?.axis},styles:{axis:_?.yAxis?.axis}}),I?l.jsx(l.Fragment,{children:I.map((R,le)=>l.jsx(Tr,{text:R.text,color:R.color,x:U(R.value),y1:0-K.top,y2:oe+K.bottom,textSide:U(R.value)>ge*.75||P?"left":"right",classNames:R.classNames,styles:R.styles,animate:B,isInView:O},le))}):null]}),C.filter(R=>R.position==="after").map(R=>R.layer)]})}),Q&&d&&ie&&he?l.jsx(st,{data:Q,body:d,xPos:ie,yPos:he,backgroundStyle:_?.tooltip,className:b?.tooltip}):null,V&&T!==void 0?l.jsx(Ce.Modal,{open:T!==void 0,onClose:()=>{Z(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof V=="string"?{__html:lt(V,T)}:void 0,children:typeof V=="function"?V(T):null})}):null]})}function l_(t){const{data:e,graphTitle:n,colors:i=Pe.light.categoricalColors.colors,sources:r,graphDescription:a,barPadding:o=.25,showTicks:s=!0,leftMargin:c=100,rightMargin:u=40,truncateBy:h=999,height:f,width:d,footNote:g,colorDomain:p,colorLegendTitle:y,padding:v,backgroundColor:m=!1,topMargin:I=25,bottomMargin:j=10,tooltip:w,onSeriesMouseOver:S,suffix:P="",prefix:W="",showLabels:D=!0,relativeHeight:x,showValues:$=!0,refValues:V,graphID:q,maxValue:ae,onSeriesMouseClick:G,graphDownload:_=!1,dataDownload:b=!1,language:B="en",labelOrder:X,minHeight:z=0,theme:C="light",maxBarThickness:A,sortParameter:M,maxNumberOfBars:O,minBarThickness:K,showColorScale:Q=!0,ariaLabel:se,resetSelectionOnDoubleClick:T=!0,detailsOnClick:Z,barAxisTitle:ie,noOfTicks:ue=5,valueColor:he,styles:Y,classNames:ge,filterNA:oe=!0,animate:ce=!1,precision:N=2,customLayers:U=[],timeline:ve={enabled:!1,autoplay:!1,showOnlyActiveDate:!0},naLabel:J="NA"}=t,[R,le]=k.useState(0),[ee,de]=k.useState(0),[te,Me]=k.useState(ve.autoplay),be=di(Xe(e.filter(Le=>Le.date!==void 0&&Le.date!==null),Le=>Le.date).map(Le=>ze(`${Le.date}`,ve.dateFormat||"yyyy",new Date).getTime()),(Le,F)=>an(Le,F)),[ne,De]=k.useState(ve.autoplay?0:be.length-1),[xe,Ae]=k.useState(void 0),ke=k.useRef(null),me=k.useRef(null);k.useEffect(()=>{const Le=new ResizeObserver(F=>{le(d||F[0].target.clientWidth||620),de(f||F[0].target.clientHeight||480)});return ke.current&&(de(ke.current.clientHeight||480),le(ke.current.clientWidth||620),d||Le.observe(ke.current)),()=>Le.disconnect()},[d,f]),k.useEffect(()=>{const Le=setInterval(()=>{De(F=>F<be.length-1?F+1:0)},(ve.speed||2)*1e3);return te||clearInterval(Le),()=>clearInterval(Le)},[be,te,ve.speed]);const Se=yi(be,ne,ve.showOnlyActiveDate,ve.dateFormat||"yyyy");return l.jsx("div",{className:`${C||"light"} flex ${d?"w-fit grow-0":"w-full grow"}`,dir:B==="he"||B==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${m?m===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${B||"en"}`,ge?.graphContainer),style:{...Y?.graphContainer||{},...m&&m!==!0?{backgroundColor:m}:{}},id:q,ref:me,"aria-label":se||`${n?`The graph shows ${n}. `:""}This is a stacked bar chart. ${a?` ${a}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:m?v||"1rem":v||0},children:l.jsxs("div",{className:"flex flex-col gap-4 w-full grow justify-between",children:[n||a||_||b?l.jsx(Qe,{styles:{title:Y?.title,description:Y?.description},classNames:{title:ge?.title,description:ge?.description},graphTitle:n,graphDescription:a,width:d,graphDownload:_?me.current:void 0,dataDownload:b?e.map(Le=>Le.data).filter(Le=>Le!==void 0).length>0?e.map(Le=>Le.data).filter(Le=>Le!==void 0):e.filter(Le=>Le!==void 0):null}):null,ve.enabled&&be.length>0&&Se?l.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[l.jsx("button",{type:"button",onClick:()=>{Me(!te)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":te?"Click to pause animation":"Click to play animation",children:te?l.jsx(mi,{}):l.jsx(pi,{})}),l.jsx(Ce.SliderUI,{min:be[0],max:be[be.length-1],marks:Se,step:null,defaultValue:be[be.length-1],value:be[ne],onChangeComplete:Le=>{De(be.indexOf(Le))},onChange:Le=>{De(be.indexOf(Le))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[Q?l.jsx(tn,{width:d,colorDomain:p,colors:i,colorLegendTitle:y,setSelectedColor:Ae,showNAColor:!1}):null,l.jsx("div",{className:"w-full grow leading-0",ref:ke,"aria-label":"Graph area",children:(d||R)&&(f||ee)?l.jsx(s_,{data:M!==void 0?M==="total"?tt(Gr(e,ve.dateFormat||"yyyy").filter(Le=>ve.enabled?Le.date===ft(new Date(be[ne]),ve.dateFormat||"yyyy"):Le).filter(Le=>oe?!Le.size.every(F=>F==null):Le),Le=>rt(Le.size.filter(F=>!je(F)))).reverse().filter((Le,F)=>O?F<O:!0):tt(Gr(e,ve.dateFormat||"yyyy").filter(Le=>ve.enabled?Le.date===ft(new Date(be[ne]),ve.dateFormat||"yyyy"):Le).filter(Le=>oe?!Le.size.every(F=>F==null):Le),Le=>je(Le.size[M])?-1/0:Le.size[M]).reverse().filter((Le,F)=>O?F<O:!0):Gr(e,ve.dateFormat||"yyyy").filter(Le=>ve.enabled?Le.date===ft(new Date(be[ne]),ve.dateFormat||"yyyy"):Le).filter(Le=>oe?!Le.size.every(F=>F==null):Le).filter((Le,F)=>O?F<O:!0),barColors:i,width:d||R,height:Math.max(z,f||(x?z?(d||R)*x>z?(d||R)*x:z:(d||R)*x:ee)),barPadding:o,showTicks:s,leftMargin:c,rightMargin:u,topMargin:I,bottomMargin:j,truncateBy:h,showLabels:D,tooltip:w,onSeriesMouseOver:S,showValues:$,suffix:P,prefix:W,refValues:V,maxValue:je(ae)?Math.max(...e.map(Le=>rt(Le.size.filter(F=>!je(F)))||0)):ae,onSeriesMouseClick:G,selectedColor:xe,rtl:B==="he"||B==="ar",labelOrder:X,maxBarThickness:A,minBarThickness:K,resetSelectionOnDoubleClick:T,detailsOnClick:Z,barAxisTitle:ie,noOfTicks:ue,valueColor:he,classNames:ge,styles:Y,animate:ce===!0?{duration:.5,once:!0,amount:.5}:ce||{duration:0,once:!0,amount:0},colorDomain:p,precision:N,customLayers:U,naLabel:J}):null})]})}),r||g?l.jsx(et,{styles:{footnote:Y?.footnote,source:Y?.source},classNames:{footnote:ge?.footnote,source:ge?.source},sources:r,footNote:g,width:d}):null]})})})})}function ro(t){const{value:e,y:n,x:i,style:r,className:a,width:o,height:s,alignment:c="top",animate:u,isInView:h}=t;return l.jsx($e.foreignObject,{width:o,height:s,y:n,variants:{initial:{x:i},whileInView:{x:i,transition:{duration:u.duration}}},initial:"initial",animate:h?"whileInView":"initial",exit:{opacity:0,transition:{duration:u.duration}},children:l.jsx("div",{className:`flex flex-col items-center h-inherit ${c==="top"?"justify-start":"justify-end"}`,children:l.jsx("p",{className:Ce.cn("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 text-center leading-none",a),style:r,children:e})})})}function ri(t){const{values:e,y:n,x1:i,x2:r,styles:a,classNames:o,prefix:s,suffix:c,labelType:u,showGridLines:h,labelPos:f="vertical",precision:d}=t;return!e&&!h?null:l.jsx(l.Fragment,{children:n.map((g,p)=>l.jsxs("g",{children:[h?l.jsx("line",{x1:i,x2:r,y1:g,y2:g,className:Ce.cn("undp-tick-line stroke-primary-gray-500 dark:stroke-primary-gray-550",o?.gridLines),style:a?.gridLines}):null,e?l.jsx("text",{x:i,y:g,dy:f==="side"?"0.33em":e[p]<0?"1em":-5,dx:f==="side"?-4:0,style:{textAnchor:f==="side"?"end":"start",...a?.labels||{}},className:Ce.cn(u==="primary"?"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs":"fill-primary-gray-550 dark:fill-primary-gray-500 text-xs",o?.labels),children:qe(e[p],"NA",d,s,c)}):null]},p))})}function c_(t){const{data:e,width:n,height:i,barColor:r,suffix:a,prefix:o,barPadding:s,showLabels:c,showValues:u,showTicks:h,colorDomain:f,truncateBy:d,rightMargin:g,topMargin:p,bottomMargin:y,leftMargin:v,tooltip:m,onSeriesMouseOver:I,refValues:j,selectedColor:w,maxValue:S,minValue:P,highlightedDataPoints:W,onSeriesMouseClick:D,labelOrder:x,maxBarThickness:$,minBarThickness:V,resetSelectionOnDoubleClick:q,detailsOnClick:ae,barAxisTitle:G,valueColor:_,noOfTicks:b,styles:B,classNames:X,dimmedOpacity:z,animate:C,precision:A,customLayers:M,naLabel:O}=t,K=k.useRef(null),Q=ct(K,{once:C.once,amount:C.amount}),se={top:p,bottom:y,left:G?v+30:v,right:g},[T,Z]=k.useState(void 0),[ie,ue]=k.useState(void 0),[he,Y]=k.useState(void 0),[ge,oe]=k.useState(void 0),ce=n-se.left-se.right,N=i-se.top-se.bottom,U=ut().domain([P,S]).range([N,0]).nice(),ve=e.map((ee,de)=>({...ee,id:x?`${ee.label}`:`${de}`})),J=x||ve.map(ee=>`${ee.id}`),R=xn().domain(J).range([0,V?Math.max(ce,V*J.length):$?Math.min(ce,$*J.length):ce]).paddingInner(s),le=U.ticks(b);return l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{ref:K,width:`${n}px`,height:`${i}px`,viewBox:`0 0 ${n} ${i}`,direction:"ltr",children:l.jsxs("g",{transform:`translate(${se.left},${se.top})`,children:[l.jsx(Dt,{y1:U(P<0?0:P),y2:U(P<0?0:P),x1:0-v,x2:ce+se.right,label:qe(P<0?0:P,O,A,o,a),labelPos:{x:0-v,dx:0,dy:S<0?"1em":-5,y:U(P<0?0:P)},classNames:{axis:X?.xAxis?.axis,label:X?.yAxis?.labels},styles:{axis:B?.xAxis?.axis,label:B?.yAxis?.labels}}),h?l.jsx(ri,{values:le.filter(ee=>ee!==0),y:le.filter(ee=>ee!==0).map(ee=>U(ee)),x1:0-v,x2:ce+se.right,styles:{gridLines:B?.yAxis?.gridLines,labels:B?.yAxis?.labels},classNames:{gridLines:X?.yAxis?.gridLines,labels:X?.yAxis?.labels},suffix:a,prefix:o,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:A}):null,l.jsx(Nt,{x:0-v-15,y:N/2,style:B?.yAxis?.title,className:X?.yAxis?.title,text:G,rotate90:!0}),M.filter(ee=>ee.position==="before").map(ee=>ee.layer),l.jsxs(mt,{children:[ve.map((ee,de)=>je(R(ee.id))?null:l.jsxs($e.g,{className:"undp-viz-g-with-hover",initial:"initial",animate:Q?"whileInView":"initial",variants:{initial:{opacity:w?ee.color&&r[f.indexOf(ee.color)]===w?1:z:W.length!==0?W.indexOf(ee.label)!==-1?.85:z:.85},whileInView:{opacity:w?ee.color&&r[f.indexOf(ee.color)]===w?1:z:W.length!==0?W.indexOf(ee.label)!==-1?.85:z:.85,transition:{duration:C.duration}}},exit:{opacity:0,transition:{duration:C.duration}},onMouseEnter:te=>{Z(ee),oe(te.clientY),Y(te.clientX),I?.(ee)},onClick:()=>{(D||ae)&&(dt(ie,ee)&&q?(ue(void 0),D?.(void 0)):(ue(ee),D?.(ee)))},onMouseMove:te=>{Z(ee),oe(te.clientY),Y(te.clientX)},onMouseLeave:()=>{Z(void 0),Y(void 0),oe(void 0),I?.(void 0)},children:[ee.size?l.jsx($e.rect,{width:R.bandwidth(),initial:"initial",animate:Q?"whileInView":"initial",variants:{initial:{height:0,x:R(`${ee.id}`),y:U(0),fill:e.filter(te=>te.color).length===0?r[0]:ee.color?r[f.indexOf(ee.color)]:Pe.gray},whileInView:{height:ee.size?Math.abs(U(ee.size)-U(0)):0,y:ee.size&&ee.size>0?U(ee.size):U(0),x:R(`${ee.id}`),fill:e.filter(te=>te.color).length===0?r[0]:ee.color?r[f.indexOf(ee.color)]:Pe.gray,transition:{duration:C.duration}}},exit:{height:0,y:U(0),transition:{duration:C.duration}}}):null,c?l.jsx(ro,{value:`${ee.label}`.length<d?`${ee.label}`:`${`${ee.label}`.substring(0,d)}...`,y:(ee.size||0)<0?0:U(0)+5,x:R(`${ee.id}`),width:R.bandwidth(),height:(ee.size||0)<0?U(0)-5:se.bottom,style:B?.xAxis?.labels,className:X?.xAxis?.labels,alignment:(ee.size||0)<0?"bottom":"top",animate:C,isInView:Q}):null,u?l.jsx($e.text,{style:{textAnchor:"middle",...B?.graphObjectValues||{}},className:Ce.cn("graph-value text-sm",!_&&r.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",X?.graphObjectValues),dy:ee.size?ee.size>=0?"-5px":"1em":"-5px",variants:{initial:{x:R(`${ee.id}`)+R.bandwidth()/2,y:U(0),opacity:0,fill:_||(e.filter(te=>te.color).length===0?r[0]:ee.color?r[f.indexOf(ee.color)]:Pe.gray)},whileInView:{x:R(`${ee.id}`)+R.bandwidth()/2,y:U(ee.size||0),fill:_||(e.filter(te=>te.color).length===0?r[0]:ee.color?r[f.indexOf(ee.color)]:Pe.gray),opacity:1,transition:{duration:C.duration}}},initial:"initial",animate:Q?"whileInView":"initial",exit:{opacity:0,transition:{duration:C.duration}},children:qe(ee.size,O,A,o,a)}):null]},ee.label)),j?l.jsx(l.Fragment,{children:j.map((ee,de)=>l.jsx(gi,{text:ee.text,color:ee.color,y:U(ee.value),x1:0-v,x2:ce+se.right,classNames:ee.classNames,styles:ee.styles,animate:C,isInView:Q},de))}):null]}),M.filter(ee=>ee.position==="after").map(ee=>ee.layer)]})}),T&&m&&he&&ge?l.jsx(st,{data:T,body:m,xPos:he,yPos:ge,backgroundStyle:B?.tooltip,className:X?.tooltip}):null,ae&&ie!==void 0?l.jsx(Ce.Modal,{open:ie!==void 0,onClose:()=>{ue(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof ae=="string"?{__html:lt(ae,ie)}:void 0,children:typeof ae=="function"?ae(ie):null})}):null]})}function u_(t){const{data:e,graphTitle:n,colors:i,barPadding:r=.25,showTicks:a=!0,leftMargin:o=20,rightMargin:s=20,topMargin:c=20,bottomMargin:u=25,truncateBy:h=999,showLabels:f=!0,showValues:d=!0,backgroundColor:g=!1,suffix:p="",prefix:y="",sources:v,graphDescription:m,height:I,width:j,footNote:w,colorDomain:S,colorLegendTitle:P,padding:W,relativeHeight:D,tooltip:x,onSeriesMouseOver:$,refValues:V,showColorScale:q=!0,graphID:ae,maxValue:G,minValue:_,highlightedDataPoints:b=[],onSeriesMouseClick:B,graphDownload:X=!1,dataDownload:z=!1,language:C="en",theme:A="light",sortData:M,labelOrder:O,showNAColor:K=!0,minHeight:Q=0,maxBarThickness:se,maxNumberOfBars:T,minBarThickness:Z,ariaLabel:ie,resetSelectionOnDoubleClick:ue=!0,detailsOnClick:he,barAxisTitle:Y,noOfTicks:ge=5,valueColor:oe,styles:ce,classNames:N,filterNA:U=!0,animate:ve=!1,dimmedOpacity:J=.3,precision:R=2,customLayers:le=[],timeline:ee={enabled:!1,autoplay:!1,showOnlyActiveDate:!0},naLabel:de="NA"}=t,[te,Me]=k.useState(0),[be,ne]=k.useState(0),[De,xe]=k.useState(ee.autoplay),Ae=di(Xe(e.filter(H=>H.date!==void 0&&H.date!==null),H=>H.date).map(H=>ze(`${H.date}`,ee.dateFormat||"yyyy",new Date).getTime()),(H,Oe)=>an(H,Oe)),[ke,me]=k.useState(ee.autoplay?0:Ae.length-1),[Se,Le]=k.useState(void 0),F=k.useRef(null),Ie=k.useRef(null);k.useEffect(()=>{const H=new ResizeObserver(Oe=>{Me(j||Oe[0].target.clientWidth||620),ne(I||Oe[0].target.clientHeight||480)});return F.current&&(ne(F.current.clientHeight||480),Me(F.current.clientWidth||620),j||H.observe(F.current)),()=>H.disconnect()},[j,I]),k.useEffect(()=>{const H=setInterval(()=>{me(Oe=>Oe<Ae.length-1?Oe+1:0)},(ee.speed||2)*1e3);return De||clearInterval(H),()=>clearInterval(H)},[Ae,De,ee.speed]);const Ve=yi(Ae,ke,ee.showOnlyActiveDate,ee.dateFormat||"yyyy");return l.jsx("div",{className:`${A||"light"} flex ${j?"w-fit grow-0":"w-full grow"}`,dir:C==="he"||C==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${g?g===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${C||"en"}`,N?.graphContainer),style:{...ce?.graphContainer||{},...g&&g!==!0?{backgroundColor:g}:{}},id:ae,ref:Ie,"aria-label":ie||`${n?`The graph shows ${n}. `:""}This is a grouped bar chart. ${m?` ${m}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:g?W||"1rem":W||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||m||X||z?l.jsx(Qe,{styles:{title:ce?.title,description:ce?.description},classNames:{title:N?.title,description:N?.description},graphTitle:n,graphDescription:m,width:j,graphDownload:X?Ie.current:void 0,dataDownload:z?e.map(H=>H.data).filter(H=>H!==void 0).length>0?e.map(H=>H.data).filter(H=>H!==void 0):e.filter(H=>H!==void 0):null}):null,ee.enabled&&Ae.length>0&&Ve?l.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[l.jsx("button",{type:"button",onClick:()=>{xe(!De)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":De?"Click to pause animation":"Click to play animation",children:De?l.jsx(mi,{}):l.jsx(pi,{})}),l.jsx(Ce.SliderUI,{min:Ae[0],max:Ae[Ae.length-1],marks:Ve,step:null,defaultValue:Ae[Ae.length-1],value:Ae[ke],onChangeComplete:H=>{me(Ae.indexOf(H))},onChange:H=>{me(Ae.indexOf(H))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[q&&e.filter(H=>H.color).length!==0?l.jsx(tn,{width:j,colorLegendTitle:P,colors:i||Pe[A].categoricalColors.colors,colorDomain:S||Xe(e.filter(H=>H.color),"color").map(H=>H.color),setSelectedColor:Le,showNAColor:K}):null,l.jsx("div",{className:"flex grow flex-col justify-center w-full leading-0",ref:F,"aria-label":"Graph area",children:(j||te)&&(I||be)?l.jsx(c_,{data:M==="asc"?tt(_o(e,ee.dateFormat||"yyyy").filter(H=>ee.enabled?H.date===ft(new Date(Ae[ke]),ee.dateFormat||"yyyy"):H).filter(H=>U?!je(H.size):H),H=>H.size).filter((H,Oe)=>T?Oe<T:!0):M==="desc"?tt(_o(e,ee.dateFormat||"yyyy").filter(H=>ee.enabled?H.date===ft(new Date(Ae[ke]),ee.dateFormat||"yyyy"):H).filter(H=>U?!je(H.size):H),H=>H.size).reverse().filter((H,Oe)=>T?Oe<T:!0):_o(e,ee.dateFormat||"yyyy").filter(H=>ee.enabled?H.date===ft(new Date(Ae[ke]),ee.dateFormat||"yyyy"):H).filter(H=>U?!je(H.size):H).filter((H,Oe)=>T?Oe<T:!0),barColor:e.filter(H=>H.color).length===0?i?[i]:[Pe.primaryColors["blue-600"]]:i||Pe[A].categoricalColors.colors,colorDomain:e.filter(H=>H.color).length===0?[]:S||Xe(e.filter(H=>H.color),"color").map(H=>H.color),width:j||te,refValues:V,height:Math.max(Q,I||(D?Q?(j||te)*D>Q?(j||te)*D:Q:(j||te)*D:be)),suffix:p,prefix:y,barPadding:r,showLabels:f,showValues:d,showTicks:a,truncateBy:h,leftMargin:o,rightMargin:s,selectedColor:Se,topMargin:c,bottomMargin:u,tooltip:x,onSeriesMouseOver:$,maxValue:je(G)?Math.max(...e.filter(H=>!je(H.size)).map(H=>H.size))<0?0:Math.max(...e.filter(H=>!je(H.size)).map(H=>H.size)):G,minValue:je(_)?Math.min(...e.filter(H=>!je(H.size)).map(H=>H.size))>=0?0:Math.min(...e.filter(H=>!je(H.size)).map(H=>H.size)):_,highlightedDataPoints:b,onSeriesMouseClick:B,labelOrder:O,maxBarThickness:se,minBarThickness:Z,resetSelectionOnDoubleClick:ue,detailsOnClick:he,barAxisTitle:Y,noOfTicks:ge,valueColor:oe,styles:ce,classNames:N,animate:ve===!0?{duration:.5,once:!0,amount:.5}:ve||{duration:0,once:!0,amount:0},dimmedOpacity:J,precision:R,customLayers:le,naLabel:de}):null})]})}),v||w?l.jsx(et,{styles:{footnote:ce?.footnote,source:ce?.source},classNames:{footnote:N?.footnote,source:N?.source},sources:v,footNote:w,width:j}):null]})})})})}function h_(t){const{data:e,width:n,height:i,barColors:r,suffix:a,prefix:o,barPadding:s,showLabels:c,showValues:u,showTicks:h,truncateBy:f,leftMargin:d,rightMargin:g,topMargin:p,bottomMargin:y,tooltip:v,onSeriesMouseOver:m,refValues:I,maxValue:j,minValue:w,onSeriesMouseClick:S,selectedColor:P,labelOrder:W,maxBarThickness:D,resetSelectionOnDoubleClick:x,detailsOnClick:$,barAxisTitle:V,valueColor:q,noOfTicks:ae,styles:G,classNames:_,animate:b,colorDomain:B,precision:X,customLayers:z,naLabel:C}=t,A=k.useRef(null),M=ct(A,{once:b.once,amount:b.amount}),O={top:p,bottom:y,left:V?d+30:d,right:g},[K,Q]=k.useState(void 0),[se,T]=k.useState(void 0),[Z,ie]=k.useState(void 0),[ue,he]=k.useState(void 0),Y=n-O.left-O.right,ge=i-O.top-O.bottom,oe=ut().domain([w,j]).range([ge,0]).nice(),ce=e.map((R,le)=>({...R,id:W?`${R.label}`:`${le}`})),N=W||ce.map(R=>`${R.id}`),U=xn().domain(N).range([0,D?Math.min(Y,D*N.length):Y]).paddingInner(s),ve=xn().domain(e[0].size.map((R,le)=>`${le}`)).range([0,U.bandwidth()]).paddingInner(.1),J=oe.ticks(ae);return l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{width:`${n}px`,height:`${i}px`,viewBox:`0 0 ${n} ${i}`,direction:"ltr",ref:A,children:l.jsxs("g",{transform:`translate(${O.left},${O.top})`,children:[l.jsx(Dt,{y1:oe(w<0?0:w),y2:oe(w<0?0:w),x1:0-d,x2:Y+O.right,label:qe(w<0?0:w,C,X,o,a),labelPos:{x:0-d,dx:0,dy:j<0?"1em":-5,y:oe(w<0?0:w)},classNames:{axis:_?.xAxis?.axis,label:_?.yAxis?.labels},styles:{axis:G?.xAxis?.axis,label:G?.yAxis?.labels}}),h?l.jsx(ri,{values:J.filter(R=>R!==0),y:J.filter(R=>R!==0).map(R=>oe(R)),x1:0-d,x2:Y+O.right,styles:{gridLines:G?.yAxis?.gridLines,labels:G?.yAxis?.labels},classNames:{gridLines:_?.yAxis?.gridLines,labels:_?.yAxis?.labels},suffix:a,prefix:o,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:X}):null,l.jsx(Nt,{x:0-d-15,y:ge/2,style:G?.yAxis?.title,className:_?.yAxis?.title,text:V,rotate90:!0}),z.filter(R=>R.position==="before").map(R=>R.layer),l.jsxs(mt,{children:[ce.map(R=>je(U(R.id))?null:l.jsxs($e.g,{variants:{initial:{x:U(`${R.id}`),y:0},whileInView:{x:U(`${R.id}`),y:0,transition:{duration:b.duration}}},initial:"initial",animate:M?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},children:[R.size.map((le,ee)=>l.jsxs($e.g,{className:"undp-viz-g-with-hover",opacity:P?r[ee]===P?1:.3:.85,onMouseEnter:de=>{Q({...R,sizeIndex:ee}),he(de.clientY),ie(de.clientX),m?.({...R,sizeIndex:ee})},onMouseMove:de=>{Q({...R,sizeIndex:ee}),he(de.clientY),ie(de.clientX)},onMouseLeave:()=>{Q(void 0),ie(void 0),he(void 0),m?.(void 0)},onClick:()=>{(S||$)&&(dt(se,{...R,sizeIndex:ee})&&x?(T(void 0),S?.(void 0)):(T({...R,sizeIndex:ee}),S&&S({...R,sizeIndex:ee})))},children:[l.jsx($e.rect,{x:ve(`${ee}`),width:ve.bandwidth(),variants:{initial:{height:0,y:oe(0),fill:r[ee]},whileInView:{height:je(le)?0:Math.abs(oe(le)-oe(0)),y:je(le)?oe(0):le>0?oe(le):oe(0),fill:r[ee],transition:{duration:b.duration}}},exit:{height:0,y:oe(0),transition:{duration:b.duration}},initial:"initial",animate:M?"whileInView":"initial"}),u?l.jsx($e.text,{x:ve(`${ee}`)+ve.bandwidth()/2,style:{fill:q||r[ee],textAnchor:"middle",...G?.graphObjectValues||{}},className:Ce.cn("graph-value text-sm",_?.graphObjectValues),dy:le?le>=0?"-5px":"1em":"-5px",variants:{initial:{y:oe(0),opacity:0},whileInView:{y:oe(le||0),opacity:1,transition:{duration:b.duration}}},initial:"initial",animate:M?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},children:qe(le,C,X,o,a)}):null]},`${R.label}-${B[ee]||ee}`)),c?l.jsx(ro,{value:`${R.label}`.length<f?`${R.label}`:`${`${R.label}`.substring(0,f)}...`,y:oe(0)+5,x:0,width:U.bandwidth(),height:O.bottom,style:G?.xAxis?.labels,className:_?.xAxis?.labels,alignment:"top",animate:b,isInView:M}):null]},R.label)),I?l.jsx(l.Fragment,{children:I.map((R,le)=>l.jsx(gi,{text:R.text,color:R.color,y:oe(R.value),x1:0-d,x2:Y+O.right,classNames:R.classNames,styles:R.styles,animate:b,isInView:M},le))}):null]}),z.filter(R=>R.position==="after").map(R=>R.layer)]})}),K&&v&&Z&&ue?l.jsx(st,{data:K,body:v,xPos:Z,yPos:ue,backgroundStyle:G?.tooltip,className:_?.tooltip}):null,$&&se!==void 0?l.jsx(Ce.Modal,{open:se!==void 0,onClose:()=>{T(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof $=="string"?{__html:lt($,se)}:void 0,children:typeof $=="function"?$(se):null})}):null]})}function f_(t){const{data:e,graphTitle:n,colors:i=Pe.light.categoricalColors.colors,sources:r,graphDescription:a,barPadding:o=.25,showTicks:s=!0,leftMargin:c=20,rightMargin:u=20,topMargin:h=20,bottomMargin:f=25,truncateBy:d=999,showLabels:g=!0,showValues:p=!0,backgroundColor:y=!1,suffix:v="",prefix:m="",height:I,width:j,footNote:w,colorDomain:S,colorLegendTitle:P,padding:W,relativeHeight:D,tooltip:x,onSeriesMouseOver:$,refValues:V,graphID:q,maxValue:ae,minValue:G,onSeriesMouseClick:_,graphDownload:b=!1,dataDownload:B=!1,language:X="en",theme:z="light",labelOrder:C,minHeight:A=0,maxBarThickness:M,ariaLabel:O,resetSelectionOnDoubleClick:K=!0,detailsOnClick:Q,barAxisTitle:se,noOfTicks:T=5,valueColor:Z,styles:ie,classNames:ue,filterNA:he=!0,showColorScale:Y=!0,animate:ge=!1,precision:oe=2,customLayers:ce=[],timeline:N={enabled:!1,autoplay:!1,showOnlyActiveDate:!0},naLabel:U="NA"}=t,[ve,J]=k.useState(0),[R,le]=k.useState(0),[ee,de]=k.useState(N.autoplay),te=di(Xe(e.filter(me=>me.date!==void 0&&me.date!==null),me=>me.date).map(me=>ze(`${me.date}`,N.dateFormat||"yyyy",new Date).getTime()),(me,Se)=>an(me,Se)),[Me,be]=k.useState(N.autoplay?0:te.length-1),[ne,De]=k.useState(void 0),xe=k.useRef(null),Ae=k.useRef(null);k.useEffect(()=>{const me=new ResizeObserver(Se=>{J(j||Se[0].target.clientWidth||620),le(I||Se[0].target.clientHeight||480)});return xe.current&&(le(xe.current.clientHeight||480),J(xe.current.clientWidth||620),j||me.observe(xe.current)),()=>me.disconnect()},[j,I]),k.useEffect(()=>{const me=setInterval(()=>{be(Se=>Se<te.length-1?Se+1:0)},(N.speed||2)*1e3);return ee||clearInterval(me),()=>clearInterval(me)},[te,ee,N.speed]);const ke=yi(te,Me,N.showOnlyActiveDate,N.dateFormat||"yyyy");return l.jsx("div",{className:`${z||"light"} flex ${j?"w-fit grow-0":"w-full grow"}`,dir:X==="he"||X==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${y?y===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${X||"en"}`,ue?.graphContainer),style:{...ie?.graphContainer||{},...y&&y!==!0?{backgroundColor:y}:{}},id:q,ref:Ae,"aria-label":O||`${n?`The graph shows ${n}. `:""}This is a grouped bar chart. ${a?` ${a}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:y?W||"1rem":W||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||a||b||B?l.jsx(Qe,{styles:{title:ie?.title,description:ie?.description},classNames:{title:ue?.title,description:ue?.description},graphTitle:n,graphDescription:a,width:j,graphDownload:b?Ae.current:void 0,dataDownload:B?e.map(me=>me.data).filter(me=>me!==void 0).length>0?e.map(me=>me.data).filter(me=>me!==void 0):e.filter(me=>me!==void 0):null}):null,N.enabled&&te.length>0&&ke?l.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[l.jsx("button",{type:"button",onClick:()=>{de(!ee)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":ee?"Click to pause animation":"Click to play animation",children:ee?l.jsx(mi,{}):l.jsx(pi,{})}),l.jsx(Ce.SliderUI,{min:te[0],max:te[te.length-1],marks:ke,step:null,defaultValue:te[te.length-1],value:te[Me],onChangeComplete:me=>{be(te.indexOf(me))},onChange:me=>{be(te.indexOf(me))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[Y?l.jsx(tn,{width:j,colorDomain:S,colors:i,colorLegendTitle:P,setSelectedColor:De,showNAColor:!1}):null,l.jsx("div",{className:"w-full grow leading-0",ref:xe,"aria-label":"Graph area",children:(j||ve)&&(I||R)?l.jsx(h_,{data:Gr(e,N.dateFormat||"yyyy").filter(me=>N.enabled?me.date===ft(new Date(te[Me]),N.dateFormat||"yyyy"):me).filter(me=>he?!me.size.every(Se=>Se==null):me),barColors:i,width:j||ve,height:Math.max(A,I||(D?A?(j||ve)*D>A?(j||ve)*D:A:(j||ve)*D:R)),suffix:v,prefix:m,barPadding:o,showLabels:g,showValues:p,showTicks:s,truncateBy:d,leftMargin:c,rightMargin:u,topMargin:h,bottomMargin:f,tooltip:x,onSeriesMouseOver:$,refValues:V,maxValue:je(ae)?Math.max(...e.map(me=>Math.max(...me.size.filter(Se=>!je(Se)))))<0?0:Math.max(...e.map(me=>Math.max(...me.size.filter(Se=>!je(Se))))):ae,minValue:je(G)?Math.min(...e.map(me=>Math.min(...me.size.filter(Se=>!je(Se)))))>=0?0:Math.min(...e.map(me=>Math.min(...me.size.filter(Se=>!je(Se))))):G,onSeriesMouseClick:_,selectedColor:ne,labelOrder:C,maxBarThickness:M,resetSelectionOnDoubleClick:K,detailsOnClick:Q,barAxisTitle:se,noOfTicks:T,valueColor:Z,styles:ie,classNames:ue,animate:ge===!0?{duration:.5,once:!0,amount:.5}:ge||{duration:0,once:!0,amount:0},colorDomain:S,precision:oe,customLayers:ce,naLabel:U}):null})]})}),r||w?l.jsx(et,{styles:{footnote:ie?.footnote,source:ie?.source},classNames:{footnote:ue?.footnote,source:ue?.source},sources:r,footNote:w,width:j}):null]})})})})}function d_(t){const{data:e,width:n,height:i,barColors:r,barPadding:a,showLabels:o,showTicks:s,truncateBy:c,leftMargin:u,topMargin:h,bottomMargin:f,rightMargin:d,tooltip:g,onSeriesMouseOver:p,suffix:y,prefix:v,showValues:m,refValues:I,maxValue:j,onSeriesMouseClick:w,selectedColor:S,labelOrder:P,maxBarThickness:W,minBarThickness:D,resetSelectionOnDoubleClick:x,detailsOnClick:$,barAxisTitle:V,valueColor:q,noOfTicks:ae,styles:G,classNames:_,animate:b,colorDomain:B,precision:X,customLayers:z,naLabel:C}=t,A=k.useRef(null),M=ct(A,{once:b.once,amount:b.amount}),O={top:h,bottom:f,left:V?u+30:u,right:d},[K,Q]=k.useState(void 0),[se,T]=k.useState(void 0),[Z,ie]=k.useState(void 0),[ue,he]=k.useState(void 0),Y=n-O.left-O.right,ge=i-O.top-O.bottom,oe=ut().domain([0,j]).range([ge,0]).nice(),ce=e.map((J,R)=>({...J,id:P?`${J.label}`:`${R}`})),N=P||ce.map(J=>`${J.id}`),U=xn().domain(N).range([0,D?Math.max(Y,D*N.length):W?Math.min(Y,W*N.length):Y]).paddingInner(a),ve=oe.ticks(ae);return l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{width:`${n}px`,height:`${i}px`,viewBox:`0 0 ${n} ${i}`,direction:"ltr",ref:A,children:l.jsxs("g",{transform:`translate(${O.left},${O.top})`,children:[l.jsx(Dt,{y1:oe(0),y2:oe(0),x1:0-u,x2:Y+O.right,label:qe(0,C,X,v,y),labelPos:{x:0-u,y:oe(0),dx:0,dy:-5},classNames:{axis:_?.xAxis?.axis,label:_?.yAxis?.labels},styles:{axis:G?.xAxis?.axis,label:G?.yAxis?.labels}}),s?l.jsx(ri,{values:ve.filter(J=>J!==0),y:ve.filter(J=>J!==0).map(J=>oe(J)),x1:0-u,x2:Y+O.right,styles:{gridLines:G?.yAxis?.gridLines,labels:G?.yAxis?.labels},classNames:{gridLines:_?.yAxis?.gridLines,labels:_?.yAxis?.labels},suffix:y,prefix:v,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:X}):null,l.jsx(Nt,{x:0-u-15,y:ge/2,style:G?.yAxis?.title,className:_?.yAxis?.title,text:V,rotate90:!0}),z.filter(J=>J.position==="before").map(J=>J.layer),l.jsxs(mt,{children:[ce.map(J=>je(U(J.id))?null:l.jsxs($e.g,{className:"undp-viz-low-opacity undp-viz-g-with-hover",variants:{initial:{x:U(`${J.id}`),y:0},whileInView:{x:U(`${J.id}`),y:0,transition:{duration:b.duration}}},transition:{duration:b.duration},initial:"initial",animate:M?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},children:[J.size.map((R,le)=>l.jsxs($e.g,{opacity:S?r[le]===S?1:.3:1,onMouseEnter:ee=>{Q({...J,sizeIndex:le}),he(ee.clientY),ie(ee.clientX),p?.({...J,sizeIndex:le})},onMouseMove:ee=>{Q({...J,sizeIndex:le}),he(ee.clientY),ie(ee.clientX)},onMouseLeave:()=>{Q(void 0),ie(void 0),he(void 0),p?.(void 0)},onClick:()=>{(w||$)&&(dt(se,{...J,sizeIndex:le})&&x?(T(void 0),w?.(void 0)):(T({...J,sizeIndex:le}),w&&w({...J,sizeIndex:le})))},children:[l.jsx($e.rect,{x:0,width:U.bandwidth(),variants:{initial:{height:0,fill:r[le],y:oe(0)},whileInView:{height:Math.abs(oe(rt(J.size.filter((ee,de)=>de<=le&&ee)))-oe(rt(J.size.filter((ee,de)=>de<le&&ee)))),y:oe(rt(J.size.filter((ee,de)=>de<=le&&ee))),fill:r[le],transition:{duration:b.duration}}},initial:"initial",animate:M?"whileInView":"initial",exit:{height:0,y:oe(0),transition:{duration:b.duration}}}),m?l.jsx($e.text,{x:U.bandwidth()/2,style:{fill:yn(r[le]),textAnchor:"middle",...G?.graphObjectValues||{}},className:Ce.cn("graph-value text-sm",_?.graphObjectValues),dy:"0.33em",variants:{initial:{y:oe(0),opacity:0,fill:yn(r[le])},whileInView:{y:oe(rt(J.size.filter((ee,de)=>de<=le&&ee)))+Math.abs(oe(rt(J.size.filter((ee,de)=>de<=le&&ee)))-oe(rt(J.size.filter((ee,de)=>de<le&&ee))))/2,opacity:R&&Math.abs(oe(rt(J.size.filter((ee,de)=>de<=le&&ee)))-oe(rt(J.size.filter((ee,de)=>de<le&&ee))))>20?1:0,fill:yn(r[le]),transition:{duration:b.duration}}},initial:"initial",animate:M?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},children:qe(R,C,X,v,y)}):null]},`${J.label}-${B[le]||le}`)),o?l.jsx(ro,{value:`${J.label}`.length<c?`${J.label}`:`${`${J.label}`.substring(0,c)}...`,y:oe(0)+5,x:0,width:U.bandwidth(),height:O.bottom,style:G?.xAxis?.labels,className:_?.xAxis?.labels,alignment:"top",animate:b,isInView:M}):null,m?l.jsx($e.text,{style:{...q&&{fill:q},textAnchor:"middle",...G?.graphObjectValues||{}},x:U.bandwidth()/2,dy:-10,className:Ce.cn("graph-value graph-value-total",q?"text-sm":"fill-primary-gray-700 dark:fill-primary-gray-300 text-sm",_?.graphObjectValues),variants:{initial:{y:oe(0),opacity:0},whileInView:{y:oe(rt(J.size.map(R=>R||0))),opacity:1,transition:{duration:b.duration}}},exit:{opacity:0,transition:{duration:b.duration}},initial:"initial",animate:M?"whileInView":"initial",children:qe(rt(J.size.filter(R=>R)),C,X,v,y)}):null]},J.label)),I?l.jsx(l.Fragment,{children:I.map((J,R)=>l.jsx(gi,{text:J.text,color:J.color,y:oe(J.value),x1:0-u,x2:Y+O.right,classNames:J.classNames,styles:J.styles,animate:b,isInView:M},R))}):null]}),z.filter(J=>J.position==="after").map(J=>J.layer)]})}),K&&g&&Z&&ue?l.jsx(st,{data:K,body:g,xPos:Z,yPos:ue,backgroundStyle:G?.tooltip,className:_?.tooltip}):null,$&&se!==void 0?l.jsx(Ce.Modal,{open:se!==void 0,onClose:()=>{T(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof $=="string"?{__html:lt($,se)}:void 0,children:typeof $=="function"?$(se):null})}):null]})}function g_(t){const{data:e,graphTitle:n,colors:i=Pe.light.categoricalColors.colors,sources:r,graphDescription:a,barPadding:o=.25,showTicks:s=!0,leftMargin:c=20,rightMargin:u=20,topMargin:h=20,bottomMargin:f=25,truncateBy:d=999,showLabels:g=!0,showValues:p=!0,backgroundColor:y=!1,showColorScale:v=!0,suffix:m="",prefix:I="",height:j,width:w,footNote:S,colorDomain:P,colorLegendTitle:W,padding:D,tooltip:x,onSeriesMouseOver:$,relativeHeight:V,refValues:q,graphID:ae,maxValue:G,onSeriesMouseClick:_,graphDownload:b=!1,dataDownload:B=!1,language:X="en",theme:z="light",labelOrder:C,minHeight:A=0,maxBarThickness:M,sortParameter:O,maxNumberOfBars:K,minBarThickness:Q,ariaLabel:se,resetSelectionOnDoubleClick:T=!0,detailsOnClick:Z,barAxisTitle:ie,noOfTicks:ue=5,valueColor:he,styles:Y,classNames:ge,filterNA:oe=!0,animate:ce=!1,precision:N=2,customLayers:U=[],timeline:ve={enabled:!1,autoplay:!1,showOnlyActiveDate:!0},naLabel:J="NA"}=t,[R,le]=k.useState(0),[ee,de]=k.useState(0),[te,Me]=k.useState(ve.autoplay),be=di(Xe(e.filter(Le=>Le.date!==void 0&&Le.date!==null),Le=>Le.date).map(Le=>ze(`${Le.date}`,ve.dateFormat||"yyyy",new Date).getTime()),(Le,F)=>an(Le,F)),[ne,De]=k.useState(ve.autoplay?0:be.length-1),[xe,Ae]=k.useState(void 0),ke=k.useRef(null),me=k.useRef(null);k.useEffect(()=>{const Le=new ResizeObserver(F=>{le(w||F[0].target.clientWidth||620),de(j||F[0].target.clientHeight||480)});return ke.current&&(de(ke.current.clientHeight||480),le(ke.current.clientWidth||620),w||Le.observe(ke.current)),()=>Le.disconnect()},[w,j]),k.useEffect(()=>{const Le=setInterval(()=>{De(F=>F<be.length-1?F+1:0)},(ve.speed||2)*1e3);return te||clearInterval(Le),()=>clearInterval(Le)},[be,te,ve.speed]);const Se=yi(be,ne,ve.showOnlyActiveDate,ve.dateFormat||"yyyy");return l.jsx("div",{className:`${z||"light"} flex ${w?"w-fit grow-0":"w-full grow"}`,dir:X==="he"||X==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${y?y===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${X||"en"}`,ge?.graphContainer),style:{...Y?.graphContainer||{},...y&&y!==!0?{backgroundColor:y}:{}},id:ae,ref:me,"aria-label":se||`${n?`The graph shows ${n}. `:""}This is a stacked bar chart. ${a?` ${a}`:""}`,children:l.jsx("div",{style:{padding:y?D||"1rem":D||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||a||b||B?l.jsx(Qe,{styles:{title:Y?.title,description:Y?.description},classNames:{title:ge?.title,description:ge?.description},graphTitle:n,graphDescription:a,width:w,graphDownload:b?me.current:void 0,dataDownload:B?e.map(Le=>Le.data).filter(Le=>Le!==void 0).length>0?e.map(Le=>Le.data).filter(Le=>Le!==void 0):e.filter(Le=>Le!==void 0):null}):null,ve.enabled&&be.length>0&&Se?l.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[l.jsx("button",{type:"button",onClick:()=>{Me(!te)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":te?"Click to pause animation":"Click to play animation",children:te?l.jsx(mi,{}):l.jsx(pi,{})}),l.jsx(Ce.SliderUI,{min:be[0],max:be[be.length-1],marks:Se,step:null,defaultValue:be[be.length-1],value:be[ne],onChangeComplete:Le=>{De(be.indexOf(Le))},onChange:Le=>{De(be.indexOf(Le))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[v?l.jsx(tn,{width:w,colorDomain:P,colors:i,colorLegendTitle:W,setSelectedColor:Ae,showNAColor:!1}):null,l.jsx("div",{className:"w-full grow leading-0",ref:ke,"aria-label":"Graph area",children:(w||R)&&(j||ee)?l.jsx(d_,{data:O!==void 0?O==="total"?tt(Gr(e,ve.dateFormat||"yyyy").filter(Le=>ve.enabled?Le.date===ft(new Date(be[ne]),ve.dateFormat||"yyyy"):Le).filter(Le=>oe?!Le.size.every(F=>F==null):Le),Le=>rt(Le.size.filter(F=>!je(F)))).filter((Le,F)=>K?F<K:!0):tt(Gr(e,ve.dateFormat||"yyyy").filter(Le=>ve.enabled?Le.date===ft(new Date(be[ne]),ve.dateFormat||"yyyy"):Le).filter(Le=>oe?!Le.size.every(F=>F==null):Le),Le=>je(Le.size[O])?-1/0:Le.size[O]).filter((Le,F)=>K?F<K:!0):Gr(e,ve.dateFormat||"yyyy").filter(Le=>oe?!Le.size.every(F=>F==null):Le).filter((Le,F)=>K?F<K:!0),barColors:i,width:w||R,height:Math.max(A,j||(V?A?(w||R)*V>A?(w||R)*V:A:(w||R)*V:ee)),barPadding:o,showLabels:g,showTicks:s,truncateBy:d,leftMargin:c,rightMargin:u,topMargin:h,bottomMargin:f,tooltip:x,onSeriesMouseOver:$,showValues:p,suffix:m,prefix:I,refValues:q,maxValue:je(G)?Math.max(...e.map(Le=>rt(Le.size.filter(F=>!je(F)))||0)):G,onSeriesMouseClick:_,selectedColor:xe,labelOrder:C,maxBarThickness:M,minBarThickness:Q,resetSelectionOnDoubleClick:T,detailsOnClick:Z,barAxisTitle:ie,noOfTicks:ue,valueColor:he,styles:Y,classNames:ge,animate:ce===!0?{duration:.5,once:!0,amount:.5}:ce||{duration:0,once:!0,amount:0},colorDomain:P,precision:N,customLayers:U,naLabel:J}):null})]})}),r||S?l.jsx(et,{styles:{footnote:Y?.footnote,source:Y?.source},classNames:{footnote:ge?.footnote,source:ge?.source},sources:r,footNote:S,width:w}):null]})})})})}function Gf(t){const{data:e,graphTitle:n,colors:i,barPadding:r,showTicks:a,leftMargin:o,rightMargin:s,topMargin:c,bottomMargin:u,truncateBy:h,showLabels:f,showValues:d,backgroundColor:g,suffix:p,prefix:y,sources:v,graphDescription:m,height:I,width:j,footNote:w,colorDomain:S,colorLegendTitle:P,padding:W,relativeHeight:D,tooltip:x,onSeriesMouseOver:$,refValues:V,showColorScale:q,graphID:ae,maxValue:G,minValue:_,highlightedDataPoints:b,onSeriesMouseClick:B,graphDownload:X,dataDownload:z,language:C,theme:A,sortData:M,labelOrder:O,showNAColor:K,minHeight:Q,maxBarThickness:se,maxNumberOfBars:T,minBarThickness:Z,ariaLabel:ie,resetSelectionOnDoubleClick:ue,detailsOnClick:he,barAxisTitle:Y,noOfTicks:ge,valueColor:oe,orientation:ce="vertical",styles:N,classNames:U,filterNA:ve,animate:J,dimmedOpacity:R,precision:le,customLayers:ee,timeline:de,naLabel:te}=t;return ce==="vertical"?l.jsx(u_,{data:e,graphTitle:n,colors:i,barPadding:r,showTicks:a,leftMargin:o,rightMargin:s,topMargin:c,bottomMargin:u,truncateBy:h,showLabels:f,showValues:d,backgroundColor:g,suffix:p,prefix:y,sources:v,graphDescription:m,height:I,width:j,footNote:w,colorDomain:S,colorLegendTitle:P,padding:W,relativeHeight:D,tooltip:x,onSeriesMouseOver:$,refValues:V,showColorScale:q,graphID:ae,maxValue:G,minValue:_,highlightedDataPoints:b,onSeriesMouseClick:B,graphDownload:X,dataDownload:z,language:C,theme:A,sortData:M,labelOrder:O,showNAColor:K,minHeight:Q,maxBarThickness:se,maxNumberOfBars:T,minBarThickness:Z,ariaLabel:ie,resetSelectionOnDoubleClick:ue,styles:N,detailsOnClick:he,barAxisTitle:Y,noOfTicks:ge,valueColor:oe,classNames:U,filterNA:ve,animate:J,dimmedOpacity:R,precision:le,customLayers:ee,timeline:de}):l.jsx(J2,{data:e,graphTitle:n,colors:i,barPadding:r,showTicks:a,leftMargin:o,rightMargin:s,topMargin:c,bottomMargin:u,truncateBy:h,showLabels:f,showValues:d,backgroundColor:g,suffix:p,prefix:y,sources:v,graphDescription:m,height:I,width:j,footNote:w,colorDomain:S,colorLegendTitle:P,padding:W,relativeHeight:D,tooltip:x,onSeriesMouseOver:$,refValues:V,showColorScale:q,graphID:ae,maxValue:G,minValue:_,highlightedDataPoints:b,onSeriesMouseClick:B,graphDownload:X,dataDownload:z,language:C,theme:A,sortData:M,labelOrder:O,showNAColor:K,minHeight:Q,maxBarThickness:se,maxNumberOfBars:T,minBarThickness:Z,ariaLabel:ie,resetSelectionOnDoubleClick:ue,styles:N,detailsOnClick:he,barAxisTitle:Y,noOfTicks:ge,valueColor:oe,classNames:U,filterNA:ve,dimmedOpacity:R,precision:le,customLayers:ee,timeline:de,naLabel:te})}function Rx(t){const{data:e,graphTitle:n,colors:i,sources:r,graphDescription:a,barPadding:o,showTicks:s,truncateBy:c,height:u,width:h,footNote:f,colorDomain:d,colorLegendTitle:g,suffix:p,prefix:y,showValues:v,padding:m,backgroundColor:I,leftMargin:j,rightMargin:w,topMargin:S,bottomMargin:P,showLabels:W,relativeHeight:D,tooltip:x,onSeriesMouseOver:$,refValues:V,graphID:q,maxValue:ae,minValue:G,onSeriesMouseClick:_,graphDownload:b,dataDownload:B,language:X,labelOrder:z,minHeight:C,theme:A,maxBarThickness:M,ariaLabel:O,resetSelectionOnDoubleClick:K,detailsOnClick:Q,barAxisTitle:se,noOfTicks:T,valueColor:Z,orientation:ie="vertical",styles:ue,classNames:he,filterNA:Y,animate:ge,precision:oe,customLayers:ce,showColorScale:N,timeline:U,naLabel:ve}=t;return ie==="vertical"?l.jsx(f_,{data:e,graphTitle:n,colors:i,sources:r,graphDescription:a,barPadding:o,showTicks:s,truncateBy:c,height:u,width:h,footNote:f,colorDomain:d,colorLegendTitle:g,suffix:p,prefix:y,showValues:v,padding:m,backgroundColor:I,leftMargin:j,rightMargin:w,topMargin:S,bottomMargin:P,showLabels:W,relativeHeight:D,tooltip:x,onSeriesMouseOver:$,refValues:V,graphID:q,maxValue:ae,minValue:G,onSeriesMouseClick:_,graphDownload:b,dataDownload:B,language:X,labelOrder:z,minHeight:C,theme:A,maxBarThickness:M,ariaLabel:O,resetSelectionOnDoubleClick:K,styles:ue,detailsOnClick:Q,barAxisTitle:se,noOfTicks:T,valueColor:Z,classNames:he,filterNA:Y,animate:ge,precision:oe,customLayers:ce,showColorScale:N,timeline:U,naLabel:ve}):l.jsx(t_,{data:e,graphTitle:n,colors:i,sources:r,graphDescription:a,barPadding:o,showTicks:s,truncateBy:c,height:u,width:h,footNote:f,colorDomain:d,colorLegendTitle:g,suffix:p,prefix:y,showValues:v,padding:m,backgroundColor:I,leftMargin:j,rightMargin:w,topMargin:S,bottomMargin:P,showLabels:W,relativeHeight:D,tooltip:x,onSeriesMouseOver:$,refValues:V,graphID:q,maxValue:ae,minValue:G,onSeriesMouseClick:_,graphDownload:b,dataDownload:B,language:X,labelOrder:z,minHeight:C,theme:A,maxBarThickness:M,ariaLabel:O,resetSelectionOnDoubleClick:K,styles:ue,detailsOnClick:Q,barAxisTitle:se,noOfTicks:T,valueColor:Z,classNames:he,filterNA:Y,animate:ge,precision:oe,customLayers:ce,showColorScale:N,timeline:U,naLabel:ve})}function Bx(t){const{data:e,graphTitle:n,colors:i,sources:r,graphDescription:a,barPadding:o,showTicks:s,leftMargin:c,rightMargin:u,topMargin:h,bottomMargin:f,truncateBy:d,showLabels:g,showValues:p,backgroundColor:y,suffix:v,prefix:m,height:I,width:j,footNote:w,colorDomain:S,colorLegendTitle:P,padding:W,tooltip:D,onSeriesMouseOver:x,relativeHeight:$,refValues:V,graphID:q,maxValue:ae,onSeriesMouseClick:G,graphDownload:_,dataDownload:b,language:B,theme:X,labelOrder:z,minHeight:C,maxBarThickness:A,sortParameter:M,maxNumberOfBars:O,minBarThickness:K,ariaLabel:Q,resetSelectionOnDoubleClick:se,detailsOnClick:T,barAxisTitle:Z,noOfTicks:ie,valueColor:ue,orientation:he="vertical",styles:Y,classNames:ge,filterNA:oe,animate:ce,precision:N,customLayers:U,showColorScale:ve,timeline:J,naLabel:R}=t;return he==="vertical"?l.jsx(g_,{data:e,graphTitle:n,colors:i,sources:r,graphDescription:a,barPadding:o,showTicks:s,leftMargin:c,rightMargin:u,topMargin:h,bottomMargin:f,truncateBy:d,showLabels:g,showValues:p,backgroundColor:y,suffix:v,prefix:m,height:I,width:j,footNote:w,colorDomain:S,colorLegendTitle:P,padding:W,tooltip:D,onSeriesMouseOver:x,relativeHeight:$,refValues:V,graphID:q,maxValue:ae,onSeriesMouseClick:G,graphDownload:_,dataDownload:b,language:B,theme:X,labelOrder:z,minHeight:C,maxBarThickness:A,sortParameter:M,maxNumberOfBars:O,minBarThickness:K,ariaLabel:Q,resetSelectionOnDoubleClick:se,styles:Y,detailsOnClick:T,barAxisTitle:Z,noOfTicks:ie,valueColor:ue,classNames:ge,filterNA:oe,animate:ce,precision:N,customLayers:U,showColorScale:ve,timeline:J,naLabel:R}):l.jsx(l_,{data:e,graphTitle:n,colors:i,sources:r,graphDescription:a,barPadding:o,showTicks:s,leftMargin:c,rightMargin:u,topMargin:h,bottomMargin:f,truncateBy:d,showLabels:g,showValues:p,backgroundColor:y,suffix:v,prefix:m,height:I,width:j,footNote:w,colorDomain:S,colorLegendTitle:P,padding:W,tooltip:D,onSeriesMouseOver:x,relativeHeight:$,refValues:V,graphID:q,maxValue:ae,onSeriesMouseClick:G,graphDownload:_,dataDownload:b,language:B,theme:X,labelOrder:z,minHeight:C,maxBarThickness:A,sortParameter:M,maxNumberOfBars:O,minBarThickness:K,ariaLabel:Q,resetSelectionOnDoubleClick:se,styles:Y,detailsOnClick:T,barAxisTitle:Z,noOfTicks:ie,valueColor:ue,classNames:ge,filterNA:oe,animate:ce,precision:N,customLayers:U,showColorScale:ve,timeline:J,naLabel:R})}function p_(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return Hx(this.cover(e,n),e,n,t)}function Hx(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,a=t._root,o={data:i},s=t._x0,c=t._y0,u=t._x1,h=t._y1,f,d,g,p,y,v,m,I;if(!a)return t._root=o,t;for(;a.length;)if((y=e>=(f=(s+u)/2))?s=f:u=f,(v=n>=(d=(c+h)/2))?c=d:h=d,r=a,!(a=a[m=v<<1|y]))return r[m]=o,t;if(g=+t._x.call(null,a.data),p=+t._y.call(null,a.data),e===g&&n===p)return o.next=a,r?r[m]=o:t._root=o,t;do r=r?r[m]=new Array(4):t._root=new Array(4),(y=e>=(f=(s+u)/2))?s=f:u=f,(v=n>=(d=(c+h)/2))?c=d:h=d;while((m=v<<1|y)===(I=(p>=d)<<1|g>=f));return r[I]=a,r[m]=o,t}function m_(t){var e,n,i=t.length,r,a,o=new Array(i),s=new Array(i),c=1/0,u=1/0,h=-1/0,f=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(a=+this._y.call(null,e))||(o[n]=r,s[n]=a,r<c&&(c=r),r>h&&(h=r),a<u&&(u=a),a>f&&(f=a));if(c>h||u>f)return this;for(this.cover(c,u).cover(h,f),n=0;n<i;++n)Hx(this,o[n],s[n],t[n]);return this}function y_(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,i=this._y0,r=this._x1,a=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,a=(i=Math.floor(e))+1;else{for(var o=r-n||1,s=this._root,c,u;n>t||t>=r||i>e||e>=a;)switch(u=(e<i)<<1|t<n,c=new Array(4),c[u]=s,s=c,o*=2,u){case 0:r=n+o,a=i+o;break;case 1:n=r-o,a=i+o;break;case 2:r=n+o,i=a-o;break;case 3:n=r-o,i=a-o;break}this._root&&this._root.length&&(this._root=s)}return this._x0=n,this._y0=i,this._x1=r,this._y1=a,this}function x_(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}function v_(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Vn(t,e,n,i,r){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=r}function w_(t,e,n){var i,r=this._x0,a=this._y0,o,s,c,u,h=this._x1,f=this._y1,d=[],g=this._root,p,y;for(g&&d.push(new Vn(g,r,a,h,f)),n==null?n=1/0:(r=t-n,a=e-n,h=t+n,f=e+n,n*=n);p=d.pop();)if(!(!(g=p.node)||(o=p.x0)>h||(s=p.y0)>f||(c=p.x1)<r||(u=p.y1)<a))if(g.length){var v=(o+c)/2,m=(s+u)/2;d.push(new Vn(g[3],v,m,c,u),new Vn(g[2],o,m,v,u),new Vn(g[1],v,s,c,m),new Vn(g[0],o,s,v,m)),(y=(e>=m)<<1|t>=v)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-y],d[d.length-1-y]=p)}else{var I=t-+this._x.call(null,g.data),j=e-+this._y.call(null,g.data),w=I*I+j*j;if(w<n){var S=Math.sqrt(n=w);r=t-S,a=e-S,h=t+S,f=e+S,i=g.data}}return i}function b_(t){if(isNaN(h=+this._x.call(null,t))||isNaN(f=+this._y.call(null,t)))return this;var e,n=this._root,i,r,a,o=this._x0,s=this._y0,c=this._x1,u=this._y1,h,f,d,g,p,y,v,m;if(!n)return this;if(n.length)for(;;){if((p=h>=(d=(o+c)/2))?o=d:c=d,(y=f>=(g=(s+u)/2))?s=g:u=g,e=n,!(n=n[v=y<<1|p]))return this;if(!n.length)break;(e[v+1&3]||e[v+2&3]||e[v+3&3])&&(i=e,m=v)}for(;n.data!==t;)if(r=n,!(n=n.next))return this;return(a=n.next)&&delete n.next,r?(a?r.next=a:delete r.next,this):e?(a?e[v]=a:delete e[v],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(i?i[m]=n:this._root=n),this):(this._root=a,this)}function C_(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function S_(){return this._root}function D_(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}function M_(t){var e=[],n,i=this._root,r,a,o,s,c;for(i&&e.push(new Vn(i,this._x0,this._y0,this._x1,this._y1));n=e.pop();)if(!t(i=n.node,a=n.x0,o=n.y0,s=n.x1,c=n.y1)&&i.length){var u=(a+s)/2,h=(o+c)/2;(r=i[3])&&e.push(new Vn(r,u,h,s,c)),(r=i[2])&&e.push(new Vn(r,a,h,u,c)),(r=i[1])&&e.push(new Vn(r,u,o,s,h)),(r=i[0])&&e.push(new Vn(r,a,o,u,h))}return this}function T_(t){var e=[],n=[],i;for(this._root&&e.push(new Vn(this._root,this._x0,this._y0,this._x1,this._y1));i=e.pop();){var r=i.node;if(r.length){var a,o=i.x0,s=i.y0,c=i.x1,u=i.y1,h=(o+c)/2,f=(s+u)/2;(a=r[0])&&e.push(new Vn(a,o,s,h,f)),(a=r[1])&&e.push(new Vn(a,h,s,c,f)),(a=r[2])&&e.push(new Vn(a,o,f,h,u)),(a=r[3])&&e.push(new Vn(a,h,f,c,u))}n.push(i)}for(;i=n.pop();)t(i.node,i.x0,i.y0,i.x1,i.y1);return this}function k_(t){return t[0]}function j_(t){return arguments.length?(this._x=t,this):this._x}function A_(t){return t[1]}function __(t){return arguments.length?(this._y=t,this):this._y}function Yf(t,e,n){var i=new qf(e??k_,n??A_,NaN,NaN,NaN,NaN);return t==null?i:i.addAll(t)}function qf(t,e,n,i,r,a){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=r,this._y1=a,this._root=void 0}function sm(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Bn=Yf.prototype=qf.prototype;Bn.copy=function(){var t=new qf(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,i;if(!e)return t;if(!e.length)return t._root=sm(e),t;for(n=[{source:e,target:t._root=new Array(4)}];e=n.pop();)for(var r=0;r<4;++r)(i=e.source[r])&&(i.length?n.push({source:i,target:e.target[r]=new Array(4)}):e.target[r]=sm(i));return t};Bn.add=p_;Bn.addAll=m_;Bn.cover=y_;Bn.data=x_;Bn.extent=v_;Bn.find=w_;Bn.remove=b_;Bn.removeAll=C_;Bn.root=S_;Bn.size=D_;Bn.visit=M_;Bn.visitAfter=T_;Bn.x=j_;Bn.y=__;function ki(t){return function(){return t}}function To(t){return(t()-.5)*1e-6}function O_(t){return t.x+t.vx}function N_(t){return t.y+t.vy}function Uf(t){var e,n,i,r=1,a=1;typeof t!="function"&&(t=ki(t==null?1:+t));function o(){for(var u,h=e.length,f,d,g,p,y,v,m=0;m<a;++m)for(f=Yf(e,O_,N_).visitAfter(s),u=0;u<h;++u)d=e[u],y=n[d.index],v=y*y,g=d.x+d.vx,p=d.y+d.vy,f.visit(I);function I(j,w,S,P,W){var D=j.data,x=j.r,$=y+x;if(D){if(D.index>d.index){var V=g-D.x-D.vx,q=p-D.y-D.vy,ae=V*V+q*q;ae<$*$&&(V===0&&(V=To(i),ae+=V*V),q===0&&(q=To(i),ae+=q*q),ae=($-(ae=Math.sqrt(ae)))/ae*r,d.vx+=(V*=ae)*($=(x*=x)/(v+x)),d.vy+=(q*=ae)*$,D.vx-=V*($=1-$),D.vy-=q*$)}return}return w>g+$||P<g-$||S>p+$||W<p-$}}function s(u){if(u.data)return u.r=n[u.data.index];for(var h=u.r=0;h<4;++h)u[h]&&u[h].r>u.r&&(u.r=u[h].r)}function c(){if(e){var u,h=e.length,f;for(n=new Array(h),u=0;u<h;++u)f=e[u],n[f.index]=+t(f,u,e)}}return o.initialize=function(u,h){e=u,i=h,c()},o.iterations=function(u){return arguments.length?(a=+u,o):a},o.strength=function(u){return arguments.length?(r=+u,o):r},o.radius=function(u){return arguments.length?(t=typeof u=="function"?u:ki(+u),c(),o):t},o}var I_={value:()=>{}};function _c(){for(var t=0,e=arguments.length,n={},i;t<e;++t){if(!(i=arguments[t]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new Pl(n)}function Pl(t){this._=t}function $_(t,e){return t.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}Pl.prototype=_c.prototype={constructor:Pl,on:function(t,e){var n=this._,i=$_(t+"",n),r,a=-1,o=i.length;if(arguments.length<2){for(;++a<o;)if((r=(t=i[a]).type)&&(r=L_(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<o;)if(r=(t=i[a]).type)n[r]=lm(n[r],t.name,e);else if(e==null)for(r in n)n[r]=lm(n[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Pl(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,a;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],i=0,r=a.length;i<r;++i)a[i].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,a=i.length;r<a;++r)i[r].value.apply(e,n)}};function L_(t,e){for(var n=0,i=t.length,r;n<i;++n)if((r=t[n]).name===e)return r.value}function lm(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=I_,t=t.slice(0,i).concat(t.slice(i+1));break}return n!=null&&t.push({name:e,value:n}),t}var Bo=0,vs=0,us=0,Wx=1e3,lc,ws,cc=0,Xa=0,Oc=0,Hs=typeof performance=="object"&&performance.now?performance:Date,zx=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Xf(){return Xa||(zx(P_),Xa=Hs.now()+Oc)}function P_(){Xa=0}function uc(){this._call=this._time=this._next=null}uc.prototype=Kf.prototype={constructor:uc,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Xf():+n)+(e==null?0:+e),!this._next&&ws!==this&&(ws?ws._next=this:lc=this,ws=this),this._call=t,this._time=n,vh()},stop:function(){this._call&&(this._call=null,this._time=1/0,vh())}};function Kf(t,e,n){var i=new uc;return i.restart(t,e,n),i}function E_(){Xf(),++Bo;for(var t=lc,e;t;)(e=Xa-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Bo}function cm(){Xa=(cc=Hs.now())+Oc,Bo=vs=0;try{E_()}finally{Bo=0,F_(),Xa=0}}function V_(){var t=Hs.now(),e=t-cc;e>Wx&&(Oc-=e,cc=t)}function F_(){for(var t,e=lc,n,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:lc=n);ws=t,vh(i)}function vh(t){if(!Bo){vs&&(vs=clearTimeout(vs));var e=t-Xa;e>24?(t<1/0&&(vs=setTimeout(cm,t-Hs.now()-Oc)),us&&(us=clearInterval(us))):(us||(cc=Hs.now(),us=setInterval(V_,Wx)),Bo=1,zx(cm))}}function um(t,e,n){var i=new uc;return e=e==null?0:+e,i.restart(r=>{i.stop(),t(r+e)},e,n),i}const R_=1664525,B_=1013904223,hm=4294967296;function H_(){let t=1;return()=>(t=(R_*t+B_)%hm)/hm}function W_(t){return t.x}function z_(t){return t.y}var G_=10,Y_=Math.PI*(3-Math.sqrt(5));function Qf(t){var e,n=1,i=.001,r=1-Math.pow(i,1/300),a=0,o=.6,s=new Map,c=Kf(f),u=_c("tick","end"),h=H_();t==null&&(t=[]);function f(){d(),u.call("tick",e),n<i&&(c.stop(),u.call("end",e))}function d(y){var v,m=t.length,I;y===void 0&&(y=1);for(var j=0;j<y;++j)for(n+=(a-n)*r,s.forEach(function(w){w(n)}),v=0;v<m;++v)I=t[v],I.fx==null?I.x+=I.vx*=o:(I.x=I.fx,I.vx=0),I.fy==null?I.y+=I.vy*=o:(I.y=I.fy,I.vy=0);return e}function g(){for(var y=0,v=t.length,m;y<v;++y){if(m=t[y],m.index=y,m.fx!=null&&(m.x=m.fx),m.fy!=null&&(m.y=m.fy),isNaN(m.x)||isNaN(m.y)){var I=G_*Math.sqrt(.5+y),j=y*Y_;m.x=I*Math.cos(j),m.y=I*Math.sin(j)}(isNaN(m.vx)||isNaN(m.vy))&&(m.vx=m.vy=0)}}function p(y){return y.initialize&&y.initialize(t,h),y}return g(),e={tick:d,restart:function(){return c.restart(f),e},stop:function(){return c.stop(),e},nodes:function(y){return arguments.length?(t=y,g(),s.forEach(p),e):t},alpha:function(y){return arguments.length?(n=+y,e):n},alphaMin:function(y){return arguments.length?(i=+y,e):i},alphaDecay:function(y){return arguments.length?(r=+y,e):+r},alphaTarget:function(y){return arguments.length?(a=+y,e):a},velocityDecay:function(y){return arguments.length?(o=1-y,e):1-o},randomSource:function(y){return arguments.length?(h=y,s.forEach(p),e):h},force:function(y,v){return arguments.length>1?(v==null?s.delete(y):s.set(y,p(v)),e):s.get(y)},find:function(y,v,m){var I=0,j=t.length,w,S,P,W,D;for(m==null?m=1/0:m*=m,I=0;I<j;++I)W=t[I],w=y-W.x,S=v-W.y,P=w*w+S*S,P<m&&(D=W,m=P);return D},on:function(y,v){return arguments.length>1?(u.on(y,v),e):u.on(y)}}}function Zf(){var t,e,n,i,r=ki(-30),a,o=1,s=1/0,c=.81;function u(g){var p,y=t.length,v=Yf(t,W_,z_).visitAfter(f);for(i=g,p=0;p<y;++p)e=t[p],v.visit(d)}function h(){if(t){var g,p=t.length,y;for(a=new Array(p),g=0;g<p;++g)y=t[g],a[y.index]=+r(y,g,t)}}function f(g){var p=0,y,v,m=0,I,j,w;if(g.length){for(I=j=w=0;w<4;++w)(y=g[w])&&(v=Math.abs(y.value))&&(p+=y.value,m+=v,I+=v*y.x,j+=v*y.y);g.x=I/m,g.y=j/m}else{y=g,y.x=y.data.x,y.y=y.data.y;do p+=a[y.data.index];while(y=y.next)}g.value=p}function d(g,p,y,v){if(!g.value)return!0;var m=g.x-e.x,I=g.y-e.y,j=v-p,w=m*m+I*I;if(j*j/c<w)return w<s&&(m===0&&(m=To(n),w+=m*m),I===0&&(I=To(n),w+=I*I),w<o&&(w=Math.sqrt(o*w)),e.vx+=m*g.value*i/w,e.vy+=I*g.value*i/w),!0;if(g.length||w>=s)return;(g.data!==e||g.next)&&(m===0&&(m=To(n),w+=m*m),I===0&&(I=To(n),w+=I*I),w<o&&(w=Math.sqrt(o*w)));do g.data!==e&&(j=a[g.data.index]*i/w,e.vx+=m*j,e.vy+=I*j);while(g=g.next)}return u.initialize=function(g,p){t=g,n=p,h()},u.strength=function(g){return arguments.length?(r=typeof g=="function"?g:ki(+g),h(),u):r},u.distanceMin=function(g){return arguments.length?(o=g*g,u):Math.sqrt(o)},u.distanceMax=function(g){return arguments.length?(s=g*g,u):Math.sqrt(s)},u.theta=function(g){return arguments.length?(c=g*g,u):Math.sqrt(c)},u}function Jf(t){var e=ki(.1),n,i,r;typeof t!="function"&&(t=ki(t==null?0:+t));function a(s){for(var c=0,u=n.length,h;c<u;++c)h=n[c],h.vx+=(r[c]-h.x)*i[c]*s}function o(){if(n){var s,c=n.length;for(i=new Array(c),r=new Array(c),s=0;s<c;++s)i[s]=isNaN(r[s]=+t(n[s],s,n))?0:+e(n[s],s,n)}}return a.initialize=function(s){n=s,o()},a.strength=function(s){return arguments.length?(e=typeof s=="function"?s:ki(+s),o(),a):e},a.x=function(s){return arguments.length?(t=typeof s=="function"?s:ki(+s),o(),a):t},a}function ed(t){var e=ki(.1),n,i,r;typeof t!="function"&&(t=ki(t==null?0:+t));function a(s){for(var c=0,u=n.length,h;c<u;++c)h=n[c],h.vy+=(r[c]-h.y)*i[c]*s}function o(){if(n){var s,c=n.length;for(i=new Array(c),r=new Array(c),s=0;s<c;++s)i[s]=isNaN(r[s]=+t(n[s],s,n))?0:+e(n[s],s,n)}}return a.initialize=function(s){n=s,o()},a.strength=function(s){return arguments.length?(e=typeof s=="function"?s:ki(+s),o(),a):e},a.y=function(s){return arguments.length?(t=typeof s=="function"?s:ki(+s),o(),a):t},a}var bs={exports:{}};bs.exports;var fm;function q_(){return fm||(fm=1,function(t,e){var n=200,i="Expected a function",r="__lodash_hash_undefined__",a=1,o=2,s=9007199254740991,c="[object Arguments]",u="[object Array]",h="[object Boolean]",f="[object Date]",d="[object Error]",g="[object Function]",p="[object GeneratorFunction]",y="[object Map]",v="[object Number]",m="[object Object]",I="[object Promise]",j="[object RegExp]",w="[object Set]",S="[object String]",P="[object Symbol]",W="[object WeakMap]",D="[object ArrayBuffer]",x="[object DataView]",$="[object Float32Array]",V="[object Float64Array]",q="[object Int8Array]",ae="[object Int16Array]",G="[object Int32Array]",_="[object Uint8Array]",b="[object Uint8ClampedArray]",B="[object Uint16Array]",X="[object Uint32Array]",z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,C=/^\w*$/,A=/^\./,M=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O=/[\\^$.*+?()[\]{}|]/g,K=/\\(\\)?/g,Q=/^\[object .+?Constructor\]$/,se=/^(?:0|[1-9]\d*)$/,T={};T[$]=T[V]=T[q]=T[ae]=T[G]=T[_]=T[b]=T[B]=T[X]=!0,T[c]=T[u]=T[D]=T[h]=T[x]=T[f]=T[d]=T[g]=T[y]=T[v]=T[m]=T[j]=T[w]=T[S]=T[W]=!1;var Z=typeof Ot=="object"&&Ot&&Ot.Object===Object&&Ot,ie=typeof self=="object"&&self&&self.Object===Object&&self,ue=Z||ie||Function("return this")(),he=e&&!e.nodeType&&e,Y=he&&!0&&t&&!t.nodeType&&t,ge=Y&&Y.exports===he,oe=ge&&Z.process,ce=function(){try{return oe&&oe.binding("util")}catch{}}(),N=ce&&ce.isTypedArray;function U(E,fe){for(var Te=-1,Ne=E?E.length:0,Be=Array(Ne);++Te<Ne;)Be[Te]=fe(E[Te],Te,E);return Be}function ve(E,fe){for(var Te=-1,Ne=E?E.length:0;++Te<Ne;)if(fe(E[Te],Te,E))return!0;return!1}function J(E){return function(fe){return fe?.[E]}}function R(E,fe){var Te=E.length;for(E.sort(fe);Te--;)E[Te]=E[Te].value;return E}function le(E,fe){for(var Te=-1,Ne=Array(E);++Te<E;)Ne[Te]=fe(Te);return Ne}function ee(E){return function(fe){return E(fe)}}function de(E,fe){return E?.[fe]}function te(E){var fe=!1;if(E!=null&&typeof E.toString!="function")try{fe=!!(E+"")}catch{}return fe}function Me(E){var fe=-1,Te=Array(E.size);return E.forEach(function(Ne,Be){Te[++fe]=[Be,Ne]}),Te}function be(E,fe){return function(Te){return E(fe(Te))}}function ne(E){var fe=-1,Te=Array(E.size);return E.forEach(function(Ne){Te[++fe]=Ne}),Te}var De=Array.prototype,xe=Function.prototype,Ae=Object.prototype,ke=ue["__core-js_shared__"],me=function(){var E=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||"");return E?"Symbol(src)_1."+E:""}(),Se=xe.toString,Le=Ae.hasOwnProperty,F=Ae.toString,Ie=RegExp("^"+Se.call(Le).replace(O,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=ue.Symbol,H=ue.Uint8Array,Oe=Ae.propertyIsEnumerable,Ee=De.splice,it=be(Object.keys,Object),Tt=Yn(ue,"DataView"),sn=Yn(ue,"Map"),vn=Yn(ue,"Promise"),ln=Yn(ue,"Set"),Ut=Yn(ue,"WeakMap"),jt=Yn(Object,"create"),gn=cn(Tt),Xt=cn(sn),Hn=cn(vn),Tn=cn(ln),zi=cn(Ut),xi=Ve?Ve.prototype:void 0,Gi=xi?xi.valueOf:void 0,Wn=xi?xi.toString:void 0;function ai(E){var fe=-1,Te=E?E.length:0;for(this.clear();++fe<Te;){var Ne=E[fe];this.set(Ne[0],Ne[1])}}function oi(){this.__data__=jt?jt(null):{}}function Ni(E){return this.has(E)&&delete this.__data__[E]}function or(E){var fe=this.__data__;if(jt){var Te=fe[E];return Te===r?void 0:Te}return Le.call(fe,E)?fe[E]:void 0}function nn(E){var fe=this.__data__;return jt?fe[E]!==void 0:Le.call(fe,E)}function kn(E,fe){var Te=this.__data__;return Te[E]=jt&&fe===void 0?r:fe,this}ai.prototype.clear=oi,ai.prototype.delete=Ni,ai.prototype.get=or,ai.prototype.has=nn,ai.prototype.set=kn;function jn(E){var fe=-1,Te=E?E.length:0;for(this.clear();++fe<Te;){var Ne=E[fe];this.set(Ne[0],Ne[1])}}function na(){this.__data__=[]}function ia(E){var fe=this.__data__,Te=Xi(fe,E);if(Te<0)return!1;var Ne=fe.length-1;return Te==Ne?fe.pop():Ee.call(fe,Te,1),!0}function ra(E){var fe=this.__data__,Te=Xi(fe,E);return Te<0?void 0:fe[Te][1]}function It(E){return Xi(this.__data__,E)>-1}function An(E,fe){var Te=this.__data__,Ne=Xi(Te,E);return Ne<0?Te.push([E,fe]):Te[Ne][1]=fe,this}jn.prototype.clear=na,jn.prototype.delete=ia,jn.prototype.get=ra,jn.prototype.has=It,jn.prototype.set=An;function _n(E){var fe=-1,Te=E?E.length:0;for(this.clear();++fe<Te;){var Ne=E[fe];this.set(Ne[0],Ne[1])}}function aa(){this.__data__={hash:new ai,map:new(sn||jn),string:new ai}}function oa(E){return At(this,E).delete(E)}function sa(E){return At(this,E).get(E)}function $t(E){return At(this,E).has(E)}function Yi(E,fe){return At(this,E).set(E,fe),this}_n.prototype.clear=aa,_n.prototype.delete=oa,_n.prototype.get=sa,_n.prototype.has=$t,_n.prototype.set=Yi;function qi(E){var fe=-1,Te=E?E.length:0;for(this.__data__=new _n;++fe<Te;)this.add(E[fe])}function la(E){return this.__data__.set(E,r),this}function On(E){return this.__data__.has(E)}qi.prototype.add=qi.prototype.push=la,qi.prototype.has=On;function Nn(E){this.__data__=new jn(E)}function zn(){this.__data__=new jn}function ca(E){return this.__data__.delete(E)}function ua(E){return this.__data__.get(E)}function Lt(E){return this.__data__.has(E)}function ha(E,fe){var Te=this.__data__;if(Te instanceof jn){var Ne=Te.__data__;if(!sn||Ne.length<n-1)return Ne.push([E,fe]),this;Te=this.__data__=new _n(Ne)}return Te.set(E,fe),this}Nn.prototype.clear=zn,Nn.prototype.delete=ca,Nn.prototype.get=ua,Nn.prototype.has=Lt,Nn.prototype.set=ha;function Ui(E,fe){var Te=un(E)||gr(E)?le(E.length,String):[],Ne=Te.length,Be=!!Ne;for(var Re in E)Le.call(E,Re)&&!(Be&&(Re=="length"||Fr(Re,Ne)))&&Te.push(Re);return Te}function Xi(E,fe){for(var Te=E.length;Te--;)if($i(E[Te][0],fe))return Te;return-1}var fa=Ma(ga),da=Ta();function ga(E,fe){return E&&da(E,fe,ye)}function In(E,fe){fe=si(fe,E)?[fe]:cr(fe);for(var Te=0,Ne=fe.length;E!=null&&Te<Ne;)E=E[$n(fe[Te++])];return Te&&Te==Ne?E:void 0}function Lr(E){return F.call(E)}function pa(E,fe){return E!=null&&fe in Object(E)}function Ii(E,fe,Te,Ne,Be){return E===fe?!0:E==null||fe==null||!vi(E)&&!wi(fe)?E!==E&&fe!==fe:sr(E,fe,Ii,Te,Ne,Be)}function sr(E,fe,Te,Ne,Be,Re){var Ge=un(E),Ue=un(fe),re=u,we=u;Ge||(re=zt(E),re=re==c?m:re),Ue||(we=zt(fe),we=we==c?m:we);var _e=re==m&&!te(E),Fe=we==m&&!te(fe),We=re==we;if(We&&!_e)return Re||(Re=new Nn),Ge||Qn(E)?Gn(E,fe,Te,Ne,Be,Re):Vr(E,fe,re,Te,Ne,Be,Re);if(!(Be&o)){var He=_e&&Le.call(E,"__wrapped__"),Ye=Fe&&Le.call(fe,"__wrapped__");if(He||Ye){var Ze=He?E.value():E,Ke=Ye?fe.value():fe;return Re||(Re=new Nn),Te(Ze,Ke,Ne,Be,Re)}}return We?(Re||(Re=new Nn),pn(E,fe,Te,Ne,Be,Re)):!1}function Pr(E,fe,Te,Ne){var Be=Te.length,Re=Be;if(E==null)return!Re;for(E=Object(E);Be--;){var Ge=Te[Be];if(Ge[2]?Ge[1]!==E[Ge[0]]:!(Ge[0]in E))return!1}for(;++Be<Re;){Ge=Te[Be];var Ue=Ge[0],re=E[Ue],we=Ge[1];if(Ge[2]){if(re===void 0&&!(Ue in E))return!1}else{var _e=new Nn,Fe;if(!(Fe===void 0?Ii(we,re,Ne,a|o,_e):Fe))return!1}}return!0}function ma(E){if(!vi(E)||qn(E))return!1;var fe=Qt(E)||te(E)?Ie:Q;return fe.test(cn(E))}function ya(E){return wi(E)&&li(E.length)&&!!T[F.call(E)]}function lr(E){return typeof E=="function"?E:E==null?L:typeof E=="object"?un(E)?ba(E[0],E[1]):wa(E):pe(E)}function xa(E){if(!Un(E))return it(E);var fe=[];for(var Te in Object(E))Le.call(E,Te)&&Te!="constructor"&&fe.push(Te);return fe}function va(E,fe){var Te=-1,Ne=Kn(E)?Array(E.length):[];return fa(E,function(Be,Re,Ge){Ne[++Te]=fe(Be,Re,Ge)}),Ne}function wa(E){var fe=ka(E);return fe.length==1&&fe[0][2]?Kt(fe[0][0],fe[0][1]):function(Te){return Te===E||Pr(Te,E,fe)}}function ba(E,fe){return si(E)&&Xn(fe)?Kt($n(E),fe):function(Te){var Ne=Aa(Te,E);return Ne===void 0&&Ne===fe?Rr(Te,E):Ii(fe,Ne,void 0,a|o)}}function Ca(E,fe,Te){var Ne=-1;fe=U(fe.length?fe:[L],ee(lr));var Be=va(E,function(Re,Ge,Ue){var re=U(fe,function(we){return we(Re)});return{criteria:re,index:++Ne,value:Re}});return R(Be,function(Re,Ge){return ur(Re,Ge,Te)})}function Er(E){return function(fe){return In(fe,E)}}function Sa(E){if(typeof E=="string")return E;if(ci(E))return Wn?Wn.call(E):"";var fe=E+"";return fe=="0"&&1/E==-1/0?"-0":fe}function cr(E){return un(E)?E:fr(E)}function Da(E,fe){if(E!==fe){var Te=E!==void 0,Ne=E===null,Be=E===E,Re=ci(E),Ge=fe!==void 0,Ue=fe===null,re=fe===fe,we=ci(fe);if(!Ue&&!we&&!Re&&E>fe||Re&&Ge&&re&&!Ue&&!we||Ne&&Ge&&re||!Te&&re||!Be)return 1;if(!Ne&&!Re&&!we&&E<fe||we&&Te&&Be&&!Ne&&!Re||Ue&&Te&&Be||!Ge&&Be||!re)return-1}return 0}function ur(E,fe,Te){for(var Ne=-1,Be=E.criteria,Re=fe.criteria,Ge=Be.length,Ue=Te.length;++Ne<Ge;){var re=Da(Be[Ne],Re[Ne]);if(re){if(Ne>=Ue)return re;var we=Te[Ne];return re*(we=="desc"?-1:1)}}return E.index-fe.index}function Ma(E,fe){return function(Te,Ne){if(Te==null)return Te;if(!Kn(Te))return E(Te,Ne);for(var Be=Te.length,Re=-1,Ge=Object(Te);++Re<Be&&Ne(Ge[Re],Re,Ge)!==!1;);return Te}}function Ta(E){return function(fe,Te,Ne){for(var Be=-1,Re=Object(fe),Ge=Ne(fe),Ue=Ge.length;Ue--;){var re=Ge[++Be];if(Te(Re[re],re,Re)===!1)break}return fe}}function Gn(E,fe,Te,Ne,Be,Re){var Ge=Be&o,Ue=E.length,re=fe.length;if(Ue!=re&&!(Ge&&re>Ue))return!1;var we=Re.get(E);if(we&&Re.get(fe))return we==fe;var _e=-1,Fe=!0,We=Be&a?new qi:void 0;for(Re.set(E,fe),Re.set(fe,E);++_e<Ue;){var He=E[_e],Ye=fe[_e];if(Ne)var Ze=Ge?Ne(Ye,He,_e,fe,E,Re):Ne(He,Ye,_e,E,fe,Re);if(Ze!==void 0){if(Ze)continue;Fe=!1;break}if(We){if(!ve(fe,function(Ke,nt){if(!We.has(nt)&&(He===Ke||Te(He,Ke,Ne,Be,Re)))return We.add(nt)})){Fe=!1;break}}else if(!(He===Ye||Te(He,Ye,Ne,Be,Re))){Fe=!1;break}}return Re.delete(E),Re.delete(fe),Fe}function Vr(E,fe,Te,Ne,Be,Re,Ge){switch(Te){case x:if(E.byteLength!=fe.byteLength||E.byteOffset!=fe.byteOffset)return!1;E=E.buffer,fe=fe.buffer;case D:return!(E.byteLength!=fe.byteLength||!Ne(new H(E),new H(fe)));case h:case f:case v:return $i(+E,+fe);case d:return E.name==fe.name&&E.message==fe.message;case j:case S:return E==fe+"";case y:var Ue=Me;case w:var re=Re&o;if(Ue||(Ue=ne),E.size!=fe.size&&!re)return!1;var we=Ge.get(E);if(we)return we==fe;Re|=a,Ge.set(E,fe);var _e=Gn(Ue(E),Ue(fe),Ne,Be,Re,Ge);return Ge.delete(E),_e;case P:if(Gi)return Gi.call(E)==Gi.call(fe)}return!1}function pn(E,fe,Te,Ne,Be,Re){var Ge=Be&o,Ue=ye(E),re=Ue.length,we=ye(fe),_e=we.length;if(re!=_e&&!Ge)return!1;for(var Fe=re;Fe--;){var We=Ue[Fe];if(!(Ge?We in fe:Le.call(fe,We)))return!1}var He=Re.get(E);if(He&&Re.get(fe))return He==fe;var Ye=!0;Re.set(E,fe),Re.set(fe,E);for(var Ze=Ge;++Fe<re;){We=Ue[Fe];var Ke=E[We],nt=fe[We];if(Ne)var Bt=Ge?Ne(nt,Ke,We,fe,E,Re):Ne(Ke,nt,We,E,fe,Re);if(!(Bt===void 0?Ke===nt||Te(Ke,nt,Ne,Be,Re):Bt)){Ye=!1;break}Ze||(Ze=We=="constructor")}if(Ye&&!Ze){var rn=E.constructor,Zt=fe.constructor;rn!=Zt&&"constructor"in E&&"constructor"in fe&&!(typeof rn=="function"&&rn instanceof rn&&typeof Zt=="function"&&Zt instanceof Zt)&&(Ye=!1)}return Re.delete(E),Re.delete(fe),Ye}function At(E,fe){var Te=E.__data__;return hr(fe)?Te[typeof fe=="string"?"string":"hash"]:Te.map}function ka(E){for(var fe=ye(E),Te=fe.length;Te--;){var Ne=fe[Te],Be=E[Ne];fe[Te]=[Ne,Be,Xn(Be)]}return fe}function Yn(E,fe){var Te=de(E,fe);return ma(Te)?Te:void 0}var zt=Lr;(Tt&&zt(new Tt(new ArrayBuffer(1)))!=x||sn&&zt(new sn)!=y||vn&&zt(vn.resolve())!=I||ln&&zt(new ln)!=w||Ut&&zt(new Ut)!=W)&&(zt=function(E){var fe=F.call(E),Te=fe==m?E.constructor:void 0,Ne=Te?cn(Te):void 0;if(Ne)switch(Ne){case gn:return x;case Xt:return y;case Hn:return I;case Tn:return w;case zi:return W}return fe});function ja(E,fe,Te){fe=si(fe,E)?[fe]:cr(fe);for(var Ne,Be=-1,Ge=fe.length;++Be<Ge;){var Re=$n(fe[Be]);if(!(Ne=E!=null&&Te(E,Re)))break;E=E[Re]}if(Ne)return Ne;var Ge=E?E.length:0;return!!Ge&&li(Ge)&&Fr(Re,Ge)&&(un(E)||gr(E))}function Fr(E,fe){return fe=fe??s,!!fe&&(typeof E=="number"||se.test(E))&&E>-1&&E%1==0&&E<fe}function si(E,fe){if(un(E))return!1;var Te=typeof E;return Te=="number"||Te=="symbol"||Te=="boolean"||E==null||ci(E)?!0:C.test(E)||!z.test(E)||fe!=null&&E in Object(fe)}function hr(E){var fe=typeof E;return fe=="string"||fe=="number"||fe=="symbol"||fe=="boolean"?E!=="__proto__":E===null}function qn(E){return!!me&&me in E}function Un(E){var fe=E&&E.constructor,Te=typeof fe=="function"&&fe.prototype||Ae;return E===Te}function Xn(E){return E===E&&!vi(E)}function Kt(E,fe){return function(Te){return Te==null?!1:Te[E]===fe&&(fe!==void 0||E in Object(Te))}}var fr=Rt(function(E){E=bn(E);var fe=[];return A.test(E)&&fe.push(""),E.replace(M,function(Te,Ne,Be,Re){fe.push(Be?Re.replace(K,"$1"):Ne||Te)}),fe});function $n(E){if(typeof E=="string"||ci(E))return E;var fe=E+"";return fe=="0"&&1/E==-1/0?"-0":fe}function cn(E){if(E!=null){try{return Se.call(E)}catch{}try{return E+""}catch{}}return""}function dr(E,fe,Te,Ne){return E==null?[]:(un(fe)||(fe=fe==null?[]:[fe]),Te=Ne?void 0:Te,un(Te)||(Te=Te==null?[]:[Te]),Ca(E,fe,Te))}function Rt(E,fe){if(typeof E!="function"||fe&&typeof fe!="function")throw new TypeError(i);var Te=function(){var Ne=arguments,Be=fe?fe.apply(this,Ne):Ne[0],Re=Te.cache;if(Re.has(Be))return Re.get(Be);var Ge=E.apply(this,Ne);return Te.cache=Re.set(Be,Ge),Ge};return Te.cache=new(Rt.Cache||_n),Te}Rt.Cache=_n;function $i(E,fe){return E===fe||E!==E&&fe!==fe}function gr(E){return wn(E)&&Le.call(E,"callee")&&(!Oe.call(E,"callee")||F.call(E)==c)}var un=Array.isArray;function Kn(E){return E!=null&&li(E.length)&&!Qt(E)}function wn(E){return wi(E)&&Kn(E)}function Qt(E){var fe=vi(E)?F.call(E):"";return fe==g||fe==p}function li(E){return typeof E=="number"&&E>-1&&E%1==0&&E<=s}function vi(E){var fe=typeof E;return!!E&&(fe=="object"||fe=="function")}function wi(E){return!!E&&typeof E=="object"}function ci(E){return typeof E=="symbol"||wi(E)&&F.call(E)==P}var Qn=N?ee(N):ya;function bn(E){return E==null?"":Sa(E)}function Aa(E,fe,Te){var Ne=E==null?void 0:In(E,fe);return Ne===void 0?Te:Ne}function Rr(E,fe){return E!=null&&ja(E,fe,pa)}function ye(E){return Kn(E)?Ui(E):xa(E)}function L(E){return E}function pe(E){return si(E)?J($n(E)):Er(E)}t.exports=dr}(bs,bs.exports)),bs.exports}var U_=q_();const Nc=rr(U_),Gx=k.memo(t=>{const{data:e,colors:n,leftMargin:i,width:r,height:a,colorDomain:o,selectedColor:s,rightMargin:c,topMargin:u,bottomMargin:h,showLabels:f,tooltip:d,onSeriesMouseOver:g,showValues:p,suffix:y,prefix:v,highlightedDataPoints:m,onSeriesMouseClick:I,maxRadiusValue:j,radius:w,resetSelectionOnDoubleClick:S,detailsOnClick:P,styles:W,classNames:D,animate:x,dimmedOpacity:$,precision:V}=t,q=k.useRef(null),ae=ct(q,{once:x.once,amount:x.amount}),[G,_]=k.useState(void 0),[b,B]=k.useState(void 0),[X,z]=k.useState(void 0),[C,A]=k.useState(void 0),[M,O]=k.useState(void 0),[K,Q]=k.useState(null),se=k.useMemo(()=>({top:u,bottom:h,left:i,right:c}),[u,h,i,c]),T=r-se.left-se.right,Z=a-se.top-se.bottom,ie=k.useMemo(()=>e.filter(U=>!je(U.size)).length===0?e:Nc(e.filter(U=>!je(U.size)),"radius","asc"),[e]),ue=k.useMemo(()=>e.filter(U=>U.size===void 0||U.size===null).length!==e.length?Qs().domain([0,je(j)?Math.max(...e.map(U=>U.size).filter(U=>U!=null)):j]).range([.25,w]).nice():void 0,[e,j,w]);k.useEffect(()=>{(()=>{const ve=[...ie];Qf(ve).force("y",ed(R=>Z/2).strength(1)).force("x",Jf(R=>T/2).strength(1)).force("collide",Uf(R=>ue?ue(R.size||0)+1:w+1)).force("charge",Zf().strength(-15)).alphaDecay(.05).tick(1e4).on("tick",()=>{Q(ve)}).on("end",()=>{Q(ve);const R=Fa(ve,te=>te.x-(ue?ue(te.size||0)+1:w+1))[0]||0,le=Fa(ve,te=>te.y-(ue?ue(te.size||0)+1:w+1))[0]||0,ee=Fa(ve,te=>te.x+(ue?ue(te.size||0)+1:w+1))[1]||0,de=Fa(ve,te=>te.y+(ue?ue(te.size||0)+1:w+1))[1]||0;z([R,le,R<0?ee-R:ee,le<0?de-le:de])})})()},[e,w,Z,T,j,ie,ue]);const he=k.useCallback((U,ve)=>{_(ve),O(U.clientY),A(U.clientX),g?.(ve)},[g]),Y=k.useCallback((U,ve)=>{_(ve),O(U.clientY),A(U.clientX)},[]),ge=k.useCallback(U=>{(I||P)&&(b===U.label&&S?(B(void 0),I?.(void 0)):(B(U.label),I?.(U)))},[I,P,b,S]),oe=k.useCallback(()=>{_(void 0),A(void 0),O(void 0),g?.(void 0)},[g]),ce=k.useCallback(U=>e.filter(ve=>ve.color).length===0?n[0]:U.color?n[o.indexOf(U.color)]:Pe.gray,[e,n,o]),N=k.useCallback(U=>s?U.color&&n[o.indexOf(U.color)]===s?1:$:m.length!==0?m.indexOf(U.label)!==-1?.85:$:.85,[s,$,n,o,m]);return K?X?l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{width:`${r}px`,height:`${a}px`,viewBox:`${X[0]>0?0:X[0]} ${X[1]>0?0:X[1]} ${r<X[2]?X[2]:r} ${a<X[3]?X[3]:a}`,direction:"ltr",ref:q,children:l.jsx("g",{transform:`translate(${se.left},${se.top})`,children:l.jsx(mt,{children:K.map(U=>{const ve=ce(U),J=N(U),R=ue?ue(U.size||0):w,le=R>20&&(f||p);return l.jsxs($e.g,{className:"undp-viz-g-with-hover",transform:`translate(${U.x},${U.y})`,onMouseEnter:ee=>he(ee,U),onMouseMove:ee=>Y(ee,U),onClick:()=>ge(U),onMouseLeave:oe,variants:{initial:{opacity:0},whileInView:{opacity:J,transition:{duration:x.duration}}},initial:"initial",animate:ae?"whileInView":"initial",children:[l.jsx($e.circle,{cx:0,cy:0,r:R,exit:{fill:ve,r:0,opacity:0,transition:{duration:x.duration}},variants:{initial:{fill:ve,r:0,opacity:0},whileInView:{fill:ve,r:R,opacity:1,transition:{duration:x.duration}}},initial:"initial",animate:ae?"whileInView":"initial"}),(le||p)&&U.size!==void 0&&U.size!==null&&l.jsx($e.g,{variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:x.duration}}},initial:"initial",animate:ae?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},children:l.jsx("foreignObject",{y:0-R,x:0-R,width:2*R,height:2*R,children:l.jsxs("div",{className:"flex flex-col justify-center items-center h-full py-0 px-3",children:[f&&l.jsx("p",{className:Ce.cn("text-center leading-[1.25] overflow-hidden m-0 circle-packing-label",D?.graphObjectValues),style:{fontSize:`${Math.min(Math.max(Math.round(R/4),12),Math.max(Math.round(R*12/`${U.label}`.length),12),14)}px`,WebkitLineClamp:R*2<60?1:R*2<75?2:R*2<100?3:void 0,display:"-webkit-box",WebkitBoxOrient:"vertical",color:yn(ve),hyphens:"auto",...W?.graphObjectValues||{}},children:U.label}),p&&l.jsx("p",{className:"text-center font-bold leading-[1.25] w-full m-0 circle-packing-value",style:{fontSize:`${Math.min(Math.max(Math.round(R/4),14),14)}px`,color:yn(ve)},children:qe(U.size,"NA",V,v,y)})]})})})]},U.label)})})})}),G&&d&&C&&M&&l.jsx(st,{data:G,body:d,xPos:C,yPos:M,backgroundStyle:W?.tooltip,className:D?.tooltip}),P&&b!==void 0?l.jsx(Ce.Modal,{open:b!==void 0,onClose:()=>{B(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof P=="string"?{__html:lt(P,b)}:void 0,children:typeof P=="function"?P(b):null})}):null]}):null:l.jsx("div",{style:{width:`${r}px`,height:`${a}px`},children:l.jsx("div",{className:"flex m-auto items-center justify-center p-0 leading-none text-base h-40",children:l.jsx(Ce.Spinner,{})})})});Gx.displayName="BubbleChart";function td(t){const{data:e,graphTitle:n,colors:i,suffix:r="",sources:a,prefix:o="",graphDescription:s,leftMargin:c=0,rightMargin:u=0,height:h,width:f,footNote:d,colorDomain:g,colorLegendTitle:p,padding:y,backgroundColor:v=!1,topMargin:m=0,bottomMargin:I=0,showLabels:j=!0,relativeHeight:w,tooltip:S,onSeriesMouseOver:P,showColorScale:W=!0,showValues:D,graphID:x,highlightedDataPoints:$=[],onSeriesMouseClick:V,graphDownload:q=!1,dataDownload:ae=!1,language:G="en",showNAColor:_,minHeight:b=0,theme:B="light",ariaLabel:X,radius:z,maxRadiusValue:C,resetSelectionOnDoubleClick:A=!0,detailsOnClick:M,styles:O,classNames:K,animate:Q=!1,dimmedOpacity:se=.3,precision:T=2}=t,[Z,ie]=k.useState(0),[ue,he]=k.useState(0),[Y,ge]=k.useState(void 0),oe=k.useRef(null),ce=k.useRef(null);return k.useEffect(()=>{const N=new ResizeObserver(U=>{ie(f||U[0].target.clientWidth||620),he(h||U[0].target.clientHeight||480)});return oe.current&&(he(oe.current.clientHeight||480),ie(oe.current.clientWidth||620),f||N.observe(oe.current)),()=>N.disconnect()},[f,h]),l.jsx("div",{className:`${B||"light"} flex ${f?"w-fit grow-0":"w-full grow"}`,dir:G==="he"||G==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${v?v===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${G||"en"}`,K?.graphContainer),style:{...O?.graphContainer||{},...v&&v!==!0?{backgroundColor:v}:{}},id:x,ref:ce,"aria-label":X||`${n?`The graph shows ${n}. `:""}This is a chart where data points are represented by circles, and their sizes reflect their values.${s?` ${s}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:v?y||"1rem":y||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||s||q||ae?l.jsx(Qe,{styles:{title:O?.title,description:O?.description},classNames:{title:K?.title,description:K?.description},graphTitle:n,graphDescription:s,width:f,graphDownload:q?ce.current:void 0,dataDownload:ae?e.map(N=>N.data).filter(N=>N!==void 0).length>0?e.map(N=>N.data).filter(N=>N!==void 0):e.filter(N=>N!==void 0):null}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[W&&e.filter(N=>N.color).length!==0?l.jsx(tn,{width:f,colorLegendTitle:p,colors:i||Pe[B].categoricalColors.colors,colorDomain:g||Xe(e.filter(N=>N.color),"color").map(N=>N.color),setSelectedColor:ge,showNAColor:_??!0,isCenter:!0}):null,l.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:oe,"aria-label":"Graph area",children:(f||Z)&&(h||ue)?l.jsx(Gx,{data:e,colors:e.filter(N=>N.color).length===0?i?[i]:[Pe.primaryColors["blue-600"]]:i||Pe[B].categoricalColors.colors,colorDomain:e.filter(N=>N.color).length===0?[]:g||Xe(e.filter(N=>N.color),"color").map(N=>N.color),width:f||Z,height:Math.max(b,h||(w?b?(f||Z)*w>b?(f||Z)*w:b:(f||Z)*w:ue)),leftMargin:c,rightMargin:u,topMargin:m,bottomMargin:I,showLabels:j,showValues:D!==!1?e.filter(N=>N.size).length!==0:D,selectedColor:Y,suffix:r,prefix:o,tooltip:S,onSeriesMouseOver:P,highlightedDataPoints:$,onSeriesMouseClick:V,theme:B,radius:z||Math.min(f||Z,h||(w?b?(f||Z)*w>b?(f||Z)*w:b:(f||Z)*w:ue))*(e.filter(N=>!je(N.size)).length===0?1:Math.max(...e.map(N=>N.size).filter(N=>N!=null)))/(e.filter(N=>!je(N.size)).length===0?e.length:rt(e.filter(N=>N.size).map(N=>N.size))*1.25),maxRadiusValue:C,resetSelectionOnDoubleClick:A,detailsOnClick:M,styles:O,classNames:K,animate:Q===!0?{duration:.5,once:!0,amount:.5}:Q||{duration:0,once:!0,amount:0},dimmedOpacity:se,precision:T}):null})]})}),a||d?l.jsx(et,{styles:{footnote:O?.footnote,source:O?.source},classNames:{footnote:K?.footnote,source:K?.source},sources:a,footNote:d,width:f}):null]})})})})}function ht(t){return function(){return t}}const dm=Math.abs,Cn=Math.atan2,$a=Math.cos,X_=Math.max,Du=Math.min,Ki=Math.sin,ko=Math.sqrt,Zn=1e-12,Ws=Math.PI,hc=Ws/2,El=2*Ws;function K_(t){return t>1?0:t<-1?Ws:Math.acos(t)}function gm(t){return t>=1?hc:t<=-1?-hc:Math.asin(t)}const wh=Math.PI,bh=2*wh,Ea=1e-6,Q_=bh-Ea;function Yx(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function Z_(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Yx;const n=10**e;return function(i){this._+=i[0];for(let r=1,a=i.length;r<a;++r)this._+=Math.round(arguments[r]*n)/n+i[r]}}let J_=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?Yx:Z_(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,i,r){this._append`Q${+e},${+n},${this._x1=+i},${this._y1=+r}`}bezierCurveTo(e,n,i,r,a,o){this._append`C${+e},${+n},${+i},${+r},${this._x1=+a},${this._y1=+o}`}arcTo(e,n,i,r,a){if(e=+e,n=+n,i=+i,r=+r,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,s=this._y1,c=i-e,u=r-n,h=o-e,f=s-n,d=h*h+f*f;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(d>Ea)if(!(Math.abs(f*c-u*h)>Ea)||!a)this._append`L${this._x1=e},${this._y1=n}`;else{let g=i-o,p=r-s,y=c*c+u*u,v=g*g+p*p,m=Math.sqrt(y),I=Math.sqrt(d),j=a*Math.tan((wh-Math.acos((y+d-v)/(2*m*I)))/2),w=j/I,S=j/m;Math.abs(w-1)>Ea&&this._append`L${e+w*h},${n+w*f}`,this._append`A${a},${a},0,0,${+(f*g>h*p)},${this._x1=e+S*c},${this._y1=n+S*u}`}}arc(e,n,i,r,a,o){if(e=+e,n=+n,i=+i,o=!!o,i<0)throw new Error(`negative radius: ${i}`);let s=i*Math.cos(r),c=i*Math.sin(r),u=e+s,h=n+c,f=1^o,d=o?r-a:a-r;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>Ea||Math.abs(this._y1-h)>Ea)&&this._append`L${u},${h}`,i&&(d<0&&(d=d%bh+bh),d>Q_?this._append`A${i},${i},0,1,${f},${e-s},${n-c}A${i},${i},0,1,${f},${this._x1=u},${this._y1=h}`:d>Ea&&this._append`A${i},${i},0,${+(d>=wh)},${f},${this._x1=e+i*Math.cos(a)},${this._y1=n+i*Math.sin(a)}`)}rect(e,n,i,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}};function nd(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);e=i}return t},()=>new J_(e)}function eO(t){return t.innerRadius}function tO(t){return t.outerRadius}function nO(t){return t.startAngle}function iO(t){return t.endAngle}function rO(t){return t&&t.padAngle}function aO(t,e,n,i,r,a,o,s){var c=n-t,u=i-e,h=o-r,f=s-a,d=f*c-h*u;if(!(d*d<Zn))return d=(h*(e-a)-f*(t-r))/d,[t+d*c,e+d*u]}function Sl(t,e,n,i,r,a,o){var s=t-n,c=e-i,u=(o?a:-a)/ko(s*s+c*c),h=u*c,f=-u*s,d=t+h,g=e+f,p=n+h,y=i+f,v=(d+p)/2,m=(g+y)/2,I=p-d,j=y-g,w=I*I+j*j,S=r-a,P=d*y-p*g,W=(j<0?-1:1)*ko(X_(0,S*S*w-P*P)),D=(P*j-I*W)/w,x=(-P*I-j*W)/w,$=(P*j+I*W)/w,V=(-P*I+j*W)/w,q=D-v,ae=x-m,G=$-v,_=V-m;return q*q+ae*ae>G*G+_*_&&(D=$,x=V),{cx:D,cy:x,x01:-h,y01:-f,x11:D*(r/S-1),y11:x*(r/S-1)}}function oO(){var t=eO,e=tO,n=ht(0),i=null,r=nO,a=iO,o=rO,s=null,c=nd(u);function u(){var h,f,d=+t.apply(this,arguments),g=+e.apply(this,arguments),p=r.apply(this,arguments)-hc,y=a.apply(this,arguments)-hc,v=dm(y-p),m=y>p;if(s||(s=h=c()),g<d&&(f=g,g=d,d=f),!(g>Zn))s.moveTo(0,0);else if(v>El-Zn)s.moveTo(g*$a(p),g*Ki(p)),s.arc(0,0,g,p,y,!m),d>Zn&&(s.moveTo(d*$a(y),d*Ki(y)),s.arc(0,0,d,y,p,m));else{var I=p,j=y,w=p,S=y,P=v,W=v,D=o.apply(this,arguments)/2,x=D>Zn&&(i?+i.apply(this,arguments):ko(d*d+g*g)),$=Du(dm(g-d)/2,+n.apply(this,arguments)),V=$,q=$,ae,G;if(x>Zn){var _=gm(x/d*Ki(D)),b=gm(x/g*Ki(D));(P-=_*2)>Zn?(_*=m?1:-1,w+=_,S-=_):(P=0,w=S=(p+y)/2),(W-=b*2)>Zn?(b*=m?1:-1,I+=b,j-=b):(W=0,I=j=(p+y)/2)}var B=g*$a(I),X=g*Ki(I),z=d*$a(S),C=d*Ki(S);if($>Zn){var A=g*$a(j),M=g*Ki(j),O=d*$a(w),K=d*Ki(w),Q;if(v<Ws)if(Q=aO(B,X,O,K,A,M,z,C)){var se=B-Q[0],T=X-Q[1],Z=A-Q[0],ie=M-Q[1],ue=1/Ki(K_((se*Z+T*ie)/(ko(se*se+T*T)*ko(Z*Z+ie*ie)))/2),he=ko(Q[0]*Q[0]+Q[1]*Q[1]);V=Du($,(d-he)/(ue-1)),q=Du($,(g-he)/(ue+1))}else V=q=0}W>Zn?q>Zn?(ae=Sl(O,K,B,X,g,q,m),G=Sl(A,M,z,C,g,q,m),s.moveTo(ae.cx+ae.x01,ae.cy+ae.y01),q<$?s.arc(ae.cx,ae.cy,q,Cn(ae.y01,ae.x01),Cn(G.y01,G.x01),!m):(s.arc(ae.cx,ae.cy,q,Cn(ae.y01,ae.x01),Cn(ae.y11,ae.x11),!m),s.arc(0,0,g,Cn(ae.cy+ae.y11,ae.cx+ae.x11),Cn(G.cy+G.y11,G.cx+G.x11),!m),s.arc(G.cx,G.cy,q,Cn(G.y11,G.x11),Cn(G.y01,G.x01),!m))):(s.moveTo(B,X),s.arc(0,0,g,I,j,!m)):s.moveTo(B,X),!(d>Zn)||!(P>Zn)?s.lineTo(z,C):V>Zn?(ae=Sl(z,C,A,M,d,-V,m),G=Sl(B,X,O,K,d,-V,m),s.lineTo(ae.cx+ae.x01,ae.cy+ae.y01),V<$?s.arc(ae.cx,ae.cy,V,Cn(ae.y01,ae.x01),Cn(G.y01,G.x01),!m):(s.arc(ae.cx,ae.cy,V,Cn(ae.y01,ae.x01),Cn(ae.y11,ae.x11),!m),s.arc(0,0,d,Cn(ae.cy+ae.y11,ae.cx+ae.x11),Cn(G.cy+G.y11,G.cx+G.x11),m),s.arc(G.cx,G.cy,V,Cn(G.y11,G.x11),Cn(G.y01,G.x01),!m))):s.arc(0,0,d,S,w,m)}if(s.closePath(),h)return s=null,h+""||null}return u.centroid=function(){var h=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,f=(+r.apply(this,arguments)+ +a.apply(this,arguments))/2-Ws/2;return[$a(f)*h,Ki(f)*h]},u.innerRadius=function(h){return arguments.length?(t=typeof h=="function"?h:ht(+h),u):t},u.outerRadius=function(h){return arguments.length?(e=typeof h=="function"?h:ht(+h),u):e},u.cornerRadius=function(h){return arguments.length?(n=typeof h=="function"?h:ht(+h),u):n},u.padRadius=function(h){return arguments.length?(i=h==null?null:typeof h=="function"?h:ht(+h),u):i},u.startAngle=function(h){return arguments.length?(r=typeof h=="function"?h:ht(+h),u):r},u.endAngle=function(h){return arguments.length?(a=typeof h=="function"?h:ht(+h),u):a},u.padAngle=function(h){return arguments.length?(o=typeof h=="function"?h:ht(+h),u):o},u.context=function(h){return arguments.length?(s=h??null,u):s},u}function id(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function qx(t){this._context=t}qx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function Oi(t){return new qx(t)}function Ux(t){return t[0]}function Xx(t){return t[1]}function ii(t,e){var n=ht(!0),i=null,r=Oi,a=null,o=nd(s);t=typeof t=="function"?t:t===void 0?Ux:ht(t),e=typeof e=="function"?e:e===void 0?Xx:ht(e);function s(c){var u,h=(c=id(c)).length,f,d=!1,g;for(i==null&&(a=r(g=o())),u=0;u<=h;++u)!(u<h&&n(f=c[u],u,c))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+t(f,u,c),+e(f,u,c));if(g)return a=null,g+""||null}return s.x=function(c){return arguments.length?(t=typeof c=="function"?c:ht(+c),s):t},s.y=function(c){return arguments.length?(e=typeof c=="function"?c:ht(+c),s):e},s.defined=function(c){return arguments.length?(n=typeof c=="function"?c:ht(!!c),s):n},s.curve=function(c){return arguments.length?(r=c,i!=null&&(a=r(i)),s):r},s.context=function(c){return arguments.length?(c==null?i=a=null:a=r(i=c),s):i},s}function No(t,e,n){var i=null,r=ht(!0),a=null,o=Oi,s=null,c=nd(u);t=typeof t=="function"?t:t===void 0?Ux:ht(+t),e=typeof e=="function"?e:ht(e===void 0?0:+e),n=typeof n=="function"?n:n===void 0?Xx:ht(+n);function u(f){var d,g,p,y=(f=id(f)).length,v,m=!1,I,j=new Array(y),w=new Array(y);for(a==null&&(s=o(I=c())),d=0;d<=y;++d){if(!(d<y&&r(v=f[d],d,f))===m)if(m=!m)g=d,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),p=d-1;p>=g;--p)s.point(j[p],w[p]);s.lineEnd(),s.areaEnd()}m&&(j[d]=+t(v,d,f),w[d]=+e(v,d,f),s.point(i?+i(v,d,f):j[d],n?+n(v,d,f):w[d]))}if(I)return s=null,I+""||null}function h(){return ii().defined(r).curve(o).context(a)}return u.x=function(f){return arguments.length?(t=typeof f=="function"?f:ht(+f),i=null,u):t},u.x0=function(f){return arguments.length?(t=typeof f=="function"?f:ht(+f),u):t},u.x1=function(f){return arguments.length?(i=f==null?null:typeof f=="function"?f:ht(+f),u):i},u.y=function(f){return arguments.length?(e=typeof f=="function"?f:ht(+f),n=null,u):e},u.y0=function(f){return arguments.length?(e=typeof f=="function"?f:ht(+f),u):e},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ht(+f),u):n},u.lineX0=u.lineY0=function(){return h().x(t).y(e)},u.lineY1=function(){return h().x(t).y(n)},u.lineX1=function(){return h().x(i).y(e)},u.defined=function(f){return arguments.length?(r=typeof f=="function"?f:ht(!!f),u):r},u.curve=function(f){return arguments.length?(o=f,a!=null&&(s=o(a)),u):o},u.context=function(f){return arguments.length?(f==null?a=s=null:s=o(a=f),u):a},u}function sO(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function lO(t){return t}function cO(){var t=lO,e=sO,n=null,i=ht(0),r=ht(El),a=ht(0);function o(s){var c,u=(s=id(s)).length,h,f,d=0,g=new Array(u),p=new Array(u),y=+i.apply(this,arguments),v=Math.min(El,Math.max(-El,r.apply(this,arguments)-y)),m,I=Math.min(Math.abs(v)/u,a.apply(this,arguments)),j=I*(v<0?-1:1),w;for(c=0;c<u;++c)(w=p[g[c]=c]=+t(s[c],c,s))>0&&(d+=w);for(e!=null?g.sort(function(S,P){return e(p[S],p[P])}):n!=null&&g.sort(function(S,P){return n(s[S],s[P])}),c=0,f=d?(v-u*j)/d:0;c<u;++c,y=m)h=g[c],w=p[h],m=y+(w>0?w*f:0)+j,p[h]={data:s[h],index:c,value:w,startAngle:y,endAngle:m,padAngle:I};return p}return o.value=function(s){return arguments.length?(t=typeof s=="function"?s:ht(+s),o):t},o.sortValues=function(s){return arguments.length?(e=s,n=null,o):e},o.sort=function(s){return arguments.length?(n=s,e=null,o):n},o.startAngle=function(s){return arguments.length?(i=typeof s=="function"?s:ht(+s),o):i},o.endAngle=function(s){return arguments.length?(r=typeof s=="function"?s:ht(+s),o):r},o.padAngle=function(s){return arguments.length?(a=typeof s=="function"?s:ht(+s),o):a},o}var uO=Qx(Oi);function Kx(t){this._curve=t}Kx.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};function Qx(t){function e(n){return new Kx(t(n))}return e._curve=t,e}function hO(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(n){return arguments.length?e(Qx(n)):e()._curve},t}function fO(){return hO(ii().curve(uO))}function fc(){}function Ch(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Zx(t,e){this._context=t,this._k=(1-e)/6}Zx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Ch(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Ch(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(i){return new Zx(i,e)}return n.tension=function(i){return t(+i)},n})(0);function Jx(t,e){this._context=t,this._k=(1-e)/6}Jx.prototype={areaStart:fc,areaEnd:fc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Ch(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const dO=function t(e){function n(i){return new Jx(i,e)}return n.tension=function(i){return t(+i)},n}(0);function ev(t){this._context=t}ev.prototype={areaStart:fc,areaEnd:fc,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function gO(t){return new ev(t)}function pm(t){return t<0?-1:1}function mm(t,e,n){var i=t._x1-t._x0,r=e-t._x1,a=(t._y1-t._y0)/(i||r<0&&-0),o=(n-t._y1)/(r||i<0&&-0),s=(a*r+o*i)/(i+r);return(pm(a)+pm(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function ym(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Mu(t,e,n){var i=t._x0,r=t._y0,a=t._x1,o=t._y1,s=(a-i)/3;t._context.bezierCurveTo(i+s,r+s*e,a-s,o-s*n,a,o)}function dc(t){this._context=t}dc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Mu(this,this._t0,ym(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Mu(this,ym(this,n=mm(this,t,e)),n);break;default:Mu(this,this._t0,n=mm(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};Object.create(dc.prototype).point=function(t,e){dc.prototype.point.call(this,e,t)};function _r(t){return new dc(t)}function Ic(t,e){this._context=t,this._t=e}Ic.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function Or(t){return new Ic(t,.5)}function Nr(t){return new Ic(t,0)}function Ir(t){return new Ic(t,1)}function pO(t){const{mainText:e,data:n,radius:i,colors:r,subNote:a,strokeWidth:o,tooltip:s,onSeriesMouseOver:c,onSeriesMouseClick:u,colorDomain:h,resetSelectionOnDoubleClick:f,detailsOnClick:d,styles:g,classNames:p,precision:y}=t,v=cO().sort(null).startAngle(0).value(x=>x.size),[m,I]=k.useState(void 0),[j,w]=k.useState(void 0),[S,P]=k.useState(void 0),[W,D]=k.useState(void 0);return l.jsxs(l.Fragment,{children:[l.jsx("svg",{width:`${i*2}px`,height:`${i*2}px`,viewBox:`0 0 ${i*2} ${i*2}`,direction:"ltr",children:l.jsxs("g",{transform:`translate(${i} ${i})`,children:[e||a?l.jsx("foreignObject",{y:0-(i-o),x:0-(i-o),width:2*(i-o),height:2*(i-o),children:l.jsxs("div",{className:"flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-4",children:[e?l.jsx(Ce.H2,{marginBottom:"none",className:"donut-main-text text-primary-gray-700 dark:text-primary-gray-100 leading-none text-center",children:typeof e=="string"?e:n.findIndex(x=>x.label===e.label)!==-1?qe(n[n.findIndex(x=>x.label===e.label)].size,"NA",y,e.prefix,e.suffix):"NA"}):null,a?l.jsx(Ce.P,{marginBottom:"none",size:"base",leading:"none",className:"donut-sub-note text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold",children:a}):typeof e=="string"||!e?null:l.jsx(Ce.P,{size:"base",marginBottom:"none",leading:"none",className:"donut-label text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold",children:e.label})]})}):null,v(n).map((x,$)=>l.jsx("path",{d:oO()({innerRadius:i-o,outerRadius:i,startAngle:x.startAngle,endAngle:x.endAngle}),style:{fill:h.indexOf(x.data.label)!==-1?r[h.indexOf(x.data.label)%r.length]:Pe.gray,opacity:m?m.label===x.data.label?1:.3:1},onMouseEnter:V=>{I(x.data),D(V.clientY),P(V.clientX),c?.(x)},onClick:()=>{(u||d)&&(dt(j,x.data)&&f?(w(void 0),u?.(void 0)):(w(x.data),u&&u(x.data)))},onMouseMove:V=>{I(x.data),D(V.clientY),P(V.clientX)},onMouseLeave:()=>{I(void 0),P(void 0),D(void 0),c?.(void 0)}},$))]})}),m&&s&&S&&W?l.jsx(st,{data:m,body:s,xPos:S,yPos:W,backgroundStyle:g?.tooltip,className:p?.tooltip}):null,d&&j!==void 0?l.jsx(Ce.Modal,{open:j!==void 0,onClose:()=>{w(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof d=="string"?{__html:lt(d,j)}:void 0,children:typeof d=="function"?d(j):null})}):null]})}function rd(t){const{mainText:e,graphTitle:n,colors:i=Pe.light.categoricalColors.colors,suffix:r="",sources:a,prefix:o="",strokeWidth:s=50,graphDescription:c,subNote:u,footNote:h,radius:f,data:d,showColorScale:g=!0,padding:p,backgroundColor:y=!1,tooltip:v,onSeriesMouseOver:m,graphID:I,onSeriesMouseClick:j,topMargin:w=0,bottomMargin:S=0,graphDownload:P=!1,dataDownload:W=!1,colorDomain:D,sortData:x,language:$="en",theme:V="light",width:q,height:ae,minHeight:G=0,relativeHeight:_,ariaLabel:b,resetSelectionOnDoubleClick:B=!0,colorScaleMaxWidth:X,detailsOnClick:z,styles:C,classNames:A,precision:M=2}=t,[O,K]=k.useState(0),[Q,se]=k.useState(0),[T,Z]=k.useState(0),ie=k.useRef(null),ue=k.useRef(null);k.useEffect(()=>{const Y=new ResizeObserver(ge=>{se(q||ge[0].target.clientWidth||420),Z(ae||ge[0].target.clientHeight||420),K((Math.min(q||ge[0].target.clientWidth||620,ae||ge[0].target.clientHeight||480)||420)/2)});return ie.current&&(Z(ie.current.clientHeight||420),se(ie.current.clientWidth||420),K((Math.min(ie.current.clientWidth,ie.current.clientHeight)||420)/2),(!q||!f)&&Y.observe(ie.current)),()=>Y.disconnect()},[q,ae,f]);const he=x==="asc"?tt(d,Y=>Y.size):x==="desc"?tt(d,Y=>Y.size).reverse():d;return l.jsx("div",{className:`${V||"light"} flex ${q?"w-fit grow-0":"w-full grow"}`,dir:$==="he"||$==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${y?y===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${$||"en"}`,A?.graphContainer),style:{...C?.graphContainer||{},minHeight:"inherit",...y&&y!==!0?{backgroundColor:y}:{}},id:I,ref:ue,"aria-label":b||`${n?`The graph shows ${n}. `:""}This is a donut or pie chart chart. ${c?` ${c}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:y?p||"1rem":p||0},children:l.jsxs("div",{className:"flex flex-col gap-2 w-full grow justify-between",children:[n||c||P||W?l.jsx(Qe,{styles:{title:C?.title,description:C?.description},classNames:{title:A?.title,description:A?.description},graphTitle:n,graphDescription:c,width:q,graphDownload:P?ue.current:void 0,dataDownload:W?d.map(Y=>Y.data).filter(Y=>Y!==void 0).length>0?d.map(Y=>Y.data).filter(Y=>Y!==void 0):d.filter(Y=>Y!==void 0):null}):null,l.jsx("div",{className:"flex grow flex-col justify-center items-stretch gap-8 flex-wrap",style:{width:q?`${q}px`:"100%",padding:`${w}px 0 ${S}px 0`},children:d.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[g?l.jsx("div",{className:"leading-0","aria-label":"Color legend",children:l.jsx("div",{className:"flex mb-0 ml-auto mr-auto justify-center gap-3.5 flex-wrap",style:{maxWidth:X},children:he.map((Y,ge)=>l.jsxs("div",{className:"flex gap-2 items-center",children:[l.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:(D||he.map(oe=>oe.label)).indexOf(Y.label)!==-1?(i||Pe[V].categoricalColors.colors)[(D||he.map(oe=>oe.label)).indexOf(Y.label)%(i||Pe[V].categoricalColors.colors).length]:Pe.gray}}),l.jsxs(Ce.P,{marginBottom:"none",size:"sm",className:"text-primary-gray-700 dark:text-primary-gray-100",children:[Y.label,":"," ",l.jsx("span",{className:"font-bold",style:{fontSize:"inherit"},children:qe(Y.size,"NA",M,o,r)})]})]},ge))})}):null,l.jsx("div",{className:`flex ${q?"grow-0":"grow"} items-center justify-center leading-0`,style:{width:q?`${q}px`:"100%",height:ae?`${Math.max(G,ae||(_?G?(q||Q)*_>G?(q||Q)*_:G:(q||Q)*_:T))}px`:"auto"},ref:ie,"aria-label":"Graph area",children:l.jsx("div",{className:"w-full flex justify-center leading-0",children:f||O?l.jsx(pO,{mainText:e,data:x==="asc"?tt(d,Y=>Y.size):x==="desc"?tt(d,Y=>Y.size).reverse():d,colors:i,radius:f||O,subNote:u,strokeWidth:s,tooltip:v,colorDomain:D||he.map(Y=>Y.label),onSeriesMouseOver:m,onSeriesMouseClick:j,resetSelectionOnDoubleClick:B,styles:C,detailsOnClick:z,precision:M}):null})})]})}),a||h?l.jsx(et,{styles:{footnote:C?.footnote,source:C?.source},classNames:{footnote:A?.footnote,source:A?.source},sources:a,footNote:h,width:q}):l.jsx("div",{})]})})})})}function mO(t){const{data:e,dotColors:n,suffix:i,prefix:r,barPadding:a,showValues:o,showTicks:s,leftMargin:c,truncateBy:u,width:h,height:f,rightMargin:d,topMargin:g,bottomMargin:p,radius:y,showLabels:v,tooltip:m,onSeriesMouseOver:I,maxValue:j,minValue:w,onSeriesMouseClick:S,selectedColor:P,arrowConnector:W,connectorStrokeWidth:D,maxBarThickness:x,minBarThickness:$,resetSelectionOnDoubleClick:V,detailsOnClick:q,axisTitle:ae,noOfTicks:G,valueColor:_,styles:b,classNames:B,labelOrder:X,refValues:z,rtl:C,animate:A,precision:M,customLayers:O,highlightedDataPoints:K,dimmedOpacity:Q}=t,se=k.useRef(null),T=ct(se,{once:A.once,amount:A.amount}),Z={top:ae?g+25:g,bottom:p,left:c,right:d},ie=h-Z.left-Z.right,ue=f-Z.top-Z.bottom,[he,Y]=k.useState(void 0),[ge,oe]=k.useState(void 0),[ce,N]=k.useState(void 0),[U,ve]=k.useState(void 0),J=e.map((te,Me)=>({...te,id:X?`${te.label}`:`${Me}`})),R=X||J.map(te=>`${te.id}`),le=ut().domain([w,j]).range([0,ie]).nice(),ee=xn().domain(R).range([0,$?Math.max(ue,$*J.length):x?Math.min(ue,x*J.length):ue]).paddingInner(a),de=le.ticks(G);return l.jsxs(l.Fragment,{children:[l.jsxs($e.svg,{width:`${h}px`,height:`${f}px`,viewBox:`0 0 ${h} ${f}`,direction:"ltr",ref:se,children:[W?l.jsx("defs",{children:l.jsx("marker",{id:"arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:l.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-primary-gray-600 dark:fill-primary-gray-300"})})}):null,l.jsxs("g",{transform:`translate(${Z.left},${Z.top})`,children:[s?l.jsx(Rn,{values:de.filter((te,Me)=>Me!==0),x:de.filter((te,Me)=>Me!==0).map(te=>le(te)),y1:0-g,y2:ue+Z.bottom,styles:{gridLines:b?.xAxis?.gridLines,labels:b?.xAxis?.labels},classNames:{gridLines:B?.xAxis?.gridLines,labels:B?.xAxis?.labels},suffix:i,prefix:r,labelType:"secondary",showGridLines:!0,precision:M}):null,l.jsx(Nt,{x:ie/2,y:0-Z.top+15,style:b?.xAxis?.title,className:B?.xAxis?.title,text:ae}),l.jsx(ri,{y:J.map(te=>ee(`${te.id}`)+ee.bandwidth()/2),x1:0,x2:ie,styles:{gridLines:b?.yAxis?.gridLines},classNames:{gridLines:B?.yAxis?.gridLines},labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:M}),O.filter(te=>te.position==="before").map(te=>te.layer),l.jsxs(mt,{children:[J.map(te=>l.jsxs($e.g,{className:"undp-viz-g-with-hover",variants:{initial:{x:0,y:ee(`${te.id}`)+ee.bandwidth()/2,opacity:K.length!==0?K.indexOf(te.label)!==-1?.85:Q:.85},whileInView:{x:0,y:ee(`${te.id}`)+ee.bandwidth()/2,opacity:K.length!==0?K.indexOf(te.label)!==-1?.85:Q:.85,transition:{duration:A.duration}}},initial:"initial",animate:T?"whileInView":"initial",exit:{opacity:0,transition:{duration:A.duration}},children:[v?l.jsx(io,{value:`${te.label}`.length<u?`${te.label}`:`${`${te.label}`.substring(0,u)}...`,y:0-ee.bandwidth()/2,x:0-Z.left,width:Z.left,height:ee.bandwidth(),alignment:"right",style:b?.yAxis?.labels,className:B?.yAxis?.labels,animate:A,isInView:T}):null,l.jsx($e.line,{y1:0,y2:0,style:{strokeWidth:D,...b?.dataConnectors||{},opacity:P?.3:1},className:Ce.cn("stroke-primary-gray-600 dark:stroke-primary-gray-300",B?.dataConnectors),markerEnd:W&&te.x.indexOf(Math.min(...te.x.filter(Me=>Me!==null)))===0?"url(#arrow)":"",markerStart:W&&te.x.indexOf(Math.min(...te.x.filter(Me=>Me!==null)))===te.x.length-1?"url(#arrow)":"",exit:{opacity:0,transition:{duration:A.duration}},variants:{initial:{x1:0,x2:0},whileInView:{x1:le(Math.min(...te.x.filter(Me=>Me!==null)))+y,x2:le(Math.max(...te.x.filter(Me=>Me!==null)))-y,transition:{duration:A.duration}}},initial:"initial",animate:T?"whileInView":"initial"}),te.x.map((Me,be)=>l.jsx($e.g,{onMouseEnter:ne=>{Y({...te,xIndex:be}),ve(ne.clientY),N(ne.clientX),I?.({...te,xIndex:be})},onClick:()=>{(S||q)&&(dt(ge,{...te,xIndex:be})&&V?(oe(void 0),S?.(void 0)):(oe({...te,xIndex:be}),S&&S({...te,xIndex:be})))},onMouseMove:ne=>{Y({...te,xIndex:be}),ve(ne.clientY),N(ne.clientX)},onMouseLeave:()=>{Y(void 0),N(void 0),ve(void 0),I?.(void 0)},exit:{opacity:0,transition:{duration:A.duration}},variants:{initial:{opacity:P?n[be]===P?1:.3:1},whileInView:{opacity:P?n[be]===P?1:.3:1,transition:{duration:A.duration}}},initial:"initial",animate:T?"whileInView":"initial",children:je(Me)?null:l.jsxs(l.Fragment,{children:[l.jsx($e.circle,{cy:0,r:y,style:{fill:n[be],fillOpacity:.85,stroke:n[be],strokeWidth:1,opacity:je(Me)?0:1},exit:{opacity:0,transition:{duration:A.duration}},variants:{initial:{cx:le(0),opacity:0},whileInView:{cx:le(Me||0),opacity:je(Me)?0:1,transition:{duration:A.duration}}},initial:"initial",animate:T?"whileInView":"initial"}),o?l.jsx($e.text,{y:0,style:{fill:_||n[be],textAnchor:"middle",...b?.graphObjectValues||{}},dx:0,dy:0-y-3,className:Ce.cn("graph-value text-sm font-bold",je(Me)?"0opacity-0":"opacity-100",B?.graphObjectValues),exit:{opacity:0,transition:{duration:A.duration}},variants:{initial:{x:le(0),opacity:0},whileInView:{x:le(Me||0),opacity:1,transition:{duration:A.duration}}},initial:"initial",animate:T?"whileInView":"initial",children:qe(Me,"NA",M,r,i)}):null]})},be))]},te.label)),z?l.jsx(l.Fragment,{children:z.map((te,Me)=>l.jsx(Tr,{text:te.text,color:te.color,x:le(te.value),y1:0-Z.top,y2:ue+Z.bottom,textSide:le(te.value)>ie*.75||C?"left":"right",classNames:te.classNames,styles:te.styles,animate:A,isInView:T},Me))}):null]}),O.filter(te=>te.position==="after").map(te=>te.layer)]})]}),he&&m&&ce&&U?l.jsx(st,{data:he,body:m,xPos:ce,yPos:U,backgroundStyle:b?.tooltip,className:B?.tooltip}):null,q&&ge!==void 0?l.jsx(Ce.Modal,{open:ge!==void 0,onClose:()=>{oe(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof q=="string"?{__html:lt(q,ge)}:void 0,children:typeof q=="function"?q(ge):null})}):null]})}function yO(t){const{data:e,graphTitle:n,colors:i=Pe.light.categoricalColors.colors,sources:r,graphDescription:a,barPadding:o=.25,showTicks:s=!0,leftMargin:c=100,rightMargin:u=40,topMargin:h=20,bottomMargin:f=10,truncateBy:d=999,height:g,width:p,footNote:y,colorDomain:v,colorLegendTitle:m,padding:I,backgroundColor:j=!1,radius:w=3,showLabels:S=!0,tooltip:P,relativeHeight:W,onSeriesMouseOver:D,graphID:x,suffix:$="",prefix:V="",maxValue:q,minValue:ae,onSeriesMouseClick:G,graphDownload:_=!1,dataDownload:b=!1,showValues:B=!0,sortParameter:X,arrowConnector:z=!1,connectorStrokeWidth:C=2,language:A="en",minHeight:M=0,theme:O="light",labelOrder:K,maxBarThickness:Q,maxNumberOfBars:se,minBarThickness:T,ariaLabel:Z,resetSelectionOnDoubleClick:ie=!0,detailsOnClick:ue,axisTitle:he,noOfTicks:Y=5,valueColor:ge,styles:oe,classNames:ce,refValues:N,filterNA:U=!0,animate:ve=!1,precision:J=2,customLayers:R=[],showColorScale:le=!0,highlightedDataPoints:ee=[],dimmedOpacity:de=.3,timeline:te={enabled:!1,autoplay:!1,showOnlyActiveDate:!0}}=t,[Me,be]=k.useState(0),[ne,De]=k.useState(0),[xe,Ae]=k.useState(te.autoplay),ke=di(Xe(e.filter(Oe=>Oe.date!==void 0&&Oe.date!==null),Oe=>Oe.date).map(Oe=>ze(`${Oe.date}`,te.dateFormat||"yyyy",new Date).getTime()),(Oe,Ee)=>an(Oe,Ee)),[me,Se]=k.useState(te.autoplay?0:ke.length-1),[Le,F]=k.useState(void 0),Ie=k.useRef(null),Ve=k.useRef(null);k.useEffect(()=>{const Oe=new ResizeObserver(Ee=>{be(p||Ee[0].target.clientWidth||620),De(g||Ee[0].target.clientHeight||480)});return Ie.current&&(De(Ie.current.clientHeight||480),be(Ie.current.clientWidth||620),p||Oe.observe(Ie.current)),()=>Oe.disconnect()},[p,g]),k.useEffect(()=>{const Oe=setInterval(()=>{Se(Ee=>Ee<ke.length-1?Ee+1:0)},(te.speed||2)*1e3);return xe||clearInterval(Oe),()=>clearInterval(Oe)},[ke,xe,te.speed]);const H=yi(ke,me,te.showOnlyActiveDate,te.dateFormat||"yyyy");return l.jsx("div",{className:`${O||"light"} flex ${p?"w-fit grow-0":"w-full grow"}`,dir:A==="he"||A==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${j?j===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${A||"en"}`,ce?.graphContainer),style:{...oe?.graphContainer||{},...j&&j!==!0?{backgroundColor:j}:{}},id:x,ref:Ve,"aria-label":Z||`${n?`The graph shows ${n}. `:""}This is a dumbbell chart that shows comparisons between two or more data points across categories. ${a?` ${a}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:j?I||"1rem":I||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||a||_||b?l.jsx(Qe,{styles:{title:oe?.title,description:oe?.description},classNames:{title:ce?.title,description:ce?.description},graphTitle:n,graphDescription:a,width:p,graphDownload:_?Ve.current:void 0,dataDownload:b?e.map(Oe=>Oe.data).filter(Oe=>Oe!==void 0).length>0?e.map(Oe=>Oe.data).filter(Oe=>Oe!==void 0):e.filter(Oe=>Oe!==void 0):null}):null,te.enabled&&ke.length>0&&H?l.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[l.jsx("button",{type:"button",onClick:()=>{Ae(!xe)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":xe?"Click to pause animation":"Click to play animation",children:xe?l.jsx(mi,{}):l.jsx(pi,{})}),l.jsx(Ce.SliderUI,{min:ke[0],max:ke[ke.length-1],marks:H,step:null,defaultValue:ke[ke.length-1],value:ke[me],onChangeComplete:Oe=>{Se(ke.indexOf(Oe))},onChange:Oe=>{Se(ke.indexOf(Oe))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[le?l.jsx(tn,{width:p,colorDomain:v,colors:i,colorLegendTitle:m,setSelectedColor:F,showNAColor:!1}):null,l.jsx("div",{className:"flex grow w-full justify-center leading-0",ref:Ie,"aria-label":"Graph area",children:(p||Me)&&(g||ne)?l.jsx(mO,{data:X!==void 0?X==="diff"?tt(Oo(e,te.dateFormat||"yyyy").filter(Oe=>te.enabled?Oe.date===ft(new Date(ke[me]),te.dateFormat||"yyyy"):Oe).filter(Oe=>U?!Oe.x.every(Ee=>Ee==null):Oe),Oe=>je(Oe.x[Oe.x.length-1])||je(Oe.x[0])?-1/0:Oe.x[Oe.x.length-1]-Oe.x[0]).reverse().filter((Oe,Ee)=>se?Ee<se:!0):tt(Oo(e,te.dateFormat||"yyyy").filter(Oe=>te.enabled?Oe.date===ft(new Date(ke[me]),te.dateFormat||"yyyy"):Oe).filter(Oe=>U?!Oe.x.every(Ee=>Ee==null):Oe),Oe=>je(Oe.x[X])?-1/0:Oe.x[X]).reverse().filter((Oe,Ee)=>se?Ee<se:!0):Oo(e,te.dateFormat||"yyyy").filter(Oe=>U?!Oe.x.every(Ee=>Ee==null):Oe).filter((Oe,Ee)=>se?Ee<se:!0),dotColors:i,width:p||Me,height:Math.max(M,g||(W?M?(p||Me)*W>M?(p||Me)*W:M:(p||Me)*W:ne)),suffix:$,prefix:V,radius:w,barPadding:o,showTicks:s,leftMargin:c,rightMargin:u,topMargin:h,bottomMargin:f,truncateBy:d,showLabels:S,showValues:B,tooltip:P,onSeriesMouseOver:D,maxValue:je(q)?Math.max(...e.map(Oe=>Math.max(...Oe.x.filter(Ee=>Ee!==null))))<0?0:Math.max(...e.map(Oe=>Math.max(...Oe.x.filter(Ee=>Ee!==null)))):q,minValue:je(ae)?Math.min(...e.map(Oe=>Math.min(...Oe.x.filter(Ee=>Ee!==null))))>0?0:Math.min(...e.map(Oe=>Math.min(...Oe.x.filter(Ee=>Ee!==null)))):ae,onSeriesMouseClick:G,selectedColor:Le,arrowConnector:z,connectorStrokeWidth:C,maxBarThickness:Q,minBarThickness:T,resetSelectionOnDoubleClick:ie,detailsOnClick:ue,axisTitle:he,noOfTicks:Y,valueColor:ge,styles:oe,classNames:ce,labelOrder:K,refValues:N,rtl:A==="he"||A==="ar",animate:ve===!0?{duration:.5,once:!0,amount:.5}:ve||{duration:0,once:!0,amount:0},precision:J,customLayers:R,highlightedDataPoints:ee,dimmedOpacity:de}):null})]})}),r||y?l.jsx(et,{styles:{footnote:oe?.footnote,source:oe?.source},classNames:{footnote:ce?.footnote,source:ce?.source},sources:r,footNote:y,width:p}):null]})})})})}function xO(t){const{data:e,dotColors:n,barPadding:i,showTicks:r,leftMargin:a,truncateBy:o,width:s,height:c,rightMargin:u,topMargin:h,bottomMargin:f,radius:d,showLabels:g,tooltip:p,onSeriesMouseOver:y,maxValue:v,minValue:m,onSeriesMouseClick:I,showValues:j,suffix:w,prefix:S,selectedColor:P,arrowConnector:W,connectorStrokeWidth:D,maxBarThickness:x,minBarThickness:$,resetSelectionOnDoubleClick:V,detailsOnClick:q,axisTitle:ae,noOfTicks:G,valueColor:_,styles:b,classNames:B,labelOrder:X,refValues:z,animate:C,precision:A,customLayers:M,highlightedDataPoints:O,dimmedOpacity:K}=t,Q=k.useRef(null),se=ct(Q,{once:C.once,amount:C.amount}),T={top:h,bottom:f,left:ae?a+30:a,right:u},Z=s-T.left-T.right,ie=c-T.top-T.bottom,[ue,he]=k.useState(void 0),[Y,ge]=k.useState(void 0),[oe,ce]=k.useState(void 0),[N,U]=k.useState(void 0),ve=e.map((de,te)=>({...de,id:X?`${de.label}`:`${te}`})),J=X||ve.map(de=>`${de.id}`),R=ut().domain([m,v]).range([ie,0]).nice(),le=xn().domain(J).range([0,$?Math.max(Z,$*ve.length):x?Math.min(Z,x*ve.length):Z]).paddingInner(i),ee=R.ticks(G);return l.jsxs(l.Fragment,{children:[l.jsxs($e.svg,{width:`${s}px`,height:`${c}px`,viewBox:`0 0 ${s} ${c}`,direction:"ltr",ref:Q,children:[W?l.jsx("defs",{children:l.jsx("marker",{id:"arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:l.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-primary-gray-600 dark:fill-primary-gray-300"})})}):null,l.jsxs("g",{transform:`translate(${T.left},${T.top})`,children:[l.jsx(Dt,{y1:R(m<0?0:m),y2:R(m<0?0:m),x1:0-a,x2:Z+T.right,label:qe(m<0?0:m,"NA",A,S,w),labelPos:{x:0-a,dx:0,dy:v<0?"1em":-5,y:R(m<0?0:m)},classNames:{axis:B?.xAxis?.axis,label:B?.yAxis?.labels},styles:{axis:b?.xAxis?.axis,label:b?.yAxis?.labels}}),r?l.jsx(ri,{values:ee.filter(de=>de!==0),y:ee.filter(de=>de!==0).map(de=>R(de)),x1:0-a,x2:Z+T.right,styles:{gridLines:b?.yAxis?.gridLines,labels:b?.yAxis?.labels},classNames:{gridLines:B?.yAxis?.gridLines,labels:B?.yAxis?.labels},suffix:w,prefix:S,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:A}):null,l.jsx(Nt,{x:0-a-15,y:ie/2,style:b?.yAxis?.title,className:B?.yAxis?.title,text:ae,rotate90:!0}),M.filter(de=>de.position==="before").map(de=>de.layer),l.jsxs(mt,{children:[ve.map(de=>l.jsxs($e.g,{className:"undp-viz-g-with-hover",variants:{initial:{x:le(`${de.id}`)+le.bandwidth()/2,y:0,opacity:O.length!==0?O.indexOf(de.label)!==-1?.85:K:.85},whileInView:{x:le(`${de.id}`)+le.bandwidth()/2,y:0,opacity:O.length!==0?O.indexOf(de.label)!==-1?.85:K:.85,transition:{duration:C.duration}}},initial:"initial",animate:se?"whileInView":"initial",exit:{opacity:0,transition:{duration:C.duration}},children:[g?l.jsx(ro,{value:`${de.label}`.length<o?`${de.label}`:`${`${de.label}`.substring(0,o)}...`,y:ie+5,x:0-le.bandwidth()/2,width:le.bandwidth(),height:T.bottom,style:b?.xAxis?.labels,className:B?.xAxis?.labels,alignment:"top",animate:C,isInView:se}):null,l.jsx($e.line,{x1:0,x2:0,style:{strokeWidth:D,...b?.dataConnectors||{},opacity:P?.3:1},className:Ce.cn("stroke-primary-gray-600 dark:stroke-primary-gray-300",B?.dataConnectors),markerEnd:W&&de.x.indexOf(Math.min(...de.x.filter(te=>te!==null)))===0?"url(#arrow)":"",markerStart:W&&de.x.indexOf(Math.min(...de.x.filter(te=>te!==null)))===de.x.length-1?"url(#arrow)":"",exit:{opacity:0,transition:{duration:C.duration}},variants:{initial:{y1:0,y2:0},whileInView:{y1:R(Math.min(...de.x.filter(te=>te!==null)))+d,y2:R(Math.max(...de.x.filter(te=>te!==null)))-d,transition:{duration:C.duration}}},initial:"initial",animate:se?"whileInView":"initial"}),de.x.map((te,Me)=>l.jsx($e.g,{onMouseEnter:be=>{he({...de,xIndex:Me}),U(be.clientY),ce(be.clientX),y?.({...de,xIndex:Me})},onClick:()=>{(I||q)&&(dt(Y,{...de,xIndex:Me})&&V?(ge(void 0),I?.(void 0)):(ge({...de,xIndex:Me}),I&&I({...de,xIndex:Me})))},onMouseMove:be=>{he({...de,xIndex:Me}),U(be.clientY),ce(be.clientX)},onMouseLeave:()=>{he(void 0),ce(void 0),U(void 0),y?.(void 0)},exit:{opacity:0,transition:{duration:C.duration}},variants:{initial:{opacity:P?n[Me]===P?1:.3:1},whileInView:{opacity:P?n[Me]===P?1:.3:1,transition:{duration:C.duration}}},initial:"initial",animate:se?"whileInView":"initial",children:je(te)?null:l.jsxs(l.Fragment,{children:[l.jsx($e.circle,{cx:0,r:d,style:{fill:n[Me],fillOpacity:.85,stroke:n[Me],strokeWidth:1},exit:{opacity:0,transition:{duration:C.duration}},variants:{initial:{cy:R(0),opacity:0},whileInView:{cy:R(te||0),opacity:je(te)?0:1,transition:{duration:C.duration}}},initial:"initial",animate:se?"whileInView":"initial"}),j?l.jsx($e.text,{x:0,style:{fill:_||n[Me],textAnchor:"start",...b?.graphObjectValues||{}},className:Ce.cn("graph-value text-sm font-bold",je(te)?"opacity-0":"opacity-100",B?.graphObjectValues),dx:d+3,dy:"0.33em",exit:{opacity:0,transition:{duration:C.duration}},variants:{initial:{y:R(0),opacity:0},whileInView:{y:R(te||0),opacity:1,transition:{duration:C.duration}}},initial:"initial",animate:se?"whileInView":"initial",children:qe(te,"NA",A,S,w)}):null]})},Me))]},de.label)),z?l.jsx(l.Fragment,{children:z.map((de,te)=>l.jsx(gi,{text:de.text,color:de.color,y:R(de.value),x1:0-a,x2:Z+T.right,classNames:de.classNames,styles:de.styles,animate:C,isInView:se},te))}):null]}),M.filter(de=>de.position==="after").map(de=>de.layer)]})]}),ue&&p&&oe&&N?l.jsx(st,{data:ue,body:p,xPos:oe,yPos:N,backgroundStyle:b?.tooltip,className:B?.tooltip}):null,q&&Y!==void 0?l.jsx(Ce.Modal,{open:Y!==void 0,onClose:()=>{ge(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof q=="string"?{__html:lt(q,Y)}:void 0,children:typeof q=="function"?q(Y):null})}):null]})}function vO(t){const{data:e,graphTitle:n,colors:i=Pe.light.categoricalColors.colors,sources:r,graphDescription:a,barPadding:o=.25,showTicks:s=!0,leftMargin:c=20,rightMargin:u=20,topMargin:h=20,bottomMargin:f=25,truncateBy:d=999,height:g,width:p,footNote:y,colorDomain:v,colorLegendTitle:m,padding:I,backgroundColor:j=!1,radius:w=3,tooltip:S,showLabels:P=!0,relativeHeight:W,onSeriesMouseOver:D,graphID:x,suffix:$="",prefix:V="",maxValue:q,minValue:ae,onSeriesMouseClick:G,graphDownload:_=!1,dataDownload:b=!1,showValues:B=!0,sortParameter:X,arrowConnector:z=!1,connectorStrokeWidth:C=2,language:A="en",minHeight:M=0,theme:O="light",maxBarThickness:K,maxNumberOfBars:Q,minBarThickness:se,ariaLabel:T,resetSelectionOnDoubleClick:Z=!0,detailsOnClick:ie,axisTitle:ue,noOfTicks:he=5,valueColor:Y,styles:ge,classNames:oe,labelOrder:ce,refValues:N,filterNA:U=!0,animate:ve=!1,precision:J=2,customLayers:R=[],showColorScale:le=!0,highlightedDataPoints:ee=[],dimmedOpacity:de=.3,timeline:te={enabled:!1,autoplay:!1,showOnlyActiveDate:!0}}=t,[Me,be]=k.useState(0),[ne,De]=k.useState(0),[xe,Ae]=k.useState(te.autoplay),ke=di(Xe(e.filter(Oe=>Oe.date!==void 0&&Oe.date!==null),Oe=>Oe.date).map(Oe=>ze(`${Oe.date}`,te.dateFormat||"yyyy",new Date).getTime()),(Oe,Ee)=>an(Oe,Ee)),[me,Se]=k.useState(te.autoplay?0:ke.length-1),[Le,F]=k.useState(void 0),Ie=k.useRef(null),Ve=k.useRef(null);k.useEffect(()=>{const Oe=new ResizeObserver(Ee=>{be(p||Ee[0].target.clientWidth||620),De(g||Ee[0].target.clientHeight||480)});return Ie.current&&(De(Ie.current.clientHeight||480),be(Ie.current.clientWidth||620),p||Oe.observe(Ie.current)),()=>Oe.disconnect()},[p,g]),k.useEffect(()=>{const Oe=setInterval(()=>{Se(Ee=>Ee<ke.length-1?Ee+1:0)},(te.speed||2)*1e3);return xe||clearInterval(Oe),()=>clearInterval(Oe)},[ke,xe,te.speed]);const H=yi(ke,me,te.showOnlyActiveDate,te.dateFormat||"yyyy");return l.jsx("div",{className:`${O||"light"} flex ${p?"w-fit grow-0":"w-full grow"}`,dir:A==="he"||A==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${j?j===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${A||"en"}`,oe?.graphContainer),style:{...ge?.graphContainer||{},...j&&j!==!0?{backgroundColor:j}:{}},id:x,ref:Ve,"aria-label":T||`${n?`The graph shows ${n}. `:""}This is a dumbbell chart that shows comparisons between two or more data points across categories. ${a?` ${a}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:j?I||"1rem":I||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||a||_||b?l.jsx(Qe,{styles:{title:ge?.title,description:ge?.description},classNames:{title:oe?.title,description:oe?.description},graphTitle:n,graphDescription:a,width:p,graphDownload:_?Ve.current:void 0,dataDownload:b?e.map(Oe=>Oe.data).filter(Oe=>Oe!==void 0).length>0?e.map(Oe=>Oe.data).filter(Oe=>Oe!==void 0):e.filter(Oe=>Oe!==void 0):null}):null,te.enabled&&ke.length>0&&H?l.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[l.jsx("button",{type:"button",onClick:()=>{Ae(!xe)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":xe?"Click to pause animation":"Click to play animation",children:xe?l.jsx(mi,{}):l.jsx(pi,{})}),l.jsx(Ce.SliderUI,{min:ke[0],max:ke[ke.length-1],marks:H,step:null,defaultValue:ke[ke.length-1],value:ke[me],onChangeComplete:Oe=>{Se(ke.indexOf(Oe))},onChange:Oe=>{Se(ke.indexOf(Oe))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[le?l.jsx(tn,{width:p,colorDomain:v,colors:i,colorLegendTitle:m,setSelectedColor:F,showNAColor:!1}):null,l.jsx("div",{className:"flex grow w-full justify-center leading-0",ref:Ie,"aria-label":"Graph area",children:(p||Me)&&(g||ne)?l.jsx(xO,{data:X!==void 0?X==="diff"?tt(Oo(e,te.dateFormat||"yyyy").filter(Oe=>te.enabled?Oe.date===ft(new Date(ke[me]),te.dateFormat||"yyyy"):Oe).filter(Oe=>U?!Oe.x.every(Ee=>Ee==null):Oe),Oe=>je(Oe.x[Oe.x.length-1])||je(Oe.x[0])?-1/0:Oe.x[Oe.x.length-1]-Oe.x[0]).filter((Oe,Ee)=>Q?Ee<Q:!0):tt(Oo(e,te.dateFormat||"yyyy").filter(Oe=>te.enabled?Oe.date===ft(new Date(ke[me]),te.dateFormat||"yyyy"):Oe).filter(Oe=>U?!Oe.x.every(Ee=>Ee==null):Oe),Oe=>je(Oe.x[X])?-1/0:Oe.x[X]).filter((Oe,Ee)=>Q?Ee<Q:!0):Oo(e,te.dateFormat||"yyyy").filter(Oe=>U?!Oe.x.every(Ee=>Ee==null):Oe).filter((Oe,Ee)=>Q?Ee<Q:!0),dotColors:i,width:p||Me,height:Math.max(M,g||(W?M?(p||Me)*W>M?(p||Me)*W:M:(p||Me)*W:ne)),radius:w,barPadding:o,showTicks:s,leftMargin:c,rightMargin:u,topMargin:h,bottomMargin:f,truncateBy:d,showLabels:P,showValues:B,tooltip:S,suffix:$,prefix:V,onSeriesMouseOver:D,maxValue:je(q)?Math.max(...e.map(Oe=>Math.max(...Oe.x.filter(Ee=>Ee!==null))))<0?0:Math.max(...e.map(Oe=>Math.max(...Oe.x.filter(Ee=>Ee!==null)))):q,minValue:je(ae)?Math.min(...e.map(Oe=>Math.min(...Oe.x.filter(Ee=>Ee!==null))))>0?0:Math.min(...e.map(Oe=>Math.min(...Oe.x.filter(Ee=>Ee!==null)))):ae,onSeriesMouseClick:G,selectedColor:Le,arrowConnector:z,connectorStrokeWidth:C,maxBarThickness:K,minBarThickness:se,resetSelectionOnDoubleClick:Z,detailsOnClick:ie,axisTitle:ue,noOfTicks:he,valueColor:Y,styles:ge,classNames:oe,labelOrder:ce,refValues:N,animate:ve===!0?{duration:.5,once:!0,amount:.5}:ve||{duration:0,once:!0,amount:0},precision:J,customLayers:R,highlightedDataPoints:ee,dimmedOpacity:de}):null})]})}),r||y?l.jsx(et,{styles:{footnote:ge?.footnote,source:ge?.source},classNames:{footnote:oe?.footnote,source:oe?.source},sources:r,footNote:y,width:p}):null]})})})})}function tv(t){const{data:e,graphTitle:n,colors:i,sources:r,graphDescription:a,barPadding:o,showTicks:s,leftMargin:c,rightMargin:u,topMargin:h,bottomMargin:f,truncateBy:d,height:g,width:p,footNote:y,colorDomain:v,colorLegendTitle:m,padding:I,backgroundColor:j,radius:w,tooltip:S,showLabels:P,relativeHeight:W,onSeriesMouseOver:D,graphID:x,suffix:$,prefix:V,maxValue:q,minValue:ae,onSeriesMouseClick:G,graphDownload:_,dataDownload:b,showValues:B,sortParameter:X,arrowConnector:z,connectorStrokeWidth:C,language:A,minHeight:M,theme:O,maxBarThickness:K,maxNumberOfBars:Q,minBarThickness:se,ariaLabel:T,resetSelectionOnDoubleClick:Z,detailsOnClick:ie,axisTitle:ue,noOfTicks:he,valueColor:Y,orientation:ge="vertical",styles:oe,classNames:ce,labelOrder:N,refValues:U,filterNA:ve,animate:J,precision:R,showColorScale:le,customLayers:ee,highlightedDataPoints:de,dimmedOpacity:te,timeline:Me}=t;return ge==="vertical"?l.jsx(vO,{data:e,graphTitle:n,colors:i,sources:r,graphDescription:a,barPadding:o,showTicks:s,leftMargin:c,rightMargin:u,topMargin:h,bottomMargin:f,truncateBy:d,height:g,width:p,footNote:y,colorDomain:v,colorLegendTitle:m,padding:I,backgroundColor:j,radius:w,tooltip:S,showLabels:P,relativeHeight:W,onSeriesMouseOver:D,graphID:x,suffix:$,prefix:V,maxValue:q,minValue:ae,onSeriesMouseClick:G,graphDownload:_,dataDownload:b,showValues:B,sortParameter:X,arrowConnector:z,connectorStrokeWidth:C,language:A,minHeight:M,theme:O,maxBarThickness:K,maxNumberOfBars:Q,minBarThickness:se,ariaLabel:T,resetSelectionOnDoubleClick:Z,styles:oe,detailsOnClick:ie,axisTitle:ue,noOfTicks:he,labelOrder:N,valueColor:Y,classNames:ce,refValues:U,filterNA:ve,animate:J,precision:R,showColorScale:le,customLayers:ee,highlightedDataPoints:de,dimmedOpacity:te,timeline:Me}):l.jsx(yO,{data:e,graphTitle:n,colors:i,sources:r,graphDescription:a,barPadding:o,showTicks:s,leftMargin:c,rightMargin:u,topMargin:h,bottomMargin:f,truncateBy:d,height:g,width:p,footNote:y,colorDomain:v,colorLegendTitle:m,padding:I,backgroundColor:j,radius:w,tooltip:S,showLabels:P,relativeHeight:W,onSeriesMouseOver:D,graphID:x,suffix:$,prefix:V,maxValue:q,minValue:ae,onSeriesMouseClick:G,graphDownload:_,dataDownload:b,showValues:B,sortParameter:X,arrowConnector:z,connectorStrokeWidth:C,language:A,minHeight:M,theme:O,maxBarThickness:K,maxNumberOfBars:Q,minBarThickness:se,ariaLabel:T,resetSelectionOnDoubleClick:Z,styles:oe,detailsOnClick:ie,axisTitle:ue,noOfTicks:he,valueColor:Y,classNames:ce,labelOrder:N,refValues:U,filterNA:ve,animate:J,precision:R,showColorScale:le,customLayers:ee,highlightedDataPoints:de,dimmedOpacity:te,timeline:Me})}function wO(t){const{data:e,circleColors:n,showTicks:i,leftMargin:r,width:a,height:o,colorDomain:s,rightMargin:c,topMargin:u,bottomMargin:h,showLabels:f,tooltip:d,onSeriesMouseOver:g,refValues:p,selectedColor:y,startFromZero:v,radius:m,maxRadiusValue:I,maxValue:j,minValue:w,highlightedDataPoints:S,onSeriesMouseClick:P,rtl:W,resetSelectionOnDoubleClick:D,detailsOnClick:x,suffix:$,prefix:V,styles:q,classNames:ae,noOfTicks:G,animate:_,dimmedOpacity:b,precision:B,customLayers:X}=t,z=k.useRef(null),C=ct(z,{once:_.once,amount:_.amount}),[A,M]=k.useState(void 0),[O,K]=k.useState(void 0),[Q,se]=k.useState(null),[T,Z]=k.useState(void 0),[ie,ue]=k.useState(void 0),he={top:u,bottom:h,left:r,right:c},Y=a-he.left-he.right,ge=o-he.top-he.bottom,oe=e.filter(R=>!je(R.radius)).length===0?e:Nc(e.filter(R=>!je(R.radius)),"radius","desc"),ce=je(j)?Math.max(...e.filter(R=>!je(R.position)).map(R=>R.position))<0&&!v?0:Math.max(...e.filter(R=>!je(R.position)).map(R=>R.position)):j,N=je(w)?Math.min(...e.filter(R=>!je(R.position)).map(R=>R.position))>=0&&!v?0:Math.min(...e.filter(R=>!je(R.position)).map(R=>R.position)):w,U=e.filter(R=>R.radius===void 0||R.radius===null).length!==e.length?Qs().domain([0,je(I)?Math.max(...e.map(R=>R.radius).filter(R=>R!=null)):I]).range([.25,m]).nice():void 0,ve=ut().domain([N,ce]).range([0,Y]).nice(),J=ve.ticks(G);return k.useEffect(()=>{se(null);const R=oe.filter(le=>le.position);Qf(R).force("x",Jf(le=>ve(le.position)).strength(5)).force("y",ed(le=>ge/2).strength(1)).force("collide",Uf(le=>U?U(le.radius||0)+1:m+1)).force("charge",Zf().strength(-15)).alphaDecay(.05).tick(1e4).on("tick",()=>{se(R)}).on("end",()=>{se(R)})},[e,m,ge,Y,N,ce,oe,ve,U]),l.jsxs(l.Fragment,{children:[Q?l.jsx($e.svg,{width:`${a}px`,height:`${o}px`,viewBox:`0 0 ${a} ${o}`,direction:"ltr",ref:z,children:l.jsxs("g",{transform:`translate(${he.left},${he.top})`,children:[i?l.jsxs(l.Fragment,{children:[l.jsx(Dt,{x1:ve(N<0?0:N),x2:ve(N<0?0:N),y1:0-he.top,y2:ge+he.bottom,label:qe(N<0?0:N,"NA",B,V,$),labelPos:{x:ve(N<0?0:N),y:0-u,dy:"0.75em",dx:3},classNames:{axis:ae?.xAxis?.axis,label:ae?.yAxis?.labels},styles:{axis:q?.xAxis?.axis,label:q?.yAxis?.labels}}),l.jsx(Rn,{values:J.filter(R=>R!==0),x:J.filter(R=>R!==0).map(R=>ve(R)),y1:0-u,y2:ge+he.bottom,styles:{gridLines:q?.xAxis?.gridLines,labels:q?.xAxis?.labels},classNames:{gridLines:ae?.xAxis?.gridLines,labels:ae?.xAxis?.labels},suffix:$,prefix:V,labelType:"secondary",showGridLines:!0,precision:B})]}):null,X.filter(R=>R.position==="before").map(R=>R.layer),l.jsxs(mt,{children:[Q.map(R=>l.jsxs($e.g,{className:"undp-viz-g-with-hover",transform:`translate(${R.x},${R.y})`,variants:{initial:{opacity:0},whileInView:{opacity:y?R.color&&n[s.indexOf(R.color)]===y?1:b:S.length!==0?S.indexOf(R.label)!==-1?.85:b:.85,transition:{duration:_.duration}}},initial:"initial",animate:C?"whileInView":"initial",exit:{opacity:0,transition:{duration:_.duration}},onMouseEnter:le=>{M(R),ue(le.clientY),Z(le.clientX),g?.(R)},onMouseMove:le=>{M(R),ue(le.clientY),Z(le.clientX)},onClick:()=>{(P||x)&&(dt(O,R)&&D?(K(void 0),P?.(void 0)):(K(R),P?.(R)))},onMouseLeave:()=>{M(void 0),Z(void 0),ue(void 0),g?.(void 0)},children:[l.jsx($e.circle,{cx:0,cy:0,variants:{initial:{fill:e.filter(le=>le.color).length===0?n[0]:R.color?n[s.indexOf(R.color)]:Pe.gray,opacity:0,radius:0},whileInView:{fill:e.filter(le=>le.color).length===0?n[0]:R.color?n[s.indexOf(R.color)]:Pe.gray,opacity:1,radius:U?U(R.radius||0):m,transition:{duration:_.duration}}},initial:"initial",animate:C?"whileInView":"initial",exit:{opacity:0,radius:0,transition:{duration:_.duration}}}),(U?U(R.radius||0):m)>10&&f?l.jsx($e.g,{variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:_.duration}}},initial:"initial",animate:C?"whileInView":"initial",exit:{opacity:0,transition:{duration:_.duration}},children:l.jsx("foreignObject",{y:0-(U?U(R.radius||0):m),x:0-(U?U(R.radius||0):m),width:2*(U?U(R.radius||0):m),height:2*(U?U(R.radius||0):m),children:l.jsx("div",{className:"flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-1.5",children:f?l.jsx("p",{className:Ce.cn("text-center leading-none m-0",ae?.graphObjectValues),style:{fontSize:`${Math.min(Math.max(Math.round((U?U(R.radius||0):m)/4),10),Math.max(Math.round((U?U(R.radius||0):m)*12/`${R.label}`.length),10),20)}px`,color:yn(e.filter(le=>le.color).length===0?n[0]:R.color?n[s.indexOf(R.color)]:Pe.gray),hyphens:"auto",...q?.graphObjectValues||{}},children:R.label}):null})})}):null]},R.label)),p?l.jsx(l.Fragment,{children:p.map((R,le)=>l.jsx(Tr,{text:R.text,color:R.color,x:ve(R.value),y1:0-he.top,y2:ge+he.bottom,textSide:ve(R.value)>Y*.75||W?"left":"right",classNames:R.classNames,styles:R.styles,animate:_,isInView:C},le))}):null]}),X.filter(R=>R.position==="after").map(R=>R.layer)]})}):l.jsx("div",{style:{width:`${a}px`,height:`${o}px`},children:l.jsx("div",{className:"flex m-auto items-center justify-center p-0 leading-none text-base h-40",children:l.jsx(Ce.Spinner,{})})}),A&&d&&T&&ie?l.jsx(st,{data:A,body:d,xPos:T,yPos:ie,backgroundStyle:q?.tooltip,className:ae?.tooltip}):null,x&&O!==void 0?l.jsx(Ce.Modal,{open:O!==void 0,onClose:()=>{K(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof x=="string"?{__html:lt(x,O)}:void 0,children:typeof x=="function"?x(O):null})}):null]})}function bO(t){const{data:e,graphTitle:n,backgroundColor:i=!1,topMargin:r=25,bottomMargin:a=10,leftMargin:o=10,rightMargin:s=10,showLabels:c=!0,showTicks:u=!0,colors:h,sources:f,graphDescription:d,height:g,width:p,footNote:y,colorDomain:v,colorLegendTitle:m,padding:I,relativeHeight:j,tooltip:w,onSeriesMouseOver:S,refValues:P,showColorScale:W,graphID:D,radius:x=5,maxRadiusValue:$,maxValue:V,minValue:q,highlightedDataPoints:ae=[],onSeriesMouseClick:G,graphDownload:_=!1,dataDownload:b=!1,language:B="en",showNAColor:X=!0,minHeight:z=0,theme:C="light",ariaLabel:A,resetSelectionOnDoubleClick:M=!0,detailsOnClick:O,suffix:K="",prefix:Q="",styles:se,classNames:T,noOfTicks:Z,animate:ie=!1,dimmedOpacity:ue=.3,precision:he=2,customLayers:Y=[]}=t,[ge,oe]=k.useState(0),[ce,N]=k.useState(0),[U,ve]=k.useState(void 0),J=k.useRef(null),R=k.useRef(null);return k.useEffect(()=>{const le=new ResizeObserver(ee=>{oe(p||ee[0].target.clientWidth||620),N(g||ee[0].target.clientHeight||480)});return J.current&&(N(J.current.clientHeight||480),oe(J.current.clientWidth||620),p||le.observe(J.current)),()=>le.disconnect()},[p,g]),l.jsx("div",{className:`${C||"light"} flex ${p?"w-fit grow-0":"w-full grow"}`,dir:B==="he"||B==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${i?i===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${B||"en"}`,T?.graphContainer),style:{...se?.graphContainer||{},...i&&i!==!0?{backgroundColor:i}:{}},id:D,ref:R,"aria-label":A||`${n?`The graph shows ${n}. `:""}This is a bee swarm chart showing the distribution along the x-axes. ${d?` ${d}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:i?I||"1rem":I||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||d||_||b?l.jsx(Qe,{styles:{title:se?.title,description:se?.description},classNames:{title:T?.title,description:T?.description},graphTitle:n,graphDescription:d,width:p,graphDownload:_?R.current:void 0,dataDownload:b?e.map(le=>le.data).filter(le=>le!==void 0).length>0?e.map(le=>le.data).filter(le=>le!==void 0):e.filter(le=>le!==void 0):null}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[W!==!1&&e.filter(le=>le.color).length!==0?l.jsx(tn,{width:p,colorLegendTitle:m,colors:h||Pe[C].categoricalColors.colors,colorDomain:v||Xe(e.filter(le=>le.color),"color").map(le=>le.color),setSelectedColor:ve,showNAColor:X??!0}):null,l.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:J,"aria-label":"Graph area",children:(p||ge)&&(g||ce)?l.jsx(wO,{data:e,circleColors:e.filter(le=>le.color).length===0?h?[h]:[Pe.primaryColors["blue-600"]]:h||Pe[C].categoricalColors.colors,colorDomain:e.filter(le=>le.color).length===0?[]:v||Xe(e.filter(le=>le.color),"color").map(le=>le.color),width:p||ge,selectedColor:U,height:Math.max(z,g||(j?z?(p||ge)*j>z?(p||ge)*j:z:(p||ge)*j:ce)),showTicks:u,leftMargin:o,rightMargin:s,topMargin:r,bottomMargin:a,showLabels:c,tooltip:w,onSeriesMouseOver:S,refValues:P,startFromZero:!1,radius:x,maxRadiusValue:$,maxValue:V,minValue:q,highlightedDataPoints:ae,onSeriesMouseClick:G,rtl:B==="he"||B==="ar",resetSelectionOnDoubleClick:M,detailsOnClick:O,suffix:K,prefix:Q,styles:se,classNames:T,noOfTicks:Z||5,animate:ie===!0?{duration:.5,once:!0,amount:.5}:ie||{duration:0,once:!0,amount:0},dimmedOpacity:ue,precision:he,customLayers:Y}):null})]})}),f||y?l.jsx(et,{styles:{footnote:se?.footnote,source:se?.source},classNames:{footnote:T?.footnote,source:T?.source},sources:f,footNote:y,width:p}):null]})})})})}function CO(t){const{data:e,circleColors:n,showTicks:i,leftMargin:r,width:a,height:o,colorDomain:s,rightMargin:c,topMargin:u,bottomMargin:h,suffix:f,prefix:d,showLabels:g,tooltip:p,onSeriesMouseOver:y,refValues:v,selectedColor:m,startFromZero:I,radius:j,maxRadiusValue:w,maxValue:S,minValue:P,highlightedDataPoints:W,onSeriesMouseClick:D,resetSelectionOnDoubleClick:x,detailsOnClick:$,styles:V,classNames:q,noOfTicks:ae,animate:G,dimmedOpacity:_,precision:b,customLayers:B}=t,X=k.useRef(null),z=ct(X,{once:G.once,amount:G.amount}),[C,A]=k.useState(void 0),[M,O]=k.useState(void 0),[K,Q]=k.useState(null),[se,T]=k.useState(void 0),[Z,ie]=k.useState(void 0),ue={top:u,bottom:h,left:r,right:c},he=a-ue.left-ue.right,Y=o-ue.top-ue.bottom,ge=e.filter(J=>!je(J.radius)).length===0?e:Nc(e.filter(J=>!je(J.radius)),"radius","desc"),oe=je(S)?Math.max(...e.filter(J=>!je(J.position)).map(J=>J.position))<0&&!I?0:Math.max(...e.filter(J=>!je(J.position)).map(J=>J.position)):S,ce=je(P)?Math.min(...e.filter(J=>!je(J.position)).map(J=>J.position))>=0&&!I?0:Math.min(...e.filter(J=>!je(J.position)).map(J=>J.position)):P,N=e.filter(J=>J.radius===void 0||J.radius===null).length!==e.length?Qs().domain([0,je(w)?Math.max(...e.map(J=>J.radius).filter(J=>J!=null)):w]).range([.25,j]).nice():void 0,U=ut().domain([ce,oe]).range([Y,0]).nice(),ve=U.ticks(ae);return k.useEffect(()=>{Q(null);const J=ge.filter(R=>R.position);Qf(J).force("y",ed(R=>U(R.position)).strength(5)).force("x",Jf(R=>he/2).strength(1)).force("collide",Uf(R=>N?N(R.radius||0)+1:j+1)).force("charge",Zf().strength(-15)).alphaDecay(.05).tick(1e4).on("tick",()=>{Q(J)}).on("end",()=>{Q(J)})},[e,j,Y,he,ce,oe,ge,U,N]),l.jsxs(l.Fragment,{children:[K?l.jsx($e.svg,{width:`${a}px`,height:`${o}px`,viewBox:`0 0 ${a} ${o}`,direction:"ltr",ref:X,children:l.jsxs("g",{transform:`translate(${ue.left},${ue.top})`,children:[i?l.jsxs(l.Fragment,{children:[l.jsx(Dt,{y1:U(ce<0?0:ce),y2:U(ce<0?0:ce),x1:0-ue.left,x2:he+ue.right,label:qe(ce<0?0:ce,"NA",b,d,f),labelPos:{x:0-ue.left,y:U(ce<0?0:ce),dx:0,dy:oe<0?"1em":-5},classNames:{axis:q?.xAxis?.axis,label:q?.yAxis?.labels},styles:{axis:V?.xAxis?.axis,label:V?.yAxis?.labels}}),l.jsx(ri,{values:ve.filter(J=>J!==0),y:ve.filter(J=>J!==0).map(J=>U(J)),x1:0-ue.left,x2:he+ue.right,styles:{gridLines:V?.yAxis?.gridLines,labels:V?.yAxis?.labels},classNames:{gridLines:q?.yAxis?.gridLines,labels:q?.yAxis?.labels},suffix:f,prefix:d,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:b})]}):null,B.filter(J=>J.position==="before").map(J=>J.layer),l.jsxs(mt,{children:[K.map(J=>l.jsxs($e.g,{className:"undp-viz-g-with-hover",transform:`translate(${J.x},${J.y})`,variants:{initial:{opacity:0},whileInView:{opacity:m?J.color&&n[s.indexOf(J.color)]===m?1:_:W.length!==0?W.indexOf(J.label)!==-1?.85:_:.85,transition:{duration:G.duration}}},initial:"initial",animate:z?"whileInView":"initial",exit:{opacity:0,transition:{duration:G.duration}},onMouseEnter:R=>{A(J),ie(R.clientY),T(R.clientX),y?.(J)},onMouseMove:R=>{A(J),ie(R.clientY),T(R.clientX)},onClick:()=>{(D||$)&&(dt(M,J)&&x?(O(void 0),D?.(void 0)):(O(J),D?.(J)))},onMouseLeave:()=>{A(void 0),T(void 0),ie(void 0),y?.(void 0)},children:[l.jsx($e.circle,{cx:0,cy:0,r:N?N(J.radius||0):j,variants:{initial:{fill:e.filter(R=>R.color).length===0?n[0]:J.color?n[s.indexOf(J.color)]:Pe.gray,opacity:0,radius:0},whileInView:{fill:e.filter(R=>R.color).length===0?n[0]:J.color?n[s.indexOf(J.color)]:Pe.gray,opacity:1,radius:N?N(J.radius||0):j,transition:{duration:G.duration}}},initial:"initial",animate:z?"whileInView":"initial",exit:{opacity:0,radius:0,transition:{duration:G.duration}}}),(N?N(J.radius||0):j)>10&&g?l.jsx($e.g,{variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:G.duration}}},initial:"initial",animate:z?"whileInView":"initial",exit:{opacity:0,transition:{duration:G.duration}},children:l.jsx("foreignObject",{y:0-(N?N(J.radius||0):j),x:0-(N?N(J.radius||0):j),width:2*(N?N(J.radius||0):j),height:2*(N?N(J.radius||0):j),children:l.jsx("div",{className:"flex flex-col justify-center items-center h-inherit py-0 px-1.5",children:g?l.jsx("p",{className:Ce.cn("text-center leading-none m-0",q?.graphObjectValues),style:{fontSize:`${Math.min(Math.max(Math.round((N?N(J.radius||0):j)/4),10),Math.max(Math.round((N?N(J.radius||0):j)*12/`${J.label}`.length),10),20)}px`,hyphens:"auto",color:yn(e.filter(R=>R.color).length===0?n[0]:J.color?n[s.indexOf(J.color)]:Pe.gray),...V?.graphObjectValues||{}},children:J.label}):null})})}):null]},J.label)),v?l.jsx(l.Fragment,{children:v.map((J,R)=>l.jsx(gi,{text:J.text,color:J.color,y:U(J.value),x1:0-ue.left,x2:he+ue.right,classNames:J.classNames,styles:J.styles,animate:G,isInView:z},R))}):null]}),B.filter(J=>J.position==="after").map(J=>J.layer)]})}):l.jsx("div",{style:{width:`${a}px`,height:`${o}px`},children:l.jsx("div",{className:"flex m-auto items-center justify-center p-0 leading-none text-base h-40",children:l.jsx(Ce.Spinner,{})})}),C&&p&&se&&Z?l.jsx(st,{data:C,body:p,xPos:se,yPos:Z,backgroundStyle:V?.tooltip,className:q?.tooltip}):null,$&&M!==void 0?l.jsx(Ce.Modal,{open:M!==void 0,onClose:()=>{O(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof $=="string"?{__html:lt($,M)}:void 0,children:typeof $=="function"?$(M):null})}):null]})}function SO(t){const{data:e,graphTitle:n,colors:i,sources:r,graphDescription:a,height:o,width:s,footNote:c,colorDomain:u,colorLegendTitle:h,padding:f,backgroundColor:d=!1,topMargin:g=25,bottomMargin:p=10,leftMargin:y=100,rightMargin:v=40,showLabels:m=!0,showTicks:I=!0,relativeHeight:j,tooltip:w,onSeriesMouseOver:S,refValues:P,showColorScale:W,graphID:D,radius:x=5,maxRadiusValue:$,maxValue:V,minValue:q,highlightedDataPoints:ae=[],onSeriesMouseClick:G,graphDownload:_=!1,dataDownload:b=!1,language:B="en",showNAColor:X=!0,minHeight:z=0,theme:C="light",ariaLabel:A,resetSelectionOnDoubleClick:M=!0,detailsOnClick:O,suffix:K="",prefix:Q="",styles:se,classNames:T,noOfTicks:Z,animate:ie=!1,dimmedOpacity:ue=.3,precision:he=2,customLayers:Y=[]}=t,[ge,oe]=k.useState(0),[ce,N]=k.useState(0),[U,ve]=k.useState(void 0),J=k.useRef(null),R=k.useRef(null);return k.useEffect(()=>{const le=new ResizeObserver(ee=>{oe(s||ee[0].target.clientWidth||620),N(o||ee[0].target.clientHeight||480)});return J.current&&(N(J.current.clientHeight||480),oe(J.current.clientWidth||620),s||le.observe(J.current)),()=>le.disconnect()},[s,o]),l.jsx("div",{className:`${C||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:B==="he"||B==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${d?d===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${B||"en"}`,T?.graphContainer),style:{...se?.graphContainer||{},...d&&d!==!0?{backgroundColor:d}:{}},id:D,ref:R,"aria-label":A||`${n?`The graph shows ${n}. `:""}This is a bee swarm chart showing the distribution along the y-axes. ${a?` ${a}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:d?f||"1rem":f||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||a||_||b?l.jsx(Qe,{styles:{title:se?.title,description:se?.description},classNames:{title:T?.title,description:T?.description},graphTitle:n,graphDescription:a,width:s,graphDownload:_?R.current:void 0,dataDownload:b?e.map(le=>le.data).filter(le=>le!==void 0).length>0?e.map(le=>le.data).filter(le=>le!==void 0):e.filter(le=>le!==void 0):null}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[W!==!1&&e.filter(le=>le.color).length!==0?l.jsx(tn,{width:s,colorLegendTitle:h,colors:i||Pe[C].categoricalColors.colors,colorDomain:u||Xe(e.filter(le=>le.color),"color").map(le=>le.color),setSelectedColor:ve,showNAColor:X}):null,l.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:J,"aria-label":"Graph area",children:(s||ge)&&(o||ce)?l.jsx(CO,{data:e,circleColors:e.filter(le=>le.color).length===0?i?[i]:[Pe.primaryColors["blue-600"]]:i||Pe[C].categoricalColors.colors,colorDomain:e.filter(le=>le.color).length===0?[]:u||Xe(e.filter(le=>le.color),"color").map(le=>le.color),width:s||ge,selectedColor:U,height:Math.max(z,o||(j?z?(s||ge)*j>z?(s||ge)*j:z:(s||ge)*j:ce)),showTicks:I,leftMargin:y,rightMargin:v,topMargin:g,bottomMargin:p,showLabels:m,tooltip:w,onSeriesMouseOver:S,refValues:P,startFromZero:!1,radius:x,maxRadiusValue:$,maxValue:V,minValue:q,highlightedDataPoints:ae,onSeriesMouseClick:G,resetSelectionOnDoubleClick:M,detailsOnClick:O,styles:se,classNames:T,suffix:K,prefix:Q,noOfTicks:Z||5,animate:ie===!0?{duration:.5,once:!0,amount:.5}:ie||{duration:0,once:!0,amount:0},dimmedOpacity:ue,precision:he,customLayers:Y}):null})]})}),r||c?l.jsx(et,{styles:{footnote:se?.footnote,source:se?.source},classNames:{footnote:T?.footnote,source:T?.source},sources:r,footNote:c,width:s}):null]})})})})}function nv(t){const{data:e,graphTitle:n,backgroundColor:i,topMargin:r,bottomMargin:a,leftMargin:o,rightMargin:s,showLabels:c,showTicks:u,colors:h,sources:f,graphDescription:d,height:g,width:p,footNote:y,colorDomain:v,colorLegendTitle:m,padding:I,relativeHeight:j,tooltip:w,onSeriesMouseOver:S,refValues:P,showColorScale:W,graphID:D,radius:x,maxRadiusValue:$,maxValue:V,minValue:q,highlightedDataPoints:ae,onSeriesMouseClick:G,graphDownload:_,dataDownload:b,language:B,showNAColor:X,minHeight:z,theme:C,ariaLabel:A,resetSelectionOnDoubleClick:M,detailsOnClick:O,noOfTicks:K,orientation:Q="vertical",styles:se,classNames:T,animate:Z,dimmedOpacity:ie,precision:ue,customLayers:he}=t;return Q==="vertical"?l.jsx(SO,{data:e,graphTitle:n,backgroundColor:i,topMargin:r,bottomMargin:a,leftMargin:o,rightMargin:s,showLabels:c,showTicks:u,colors:h,sources:f,graphDescription:d,height:g,width:p,footNote:y,colorDomain:v,colorLegendTitle:m,padding:I,relativeHeight:j,tooltip:w,onSeriesMouseOver:S,refValues:P,showColorScale:W,graphID:D,radius:x,maxRadiusValue:$,maxValue:V,minValue:q,highlightedDataPoints:ae,onSeriesMouseClick:G,graphDownload:_,dataDownload:b,language:B,showNAColor:X,minHeight:z,theme:C,ariaLabel:A,resetSelectionOnDoubleClick:M,styles:se,detailsOnClick:O,classNames:T,noOfTicks:K,animate:Z,dimmedOpacity:ie,precision:ue,customLayers:he}):l.jsx(bO,{data:e,graphTitle:n,backgroundColor:i,topMargin:r,bottomMargin:a,leftMargin:o,rightMargin:s,showLabels:c,showTicks:u,colors:h,sources:f,graphDescription:d,height:g,width:p,footNote:y,colorDomain:v,colorLegendTitle:m,padding:I,relativeHeight:j,tooltip:w,onSeriesMouseOver:S,refValues:P,showColorScale:W,graphID:D,radius:x,maxRadiusValue:$,maxValue:V,minValue:q,highlightedDataPoints:ae,onSeriesMouseClick:G,graphDownload:_,dataDownload:b,language:B,showNAColor:X,minHeight:z,theme:C,ariaLabel:A,resetSelectionOnDoubleClick:M,styles:se,detailsOnClick:O,classNames:T,noOfTicks:K,animate:Z,dimmedOpacity:ie,precision:ue,customLayers:he})}var Sh="http://www.w3.org/1999/xhtml";const xm={svg:"http://www.w3.org/2000/svg",xhtml:Sh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function $c(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),xm.hasOwnProperty(e)?{space:xm[e],local:t}:t}function DO(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Sh&&e.documentElement.namespaceURI===Sh?e.createElement(t):e.createElementNS(n,t)}}function MO(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function iv(t){var e=$c(t);return(e.local?MO:DO)(e)}function TO(){}function ad(t){return t==null?TO:function(){return this.querySelector(t)}}function kO(t){typeof t!="function"&&(t=ad(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var a=e[r],o=a.length,s=i[r]=new Array(o),c,u,h=0;h<o;++h)(c=a[h])&&(u=t.call(c,c.__data__,h,a))&&("__data__"in c&&(u.__data__=c.__data__),s[h]=u);return new fi(i,this._parents)}function jO(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function AO(){return[]}function rv(t){return t==null?AO:function(){return this.querySelectorAll(t)}}function _O(t){return function(){return jO(t.apply(this,arguments))}}function OO(t){typeof t=="function"?t=_O(t):t=rv(t);for(var e=this._groups,n=e.length,i=[],r=[],a=0;a<n;++a)for(var o=e[a],s=o.length,c,u=0;u<s;++u)(c=o[u])&&(i.push(t.call(c,c.__data__,u,o)),r.push(c));return new fi(i,r)}function av(t){return function(){return this.matches(t)}}function ov(t){return function(e){return e.matches(t)}}var NO=Array.prototype.find;function IO(t){return function(){return NO.call(this.children,t)}}function $O(){return this.firstElementChild}function LO(t){return this.select(t==null?$O:IO(typeof t=="function"?t:ov(t)))}var PO=Array.prototype.filter;function EO(){return Array.from(this.children)}function VO(t){return function(){return PO.call(this.children,t)}}function FO(t){return this.selectAll(t==null?EO:VO(typeof t=="function"?t:ov(t)))}function RO(t){typeof t!="function"&&(t=av(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var a=e[r],o=a.length,s=i[r]=[],c,u=0;u<o;++u)(c=a[u])&&t.call(c,c.__data__,u,a)&&s.push(c);return new fi(i,this._parents)}function sv(t){return new Array(t.length)}function BO(){return new fi(this._enter||this._groups.map(sv),this._parents)}function gc(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}gc.prototype={constructor:gc,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function HO(t){return function(){return t}}function WO(t,e,n,i,r,a){for(var o=0,s,c=e.length,u=a.length;o<u;++o)(s=e[o])?(s.__data__=a[o],i[o]=s):n[o]=new gc(t,a[o]);for(;o<c;++o)(s=e[o])&&(r[o]=s)}function zO(t,e,n,i,r,a,o){var s,c,u=new Map,h=e.length,f=a.length,d=new Array(h),g;for(s=0;s<h;++s)(c=e[s])&&(d[s]=g=o.call(c,c.__data__,s,e)+"",u.has(g)?r[s]=c:u.set(g,c));for(s=0;s<f;++s)g=o.call(t,a[s],s,a)+"",(c=u.get(g))?(i[s]=c,c.__data__=a[s],u.delete(g)):n[s]=new gc(t,a[s]);for(s=0;s<h;++s)(c=e[s])&&u.get(d[s])===c&&(r[s]=c)}function GO(t){return t.__data__}function YO(t,e){if(!arguments.length)return Array.from(this,GO);var n=e?zO:WO,i=this._parents,r=this._groups;typeof t!="function"&&(t=HO(t));for(var a=r.length,o=new Array(a),s=new Array(a),c=new Array(a),u=0;u<a;++u){var h=i[u],f=r[u],d=f.length,g=qO(t.call(h,h&&h.__data__,u,i)),p=g.length,y=s[u]=new Array(p),v=o[u]=new Array(p),m=c[u]=new Array(d);n(h,f,y,v,m,g,e);for(var I=0,j=0,w,S;I<p;++I)if(w=y[I]){for(I>=j&&(j=I+1);!(S=v[j])&&++j<p;);w._next=S||null}}return o=new fi(o,i),o._enter=s,o._exit=c,o}function qO(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function UO(){return new fi(this._exit||this._groups.map(sv),this._parents)}function XO(t,e,n){var i=this.enter(),r=this,a=this.exit();return typeof t=="function"?(i=t(i),i&&(i=i.selection())):i=i.append(t+""),e!=null&&(r=e(r),r&&(r=r.selection())),n==null?a.remove():n(a),i&&r?i.merge(r).order():r}function KO(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,a=i.length,o=Math.min(r,a),s=new Array(r),c=0;c<o;++c)for(var u=n[c],h=i[c],f=u.length,d=s[c]=new Array(f),g,p=0;p<f;++p)(g=u[p]||h[p])&&(d[p]=g);for(;c<r;++c)s[c]=n[c];return new fi(s,this._parents)}function QO(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i=t[e],r=i.length-1,a=i[r],o;--r>=0;)(o=i[r])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function ZO(t){t||(t=JO);function e(f,d){return f&&d?t(f.__data__,d.__data__):!f-!d}for(var n=this._groups,i=n.length,r=new Array(i),a=0;a<i;++a){for(var o=n[a],s=o.length,c=r[a]=new Array(s),u,h=0;h<s;++h)(u=o[h])&&(c[h]=u);c.sort(e)}return new fi(r,this._parents).order()}function JO(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function eN(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function tN(){return Array.from(this)}function nN(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,a=i.length;r<a;++r){var o=i[r];if(o)return o}return null}function iN(){let t=0;for(const e of this)++t;return t}function rN(){return!this.node()}function aN(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r=e[n],a=0,o=r.length,s;a<o;++a)(s=r[a])&&t.call(s,s.__data__,a,r);return this}function oN(t){return function(){this.removeAttribute(t)}}function sN(t){return function(){this.removeAttributeNS(t.space,t.local)}}function lN(t,e){return function(){this.setAttribute(t,e)}}function cN(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function uN(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function hN(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function fN(t,e){var n=$c(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((e==null?n.local?sN:oN:typeof e=="function"?n.local?hN:uN:n.local?cN:lN)(n,e))}function lv(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function dN(t){return function(){this.style.removeProperty(t)}}function gN(t,e,n){return function(){this.style.setProperty(t,e,n)}}function pN(t,e,n){return function(){var i=e.apply(this,arguments);i==null?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function mN(t,e,n){return arguments.length>1?this.each((e==null?dN:typeof e=="function"?pN:gN)(t,e,n??"")):Ho(this.node(),t)}function Ho(t,e){return t.style.getPropertyValue(e)||lv(t).getComputedStyle(t,null).getPropertyValue(e)}function yN(t){return function(){delete this[t]}}function xN(t,e){return function(){this[t]=e}}function vN(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function wN(t,e){return arguments.length>1?this.each((e==null?yN:typeof e=="function"?vN:xN)(t,e)):this.node()[t]}function cv(t){return t.trim().split(/^|\s+/)}function od(t){return t.classList||new uv(t)}function uv(t){this._node=t,this._names=cv(t.getAttribute("class")||"")}uv.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function hv(t,e){for(var n=od(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function fv(t,e){for(var n=od(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function bN(t){return function(){hv(this,t)}}function CN(t){return function(){fv(this,t)}}function SN(t,e){return function(){(e.apply(this,arguments)?hv:fv)(this,t)}}function DN(t,e){var n=cv(t+"");if(arguments.length<2){for(var i=od(this.node()),r=-1,a=n.length;++r<a;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof e=="function"?SN:e?bN:CN)(n,e))}function MN(){this.textContent=""}function TN(t){return function(){this.textContent=t}}function kN(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function jN(t){return arguments.length?this.each(t==null?MN:(typeof t=="function"?kN:TN)(t)):this.node().textContent}function AN(){this.innerHTML=""}function _N(t){return function(){this.innerHTML=t}}function ON(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function NN(t){return arguments.length?this.each(t==null?AN:(typeof t=="function"?ON:_N)(t)):this.node().innerHTML}function IN(){this.nextSibling&&this.parentNode.appendChild(this)}function $N(){return this.each(IN)}function LN(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function PN(){return this.each(LN)}function EN(t){var e=typeof t=="function"?t:iv(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function VN(){return null}function FN(t,e){var n=typeof t=="function"?t:iv(t),i=e==null?VN:typeof e=="function"?e:ad(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function RN(){var t=this.parentNode;t&&t.removeChild(this)}function BN(){return this.each(RN)}function HN(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function WN(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function zN(t){return this.select(t?WN:HN)}function GN(t){return arguments.length?this.property("__data__",t):this.node().__data__}function YN(t){return function(e){t.call(this,e,this.__data__)}}function qN(t){return t.trim().split(/^|\s+/).map(function(e){var n="",i=e.indexOf(".");return i>=0&&(n=e.slice(i+1),e=e.slice(0,i)),{type:e,name:n}})}function UN(t){return function(){var e=this.__on;if(e){for(var n=0,i=-1,r=e.length,a;n<r;++n)a=e[n],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++i]=a;++i?e.length=i:delete this.__on}}}function XN(t,e,n){return function(){var i=this.__on,r,a=YN(e);if(i){for(var o=0,s=i.length;o<s;++o)if((r=i[o]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=a,r.options=n),r.value=e;return}}this.addEventListener(t.type,a,n),r={type:t.type,name:t.name,value:e,listener:a,options:n},i?i.push(r):this.__on=[r]}}function KN(t,e,n){var i=qN(t+""),r,a=i.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,u=s.length,h;c<u;++c)for(r=0,h=s[c];r<a;++r)if((o=i[r]).type===h.type&&o.name===h.name)return h.value}return}for(s=e?XN:UN,r=0;r<a;++r)this.each(s(i[r],e,n));return this}function dv(t,e,n){var i=lv(t),r=i.CustomEvent;typeof r=="function"?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function QN(t,e){return function(){return dv(this,t,e)}}function ZN(t,e){return function(){return dv(this,t,e.apply(this,arguments))}}function JN(t,e){return this.each((typeof e=="function"?ZN:QN)(t,e))}function*eI(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,a=i.length,o;r<a;++r)(o=i[r])&&(yield o)}var gv=[null];function fi(t,e){this._groups=t,this._parents=e}function il(){return new fi([[document.documentElement]],gv)}function tI(){return this}fi.prototype=il.prototype={constructor:fi,select:kO,selectAll:OO,selectChild:LO,selectChildren:FO,filter:RO,data:YO,enter:BO,exit:UO,join:XO,merge:KO,selection:tI,order:QO,sort:ZO,call:eN,nodes:tN,node:nN,size:iN,empty:rN,each:aN,attr:fN,style:mN,property:wN,classed:DN,text:jN,html:NN,raise:$N,lower:PN,append:EN,insert:FN,remove:BN,clone:zN,datum:GN,on:KN,dispatch:JN,[Symbol.iterator]:eI};function bt(t){return typeof t=="string"?new fi([[document.querySelector(t)]],[document.documentElement]):new fi([[t]],gv)}function nI(t){let e;for(;e=t.sourceEvent;)t=e;return t}function En(t,e){if(t=nI(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,i=i.matrixTransform(e.getScreenCTM().inverse()),[i.x,i.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}function ao(t){const{areaSettings:e,width:n,height:i,scale:r,animate:a,isInView:o}=t;return l.jsx(l.Fragment,{children:e.map((s,c)=>l.jsx($e.g,{children:s.coordinates[0]===null&&s.coordinates[1]===null?null:l.jsx($e.g,{children:l.jsx($e.rect,{style:{fill:s.color||Pe.light.grays["gray-300"],strokeWidth:s.strokeWidth,...s.style||{}},className:s.className,y:0,height:i,variants:{initial:{width:0,x:s.coordinates[0]?r(s.coordinates[0]):0,opacity:1},whileInView:{width:s.coordinates[1]?r(s.coordinates[1])-(s.coordinates[0]?r(s.coordinates[0]):0):n-(s.coordinates[0]?r(s.coordinates[0]):0),x:s.coordinates[0]?r(s.coordinates[0]):0,opacity:1,transition:{duration:a.duration}}},initial:"initial",animate:o?"whileInView":"initial",exit:{opacity:0,width:0,transition:{duration:a.duration}}})})},c))})}function iI(t){const{areaSettings:e,width:n,height:i,scaleX:r,scaleY:a,animate:o,isInView:s}=t;return l.jsx(l.Fragment,{children:e.map((c,u)=>l.jsx($e.g,{children:c.coordinates.filter(h=>h===null).length===4?null:l.jsx($e.g,{children:l.jsx($e.rect,{style:{fill:c.color||Pe.light.grays["gray-300"],strokeWidth:c.strokeWidth,...c.style||{}},className:c.className,variants:{initial:{x:c.coordinates[0]?r(c.coordinates[0]):0,width:0,y:c.coordinates[3]?a(c.coordinates[3]):0,height:0},whileInView:{x:c.coordinates[0]?r(c.coordinates[0]):0,width:c.coordinates[1]?r(c.coordinates[1])-(c.coordinates[0]?r(c.coordinates[0]):0):n-(c.coordinates[0]?r(c.coordinates[0]):0),y:c.coordinates[3]?a(c.coordinates[3]):0,height:c.coordinates[2]!==null?a(c.coordinates[2])-(c.coordinates[3]?a(c.coordinates[3]):0):i-(c.coordinates[3]?i-a(c.coordinates[3]):0),transition:{duration:o.duration}}},initial:"initial",animate:s?"whileInView":"initial",exit:{opacity:0,width:0,height:0,transition:{duration:o.duration}}})})},`${u}`))})}function rI(t){const{data:e,width:n,height:i,lineColors:r,labels:a,sameAxes:o,dateFormat:s,showValues:c,noOfXTicks:u,rightMargin:h,leftMargin:f,topMargin:d,bottomMargin:g,tooltip:p,highlightAreaSettings:y,onSeriesMouseOver:v,animate:m,strokeWidth:I,showDots:j,noOfYTicks:w,lineSuffixes:S,linePrefixes:P,minDate:W,maxDate:D,curveType:x,styles:$,classNames:V,precision:q,customLayers:ae}=t,G=k.useRef(null),_=ct(G,{once:m.once,amount:m.amount}),[b,B]=k.useState(!1);k.useEffect(()=>{if(_&&!b){const ne=setTimeout(()=>{B(!0)},(m.duration+.5)*1e3);return()=>clearTimeout(ne)}},[_,b,m.duration]);const X=x==="linear"?Oi:x==="step"?Or:x==="stepAfter"?Ir:x==="stepBefore"?Nr:_r,[z,C]=k.useState(void 0),[A,M]=k.useState(void 0),[O,K]=k.useState(void 0),Q={top:d,bottom:g,left:f+50,right:h+65},se=k.useRef(null),T=tt(e.map(ne=>({...ne,date:ze(`${ne.date}`,s,new Date)})),"date"),Z=y.map(ne=>({...ne,coordinates:[ne.coordinates[0]===null?null:ze(`${ne.coordinates[0]}`,s,new Date),ne.coordinates[1]===null?null:ze(`${ne.coordinates[1]}`,s,new Date)]})),ie=n-Q.left-Q.right,ue=i-Q.top-Q.bottom,he=W?ze(`${W}`,s,new Date):T[0].date,Y=D?ze(`${D}`,s,new Date):T[T.length-1].date,ge=Math.min(...T.map(ne=>ne.y1).filter(ne=>ne!=null))!==1/0?Math.min(...T.map(ne=>ne.y2).filter(ne=>ne!=null))>0?0:Math.min(...T.map(ne=>ne.y1).filter(ne=>ne!=null)):0,oe=Math.min(...T.map(ne=>ne.y2).filter(ne=>ne!=null))!==1/0?Math.min(...T.map(ne=>ne.y2).filter(ne=>ne!=null))>0?0:Math.min(...T.map(ne=>ne.y2).filter(ne=>ne!=null)):0,ce=Math.max(...T.map(ne=>ne.y1).filter(ne=>ne!=null))!==1/0?Math.max(...T.map(ne=>ne.y1).filter(ne=>ne!=null)):0,N=Math.max(...T.map(ne=>ne.y2).filter(ne=>ne!=null))!==1/0?Math.max(...T.map(ne=>ne.y2).filter(ne=>ne!=null)):0,U=ge<oe?ge:oe,ve=ce>N?ce:N,J=Zr().domain([he,Y]).range([0,ie]),R=ut().domain([o?U:ge,o?ve>0?ve:0:ce>0?ce:0]).range([ue,0]).nice(),le=ut().domain([o?U:oe,o?ve>0?ve:0:N>0?N:0]).range([ue,0]).nice(),ee=ii().defined(ne=>!je(ne.y1)).x(ne=>J(ne.date)).y(ne=>R(ne.y1)).curve(X),de=ii().defined(ne=>!je(ne.y2)).x(ne=>J(ne.date)).y(ne=>le(ne.y2)).curve(X),te=R.ticks(w),Me=le.ticks(w),be=J.ticks(u);return k.useEffect(()=>{const ne=xe=>{const Ae=T[Qr(T.map(ke=>ke.date),J.invert(En(xe)[0]),1)];C(Ae||T[T.length-1]),v?.(Ae||T[T.length-1]),K(xe.clientY),M(xe.clientX)},De=()=>{C(void 0),M(void 0),K(void 0),v?.(void 0)};bt(se.current).on("mousemove",ne).on("mouseout",De)},[J,T,v]),l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{width:`${n}px`,height:`${i}px`,viewBox:`0 0 ${n} ${i}`,direction:"ltr",ref:G,children:l.jsxs("g",{transform:`translate(${Q.left},${Q.top})`,children:[l.jsx(ao,{areaSettings:Z,width:ie,height:ue,scale:J,animate:m,isInView:_}),l.jsxs("g",{children:[te.map((ne,De)=>l.jsxs("g",{children:[l.jsx("line",{y1:R(ne),y2:R(ne),x1:-15,x2:-20,style:{stroke:r[0],strokeWidth:1,...$?.yAxis?.gridLines||{}},className:V?.yAxis?.gridLines}),l.jsx("text",{x:-25,y:R(ne),dy:"0.33em",className:Ce.cn("text-xs",V?.yAxis?.labels),style:{textAnchor:"end",fill:r[0],...$?.yAxis?.labels||{}},children:qe(ne,"NA",q,P[0],S[0])})]},De)),l.jsx(Dt,{y1:0,y2:ue,x1:-15,x2:-15,classNames:{axis:V?.xAxis?.axis},styles:{axis:{stroke:r[0],...$?.xAxis?.axis||{}}}}),l.jsx(Nt,{x:10-Q.left,y:ue/2,style:{fill:r[0],...$?.yAxis?.title||{}},className:V?.yAxis?.title,text:a[0].length>100?`${a[0].substring(0,100)}...`:a[0],rotate90:!0})]}),l.jsxs("g",{children:[Me.map((ne,De)=>l.jsxs("g",{children:[l.jsx("line",{y1:le(ne),y2:le(ne),x1:ie+15,x2:ie+20,style:{stroke:r[1],strokeWidth:1,...$?.yAxis?.gridLines||{}},className:V?.yAxis?.gridLines}),l.jsx("text",{x:ie+25,y:le(ne),dy:"0.33em",dx:-2,style:{textAnchor:"start",fill:r[1],...$?.yAxis?.labels||{}},className:Ce.cn("text-xs",V?.yAxis?.labels),children:qe(ne,"NA",q,P[1],S[1])})]},De)),l.jsx(Dt,{y1:0,y2:ue,x1:ie+15,x2:ie+15,classNames:{axis:V?.xAxis?.axis},styles:{axis:{stroke:r[1],...$?.xAxis?.axis||{}}}}),l.jsx(Nt,{x:ie+Q.right-15,y:ue/2,style:{fill:r[1],...$?.yAxis?.title||{}},className:V?.yAxis?.title,text:a[1].length>100?`${a[1].substring(0,100)}...`:a[1],rotate90:!0})]}),l.jsxs("g",{children:[l.jsx(Dt,{y1:ue,y2:ue,x1:-15,x2:ie+15,classNames:{axis:V?.xAxis?.axis},styles:{axis:$?.xAxis?.axis}}),l.jsx(Rn,{values:be.map(ne=>ft(ne,s)),x:be.map(ne=>J(ne)),y1:0,y2:ue,styles:{gridLines:$?.xAxis?.gridLines,labels:$?.xAxis?.labels},classNames:{gridLines:Ce.cn("opacity-0",V?.xAxis?.gridLines),labels:Ce.cn("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",V?.xAxis?.labels)},labelType:"primary",showGridLines:!0,precision:q})]}),ae.filter(ne=>ne.position==="before").map(ne=>ne.layer),l.jsxs("g",{children:[l.jsx($e.path,{style:{stroke:r[0],strokeWidth:I,fill:"none"},exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{pathLength:0,d:ee(T.filter(ne=>!je(ne.y1)))||"",opacity:1},whileInView:{pathLength:1,d:ee(T.filter(ne=>!je(ne.y1)))||"",opacity:1,transition:{duration:m.duration}}},initial:"initial",animate:_?"whileInView":"initial"}),l.jsx($e.path,{d:de(T.filter(ne=>!je(ne.y2)))||"",style:{stroke:r[1],strokeWidth:I,fill:"none"},exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{pathLength:0,d:de(T.filter(ne=>!je(ne.y2)))||"",opacity:1},whileInView:{pathLength:1,d:de(T.filter(ne=>!je(ne.y2)))||"",opacity:1,transition:{duration:m.duration}}},initial:"initial",animate:_?"whileInView":"initial"}),z?l.jsx("line",{y1:0,y2:ue,x1:J(z.date),x2:J(z.date),className:Ce.cn("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",V?.mouseOverLine),style:$?.mouseOverLine}):null]}),l.jsx("g",{children:T.map((ne,De)=>l.jsxs($e.g,{children:[je(ne.y1)?null:l.jsxs(l.Fragment,{children:[j?l.jsx($e.circle,{r:ie/T.length<5?0:ie/T.length<20?2:4,style:{fill:r[0]},exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{opacity:0,cx:J(ne.date),cy:R(ne.y1)},whileInView:{opacity:1,transition:{duration:b?m.duration:.5,delay:b?0:m.duration},cx:J(ne.date),cy:R(ne.y1)}},initial:"initial",animate:_?"whileInView":"initial"}):null,c?l.jsx($e.text,{dy:je(ne.y2)||ne.y2<ne.y1?-8:"1em",style:{fill:r[0],textAnchor:"middle",...$?.graphObjectValues||{}},className:Ce.cn("graph-value graph-value-line-1 text-xs font-bold",V?.graphObjectValues),exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{opacity:0,x:J(ne.date),y:le(ne.y1)},whileInView:{opacity:1,x:J(ne.date),y:le(ne.y1),transition:{duration:b?m.duration:.5,delay:b?0:m.duration}}},initial:"initial",animate:_?"whileInView":"initial",children:qe(ne.y1,"NA",q,P[0],S[0])}):null]}),je(ne.y2)?null:l.jsxs(l.Fragment,{children:[j?l.jsx($e.circle,{r:ie/T.length<5?0:ie/T.length<20?2:4,style:{fill:r[1]},exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{opacity:0,cx:J(ne.date),cy:le(ne.y2)},whileInView:{opacity:1,transition:{duration:b?m.duration:.5,delay:b?0:m.duration},cx:J(ne.date),cy:le(ne.y2)}},initial:"initial",animate:_?"whileInView":"initial"}):null,c?l.jsx($e.text,{dy:je(ne.y1)||ne.y1<ne.y2?-8:"1em",style:{fill:r[1],textAnchor:"middle",...$?.graphObjectValues||{}},className:Ce.cn("graph-value graph-value-line-2 text-xs font-bold",V?.graphObjectValues),exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{opacity:0,x:J(ne.date),y:le(ne.y2)},whileInView:{opacity:1,x:J(ne.date),y:le(ne.y2),transition:{duration:b?m.duration:.5,delay:b?0:m.duration}}},initial:"initial",animate:_?"whileInView":"initial",children:qe(ne.y2,"NA",q,P[1],S[1])}):null]})]},De))}),ae.filter(ne=>ne.position==="after").map(ne=>ne.layer),l.jsx("rect",{ref:se,style:{fill:"none",pointerEvents:"all"},width:ie,height:ue})]})}),z&&p&&A&&O?l.jsx(st,{data:z,body:p,xPos:A,yPos:O,backgroundStyle:$?.tooltip,className:V?.tooltip}):null]})}function Hi(t){const{colorLegendTitle:e,colorDomain:n,colors:i,showNAColor:r,width:a,isCenter:o,className:s,labelsToBeHidden:c=[]}=t;return l.jsx("div",{className:Ce.cn("flex leading-0",o&&"justify-center",s),style:{maxWidth:a?`${a}px`:"none"},"aria-label":"Color legend",children:l.jsxs("div",{children:[e&&e!==""?l.jsx(Ce.P,{size:"sm",marginBottom:"2xs",className:o?"text-center":"",children:e}):null,l.jsxs("div",{className:"flex flex-wrap mb-0 gap-3.5",children:[n.map((u,h)=>c.includes(u)?null:l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:i[h%i.length]}}),u===""?null:l.jsx(Ce.P,{size:"sm",marginBottom:"none",children:u})]},h)),r?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:Pe.gray}}),l.jsx(Ce.P,{size:"sm",marginBottom:"none",children:"NA"})]}):null]})]})})}function pv(t){const{data:e,graphTitle:n,sources:i,graphDescription:r,height:a,width:o,footNote:s,noOfXTicks:c=10,dateFormat:u="yyyy",showValues:h=!1,padding:f,lineColors:d=[Pe.light.categoricalColors.colors[0],Pe.light.categoricalColors.colors[1]],sameAxes:g=!1,backgroundColor:p=!1,leftMargin:y=80,rightMargin:v=80,topMargin:m=20,bottomMargin:I=25,labels:j,lineSuffixes:w=["",""],linePrefixes:S=["",""],tooltip:P,highlightAreaSettings:W=[],relativeHeight:D,onSeriesMouseOver:x,graphID:$,graphDownload:V=!1,dataDownload:q=!1,animate:ae=!1,strokeWidth:G=2,showDots:_=!0,language:b="en",showColorScale:B=!0,minHeight:X=0,colorLegendTitle:z,theme:C="light",ariaLabel:A,noOfYTicks:M=5,maxDate:O,minDate:K,curveType:Q="curve",styles:se,classNames:T,precision:Z=2,customLayers:ie=[]}=t,[ue,he]=k.useState(0),[Y,ge]=k.useState(0),oe=k.useRef(null),ce=k.useRef(null);return k.useEffect(()=>{const N=new ResizeObserver(U=>{he(o||U[0].target.clientWidth||620),ge(a||U[0].target.clientHeight||480)});return oe.current&&(ge(oe.current.clientHeight||480),he(oe.current.clientWidth||620),o||N.observe(oe.current)),()=>N.disconnect()},[o,a]),l.jsx("div",{className:`${C||"light"} flex ${o?"w-fit grow-0":"w-full grow"}`,dir:b==="he"||b==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${p?p===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${b||"en"}`,T?.graphContainer),style:{...se?.graphContainer||{},...p&&p!==!0?{backgroundColor:p}:{}},id:$,ref:ce,"aria-label":A||`${n?`The graph shows ${n}. `:""}This is a line chart that show trends for two datasets over time.${r?` ${r}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:p?f||"1rem":f||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||r||V||q?l.jsx(Qe,{styles:{title:se?.title,description:se?.description},classNames:{title:T?.title,description:T?.description},graphTitle:n,graphDescription:r,width:o,graphDownload:V?ce.current:void 0,dataDownload:q?e.map(N=>N.data).filter(N=>N!==void 0).length>0?e.map(N=>N.data).filter(N=>N!==void 0):e.filter(N=>N!==void 0):null}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[B?null:l.jsx(Hi,{colorDomain:j,colorLegendTitle:z,colors:d,showNAColor:!1}),l.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:oe,"aria-label":"Graph area",children:(o||ue)&&(a||Y)?l.jsx(rI,{data:e,sameAxes:g,lineColors:d,width:o||ue,height:Math.max(X,a||(D?X?(o||ue)*D>X?(o||ue)*D:X:(o||ue)*D:Y)),dateFormat:u,showValues:h,noOfXTicks:c,leftMargin:y,rightMargin:v,topMargin:m,bottomMargin:I,labels:j,highlightAreaSettings:W,tooltip:P,onSeriesMouseOver:x,animate:ae===!0?{duration:.5,once:!0,amount:.5}:ae||{duration:0,once:!0,amount:0},strokeWidth:G,showDots:_,noOfYTicks:M,lineSuffixes:w,linePrefixes:S,minDate:K,maxDate:O,curveType:Q,styles:se,classNames:T,precision:Z,customLayers:ie}):null})]})}),i||s?l.jsx(et,{styles:{footnote:se?.footnote,source:se?.source},classNames:{footnote:T?.footnote,source:T?.source},sources:i,footNote:s,width:o}):null]})})})})}function sd(t){var e,n,i=t.length;if(i===1)e=0,n=t[0][1];else{for(var r=0,a=0,o=0,s=0,c,u,h,f=0;f<i;f++)c=t[f],u=c[0],h=c[1],r+=u,a+=h,o+=u*u,s+=u*h;e=(i*s-r*a)/(i*o-r*r),n=a/i-e*r/i}return{m:e,b:n}}function ld(t){return function(e){return t.b+t.m*e}}function aI(t,e,n){var i=t.length,r=[],a=n;for(r[n]=t[t.length-1];a>0;)r[a-1]=t[e[i][a]-1],i=e[i][a]-1,a--;return r}function oI(t,e){var n=[],i=[],r,a,o=0;for(r=0;r<t.length+1;r++){var s=[],c=[];for(a=0;a<e+1;a++)s.push(0),c.push(0);n.push(s),i.push(c)}for(r=1;r<e+1;r++)for(n[1][r]=1,i[1][r]=0,a=2;a<t.length+1;a++)i[a][r]=Number.POSITIVE_INFINITY;for(var u=2;u<t.length+1;u++){for(var h=0,f=0,d=0,g=0,p=1;p<u+1;p++){var y=u-p+1,v=t[y-1];if(d++,h+=v,f+=v*v,o=f-h*h/d,g=y-1,g!==0)for(a=2;a<e+1;a++)i[u][a]>=o+i[g][a-1]&&(n[u][a]=y,i[u][a]=o+i[g][a-1])}n[u][1]=1,i[u][1]=o}return{lowerClassLimits:n,varianceCombinations:i}}function sI(t,e){if(e>t.length)return null;t=t.slice().sort(function(r,a){return r-a});var n=oI(t,e),i=n.lowerClassLimits;return aI(t,i,e)}function oo(t,e,n){const i={x:e.x,y:e.y},r={x:t.x-i.x,y:t.y-i.y},a=Math.sqrt(r.x**2+r.y**2),o={x:r.x/a,y:r.y/a};return{x:i.x+n*o.x,y:i.y+n*o.y}}function rl(t=8){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",n=`${e}0123456789`;let i=e.charAt(Math.floor(Math.random()*e.length));for(let r=1;r<t;r+=1)i+=n.charAt(Math.floor(Math.random()*n.length));return i}function cd(t){const{color:e,x1:n,x2:i,y1:r,y2:a,className:o,style:s,animate:c,isInView:u,graphWidth:h,graphHeight:f}=t,d=rl(8);return l.jsxs("g",{children:[l.jsx("defs",{children:l.jsx("clipPath",{id:d,children:l.jsx("rect",{x:"0",y:"0",width:h,height:f})})}),l.jsx(mt,{children:l.jsx($e.line,{clipPath:`url(#${d})`,className:Ce.cn("undp-ref-line",e?void 0:"stroke-primary-gray-700 dark:stroke-primary-gray-300",o),style:{...e&&{stroke:e},fill:"none",...s||{}},exit:{opacity:0,transition:{duration:c.duration}},variants:{initial:{y1:r,y2:r,x1:n,x2:n},whileInView:{y1:r,y2:a,x1:n,x2:i,transition:{duration:c.duration}}},initial:"initial",animate:u?"whileInView":"initial"})})]})}function so(t){const{connectorsSettings:e,text:n,color:i,labelSettings:r,classNames:a,styles:o,animate:s,isInView:c}=t;return l.jsxs($e.g,{exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:c?"whileInView":"initial",children:[e?l.jsxs(l.Fragment,{children:[l.jsx("circle",{cy:e.cy,cx:e.cx,r:e.circleRadius,className:Ce.cn(i?"":"stroke-primary-gray-700 dark:stroke-primary-gray-300",a?.connector),style:{fill:"none",strokeWidth:e.strokeWidth,...i?{stroke:i}:{},...o?.connector||{}}}),l.jsx("line",{y1:e.y1,x1:e.x1,y2:e.y2,x2:e.x2,className:Ce.cn(i?"":"stroke-primary-gray-700 dark:stroke-primary-gray-300",a?.connector),style:{fill:"none",strokeWidth:e.strokeWidth,...i?{stroke:i}:{},...o?.connector||{}}})]}):null,l.jsx("foreignObject",{y:r.y,x:r.x,width:r.width,height:1,style:{overflow:"visible"},children:l.jsx("p",{className:Ce.cn("text-sm leading-[1.25] m-0 whitespace-normal",r.fontWeight==="bold"?"font-bold":r.fontWeight==="medium"?"font-medium":"font-normal",r.align==="right"?"text-right":r.align==="center"?"text-center":"text-left",i?void 0:"text-primary-gray-700 dark:text-primary-gray-300",a?.text),style:{maxWidth:r.maxWidth||"auto",...i?{color:i}:{},...o?.text||{}},children:n})})]})}function lI(t,e){if(t.length<4||t.length%2!==0)return"";let n=`M ${t[0]} ${t[1]}`;for(let i=2;i<t.length;i+=2)n+=` L ${t[i]} ${t[i+1]}`;return e===!1||(n+=" Z"),n}function lo(t){const{areaSettings:e,scaleX:n,scaleY:i,animate:r,isInView:a}=t;return l.jsx(l.Fragment,{children:e.map(o=>l.jsx($e.g,{variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:r.duration}}},initial:"initial",animate:a?"whileInView":"initial",children:o.coordinates.length!==4?l.jsx("path",{d:lI(o.coordinates.map((s,c)=>c%2===0?n(s):i(s)),o.closePath),style:{strokeWidth:o.strokeWidth||0,...o.coordinates.length>4?o.color&&{fill:o.color}:{fill:"none"},...o.color&&{stroke:o.color},...o.style||{}},className:Ce.cn(o.color?"":"stroke-primary-gray-300 dark:stroke-primary-gray-550 fill-primary-gray-300 dark:fill-primary-gray-550",o.className)}):l.jsx("line",{x1:n(o.coordinates[0]),y1:i(o.coordinates[1]),x2:n(o.coordinates[2]),y2:i(o.coordinates[3]),style:{...o.color&&{stroke:o.color},fill:"none",strokeWidth:o.strokeWidth||1,...o.style||{}},className:Ce.cn(o.color?"":"stroke-primary-gray-300 dark:stroke-primary-gray-550",o.className)})},o.coordinates.map(s=>s instanceof Date?s.toISOString():s.toString()).join("~")))})}function cI(t){const{data:e,width:n,height:i,lineColor:r,suffix:a,prefix:o,dateFormat:s,highlightAreaSettings:c,showValues:u,noOfXTicks:h,rightMargin:f,leftMargin:d,topMargin:g,bottomMargin:p,tooltip:y,onSeriesMouseOver:v,refValues:m,minValue:I,maxValue:j,animate:w,rtl:S,strokeWidth:P,showDots:W,annotations:D,customHighlightAreaSettings:x,regressionLine:$,showIntervalDots:V,showIntervalValues:q,intervalLineStrokeWidth:ae,intervalLineColors:G,intervalAreaColor:_,intervalAreaOpacity:b,yAxisTitle:B,noOfYTicks:X,minDate:z,maxDate:C,curveType:A,styles:M,classNames:O,precision:K,customLayers:Q}=t,se=k.useRef(null),T=ct(se,{once:w.once,amount:w.amount}),[Z,ie]=k.useState(!1);k.useEffect(()=>{if(T&&!Z){const H=setTimeout(()=>{ie(!0)},(w.duration+.5)*1e3);return()=>clearTimeout(H)}},[T,Z,w.duration]);const ue=A==="linear"?Oi:A==="step"?Or:A==="stepAfter"?Ir:A==="stepBefore"?Nr:_r,[he,Y]=k.useState(void 0),[ge,oe]=k.useState(void 0),[ce,N]=k.useState(void 0),U={top:g,bottom:p,left:B?d+30:d,right:f},ve=k.useRef(null),J=tt(e.filter(H=>!je(H.y)).map(H=>({date:ze(`${H.date}`,s,new Date),y:H.y,yMin:je(H.yMin)?H.y:H.yMin,yMax:je(H.yMax)?H.y:H.yMax,data:H.data})),"date"),R=c.map(H=>({...H,coordinates:[H.coordinates[0]===null?null:ze(`${H.coordinates[0]}`,s,new Date),H.coordinates[1]===null?null:ze(`${H.coordinates[1]}`,s,new Date)]})),le=x.map(H=>({...H,coordinates:H.coordinates.map((Oe,Ee)=>Ee%2===0?ze(`${Oe}`,s,new Date):Oe)})),ee=n-U.left-U.right,de=i-U.top-U.bottom,te=z?ze(`${z}`,s,new Date):J[0].date,Me=C?ze(`${C}`,s,new Date):J[J.length-1].date,be=je(I)?Math.min(...J.map(H=>Math.min(H.y,H.yMax,H.yMin)))?Math.min(...J.map(H=>Math.min(H.y,H.yMax,H.yMin)))>0?0:Math.min(...J.map(H=>Math.min(H.y,H.yMax,H.yMin))):0:I,ne=Math.max(...J.map(H=>Math.max(H.y,H.yMax,H.yMin)))?Math.max(...J.map(H=>Math.max(H.y,H.yMax,H.yMin))):0,De=Zr().domain([te,Me]).range([0,ee]),xe=ut().domain([be,je(j)?ne>0?ne:0:j]).range([de,0]).nice(),Ae=ii().x(H=>De(H.date)).y(H=>xe(H.y)).curve(ue),ke=ii().x(H=>De(H.date)).y(H=>xe(H.yMin)).curve(ue),me=ii().x(H=>De(H.date)).y(H=>xe(H.yMax)).curve(ue),Se=No().x(H=>De(H.date)).y0(H=>xe(H.yMin)).y1(H=>xe(H.yMax)).curve(ue),Le=xe.ticks(X),F=De.ticks(h);k.useEffect(()=>{const H=Ee=>{const it=J[Qr(J.map(Tt=>Tt.date),De.invert(En(Ee)[0]),1)];Y(it||J[J.length-1]),v?.(it||J[J.length-1]),N(Ee.clientY),oe(Ee.clientX)},Oe=()=>{Y(void 0),oe(void 0),N(void 0),v?.(void 0)};bt(ve.current).on("mousemove",H).on("mouseout",Oe)},[De,J,v]);const Ie=sd(J.filter(H=>!je(H.date)&&!je(H.y)).map(H=>[De(H.date),xe(H.y)])),Ve=ld(Ie);return l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{width:`${n}px`,height:`${i}px`,viewBox:`0 0 ${n} ${i}`,direction:"ltr",ref:se,children:l.jsxs("g",{transform:`translate(${U.left},${U.top})`,children:[l.jsx(ao,{areaSettings:R,width:ee,height:de,scale:De,animate:w,isInView:T}),l.jsx(lo,{areaSettings:le,scaleX:De,scaleY:xe,animate:w,isInView:T}),l.jsxs("g",{children:[l.jsx(ri,{values:Le.filter(H=>H!==0),y:Le.filter(H=>H!==0).map(H=>xe(H)),x1:0-d,x2:ee+U.right,styles:{gridLines:M?.yAxis?.gridLines,labels:M?.yAxis?.labels},classNames:{gridLines:O?.yAxis?.gridLines,labels:O?.yAxis?.labels},suffix:a,prefix:o,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:K}),l.jsx(Dt,{y1:xe(be<0?0:be),y2:xe(be<0?0:be),x1:0-d,x2:ee+U.right,label:qe(be<0?0:be,"NA",K,o,a),labelPos:{x:0-d,y:xe(be<0?0:be),dx:0,dy:ne<0?"1em":-5},classNames:{axis:O?.xAxis?.axis,label:O?.yAxis?.labels},styles:{axis:M?.xAxis?.axis,label:M?.yAxis?.labels}}),l.jsx(Nt,{x:0-d+15,y:de/2,style:M?.yAxis?.title,className:O?.yAxis?.title,text:B,rotate90:!0})]}),l.jsx("g",{children:F.map((H,Oe)=>l.jsx("g",{children:l.jsx("text",{y:de,x:De(H),style:{textAnchor:"middle"},className:"fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",dy:15,children:ft(H,s)})},Oe))}),Q.filter(H=>H.position==="before").map(H=>H.layer),l.jsx($e.path,{style:{fill:_},exit:{opacity:0,transition:{duration:w.duration}},variants:{initial:{opacity:0,d:Se(J)||""},whileInView:{opacity:b,d:Se(J)||"",transition:{duration:w.duration}}},initial:"initial",animate:T?"whileInView":"initial"}),ae?l.jsxs(l.Fragment,{children:[l.jsx($e.path,{style:{stroke:G[0],fill:"none",strokeWidth:ae},exit:{opacity:0,transition:{duration:w.duration}},variants:{initial:{pathLength:0,d:ke(J)||"",opacity:1},whileInView:{pathLength:1,d:ke(J)||"",opacity:1,transition:{duration:w.duration}}},initial:"initial",animate:T?"whileInView":"initial"}),l.jsx($e.path,{style:{stroke:G[1],fill:"none",strokeWidth:ae},exit:{opacity:0,transition:{duration:w.duration}},variants:{initial:{pathLength:0,d:me(J)||"",opacity:1},whileInView:{pathLength:1,d:me(J)||"",opacity:1,transition:{duration:w.duration}}},initial:"initial",animate:T?"whileInView":"initial"})]}):null,l.jsx($e.path,{style:{stroke:r,fill:"none",strokeWidth:P},exit:{opacity:0,transition:{duration:w.duration}},variants:{initial:{pathLength:0,d:Ae(J)||"",opacity:1},whileInView:{pathLength:1,d:Ae(J)||"",opacity:1,transition:{duration:w.duration}}},initial:"initial",animate:T?"whileInView":"initial"}),he?l.jsx("line",{y1:0,y2:de,x1:De(he.date),x2:De(he.date),className:Ce.cn("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",O?.mouseOverLine),style:M?.mouseOverLine}):null,l.jsx("g",{children:J.map((H,Oe)=>l.jsx($e.g,{children:je(H.y)?null:l.jsxs(l.Fragment,{children:[W?l.jsx($e.circle,{r:ee/J.length<5?0:ee/J.length<20?2:4,style:{fill:r},exit:{opacity:0,transition:{duration:w.duration}},variants:{initial:{opacity:0,cx:De(H.date),cy:xe(H.y)},whileInView:{opacity:1,transition:{duration:Z?w.duration:.5,delay:Z?0:w.duration},cx:De(H.date),cy:xe(H.y)}},initial:"initial",animate:T?"whileInView":"initial"}):null,V?l.jsxs(l.Fragment,{children:[l.jsx($e.circle,{r:ee/J.length<5?0:ee/J.length<20?2:4,style:{fill:G[0]},exit:{opacity:0,transition:{duration:w.duration}},variants:{initial:{opacity:0,cx:De(H.date),cy:xe(H.yMin)},whileInView:{opacity:1,transition:{duration:Z?w.duration:.5,delay:Z?0:w.duration},cx:De(H.date),cy:xe(H.yMin)}},initial:"initial",animate:T?"whileInView":"initial"}),l.jsx($e.circle,{r:ee/J.length<5?0:ee/J.length<20?2:4,style:{fill:G[1]},exit:{opacity:0,transition:{duration:w.duration}},variants:{initial:{opacity:0,cx:De(H.date),cy:xe(H.yMax)},whileInView:{opacity:1,transition:{duration:Z?w.duration:.5,delay:Z?0:w.duration},cx:De(H.date),cy:xe(H.yMax)}},initial:"initial",animate:T?"whileInView":"initial"})]}):null,u?l.jsx($e.text,{dy:-8,style:{fill:r,textAnchor:"middle",...M?.graphObjectValues||{}},className:Ce.cn("graph-value text-xs font-bold",O?.graphObjectValues),exit:{opacity:0,transition:{duration:w.duration}},variants:{initial:{opacity:0,x:De(H.date),y:xe(H.y)},whileInView:{opacity:1,x:De(H.date),y:xe(H.y),transition:{duration:Z?w.duration:.5,delay:Z?0:w.duration}}},initial:"initial",animate:T?"whileInView":"initial",children:qe(H.y,"NA",K,o,a)}):null,q?l.jsxs(l.Fragment,{children:[l.jsx($e.text,{dy:"1em",style:{fill:G[0],textAnchor:"middle",...M?.graphObjectValues||{}},className:Ce.cn("text-xs font-bold",O?.graphObjectValues),exit:{opacity:0,transition:{duration:w.duration}},variants:{initial:{opacity:0,x:De(H.date),y:xe(H.yMin)},whileInView:{opacity:1,x:De(H.date),y:xe(H.yMin),transition:{duration:Z?w.duration:.5,delay:Z?0:w.duration}}},initial:"initial",animate:T?"whileInView":"initial",children:qe(H.yMin,"NA",K,o,a)}),l.jsx($e.text,{dy:-8,style:{fill:G[1],textAnchor:"middle",...M?.graphObjectValues||{}},className:Ce.cn("text-xs font-bold",O?.graphObjectValues),exit:{opacity:0,transition:{duration:w.duration}},variants:{initial:{opacity:0,x:De(H.date),y:xe(H.yMax)},whileInView:{opacity:1,x:De(H.date),y:xe(H.yMax),transition:{duration:Z?w.duration:.5,delay:Z?0:w.duration}}},initial:"initial",animate:T?"whileInView":"initial",children:qe(H.yMax,"NA",K,o,a)})]}):null]})},Oe))}),m?l.jsx(l.Fragment,{children:m.map((H,Oe)=>l.jsx(gi,{text:H.text,color:H.color,y:xe(H.value),x1:0-d,x2:ee+U.right,classNames:H.classNames,styles:H.styles,animate:w,isInView:T},Oe))}):null,l.jsx("g",{children:D.map((H,Oe)=>{const Ee=oo({x:H.xCoordinate?De(ze(`${H.xCoordinate}`,s,new Date))+(H.xOffset||0):0+(H.xOffset||0),y:H.yCoordinate?xe(H.yCoordinate)+(H.yOffset||0)-8:0+(H.yOffset||0)-8},{x:H.xCoordinate?De(ze(`${H.xCoordinate}`,s,new Date)):0,y:H.yCoordinate?xe(H.yCoordinate):0},je(H.connectorRadius)?3.5:H.connectorRadius),it=H.showConnector?{y1:Ee.y,x1:Ee.x,y2:H.yCoordinate?xe(H.yCoordinate)+(H.yOffset||0):0+(H.yOffset||0),x2:H.xCoordinate?De(ze(`${H.xCoordinate}`,s,new Date))+(H.xOffset||0):0+(H.xOffset||0),cy:H.yCoordinate?xe(H.yCoordinate):0,cx:H.xCoordinate?De(ze(`${H.xCoordinate}`,s,new Date)):0,circleRadius:je(H.connectorRadius)?3.5:H.connectorRadius,strokeWidth:H.showConnector===!0?2:Math.min(H.showConnector||0,1)}:void 0,Tt={y:H.yCoordinate?xe(H.yCoordinate)+(H.yOffset||0)-8:0+(H.yOffset||0)-8,x:S?0:H.xCoordinate?De(ze(`${H.xCoordinate}`,s,new Date))+(H.xOffset||0):0+(H.xOffset||0),width:S?H.xCoordinate?De(ze(`${H.xCoordinate}`,s,new Date))+(H.xOffset||0):0+(H.xOffset||0):ee-(H.xCoordinate?De(ze(`${H.xCoordinate}`,s,new Date))+(H.xOffset||0):0+(H.xOffset||0)),maxWidth:H.maxWidth,fontWeight:H.fontWeight,align:H.align};return l.jsx(so,{color:H.color,connectorsSettings:it,labelSettings:Tt,text:H.text,classNames:H.classNames,styles:H.styles,animate:w,isInView:T},Oe)})}),l.jsx("g",{children:$?l.jsx(cd,{x1:0,x2:ee,y1:Ve(0),y2:Ve(ee),graphHeight:de,graphWidth:ee,className:O?.regLine,style:M?.regLine,color:typeof $=="string"?$:void 0,animate:w,isInView:T}):null}),Q.filter(H=>H.position==="after").map(H=>H.layer),l.jsx("rect",{ref:ve,style:{fill:"none",pointerEvents:"all"},width:ee,height:de})]})}),he&&y&&ge&&ce?l.jsx(st,{data:he,body:y,xPos:ge,yPos:ce,backgroundStyle:M?.tooltip,className:O?.tooltip}):null]})}function mv(t){const{data:e,graphTitle:n,suffix:i="",sources:r,prefix:a="",graphDescription:o,height:s,width:c,footNote:u,noOfXTicks:h=10,dateFormat:f="yyyy",showValues:d=!1,backgroundColor:g=!1,padding:p,lineColor:y,leftMargin:v=30,rightMargin:m=30,topMargin:I=20,bottomMargin:j=25,tooltip:w,refValues:S=[],highlightAreaSettings:P=[],relativeHeight:W,onSeriesMouseOver:D,graphID:x,minValue:$,maxValue:V,regressionLine:q=!1,showIntervalDots:ae=!1,showIntervalValues:G=!1,intervalLineStrokeWidth:_=0,intervalLineColors:b=[Pe.light.grays["gray-500"],Pe.light.grays["gray-500"]],intervalAreaColor:B=Pe.primaryColors["blue-100"],intervalAreaOpacity:X=.4,graphDownload:z=!1,dataDownload:C=!1,animate:A=!1,language:M="en",minHeight:O=0,strokeWidth:K=2,showDots:Q=!0,annotations:se=[],customHighlightAreaSettings:T=[],theme:Z="light",ariaLabel:ie,yAxisTitle:ue,noOfYTicks:he=5,minDate:Y,maxDate:ge,colorLegendTitle:oe,colorLegendColors:ce,colorLegendDomain:N,curveType:U="curve",styles:ve,classNames:J,precision:R=2,customLayers:le=[]}=t,[ee,de]=k.useState(0),[te,Me]=k.useState(0),be=k.useRef(null),ne=k.useRef(null);return k.useEffect(()=>{const De=new ResizeObserver(xe=>{de(c||xe[0].target.clientWidth||620),Me(s||xe[0].target.clientHeight||480)});return be.current&&(Me(be.current.clientHeight||480),de(be.current.clientWidth||620),c||De.observe(be.current)),()=>De.disconnect()},[c,s]),l.jsx("div",{className:`${Z||"light"} flex ${c?"w-fit grow-0":"w-full grow"}`,dir:M==="he"||M==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${g?g===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${M||"en"}`,J?.graphContainer),style:{...ve?.graphContainer||{},...g&&g!==!0?{backgroundColor:g}:{}},id:x,ref:ne,"aria-label":ie||`${n?`The graph shows ${n}. `:""}This is a line chart that highlights the difference between two datasets over time.${o?` ${o}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:g?p||"1rem":p||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||o||z||C?l.jsx(Qe,{styles:{title:ve?.title,description:ve?.description},classNames:{title:J?.title,description:J?.description},graphTitle:n,graphDescription:o,width:c,graphDownload:z?ne.current:void 0,dataDownload:C?e.map(De=>De.data).filter(De=>De!==void 0).length>0?e.map(De=>De.data).filter(De=>De!==void 0):e.filter(De=>De!==void 0):null}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[ce&&N?l.jsx(Hi,{width:c,colorLegendTitle:oe,colors:ce,colorDomain:N,showNAColor:!1}):null,l.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:be,"aria-label":"Graph area",children:(c||ee)&&(s||te)?l.jsx(cI,{data:e,lineColor:y||Pe.primaryColors["blue-600"],width:c||ee,height:Math.max(O,s||(W?O?(c||ee)*W>O?(c||ee)*W:O:(c||ee)*W:te)),suffix:i,prefix:a,dateFormat:f,showValues:d,noOfXTicks:h,leftMargin:v,rightMargin:m,topMargin:I,bottomMargin:j,tooltip:w,highlightAreaSettings:P,onSeriesMouseOver:D,refValues:S,minValue:$,maxValue:V,animate:A===!0?{duration:.5,once:!0,amount:.5}:A||{duration:0,once:!0,amount:0},rtl:M==="he"||M==="ar",strokeWidth:K,showDots:Q,annotations:se,customHighlightAreaSettings:T,regressionLine:q,showIntervalDots:ae,showIntervalValues:G,intervalLineStrokeWidth:_,intervalLineColors:b,intervalAreaColor:B,intervalAreaOpacity:X,yAxisTitle:ue,noOfYTicks:he,minDate:Y,maxDate:ge,curveType:U,styles:ve,classNames:J,precision:R,customLayers:le}):null})]})}),r||u?l.jsx(et,{styles:{footnote:ve?.footnote,source:ve?.source},classNames:{footnote:J?.footnote,source:J?.source},sources:r,footNote:u,width:c}):null]})})})})}function uI(t){const{data:e,width:n,height:i,lineColor:r,suffix:a,prefix:o,dateFormat:s,highlightAreaSettings:c,showValues:u,noOfXTicks:h,rightMargin:f,leftMargin:d,topMargin:g,bottomMargin:p,tooltip:y,onSeriesMouseOver:v,refValues:m,minValue:I,maxValue:j,animate:w,rtl:S,strokeWidth:P,showDots:W,annotations:D,customHighlightAreaSettings:x,regressionLine:$,yAxisTitle:V,noOfYTicks:q,maxDate:ae,minDate:G,curveType:_,styles:b,classNames:B,precision:X,customLayers:z}=t,C=k.useRef(null),A=ct(C,{once:w.once,amount:w.amount}),[M,O]=k.useState(!1);k.useEffect(()=>{if(A&&!M){const xe=setTimeout(()=>{O(!0)},(w.duration+.5)*1e3);return()=>clearTimeout(xe)}},[A,M,w.duration]);const K=_==="linear"?Oi:_==="step"?Or:_==="stepAfter"?Ir:_==="stepBefore"?Nr:_r,[Q,se]=k.useState(void 0),[T,Z]=k.useState(void 0),[ie,ue]=k.useState(void 0),he={top:g,bottom:p,left:V?d+30:d,right:f},Y=k.useRef(null),ge=tt(e.map(xe=>({...xe,date:ze(`${xe.date}`,s,new Date)})),"date"),oe=c.map(xe=>({...xe,coordinates:[xe.coordinates[0]===null?null:ze(`${xe.coordinates[0]}`,s,new Date),xe.coordinates[1]===null?null:ze(`${xe.coordinates[1]}`,s,new Date)]})),ce=x.map(xe=>({...xe,coordinates:xe.coordinates.map((Ae,ke)=>ke%2===0?ze(`${Ae}`,s,new Date):Ae)})),N=n-he.left-he.right,U=i-he.top-he.bottom,ve=G?ze(`${G}`,s,new Date):ge[0].date,J=ae?ze(`${ae}`,s,new Date):ge[ge.length-1].date,R=je(I)?Math.min(...ge.map(xe=>xe.y).filter(xe=>xe!=null))!==1/0?Math.min(...ge.map(xe=>xe.y).filter(xe=>xe!=null))>0?0:Math.min(...ge.map(xe=>xe.y).filter(xe=>xe!=null)):0:I,le=Math.max(...ge.map(xe=>xe.y).filter(xe=>xe!=null))!==1/0?Math.max(...ge.map(xe=>xe.y).filter(xe=>xe!=null)):0,ee=Zr().domain([ve,J]).range([0,N]),de=ut().domain([R,je(j)?le>0?le:0:j]).range([U,0]).nice(),te=ii().x(xe=>ee(xe.date)).y(xe=>de(xe.y)).curve(K),Me=de.ticks(q),be=ee.ticks(h);k.useEffect(()=>{const xe=ke=>{const me=ge[Qr(ge.map(Se=>Se.date),ee.invert(En(ke)[0]),1)];se(me||ge[ge.length-1]),v?.(me||ge[ge.length-1]),ue(ke.clientY),Z(ke.clientX)},Ae=()=>{se(void 0),Z(void 0),ue(void 0),v?.(void 0)};bt(Y.current).on("mousemove",xe).on("mouseout",Ae)},[ee,ge,v]);const ne=sd(ge.filter(xe=>!je(xe.date)&&!je(xe.y)).map(xe=>[ee(xe.date),de(xe.y)])),De=ld(ne);return l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{width:`${n}px`,height:`${i}px`,viewBox:`0 0 ${n} ${i}`,direction:"ltr",ref:C,children:l.jsxs("g",{transform:`translate(${he.left},${he.top})`,children:[l.jsx(ao,{areaSettings:oe,width:N,height:U,scale:ee,animate:w,isInView:A}),l.jsx(lo,{areaSettings:ce,scaleX:ee,scaleY:de,animate:w,isInView:A}),l.jsxs("g",{children:[l.jsx(ri,{values:Me.filter(xe=>xe!==0),y:Me.filter(xe=>xe!==0).map(xe=>de(xe)),x1:0-d,x2:N+he.right,styles:{gridLines:b?.yAxis?.gridLines,labels:b?.yAxis?.labels},classNames:{gridLines:B?.yAxis?.gridLines,labels:B?.yAxis?.labels},suffix:a,prefix:o,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:X}),l.jsx(Dt,{y1:de(R<0?0:R),y2:de(R<0?0:R),x1:0-d,x2:N+he.right,label:qe(R<0?0:R,"NA",X,o,a),labelPos:{x:0-d,y:de(R<0?0:R),dx:0,dy:le<0?"1em":-5},classNames:{axis:B?.xAxis?.axis,label:B?.yAxis?.labels},styles:{axis:b?.xAxis?.axis,label:b?.yAxis?.labels}}),l.jsx(Nt,{x:0-d-15,y:U/2,style:b?.yAxis?.title,className:B?.yAxis?.title,text:V,rotate90:!0})]}),l.jsx(Rn,{values:be.map(xe=>ft(xe,s)),x:be.map(xe=>ee(xe)),y1:0,y2:U,styles:{gridLines:b?.xAxis?.gridLines,labels:b?.xAxis?.labels},classNames:{gridLines:Ce.cn("opacity-0",B?.xAxis?.gridLines),labels:Ce.cn("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",B?.xAxis?.labels)},suffix:a,prefix:o,labelType:"primary",showGridLines:!0,precision:X}),z.filter(xe=>xe.position==="before").map(xe=>xe.layer),l.jsxs("g",{children:[l.jsx($e.path,{style:{stroke:r,fill:"none",strokeWidth:P},exit:{opacity:0,transition:{duration:w.duration}},variants:{initial:{pathLength:0,d:te(ge)||"",opacity:1},whileInView:{pathLength:1,d:te(ge)||"",opacity:1,transition:{duration:w.duration}}},initial:"initial",animate:A?"whileInView":"initial"}),Q?l.jsx("line",{y1:0,y2:U,x1:ee(Q.date),x2:ee(Q.date),className:Ce.cn("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",B?.mouseOverLine),style:b?.mouseOverLine}):null]}),l.jsx("g",{children:ge.map((xe,Ae)=>l.jsx($e.g,{children:je(xe.y)?null:l.jsxs(l.Fragment,{children:[W?l.jsx($e.circle,{r:N/ge.length<5?0:N/ge.length<20?2:4,style:{fill:r},exit:{opacity:0,transition:{duration:w.duration}},variants:{initial:{opacity:0,cx:ee(xe.date),cy:de(xe.y)},whileInView:{opacity:1,transition:{duration:M?w.duration:.5,delay:M?0:w.duration},cx:ee(xe.date),cy:de(xe.y)}},initial:"initial",animate:A?"whileInView":"initial"}):null,u?l.jsx($e.text,{dy:-8,style:{textAnchor:"middle",...b?.graphObjectValues||{}},className:Ce.cn("graph-value text-xs font-bold",B?.graphObjectValues),exit:{opacity:0,transition:{duration:w.duration}},variants:{initial:{opacity:0,x:ee(xe.date),y:de(xe.y)},whileInView:{opacity:1,x:ee(xe.date),y:de(xe.y),transition:{duration:M?w.duration:.5,delay:M?0:w.duration}}},initial:"initial",animate:A?"whileInView":"initial",children:qe(xe.y,"NA",X,o,a)}):null]})},Ae))}),m?l.jsx(l.Fragment,{children:m.map((xe,Ae)=>l.jsx(gi,{text:xe.text,color:xe.color,y:de(xe.value),x1:0-d,x2:N+he.right,classNames:xe.classNames,styles:xe.styles,animate:w,isInView:A},Ae))}):null,l.jsx("g",{children:D.map((xe,Ae)=>{const ke=oo({x:xe.xCoordinate?ee(ze(`${xe.xCoordinate}`,s,new Date))+(xe.xOffset||0):0+(xe.xOffset||0),y:xe.yCoordinate?de(xe.yCoordinate)+(xe.yOffset||0)-8:0+(xe.yOffset||0)-8},{x:xe.xCoordinate?ee(ze(`${xe.xCoordinate}`,s,new Date)):0,y:xe.yCoordinate?de(xe.yCoordinate):0},je(xe.connectorRadius)?3.5:xe.connectorRadius),me=xe.showConnector?{y1:ke.y,x1:ke.x,y2:xe.yCoordinate?de(xe.yCoordinate)+(xe.yOffset||0):0+(xe.yOffset||0),x2:xe.xCoordinate?ee(ze(`${xe.xCoordinate}`,s,new Date))+(xe.xOffset||0):0+(xe.xOffset||0),cy:xe.yCoordinate?de(xe.yCoordinate):0,cx:xe.xCoordinate?ee(ze(`${xe.xCoordinate}`,s,new Date)):0,circleRadius:je(xe.connectorRadius)?3.5:xe.connectorRadius,strokeWidth:xe.showConnector===!0?2:Math.min(xe.showConnector||0,1)}:void 0,Se={y:xe.yCoordinate?de(xe.yCoordinate)+(xe.yOffset||0)-8:0+(xe.yOffset||0)-8,x:S?0:xe.xCoordinate?ee(ze(`${xe.xCoordinate}`,s,new Date))+(xe.xOffset||0):0+(xe.xOffset||0),width:S?xe.xCoordinate?ee(ze(`${xe.xCoordinate}`,s,new Date))+(xe.xOffset||0):0+(xe.xOffset||0):N-(xe.xCoordinate?ee(ze(`${xe.xCoordinate}`,s,new Date))+(xe.xOffset||0):0+(xe.xOffset||0)),maxWidth:xe.maxWidth,fontWeight:xe.fontWeight,align:xe.align};return l.jsx(so,{color:xe.color,connectorsSettings:me,labelSettings:Se,text:xe.text,classNames:xe.classNames,styles:xe.styles,animate:w,isInView:A},Ae)})}),l.jsx("g",{children:$?l.jsx(cd,{x1:0,x2:N,y1:De(0),y2:De(N),graphHeight:U,graphWidth:N,className:B?.regLine,style:b?.regLine,color:typeof $=="string"?$:void 0,animate:w,isInView:A}):null}),z.filter(xe=>xe.position==="after").map(xe=>xe.layer),l.jsx("rect",{ref:Y,style:{fill:"none",pointerEvents:"all"},width:N,height:U})]})}),Q&&y&&T&&ie?l.jsx(st,{data:Q,body:y,xPos:T,yPos:ie,backgroundStyle:b?.tooltip,className:B?.tooltip}):null]})}function yv(t){const{data:e,graphTitle:n,lineColor:i,suffix:r="",sources:a,prefix:o="",graphDescription:s,height:c,width:u,footNote:h,noOfXTicks:f=10,dateFormat:d="yyyy",showValues:g=!1,padding:p,backgroundColor:y=!1,leftMargin:v=30,rightMargin:m=30,topMargin:I=20,bottomMargin:j=25,relativeHeight:w,tooltip:S,onSeriesMouseOver:P,highlightAreaSettings:W=[],graphID:D,minValue:x,maxValue:$,maxDate:V,minDate:q,graphDownload:ae=!1,dataDownload:G=!1,animate:_=!1,language:b="en",refValues:B=[],minHeight:X=0,strokeWidth:z=2,showDots:C=!0,annotations:A=[],customHighlightAreaSettings:M=[],theme:O="light",ariaLabel:K,regressionLine:Q=!1,yAxisTitle:se,noOfYTicks:T=5,curveType:Z="curve",styles:ie,classNames:ue,precision:he=2,customLayers:Y=[]}=t,[ge,oe]=k.useState(0),[ce,N]=k.useState(0),U=k.useRef(null),ve=k.useRef(null);return k.useEffect(()=>{const J=new ResizeObserver(R=>{oe(u||R[0].target.clientWidth||620),N(c||R[0].target.clientHeight||480)});return U.current&&(N(U.current.clientHeight||480),oe(U.current.clientWidth||620),u||J.observe(U.current)),()=>J.disconnect()},[u,c]),l.jsx("div",{className:`${O||"light"} flex ${u?"w-fit grow-0":"w-full grow"}`,dir:b==="he"||b==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${y?y===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${b||"en"}`,ue?.graphContainer),style:{...ie?.graphContainer||{},...y&&y!==!0?{backgroundColor:y}:{}},id:D,ref:ve,"aria-label":K||`${n?`The graph shows ${n}. `:""}This is a line chart that shows trends over time.${s?` ${s}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:y?p||"1rem":p||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||s||ae||G?l.jsx(Qe,{styles:{title:ie?.title,description:ie?.description},classNames:{title:ue?.title,description:ue?.description},graphTitle:n,graphDescription:s,width:u,graphDownload:ae?ve.current:void 0,dataDownload:G?e.map(J=>J.data).filter(J=>J!==void 0).length>0?e.map(J=>J.data).filter(J=>J!==void 0):e.filter(J=>J!==void 0):null}):null,e.length===0?l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:l.jsx(xt,{})}):l.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:U,"aria-label":"Graph area",children:(u||ge)&&(c||ce)?l.jsx(uI,{data:e,lineColor:i||Pe.primaryColors["blue-600"],width:u||ge,height:Math.max(X,c||(w?X?(u||ge)*w>X?(u||ge)*w:X:(u||ge)*w:ce)),suffix:r,prefix:o,dateFormat:d,showValues:g,noOfXTicks:f,leftMargin:v,rightMargin:m,topMargin:I,bottomMargin:j,tooltip:S,highlightAreaSettings:W,onSeriesMouseOver:P,refValues:B,minValue:x,maxValue:$,animate:_===!0?{duration:.5,once:!0,amount:.5}:_||{duration:0,once:!0,amount:0},rtl:b==="he"||b==="ar",strokeWidth:z,showDots:C,annotations:A,customHighlightAreaSettings:M,regressionLine:Q,yAxisTitle:se,noOfYTicks:T,maxDate:V,minDate:q,curveType:Z,styles:ie,classNames:ue,precision:he,customLayers:Y}):null}),a||h?l.jsx(et,{styles:{footnote:ie?.footnote,source:ie?.source},classNames:{footnote:ue?.footnote,source:ue?.source},sources:a,footNote:h,width:u}):null]})})})})}function hI(t){const{data:e,width:n,height:i,lineColors:r,dateFormat:a,noOfXTicks:o,labels:s,rightMargin:c,topMargin:u,bottomMargin:h,suffix:f,prefix:d,leftMargin:g,tooltip:p,onSeriesMouseOver:y,showValues:v,showColorLegendAtTop:m,refValues:I,highlightAreaSettings:j,minValue:w,maxValue:S,highlightedLines:P,animate:W,rtl:D,strokeWidth:x,showDots:$,annotations:V,customHighlightAreaSettings:q,yAxisTitle:ae,noOfYTicks:G,minDate:_,maxDate:b,curveType:B,styles:X,classNames:z,dimmedOpacity:C,precision:A,customLayers:M,dashedLines:O,dashSettings:K,labelsToBeHidden:Q,revealClipId:se}=t,T=k.useRef(null),Z=ct(T,{once:W.once,amount:W.amount}),[ie,ue]=k.useState(!1);k.useEffect(()=>{if(Z&&!ie){const F=setTimeout(()=>{ue(!0)},(W.duration+.5)*1e3);return()=>clearTimeout(F)}},[Z,ie,W.duration]);const he=B==="linear"?Oi:B==="step"?Or:B==="stepAfter"?Ir:B==="stepBefore"?Nr:_r,[Y,ge]=k.useState(void 0),[oe,ce]=k.useState(void 0),[N,U]=k.useState(void 0),ve={top:u,bottom:h,left:ae?g+30:g,right:c},J=k.useRef(null),R=tt(e.map(F=>({...F,date:ze(`${F.date}`,a,new Date)})),"date"),le=R[0].y.map((F,Ie)=>R.map(Ve=>({...Ve,y:Ve.y[Ie]})).filter(Ve=>!je(Ve.y))),ee=j.map(F=>({...F,coordinates:[F.coordinates[0]===null?null:ze(`${F.coordinates[0]}`,a,new Date),F.coordinates[1]===null?null:ze(`${F.coordinates[1]}`,a,new Date)]})),de=q.map(F=>({...F,coordinates:F.coordinates.map((Ie,Ve)=>Ve%2===0?ze(`${Ie}`,a,new Date):Ie)})),te=n-ve.left-ve.right,Me=i-ve.top-ve.bottom,be=_?ze(`${_}`,a,new Date):R[0].date,ne=b?ze(`${b}`,a,new Date):R[R.length-1].date,De=je(w)?Math.min(...R.map(F=>Math.min(...F.y.filter(Ie=>!je(Ie)))))?Math.min(...R.map(F=>Math.min(...F.y.filter(Ie=>!je(Ie)))))>0?0:Math.min(...R.map(F=>Math.min(...F.y.filter(Ie=>!je(Ie))))):0:w,xe=Math.max(...R.map(F=>Math.max(...F.y.filter(Ie=>!je(Ie)))))?Math.max(...R.map(F=>Math.max(...F.y.filter(Ie=>!je(Ie))))):0,Ae=Zr().domain([be,ne]).range([0,te]),ke=ut().domain([je(w)?De:w,je(S)?xe>0?xe:0:S]).range([Me,0]).nice(),me=ii().x(F=>Ae(F.date)).y(F=>ke(F.y)).curve(he),Se=ke.ticks(G),Le=Ae.ticks(o);return k.useEffect(()=>{const F=Ve=>{const H=R[Qr(R.map(Oe=>Oe.date),Ae.invert(En(Ve)[0]),1)];ge(H||R[R.length-1]),U(Ve.clientY),ce(Ve.clientX),y?.(H||R[R.length-1])},Ie=()=>{ge(void 0),ce(void 0),U(void 0)};bt(J.current).on("mousemove",F).on("mouseout",Ie),y?.(void 0)},[Ae,R,y]),l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{width:`${n}px`,height:`${i}px`,viewBox:`0 0 ${n} ${i}`,direction:"ltr",ref:T,children:l.jsxs("g",{transform:`translate(${ve.left},${ve.top})`,children:[l.jsx("defs",{children:l.jsx("clipPath",{id:se,children:l.jsx($e.rect,{x:0,y:0,height:Me,variants:{initial:{width:0},whileInView:{width:te,transition:{duration:W.duration}}},initial:"initial",animate:Z?"whileInView":"initial"})})}),l.jsx(ao,{areaSettings:ee,width:te,height:Me,scale:Ae,animate:W,isInView:Z}),l.jsx(lo,{areaSettings:de,scaleX:Ae,scaleY:ke,animate:W,isInView:Z}),l.jsxs("g",{children:[l.jsx(ri,{values:Se.filter(F=>F!==0),y:Se.filter(F=>F!==0).map(F=>ke(F)),x1:0-g,x2:te+ve.right,styles:{gridLines:X?.yAxis?.gridLines,labels:X?.yAxis?.labels},classNames:{gridLines:z?.yAxis?.gridLines,labels:z?.yAxis?.labels},suffix:f,prefix:d,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:A}),l.jsx(Dt,{y1:ke(De<0?0:De),y2:ke(De<0?0:De),x1:0-g,x2:te+ve.right,label:qe(De<0?0:De,"NA",A,d,f),labelPos:{x:0-g,y:ke(De<0?0:De),dx:0,dy:xe<0?"1em":-5},classNames:{axis:z?.xAxis?.axis,label:z?.yAxis?.labels},styles:{axis:X?.xAxis?.axis,label:X?.yAxis?.labels}}),l.jsx(Nt,{x:0-g-15,y:Me/2,style:X?.yAxis?.title,className:z?.yAxis?.title,text:ae,rotate90:!0})]}),l.jsx("g",{children:l.jsx(Rn,{values:Le.map(F=>ft(F,a)),x:Le.map(F=>Ae(F)),y1:0,y2:Me,styles:{gridLines:X?.xAxis?.gridLines,labels:X?.xAxis?.labels},classNames:{gridLines:Ce.cn("opacity-0",z?.xAxis?.gridLines),labels:Ce.cn("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",z?.xAxis?.labels)},suffix:f,prefix:d,labelType:"primary",showGridLines:!0,precision:A})}),M.filter(F=>F.position==="before").map(F=>F.layer),l.jsxs("g",{children:[le.map((F,Ie)=>l.jsxs($e.g,{exit:{opacity:0,transition:{duration:W.duration}},variants:{initial:{opacity:P.length!==0?P.indexOf(s[Ie])!==-1?1:C:1},whileInView:{opacity:P.length!==0?P.indexOf(s[Ie])!==-1?1:C:1,transition:{duration:W.duration}}},initial:"initial",animate:Z?"whileInView":"initial",children:[l.jsx($e.path,{style:{fill:"none",strokeWidth:x},clipPath:`url(#${se})`,exit:{opacity:0,transition:{duration:W.duration}},variants:{initial:{...O.length===0?{pathLength:0}:{},d:me(F.filter(Ve=>!je(Ve.y)))||"",opacity:1,stroke:r[Ie]},whileInView:{...O.length===0?{pathLength:1}:{},d:me(F.filter(Ve=>!je(Ve.y)))||"",opacity:1,stroke:r[Ie],transition:{duration:W.duration}}},strokeDasharray:O.includes(s[Ie])?K[Ie%K.length]:void 0,initial:"initial",animate:Z?"whileInView":"initial"}),F.map((Ve,H)=>l.jsx("g",{children:je(Ve.y)?null:l.jsxs(l.Fragment,{children:[$?l.jsx($e.circle,{r:te/R.length<5?0:te/R.length<20?2:4,style:{fill:r[Ie]},exit:{opacity:0,transition:{duration:W.duration}},variants:{initial:{opacity:0,cx:Ae(Ve.date),cy:ke(Ve.y)},whileInView:{opacity:1,transition:{duration:ie?W.duration:.5,delay:ie?0:W.duration},cx:Ae(Ve.date),cy:ke(Ve.y)}},initial:"initial",animate:Z?"whileInView":"initial"}):null,v?l.jsx($e.text,{dy:-8,style:{fill:r[Ie],textAnchor:"middle",...X?.graphObjectValues||{}},className:Ce.cn("graph-value text-xs font-bold",z?.graphObjectValues),exit:{opacity:0,transition:{duration:W.duration}},variants:{initial:{opacity:0,x:Ae(Ve.date),y:ke(Ve.y)},whileInView:{opacity:1,x:Ae(Ve.date),y:ke(Ve.y),transition:{duration:ie?W.duration:.5,delay:ie?0:W.duration}}},initial:"initial",animate:Z?"whileInView":"initial",children:qe(Ve.y,"NA",A,d,f)}):null]})},H)),m||Q.includes(s[Ie])?null:l.jsx($e.text,{style:{fill:r[Ie]},className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:W.duration}},variants:{initial:{opacity:0,x:Ae(F[F.length-1].date),y:ke(F[F.length-1].y)},whileInView:{opacity:1,x:Ae(F[F.length-1].date),y:ke(F[F.length-1].y),transition:{duration:ie?W.duration:.5,delay:ie?0:W.duration}}},initial:"initial",animate:Z?"whileInView":"initial",children:s[Ie]})]},s[Ie])),Y?l.jsx("line",{y1:0,y2:Me,x1:Ae(Y.date),x2:Ae(Y.date),className:Ce.cn("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",z?.mouseOverLine),style:X?.mouseOverLine}):null]}),I?l.jsx(l.Fragment,{children:I.map((F,Ie)=>l.jsx(gi,{text:F.text,color:F.color,y:ke(F.value),x1:0-g,x2:te+ve.right,classNames:F.classNames,styles:F.styles,animate:W,isInView:Z},Ie))}):null,l.jsx("g",{children:V.map((F,Ie)=>{const Ve=oo({x:F.xCoordinate?Ae(ze(`${F.xCoordinate}`,a,new Date))+(F.xOffset||0):0+(F.xOffset||0),y:F.yCoordinate?ke(F.yCoordinate)+(F.yOffset||0)-8:0+(F.yOffset||0)-8},{x:F.xCoordinate?Ae(ze(`${F.xCoordinate}`,a,new Date)):0,y:F.yCoordinate?ke(F.yCoordinate):0},je(F.connectorRadius)?3.5:F.connectorRadius),H=F.showConnector?{y1:Ve.y,x1:Ve.x,y2:F.yCoordinate?ke(F.yCoordinate)+(F.yOffset||0):0+(F.yOffset||0),x2:F.xCoordinate?Ae(ze(`${F.xCoordinate}`,a,new Date))+(F.xOffset||0):0+(F.xOffset||0),cy:F.yCoordinate?ke(F.yCoordinate):0,cx:F.xCoordinate?Ae(ze(`${F.xCoordinate}`,a,new Date)):0,circleRadius:je(F.connectorRadius)?3.5:F.connectorRadius,strokeWidth:F.showConnector===!0?2:Math.min(F.showConnector||0,1)}:void 0,Oe={y:F.yCoordinate?ke(F.yCoordinate)+(F.yOffset||0)-8:0+(F.yOffset||0)-8,x:D?0:F.xCoordinate?Ae(ze(`${F.xCoordinate}`,a,new Date))+(F.xOffset||0):0+(F.xOffset||0),width:D?F.xCoordinate?Ae(ze(`${F.xCoordinate}`,a,new Date))+(F.xOffset||0):0+(F.xOffset||0):te-(F.xCoordinate?Ae(ze(`${F.xCoordinate}`,a,new Date))+(F.xOffset||0):0+(F.xOffset||0)),maxWidth:F.maxWidth,fontWeight:F.fontWeight,align:F.align};return l.jsx(so,{color:F.color,connectorsSettings:H,labelSettings:Oe,text:F.text,classNames:F.classNames,styles:F.styles,animate:W,isInView:Z},Ie)})}),M.filter(F=>F.position==="after").map(F=>F.layer),l.jsx("rect",{ref:J,style:{fill:"none",pointerEvents:"all"},width:te,height:Me})]})}),Y&&p&&oe&&N?l.jsx(st,{data:Y,body:p,xPos:oe,yPos:N,backgroundStyle:X?.tooltip,className:z?.tooltip}):null]})}function xv(t){const{data:e,graphTitle:n,lineColors:i=Pe.light.categoricalColors.colors,suffix:r="",sources:a,prefix:o="",graphDescription:s,height:c,width:u,footNote:h,noOfXTicks:f=10,dateFormat:d="yyyy",labels:g,padding:p,showValues:y=!1,backgroundColor:v=!1,leftMargin:m=30,rightMargin:I=50,topMargin:j=20,bottomMargin:w=25,tooltip:S,relativeHeight:P,onSeriesMouseOver:W,showColorLegendAtTop:D=!1,refValues:x=[],highlightAreaSettings:$=[],graphID:V,minValue:q,maxValue:ae,highlightedLines:G=[],graphDownload:_=!1,dataDownload:b=!1,animate:B=!1,language:X="en",colorLegendTitle:z,minHeight:C=0,strokeWidth:A=2,showDots:M=!0,annotations:O=[],customHighlightAreaSettings:K=[],theme:Q="light",ariaLabel:se,yAxisTitle:T,noOfYTicks:Z=5,minDate:ie,maxDate:ue,curveType:he="curve",styles:Y,classNames:ge,dimmedOpacity:oe=.3,precision:ce=2,customLayers:N=[],dashedLines:U=[],dashSettings:ve=["5 5"],labelsToBeHidden:J=[],showColorScale:R=!0}=t,[le,ee]=k.useState(0),[de,te]=k.useState(0),Me=k.useRef(null),be=k.useRef(null);return k.useEffect(()=>{const ne=new ResizeObserver(De=>{ee(u||De[0].target.clientWidth||620),te(c||De[0].target.clientHeight||480)});return Me.current&&(te(Me.current.clientHeight||480),ee(Me.current.clientWidth||620),u||ne.observe(Me.current)),()=>ne.disconnect()},[u,c]),l.jsx("div",{className:`${Q||"light"} flex ${u?"w-fit grow-0":"w-full grow"}`,dir:X==="he"||X==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${v?v===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${X||"en"}`,ge?.graphContainer),style:{...Y?.graphContainer||{},...v&&v!==!0?{backgroundColor:v}:{}},id:V,ref:be,"aria-label":se||`${n?`The graph shows ${n}. `:""}This is a multi-line chart that shows trends over time.${s?` ${s}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:v?p||"1rem":p||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||s||_||b?l.jsx(Qe,{styles:{title:Y?.title,description:Y?.description},classNames:{title:ge?.title,description:ge?.description},graphTitle:n,graphDescription:s,width:u,graphDownload:_?be.current:void 0,dataDownload:b?e.map(ne=>ne.data).filter(ne=>ne!==void 0).length>0?e.map(ne=>ne.data).filter(ne=>ne!==void 0):e.filter(ne=>ne!==void 0):null}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[D&&R?l.jsx(Hi,{colorDomain:g,colorLegendTitle:z,labelsToBeHidden:J,colors:i,showNAColor:!1}):null,l.jsx("div",{className:"w-full grow leading-0",ref:Me,"aria-label":"Graph area",children:(u||le)&&(c||de)?l.jsx(hI,{data:e,lineColors:i,width:u||le,height:Math.max(C,c||(P?C?(u||le)*P>C?(u||le)*P:C:(u||le)*P:de)),dateFormat:d,noOfXTicks:f,leftMargin:m,rightMargin:I,topMargin:j,bottomMargin:w,labels:g,tooltip:S,onSeriesMouseOver:W,showColorLegendAtTop:R?D:!0,showValues:y,suffix:r,prefix:o,highlightAreaSettings:$,refValues:x,minValue:q,maxValue:ae,highlightedLines:G,animate:B===!0?{duration:.5,once:!0,amount:.5}:B||{duration:0,once:!0,amount:0},rtl:X==="he"||X==="ar",strokeWidth:A,showDots:M,annotations:O,customHighlightAreaSettings:K,yAxisTitle:T,noOfYTicks:Z,minDate:ie,maxDate:ue,curveType:he,styles:Y,classNames:ge,dimmedOpacity:oe,precision:ce,customLayers:N,labelsToBeHidden:J,dashedLines:U,dashSettings:ve,revealClipId:rl(8)}):null})]})}),a||h?l.jsx(et,{styles:{footnote:Y?.footnote,source:Y?.source},classNames:{footnote:ge?.footnote,source:ge?.source},sources:a,footNote:h,width:u}):null]})})})})}const wr=11102230246251565e-32,Sn=134217729,fI=(3+8*wr)*wr;function Tu(t,e,n,i,r){let a,o,s,c,u=e[0],h=i[0],f=0,d=0;h>u==h>-u?(a=u,u=e[++f]):(a=h,h=i[++d]);let g=0;if(f<t&&d<n)for(h>u==h>-u?(o=u+a,s=a-(o-u),u=e[++f]):(o=h+a,s=a-(o-h),h=i[++d]),a=o,s!==0&&(r[g++]=s);f<t&&d<n;)h>u==h>-u?(o=a+u,c=o-a,s=a-(o-c)+(u-c),u=e[++f]):(o=a+h,c=o-a,s=a-(o-c)+(h-c),h=i[++d]),a=o,s!==0&&(r[g++]=s);for(;f<t;)o=a+u,c=o-a,s=a-(o-c)+(u-c),u=e[++f],a=o,s!==0&&(r[g++]=s);for(;d<n;)o=a+h,c=o-a,s=a-(o-c)+(h-c),h=i[++d],a=o,s!==0&&(r[g++]=s);return(a!==0||g===0)&&(r[g++]=a),g}function dI(t,e){let n=e[0];for(let i=1;i<t;i++)n+=e[i];return n}function al(t){return new Float64Array(t)}const gI=(3+16*wr)*wr,pI=(2+12*wr)*wr,mI=(9+64*wr)*wr*wr,mo=al(4),vm=al(8),wm=al(12),bm=al(16),Ln=al(4);function yI(t,e,n,i,r,a,o){let s,c,u,h,f,d,g,p,y,v,m,I,j,w,S,P,W,D;const x=t-r,$=n-r,V=e-a,q=i-a;w=x*q,d=Sn*x,g=d-(d-x),p=x-g,d=Sn*q,y=d-(d-q),v=q-y,S=p*v-(w-g*y-p*y-g*v),P=V*$,d=Sn*V,g=d-(d-V),p=V-g,d=Sn*$,y=d-(d-$),v=$-y,W=p*v-(P-g*y-p*y-g*v),m=S-W,f=S-m,mo[0]=S-(m+f)+(f-W),I=w+m,f=I-w,j=w-(I-f)+(m-f),m=j-P,f=j-m,mo[1]=j-(m+f)+(f-P),D=I+m,f=D-I,mo[2]=I-(D-f)+(m-f),mo[3]=D;let ae=dI(4,mo),G=pI*o;if(ae>=G||-ae>=G||(f=t-x,s=t-(x+f)+(f-r),f=n-$,u=n-($+f)+(f-r),f=e-V,c=e-(V+f)+(f-a),f=i-q,h=i-(q+f)+(f-a),s===0&&c===0&&u===0&&h===0)||(G=mI*o+fI*Math.abs(ae),ae+=x*h+q*s-(V*u+$*c),ae>=G||-ae>=G))return ae;w=s*q,d=Sn*s,g=d-(d-s),p=s-g,d=Sn*q,y=d-(d-q),v=q-y,S=p*v-(w-g*y-p*y-g*v),P=c*$,d=Sn*c,g=d-(d-c),p=c-g,d=Sn*$,y=d-(d-$),v=$-y,W=p*v-(P-g*y-p*y-g*v),m=S-W,f=S-m,Ln[0]=S-(m+f)+(f-W),I=w+m,f=I-w,j=w-(I-f)+(m-f),m=j-P,f=j-m,Ln[1]=j-(m+f)+(f-P),D=I+m,f=D-I,Ln[2]=I-(D-f)+(m-f),Ln[3]=D;const _=Tu(4,mo,4,Ln,vm);w=x*h,d=Sn*x,g=d-(d-x),p=x-g,d=Sn*h,y=d-(d-h),v=h-y,S=p*v-(w-g*y-p*y-g*v),P=V*u,d=Sn*V,g=d-(d-V),p=V-g,d=Sn*u,y=d-(d-u),v=u-y,W=p*v-(P-g*y-p*y-g*v),m=S-W,f=S-m,Ln[0]=S-(m+f)+(f-W),I=w+m,f=I-w,j=w-(I-f)+(m-f),m=j-P,f=j-m,Ln[1]=j-(m+f)+(f-P),D=I+m,f=D-I,Ln[2]=I-(D-f)+(m-f),Ln[3]=D;const b=Tu(_,vm,4,Ln,wm);w=s*h,d=Sn*s,g=d-(d-s),p=s-g,d=Sn*h,y=d-(d-h),v=h-y,S=p*v-(w-g*y-p*y-g*v),P=c*u,d=Sn*c,g=d-(d-c),p=c-g,d=Sn*u,y=d-(d-u),v=u-y,W=p*v-(P-g*y-p*y-g*v),m=S-W,f=S-m,Ln[0]=S-(m+f)+(f-W),I=w+m,f=I-w,j=w-(I-f)+(m-f),m=j-P,f=j-m,Ln[1]=j-(m+f)+(f-P),D=I+m,f=D-I,Ln[2]=I-(D-f)+(m-f),Ln[3]=D;const B=Tu(b,wm,4,Ln,bm);return bm[B-1]}function Dl(t,e,n,i,r,a){const o=(e-a)*(n-r),s=(t-r)*(i-a),c=o-s,u=Math.abs(o+s);return Math.abs(c)>=gI*u?c:-yI(t,e,n,i,r,a,u)}const Cm=Math.pow(2,-52),Ml=new Uint32Array(512);class pc{static from(e,n=CI,i=SI){const r=e.length,a=new Float64Array(r*2);for(let o=0;o<r;o++){const s=e[o];a[2*o]=n(s),a[2*o+1]=i(s)}return new pc(a)}constructor(e){const n=e.length>>1;if(n>0&&typeof e[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=e;const i=Math.max(2*n-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:e,_hullPrev:n,_hullNext:i,_hullTri:r,_hullHash:a}=this,o=e.length>>1;let s=1/0,c=1/0,u=-1/0,h=-1/0;for(let x=0;x<o;x++){const $=e[2*x],V=e[2*x+1];$<s&&(s=$),V<c&&(c=V),$>u&&(u=$),V>h&&(h=V),this._ids[x]=x}const f=(s+u)/2,d=(c+h)/2;let g,p,y;for(let x=0,$=1/0;x<o;x++){const V=ku(f,d,e[2*x],e[2*x+1]);V<$&&(g=x,$=V)}const v=e[2*g],m=e[2*g+1];for(let x=0,$=1/0;x<o;x++){if(x===g)continue;const V=ku(v,m,e[2*x],e[2*x+1]);V<$&&V>0&&(p=x,$=V)}let I=e[2*p],j=e[2*p+1],w=1/0;for(let x=0;x<o;x++){if(x===g||x===p)continue;const $=wI(v,m,I,j,e[2*x],e[2*x+1]);$<w&&(y=x,w=$)}let S=e[2*y],P=e[2*y+1];if(w===1/0){for(let V=0;V<o;V++)this._dists[V]=e[2*V]-e[0]||e[2*V+1]-e[1];jo(this._ids,this._dists,0,o-1);const x=new Uint32Array(o);let $=0;for(let V=0,q=-1/0;V<o;V++){const ae=this._ids[V],G=this._dists[ae];G>q&&(x[$++]=ae,q=G)}this.hull=x.subarray(0,$),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Dl(v,m,I,j,S,P)<0){const x=p,$=I,V=j;p=y,I=S,j=P,y=x,S=$,P=V}const W=bI(v,m,I,j,S,P);this._cx=W.x,this._cy=W.y;for(let x=0;x<o;x++)this._dists[x]=ku(e[2*x],e[2*x+1],W.x,W.y);jo(this._ids,this._dists,0,o-1),this._hullStart=g;let D=3;i[g]=n[y]=p,i[p]=n[g]=y,i[y]=n[p]=g,r[g]=0,r[p]=1,r[y]=2,a.fill(-1),a[this._hashKey(v,m)]=g,a[this._hashKey(I,j)]=p,a[this._hashKey(S,P)]=y,this.trianglesLen=0,this._addTriangle(g,p,y,-1,-1,-1);for(let x=0,$,V;x<this._ids.length;x++){const q=this._ids[x],ae=e[2*q],G=e[2*q+1];if(x>0&&Math.abs(ae-$)<=Cm&&Math.abs(G-V)<=Cm||($=ae,V=G,q===g||q===p||q===y))continue;let _=0;for(let C=0,A=this._hashKey(ae,G);C<this._hashSize&&(_=a[(A+C)%this._hashSize],!(_!==-1&&_!==i[_]));C++);_=n[_];let b=_,B;for(;B=i[b],Dl(ae,G,e[2*b],e[2*b+1],e[2*B],e[2*B+1])>=0;)if(b=B,b===_){b=-1;break}if(b===-1)continue;let X=this._addTriangle(b,q,i[b],-1,-1,r[b]);r[q]=this._legalize(X+2),r[b]=X,D++;let z=i[b];for(;B=i[z],Dl(ae,G,e[2*z],e[2*z+1],e[2*B],e[2*B+1])<0;)X=this._addTriangle(z,q,B,r[q],-1,r[z]),r[q]=this._legalize(X+2),i[z]=z,D--,z=B;if(b===_)for(;B=n[b],Dl(ae,G,e[2*B],e[2*B+1],e[2*b],e[2*b+1])<0;)X=this._addTriangle(B,q,b,-1,r[b],r[B]),this._legalize(X+2),r[B]=X,i[b]=b,D--,b=B;this._hullStart=n[q]=b,i[b]=n[z]=q,i[q]=z,a[this._hashKey(ae,G)]=q,a[this._hashKey(e[2*b],e[2*b+1])]=b}this.hull=new Uint32Array(D);for(let x=0,$=this._hullStart;x<D;x++)this.hull[x]=$,$=i[$];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,n){return Math.floor(xI(e-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:n,_halfedges:i,coords:r}=this;let a=0,o=0;for(;;){const s=i[e],c=e-e%3;if(o=c+(e+2)%3,s===-1){if(a===0)break;e=Ml[--a];continue}const u=s-s%3,h=c+(e+1)%3,f=u+(s+2)%3,d=n[o],g=n[e],p=n[h],y=n[f];if(vI(r[2*d],r[2*d+1],r[2*g],r[2*g+1],r[2*p],r[2*p+1],r[2*y],r[2*y+1])){n[e]=y,n[s]=d;const m=i[f];if(m===-1){let j=this._hullStart;do{if(this._hullTri[j]===f){this._hullTri[j]=e;break}j=this._hullPrev[j]}while(j!==this._hullStart)}this._link(e,m),this._link(s,i[o]),this._link(o,f);const I=u+(s+1)%3;a<Ml.length&&(Ml[a++]=I)}else{if(a===0)break;e=Ml[--a]}}return o}_link(e,n){this._halfedges[e]=n,n!==-1&&(this._halfedges[n]=e)}_addTriangle(e,n,i,r,a,o){const s=this.trianglesLen;return this._triangles[s]=e,this._triangles[s+1]=n,this._triangles[s+2]=i,this._link(s,r),this._link(s+1,a),this._link(s+2,o),this.trianglesLen+=3,s}}function xI(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}function ku(t,e,n,i){const r=t-n,a=e-i;return r*r+a*a}function vI(t,e,n,i,r,a,o,s){const c=t-o,u=e-s,h=n-o,f=i-s,d=r-o,g=a-s,p=c*c+u*u,y=h*h+f*f,v=d*d+g*g;return c*(f*v-y*g)-u*(h*v-y*d)+p*(h*g-f*d)<0}function wI(t,e,n,i,r,a){const o=n-t,s=i-e,c=r-t,u=a-e,h=o*o+s*s,f=c*c+u*u,d=.5/(o*u-s*c),g=(u*h-s*f)*d,p=(o*f-c*h)*d;return g*g+p*p}function bI(t,e,n,i,r,a){const o=n-t,s=i-e,c=r-t,u=a-e,h=o*o+s*s,f=c*c+u*u,d=.5/(o*u-s*c),g=t+(u*h-s*f)*d,p=e+(o*f-c*h)*d;return{x:g,y:p}}function jo(t,e,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const a=t[r],o=e[a];let s=r-1;for(;s>=n&&e[t[s]]>o;)t[s+1]=t[s--];t[s+1]=a}else{const r=n+i>>1;let a=n+1,o=i;hs(t,r,a),e[t[n]]>e[t[i]]&&hs(t,n,i),e[t[a]]>e[t[i]]&&hs(t,a,i),e[t[n]]>e[t[a]]&&hs(t,n,a);const s=t[a],c=e[s];for(;;){do a++;while(e[t[a]]<c);do o--;while(e[t[o]]>c);if(o<a)break;hs(t,a,o)}t[n+1]=t[o],t[o]=s,i-a+1>=o-n?(jo(t,e,a,i),jo(t,e,n,o-1)):(jo(t,e,n,o-1),jo(t,e,a,i))}}function hs(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function CI(t){return t[0]}function SI(t){return t[1]}const Sm=1e-6;let Wa=class{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,n){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,n){this._+=`L${this._x1=+e},${this._y1=+n}`}arc(e,n,i){e=+e,n=+n,i=+i;const r=e+i,a=n;if(i<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${a}`:(Math.abs(this._x1-r)>Sm||Math.abs(this._y1-a)>Sm)&&(this._+="L"+r+","+a),i&&(this._+=`A${i},${i},0,1,1,${e-i},${n}A${i},${i},0,1,1,${this._x1=r},${this._y1=a}`)}rect(e,n,i,r){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${+i}v${+r}h${-i}Z`}value(){return this._||null}};class Dh{constructor(){this._=[]}moveTo(e,n){this._.push([e,n])}closePath(){this._.push(this._[0].slice())}lineTo(e,n){this._.push([e,n])}value(){return this._.length?this._:null}}class DI{constructor(e,[n,i,r,a]=[0,0,960,500]){if(!((r=+r)>=(n=+n))||!((a=+a)>=(i=+i)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(e.points.length*2),this.vectors=new Float64Array(e.points.length*2),this.xmax=r,this.xmin=n,this.ymax=a,this.ymin=i,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:n,triangles:i},vectors:r}=this;let a,o;const s=this.circumcenters=this._circumcenters.subarray(0,i.length/3*2);for(let y=0,v=0,m=i.length,I,j;y<m;y+=3,v+=2){const w=i[y]*2,S=i[y+1]*2,P=i[y+2]*2,W=e[w],D=e[w+1],x=e[S],$=e[S+1],V=e[P],q=e[P+1],ae=x-W,G=$-D,_=V-W,b=q-D,B=(ae*b-G*_)*2;if(Math.abs(B)<1e-9){if(a===void 0){a=o=0;for(const z of n)a+=e[z*2],o+=e[z*2+1];a/=n.length,o/=n.length}const X=1e9*Math.sign((a-W)*b-(o-D)*_);I=(W+V)/2-X*b,j=(D+q)/2+X*_}else{const X=1/B,z=ae*ae+G*G,C=_*_+b*b;I=W+(b*z-G*C)*X,j=D+(ae*C-_*z)*X}s[v]=I,s[v+1]=j}let c=n[n.length-1],u,h=c*4,f,d=e[2*c],g,p=e[2*c+1];r.fill(0);for(let y=0;y<n.length;++y)c=n[y],u=h,f=d,g=p,h=c*4,d=e[2*c],p=e[2*c+1],r[u+2]=r[h]=g-p,r[u+3]=r[h+1]=d-f}render(e){const n=e==null?e=new Wa:void 0,{delaunay:{halfedges:i,inedges:r,hull:a},circumcenters:o,vectors:s}=this;if(a.length<=1)return null;for(let h=0,f=i.length;h<f;++h){const d=i[h];if(d<h)continue;const g=Math.floor(h/3)*2,p=Math.floor(d/3)*2,y=o[g],v=o[g+1],m=o[p],I=o[p+1];this._renderSegment(y,v,m,I,e)}let c,u=a[a.length-1];for(let h=0;h<a.length;++h){c=u,u=a[h];const f=Math.floor(r[u]/3)*2,d=o[f],g=o[f+1],p=c*4,y=this._project(d,g,s[p+2],s[p+3]);y&&this._renderSegment(d,g,y[0],y[1],e)}return n&&n.value()}renderBounds(e){const n=e==null?e=new Wa:void 0;return e.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(e,n){const i=n==null?n=new Wa:void 0,r=this._clip(e);if(r===null||!r.length)return;n.moveTo(r[0],r[1]);let a=r.length;for(;r[0]===r[a-2]&&r[1]===r[a-1]&&a>1;)a-=2;for(let o=2;o<a;o+=2)(r[o]!==r[o-2]||r[o+1]!==r[o-1])&&n.lineTo(r[o],r[o+1]);return n.closePath(),i&&i.value()}*cellPolygons(){const{delaunay:{points:e}}=this;for(let n=0,i=e.length/2;n<i;++n){const r=this.cellPolygon(n);r&&(r.index=n,yield r)}}cellPolygon(e){const n=new Dh;return this.renderCell(e,n),n.value()}_renderSegment(e,n,i,r,a){let o;const s=this._regioncode(e,n),c=this._regioncode(i,r);s===0&&c===0?(a.moveTo(e,n),a.lineTo(i,r)):(o=this._clipSegment(e,n,i,r,s,c))&&(a.moveTo(o[0],o[1]),a.lineTo(o[2],o[3]))}contains(e,n,i){return n=+n,n!==n||(i=+i,i!==i)?!1:this.delaunay._step(e,n,i)===e}*neighbors(e){const n=this._clip(e);if(n)for(const i of this.delaunay.neighbors(e)){const r=this._clip(i);if(r){e:for(let a=0,o=n.length;a<o;a+=2)for(let s=0,c=r.length;s<c;s+=2)if(n[a]===r[s]&&n[a+1]===r[s+1]&&n[(a+2)%o]===r[(s+c-2)%c]&&n[(a+3)%o]===r[(s+c-1)%c]){yield i;break e}}}}_cell(e){const{circumcenters:n,delaunay:{inedges:i,halfedges:r,triangles:a}}=this,o=i[e];if(o===-1)return null;const s=[];let c=o;do{const u=Math.floor(c/3);if(s.push(n[u*2],n[u*2+1]),c=c%3===2?c-2:c+1,a[c]!==e)break;c=r[c]}while(c!==o&&c!==-1);return s}_clip(e){if(e===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(e);if(n===null)return null;const{vectors:i}=this,r=e*4;return this._simplify(i[r]||i[r+1]?this._clipInfinite(e,n,i[r],i[r+1],i[r+2],i[r+3]):this._clipFinite(e,n))}_clipFinite(e,n){const i=n.length;let r=null,a,o,s=n[i-2],c=n[i-1],u,h=this._regioncode(s,c),f,d=0;for(let g=0;g<i;g+=2)if(a=s,o=c,s=n[g],c=n[g+1],u=h,h=this._regioncode(s,c),u===0&&h===0)f=d,d=0,r?r.push(s,c):r=[s,c];else{let p,y,v,m,I;if(u===0){if((p=this._clipSegment(a,o,s,c,u,h))===null)continue;[y,v,m,I]=p}else{if((p=this._clipSegment(s,c,a,o,h,u))===null)continue;[m,I,y,v]=p,f=d,d=this._edgecode(y,v),f&&d&&this._edge(e,f,d,r,r.length),r?r.push(y,v):r=[y,v]}f=d,d=this._edgecode(m,I),f&&d&&this._edge(e,f,d,r,r.length),r?r.push(m,I):r=[m,I]}if(r)f=d,d=this._edgecode(r[0],r[1]),f&&d&&this._edge(e,f,d,r,r.length);else if(this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return r}_clipSegment(e,n,i,r,a,o){const s=a<o;for(s&&([e,n,i,r,a,o]=[i,r,e,n,o,a]);;){if(a===0&&o===0)return s?[i,r,e,n]:[e,n,i,r];if(a&o)return null;let c,u,h=a||o;h&8?(c=e+(i-e)*(this.ymax-n)/(r-n),u=this.ymax):h&4?(c=e+(i-e)*(this.ymin-n)/(r-n),u=this.ymin):h&2?(u=n+(r-n)*(this.xmax-e)/(i-e),c=this.xmax):(u=n+(r-n)*(this.xmin-e)/(i-e),c=this.xmin),a?(e=c,n=u,a=this._regioncode(e,n)):(i=c,r=u,o=this._regioncode(i,r))}}_clipInfinite(e,n,i,r,a,o){let s=Array.from(n),c;if((c=this._project(s[0],s[1],i,r))&&s.unshift(c[0],c[1]),(c=this._project(s[s.length-2],s[s.length-1],a,o))&&s.push(c[0],c[1]),s=this._clipFinite(e,s))for(let u=0,h=s.length,f,d=this._edgecode(s[h-2],s[h-1]);u<h;u+=2)f=d,d=this._edgecode(s[u],s[u+1]),f&&d&&(u=this._edge(e,f,d,s,u),h=s.length);else this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(e,n,i,r,a){for(;n!==i;){let o,s;switch(n){case 5:n=4;continue;case 4:n=6,o=this.xmax,s=this.ymin;break;case 6:n=2;continue;case 2:n=10,o=this.xmax,s=this.ymax;break;case 10:n=8;continue;case 8:n=9,o=this.xmin,s=this.ymax;break;case 9:n=1;continue;case 1:n=5,o=this.xmin,s=this.ymin;break}(r[a]!==o||r[a+1]!==s)&&this.contains(e,o,s)&&(r.splice(a,0,o,s),a+=2)}return a}_project(e,n,i,r){let a=1/0,o,s,c;if(r<0){if(n<=this.ymin)return null;(o=(this.ymin-n)/r)<a&&(c=this.ymin,s=e+(a=o)*i)}else if(r>0){if(n>=this.ymax)return null;(o=(this.ymax-n)/r)<a&&(c=this.ymax,s=e+(a=o)*i)}if(i>0){if(e>=this.xmax)return null;(o=(this.xmax-e)/i)<a&&(s=this.xmax,c=n+(a=o)*r)}else if(i<0){if(e<=this.xmin)return null;(o=(this.xmin-e)/i)<a&&(s=this.xmin,c=n+(a=o)*r)}return[s,c]}_edgecode(e,n){return(e===this.xmin?1:e===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(e,n){return(e<this.xmin?1:e>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let n=0;n<e.length;n+=2){const i=(n+2)%e.length,r=(n+4)%e.length;(e[n]===e[i]&&e[i]===e[r]||e[n+1]===e[i+1]&&e[i+1]===e[r+1])&&(e.splice(i,2),n-=2)}e.length||(e=null)}return e}}const MI=2*Math.PI,yo=Math.pow;function TI(t){return t[0]}function kI(t){return t[1]}function jI(t){const{triangles:e,coords:n}=t;for(let i=0;i<e.length;i+=3){const r=2*e[i],a=2*e[i+1],o=2*e[i+2];if((n[o]-n[r])*(n[a+1]-n[r+1])-(n[a]-n[r])*(n[o+1]-n[r+1])>1e-10)return!1}return!0}function AI(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class Lc{static from(e,n=TI,i=kI,r){return new Lc("length"in e?_I(e,n,i,r):Float64Array.from(OI(e,n,i,r)))}constructor(e){this._delaunator=new pc(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const e=this._delaunator,n=this.points;if(e.hull&&e.hull.length>2&&jI(e)){this.collinear=Int32Array.from({length:n.length/2},(d,g)=>g).sort((d,g)=>n[2*d]-n[2*g]||n[2*d+1]-n[2*g+1]);const c=this.collinear[0],u=this.collinear[this.collinear.length-1],h=[n[2*c],n[2*c+1],n[2*u],n[2*u+1]],f=1e-8*Math.hypot(h[3]-h[1],h[2]-h[0]);for(let d=0,g=n.length/2;d<g;++d){const p=AI(n[2*d],n[2*d+1],f);n[2*d]=p[0],n[2*d+1]=p[1]}this._delaunator=new pc(n)}else delete this.collinear;const i=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,a=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),s=this._hullIndex.fill(-1);for(let c=0,u=i.length;c<u;++c){const h=a[c%3===2?c-2:c+1];(i[c]===-1||o[h]===-1)&&(o[h]=c)}for(let c=0,u=r.length;c<u;++c)s[r[c]]=c;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,r.length===2&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(e){return new DI(this,e)}*neighbors(e){const{inedges:n,hull:i,_hullIndex:r,halfedges:a,triangles:o,collinear:s}=this;if(s){const f=s.indexOf(e);f>0&&(yield s[f-1]),f<s.length-1&&(yield s[f+1]);return}const c=n[e];if(c===-1)return;let u=c,h=-1;do{if(yield h=o[u],u=u%3===2?u-2:u+1,o[u]!==e)return;if(u=a[u],u===-1){const f=i[(r[e]+1)%i.length];f!==h&&(yield f);return}}while(u!==c)}find(e,n,i=0){if(e=+e,e!==e||(n=+n,n!==n))return-1;const r=i;let a;for(;(a=this._step(i,e,n))>=0&&a!==i&&a!==r;)i=a;return a}_step(e,n,i){const{inedges:r,hull:a,_hullIndex:o,halfedges:s,triangles:c,points:u}=this;if(r[e]===-1||!u.length)return(e+1)%(u.length>>1);let h=e,f=yo(n-u[e*2],2)+yo(i-u[e*2+1],2);const d=r[e];let g=d;do{let p=c[g];const y=yo(n-u[p*2],2)+yo(i-u[p*2+1],2);if(y<f&&(f=y,h=p),g=g%3===2?g-2:g+1,c[g]!==e)break;if(g=s[g],g===-1){if(g=a[(o[e]+1)%a.length],g!==p&&yo(n-u[g*2],2)+yo(i-u[g*2+1],2)<f)return g;break}}while(g!==d);return h}render(e){const n=e==null?e=new Wa:void 0,{points:i,halfedges:r,triangles:a}=this;for(let o=0,s=r.length;o<s;++o){const c=r[o];if(c<o)continue;const u=a[o]*2,h=a[c]*2;e.moveTo(i[u],i[u+1]),e.lineTo(i[h],i[h+1])}return this.renderHull(e),n&&n.value()}renderPoints(e,n){n===void 0&&(!e||typeof e.moveTo!="function")&&(n=e,e=null),n=n==null?2:+n;const i=e==null?e=new Wa:void 0,{points:r}=this;for(let a=0,o=r.length;a<o;a+=2){const s=r[a],c=r[a+1];e.moveTo(s+n,c),e.arc(s,c,n,0,MI)}return i&&i.value()}renderHull(e){const n=e==null?e=new Wa:void 0,{hull:i,points:r}=this,a=i[0]*2,o=i.length;e.moveTo(r[a],r[a+1]);for(let s=1;s<o;++s){const c=2*i[s];e.lineTo(r[c],r[c+1])}return e.closePath(),n&&n.value()}hullPolygon(){const e=new Dh;return this.renderHull(e),e.value()}renderTriangle(e,n){const i=n==null?n=new Wa:void 0,{points:r,triangles:a}=this,o=a[e*=3]*2,s=a[e+1]*2,c=a[e+2]*2;return n.moveTo(r[o],r[o+1]),n.lineTo(r[s],r[s+1]),n.lineTo(r[c],r[c+1]),n.closePath(),i&&i.value()}*trianglePolygons(){const{triangles:e}=this;for(let n=0,i=e.length/3;n<i;++n)yield this.trianglePolygon(n)}trianglePolygon(e){const n=new Dh;return this.renderTriangle(e,n),n.value()}}function _I(t,e,n,i){const r=t.length,a=new Float64Array(r*2);for(let o=0;o<r;++o){const s=t[o];a[o*2]=e.call(i,s,o,t),a[o*2+1]=n.call(i,s,o,t)}return a}function*OI(t,e,n,i){let r=0;for(const a of t)yield e.call(i,a,r,t),yield n.call(i,a,r,t),++r}function NI(t){const{data:e,width:n,height:i,lineColors:r,dateFormat:a,noOfXTicks:o,rightMargin:s,topMargin:c,bottomMargin:u,suffix:h,prefix:f,leftMargin:d,tooltip:g,onSeriesMouseOver:p,refValues:y,highlightAreaSettings:v,minValue:m,maxValue:I,highlightedLines:j,animate:w,rtl:S,strokeWidth:P,showDots:W,annotations:D,customHighlightAreaSettings:x,yAxisTitle:$,noOfYTicks:V,minDate:q,maxDate:ae,curveType:G,styles:_,colorDomain:b,selectedColor:B,classNames:X,showLabels:z,dimmedOpacity:C,precision:A,naLabel:M,customLayers:O}=t,K=k.useRef(null),Q=ct(K,{once:w.once,amount:w.amount}),[se,T]=k.useState(!1);k.useEffect(()=>{if(Q&&!se){const F=setTimeout(()=>{T(!0)},(w.duration+.5)*1e3);return()=>clearTimeout(F)}},[Q,se,w.duration]);const Z=G==="linear"?Oi:G==="step"?Or:G==="stepAfter"?Ir:G==="stepBefore"?Nr:_r,ie=tt(e.map(F=>({...F,date:ze(`${F.date}`,a,new Date)})),"date").filter(F=>!je(F.y)),ue=Xe(ie,F=>F.label).map(F=>F.label),he=Xe(tt(e.map(F=>({...F,date:ze(`${F.date}`,a,new Date)})),"date"),F=>F.date).map(F=>F.date),[Y,ge]=k.useState(void 0),[oe,ce]=k.useState(void 0),[N,U]=k.useState(void 0),ve={top:c,bottom:u,left:$?d+30:d,right:s},J=k.useRef(null),R=ue.map(F=>tt(ie.filter(Ie=>Ie.label==F),"date")),le=v.map(F=>({...F,coordinates:[F.coordinates[0]===null?null:ze(`${F.coordinates[0]}`,a,new Date),F.coordinates[1]===null?null:ze(`${F.coordinates[1]}`,a,new Date)]})),ee=x.map(F=>({...F,coordinates:F.coordinates.map((Ie,Ve)=>Ve%2===0?ze(`${Ie}`,a,new Date):Ie)})),de=n-ve.left-ve.right,te=i-ve.top-ve.bottom,Me=q?ze(`${q}`,a,new Date):he[0],be=ae?ze(`${ae}`,a,new Date):he[he.length-1],ne=je(m)?Math.min(...ie.map(F=>F.y).filter(F=>!je(F)))?Math.min(...ie.map(F=>F.y).filter(F=>!je(F)))>0?0:Math.min(...ie.map(F=>F.y).filter(F=>!je(F))):0:m,De=Math.max(...ie.map(F=>F.y).filter(F=>!je(F)))?Math.max(...ie.map(F=>F.y).filter(F=>!je(F))):0,xe=Zr().domain([Me,be]).range([0,de]),Ae=ut().domain([je(m)?ne:m,je(I)?De>0?De:0:I]).range([te,0]).nice(),ke=Lc.from(ie.filter(F=>!je(F.date)&&!je(F.y)),F=>xe(F.date),F=>Ae(F.y)).voronoi([0,0,de<0?0:de,te<0?0:te]),me=ii().x(F=>xe(F.date)).y(F=>Ae(F.y)).curve(Z),Se=Ae.ticks(V),Le=xe.ticks(o);return k.useEffect(()=>{const F=Ve=>{const H=ie[Qr(ie.map(Oe=>Oe.date),xe.invert(En(Ve)[0]),1)];ge(H||ie[ie.length-1]),U(Ve.clientY),ce(Ve.clientX),p?.(H||ie[ie.length-1])},Ie=()=>{ge(void 0),ce(void 0),U(void 0)};bt(J.current).on("mousemove",F).on("mouseout",Ie),p?.(void 0)},[xe,ie,p]),l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{width:`${n}px`,height:`${i}px`,viewBox:`0 0 ${n} ${i}`,direction:"ltr",ref:K,children:l.jsxs("g",{transform:`translate(${ve.left},${ve.top})`,children:[l.jsx(ao,{areaSettings:le,width:de,height:te,scale:xe,animate:w,isInView:Q}),l.jsx(lo,{areaSettings:ee,scaleX:xe,scaleY:Ae,animate:w,isInView:Q}),l.jsxs("g",{children:[l.jsx(ri,{values:Se.filter(F=>F!==0),y:Se.filter(F=>F!==0).map(F=>Ae(F)),x1:0-d,x2:de+ve.right,styles:{gridLines:_?.yAxis?.gridLines,labels:_?.yAxis?.labels},classNames:{gridLines:X?.yAxis?.gridLines,labels:X?.yAxis?.labels},suffix:h,prefix:f,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:A}),l.jsx(Dt,{y1:Ae(ne<0?0:ne),y2:Ae(ne<0?0:ne),x1:0-d,x2:de+ve.right,label:qe(ne<0?0:ne,"NA",A,f,h),labelPos:{x:0-d,y:Ae(ne<0?0:ne),dx:0,dy:De<0?"1em":-5},classNames:{axis:X?.xAxis?.axis,label:X?.yAxis?.labels},styles:{axis:_?.xAxis?.axis,label:_?.yAxis?.labels}}),l.jsx(Nt,{x:0-d-15,y:te/2,style:_?.yAxis?.title,className:X?.yAxis?.title,text:$,rotate90:!0})]}),l.jsx("g",{children:l.jsx(Rn,{values:Le.map(F=>ft(F,a)),x:Le.map(F=>xe(F)),y1:0,y2:te,styles:{gridLines:_?.xAxis?.gridLines,labels:_?.xAxis?.labels},classNames:{gridLines:Ce.cn("opacity-0",X?.xAxis?.gridLines),labels:Ce.cn("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",X?.xAxis?.labels)},suffix:h,prefix:f,labelType:"primary",showGridLines:!0,precision:A})}),O.filter(F=>F.position==="before").map(F=>F.layer),l.jsxs($e.g,{children:[R.map(F=>l.jsxs($e.g,{exit:{opacity:0,transition:{duration:w.duration}},variants:{initial:{opacity:Y?F[0].label===Y.label?1:C:B?F[0].color&&r[b.indexOf(F[0].color)]===B?1:C:j.length!==0?j.indexOf(F[0].label)!==-1?1:C:1},whileInView:{opacity:Y?F[0].label===Y.label?1:C:B?F[0].color&&r[b.indexOf(F[0].color)]===B?1:C:j.length!==0?j.indexOf(F[0].label)!==-1?1:C:1,transition:{duration:w.duration}}},initial:"initial",animate:Q?"whileInView":"initial",children:[l.jsx($e.path,{d:me(F.filter(Ie=>!je(Ie.y)))||"",style:{fill:"none",strokeWidth:Y?F[0].label===Y.label?P+Math.max(2,.5*P):P:j.length!==0&&j.indexOf(F[0].label)!==-1?P+Math.max(2,.5*P):P},exit:{opacity:0,transition:{duration:w.duration}},variants:{initial:{pathLength:0,d:me(F.filter(Ie=>!je(Ie.y)))||"",opacity:1,stroke:e.filter(Ie=>Ie.color).length===0?r[0]:F[0].color?r[b.indexOf(F[0].color)]:Pe.gray},whileInView:{pathLength:1,d:me(F.filter(Ie=>!je(Ie.y)))||"",opacity:1,stroke:e.filter(Ie=>Ie.color).length===0?r[0]:F[0].color?r[b.indexOf(F[0].color)]:Pe.gray,transition:{duration:w.duration}}},initial:"initial",animate:Q?"whileInView":"initial"}),F.map((Ie,Ve)=>l.jsx($e.g,{children:je(Ie.y)?null:l.jsx(l.Fragment,{children:W?l.jsx($e.circle,{r:de/F.length<5?0:de/F.length<20?2:4,exit:{opacity:0,transition:{duration:w.duration}},variants:{initial:{opacity:0,fill:e.filter(H=>H.color).length===0?r[0]:F[0].color?r[b.indexOf(F[0].color)]:Pe.gray,cx:xe(Ie.date),cy:Ae(Ie.y)},whileInView:{opacity:1,fill:e.filter(H=>H.color).length===0?r[0]:F[0].color?r[b.indexOf(F[0].color)]:Pe.gray,transition:{duration:se?w.duration:.5,delay:se?0:w.duration},cx:xe(Ie.date),cy:Ae(Ie.y)}},initial:"initial",animate:Q?"whileInView":"initial"}):null})},Ve)),(j.indexOf(F[0].label)!==-1||Y?.label===F[0].label)&&z?l.jsx($e.text,{style:{fill:e.filter(Ie=>Ie.color).length===0?r[0]:F[0].color?r[b.indexOf(F[0].color)]:Pe.gray},className:"text-sm font-bold",dx:5,dy:4,exit:{opacity:0,transition:{duration:w.duration}},variants:{initial:{opacity:0,x:xe(F[F.length-1].date),y:Ae(F[F.length-1].y)},whileInView:{opacity:1,x:xe(F[F.length-1].date),y:Ae(F[F.length-1].y),transition:{duration:se?w.duration:.5,delay:se?0:w.duration}}},initial:"initial",animate:Q?"whileInView":"initial",children:F[0].label}):null]},F[0].label)),Y?l.jsx("text",{y:Ae(Y.y)-8,x:xe(Y.date),className:Ce.cn("graph-value text-sm font-bold",X?.graphObjectValues),style:{fill:e.filter(F=>F.color).length===0?r[0]:Y.color?r[b.indexOf(Y.color)]:Pe.gray,textAnchor:"middle",..._?.graphObjectValues||{}},children:qe(Y.y,M,A,f,h)}):null]}),ie.filter(F=>!je(F.y)).map((F,Ie)=>l.jsx("g",{children:l.jsx("path",{d:ke.renderCell(ie.findIndex(Ve=>Ve.label===F.label&&Ve.date===F.date)),opacity:0,onMouseEnter:Ve=>{ge(F),U(Ve.clientY),ce(Ve.clientX),p?.(F)},onMouseMove:Ve=>{ge(F),U(Ve.clientY),ce(Ve.clientX)},onMouseLeave:()=>{ge(void 0),ce(void 0),U(void 0),p?.(void 0)}})},Ie)),y?l.jsx(l.Fragment,{children:y.map((F,Ie)=>l.jsx(gi,{text:F.text,color:F.color,y:Ae(F.value),x1:0-d,x2:de+ve.right,classNames:F.classNames,styles:F.styles,animate:w,isInView:Q},Ie))}):null,l.jsx("g",{children:D.map((F,Ie)=>{const Ve=oo({x:F.xCoordinate?xe(ze(`${F.xCoordinate}`,a,new Date))+(F.xOffset||0):0+(F.xOffset||0),y:F.yCoordinate?Ae(F.yCoordinate)+(F.yOffset||0)-8:0+(F.yOffset||0)-8},{x:F.xCoordinate?xe(ze(`${F.xCoordinate}`,a,new Date)):0,y:F.yCoordinate?Ae(F.yCoordinate):0},je(F.connectorRadius)?3.5:F.connectorRadius),H=F.showConnector?{y1:Ve.y,x1:Ve.x,y2:F.yCoordinate?Ae(F.yCoordinate)+(F.yOffset||0):0+(F.yOffset||0),x2:F.xCoordinate?xe(ze(`${F.xCoordinate}`,a,new Date))+(F.xOffset||0):0+(F.xOffset||0),cy:F.yCoordinate?Ae(F.yCoordinate):0,cx:F.xCoordinate?xe(ze(`${F.xCoordinate}`,a,new Date)):0,circleRadius:je(F.connectorRadius)?3.5:F.connectorRadius,strokeWidth:F.showConnector===!0?2:Math.min(F.showConnector||0,1)}:void 0,Oe={y:F.yCoordinate?Ae(F.yCoordinate)+(F.yOffset||0)-8:0+(F.yOffset||0)-8,x:S?0:F.xCoordinate?xe(ze(`${F.xCoordinate}`,a,new Date))+(F.xOffset||0):0+(F.xOffset||0),width:S?F.xCoordinate?xe(ze(`${F.xCoordinate}`,a,new Date))+(F.xOffset||0):0+(F.xOffset||0):de-(F.xCoordinate?xe(ze(`${F.xCoordinate}`,a,new Date))+(F.xOffset||0):0+(F.xOffset||0)),maxWidth:F.maxWidth,fontWeight:F.fontWeight,align:F.align};return l.jsx(so,{color:F.color,connectorsSettings:H,labelSettings:Oe,text:F.text,classNames:F.classNames,styles:F.styles,animate:w,isInView:Q},Ie)})}),O.filter(F=>F.position==="after").map(F=>F.layer)]})}),Y&&g&&oe&&N?l.jsx(st,{data:Y,body:g,xPos:oe,yPos:N,backgroundStyle:_?.tooltip,className:X?.tooltip}):null]})}function vv(t){const{data:e,graphTitle:n,showNAColor:i=!0,colors:r,colorDomain:a,suffix:o="",sources:s,prefix:c="",graphDescription:u,height:h,width:f,footNote:d,noOfXTicks:g=10,dateFormat:p="yyyy",padding:y,backgroundColor:v=!1,leftMargin:m=30,rightMargin:I=50,topMargin:j=20,bottomMargin:w=25,showColorScale:S=!0,tooltip:P,relativeHeight:W,onSeriesMouseOver:D,showLabels:x=!0,refValues:$=[],highlightAreaSettings:V=[],graphID:q,minValue:ae,maxValue:G,highlightedLines:_=[],graphDownload:b=!1,dataDownload:B=!1,animate:X=!1,language:z="en",colorLegendTitle:C,minHeight:A=0,strokeWidth:M=2,showDots:O=!0,annotations:K=[],customHighlightAreaSettings:Q=[],theme:se="light",ariaLabel:T,yAxisTitle:Z,noOfYTicks:ie=5,minDate:ue,maxDate:he,curveType:Y="curve",styles:ge,classNames:oe,dimmedOpacity:ce=.3,precision:N=2,customLayers:U=[],naLabel:ve="NA"}=t,[J,R]=k.useState(0),[le,ee]=k.useState(0),[de,te]=k.useState(void 0),Me=k.useRef(null),be=k.useRef(null);return k.useEffect(()=>{const ne=new ResizeObserver(De=>{R(f||De[0].target.clientWidth||620),ee(h||De[0].target.clientHeight||480)});return Me.current&&(ee(Me.current.clientHeight||480),R(Me.current.clientWidth||620),f||ne.observe(Me.current)),()=>ne.disconnect()},[f,h]),l.jsx("div",{className:`${se||"light"} flex ${f?"w-fit grow-0":"w-full grow"}`,dir:z==="he"||z==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${v?v===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${z||"en"}`,oe?.graphContainer),style:{...ge?.graphContainer||{},...v&&v!==!0?{backgroundColor:v}:{}},id:q,ref:be,"aria-label":T||`${n?`The graph shows ${n}. `:""}This is a multi-line chart that shows trends over time.${u?` ${u}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:v?y||"1rem":y||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||u||b||B?l.jsx(Qe,{styles:{title:ge?.title,description:ge?.description},classNames:{title:oe?.title,description:oe?.description},graphTitle:n,graphDescription:u,width:f,graphDownload:b?be.current:void 0,dataDownload:B?e.map(ne=>ne.data).filter(ne=>ne!==void 0).length>0?e.map(ne=>ne.data).filter(ne=>ne!==void 0):e.filter(ne=>ne!==void 0):null}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[S&&e.filter(ne=>ne.color).length!==0?l.jsx(tn,{width:f,colorLegendTitle:C,colors:r||Pe[se].categoricalColors.colors,colorDomain:a||Xe(e.filter(ne=>ne.color),"color").map(ne=>ne.color).filter(ne=>ne!==void 0),setSelectedColor:te,showNAColor:i}):null,l.jsx("div",{className:"w-full grow leading-0",ref:Me,"aria-label":"Graph area",children:(f||J)&&(h||le)?l.jsx(NI,{data:e,lineColors:e.filter(ne=>ne.color).length===0?r?[r]:[Pe.primaryColors["blue-600"]]:r||Pe[se].categoricalColors.colors,width:f||J,height:Math.max(A,h||(W?A?(f||J)*W>A?(f||J)*W:A:(f||J)*W:le)),dateFormat:p,noOfXTicks:g,leftMargin:m,rightMargin:I,topMargin:j,bottomMargin:w,tooltip:P,onSeriesMouseOver:D,suffix:o,prefix:c,highlightAreaSettings:V,refValues:$,minValue:ae,maxValue:G,highlightedLines:_,animate:X===!0?{duration:.5,once:!0,amount:.5}:X||{duration:0,once:!0,amount:0},rtl:z==="he"||z==="ar",strokeWidth:M,showDots:O,annotations:K,customHighlightAreaSettings:Q,yAxisTitle:Z,noOfYTicks:ie,minDate:ue,maxDate:he,curveType:Y,styles:ge,classNames:oe,selectedColor:de,showLabels:x,colorDomain:e.filter(ne=>ne.color).length===0?[]:a||Xe(e.filter(ne=>ne.color),"color").map(ne=>ne.color),dimmedOpacity:ce,precision:N,customLayers:U,naLabel:ve}):null})]})}),s||d?l.jsx(et,{styles:{footnote:ge?.footnote,source:ge?.source},classNames:{footnote:oe?.footnote,source:oe?.source},sources:s,footNote:d,width:f}):null]})})})})}function II(t){const{data:e,width:n,height:i,lineColors:r,suffix:a,prefix:o,dateFormat:s,showValues:c,noOfXTicks:u,rightMargin:h,leftMargin:f,topMargin:d,bottomMargin:g,tooltip:p,highlightAreaSettings:y,onSeriesMouseOver:v,animate:m,rtl:I,showColorLegendAtTop:j,colorDomain:w,diffAreaColors:S,idSuffix:P,strokeWidth:W,showDots:D,refValues:x,minValue:$,maxValue:V,annotations:q,customHighlightAreaSettings:ae,yAxisTitle:G,noOfYTicks:_,minDate:b,maxDate:B,curveType:X,styles:z,classNames:C,precision:A,customLayers:M}=t,O=k.useRef(null),K=ct(O,{once:m.once,amount:m.amount}),[Q,se]=k.useState(!1);k.useEffect(()=>{if(K&&!Q){const H=setTimeout(()=>{se(!0)},(m.duration+.5)*1e3);return()=>clearTimeout(H)}},[K,Q,m.duration]);const T=X==="linear"?Oi:X==="step"?Or:X==="stepAfter"?Ir:X==="stepBefore"?Nr:_r,[Z,ie]=k.useState(void 0),[ue,he]=k.useState(void 0),[Y,ge]=k.useState(void 0),oe={top:d,bottom:g,left:G?f+30:f,right:h},ce=k.useRef(null),N=tt(e.map(H=>({...H,date:ze(`${H.date}`,s,new Date)})),"date"),U=y.map(H=>({...H,coordinates:[H.coordinates[0]===null?null:ze(`${H.coordinates[0]}`,s,new Date),H.coordinates[1]===null?null:ze(`${H.coordinates[1]}`,s,new Date)]})),ve=ae.map(H=>({...H,coordinates:H.coordinates.map((Oe,Ee)=>Ee%2===0?ze(`${Oe}`,s,new Date):Oe)})),J=n-oe.left-oe.right,R=i-oe.top-oe.bottom,le=b?ze(`${b}`,s,new Date):N[0].date,ee=B?ze(`${B}`,s,new Date):N[N.length-1].date,de=Math.min(...N.map(H=>H.y1))!==1/0?Math.min(...N.map(H=>H.y1))>0?0:Math.min(...N.map(H=>H.y1)):0,te=Math.min(...N.map(H=>H.y2))!==1/0?Math.min(...N.map(H=>H.y2))>0?0:Math.min(...N.map(H=>H.y2)):0,Me=Math.max(...N.map(H=>H.y1))!==1/0?Math.max(...N.map(H=>H.y1)):0,be=Math.max(...N.map(H=>H.y2))!==1/0?Math.max(...N.map(H=>H.y2)):0,ne=je($)?de<te?de:te:$,De=Me>be?Me:be,xe=Zr().domain([le,ee]).range([0,J]),Ae=ut().domain([je($)?ne:$,je(V)?De>0?De:0:V]).range([R,0]).nice(),ke=ii().x(H=>xe(H.date)).y(H=>Ae(H.y1)).curve(T),me=ii().x(H=>xe(H.date)).y(H=>Ae(H.y2)).curve(T),Se=No().x(H=>xe(H.date)).y1(H=>Ae(H.y1)).y0(H=>Ae(H.y2)).curve(T),Le=No().x(H=>xe(H.date)).y1(H=>Ae(H.y1)).y0(0).curve(T),F=No().x(H=>xe(H.date)).y1(H=>Ae(H.y2)).y0(0).curve(T),Ie=Ae.ticks(_),Ve=xe.ticks(u);return k.useEffect(()=>{const H=Ee=>{const it=N[Qr(N.map(Tt=>Tt.date),xe.invert(En(Ee)[0]),1)];ie(it||N[N.length-1]),v?.(it||N[N.length-1]),ge(Ee.clientY),he(Ee.clientX)},Oe=()=>{ie(void 0),he(void 0),ge(void 0),v?.(void 0)};bt(ce.current).on("mousemove",H).on("mouseout",Oe)},[xe,N,v]),l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{width:`${n}px`,height:`${i}px`,viewBox:`0 0 ${n} ${i}`,direction:"ltr",ref:O,children:l.jsxs("g",{transform:`translate(${oe.left},${oe.top})`,children:[l.jsx("clipPath",{id:`above${P}`,children:l.jsx("path",{d:F(N),style:{fill:"none"}})}),l.jsx("clipPath",{id:`below${P}`,children:l.jsx("path",{d:Le(N),style:{fill:"none"}})}),l.jsx(ao,{areaSettings:U,width:J,height:R,scale:xe,animate:m,isInView:K}),l.jsx(lo,{areaSettings:ve,scaleX:xe,scaleY:Ae,animate:m,isInView:K}),l.jsx("g",{children:l.jsxs("g",{children:[l.jsx(ri,{values:Ie.filter(H=>H!==0),y:Ie.filter(H=>H!==0).map(H=>Ae(H)),x1:0-f,x2:J+oe.right,styles:{gridLines:z?.yAxis?.gridLines,labels:z?.yAxis?.labels},classNames:{gridLines:C?.yAxis?.gridLines,labels:C?.yAxis?.labels},suffix:a,prefix:o,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:A}),l.jsx(Dt,{y1:Ae(ne<0?0:ne),y2:Ae(ne<0?0:ne),x1:0-f,x2:J+oe.right,label:qe(ne<0?0:ne,"NA",A,o,a),labelPos:{x:0-f,y:Ae(ne<0?0:ne),dx:0,dy:De<0?"1rem":-5},classNames:{axis:C?.xAxis?.axis,label:C?.yAxis?.labels},styles:{axis:z?.xAxis?.axis,label:z?.yAxis?.labels}}),l.jsx(Nt,{x:0-f-15,y:R/2,style:z?.yAxis?.title,className:C?.yAxis?.title,text:G,rotate90:!0})]})}),l.jsx(Rn,{values:Ve.map(H=>ft(H,s)),x:Ve.map(H=>xe(H)),y1:0,y2:R,styles:{gridLines:z?.xAxis?.gridLines,labels:z?.xAxis?.labels},classNames:{gridLines:Ce.cn("opacity-0",C?.xAxis?.gridLines),labels:Ce.cn("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",C?.xAxis?.labels)},suffix:a,prefix:o,labelType:"primary",showGridLines:!0,precision:A}),M.filter(H=>H.position==="before").map(H=>H.layer),l.jsxs("g",{children:[l.jsx($e.path,{clipPath:`url(#below${P})`,d:Se(N)||"",style:{fill:S[1]},exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{opacity:1},whileInView:{opacity:1,transition:{duration:m.duration}}},initial:"initial",animate:K?"whileInView":"initial"}),l.jsx($e.path,{clipPath:`url(#above${P})`,d:Se(N)||"",style:{fill:S[0]},exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:m.duration}}},initial:"initial",animate:K?"whileInView":"initial"})]}),l.jsxs("g",{children:[l.jsx($e.path,{d:ke(N)||"",style:{fill:"none",stroke:r[0],strokeWidth:W},exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{pathLength:0,d:ke(N)||"",opacity:1},whileInView:{pathLength:1,d:ke(N)||"",opacity:1,transition:{duration:m.duration}}},initial:"initial",animate:K?"whileInView":"initial"}),l.jsx($e.path,{style:{fill:"none",stroke:r[1],strokeWidth:W},exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{pathLength:0,d:me(N)||"",opacity:1},whileInView:{pathLength:1,d:me(N)||"",opacity:1,transition:{duration:m.duration}}},initial:"initial",animate:K?"whileInView":"initial"}),j?null:l.jsxs("g",{children:[l.jsx($e.text,{style:{fill:r[0]},className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{opacity:0,x:xe(N[N.length-1].date),y:Ae(N[N.length-1].y1)},whileInView:{opacity:1,x:xe(N[N.length-1].date),y:Ae(N[N.length-1].y1),transition:{duration:Q?m.duration:.5,delay:Q?0:m.duration}}},initial:"initial",animate:K?"whileInView":"initial",children:w[0]},w[0]),l.jsx($e.text,{style:{fill:r[1]},className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{opacity:0,x:xe(N[N.length-1].date),y:Ae(N[N.length-1].y2)},whileInView:{opacity:1,x:xe(N[N.length-1].date),y:Ae(N[N.length-1].y2),transition:{duration:Q?m.duration:.5,delay:Q?0:m.duration}}},initial:"initial",animate:K?"whileInView":"initial",children:w[1]},w[1])]}),Z?l.jsx("line",{y1:0,y2:R,x1:xe(Z.date),x2:xe(Z.date),className:Ce.cn("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",C?.mouseOverLine),style:z?.mouseOverLine}):null,N.map((H,Oe)=>l.jsxs($e.g,{children:[je(H.y1)?null:l.jsxs(l.Fragment,{children:[D?l.jsx($e.circle,{r:J/N.length<5?0:J/N.length<20?2:4,style:{fill:r[0]},exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{opacity:0,cx:xe(H.date),cy:Ae(H.y1)},whileInView:{opacity:1,transition:{duration:.5,delay:m.duration},cx:xe(H.date),cy:Ae(H.y1)}},initial:"initial",animate:K?"whileInView":"initial"}):null,c?l.jsx($e.text,{dy:H.y2<H.y1?-8:"1em",style:{fill:r[0],textAnchor:"middle",...z?.graphObjectValues||{}},className:Ce.cn("graph-value graph-value-line-1 text-xs font-bold",C?.graphObjectValues),exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{opacity:0,x:xe(H.date),y:Ae(H.y1)},whileInView:{opacity:1,x:xe(H.date),y:Ae(H.y1),transition:{duration:Q?m.duration:.5,delay:Q?0:m.duration}}},initial:"initial",animate:K?"whileInView":"initial",children:qe(H.y1,"NA",A,o,a)}):null]}),je(H.y2)?null:l.jsxs(l.Fragment,{children:[D?l.jsx($e.circle,{r:J/N.length<5?0:J/N.length<20?2:4,style:{fill:r[1]},exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{opacity:0,cx:xe(H.date),cy:Ae(H.y2)},whileInView:{opacity:1,transition:{duration:Q?m.duration:.5,delay:Q?0:m.duration},cx:xe(H.date),cy:Ae(H.y2)}},initial:"initial",animate:K?"whileInView":"initial"}):null,c?l.jsx($e.text,{dy:H.y2>H.y1?-8:"1em",style:{fill:r[1],textAnchor:"middle",...z?.graphObjectValues||{}},className:Ce.cn("graph-value graph-value-line-2 text-xs font-bold",C?.graphObjectValues),exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{opacity:0,x:xe(H.date),y:Ae(H.y2)},whileInView:{opacity:1,x:xe(H.date),y:Ae(H.y2),transition:{duration:Q?m.duration:.5,delay:Q?0:m.duration}}},initial:"initial",animate:K?"whileInView":"initial",children:qe(H.y2,"NA",A,o,a)}):null]})]},Oe))]}),x?l.jsx(l.Fragment,{children:x.map((H,Oe)=>l.jsx(gi,{text:H.text,color:H.color,y:Ae(H.value),x1:0-f,x2:J+oe.right,classNames:H.classNames,styles:H.styles,animate:m,isInView:K},Oe))}):null,l.jsx("g",{children:q.map((H,Oe)=>{const Ee=oo({x:H.xCoordinate?xe(ze(`${H.xCoordinate}`,s,new Date))+(H.xOffset||0):0+(H.xOffset||0),y:H.yCoordinate?Ae(H.yCoordinate)+(H.yOffset||0)-8:0+(H.yOffset||0)-8},{x:H.xCoordinate?xe(ze(`${H.xCoordinate}`,s,new Date)):0,y:H.yCoordinate?Ae(H.yCoordinate):0},je(H.connectorRadius)?3.5:H.connectorRadius),it=H.showConnector?{y1:Ee.y,x1:Ee.x,y2:H.yCoordinate?Ae(H.yCoordinate)+(H.yOffset||0):0+(H.yOffset||0),x2:H.xCoordinate?xe(ze(`${H.xCoordinate}`,s,new Date))+(H.xOffset||0):0+(H.xOffset||0),cy:H.yCoordinate?Ae(H.yCoordinate):0,cx:H.xCoordinate?xe(ze(`${H.xCoordinate}`,s,new Date)):0,circleRadius:je(H.connectorRadius)?3.5:H.connectorRadius,strokeWidth:H.showConnector===!0?2:Math.min(H.showConnector||0,1)}:void 0,Tt={y:H.yCoordinate?Ae(H.yCoordinate)+(H.yOffset||0)-8:0+(H.yOffset||0)-8,x:I?0:H.xCoordinate?xe(ze(`${H.xCoordinate}`,s,new Date))+(H.xOffset||0):0+(H.xOffset||0),width:I?H.xCoordinate?xe(ze(`${H.xCoordinate}`,s,new Date))+(H.xOffset||0):0+(H.xOffset||0):J-(H.xCoordinate?xe(ze(`${H.xCoordinate}`,s,new Date))+(H.xOffset||0):0+(H.xOffset||0)),maxWidth:H.maxWidth,fontWeight:H.fontWeight,align:H.align};return l.jsx(so,{color:H.color,connectorsSettings:it,labelSettings:Tt,text:H.text,classNames:H.classNames,styles:H.styles,animate:m,isInView:K},Oe)})}),M.filter(H=>H.position==="after").map(H=>H.layer),l.jsx("rect",{ref:ce,style:{fill:"none",pointerEvents:"all"},width:J,height:R})]})}),Z&&p&&ue&&Y?l.jsx(st,{data:Z,body:p,xPos:ue,yPos:Y,backgroundStyle:z?.tooltip,className:C?.tooltip}):null]})}function wv(t){const{data:e,graphTitle:n,suffix:i="",sources:r,prefix:a="",graphDescription:o,height:s,width:c,footNote:u,noOfXTicks:h=10,dateFormat:f="yyyy",showValues:d=!1,padding:g,lineColors:p=[Pe.light.categoricalColors.colors[0],Pe.light.categoricalColors.colors[1]],backgroundColor:y=!1,leftMargin:v=30,rightMargin:m=50,topMargin:I=20,bottomMargin:j=25,tooltip:w,highlightAreaSettings:S=[],relativeHeight:P,onSeriesMouseOver:W,graphID:D,graphDownload:x=!1,dataDownload:$=!1,animate:V=!1,language:q="en",minHeight:ae=0,labels:G,showColorLegendAtTop:_=!1,colorLegendTitle:b,diffAreaColors:B=[Pe.alerts.red,Pe.alerts.darkGreen],strokeWidth:X=2,showDots:z=!0,refValues:C=[],minValue:A,maxValue:M,annotations:O=[],customHighlightAreaSettings:K=[],theme:Q="light",ariaLabel:se,yAxisTitle:T,noOfYTicks:Z=5,minDate:ie,maxDate:ue,curveType:he="curve",styles:Y,classNames:ge,precision:oe=2,customLayers:ce=[]}=t,[N,U]=k.useState(0),[ve,J]=k.useState(0),R=k.useRef(null),le=k.useRef(null);return k.useEffect(()=>{const ee=new ResizeObserver(de=>{U(c||de[0].target.clientWidth||620),J(s||de[0].target.clientHeight||480)});return R.current&&(J(R.current.clientHeight||480),U(R.current.clientWidth||620),c||ee.observe(R.current)),()=>ee.disconnect()},[c,s]),l.jsx("div",{className:`${Q||"light"} flex ${c?"w-fit grow-0":"w-full grow"}`,dir:q==="he"||q==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${y?y===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${q||"en"}`,ge?.graphContainer),style:{...Y?.graphContainer||{},...y&&y!==!0?{backgroundColor:y}:{}},id:D,ref:le,"aria-label":se||`${n?`The graph shows ${n}. `:""}This is a line chart that highlights the difference between two datasets over time.${o?` ${o}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:y?g||"1rem":g||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||o||x||$?l.jsx(Qe,{styles:{title:Y?.title,description:Y?.description},classNames:{title:ge?.title,description:ge?.description},graphTitle:n,graphDescription:o,width:c,graphDownload:x?le.current:void 0,dataDownload:$?e.map(ee=>ee.data).filter(ee=>ee!==void 0).length>0?e.map(ee=>ee.data).filter(ee=>ee!==void 0):e.filter(ee=>ee!==void 0):null}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[_?l.jsx(Hi,{colorDomain:G,colorLegendTitle:b,colors:p,showNAColor:!1}):null,l.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:R,"aria-label":"Graph area",children:(c||N)&&(s||ve)?l.jsx(II,{data:e,lineColors:p,colorDomain:G,width:c||N,height:Math.max(ae,s||(P?ae?(c||N)*P>ae?(c||N)*P:ae:(c||N)*P:ve)),suffix:i,prefix:a,dateFormat:f,showValues:d,noOfXTicks:h,leftMargin:v,rightMargin:m,topMargin:I,bottomMargin:j,highlightAreaSettings:S,tooltip:w,onSeriesMouseOver:W,showColorLegendAtTop:_,animate:V===!0?{duration:.5,once:!0,amount:.5}:V||{duration:0,once:!0,amount:0},rtl:q==="he"||q==="ar",diffAreaColors:B,idSuffix:rl(8),strokeWidth:X,showDots:z,refValues:C,minValue:A,maxValue:M,annotations:O,customHighlightAreaSettings:K,yAxisTitle:T,noOfYTicks:Z,minDate:ie,maxDate:ue,curveType:he,styles:Y,classNames:ge,precision:oe,customLayers:ce}):null})]})}),r||u?l.jsx(et,{styles:{footnote:Y?.footnote,source:Y?.source},classNames:{footnote:ge?.footnote,source:ge?.source},sources:r,footNote:u,width:c}):null]})})})})}function $I(t){const{data:e,width:n,height:i,lineColor:r,dateFormat:a,areaId:o,leftMargin:s,rightMargin:c,topMargin:u,bottomMargin:h,tooltip:f,onSeriesMouseOver:d,minValue:g,maxValue:p,curveType:y,styles:v,classNames:m,customLayers:I}=t,j=y==="linear"?Oi:y==="step"?Or:y==="stepAfter"?Ir:y==="stepBefore"?Nr:_r,[w,S]=k.useState(void 0),[P,W]=k.useState(void 0),[D,x]=k.useState(void 0),$={top:u,bottom:h,left:s,right:c},V=k.useRef(null),q=tt(e.map(O=>({...O,date:ze(`${O.date}`,a,new Date)})),"date"),ae=n-$.left-$.right,G=i-$.top-$.bottom,_=q[0].date,b=q[q.length-1].date,B=Math.min(...q.map(O=>O.y).filter(O=>O!=null))!==1/0?Math.min(...q.map(O=>O.y).filter(O=>O!=null))>0?0:Math.min(...q.map(O=>O.y).filter(O=>O!=null)):0,X=Math.max(...q.map(O=>O.y).filter(O=>O!=null))!==1/0?Math.max(...q.map(O=>O.y).filter(O=>O!=null)):0,z=Zr().domain([_,b]).range([0,ae]),C=ut().domain([je(g)?B:g,je(p)?X>0?X:0:p]).range([G,0]).nice(),A=No().x(O=>z(O.date)).y1(O=>C(O.y)).y0(G).curve(j),M=ii().x(O=>z(O.date)).y(O=>C(O.y)).curve(j);return k.useEffect(()=>{const O=Q=>{const se=q[Qr(q.map(T=>T.date),z.invert(En(Q)[0]),1)];S(se||q[q.length-1]),d?.(se||q[q.length-1]),x(Q.clientY),W(Q.clientX)},K=()=>{S(void 0),d?.(void 0),W(void 0),x(void 0)};bt(V.current).on("mousemove",O).on("mouseout",K),d?.(void 0)},[z,q,d]),l.jsxs(l.Fragment,{children:[l.jsxs("svg",{width:`${n}px`,height:`${i}px`,viewBox:`0 0 ${n} ${i}`,direction:"ltr",children:[o?l.jsxs("linearGradient",{id:o,x1:"0",x2:"0",y1:"0",y2:"1",children:[l.jsx("stop",{style:{stopColor:r},stopOpacity:"0.1",offset:"0%"}),l.jsx("stop",{style:{stopColor:r},stopOpacity:"0",offset:"100%"})]}):null,l.jsxs("g",{transform:`translate(${$.left},${$.top})`,children:[I.filter(O=>O.position==="before").map(O=>O.layer),l.jsxs("g",{children:[l.jsx("text",{className:Ce.cn("xs:max-[360px]:hidden fill-primary-gray-700 dark:fill-primary-gray-300 text-[9px] md:text-[10px] lg:text-xs",m?.xAxis?.labels),y:G,x:z(q[q.length-1].date),style:{textAnchor:"end",...v?.xAxis?.labels},dy:"1em",children:ft(q[q.length-1].date,a)}),l.jsx("text",{y:G,x:z(q[0].date),style:{textAnchor:"start",...v?.xAxis?.labels},className:Ce.cn("xs:max-[360px]:hidden fill-primary-gray-700 dark:fill-primary-gray-300 text-[9px] md:text-[10px] lg:text-xs",m?.xAxis?.labels),dy:"1em",children:ft(q[0].date,a)})]}),l.jsxs("g",{children:[l.jsx("path",{d:A(q)||"",style:{fill:`url(#${o})`,clipPath:"url(#clip)"}}),l.jsx("path",{d:M(q)||"",style:{stroke:r,fill:"none",strokeWidth:2}}),w?l.jsx("circle",{y1:0,cy:C(w.y),cx:z(w.date),r:5,style:{fill:r}}):null]}),I.filter(O=>O.position==="after").map(O=>O.layer),l.jsx("rect",{ref:V,style:{fill:"none",pointerEvents:"all"},width:ae,height:G})]})]}),w&&f&&P&&D?l.jsx(st,{data:w,body:f,xPos:P,yPos:D,backgroundStyle:v?.tooltip,className:m?.tooltip}):null]})}function bv(t){const{data:e,graphTitle:n,lineColor:i,sources:r,graphDescription:a,height:o,width:s,footNote:c,dateFormat:u="yyyy",area:h=!1,padding:f,backgroundColor:d,leftMargin:g=5,rightMargin:p=5,topMargin:y=10,bottomMargin:v=20,tooltip:m,relativeHeight:I,onSeriesMouseOver:j,graphID:w,minValue:S,maxValue:P,graphDownload:W=!1,dataDownload:D=!1,language:x="en",minHeight:$=0,theme:V="light",ariaLabel:q,curveType:ae="curve",styles:G,classNames:_,customLayers:b=[]}=t,[B,X]=k.useState(0),[z,C]=k.useState(0),A=k.useRef(null),M=k.useRef(null);return k.useEffect(()=>{const O=new ResizeObserver(K=>{X(s||K[0].target.clientWidth||620),C(o||K[0].target.clientHeight||480)});return A.current&&(C(A.current.clientHeight||480),X(A.current.clientWidth||620),s||O.observe(A.current)),()=>O.disconnect()},[s,o]),l.jsx("div",{className:`${V||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:x==="he"||x==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${d?d===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${x||"en"}`,_?.graphContainer),style:{...G?.graphContainer||{},...d&&d!==!0?{backgroundColor:d}:{}},id:w,ref:M,"aria-label":q||`${n?`The graph shows ${n}. `:""}This is a line chart that show trends over time.${a?` ${a}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:d?f||"1rem":f||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||a||W||D?l.jsx(Qe,{styles:{title:G?.title,description:G?.description},classNames:{title:_?.title,description:_?.description},graphTitle:n,graphDescription:a,width:s,graphDownload:W?M.current:void 0,dataDownload:D?e.map(O=>O.data).filter(O=>O!==void 0).length>0?e.map(O=>O.data).filter(O=>O!==void 0):e.filter(O=>O!==void 0):null}):null,l.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:A,"aria-label":"Graph area",children:(s||B)&&(o||z)?l.jsx($I,{data:e,lineColor:i||Pe.primaryColors["blue-600"],width:s||B,height:Math.max($,o||(I?$?(s||B)*I>$?(s||B)*I:$:(s||B)*I:z)),dateFormat:u,areaId:h?rl(8):void 0,leftMargin:g,rightMargin:p,topMargin:y,bottomMargin:v,tooltip:m,onSeriesMouseOver:j,minValue:S,maxValue:P,curveType:ae,styles:G,classNames:_,customLayers:b}):null}),r||c?l.jsx(et,{styles:{footnote:G?.footnote,source:G?.source},classNames:{footnote:_?.footnote,source:_?.source},sources:r,footNote:c,width:s}):null]})})})})}function LI(t,e,n={}){const i={type:"Feature"};return(n.id===0||n.id)&&(i.id=n.id),n.bbox&&(i.bbox=n.bbox),i.properties=e||{},i.geometry=t,i}function PI(t,e,n={}){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Dm(t[0])||!Dm(t[1]))throw new Error("coordinates must contain numbers");return LI({type:"Point",coordinates:t},e,n)}function Dm(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function ud(t,e,n){if(t!==null)for(var i,r,a,o,s,c,u,h=0,f=0,d,g=t.type,p=g==="FeatureCollection",y=g==="Feature",v=p?t.features.length:1,m=0;m<v;m++){u=p?t.features[m].geometry:y?t.geometry:t,d=u?u.type==="GeometryCollection":!1,s=d?u.geometries.length:1;for(var I=0;I<s;I++){var j=0,w=0;if(o=d?u.geometries[I]:u,o!==null){c=o.coordinates;var S=o.type;switch(h=n&&(S==="Polygon"||S==="MultiPolygon")?1:0,S){case null:break;case"Point":if(e(c,f,m,j,w)===!1)return!1;f++,j++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(e(c[i],f,m,j,w)===!1)return!1;f++,S==="MultiPoint"&&j++}S==="LineString"&&j++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(r=0;r<c[i].length-h;r++){if(e(c[i][r],f,m,j,w)===!1)return!1;f++}S==="MultiLineString"&&j++,S==="Polygon"&&w++}S==="Polygon"&&j++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(w=0,r=0;r<c[i].length;r++){for(a=0;a<c[i][r].length-h;a++){if(e(c[i][r][a],f,m,j,w)===!1)return!1;f++}w++}j++}break;case"GeometryCollection":for(i=0;i<o.geometries.length;i++)if(ud(o.geometries[i],e,n)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function EI(t,e={}){if(t.bbox!=null&&e.recompute!==!0)return t.bbox;const n=[1/0,1/0,-1/0,-1/0];return ud(t,i=>{n[0]>i[0]&&(n[0]=i[0]),n[1]>i[1]&&(n[1]=i[1]),n[2]<i[0]&&(n[2]=i[0]),n[3]<i[1]&&(n[3]=i[1])}),n}var hd=EI;function VI(t,e={}){let n=0,i=0,r=0;return ud(t,function(a){n+=a[0],i+=a[1],r++},!0),PI([n/r,i/r],e.properties)}var fd=VI,at=1e-6,Cv=1e-12,ot=Math.PI,ti=ot/2,Mm=ot/4,_i=ot*2,Pn=180/ot,Ht=ot/180,kt=Math.abs,Sv=Math.atan,Ka=Math.atan2,Mt=Math.cos,FI=Math.exp,RI=Math.log,pt=Math.sin,Vl=Math.sign||function(t){return t>0?1:t<0?-1:0},Xr=Math.sqrt,BI=Math.tan;function HI(t){return t>1?0:t<-1?ot:Math.acos(t)}function Bi(t){return t>1?ti:t<-1?-ti:Math.asin(t)}function Cs(){}function mc(t,e){t&&km.hasOwnProperty(t.type)&&km[t.type](t,e)}var Tm={Feature:function(t,e){mc(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)mc(n[i].geometry,e)}},km={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)t=n[i],e.point(t[0],t[1],t[2])},LineString:function(t,e){Mh(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)Mh(n[i],e,0)},Polygon:function(t,e){jm(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)jm(n[i],e)},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)mc(n[i],e)}};function Mh(t,e,n){var i=-1,r=t.length-n,a;for(e.lineStart();++i<r;)a=t[i],e.point(a[0],a[1],a[2]);e.lineEnd()}function jm(t,e){var n=-1,i=t.length;for(e.polygonStart();++n<i;)Mh(t[n],e,1);e.polygonEnd()}function WI(t,e){t&&Tm.hasOwnProperty(t.type)?Tm[t.type](t,e):mc(t,e)}function Th(t){return[Ka(t[1],t[0]),Bi(t[2])]}function Wo(t){var e=t[0],n=t[1],i=Mt(n);return[i*Mt(e),i*pt(e),pt(n)]}function Tl(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function yc(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function ju(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function kl(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function kh(t){var e=Xr(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function jh(t,e){function n(i,r){return i=t(i,r),e(i[0],i[1])}return t.invert&&e.invert&&(n.invert=function(i,r){return i=e.invert(i,r),i&&t.invert(i[0],i[1])}),n}function Ah(t,e){return kt(t)>ot&&(t-=Math.round(t/_i)*_i),[t,e]}Ah.invert=Ah;function Dv(t,e,n){return(t%=_i)?e||n?jh(_m(t),Om(e,n)):_m(t):e||n?Om(e,n):Ah}function Am(t){return function(e,n){return e+=t,kt(e)>ot&&(e-=Math.round(e/_i)*_i),[e,n]}}function _m(t){var e=Am(t);return e.invert=Am(-t),e}function Om(t,e){var n=Mt(t),i=pt(t),r=Mt(e),a=pt(e);function o(s,c){var u=Mt(c),h=Mt(s)*u,f=pt(s)*u,d=pt(c),g=d*n+h*i;return[Ka(f*r-g*a,h*n-d*i),Bi(g*r+f*a)]}return o.invert=function(s,c){var u=Mt(c),h=Mt(s)*u,f=pt(s)*u,d=pt(c),g=d*r-f*a;return[Ka(f*r+d*a,h*n+g*i),Bi(g*n-h*i)]},o}function zI(t){t=Dv(t[0]*Ht,t[1]*Ht,t.length>2?t[2]*Ht:0);function e(n){return n=t(n[0]*Ht,n[1]*Ht),n[0]*=Pn,n[1]*=Pn,n}return e.invert=function(n){return n=t.invert(n[0]*Ht,n[1]*Ht),n[0]*=Pn,n[1]*=Pn,n},e}function GI(t,e,n,i,r,a){if(n){var o=Mt(e),s=pt(e),c=i*n;r==null?(r=e+i*_i,a=e-c/2):(r=Nm(o,r),a=Nm(o,a),(i>0?r<a:r>a)&&(r+=i*_i));for(var u,h=r;i>0?h>a:h<a;h-=c)u=Th([o,-s*Mt(h),-s*pt(h)]),t.point(u[0],u[1])}}function Nm(t,e){e=Wo(e),e[0]-=t,kh(e);var n=HI(-e[1]);return((-e[2]<0?-n:n)+_i-at)%_i}function Mv(){var t=[],e;return{point:function(n,i,r){e.push([n,i,r])},lineStart:function(){t.push(e=[])},lineEnd:Cs,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function Fl(t,e){return kt(t[0]-e[0])<at&&kt(t[1]-e[1])<at}function jl(t,e,n,i){this.x=t,this.z=e,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function Tv(t,e,n,i,r){var a=[],o=[],s,c;if(t.forEach(function(p){if(!((y=p.length-1)<=0)){var y,v=p[0],m=p[y],I;if(Fl(v,m)){if(!v[2]&&!m[2]){for(r.lineStart(),s=0;s<y;++s)r.point((v=p[s])[0],v[1]);r.lineEnd();return}m[0]+=2*at}a.push(I=new jl(v,p,null,!0)),o.push(I.o=new jl(v,null,I,!1)),a.push(I=new jl(m,p,null,!1)),o.push(I.o=new jl(m,null,I,!0))}}),!!a.length){for(o.sort(e),Im(a),Im(o),s=0,c=o.length;s<c;++s)o[s].e=n=!n;for(var u=a[0],h,f;;){for(var d=u,g=!0;d.v;)if((d=d.n)===u)return;h=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(g)for(s=0,c=h.length;s<c;++s)r.point((f=h[s])[0],f[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(g)for(h=d.p.z,s=h.length-1;s>=0;--s)r.point((f=h[s])[0],f[1]);else i(d.x,d.p.x,-1,r);d=d.p}d=d.o,h=d.z,g=!g}while(!d.v);r.lineEnd()}}}function Im(t){if(e=t.length){for(var e,n=0,i=t[0],r;++n<e;)i.n=r=t[n],r.p=i,i=r;i.n=r=t[0],r.p=i}}function Au(t){return kt(t[0])<=ot?t[0]:Vl(t[0])*((kt(t[0])+ot)%_i-ot)}function YI(t,e){var n=Au(e),i=e[1],r=pt(i),a=[pt(n),-Mt(n),0],o=0,s=0,c=new iC;r===1?i=ti+at:r===-1&&(i=-ti-at);for(var u=0,h=t.length;u<h;++u)if(d=(f=t[u]).length)for(var f,d,g=f[d-1],p=Au(g),y=g[1]/2+Mm,v=pt(y),m=Mt(y),I=0;I<d;++I,p=w,v=P,m=W,g=j){var j=f[I],w=Au(j),S=j[1]/2+Mm,P=pt(S),W=Mt(S),D=w-p,x=D>=0?1:-1,$=x*D,V=$>ot,q=v*P;if(c.add(Ka(q*x*pt($),m*W+q*Mt($))),o+=V?D+x*_i:D,V^p>=n^w>=n){var ae=yc(Wo(g),Wo(j));kh(ae);var G=yc(a,ae);kh(G);var _=(V^D>=0?-1:1)*Bi(G[2]);(i>_||i===_&&(ae[0]||ae[1]))&&(s+=V^D>=0?1:-1)}}return(o<-at||o<at&&c<-Cv)^s&1}function kv(t,e,n,i){return function(r){var a=e(r),o=Mv(),s=e(o),c=!1,u,h,f,d={point:g,lineStart:y,lineEnd:v,polygonStart:function(){d.point=m,d.lineStart=I,d.lineEnd=j,h=[],u=[]},polygonEnd:function(){d.point=g,d.lineStart=y,d.lineEnd=v,h=x0(h);var w=YI(u,i);h.length?(c||(r.polygonStart(),c=!0),Tv(h,UI,w,n,r)):w&&(c||(r.polygonStart(),c=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),c&&(r.polygonEnd(),c=!1),h=u=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function g(w,S){t(w,S)&&r.point(w,S)}function p(w,S){a.point(w,S)}function y(){d.point=p,a.lineStart()}function v(){d.point=g,a.lineEnd()}function m(w,S){f.push([w,S]),s.point(w,S)}function I(){s.lineStart(),f=[]}function j(){m(f[0][0],f[0][1]),s.lineEnd();var w=s.clean(),S=o.result(),P,W=S.length,D,x,$;if(f.pop(),u.push(f),f=null,!!W){if(w&1){if(x=S[0],(D=x.length-1)>0){for(c||(r.polygonStart(),c=!0),r.lineStart(),P=0;P<D;++P)r.point(($=x[P])[0],$[1]);r.lineEnd()}return}W>1&&w&2&&S.push(S.pop().concat(S.shift())),h.push(S.filter(qI))}}return d}}function qI(t){return t.length>1}function UI(t,e){return((t=t.x)[0]<0?t[1]-ti-at:ti-t[1])-((e=e.x)[0]<0?e[1]-ti-at:ti-e[1])}const $m=kv(function(){return!0},XI,QI,[-ot,-ti]);function XI(t){var e=NaN,n=NaN,i=NaN,r;return{lineStart:function(){t.lineStart(),r=1},point:function(a,o){var s=a>0?ot:-ot,c=kt(a-e);kt(c-ot)<at?(t.point(e,n=(n+o)/2>0?ti:-ti),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),r=0):i!==s&&c>=ot&&(kt(e-i)<at&&(e-=i*at),kt(a-s)<at&&(a-=s*at),n=KI(e,n,a,o),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),r=0),t.point(e=a,n=o),i=s},lineEnd:function(){t.lineEnd(),e=n=NaN},clean:function(){return 2-r}}}function KI(t,e,n,i){var r,a,o=pt(t-n);return kt(o)>at?Sv((pt(e)*(a=Mt(i))*pt(n)-pt(i)*(r=Mt(e))*pt(t))/(r*a*o)):(e+i)/2}function QI(t,e,n,i){var r;if(t==null)r=n*ti,i.point(-ot,r),i.point(0,r),i.point(ot,r),i.point(ot,0),i.point(ot,-r),i.point(0,-r),i.point(-ot,-r),i.point(-ot,0),i.point(-ot,r);else if(kt(t[0]-e[0])>at){var a=t[0]<e[0]?ot:-ot;r=n*a/2,i.point(-a,r),i.point(0,r),i.point(a,r)}else i.point(e[0],e[1])}function ZI(t){var e=Mt(t),n=2*Ht,i=e>0,r=kt(e)>at;function a(h,f,d,g){GI(g,t,n,d,h,f)}function o(h,f){return Mt(h)*Mt(f)>e}function s(h){var f,d,g,p,y;return{lineStart:function(){p=g=!1,y=1},point:function(v,m){var I=[v,m],j,w=o(v,m),S=i?w?0:u(v,m):w?u(v+(v<0?ot:-ot),m):0;if(!f&&(p=g=w)&&h.lineStart(),w!==g&&(j=c(f,I),(!j||Fl(f,j)||Fl(I,j))&&(I[2]=1)),w!==g)y=0,w?(h.lineStart(),j=c(I,f),h.point(j[0],j[1])):(j=c(f,I),h.point(j[0],j[1],2),h.lineEnd()),f=j;else if(r&&f&&i^w){var P;!(S&d)&&(P=c(I,f,!0))&&(y=0,i?(h.lineStart(),h.point(P[0][0],P[0][1]),h.point(P[1][0],P[1][1]),h.lineEnd()):(h.point(P[1][0],P[1][1]),h.lineEnd(),h.lineStart(),h.point(P[0][0],P[0][1],3)))}w&&(!f||!Fl(f,I))&&h.point(I[0],I[1]),f=I,g=w,d=S},lineEnd:function(){g&&h.lineEnd(),f=null},clean:function(){return y|(p&&g)<<1}}}function c(h,f,d){var g=Wo(h),p=Wo(f),y=[1,0,0],v=yc(g,p),m=Tl(v,v),I=v[0],j=m-I*I;if(!j)return!d&&h;var w=e*m/j,S=-e*I/j,P=yc(y,v),W=kl(y,w),D=kl(v,S);ju(W,D);var x=P,$=Tl(W,x),V=Tl(x,x),q=$*$-V*(Tl(W,W)-1);if(!(q<0)){var ae=Xr(q),G=kl(x,(-$-ae)/V);if(ju(G,W),G=Th(G),!d)return G;var _=h[0],b=f[0],B=h[1],X=f[1],z;b<_&&(z=_,_=b,b=z);var C=b-_,A=kt(C-ot)<at,M=A||C<at;if(!A&&X<B&&(z=B,B=X,X=z),M?A?B+X>0^G[1]<(kt(G[0]-_)<at?B:X):B<=G[1]&&G[1]<=X:C>ot^(_<=G[0]&&G[0]<=b)){var O=kl(x,(-$+ae)/V);return ju(O,W),[G,Th(O)]}}}function u(h,f){var d=i?t:ot-t,g=0;return h<-d?g|=1:h>d&&(g|=2),f<-d?g|=4:f>d&&(g|=8),g}return kv(o,s,a,i?[0,-t]:[-ot,t-ot])}function JI(t,e,n,i,r,a){var o=t[0],s=t[1],c=e[0],u=e[1],h=0,f=1,d=c-o,g=u-s,p;if(p=n-o,!(!d&&p>0)){if(p/=d,d<0){if(p<h)return;p<f&&(f=p)}else if(d>0){if(p>f)return;p>h&&(h=p)}if(p=r-o,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>h&&(h=p)}else if(d>0){if(p<h)return;p<f&&(f=p)}if(p=i-s,!(!g&&p>0)){if(p/=g,g<0){if(p<h)return;p<f&&(f=p)}else if(g>0){if(p>f)return;p>h&&(h=p)}if(p=a-s,!(!g&&p<0)){if(p/=g,g<0){if(p>f)return;p>h&&(h=p)}else if(g>0){if(p<h)return;p<f&&(f=p)}return h>0&&(t[0]=o+h*d,t[1]=s+h*g),f<1&&(e[0]=o+f*d,e[1]=s+f*g),!0}}}}}var Ss=1e9,Al=-Ss;function e$(t,e,n,i){function r(u,h){return t<=u&&u<=n&&e<=h&&h<=i}function a(u,h,f,d){var g=0,p=0;if(u==null||(g=o(u,f))!==(p=o(h,f))||c(u,h)<0^f>0)do d.point(g===0||g===3?t:n,g>1?i:e);while((g=(g+f+4)%4)!==p);else d.point(h[0],h[1])}function o(u,h){return kt(u[0]-t)<at?h>0?0:3:kt(u[0]-n)<at?h>0?2:1:kt(u[1]-e)<at?h>0?1:0:h>0?3:2}function s(u,h){return c(u.x,h.x)}function c(u,h){var f=o(u,1),d=o(h,1);return f!==d?f-d:f===0?h[1]-u[1]:f===1?u[0]-h[0]:f===2?u[1]-h[1]:h[0]-u[0]}return function(u){var h=u,f=Mv(),d,g,p,y,v,m,I,j,w,S,P,W={point:D,lineStart:q,lineEnd:ae,polygonStart:$,polygonEnd:V};function D(_,b){r(_,b)&&h.point(_,b)}function x(){for(var _=0,b=0,B=g.length;b<B;++b)for(var X=g[b],z=1,C=X.length,A=X[0],M,O,K=A[0],Q=A[1];z<C;++z)M=K,O=Q,A=X[z],K=A[0],Q=A[1],O<=i?Q>i&&(K-M)*(i-O)>(Q-O)*(t-M)&&++_:Q<=i&&(K-M)*(i-O)<(Q-O)*(t-M)&&--_;return _}function $(){h=f,d=[],g=[],P=!0}function V(){var _=x(),b=P&&_,B=(d=x0(d)).length;(b||B)&&(u.polygonStart(),b&&(u.lineStart(),a(null,null,1,u),u.lineEnd()),B&&Tv(d,s,_,a,u),u.polygonEnd()),h=u,d=g=p=null}function q(){W.point=G,g&&g.push(p=[]),S=!0,w=!1,I=j=NaN}function ae(){d&&(G(y,v),m&&w&&f.rejoin(),d.push(f.result())),W.point=D,w&&h.lineEnd()}function G(_,b){var B=r(_,b);if(g&&p.push([_,b]),S)y=_,v=b,m=B,S=!1,B&&(h.lineStart(),h.point(_,b));else if(B&&w)h.point(_,b);else{var X=[I=Math.max(Al,Math.min(Ss,I)),j=Math.max(Al,Math.min(Ss,j))],z=[_=Math.max(Al,Math.min(Ss,_)),b=Math.max(Al,Math.min(Ss,b))];JI(X,z,t,e,n,i)?(w||(h.lineStart(),h.point(X[0],X[1])),h.point(z[0],z[1]),B||h.lineEnd(),P=!1):B&&(h.lineStart(),h.point(_,b),P=!1)}I=_,j=b,w=B}return W}}const Lm=t=>t;var zo=1/0,xc=zo,zs=-zo,vc=zs,Pm={point:t$,lineStart:Cs,lineEnd:Cs,polygonStart:Cs,polygonEnd:Cs,result:function(){var t=[[zo,xc],[zs,vc]];return zs=vc=-(xc=zo=1/0),t}};function t$(t,e){t<zo&&(zo=t),t>zs&&(zs=t),e<xc&&(xc=e),e>vc&&(vc=e)}function dd(t){return function(e){var n=new _h;for(var i in t)n[i]=t[i];return n.stream=e,n}}function _h(){}_h.prototype={constructor:_h,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function gd(t,e,n){var i=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),i!=null&&t.clipExtent(null),WI(n,t.stream(Pm)),e(Pm.result()),i!=null&&t.clipExtent(i),t}function pd(t,e,n){return gd(t,function(i){var r=e[1][0]-e[0][0],a=e[1][1]-e[0][1],o=Math.min(r/(i[1][0]-i[0][0]),a/(i[1][1]-i[0][1])),s=+e[0][0]+(r-o*(i[1][0]+i[0][0]))/2,c=+e[0][1]+(a-o*(i[1][1]+i[0][1]))/2;t.scale(150*o).translate([s,c])},n)}function jv(t,e,n){return pd(t,[[0,0],e],n)}function Av(t,e,n){return gd(t,function(i){var r=+e,a=r/(i[1][0]-i[0][0]),o=(r-a*(i[1][0]+i[0][0]))/2,s=-a*i[0][1];t.scale(150*a).translate([o,s])},n)}function _v(t,e,n){return gd(t,function(i){var r=+e,a=r/(i[1][1]-i[0][1]),o=-a*i[0][0],s=(r-a*(i[1][1]+i[0][1]))/2;t.scale(150*a).translate([o,s])},n)}var Em=16,n$=Mt(30*Ht);function Vm(t,e){return+e?r$(t,e):i$(t)}function i$(t){return dd({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function r$(t,e){function n(i,r,a,o,s,c,u,h,f,d,g,p,y,v){var m=u-i,I=h-r,j=m*m+I*I;if(j>4*e&&y--){var w=o+d,S=s+g,P=c+p,W=Xr(w*w+S*S+P*P),D=Bi(P/=W),x=kt(kt(P)-1)<at||kt(a-f)<at?(a+f)/2:Ka(S,w),$=t(x,D),V=$[0],q=$[1],ae=V-i,G=q-r,_=I*ae-m*G;(_*_/j>e||kt((m*ae+I*G)/j-.5)>.3||o*d+s*g+c*p<n$)&&(n(i,r,a,o,s,c,V,q,x,w/=W,S/=W,P,y,v),v.point(V,q),n(V,q,x,w,S,P,u,h,f,d,g,p,y,v))}}return function(i){var r,a,o,s,c,u,h,f,d,g,p,y,v={point:m,lineStart:I,lineEnd:w,polygonStart:function(){i.polygonStart(),v.lineStart=S},polygonEnd:function(){i.polygonEnd(),v.lineStart=I}};function m(D,x){D=t(D,x),i.point(D[0],D[1])}function I(){f=NaN,v.point=j,i.lineStart()}function j(D,x){var $=Wo([D,x]),V=t(D,x);n(f,d,h,g,p,y,f=V[0],d=V[1],h=D,g=$[0],p=$[1],y=$[2],Em,i),i.point(f,d)}function w(){v.point=m,i.lineEnd()}function S(){I(),v.point=P,v.lineEnd=W}function P(D,x){j(r=D,x),a=f,o=d,s=g,c=p,u=y,v.point=j}function W(){n(f,d,h,g,p,y,a,o,r,s,c,u,Em,i),v.lineEnd=w,w()}return v}}var a$=dd({point:function(t,e){this.stream.point(t*Ht,e*Ht)}});function o$(t){return dd({point:function(e,n){var i=t(e,n);return this.stream.point(i[0],i[1])}})}function s$(t,e,n,i,r){function a(o,s){return o*=i,s*=r,[e+t*o,n-t*s]}return a.invert=function(o,s){return[(o-e)/t*i,(n-s)/t*r]},a}function Fm(t,e,n,i,r,a){if(!a)return s$(t,e,n,i,r);var o=Mt(a),s=pt(a),c=o*t,u=s*t,h=o/t,f=s/t,d=(s*n-o*e)/t,g=(s*e+o*n)/t;function p(y,v){return y*=i,v*=r,[c*y-u*v+e,n-u*y-c*v]}return p.invert=function(y,v){return[i*(h*y-f*v+d),r*(g-f*y-h*v)]},p}function Pc(t){return Ov(function(){return t})()}function Ov(t){var e,n=150,i=480,r=250,a=0,o=0,s=0,c=0,u=0,h,f=0,d=1,g=1,p=null,y=$m,v=null,m,I,j,w=Lm,S=.5,P,W,D,x,$;function V(_){return D(_[0]*Ht,_[1]*Ht)}function q(_){return _=D.invert(_[0],_[1]),_&&[_[0]*Pn,_[1]*Pn]}V.stream=function(_){return x&&$===_?x:x=a$(o$(h)(y(P(w($=_)))))},V.preclip=function(_){return arguments.length?(y=_,p=void 0,G()):y},V.postclip=function(_){return arguments.length?(w=_,v=m=I=j=null,G()):w},V.clipAngle=function(_){return arguments.length?(y=+_?ZI(p=_*Ht):(p=null,$m),G()):p*Pn},V.clipExtent=function(_){return arguments.length?(w=_==null?(v=m=I=j=null,Lm):e$(v=+_[0][0],m=+_[0][1],I=+_[1][0],j=+_[1][1]),G()):v==null?null:[[v,m],[I,j]]},V.scale=function(_){return arguments.length?(n=+_,ae()):n},V.translate=function(_){return arguments.length?(i=+_[0],r=+_[1],ae()):[i,r]},V.center=function(_){return arguments.length?(a=_[0]%360*Ht,o=_[1]%360*Ht,ae()):[a*Pn,o*Pn]},V.rotate=function(_){return arguments.length?(s=_[0]%360*Ht,c=_[1]%360*Ht,u=_.length>2?_[2]%360*Ht:0,ae()):[s*Pn,c*Pn,u*Pn]},V.angle=function(_){return arguments.length?(f=_%360*Ht,ae()):f*Pn},V.reflectX=function(_){return arguments.length?(d=_?-1:1,ae()):d<0},V.reflectY=function(_){return arguments.length?(g=_?-1:1,ae()):g<0},V.precision=function(_){return arguments.length?(P=Vm(W,S=_*_),G()):Xr(S)},V.fitExtent=function(_,b){return pd(V,_,b)},V.fitSize=function(_,b){return jv(V,_,b)},V.fitWidth=function(_,b){return Av(V,_,b)},V.fitHeight=function(_,b){return _v(V,_,b)};function ae(){var _=Fm(n,0,0,d,g,f).apply(null,e(a,o)),b=Fm(n,i-_[0],r-_[1],d,g,f);return h=Dv(s,c,u),W=jh(e,b),D=jh(h,W),P=Vm(W,S),G()}function G(){return x=$=null,V}return function(){return e=t.apply(this,arguments),V.invert=e.invert&&q,ae()}}function l$(t){var e=0,n=ot/3,i=Ov(t),r=i(e,n);return r.parallels=function(a){return arguments.length?i(e=a[0]*Ht,n=a[1]*Ht):[e*Pn,n*Pn]},r}function c$(t){var e=Mt(t);function n(i,r){return[i*e,pt(r)/e]}return n.invert=function(i,r){return[i/e,Bi(r*e)]},n}function u$(t,e){var n=pt(t),i=(n+pt(e))/2;if(kt(i)<at)return c$(t);var r=1+n*(2*i-n),a=Xr(r)/i;function o(s,c){var u=Xr(r-2*i*pt(c))/i;return[u*pt(s*=i),a-u*Mt(s)]}return o.invert=function(s,c){var u=a-c,h=Ka(s,kt(u))*Vl(u);return u*i<0&&(h-=ot*Vl(s)*Vl(u)),[h/i,Bi((r-(s*s+u*u)*i*i)/(2*i))]},o}function Oh(){return l$(u$).scale(155.424).center([0,33.6442])}function h$(){return Oh().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function f$(t){var e=t.length;return{point:function(n,i){for(var r=-1;++r<e;)t[r].point(n,i)},sphere:function(){for(var n=-1;++n<e;)t[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)t[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)t[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)t[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)t[n].polygonEnd()}}}function md(){var t,e,n=h$(),i,r=Oh().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a,o=Oh().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s,c,u={point:function(d,g){c=[d,g]}};function h(d){var g=d[0],p=d[1];return c=null,i.point(g,p),c||(a.point(g,p),c)||(s.point(g,p),c)}h.invert=function(d){var g=n.scale(),p=n.translate(),y=(d[0]-p[0])/g,v=(d[1]-p[1])/g;return(v>=.12&&v<.234&&y>=-.425&&y<-.214?r:v>=.166&&v<.234&&y>=-.214&&y<-.115?o:n).invert(d)},h.stream=function(d){return t&&e===d?t:t=f$([n.stream(e=d),r.stream(d),o.stream(d)])},h.precision=function(d){return arguments.length?(n.precision(d),r.precision(d),o.precision(d),f()):n.precision()},h.scale=function(d){return arguments.length?(n.scale(d),r.scale(d*.35),o.scale(d),h.translate(n.translate())):n.scale()},h.translate=function(d){if(!arguments.length)return n.translate();var g=n.scale(),p=+d[0],y=+d[1];return i=n.translate(d).clipExtent([[p-.455*g,y-.238*g],[p+.455*g,y+.238*g]]).stream(u),a=r.translate([p-.307*g,y+.201*g]).clipExtent([[p-.425*g+at,y+.12*g+at],[p-.214*g-at,y+.234*g-at]]).stream(u),s=o.translate([p-.205*g,y+.212*g]).clipExtent([[p-.214*g+at,y+.166*g+at],[p-.115*g-at,y+.234*g-at]]).stream(u),f()},h.fitExtent=function(d,g){return pd(h,d,g)},h.fitSize=function(d,g){return jv(h,d,g)},h.fitWidth=function(d,g){return Av(h,d,g)},h.fitHeight=function(d,g){return _v(h,d,g)};function f(){return t=e=null,h}return h.scale(1070)}function d$(t){return function(e,n){var i=Xr(e*e+n*n),r=t(i),a=pt(r),o=Mt(r);return[Ka(e*a,i*o),Bi(i&&n*a/i)]}}function yd(t,e){return[t,RI(BI((ti+e)/2))]}yd.invert=function(t,e){return[t,2*Sv(FI(e))-ti]};function xd(){return g$(yd).scale(961/_i)}function g$(t){var e=Pc(t),n=e.center,i=e.scale,r=e.translate,a=e.clipExtent,o=null,s,c,u;e.scale=function(f){return arguments.length?(i(f),h()):i()},e.translate=function(f){return arguments.length?(r(f),h()):r()},e.center=function(f){return arguments.length?(n(f),h()):n()},e.clipExtent=function(f){return arguments.length?(f==null?o=s=c=u=null:(o=+f[0][0],s=+f[0][1],c=+f[1][0],u=+f[1][1]),h()):o==null?null:[[o,s],[c,u]]};function h(){var f=ot*i(),d=e(zI(e.rotate()).invert([0,0]));return a(o==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:t===yd?[[Math.max(d[0]-f,o),s],[Math.min(d[0]+f,c),u]]:[[o,Math.max(d[1]-f,s)],[c,Math.min(d[1]+f,u)]])}return h()}var As=1.340264,_s=-.081106,Os=893e-6,Ns=.003796,wc=Xr(3)/2,p$=12;function Nv(t,e){var n=Bi(wc*pt(e)),i=n*n,r=i*i*i;return[t*Mt(n)/(wc*(As+3*_s*i+r*(7*Os+9*Ns*i))),n*(As+_s*i+r*(Os+Ns*i))]}Nv.invert=function(t,e){for(var n=e,i=n*n,r=i*i*i,a=0,o,s,c;a<p$&&(s=n*(As+_s*i+r*(Os+Ns*i))-e,c=As+3*_s*i+r*(7*Os+9*Ns*i),n-=o=s/c,i=n*n,r=i*i*i,!(kt(o)<Cv));++a);return[wc*t*(As+3*_s*i+r*(7*Os+9*Ns*i))/Mt(n),Bi(pt(n)/wc)]};function vd(){return Pc(Nv).scale(177.158)}function Iv(t,e){var n=e*e,i=n*n;return[t*(.8707-.131979*n+i*(-.013791+i*(.003971*n-.001529*i))),e*(1.007226+n*(.015085+i*(-.044475+.028874*n-.005916*i)))]}Iv.invert=function(t,e){var n=e,i=25,r;do{var a=n*n,o=a*a;n-=r=(n*(1.007226+a*(.015085+o*(-.044475+.028874*a-.005916*o)))-e)/(1.007226+a*(.015085*3+o*(-.044475*7+.028874*9*a-.005916*11*o)))}while(kt(r)>at&&--i>0);return[t/(.8707+(a=n*n)*(-.131979+a*(-.013791+a*a*a*(.003971-.001529*a)))),n]};function wd(){return Pc(Iv).scale(175.295)}function $v(t,e){return[Mt(e)*pt(t),pt(e)]}$v.invert=d$(Bi);function bd(){return Pc($v).scale(249.5).clipAngle(90+at)}const Nh={capture:!0,passive:!1};function Ih(t){t.preventDefault(),t.stopImmediatePropagation()}function m$(t){var e=t.document.documentElement,n=bt(t).on("dragstart.drag",Ih,Nh);"onselectstart"in e?n.on("selectstart.drag",Ih,Nh):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function y$(t,e){var n=t.document.documentElement,i=bt(t).on("dragstart.drag",null);e&&(i.on("click.drag",Ih,Nh),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var x$=_c("start","end","cancel","interrupt"),v$=[],Lv=0,Rm=1,$h=2,Rl=3,Bm=4,Lh=5,Bl=6;function Ec(t,e,n,i,r,a){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;w$(t,n,{name:e,index:i,group:r,on:x$,tween:v$,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Lv})}function Cd(t,e){var n=Wi(t,e);if(n.state>Lv)throw new Error("too late; already scheduled");return n}function ar(t,e){var n=Wi(t,e);if(n.state>Rl)throw new Error("too late; already running");return n}function Wi(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function w$(t,e,n){var i=t.__transition,r;i[e]=n,n.timer=Kf(a,0,n.time);function a(u){n.state=Rm,n.timer.restart(o,n.delay,n.time),n.delay<=u&&o(u-n.delay)}function o(u){var h,f,d,g;if(n.state!==Rm)return c();for(h in i)if(g=i[h],g.name===n.name){if(g.state===Rl)return um(o);g.state===Bm?(g.state=Bl,g.timer.stop(),g.on.call("interrupt",t,t.__data__,g.index,g.group),delete i[h]):+h<e&&(g.state=Bl,g.timer.stop(),g.on.call("cancel",t,t.__data__,g.index,g.group),delete i[h])}if(um(function(){n.state===Rl&&(n.state=Bm,n.timer.restart(s,n.delay,n.time),s(u))}),n.state=$h,n.on.call("start",t,t.__data__,n.index,n.group),n.state===$h){for(n.state=Rl,r=new Array(d=n.tween.length),h=0,f=-1;h<d;++h)(g=n.tween[h].value.call(t,t.__data__,n.index,n.group))&&(r[++f]=g);r.length=f+1}}function s(u){for(var h=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(c),n.state=Lh,1),f=-1,d=r.length;++f<d;)r[f].call(t,h);n.state===Lh&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){n.state=Bl,n.timer.stop(),delete i[e];for(var u in i)return;delete t.__transition}}function Hl(t,e){var n=t.__transition,i,r,a=!0,o;if(n){e=e==null?null:e+"";for(o in n){if((i=n[o]).name!==e){a=!1;continue}r=i.state>$h&&i.state<Lh,i.state=Bl,i.timer.stop(),i.on.call(r?"interrupt":"cancel",t,t.__data__,i.index,i.group),delete n[o]}a&&delete t.__transition}}function b$(t){return this.each(function(){Hl(this,t)})}function C$(t,e){var n,i;return function(){var r=ar(this,t),a=r.tween;if(a!==n){i=n=a;for(var o=0,s=i.length;o<s;++o)if(i[o].name===e){i=i.slice(),i.splice(o,1);break}}r.tween=i}}function S$(t,e,n){var i,r;if(typeof n!="function")throw new Error;return function(){var a=ar(this,t),o=a.tween;if(o!==i){r=(i=o).slice();for(var s={name:e,value:n},c=0,u=r.length;c<u;++c)if(r[c].name===e){r[c]=s;break}c===u&&r.push(s)}a.tween=r}}function D$(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i=Wi(this.node(),n).tween,r=0,a=i.length,o;r<a;++r)if((o=i[r]).name===t)return o.value;return null}return this.each((e==null?C$:S$)(n,t,e))}function Sd(t,e,n){var i=t._id;return t.each(function(){var r=ar(this,i);(r.value||(r.value={}))[e]=n.apply(this,arguments)}),function(r){return Wi(r,i).value[e]}}function Pv(t,e){var n;return(typeof e=="number"?Pi:e instanceof qa?Xl:(n=qa(e))?(e=n,Xl):C0)(t,e)}function M$(t){return function(){this.removeAttribute(t)}}function T$(t){return function(){this.removeAttributeNS(t.space,t.local)}}function k$(t,e,n){var i,r=n+"",a;return function(){var o=this.getAttribute(t);return o===r?null:o===i?a:a=e(i=o,n)}}function j$(t,e,n){var i,r=n+"",a;return function(){var o=this.getAttributeNS(t.space,t.local);return o===r?null:o===i?a:a=e(i=o,n)}}function A$(t,e,n){var i,r,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(t):(o=this.getAttribute(t),c=s+"",o===c?null:o===i&&c===r?a:(r=c,a=e(i=o,s)))}}function _$(t,e,n){var i,r,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),c=s+"",o===c?null:o===i&&c===r?a:(r=c,a=e(i=o,s)))}}function O$(t,e){var n=$c(t),i=n==="transform"?UC:Pv;return this.attrTween(t,typeof e=="function"?(n.local?_$:A$)(n,i,Sd(this,"attr."+t,e)):e==null?(n.local?T$:M$)(n):(n.local?j$:k$)(n,i,e))}function N$(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function I$(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function $$(t,e){var n,i;function r(){var a=e.apply(this,arguments);return a!==i&&(n=(i=a)&&I$(t,a)),n}return r._value=e,r}function L$(t,e){var n,i;function r(){var a=e.apply(this,arguments);return a!==i&&(n=(i=a)&&N$(t,a)),n}return r._value=e,r}function P$(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var i=$c(t);return this.tween(n,(i.local?$$:L$)(i,e))}function E$(t,e){return function(){Cd(this,t).delay=+e.apply(this,arguments)}}function V$(t,e){return e=+e,function(){Cd(this,t).delay=e}}function F$(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?E$:V$)(e,t)):Wi(this.node(),e).delay}function R$(t,e){return function(){ar(this,t).duration=+e.apply(this,arguments)}}function B$(t,e){return e=+e,function(){ar(this,t).duration=e}}function H$(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?R$:B$)(e,t)):Wi(this.node(),e).duration}function W$(t,e){if(typeof e!="function")throw new Error;return function(){ar(this,t).ease=e}}function z$(t){var e=this._id;return arguments.length?this.each(W$(e,t)):Wi(this.node(),e).ease}function G$(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;ar(this,t).ease=n}}function Y$(t){if(typeof t!="function")throw new Error;return this.each(G$(this._id,t))}function q$(t){typeof t!="function"&&(t=av(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var a=e[r],o=a.length,s=i[r]=[],c,u=0;u<o;++u)(c=a[u])&&t.call(c,c.__data__,u,a)&&s.push(c);return new kr(i,this._parents,this._name,this._id)}function U$(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,r=n.length,a=Math.min(i,r),o=new Array(i),s=0;s<a;++s)for(var c=e[s],u=n[s],h=c.length,f=o[s]=new Array(h),d,g=0;g<h;++g)(d=c[g]||u[g])&&(f[g]=d);for(;s<i;++s)o[s]=e[s];return new kr(o,this._parents,this._name,this._id)}function X$(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function K$(t,e,n){var i,r,a=X$(e)?Cd:ar;return function(){var o=a(this,t),s=o.on;s!==i&&(r=(i=s).copy()).on(e,n),o.on=r}}function Q$(t,e){var n=this._id;return arguments.length<2?Wi(this.node(),n).on.on(t):this.each(K$(n,t,e))}function Z$(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function J$(){return this.on("end.remove",Z$(this._id))}function eL(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ad(t));for(var i=this._groups,r=i.length,a=new Array(r),o=0;o<r;++o)for(var s=i[o],c=s.length,u=a[o]=new Array(c),h,f,d=0;d<c;++d)(h=s[d])&&(f=t.call(h,h.__data__,d,s))&&("__data__"in h&&(f.__data__=h.__data__),u[d]=f,Ec(u[d],e,n,d,u,Wi(h,n)));return new kr(a,this._parents,e,n)}function tL(t){var e=this._name,n=this._id;typeof t!="function"&&(t=rv(t));for(var i=this._groups,r=i.length,a=[],o=[],s=0;s<r;++s)for(var c=i[s],u=c.length,h,f=0;f<u;++f)if(h=c[f]){for(var d=t.call(h,h.__data__,f,c),g,p=Wi(h,n),y=0,v=d.length;y<v;++y)(g=d[y])&&Ec(g,e,n,y,d,p);a.push(d),o.push(h)}return new kr(a,o,e,n)}var nL=il.prototype.constructor;function iL(){return new nL(this._groups,this._parents)}function rL(t,e){var n,i,r;return function(){var a=Ho(this,t),o=(this.style.removeProperty(t),Ho(this,t));return a===o?null:a===n&&o===i?r:r=e(n=a,i=o)}}function Ev(t){return function(){this.style.removeProperty(t)}}function aL(t,e,n){var i,r=n+"",a;return function(){var o=Ho(this,t);return o===r?null:o===i?a:a=e(i=o,n)}}function oL(t,e,n){var i,r,a;return function(){var o=Ho(this,t),s=n(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(t),Ho(this,t))),o===c?null:o===i&&c===r?a:(r=c,a=e(i=o,s))}}function sL(t,e){var n,i,r,a="style."+e,o="end."+a,s;return function(){var c=ar(this,t),u=c.on,h=c.value[a]==null?s||(s=Ev(e)):void 0;(u!==n||r!==h)&&(i=(n=u).copy()).on(o,r=h),c.on=i}}function lL(t,e,n){var i=(t+="")=="transform"?qC:Pv;return e==null?this.styleTween(t,rL(t,i)).on("end.style."+t,Ev(t)):typeof e=="function"?this.styleTween(t,oL(t,i,Sd(this,"style."+t,e))).each(sL(this._id,t)):this.styleTween(t,aL(t,i,e),n).on("end.style."+t,null)}function cL(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}function uL(t,e,n){var i,r;function a(){var o=e.apply(this,arguments);return o!==r&&(i=(r=o)&&cL(t,o,n)),i}return a._value=e,a}function hL(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(e==null)return this.tween(i,null);if(typeof e!="function")throw new Error;return this.tween(i,uL(t,e,n??""))}function fL(t){return function(){this.textContent=t}}function dL(t){return function(){var e=t(this);this.textContent=e??""}}function gL(t){return this.tween("text",typeof t=="function"?dL(Sd(this,"text",t)):fL(t==null?"":t+""))}function pL(t){return function(e){this.textContent=t.call(this,e)}}function mL(t){var e,n;function i(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&pL(r)),e}return i._value=t,i}function yL(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,mL(t))}function xL(){for(var t=this._name,e=this._id,n=Vv(),i=this._groups,r=i.length,a=0;a<r;++a)for(var o=i[a],s=o.length,c,u=0;u<s;++u)if(c=o[u]){var h=Wi(c,e);Ec(c,t,n,u,o,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new kr(i,this._parents,t,n)}function vL(){var t,e,n=this,i=n._id,r=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--r===0&&a()}};n.each(function(){var u=ar(this,i),h=u.on;h!==t&&(e=(t=h).copy(),e._.cancel.push(s),e._.interrupt.push(s),e._.end.push(c)),u.on=e}),r===0&&a()})}var wL=0;function kr(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function Vv(){return++wL}var mr=il.prototype;kr.prototype={constructor:kr,select:eL,selectAll:tL,selectChild:mr.selectChild,selectChildren:mr.selectChildren,filter:q$,merge:U$,selection:iL,transition:xL,call:mr.call,nodes:mr.nodes,node:mr.node,size:mr.size,empty:mr.empty,each:mr.each,on:Q$,attr:O$,attrTween:P$,style:lL,styleTween:hL,text:gL,textTween:yL,remove:J$,tween:D$,delay:F$,duration:H$,ease:z$,easeVarying:Y$,end:vL,[Symbol.iterator]:mr[Symbol.iterator]};function bL(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var CL={time:null,delay:0,duration:250,ease:bL};function SL(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function DL(t){var e,n;t instanceof kr?(e=t._id,t=t._name):(e=Vv(),(n=CL).time=Xf(),t=t==null?null:t+"");for(var i=this._groups,r=i.length,a=0;a<r;++a)for(var o=i[a],s=o.length,c,u=0;u<s;++u)(c=o[u])&&Ec(c,t,e,u,o,n||SL(c,e));return new kr(i,this._parents,t,e)}il.prototype.interrupt=b$;il.prototype.transition=DL;const _l=t=>()=>t;function ML(t,{sourceEvent:e,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function vr(t,e,n){this.k=t,this.x=e,this.y=n}vr.prototype={constructor:vr,scale:function(t){return t===1?this:new vr(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new vr(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Fv=new vr(1,0,0);vr.prototype;function _u(t){t.stopImmediatePropagation()}function fs(t){t.preventDefault(),t.stopImmediatePropagation()}function TL(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function kL(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function Hm(){return this.__zoom||Fv}function jL(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function AL(){return navigator.maxTouchPoints||"ontouchstart"in this}function _L(t,e,n){var i=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],a=t.invertY(e[0][1])-n[0][1],o=t.invertY(e[1][1])-n[1][1];return t.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function Dd(){var t=TL,e=kL,n=_L,i=jL,r=AL,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=ZC,u=_c("start","zoom","end"),h,f,d,g=500,p=150,y=0,v=10;function m(G){G.property("__zoom",Hm).on("wheel.zoom",D,{passive:!1}).on("mousedown.zoom",x).on("dblclick.zoom",$).filter(r).on("touchstart.zoom",V).on("touchmove.zoom",q).on("touchend.zoom touchcancel.zoom",ae).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(G,_,b,B){var X=G.selection?G.selection():G;X.property("__zoom",Hm),G!==X?S(G,_,b,B):X.interrupt().each(function(){P(this,arguments).event(B).start().zoom(null,typeof _=="function"?_.apply(this,arguments):_).end()})},m.scaleBy=function(G,_,b,B){m.scaleTo(G,function(){var X=this.__zoom.k,z=typeof _=="function"?_.apply(this,arguments):_;return X*z},b,B)},m.scaleTo=function(G,_,b,B){m.transform(G,function(){var X=e.apply(this,arguments),z=this.__zoom,C=b==null?w(X):typeof b=="function"?b.apply(this,arguments):b,A=z.invert(C),M=typeof _=="function"?_.apply(this,arguments):_;return n(j(I(z,M),C,A),X,o)},b,B)},m.translateBy=function(G,_,b,B){m.transform(G,function(){return n(this.__zoom.translate(typeof _=="function"?_.apply(this,arguments):_,typeof b=="function"?b.apply(this,arguments):b),e.apply(this,arguments),o)},null,B)},m.translateTo=function(G,_,b,B,X){m.transform(G,function(){var z=e.apply(this,arguments),C=this.__zoom,A=B==null?w(z):typeof B=="function"?B.apply(this,arguments):B;return n(Fv.translate(A[0],A[1]).scale(C.k).translate(typeof _=="function"?-_.apply(this,arguments):-_,typeof b=="function"?-b.apply(this,arguments):-b),z,o)},B,X)};function I(G,_){return _=Math.max(a[0],Math.min(a[1],_)),_===G.k?G:new vr(_,G.x,G.y)}function j(G,_,b){var B=_[0]-b[0]*G.k,X=_[1]-b[1]*G.k;return B===G.x&&X===G.y?G:new vr(G.k,B,X)}function w(G){return[(+G[0][0]+ +G[1][0])/2,(+G[0][1]+ +G[1][1])/2]}function S(G,_,b,B){G.on("start.zoom",function(){P(this,arguments).event(B).start()}).on("interrupt.zoom end.zoom",function(){P(this,arguments).event(B).end()}).tween("zoom",function(){var X=this,z=arguments,C=P(X,z).event(B),A=e.apply(X,z),M=b==null?w(A):typeof b=="function"?b.apply(X,z):b,O=Math.max(A[1][0]-A[0][0],A[1][1]-A[0][1]),K=X.__zoom,Q=typeof _=="function"?_.apply(X,z):_,se=c(K.invert(M).concat(O/K.k),Q.invert(M).concat(O/Q.k));return function(T){if(T===1)T=Q;else{var Z=se(T),ie=O/Z[2];T=new vr(ie,M[0]-Z[0]*ie,M[1]-Z[1]*ie)}C.zoom(null,T)}})}function P(G,_,b){return!b&&G.__zooming||new W(G,_)}function W(G,_){this.that=G,this.args=_,this.active=0,this.sourceEvent=null,this.extent=e.apply(G,_),this.taps=0}W.prototype={event:function(G){return G&&(this.sourceEvent=G),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(G,_){return this.mouse&&G!=="mouse"&&(this.mouse[1]=_.invert(this.mouse[0])),this.touch0&&G!=="touch"&&(this.touch0[1]=_.invert(this.touch0[0])),this.touch1&&G!=="touch"&&(this.touch1[1]=_.invert(this.touch1[0])),this.that.__zoom=_,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(G){var _=bt(this.that).datum();u.call(G,this.that,new ML(G,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:u}),_)}};function D(G,..._){if(!t.apply(this,arguments))return;var b=P(this,_).event(G),B=this.__zoom,X=Math.max(a[0],Math.min(a[1],B.k*Math.pow(2,i.apply(this,arguments)))),z=En(G);if(b.wheel)(b.mouse[0][0]!==z[0]||b.mouse[0][1]!==z[1])&&(b.mouse[1]=B.invert(b.mouse[0]=z)),clearTimeout(b.wheel);else{if(B.k===X)return;b.mouse=[z,B.invert(z)],Hl(this),b.start()}fs(G),b.wheel=setTimeout(C,p),b.zoom("mouse",n(j(I(B,X),b.mouse[0],b.mouse[1]),b.extent,o));function C(){b.wheel=null,b.end()}}function x(G,..._){if(d||!t.apply(this,arguments))return;var b=G.currentTarget,B=P(this,_,!0).event(G),X=bt(G.view).on("mousemove.zoom",M,!0).on("mouseup.zoom",O,!0),z=En(G,b),C=G.clientX,A=G.clientY;m$(G.view),_u(G),B.mouse=[z,this.__zoom.invert(z)],Hl(this),B.start();function M(K){if(fs(K),!B.moved){var Q=K.clientX-C,se=K.clientY-A;B.moved=Q*Q+se*se>y}B.event(K).zoom("mouse",n(j(B.that.__zoom,B.mouse[0]=En(K,b),B.mouse[1]),B.extent,o))}function O(K){X.on("mousemove.zoom mouseup.zoom",null),y$(K.view,B.moved),fs(K),B.event(K).end()}}function $(G,..._){if(t.apply(this,arguments)){var b=this.__zoom,B=En(G.changedTouches?G.changedTouches[0]:G,this),X=b.invert(B),z=b.k*(G.shiftKey?.5:2),C=n(j(I(b,z),B,X),e.apply(this,_),o);fs(G),s>0?bt(this).transition().duration(s).call(S,C,B,G):bt(this).call(m.transform,C,B,G)}}function V(G,..._){if(t.apply(this,arguments)){var b=G.touches,B=b.length,X=P(this,_,G.changedTouches.length===B).event(G),z,C,A,M;for(_u(G),C=0;C<B;++C)A=b[C],M=En(A,this),M=[M,this.__zoom.invert(M),A.identifier],X.touch0?!X.touch1&&X.touch0[2]!==M[2]&&(X.touch1=M,X.taps=0):(X.touch0=M,z=!0,X.taps=1+!!h);h&&(h=clearTimeout(h)),z&&(X.taps<2&&(f=M[0],h=setTimeout(function(){h=null},g)),Hl(this),X.start())}}function q(G,..._){if(this.__zooming){var b=P(this,_).event(G),B=G.changedTouches,X=B.length,z,C,A,M;for(fs(G),z=0;z<X;++z)C=B[z],A=En(C,this),b.touch0&&b.touch0[2]===C.identifier?b.touch0[0]=A:b.touch1&&b.touch1[2]===C.identifier&&(b.touch1[0]=A);if(C=b.that.__zoom,b.touch1){var O=b.touch0[0],K=b.touch0[1],Q=b.touch1[0],se=b.touch1[1],T=(T=Q[0]-O[0])*T+(T=Q[1]-O[1])*T,Z=(Z=se[0]-K[0])*Z+(Z=se[1]-K[1])*Z;C=I(C,Math.sqrt(T/Z)),A=[(O[0]+Q[0])/2,(O[1]+Q[1])/2],M=[(K[0]+se[0])/2,(K[1]+se[1])/2]}else if(b.touch0)A=b.touch0[0],M=b.touch0[1];else return;b.zoom("touch",n(j(C,A,M),b.extent,o))}}function ae(G,..._){if(this.__zooming){var b=P(this,_).event(G),B=G.changedTouches,X=B.length,z,C;for(_u(G),d&&clearTimeout(d),d=setTimeout(function(){d=null},g),z=0;z<X;++z)C=B[z],b.touch0&&b.touch0[2]===C.identifier?delete b.touch0:b.touch1&&b.touch1[2]===C.identifier&&delete b.touch1;if(b.touch1&&!b.touch0&&(b.touch0=b.touch1,delete b.touch1),b.touch0)b.touch0[1]=this.__zoom.invert(b.touch0[0]);else if(b.end(),b.taps===2&&(C=En(C,this),Math.hypot(f[0]-C[0],f[1]-C[1])<v)){var A=bt(this).on("dblclick.zoom");A&&A.apply(this,arguments)}}}return m.wheelDelta=function(G){return arguments.length?(i=typeof G=="function"?G:_l(+G),m):i},m.filter=function(G){return arguments.length?(t=typeof G=="function"?G:_l(!!G),m):t},m.touchable=function(G){return arguments.length?(r=typeof G=="function"?G:_l(!!G),m):r},m.extent=function(G){return arguments.length?(e=typeof G=="function"?G:_l([[+G[0][0],+G[0][1]],[+G[1][0],+G[1][1]]]),m):e},m.scaleExtent=function(G){return arguments.length?(a[0]=+G[0],a[1]=+G[1],m):[a[0],a[1]]},m.translateExtent=function(G){return arguments.length?(o[0][0]=+G[0][0],o[1][0]=+G[1][0],o[0][1]=+G[0][1],o[1][1]=+G[1][1],m):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},m.constrain=function(G){return arguments.length?(n=G,m):n},m.duration=function(G){return arguments.length?(s=+G,m):s},m.interpolate=function(G){return arguments.length?(c=G,m):c},m.on=function(){var G=u.on.apply(u,arguments);return G===u?m:G},m.clickDistance=function(G){return arguments.length?(y=(G=+G)*G,m):Math.sqrt(y)},m.tapDistance=function(G){return arguments.length?(v=+G,m):v},m}function OL(t){const{data:e,xDomain:n,mapData:i,xColorLegendTitle:r,yDomain:a,yColorLegendTitle:o,width:s,height:c,colors:u,scale:h,centerPoint:f,mapBorderWidth:d,mapNoDataColor:g,mapBorderColor:p,tooltip:y,onSeriesMouseOver:v,zoomScaleExtend:m,zoomTranslateExtend:I,highlightedIds:j,onSeriesMouseClick:w,mapProperty:S,resetSelectionOnDoubleClick:P,detailsOnClick:W,showColorScale:D,styles:x,classNames:$,mapProjection:V,zoomInteraction:q,animate:ae,dimmedOpacity:G,customLayers:_}=t,[b,B]=k.useState(!(s<680)),[X,z]=k.useState(void 0),[C,A]=k.useState(void 0),[M,O]=k.useState(void 0),[K,Q]=k.useState(void 0),[se,T]=k.useState(void 0),Z=k.useRef(null),ie=ct(Z,{once:ae.once,amount:ae.amount}),ue=k.useRef(null),he=k.useRef(null);k.useEffect(()=>{const Me=bt(ue.current),be=bt(Z.current),ne=xe=>{if(q==="noZoom")return!1;if(q==="button")return!xe.type.includes("wheel");const Ae=xe.type==="wheel",ke=xe.type.startsWith("touch"),me=xe.type==="mousedown"||xe.type==="mousemove";return ke?!0:Ae?q==="scroll"?!0:xe.ctrlKey:me&&!xe.button&&!xe.ctrlKey},De=Dd().scaleExtent(m).translateExtent(I||[[-20,-20],[s+20,c+20]]).filter(ne).on("zoom",({transform:xe})=>{Me.attr("transform",xe)});be.call(De),he.current=De},[c,s,q]);const Y=hd(i),ge=fd(i),oe=Y[2]-Y[0],ce=Y[3]-Y[1],N=s*190/960*360/oe,U=c*190/678*180/ce,ve=h*Math.min(N,U),J=V==="mercator"?xd().rotate([0,0]).center(f||ge.geometry.coordinates).translate([s/2,c/2]).scale(ve):V==="equalEarth"?vd().rotate([0,0]).center(f||ge.geometry.coordinates).translate([s/2,c/2]).scale(ve):V==="naturalEarth"?wd().rotate([0,0]).center(f||ge.geometry.coordinates).translate([s/2,c/2]).scale(ve):V==="orthographic"?bd().rotate([0,0]).center(f||ge.geometry.coordinates).translate([s/2,c/2]).scale(ve):md().rotate([0,0]).center(f||ge.geometry.coordinates).translate([s/2,c/2]).scale(ve),R=Array.from({length:n.length},(Me,be)=>be),le=Array.from({length:a.length},(Me,be)=>be),ee=Po().domain(n).range(R),de=Po().domain(a).range(le),te=Me=>{if(!Z.current||!he.current)return;bt(Z.current).call(he.current.scaleBy,Me==="in"?1.2:1/1.2)};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"relative",children:[l.jsx($e.svg,{viewBox:`0 0 ${s} ${c}`,width:`${s}px`,height:`${c}px`,ref:Z,direction:"ltr",children:l.jsxs("g",{ref:ue,children:[_.filter(Me=>Me.position==="before").map(Me=>Me.layer),i.features.map((Me,be)=>e.findIndex(De=>De.id===Me.properties[S])!==-1?null:l.jsx($e.g,{opacity:X?G:j.length!==0?j.indexOf(Me.properties[S])!==-1?1:G:1,children:Me.geometry.type==="MultiPolygon"?Me.geometry.coordinates.map((De,xe)=>{let Ae="";return De.forEach(ke=>{let me=" M";ke.forEach((Se,Le)=>{const F=J([Se[0],Se[1]]);Le!==ke.length-1?me=`${me}${F[0]} ${F[1]}L`:me=`${me}${F[0]} ${F[1]}`}),Ae+=me}),l.jsx("path",{d:Ae,style:{stroke:p,strokeWidth:d,fill:g}},xe)}):Me.geometry.coordinates.map((De,xe)=>{let Ae="M";return De.forEach((ke,me)=>{const Se=J([ke[0],ke[1]]);me!==De.length-1?Ae=`${Ae}${Se[0]} ${Se[1]}L`:Ae=`${Ae}${Se[0]} ${Se[1]}`}),l.jsx("path",{d:Ae,style:{stroke:p,strokeWidth:d,fill:g}},xe)})},be)),l.jsx(mt,{children:e.map(Me=>{const be=i.features.findIndex(Ae=>Me.id===Ae.properties[S]),ne=je(Me.x)?void 0:ee(Me.x),De=je(Me.y)?void 0:de(Me.y),xe=ne!==void 0&&De!==void 0?u[De][ne]:g;return l.jsx($e.g,{variants:{initial:{opacity:0},whileInView:{opacity:X?X===xe?1:G:j.length!==0?j.indexOf(Me.id)!==-1?1:G:1,transition:{duration:ae.duration}}},initial:"initial",animate:ie?"whileInView":"initial",exit:{opacity:0,transition:{duration:ae.duration}},onMouseEnter:Ae=>{O(Me),T(Ae.clientY),Q(Ae.clientX),v?.(Me)},onClick:()=>{(w||W)&&(dt(C,Me)&&P?(A(void 0),w?.(void 0)):(A(Me),w?.(Me)))},onMouseMove:Ae=>{O(Me),T(Ae.clientY),Q(Ae.clientX)},onMouseLeave:()=>{O(void 0),Q(void 0),T(void 0),v?.(void 0)},children:be===-1?null:i.features[be].geometry.type==="MultiPolygon"?i.features[be].geometry.coordinates.map((Ae,ke)=>{let me="";return Ae.forEach(Se=>{let Le=" M";Se.forEach((F,Ie)=>{const Ve=J([F[0],F[1]]);Ie!==Se.length-1?Le=`${Le}${Ve[0]} ${Ve[1]}L`:Le=`${Le}${Ve[0]} ${Ve[1]}`}),me+=Le}),l.jsx($e.path,{variants:{initial:{fill:xe,opacity:0},whileInView:{fill:xe,opacity:1,transition:{duration:ae.duration}}},initial:"initial",animate:ie?"whileInView":"initial",exit:{opacity:0,transition:{duration:ae.duration}},d:me,className:`${xe===g?"stroke-primary-gray-400 dark:stroke-primary-gray-500":"stroke-primary-white dark:stroke-primary-gray-650"}`,style:{strokeWidth:d}},`${Me.id}-${ke}`)}):i.features[be].geometry.coordinates.map((Ae,ke)=>{let me="M";return Ae.forEach((Se,Le)=>{const F=J([Se[0],Se[1]]);Le!==Ae.length-1?me=`${me}${F[0]} ${F[1]}L`:me=`${me}${F[0]} ${F[1]}`}),l.jsx($e.path,{d:me,variants:{initial:{fill:xe,opacity:0},whileInView:{fill:xe,opacity:1,transition:{duration:ae.duration}}},initial:"initial",animate:ie?"whileInView":"initial",exit:{opacity:0,transition:{duration:ae.duration}},className:`${xe===g?"stroke-primary-gray-400 dark:stroke-primary-gray-500":"stroke-primary-white dark:stroke-primary-gray-650"}`,style:{strokeWidth:d}},`${Me.id}-${ke}`)})},Me.id)})}),M?i.features.filter(Me=>Me.properties[S]===M.id).map((Me,be)=>l.jsx("g",{children:Me.geometry.type==="MultiPolygon"?Me.geometry.coordinates.map((ne,De)=>{let xe="";return ne.forEach(Ae=>{let ke=" M";Ae.forEach((me,Se)=>{const Le=J([me[0],me[1]]);Se!==Ae.length-1?ke=`${ke}${Le[0]} ${Le[1]}L`:ke=`${ke}${Le[0]} ${Le[1]}`}),xe+=ke}),l.jsx("path",{d:xe,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},De)}):Me.geometry.coordinates.map((ne,De)=>{let xe="M";return ne.forEach((Ae,ke)=>{const me=J([Ae[0],Ae[1]]);ke!==ne.length-1?xe=`${xe}${me[0]} ${me[1]}L`:xe=`${xe}${me[0]} ${me[1]}`}),l.jsx("path",{d:xe,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},De)})},be)):null,_.filter(Me=>Me.position==="after").map(Me=>Me.layer)]})}),D===!1?null:l.jsx("div",{className:"absolute left-4 bottom-4",children:b?l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{backgroundColor:"rgba(240,240,240, 0.7)",border:"1px solid var(--gray-400)",borderRadius:"999px",width:"24px",height:"24px",padding:"3px",cursor:"pointer",zIndex:10,position:"absolute",right:"-0.75rem",top:"-0.75rem"},onClick:()=>{B(!1)},children:l.jsx(ea,{})}),l.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)",width:"175px"},children:[l.jsxs("div",{className:"flex gap-1 items-center",children:[l.jsx("svg",{width:"136px",viewBox:"0 0 136 136",className:"shrink-0",children:l.jsxs("g",{children:[u.map((Me,be)=>l.jsx("g",{transform:`translate(0,${100-be*25})`,children:Me.map((ne,De)=>l.jsx("rect",{y:1,x:De*25+1,fill:ne,width:23,height:23,strokeWidth:X===ne?2:.25,style:{cursor:"pointer"},onMouseOver:()=>{z(ne)},onMouseLeave:()=>{z(void 0)}},De))},be)),l.jsx("g",{transform:"translate(0,125)",children:n.map((Me,be)=>l.jsx("text",{y:10,x:(be+1)*25,fontSize:10,textAnchor:"middle",children:typeof Me=="string"||Me<1?Me:qe(Me,"NA")},be))}),a.map((Me,be)=>l.jsx("g",{transform:`translate(${Math.max(Math.min(n.length+1,5),4)*25+10},${100-be*25})`,children:l.jsx("text",{x:0,transform:"rotate(-90)",y:0,fontSize:10,textAnchor:"middle",children:typeof Me=="string"||Me<1?Me:qe(Me,"NA")})},be))]})}),l.jsx(Ce.P,{marginBottom:"none",size:"xs",className:"leading-normal text-center shrink-0",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical",overflow:"hidden",writingMode:"vertical-rl",height:"8.5rem",transform:"rotate(180deg)"},children:o})]}),l.jsx(Ce.P,{marginBottom:"none",size:"xs",className:"mt-1 leading-normal text-center",style:{display:"-webkit-box",WebkitLineClamp:"1",width:"8.5rem",WebkitBoxOrient:"vertical",overflow:"hidden"},children:r})]})]}):l.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{B(!0)},children:l.jsx("div",{className:"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-550 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),q==="button"&&l.jsxs("div",{className:"absolute left-4 top-4 flex flex-col",children:[l.jsx("button",{onClick:()=>te("in"),className:"leading-0 px-2 py-3.5 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-400 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),l.jsx("button",{onClick:()=>te("out"),className:"leading-0 px-2 py-3.5 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-400 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),M&&y&&K&&se?l.jsx(st,{data:M,body:y,xPos:K,yPos:se,backgroundStyle:x?.tooltip,className:$?.tooltip}):null,W&&C!==void 0?l.jsx(Ce.Modal,{open:C!==void 0,onClose:()=>{A(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof W=="string"?{__html:lt(W,C)}:void 0,children:typeof W=="function"?W(C):null})}):null]})}var Wl={exports:{}};/* @license
|
|
54
|
-
Papa Parse
|
|
55
|
-
v5.5.2
|
|
56
|
-
https://github.com/mholt/PapaParse
|
|
57
|
-
License: MIT
|
|
58
|
-
*/var NL=Wl.exports,Wm;function IL(){return Wm||(Wm=1,function(t,e){((n,i)=>{t.exports=i()})(NL,function n(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},r,a=!i.document&&!!i.postMessage,o=i.IS_PAPA_WORKER||!1,s={},c=0,u={};function h(D){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(x){var $=S(x);$.chunkSize=parseInt($.chunkSize),x.step||x.chunk||($.chunkSize=null),this._handle=new y($),(this._handle.streamer=this)._config=$}).call(this,D),this.parseChunk=function(x,$){var V=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<V){let ae=this._config.newline;ae||(q=this._config.quoteChar||'"',ae=this._handle.guessLineEndings(x,q)),x=[...x.split(ae).slice(V)].join(ae)}this.isFirstChunk&&W(this._config.beforeFirstChunk)&&(q=this._config.beforeFirstChunk(x))!==void 0&&(x=q),this.isFirstChunk=!1,this._halted=!1;var V=this._partialLine+x,q=(this._partialLine="",this._handle.parse(V,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(x=q.meta.cursor,V=(this._finished||(this._partialLine=V.substring(x-this._baseIndex),this._baseIndex=x),q&&q.data&&(this._rowCount+=q.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),o)i.postMessage({results:q,workerId:u.WORKER_ID,finished:V});else if(W(this._config.chunk)&&!$){if(this._config.chunk(q,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=q=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(q.data),this._completeResults.errors=this._completeResults.errors.concat(q.errors),this._completeResults.meta=q.meta),this._completed||!V||!W(this._config.complete)||q&&q.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),V||q&&q.meta.paused||this._nextChunk(),q}this._halted=!0},this._sendError=function(x){W(this._config.error)?this._config.error(x):o&&this._config.error&&i.postMessage({workerId:u.WORKER_ID,error:x,finished:!1})}}function f(D){var x;(D=D||{}).chunkSize||(D.chunkSize=u.RemoteChunkSize),h.call(this,D),this._nextChunk=a?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function($){this._input=$,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(x=new XMLHttpRequest,this._config.withCredentials&&(x.withCredentials=this._config.withCredentials),a||(x.onload=P(this._chunkLoaded,this),x.onerror=P(this._chunkError,this)),x.open(this._config.downloadRequestBody?"POST":"GET",this._input,!a),this._config.downloadRequestHeaders){var $,V=this._config.downloadRequestHeaders;for($ in V)x.setRequestHeader($,V[$])}var q;this._config.chunkSize&&(q=this._start+this._config.chunkSize-1,x.setRequestHeader("Range","bytes="+this._start+"-"+q));try{x.send(this._config.downloadRequestBody)}catch(ae){this._chunkError(ae.message)}a&&x.status===0&&this._chunkError()}},this._chunkLoaded=function(){x.readyState===4&&(x.status<200||400<=x.status?this._chunkError():(this._start+=this._config.chunkSize||x.responseText.length,this._finished=!this._config.chunkSize||this._start>=($=>($=$.getResponseHeader("Content-Range"))!==null?parseInt($.substring($.lastIndexOf("/")+1)):-1)(x),this.parseChunk(x.responseText)))},this._chunkError=function($){$=x.statusText||$,this._sendError(new Error($))}}function d(D){(D=D||{}).chunkSize||(D.chunkSize=u.LocalChunkSize),h.call(this,D);var x,$,V=typeof FileReader<"u";this.stream=function(q){this._input=q,$=q.slice||q.webkitSlice||q.mozSlice,V?((x=new FileReader).onload=P(this._chunkLoaded,this),x.onerror=P(this._chunkError,this)):x=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var q=this._input,ae=(this._config.chunkSize&&(ae=Math.min(this._start+this._config.chunkSize,this._input.size),q=$.call(q,this._start,ae)),x.readAsText(q,this._config.encoding));V||this._chunkLoaded({target:{result:ae}})},this._chunkLoaded=function(q){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(q.target.result)},this._chunkError=function(){this._sendError(x.error)}}function g(D){var x;h.call(this,D=D||{}),this.stream=function($){return x=$,this._nextChunk()},this._nextChunk=function(){var $,V;if(!this._finished)return $=this._config.chunkSize,x=$?(V=x.substring(0,$),x.substring($)):(V=x,""),this._finished=!x,this.parseChunk(V)}}function p(D){h.call(this,D=D||{});var x=[],$=!0,V=!1;this.pause=function(){h.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){h.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(q){this._input=q,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){V&&x.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),x.length?this.parseChunk(x.shift()):$=!0},this._streamData=P(function(q){try{x.push(typeof q=="string"?q:q.toString(this._config.encoding)),$&&($=!1,this._checkIsFinished(),this.parseChunk(x.shift()))}catch(ae){this._streamError(ae)}},this),this._streamError=P(function(q){this._streamCleanUp(),this._sendError(q)},this),this._streamEnd=P(function(){this._streamCleanUp(),V=!0,this._streamData("")},this),this._streamCleanUp=P(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function y(D){var x,$,V,q,ae=Math.pow(2,53),G=-ae,_=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,b=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,B=this,X=0,z=0,C=!1,A=!1,M=[],O={data:[],errors:[],meta:{}};function K(Z){return D.skipEmptyLines==="greedy"?Z.join("").trim()==="":Z.length===1&&Z[0].length===0}function Q(){if(O&&V&&(T("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),V=!1),D.skipEmptyLines&&(O.data=O.data.filter(function(he){return!K(he)})),se()){let he=function(Y,ge){W(D.transformHeader)&&(Y=D.transformHeader(Y,ge)),M.push(Y)};if(O)if(Array.isArray(O.data[0])){for(var Z=0;se()&&Z<O.data.length;Z++)O.data[Z].forEach(he);O.data.splice(0,1)}else O.data.forEach(he)}function ie(he,Y){for(var ge=D.header?{}:[],oe=0;oe<he.length;oe++){var ce=oe,N=he[oe],N=((U,ve)=>(J=>(D.dynamicTypingFunction&&D.dynamicTyping[J]===void 0&&(D.dynamicTyping[J]=D.dynamicTypingFunction(J)),(D.dynamicTyping[J]||D.dynamicTyping)===!0))(U)?ve==="true"||ve==="TRUE"||ve!=="false"&&ve!=="FALSE"&&((J=>{if(_.test(J)&&(J=parseFloat(J),G<J&&J<ae))return 1})(ve)?parseFloat(ve):b.test(ve)?new Date(ve):ve===""?null:ve):ve)(ce=D.header?oe>=M.length?"__parsed_extra":M[oe]:ce,N=D.transform?D.transform(N,ce):N);ce==="__parsed_extra"?(ge[ce]=ge[ce]||[],ge[ce].push(N)):ge[ce]=N}return D.header&&(oe>M.length?T("FieldMismatch","TooManyFields","Too many fields: expected "+M.length+" fields but parsed "+oe,z+Y):oe<M.length&&T("FieldMismatch","TooFewFields","Too few fields: expected "+M.length+" fields but parsed "+oe,z+Y)),ge}var ue;O&&(D.header||D.dynamicTyping||D.transform)&&(ue=1,!O.data.length||Array.isArray(O.data[0])?(O.data=O.data.map(ie),ue=O.data.length):O.data=ie(O.data,0),D.header&&O.meta&&(O.meta.fields=M),z+=ue)}function se(){return D.header&&M.length===0}function T(Z,ie,ue,he){Z={type:Z,code:ie,message:ue},he!==void 0&&(Z.row=he),O.errors.push(Z)}W(D.step)&&(q=D.step,D.step=function(Z){O=Z,se()?Q():(Q(),O.data.length!==0&&(X+=Z.data.length,D.preview&&X>D.preview?$.abort():(O.data=O.data[0],q(O,B))))}),this.parse=function(Z,ie,ue){var he=D.quoteChar||'"',he=(D.newline||(D.newline=this.guessLineEndings(Z,he)),V=!1,D.delimiter?W(D.delimiter)&&(D.delimiter=D.delimiter(Z),O.meta.delimiter=D.delimiter):((he=((Y,ge,oe,ce,N)=>{var U,ve,J,R;N=N||[","," ","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var le=0;le<N.length;le++){for(var ee,de=N[le],te=0,Me=0,be=0,ne=(J=void 0,new m({comments:ce,delimiter:de,newline:ge,preview:10}).parse(Y)),De=0;De<ne.data.length;De++)oe&&K(ne.data[De])?be++:(ee=ne.data[De].length,Me+=ee,J===void 0?J=ee:0<ee&&(te+=Math.abs(ee-J),J=ee));0<ne.data.length&&(Me/=ne.data.length-be),(ve===void 0||te<=ve)&&(R===void 0||R<Me)&&1.99<Me&&(ve=te,U=de,R=Me)}return{successful:!!(D.delimiter=U),bestDelimiter:U}})(Z,D.newline,D.skipEmptyLines,D.comments,D.delimitersToGuess)).successful?D.delimiter=he.bestDelimiter:(V=!0,D.delimiter=u.DefaultDelimiter),O.meta.delimiter=D.delimiter),S(D));return D.preview&&D.header&&he.preview++,x=Z,$=new m(he),O=$.parse(x,ie,ue),Q(),C?{meta:{paused:!0}}:O||{meta:{paused:!1}}},this.paused=function(){return C},this.pause=function(){C=!0,$.abort(),x=W(D.chunk)?"":x.substring($.getCharIndex())},this.resume=function(){B.streamer._halted?(C=!1,B.streamer.parseChunk(x,!0)):setTimeout(B.resume,3)},this.aborted=function(){return A},this.abort=function(){A=!0,$.abort(),O.meta.aborted=!0,W(D.complete)&&D.complete(O),x=""},this.guessLineEndings=function(Y,he){Y=Y.substring(0,1048576);var he=new RegExp(v(he)+"([^]*?)"+v(he),"gm"),ue=(Y=Y.replace(he,"")).split("\r"),he=Y.split(`
|
|
59
|
-
`),Y=1<he.length&&he[0].length<ue[0].length;if(ue.length===1||Y)return`
|
|
60
|
-
`;for(var ge=0,oe=0;oe<ue.length;oe++)ue[oe][0]===`
|
|
61
|
-
`&&ge++;return ge>=ue.length/2?`\r
|
|
62
|
-
`:"\r"}}function v(D){return D.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function m(D){var x=(D=D||{}).delimiter,$=D.newline,V=D.comments,q=D.step,ae=D.preview,G=D.fastMode,_=null,b=!1,B=D.quoteChar==null?'"':D.quoteChar,X=B;if(D.escapeChar!==void 0&&(X=D.escapeChar),(typeof x!="string"||-1<u.BAD_DELIMITERS.indexOf(x))&&(x=","),V===x)throw new Error("Comment character same as delimiter");V===!0?V="#":(typeof V!="string"||-1<u.BAD_DELIMITERS.indexOf(V))&&(V=!1),$!==`
|
|
63
|
-
`&&$!=="\r"&&$!==`\r
|
|
64
|
-
`&&($=`
|
|
65
|
-
`);var z=0,C=!1;this.parse=function(A,M,O){if(typeof A!="string")throw new Error("Input must be a string");var K=A.length,Q=x.length,se=$.length,T=V.length,Z=W(q),ie=[],ue=[],he=[],Y=z=0;if(!A)return te();if(G||G!==!1&&A.indexOf(B)===-1){for(var ge=A.split($),oe=0;oe<ge.length;oe++){if(he=ge[oe],z+=he.length,oe!==ge.length-1)z+=$.length;else if(O)return te();if(!V||he.substring(0,T)!==V){if(Z){if(ie=[],R(he.split(x)),Me(),C)return te()}else R(he.split(x));if(ae&&ae<=oe)return ie=ie.slice(0,ae),te(!0)}}return te()}for(var ce=A.indexOf(x,z),N=A.indexOf($,z),U=new RegExp(v(X)+v(B),"g"),ve=A.indexOf(B,z);;)if(A[z]===B)for(ve=z,z++;;){if((ve=A.indexOf(B,ve+1))===-1)return O||ue.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:ie.length,index:z}),ee();if(ve===K-1)return ee(A.substring(z,ve).replace(U,B));if(B===X&&A[ve+1]===X)ve++;else if(B===X||ve===0||A[ve-1]!==X){ce!==-1&&ce<ve+1&&(ce=A.indexOf(x,ve+1));var J=le((N=N!==-1&&N<ve+1?A.indexOf($,ve+1):N)===-1?ce:Math.min(ce,N));if(A.substr(ve+1+J,Q)===x){he.push(A.substring(z,ve).replace(U,B)),A[z=ve+1+J+Q]!==B&&(ve=A.indexOf(B,z)),ce=A.indexOf(x,z),N=A.indexOf($,z);break}if(J=le(N),A.substring(ve+1+J,ve+1+J+se)===$){if(he.push(A.substring(z,ve).replace(U,B)),de(ve+1+J+se),ce=A.indexOf(x,z),ve=A.indexOf(B,z),Z&&(Me(),C))return te();if(ae&&ie.length>=ae)return te(!0);break}ue.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:ie.length,index:z}),ve++}}else if(V&&he.length===0&&A.substring(z,z+T)===V){if(N===-1)return te();z=N+se,N=A.indexOf($,z),ce=A.indexOf(x,z)}else if(ce!==-1&&(ce<N||N===-1))he.push(A.substring(z,ce)),z=ce+Q,ce=A.indexOf(x,z);else{if(N===-1)break;if(he.push(A.substring(z,N)),de(N+se),Z&&(Me(),C))return te();if(ae&&ie.length>=ae)return te(!0)}return ee();function R(be){ie.push(be),Y=z}function le(be){var ne=0;return ne=be!==-1&&(be=A.substring(ve+1,be))&&be.trim()===""?be.length:ne}function ee(be){return O||(be===void 0&&(be=A.substring(z)),he.push(be),z=K,R(he),Z&&Me()),te()}function de(be){z=be,R(he),he=[],N=A.indexOf($,z)}function te(be){if(D.header&&!M&&ie.length&&!b){var ne=ie[0],De={},xe=new Set(ne);let Ae=!1;for(let ke=0;ke<ne.length;ke++){let me=ne[ke];if(De[me=W(D.transformHeader)?D.transformHeader(me,ke):me]){let Se,Le=De[me];for(;Se=me+"_"+Le,Le++,xe.has(Se););xe.add(Se),ne[ke]=Se,De[me]++,Ae=!0,(_=_===null?{}:_)[Se]=me}else De[me]=1,ne[ke]=me;xe.add(me)}Ae&&console.warn("Duplicate headers found and renamed."),b=!0}return{data:ie,errors:ue,meta:{delimiter:x,linebreak:$,aborted:C,truncated:!!be,cursor:Y+(M||0),renamedHeaders:_}}}function Me(){q(te()),ie=[],ue=[]}},this.abort=function(){C=!0},this.getCharIndex=function(){return z}}function I(D){var x=D.data,$=s[x.workerId],V=!1;if(x.error)$.userError(x.error,x.file);else if(x.results&&x.results.data){var q={abort:function(){V=!0,j(x.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:w,resume:w};if(W($.userStep)){for(var ae=0;ae<x.results.data.length&&($.userStep({data:x.results.data[ae],errors:x.results.errors,meta:x.results.meta},q),!V);ae++);delete x.results}else W($.userChunk)&&($.userChunk(x.results,q,x.file),delete x.results)}x.finished&&!V&&j(x.workerId,x.results)}function j(D,x){var $=s[D];W($.userComplete)&&$.userComplete(x),$.terminate(),delete s[D]}function w(){throw new Error("Not implemented.")}function S(D){if(typeof D!="object"||D===null)return D;var x,$=Array.isArray(D)?[]:{};for(x in D)$[x]=S(D[x]);return $}function P(D,x){return function(){D.apply(x,arguments)}}function W(D){return typeof D=="function"}return u.parse=function(D,x){var $=(x=x||{}).dynamicTyping||!1;if(W($)&&(x.dynamicTypingFunction=$,$={}),x.dynamicTyping=$,x.transform=!!W(x.transform)&&x.transform,!x.worker||!u.WORKERS_SUPPORTED)return $=null,u.NODE_STREAM_INPUT,typeof D=="string"?(D=(V=>V.charCodeAt(0)!==65279?V:V.slice(1))(D),$=new(x.download?f:g)(x)):D.readable===!0&&W(D.read)&&W(D.on)?$=new p(x):(i.File&&D instanceof File||D instanceof Object)&&($=new d(x)),$.stream(D);($=(()=>{var V;return!!u.WORKERS_SUPPORTED&&(V=(()=>{var q=i.URL||i.webkitURL||null,ae=n.toString();return u.BLOB_URL||(u.BLOB_URL=q.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",ae,")();"],{type:"text/javascript"})))})(),(V=new i.Worker(V)).onmessage=I,V.id=c++,s[V.id]=V)})()).userStep=x.step,$.userChunk=x.chunk,$.userComplete=x.complete,$.userError=x.error,x.step=W(x.step),x.chunk=W(x.chunk),x.complete=W(x.complete),x.error=W(x.error),delete x.worker,$.postMessage({input:D,config:x,workerId:$.id})},u.unparse=function(D,x){var $=!1,V=!0,q=",",ae=`\r
|
|
66
|
-
`,G='"',_=G+G,b=!1,B=null,X=!1,z=((()=>{if(typeof x=="object"){if(typeof x.delimiter!="string"||u.BAD_DELIMITERS.filter(function(M){return x.delimiter.indexOf(M)!==-1}).length||(q=x.delimiter),typeof x.quotes!="boolean"&&typeof x.quotes!="function"&&!Array.isArray(x.quotes)||($=x.quotes),typeof x.skipEmptyLines!="boolean"&&typeof x.skipEmptyLines!="string"||(b=x.skipEmptyLines),typeof x.newline=="string"&&(ae=x.newline),typeof x.quoteChar=="string"&&(G=x.quoteChar),typeof x.header=="boolean"&&(V=x.header),Array.isArray(x.columns)){if(x.columns.length===0)throw new Error("Option columns is empty");B=x.columns}x.escapeChar!==void 0&&(_=x.escapeChar+G),x.escapeFormulae instanceof RegExp?X=x.escapeFormulae:typeof x.escapeFormulae=="boolean"&&x.escapeFormulae&&(X=/^[=+\-@\t\r].*$/)}})(),new RegExp(v(G),"g"));if(typeof D=="string"&&(D=JSON.parse(D)),Array.isArray(D)){if(!D.length||Array.isArray(D[0]))return C(null,D,b);if(typeof D[0]=="object")return C(B||Object.keys(D[0]),D,b)}else if(typeof D=="object")return typeof D.data=="string"&&(D.data=JSON.parse(D.data)),Array.isArray(D.data)&&(D.fields||(D.fields=D.meta&&D.meta.fields||B),D.fields||(D.fields=Array.isArray(D.data[0])?D.fields:typeof D.data[0]=="object"?Object.keys(D.data[0]):[]),Array.isArray(D.data[0])||typeof D.data[0]=="object"||(D.data=[D.data])),C(D.fields||[],D.data||[],b);throw new Error("Unable to serialize unrecognized input");function C(M,O,K){var Q="",se=(typeof M=="string"&&(M=JSON.parse(M)),typeof O=="string"&&(O=JSON.parse(O)),Array.isArray(M)&&0<M.length),T=!Array.isArray(O[0]);if(se&&V){for(var Z=0;Z<M.length;Z++)0<Z&&(Q+=q),Q+=A(M[Z],Z);0<O.length&&(Q+=ae)}for(var ie=0;ie<O.length;ie++){var ue=(se?M:O[ie]).length,he=!1,Y=se?Object.keys(O[ie]).length===0:O[ie].length===0;if(K&&!se&&(he=K==="greedy"?O[ie].join("").trim()==="":O[ie].length===1&&O[ie][0].length===0),K==="greedy"&&se){for(var ge=[],oe=0;oe<ue;oe++){var ce=T?M[oe]:oe;ge.push(O[ie][ce])}he=ge.join("").trim()===""}if(!he){for(var N=0;N<ue;N++){0<N&&!Y&&(Q+=q);var U=se&&T?M[N]:N;Q+=A(O[ie][U],N)}ie<O.length-1&&(!K||0<ue&&!Y)&&(Q+=ae)}}return Q}function A(M,O){var K,Q;return M==null?"":M.constructor===Date?JSON.stringify(M).slice(1,25):(Q=!1,X&&typeof M=="string"&&X.test(M)&&(M="'"+M,Q=!0),K=M.toString().replace(z,_),(Q=Q||$===!0||typeof $=="function"&&$(M,O)||Array.isArray($)&&$[O]||((se,T)=>{for(var Z=0;Z<T.length;Z++)if(-1<se.indexOf(T[Z]))return!0;return!1})(K,u.BAD_DELIMITERS)||-1<K.indexOf(q)||K.charAt(0)===" "||K.charAt(K.length-1)===" ")?G+K+G:K)}},u.RECORD_SEP="",u.UNIT_SEP="",u.BYTE_ORDER_MARK="\uFEFF",u.BAD_DELIMITERS=["\r",`
|
|
67
|
-
`,'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!a&&!!i.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=m,u.ParserHandle=y,u.NetworkStreamer=f,u.FileStreamer=d,u.StringStreamer=g,u.ReadableStreamStreamer=p,i.jQuery&&((r=i.jQuery).fn.parse=function(D){var x=D.config||{},$=[];return this.each(function(ae){if(!(r(this).prop("tagName").toUpperCase()==="INPUT"&&r(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var G=0;G<this.files.length;G++)$.push({file:this.files[G],inputElem:this,instanceConfig:r.extend({},x)})}),V(),this;function V(){if($.length===0)W(D.complete)&&D.complete();else{var ae,G,_,b,B=$[0];if(W(D.before)){var X=D.before(B.file,B.inputElem);if(typeof X=="object"){if(X.action==="abort")return ae="AbortError",G=B.file,_=B.inputElem,b=X.reason,void(W(D.error)&&D.error({name:ae},G,_,b));if(X.action==="skip")return void q();typeof X.config=="object"&&(B.instanceConfig=r.extend(B.instanceConfig,X.config))}else if(X==="skip")return void q()}var z=B.instanceConfig.complete;B.instanceConfig.complete=function(C){W(z)&&z(C,B.file,B.inputElem),q()},u.parse(B.file,B.instanceConfig)}}function q(){$.splice(0,1),V()}}),o&&(i.onmessage=function(D){D=D.data,u.WORKER_ID===void 0&&D&&(u.WORKER_ID=D.workerId),typeof D.input=="string"?i.postMessage({workerId:u.WORKER_ID,results:u.parse(D.input,D.config),finished:!0}):(i.File&&D.input instanceof File||D.input instanceof Object)&&(D=u.parse(D.input,D.config))&&i.postMessage({workerId:u.WORKER_ID,results:D,finished:!0})}),(f.prototype=Object.create(h.prototype)).constructor=f,(d.prototype=Object.create(h.prototype)).constructor=d,(g.prototype=Object.create(g.prototype)).constructor=g,(p.prototype=Object.create(h.prototype)).constructor=p,u})}(Wl)),Wl.exports}var $L=IL();const Rv=rr($L);function $r(t,e){return!e||e.length===0?t:t.map(i=>{const r={...i};return e.forEach(a=>{r[a.column]=r[a.column]?r[a.column].split(a.delimiter||",").map(o=>o.trim()):[]}),r})}var Ds={exports:{}};Ds.exports;var zm;function LL(){return zm||(zm=1,function(t,e){var n=200,i="Expected a function",r="__lodash_hash_undefined__",a=1,o=2,s=9007199254740991,c="[object Arguments]",u="[object Array]",h="[object Boolean]",f="[object Date]",d="[object Error]",g="[object Function]",p="[object GeneratorFunction]",y="[object Map]",v="[object Number]",m="[object Object]",I="[object Promise]",j="[object RegExp]",w="[object Set]",S="[object String]",P="[object Symbol]",W="[object WeakMap]",D="[object ArrayBuffer]",x="[object DataView]",$="[object Float32Array]",V="[object Float64Array]",q="[object Int8Array]",ae="[object Int16Array]",G="[object Int32Array]",_="[object Uint8Array]",b="[object Uint8ClampedArray]",B="[object Uint16Array]",X="[object Uint32Array]",z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,C=/^\w*$/,A=/^\./,M=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O=/[\\^$.*+?()[\]{}|]/g,K=/\\(\\)?/g,Q=/^\[object .+?Constructor\]$/,se=/^(?:0|[1-9]\d*)$/,T={};T[$]=T[V]=T[q]=T[ae]=T[G]=T[_]=T[b]=T[B]=T[X]=!0,T[c]=T[u]=T[D]=T[h]=T[x]=T[f]=T[d]=T[g]=T[y]=T[v]=T[m]=T[j]=T[w]=T[S]=T[W]=!1;var Z=typeof Ot=="object"&&Ot&&Ot.Object===Object&&Ot,ie=typeof self=="object"&&self&&self.Object===Object&&self,ue=Z||ie||Function("return this")(),he=e&&!e.nodeType&&e,Y=he&&!0&&t&&!t.nodeType&&t,ge=Y&&Y.exports===he,oe=ge&&Z.process,ce=function(){try{return oe&&oe.binding("util")}catch{}}(),N=ce&&ce.isTypedArray;function U(ye,L,pe,E){for(var fe=-1,Te=ye?ye.length:0;++fe<Te;){var Ne=ye[fe];L(E,Ne,pe(Ne),ye)}return E}function ve(ye,L){for(var pe=-1,E=ye?ye.length:0;++pe<E;)if(L(ye[pe],pe,ye))return!0;return!1}function J(ye){return function(L){return L?.[ye]}}function R(ye,L){for(var pe=-1,E=Array(ye);++pe<ye;)E[pe]=L(pe);return E}function le(ye){return function(L){return ye(L)}}function ee(ye,L){return ye?.[L]}function de(ye){var L=!1;if(ye!=null&&typeof ye.toString!="function")try{L=!!(ye+"")}catch{}return L}function te(ye){var L=-1,pe=Array(ye.size);return ye.forEach(function(E,fe){pe[++L]=[fe,E]}),pe}function Me(ye,L){return function(pe){return ye(L(pe))}}function be(ye){var L=-1,pe=Array(ye.size);return ye.forEach(function(E){pe[++L]=E}),pe}var ne=Array.prototype,De=Function.prototype,xe=Object.prototype,Ae=ue["__core-js_shared__"],ke=function(){var ye=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||"");return ye?"Symbol(src)_1."+ye:""}(),me=De.toString,Se=xe.hasOwnProperty,Le=xe.toString,F=RegExp("^"+me.call(Se).replace(O,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=ue.Symbol,Ve=ue.Uint8Array,H=xe.propertyIsEnumerable,Oe=ne.splice,Ee=Me(Object.keys,Object),it=pn(ue,"DataView"),Tt=pn(ue,"Map"),sn=pn(ue,"Promise"),vn=pn(ue,"Set"),ln=pn(ue,"WeakMap"),Ut=pn(Object,"create"),jt=Kt(it),gn=Kt(Tt),Xt=Kt(sn),Hn=Kt(vn),Tn=Kt(ln),zi=Ie?Ie.prototype:void 0,xi=zi?zi.valueOf:void 0,Gi=zi?zi.toString:void 0;function Wn(ye){var L=-1,pe=ye?ye.length:0;for(this.clear();++L<pe;){var E=ye[L];this.set(E[0],E[1])}}function ai(){this.__data__=Ut?Ut(null):{}}function oi(ye){return this.has(ye)&&delete this.__data__[ye]}function Ni(ye){var L=this.__data__;if(Ut){var pe=L[ye];return pe===r?void 0:pe}return Se.call(L,ye)?L[ye]:void 0}function or(ye){var L=this.__data__;return Ut?L[ye]!==void 0:Se.call(L,ye)}function nn(ye,L){var pe=this.__data__;return pe[ye]=Ut&&L===void 0?r:L,this}Wn.prototype.clear=ai,Wn.prototype.delete=oi,Wn.prototype.get=Ni,Wn.prototype.has=or,Wn.prototype.set=nn;function kn(ye){var L=-1,pe=ye?ye.length:0;for(this.clear();++L<pe;){var E=ye[L];this.set(E[0],E[1])}}function jn(){this.__data__=[]}function na(ye){var L=this.__data__,pe=Ui(L,ye);if(pe<0)return!1;var E=L.length-1;return pe==E?L.pop():Oe.call(L,pe,1),!0}function ia(ye){var L=this.__data__,pe=Ui(L,ye);return pe<0?void 0:L[pe][1]}function ra(ye){return Ui(this.__data__,ye)>-1}function It(ye,L){var pe=this.__data__,E=Ui(pe,ye);return E<0?pe.push([ye,L]):pe[E][1]=L,this}kn.prototype.clear=jn,kn.prototype.delete=na,kn.prototype.get=ia,kn.prototype.has=ra,kn.prototype.set=It;function An(ye){var L=-1,pe=ye?ye.length:0;for(this.clear();++L<pe;){var E=ye[L];this.set(E[0],E[1])}}function _n(){this.__data__={hash:new Wn,map:new(Tt||kn),string:new Wn}}function aa(ye){return Gn(this,ye).delete(ye)}function oa(ye){return Gn(this,ye).get(ye)}function sa(ye){return Gn(this,ye).has(ye)}function $t(ye,L){return Gn(this,ye).set(ye,L),this}An.prototype.clear=_n,An.prototype.delete=aa,An.prototype.get=oa,An.prototype.has=sa,An.prototype.set=$t;function Yi(ye){var L=-1,pe=ye?ye.length:0;for(this.__data__=new An;++L<pe;)this.add(ye[L])}function qi(ye){return this.__data__.set(ye,r),this}function la(ye){return this.__data__.has(ye)}Yi.prototype.add=Yi.prototype.push=qi,Yi.prototype.has=la;function On(ye){this.__data__=new kn(ye)}function Nn(){this.__data__=new kn}function zn(ye){return this.__data__.delete(ye)}function ca(ye){return this.__data__.get(ye)}function ua(ye){return this.__data__.has(ye)}function Lt(ye,L){var pe=this.__data__;if(pe instanceof kn){var E=pe.__data__;if(!Tt||E.length<n-1)return E.push([ye,L]),this;pe=this.__data__=new An(E)}return pe.set(ye,L),this}On.prototype.clear=Nn,On.prototype.delete=zn,On.prototype.get=ca,On.prototype.has=ua,On.prototype.set=Lt;function ha(ye,L){var pe=Rt(ye)||dr(ye)?R(ye.length,String):[],E=pe.length,fe=!!E;for(var Te in ye)Se.call(ye,Te)&&!(fe&&(Te=="length"||Yn(Te,E)))&&pe.push(Te);return pe}function Ui(ye,L){for(var pe=ye.length;pe--;)if(cn(ye[pe][0],L))return pe;return-1}function Xi(ye,L,pe,E){return fa(ye,function(fe,Te,Ne){L(E,fe,pe(fe),Ne)}),E}var fa=cr(ga),da=Da();function ga(ye,L){return ye&&da(ye,L,bn)}function In(ye,L){L=zt(L,ye)?[L]:Er(L);for(var pe=0,E=L.length;ye!=null&&pe<E;)ye=ye[Xn(L[pe++])];return pe&&pe==E?ye:void 0}function Lr(ye){return Le.call(ye)}function pa(ye,L){return ye!=null&&L in Object(ye)}function Ii(ye,L,pe,E,fe){return ye===L?!0:ye==null||L==null||!wn(ye)&&!Qt(L)?ye!==ye&&L!==L:sr(ye,L,Ii,pe,E,fe)}function sr(ye,L,pe,E,fe,Te){var Ne=Rt(ye),Be=Rt(L),Re=u,Ge=u;Ne||(Re=At(ye),Re=Re==c?m:Re),Be||(Ge=At(L),Ge=Ge==c?m:Ge);var Ue=Re==m&&!de(ye),re=Ge==m&&!de(L),we=Re==Ge;if(we&&!Ue)return Te||(Te=new On),Ne||vi(ye)?ur(ye,L,pe,E,fe,Te):Ma(ye,L,Re,pe,E,fe,Te);if(!(fe&o)){var _e=Ue&&Se.call(ye,"__wrapped__"),Fe=re&&Se.call(L,"__wrapped__");if(_e||Fe){var We=_e?ye.value():ye,He=Fe?L.value():L;return Te||(Te=new On),pe(We,He,E,fe,Te)}}return we?(Te||(Te=new On),Ta(ye,L,pe,E,fe,Te)):!1}function Pr(ye,L,pe,E){var fe=pe.length,Te=fe;if(ye==null)return!Te;for(ye=Object(ye);fe--;){var Ne=pe[fe];if(Ne[2]?Ne[1]!==ye[Ne[0]]:!(Ne[0]in ye))return!1}for(;++fe<Te;){Ne=pe[fe];var Be=Ne[0],Re=ye[Be],Ge=Ne[1];if(Ne[2]){if(Re===void 0&&!(Be in ye))return!1}else{var Ue=new On,re;if(!(re===void 0?Ii(Ge,Re,E,a|o,Ue):re))return!1}}return!0}function ma(ye){if(!wn(ye)||Fr(ye))return!1;var L=un(ye)||de(ye)?F:Q;return L.test(Kt(ye))}function ya(ye){return Qt(ye)&&Kn(ye.length)&&!!T[Le.call(ye)]}function lr(ye){return typeof ye=="function"?ye:ye==null?Aa:typeof ye=="object"?Rt(ye)?wa(ye[0],ye[1]):va(ye):Rr(ye)}function xa(ye){if(!si(ye))return Ee(ye);var L=[];for(var pe in Object(ye))Se.call(ye,pe)&&pe!="constructor"&&L.push(pe);return L}function va(ye){var L=Vr(ye);return L.length==1&&L[0][2]?qn(L[0][0],L[0][1]):function(pe){return pe===ye||Pr(pe,ye,L)}}function wa(ye,L){return zt(ye)&&hr(L)?qn(Xn(ye),L):function(pe){var E=ci(pe,ye);return E===void 0&&E===L?Qn(pe,ye):Ii(L,E,void 0,a|o)}}function ba(ye){return function(L){return In(L,ye)}}function Ca(ye){if(typeof ye=="string")return ye;if(li(ye))return Gi?Gi.call(ye):"";var L=ye+"";return L=="0"&&1/ye==-1/0?"-0":L}function Er(ye){return Rt(ye)?ye:Un(ye)}function Sa(ye,L){return function(pe,E){var fe=Rt(pe)?U:Xi,Te={};return fe(pe,ye,lr(E),Te)}}function cr(ye,L){return function(pe,E){if(pe==null)return pe;if(!$i(pe))return ye(pe,E);for(var fe=pe.length,Te=-1,Ne=Object(pe);++Te<fe&&E(Ne[Te],Te,Ne)!==!1;);return pe}}function Da(ye){return function(L,pe,E){for(var fe=-1,Te=Object(L),Ne=E(L),Be=Ne.length;Be--;){var Re=Ne[++fe];if(pe(Te[Re],Re,Te)===!1)break}return L}}function ur(ye,L,pe,E,fe,Te){var Ne=fe&o,Be=ye.length,Re=L.length;if(Be!=Re&&!(Ne&&Re>Be))return!1;var Ge=Te.get(ye);if(Ge&&Te.get(L))return Ge==L;var Ue=-1,re=!0,we=fe&a?new Yi:void 0;for(Te.set(ye,L),Te.set(L,ye);++Ue<Be;){var _e=ye[Ue],Fe=L[Ue];if(E)var We=Ne?E(Fe,_e,Ue,L,ye,Te):E(_e,Fe,Ue,ye,L,Te);if(We!==void 0){if(We)continue;re=!1;break}if(we){if(!ve(L,function(He,Ye){if(!we.has(Ye)&&(_e===He||pe(_e,He,E,fe,Te)))return we.add(Ye)})){re=!1;break}}else if(!(_e===Fe||pe(_e,Fe,E,fe,Te))){re=!1;break}}return Te.delete(ye),Te.delete(L),re}function Ma(ye,L,pe,E,fe,Te,Ne){switch(pe){case x:if(ye.byteLength!=L.byteLength||ye.byteOffset!=L.byteOffset)return!1;ye=ye.buffer,L=L.buffer;case D:return!(ye.byteLength!=L.byteLength||!E(new Ve(ye),new Ve(L)));case h:case f:case v:return cn(+ye,+L);case d:return ye.name==L.name&&ye.message==L.message;case j:case S:return ye==L+"";case y:var Be=te;case w:var Re=Te&o;if(Be||(Be=be),ye.size!=L.size&&!Re)return!1;var Ge=Ne.get(ye);if(Ge)return Ge==L;Te|=a,Ne.set(ye,L);var Ue=ur(Be(ye),Be(L),E,fe,Te,Ne);return Ne.delete(ye),Ue;case P:if(xi)return xi.call(ye)==xi.call(L)}return!1}function Ta(ye,L,pe,E,fe,Te){var Ne=fe&o,Be=bn(ye),Re=Be.length,Ge=bn(L),Ue=Ge.length;if(Re!=Ue&&!Ne)return!1;for(var re=Re;re--;){var we=Be[re];if(!(Ne?we in L:Se.call(L,we)))return!1}var _e=Te.get(ye);if(_e&&Te.get(L))return _e==L;var Fe=!0;Te.set(ye,L),Te.set(L,ye);for(var We=Ne;++re<Re;){we=Be[re];var He=ye[we],Ye=L[we];if(E)var Ze=Ne?E(Ye,He,we,L,ye,Te):E(He,Ye,we,ye,L,Te);if(!(Ze===void 0?He===Ye||pe(He,Ye,E,fe,Te):Ze)){Fe=!1;break}We||(We=we=="constructor")}if(Fe&&!We){var Ke=ye.constructor,nt=L.constructor;Ke!=nt&&"constructor"in ye&&"constructor"in L&&!(typeof Ke=="function"&&Ke instanceof Ke&&typeof nt=="function"&&nt instanceof nt)&&(Fe=!1)}return Te.delete(ye),Te.delete(L),Fe}function Gn(ye,L){var pe=ye.__data__;return ja(L)?pe[typeof L=="string"?"string":"hash"]:pe.map}function Vr(ye){for(var L=bn(ye),pe=L.length;pe--;){var E=L[pe],fe=ye[E];L[pe]=[E,fe,hr(fe)]}return L}function pn(ye,L){var pe=ee(ye,L);return ma(pe)?pe:void 0}var At=Lr;(it&&At(new it(new ArrayBuffer(1)))!=x||Tt&&At(new Tt)!=y||sn&&At(sn.resolve())!=I||vn&&At(new vn)!=w||ln&&At(new ln)!=W)&&(At=function(ye){var L=Le.call(ye),pe=L==m?ye.constructor:void 0,E=pe?Kt(pe):void 0;if(E)switch(E){case jt:return x;case gn:return y;case Xt:return I;case Hn:return w;case Tn:return W}return L});function ka(ye,L,pe){L=zt(L,ye)?[L]:Er(L);for(var E,fe=-1,Ne=L.length;++fe<Ne;){var Te=Xn(L[fe]);if(!(E=ye!=null&&pe(ye,Te)))break;ye=ye[Te]}if(E)return E;var Ne=ye?ye.length:0;return!!Ne&&Kn(Ne)&&Yn(Te,Ne)&&(Rt(ye)||dr(ye))}function Yn(ye,L){return L=L??s,!!L&&(typeof ye=="number"||se.test(ye))&&ye>-1&&ye%1==0&&ye<L}function zt(ye,L){if(Rt(ye))return!1;var pe=typeof ye;return pe=="number"||pe=="symbol"||pe=="boolean"||ye==null||li(ye)?!0:C.test(ye)||!z.test(ye)||L!=null&&ye in Object(L)}function ja(ye){var L=typeof ye;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?ye!=="__proto__":ye===null}function Fr(ye){return!!ke&&ke in ye}function si(ye){var L=ye&&ye.constructor,pe=typeof L=="function"&&L.prototype||xe;return ye===pe}function hr(ye){return ye===ye&&!wn(ye)}function qn(ye,L){return function(pe){return pe==null?!1:pe[ye]===L&&(L!==void 0||ye in Object(pe))}}var Un=$n(function(ye){ye=wi(ye);var L=[];return A.test(ye)&&L.push(""),ye.replace(M,function(pe,E,fe,Te){L.push(fe?Te.replace(K,"$1"):E||pe)}),L});function Xn(ye){if(typeof ye=="string"||li(ye))return ye;var L=ye+"";return L=="0"&&1/ye==-1/0?"-0":L}function Kt(ye){if(ye!=null){try{return me.call(ye)}catch{}try{return ye+""}catch{}}return""}var fr=Sa(function(ye,L,pe){Se.call(ye,pe)?ye[pe].push(L):ye[pe]=[L]});function $n(ye,L){if(typeof ye!="function"||L&&typeof L!="function")throw new TypeError(i);var pe=function(){var E=arguments,fe=L?L.apply(this,E):E[0],Te=pe.cache;if(Te.has(fe))return Te.get(fe);var Ne=ye.apply(this,E);return pe.cache=Te.set(fe,Ne),Ne};return pe.cache=new($n.Cache||An),pe}$n.Cache=An;function cn(ye,L){return ye===L||ye!==ye&&L!==L}function dr(ye){return gr(ye)&&Se.call(ye,"callee")&&(!H.call(ye,"callee")||Le.call(ye)==c)}var Rt=Array.isArray;function $i(ye){return ye!=null&&Kn(ye.length)&&!un(ye)}function gr(ye){return Qt(ye)&&$i(ye)}function un(ye){var L=wn(ye)?Le.call(ye):"";return L==g||L==p}function Kn(ye){return typeof ye=="number"&&ye>-1&&ye%1==0&&ye<=s}function wn(ye){var L=typeof ye;return!!ye&&(L=="object"||L=="function")}function Qt(ye){return!!ye&&typeof ye=="object"}function li(ye){return typeof ye=="symbol"||Qt(ye)&&Le.call(ye)==P}var vi=N?le(N):ya;function wi(ye){return ye==null?"":Ca(ye)}function ci(ye,L,pe){var E=ye==null?void 0:In(ye,L);return E===void 0?pe:E}function Qn(ye,L){return ye!=null&&ka(ye,L,pa)}function bn(ye){return $i(ye)?ha(ye):xa(ye)}function Aa(ye){return ye}function Rr(ye){return zt(ye)?J(Xn(ye)):ba(ye)}t.exports=fr}(Ds,Ds.exports)),Ds.exports}var PL=LL();const EL=rr(PL);function VL(t,e){return t.map(n=>{const i={...n};return i["~id"]=i[e],i})}function FL(t){const e=[];return t.forEach(n=>{n.forEach(i=>{e.push(i)})}),e}function RL(t,e){const n=EL(t,"~id"),i=Object.keys(n).map(s=>n[s].reduce((u,h)=>(Object.assign(u,h),u),{})),r=new Set;i.forEach(s=>{Object.keys(s).forEach(c=>{r.add(c)})});const a={};return r.forEach(s=>{a[s]=void 0}),i.map(s=>({...a,...s})).map(s=>({...s,[e]:s["~id"]}))}function BL(t,e){const n=t.map(r=>VL(r.data,r.idColumn)),i=FL(n);return RL(i,e||"~id")}function Go(t,e){if(!e)return t;Qi.registerHelper("json",i=>new Qi.SafeString(JSON.stringify(i,null,2)));const n=Qi.compile(e);return JSON.parse(n(t))}async function co(t,e,n,i,r,a){return new Promise((o,s)=>{Rv.parse(t,{download:!0,skipEmptyLines:!0,dynamicTyping:!0,header:a!==!1,delimiter:r||",",complete(c){if(i&&console.log("Data from file:",c.data),n){const u=$r(c.data,n);i&&console.log("Data after transformation of column to array:",u),o(Go(u,e))}else o(Go(c.data,e))},error(c){s(c)}})})}async function HL(t,e,n,i,r,a){return new Promise((o,s)=>{Rv.parse(t,{skipEmptyLines:!0,header:a!==!1,delimiter:r||",",complete(c){if(i&&console.log("Data from file:",c.data),n){const u=$r(c.data,n);i&&console.log("Data after transformation of column to array:",u),o(Go(u,e))}else o(Go(c.data,e))},error(c){s(c)}})})}async function en(t,e,n,i){const r=t;try{const a=await fetch(r);if(!a.ok)throw new Error(`Response status: ${a.status}`);const o=await a.json(),s=Go(o,n);if(i&&console.log("Data from file:",o),e){const c=$r(s,e);return i&&console.log("Data after transformation of column to array:",c),c}return s}catch(a){return a}}async function uo(t,e,n,i,r){const a=await fetch(t,{method:"GET",headers:e});if(!a.ok)throw new Error("Network response was not ok");const o=await a.json(),s=Go(o,i);if(r&&(console.log("Data from api:",o),console.log("Data from api after transformation:",s)),n){const c=$r(s,n);return r&&console.log("Data after transformation of column to array:",c),c}return s}async function ts(t,e){const n=await Promise.all(t.map(r=>r.fileType==="json"?en(r.dataURL,r.columnsToArray,r.dataTransformation,!1):r.fileType==="api"?uo(r.dataURL,r.apiHeaders,r.columnsToArray,r.dataTransformation,!1):co(r.dataURL,r.dataTransformation,r.columnsToArray,!1,r.delimiter,!0)));return BL(n.map((r,a)=>({data:r,idColumn:t[a].idColumnName})),e)}const WL=(t,e)=>{const n=[...t];for(;n.length<e;)n.push(n[n.length-1]);return n};function Gs(t,e){const n=tt(t.filter(a=>a!=null),a=>a),r=([...new Set(n)].length<e?WL(n,e).slice(1,-1):sI(n,e).slice(1,-1)).map(a=>{const o=parseFloat(Zh(".2r")(a));return isNaN(o)?a<-1?Math.round(a):a:a!==0&&Math.abs(a)<1?o:Math.round(o)});return[...new Set(r)]}function Bv(t){const{data:e,graphTitle:n,mapData:i="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json",colors:r=Pe.light.bivariateColors.colors05x05,sources:a,graphDescription:o,height:s,width:c,footNote:u="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.",xDomain:h,yDomain:f,xColorLegendTitle:d="X Color key",yColorLegendTitle:g="Y Color key",tooltip:p,scale:y=.95,centerPoint:v,padding:m,mapBorderWidth:I=.5,mapNoDataColor:j=Pe.light.graphNoData,backgroundColor:w=!1,mapBorderColor:S=Pe.light.grays["gray-500"],relativeHeight:P,onSeriesMouseOver:W,isWorldMap:D=!0,zoomScaleExtend:x=[.8,6],zoomTranslateExtend:$,graphID:V,showColorScale:q=!0,highlightedIds:ae=[],onSeriesMouseClick:G,mapProperty:_="ISO3",graphDownload:b=!1,dataDownload:B=!1,showAntarctica:X=!1,language:z="en",minHeight:C=0,theme:A="light",ariaLabel:M,resetSelectionOnDoubleClick:O=!0,detailsOnClick:K,styles:Q,classNames:se,mapProjection:T,zoomInteraction:Z="button",animate:ie=!1,dimmedOpacity:ue=.3,customLayers:he=[],timeline:Y={enabled:!1,autoplay:!1,showOnlyActiveDate:!0}}=t,[ge,oe]=k.useState(0),[ce,N]=k.useState(0),[U,ve]=k.useState(Y.autoplay),J=di(Xe(e.filter(ne=>ne.date!==void 0&&ne.date!==null),ne=>ne.date).map(ne=>ze(`${ne.date}`,Y.dateFormat||"yyyy",new Date).getTime()),(ne,De)=>an(ne,De)),[R,le]=k.useState(Y.autoplay?0:J.length-1),[ee,de]=k.useState(void 0),te=k.useRef(null),Me=k.useRef(null);k.useEffect(()=>{const ne=new ResizeObserver(De=>{oe(c||De[0].contentRect.width||760),N(s||De[0].target.clientHeight||480)});return te.current&&(N(te.current.clientHeight||480),oe(te.current.clientWidth||760),c||ne.observe(te.current)),()=>ne.disconnect()},[c,s]),k.useEffect(()=>{typeof i=="string"?en(i).then(De=>{de(De)}):de(i)},[i]),k.useEffect(()=>{const ne=setInterval(()=>{le(De=>De<J.length-1?De+1:0)},(Y.speed||2)*1e3);return U||clearInterval(ne),()=>clearInterval(ne)},[J,U,Y.speed]);const be=yi(J,R,Y.showOnlyActiveDate,Y.dateFormat||"yyyy");return h&&f&&(h.length!==r[0].length-1||f.length!==r.length-1)?(console.error("the xDomain and yDomain array length don't match to the color array length"),null):l.jsx("div",{className:`${A||"light"} flex ${c?"w-fit grow-0":"w-full grow"}`,dir:z==="he"||z==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${w?w===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${z||"en"}`,se?.graphContainer),style:{...Q?.graphContainer||{},...w&&w!==!0?{backgroundColor:w}:{}},id:V,ref:Me,"aria-label":M||`${n?`The graph shows ${n}. `:""}This is bi-variate choropleth map where geographic areas are colored in proportion to two variables.${o?` ${o}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:w?m||"1rem":m||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||o||b||B?l.jsx(Qe,{styles:{title:Q?.title,description:Q?.description},classNames:{title:se?.title,description:se?.description},graphTitle:n,graphDescription:o,width:c,graphDownload:b?Me.current:void 0,dataDownload:B?e.map(ne=>ne.data).filter(ne=>ne!==void 0).length>0?e.map(ne=>ne.data).filter(ne=>ne!==void 0):e.filter(ne=>ne!==void 0):null}):null,Y.enabled&&J.length>0&&be?l.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[l.jsx("button",{type:"button",onClick:()=>{ve(!U)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":U?"Click to pause animation":"Click to play animation",children:U?l.jsx(mi,{}):l.jsx(pi,{})}),l.jsx(Ce.SliderUI,{min:J[0],max:J[J.length-1],marks:be,step:null,defaultValue:J[J.length-1],value:J[R],onChangeComplete:ne=>{le(J.indexOf(ne))},onChange:ne=>{le(J.indexOf(ne))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,l.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:te,"aria-label":"Map area",children:(c||ge)&&(s||ce)&&ee?l.jsx(OL,{data:e.filter(ne=>Y.enabled?ne.date===ft(new Date(J[R]),Y.dateFormat||"yyyy"):ne),mapData:X?ee:{...ee,features:ee.features.filter(ne=>ne.properties.NAME!=="Antarctica")},xDomain:h||Gs(e.map(ne=>ne.x),r[0].length),yDomain:f||Gs(e.map(ne=>ne.y),r.length),width:c||ge,height:Math.max(C,s||(P?C?(c||ge)*P>C?(c||ge)*P:C:(c||ge)*P:ce)),scale:y,centerPoint:v,colors:r,xColorLegendTitle:d,yColorLegendTitle:g,mapBorderWidth:I,mapNoDataColor:j,mapBorderColor:S,tooltip:p,onSeriesMouseOver:W,isWorldMap:D,zoomScaleExtend:x,zoomTranslateExtend:$,onSeriesMouseClick:G,mapProperty:_,highlightedIds:ae,resetSelectionOnDoubleClick:O,styles:Q,showColorScale:q,classNames:se,mapProjection:T||(D?"naturalEarth":"mercator"),detailsOnClick:K,zoomInteraction:Z,animate:ie===!0?{duration:.5,once:!0,amount:.5}:ie||{duration:0,once:!0,amount:0},dimmedOpacity:ue,customLayers:he}):l.jsx("div",{style:{height:`${Math.max(C,s||(P?C?(c||ge)*P>C?(c||ge)*P:C:(c||ge)*P:ce))}px`},className:"flex items-center justify-center",children:l.jsx(Ce.Spinner,{"aria-label":"Loading graph"})})}),a||u?l.jsx(et,{styles:{footnote:Q?.footnote,source:Q?.source},classNames:{footnote:se?.footnote,source:se?.source},sources:a,footNote:u,width:c}):null]})})})})}function zL(t){const{data:e,colorDomain:n,colors:i,mapData:r,colorLegendTitle:a,categorical:o,height:s,width:c,scale:u,centerPoint:h,tooltip:f,mapBorderWidth:d,mapBorderColor:g,mapNoDataColor:p,onSeriesMouseOver:y,showColorScale:v,zoomScaleExtend:m,zoomTranslateExtend:I,highlightedIds:j,onSeriesMouseClick:w,mapProperty:S,resetSelectionOnDoubleClick:P,detailsOnClick:W,styles:D,classNames:x,mapProjection:$,zoomInteraction:V,animate:q,dimmedOpacity:ae,customLayers:G}=t,[_,b]=k.useState(void 0),B=k.useRef(null),[X,z]=k.useState(!(c<680)),[C,A]=k.useState(void 0),[M,O]=k.useState(void 0),[K,Q]=k.useState(void 0),[se,T]=k.useState(void 0),Z=k.useRef(null),ie=ct(Z,{once:q.once,amount:q.amount}),ue=k.useRef(null),he=o?Xs().domain(n).range(i):Po().domain(n).range(i);k.useEffect(()=>{const le=bt(ue.current),ee=bt(Z.current),de=Me=>{if(V==="noZoom")return!1;if(V==="button")return!Me.type.includes("wheel");const be=Me.type==="wheel",ne=Me.type.startsWith("touch"),De=Me.type==="mousedown"||Me.type==="mousemove";return ne?!0:be?V==="scroll"?!0:Me.ctrlKey:De&&!Me.button&&!Me.ctrlKey},te=Dd().scaleExtent(m).translateExtent(I||[[-20,-20],[c+20,s+20]]).filter(de).on("zoom",({transform:Me})=>{le.attr("transform",Me)});ee.call(te),B.current=te},[s,c,V]);const Y=hd(r),ge=fd(r),oe=Y[2]-Y[0],ce=Y[3]-Y[1],N=c*190/960*360/oe,U=s*190/678*180/ce,ve=u*Math.min(N,U),J=$==="mercator"?xd().rotate([0,0]).center(h||ge.geometry.coordinates).translate([c/2,s/2]).scale(ve):$==="equalEarth"?vd().rotate([0,0]).center(h||ge.geometry.coordinates).translate([c/2,s/2]).scale(ve):$==="naturalEarth"?wd().rotate([0,0]).center(h||ge.geometry.coordinates).translate([c/2,s/2]).scale(ve):$==="orthographic"?bd().rotate([0,0]).center(h||ge.geometry.coordinates).translate([c/2,s/2]).scale(ve):md().rotate([0,0]).center(h||ge.geometry.coordinates).translate([c/2,s/2]).scale(ve),R=le=>{if(!Z.current||!B.current)return;bt(Z.current).call(B.current.scaleBy,le==="in"?1.2:1/1.2)};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"relative",children:[l.jsx($e.svg,{width:`${c}px`,height:`${s}px`,viewBox:`0 0 ${c} ${s}`,ref:Z,direction:"ltr",children:l.jsxs("g",{ref:ue,children:[G.filter(le=>le.position==="before").map(le=>le.layer),r.features.map((le,ee)=>e.findIndex(te=>te.id===le.properties[S])!==-1?null:l.jsx("g",{opacity:_?ae:j.length!==0?j.indexOf(le.properties[S])!==-1?1:ae:1,children:le.geometry.type==="MultiPolygon"?le.geometry.coordinates.map((te,Me)=>{let be="";return te.forEach(ne=>{let De=" M";ne.forEach((xe,Ae)=>{const ke=J([xe[0],xe[1]]);Ae!==ne.length-1?De=`${De}${ke[0]} ${ke[1]}L`:De=`${De}${ke[0]} ${ke[1]}`}),be+=De}),l.jsx("path",{d:be,style:{stroke:g,strokeWidth:d,fill:p}},Me)}):le.geometry.coordinates.map((te,Me)=>{let be="M";return te.forEach((ne,De)=>{const xe=J([ne[0],ne[1]]);De!==te.length-1?be=`${be}${xe[0]} ${xe[1]}L`:be=`${be}${xe[0]} ${xe[1]}`}),l.jsx("path",{d:be,style:{stroke:g,strokeWidth:d,fill:p}},Me)})},ee)),l.jsx(mt,{children:e.map(le=>{const ee=r.features.findIndex(te=>le.id===te.properties[S]),de=je(le.x)?p:he(le.x);return l.jsx($e.g,{variants:{initial:{opacity:0},whileInView:{opacity:_?_===de?1:ae:j.length!==0?j.indexOf(le.id)!==-1?1:ae:1,transition:{duration:q.duration}}},initial:"initial",animate:ie?"whileInView":"initial",exit:{opacity:0,transition:{duration:q.duration}},onMouseEnter:te=>{O(le),T(te.clientY),Q(te.clientX),y?.(le)},onMouseMove:te=>{O(le),T(te.clientY),Q(te.clientX)},onMouseLeave:()=>{O(void 0),Q(void 0),T(void 0),y?.(void 0)},onClick:()=>{(w||W)&&(dt(C,le)&&P?(A(void 0),w?.(void 0)):(A(le),w?.(le)))},children:ee===-1?null:r.features[ee].geometry.type==="MultiPolygon"?r.features[ee].geometry.coordinates.map((te,Me)=>{let be="";return te.forEach(ne=>{let De=" M";ne.forEach((xe,Ae)=>{const ke=J([xe[0],xe[1]]);Ae!==ne.length-1?De=`${De}${ke[0]} ${ke[1]}L`:De=`${De}${ke[0]} ${ke[1]}`}),be+=De}),l.jsx($e.path,{d:be,variants:{initial:{fill:de,opacity:0},whileInView:{fill:de,opacity:1,transition:{duration:q.duration}}},initial:"initial",animate:ie?"whileInView":"initial",exit:{opacity:0,transition:{duration:q.duration}},style:{stroke:g,strokeWidth:d}},`${le.id}-${Me}`)}):r.features[ee].geometry.coordinates.map((te,Me)=>{let be="M";return te.forEach((ne,De)=>{const xe=J([ne[0],ne[1]]);De!==te.length-1?be=`${be}${xe[0]} ${xe[1]}L`:be=`${be}${xe[0]} ${xe[1]}`}),l.jsx($e.path,{d:be,variants:{initial:{fill:de,opacity:0},whileInView:{fill:de,opacity:1,transition:{duration:q.duration}}},initial:"initial",animate:ie?"whileInView":"initial",exit:{opacity:0,transition:{duration:q.duration}},style:{stroke:g,strokeWidth:d}},`${le.id}-${Me}`)})},le.id)})}),M?r.features.filter(le=>le.properties[S]===M.id).map((le,ee)=>l.jsx("g",{children:le.geometry.type==="MultiPolygon"?le.geometry.coordinates.map((de,te)=>{let Me="";return de.forEach(be=>{let ne=" M";be.forEach((De,xe)=>{const Ae=J([De[0],De[1]]);xe!==be.length-1?ne=`${ne}${Ae[0]} ${Ae[1]}L`:ne=`${ne}${Ae[0]} ${Ae[1]}`}),Me+=ne}),l.jsx("path",{d:Me,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},te)}):le.geometry.coordinates.map((de,te)=>{let Me="M";return de.forEach((be,ne)=>{const De=J([be[0],be[1]]);ne!==de.length-1?Me=`${Me}${De[0]} ${De[1]}L`:Me=`${Me}${De[0]} ${De[1]}`}),l.jsx("path",{d:Me,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},te)})},ee)):null,G.filter(le=>le.position==="after").map(le=>le.layer)]})}),v===!1?null:l.jsx("div",{className:"absolute left-4 bottom-4",children:X?l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{backgroundColor:"rgba(240,240,240, 0.7)",border:"1px solid var(--gray-400)",borderRadius:"999px",width:"24px",height:"24px",padding:"3px",cursor:"pointer",zIndex:10,position:"absolute",right:"-0.75rem",top:"-0.75rem"},onClick:()=>{z(!1)},children:l.jsx(ea,{})}),l.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)",width:o?void 0:"340px"},children:[a&&a!==""?l.jsx(Ce.P,{size:"xs",marginBottom:"xs",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:a}):null,o?l.jsx("div",{className:"flex flex-col gap-3",children:n.map((le,ee)=>l.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{b(i[ee%i.length])},onMouseLeave:()=>{b(void 0)},children:[l.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:i[ee%i.length]}}),l.jsx(Ce.P,{size:"sm",marginBottom:"none",leading:"none",children:le})]},ee))}):l.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:l.jsxs("g",{children:[n.map((le,ee)=>l.jsxs("g",{onMouseOver:()=>{b(i[ee])},onMouseLeave:()=>{b(void 0)},className:"cursor-pointer",children:[l.jsx("rect",{x:ee*320/i.length+1,y:1,width:320/i.length-2,height:8,className:_===i[ee]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:i[ee],..._===i[ee]?{}:{stroke:i[ee]}}}),l.jsx("text",{x:(ee+1)*320/i.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:qe(le,"NA")})]},ee)),l.jsx("g",{children:l.jsx("rect",{onMouseOver:()=>{b(i[n.length])},onMouseLeave:()=>{b(void 0)},x:n.length*320/i.length+1,y:1,width:320/i.length-2,height:8,className:`cursor-pointer ${_===i[n.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:i[n.length],..._===i[n.length]?{}:{stroke:i[n.length]}}})})]})})]})]}):l.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{z(!0)},children:l.jsx("div",{className:"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-550 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),V==="button"&&l.jsxs("div",{className:"absolute left-4 top-4 flex flex-col",children:[l.jsx("button",{onClick:()=>R("in"),className:"leading-0 px-2 py-3.5 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-400 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),l.jsx("button",{onClick:()=>R("out"),className:"leading-0 px-2 py-3.5 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-400 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),W&&C!==void 0?l.jsx(Ce.Modal,{open:C!==void 0,onClose:()=>{A(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof W=="string"?{__html:lt(W,C)}:void 0,children:typeof W=="function"?W(C):null})}):null,M&&f&&K&&se?l.jsx(st,{data:M,body:f,xPos:K,yPos:se,backgroundStyle:D?.tooltip,className:x?.tooltip}):null]})}var Ou,Gm;function GL(){if(Gm)return Ou;Gm=1;var t=1/0,e=9007199254740991,n="[object Arguments]",i="[object Function]",r="[object GeneratorFunction]",a=typeof Ot=="object"&&Ot&&Ot.Object===Object&&Ot,o=typeof self=="object"&&self&&self.Object===Object&&self,s=a||o||Function("return this")(),c=Object.prototype,u=c.hasOwnProperty,h=c.toString,f=s.Symbol,d=c.propertyIsEnumerable,g=f?f.isConcatSpreadable:void 0;function p(x,$,V,q,ae){var G=-1,_=x.length;for(V||(V=y),ae||(ae=[]);++G<_;){var b=x[G];V(b)?p(b,$-1,V,q,ae):ae[ae.length]=b}return ae}function y(x){return I(x)||m(x)||!!(g&&x&&x[g])}function v(x){var $=x?x.length:0;return $?p(x,t):[]}function m(x){return w(x)&&u.call(x,"callee")&&(!d.call(x,"callee")||h.call(x)==n)}var I=Array.isArray;function j(x){return x!=null&&P(x.length)&&!S(x)}function w(x){return D(x)&&j(x)}function S(x){var $=W(x)?h.call(x):"";return $==i||$==r}function P(x){return typeof x=="number"&&x>-1&&x%1==0&&x<=e}function W(x){var $=typeof x;return!!x&&($=="object"||$=="function")}function D(x){return!!x&&typeof x=="object"}return Ou=v,Ou}var YL=GL();const hn=rr(YL);function jr(t,e){return t.length===0?[]:typeof t[0][e]!="object"?tt(Xe(t,r=>r[e]),r=>r[e]).map(r=>r[e]):tt(Xe(hn(t.map(i=>i[e])),i=>i),i=>i)}function Hv(t){const{data:e,mapData:n="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json",graphTitle:i,colors:r,sources:a,graphDescription:o,height:s,width:c,footNote:u="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.",colorDomain:h,colorLegendTitle:f,scaleType:d="threshold",scale:g=.95,centerPoint:p,padding:y,mapBorderWidth:v=.5,mapNoDataColor:m=Pe.light.graphNoData,backgroundColor:I=!1,mapBorderColor:j=Pe.light.grays["gray-500"],relativeHeight:w,tooltip:S,onSeriesMouseOver:P,isWorldMap:W=!0,showColorScale:D=!0,zoomScaleExtend:x=[.8,6],zoomTranslateExtend:$,graphID:V,highlightedIds:q=[],onSeriesMouseClick:ae,mapProperty:G="ISO3",graphDownload:_=!1,dataDownload:b=!1,showAntarctica:B=!1,language:X="en",minHeight:z=0,theme:C="light",ariaLabel:A,resetSelectionOnDoubleClick:M=!0,detailsOnClick:O,styles:K,classNames:Q,mapProjection:se,zoomInteraction:T="button",animate:Z=!1,dimmedOpacity:ie=.3,customLayers:ue=[],timeline:he={enabled:!1,autoplay:!1,showOnlyActiveDate:!0}}=t,[Y,ge]=k.useState(0),[oe,ce]=k.useState(0),[N,U]=k.useState(he.autoplay),ve=di(Xe(e.filter(ne=>ne.date!==void 0&&ne.date!==null),ne=>ne.date).map(ne=>ze(`${ne.date}`,he.dateFormat||"yyyy",new Date).getTime()),(ne,De)=>an(ne,De)),[J,R]=k.useState(he.autoplay?0:ve.length-1),[le,ee]=k.useState(void 0),de=k.useRef(null),te=k.useRef(null);k.useEffect(()=>{const ne=new ResizeObserver(De=>{ge(c||De[0].target.clientWidth||760),ce(s||De[0].target.clientHeight||480)});return de.current&&(ce(de.current.clientHeight||480),ge(de.current.clientWidth||760),c||ne.observe(de.current)),()=>ne.disconnect()},[c,s]),k.useEffect(()=>{typeof n=="string"?en(n).then(De=>{ee(De)}):ee(n)},[n]);const Me=h||(d==="categorical"?jr(e,"x"):Gs(e.map(ne=>ne.x),r?.length||4));k.useEffect(()=>{const ne=setInterval(()=>{R(De=>De<ve.length-1?De+1:0)},(he.speed||2)*1e3);return N||clearInterval(ne),()=>clearInterval(ne)},[ve,N,he.speed]);const be=yi(ve,J,he.showOnlyActiveDate,he.dateFormat||"yyyy");return l.jsx("div",{className:`${C||"light"} flex ${c?"w-fit grow-0":"w-full grow"}`,dir:X==="he"||X==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${I?I===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${X||"en"}`,Q?.graphContainer),style:{...K?.graphContainer||{},...I&&I!==!0?{backgroundColor:I}:{}},id:V,ref:te,"aria-label":A||`${i?`The graph shows ${i}. `:""}This is a choropleth map where geographic areas are colored in proportion to a specific variable.${o?` ${o}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:I?y||"1rem":y||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[i||o||_||b?l.jsx(Qe,{styles:{title:K?.title,description:K?.description},classNames:{title:Q?.title,description:Q?.description},graphTitle:i,graphDescription:o,width:c,graphDownload:_?te.current:void 0,dataDownload:b?e.map(ne=>ne.data).filter(ne=>ne!==void 0).length>0?e.map(ne=>ne.data).filter(ne=>ne!==void 0):e.filter(ne=>ne!==void 0):null}):null,he.enabled&&ve.length>0&&be?l.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[l.jsx("button",{type:"button",onClick:()=>{U(!N)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":N?"Click to pause animation":"Click to play animation",children:N?l.jsx(mi,{}):l.jsx(pi,{})}),l.jsx(Ce.SliderUI,{min:ve[0],max:ve[ve.length-1],marks:be,step:null,defaultValue:ve[ve.length-1],value:ve[J],onChangeComplete:ne=>{R(ve.indexOf(ne))},onChange:ne=>{R(ve.indexOf(ne))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,l.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:de,"aria-label":"Map area",children:(c||Y)&&(s||oe)&&le?l.jsx(zL,{data:e.filter(ne=>he.enabled?ne.date===ft(new Date(ve[J]),he.dateFormat||"yyyy"):ne),mapData:B?le:{...le,features:le.features.filter(ne=>ne.properties.NAME!=="Antarctica")},colorDomain:Me,width:c||Y,height:Math.max(z,s||(w?z?(c||Y)*w>z?(c||Y)*w:z:(c||Y)*w:oe)),scale:g,centerPoint:p,colors:r||(d==="categorical"?Pe[C].sequentialColors[`neutralColorsx0${Me.length}`]:Pe[C].sequentialColors[`neutralColorsx0${Me.length+1}`]),colorLegendTitle:f,mapBorderWidth:v,mapNoDataColor:m,categorical:d==="categorical",mapBorderColor:j,tooltip:S,onSeriesMouseOver:P,isWorldMap:W,showColorScale:D,zoomScaleExtend:x,zoomTranslateExtend:$,onSeriesMouseClick:ae,mapProperty:G,highlightedIds:q,resetSelectionOnDoubleClick:M,styles:K,classNames:Q,detailsOnClick:O,mapProjection:se||(W?"naturalEarth":"mercator"),zoomInteraction:T,dimmedOpacity:ie,animate:Z===!0?{duration:.5,once:!0,amount:.5}:Z||{duration:0,once:!0,amount:0},customLayers:ue}):l.jsx("div",{style:{height:`${Math.max(z,s||(w?z?(c||Y)*w>z?(c||Y)*w:z:(c||Y)*w:oe))}px`},className:"flex items-center justify-center",children:l.jsx(Ce.Spinner,{"aria-label":"Loading graph"})})}),a||u?l.jsx(et,{styles:{footnote:K?.footnote,source:K?.source},classNames:{footnote:Q?.footnote,source:Q?.source},sources:a,footNote:u,width:c}):null]})})})})}function qL(t){const{data:e,colors:n,mapData:i,colorLegendTitle:r,colorDomain:a,radius:o,height:s,width:c,scale:u,centerPoint:h,tooltip:f,showLabels:d,mapBorderWidth:g,mapBorderColor:p,mapNoDataColor:y,onSeriesMouseOver:v,showColorScale:m,zoomScaleExtend:I,zoomTranslateExtend:j,highlightedDataPoints:w,onSeriesMouseClick:S,resetSelectionOnDoubleClick:P,detailsOnClick:W,styles:D,classNames:x,mapProjection:$,zoomInteraction:V,animate:q,dimmedOpacity:ae,customLayers:G,maxRadiusValue:_}=t,[b,B]=k.useState(void 0),[X,z]=k.useState(!(c<680)),C=k.useRef(null),[A,M]=k.useState(void 0),[O,K]=k.useState(void 0),[Q,se]=k.useState(void 0),[T,Z]=k.useState(void 0),ie=k.useRef(null),ue=ct(ie,{once:q.once,amount:q.amount}),he=k.useRef(null),Y=e.filter(ee=>ee.radius===void 0||ee.radius===null).length!==e.length?Qs().domain([0,_]).range([.25,o]).nice():void 0;k.useEffect(()=>{const ee=bt(he.current),de=bt(ie.current),te=be=>{if(V==="noZoom")return!1;if(V==="button")return!be.type.includes("wheel");const ne=be.type==="wheel",De=be.type.startsWith("touch"),xe=be.type==="mousedown"||be.type==="mousemove";return De?!0:ne?V==="scroll"?!0:be.ctrlKey:xe&&!be.button&&!be.ctrlKey},Me=Dd().scaleExtent(I).translateExtent(j||[[-20,-20],[c+20,s+20]]).filter(te).on("zoom",({transform:be})=>{ee.attr("transform",be)});de.call(Me),C.current=Me},[s,c,V]);const ge=hd(i),oe=fd(i),ce=ge[2]-ge[0],N=ge[3]-ge[1],U=c*190/960*360/ce,ve=s*190/678*180/N,J=u*Math.min(U,ve),R=$==="mercator"?xd().rotate([0,0]).center(h||oe.geometry.coordinates).translate([c/2,s/2]).scale(J):$==="equalEarth"?vd().rotate([0,0]).center(h||oe.geometry.coordinates).translate([c/2,s/2]).scale(J):$==="naturalEarth"?wd().rotate([0,0]).center(h||oe.geometry.coordinates).translate([c/2,s/2]).scale(J):$==="orthographic"?bd().rotate([0,0]).center(h||oe.geometry.coordinates).translate([c/2,s/2]).scale(J):md().rotate([0,0]).center(h||oe.geometry.coordinates).translate([c/2,s/2]).scale(J),le=ee=>{if(!ie.current||!C.current)return;bt(ie.current).call(C.current.scaleBy,ee==="in"?1.2:1/1.2)};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"relative",children:[l.jsx($e.svg,{width:`${c}px`,height:`${s}px`,viewBox:`0 0 ${c} ${s}`,ref:ie,direction:"ltr",children:l.jsxs("g",{ref:he,children:[G.filter(ee=>ee.position==="before").map(ee=>ee.layer),i.features.map((ee,de)=>l.jsx("g",{children:ee.geometry.type==="MultiPolygon"?ee.geometry.coordinates.map((te,Me)=>{let be="";return te.forEach(ne=>{let De=" M";ne.forEach((xe,Ae)=>{const ke=R([xe[0],xe[1]]);Ae!==ne.length-1?De=`${De}${ke[0]} ${ke[1]}L`:De=`${De}${ke[0]} ${ke[1]}`}),be+=De}),l.jsx("path",{d:be,style:{stroke:p,strokeWidth:g,fill:y}},Me)}):ee.geometry.coordinates.map((te,Me)=>{let be="M";return te.forEach((ne,De)=>{const xe=R([ne[0],ne[1]]);De!==te.length-1?be=`${be}${xe[0]} ${xe[1]}L`:be=`${be}${xe[0]} ${xe[1]}`}),l.jsx("path",{d:be,style:{stroke:p,strokeWidth:g,fill:y}},Me)})},de)),l.jsx(mt,{children:e.map(ee=>{const de=e.filter(te=>te.color).length===0?n[0]:ee.color?n[a.indexOf(`${ee.color}`)]:Pe.gray;return l.jsxs($e.g,{variants:{initial:{opacity:0},whileInView:{opacity:b?b===de?1:ae:w.length!==0?w.indexOf(ee.label||"")!==-1?1:ae:1,transition:{duration:q.duration}}},initial:"initial",animate:ue?"whileInView":"initial",exit:{opacity:0,transition:{duration:q.duration}},onMouseEnter:te=>{K(ee),Z(te.clientY),se(te.clientX),v?.(ee)},onMouseMove:te=>{K(ee),Z(te.clientY),se(te.clientX)},onMouseLeave:()=>{K(void 0),se(void 0),Z(void 0),v?.(void 0)},onClick:()=>{(S||W)&&(dt(A,ee)&&P?(M(void 0),S?.(void 0)):(M(ee),S?.(ee)))},transform:`translate(${R([ee.long,ee.lat])[0]},${R([ee.long,ee.lat])[1]})`,children:[l.jsx($e.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:e.filter(te=>te.color).length===0?n[0]:ee.color?n[a.indexOf(`${ee.color}`)]:Pe.gray,stroke:e.filter(te=>te.color).length===0?n[0]:ee.color?n[a.indexOf(`${ee.color}`)]:Pe.gray},whileInView:{r:Y?Y(ee.radius||0):o,fill:e.filter(te=>te.color).length===0?n[0]:ee.color?n[a.indexOf(`${ee.color}`)]:Pe.gray,stroke:e.filter(te=>te.color).length===0?n[0]:ee.color?n[a.indexOf(`${ee.color}`)]:Pe.gray,transition:{duration:q.duration}}},initial:"initial",animate:ue?"whileInView":"initial",exit:{r:0,transition:{duration:q.duration}},style:{fillOpacity:.8}}),d&&ee.label?l.jsx($e.text,{variants:{initial:{opacity:0,x:Y?Y(ee.radius||0):o},whileInView:{opacity:1,x:Y?Y(ee.radius||0):o,transition:{duration:q.duration}}},initial:"initial",animate:ue?"whileInView":"initial",exit:{opacity:0,transition:{duration:q.duration}},y:0,className:"fill-primary-gray-600 dark:fill-primary-gray-300 text-sm",style:{textAnchor:"start"},dx:4,dy:5,children:ee.label}):null]},ee.label||`${ee.lat}-${ee.long}`)})}),G.filter(ee=>ee.position==="after").map(ee=>ee.layer)]})}),e.filter(ee=>ee.color).length===0||m===!1?null:l.jsx("div",{className:"absolute left-4 bottom-4",children:X?l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{backgroundColor:"rgba(240,240,240, 0.7)",border:"1px solid var(--gray-400)",borderRadius:"999px",width:"24px",height:"24px",padding:"3px",cursor:"pointer",zIndex:10,position:"absolute",right:"-0.75rem",top:"-0.75rem"},onClick:()=>{z(!1)},children:l.jsx(ea,{})}),l.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)"},children:[r&&r!==""?l.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:r}):null,l.jsx("div",{className:"flex flex-col gap-3",children:a.map((ee,de)=>l.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{B(n[de%n.length])},onMouseLeave:()=>{B(void 0)},children:[l.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:n[de%n.length]}}),l.jsx(Ce.P,{size:"sm",marginBottom:"none",leading:"none",children:ee})]},de))})]})]}):l.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{z(!0)},children:l.jsx("div",{className:"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-550 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),V==="button"&&l.jsxs("div",{className:"absolute left-4 top-4 flex flex-col",children:[l.jsx("button",{onClick:()=>le("in"),className:"leading-0 px-2 py-3.5 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-400 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),l.jsx("button",{onClick:()=>le("out"),className:"leading-0 px-2 py-3.5 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-400 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),W&&A!==void 0?l.jsx(Ce.Modal,{open:A!==void 0,onClose:()=>{M(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof W=="string"?{__html:lt(W,A)}:void 0,children:typeof W=="function"?W(A):null})}):null,O&&f&&Q&&T?l.jsx(st,{data:O,body:f,xPos:Q,yPos:T,backgroundStyle:D?.tooltip,className:x?.tooltip}):null]})}function Wv(t){const{data:e,mapData:n="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json",graphTitle:i,colors:r,sources:a,graphDescription:o,height:s,width:c,footNote:u="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.",colorLegendTitle:h,colorDomain:f,radius:d=5,scale:g=.95,centerPoint:p,padding:y,mapBorderWidth:v=.5,mapNoDataColor:m=Pe.light.graphNoData,backgroundColor:I=!1,showLabels:j=!1,mapBorderColor:w=Pe.light.grays["gray-500"],tooltip:S,relativeHeight:P,onSeriesMouseOver:W,isWorldMap:D=!0,showColorScale:x=!0,zoomScaleExtend:$=[.8,6],zoomTranslateExtend:V,graphID:q,highlightedDataPoints:ae=[],onSeriesMouseClick:G,graphDownload:_=!1,dataDownload:b=!1,showAntarctica:B=!1,language:X="en",minHeight:z=0,theme:C="light",ariaLabel:A,resetSelectionOnDoubleClick:M=!0,detailsOnClick:O,styles:K,classNames:Q,mapProjection:se,zoomInteraction:T="button",animate:Z=!1,dimmedOpacity:ie=.3,customLayers:ue=[],maxRadiusValue:he,timeline:Y={enabled:!1,autoplay:!1,showOnlyActiveDate:!0}}=t,[ge,oe]=k.useState(0),[ce,N]=k.useState(0),[U,ve]=k.useState(Y.autoplay),J=di(Xe(e.filter(ne=>ne.date!==void 0&&ne.date!==null),ne=>ne.date).map(ne=>ze(`${ne.date}`,Y.dateFormat||"yyyy",new Date).getTime()),(ne,De)=>an(ne,De)),[R,le]=k.useState(Y.autoplay?0:J.length-1),[ee,de]=k.useState(void 0),te=k.useRef(null),Me=k.useRef(null);k.useEffect(()=>{const ne=new ResizeObserver(De=>{oe(c||De[0].target.clientWidth||760),N(s||De[0].target.clientHeight||480)});return te.current&&(N(te.current.clientHeight||480),oe(te.current.clientWidth||760),c||ne.observe(te.current)),()=>ne.disconnect()},[c,s]),k.useEffect(()=>{typeof n=="string"?en(n).then(De=>{de(De)}):de(n)},[n]),k.useEffect(()=>{const ne=setInterval(()=>{le(De=>De<J.length-1?De+1:0)},(Y.speed||2)*1e3);return U||clearInterval(ne),()=>clearInterval(ne)},[J,U,Y.speed]);const be=yi(J,R,Y.showOnlyActiveDate,Y.dateFormat||"yyyy");return l.jsx("div",{className:`${C||"light"} flex ${c?"w-fit grow-0":"w-full grow"}`,dir:X==="he"||X==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${I?I===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${X||"en"}`,Q?.graphContainer),style:{...K?.graphContainer||{},...I&&I!==!0?{backgroundColor:I}:{}},id:q,ref:Me,"aria-label":A||`${i?`The graph shows ${i}. `:""}This is a dot density map showing the distribution of a variable across a region or world, with each dot representing a data point.${o?` ${o}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:I?y||"1rem":y||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[i||o||_||b?l.jsx(Qe,{styles:{title:K?.title,description:K?.description},classNames:{title:Q?.title,description:Q?.description},graphTitle:i,graphDescription:o,width:c,graphDownload:_?Me.current:void 0,dataDownload:b?e.map(ne=>ne.data).filter(ne=>ne!==void 0).length>0?e.map(ne=>ne.data).filter(ne=>ne!==void 0):e.filter(ne=>ne!==void 0):null}):null,Y.enabled&&J.length>0&&be?l.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[l.jsx("button",{type:"button",onClick:()=>{ve(!U)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":U?"Click to pause animation":"Click to play animation",children:U?l.jsx(mi,{}):l.jsx(pi,{})}),l.jsx(Ce.SliderUI,{min:J[0],max:J[J.length-1],marks:be,step:null,defaultValue:J[J.length-1],value:J[R],onChangeComplete:ne=>{le(J.indexOf(ne))},onChange:ne=>{le(J.indexOf(ne))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,l.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:te,"aria-label":"Map area",children:(c||ge)&&(s||ce)&&ee?l.jsx(qL,{data:e.filter(ne=>Y.enabled?ne.date===ft(new Date(J[R]),Y.dateFormat||"yyyy"):ne),mapData:B?ee:{...ee,features:ee.features.filter(ne=>ne.properties.NAME!=="Antarctica")},colorDomain:e.filter(ne=>ne.color).length===0?[]:f||Xe(e.filter(ne=>!je(ne.color)),"color").map(ne=>`${ne.color}`),width:c||ge,height:Math.max(z,s||(P?z?(c||ge)*P>z?(c||ge)*P:z:(c||ge)*P:ce)),scale:g,centerPoint:p,colors:e.filter(ne=>ne.color).length===0?r?[r]:[Pe.primaryColors["blue-600"]]:r||Pe[C].categoricalColors.colors,colorLegendTitle:h,radius:d,mapBorderWidth:v,mapNoDataColor:m,mapBorderColor:w,tooltip:S,onSeriesMouseOver:W,showLabels:j,isWorldMap:D,showColorScale:x,zoomScaleExtend:$,zoomTranslateExtend:V,onSeriesMouseClick:G,highlightedDataPoints:ae,resetSelectionOnDoubleClick:M,styles:K,classNames:Q,zoomInteraction:T,detailsOnClick:O,mapProjection:se||(D?"naturalEarth":"mercator"),animate:Z===!0?{duration:.5,once:!0,amount:.5}:Z||{duration:0,once:!0,amount:0},dimmedOpacity:ie,customLayers:ue,maxRadiusValue:je(he)?Math.max(...e.map(ne=>ne.radius).filter(ne=>ne!=null)):he}):l.jsx("div",{style:{height:`${Math.max(z,s||(P?z?(c||ge)*P>z?(c||ge)*P:z:(c||ge)*P:ce))}px`},className:"flex items-center justify-center",children:l.jsx(Ce.Spinner,{"aria-label":"Loading graph"})})}),a||u?l.jsx(et,{styles:{footnote:K?.footnote,source:K?.source},classNames:{footnote:Q?.footnote,source:Q?.source},sources:a,footNote:u,width:c}):null]})})})})}function UL(t){const{width:e,autoRotate:n,data:i,enableZoom:r,categorical:a,colorDomain:o,colors:s,globeMaterial:c,height:u,polygonData:h,mapProperty:f,mapBorderColor:d,atmosphereColor:g,tooltip:p,styles:y,classNames:v,mapNoDataColor:m,centerPoint:I,colorLegendTitle:j,showColorScale:w,hoverStrokeColor:S,detailsOnClick:P,onSeriesMouseClick:W,onSeriesMouseOver:D,resetSelectionOnDoubleClick:x,highlightedIds:$,altitude:V,globeOffset:q,polygonAltitude:ae,centerLng:G,centerLat:_}=t,b=k.useRef(void 0),[B,X]=k.useState(void 0),[z,C]=k.useState(!(e<680)),[A,M]=k.useState({x:0,y:0}),[O,K]=k.useState(void 0),Q=a?Xs().domain(o).range(s):Po().domain(o).range(s);k.useEffect(()=>{b?.current&&(b.current.controls().autoRotate=n!==0,b.current.controls().enableZoom=r,b.current.controls().autoRotateSpeed=n)},[n,r]),k.useEffect(()=>{b.current&&(O?b.current.controls().autoRotate=!1:b.current.controls().autoRotate=n!==0)},[O,n]),k.useEffect(()=>{const T=b.current?.renderer().domElement;if(!T)return;const Z=ie=>{M({x:ie.clientX,y:ie.clientY})};return T.addEventListener("mousemove",Z),()=>T.removeEventListener("mousemove",Z)},[]),k.useEffect(()=>{b.current&&b.current.pointOfView({lat:_,lng:G,altitude:V},1e3)},[V,G,_]);const se=new Gw.MeshLambertMaterial(c);return l.jsxs("div",{className:"relative",children:[l.jsx(Vw,{ref:b,width:e,height:u,globeOffset:q,lineHoverPrecision:0,polygonsData:h,polygonAltitude:T=>$.includes(T?.properties?.[f])?.1:T?.properties?.[f]===O?.id?.01:ae,polygonCapColor:T=>{const Z=T?.properties?.[f],ie=i.find(ue=>ue.id===Z)?.x;return ie!=null?Q(ie):m},polygonSideColor:T=>{const Z=T?.properties?.[f],ie=i.find(he=>he.id===Z)?.x,ue=ie!=null?Q(ie):m;return $.includes(T?.properties?.[f])?ue:"rgba(100,100,100,0)"},polygonStrokeColor:T=>T?.properties?.[f]===O?.id?S:d,onPolygonClick:T=>{const Z=T?.properties?.[f]?i.find(ie=>ie.id===T?.properties?.[f]):void 0;(W||P)&&(dt(B,Z)&&x&&Z?(X(void 0),W?.(void 0)):(X(Z),W?.(Z))),X(Z),W?.(Z)},onPolygonHover:T=>{const Z=T?.properties?.[f]?i.find(ie=>ie.id===T?.properties?.[f]):void 0;K(Z),D?.(Z)},atmosphereColor:g,globeMaterial:se,backgroundColor:"rgba(0, 0, 0, 0)",polygonsTransitionDuration:100,onGlobeReady:()=>{b.current&&b.current.pointOfView({lat:I[0],lng:I[1]})}}),w===!1?null:l.jsx("div",{className:"absolute left-4 bottom-4",children:z?l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{backgroundColor:"rgba(240,240,240, 0.7)",border:"1px solid var(--gray-400)",borderRadius:"999px",width:"24px",height:"24px",padding:"3px",cursor:"pointer",zIndex:10,position:"absolute",right:"-0.75rem",top:"-0.75rem"},onClick:()=>{C(!1)},children:l.jsx(ea,{})}),l.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)",width:a?void 0:"340px"},children:[j&&j!==""?l.jsx(Ce.P,{size:"xs",marginBottom:"xs",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:j}):null,a?l.jsx("div",{className:"flex flex-col gap-3",children:o.map((T,Z)=>l.jsxs("div",{className:"flex gap-2 items-center",children:[l.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:s[Z%s.length]}}),l.jsx(Ce.P,{size:"sm",marginBottom:"none",leading:"none",children:T})]},Z))}):l.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:l.jsxs("g",{children:[o.map((T,Z)=>l.jsxs("g",{className:"cursor-pointer",children:[l.jsx("rect",{x:Z*320/s.length+1,y:1,width:320/s.length-2,height:8,style:{fill:s[Z],stroke:s[Z]}}),l.jsx("text",{x:(Z+1)*320/s.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:qe(T,"NA")})]},Z)),l.jsx("g",{children:l.jsx("rect",{x:o.length*320/s.length+1,y:1,width:320/s.length-2,height:8,style:{fill:s[o.length],stroke:s[o.length]}})})]})})]})]}):l.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{C(!0)},children:l.jsx("div",{className:"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-550 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),O&&p?l.jsx(st,{data:O,body:p,xPos:A.x,yPos:A.y,backgroundStyle:y?.tooltip,className:v?.tooltip}):null,P&&B!==void 0?l.jsx(Ce.Modal,{open:B!==void 0,onClose:()=>{X(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof P=="string"?{__html:lt(P,B)}:void 0,children:typeof P=="function"?P(B):null})}):null]})}function zv(t){const{data:e,mapData:n="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json",graphTitle:i,colors:r,sources:a,graphDescription:o,height:s,width:c,footNote:u="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.",colorDomain:h,colorLegendTitle:f,scaleType:d="threshold",padding:g,mapNoDataColor:p=Pe.light.graphNoData,backgroundColor:y=!1,mapBorderColor:v=Pe.light.grays["gray-500"],relativeHeight:m,tooltip:I,graphID:j,mapProperty:w="ISO3",dataDownload:S=!1,language:P="en",minHeight:W=0,theme:D="light",ariaLabel:x,styles:$,classNames:V,autoRotate:q=!0,enableZoom:ae=!0,globeMaterial:G={color:"#fff",opacity:1,transparent:!1},centerPoint:_=[0,0],atmosphereColor:b="#999",showColorScale:B=!0,resetSelectionOnDoubleClick:X=!0,detailsOnClick:z,onSeriesMouseOver:C,onSeriesMouseClick:A,highlightedIds:M=[],altitude:O=1,globeOffset:K=[0,0],polygonAltitude:Q=.01}=t,[se,T]=k.useState(void 0),[Z,ie]=k.useState(0),[ue,he]=k.useState(0),Y=k.useRef(null);k.useEffect(()=>{const oe=new ResizeObserver(ce=>{ie(c||ce[0].target.clientWidth||760),he(s||ce[0].target.clientHeight||480)});return Y.current&&(he(Y.current.clientHeight||480),ie(Y.current.clientWidth||760),c||oe.observe(Y.current)),()=>oe.disconnect()},[c,s]),k.useEffect(()=>{typeof n=="string"?en(n).then(ce=>{if(n==="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json"){const N=ce.features.map(U=>{if(U.geometry.type==="Polygon"){const R=[...U.geometry.coordinates[0]].reverse(),le={...U.geometry,coordinates:[R]};return{...U,geometry:le}}const ve=[];U.geometry.coordinates.forEach(R=>{const le=[...R[0]].reverse();ve.push([le])});const J={...U.geometry,coordinates:ve};return{...U,geometry:J}});T(N)}else T(ce.features)}):T(n.features)},[n]);const ge=h||(d==="categorical"?jr(e,"x"):Gs(e.map(oe=>oe.x),r?.length||4));return l.jsx("div",{className:`${D||"light"} flex ${c?"w-fit grow-0":"w-full grow"}`,dir:P==="he"||P==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${y?y===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${P||"en"}`,V?.graphContainer),style:{...$?.graphContainer||{},...y&&y!==!0?{backgroundColor:y}:{}},id:j,"aria-label":x||`${i?`The graph shows ${i}. `:""}This is a map.${o?` ${o}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:y?g||"1rem":g||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[i||o||S?l.jsx(Qe,{styles:{title:$?.title,description:$?.description},classNames:{title:V?.title,description:V?.description},graphTitle:i,graphDescription:o,width:c,graphDownload:void 0,dataDownload:S?e.map(oe=>oe.data).filter(oe=>oe!==void 0).length>0?e.map(oe=>oe.data).filter(oe=>oe!==void 0):e.filter(oe=>oe!==void 0):null}):null,l.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:Y,"aria-label":"Map area",children:(c||Z)&&(s||ue)&&se?l.jsx(UL,{data:e,globeOffset:K,polygonData:se,colorDomain:ge,width:c||Z,height:Math.max(W,s||(m?W?(c||Z)*m>W?(c||Z)*m:W:(c||Z)*m:ue)),colors:r||(d==="categorical"?Pe[D].sequentialColors[`neutralColorsx0${ge.length}`]:Pe[D].sequentialColors[`neutralColorsx0${ge.length+1}`]),mapNoDataColor:p,categorical:d==="categorical",mapBorderColor:v,tooltip:I,mapProperty:w,styles:$,classNames:V,autoRotate:q===!0?1.5:q===!1?0:q,enableZoom:ae,globeMaterial:G,atmosphereColor:b,centerPoint:_,colorLegendTitle:f,showColorScale:B,hoverStrokeColor:D==="light"?Pe.light.grays["gray-700"]:Pe.light.grays["gray-300"],highlightedIds:M,resetSelectionOnDoubleClick:X,detailsOnClick:z,onSeriesMouseOver:C,onSeriesMouseClick:A,altitude:O,polygonAltitude:Q,centerLat:_[0],centerLng:_[1]}):l.jsx("div",{style:{height:`${Math.max(W,s||(m?W?(c||Z)*m>W?(c||Z)*m:W:(c||Z)*m:ue))}px`},className:"flex items-center justify-center",children:l.jsx(Ce.Spinner,{"aria-label":"Loading graph"})})}),a||u?l.jsx(et,{styles:{footnote:$?.footnote,source:$?.source},classNames:{footnote:V?.footnote,source:V?.source},sources:a,footNote:u,width:c}):null]})})})})}var Nu,Ym;function XL(){if(Ym)return Nu;Ym=1;var t="__lodash_hash_undefined__",e=9007199254740991,n="[object Function]",i="[object GeneratorFunction]",r=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=typeof Ot=="object"&&Ot&&Ot.Object===Object&&Ot,s=typeof self=="object"&&self&&self.Object===Object&&self,c=o||s||Function("return this")();function u(F,Ie,Ve){switch(Ve.length){case 0:return F.call(Ie);case 1:return F.call(Ie,Ve[0]);case 2:return F.call(Ie,Ve[0],Ve[1]);case 3:return F.call(Ie,Ve[0],Ve[1],Ve[2])}return F.apply(Ie,Ve)}function h(F,Ie){var Ve=F?F.length:0;return!!Ve&&g(F,Ie,0)>-1}function f(F,Ie){for(var Ve=-1,H=F?F.length:0,Oe=Array(H);++Ve<H;)Oe[Ve]=Ie(F[Ve],Ve,F);return Oe}function d(F,Ie,Ve,H){for(var Oe=F.length,Ee=Ve+-1;++Ee<Oe;)if(Ie(F[Ee],Ee,F))return Ee;return-1}function g(F,Ie,Ve){if(Ie!==Ie)return d(F,p,Ve);for(var H=Ve-1,Oe=F.length;++H<Oe;)if(F[H]===Ie)return H;return-1}function p(F){return F!==F}function y(F,Ie){return F.has(Ie)}function v(F,Ie){return F?.[Ie]}function m(F){var Ie=!1;if(F!=null&&typeof F.toString!="function")try{Ie=!!(F+"")}catch{}return Ie}var I=Array.prototype,j=Function.prototype,w=Object.prototype,S=c["__core-js_shared__"],P=function(){var F=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||"");return F?"Symbol(src)_1."+F:""}(),W=j.toString,D=w.hasOwnProperty,x=w.toString,$=RegExp("^"+W.call(D).replace(r,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),V=I.splice,q=Math.max,ae=Math.min,G=de(c,"Map"),_=de(Object,"create");function b(F){var Ie=-1,Ve=F?F.length:0;for(this.clear();++Ie<Ve;){var H=F[Ie];this.set(H[0],H[1])}}function B(){this.__data__=_?_(null):{}}function X(F){return this.has(F)&&delete this.__data__[F]}function z(F){var Ie=this.__data__;if(_){var Ve=Ie[F];return Ve===t?void 0:Ve}return D.call(Ie,F)?Ie[F]:void 0}function C(F){var Ie=this.__data__;return _?Ie[F]!==void 0:D.call(Ie,F)}function A(F,Ie){var Ve=this.__data__;return Ve[F]=_&&Ie===void 0?t:Ie,this}b.prototype.clear=B,b.prototype.delete=X,b.prototype.get=z,b.prototype.has=C,b.prototype.set=A;function M(F){var Ie=-1,Ve=F?F.length:0;for(this.clear();++Ie<Ve;){var H=F[Ie];this.set(H[0],H[1])}}function O(){this.__data__=[]}function K(F){var Ie=this.__data__,Ve=U(Ie,F);if(Ve<0)return!1;var H=Ie.length-1;return Ve==H?Ie.pop():V.call(Ie,Ve,1),!0}function Q(F){var Ie=this.__data__,Ve=U(Ie,F);return Ve<0?void 0:Ie[Ve][1]}function se(F){return U(this.__data__,F)>-1}function T(F,Ie){var Ve=this.__data__,H=U(Ve,F);return H<0?Ve.push([F,Ie]):Ve[H][1]=Ie,this}M.prototype.clear=O,M.prototype.delete=K,M.prototype.get=Q,M.prototype.has=se,M.prototype.set=T;function Z(F){var Ie=-1,Ve=F?F.length:0;for(this.clear();++Ie<Ve;){var H=F[Ie];this.set(H[0],H[1])}}function ie(){this.__data__={hash:new b,map:new(G||M),string:new b}}function ue(F){return ee(this,F).delete(F)}function he(F){return ee(this,F).get(F)}function Y(F){return ee(this,F).has(F)}function ge(F,Ie){return ee(this,F).set(F,Ie),this}Z.prototype.clear=ie,Z.prototype.delete=ue,Z.prototype.get=he,Z.prototype.has=Y,Z.prototype.set=ge;function oe(F){var Ie=-1,Ve=F?F.length:0;for(this.__data__=new Z;++Ie<Ve;)this.add(F[Ie])}function ce(F){return this.__data__.set(F,t),this}function N(F){return this.__data__.has(F)}oe.prototype.add=oe.prototype.push=ce,oe.prototype.has=N;function U(F,Ie){for(var Ve=F.length;Ve--;)if(De(F[Ve][0],Ie))return Ve;return-1}function ve(F,Ie,Ve){for(var H=h,Oe=F[0].length,Ee=F.length,it=Ee,Tt=Array(Ee),sn=1/0,vn=[];it--;){var ln=F[it];sn=ae(ln.length,sn),Tt[it]=Oe>=120&&ln.length>=120?new oe(it&&ln):void 0}ln=F[0];var Ut=-1,jt=Tt[0];e:for(;++Ut<Oe&&vn.length<sn;){var gn=ln[Ut],Xt=gn;if(gn=gn!==0?gn:0,!(jt?y(jt,Xt):H(vn,Xt))){for(it=Ee;--it;){var Hn=Tt[it];if(!(Hn?y(Hn,Xt):H(F[it],Xt)))continue e}jt&&jt.push(Xt),vn.push(gn)}}return vn}function J(F){if(!Se(F)||Me(F))return!1;var Ie=ke(F)||m(F)?$:a;return Ie.test(be(F))}function R(F,Ie){return Ie=q(Ie===void 0?F.length-1:Ie,0),function(){for(var Ve=arguments,H=-1,Oe=q(Ve.length-Ie,0),Ee=Array(Oe);++H<Oe;)Ee[H]=Ve[Ie+H];H=-1;for(var it=Array(Ie+1);++H<Ie;)it[H]=Ve[H];return it[Ie]=Ee,u(F,this,it)}}function le(F){return Ae(F)?F:[]}function ee(F,Ie){var Ve=F.__data__;return te(Ie)?Ve[typeof Ie=="string"?"string":"hash"]:Ve.map}function de(F,Ie){var Ve=v(F,Ie);return J(Ve)?Ve:void 0}function te(F){var Ie=typeof F;return Ie=="string"||Ie=="number"||Ie=="symbol"||Ie=="boolean"?F!=="__proto__":F===null}function Me(F){return!!P&&P in F}function be(F){if(F!=null){try{return W.call(F)}catch{}try{return F+""}catch{}}return""}var ne=R(function(F){var Ie=f(F,le);return Ie.length&&Ie[0]===F[0]?ve(Ie):[]});function De(F,Ie){return F===Ie||F!==F&&Ie!==Ie}function xe(F){return F!=null&&me(F.length)&&!ke(F)}function Ae(F){return Le(F)&&xe(F)}function ke(F){var Ie=Se(F)?x.call(F):"";return Ie==n||Ie==i}function me(F){return typeof F=="number"&&F>-1&&F%1==0&&F<=e}function Se(F){var Ie=typeof F;return!!F&&(Ie=="object"||Ie=="function")}function Le(F){return!!F&&typeof F=="object"}return Nu=ne,Nu}var KL=XL();const Qa=rr(KL);function Ai(t,e){return e.length===0?t:t.filter(r=>e.every(a=>a.includeValues&&a.includeValues.length>0?Qa(hn([r[a.column]]),a.includeValues).length>0:!0)).filter(r=>e.every(a=>a.excludeValues&&a.excludeValues.length>0?Qa(hn([r[a.column]]),a.excludeValues).length===0:!0))}function QL(t){const{mapStyle:e,height:n,width:i,relativeHeight:r,center:a,zoomLevel:o,minHeight:s,includeLayers:c,excludeLayers:u,mapLegend:h}=t,[f,d]=k.useState(0),[g,p]=k.useState(0),[y,v]=k.useState(!0),m=k.useRef(null),I=k.useRef(null),j=k.useRef(null);return k.useEffect(()=>{const w=new ResizeObserver(S=>{d(i||S[0].target.clientWidth||620),p(n||S[0].target.clientHeight||480)});return m.current&&(p(m.current.clientHeight||480),d(m.current.clientWidth||620),i||w.observe(m.current)),()=>w.disconnect()},[i,n]),k.useEffect(()=>{I.current&&f&&!j.current&&en(e).then(w=>{bt(I.current).selectAll("div").remove();const P=new Sc.Protocol;hi.addProtocol("pmtiles",P.tile);const W={container:I.current,style:c.length===0&&u.length===0?w:{...w,layers:Ai(w.layers,[{column:"id",includeValues:c,excludeValues:u}])},attributionControl:!0};a&&(W.center=a),o&&(W.zoom=o),j.current=new hi.Map(W),j.current.addControl(new hi.NavigationControl({visualizePitch:!0,showZoom:!0,showCompass:!0}),"bottom-right"),j.current.addControl(new hi.ScaleControl,"bottom-left")})},[f,a,o,c,u,e]),k.useEffect(()=>{j.current&&en(e).then(w=>{const S={...w,layers:Ai(w.layers,[{column:"id",includeValues:c,excludeValues:u}])};j.current.setStyle(S)})},[u,c,e]),l.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:m,"aria-label":"Map area",children:(i||f)&&(n||g)?l.jsxs("div",{style:{width:i||f,height:Math.max(s,n||(r?s?(i||f)*r>s?(i||f)*r:s:(i||f)*r:g))},children:[l.jsx("div",{ref:I,className:"map maplibre-show-control",style:{width:"100%",height:"100%"}}),h?l.jsx("div",{className:"absolute left-[22px] bottom-13",children:y?l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{backgroundColor:"rgba(240,240,240, 0.7)",border:"1px solid var(--gray-400)",borderRadius:"999px",width:"24px",height:"24px",padding:"3px",cursor:"pointer",zIndex:10,position:"absolute",right:"-0.75rem",top:"-0.75rem"},onClick:()=>{v(!1)},children:l.jsx(ea,{})}),l.jsx("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)"},dangerouslySetInnerHTML:typeof h=="string"?{__html:lt(h)}:void 0,children:k.isValidElement(h)?h:null})]}):l.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{v(!0)},children:l.jsx("div",{className:"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-550 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}):null]}):null})}function ZL(t){const{mapStyle:e,height:n,width:i,relativeHeight:r,center:a,zoomLevel:o,minHeight:s,includeLayers:c,excludeLayers:u,mapLegend:h}=t,[f,d]=k.useState(0),[g,p]=k.useState(0),[y,v]=k.useState(!0),m=k.useRef(null),I=k.useRef(null);return k.useEffect(()=>{const j=new ResizeObserver(w=>{d(i||w[0].target.clientWidth||620),p(n||w[0].target.clientHeight||480)});return m.current&&(p(m.current.clientHeight||480),d(m.current.clientWidth||620),i||j.observe(m.current)),()=>j.disconnect()},[i,n]),k.useEffect(()=>{I.current&&f&&en(e).then(j=>{bt(I.current).selectAll("div").remove();const S=new Sc.Protocol;hi.addProtocol("pmtiles",S.tile);const P={container:I.current,style:c.length===0&&u.length===0?j:{...j,layers:Ai(j.layers,[{column:"id",includeValues:c,excludeValues:u}])},attributionControl:!0};a&&(P.center=a),o&&(P.zoom=o);const W=new hi.Map(P);W.addControl(new hi.NavigationControl({visualizePitch:!0,showZoom:!0,showCompass:!0}),"bottom-right"),W.addControl(new hi.ScaleControl,"bottom-left")})},[f,e,a,o,c,u]),l.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:m,"aria-label":"Map area",children:(i||f)&&(n||g)?l.jsxs("div",{style:{width:i||f,height:Math.max(s,n||(r?s?(i||f)*r>s?(i||f)*r:s:(i||f)*r:g))},children:[l.jsx("div",{ref:I,className:"map maplibre-show-control",style:{width:"100%",height:"100%"}}),h?l.jsx("div",{className:"absolute left-[22px] bottom-13",children:y?l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{backgroundColor:"rgba(240,240,240, 0.7)",border:"1px solid var(--gray-400)",borderRadius:"999px",width:"24px",height:"24px",padding:"3px",cursor:"pointer",zIndex:10,position:"absolute",right:"-0.75rem",top:"-0.75rem"},onClick:()=>{v(!1)},children:l.jsx(ea,{})}),l.jsx("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)"},dangerouslySetInnerHTML:typeof h=="string"?{__html:lt(h)}:void 0,children:k.isValidElement(h)?h:null})]}):l.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{v(!0)},children:l.jsx("div",{className:"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-550 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}):null]}):null})}function Gv(t){const{mapStyle:e,graphTitle:n,height:i,width:r,relativeHeight:a,sources:o,graphDescription:s,footNote:c,padding:u,backgroundColor:h=!1,center:f,zoomLevel:d,graphID:g,language:p="en",minHeight:y=0,theme:v="light",includeLayers:m=[],excludeLayers:I=[],ariaLabel:j,uiMode:w="normal",styles:S,classNames:P,mapLegend:W}=t,[D,x]=k.useState(typeof e=="string"?e:e[0].style);k.useEffect(()=>{x(typeof e=="string"?e:e[0].style)},[e]);const $=k.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]);return l.jsx("div",{className:`${v||"light"} flex ${r?"w-fit grow-0":"w-full grow"}`,dir:p==="he"||p==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${h?h===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${p||"en"}`,P?.graphContainer),style:{...S?.graphContainer||{},...h&&h!==!0?{backgroundColor:h}:{}},id:g,"aria-label":j||`${n?`The graph shows ${n}. `:""}This is a map.${s?` ${s}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:h?u||"1rem":u||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||s?l.jsx(Qe,{styles:{title:S?.title,description:S?.description},classNames:{title:P?.title,description:P?.description},graphTitle:n,graphDescription:s,width:r}):null,typeof e=="string"?null:l.jsx(Ce.DropdownSelect,{options:e.map(V=>({label:V.name,value:V.style})),isClearable:!1,size:"sm",variant:w,isRtl:p==="he"||p==="ar",isSearchable:!0,filterOption:Ce.createFilter($),defaultValue:{label:e[0].name,value:e[0].style},controlShouldRenderValue:!0,onChange:V=>{V&&x(V.value)}}),typeof e=="string"?l.jsx(ZL,{mapStyle:e,center:f,zoomLevel:d,width:r,height:i,relativeHeight:a,minHeight:y,includeLayers:m,excludeLayers:I,mapLegend:W}):l.jsx(QL,{mapStyle:D,center:f,zoomLevel:d,width:r,height:i,relativeHeight:a,minHeight:y,includeLayers:m,excludeLayers:I,mapLegend:(W||[]).find(V=>V.mapStyleName===e.find(q=>q.style===D)?.name)?.legend}),o||c?l.jsx(et,{styles:{footnote:S?.footnote,source:S?.source},classNames:{footnote:P?.footnote,source:P?.source},sources:o,footNote:c,width:r}):null]})})})})}function JL(t,e){let n=!1;function i(r,a){if(!n){n=!0;const o=r.getCenter(),s=r.getZoom(),c=r.getBearing(),u=r.getPitch();a.jumpTo({center:o,zoom:s,bearing:c,pitch:u}),n=!1}}t.on("move",()=>{i(t,e)}),e.on("move",()=>{i(e,t)})}function eP(t){const{height:e,width:n,mapStyles:i,center:r,zoomLevel:a,mapLegend:o}=t,[s,c]=k.useState(50),[u,h]=k.useState(!1),f=k.useRef(null),[d,g]=k.useState(!0),p=k.useRef(50),y=k.useRef(0),v=ps.useSensors(ps.useSensor(ps.PointerSensor,{activationConstraint:{distance:0}})),m=()=>{h(!0),p.current=s,f.current&&(y.current=f.current.getBoundingClientRect().width)},I=x=>{if(!f.current||y.current===0)return;const $=x.delta.x/y.current*100,V=Math.max(0,Math.min(100,p.current+$));c(V)},j=()=>{h(!1)},w=x=>{if(u||!f.current)return;const $=f.current.getBoundingClientRect(),q=(x.clientX-$.left)/$.width*100;c(Math.max(0,Math.min(100,q)))},S=k.useRef(null),P=k.useRef(null),W=k.useRef(null),D=k.useRef(null);return k.useEffect(()=>{if(D.current&&P.current&&W.current&&n){bt(D.current).selectAll(".maplibregl-compare").remove(),bt(P.current).selectAll("div").remove(),bt(W.current).selectAll("div").remove();const q=new Sc.Protocol;Oa.addProtocol("pmtiles",q.tile);const ae=new Oa.Map({container:P.current,style:i[0],center:r||[0,0],zoom:a||4}),G=new Oa.Map({container:W.current,style:i[1],center:r||[0,0],zoom:a||4});G.addControl(new Oa.NavigationControl({visualizePitch:!0,showZoom:!0,showCompass:!0}),"bottom-right"),ae.addControl(new Oa.ScaleControl,"bottom-left"),ae.addControl(new Oa.NavigationControl({visualizePitch:!0,showZoom:!0,showCompass:!0}),"bottom-right"),G.addControl(new Oa.ScaleControl,"bottom-left"),JL(ae,G)}},[n,i,r,a]),l.jsxs("div",{className:"flex flex-col grow justify-center leading-0",ref:S,"aria-label":"Map area",children:[l.jsx("div",{style:{width:n,height:e},children:l.jsx("div",{ref:D,className:"map maplibre-show-control relative w-full h-full",style:{inset:0},children:l.jsx(ps.DndContext,{sensors:v,modifiers:[Bw.restrictToHorizontalAxis],onDragStart:m,onDragMove:I,onDragEnd:j,children:l.jsxs("div",{ref:f,style:{position:"relative",width:n,height:e,overflow:"hidden",cursor:u?"grabbing":"col-resize",userSelect:"none"},onClick:w,children:[l.jsx("div",{ref:W,className:"absolute h-full rightMap w-full",style:{position:"absolute",top:0,left:0,clipPath:`polygon(${s}% 0%, ${s}% 100%, 100% 100%, 100% 0%)`}}),l.jsx("div",{ref:P,className:"absolute h-full leftMap w-full",style:{position:"absolute",top:0,left:0,inset:0,clipPath:`polygon(0% 0%, ${s}% 0%, ${s}% 100%, 0% 100%)`}}),l.jsx(tP,{position:s})]})})})}),o?l.jsx("div",{className:"absolute left-[22px] bottom-13",children:d?l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{backgroundColor:"rgba(240,240,240, 0.7)",border:"1px solid var(--gray-400)",borderRadius:"999px",width:"24px",height:"24px",padding:"3px",cursor:"pointer",zIndex:10,position:"absolute",right:"-0.75rem",top:"-0.75rem"},onClick:()=>{g(!1)},children:l.jsx(ea,{})}),l.jsx("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)"},dangerouslySetInnerHTML:typeof o=="string"?{__html:lt(o)}:void 0,children:k.isValidElement(o)?o:null})]}):l.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{g(!0)},children:l.jsx("div",{className:"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-550 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}):null]})}function tP(t){const{position:e}=t,{attributes:n,listeners:i,setNodeRef:r}=ps.useDraggable({id:"slider-handle"});return l.jsxs("div",{ref:r,style:{position:"absolute",left:`${e}%`,top:0,bottom:0,width:"40px",transform:"translateX(-50%)",cursor:"col-resize",display:"flex",justifyContent:"center",alignItems:"center",zIndex:10,touchAction:"none"},...i,...n,children:[l.jsx("div",{className:"h-full bg-primary-blue-600 dark:bg-primary-blue-400",style:{width:"2px"}}),l.jsx("div",{className:"flex bg-primary-blue-600 dark:bg-primary-blue-400 rounded-full absolute items-center justify-center text-primary-white font-primary-white",style:{boxShadow:"inset 0 0 0 1px #fff",width:"42px",height:"42px",top:"calc(50% - 21px)",left:"0",cursor:"col-resize"},children:l.jsx(t2,{})})]})}function Yv(t){const{graphTitle:e,height:n,width:i,relativeHeight:r,sources:a,graphDescription:o,footNote:s,padding:c,backgroundColor:u=!1,graphID:h,mapStyles:f,center:d=[0,0],zoomLevel:g=3,language:p="en",minHeight:y=0,theme:v="light",ariaLabel:m,styles:I,classNames:j,mapLegend:w}=t,[S,P]=k.useState(0),[W,D]=k.useState(0),x=k.useRef(null);return k.useEffect(()=>{const $=new ResizeObserver(V=>{P(i||V[0].target.clientWidth||620),D(n||V[0].target.clientHeight||480)});return x.current&&(D(x.current.clientHeight||480),P(x.current.clientWidth||620),i||$.observe(x.current)),()=>$.disconnect()},[i,n]),l.jsx("div",{className:`${v||"light"} flex ${i?"w-fit grow-0":"w-full grow"}`,dir:p==="he"||p==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${u?u===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${p||"en"}`,j?.graphContainer),style:{...I?.graphContainer||{},...u&&u!==!0?{backgroundColor:u}:{}},id:h,"aria-label":m||`${e?`The graph shows ${e}. `:""}This is a comparison between two maps.${o?` ${o}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:u?c||"1rem":c||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[e||o?l.jsx(Qe,{styles:{title:I?.title,description:I?.description},classNames:{title:j?.title,description:j?.description},graphTitle:e,graphDescription:o,width:i}):null,l.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:x,"aria-label":"map area",children:(i||S)&&(n||W)?l.jsx(eP,{width:i||S,height:Math.max(y,n||(r?y?(i||S)*r>y?(i||S)*r:y:(i||S)*r:W)),mapStyles:f,center:d,zoomLevel:g,mapLegend:w}):null}),a||s?l.jsx(et,{styles:{footnote:I?.footnote,source:I?.source},classNames:{footnote:j?.footnote,source:j?.source},sources:a,footNote:s,width:i}):null]})})})})}function nP(t){const{mapStyle:e,height:n,width:i,relativeHeight:r,center:a,zoomLevel:o,minHeight:s,selectedLayer:c,layerIdList:u,excludeLayers:h,mapLegend:f}=t,[d,g]=k.useState(0),[p,y]=k.useState(0),[v,m]=k.useState(!0),[I,j]=k.useState(void 0),w=k.useRef(null),S=k.useRef(null),P=k.useRef(null);return k.useEffect(()=>{const W=new ResizeObserver(D=>{g(i||D[0].target.clientWidth||620),y(n||D[0].target.clientHeight||480)});return w.current&&(y(w.current.clientHeight||480),g(w.current.clientWidth||620),i||W.observe(w.current)),()=>W.disconnect()},[i,n]),k.useEffect(()=>{S.current&&d&&!P.current&&en(e).then(W=>{j(W),bt(S.current).selectAll("div").remove();const x=new Sc.Protocol;hi.addProtocol("pmtiles",x.tile);const $={container:S.current,style:{...W,layers:Ai(W.layers,[{column:"id",excludeValues:[...h,...u.filter(V=>c.indexOf(V)===-1)]}])},attributionControl:!0};a&&($.center=a),o&&($.zoom=o),P.current=new hi.Map($),P.current.addControl(new hi.NavigationControl({visualizePitch:!0,showZoom:!0,showCompass:!0}),"bottom-right"),P.current.addControl(new hi.ScaleControl,"bottom-left")})},[d,a,o,u,e,h,c]),k.useEffect(()=>{if(P.current)if(I){const W={...I,layers:Ai(I.layers,[{column:"id",excludeValues:[...h,...u.filter(D=>c.indexOf(D)===-1)]}])};P.current.setStyle(W)}else en(e).then(W=>{const D={...W,layers:Ai(W.layers,[{column:"id",excludeValues:[...h,...u.filter(x=>c.indexOf(x)===-1)]}])};P.current.setStyle(D)})},[h,u,e,I,c]),l.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:w,"aria-label":"Map area",children:(i||d)&&(n||p)?l.jsxs("div",{style:{width:i||d,height:Math.max(s,n||(r?s?(i||d)*r>s?(i||d)*r:s:(i||d)*r:p))},children:[l.jsx("div",{ref:S,className:"map maplibre-show-control w-full h-full"}),f?l.jsx("div",{className:"absolute left-[22px] bottom-13",children:v?l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{backgroundColor:"rgba(240,240,240, 0.7)",border:"1px solid var(--gray-400)",borderRadius:"999px",width:"24px",height:"24px",padding:"3px",cursor:"pointer",zIndex:10,position:"absolute",right:"-0.75rem",top:"-0.75rem"},onClick:()=>{m(!1)},children:l.jsx(ea,{})}),l.jsx("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)"},dangerouslySetInnerHTML:typeof f=="string"?{__html:lt(f)}:void 0,children:k.isValidElement(f)?f:null})]}):l.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{m(!0)},children:l.jsx("div",{className:"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-550 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}):null]}):null})}function qv(t){const{mapStyle:e,graphTitle:n,height:i,width:r,relativeHeight:a,sources:o,graphDescription:s,footNote:c,padding:u,backgroundColor:h=!1,center:f,zoomLevel:d,graphID:g,language:p="en",minHeight:y=0,theme:v="light",layerSelection:m,excludeLayers:I=[],ariaLabel:j,uiMode:w="normal",styles:S,classNames:P,mapLegend:W=[]}=t,[D,x]=k.useState(m[0].layerID);k.useEffect(()=>{x(m[0].layerID)},[m]);const $=k.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]);return l.jsx("div",{className:`${v||"light"} flex ${r?"w-fit grow-0":"w-full grow"}`,dir:p==="he"||p==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${h?h===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${p||"en"}`,P?.graphContainer),style:{...S?.graphContainer||{},...h&&h!==!0?{backgroundColor:h}:{}},id:g,"aria-label":j||`${n?`The graph shows ${n}. `:""}This is a map.${s?` ${s}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:h?u||"1rem":u||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||s?l.jsx(Qe,{styles:{title:S?.title,description:S?.description},classNames:{title:P?.title,description:P?.description},graphTitle:n,graphDescription:s,width:r}):null,l.jsx(Ce.DropdownSelect,{options:m.map(V=>({label:V.name,value:V.layerID})),size:"sm",isClearable:!1,variant:w,isRtl:p==="he"||p==="ar",isSearchable:!0,filterOption:Ce.createFilter($),defaultValue:{label:m[0].name,value:m[0].layerID},controlShouldRenderValue:!0,onChange:V=>{V&&x(V.value)}}),l.jsx(nP,{mapStyle:e,center:f,zoomLevel:d,width:r,height:i,relativeHeight:a,minHeight:y,selectedLayer:D,layerIdList:hn(m.map(V=>V.layerID)),excludeLayers:I,mapLegend:W.find(V=>V.mapStyleName===m.find(q=>q.layerID===D)?.name)?.legend}),o||c?l.jsx(et,{styles:{footnote:S?.footnote,source:S?.source},classNames:{footnote:P?.footnote,source:P?.source},sources:o,footNote:c,width:r}):null]})})})})}function iP(t){const{data:e,width:n,height:i,showLabels:r,colors:a,colorDomain:o,radius:s,xAxisTitle:c,yAxisTitle:u,leftMargin:h,rightMargin:f,topMargin:d,bottomMargin:g,tooltip:p,onSeriesMouseOver:y,refXValues:v,refYValues:m,highlightAreaSettings:I,selectedColor:j,highlightedDataPoints:w,maxRadiusValue:S,maxXValue:P,minXValue:W,maxYValue:D,minYValue:x,onSeriesMouseClick:$,rtl:V,annotations:q,customHighlightAreaSettings:ae,regressionLine:G,resetSelectionOnDoubleClick:_,detailsOnClick:b,noOfXTicks:B,noOfYTicks:X,labelColor:z,xSuffix:C,ySuffix:A,xPrefix:M,yPrefix:O,styles:K,classNames:Q,animate:se,dimmedOpacity:T,precision:Z,customLayers:ie}=t,ue=k.useRef(null),he=ct(ue,{once:se.once,amount:se.amount}),[Y,ge]=k.useState(void 0),[oe,ce]=k.useState(void 0),[N,U]=k.useState(void 0),[ve,J]=k.useState(void 0),R={top:d,bottom:c?g+50:g,left:u?h+30:h,right:f},le=e.map((Se,Le)=>({...Se,id:`${Le}`})),ee=n-R.left-R.right,de=i-R.top-R.bottom,te=e.filter(Se=>Se.radius===void 0||Se.radius===null).length!==e.length?Qs().domain([0,S]).range([.25,s]).nice():void 0,Me=le.filter(Se=>!je(Se.radius)).length===0?le:Nc(le.filter(Se=>!je(Se.radius)),"radius","desc"),be=ut().domain([W,P]).range([0,ee]).nice(),ne=ut().domain([x,D]).range([de,0]).nice(),De=be.ticks(B),xe=ne.ticks(X),Ae=Lc.from(Me.filter(Se=>!je(Se.x)&&!je(Se.y)),Se=>be(Se.x),Se=>ne(Se.y)).voronoi([0,0,ee<0?0:ee,de<0?0:de]),ke=sd(e.filter(Se=>!je(Se.x)&&!je(Se.y)).map(Se=>[be(Se.x),ne(Se.y)])),me=ld(ke);return l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{width:`${n}px`,height:`${i}px`,viewBox:`0 0 ${n} ${i}`,direction:"ltr",ref:ue,children:l.jsxs("g",{transform:`translate(${R.left},${R.top})`,children:[l.jsxs(mt,{children:[l.jsx(iI,{areaSettings:I,width:ee,height:de,scaleX:be,scaleY:ne,animate:se,isInView:he}),l.jsx(lo,{areaSettings:ae,scaleX:be,scaleY:ne,animate:se,isInView:he})]}),l.jsxs("g",{children:[l.jsx(ri,{values:xe.filter(Se=>Se!==0),y:xe.filter(Se=>Se!==0).map(Se=>ne(Se)),x1:0,x2:ee+R.right,styles:{gridLines:K?.yAxis?.gridLines,labels:K?.yAxis?.labels},classNames:{gridLines:Q?.yAxis?.gridLines,labels:Q?.yAxis?.labels},suffix:A,prefix:O,labelType:"secondary",showGridLines:!0,labelPos:"side",precision:Z}),l.jsx(Dt,{y1:ne(x<0?0:x),y2:ne(x<0?0:x),x1:0,x2:ee+R.right,label:qe(x<0?0:x,"NA",Z,O,A),labelPos:{x:0,y:ne(x<0?0:x),dy:"0.33em",dx:-4},classNames:{axis:Q?.xAxis?.axis,label:Q?.yAxis?.labels},styles:{axis:K?.xAxis?.axis,label:{textAnchor:"end",...K?.yAxis?.labels||{}}}}),l.jsx(Nt,{x:0-h-15,y:de/2,style:K?.yAxis?.title,className:Q?.yAxis?.title,text:u,rotate90:!0})]}),l.jsxs("g",{children:[l.jsx(Rn,{values:De.filter(Se=>Se!==0),x:De.filter(Se=>Se!==0).map(Se=>be(Se)),y1:0,y2:de,styles:{gridLines:K?.xAxis?.gridLines,labels:K?.xAxis?.labels},classNames:{gridLines:Q?.xAxis?.gridLines,labels:Q?.xAxis?.labels},suffix:C,prefix:M,labelType:"primary",showGridLines:!0,precision:Z}),l.jsx(Dt,{x1:be(W<0?0:W),x2:be(W<0?0:W),y1:0,y2:de,label:qe(W<0?0:W,"NA",Z,M,C),labelPos:{x:be(W<0?0:W),y:de,dy:"1em",dx:0},classNames:{axis:Q?.xAxis?.axis,label:Q?.yAxis?.labels},styles:{axis:K?.xAxis?.axis,label:{textAnchor:"middle",...K?.yAxis?.labels||{}}}}),l.jsx(Nt,{x:ee/2,y:de+30,style:K?.xAxis?.title,className:Q?.xAxis?.title,text:c})]}),ie.filter(Se=>Se.position==="before").map(Se=>Se.layer),l.jsxs(mt,{children:[Me.filter(Se=>!je(Se.x)&&!je(Se.y)).map((Se,Le)=>l.jsx("path",{d:Ae.renderCell(Me.findIndex(F=>F.id===Se.id)),opacity:0,onMouseEnter:F=>{ge(Se),J(F.clientY),U(F.clientX),y?.(Se)},onMouseMove:F=>{ge(Se),J(F.clientY),U(F.clientX)},onMouseLeave:()=>{ge(void 0),U(void 0),J(void 0),y?.(void 0)},onClick:()=>{($||b)&&(dt(oe,Se)&&_?(ce(void 0),$?.(void 0)):(ce(Se),$?.(Se)))}},`${Se.label||Le}`)),Me.filter(Se=>!je(Se.x)&&!je(Se.y)).map((Se,Le)=>l.jsxs($e.g,{variants:{initial:{x:be(Se.x),y:ne(Se.y),opacity:j?Se.color&&a[o.indexOf(`${Se.color}`)]===j?1:T:Y?Y.id===Se.id?1:T:w.length!==0?w.indexOf(Se.label||"")!==-1?1:T:1},whileInView:{x:be(Se.x),y:ne(Se.y),opacity:j?Se.color&&a[o.indexOf(`${Se.color}`)]===j?1:T:Y?Y.id===Se.id?1:T:w.length!==0?w.indexOf(Se.label||"")!==-1?1:T:1,transition:{duration:se.duration}}},initial:"initial",animate:he?"whileInView":"initial",exit:{opacity:0,transition:{duration:se.duration}},onMouseEnter:F=>{ge(Se),J(F.clientY),U(F.clientX),y?.(Se)},onMouseMove:F=>{ge(Se),J(F.clientY),U(F.clientX)},onMouseLeave:()=>{ge(void 0),U(void 0),J(void 0),y?.(void 0)},onClick:()=>{($||b)&&(dt(oe,Se)&&_?(ce(void 0),$?.(void 0)):(ce(Se),$?.(Se)))},children:[l.jsx($e.circle,{cx:0,cy:0,exit:{r:0,transition:{duration:se.duration}},variants:{initial:{r:0,fill:e.filter(F=>F.color).length===0?a[0]:Se.color?a[o.indexOf(`${Se.color}`)]:Pe.gray,stroke:e.filter(F=>F.color).length===0?a[0]:Se.color?a[o.indexOf(`${Se.color}`)]:Pe.gray},whileInView:{r:te?te(Se.radius||0):s,fill:e.filter(F=>F.color).length===0?a[0]:Se.color?a[o.indexOf(`${Se.color}`)]:Pe.gray,stroke:e.filter(F=>F.color).length===0?a[0]:Se.color?a[o.indexOf(`${Se.color}`)]:Pe.gray,transition:{duration:se.duration}}},initial:"initial",animate:he?"whileInView":"initial",style:{fillOpacity:.6}}),r&&!je(Se.label)?l.jsx($e.text,{style:{...K?.graphObjectValues||{}},className:Ce.cn("graph-value text-sm",Q?.graphObjectValues),y:0,exit:{opacity:0,transition:{duration:se.duration}},variants:{initial:{x:te?te(Se.radius||0):s,opacity:0,fill:z||(e.filter(F=>F.color).length===0?a[0]:Se.color?a[o.indexOf(`${Se.color}`)]:Pe.gray)},whileInView:{x:te?te(Se.radius||0):s,opacity:1,fill:z||(e.filter(F=>F.color).length===0?a[0]:Se.color?a[o.indexOf(`${Se.color}`)]:Pe.gray),transition:{duration:se.duration}}},initial:"initial",animate:he?"whileInView":"initial",dy:"0.33em",dx:3,children:Se.label}):w.length!==0&&!je(Se.label)&&w.indexOf(Se.label)!==-1?l.jsx($e.text,{style:{fill:z||(e.filter(F=>F.color).length===0?a[0]:Se.color?a[o.indexOf(`${Se.color}`)]:Pe.gray),...K?.graphObjectValues||{}},className:Ce.cn("graph-value text-sm",Q?.graphObjectValues),y:0,exit:{opacity:0,transition:{duration:se.duration}},variants:{initial:{x:te?te(Se.radius||0):s,opacity:0},whileInView:{x:te?te(Se.radius||0):s,opacity:1,transition:{duration:se.duration}}},initial:"initial",animate:he?"whileInView":"initial",dy:"0.33em",dx:3,children:Se.label}):null]},`${Se.label||Le}`)),v.map((Se,Le)=>l.jsx(Tr,{text:Se.text,color:Se.color,x:be(Se.value),y1:0,y2:de,textSide:be(Se.value)>ee*.75||V?"left":"right",classNames:Se.classNames,styles:Se.styles,animate:se,isInView:he},Le)),m.map((Se,Le)=>l.jsx(gi,{text:Se.text,color:Se.color,y:ne(Se.value),x1:0,x2:ee,classNames:Se.classNames,styles:Se.styles,animate:se,isInView:he},Le)),l.jsx("g",{children:q.map((Se,Le)=>{const F=oo({x:Se.xCoordinate?be(Se.xCoordinate)+(Se.xOffset||0):0+(Se.xOffset||0),y:Se.yCoordinate?ne(Se.yCoordinate)+(Se.yOffset||0)-8:0+(Se.yOffset||0)-8},{x:Se.xCoordinate?be(Se.xCoordinate):0,y:Se.yCoordinate?ne(Se.yCoordinate):0},je(Se.connectorRadius)?3.5:Se.connectorRadius),Ie=Se.showConnector?{y1:F.y,x1:F.x,y2:Se.yCoordinate?ne(Se.yCoordinate)+(Se.yOffset||0):0+(Se.yOffset||0),x2:Se.xCoordinate?be(Se.xCoordinate)+(Se.xOffset||0):0+(Se.xOffset||0),cy:Se.yCoordinate?ne(Se.yCoordinate):0,cx:Se.xCoordinate?be(Se.xCoordinate):0,circleRadius:je(Se.connectorRadius)?3.5:Se.connectorRadius,strokeWidth:Se.showConnector===!0?2:Math.min(Se.showConnector||0,1)}:void 0,Ve={y:Se.yCoordinate?ne(Se.yCoordinate)+(Se.yOffset||0)-8:0+(Se.yOffset||0)-8,x:V?0:Se.xCoordinate?be(Se.xCoordinate)+(Se.xOffset||0):0+(Se.xOffset||0),width:V?Se.xCoordinate?be(Se.xCoordinate)+(Se.xOffset||0):0+(Se.xOffset||0):ee-(Se.xCoordinate?be(Se.xCoordinate)+(Se.xOffset||0):0+(Se.xOffset||0)),maxWidth:Se.maxWidth,fontWeight:Se.fontWeight,align:Se.align};return l.jsx(so,{color:Se.color,connectorsSettings:Ie,labelSettings:Ve,text:Se.text,classNames:Se.classNames,styles:Se.styles,animate:se,isInView:he},Le)})}),G?l.jsx(cd,{x1:0,x2:ee,y1:me(0),y2:me(ee),graphHeight:de,graphWidth:ee,className:Q?.regLine,style:K?.regLine,color:typeof G=="string"?G:void 0,animate:se,isInView:he}):null]}),ie.filter(Se=>Se.position==="after").map(Se=>Se.layer)]})}),Y&&p&&N&&ve?l.jsx(st,{data:Y,body:p,xPos:N,yPos:ve,backgroundStyle:K?.tooltip,className:Q?.tooltip}):null,b&&oe!==void 0?l.jsx(Ce.Modal,{open:oe!==void 0,onClose:()=>{ce(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof b=="string"?{__html:lt(b,oe)}:void 0,children:typeof b=="function"?b(oe):null})}):null]})}function Uv(t){const{data:e,graphTitle:n,colors:i,sources:r,graphDescription:a,showLabels:o=!1,height:s,width:c,footNote:u,colorDomain:h,colorLegendTitle:f,radius:d=5,xAxisTitle:g="X Axis",yAxisTitle:p="Y Axis",padding:y,backgroundColor:v=!1,leftMargin:m=0,rightMargin:I=10,topMargin:j=20,bottomMargin:w=50,tooltip:S,relativeHeight:P,onSeriesMouseOver:W,refXValues:D=[],refYValues:x=[],highlightAreaSettings:$=[],showColorScale:V=!0,highlightedDataPoints:q=[],graphID:ae,maxRadiusValue:G,maxXValue:_,minXValue:b,maxYValue:B,minYValue:X,xSuffix:z="",ySuffix:C="",xPrefix:A="",yPrefix:M="",onSeriesMouseClick:O,graphDownload:K=!1,dataDownload:Q=!1,language:se="en",showNAColor:T=!0,minHeight:Z=0,annotations:ie=[],customHighlightAreaSettings:ue=[],theme:he="light",regressionLine:Y=!1,ariaLabel:ge,resetSelectionOnDoubleClick:oe=!0,detailsOnClick:ce,noOfXTicks:N=5,noOfYTicks:U=5,labelColor:ve,styles:J,classNames:R,animate:le=!1,dimmedOpacity:ee=.3,precision:de=2,customLayers:te=[],timeline:Me={enabled:!1,autoplay:!1,showOnlyActiveDate:!0}}=t,[be,ne]=k.useState(0),[De,xe]=k.useState(0),[Ae,ke]=k.useState(Me.autoplay),me=di(Xe(e.filter(Ee=>Ee.date!==void 0&&Ee.date!==null),Ee=>Ee.date).map(Ee=>ze(`${Ee.date}`,Me.dateFormat||"yyyy",new Date).getTime()),(Ee,it)=>an(Ee,it)),[Se,Le]=k.useState(Me.autoplay?0:me.length-1),[F,Ie]=k.useState(void 0),Ve=k.useRef(null),H=k.useRef(null);k.useEffect(()=>{const Ee=new ResizeObserver(it=>{ne(c||it[0].target.clientWidth||620),xe(s||it[0].target.clientHeight||480)});return Ve.current&&(xe(Ve.current.clientHeight||480),ne(Ve.current.clientWidth||620),c||Ee.observe(Ve.current)),()=>Ee.disconnect()},[c,s]),k.useEffect(()=>{const Ee=setInterval(()=>{Le(it=>it<me.length-1?it+1:0)},(Me.speed||2)*1e3);return Ae||clearInterval(Ee),()=>clearInterval(Ee)},[me,Ae,Me.speed]);const Oe=yi(me,Se,Me.showOnlyActiveDate,Me.dateFormat||"yyyy");return l.jsx("div",{className:`${he||"light"} flex ${c?"w-fit grow-0":"w-full grow"}`,dir:se==="he"||se==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${v?v===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${se||"en"}`,R?.graphContainer),style:{...J?.graphContainer||{},...v&&v!==!0?{backgroundColor:v}:{}},id:ae,ref:H,"aria-label":ge||`${n?`The graph shows ${n}. `:""}This is a scatter plot that shows correlation between two variables.${a?` ${a}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:v?y||"1rem":y||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||a||K||Q?l.jsx(Qe,{styles:{title:J?.title,description:J?.description},classNames:{title:R?.title,description:R?.description},graphTitle:n,graphDescription:a,width:c,graphDownload:K?H.current:void 0,dataDownload:Q?e.map(Ee=>Ee.data).filter(Ee=>Ee!==void 0).length>0?e.map(Ee=>Ee.data).filter(Ee=>Ee!==void 0):e.filter(Ee=>Ee!==void 0):null}):null,Me.enabled&&me.length>0&&Oe?l.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[l.jsx("button",{type:"button",onClick:()=>{ke(!Ae)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":Ae?"Click to pause animation":"Click to play animation",children:Ae?l.jsx(mi,{}):l.jsx(pi,{})}),l.jsx(Ce.SliderUI,{min:me[0],max:me[me.length-1],marks:Oe,step:null,defaultValue:me[me.length-1],value:me[Se],onChangeComplete:Ee=>{Le(me.indexOf(Ee))},onChange:Ee=>{Le(me.indexOf(Ee))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[V&&e.filter(Ee=>Ee.color).length!==0?l.jsx(tn,{width:c,colorLegendTitle:f,colors:i||Pe[he].categoricalColors.colors,colorDomain:h||Xe(e.filter(Ee=>Ee.color),"color").map(Ee=>Ee.color),setSelectedColor:Ie,showNAColor:T}):null,l.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:Ve,"aria-label":"Graph area",children:(c||be)&&(s||De)?l.jsx(iP,{data:Z2(e,Me.dateFormat||"yyyy").filter(Ee=>Me.enabled?Ee.date===ft(new Date(me[Se]),Me.dateFormat||"yyyy"):Ee),width:c||be,height:Math.max(Z,s||(P?Z?(c||be)*P>Z?(c||be)*P:Z:(c||be)*P:De)),colorDomain:e.filter(Ee=>Ee.color).length===0?[]:h||Xe(e.filter(Ee=>Ee.color),"color").map(Ee=>Ee.color),colors:e.filter(Ee=>Ee.color).length===0?i?[i]:[Pe.primaryColors["blue-600"]]:i||Pe[he].categoricalColors.colors,xAxisTitle:g,yAxisTitle:p,refXValues:D,refYValues:x,showLabels:o,radius:d,leftMargin:m,rightMargin:I,topMargin:j,bottomMargin:w,tooltip:S,onSeriesMouseOver:W,highlightAreaSettings:$,highlightedDataPoints:e.filter(Ee=>Ee.label).length===0?[]:q,selectedColor:F,maxRadiusValue:je(G)?Math.max(...e.map(Ee=>Ee.radius).filter(Ee=>Ee!=null)):G,maxXValue:je(_)?Math.max(...e.map(Ee=>Ee.x).filter(Ee=>Ee!=null))>0?Math.max(...e.map(Ee=>Ee.x).filter(Ee=>Ee!=null)):0:_,minXValue:je(b)?Math.min(...e.map(Ee=>Ee.x).filter(Ee=>Ee!=null))>0?0:Math.min(...e.map(Ee=>Ee.x).filter(Ee=>Ee!=null)):b,maxYValue:je(B)?Math.max(...e.map(Ee=>Ee.y).filter(Ee=>Ee!=null))>0?Math.max(...e.map(Ee=>Ee.y).filter(Ee=>Ee!=null)):0:B,minYValue:je(X)?Math.min(...e.map(Ee=>Ee.y).filter(Ee=>Ee!=null))>0?0:Math.min(...e.map(Ee=>Ee.y).filter(Ee=>Ee!=null)):X,onSeriesMouseClick:O,rtl:se==="he"||se==="ar",annotations:ie,customHighlightAreaSettings:ue,regressionLine:Y,resetSelectionOnDoubleClick:oe,detailsOnClick:ce,noOfXTicks:N,noOfYTicks:U,labelColor:ve,xSuffix:z,ySuffix:C,xPrefix:A,yPrefix:M,styles:J,classNames:R,animate:le===!0?{duration:.5,once:!0,amount:.5}:le||{duration:0,once:!0,amount:0},dimmedOpacity:ee,precision:de,customLayers:te}):null})]})}),r||u?l.jsx(et,{styles:{footnote:J?.footnote,source:J?.source},classNames:{footnote:R?.footnote,source:R?.source},sources:r,footNote:u,width:c}):null]})})})})}function rP(t){const{data:e,width:n,height:i,showLabels:r,colors:a,colorDomain:o,radius:s,leftMargin:c,rightMargin:u,topMargin:h,bottomMargin:f,tooltip:d,onSeriesMouseOver:g,axisTitles:p,highlightedDataPoints:y,selectedColor:v,minValue:m,maxValue:I,onSeriesMouseClick:j,resetSelectionOnDoubleClick:w,detailsOnClick:S,styles:P,classNames:W,animate:D,dimmedOpacity:x,customLayers:$}=t,V=k.useRef(null),q=ct(V,{once:D.once,amount:D.amount}),[ae,G]=k.useState(void 0),[_,b]=k.useState(void 0),[B,X]=k.useState(void 0),[z,C]=k.useState(void 0),A={top:h,bottom:f,left:c,right:u},M=n-A.left-A.right,O=i-A.top-A.bottom,K=Math.min(Math.min(...e.map(T=>T.y1)),Math.min(...e.map(T=>T.y2))),Q=Math.max(Math.max(...e.map(T=>T.y1)),Math.max(...e.map(T=>T.y2))),se=ut().domain([je(m)?K>0?0:K:m,je(I)?Q>0?Q:0:I]).range([O,0]).nice();return l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{width:`${n}px`,height:`${i}px`,viewBox:`0 0 ${n} ${i}`,className:"mx-auto",direction:"ltr",ref:V,children:l.jsxs("g",{transform:`translate(${A.left},${A.top})`,children:[l.jsxs("g",{children:[l.jsx(Dt,{y1:0,y2:O,x1:s,x2:s,classNames:{axis:Ce.cn("stroke-1 stroke-primary-gray-500 dark:stroke-primary-gray-550",W?.yAxis?.axis)}}),l.jsx(Nt,{x:s,y:O+15,style:P?.yAxis?.title,className:Ce.cn("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",W?.yAxis?.title),text:p[0]})]}),l.jsxs("g",{children:[l.jsx(Dt,{y1:0,y2:O,x1:M-s,x2:M-s,classNames:{axis:Ce.cn("stroke-1 stroke-primary-gray-500 dark:stroke-primary-gray-550",W?.yAxis?.axis)}}),l.jsx(Nt,{x:M-s,y:O+15,style:P?.yAxis?.title,className:Ce.cn("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",W?.yAxis?.title),text:p[1]})]}),$.filter(T=>T.position==="before").map(T=>T.layer),l.jsx(mt,{children:e.map((T,Z)=>l.jsxs($e.g,{variants:{initial:{opacity:v?T.color&&a[o.indexOf(`${T.color}`)]===v?1:x:ae?ae.label===T.label?1:x:y.length!==0?y.indexOf(T.label)!==-1?1:x:1},whileInView:{opacity:v?T.color&&a[o.indexOf(`${T.color}`)]===v?1:x:ae?ae.label===T.label?1:x:y.length!==0?y.indexOf(T.label)!==-1?1:x:1,transition:{duration:D.duration}}},initial:"initial",animate:q?"whileInView":"initial",exit:{opacity:0,transition:{duration:D.duration}},onMouseEnter:ie=>{G(T),C(ie.clientY),X(ie.clientX),g?.(T)},onMouseMove:ie=>{G(T),C(ie.clientY),X(ie.clientX)},onMouseLeave:()=>{G(void 0),X(void 0),C(void 0),g?.(void 0)},onClick:()=>{(j||S)&&(dt(_,T)&&w?(b(void 0),j?.(void 0)):(b(T),j?.(T)))},children:[l.jsx($e.circle,{cx:s,variants:{initial:{cy:se(T.y1),fill:e.filter(ie=>ie.color).length===0?a[0]:T.color?a[o.indexOf(`${T.color}`)]:Pe.gray,stroke:e.filter(ie=>ie.color).length===0?a[0]:T.color?a[o.indexOf(`${T.color}`)]:Pe.gray,opacity:0},whileInView:{cy:se(T.y1),fill:e.filter(ie=>ie.color).length===0?a[0]:T.color?a[o.indexOf(`${T.color}`)]:Pe.gray,stroke:e.filter(ie=>ie.color).length===0?a[0]:T.color?a[o.indexOf(`${T.color}`)]:Pe.gray,opacity:1,transition:{duration:D.duration}}},initial:"initial",animate:q?"whileInView":"initial",exit:{opacity:0,transition:{duration:D.duration}},r:s,style:{fillOpacity:.6}}),r?l.jsx($e.text,{variants:{initial:{y:se(T.y1),fill:e.filter(ie=>ie.color).length===0?a[0]:T.color?a[o.indexOf(`${T.color}`)]:Pe.gray,opacity:0},whileInView:{y:se(T.y1),fill:e.filter(ie=>ie.color).length===0?a[0]:T.color?a[o.indexOf(`${T.color}`)]:Pe.gray,opacity:1,transition:{duration:D.duration}}},initial:"initial",animate:q?"whileInView":"initial",exit:{opacity:0,transition:{duration:D.duration}},style:{textAnchor:"end",...P?.yAxis?.labels||{}},className:Ce.cn("text-xs",W?.yAxis?.labels),x:5,dy:"0.33em",textAnchor:"end",dx:0-s-3,children:T.label}):y.length!==0&&y.indexOf(T.label)!==-1?l.jsx($e.text,{variants:{initial:{y:se(T.y1),fill:e.filter(ie=>ie.color).length===0?a[0]:T.color?a[o.indexOf(`${T.color}`)]:Pe.gray,opacity:0},whileInView:{y:se(T.y1),fill:e.filter(ie=>ie.color).length===0?a[0]:T.color?a[o.indexOf(`${T.color}`)]:Pe.gray,opacity:1,transition:{duration:D.duration}}},initial:"initial",animate:q?"whileInView":"initial",exit:{opacity:0,transition:{duration:D.duration}},style:{textAnchor:"end",...P?.yAxis?.labels||{}},className:Ce.cn("text-xs",W?.yAxis?.labels),x:5,dy:"0.33em",dx:-3,children:T.label}):null,l.jsx($e.circle,{cx:M-s,variants:{initial:{cy:se(T.y2),fill:e.filter(ie=>ie.color).length===0?a[0]:T.color?a[o.indexOf(`${T.color}`)]:Pe.gray,stroke:e.filter(ie=>ie.color).length===0?a[0]:T.color?a[o.indexOf(`${T.color}`)]:Pe.gray,opacity:0},whileInView:{cy:se(T.y2),fill:e.filter(ie=>ie.color).length===0?a[0]:T.color?a[o.indexOf(`${T.color}`)]:Pe.gray,stroke:e.filter(ie=>ie.color).length===0?a[0]:T.color?a[o.indexOf(`${T.color}`)]:Pe.gray,opacity:1,transition:{duration:D.duration}}},initial:"initial",animate:q?"whileInView":"initial",exit:{opacity:0,transition:{duration:D.duration}},r:s,style:{fillOpacity:.6}}),r?l.jsx($e.text,{variants:{initial:{y:se(T.y2),fill:e.filter(ie=>ie.color).length===0?a[0]:T.color?a[o.indexOf(`${T.color}`)]:Pe.gray,opacity:0},whileInView:{y:se(T.y2),fill:e.filter(ie=>ie.color).length===0?a[0]:T.color?a[o.indexOf(`${T.color}`)]:Pe.gray,opacity:1,transition:{duration:D.duration}}},initial:"initial",animate:q?"whileInView":"initial",exit:{opacity:0,transition:{duration:D.duration}},style:{textAnchor:"start",...P?.yAxis?.labels||{}},className:Ce.cn("text-xs",W?.yAxis?.labels),x:M-5,dy:"0.33em",dx:s+3,children:T.label}):y.length!==0&&y.indexOf(T.label)!==-1?l.jsx($e.text,{variants:{initial:{y:se(T.y2),fill:e.filter(ie=>ie.color).length===0?a[0]:T.color?a[o.indexOf(`${T.color}`)]:Pe.gray,opacity:0},whileInView:{y:se(T.y2),fill:e.filter(ie=>ie.color).length===0?a[0]:T.color?a[o.indexOf(`${T.color}`)]:Pe.gray,opacity:1,transition:{duration:D.duration}}},initial:"initial",animate:q?"whileInView":"initial",exit:{opacity:0,transition:{duration:D.duration}},style:{textAnchor:"start",...P?.yAxis?.labels||{}},className:Ce.cn("text-xs",W?.yAxis?.labels),x:M-5,dy:"0.33em",dx:3,children:T.label}):null,l.jsx($e.line,{x1:s,x2:M-s,variants:{initial:{y1:se(T.y1),y2:se(T.y1),stroke:e.filter(ie=>ie.color).length===0?a[0]:T.color?a[o.indexOf(`${T.color}`)]:Pe.gray},whileInView:{y1:se(T.y1),y2:se(T.y2),stroke:e.filter(ie=>ie.color).length===0?a[0]:T.color?a[o.indexOf(`${T.color}`)]:Pe.gray,transition:{duration:D.duration}}},initial:"initial",animate:q?"whileInView":"initial",exit:{opacity:0,transition:{duration:D.duration}},className:W?.dataConnectors,style:{fill:"none",strokeWidth:1,...P?.dataConnectors}})]},Z))}),$.filter(T=>T.position==="after").map(T=>T.layer)]})}),ae&&d&&B&&z?l.jsx(st,{data:ae,body:d,xPos:B,yPos:z,backgroundStyle:P?.tooltip,className:W?.tooltip}):null,S&&_!==void 0?l.jsx(Ce.Modal,{open:_!==void 0,onClose:()=>{b(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof S=="string"?{__html:lt(S,_)}:void 0,children:typeof S=="function"?S(_):null})}):null]})}function Xv(t){const{data:e,graphTitle:n,colors:i,sources:r,graphDescription:a,showLabels:o=!1,height:s,width:c,footNote:u,colorDomain:h,colorLegendTitle:f,radius:d=5,axisTitles:g=["",""],padding:p,backgroundColor:y=!1,leftMargin:v=50,rightMargin:m=50,topMargin:I=20,bottomMargin:j=20,tooltip:w,relativeHeight:S,onSeriesMouseOver:P,showColorScale:W=!0,highlightedDataPoints:D=[],graphID:x,minValue:$,maxValue:V,onSeriesMouseClick:q,graphDownload:ae=!1,dataDownload:G=!1,fillContainer:_=!0,language:b="en",showNAColor:B=!0,minHeight:X=0,theme:z="light",ariaLabel:C,resetSelectionOnDoubleClick:A=!0,detailsOnClick:M,styles:O,classNames:K,animate:Q=!1,dimmedOpacity:se=.3,customLayers:T=[]}=t,[Z,ie]=k.useState(0),[ue,he]=k.useState(0),[Y,ge]=k.useState(void 0),oe=k.useRef(null),ce=k.useRef(null);return k.useEffect(()=>{const N=new ResizeObserver(U=>{ie(c||U[0].target.clientWidth||620),he(s||U[0].target.clientHeight||480)});return oe.current&&(he(oe.current.clientHeight||480),ie(oe.current.clientWidth||620),c||N.observe(oe.current)),()=>N.disconnect()},[c,s]),l.jsx("div",{className:`${z||"light"} flex ${c?"grow-0":"grow"} ${_?"w-full":"w-fit"} `,dir:b==="he"||b==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${y?y===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${b||"en"}`,K?.graphContainer),style:{...O?.graphContainer||{},...y&&y!==!0?{backgroundColor:y}:{}},id:x,ref:ce,"aria-label":C||`${n?`The graph shows ${n}. `:""}This is a slope chart showing changes in data between two category or starting and ending time. Each line represents a different row in data, with lines sloping up or down to show increase or decrease over two categories or time.${a?` ${a}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:y?p||"1rem":p||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||a||ae||G?l.jsx(Qe,{styles:{title:O?.title,description:O?.description},classNames:{title:K?.title,description:K?.description},graphTitle:n,graphDescription:a,width:c,graphDownload:ae?ce.current:void 0,dataDownload:G?e.map(N=>N.data).filter(N=>N!==void 0).length>0?e.map(N=>N.data).filter(N=>N!==void 0):e.filter(N=>N!==void 0):null}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[W&&e.filter(N=>N.color).length!==0?l.jsx(tn,{width:c,colorLegendTitle:f,colors:i||Pe[z].categoricalColors.colors,colorDomain:h||Xe(e.filter(N=>N.color),"color").map(N=>N.color),setSelectedColor:ge,showNAColor:B}):null,l.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:oe,"aria-label":"Graph area",children:(c||Z)&&(s||ue)?l.jsx(rP,{data:e.filter(N=>!je(N.y1)&&!je(N.y2)),width:c||Z,height:Math.max(X,s||(S?X?(c||Z)*S>X?(c||Z)*S:X:(c||Z)*S:ue)),colorDomain:e.filter(N=>N.color).length===0?[]:h||Xe(e.filter(N=>N.color),"color").map(N=>N.color),colors:e.filter(N=>N.color).length===0?i?[i]:[Pe.primaryColors["blue-600"]]:i||Pe[z].categoricalColors.colors,selectedColor:Y,axisTitles:g,showLabels:o,radius:d,leftMargin:v,rightMargin:m,topMargin:I,bottomMargin:j,tooltip:w,onSeriesMouseOver:P,highlightedDataPoints:D,minValue:$,maxValue:V,onSeriesMouseClick:q,resetSelectionOnDoubleClick:A,detailsOnClick:M,styles:O,classNames:K,animate:Q===!0?{duration:.5,once:!0,amount:.5}:Q||{duration:0,once:!0,amount:0},dimmedOpacity:se,customLayers:T}):null})]})}),r||u?l.jsx(et,{styles:{footnote:O?.footnote,source:O?.source},classNames:{footnote:K?.footnote,source:K?.source},sources:r,footNote:u,width:c}):null]})})})})}function aP(t){const{data:e,barColor:n,suffix:i,prefix:r,barPadding:a,showValues:o,showTicks:s,leftMargin:c,truncateBy:u,width:h,height:f,rightMargin:d,topMargin:g,bottomMargin:p,showLabels:y,tooltip:v,onSeriesMouseOver:m,refValues:I,highlightedDataPoints:j,maxValue:w,minValue:S,onSeriesMouseClick:P,labelOrder:W,rtl:D,maxBarThickness:x,minBarThickness:$,resetSelectionOnDoubleClick:V,detailsOnClick:q,barAxisTitle:ae,valueColor:G,noOfTicks:_,styles:b,classNames:B,targetStyle:X,targetColor:z,qualitativeRangeColors:C,measureBarWidthFactor:A,animate:M,dimmedOpacity:O,precision:K,customLayers:Q,naLabel:se}=t,T=k.useRef(null),Z=ct(T,{once:M.once,amount:M.amount}),[ie,ue]=k.useState(void 0),[he,Y]=k.useState(void 0),[ge,oe]=k.useState(void 0),[ce,N]=k.useState(void 0),U={top:ae?g+25:g,bottom:p,left:c,right:d},ve=h-U.left-U.right,J=f-U.top-U.bottom,R=Math.max(...e.filter(me=>!je(me.size)).map(me=>me.size))<0?0:Math.max(...e.filter(me=>!je(me.size)).map(me=>me.size)),le=Math.max(...e.filter(me=>!je(me.target)).map(me=>me.target))<0?0:Math.max(...e.filter(me=>!je(me.target)).map(me=>me.target)),ee=Math.max(...e.map(me=>rt((me.qualitativeRange||[]).filter(Se=>!je(Se)))||0)),de=je(w)?Math.max(...[R,le,ee].filter(Number.isFinite))<0?0:Math.max(...[R,le,ee].filter(Number.isFinite)):w,te=Math.min(...e.filter(me=>!je(me.size)).map(me=>me.size))>=0?0:Math.min(...e.filter(me=>!je(me.size)).map(me=>me.size)),Me=Math.min(...e.filter(me=>!je(me.target)).map(me=>me.target))>=0?0:Math.min(...e.filter(me=>!je(me.target)).map(me=>me.target)),be=je(S)?Math.min(...[te,Me].filter(Number.isFinite))>=0?0:Math.min(...[te,Me].filter(Number.isFinite)):S,ne=e.map((me,Se)=>({...me,id:W?`${me.label}`:`${Se}`})),De=ut().domain([be,de]).range([0,ve]).nice(),xe=W||ne.map(me=>`${me.id}`),Ae=xn().domain(xe).range([0,$?Math.max(J,$*xe.length):x?Math.min(J,x*xe.length):J]).paddingInner(a),ke=De.ticks(_);return l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{width:`${h}px`,height:`${f}px`,viewBox:`0 0 ${h} ${f}`,direction:"ltr",ref:T,children:l.jsxs("g",{transform:`translate(${U.left},${U.top})`,children:[s?l.jsx(Rn,{values:ke.filter(me=>me!==0),x:ke.filter(me=>me!==0).map(me=>De(me)),y1:0-g,y2:J+U.bottom,styles:{gridLines:b?.xAxis?.gridLines,labels:b?.xAxis?.labels},classNames:{gridLines:B?.xAxis?.gridLines,labels:B?.xAxis?.labels},suffix:i,prefix:r,labelType:"secondary",showGridLines:!0,precision:K}):null,l.jsx(Nt,{x:ve/2,y:0-U.top+15,style:b?.xAxis?.title,className:B?.xAxis?.title,text:ae}),l.jsx(Dt,{x1:De(be<0?0:be),x2:De(be<0?0:be),y1:-2.5,y2:J+U.bottom,classNames:{axis:B?.yAxis?.axis},styles:{axis:b?.yAxis?.axis}}),Q.filter(me=>me.position==="before").map(me=>me.layer),l.jsxs(mt,{children:[ne.map(me=>je(Ae(me.id))?null:l.jsxs($e.g,{className:"undp-viz-g-with-hover",onMouseEnter:Se=>{ue(me),N(Se.clientY),oe(Se.clientX),m?.(me)},onClick:()=>{(P||q)&&(dt(he,me)&&V?(Y(void 0),P?.(void 0)):(Y(me),P?.(me)))},onMouseMove:Se=>{ue(me),N(Se.clientY),oe(Se.clientX)},onMouseLeave:()=>{ue(void 0),oe(void 0),N(void 0),m?.(void 0)},exit:{opacity:0,transition:{duration:M.duration}},variants:{initial:{x:0,y:Ae(`${me.id}`),opacity:j.length!==0?j.indexOf(me.label)!==-1?.85:O:.85},whileInView:{x:0,y:Ae(`${me.id}`),opacity:j.length!==0?j.indexOf(me.label)!==-1?.85:O:.85,transition:{duration:M.duration}}},initial:"initial",animate:Z?"whileInView":"initial",children:[me.qualitativeRange?me.qualitativeRange.map((Se,Le)=>l.jsx($e.rect,{exit:{width:0,x:De(0),transition:{duration:M.duration}},variants:{initial:{x:De(0),width:0,fill:C[Le]},whileInView:{x:De(Le===0?0:rt(me.qualitativeRange.filter((F,Ie)=>Ie<Le&&F))),width:De(Se),fill:C[Le],transition:{duration:M.duration}}},initial:"initial",animate:Z?"whileInView":"initial",y:0,height:Ae.bandwidth()},Le)):null,me.target&&X==="background"?l.jsx($e.rect,{y:0,x:me.target>=0?De(0):De(me.target),height:Ae.bandwidth(),style:{fill:z},exit:{width:0,x:De(0),transition:{duration:M.duration}},variants:{initial:{x:De(0),width:0},whileInView:{x:me.target>=0?De(0):De(me.target),width:me.target>=0?De(me.target)-De(0):De(0)-De(me.target),transition:{duration:M.duration}}},initial:"initial",animate:Z?"whileInView":"initial"}):null,me.size?l.jsx($e.rect,{y:Ae.bandwidth()*((1-A)/2),style:{fill:n},height:Ae.bandwidth()*A,exit:{width:0,x:De(0),transition:{duration:M.duration}},variants:{initial:{x:De(0),width:0},whileInView:{x:me.size>=0?De(0):De(me.size),width:me.size>=0?De(me.size)-De(0):De(0)-De(me.size),transition:{duration:M.duration}}},initial:"initial",animate:Z?"whileInView":"initial"}):null,me.target&&X==="line"?l.jsx($e.rect,{y:0,height:Ae.bandwidth(),style:{fill:z},width:2,exit:{opacity:0,x:De(0),transition:{duration:M.duration}},variants:{initial:{x:De(0),opacity:0},whileInView:{x:De(me.target)-1,opacity:1,transition:{duration:M.duration}}},initial:"initial",animate:Z?"whileInView":"initial"}):null,y?l.jsx(io,{value:`${me.label}`.length<u?`${me.label}`:`${`${me.label}`.substring(0,u)}...`,y:0,x:(me.size||0)<0?De(0):0-U.left,width:(me.size||0)<0?h-De(0):De(0)+U.left,height:Ae.bandwidth(),alignment:me.size&&me.size<0?"left":"right",style:b?.yAxis?.labels,className:B?.yAxis?.labels,animate:M,isInView:Z}):null,o?l.jsx($e.text,{y:Ae.bandwidth()/2,style:{...G?{fill:G}:{fill:n},textAnchor:me.size&&me.size<0?"end":"start",...b?.graphObjectValues||{}},className:Ce.cn("graph-value text-sm",!G&&n.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",B?.graphObjectValues),dx:me.size&&me.size<0?-5:5,dy:"0.33em",exit:{opacity:0,transition:{duration:M.duration}},variants:{initial:{x:De(0),opacity:0},whileInView:{x:me.size?De(me.size):De(0),opacity:1,transition:{duration:M.duration}}},initial:"initial",animate:Z?"whileInView":"initial",children:qe(me.size,se,K,r,i)}):null]},me.label)),I?l.jsx(l.Fragment,{children:I.map((me,Se)=>l.jsx(Tr,{text:me.text,color:me.color,x:De(me.value),y1:0-U.top,y2:J+U.bottom,textSide:De(me.value)>ve*.75||D?"left":"right",classNames:me.classNames,styles:me.styles,animate:M,isInView:Z},Se))}):null]}),Q.filter(me=>me.position==="after").map(me=>me.layer)]})}),ie&&v&&ge&&ce?l.jsx(st,{data:ie,body:v,xPos:ge,yPos:ce,backgroundStyle:b?.tooltip,className:B?.tooltip}):null,q&&he!==void 0?l.jsx(Ce.Modal,{open:he!==void 0,onClose:()=>{Y(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof q=="string"?{__html:lt(q,he)}:void 0,children:typeof q=="function"?q(he):null})}):null]})}function oP(t){const{data:e,graphTitle:n,barColor:i=Pe.primaryColors["blue-600"],suffix:r="",sources:a,prefix:o="",graphDescription:s,barPadding:c=.25,showValues:u=!0,showTicks:h=!0,leftMargin:f=100,rightMargin:d=40,truncateBy:g=999,height:p,width:y,footNote:v,colorDomain:m,colorLegendTitle:I,highlightedDataPoints:j=[],padding:w,backgroundColor:S=!1,topMargin:P=25,bottomMargin:W=10,showLabels:D=!0,relativeHeight:x,tooltip:$,onSeriesMouseOver:V,refValues:q,showColorScale:ae=!0,graphID:G,maxValue:_,minValue:b,onSeriesMouseClick:B,graphDownload:X=!1,dataDownload:z=!1,sortData:C,labelOrder:A,language:M="en",minHeight:O=0,theme:K="light",maxBarThickness:Q,maxNumberOfBars:se,minBarThickness:T,ariaLabel:Z,resetSelectionOnDoubleClick:ie=!0,detailsOnClick:ue,barAxisTitle:he,noOfTicks:Y=5,valueColor:ge,styles:oe,classNames:ce,filterNA:N=!0,targetStyle:U="line",targetColor:ve=Pe.light.grays["gray-700"],qualitativeRangeColors:J,measureBarWidthFactor:R=.4,animate:le=!1,dimmedOpacity:ee=.3,precision:de=2,customLayers:te=[],naLabel:Me="NA"}=t,[be,ne]=k.useState(0),[De,xe]=k.useState(0),Ae=k.useRef(null),ke=k.useRef(null);return k.useEffect(()=>{const me=new ResizeObserver(Se=>{ne(y||Se[0].target.clientWidth||620),xe(p||Se[0].target.clientHeight||480)});return Ae.current&&(xe(Ae.current.clientHeight||480),ne(Ae.current.clientWidth||620),y||me.observe(Ae.current)),()=>me.disconnect()},[y,p]),l.jsx("div",{className:`${K||"light"} flex ${y?"w-fit grow-0":"w-full grow"}`,dir:M==="he"||M==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${S?S===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${M||"en"}`,ce?.graphContainer),style:{...oe?.graphContainer||{},...S&&S!==!0?{backgroundColor:S}:{}},id:G,ref:ke,"aria-label":Z||`${n?`The graph shows ${n}. `:""}This is a bar chart. ${s?` ${s}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:S?w||"1rem":w||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||s||X||z?l.jsx(Qe,{styles:{title:oe?.title,description:oe?.description},classNames:{title:ce?.title,description:ce?.description},graphTitle:n,graphDescription:s,width:y,graphDownload:X?ke.current:void 0,dataDownload:z?e.map(me=>me.data).filter(me=>me!==void 0).length>0?e.map(me=>me.data).filter(me=>me!==void 0):e.filter(me=>me!==void 0):null}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[ae&&e.filter(me=>me.qualitativeRange).length!==0&&m?l.jsx(Hi,{width:y,colorLegendTitle:I,colors:J||Pe[K].sequentialColors.positiveColorsx10,colorDomain:m,showNAColor:!1}):null,l.jsx("div",{className:"flex grow flex-col justify-center w-full leading-0",ref:Ae,"aria-label":"Graph area",children:(y||be)&&(p||De)?l.jsx(aP,{data:C==="asc"?tt(e.filter(me=>N?!je(me.size):me),me=>me.size).filter((me,Se)=>se?Se<se:!0):C==="desc"?tt(e.filter(me=>N?!je(me.size):me),me=>me.size).reverse().filter((me,Se)=>se?Se<se:!0):e.filter(me=>N?!je(me.size):me).filter((me,Se)=>se?Se<se:!0),barColor:i,targetColor:ve,width:y||be,height:Math.max(O,p||(x?O?(y||be)*x>O?(y||be)*x:O:(y||be)*x:De)),suffix:r,prefix:o,barPadding:c,showValues:u,showTicks:h,leftMargin:f,rightMargin:d,topMargin:P,bottomMargin:W,truncateBy:g,showLabels:D,tooltip:$,onSeriesMouseOver:V,refValues:q,maxValue:_,minValue:b,highlightedDataPoints:j,onSeriesMouseClick:B,labelOrder:A,rtl:M==="he"||M==="ar",maxBarThickness:Q,minBarThickness:T,resetSelectionOnDoubleClick:ie,detailsOnClick:ue,barAxisTitle:he,noOfTicks:Y,valueColor:ge,classNames:ce,styles:oe,targetStyle:U,qualitativeRangeColors:J||Pe[K].sequentialColors.positiveColorsx10,measureBarWidthFactor:R,animate:le===!0?{duration:.5,once:!0,amount:.5}:le||{duration:0,once:!0,amount:0},dimmedOpacity:ee,precision:de,customLayers:te,naLabel:Me}):null})]})}),a||v?l.jsx(et,{sources:a,footNote:v,width:y,styles:{footnote:oe?.footnote,source:oe?.source},classNames:{footnote:ce?.footnote,source:ce?.source}}):null]})})})})}function sP(t){const{data:e,width:n,height:i,barColor:r,suffix:a,prefix:o,barPadding:s,showLabels:c,showValues:u,showTicks:h,truncateBy:f,rightMargin:d,topMargin:g,bottomMargin:p,leftMargin:y,tooltip:v,onSeriesMouseOver:m,refValues:I,maxValue:j,minValue:w,highlightedDataPoints:S,onSeriesMouseClick:P,labelOrder:W,maxBarThickness:D,minBarThickness:x,resetSelectionOnDoubleClick:$,detailsOnClick:V,barAxisTitle:q,valueColor:ae,noOfTicks:G,styles:_,classNames:b,targetStyle:B,targetColor:X,qualitativeRangeColors:z,measureBarWidthFactor:C,animate:A,dimmedOpacity:M,precision:O,customLayers:K,naLabel:Q}=t,se=k.useRef(null),T=ct(se,{once:A.once,amount:A.amount}),Z={top:g,bottom:p,left:q?y+30:y,right:d},[ie,ue]=k.useState(void 0),[he,Y]=k.useState(void 0),[ge,oe]=k.useState(void 0),[ce,N]=k.useState(void 0),U=n-Z.left-Z.right,ve=i-Z.top-Z.bottom,J=Math.max(...e.filter(ke=>!je(ke.size)).map(ke=>ke.size))<0?0:Math.max(...e.filter(ke=>!je(ke.size)).map(ke=>ke.size)),R=Math.max(...e.filter(ke=>!je(ke.target)).map(ke=>ke.target))<0?0:Math.max(...e.filter(ke=>!je(ke.size)).map(ke=>ke.target)),le=Math.max(...e.map(ke=>rt((ke.qualitativeRange||[]).filter(me=>!je(me)))||0)),ee=je(j)?Math.max(...[J,R,le].filter(Number.isFinite))<0?0:Math.max(...[J,R,le].filter(Number.isFinite)):j,de=Math.min(...e.filter(ke=>!je(ke.size)).map(ke=>ke.size))>=0?0:Math.min(...e.filter(ke=>!je(ke.size)).map(ke=>ke.size)),te=Math.min(...e.filter(ke=>!je(ke.target)).map(ke=>ke.target))>=0?0:Math.min(...e.filter(ke=>!je(ke.target)).map(ke=>ke.target)),Me=je(w)?Math.min(...[de,te].filter(Number.isFinite))>=0?0:Math.min(...[de,te].filter(Number.isFinite)):w,be=ut().domain([Me,ee]).range([ve,0]).nice(),ne=e.map((ke,me)=>({...ke,id:W?`${ke.label}`:`${me}`})),De=W||ne.map(ke=>`${ke.id}`),xe=xn().domain(De).range([0,x?Math.max(U,x*De.length):D?Math.min(U,D*De.length):U]).paddingInner(s),Ae=be.ticks(G);return l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{width:`${n}px`,height:`${i}px`,viewBox:`0 0 ${n} ${i}`,direction:"ltr",ref:se,children:l.jsxs("g",{transform:`translate(${Z.left},${Z.top})`,children:[l.jsx(Dt,{y1:be(Me<0?0:Me),y2:be(Me<0?0:Me),x1:0-y,x2:U+Z.right,label:qe(Me<0?0:Me,Q,O,o,a),labelPos:{x:0-y,dx:0,dy:ee<0?"1em":-5,y:be(Me<0?0:Me)},classNames:{axis:b?.xAxis?.axis,label:b?.yAxis?.labels},styles:{axis:_?.xAxis?.axis,label:_?.yAxis?.labels}}),h?l.jsx(ri,{values:Ae.filter(ke=>ke!==0),y:Ae.filter(ke=>ke!==0).map(ke=>be(ke)),x1:0-y,x2:U+Z.right,styles:{gridLines:_?.yAxis?.gridLines,labels:_?.yAxis?.labels},classNames:{gridLines:b?.yAxis?.gridLines,labels:b?.yAxis?.labels},suffix:a,prefix:o,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:O}):null,l.jsx(Nt,{x:0-y-15,y:ve/2,style:_?.yAxis?.title,className:b?.yAxis?.title,text:q,rotate90:!0}),K.filter(ke=>ke.position==="before").map(ke=>ke.layer),l.jsxs(mt,{children:[ne.map(ke=>je(xe(ke.id))?null:l.jsxs($e.g,{className:"undp-viz-g-with-hover",onMouseEnter:me=>{ue(ke),N(me.clientY),oe(me.clientX),m?.(ke)},onClick:()=>{(P||V)&&(dt(he,ke)&&$?(Y(void 0),P?.(void 0)):(Y(ke),P?.(ke)))},onMouseMove:me=>{ue(ke),N(me.clientY),oe(me.clientX)},onMouseLeave:()=>{ue(void 0),oe(void 0),N(void 0),m?.(void 0)},exit:{opacity:0,transition:{duration:A.duration}},variants:{initial:{x:xe(`${ke.id}`),y:0,opacity:S.length!==0?S.indexOf(ke.label)!==-1?.85:M:.85},whileInView:{x:xe(`${ke.id}`),y:0,opacity:S.length!==0?S.indexOf(ke.label)!==-1?.85:M:.85,transition:{duration:A.duration}}},initial:"initial",animate:T?"whileInView":"initial",children:[ke.qualitativeRange?ke.qualitativeRange.map((me,Se)=>l.jsx($e.rect,{x:0,exit:{height:0,y:be(0),transition:{duration:A.duration}},variants:{initial:{height:0,y:be(0),fill:z[Se]},whileInView:{height:Math.abs(be(rt(ke.qualitativeRange.filter((Le,F)=>F<=Se&&Le)))-be(rt(ke.qualitativeRange.filter((Le,F)=>F<Se&&Le)))),y:be(rt(ke.qualitativeRange.filter((Le,F)=>F<=Se&&Le))),fill:z[Se],transition:{duration:A.duration}}},initial:"initial",animate:T?"whileInView":"initial",width:xe.bandwidth()},Se)):null,ke.target&&B==="background"?l.jsx($e.rect,{x:0,width:xe.bandwidth(),style:{fill:X},exit:{height:0,y:be(0),transition:{duration:A.duration}},variants:{initial:{height:0,y:be(0)},whileInView:{height:Math.abs(be(ke.target)-be(0)),y:ke.target>0?be(ke.target):be(0),transition:{duration:A.duration}}},initial:"initial",animate:T?"whileInView":"initial"}):null,ke.size?l.jsx($e.rect,{x:xe.bandwidth()*((1-C)/2),width:xe.bandwidth()*C,style:{fill:r},exit:{height:0,y:be(0),transition:{duration:A.duration}},variants:{initial:{height:0,y:be(0)},whileInView:{height:Math.abs(be(ke.size)-be(0)),y:ke.size>0?be(ke.size):be(0),transition:{duration:A.duration}}},initial:"initial",animate:T?"whileInView":"initial"}):null,ke.target&&B==="line"?l.jsx($e.rect,{x:0,width:xe.bandwidth(),style:{fill:X},exit:{y:be(0),opacity:0,transition:{duration:A.duration}},variants:{initial:{y:be(0),opacity:0},whileInView:{y:be(ke.target)-1,opacity:1,transition:{duration:A.duration}}},initial:"initial",animate:T?"whileInView":"initial",height:2}):null,c?l.jsx(ro,{value:`${ke.label}`.length<f?`${ke.label}`:`${`${ke.label}`.substring(0,f)}...`,y:(ke.size||0)<0?0:be(0)+5,x:0,width:xe.bandwidth(),height:(ke.size||0)<0?be(0)-5:Z.bottom,style:_?.xAxis?.labels,className:b?.xAxis?.labels,alignment:(ke.size||0)<0?"bottom":"top",animate:A,isInView:T}):null,u?l.jsx($e.text,{x:xe.bandwidth()/2,style:{...ae?{fill:ae}:{fill:r},textAnchor:"middle",..._?.graphObjectValues||{}},className:Ce.cn("graph-value text-sm",!ae&&r.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",b?.graphObjectValues),dy:ke.size?ke.size>=0?"-5px":"1em":"-5px",exit:{opacity:0,transition:{duration:A.duration}},variants:{initial:{y:be(0),opacity:0},whileInView:{y:be(ke.size||0),opacity:1,transition:{duration:A.duration}}},initial:"initial",animate:T?"whileInView":"initial",children:qe(ke.size,Q,O,o,a)}):null]},ke.label)),I?l.jsx(l.Fragment,{children:I.map((ke,me)=>l.jsx(gi,{text:ke.text,color:ke.color,y:be(ke.value),x1:0-y,x2:U+Z.right,classNames:ke.classNames,styles:ke.styles,animate:A,isInView:T},me))}):null]}),K.filter(ke=>ke.position==="after").map(ke=>ke.layer)]})}),ie&&v&&ge&&ce?l.jsx(st,{data:ie,body:v,xPos:ge,yPos:ce,backgroundStyle:_?.tooltip,className:b?.tooltip}):null,V&&he!==void 0?l.jsx(Ce.Modal,{open:he!==void 0,onClose:()=>{Y(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof V=="string"?{__html:lt(V,he)}:void 0,children:typeof V=="function"?V(he):null})}):null]})}function lP(t){const{data:e,graphTitle:n,barColor:i=Pe.primaryColors["blue-600"],barPadding:r=.25,showTicks:a=!0,leftMargin:o=20,rightMargin:s=20,topMargin:c=20,bottomMargin:u=25,truncateBy:h=999,showLabels:f=!0,showValues:d=!0,backgroundColor:g=!1,suffix:p="",prefix:y="",sources:v,graphDescription:m,height:I,width:j,footNote:w,colorDomain:S,colorLegendTitle:P,padding:W,relativeHeight:D,tooltip:x,onSeriesMouseOver:$,refValues:V,showColorScale:q=!0,graphID:ae,maxValue:G,minValue:_,highlightedDataPoints:b=[],qualitativeRangeColors:B,onSeriesMouseClick:X,graphDownload:z=!1,dataDownload:C=!1,language:A="en",theme:M="light",sortData:O,labelOrder:K,minHeight:Q=0,maxBarThickness:se,maxNumberOfBars:T,minBarThickness:Z,ariaLabel:ie,resetSelectionOnDoubleClick:ue=!0,detailsOnClick:he,barAxisTitle:Y,noOfTicks:ge=5,valueColor:oe,styles:ce,classNames:N,targetColor:U=Pe.light.grays["gray-700"],filterNA:ve=!0,targetStyle:J="line",measureBarWidthFactor:R=.4,animate:le=!1,dimmedOpacity:ee=.3,precision:de=2,customLayers:te=[],naLabel:Me="NA"}=t,[be,ne]=k.useState(0),[De,xe]=k.useState(0),Ae=k.useRef(null),ke=k.useRef(null);return k.useEffect(()=>{const me=new ResizeObserver(Se=>{ne(j||Se[0].target.clientWidth||620),xe(I||Se[0].target.clientHeight||480)});return Ae.current&&(xe(Ae.current.clientHeight||480),ne(Ae.current.clientWidth||620),j||me.observe(Ae.current)),()=>me.disconnect()},[j,I]),l.jsx("div",{className:`${M||"light"} flex ${j?"w-fit grow-0":"w-full grow"}`,dir:A==="he"||A==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${g?g===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${A||"en"}`,N?.graphContainer),style:{...ce?.graphContainer||{},...g&&g!==!0?{backgroundColor:g}:{}},id:ae,ref:ke,"aria-label":ie||`${n?`The graph shows ${n}. `:""}This is a grouped bar chart. ${m?` ${m}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:g?W||"1rem":W||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||m||z||C?l.jsx(Qe,{styles:{title:ce?.title,description:ce?.description},classNames:{title:N?.title,description:N?.description},graphTitle:n,graphDescription:m,width:j,graphDownload:z?ke.current:void 0,dataDownload:C?e.map(me=>me.data).filter(me=>me!==void 0).length>0?e.map(me=>me.data).filter(me=>me!==void 0):e.filter(me=>me!==void 0):null}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[q&&e.filter(me=>me.qualitativeRange).length!==0&&S?l.jsx(Hi,{width:j,colorLegendTitle:P,colors:B||Pe[M].sequentialColors.positiveColorsx10,colorDomain:S,showNAColor:!1}):null,l.jsx("div",{className:"flex grow flex-col justify-center w-full leading-0",ref:Ae,"aria-label":"Graph area",children:(j||be)&&(I||De)?l.jsx(sP,{data:O==="asc"?tt(e.filter(me=>ve?!je(me.size):me),me=>me.size).filter((me,Se)=>T?Se<T:!0):O==="desc"?tt(e.filter(me=>ve?!je(me.size):me),me=>me.size).reverse().filter((me,Se)=>T?Se<T:!0):e.filter(me=>ve?!je(me.size):me).filter((me,Se)=>T?Se<T:!0),barColor:i,targetColor:U,width:j||be,refValues:V,height:Math.max(Q,I||(D?Q?(j||be)*D>Q?(j||be)*D:Q:(j||be)*D:De)),suffix:p,prefix:y,barPadding:r,showLabels:f,showValues:d,showTicks:a,truncateBy:h,leftMargin:o,rightMargin:s,qualitativeRangeColors:B||Pe[M].sequentialColors.positiveColorsx10,topMargin:c,bottomMargin:u,tooltip:x,onSeriesMouseOver:$,maxValue:G,minValue:_,highlightedDataPoints:b,onSeriesMouseClick:X,labelOrder:K,maxBarThickness:se,minBarThickness:Z,resetSelectionOnDoubleClick:ue,detailsOnClick:he,barAxisTitle:Y,noOfTicks:ge,valueColor:oe,styles:ce,classNames:N,targetStyle:J,dimmedOpacity:ee,measureBarWidthFactor:R,animate:le===!0?{duration:.5,once:!0,amount:.5}:le||{duration:0,once:!0,amount:0},precision:de,customLayers:te,naLabel:Me}):null})]})}),v||w?l.jsx(et,{styles:{footnote:ce?.footnote,source:ce?.source},classNames:{footnote:N?.footnote,source:N?.source},sources:v,footNote:w,width:j}):null]})})})})}function Kv(t){const{data:e,graphTitle:n,barColor:i,barPadding:r,showTicks:a,leftMargin:o,rightMargin:s,topMargin:c,bottomMargin:u,truncateBy:h,showLabels:f,showValues:d,backgroundColor:g,suffix:p,prefix:y,sources:v,graphDescription:m,height:I,width:j,footNote:w,colorDomain:S,colorLegendTitle:P,padding:W,relativeHeight:D,tooltip:x,onSeriesMouseOver:$,refValues:V,showColorScale:q,graphID:ae,maxValue:G,minValue:_,highlightedDataPoints:b,onSeriesMouseClick:B,graphDownload:X,dataDownload:z,language:C,theme:A,sortData:M,labelOrder:O,minHeight:K,maxBarThickness:Q,maxNumberOfBars:se,minBarThickness:T,ariaLabel:Z,resetSelectionOnDoubleClick:ie,detailsOnClick:ue,barAxisTitle:he,noOfTicks:Y,valueColor:ge,orientation:oe="vertical",styles:ce,classNames:N,filterNA:U,targetStyle:ve,targetColor:J,qualitativeRangeColors:R,measureBarWidthFactor:le,animate:ee,dimmedOpacity:de,precision:te,naLabel:Me}=t;return oe==="vertical"?l.jsx(lP,{data:e,graphTitle:n,barColor:i,barPadding:r,showTicks:a,leftMargin:o,rightMargin:s,topMargin:c,bottomMargin:u,truncateBy:h,showLabels:f,showValues:d,backgroundColor:g,suffix:p,prefix:y,sources:v,graphDescription:m,height:I,width:j,footNote:w,colorDomain:S,colorLegendTitle:P,padding:W,relativeHeight:D,tooltip:x,onSeriesMouseOver:$,refValues:V,showColorScale:q,graphID:ae,maxValue:G,minValue:_,highlightedDataPoints:b,onSeriesMouseClick:B,graphDownload:X,dataDownload:z,language:C,theme:A,sortData:M,labelOrder:O,minHeight:K,maxBarThickness:Q,maxNumberOfBars:se,minBarThickness:T,ariaLabel:Z,resetSelectionOnDoubleClick:ie,styles:ce,detailsOnClick:ue,barAxisTitle:he,noOfTicks:Y,valueColor:ge,classNames:N,filterNA:U,targetStyle:ve,targetColor:J,measureBarWidthFactor:le,qualitativeRangeColors:R,animate:ee,dimmedOpacity:de,precision:te,naLabel:Me}):l.jsx(oP,{data:e,graphTitle:n,barColor:i,barPadding:r,showTicks:a,leftMargin:o,rightMargin:s,topMargin:c,bottomMargin:u,truncateBy:h,showLabels:f,showValues:d,backgroundColor:g,suffix:p,prefix:y,sources:v,graphDescription:m,height:I,width:j,footNote:w,colorDomain:S,colorLegendTitle:P,padding:W,relativeHeight:D,tooltip:x,onSeriesMouseOver:$,refValues:V,showColorScale:q,graphID:ae,maxValue:G,minValue:_,highlightedDataPoints:b,onSeriesMouseClick:B,graphDownload:X,dataDownload:z,language:C,theme:A,sortData:M,labelOrder:O,minHeight:K,maxBarThickness:Q,maxNumberOfBars:se,minBarThickness:T,ariaLabel:Z,resetSelectionOnDoubleClick:ie,styles:ce,detailsOnClick:ue,barAxisTitle:he,noOfTicks:Y,valueColor:ge,classNames:N,filterNA:U,targetStyle:ve,targetColor:J,measureBarWidthFactor:le,qualitativeRangeColors:R,animate:ee,dimmedOpacity:de,precision:te,naLabel:Me})}function cP(t){const{data:e,width:n,height:i,colors:r,dateFormat:a,noOfXTicks:o,rightMargin:s,leftMargin:c,topMargin:u,bottomMargin:h,yAxisTitle:f,tooltip:d,onSeriesMouseOver:g,highlightAreaSettings:p,refValues:y,minValue:v,maxValue:m,rtl:I,annotations:j,customHighlightAreaSettings:w,noOfYTicks:S,prefix:P,suffix:W,curveType:D,styles:x,classNames:$,precision:V,customLayers:q,animate:ae}=t,G=k.useRef(null),_=ct(G,{once:ae.once,amount:ae.amount}),b=D==="linear"?Oi:D==="step"?Or:D==="stepAfter"?Ir:D==="stepBefore"?Nr:_r,[B,X]=k.useState(void 0),[z,C]=k.useState(void 0),[A,M]=k.useState(void 0),O={top:u,bottom:h,left:f?c+30:c,right:s},K=k.useRef(null),Q=tt(e.map(R=>({...R,date:ze(`${R.date}`,a,new Date)})),"date"),se=p.map(R=>({...R,coordinates:[R.coordinates[0]===null?null:ze(`${R.coordinates[0]}`,a,new Date),R.coordinates[1]===null?null:ze(`${R.coordinates[1]}`,a,new Date)]})),T=w.map(R=>({...R,coordinates:R.coordinates.map((le,ee)=>ee%2===0?ze(`${le}`,a,new Date):le)})),Z=Q[0].y.map((R,le)=>Q.map(ee=>({date:ee.date,y0:le===0?0:rt(ee.y.filter((de,te)=>te<le)),y1:rt(ee.y.filter((de,te)=>te<=le))}))),ie=n-O.left-O.right,ue=i-O.top-O.bottom,he=Q[0].date,Y=Q[Q.length-1].date,ge=je(v)?0:v,oe=je(m)?Math.max(...e.map(R=>rt(R.y)||0)):m,ce=Zr().domain([he,Y]).range([0,ie]),N=ut().domain([ge,oe]).range([ue,0]).nice(),U=No().x(R=>ce(R.date)).y0(R=>N(R.y0)).y1(R=>N(R.y1)).curve(b),ve=N.ticks(S),J=ce.ticks(o);return k.useEffect(()=>{const R=ee=>{const de=Q[Qr(Q.map(te=>te.date),ce.invert(En(ee)[0]),1)];X(de||Q[Q.length-1]),g?.(de||Q[Q.length-1]),M(ee.clientY),C(ee.clientX)},le=()=>{X(void 0),C(void 0),M(void 0),g?.(void 0)};bt(K.current).on("mousemove",R).on("mouseout",le),g?.(void 0)},[ce,Q,g]),l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{width:`${n}px`,height:`${i}px`,viewBox:`0 0 ${n} ${i}`,direction:"ltr",ref:G,children:l.jsx(mt,{children:l.jsxs($e.g,{transform:`translate(${O.left},${O.top})`,children:[l.jsx(ao,{areaSettings:se,width:ie,height:ue,scale:ce,animate:ae,isInView:_}),l.jsx(lo,{animate:ae,areaSettings:T,scaleX:ce,scaleY:N,isInView:_}),l.jsxs("g",{children:[l.jsx(ri,{values:ve.filter(R=>R!==0),y:ve.filter(R=>R!==0).map(R=>N(R)),x1:0-c,x2:ie+O.right,styles:{gridLines:x?.yAxis?.gridLines,labels:x?.yAxis?.labels},classNames:{gridLines:$?.yAxis?.gridLines,labels:$?.yAxis?.labels},suffix:W,prefix:P,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:V}),l.jsx(Dt,{y1:N(ge<0?0:ge),y2:N(ge<0?0:ge),x1:0-c,x2:ie+O.right,label:qe(ge<0?0:ge,"NA",V,P,W),labelPos:{x:0-c,dx:0,dy:oe<0?"1em":-5,y:N(ge<0?0:ge)},classNames:{axis:$?.xAxis?.axis,label:$?.yAxis?.labels},styles:{axis:x?.xAxis?.axis,label:x?.yAxis?.labels}}),l.jsx(Nt,{x:0-c-15,y:ue/2,style:x?.yAxis?.title,className:$?.yAxis?.title,text:f,rotate90:!0})]}),l.jsx(Rn,{values:J.map(R=>ft(R,a)),x:J.map(R=>ce(R)),y1:0,y2:ue,styles:{gridLines:x?.xAxis?.gridLines,labels:x?.xAxis?.labels},classNames:{gridLines:Ce.cn("opacity-0",$?.xAxis?.gridLines),labels:Ce.cn("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[8px] sm:text-[9px] md:text-[10px] lg:text-xs",$?.xAxis?.labels)},suffix:W,prefix:P,labelType:"primary",showGridLines:!0,precision:V}),q.filter(R=>R.position==="before").map(R=>R.layer),l.jsxs($e.g,{children:[Z.map((R,le)=>l.jsx($e.path,{d:U(R),exit:{opacity:0,transition:{duration:ae.duration}},variants:{initial:{d:U(R.map(ee=>({...ee,y0:0,y1:0}))),opacity:0},whileInView:{d:U(R),opacity:1,transition:{duration:ae.duration}}},initial:"initial",animate:_?"whileInView":"initial",style:{fill:r[le],opacity:.8}},le)),B?l.jsx("line",{y1:0,y2:ue,x1:ce(B.date),x2:ce(B.date),className:Ce.cn("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",$?.mouseOverLine),style:x?.mouseOverLine}):null]}),y?l.jsx(l.Fragment,{children:y.map((R,le)=>l.jsx(gi,{text:R.text,color:R.color,y:N(R.value),x1:0-c,x2:ie+O.right,classNames:R.classNames,styles:R.styles,animate:ae,isInView:_},le))}):null,l.jsx("g",{children:j.map((R,le)=>{const ee=oo({x:R.xCoordinate?ce(ze(`${R.xCoordinate}`,a,new Date))+(R.xOffset||0):0+(R.xOffset||0),y:R.yCoordinate?N(R.yCoordinate)+(R.yOffset||0)-8:0+(R.yOffset||0)-8},{x:R.xCoordinate?ce(ze(`${R.xCoordinate}`,a,new Date)):0,y:R.yCoordinate?N(R.yCoordinate):0},je(R.connectorRadius)?3.5:R.connectorRadius),de=R.showConnector?{y1:ee.y,x1:ee.x,y2:R.yCoordinate?N(R.yCoordinate)+(R.yOffset||0):0+(R.yOffset||0),x2:R.xCoordinate?ce(ze(`${R.xCoordinate}`,a,new Date))+(R.xOffset||0):0+(R.xOffset||0),cx:R.xCoordinate?ce(ze(`${R.xCoordinate}`,a,new Date)):0,cy:R.yCoordinate?N(R.yCoordinate):0,circleRadius:je(R.connectorRadius)?3.5:R.connectorRadius,strokeWidth:R.showConnector===!0?2:Math.min(R.showConnector||0,1)}:void 0,te={y:R.yCoordinate?N(R.yCoordinate)+(R.yOffset||0)-8:0+(R.yOffset||0)-8,x:I?0:R.xCoordinate?ce(ze(`${R.xCoordinate}`,a,new Date))+(R.xOffset||0):0+(R.xOffset||0),width:I?R.xCoordinate?ce(ze(`${R.xCoordinate}`,a,new Date))+(R.xOffset||0):0+(R.xOffset||0):ie-(R.xCoordinate?ce(ze(`${R.xCoordinate}`,a,new Date))+(R.xOffset||0):0+(R.xOffset||0)),maxWidth:R.maxWidth,fontWeight:R.fontWeight,align:R.align};return l.jsx(so,{color:R.color,connectorsSettings:de,labelSettings:te,text:R.text,classNames:R.classNames,styles:R.styles,animate:ae,isInView:_},le)})}),q.filter(R=>R.position==="after").map(R=>R.layer),l.jsx("rect",{ref:K,style:{fill:"none",pointerEvents:"all"},width:ie,height:ue})]})})}),B&&d&&z&&A?l.jsx(st,{data:B,body:d,xPos:z,yPos:A,backgroundStyle:x?.tooltip,className:$?.tooltip}):null]})}function Qv(t){const{data:e,graphTitle:n,colors:i=Pe.light.categoricalColors.colors,sources:r,graphDescription:a,height:o,width:s,footNote:c,noOfXTicks:u=10,dateFormat:h="yyyy",colorDomain:f,padding:d,backgroundColor:g=!1,colorLegendTitle:p,leftMargin:y=50,rightMargin:v=20,topMargin:m=20,bottomMargin:I=25,highlightAreaSettings:j=[],tooltip:w,relativeHeight:S,onSeriesMouseOver:P,refValues:W=[],graphID:D,minValue:x,maxValue:$,graphDownload:V=!1,dataDownload:q=!1,showColorScale:ae=!0,language:G="en",minHeight:_=0,annotations:b=[],customHighlightAreaSettings:B=[],theme:X="light",ariaLabel:z,yAxisTitle:C,noOfYTicks:A=5,prefix:M="",suffix:O="",curveType:K="curve",styles:Q,classNames:se,precision:T=2,customLayers:Z=[],animate:ie=!1}=t,[ue,he]=k.useState(0),[Y,ge]=k.useState(0),oe=k.useRef(null),ce=k.useRef(null);return k.useEffect(()=>{const N=new ResizeObserver(U=>{he(s||U[0].target.clientWidth||620),ge(o||U[0].target.clientHeight||480)});return oe.current&&(ge(oe.current.clientHeight||480),he(oe.current.clientWidth||620),s||N.observe(oe.current)),()=>N.disconnect()},[s,o]),l.jsx("div",{className:`${X||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:G==="he"||G==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${g?g===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${G||"en"}`,se?.graphContainer),style:{...Q?.graphContainer||{},...g&&g!==!0?{backgroundColor:g}:{}},id:D,ref:ce,"aria-label":z||`${n?`The graph shows ${n}. `:""}This is a stacked area chart that shows trends over time.${a?` ${a}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:g?d||"1rem":d||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||a||V||q?l.jsx(Qe,{styles:{title:Q?.title,description:Q?.description},classNames:{title:se?.title,description:se?.description},graphTitle:n,graphDescription:a,width:s,graphDownload:V?ce.current:void 0,dataDownload:q?e.map(N=>N.data).filter(N=>N!==void 0).length>0?e.map(N=>N.data).filter(N=>N!==void 0):e.filter(N=>N!==void 0):null}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[ae!==!1?l.jsx(Hi,{colorDomain:f,colors:i,colorLegendTitle:p,showNAColor:!1}):null,l.jsx("div",{className:"w-full grow leading-0",ref:oe,"aria-label":"Graph area",children:(s||ue)&&(o||Y)?l.jsx(cP,{data:e,colors:i,width:s||ue,height:Math.max(_,o||(S?_?(s||ue)*S>_?(s||ue)*S:_:(s||ue)*S:Y)),dateFormat:h,noOfXTicks:u,leftMargin:y,rightMargin:v,topMargin:m,bottomMargin:I,tooltip:w,onSeriesMouseOver:P,highlightAreaSettings:j,refValues:W,minValue:x,maxValue:$,rtl:G==="he"||G==="ar",annotations:b,customHighlightAreaSettings:B,yAxisTitle:C,noOfYTicks:A,prefix:M,suffix:O,curveType:K,styles:Q,classNames:se,precision:T,customLayers:Z,animate:ie===!0?{duration:.5,once:!0,amount:.5}:ie||{duration:0,once:!0,amount:0}}):null})]})}),r||c?l.jsx(et,{styles:{footnote:Q?.footnote,source:Q?.source},classNames:{footnote:se?.footnote,source:se?.source},sources:r,footNote:c,width:s}):null]})})})})}function uP(t){const{year:e,value:n,graphTitle:i,suffix:r="",sources:a,prefix:o="",graphDescription:s,footNote:c,padding:u,backgroundColor:h=!1,graphID:f,language:d="en",theme:g="light",ariaLabel:p,textBackground:y=!1,headingFontSize:v="4.375rem",centerAlign:m=!1,verticalAlign:I="center",layout:j="primary",styles:w,classNames:S,precision:P}=t;return l.jsx("div",{className:`${g||"light"} flex w-full`,dir:d==="he"||d==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${h?h===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}flex flex-col w-full h-inherit ${d||"en"}`,S?.graphContainer),style:{...w?.graphContainer||{},...h&&h!==!0?{backgroundColor:h}:{}},id:f,"aria-label":p||`${i?`The graph shows ${i}. `:""}This is a statistic card.${s?` ${s}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:h?u||"1rem":u||0},children:j!=="secondary"?l.jsxs("div",{className:"flex flex-col w-full gap-12 justify-between grow",children:[i||s?l.jsx(Qe,{styles:{title:w?.title,description:w?.description},classNames:{title:S?.title,description:S?.description},graphTitle:i,graphDescription:s}):null,l.jsx("div",{className:`flex flex-col justify-between grow ${I==="top"?"justify-start":I==="bottom"?"justify-end":"justify-center"}`,children:l.jsxs(Ce.H3,{marginBottom:"base",className:`leading-none text-outline font-heading ${m?"text-center":d==="he"||d==="ar"?"text-right":"text-left"} ${y?"text-primary-black dark:text-primary-white":"transparent"}`,style:{fontSize:v,letterSpacing:"0.05rem"},children:[qe(n,"NA",P,o,r)," ",e?l.jsxs("span",{className:"text-lg font-normal mt-0 mb-4 text-primary-gray-550 dark:text-primary-gray-400",style:{marginLeft:"-8px",lineHeight:"1.09",textShadow:"none",WebkitTextStrokeWidth:0},children:["(",e,")"]}):null]})}),a||c?l.jsx(et,{styles:{footnote:w?.footnote,source:w?.source},classNames:{footnote:S?.footnote,source:S?.source},sources:a,footNote:c}):null]}):l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-center",children:[l.jsxs(Ce.H3,{marginBottom:j==="secondary"?"none":"base",className:`leading-none text-outline font-heading ${m?"text-center":d==="he"||d==="ar"?"text-right":"text-left"} ${y?"text-primary-black dark:text-primary-white":"transparent"}`,style:{fontSize:v,letterSpacing:"0.05rem"},children:[qe(n,"NA",P,o,r)," ",e?l.jsxs("span",{className:"text-lg font-normal mt-0 mb-4 text-primary-gray-550 dark:text-primary-gray-400",style:{marginLeft:"-8px",lineHeight:"1.09",textShadow:"none",WebkitTextStrokeWidth:0},children:["(",e,")"]}):null]}),i||s?l.jsx(Qe,{styles:{title:w?.title,description:w?.description},classNames:{title:S?.title,description:S?.description},graphTitle:i,graphDescription:s}):null,a||c?l.jsx(et,{styles:{footnote:w?.footnote,source:w?.source},classNames:{footnote:S?.footnote,source:S?.source},sources:a,footNote:c}):null]})})})})}function Zv(t){const{year:e,data:n,graphTitle:i,suffix:r="",sources:a,prefix:o="",graphDescription:s,footNote:c,padding:u,backgroundColor:h=!1,graphID:f,aggregationMethod:d="count",language:g="en",countOnly:p,theme:y="light",ariaLabel:v,textBackground:m=!1,headingFontSize:I="4.375rem",centerAlign:j=!1,verticalAlign:w="center",layout:S="primary",styles:P,classNames:W,precision:D=2}=t;return l.jsx("div",{className:`${y||"light"} flex w-full`,dir:g==="he"||g==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${h?h===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}flex flex-col w-full h-inherit ${g||"en"}`,W?.graphContainer),style:{...P?.graphContainer||{},...h&&h!==!0?{backgroundColor:h}:{}},id:f,"aria-label":v||`${i?`The graph shows ${i}. `:""}This is a statistic card.${s?` ${s}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:h?u||"1rem":u||0},children:S!=="secondary"?l.jsxs("div",{className:"flex flex-col w-full gap-12 justify-between grow",children:[i||s?l.jsx(Qe,{styles:{title:P?.title,description:P?.description},classNames:{title:W?.title,description:W?.description},graphTitle:i,graphDescription:s}):null,l.jsx("div",{className:`flex flex-col justify-between grow ${w==="top"?"justify-start":w==="bottom"?"justify-end":"justify-center"}`,children:l.jsxs(Ce.H3,{marginBottom:"base",className:`leading-none text-outline font-heading ${j?"text-center":g==="he"||g==="ar"?"text-right":"text-left"} ${m?"text-primary-black dark:text-primary-white":"transparent"}`,style:{fontSize:I,letterSpacing:"0.05rem"},children:[n.filter(x=>typeof x.value=="string").length>0||d==="count"?p&&p?.length!==0?n.filter(x=>p.indexOf(x.value)!==-1).length:n.length:qe(d==="sum"?rt(n.map(x=>x.value)):d==="average"?parseFloat((rt(n.map(x=>x.value))/n.length).toFixed(2)):d==="max"?Math.max(...n.map(x=>x.value).filter(x=>x!==void 0)):Math.min(...n.map(x=>x.value).filter(x=>x!==void 0)),"NA",D,o,r)," ",e?l.jsxs("span",{className:"text-lg font-normal mt-0 mb-4 text-primary-gray-550 dark:text-primary-gray-400",style:{marginLeft:"-8px",lineHeight:"1.09",textShadow:"none",WebkitTextStrokeWidth:0},children:["(",e,")"]}):null]})}),a||c?l.jsx(et,{styles:{footnote:P?.footnote,source:P?.source},classNames:{footnote:W?.footnote,source:W?.source},sources:a,footNote:c}):null]}):l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-center",children:[l.jsxs(Ce.H3,{marginBottom:S==="secondary"?"none":"base",className:`leading-none text-outline font-heading ${j?"text-center":g==="he"||g==="ar"?"text-right":"text-left"} ${m?"text-primary-black dark:text-primary-white":"transparent"}`,style:{fontSize:I,letterSpacing:"0.05rem"},children:[n.filter(x=>typeof x.value=="string").length>0||d==="count"?p&&p?.length!==0?n.filter(x=>p.indexOf(x.value)!==-1).length:n.length:qe(d==="sum"?rt(n.map(x=>x.value)):d==="average"?parseFloat((rt(n.map(x=>x.value))/n.length).toFixed(2)):d==="max"?Math.max(...n.map(x=>x.value).filter(x=>x!==void 0)):Math.min(...n.map(x=>x.value).filter(x=>x!==void 0)),"NA",D,o,r)," ",e?l.jsxs("span",{className:"text-lg font-normal mt-0 mb-4 text-primary-gray-550 dark:text-primary-gray-400",style:{marginLeft:"-8px",lineHeight:"1.09",textShadow:"none",WebkitTextStrokeWidth:0},children:["(",e,")"]}):null]}),i||s?l.jsx(Qe,{styles:{title:P?.title,description:P?.description},classNames:{title:W?.title,description:W?.description},graphTitle:i,graphDescription:s}):null,a||c?l.jsx(et,{styles:{footnote:P?.footnote,source:P?.source},classNames:{footnote:W?.footnote,source:W?.source},sources:a,footNote:c}):null]})})})})}function hP(t){var e=0,n=t.children,i=n&&n.length;if(!i)e=1;else for(;--i>=0;)e+=n[i].value;t.value=e}function fP(){return this.eachAfter(hP)}function dP(t,e){let n=-1;for(const i of this)t.call(e,i,++n,this);return this}function gP(t,e){for(var n=this,i=[n],r,a,o=-1;n=i.pop();)if(t.call(e,n,++o,this),r=n.children)for(a=r.length-1;a>=0;--a)i.push(r[a]);return this}function pP(t,e){for(var n=this,i=[n],r=[],a,o,s,c=-1;n=i.pop();)if(r.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)i.push(a[o]);for(;n=r.pop();)t.call(e,n,++c,this);return this}function mP(t,e){let n=-1;for(const i of this)if(t.call(e,i,++n,this))return i}function yP(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n})}function xP(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function vP(t){for(var e=this,n=wP(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i}function wP(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;for(t=n.pop(),e=i.pop();t===e;)r=t,t=n.pop(),e=i.pop();return r}function bP(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function CP(){return Array.from(this)}function SP(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function DP(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*MP(){var t=this,e,n=[t],i,r,a;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,i=t.children)for(r=0,a=i.length;r<a;++r)n.push(i[r]);while(n.length)}function Jv(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=jP)):e===void 0&&(e=kP);for(var n=new Ys(t),i,r=[n],a,o,s,c;i=r.pop();)if((o=e(i.data))&&(c=(o=Array.from(o)).length))for(i.children=o,s=c-1;s>=0;--s)r.push(a=o[s]=new Ys(o[s])),a.parent=i,a.depth=i.depth+1;return n.eachBefore(ew)}function TP(){return Jv(this).eachBefore(AP)}function kP(t){return t.children}function jP(t){return Array.isArray(t)?t[1]:null}function AP(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function ew(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function Ys(t){this.data=t,this.depth=this.height=0,this.parent=null}Ys.prototype=Jv.prototype={constructor:Ys,count:fP,each:dP,eachAfter:pP,eachBefore:gP,find:mP,sum:yP,sort:xP,path:vP,ancestors:bP,descendants:CP,leaves:SP,links:DP,copy:TP,[Symbol.iterator]:MP};function Iu(t){return t==null?null:tw(t)}function tw(t){if(typeof t!="function")throw new Error;return t}function ds(){return 0}function gs(t){return function(){return t}}function _P(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function OP(t,e,n,i,r){for(var a=t.children,o,s=-1,c=a.length,u=t.value&&(i-e)/t.value;++s<c;)o=a[s],o.y0=n,o.y1=r,o.x0=e,o.x1=e+=o.value*u}var NP={depth:-1},qm={},$u={};function IP(t){return t.id}function $P(t){return t.parentId}function LP(){var t=IP,e=$P,n;function i(r){var a=Array.from(r),o=t,s=e,c,u,h,f,d,g,p,y,v=new Map;if(n!=null){const m=a.map((w,S)=>PP(n(w,S,r))),I=m.map(Um),j=new Set(m).add("");for(const w of I)j.has(w)||(j.add(w),m.push(w),I.push(Um(w)),a.push($u));o=(w,S)=>m[S],s=(w,S)=>I[S]}for(h=0,c=a.length;h<c;++h)u=a[h],g=a[h]=new Ys(u),(p=o(u,h,r))!=null&&(p+="")&&(y=g.id=p,v.set(y,v.has(y)?qm:g)),(p=s(u,h,r))!=null&&(p+="")&&(g.parent=p);for(h=0;h<c;++h)if(g=a[h],p=g.parent){if(d=v.get(p),!d)throw new Error("missing: "+p);if(d===qm)throw new Error("ambiguous: "+p);d.children?d.children.push(g):d.children=[g],g.parent=d}else{if(f)throw new Error("multiple roots");f=g}if(!f)throw new Error("no root");if(n!=null){for(;f.data===$u&&f.children.length===1;)f=f.children[0],--c;for(let m=a.length-1;m>=0&&(g=a[m],g.data===$u);--m)g.data=null}if(f.parent=NP,f.eachBefore(function(m){m.depth=m.parent.depth+1,--c}).eachBefore(ew),f.parent=null,c>0)throw new Error("cycle");return f}return i.id=function(r){return arguments.length?(t=Iu(r),i):t},i.parentId=function(r){return arguments.length?(e=Iu(r),i):e},i.path=function(r){return arguments.length?(n=Iu(r),i):n},i}function PP(t){t=`${t}`;let e=t.length;return Ph(t,e-1)&&!Ph(t,e-2)&&(t=t.slice(0,-1)),t[0]==="/"?t:`/${t}`}function Um(t){let e=t.length;if(e<2)return"";for(;--e>1&&!Ph(t,e););return t.slice(0,e)}function Ph(t,e){if(t[e]==="/"){let n=0;for(;e>0&&t[--e]==="\\";)++n;if((n&1)===0)return!0}return!1}function EP(t,e,n,i,r){for(var a=t.children,o,s=-1,c=a.length,u=t.value&&(r-n)/t.value;++s<c;)o=a[s],o.x0=e,o.x1=i,o.y0=n,o.y1=n+=o.value*u}var VP=(1+Math.sqrt(5))/2;function FP(t,e,n,i,r,a){for(var o=[],s=e.children,c,u,h=0,f=0,d=s.length,g,p,y=e.value,v,m,I,j,w,S,P;h<d;){g=r-n,p=a-i;do v=s[f++].value;while(!v&&f<d);for(m=I=v,S=Math.max(p/g,g/p)/(y*t),P=v*v*S,w=Math.max(I/P,P/m);f<d;++f){if(v+=u=s[f].value,u<m&&(m=u),u>I&&(I=u),P=v*v*S,j=Math.max(I/P,P/m),j>w){v-=u;break}w=j}o.push(c={value:v,dice:g<p,children:s.slice(h,f)}),c.dice?OP(c,n,i,r,y?i+=p*v/y:a):EP(c,n,i,y?n+=g*v/y:r,a),y-=v,h=f}return o}const RP=function t(e){function n(i,r,a,o,s){FP(e,i,r,a,o,s)}return n.ratio=function(i){return t((i=+i)>1?i:1)},n}(VP);function BP(){var t=RP,e=!1,n=1,i=1,r=[0],a=ds,o=ds,s=ds,c=ds,u=ds;function h(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(f),r=[0],e&&d.eachBefore(_P),d}function f(d){var g=r[d.depth],p=d.x0+g,y=d.y0+g,v=d.x1-g,m=d.y1-g;v<p&&(p=v=(p+v)/2),m<y&&(y=m=(y+m)/2),d.x0=p,d.y0=y,d.x1=v,d.y1=m,d.children&&(g=r[d.depth+1]=a(d)/2,p+=u(d)-g,y+=o(d)-g,v-=s(d)-g,m-=c(d)-g,v<p&&(p=v=(p+v)/2),m<y&&(y=m=(y+m)/2),t(d,p,y,v,m))}return h.round=function(d){return arguments.length?(e=!!d,h):e},h.size=function(d){return arguments.length?(n=+d[0],i=+d[1],h):[n,i]},h.tile=function(d){return arguments.length?(t=tw(d),h):t},h.padding=function(d){return arguments.length?h.paddingInner(d).paddingOuter(d):h.paddingInner()},h.paddingInner=function(d){return arguments.length?(a=typeof d=="function"?d:gs(+d),h):a},h.paddingOuter=function(d){return arguments.length?h.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):h.paddingTop()},h.paddingTop=function(d){return arguments.length?(o=typeof d=="function"?d:gs(+d),h):o},h.paddingRight=function(d){return arguments.length?(s=typeof d=="function"?d:gs(+d),h):s},h.paddingBottom=function(d){return arguments.length?(c=typeof d=="function"?d:gs(+d),h):c},h.paddingLeft=function(d){return arguments.length?(u=typeof d=="function"?d:gs(+d),h):u},h}function HP(t){const{data:e,colors:n,leftMargin:i,width:r,height:a,colorDomain:o,rightMargin:s,topMargin:c,bottomMargin:u,showLabels:h,tooltip:f,onSeriesMouseOver:d,selectedColor:g,showValues:p,suffix:y,prefix:v,highlightedDataPoints:m,onSeriesMouseClick:I,resetSelectionOnDoubleClick:j,detailsOnClick:w,language:S,styles:P,classNames:W,animate:D,dimmedOpacity:x,precision:$}=t,V=k.useRef(null),q=ct(V,{once:D.once,amount:D.amount}),[ae,G]=k.useState(void 0),[_,b]=k.useState(void 0),[B,X]=k.useState(void 0),[z,C]=k.useState(void 0),A={top:c,bottom:u,left:i,right:s},M=r-A.left-A.right,O=a-A.top-A.bottom,K=[{id:"root",parent:void 0,value:void 0,data:void 0},...e.map(T=>({id:T.label,value:T.size,parent:"root",data:T}))],Q=LP().id(T=>T.id).parentId(T=>T.parent)(K);Q.sum(T=>T.value);const se=BP().size([M,O]).padding(2)(Q);return l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{width:`${r}px`,height:`${a}px`,viewBox:`0 0 ${r} ${a}`,direction:"ltr",ref:V,children:l.jsx("g",{transform:`translate(${A.left},${A.top})`,children:l.jsx(mt,{children:se.children?.map(T=>l.jsxs($e.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:T.x0,y:T.y0},whileInView:{opacity:g?T.data.data.color&&n[o.indexOf(T.data.data.color)]===g?1:x:m.length!==0?m.indexOf(T.data.id)!==-1?.85:x:.85,x:T.x0,y:T.y0,transition:{duration:D.duration}}},initial:"initial",animate:q?"whileInView":"initial",exit:{opacity:0,transition:{duration:D.duration}},onMouseEnter:Z=>{G(T.data.data),C(Z.clientY),X(Z.clientX),d?.(T.data.data)},onClick:()=>{(I||w)&&(_===T.data.id&&j?(b(void 0),I?.(void 0)):(b(T.data.id),I?.(T.data.data)))},onMouseMove:Z=>{G(T.data.data),C(Z.clientY),X(Z.clientX)},onMouseLeave:()=>{G(void 0),X(void 0),C(void 0),d?.(void 0)},children:[l.jsx($e.rect,{x:0,y:0,exit:{width:0,height:0,opacity:0,transition:{duration:D.duration}},variants:{initial:{width:0,height:0,fill:e.filter(Z=>Z.color).length===0?n[0]:T.data.data.color?n[o.indexOf(T.data.data.color)]:Pe.gray},whileInView:{width:T.x1-T.x0,height:T.y1-T.y0,fill:e.filter(Z=>Z.color).length===0?n[0]:T.data.data.color?n[o.indexOf(T.data.data.color)]:Pe.gray,transition:{duration:D.duration}}},initial:"initial",animate:q?"whileInView":"initial"}),T.x1-T.x0>50&&T.y1-T.y0>25&&(h||p)?l.jsx($e.g,{variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:D.duration}}},initial:"initial",animate:q?"whileInView":"initial",exit:{opacity:0,transition:{duration:D.duration}},children:l.jsx("foreignObject",{y:0,x:0,width:T.x1-T.x0,height:T.y1-T.y0,children:l.jsxs("div",{className:"flex flex-col gap-0.5 p-2 w-full",style:{color:yn(e.filter(Z=>Z.color).length===0?n[0]:T.data.data.color?n[o.indexOf(T.data.data.color)]:Pe.gray)},children:[h?l.jsx(Ce.P,{marginBottom:"none",size:"sm",leading:"none",className:Ce.cn("w-full treemap-label",S==="ar"||S==="he"?"text-right":"text-left",W?.graphObjectValues),style:{WebkitLineClamp:T.y1-T.y0>50?T.y1-T.y0>100?T.y1-T.y0>150?void 0:3:2:1,display:"-webkit-box",WebkitBoxOrient:"vertical",overflow:"hidden",color:yn(e.filter(Z=>Z.color).length===0?n[0]:T.data.data.color?n[o.indexOf(T.data.data.color)]:Pe.gray),...P?.graphObjectValues||{}},children:T.data.id}):null,p?l.jsx(Ce.P,{marginBottom:"none",size:"sm",leading:"none",className:Ce.cn("w-full font-bold treemap-value",S==="ar"||S==="he"?"text-right":"text-left",W?.graphObjectValues),style:{color:yn(e.filter(Z=>Z.color).length===0?n[0]:T.data.data.color?n[o.indexOf(T.data.data.color)]:Pe.gray),...P?.graphObjectValues||{}},children:qe(T.data.value,"NA",$,v,y)}):null]})})}):null]},T.data.id))})})}),ae&&f&&B&&z?l.jsx(st,{data:ae,body:f,xPos:B,yPos:z,backgroundStyle:P?.tooltip,className:W?.tooltip}):null,w&&_!==void 0?l.jsx(Ce.Modal,{open:_!==void 0,onClose:()=>{b(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof w=="string"?{__html:lt(w,_)}:void 0,children:typeof w=="function"?w(_):null})}):null]})}function Md(t){const{data:e,graphTitle:n,colors:i,suffix:r="",sources:a,prefix:o="",graphDescription:s,leftMargin:c=0,rightMargin:u=0,topMargin:h=0,bottomMargin:f=0,height:d,width:g,footNote:p,colorDomain:y,colorLegendTitle:v,padding:m,backgroundColor:I=!1,showLabels:j=!0,relativeHeight:w,tooltip:S,onSeriesMouseOver:P,showColorScale:W=!0,showValues:D=!0,graphID:x,highlightedDataPoints:$=[],onSeriesMouseClick:V,graphDownload:q=!1,dataDownload:ae=!1,language:G="en",showNAColor:_=!0,minHeight:b=0,theme:B="light",ariaLabel:X,resetSelectionOnDoubleClick:z=!0,detailsOnClick:C,styles:A,classNames:M,animate:O=!1,dimmedOpacity:K=.3,precision:Q=2}=t,[se,T]=k.useState(0),[Z,ie]=k.useState(0),[ue,he]=k.useState(void 0),Y=k.useRef(null),ge=k.useRef(null);return k.useEffect(()=>{const oe=new ResizeObserver(ce=>{T(g||ce[0].target.clientWidth||620),ie(d||ce[0].target.clientHeight||480)});return Y.current&&(ie(Y.current.clientHeight||480),T(Y.current.clientWidth||620),g||oe.observe(Y.current)),()=>oe.disconnect()},[g,d]),l.jsx("div",{className:`${B||"light"} flex ${g?"w-fit grow-0":"w-full grow"}`,dir:G==="he"||G==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${I?I===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${G||"en"}`,M?.graphContainer),style:{...A?.graphContainer||{},...I&&I!==!0?{backgroundColor:I}:{}},id:x,ref:ge,"aria-label":X||`${n?`The graph shows ${n}. `:""}This is a chart where data points are represented by squares, and their sizes reflect their values. ${s?` ${s}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:I?m||"1rem":m||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||s||q||ae?l.jsx(Qe,{styles:{title:A?.title,description:A?.description},classNames:{title:M?.title,description:M?.description},graphTitle:n,graphDescription:s,width:g,graphDownload:q?ge.current:void 0,dataDownload:ae?e.map(oe=>oe.data).filter(oe=>oe!==void 0).length>0?e.map(oe=>oe.data).filter(oe=>oe!==void 0):e.filter(oe=>oe!==void 0):null}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[W&&e.filter(oe=>oe.color).length!==0?l.jsx(tn,{width:g,colorLegendTitle:v,colors:i||Pe[B].categoricalColors.colors,colorDomain:y||Xe(e.filter(oe=>oe.color),"color").map(oe=>oe.color),setSelectedColor:he,showNAColor:_}):null,l.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:Y,"aria-label":"Graph area",children:(g||se)&&(d||Z)?l.jsx(HP,{data:e.filter(oe=>!je(oe.size)),colors:e.filter(oe=>oe.color).length===0?i?[i]:[Pe.primaryColors["blue-600"]]:i||Pe[B].categoricalColors.colors,colorDomain:e.filter(oe=>oe.color).length===0?[]:y||Xe(e.filter(oe=>oe.color),"color").map(oe=>oe.color),width:g||se,height:Math.max(b,d||(w?b?(g||se)*w>b?(g||se)*w:b:(g||se)*w:Z)),leftMargin:c,rightMargin:u,topMargin:h,bottomMargin:f,showLabels:j,showValues:D,suffix:r,prefix:o,selectedColor:ue,tooltip:S,onSeriesMouseOver:P,onSeriesMouseClick:V,highlightedDataPoints:$,resetSelectionOnDoubleClick:z,detailsOnClick:C,styles:A,classNames:M,language:G,animate:O===!0?{duration:.5,once:!0,amount:.5}:O||{duration:0,once:!0,amount:0},dimmedOpacity:K,precision:Q}):null})]})}),a||p?l.jsx(et,{styles:{footnote:A?.footnote,source:A?.source},classNames:{footnote:M?.footnote,source:M?.source},sources:a,footNote:p,width:g}):null]})})})})}function nw(t){const{data:e,size:n=200,graphTitle:i,sources:r,colors:a=Pe.light.categoricalColors.colors,graphDescription:o,totalNoOfDots:s=100,unitPadding:c=3,gridSize:u=10,footNote:h,padding:f,backgroundColor:d=!1,graphID:g,graphDownload:p=!1,language:y="en",showColorScale:v=!0,showStrokeForWhiteDots:m=!0,note:I,dataDownload:j=!1,theme:w="light",width:S,height:P,minHeight:W=0,relativeHeight:D,ariaLabel:x,styles:$,classNames:V,animate:q=!1,precision:ae=2}=t,G=k.useRef(null),_=q===!0?{duration:.5,once:!0,amount:.5}:q||{duration:0,once:!0,amount:0},b=ct(G,{once:_.once,amount:_.amount}),B=rt(e.map(M=>M.value)),X=k.useRef(null),z=n/u,C=(z-c*2)/2;if(C<=0)return console.error("The size of single unit is less than or equal to zero. Check values for ((dimension / gridSize) - (padding * 2)) / 2 is not less than or equal to 0."),null;const A=[];return e.forEach((M,O)=>{const K=Math.round(M.value/B*s);for(let Q=0;Q<K;Q+=1)A.push({color:a[O]})}),l.jsx("div",{className:`${w||"light"} flex ${S?"w-fit grow-0":"w-full grow"}`,dir:y==="he"||y==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${d?d===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${y||"en"}`,V?.graphContainer),style:{...$?.graphContainer||{},minHeight:"inherit",...d&&d!==!0?{backgroundColor:d}:{}},id:g,ref:X,"aria-label":x||`${i?`The graph shows ${i}. `:""}${o?` ${o}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:d?f||"1rem":f||0},children:l.jsxs("div",{className:"flex flex-col gap-3 w-full grow",children:[i||o||p?l.jsx(Qe,{styles:{title:$?.title,description:$?.description},classNames:{title:V?.title,description:V?.description},graphTitle:i,graphDescription:o,width:S,graphDownload:p?X.current:void 0,dataDownload:j?e.map(M=>M.data).filter(M=>M!==void 0).length>0?e.map(M=>M.data).filter(M=>M!==void 0):e.filter(M=>M!==void 0):null}):null,I?l.jsx(Ce.H2,{marginBottom:"2xs",className:"text-primary-gray-700 dark:text-primary-gray-100 font-bold",style:{width:S?`${S}px`:"100%"},children:I}):null,l.jsxs("div",{className:"flex grow flex-col gap-4 justify-between",children:[l.jsxs("div",{children:[v?l.jsx("div",{className:"mb-4 leading-0",style:{width:S?`${S}px`:"100%"},"aria-label":"Color legend",children:l.jsx("div",{className:"flex mb-0 flex-wrap gap-x-4 gap-y-1",children:e.map((M,O)=>l.jsxs("div",{className:"flex gap-2 items-center",children:[l.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:a[O]}}),l.jsxs(Ce.P,{marginBottom:"none",size:"sm",className:"text-primary-gray-700 dark:text-primary-gray-100",children:[M.label,":"," ",l.jsx("span",{className:"font-bold",children:qe(M.value,"NA",ae)})]})]},O))})}):null,l.jsx("div",{"aria-label":"Graph area",children:l.jsx("svg",{width:`${S||n}px`,height:`${Math.max(W,P?D&&S?W?S*D>W?S*D:W:S*D:P:Math.floor((s-1)/u)*z+z/2+C+5)}px`,ref:G,direction:"ltr",viewBox:`0 0 ${S||n} ${Math.max(W,P?D&&S?W?S*D>W?S*D:W:S*D:P:Math.floor((s-1)/u)*z+z/2+C+5)}`,children:l.jsx(mt,{children:l.jsx("g",{children:A.map((M,O)=>l.jsx($e.circle,{cx:O%u*z+z/2,cy:Math.floor(O/u)*z+z/2,style:{...m?{}:{stroke:M.color},strokeWidth:1},variants:{initial:{fill:"#fff",opacity:0,...m?{}:{stroke:M.color},strokeWidth:1},whileInView:{fill:M.color,opacity:1,...m?{}:{stroke:M.color},strokeWidth:1,transition:{duration:0,delay:_.duration/A.length*O}}},initial:"initial",animate:b?"whileInView":"initial",className:(M.color.toLowerCase()==="#fff"||M.color.toLowerCase()==="#ffffff"||M.color.toLowerCase()==="white")&&m?"stroke-primary-gray-400 dark:stroke-primary-gray-500":"",r:C},O))})})})})]}),r||h?l.jsx(et,{styles:{footnote:$?.footnote,source:$?.source},sources:r,footNote:h,width:S}):null]})]})})})})}function WP(t){const{data:e,showColumnLabels:n,leftMargin:i,rightMargin:r,truncateBy:a,width:o,height:s,topMargin:c,bottomMargin:u,tooltip:h,onSeriesMouseOver:f,suffix:d,prefix:g,showValues:p,colorDomain:y,colors:v,noDataColor:m,scaleType:I,showRowLabels:j,selectedColor:w,onSeriesMouseClick:S,resetSelectionOnDoubleClick:P,detailsOnClick:W,styles:D,classNames:x,animate:$,precision:V}=t,q=k.useRef(null),ae=ct(q,{once:$.once,amount:$.amount}),G={top:c,bottom:u,left:i,right:r},[_,b]=k.useState(void 0),[B,X]=k.useState(void 0),[z,C]=k.useState(void 0),[A,M]=k.useState(void 0),O=o-G.left-G.right,K=s-G.top-G.bottom,Q=Xe(e,Y=>Y.column).map(Y=>Y.column),se=Xe(e,Y=>Y.row).map(Y=>Y.row),T=xn().domain(se).range([0,K]),Z=T.bandwidth(),ie=xn().domain(Q).range([0,O]),ue=ie.bandwidth(),he=I==="categorical"?Xs().domain(y).range(v):I==="threshold"?Po().domain(y).range(v):ut().domain(y).range(v);return l.jsxs(l.Fragment,{children:[l.jsxs($e.svg,{width:`${o}px`,height:`${s}px`,viewBox:`0 0 ${o} ${s}`,style:{marginLeft:"auto",marginRight:"auto"},direction:"ltr",ref:q,children:[l.jsx("g",{transform:`translate(${G.left},0)`,children:n?Q.map((Y,ge)=>l.jsx(ro,{y:0,x:ie(Y),width:ue,height:G.top-5,value:`${Y}`.length<a?`${Y}`:`${`${Y}`.substring(0,a)}...`,style:D?.xAxis?.labels,className:x?.xAxis?.labels,alignment:"bottom",animate:{duration:0,once:!0,amount:0},isInView:ae},ge)):null}),l.jsx("g",{transform:`translate(0,${G.top})`,children:j?se.map((Y,ge)=>l.jsx(io,{value:`${Y}`.length<a?`${Y}`:`${`${Y}`.substring(0,a)}...`,y:T(Y),x:0,width:G.left,height:Z,alignment:"right",style:D?.yAxis?.labels,className:x?.yAxis?.labels,animate:{duration:0,once:!0,amount:0},isInView:ae},ge)):null}),l.jsxs("g",{transform:`translate(${G.left},${G.top})`,children:[se.map((Y,ge)=>l.jsx("g",{transform:`translate(0,${T(Y)})`,children:Q.map(oe=>l.jsx("rect",{x:ie(oe),y:0,width:ue,height:Z,style:{fill:m},className:"stroke-1 stroke-primary-white dark:stroke-primary-gray-700"},`${Y}-${oe}`))},ge)),e.filter(Y=>!je(Y.value)).map((Y,ge)=>{const oe=je(Y.value)?m:he(Y.value);return l.jsxs("g",{transform:`translate(${ie(Y.column)},${T(Y.row)})`,onMouseEnter:ce=>{X(Y),M(ce.clientY),C(ce.clientX),f?.(Y)},onClick:()=>{(S||W)&&(dt(_,Y)&&P?(b(void 0),S?.(void 0)):(b(Y),S?.(Y)))},onMouseMove:ce=>{X(Y),M(ce.clientY),C(ce.clientX)},onMouseLeave:()=>{X(void 0),C(void 0),M(void 0),f?.(void 0)},opacity:w?w===oe?1:.3:1,children:[l.jsx($e.rect,{x:0,y:0,width:ue,height:Z,className:"stroke-1 stroke-primary-white dark:stroke-primary-gray-700",exit:{opacity:0,transition:{duration:$.duration}},variants:{initial:{fill:oe,opacity:0},whileInView:{fill:oe,opacity:1,transition:{duration:$.duration}}},initial:"initial",animate:ae?"whileInView":"initial"}),p&&!je(Y.value)?l.jsx($e.g,{variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:$.duration}}},initial:"initial",animate:ae?"whileInView":"initial",exit:{opacity:0,transition:{duration:$.duration}},children:l.jsx("foreignObject",{y:0,x:0,width:ue,height:Z,children:l.jsx("div",{className:"flex flex-col justify-center items-center h-inherit p-1",children:l.jsx("p",{className:Ce.cn("text-xs text-center m-0 leading-[1.25] graph-value",x?.graphObjectValues),style:{color:yn(oe),...D?.graphObjectValues||{}},children:qe(Y.value,"NA",V,g,d)})})},ge)}):null]},`${Y.column}-${Y.row}`)}),B?l.jsx("rect",{x:ie(B.column),y:T(B.row),width:ue,height:Z,style:{fill:"none",fillOpacity:0,strokeWidth:1.5},className:"stroke-primary-gray-700 dark:stroke-primary-gray-300"}):null]})]}),B&&h&&z&&A?l.jsx(st,{data:B,body:h,xPos:z,yPos:A,backgroundStyle:D?.tooltip,className:x?.tooltip}):null,W&&_!==void 0?l.jsx(Ce.Modal,{open:_!==void 0,onClose:()=>{b(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof W=="string"?{__html:lt(W,_)}:void 0,children:typeof W=="function"?W(_):null})}):null]})}function iw(t){const{colorLegendTitle:e,colorDomain:n,colors:i,width:r,className:a}=t;return l.jsxs("div",{className:Ce.cn("flex gap-0 flex-wrap justify-center leading-0",a),style:{maxWidth:r?`${r}px`:"none"},"aria-label":"Color legend",children:[e&&e!==""?l.jsx(Ce.P,{size:"sm",marginBottom:"2xs",className:"w-full text-center",children:e}):null,l.jsxs("div",{className:"flex gap-0 flex-wrap justify-center w-full min-w-[360px] leading-0",children:[l.jsx("div",{className:"h-4 mb-1 w-full min-w-[360px]",style:{background:`linear-gradient(90deg, ${i[0]} 0%, ${i[1]} 100%)`}}),l.jsxs("div",{className:"flex justify-between w-full min-w-[360px]",children:[l.jsx(Ce.P,{marginBottom:"none",size:"sm",children:qe(n[0],"NA",2,"","")}),l.jsx(Ce.P,{marginBottom:"none",size:"sm",children:qe(n[1],"NA",2,"","")})]})]})]})}function rw(t){const{colorLegendTitle:e,colorDomain:n,colors:i,setSelectedColor:r,width:a,naColor:o,className:s,showNAColor:c}=t,[u,h]=k.useState(void 0),f=o?320:360;return l.jsxs("div",{className:Ce.cn("flex flex-wrap gap-0 justify-center leading-0",s),style:{maxWidth:a?`${a}px`:"none"},"aria-label":"Color legend",children:[e&&e!==""?l.jsx(Ce.P,{size:"sm",marginBottom:"2xs",className:"w-full text-center",children:e}):null,l.jsx("svg",{width:"100%",viewBox:"0 0 360 30",style:{maxWidth:"360px"},direction:"ltr",children:l.jsxs("g",{children:[n.map((d,g)=>l.jsxs("g",{onMouseOver:()=>{h(i[g]),r(i[g])},onMouseLeave:()=>{h(void 0),r(void 0)},className:"cursor-pointer",children:[l.jsx("rect",{x:g*f/i.length+1,y:1,width:f/i.length-2,height:8,className:`stroke-1 ${u===i[g]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:i[g],...u!==i[g]?{stroke:i[g]}:{}}}),l.jsx("text",{x:(g+1)*f/i.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-sm",style:{textAnchor:"middle"},children:qe(d,"NA",2,"","")})]},g)),l.jsx("g",{children:l.jsx("rect",{onMouseOver:()=>{h(i[n.length]),r(i[n.length])},onMouseLeave:()=>{h(void 0),r(void 0)},x:n.length*f/i.length+1,y:1,width:f/i.length-2,height:8,className:`cursor-pointer stroke-1 ${u===i[n.length]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:i[n.length],...u!==i[n.length]?{stroke:i[n.length]}:{}}})}),c?l.jsxs("g",{onMouseOver:()=>{h(o||"#D4D6D8"),r(o||"#D4D6D8")},onMouseLeave:()=>{h(void 0),r(void 0)},className:"cursor-pointer",children:[l.jsx("rect",{x:335,y:1,width:24,height:8,className:`stroke-1 ${u===o?"stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:o||"#D4D6D8",...u!==o?{stroke:o}:{},strokeWidth:1}}),l.jsx("text",{x:337.5,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-sm",style:{textAnchor:"start"},children:"NA"})]}):null]})})]})}function aw(t){const{data:e,graphTitle:n,colors:i,sources:r,graphDescription:a,showColumnLabels:o=!0,leftMargin:s=100,rightMargin:c=10,truncateBy:u=999,height:h,width:f,scaleType:d,colorDomain:g,footNote:p,colorLegendTitle:y,padding:v,backgroundColor:m=!1,topMargin:I=30,bottomMargin:j=10,tooltip:w,onSeriesMouseOver:S,suffix:P="",prefix:W="",showRowLabels:D=!0,relativeHeight:x,showValues:$,graphID:V,noDataColor:q=Pe.gray,showColorScale:ae=!0,onSeriesMouseClick:G,graphDownload:_=!1,dataDownload:b=!1,fillContainer:B=!0,language:X="en",showNAColor:z=!0,minHeight:C=0,theme:A="light",ariaLabel:M,resetSelectionOnDoubleClick:O=!0,detailsOnClick:K,styles:Q,classNames:se,animate:T=!1,precision:Z=2}=t,[ie,ue]=k.useState(0),[he,Y]=k.useState(0),[ge,oe]=k.useState(void 0),ce=k.useRef(null),N=k.useRef(null);k.useEffect(()=>{const ve=new ResizeObserver(J=>{ue(f||J[0].target.clientWidth||620),Y(h||J[0].target.clientHeight||480)});return ce.current&&(Y(ce.current.clientHeight||480),ue(ce.current.clientWidth||620),f||ve.observe(ce.current)),()=>ve.disconnect()},[f,h]);const U=d||(typeof g[0]=="string"?"categorical":g.length===2?"linear":"threshold");return l.jsx("div",{className:`${A||"light"} flex ${f?"grow-0":"grow"} ${B?"w-full":"w-fit"}`,dir:X==="he"||X==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${m?m===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${X||"en"}`,se?.graphContainer),style:{...Q?.graphContainer||{},...m&&m!==!0?{backgroundColor:m}:{}},id:V,ref:N,"aria-label":M||`${n?`The graph shows ${n}. `:""}This is a heatmap. ${a?` ${a}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:m?v||"1rem":v||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||a||_||b?l.jsx(Qe,{styles:{title:Q?.title,description:Q?.description},classNames:{title:se?.title,description:se?.description},graphTitle:n,graphDescription:a,width:f,graphDownload:_?N.current:void 0,dataDownload:b?e.map(ve=>ve.data).filter(ve=>ve!==void 0).length>0?e.map(ve=>ve.data).filter(ve=>ve!==void 0):e.filter(ve=>ve!==void 0):null}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[ae?U==="categorical"?l.jsx(tn,{width:B?void 0:f,colorLegendTitle:y,colors:i||(typeof g[0]=="string"?Pe[A].categoricalColors.colors:g.length===2?[Pe[A].sequentialColors.neutralColorsx09[0],Pe[A].sequentialColors.neutralColorsx09[8]]:Pe[A].sequentialColors[`neutralColorsx0${g.length+1}`]),colorDomain:g.map(ve=>`${ve}`),setSelectedColor:oe,showNAColor:z}):U==="threshold"?l.jsx(rw,{width:B?void 0:f,colorLegendTitle:y,colors:i||(typeof g[0]=="string"?Pe[A].categoricalColors.colors:g.length===2?[Pe[A].sequentialColors.neutralColorsx09[0],Pe[A].sequentialColors.neutralColorsx09[8]]:Pe[A].sequentialColors[`neutralColorsx0${g.length+1}`]),colorDomain:g,setSelectedColor:oe,naColor:q,showNAColor:z}):l.jsx(iw,{width:B?void 0:f,colorLegendTitle:y,colors:i||[Pe[A].sequentialColors.neutralColorsx09[0],Pe[A].sequentialColors.neutralColorsx09[8]],colorDomain:g}):null,l.jsx("div",{className:"flex grow flex-col justify-center w-full leading-0",ref:ce,"aria-label":"Graph area",children:(f||ie)&&(h||he)?l.jsx(WP,{data:e,colorDomain:g,width:f||ie,colors:i||(typeof g[0]=="string"?Pe[A].categoricalColors.colors:g.length===2?[Pe[A].sequentialColors.neutralColorsx09[0],Pe[A].sequentialColors.neutralColorsx09[8]]:Pe[A].sequentialColors[`neutralColorsx0${g.length+1}`]),noDataColor:q,scaleType:U,height:Math.max(C,h||(x?C?(f||ie)*x>C?(f||ie)*x:C:(f||ie)*x:he)),showColumnLabels:o,leftMargin:s,rightMargin:c,topMargin:I,bottomMargin:j,selectedColor:ge,truncateBy:u,showRowLabels:D,tooltip:w,onSeriesMouseOver:S,showValues:$,suffix:P,prefix:W,onSeriesMouseClick:G,resetSelectionOnDoubleClick:O,detailsOnClick:K,styles:Q,classNames:se,animate:T===!0?{duration:.5,once:!0,amount:.5}:T||{duration:0,once:!0,amount:0},precision:Z}):null})]})}),r||p?l.jsx(et,{styles:{footnote:Q?.footnote,source:Q?.source},classNames:{footnote:se?.footnote,source:se?.source},sources:r,footNote:p,width:f}):null]})})})})}const Xm=t=>t.map(i=>i||1).reduce((i,r)=>i+r,0);function ow(t){const{width:e,height:n,graphTitle:i,sources:r,graphDescription:a,footNote:o,graphID:s,data:c,columnData:u,onSeriesMouseClick:h,language:f="en",theme:d="light",ariaLabel:g,backgroundColor:p=!1,padding:y,resetSelectionOnDoubleClick:v=!0,styles:m,classNames:I,minWidth:j,naLabel:w="NA",precision:S=2}=t,[P,W]=k.useState(void 0),[D,x]=k.useState(void 0),[$,V]=k.useState("asc"),[q,ae]=k.useState(void 0),[G,_]=k.useState({}),[b,B]=k.useState(u.filter(C=>C.filterOptions&&C.filterOptions.length>0).map(C=>({id:C.columnId,option:C.filterOptions}))),[X,z]=k.useState(c);return k.useEffect(()=>{const C=[];c.forEach(A=>{let M=!0;b.forEach(O=>{if(typeof A[O.id]!="object"&&typeof A[O.id]!="function"&&typeof A[O.id]!="symbol")if(u[u.findIndex(K=>K.columnId===O.id)].separator){const K=A[O.id].split(u[u.findIndex(Q=>Q.columnId===O.id)].separator);Qa(K,O.option).length===0&&(M=!1)}else O.option.indexOf(A[O.id])===-1&&(M=!1)}),M&&C.push(A)}),z(P&&c?$==="asc"?tt(C,[P]):tt(C,[P]).reverse():C)},[P,$,c,b,u]),l.jsx("div",{className:`${d||"light"} flex ${e?"w-fit grow-0":"w-full grow"}`,dir:f==="he"||f==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${p?p===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${f||"en"} w-full`,I?.graphContainer),style:{...m?.graphContainer||{},...p&&p!==!0?{backgroundColor:p}:{}},id:s,"aria-label":g||`${i?`The graph shows ${i}. `:""}This is an data table. ${a?` ${a}`:""}`,children:l.jsxs("div",{className:"flex grow",style:{padding:p?y||"1rem":y||0},children:[l.jsxs("div",{className:"flex flex-col gap-3 w-full justify-between grow",children:[i||a?l.jsx(Qe,{styles:{title:m?.title,description:m?.description},classNames:{title:I?.title,description:I?.description},graphTitle:i,graphDescription:a,width:e}):null,l.jsx("div",{className:"grow flex flex-col justify-center",children:l.jsx("div",{className:"undp-scrollbar",style:{width:e?`${e}px`:"100%",height:n?`${n}px`:"auto"},children:l.jsx("div",{style:j?{minWidth:j}:void 0,children:c?l.jsxs("table",{className:"w-full",style:{borderCollapse:"collapse"},children:[l.jsx("thead",{className:"text-left bg-primary-gray-300 dark:bg-primary-gray-550",children:l.jsx("tr",{children:u?.map((C,A)=>l.jsx("th",{className:"text-primary-gray-700 dark:text-primary-gray-100 text-sm",style:{width:`calc(${100*(C.columnWidth||1)/Xm(u.map(M=>M.columnWidth||1))}%`},children:l.jsxs("div",{className:"flex gap-2 justify-between items-center p-4",children:[l.jsx(Ce.P,{size:"sm",marginBottom:"none",className:`w-fit grow text-${C.align||"left"} font-bold`,children:C.columnTitle||C.columnId}),C.sortable?l.jsx("button",{type:"button",className:"bg-transparent cursor-pointer p-0 m-0 border-0",onClick:()=>{P===C.columnId?($==="asc"&&V("desc"),$==="desc"&&W(void 0)):(W(C.columnId),V("asc"))},children:P===C.columnId?$==="asc"?l.jsx(ZA,{}):l.jsx(QA,{}):l.jsx(KA,{})}):null,C.filterOptions&&C.filterOptions.length?l.jsx("button",{type:"button",className:"bg-transparent cursor-pointer m-0 p-0 border-0",onClick:M=>{if(q===C.columnId)ae(void 0);else if(M.currentTarget){ae(C.columnId);const O=M.currentTarget.getBoundingClientRect();_({top:O.bottom+window.scrollY,left:O.left+window.scrollX-160<0?O.left+window.scrollX:O.left+window.scrollX-160,width:"10rem"})}},children:b[b.findIndex(M=>M.id===C.columnId)].option.length===C.filterOptions?.length?l.jsx(JA,{}):l.jsx(e2,{})}):null]})},A))})}),l.jsx("tbody",{children:X?.map((C,A)=>l.jsx("tr",{className:`cursor-${h?"pointer":"auto"} border-b border-b-primary-gray-400 dark:border-b-primary-gray-500 ${dt(D,C)?"bg-primary-gray-200 dark:bg-primary-gray-600":"bg-transparent"}`,style:C.rowStyle,onClick:()=>{h&&(dt(D,C)&&v?(x(void 0),h(void 0)):(x(C),h(C)))},children:u.map((M,O)=>l.jsx("td",{className:`text-primary-gray-700 dark:text-primary-gray-100 text-sm text-${M.align||"left"}`,style:{width:`calc(${100*(C.columnWidth||1)/Xm(u.map(K=>K.columnWidth||1))}%`},children:l.jsx("div",{className:`text-primary-gray-700 dark:text-primary-gray-100 flex p-4 ${M.align==="right"?"justify-end":M.align==="center"?"justify-center":"justify-start"}`,children:typeof C[M.columnId]=="number"?l.jsx(Ce.P,{marginBottom:"none",size:"sm",className:`text-primary-gray-700 dark:text-primary-gray-100 w-fit ${M.chip?"grow-0 rounded-sm p-2":"grow rounded-none p-0"} text-${M.align||"left"} ${M.chip?M.chipColors?"":"bg-primary-gray-300 dark:bg-primary-gray-500":"bg-transparent"}`,style:{...M.chip&&M.chipColors?{backgroundColor:M.chipColors[M.chipColors.findIndex(K=>K.value===C[M.chipColumnId||M.columnId])].color,color:yn(M.chipColors[M.chipColors.findIndex(K=>K.value===C[M.chipColumnId||M.columnId])].color)}:{}},children:qe(C[M.columnId],w,S,M.prefix,M.suffix)}):typeof C[M.columnId]=="string"?M.separator?l.jsx("div",{className:"text-primary-gray-700 dark:text-primary-gray-100 flex flex-wrap gap-2",children:C[M.columnId].split(M.separator).map((K,Q)=>l.jsx(Ce.P,{marginBottom:"none",size:"sm",className:`text-primary-gray-700 dark:text-primary-gray-100 w-fit ${M.chip?"grow-0 rounded-sm p-2":"grow rounded-none p-0"} text-${M.align||"left"} ${M.chip?M.chipColors?"":"bg-primary-gray-300 dark:bg-primary-gray-500":"bg-transparent"}`,style:{...M.chip&&M.chipColors?{backgroundColor:M.chipColors[M.chipColors.findIndex(se=>se.value===(M.chipColumnId?C[M.chipColumnId]:K))].color,color:yn(M.chipColors[M.chipColors.findIndex(se=>se.value===(M.chipColumnId?C[M.chipColumnId]:K))].color)}:{}},children:qe(K,w,S,M.prefix,M.suffix)},Q))}):l.jsx(Ce.P,{marginBottom:"none",size:"sm",className:`text-primary-gray-700 dark:text-primary-gray-100 w-fit ${M.chip?"grow-0 rounded-sm p-2":"grow rounded-none p-0"} text-${M.align||"left"} ${M.chip?M.chipColors?"":"bg-primary-gray-300 dark:bg-primary-gray-500":"bg-transparent"}`,style:{...M.chip&&M.chipColors?{backgroundColor:M.chipColors[M.chipColors.findIndex(K=>K.value===C[M.chipColumnId||M.columnId])].color,color:yn(M.chipColors[M.chipColors.findIndex(K=>K.value===C[M.chipColumnId||M.columnId])].color)}:{}},children:qe(C[M.columnId],w,S,M.prefix,M.suffix)}):l.jsx("div",{children:qe(C[M.columnId],w,S,M.prefix,M.suffix)})})},O))},A))})]}):null})})}),r||o?l.jsx(et,{styles:{footnote:m?.footnote,source:m?.source},classNames:{footnote:I?.footnote,source:I?.source},sources:r,footNote:o,width:e}):null]}),q&&l.jsx("div",{style:G,className:"absolute p-3 border z-[1000] rounded-sm bg-primary-white dark:bg-primary-gray-700 border-primary-gray-300 dark:border-primary-gray-550",children:l.jsxs("div",{className:"max-w-60",children:[l.jsx(Ce.P,{size:"sm",marginBottom:"2xs",className:"font-bold",children:"Filter data by"}),l.jsx("div",{className:"flex flex-col gap-2",children:u[u.findIndex(C=>C.columnId===q)].filterOptions?.map((C,A)=>l.jsx("div",{children:l.jsxs("label",{className:"undp-viz-label",children:[l.jsx("input",{type:"checkbox",className:"undp-viz-checkbox",checked:b[b.findIndex(M=>M.id===q)].option.indexOf(C)!==-1,onChange:()=>{const M=b.findIndex(K=>K.id===q),O=[...b[M].option];if(O.indexOf(C)!==-1){O.splice(O.indexOf(C),1);const K=[...b];K[M].option=O,B(K)}else{O.push(C);const K=[...b];K[M].option=O,B(K)}}}),C]},A)},A))})]})})]})})})}const zP=t=>t?Object.entries(t).map(([n,i])=>Array.isArray(i)?{" ":n,value:`"${i.join("; ")}"`}:{" ":n,value:`"${i}"`}):{};function GP(t){const{width:e,height:n,data:i,onSeriesMouseClick:r,cardTemplate:a,cardBackgroundColor:o,cardMinWidth:s=320,detailsOnClick:c,noOfItemsInAPage:u,styles:h,classNames:f,page:d,allowDataDownloadOnDetail:g}=t,[p,y]=k.useState(void 0);return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"undp-scrollbar w-full my-0 mx-auto grid gap-4 undp-viz-data-cards-container",style:{width:e?`${e}px`:"100%",height:n?`${n}px`:"auto",gridTemplateColumns:`repeat(auto-fill, minmax(${s}px, 1fr))`},children:i.filter((v,m)=>u?m<d*u&&m>=(d-1)*u:!0).map((v,m)=>l.jsx("div",{style:{...h?.dataCards||{},...o&&{backgroundColor:o}},className:`w-full flex flex-col ${r||c?"cursor-pointer":"cursor-auto"}${o?"":"bg-primary-gray-200 dark:bg-primary-gray-600"} ${f?.dataCards||""}`,onClick:()=>{r?.(v),y(v)},dangerouslySetInnerHTML:typeof a=="string"?{__html:lt(a,v)}:void 0,children:typeof a=="function"?a(v):null},m))}),c&&p!==void 0?l.jsxs(Ce.Modal,{open:p!==void 0,onClose:()=>{y(void 0)},children:[l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof c=="string"?{__html:lt(c,p)}:void 0,children:typeof c=="function"?c(p):null}),g?l.jsx("div",{className:"flex",children:l.jsx(Hf,{csvData:zP(p),headers:[{label:" ",key:" "},{label:"value",key:"value"}],buttonContent:l.jsxs("div",{className:"flex items-center gap-4",children:[typeof g=="string"?g:null,l.jsx(Bf,{})]})})}):null]}):null]})}function Kr(t){if(t!==void 0)return Array.isArray(t)?t.map(e=>({value:e,label:e})):{value:t,label:t}}const YP=(t,e,n)=>e.length===0?t:t.filter(i=>e.some(r=>i[r]?.toLowerCase().includes(n.toLowerCase())));function sw(t){const{width:e,height:n,graphTitle:i,sources:r,graphDescription:a,footNote:o,graphID:s,data:c,onSeriesMouseClick:u,language:h="en",theme:f="light",ariaLabel:d,cardTemplate:g,cardBackgroundColor:p,cardFilters:y,cardSortingOptions:v,cardSearchColumns:m,cardMinWidth:I=320,backgroundColor:j=!1,padding:w,detailsOnClick:S,allowDataDownloadOnDetail:P=!1,noOfItemsInAPage:W,uiMode:D="normal",styles:x,classNames:$}=t,[V,q]=k.useState(c),[ae,G]=k.useState(1),[_,b]=k.useState(""),B=k.useMemo(()=>(y||[]).map(O=>({filter:O.column,label:O.label||`Filter by ${O.column}`,singleSelect:!0,clearable:!0,defaultValue:Kr(O.defaultValue),availableValues:jr(c,O.column).filter(K=>!O.excludeValues?.includes(`${K}`)).map(K=>({value:K,label:K})),width:O.width})),[y,c]),[X,z]=k.useState((y||[]).map(O=>({filter:O.column,value:Kr(O.defaultValue)}))),[C,A]=k.useState(v?!v.defaultValue||v.options.findIndex(O=>O.label===v.defaultValue)===-1?v.options[0]:v.options[v.options.findIndex(O=>O.label===v.defaultValue)]:void 0),M=k.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]);return k.useEffect(()=>{A(v?!v.defaultValue||v.options.findIndex(O=>O.label===v.defaultValue)===-1?v.options[0]:v.options[v.options.findIndex(O=>O.label===v.defaultValue)]:void 0)},[v]),k.useEffect(()=>{const O=YP(c,m||[],_).filter(K=>X.every(Q=>Q.value&&hn([Q.value]).length>0?Qa(hn([K[Q.filter]]),hn([Q.value]).map(se=>se.value)).length>0:!0));q(C?tt(O,C?.value,C?.type):O)},[c,m,_,X,C]),k.useEffect(()=>{G(1)},[V]),l.jsx("div",{className:`${f||"light"} flex ${e?"w-fit grow-0":"w-full grow"}`,dir:h==="he"||h==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${j?j===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${h||"en"}`,$?.graphContainer),style:{...x?.graphContainer||{},...j&&j!==!0?{backgroundColor:j}:{}},id:s,"aria-label":d||`${i?`The graph shows ${i}. `:""}This is an list of cards. ${a?` ${a}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:j?w||"1rem":w||0},children:l.jsxs("div",{className:"flex flex-col grow gap-3 w-full justify-between",children:[i||a?l.jsx(Qe,{styles:{title:x?.title,description:x?.description},classNames:{title:$?.title,description:$?.description},graphTitle:i,graphDescription:a,width:e}):null,v||B.length>0?l.jsxs("div",{className:"flex gap-4 flex-wrap items-start w-full",children:[v?l.jsxs("div",{className:"grow shrink-0 min-w-[240px]",style:{width:v.width||"calc(25% - 0.75rem)"},children:[l.jsx(Ce.P,{marginBottom:"xs",size:"sm",className:"text-primary-gray-700 dark:text-primary-gray-100",children:"Sort by"}),l.jsx(Ce.DropdownSelect,{options:v.options,isRtl:h==="he"||h==="ar",isSearchable:!0,filterOption:Ce.createFilter(M),onChange:O=>{A(O||void 0)},variant:D,size:"sm",defaultValue:!v.defaultValue||v.options.findIndex(O=>O.label===v.defaultValue)===-1?v.options[0]:v.options[v.options.findIndex(O=>O.label===v.defaultValue)]})]}):null,B?.map((O,K)=>l.jsxs("div",{className:"grow shrink-0 min-w-[240px]",style:{width:O.width||"calc(25% - 0.75rem)"},children:[l.jsx(Ce.P,{marginBottom:"xs",size:"sm",className:"text-primary-gray-700 dark:text-primary-gray-100",children:O.label}),l.jsx(Ce.DropdownSelect,{options:O.availableValues,isClearable:O.clearable===void 0?!0:O.clearable,isRtl:h==="he"||h==="ar",isSearchable:!0,variant:D,size:"sm",controlShouldRenderValue:!0,filterOption:Ce.createFilter(M),onChange:Q=>{z(se=>se.map(T=>T.filter===O.filter?{...T,value:Q}:T))},defaultValue:O.defaultValue})]},K))]}):null,(m||[]).length>0?l.jsx("div",{style:{paddingTop:"1px"},children:l.jsx(Ce.Search,{placeholder:"Search...",onSearch:O=>{b(O||"")},buttonVariant:"icon",inputVariant:D,showSearchButton:!1,inputSize:"sm"})}):null,l.jsx(GP,{data:V,width:e,height:n,cardTemplate:g,cardMinWidth:I,page:ae,cardBackgroundColor:p,styles:x,classNames:$,noOfItemsInAPage:W,detailsOnClick:S,onSeriesMouseClick:u,allowDataDownloadOnDetail:P}),W?l.jsx(Ce.Pagination,{total:V.length,defaultPage:0,pageSize:W,onChange:G}):null,r||o?l.jsx(et,{styles:{footnote:x?.footnote,source:x?.source},classNames:{footnote:$?.footnote,source:$?.source},sources:r,footNote:o,width:e}):null]})})})})}function lw(t,e){if(t<2)return[];const n=e/(t-1);return Array.from({length:t},(i,r)=>r*n)}function qP(t){const{data:e,width:n,height:i,colors:r,colorDomain:a,radius:o,leftMargin:s,rightMargin:c,topMargin:u,bottomMargin:h,tooltip:f,onSeriesMouseOver:d,highlightedDataPoints:g,selectedColor:p,minValue:y,maxValue:v,onSeriesMouseClick:m,prefix:I,suffix:j,stripType:w,highlightColor:S,dotOpacity:P,resetSelectionOnDoubleClick:W,detailsOnClick:D,styles:x,classNames:$,valueColor:V,animate:q,noOfTicks:ae,dimmedOpacity:G,precision:_,customLayers:b}=t,B=k.useRef(null),X=ct(B,{once:q.once,amount:q.amount}),[z,C]=k.useState(void 0),[A,M]=k.useState(void 0),[O,K]=k.useState(void 0),[Q,se]=k.useState(void 0),T={top:u,bottom:h,left:s,right:c},Z=n-T.left-T.right,ie=i-T.top-T.bottom,ue=e.map((N,U)=>({...N,id:`${U}`})),he=tt(ue,N=>{const U=(g||[]).indexOf(N.label);return U===-1?1/0:U}).reverse(),Y=je(v)?Math.max(...e.filter(N=>!je(N.position)).map(N=>N.position))<0?0:Math.max(...e.filter(N=>!je(N.position)).map(N=>N.position)):v,ge=je(y)?Math.min(...e.filter(N=>!je(N.position)).map(N=>N.position))>=0?0:Math.min(...e.filter(N=>!je(N.position)).map(N=>N.position)):y,oe=ut().domain([ge,Y]).range([0,Z]).nice(),ce=lw(ae,Z);return l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{width:`${n}px`,height:`${i}px`,viewBox:`0 0 ${n} ${i}`,direction:"ltr",ref:B,children:l.jsxs("g",{transform:`translate(${T.left},${T.top})`,children:[b.filter(N=>N.position==="before").map(N=>N.layer),l.jsxs(mt,{children:[he.map(N=>l.jsxs($e.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:oe(0),y:ie/2},whileInView:{x:oe(N.position),y:ie/2,opacity:p?N.color&&r[a.indexOf(N.color)]===p?.95:G:g.length!==0?g.indexOf(N.label)!==-1?.95:G:P,transition:{duration:q.duration}}},initial:"initial",animate:X?"whileInView":"initial",exit:{opacity:0,transition:{duration:q.duration}},onMouseEnter:U=>{C(N),se(U.clientY),K(U.clientX),d?.(N)},onClick:()=>{(m||D)&&(dt(A,N)&&W?(M(void 0),m?.(void 0)):(M(N),m?.(N)))},onMouseMove:U=>{C(N),se(U.clientY),K(U.clientX)},onMouseLeave:()=>{C(void 0),K(void 0),se(void 0),d?.(void 0)},children:[w==="dot"?l.jsx($e.circle,{cy:0,cx:0,variants:{initial:{fill:S&&g?g.indexOf(N.label)!==-1?S:e.filter(U=>U.color).length===0?r[0]:N.color?r[a.indexOf(N.color)]:Pe.gray:e.filter(U=>U.color).length===0?r[0]:N.color?r[a.indexOf(N.color)]:Pe.gray},whileInView:{fill:S&&g?g.indexOf(N.label)!==-1?S:e.filter(U=>U.color).length===0?r[0]:N.color?r[a.indexOf(N.color)]:Pe.gray:e.filter(U=>U.color).length===0?r[0]:N.color?r[a.indexOf(N.color)]:Pe.gray,transition:{duration:q.duration}}},initial:"initial",animate:X?"whileInView":"initial",exit:{opacity:0,transition:{duration:q.duration}},r:o}):l.jsx($e.rect,{y:0-o,x:-1,height:o*2,width:2,variants:{initial:{fill:S&&g?g.indexOf(N.label)!==-1?S:e.filter(U=>U.color).length===0?r[0]:N.color?r[a.indexOf(N.color)]:Pe.gray:e.filter(U=>U.color).length===0?r[0]:N.color?r[a.indexOf(N.color)]:Pe.gray},whileInView:{fill:S&&g?g.indexOf(N.label)!==-1?S:e.filter(U=>U.color).length===0?r[0]:N.color?r[a.indexOf(N.color)]:Pe.gray:e.filter(U=>U.color).length===0?r[0]:N.color?r[a.indexOf(N.color)]:Pe.gray,transition:{duration:q.duration}}},initial:"initial",animate:X?"whileInView":"initial",exit:{opacity:0,transition:{duration:q.duration}}}),g.length!==0&&g.indexOf(N.label)!==-1?l.jsx($e.text,{x:0,y:0-o-5,variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:q.duration}}},initial:"initial",animate:X?"whileInView":"initial",exit:{opacity:0,transition:{duration:q.duration}},style:{fill:V||(S&&g?g.indexOf(N.label)!==-1?S:e.filter(U=>U.color).length===0?r[0]:N.color?r[a.indexOf(N.color)]:Pe.gray:e.filter(U=>U.color).length===0?r[0]:N.color?r[a.indexOf(N.color)]:Pe.gray),textAnchor:"middle",...x?.graphObjectValues||{}},className:Ce.cn("graph-value text-sm font-bold",$?.graphObjectValues),children:qe(N.position,"NA",_,I,j)}):null]},N.label)),ce.map((N,U)=>l.jsx("text",{x:N,y:ie/2+o,style:{textAnchor:U===0?"start":U===ce.length-1?"end":"middle",...x?.xAxis?.labels||{}},className:Ce.cn("fill-primary-gray-550 dark:fill-primary-gray-500 text-xs",$?.xAxis?.labels),dy:"1em",children:qe(oe.invert(N),"NA",_,I,j)},U))]}),b.filter(N=>N.position==="after").map(N=>N.layer)]})}),z&&f&&O&&Q?l.jsx(st,{data:z,body:f,xPos:O,yPos:Q,backgroundStyle:x?.tooltip,className:$?.tooltip}):null,D&&A!==void 0?l.jsx(Ce.Modal,{open:A!==void 0,onClose:()=>{M(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof D=="string"?{__html:lt(D,A)}:void 0,children:typeof D=="function"?D(A):null})}):null]})}function UP(t){const{data:e,graphTitle:n,colors:i,sources:r,graphDescription:a,height:o,width:s,footNote:c,colorDomain:u,colorLegendTitle:h,radius:f=5,padding:d,backgroundColor:g=!1,leftMargin:p=5,rightMargin:y=5,topMargin:v=10,bottomMargin:m=10,tooltip:I,relativeHeight:j,onSeriesMouseOver:w,showColorScale:S=!0,highlightedDataPoints:P=[],graphID:W,minValue:D,maxValue:x,onSeriesMouseClick:$,graphDownload:V=!1,dataDownload:q=!1,prefix:ae="",suffix:G="",stripType:_="dot",language:b="en",highlightColor:B,dotOpacity:X=.3,showNAColor:z=!0,minHeight:C=0,theme:A="light",ariaLabel:M,resetSelectionOnDoubleClick:O=!0,detailsOnClick:K,styles:Q,classNames:se,valueColor:T,animate:Z=!1,noOfTicks:ie=2,dimmedOpacity:ue=.3,precision:he=2,customLayers:Y=[]}=t,[ge,oe]=k.useState(0),[ce,N]=k.useState(0),[U,ve]=k.useState(void 0),J=k.useRef(null),R=k.useRef(null);return k.useEffect(()=>{const le=new ResizeObserver(ee=>{oe(s||ee[0].target.clientWidth||620),N(o||ee[0].target.clientHeight||480)});return J.current&&(N(J.current.clientHeight||480),oe(J.current.clientWidth||620),s||le.observe(J.current)),()=>le.disconnect()},[s,o]),l.jsx("div",{className:`${A||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:b==="he"||b==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${g?g===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${b||"en"}`,se?.graphContainer),style:{...Q?.graphContainer||{},...g&&g!==!0?{backgroundColor:g}:{}},id:W,ref:R,"aria-label":M||`${n?`The graph shows ${n}. `:""}This is a strip chart showing distribution of data along the horizontal axis. Each dot represents an individual data point, helping to visualize the spread and clustering of values.${a?` ${a}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:g?d||"1rem":d||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||a||V||q?l.jsx(Qe,{styles:{title:Q?.title,description:Q?.description},classNames:{title:se?.title,description:se?.description},graphTitle:n,graphDescription:a,width:s,graphDownload:V?R.current:void 0,dataDownload:q?e.map(le=>le.data).filter(le=>le!==void 0).length>0?e.map(le=>le.data).filter(le=>le!==void 0):e.filter(le=>le!==void 0):null}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[S!==!1&&e.filter(le=>le.color).length!==0?l.jsx(tn,{width:s,colorLegendTitle:h,colors:i||Pe[A].categoricalColors.colors,colorDomain:u||Xe(e.filter(le=>le.color),"color").map(le=>le.color),setSelectedColor:ve,showNAColor:z??!0}):null,l.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:J,"aria-label":"Graph area",children:(s||ge)&&(o||ce)?l.jsx(qP,{data:e,width:s||ge,height:Math.max(C,o||(j?C?(s||ge)*j>C?(s||ge)*j:C:(s||ge)*j:ce)),colorDomain:e.filter(le=>le.color).length===0?[]:u||Xe(e.filter(le=>le.color),"color").map(le=>le.color),colors:e.filter(le=>le.color).length===0?i?[i]:[Pe.primaryColors["blue-600"]]:i||Pe[A].categoricalColors.colors,selectedColor:U,radius:f,leftMargin:p,rightMargin:y,topMargin:v,bottomMargin:m,tooltip:I,onSeriesMouseOver:w,highlightedDataPoints:P,minValue:D,maxValue:x,onSeriesMouseClick:$,prefix:ae,suffix:G,stripType:_,highlightColor:B,dotOpacity:X,resetSelectionOnDoubleClick:O,detailsOnClick:K,styles:Q,classNames:se,valueColor:T,animate:Z===!0?{duration:.5,once:!0,amount:.5}:Z||{duration:0,once:!0,amount:0},noOfTicks:ie,dimmedOpacity:ue,precision:he,customLayers:Y}):null})]})}),r||c?l.jsx(et,{styles:{footnote:Q?.footnote,source:Q?.source},classNames:{footnote:se?.footnote,source:se?.source},sources:r,footNote:c,width:s}):null]})})})})}function XP(t){const{data:e,width:n,height:i,colors:r,colorDomain:a,radius:o,leftMargin:s,rightMargin:c,topMargin:u,bottomMargin:h,tooltip:f,onSeriesMouseOver:d,highlightedDataPoints:g,selectedColor:p,minValue:y,maxValue:v,onSeriesMouseClick:m,noOfTicks:I,prefix:j,suffix:w,stripType:S,highlightColor:P,dotOpacity:W,resetSelectionOnDoubleClick:D,detailsOnClick:x,styles:$,classNames:V,valueColor:q,animate:ae,dimmedOpacity:G,precision:_,customLayers:b}=t,B=k.useRef(null),X=ct(B,{once:ae.once,amount:ae.amount}),[z,C]=k.useState(void 0),[A,M]=k.useState(void 0),[O,K]=k.useState(void 0),[Q,se]=k.useState(void 0),T={top:u,bottom:h,left:s,right:c},Z=n-T.left-T.right,ie=i-T.top-T.bottom,ue=e.map((N,U)=>({...N,id:`${U}`})),he=tt(ue,N=>{const U=(g||[]).indexOf(N.label);return U===-1?1/0:U}).reverse(),Y=je(v)?Math.max(...e.filter(N=>!je(N.position)).map(N=>N.position))<0?0:Math.max(...e.filter(N=>!je(N.position)).map(N=>N.position)):v,ge=je(y)?Math.min(...e.filter(N=>!je(N.position)).map(N=>N.position))>=0?0:Math.min(...e.filter(N=>!je(N.position)).map(N=>N.position)):y,oe=ut().domain([ge,Y]).range([ie,0]).nice(),ce=lw(I,ie);return l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{width:`${n}px`,height:`${i}px`,viewBox:`0 0 ${n} ${i}`,direction:"ltr",ref:B,children:l.jsxs("g",{transform:`translate(${T.left},${T.top})`,children:[b.filter(N=>N.position==="before").map(N=>N.layer),l.jsxs(mt,{children:[he.map(N=>l.jsxs($e.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:Z/2,y:oe(0)},whileInView:{x:Z/2,y:oe(N.position),opacity:p?N.color&&r[a.indexOf(N.color)]===p?.95:G:g.length!==0?g.indexOf(N.label)!==-1?.95:G:W,transition:{duration:ae.duration}}},initial:"initial",animate:X?"whileInView":"initial",exit:{opacity:0,transition:{duration:ae.duration}},onMouseEnter:U=>{C(N),se(U.clientY),K(U.clientX),d?.(N)},onClick:()=>{(m||x)&&(dt(A,N)&&D?(M(void 0),m?.(void 0)):(M(N),m?.(N)))},onMouseMove:U=>{C(N),se(U.clientY),K(U.clientX)},onMouseLeave:()=>{C(void 0),K(void 0),se(void 0),d?.(void 0)},children:[S==="dot"?l.jsx($e.circle,{cy:0,cx:0,variants:{initial:{fill:P&&g?g.indexOf(N.label)!==-1?P:e.filter(U=>U.color).length===0?r[0]:N.color?r[a.indexOf(N.color)]:Pe.gray:e.filter(U=>U.color).length===0?r[0]:N.color?r[a.indexOf(N.color)]:Pe.gray},whileInView:{fill:P&&g?g.indexOf(N.label)!==-1?P:e.filter(U=>U.color).length===0?r[0]:N.color?r[a.indexOf(N.color)]:Pe.gray:e.filter(U=>U.color).length===0?r[0]:N.color?r[a.indexOf(N.color)]:Pe.gray,transition:{duration:ae.duration}}},initial:"initial",animate:X?"whileInView":"initial",exit:{opacity:0,transition:{duration:ae.duration}},r:o}):l.jsx($e.rect,{x:0-o,y:-1,width:o*2,height:2,variants:{initial:{fill:P&&g?g.indexOf(N.label)!==-1?P:e.filter(U=>U.color).length===0?r[0]:N.color?r[a.indexOf(N.color)]:Pe.gray:e.filter(U=>U.color).length===0?r[0]:N.color?r[a.indexOf(N.color)]:Pe.gray},whileInView:{fill:P&&g?g.indexOf(N.label)!==-1?P:e.filter(U=>U.color).length===0?r[0]:N.color?r[a.indexOf(N.color)]:Pe.gray:e.filter(U=>U.color).length===0?r[0]:N.color?r[a.indexOf(N.color)]:Pe.gray,transition:{duration:ae.duration}}},initial:"initial",animate:X?"whileInView":"initial",exit:{opacity:0,transition:{duration:ae.duration}}}),g.length!==0&&g.indexOf(N.label)!==-1?l.jsx($e.text,{y:0,dy:"0.33em",x:0+o+3,variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:ae.duration}}},initial:"initial",animate:X?"whileInView":"initial",exit:{opacity:0,transition:{duration:ae.duration}},style:{fill:q||(P&&g?g.indexOf(N.label)!==-1?P:e.filter(U=>U.color).length===0?r[0]:N.color?r[a.indexOf(N.color)]:Pe.gray:e.filter(U=>U.color).length===0?r[0]:N.color?r[a.indexOf(N.color)]:Pe.gray),textAnchor:"start",...$?.graphObjectValues||{}},className:Ce.cn("graph-value text-sm font-bold",V?.graphObjectValues),children:qe(N.position,"NA",_,j,w)}):null]},N.label)),ce.map((N,U)=>l.jsx("text",{y:N,x:Z/2+o+5,style:{textAnchor:"start",...$?.yAxis?.labels||{}},className:Ce.cn("fill-primary-gray-550 dark:fill-primary-gray-500 text-xs",V?.yAxis?.labels),children:qe(oe.invert(N),"NA",_,j,w)},U))]}),b.filter(N=>N.position==="after").map(N=>N.layer)]})}),z&&f&&O&&Q?l.jsx(st,{data:z,body:f,xPos:O,yPos:Q,backgroundStyle:$?.tooltip,className:V?.tooltip}):null,x&&A!==void 0?l.jsx(Ce.Modal,{open:A!==void 0,onClose:()=>{M(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof x=="string"?{__html:lt(x,A)}:void 0,children:typeof x=="function"?x(A):null})}):null]})}function KP(t){const{data:e,graphTitle:n,colors:i,sources:r,graphDescription:a,height:o,width:s,footNote:c,colorDomain:u,colorLegendTitle:h,radius:f=5,padding:d,backgroundColor:g=!1,leftMargin:p=20,rightMargin:y=20,topMargin:v=10,bottomMargin:m=10,tooltip:I,relativeHeight:j,onSeriesMouseOver:w,showColorScale:S=!0,highlightedDataPoints:P=[],graphID:W,minValue:D,maxValue:x,onSeriesMouseClick:$,graphDownload:V=!1,dataDownload:q=!1,prefix:ae="",suffix:G="",stripType:_="dot",language:b="en",highlightColor:B,dotOpacity:X=.3,showNAColor:z=!0,minHeight:C=0,theme:A="light",ariaLabel:M,resetSelectionOnDoubleClick:O=!0,detailsOnClick:K,styles:Q,classNames:se,valueColor:T,animate:Z=!1,noOfTicks:ie=2,dimmedOpacity:ue=.3,precision:he=2,customLayers:Y=[]}=t,[ge,oe]=k.useState(0),[ce,N]=k.useState(0),[U,ve]=k.useState(void 0),J=k.useRef(null),R=k.useRef(null);return k.useEffect(()=>{const le=new ResizeObserver(ee=>{oe(s||ee[0].target.clientWidth||620),N(o||ee[0].target.clientHeight||480)});return J.current&&(N(J.current.clientHeight||480),oe(J.current.clientWidth||620),s||le.observe(J.current)),()=>le.disconnect()},[s,o]),l.jsx("div",{className:`${A||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:b==="he"||b==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${g?g===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${b||"en"}`,se?.graphContainer),style:{...Q?.graphContainer||{},...g&&g!==!0?{backgroundColor:g}:{}},id:W,ref:R,"aria-label":M||`${n?`The graph shows ${n}. `:""}This is a strip chart showing distribution of data along the vertical axis. Each dot represents an individual data point, helping to visualize the spread and clustering of values.${a?` ${a}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:g?d||"1rem":d||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||a||V||q?l.jsx(Qe,{styles:{title:Q?.title,description:Q?.description},classNames:{title:se?.title,description:se?.description},graphTitle:n,graphDescription:a,width:s,graphDownload:V?R.current:void 0,dataDownload:q?e.map(le=>le.data).filter(le=>le!==void 0).length>0?e.map(le=>le.data).filter(le=>le!==void 0):e.filter(le=>le!==void 0):null}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[S!==!1&&e.filter(le=>le.color).length!==0?l.jsx(tn,{width:s,colorLegendTitle:h,colors:i||Pe[A].categoricalColors.colors,colorDomain:u||Xe(e.filter(le=>le.color),"color").map(le=>le.color),setSelectedColor:ve,showNAColor:z}):null,l.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:J,children:(s||ge)&&(o||ce)?l.jsx(XP,{data:e,width:s||ge,height:Math.max(C,o||(j?C?(s||ge)*j>C?(s||ge)*j:C:(s||ge)*j:ce)),colorDomain:e.filter(le=>le.color).length===0?[]:u||Xe(e.filter(le=>le.color),"color").map(le=>le.color),colors:e.filter(le=>le.color).length===0?i?[i]:[Pe.primaryColors["blue-600"]]:i||Pe[A].categoricalColors.colors,selectedColor:U,radius:f,leftMargin:p,rightMargin:y,topMargin:v,bottomMargin:m,tooltip:I,onSeriesMouseOver:w,highlightedDataPoints:P,minValue:D,maxValue:x,onSeriesMouseClick:$,prefix:ae,suffix:G,stripType:_,highlightColor:B,dotOpacity:X,resetSelectionOnDoubleClick:O,detailsOnClick:K,styles:Q,classNames:se,valueColor:T,animate:Z===!0?{duration:.5,once:!0,amount:.5}:Z||{duration:0,once:!0,amount:0},noOfTicks:ie,dimmedOpacity:ue,precision:he,customLayers:Y}):null})]})}),r||c?l.jsx(et,{styles:{footnote:Q?.footnote,source:Q?.source},classNames:{footnote:se?.footnote,source:se?.source},sources:r,footNote:c,width:s}):null]})})})})}function cw(t){const{data:e,graphTitle:n,colors:i,sources:r,graphDescription:a,height:o,width:s,footNote:c,colorDomain:u,colorLegendTitle:h,radius:f,padding:d,backgroundColor:g,leftMargin:p,rightMargin:y,topMargin:v,bottomMargin:m,tooltip:I,relativeHeight:j,onSeriesMouseOver:w,showColorScale:S,highlightedDataPoints:P,graphID:W,minValue:D,maxValue:x,onSeriesMouseClick:$,noOfTicks:V,graphDownload:q,dataDownload:ae,prefix:G,suffix:_,stripType:b,language:B,highlightColor:X,dotOpacity:z,showNAColor:C,minHeight:A,theme:M,ariaLabel:O,valueColor:K,resetSelectionOnDoubleClick:Q,detailsOnClick:se,orientation:T="vertical",styles:Z,classNames:ie,animate:ue,dimmedOpacity:he=.3,precision:Y,customLayers:ge}=t;return T==="vertical"?l.jsx(KP,{data:e,graphTitle:n,colors:i,sources:r,graphDescription:a,height:o,width:s,footNote:c,colorDomain:u,colorLegendTitle:h,radius:f,padding:d,backgroundColor:g,leftMargin:p,rightMargin:y,topMargin:v,bottomMargin:m,tooltip:I,relativeHeight:j,onSeriesMouseOver:w,showColorScale:S,highlightedDataPoints:P,graphID:W,minValue:D,maxValue:x,onSeriesMouseClick:$,noOfTicks:V,graphDownload:q,dataDownload:ae,prefix:G,suffix:_,stripType:b,language:B,highlightColor:X,dotOpacity:z,showNAColor:C,minHeight:A,theme:M,ariaLabel:O,resetSelectionOnDoubleClick:Q,styles:Z,valueColor:K,detailsOnClick:se,classNames:ie,animate:ue,dimmedOpacity:he,precision:Y,customLayers:ge}):l.jsx(UP,{data:e,graphTitle:n,colors:i,sources:r,graphDescription:a,height:o,width:s,footNote:c,colorDomain:u,colorLegendTitle:h,radius:f,padding:d,backgroundColor:g,leftMargin:p,rightMargin:y,topMargin:v,bottomMargin:m,tooltip:I,relativeHeight:j,onSeriesMouseOver:w,showColorScale:S,highlightedDataPoints:P,graphID:W,minValue:D,maxValue:x,onSeriesMouseClick:$,noOfTicks:V,graphDownload:q,dataDownload:ae,prefix:G,suffix:_,stripType:b,language:B,highlightColor:X,dotOpacity:z,showNAColor:C,minHeight:A,theme:M,ariaLabel:O,resetSelectionOnDoubleClick:Q,styles:Z,valueColor:K,detailsOnClick:se,classNames:ie,animate:ue,dimmedOpacity:he,precision:Y,customLayers:ge})}function QP(t){const{data:e,width:n,height:i,barColor:r,lineColor:a,axisTitles:o,sameAxes:s,rightMargin:c,leftMargin:u,topMargin:h,bottomMargin:f,tooltip:d,showValues:g,onSeriesMouseOver:p,barPadding:y,truncateBy:v,showLabels:m,onSeriesMouseClick:I,resetSelectionOnDoubleClick:j,detailsOnClick:w,noOfTicks:S,lineSuffix:P,barSuffix:W,linePrefix:D,barPrefix:x,curveType:$,styles:V,classNames:q,animate:ae,precision:G,customLayers:_,naLabel:b}=t,B=k.useRef(null),X=ct(B,{once:ae.once,amount:ae.amount}),z=$==="linear"?Oi:$==="step"?Or:$==="stepAfter"?Ir:$==="stepBefore"?Nr:_r,[C,A]=k.useState(void 0),[M,O]=k.useState(void 0),[K,Q]=k.useState(void 0),[se,T]=k.useState(void 0),Z={top:h,bottom:f,left:u+50,right:c+65},ie=n-Z.left-Z.right,ue=i-Z.top-Z.bottom,he=e.map((te,Me)=>({...te,id:`${Me}`})),Y=xn().domain(he.map(te=>`${te.id}`)).range([0,ie]).paddingInner(y),ge=Math.min(...he.map(te=>te.bar).filter(te=>te!=null))!==1/0?Math.min(...he.map(te=>te.bar).filter(te=>te!=null))>0?0:Math.min(...he.map(te=>te.bar).filter(te=>te!=null)):0,oe=Math.min(...he.map(te=>te.line).filter(te=>te!=null))!==1/0?Math.min(...he.map(te=>te.line).filter(te=>te!=null))>0?0:Math.min(...he.map(te=>te.line).filter(te=>te!=null)):0,ce=Math.max(...he.map(te=>te.bar).filter(te=>te!=null))!==1/0?Math.max(...he.map(te=>te.bar).filter(te=>te!=null)):0,N=Math.max(...he.map(te=>te.line).filter(te=>te!=null))!==1/0?Math.max(...he.map(te=>te.line).filter(te=>te!=null)):0,U=ge<oe?ge:oe,ve=ce>N?ce:N,J=ut().domain([s?U:ge,s?ve>0?ve:0:ce>0?ce:0]).range([ue,0]).nice(),R=ut().domain([s?U:oe,s?ve>0?ve:0:N>0?N:0]).range([ue,0]).nice(),le=ii().defined(te=>!je(te.line)).x(te=>Y(`${te.id}`)+Y.bandwidth()/2).y(te=>R(te.line)).curve(z),ee=J.ticks(S),de=R.ticks(S);return l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{width:`${n}px`,height:`${i}px`,viewBox:`0 0 ${n} ${i}`,direction:"ltr",ref:B,children:l.jsxs("g",{transform:`translate(${Z.left},${Z.top})`,children:[l.jsxs("g",{children:[ee.map((te,Me)=>l.jsxs("g",{children:[l.jsx("line",{y1:J(te),y2:J(te),x1:-15,x2:-20,style:{stroke:r,strokeWidth:1,...V?.yAxis?.gridLines||{}},className:q?.yAxis?.gridLines}),l.jsx("text",{x:-25,y:J(te),dy:"0.33em",className:Ce.cn("text-xs",q?.yAxis?.labels),style:{textAnchor:"end",fill:r,...V?.yAxis?.labels||{}},children:qe(te,b,G,x,W)})]},Me)),l.jsx(Dt,{y1:0,y2:ue,x1:-15,x2:-15,classNames:{axis:q?.xAxis?.axis},styles:{axis:{stroke:r,...V?.xAxis?.axis||{}}}}),l.jsx(Nt,{x:10-Z.left,y:ue/2,style:{fill:r,...V?.yAxis?.title||{}},className:q?.yAxis?.title,text:o[0].length>100?`${o[0].substring(0,100)}...`:o[0],rotate90:!0})]}),l.jsxs("g",{children:[de.map((te,Me)=>l.jsxs("g",{children:[l.jsx("line",{y1:R(te),y2:R(te),x1:ie+15,x2:ie+20,style:{stroke:a,strokeWidth:1,...V?.yAxis?.gridLines||{}},className:q?.yAxis?.gridLines}),l.jsx("text",{x:ie+25,y:R(te),dy:"0.33em",dx:-2,style:{textAnchor:"start",fill:a,...V?.yAxis?.labels||{}},className:Ce.cn("text-xs",q?.yAxis?.labels),children:qe(te,b,G,D,P)})]},Me)),l.jsx(Dt,{y1:0,y2:ue,x1:ie+15,x2:ie+15,classNames:{axis:q?.xAxis?.axis},styles:{axis:{stroke:a,...V?.xAxis?.axis||{}}}}),l.jsx(Nt,{x:ie+Z.right-15,y:ue/2,style:{fill:a,...V?.yAxis?.title||{}},className:q?.yAxis?.title,text:o[1].length>100?`${o[1].substring(0,100)}...`:o[1],rotate90:!0})]}),l.jsx(Dt,{y1:s?J(0):ue,y2:s?J(0):ue,x1:-15,x2:ie+15,classNames:{axis:q?.xAxis?.axis},styles:{axis:V?.xAxis?.axis}}),_.filter(te=>te.position==="before").map(te=>te.layer),l.jsxs(mt,{children:[he.map((te,Me)=>l.jsxs($e.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:be=>{A(te),T(be.clientY),Q(be.clientX),p?.(te)},onClick:()=>{(I||w)&&(dt(M,te)&&j?(O(void 0),I?.(void 0)):(O(te),I?.(te)))},onMouseMove:be=>{A(te),T(be.clientY),Q(be.clientX)},onMouseLeave:()=>{A(void 0),Q(void 0),T(void 0),p?.(void 0)},children:[l.jsx($e.rect,{variants:{initial:{attrY:J(0),height:0,opacity:1},whileInView:{attrY:te.bar?te.bar>0?J(te.bar):J(0):0,height:te.bar?Math.abs(J(te.bar)-J(0)):0,opacity:1,transition:{duration:ae.duration}}},initial:"initial",animate:X?"whileInView":"initial",exit:{attrY:J(0),height:0,opacity:0,transition:{duration:ae.duration}},x:Y(`${Me}`),width:Y.bandwidth(),style:{fill:r}}),g&&!je(te.bar)?l.jsx($e.text,{x:Y(`${te.id}`)+Y.bandwidth()/2,exit:{attrY:J(0),opacity:0,transition:{duration:ae.duration}},variants:{initial:{attrY:J(0),opacity:0},whileInView:{attrY:J(te.bar||0),opacity:1,transition:{duration:ae.duration}}},initial:"initial",animate:X?"whileInView":"initial",style:{fill:r,textAnchor:"middle",...V?.graphObjectValues||{}},className:Ce.cn("graph-value text-sm",q?.graphObjectValues),dy:te.bar?te.bar>=0?"-5px":"1em":"-5px",children:qe(te.bar,b,G,x,W)}):null,m?l.jsx(ro,{value:`${te.label}`.length<v?`${te.label}`:`${`${te.label}`.substring(0,v)}...`,y:ue+5,x:Y(`${te.id}`),width:Y.bandwidth(),height:Z.bottom,style:V?.xAxis?.labels,className:q?.xAxis?.labels,alignment:"top",animate:ae,isInView:X}):null]},te.label)),l.jsx($e.path,{exit:{opacity:0,transition:{duration:ae.duration}},variants:{initial:{d:le(he.map(te=>({...te,line:0}))),opacity:0},whileInView:{d:le(he),opacity:1,transition:{duration:ae.duration}}},initial:"initial",animate:X?"whileInView":"initial",style:{stroke:a,fill:"none",strokeWidth:2}}),he.map((te,Me)=>l.jsx("g",{children:je(te.line)?null:l.jsxs("g",{onMouseEnter:be=>{A(te),T(be.clientY),Q(be.clientX),p?.(te)},onClick:()=>{(I||w)&&(dt(M,te)&&j?(O(void 0),I?.(void 0)):(O(te),I?.(te)))},onMouseMove:be=>{A(te),T(be.clientY),Q(be.clientX)},onMouseLeave:()=>{A(void 0),Q(void 0),T(void 0),p?.(void 0)},children:[l.jsx($e.circle,{exit:{cy:R(0),opacity:0,transition:{duration:ae.duration}},variants:{initial:{cy:R(0),opacity:0},whileInView:{cy:R(te.line),opacity:1,transition:{duration:ae.duration}}},initial:"initial",animate:X?"whileInView":"initial",cx:Y(te.id)+Y.bandwidth()/2,r:ie/he.length<5?0:ie/he.length<20?2:4,style:{fill:a}}),g?l.jsx($e.text,{x:Y(`${te.id}`)+Y.bandwidth()/2,exit:{y:R(0),opacity:0,transition:{duration:ae.duration}},style:{fill:a,textAnchor:"middle",...V?.graphObjectValues||{}},variants:{initial:{y:R(0),opacity:0},whileInView:{y:R(te.line),opacity:1,transition:{duration:ae.duration}}},initial:"initial",animate:X?"whileInView":"initial",className:Ce.cn("graph-value text-sm",q?.graphObjectValues),dy:"-5px",children:qe(te.line,b,G,D,P)}):null]})},Me))]}),_.filter(te=>te.position==="after").map(te=>te.layer)]})}),C&&d&&K&&se?l.jsx(st,{data:C,body:d,xPos:K,yPos:se,backgroundStyle:V?.tooltip,className:q?.tooltip}):null,w&&M!==void 0?l.jsx(Ce.Modal,{open:M!==void 0,onClose:()=>{O(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof w=="string"?{__html:lt(w,M)}:void 0,children:typeof w=="function"?w(M):null})}):null]})}function uw(t){const{data:e,graphTitle:n,sources:i,graphDescription:r,height:a,width:o,footNote:s,padding:c,lineColor:u=Pe.light.categoricalColors.colors[1],barColor:h=Pe.light.categoricalColors.colors[0],sameAxes:f=!1,backgroundColor:d=!1,leftMargin:g=80,rightMargin:p=80,topMargin:y=20,bottomMargin:v=25,lineAxisTitle:m="Line chart",barAxisTitle:I="Bar graph",tooltip:j,relativeHeight:w,onSeriesMouseOver:S,graphID:P,graphDownload:W=!1,dataDownload:D=!1,barPadding:x=.25,truncateBy:$=999,showLabels:V=!0,onSeriesMouseClick:q,language:ae="en",colorLegendTitle:G,minHeight:_=0,theme:b="light",ariaLabel:B,resetSelectionOnDoubleClick:X=!0,detailsOnClick:z,showValues:C=!0,noOfTicks:A=5,lineSuffix:M="",barSuffix:O="",linePrefix:K="",barPrefix:Q="",curveType:se="curve",styles:T,classNames:Z,animate:ie=!1,precision:ue=2,customLayers:he=[],naLabel:Y="NA"}=t,[ge,oe]=k.useState(0),[ce,N]=k.useState(0),U=k.useRef(null),ve=k.useRef(null);return k.useEffect(()=>{const J=new ResizeObserver(R=>{oe(o||R[0].target.clientWidth||620),N(a||R[0].target.clientHeight||480)});return U.current&&(N(U.current.clientHeight||480),oe(U.current.clientWidth||620),o||J.observe(U.current)),()=>J.disconnect()},[o,a]),l.jsx("div",{className:`${b||"light"} flex ${o?"w-fit grow-0":"w-full grow"}`,dir:ae==="he"||ae==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${d?d===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${ae||"en"}`,Z?.graphContainer),style:{...T?.graphContainer||{},...d&&d!==!0?{backgroundColor:d}:{}},id:P,ref:ve,"aria-label":B||`${n?`The graph shows ${n}. `:""}This is a pareto chart that shows a variable as bars and another as line chart.${r?` ${r}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:d?c||"1rem":c||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||r||W||D?l.jsx(Qe,{styles:{title:T?.title,description:T?.description},classNames:{title:Z?.title,description:Z?.description},graphTitle:n,graphDescription:r,width:o,graphDownload:W?ve.current:void 0,dataDownload:D?e.map(J=>J.data).filter(J=>J!==void 0).length>0?e.map(J=>J.data).filter(J=>J!==void 0):e.filter(J=>J!==void 0):null}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[l.jsx(Hi,{colorDomain:[I,m],colors:[h||Pe[b].categoricalColors.colors[0],u||Pe[b].categoricalColors.colors[1]],colorLegendTitle:G,showNAColor:!1}),l.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:U,"aria-label":"Graph area",children:(o||ge)&&(a||ce)?l.jsx(QP,{data:e,sameAxes:f,lineColor:u,barColor:h,width:o||ge,height:Math.max(_,a||(w?_?(o||ge)*w>_?(o||ge)*w:_:(o||ge)*w:ce)),truncateBy:$,leftMargin:g,rightMargin:p,topMargin:y,bottomMargin:v,axisTitles:[I,m],tooltip:j,onSeriesMouseOver:S,barPadding:x,showLabels:V,onSeriesMouseClick:q,resetSelectionOnDoubleClick:X,detailsOnClick:z,noOfTicks:A,lineSuffix:M,barSuffix:O,linePrefix:K,barPrefix:Q,curveType:se,showValues:C,styles:T,classNames:Z,animate:ie===!0?{duration:.5,once:!0,amount:.5}:ie||{duration:0,once:!0,amount:0},precision:ue,customLayers:he,naLabel:Y}):null})]})}),i||s?l.jsx(et,{styles:{footnote:T?.footnote,source:T?.source},classNames:{footnote:Z?.footnote,source:Z?.source},sources:i,footNote:s,width:o}):null]})})})})}function ZP(t){const{data:e,width:n,height:i,barColors:r,centerGap:a,refValues:o,maxValue:s,minValue:c,showValues:u,axisTitles:h,rightMargin:f,leftMargin:d,topMargin:g,bottomMargin:p,tooltip:y,onSeriesMouseOver:v,barPadding:m,truncateBy:I,onSeriesMouseClick:j,showTicks:w,suffix:S,prefix:P,resetSelectionOnDoubleClick:W,detailsOnClick:D,styles:x,classNames:$,noOfTicks:V,animate:q,precision:ae,customLayers:G,minValueLeftBar:_,minValueRightBar:b,naLabel:B}=t,X=k.useRef(null),z=ct(X,{once:q.once,amount:q.amount}),[C,A]=k.useState(void 0),[M,O]=k.useState(void 0),[K,Q]=k.useState(void 0),[se,T]=k.useState(void 0),Z={top:g,bottom:p,left:d,right:f},ie=n-Z.left-Z.right,ue=i-Z.top-Z.bottom,he=e.map((U,ve)=>({...U,id:`${ve}`})),Y=xn().domain(he.map(U=>`${U.id}`)).range([ue,0]).paddingInner(m),ge=ut().domain([c,s]).range([0,(ie-a)/2]).nice(),oe=ge.ticks(V),ce=ut().domain([c,s]).range([(ie-a)/2,0]).nice(),N=ce.ticks(V);return l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{width:`${n}px`,height:`${i}px`,viewBox:`0 0 ${n} ${i}`,direction:"ltr",ref:X,children:l.jsxs("g",{transform:`translate(${Z.left},${Z.top})`,children:[G.filter(U=>U.position==="before").map(U=>U.layer),l.jsxs("g",{transform:"translate(0,0)",children:[w?l.jsx(Rn,{values:N.filter(U=>U!==0),x:N.filter(U=>U!==0).map(U=>ce(U)),y1:0-g,y2:ue+Z.bottom,styles:{gridLines:x?.xAxis?.gridLines,labels:x?.xAxis?.labels},classNames:{gridLines:$?.xAxis?.gridLines,labels:$?.xAxis?.labels},suffix:S,prefix:P,labelType:"secondary",showGridLines:!0,leftLabel:!0,precision:ae}):null,l.jsxs(mt,{children:[he.map((U,ve)=>l.jsxs($e.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:J=>{A(U),T(J.clientY),Q(J.clientX),v?.(U)},onClick:()=>{(j||D)&&(dt(M,U)&&W?(O(void 0),j?.(void 0)):(O(U),j?.(U)))},onMouseMove:J=>{A(U),T(J.clientY),Q(J.clientX)},onMouseLeave:()=>{A(void 0),Q(void 0),T(void 0),v?.(void 0)},children:[U.leftBar?l.jsx($e.rect,{y:Y(`${ve}`),style:{fill:r[0]},height:Y.bandwidth(),variants:{initial:{x:ce(0),width:0},whileInView:{x:U.leftBar<0?ce(0):ce(U.leftBar),width:U.leftBar<0?ce(U.leftBar)-ce(0):ce(0)-ce(U.leftBar),transition:{duration:q.duration}}},initial:"initial",animate:z?"whileInView":"initial",exit:{x:ce(0),width:0,transition:{duration:q.duration}}}):null,u?l.jsx($e.text,{y:Y(`${ve}`)+Y.bandwidth()/2,style:{fill:r[0],textAnchor:U.rightBar&&U.rightBar>0?"end":"start",...x?.graphObjectValues||{}},dx:U.rightBar&&U.rightBar>0?-5:5,dy:"0.33em",className:Ce.cn("graph-value text-sm",$?.graphObjectValues),exit:{opacity:0,transition:{duration:q.duration}},variants:{initial:{x:ce(0),opacity:0},whileInView:{x:U.leftBar?ce(U.leftBar):ce(_<0?0:_),opacity:1,transition:{duration:q.duration}}},initial:"initial",animate:z?"whileInView":"initial",children:qe(U.rightBar,B,ae,P,S)}):null]},U.label)),l.jsx(Dt,{y1:-2.5,y2:ue+Z.bottom,x1:ce(_<0?0:_),x2:ce(_<0?0:_),classNames:{axis:$?.yAxis?.axis},styles:{axis:x?.yAxis?.axis}}),o?l.jsx(l.Fragment,{children:o.map((U,ve)=>l.jsx(Tr,{text:U.text,color:U.color,x:ce(U.value),y1:0-Z.top,y2:ue+Z.bottom,textSide:"left",classNames:U.classNames,styles:U.styles,animate:q,isInView:z},ve))}):null]})]}),l.jsxs("g",{transform:`translate(${(ie+a)/2},0)`,children:[w?l.jsx(Rn,{values:oe.filter(U=>U!==0),x:oe.filter(U=>U!==0).map(U=>ge(U)),y1:0-g,y2:ue+Z.bottom,styles:{gridLines:x?.xAxis?.gridLines,labels:x?.xAxis?.labels},classNames:{gridLines:$?.xAxis?.gridLines,labels:$?.xAxis?.labels},suffix:S,prefix:P,labelType:"secondary",showGridLines:!0,precision:ae}):null,l.jsxs(mt,{children:[he.map((U,ve)=>l.jsxs($e.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:J=>{A(U),T(J.clientY),Q(J.clientX),v?.(U)},onClick:()=>{(j||D)&&(dt(M,U)&&W?(O(void 0),j?.(void 0)):(O(U),j?.(U)))},onMouseMove:J=>{A(U),T(J.clientY),Q(J.clientX)},onMouseLeave:()=>{A(void 0),Q(void 0),T(void 0),v?.(void 0)},children:[U.rightBar?l.jsx($e.rect,{y:Y(`${ve}`),style:{fill:r[1]},height:Y.bandwidth(),exit:{x:ge(0),width:0,transition:{duration:q.duration}},variants:{initial:{x:ge(0),width:0},whileInView:{x:U.rightBar>=0?ge(0):ge(U.rightBar),width:U.rightBar>=0?ge(U.rightBar)-ge(0):ge(0)-ge(U.rightBar),transition:{duration:q.duration}}},initial:"initial",animate:z?"whileInView":"initial"}):null,u?l.jsx($e.text,{y:Y(`${ve}`)+Y.bandwidth()/2,style:{fill:r[1],textAnchor:U.rightBar&&U.rightBar<0?"end":"start",...x?.graphObjectValues||{}},className:Ce.cn("graph-value text-sm",$?.graphObjectValues),dx:U.rightBar&&U.rightBar<0?-5:5,dy:"0.33em",exit:{opacity:0,transition:{duration:q.duration}},variants:{initial:{x:ge(0),opacity:0},whileInView:{x:U.rightBar?ge(U.rightBar):ge(b<0?0:b),opacity:1,transition:{duration:q.duration}}},initial:"initial",animate:z?"whileInView":"initial",children:qe(U.rightBar,B,ae,P,S)}):null]},ve)),l.jsx(Dt,{y1:-2.5,y2:ue+Z.bottom,x1:ge(b<0?0:b),x2:ge(b<0?0:b),classNames:{axis:$?.yAxis?.axis},styles:{axis:x?.yAxis?.axis}}),o?l.jsx(l.Fragment,{children:o.map((U,ve)=>l.jsx(Tr,{text:U.text,color:U.color,x:ge(U.value),y1:0-Z.top,y2:ue+Z.bottom,textSide:"right",classNames:U.classNames,styles:U.styles,animate:q,isInView:z},ve))}):null]})]}),l.jsx(mt,{children:l.jsx($e.g,{transform:`translate(${ie/2},0)`,children:he.map((U,ve)=>l.jsx(io,{value:`${U.label}`.length<I?`${U.label}`:`${`${U.label}`.substring(0,I)}...`,y:Y(`${U.id}`),x:0-a/2,width:a,height:Y.bandwidth(),alignment:"center",style:x?.yAxis?.labels,className:$?.yAxis?.labels,animate:q,isInView:z},ve))})}),l.jsxs("g",{transform:`translate(0,${ue})`,children:[l.jsx("text",{style:{fill:r[0],textAnchor:"end",...x?.yAxis?.title},className:Ce.cn("text-base",$?.yAxis?.title),x:ie/2-a/2,y:0,dx:-5,dy:20,children:h[0]}),l.jsx("text",{style:{fill:r[1],textAnchor:"start",...x?.yAxis?.title},className:Ce.cn("text-base",$?.yAxis?.title),x:ie/2+a/2,y:0,dx:5,dy:20,children:h[1]})]}),G.filter(U=>U.position==="after").map(U=>U.layer)]})}),C&&y&&K&&se?l.jsx(st,{data:C,body:y,xPos:K,yPos:se,backgroundStyle:x?.tooltip,className:$?.tooltip}):null,D&&M!==void 0?l.jsx(Ce.Modal,{open:M!==void 0,onClose:()=>{O(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof D=="string"?{__html:lt(D,M)}:void 0,children:typeof D=="function"?D(M):null})}):null]})}function xo(t,e,n,i){const r=t.map(s=>s[e]).filter(s=>!je(s)),a=je(n)?Math.min(...r)>=0?0:Math.min(...r):n,o=je(i)?Math.max(...r)<0?0:Math.max(...r):i;return{min:a,max:o}}function hw(t){const{data:e,graphTitle:n,sources:i,graphDescription:r,height:a,width:o,footNote:s,padding:c,barColors:u=[Pe.light.categoricalColors.colors[0],Pe.light.categoricalColors.colors[1]],backgroundColor:h=!1,leftMargin:f=20,rightMargin:d=20,topMargin:g=25,bottomMargin:p=30,rightBarTitle:y="Right bar graph",leftBarTitle:v="Left bar graph",tooltip:m,relativeHeight:I,onSeriesMouseOver:j,graphID:w,barPadding:S=.25,truncateBy:P=999,onSeriesMouseClick:W,centerGap:D=100,showValues:x=!0,maxValue:$,minValue:V,refValues:q=[],suffix:ae="",prefix:G="",showTicks:_=!0,showColorScale:b=!1,graphDownload:B=!1,dataDownload:X=!1,language:z="en",colorLegendTitle:C,minHeight:A=0,theme:M="light",ariaLabel:O,resetSelectionOnDoubleClick:K=!0,detailsOnClick:Q,styles:se,classNames:T,noOfTicks:Z=5,animate:ie=!1,precision:ue=2,customLayers:he=[],timeline:Y={enabled:!1,autoplay:!1,showOnlyActiveDate:!0},naLabel:ge="NA"}=t,[oe,ce]=k.useState(0),[N,U]=k.useState(0),[ve,J]=k.useState(Y.autoplay),R=di(Xe(e.filter(be=>be.date!==void 0&&be.date!==null),be=>be.date).map(be=>ze(`${be.date}`,Y.dateFormat||"yyyy",new Date).getTime()),(be,ne)=>an(be,ne)),[le,ee]=k.useState(Y.autoplay?0:R.length-1),de=k.useRef(null),te=k.useRef(null);k.useEffect(()=>{const be=new ResizeObserver(ne=>{ce(o||ne[0].target.clientWidth||620),U(a||ne[0].target.clientHeight||480)});return de.current&&(U(de.current.clientHeight||480),ce(de.current.clientWidth||620),o||be.observe(de.current)),()=>be.disconnect()},[o,a]),k.useEffect(()=>{const be=setInterval(()=>{ee(ne=>ne<R.length-1?ne+1:0)},(Y.speed||2)*1e3);return ve||clearInterval(be),()=>clearInterval(be)},[R,ve,Y.speed]);const Me=yi(R,le,Y.showOnlyActiveDate,Y.dateFormat||"yyyy");return l.jsx("div",{className:`${M||"light"} flex ${o?"w-fit grow-0":"w-full grow"}`,dir:z==="he"||z==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${h?h===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${z||"en"}`,T?.graphContainer),style:{...se?.graphContainer||{},...h&&h!==!0?{backgroundColor:h}:{}},id:w,ref:te,"aria-label":O||`${n?`The graph shows ${n}. `:""}This is a diverging bar chart. ${r?` ${r}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:h?c||"1rem":c||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||r||B||X?l.jsx(Qe,{styles:{title:se?.title,description:se?.description},classNames:{title:T?.title,description:T?.description},graphTitle:n,graphDescription:r,width:o,graphDownload:B?te.current:void 0,dataDownload:X?e.map(be=>be.data).filter(be=>be!==void 0).length>0?e.map(be=>be.data).filter(be=>be!==void 0):e.filter(be=>be!==void 0):null}):null,Y.enabled&&R.length>0&&Me?l.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[l.jsx("button",{type:"button",onClick:()=>{J(!ve)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":ve?"Click to pause animation":"Click to play animation",children:ve?l.jsx(mi,{}):l.jsx(pi,{})}),l.jsx(Ce.SliderUI,{min:R[0],max:R[R.length-1],marks:Me,step:null,defaultValue:R[R.length-1],value:R[le],onChangeComplete:be=>{ee(R.indexOf(be))},onChange:be=>{ee(R.indexOf(be))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[b?l.jsx(Hi,{colorLegendTitle:C,colorDomain:[v,y],colors:u,showNAColor:!1}):null,l.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:de,"aria-label":"Graph area",children:(o||oe)&&(a||N)?l.jsx(ZP,{data:Q2(e,Y.dateFormat||"yyyy").filter(be=>Y.enabled?be.date===ft(new Date(R[le]),Y.dateFormat||"yyyy"):be),barColors:u,width:o||oe,centerGap:D,height:Math.max(A,a||(I?A?(o||oe)*I>A?(o||oe)*I:A:(o||oe)*I:N)),truncateBy:P,leftMargin:f,rightMargin:d,topMargin:g,bottomMargin:p,axisTitles:[v,y],tooltip:m,onSeriesMouseOver:j,barPadding:S,refValues:q,maxValue:Math.max(xo(e,"leftBar",V,$).max,xo(e,"rightBar",V,$).max),minValue:Math.min(xo(e,"leftBar",V,$).min,xo(e,"rightBar",V,$).min),minValueLeftBar:xo(e,"leftBar",V,$).min,minValueRightBar:xo(e,"rightBar",V,$).min,showValues:x,onSeriesMouseClick:W,showTicks:_,suffix:ae,prefix:G,resetSelectionOnDoubleClick:K,detailsOnClick:Q,styles:se,classNames:T,noOfTicks:Z,animate:ie===!0?{duration:.5,once:!0,amount:.5}:ie||{duration:0,once:!0,amount:0},precision:ue,customLayers:he,naLabel:ge}):null})]})}),i||s?l.jsx(et,{styles:{footnote:se?.footnote,source:se?.source},classNames:{footnote:T?.footnote,source:T?.source},sources:i,footNote:s,width:o}):null]})})})})}function fw(t){const{data:e,graphTitle:n,sources:i,graphDescription:r,barPadding:a,showValues:o,showTicks:s,leftMargin:c,rightMargin:u,height:h,width:f,footNote:d,colors:g,padding:p,backgroundColor:y,topMargin:v,bottomMargin:m,showLabels:I,relativeHeight:j,tooltip:w,onSeriesMouseOver:S,refValues:P,graphID:W,maxValue:D,onSeriesMouseClick:x,graphDownload:$,dataDownload:V,numberOfBins:q,truncateBy:ae,graphType:G,barGraphLayout:_,donutStrokeWidth:b,sortData:B,language:X,minHeight:z,theme:C="light",maxBarThickness:A,ariaLabel:M,detailsOnClick:O,styles:K,classNames:Q,precision:se}=t,[T,Z]=k.useState([]);return k.useEffect(()=>{const ue=yC().thresholds(q||10).value(he=>he.value)(e).map(he=>({label:`${he.x0}-${he.x1}`,size:he.length,data:{options:`${he.x0}-${he.x1}`,frequency:he.length}}));Z(ue)},[e,q]),T.length===0?l.jsx("div",{style:{width:`${f}px`,height:`${h}px`,margin:"auto"},children:l.jsx("div",{className:"flex m-auto items-center justify-center p-0 leading-none text-base h-40",children:l.jsx(Ce.Spinner,{})})}):G==="circlePacking"?l.jsx(td,{colors:g||Pe.graphMainColor,graphTitle:n,graphDescription:r,footNote:d,width:f,height:h,sources:i,leftMargin:c,rightMargin:u,backgroundColor:y,padding:p,topMargin:v,bottomMargin:m,relativeHeight:j,showLabels:I,tooltip:w,onSeriesMouseOver:S,showColorScale:!1,showValues:o,graphID:W,onSeriesMouseClick:x,graphDownload:$,dataDownload:V,data:T,language:X,minHeight:z,theme:C,ariaLabel:M,detailsOnClick:O,styles:K,classNames:Q,precision:se}):G==="treeMap"?l.jsx(Md,{colors:g||Pe.graphMainColor,graphTitle:n,graphDescription:r,footNote:d,width:f,height:h,sources:i,leftMargin:c,rightMargin:u,backgroundColor:y,padding:p,topMargin:v,bottomMargin:m,relativeHeight:j,showLabels:I,tooltip:w,onSeriesMouseOver:S,showColorScale:!1,showValues:o,graphID:W,onSeriesMouseClick:x,graphDownload:$,dataDownload:V,data:T,language:X,minHeight:z,theme:C,ariaLabel:M,detailsOnClick:O,styles:K,classNames:Q,precision:se}):G==="donutChart"?l.jsx(rd,{colors:g||Pe[C].categoricalColors.colors,graphTitle:n,graphDescription:r,footNote:d,radius:f&&h?f<h?f:h:f||h||void 0,sources:i,backgroundColor:y,padding:p,tooltip:w,onSeriesMouseOver:S,graphID:W,onSeriesMouseClick:x,graphDownload:$,dataDownload:V,data:T,strokeWidth:b,showColorScale:!0,sortData:B,language:X,theme:C,ariaLabel:M,detailsOnClick:O,styles:K,classNames:Q,precision:se}):l.jsx(Gf,{colors:g||Pe.graphMainColor,graphTitle:n,graphDescription:r,footNote:d,width:f,height:h,sources:i,leftMargin:c,rightMargin:u,backgroundColor:y,padding:p,topMargin:v,bottomMargin:m,relativeHeight:j,showLabels:I,tooltip:w,onSeriesMouseOver:S,showColorScale:!1,showValues:o,graphID:W,onSeriesMouseClick:x,graphDownload:$,dataDownload:V,data:T,barPadding:a,refValues:P,truncateBy:ae,maxValue:D,showTicks:s,sortData:B,language:X,minHeight:z,theme:C,maxBarThickness:A,ariaLabel:M,orientation:_,detailsOnClick:O,styles:K,classNames:Q,precision:se})}function Km(t,e){let n;if(e===void 0)for(const i of t)i!=null&&(n<i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of t)(r=e(r,++i,t))!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}return n}function dw(t,e){let n;if(e===void 0)for(const i of t)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of t)(r=e(r,++i,t))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function Lu(t,e){let n=0;if(e===void 0)for(let i of t)(i=+i)&&(n+=i);else{let i=-1;for(let r of t)(r=+e(r,++i,t))&&(n+=r)}return n}function JP(t){return t.target.depth}function eE(t,e){return t.sourceLinks.length?t.depth:e-1}function Pu(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?dw(t.sourceLinks,JP)-1:0}function Ol(t){return function(){return t}}function Qm(t,e){return bc(t.source,e.source)||t.index-e.index}function Zm(t,e){return bc(t.target,e.target)||t.index-e.index}function bc(t,e){return t.y0-e.y0}function Eu(t){return t.value}function tE(t){return t.index}function nE(t){return t.nodes}function iE(t){return t.links}function Jm(t,e){const n=t.get(e);if(!n)throw new Error("missing: "+e);return n}function e0({nodes:t}){for(const e of t){let n=e.y0,i=n;for(const r of e.sourceLinks)r.y0=n+r.width/2,n+=r.width;for(const r of e.targetLinks)r.y1=i+r.width/2,i+=r.width}}function Vu(){let t=0,e=0,n=1,i=1,r=24,a=8,o,s=tE,c=eE,u,h,f=nE,d=iE,g=6;function p(){const _={nodes:f.apply(null,arguments),links:d.apply(null,arguments)};return y(_),v(_),m(_),I(_),S(_),e0(_),_}p.update=function(_){return e0(_),_},p.nodeId=function(_){return arguments.length?(s=typeof _=="function"?_:Ol(_),p):s},p.nodeAlign=function(_){return arguments.length?(c=typeof _=="function"?_:Ol(_),p):c},p.nodeSort=function(_){return arguments.length?(u=_,p):u},p.nodeWidth=function(_){return arguments.length?(r=+_,p):r},p.nodePadding=function(_){return arguments.length?(a=o=+_,p):a},p.nodes=function(_){return arguments.length?(f=typeof _=="function"?_:Ol(_),p):f},p.links=function(_){return arguments.length?(d=typeof _=="function"?_:Ol(_),p):d},p.linkSort=function(_){return arguments.length?(h=_,p):h},p.size=function(_){return arguments.length?(t=e=0,n=+_[0],i=+_[1],p):[n-t,i-e]},p.extent=function(_){return arguments.length?(t=+_[0][0],n=+_[1][0],e=+_[0][1],i=+_[1][1],p):[[t,e],[n,i]]},p.iterations=function(_){return arguments.length?(g=+_,p):g};function y({nodes:_,links:b}){for(const[X,z]of _.entries())z.index=X,z.sourceLinks=[],z.targetLinks=[];const B=new Map(_.map((X,z)=>[s(X,z,_),X]));for(const[X,z]of b.entries()){z.index=X;let{source:C,target:A}=z;typeof C!="object"&&(C=z.source=Jm(B,C)),typeof A!="object"&&(A=z.target=Jm(B,A)),C.sourceLinks.push(z),A.targetLinks.push(z)}if(h!=null)for(const{sourceLinks:X,targetLinks:z}of _)X.sort(h),z.sort(h)}function v({nodes:_}){for(const b of _)b.value=b.fixedValue===void 0?Math.max(Lu(b.sourceLinks,Eu),Lu(b.targetLinks,Eu)):b.fixedValue}function m({nodes:_}){const b=_.length;let B=new Set(_),X=new Set,z=0;for(;B.size;){for(const C of B){C.depth=z;for(const{target:A}of C.sourceLinks)X.add(A)}if(++z>b)throw new Error("circular link");B=X,X=new Set}}function I({nodes:_}){const b=_.length;let B=new Set(_),X=new Set,z=0;for(;B.size;){for(const C of B){C.height=z;for(const{source:A}of C.targetLinks)X.add(A)}if(++z>b)throw new Error("circular link");B=X,X=new Set}}function j({nodes:_}){const b=Km(_,z=>z.depth)+1,B=(n-t-r)/(b-1),X=new Array(b);for(const z of _){const C=Math.max(0,Math.min(b-1,Math.floor(c.call(null,z,b))));z.layer=C,z.x0=t+C*B,z.x1=z.x0+r,X[C]?X[C].push(z):X[C]=[z]}if(u)for(const z of X)z.sort(u);return X}function w(_){const b=dw(_,B=>(i-e-(B.length-1)*o)/Lu(B,Eu));for(const B of _){let X=e;for(const z of B){z.y0=X,z.y1=X+z.value*b,X=z.y1+o;for(const C of z.sourceLinks)C.width=C.value*b}X=(i-X+o)/(B.length+1);for(let z=0;z<B.length;++z){const C=B[z];C.y0+=X*(z+1),C.y1+=X*(z+1)}q(B)}}function S(_){const b=j(_);o=Math.min(a,(i-e)/(Km(b,B=>B.length)-1)),w(b);for(let B=0;B<g;++B){const X=Math.pow(.99,B),z=Math.max(1-X,(B+1)/g);W(b,X,z),P(b,X,z)}}function P(_,b,B){for(let X=1,z=_.length;X<z;++X){const C=_[X];for(const A of C){let M=0,O=0;for(const{source:Q,value:se}of A.targetLinks){let T=se*(A.layer-Q.layer);M+=ae(Q,A)*T,O+=T}if(!(O>0))continue;let K=(M/O-A.y0)*b;A.y0+=K,A.y1+=K,V(A)}u===void 0&&C.sort(bc),D(C,B)}}function W(_,b,B){for(let X=_.length,z=X-2;z>=0;--z){const C=_[z];for(const A of C){let M=0,O=0;for(const{target:Q,value:se}of A.sourceLinks){let T=se*(Q.layer-A.layer);M+=G(A,Q)*T,O+=T}if(!(O>0))continue;let K=(M/O-A.y0)*b;A.y0+=K,A.y1+=K,V(A)}u===void 0&&C.sort(bc),D(C,B)}}function D(_,b){const B=_.length>>1,X=_[B];$(_,X.y0-o,B-1,b),x(_,X.y1+o,B+1,b),$(_,i,_.length-1,b),x(_,e,0,b)}function x(_,b,B,X){for(;B<_.length;++B){const z=_[B],C=(b-z.y0)*X;C>1e-6&&(z.y0+=C,z.y1+=C),b=z.y1+o}}function $(_,b,B,X){for(;B>=0;--B){const z=_[B],C=(z.y1-b)*X;C>1e-6&&(z.y0-=C,z.y1-=C),b=z.y0-o}}function V({sourceLinks:_,targetLinks:b}){if(h===void 0){for(const{source:{sourceLinks:B}}of b)B.sort(Zm);for(const{target:{targetLinks:B}}of _)B.sort(Qm)}}function q(_){if(h===void 0)for(const{sourceLinks:b,targetLinks:B}of _)b.sort(Zm),B.sort(Qm)}function ae(_,b){let B=_.y0-(_.sourceLinks.length-1)*o/2;for(const{target:X,width:z}of _.sourceLinks){if(X===b)break;B+=z+o}for(const{source:X,width:z}of b.targetLinks){if(X===_)break;B-=z}return B}function G(_,b){let B=b.y0-(b.targetLinks.length-1)*o/2;for(const{source:X,width:z}of b.targetLinks){if(X===_)break;B+=z+o}for(const{target:X,width:z}of _.sourceLinks){if(X===b)break;B-=z}return B}return p}var Eh=Math.PI,Vh=2*Eh,Va=1e-6,rE=Vh-Va;function Fh(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function gw(){return new Fh}Fh.prototype=gw.prototype={constructor:Fh,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,r,a){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+a)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var a=this._x1,o=this._y1,s=n-t,c=i-e,u=a-t,h=o-e,f=u*u+h*h;if(r<0)throw new Error("negative radius: "+r);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(f>Va)if(!(Math.abs(h*s-c*u)>Va)||!r)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var d=n-a,g=i-o,p=s*s+c*c,y=d*d+g*g,v=Math.sqrt(p),m=Math.sqrt(f),I=r*Math.tan((Eh-Math.acos((p+f-y)/(2*v*m)))/2),j=I/m,w=I/v;Math.abs(j-1)>Va&&(this._+="L"+(t+j*u)+","+(e+j*h)),this._+="A"+r+","+r+",0,0,"+ +(h*d>u*g)+","+(this._x1=t+w*s)+","+(this._y1=e+w*c)}},arc:function(t,e,n,i,r,a){t=+t,e=+e,n=+n,a=!!a;var o=n*Math.cos(i),s=n*Math.sin(i),c=t+o,u=e+s,h=1^a,f=a?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+c+","+u:(Math.abs(this._x1-c)>Va||Math.abs(this._y1-u)>Va)&&(this._+="L"+c+","+u),n&&(f<0&&(f=f%Vh+Vh),f>rE?this._+="A"+n+","+n+",0,1,"+h+","+(t-o)+","+(e-s)+"A"+n+","+n+",0,1,"+h+","+(this._x1=c)+","+(this._y1=u):f>Va&&(this._+="A"+n+","+n+",0,"+ +(f>=Eh)+","+h+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};function t0(t){return function(){return t}}function aE(t){return t[0]}function oE(t){return t[1]}var sE=Array.prototype.slice;function lE(t){return t.source}function cE(t){return t.target}function uE(t){var e=lE,n=cE,i=aE,r=oE,a=null;function o(){var s,c=sE.call(arguments),u=e.apply(this,c),h=n.apply(this,c);if(a||(a=s=gw()),t(a,+i.apply(this,(c[0]=u,c)),+r.apply(this,c),+i.apply(this,(c[0]=h,c)),+r.apply(this,c)),s)return a=null,s+""||null}return o.source=function(s){return arguments.length?(e=s,o):e},o.target=function(s){return arguments.length?(n=s,o):n},o.x=function(s){return arguments.length?(i=typeof s=="function"?s:t0(+s),o):i},o.y=function(s){return arguments.length?(r=typeof s=="function"?s:t0(+s),o):r},o.context=function(s){return arguments.length?(a=s??null,o):a},o}function hE(t,e,n,i,r){t.moveTo(e,n),t.bezierCurveTo(e=(e+i)/2,n,e,r,i,r)}function fE(){return uE(hE)}function dE(t){return[t.source.x1,t.y0]}function gE(t){return[t.target.x0,t.y1]}function pE(){return fE().source(dE).target(gE)}function mE(t){const{data:e,showLabels:n,leftMargin:i,rightMargin:r,truncateBy:a,width:o,height:s,topMargin:c,bottomMargin:u,tooltip:h,onSeriesMouseOver:f,suffix:d,prefix:g,showValues:p,onSeriesMouseClick:y,nodePadding:v,nodeWidth:m,id:I,highlightedSourceDataPoints:j,highlightedTargetDataPoints:w,defaultLinkOpacity:S,sourceTitle:P,targetTitle:W,animate:D,sortNodes:x,resetSelectionOnDoubleClick:$,detailsOnClick:V,styles:q,classNames:ae,precision:G,customLayers:_}=t,b=k.useRef(null),B=ct(b,{once:D.once,amount:D.amount}),[X,z]=k.useState(void 0),[C,A]=k.useState(void 0),[M,O]=k.useState(void 0),[K,Q]=k.useState(void 0),[se,T]=k.useState(void 0),Z={top:c,bottom:u,left:i,right:r},ie=o-Z.left-Z.right,ue=s-Z.top-Z.bottom,he=x==="mostReadable"?Vu().nodeWidth(m).nodePadding(v).size([ie,ue]).nodeAlign(Pu):x==="none"?Vu().nodeWidth(m).nodePadding(v).size([ie,ue]).nodeAlign(Pu).nodeSort(()=>null).linkSort(()=>null):Vu().nodeWidth(m).nodePadding(v).size([ie,ue]).nodeAlign(Pu).nodeSort(x==="desc"?(ce,N)=>(N.value||0)-(ce.value||0):(ce,N)=>(ce.value||0)-(N.value||0)),{nodes:Y,links:ge}=he(e),oe=pE();return l.jsxs(l.Fragment,{children:[l.jsxs($e.svg,{width:`${o}px`,height:`${s}px`,viewBox:`0 0 ${o} ${s}`,style:{marginLeft:"auto",marginRight:"auto"},direction:"ltr",ref:b,children:[P?l.jsx("text",{x:Z.left,y:Z.top-10,className:"text-base font-bold fill-primary-gray-700 dark:fill-primary-gray-100",style:{textAnchor:"start"},children:P}):null,W?l.jsx("text",{x:o-Z.right,y:Z.top-10,className:"text-base font-bold fill-primary-gray-700 dark:fill-primary-gray-100",style:{textAnchor:"end"},children:W}):null,l.jsxs("g",{transform:`translate(${Z.left},${Z.top})`,children:[_.filter(ce=>ce.position==="before").map(ce=>ce.layer),Y.filter(ce=>ce.type==="source").map((ce,N)=>l.jsx("g",{onMouseEnter:()=>{O(ce)},onMouseLeave:()=>{O(void 0)},children:l.jsxs("g",{transform:`translate(${ce.x0},${ce.y0})`,children:[l.jsx("rect",{x:0,y:0,width:(ce.x1||0)-(ce.x0||0),height:(ce.y1||0)-(ce.y0||0),style:{fill:ce.color}}),n||p?l.jsx("foreignObject",{y:0-v/2,x:0-i,width:i,height:(ce.y1||0)-(ce.y0||0)+v,children:l.jsxs("div",{className:"flex flex-col gap-0.5 justify-center py-0 px-1.5",style:{height:`${(ce.y1||0)-(ce.y0||0)+v}px`,overflow:"visible"},children:[n?l.jsx(Ce.P,{marginBottom:p?"3xs":"none",size:"sm",leading:"none",className:Ce.cn("sankey-right-label text-right",ae?.graphObjectValues),style:{hyphens:"auto",color:ce.color,...q?.graphObjectValues},children:`${ce.label}`.length<a?`${ce.label}`:`${`${ce.label}`.substring(0,a)}...`}):null,p?l.jsx(Ce.P,{marginBottom:"none",size:"sm",leading:"none",className:Ce.cn("sankey-right-value text-right font-bold",ae?.graphObjectValues),style:{hyphens:"auto",color:ce.color,...q?.graphObjectValues},children:qe(ce.value,"NA",G,g,d)}):null]})}):null]})},N)),Y.filter(ce=>ce.type==="target").map((ce,N)=>l.jsx("g",{onMouseEnter:()=>{O(ce)},onMouseLeave:()=>{O(void 0)},children:l.jsxs("g",{transform:`translate(${ce.x0},${ce.y0})`,children:[l.jsx("rect",{x:0,y:0,width:(ce.x1||0)-(ce.x0||0),height:(ce.y1||0)-(ce.y0||0),style:{fill:ce.color}}),n||p?l.jsx("foreignObject",{y:0-v/2,x:m,width:r-m,height:(ce.y1||0)-(ce.y0||0)+v,children:l.jsxs("div",{className:"flex flex-col gap-0.5 justify-center py-0 px-1.5",style:{height:`${(ce.y1||0)-(ce.y0||0)+v}px`},children:[n?l.jsx(Ce.P,{marginBottom:p?"3xs":"none",size:"sm",leading:"none",className:Ce.cn("sankey-left-label text-left",ae?.graphObjectValues),style:{hyphens:"auto",color:ce.color,...q?.graphObjectValues},children:`${ce.label}`.length<a?`${ce.label}`:`${`${ce.label}`.substring(0,a)}...`}):null,p?l.jsx(Ce.P,{size:"sm",leading:"none",marginBottom:"none",className:Ce.cn("sankey-left-value text-left font-bold",ae?.graphObjectValues),style:{hyphens:"auto",color:ce.color,...q?.graphObjectValues},children:qe(ce.value,"NA",G,g,d)}):null]})}):null]})},N)),l.jsx("defs",{children:ge.map((ce,N)=>l.jsxs("linearGradient",{id:`${I}-gradient-${N}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{offset:"0%",style:{stopColor:ce.source.color,stopOpacity:1}}),l.jsx("stop",{offset:"100%",style:{stopColor:ce.target.color,stopOpacity:1}})]},N))}),l.jsx("g",{children:l.jsx(mt,{children:ge.map((ce,N)=>l.jsx($e.g,{className:"undp-viz-g-with-hover",onMouseEnter:U=>{z(ce.data),T(U.clientY),Q(U.clientX),f?.(ce)},onMouseMove:U=>{z(ce.data),T(U.clientY),Q(U.clientX)},onClick:()=>{(y||V)&&(dt(C,ce.data)&&$?(A(void 0),y?.(void 0)):(A(ce.data),y?.(ce.data)))},onMouseLeave:()=>{z(void 0),Q(void 0),T(void 0),f?.(void 0)},variants:{initial:{opacity:M?ce.source.name===M.name||ce.target.name===M.name?.85:S:(j.length!==0||w.length!==0)&&(j.indexOf(ce.source.label)!==-1||w.indexOf(ce.target.label)!==-1)?.85:S},whileInView:{opacity:M?ce.source.name===M.name||ce.target.name===M.name?.85:S:(j.length!==0||w.length!==0)&&(j.indexOf(ce.source.label)!==-1||w.indexOf(ce.target.label)!==-1)?.85:S,transition:{duration:D.duration}}},initial:"initial",animate:B?"whileInView":"initial",exit:{opacity:0,transition:{duration:D.duration}},children:l.jsx($e.path,{d:oe(ce)||"",style:{stroke:`url(#${I}-gradient-${N})`,strokeWidth:ce.width,fill:"none"},exit:{opacity:0,transition:{duration:D.duration}},variants:{initial:{pathLength:0,opacity:1},whileInView:{pathLength:1,opacity:1,transition:{duration:D.duration}}},initial:"initial",animate:B?"whileInView":"initial"},`${ce.source}-${ce.target}`)},`${ce.source}-${ce.target}`))})}),_.filter(ce=>ce.position==="after").map(ce=>ce.layer)]})]}),X&&h&&K&&se?l.jsx(st,{data:X,body:h,xPos:K,yPos:se,backgroundStyle:q?.tooltip,className:ae?.tooltip}):null,V&&C!==void 0?l.jsx(Ce.Modal,{open:C!==void 0,onClose:()=>{A(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof V=="string"?{__html:lt(V,C)}:void 0,children:typeof V=="function"?V(C):null})}):null]})}function pw(t){const{data:e,graphTitle:n,sources:i,graphDescription:r,showLabels:a=!0,leftMargin:o=75,rightMargin:s=75,topMargin:c=30,bottomMargin:u=10,truncateBy:h=999,height:f,width:d,footNote:g,padding:p,backgroundColor:y,tooltip:v,onSeriesMouseOver:m,suffix:I="",prefix:j="",relativeHeight:w,showValues:S=!0,graphID:P,onSeriesMouseClick:W,graphDownload:D=!1,dataDownload:x=!1,fillContainer:$=!0,language:V="en",minHeight:q=0,theme:ae="light",ariaLabel:G,sourceColors:_,targetColors:b,sourceColorDomain:B,targetColorDomain:X,nodePadding:z=5,nodeWidth:C=5,highlightedSourceDataPoints:A=[],highlightedTargetDataPoints:M=[],defaultLinkOpacity:O=.3,sourceTitle:K,targetTitle:Q,sortNodes:se="mostReadable",resetSelectionOnDoubleClick:T=!0,detailsOnClick:Z,styles:ie,classNames:ue,animate:he=!1,precision:Y=2,customLayers:ge=[]}=t,[oe,ce]=k.useState(0),[N,U]=k.useState(0),[ve,J]=k.useState(void 0),R=k.useRef(null),le=k.useRef(null);return k.useEffect(()=>{const ee=Xe(e,"source").map(ne=>({name:`source_${ne.source}`,type:"source",label:`${ne.source}`,color:typeof _=="string"||!_?_||Pe.graphMainColor:_[(B||Xe(e,"source").map(De=>`${De.source}`)).findIndex(De=>`${De}`==`${ne.source}`)>_.length?_.length-1:(B||Xe(e,"source").map(De=>`${De.source}`)).findIndex(De=>`${De}`==`${ne.source}`)],totalValue:rt(e.filter(De=>`${De.source}`==`${ne.source}`).map(De=>De.value))})),de=se==="asc"?tt(ee,ne=>ne.totalValue):se==="desc"?tt(ee,ne=>ne.totalValue).reverse():ee,te=Xe(e,"target").map(ne=>({name:`target_${ne.target}`,type:"target",label:`${ne.target}`,color:typeof b=="string"||!b?b||Pe.graphMainColor:b[(X||Xe(e,"target").map(De=>`${De.target}`)).findIndex(De=>`${De}`==`${ne.target}`)>b.length?b.length-1:(X||Xe(e,"target").map(De=>`${De.target}`)).findIndex(De=>`${De}`==`${ne.target}`)],totalValue:rt(e.filter(De=>`${De.target}`==`${ne.target}`).map(De=>De.value))})),Me=se==="asc"?tt(te,ne=>ne.totalValue):se==="desc"?tt(te,ne=>ne.totalValue).reverse():te,be=[...de,...Me];J({nodes:be,links:e.map(ne=>({source:be.findIndex(De=>De.name===`source_${ne.source}`),target:be.findIndex(De=>De.name===`target_${ne.target}`),value:ne.value,data:{...ne}}))})},[e,se,B,_,X,b]),k.useEffect(()=>{const ee=new ResizeObserver(de=>{ce(d||de[0].target.clientWidth||620),U(f||de[0].target.clientHeight||480)});return R.current&&(U(R.current.clientHeight||480),ce(R.current.clientWidth||620),d||ee.observe(R.current)),()=>ee.disconnect()},[d,f]),l.jsx("div",{className:`${ae||"light"} flex ${d?"grow-0":"grow"} ${$?"w-full":"w-fit"} `,dir:V==="he"||V==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${y?y===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${V||"en"}`,ue?.graphContainer),style:{...ie?.graphContainer||{},...y&&y!==!0?{backgroundColor:y}:{}},id:P,ref:le,"aria-label":G||`${n?`The graph shows ${n}. `:""}This is a sankey chart showing flow. ${r?` ${r}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:y?p||"1rem":p||0},children:l.jsxs("div",{className:"flex flex-col gap-4 w-full grow justify-between",children:[n||r||D||x?l.jsx(Qe,{styles:{title:ie?.title,description:ie?.description},classNames:{title:ue?.title,description:ue?.description},graphTitle:n,graphDescription:r,width:d,graphDownload:D?le.current:void 0,dataDownload:x?e.map(ee=>ee.data).filter(ee=>ee!==void 0).length>0?e.map(ee=>ee.data).filter(ee=>ee!==void 0):e.filter(ee=>ee!==void 0):null}):null,l.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:e.length===0?l.jsx(xt,{}):l.jsx("div",{className:"flex flex-col grow justify-center gap-3 w-full leading-0",ref:R,"aria-label":"Graph area",children:(d||oe)&&(f||N)&&ve?l.jsx(mE,{data:ve,width:d||oe,nodePadding:z,nodeWidth:C,height:Math.max(q,f||(w?q?(d||oe)*w>q?(d||oe)*w:q:(d||oe)*w:N)),showLabels:a,leftMargin:o,rightMargin:s,topMargin:c,bottomMargin:u,truncateBy:h,tooltip:v,onSeriesMouseOver:m,showValues:S,suffix:I,prefix:j,onSeriesMouseClick:W,id:rl(8),highlightedSourceDataPoints:A.map(ee=>`${ee}`),highlightedTargetDataPoints:M.map(ee=>`${ee}`),defaultLinkOpacity:O,sourceTitle:K,targetTitle:Q,sortNodes:se,resetSelectionOnDoubleClick:T,styles:ie,classNames:ue,detailsOnClick:Z,animate:he===!0?{duration:.5,once:!0,amount:.5}:he||{duration:0,once:!0,amount:0},precision:Y,customLayers:ge}):null})}),i||g?l.jsx(et,{styles:{footnote:ie?.footnote,source:ie?.source},classNames:{footnote:ue?.footnote,source:ue?.source},sources:i,footNote:g,width:d}):null]})})})})}function yE(t){const{data:e,radius:n,lineColors:i,tooltip:r,onSeriesMouseOver:a,onSeriesMouseClick:o,colorDomain:s,detailsOnClick:c,styles:u,classNames:h,selectedColor:f,axisLabels:d,strokeWidth:g,showValues:p,showDots:y,rightMargin:v,topMargin:m,bottomMargin:I,leftMargin:j,curveType:w,noOfTicks:S,minValue:P,maxValue:W,resetSelectionOnDoubleClick:D,fillShape:x,highlightedLines:$,animate:V,dimmedOpacity:q,precision:ae,customLayers:G}=t,_=k.useRef(null),b=ct(_,{once:V.once,amount:V.amount}),B=w==="linear"?gO:dO,X={top:m,left:j},z=Math.min((2*n-j-v)/2,(2*n-m-I)/2),[C,A]=k.useState(void 0),[M,O]=k.useState(void 0),[K,Q]=k.useState(void 0),[se,T]=k.useState(void 0),Z=ut().domain([0,e[0].values.length]).range([0,2*Math.PI]),ie=je(W)?Math.max(...e.map(oe=>Math.max(...oe.values.filter(ce=>!je(ce)))))<0?0:Math.max(...e.map(oe=>Math.max(...oe.values.filter(ce=>!je(ce))))):W,ue=je(P)?Math.min(...e.map(oe=>Math.min(...oe.values.filter(ce=>!je(ce)))))>=0?0:Math.min(...e.map(oe=>Math.min(...oe.values.filter(ce=>!je(ce))))):P,he=ut().domain([ue,ie]).range([0,z]).nice(),Y=he.ticks(S),ge=fO().radius(oe=>he(oe)).angle((oe,ce)=>Z(ce)).curve(B);return l.jsxs(l.Fragment,{children:[l.jsx($e.svg,{width:`${n*2}px`,height:`${n*2}px`,viewBox:`0 0 ${n*2} ${n*2}`,direction:"ltr",ref:_,children:l.jsxs("g",{transform:`translate(${X.left},${X.top})`,children:[G.filter(oe=>oe.position==="before").map(oe=>oe.layer),l.jsxs("g",{transform:`translate(${z},${z})`,children:[d.map((oe,ce)=>l.jsxs("g",{children:[l.jsx("line",{x1:0,y1:0,x2:Math.cos(Z(ce)-Math.PI/2)*z,y2:Math.sin(Z(ce)-Math.PI/2)*z,className:Ce.cn("stroke-1 stroke-primary-gray-500 dark:stroke-primary-gray-550",h?.xAxis?.axis),style:u?.xAxis?.axis},ce),l.jsx("text",{x:Math.cos(Z(ce)-Math.PI/2)*(z+6),y:Math.sin(Z(ce)-Math.PI/2)*(z+6),style:{textAnchor:Math.cos(Z(ce)-Math.PI/2)<0?"end":Math.cos(Z(ce)-Math.PI/2)<1e-5?"middle":"start",...u?.xAxis?.labels||""},dy:Math.sin(Z(ce)-Math.PI/2)<0?0:Math.sin(Z(ce)-Math.PI/2)<1e-5?5:10,className:Ce.cn("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",h?.xAxis?.labels),children:oe})]},ce)),Y.map((oe,ce)=>l.jsxs("g",{children:[l.jsx("path",{d:ge(Array(d.length).fill(oe))||"",className:Ce.cn("stroke-primary-gray-500 dark:stroke-primary-gray-550",h?.xAxis?.gridLines),style:{...u?.xAxis?.gridLines,fill:"none"}}),l.jsx("foreignObject",{x:-25,y:Math.sin(-Math.PI/2)*he(oe)>-1e-4?Math.sin(-Math.PI/2)*he(oe)-7:Math.sin(-Math.PI/2)*he(oe)-5,width:50,height:12,children:l.jsx("div",{className:"flex justify-center",children:l.jsx("p",{className:Ce.cn("fill-primary-gray-500 dark:fill-primary-gray-550 text-xs m-0 py-0 px-1.5 text-center leading-none bg-primary-white dark:bg-primary-gray-700",h?.xAxis?.labels),style:u?.xAxis?.labels,children:qe(oe,"NA",ae)})})})]},ce)),l.jsx(mt,{children:e.map((oe,ce)=>l.jsxs($e.g,{variants:{initial:{opacity:C?oe.label===C.label?1:q:f?oe.color&&i[s.indexOf(oe.color)]===f?1:q:$.length!==0?oe.label&&$.indexOf(oe.label)!==-1?1:.3:1},whileInView:{opacity:C?oe.label===C.label?1:q:f?oe.color&&i[s.indexOf(oe.color)]===f?1:q:$.length!==0?oe.label&&$.indexOf(oe.label)!==-1?1:q:1,transition:{duration:V.duration}}},initial:"initial",animate:b?"whileInView":"initial",exit:{opacity:0,transition:{duration:V.duration}},onMouseEnter:N=>{A(oe),T(N.clientY),Q(N.clientX),a?.(oe)},onMouseMove:N=>{A(oe),T(N.clientY),Q(N.clientX)},onMouseLeave:()=>{A(void 0),Q(void 0),T(void 0),a?.(void 0)},onClick:()=>{(o||c)&&(dt(M,oe)&&D?(O(void 0),o?.(void 0)):(O(oe),o?.(oe)))},children:[l.jsx($e.path,{d:ge(oe.values)||"",variants:{initial:{d:ge(oe.values.map(N=>0))||""},whileInView:{d:ge(oe.values)||"",transition:{duration:V.duration}}},initial:"initial",animate:b?"whileInView":"initial",exit:{opacity:0,transition:{duration:V.duration}},style:{stroke:e.filter(N=>N.color).length===0?i[0]:oe.color?i[s.indexOf(oe.color)]:Pe.gray,fill:x?e.filter(N=>N.color).length===0?i[0]:oe.color?i[s.indexOf(oe.color)]:Pe.gray:"none",fillOpacity:.1,strokeWidth:g}}),l.jsx("g",{children:oe.values.map((N,U)=>l.jsx("g",{children:je(N)?null:l.jsxs(l.Fragment,{children:[y?l.jsx($e.circle,{cx:Math.cos(Z(U)-Math.PI/2)*he(N),cy:Math.sin(Z(U)-Math.PI/2)*he(N),r:4,style:{fill:e.filter(ve=>ve.color).length===0?i[0]:oe.color?i[s.indexOf(oe.color)]:Pe.gray},variants:{initial:{cx:0,cy:0,opacity:0},whileInView:{cx:Math.cos(Z(U)-Math.PI/2)*he(N),cy:Math.sin(Z(U)-Math.PI/2)*he(N),opacity:1,transition:{duration:V.duration}}},initial:"initial",animate:b?"whileInView":"initial",exit:{opacity:0,transition:{duration:V.duration}}}):null,p?l.jsx($e.text,{x:Math.cos(Z(U)-Math.PI/2)*(he(N)+6),y:Math.sin(Z(U)-Math.PI/2)*(he(N)+6),style:{fill:i[ce],textAnchor:Math.cos(Z(U)-Math.PI/2)<0?"end":Math.cos(Z(U)-Math.PI/2)<1e-5?"middle":"start",...u?.graphObjectValues||{}},dy:Math.sin(Z(U)-Math.PI/2)<0?10:(Math.sin(Z(U)-Math.PI/2)<1e-5,0),className:Ce.cn("graph-value text-xs font-bold",h?.graphObjectValues),variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:V.duration}}},initial:"initial",animate:b?"whileInView":"initial",exit:{opacity:0,transition:{duration:V.duration}},children:qe(N,"NA",ae)}):null]})},U))})]},oe.label||ce))})]}),G.filter(oe=>oe.position==="after").map(oe=>oe.layer)]})}),C&&r&&K&&se?l.jsx(st,{data:C,body:r,xPos:K,yPos:se,backgroundStyle:u?.tooltip,className:h?.tooltip}):null,c&&M!==void 0?l.jsx(Ce.Modal,{open:M!==void 0,onClose:()=>{O(void 0)},children:l.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof c=="string"?{__html:lt(c,M)}:void 0,children:typeof c=="function"?c(M):null})}):null]})}function mw(t){const{graphTitle:e,colors:n,sources:i,graphDescription:r,footNote:a,radius:o,data:s,showColorScale:c=!0,padding:u,backgroundColor:h=!1,tooltip:f,onSeriesMouseOver:d,graphID:g,onSeriesMouseClick:p,topMargin:y=75,bottomMargin:v=75,leftMargin:m=75,rightMargin:I=75,graphDownload:j=!1,dataDownload:w=!1,colorDomain:S,language:P="en",theme:W="light",highlightedLines:D=[],width:x,height:$,minHeight:V=0,strokeWidth:q=2,relativeHeight:ae,ariaLabel:G,colorLegendTitle:_,detailsOnClick:b,styles:B,classNames:X,showNAColor:z=!0,axisLabels:C,showDots:A=!0,showValues:M=!1,curveType:O="curve",noOfTicks:K=5,minValue:Q,maxValue:se,fillShape:T=!1,resetSelectionOnDoubleClick:Z=!0,animate:ie=!1,dimmedOpacity:ue=.3,precision:he=2,customLayers:Y=[]}=t,[ge,oe]=k.useState(0),[ce,N]=k.useState(0),[U,ve]=k.useState(0),[J,R]=k.useState(void 0),le=k.useRef(null),ee=k.useRef(null);return k.useEffect(()=>{const de=new ResizeObserver(te=>{N(x||te[0].target.clientWidth||420),ve($||te[0].target.clientHeight||420),oe((Math.min(x||te[0].target.clientWidth||620,$||te[0].target.clientHeight||480)||420)/2)});return le.current&&(ve(le.current.clientHeight||420),N(le.current.clientWidth||420),oe((Math.min(le.current.clientWidth,le.current.clientHeight)||420)/2),(!x||!o)&&de.observe(le.current)),()=>de.disconnect()},[x,$,o]),l.jsx("div",{className:`${W||"light"} flex ${x?"w-fit grow-0":"w-full grow"}`,dir:P==="he"||P==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${h?h===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${P||"en"}`,X?.graphContainer),style:{...B?.graphContainer||{},minHeight:"inherit",...h&&h!==!0?{backgroundColor:h}:{}},id:g,ref:ee,"aria-label":G||`${e?`The graph shows ${e}. `:""}This is a donut or pie chart chart. ${r?` ${r}`:""}`,children:l.jsx("div",{className:"flex grow",style:{padding:h?u||"1rem":u||0},children:l.jsxs("div",{className:"flex flex-col gap-2 w-full grow justify-between",children:[e||r||j||w?l.jsx(Qe,{styles:{title:B?.title,description:B?.description},classNames:{title:X?.title,description:X?.description},graphTitle:e,graphDescription:r,width:x,graphDownload:j?ee.current:void 0,dataDownload:w?s.map(de=>de.data).filter(de=>de!==void 0).length>0?s.map(de=>de.data).filter(de=>de!==void 0):s.filter(de=>de!==void 0):null}):null,l.jsx("div",{className:"flex grow flex-col justify-center items-stretch gap-8 flex-wrap",style:{width:x?`${x}px`:"100%"},children:s.length===0?l.jsx(xt,{}):l.jsxs(l.Fragment,{children:[c&&s.filter(de=>de.color).length!==0?l.jsx(tn,{width:x,colorLegendTitle:_,colors:n||Pe[W].categoricalColors.colors,colorDomain:S||Xe(s.filter(de=>de.color),"color").map(de=>de.color),setSelectedColor:R,showNAColor:z}):null,l.jsx("div",{className:`flex ${x?"grow-0":"grow"} items-center justify-center leading-0`,style:{width:x?`${x}px`:"100%",height:$?`${Math.max(V,$||(ae?V?(x||ce)*ae>V?(x||ce)*ae:V:(x||ce)*ae:U))}px`:"auto"},ref:le,"aria-label":"Graph area",children:l.jsx("div",{className:"w-full flex justify-center leading-0",children:o||ge?l.jsx(yE,{data:s,lineColors:s.filter(de=>de.color).length===0?n?[n]:[Pe.primaryColors["blue-600"]]:n||Pe[W].categoricalColors.colors,radius:o||ge,tooltip:f,colorDomain:S||Xe(s.filter(de=>de.color),"color").map(de=>de.color),onSeriesMouseOver:d,onSeriesMouseClick:p,styles:B,detailsOnClick:b,selectedColor:J,axisLabels:C,strokeWidth:q,showValues:M,showDots:A,topMargin:y,bottomMargin:v,leftMargin:m,rightMargin:I,curveType:O,noOfTicks:K,minValue:Q,maxValue:se,fillShape:T,highlightedLines:D,resetSelectionOnDoubleClick:Z,animate:ie===!0?{duration:.5,once:!0,amount:.5}:ie||{duration:0,once:!0,amount:0},dimmedOpacity:ue,precision:he,customLayers:Y}):null})})]})}),i||a?l.jsx(et,{styles:{footnote:B?.footnote,source:B?.source},classNames:{footnote:X?.footnote,source:X?.source},sources:i,footNote:a,width:x}):l.jsx("div",{})]})})})})}function Ct(t,e,n){return e.findIndex(i=>i.chartConfigId===t)===-1?void 0:typeof e[e.findIndex(i=>i.chartConfigId===t)].columnId=="object"?e[e.findIndex(i=>i.chartConfigId===t)].columnId.map(i=>n.findIndex(r=>r.value===i)===-1?i:n[n.findIndex(r=>r.value===i)].label):n.findIndex(i=>i.value===e[e.findIndex(r=>r.chartConfigId===t)].columnId)===-1?e[e.findIndex(i=>i.chartConfigId===t)].columnId:n[n.findIndex(i=>i.value===e[e.findIndex(r=>r.chartConfigId===t)].columnId)].label}function yw(t){const{settings:e,graph:n,graphData:i,debugMode:r,graphDataConfiguration:a,readableHeader:o,updateFilters:s}=t;if(r&&(console.log(`Graph: ${n}`),console.log("Transformed data:",i),console.log("Settings:",e)),typeof i=="string")return l.jsx("div",{className:`flex my-0 mx-auto grow flex-col justify-center ${e?.width?"w-fit":"w-full"}`,style:{height:"inherit"},children:l.jsx(Ce.P,{size:"sm",marginBottom:"none",className:"p-2 text-center text-accent-dark-red dark:text-accent-red",children:i})});const c={barChart:Gf,bulletChart:Kv,groupedBarChart:Rx,stackedBarChart:Bx,lineChart:yv,dualAxisLineChart:pv,multiLineChart:xv,multiLineAltChart:vv,stackedAreaChart:Qv,choroplethMap:Hv,biVariateChoroplethMap:Bv,dotDensityMap:Wv,donutChart:rd,slopeChart:Xv,scatterPlot:Uv,dumbbellChart:tv,treeMap:Md,circlePacking:td,heatMap:aw,stripChart:cw,beeSwarmChart:nv,butterflyChart:hw,histogram:fw,sparkLine:bv,paretoChart:uw,dataTable:ow,statCard:Zv,geoHubCompareMap:Yv,geoHubMap:Gv,unitChart:nw,differenceLineChart:wv,geoHubMapWithLayerSelection:qv,sankeyChart:pw,lineChartWithConfidenceInterval:mv,dataCards:sw,radarChart:mw,threeDGlobe:zv},u=d=>{switch(d){case"barChart":return{timeline:e?.timeline,customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,orientation:e?.orientation,data:i,colors:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,height:e?.height,width:e?.width,suffix:e?.suffix,prefix:e?.prefix,sources:e?.sources,barPadding:e?.barPadding,showValues:e?.showValues,showTicks:e?.showTicks,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,truncateBy:e?.truncateBy,colorDomain:e?.colorDomain,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:Ct("color",a||[],o||[]),backgroundColor:e?.backgroundColor,padding:e?.padding,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,showLabels:e?.showLabels,showColorScale:e?.showColorScale,maxValue:e?.maxValue,minValue:e?.minValue,labelOrder:e?.labelOrder,tooltip:e?.tooltip,refValues:e?.refValues,graphID:e?.graphID,highlightedDataPoints:e?.highlightedDataPoints,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,sortData:e?.sortData,language:e?.language,minHeight:e?.minHeight,showNAColor:e?.showNAColor,maxBarThickness:e?.maxBarThickness,minBarThickness:e?.minBarThickness,maxNumberOfBars:e?.maxNumberOfBars,ariaLabel:e?.ariaLabel,onSeriesMouseClick:g=>{s?.(g.label)},resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,detailsOnClick:e?.detailsOnClick,barAxisTitle:e?.barAxisTitle,noOfTicks:e?.noOfTicks,valueColor:e?.valueColor,styles:e?.styles,classNames:e?.classNames,filterNA:e?.filterNA,animate:e?.animate,naLabel:e?.naLabel};case"groupedBarChart":return{timeline:e?.timeline,customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,orientation:e?.orientation,data:i,colors:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,showColorScale:e?.showColorScale,sources:e?.sources,barPadding:e?.barPadding,showTicks:e?.showTicks,truncateBy:e?.truncateBy,colorDomain:e?.colorDomain||Ct("size",a||[],o||[]),colorLegendTitle:e?.colorLegendTitle,suffix:e?.suffix,prefix:e?.prefix,showValues:e?.showValues,backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,showLabels:e?.showLabels,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,refValues:e?.refValues,graphID:e?.graphID,labelOrder:e?.labelOrder,maxValue:e?.maxValue,minValue:e?.minValue,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,maxBarThickness:e?.maxBarThickness,ariaLabel:e?.ariaLabel,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,detailsOnClick:e?.detailsOnClick,barAxisTitle:e?.barAxisTitle,noOfTicks:e?.noOfTicks,valueColor:e?.valueColor,styles:e?.styles,classNames:e?.classNames,animate:e?.animate,naLabel:e?.naLabel};case"stackedBarChart":return{timeline:e?.timeline,customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,orientation:e?.orientation,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:i,colors:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,showColorScale:e?.showColorScale,width:e?.width,height:e?.height,sources:e?.sources,barPadding:e?.barPadding,showTicks:e?.showTicks,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,truncateBy:e?.truncateBy,colorDomain:e?.colorDomain||Ct("size",a||[],o||[]),colorLegendTitle:e?.colorLegendTitle,backgroundColor:e?.backgroundColor,padding:e?.padding,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,suffix:e?.suffix,prefix:e?.prefix,labelOrder:e?.labelOrder,showValues:e?.showValues,showLabels:e?.showLabels,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,refValues:e?.refValues,graphID:e?.graphID,maxValue:e?.maxValue,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,maxBarThickness:e?.maxBarThickness,minBarThickness:e?.minBarThickness,maxNumberOfBars:e?.maxNumberOfBars,sortParameter:e?.sortParameter,ariaLabel:e?.ariaLabel,detailsOnClick:e?.detailsOnClick,barAxisTitle:e?.barAxisTitle,noOfTicks:e?.noOfTicks,valueColor:e?.valueColor,styles:e?.styles,classNames:e?.classNames,animate:e?.animate,naLabel:e?.naLabel};case"bulletChart":return{customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,orientation:e?.orientation,data:i,barColor:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,height:e?.height,width:e?.width,suffix:e?.suffix,prefix:e?.prefix,sources:e?.sources,barPadding:e?.barPadding,showValues:e?.showValues,showTicks:e?.showTicks,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,truncateBy:e?.truncateBy,colorDomain:e?.colorDomain,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:Ct("color",a||[],o||[]),backgroundColor:e?.backgroundColor,padding:e?.padding,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,showLabels:e?.showLabels,showColorScale:e?.showColorScale,maxValue:e?.maxValue,minValue:e?.minValue,labelOrder:e?.labelOrder,tooltip:e?.tooltip,refValues:e?.refValues,graphID:e?.graphID,highlightedDataPoints:e?.highlightedDataPoints,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,sortData:e?.sortData,language:e?.language,minHeight:e?.minHeight,showNAColor:e?.showNAColor,maxBarThickness:e?.maxBarThickness,minBarThickness:e?.minBarThickness,maxNumberOfBars:e?.maxNumberOfBars,ariaLabel:e?.ariaLabel,onSeriesMouseClick:g=>{s?.(g.label)},resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,detailsOnClick:e?.detailsOnClick,barAxisTitle:e?.barAxisTitle,noOfTicks:e?.noOfTicks,valueColor:e?.valueColor,styles:e?.styles,classNames:e?.classNames,filterNA:e?.filterNA,qualitativeRangeColors:e?.qualitativeRangeColors,targetStyle:e?.targetStyle,targetColor:e?.targetColor,measureBarWidthFactor:e?.measureBarWidthFactor,animate:e?.animate,naLabel:e?.naLabel};case"lineChart":return{customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,curveType:e?.curveType,data:i,graphID:e?.graphID,lineColor:e?.lineColor,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,suffix:e?.suffix,prefix:e?.prefix,sources:e?.sources,noOfXTicks:e?.noOfXTicks,dateFormat:e?.dateFormat,showValues:e?.showValues,backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,refValues:e?.refValues,highlightAreaSettings:e?.highlightAreaSettings,maxValue:e?.maxValue,minValue:e?.minValue,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,animate:e?.animate,strokeWidth:e?.strokeWidth,showDots:e?.showDots,customHighlightAreaSettings:e?.customHighlightAreaSettings,annotations:e?.annotations,regressionLine:e?.regressionLine,ariaLabel:e?.ariaLabel,yAxisTitle:e?.yAxisTitle,noOfYTicks:e?.noOfYTicks,minDate:e?.minDate,maxDate:e?.maxDate,styles:e?.styles,classNames:e?.classNames};case"lineChartWithConfidenceInterval":return{customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,data:i,curveType:e?.curveType,graphID:e?.graphID,lineColor:e?.lineColor,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,suffix:e?.suffix,prefix:e?.prefix,sources:e?.sources,noOfXTicks:e?.noOfXTicks,dateFormat:e?.dateFormat,showValues:e?.showValues,backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,refValues:e?.refValues,highlightAreaSettings:e?.highlightAreaSettings,maxValue:e?.maxValue,minValue:e?.minValue,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,animate:e?.animate,strokeWidth:e?.strokeWidth,showDots:e?.showDots,customHighlightAreaSettings:e?.customHighlightAreaSettings,annotations:e?.annotations,regressionLine:e?.regressionLine,ariaLabel:e?.ariaLabel,showIntervalDots:e?.showIntervalDots,showIntervalValues:e?.showIntervalValues,intervalLineStrokeWidth:e?.intervalLineStrokeWidth,intervalLineColors:e?.intervalLineColors,intervalAreaColor:e?.intervalAreaColor,intervalAreaOpacity:e?.intervalAreaOpacity,yAxisTitle:e?.yAxisTitle,noOfYTicks:e?.noOfYTicks,minDate:e?.minDate,maxDate:e?.maxDate,colorLegendTitle:e?.colorLegendTitle,colorLegendColors:e?.colorLegendColors,colorLegendDomain:e?.colorLegendDomain,styles:e?.styles,classNames:e?.classNames};case"dualAxisLineChart":return{customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,data:i,curveType:e?.curveType,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,labels:e?.labels||[Ct("y1",a||[],o||[]),Ct("y2",a||[],o||[])],footNote:e?.footNote,width:e?.width,height:e?.height,suffix:e?.suffix,prefix:e?.prefix,sources:e?.sources,noOfXTicks:e?.noOfXTicks,dateFormat:e?.dateFormat,showValues:e?.showValues,backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,lineColors:e?.lineColors,sameAxes:e?.sameAxes,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,highlightAreaSettings:e?.highlightAreaSettings,graphID:e?.graphID,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,animate:e?.animate,strokeWidth:e?.strokeWidth,showDots:e?.showDots,colorLegendTitle:e?.colorLegendTitle,ariaLabel:e?.ariaLabel,noOfYTicks:e?.noOfYTicks,minDate:e?.minDate,maxDate:e?.maxDate,lineSuffixes:e?.lineSuffixes,linePrefixes:e?.linePrefixes,styles:e?.styles,classNames:e?.classNames};case"multiLineChart":return{customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,data:i,curveType:e?.curveType,lineColors:e?.lineColors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,noOfXTicks:e?.noOfXTicks,dateFormat:e?.dateFormat,suffix:e?.suffix,prefix:e?.prefix,showColorScale:e?.showColorScale,labels:e?.labels||Ct("y",a||[],o||[]),backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,showValues:e?.showValues,relativeHeight:e?.relativeHeight,showColorLegendAtTop:e?.showColorLegendAtTop,tooltip:e?.tooltip,refValues:e?.refValues,highlightAreaSettings:e?.highlightAreaSettings,graphID:e?.graphID,maxValue:e?.maxValue,minValue:e?.minValue,highlightedLines:e?.highlightedLines,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,animate:e?.animate,strokeWidth:e?.strokeWidth,showDots:e?.showDots,colorLegendTitle:e?.colorLegendTitle,customHighlightAreaSettings:e?.customHighlightAreaSettings,annotations:e?.annotations,ariaLabel:e?.ariaLabel,yAxisTitle:e?.yAxisTitle,noOfYTicks:e?.noOfYTicks,minDate:e?.minDate,maxDate:e?.maxDate,styles:e?.styles,classNames:e?.classNames,dashedLines:e?.dashedLines,dashSettings:e?.dashSettings,labelsToBeHidden:e?.labelsToBeHidden};case"multiLineAltChart":return{naLabel:e?.naLabel,customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,data:i,dimmedOpacity:e?.dimmedOpacity,curveType:e?.curveType,colors:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,noOfXTicks:e?.noOfXTicks,dateFormat:e?.dateFormat,suffix:e?.suffix,prefix:e?.prefix,backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,refValues:e?.refValues,showLabels:e?.showLabels,highlightAreaSettings:e?.highlightAreaSettings,graphID:e?.graphID,maxValue:e?.maxValue,minValue:e?.minValue,highlightedLines:e?.highlightedLines,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,animate:e?.animate,strokeWidth:e?.strokeWidth,showDots:e?.showDots,colorLegendTitle:e?.colorLegendTitle,customHighlightAreaSettings:e?.customHighlightAreaSettings,annotations:e?.annotations,ariaLabel:e?.ariaLabel,yAxisTitle:e?.yAxisTitle,noOfYTicks:e?.noOfYTicks,minDate:e?.minDate,maxDate:e?.maxDate,styles:e?.styles,classNames:e?.classNames,colorDomain:e?.colorDomain,showNAColor:e?.showNAColor};case"differenceLineChart":return{customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,data:i,curveType:e?.curveType,lineColors:e?.lineColors,diffAreaColors:e?.diffAreaColors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,noOfXTicks:e?.noOfXTicks,dateFormat:e?.dateFormat,suffix:e?.suffix,prefix:e?.prefix,labels:e?.labels||[Ct("y1",a||[],o||[]),Ct("y2",a||[],o||[])],backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,showValues:e?.showValues,relativeHeight:e?.relativeHeight,showColorLegendAtTop:e?.showColorLegendAtTop,tooltip:e?.tooltip,refValues:e?.refValues,highlightAreaSettings:e?.highlightAreaSettings,graphID:e?.graphID,maxValue:e?.maxValue,minValue:e?.minValue,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,animate:e?.animate,strokeWidth:e?.strokeWidth,showDots:e?.showDots,colorLegendTitle:e?.colorLegendTitle,customHighlightAreaSettings:e?.customHighlightAreaSettings,annotations:e?.annotations,ariaLabel:e?.ariaLabel,yAxisTitle:e?.yAxisTitle,noOfYTicks:e?.noOfYTicks,minDate:e?.minDate,maxDate:e?.maxDate,styles:e?.styles,classNames:e?.classNames};case"stackedAreaChart":return{customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,data:i,curveType:e?.curveType,colors:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,noOfXTicks:e?.noOfXTicks,dateFormat:e?.dateFormat,colorDomain:e?.colorDomain||Ct("y",a||[],o||[]),backgroundColor:e?.backgroundColor,padding:e?.padding,colorLegendTitle:e?.colorLegendTitle,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,relativeHeight:e?.relativeHeight,bottomMargin:e?.bottomMargin,tooltip:e?.tooltip,refValues:e?.refValues,highlightAreaSettings:e?.highlightAreaSettings,graphID:e?.graphID,maxValue:e?.maxValue,minValue:e?.minValue,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,showColorScale:e?.showColorScale,language:e?.language,minHeight:e?.minHeight,customHighlightAreaSettings:e?.customHighlightAreaSettings,annotations:e?.annotations,ariaLabel:e?.ariaLabel,yAxisTitle:e?.yAxisTitle,noOfYTicks:e?.noOfYTicks,suffix:e?.suffix,prefix:e?.prefix,styles:e?.styles,classNames:e?.classNames};case"choroplethMap":return{timeline:e?.timeline,customLayers:e?.customLayers,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,graphTitle:e?.graphTitle,mapData:e?.mapData,mapProjection:e?.mapProjection,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,colorDomain:e?.colorDomain,colors:e?.colors,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:Ct("x",a||[],o||[]),scaleType:e?.scaleType,categorical:e?.categorical,data:i,scale:e?.scale,centerPoint:e?.centerPoint,backgroundColor:e?.backgroundColor,mapBorderWidth:e?.mapBorderWidth,mapNoDataColor:e?.mapNoDataColor,mapBorderColor:e?.mapBorderColor,relativeHeight:e?.relativeHeight,padding:e?.padding,isWorldMap:e?.isWorldMap,tooltip:e?.tooltip,showColorScale:e?.showColorScale,zoomScaleExtend:e?.zoomScaleExtend,zoomTranslateExtend:e?.zoomTranslateExtend,graphID:e?.graphID,highlightedIds:e?.highlightedIds,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,mapProperty:e?.mapProperty,showAntarctica:e?.showAntarctica,language:e?.language,minHeight:e?.minHeight,ariaLabel:e?.ariaLabel,onSeriesMouseClick:g=>{s?.(g.id)},detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,zoomInteraction:e?.zoomInteraction,animate:e?.animate};case"biVariateChoroplethMap":return{timeline:e?.timeline,customLayers:e?.customLayers,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:i,mapData:e?.mapData,mapProjection:e?.mapProjection,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,xColorLegendTitle:Object.keys(e||{}).indexOf("xColorLegendTitle")!==-1?e?.xColorLegendTitle:Ct("x",a||[],o||[]),yColorLegendTitle:Object.keys(e||{}).indexOf("yColorLegendTitle")!==-1?e?.yColorLegendTitle:Ct("y",a||[],o||[]),xDomain:e?.xDomain,yDomain:e?.yDomain,colors:e?.colors,scale:e?.scale,centerPoint:e?.centerPoint,backgroundColor:e?.backgroundColor,mapBorderWidth:e?.mapBorderWidth,mapNoDataColor:e?.mapNoDataColor,padding:e?.padding,mapBorderColor:e?.mapBorderColor,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,isWorldMap:e?.isWorldMap,zoomScaleExtend:e?.zoomScaleExtend,zoomTranslateExtend:e?.zoomTranslateExtend,graphID:e?.graphID,highlightedIds:e?.highlightedIds,mapProperty:e?.mapProperty,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,showAntarctica:e?.showAntarctica,language:e?.language,minHeight:e?.minHeight,ariaLabel:e?.ariaLabel,onSeriesMouseClick:g=>{s?.(g.id)},detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,zoomInteraction:e?.zoomInteraction,animate:e?.animate};case"dotDensityMap":return{timeline:e?.timeline,customLayers:e?.customLayers,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,graphTitle:e?.graphTitle,mapData:e?.mapData,mapProjection:e?.mapProjection,graphDescription:e?.graphDescription,footNote:e?.footNote,maxRadiusValue:e?.maxRadiusValue,width:e?.width,height:e?.height,radius:e?.radius,sources:e?.sources,colors:e?.colors,colorDomain:e?.colorDomain,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:Ct("color",a||[],o||[]),data:i,scale:e?.scale,centerPoint:e?.centerPoint,backgroundColor:e?.backgroundColor,mapBorderWidth:e?.mapBorderWidth,mapNoDataColor:e?.mapNoDataColor,mapBorderColor:e?.mapBorderColor,padding:e?.padding,showLabels:e?.showLabels,relativeHeight:e?.relativeHeight,isWorldMap:e?.isWorldMap,tooltip:e?.tooltip,showColorScale:e?.showColorScale,zoomScaleExtend:e?.zoomScaleExtend,zoomTranslateExtend:e?.zoomTranslateExtend,graphID:e?.graphID,highlightedDataPoints:e?.highlightedDataPoints,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,showAntarctica:e?.showAntarctica,language:e?.language,minHeight:e?.minHeight,ariaLabel:e?.ariaLabel,detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,zoomInteraction:e?.zoomInteraction,animate:e?.animate};case"threeDGlobe":return{highlightedIds:e?.highlightedIds,theme:e?.theme,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,graphTitle:e?.graphTitle,mapData:e?.mapData,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,colorDomain:e?.colorDomain,colors:e?.colors,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:Ct("x",a||[],o||[]),scaleType:e?.scaleType,data:i,centerPoint:e?.centerPoint,backgroundColor:e?.backgroundColor,mapNoDataColor:e?.mapNoDataColor,mapBorderColor:e?.mapBorderColor,relativeHeight:e?.relativeHeight,padding:e?.padding,tooltip:e?.tooltip,showColorScale:e?.showColorScale,graphID:e?.graphID,dataDownload:e?.dataDownload,mapProperty:e?.mapProperty,language:e?.language,minHeight:e?.minHeight,ariaLabel:e?.ariaLabel,onSeriesMouseClick:g=>{s?.(g.id)},detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,categorical:e?.categorical,autoRotate:e?.autoRotate,globeMaterial:e?.globeMaterial,atmosphereColor:e?.atmosphereColor,enableZoom:e?.enableZoom};case"donutChart":return{precision:e?.precision,theme:e?.theme,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,mainText:e?.mainText,data:i,colors:e?.colors,graphTitle:e?.graphTitle,suffix:e?.suffix,prefix:e?.prefix,sources:e?.sources,graphDescription:e?.graphDescription,subNote:e?.subNote,footNote:e?.footNote,radius:e?.radius,strokeWidth:e?.strokeWidth,showColorScale:e?.showColorScale,backgroundColor:e?.backgroundColor,padding:e?.padding,tooltip:e?.tooltip,graphID:e?.graphID,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,colorDomain:e?.colorDomain,sortData:e?.sortData,language:e?.language,width:e?.width,height:e?.height,minHeight:e?.minHeight,relativeHeight:e?.relativeHeight,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,ariaLabel:e?.ariaLabel,legendMaxWidth:e?.legendMaxWidth,onSeriesMouseClick:g=>{s?.(g.label)},detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,colorScaleMaxWidth:e?.colorScaleMaxWidth};case"slopeChart":return{customLayers:e?.customLayers,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:i,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,showLabels:e?.showLabels,colors:e?.colors,colorDomain:e?.colorDomain,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:Ct("color",a||[],o||[]),radius:e?.radius,axisTitles:e?.axisTitles,backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,highlightedDataPoints:e?.highlightedDataPoints,showColorScale:e?.showColorScale,graphID:e?.graphID,maxValue:e?.maxValue,minValue:e?.minValue,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,fillContainer:e?.fillContainer,language:e?.language,minHeight:e?.minHeight,ariaLabel:e?.ariaLabel,detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,animate:e?.animate};case"scatterPlot":return{timeline:e?.timeline,customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:i,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,showLabels:e?.showLabels,colors:e?.colors,colorDomain:e?.colorDomain,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:Ct("color",a||[],o||[]),radius:e?.radius,xAxisTitle:Object.keys(e||{}).indexOf("xAxisTitle")!==-1?e?.xAxisTitle:Ct("x",a||[],o||[]),yAxisTitle:Object.keys(e||{}).indexOf("yAxisTitle")!==-1?e?.yAxisTitle:Ct("y",a||[],o||[]),backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,refXValues:e?.refXValues,refYValues:e?.refYValues,highlightedDataPoints:e?.highlightedDataPoints,highlightAreaSettings:e?.highlightAreaSettings,showColorScale:e?.showColorScale,graphID:e?.graphID,maxRadiusValue:e?.maxRadiusValue,maxXValue:e?.maxXValue,minXValue:e?.minXValue,maxYValue:e?.maxYValue,minYValue:e?.minYValue,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,showNAColor:e?.showNAColor,customHighlightAreaSettings:e?.customHighlightAreaSettings,annotations:e?.annotations,regressionLine:e?.regressionLine,ariaLabel:e?.ariaLabel,detailsOnClick:e?.detailsOnClick,noOfXTicks:e?.noOfXTicks,noOfYTicks:e?.noOfYTicks,labelColor:e?.labelColor,xSuffix:e?.xSuffix,ySuffix:e?.ySuffix,xPrefix:e?.xPrefix,yPrefix:e?.yPrefix,styles:e?.styles,classNames:e?.classNames,animate:e?.animate};case"dumbbellChart":return{timeline:e?.timeline,customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,orientation:e?.orientation,refValues:e?.refValues,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:i,colors:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,barPadding:e?.barPadding,showTicks:e?.showTicks,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,truncateBy:e?.truncateBy,labelOrder:e?.labelOrder,showColorScale:e?.showColorScale,colorDomain:e?.colorDomain||Ct("x",a||[],o||[]),colorLegendTitle:e?.colorLegendTitle,backgroundColor:e?.backgroundColor,padding:e?.padding,radius:e?.radius,relativeHeight:e?.relativeHeight,showValues:e?.showValues,showLabels:e?.showLabels,tooltip:e?.tooltip,graphID:e?.graphID,maxValue:e?.maxValue,minValue:e?.minValue,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,suffix:e?.suffix,prefix:e?.prefix,language:e?.language,minHeight:e?.minHeight,sortParameter:e?.sortParameter,arrowConnector:e?.arrowConnector,connectorStrokeWidth:e?.connectorStrokeWidth,maxBarThickness:e?.maxBarThickness,minBarThickness:e?.minBarThickness,maxNumberOfBars:e?.maxNumberOfBars,ariaLabel:e?.ariaLabel,detailsOnClick:e?.detailsOnClick,axisTitle:e?.axisTitle,noOfTicks:e?.noOfTicks,valueColor:e?.valueColor,styles:e?.styles,classNames:e?.classNames,animate:e?.animate,highlightedDataPoints:e?.highlightedDataPoints,dimmedOpacity:e?.dimmedOpacity};case"treeMap":return{precision:e?.precision,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:i,colors:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,suffix:e?.suffix,prefix:e?.prefix,sources:e?.sources,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,colorDomain:e?.colorDomain,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:Ct("color",a||[],o||[]),backgroundColor:e?.backgroundColor,padding:e?.padding,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,showLabels:e?.showLabels,tooltip:e?.tooltip,showColorScale:e?.showColorScale,showValues:e?.showValues,graphID:e?.graphID,highlightedDataPoints:e?.highlightedDataPoints,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,showNAColor:e?.showNAColor,ariaLabel:e?.ariaLabel,onSeriesMouseClick:g=>{s?.(g.label)},detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,animate:e?.animate};case"circlePacking":return{precision:e?.precision,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:i,colors:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,suffix:e?.suffix,prefix:e?.prefix,sources:e?.sources,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,colorDomain:e?.colorDomain,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:Ct("color",a||[],o||[]),backgroundColor:e?.backgroundColor,padding:e?.padding,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,showLabels:e?.showLabels,tooltip:e?.tooltip,showColorScale:e?.showColorScale,showValues:e?.showValues,graphID:e?.graphID,highlightedDataPoints:e?.highlightedDataPoints,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,showNAColor:e?.showNAColor,ariaLabel:e?.ariaLabel,radius:e?.radius,maxRadiusValue:e?.maxRadiusValue,onSeriesMouseClick:g=>{s?.(g.label)},detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,animate:e?.animate};case"heatMap":return{precision:e?.precision,theme:e?.theme,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:i,colors:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,scaleType:e?.scaleType,colorDomain:e?.colorDomain,showColumnLabels:e?.showColumnLabels,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,truncateBy:e?.truncateBy,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:Ct("color",a||[],o||[]),backgroundColor:e?.backgroundColor,padding:e?.padding,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,suffix:e?.suffix,prefix:e?.prefix,showValues:e?.showValues,showRowLabels:e?.showRowLabels,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,graphID:e?.graphID,noDataColor:e?.noDataColor,showColorScale:e?.showColorScale,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,fillContainer:e?.fillContainer,language:e?.language,minHeight:e?.minHeight,showNAColor:e?.showNAColor,ariaLabel:e?.ariaLabel,detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,animate:e?.animate};case"stripChart":return{customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,orientation:e?.orientation,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:i,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,colors:e?.colors,colorDomain:e?.colorDomain,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:Ct("color",a||[],o||[]),radius:e?.radius,backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,highlightedDataPoints:e?.highlightedDataPoints,showColorScale:e?.showColorScale,graphID:e?.graphID,maxValue:e?.maxValue,minValue:e?.minValue,noOfTicks:e?.noOfTicks,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,prefix:e?.prefix,suffix:e?.suffix,stripType:e?.stripType,valueColor:e?.valueColor,language:e?.language,minHeight:e?.minHeight,highlightColor:e?.highlightColor,dotOpacity:e?.dotOpacity,showNAColor:e?.showNAColor,ariaLabel:e?.ariaLabel,detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,animate:e?.animate};case"beeSwarmChart":return{customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:i,colors:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,showTicks:e?.showTicks,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,colorDomain:e?.colorDomain,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:Ct("color",a||[],o||[]),backgroundColor:e?.backgroundColor,padding:e?.padding,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,showLabels:e?.showLabels,showColorScale:e?.showColorScale,tooltip:e?.tooltip,refValues:e?.refValues,graphID:e?.graphID,radius:e?.radius,maxRadiusValue:e?.maxRadiusValue,maxValue:e?.maxValue,minValue:e?.minValue,highlightedDataPoints:e?.highlightedDataPoints,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,showNAColor:e?.showNAColor,ariaLabel:e?.ariaLabel,detailsOnClick:e?.detailsOnClick,orientation:e?.orientation,styles:e?.styles,classNames:e?.classNames,animate:e?.animate};case"butterflyChart":return{naLabel:e?.naLabel,timeline:e?.timeline,customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:i,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,leftBarTitle:Object.keys(e||{}).indexOf("leftBarTitle")!==-1?e?.leftBarTitle:Ct("leftBar",a||[],o||[]),rightBarTitle:Object.keys(e||{}).indexOf("rightBarTitle")!==-1?e?.rightBarTitle:Ct("rightBar",a||[],o||[]),footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,barColors:e?.barColors,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,graphID:e?.graphID,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,barPadding:e?.barPadding,truncateBy:e?.truncateBy,suffix:e?.suffix,prefix:e?.prefix,showTicks:e?.showTicks,showValues:e?.showValues,centerGap:e?.centerGap,maxValue:e?.maxValue,minValue:e?.minValue,showColorScale:e?.showColorScale,refValues:e?.refValues,language:e?.language,minHeight:e?.minHeight,ariaLabel:e?.ariaLabel,detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,animate:e?.animate};case"histogram":return{precision:e?.precision,theme:e?.theme,data:i,colors:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,barPadding:e?.barPadding,showValues:e?.showValues,showTicks:e?.showTicks,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,backgroundColor:e?.backgroundColor,padding:e?.padding,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,showLabels:e?.showLabels,maxValue:e?.maxValue,tooltip:e?.tooltip,refValues:e?.refValues,graphID:e?.graphID,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,numberOfBins:e?.numberOfBins,truncateBy:e?.truncateBy,donutStrokeWidth:e?.donutStrokeWidth,sortData:e?.sortData,barGraphLayout:e?.barGraphLayout,graphType:e?.graphType,language:e?.language,minHeight:e?.minHeight,maxBarThickness:e?.maxBarThickness,ariaLabel:e?.ariaLabel,detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames};case"sparkLine":return{customLayers:e?.customLayers,theme:e?.theme,data:i,curveType:e?.curveType,lineColor:e?.lineColor,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,dateFormat:e?.dateFormat,area:e?.area,backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,graphID:e?.graphID,maxValue:e?.maxValue,minValue:e?.minValue,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,ariaLabel:e?.ariaLabel,styles:e?.styles,classNames:e?.classNames};case"paretoChart":return{naLabel:e?.naLabel,customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:i,showValues:e?.showValues,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,barTitle:Object.keys(e||{}).indexOf("barTitle")!==-1?e?.barTitle:Ct("barTitle",a||[],o||[]),lineTitle:Object.keys(e||{}).indexOf("lineTitle")!==-1?e?.lineTitle:Ct("lineTitle",a||[],o||[]),footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,barColor:e?.barColor,curveType:e?.curveType,lineColor:e?.lineColor,sameAxes:e?.sameAxes,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,graphID:e?.graphID,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,barPadding:e?.barPadding,truncateBy:e?.truncateBy,showLabels:e?.showLabels,language:e?.language,minHeight:e?.minHeight,ariaLabel:e?.ariaLabel,detailsOnClick:e?.detailsOnClick,noOfTicks:e?.noOfTicks,lineSuffix:e?.lineSuffix,barSuffix:e?.barSuffix,linePrefix:e?.lineSuffix,barPrefix:e?.barPrefix,barAxisTitle:e?.barAxisTitle,lineAxisTitle:e?.lineAxisTitle,styles:e?.styles,classNames:e?.classNames,animate:e?.animate};case"dataTable":return{naLabel:e?.naLabel,precision:e?.precision,theme:e?.theme,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,graphTitle:e?.graphTitle,sources:e?.sources,graphDescription:e?.graphDescription,footNote:e?.footNote,graphID:e?.graphID,width:e?.width,height:e?.height,columnData:e?.columnData||[],data:i,language:e?.language,ariaLabel:e?.ariaLabel,minWidth:e?.minWidth,backgroundColor:e?.backgroundColor,padding:e?.padding,styles:e?.styles,classNames:e?.classNames};case"statCard":return{precision:e?.precision,theme:e?.theme,year:e?.year,data:i,graphTitle:e?.graphTitle||"",graphDescription:e?.graphDescription,suffix:e?.suffix,prefix:e?.prefix,sources:e?.sources||[],footNote:e?.footNote,backgroundColor:e?.backgroundColor,padding:e?.padding,graphID:e?.graphID,aggregationMethod:e?.aggregationMethod,language:e?.language,minHeight:e?.minHeight,countOnly:e?.countOnly,ariaLabel:e?.ariaLabel,textBackground:e?.textBackground,headingFontSize:e?.headingFontSize,centerAlign:e?.centerAlign,verticalAlign:e?.verticalAlign,styles:e?.styles,classNames:e?.classNames,layout:e?.layout};case"geoHubCompareMap":return{theme:e?.theme,graphTitle:e?.graphTitle,sources:e?.sources,graphDescription:e?.graphDescription,footNote:e?.footNote,backgroundColor:e?.backgroundColor,padding:e?.padding,width:e?.width,height:e?.height,relativeHeight:e?.relativeHeight,graphID:e?.graphID,mapStyles:e?.mapStyles,center:e?.center,zoomLevel:e?.zoomLevel,language:e?.language,minHeight:e?.minHeight,ariaLabel:e?.ariaLabel,styles:e?.styles,classNames:e?.classNames,mapLegend:e?.mapLegend};case"geoHubMap":return{theme:e?.theme,mapStyle:e?.mapStyle,center:e?.center,zoomLevel:e?.zoomLevel,graphTitle:e?.graphTitle,sources:e?.sources,graphDescription:e?.graphDescription,footNote:e?.footNote,backgroundColor:e?.backgroundColor,padding:e?.padding,width:e?.width,height:e?.height,relativeHeight:e?.relativeHeight,graphID:e?.graphID,language:e?.language,minHeight:e?.minHeight,includeLayers:e?.includeLayers,excludeLayers:e?.excludeLayers,ariaLabel:e?.ariaLabel,uiMode:e?.uiMode,styles:e?.styles,classNames:e?.classNames,mapLegend:e?.mapLegend};case"geoHubMapWithLayerSelection":return{theme:e?.theme,mapStyle:e?.mapStyle,center:e?.center,zoomLevel:e?.zoomLevel,graphTitle:e?.graphTitle,sources:e?.sources,graphDescription:e?.graphDescription,footNote:e?.footNote,backgroundColor:e?.backgroundColor,padding:e?.padding,width:e?.width,height:e?.height,relativeHeight:e?.relativeHeight,graphID:e?.graphID,language:e?.language,minHeight:e?.minHeight,layerSelection:e?.layerSelection,excludeLayers:e?.excludeLayers,ariaLabel:e?.ariaLabel,uiMode:e?.uiMode,mapLegend:e?.mapLegend};case"unitChart":return{precision:e?.precision,theme:e?.theme,totalNoOfDots:e?.totalNoOfDots,gridSize:e?.gridSize,unitPadding:e?.unitPadding,size:e?.size,graphTitle:e?.graphTitle,sources:e?.sources,colors:e?.colors,graphDescription:e?.graphDescription,footNote:e?.footNote,backgroundColor:e?.backgroundColor,padding:e?.padding,graphID:e?.graphID,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,showColorScale:e?.showColorScale,showStrokeForWhiteDots:e?.showStrokeForWhiteDots,note:e?.note,data:i,width:e?.width,height:e?.height,minHeight:e?.minHeight,relativeHeight:e?.relativeHeight,ariaLabel:e?.ariaLabel,styles:e?.styles,classNames:e?.classNames,animate:e?.animate};case"sankeyChart":return{customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:i,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,showLabels:e?.showLabels,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,truncateBy:e?.truncateBy,padding:e?.padding,backgroundColor:e?.backgroundColor,tooltip:e?.tooltip,suffix:e?.suffix,prefix:e?.prefix,relativeHeight:e?.relativeHeight,showValues:e?.showValues,graphID:e?.graphID,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,fillContainer:e?.fillContainer,language:e?.language,minHeight:e?.minHeight,ariaLabel:e?.ariaLabel,sourceColors:e?.sourceColors,targetColors:e?.targetColors,sourceColorDomain:e?.sourceColorDomain,targetColorDomain:e?.targetColorDomain,nodePadding:e?.nodePadding,nodeWidth:e?.nodeWidth,highlightedSourceDataPoints:e?.highlightedSourceDataPoints,highlightedTargetDataPoints:e?.highlightedTargetDataPoints,defaultLinkOpacity:e?.defaultLinkOpacity,sourceTitle:e?.sourceTitle,targetTitle:e?.targetTitle,sortNodes:e?.sortNodes,detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,animate:e?.animate};case"dataCards":return{theme:e?.theme,graphTitle:e?.graphTitle,sources:e?.sources,graphDescription:e?.graphDescription,footNote:e?.footNote,graphID:e?.graphID,width:e?.width,height:e?.height,columnData:e?.columnData||[],data:i,language:e?.language,ariaLabel:e?.ariaLabel,cardTemplate:e?.cardTemplate,cardBackgroundColor:e?.cardBackgroundColor,cardFilters:e?.cardFilters||[],cardSortingOptions:e?.cardSortingOptions,cardSearchColumns:e?.cardSearchColumns,cardMinWidth:e?.cardMinWidth,backgroundColor:e?.backgroundColor,padding:e?.padding,detailsOnClick:e?.detailsOnClick,allowDataDownloadOnDetail:e?.allowDataDownloadOnDetail,noOfItemsInAPage:e?.noOfItemsInAPage,uiMode:e?.uiMode,styles:e?.styles,classNames:e?.classNames};case"radarChart":return{customLayers:e?.customLayers,precision:e?.precision,graphTitle:e?.graphTitle,dimmedOpacity:e?.dimmedOpacity,graphDescription:e?.graphDescription,footNote:e?.footNote,sources:e?.sources,ariaLabel:e?.ariaLabel,colors:e?.colors,colorDomain:e?.colorDomain,colorLegendTitle:e?.colorLegendTitle,backgroundColor:e?.backgroundColor,styles:e?.styles,classNames:e?.classNames,width:e?.width,height:e?.height,minHeight:e?.minHeight,relativeHeight:e?.relativeHeight,padding:e?.padding,radius:e?.radius,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,maxValue:e?.maxValue,minValue:e?.minValue,showValues:e?.showValues,showDots:e?.showDots,strokeWidth:e?.strokeWidth,fillShape:e?.fillShape,noOfTicks:e?.noOfTicks,showColorScale:e?.showColorScale,showNAColor:e?.showNAColor,highlightedLines:e?.highlightedLines,axisLabels:e?.axisLabels,curveType:e?.curveType,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,tooltip:e?.tooltip,detailsOnClick:e?.detailsOnClick,language:e?.language,theme:e?.theme,graphID:e?.graphID,animate:e?.animate};default:return{}}},h=c[n],f=u(n);return l.jsx("div",{className:`grow my-0 ${n!=="statCard"?"mx-auto":"mx-0"} flex flex-col h-inherit ${e?.width?"w-fit":"w-full"} ${n!=="unitChart"&&n!=="statCard"?"justify-center":"justify-start"} ${e?.theme||"light"}`,style:{minHeight:"inherit"},children:h?l.jsx(h,{...f}):l.jsx(Ce.P,{size:"sm",marginBottom:"none",className:"p-2 text-center text-accent-dark-red dark:text-accent-red",children:`Invalid chart type: ${n}`})})}const Cc=[{chartID:"barChart",configuration:[{id:"label",required:!0,multiple:!1},{id:"size",required:!0,multiple:!1},{id:"color",required:!1,multiple:!1},{id:"date",required:!1,multiple:!1}]},{chartID:"bulletChart",configuration:[{id:"label",required:!0,multiple:!1},{id:"size",required:!0,multiple:!1},{id:"target",required:!1,multiple:!1},{id:"qualitativeRange",required:!1,multiple:!0}]},{chartID:"radarChart",configuration:[{id:"label",required:!1,multiple:!1},{id:"values",required:!0,multiple:!0},{id:"color",required:!1,multiple:!1}]},{chartID:"stackedBarChart",configuration:[{id:"label",required:!0,multiple:!1},{id:"size",multiple:!0,required:!0},{id:"date",required:!1,multiple:!1}]},{chartID:"groupedBarChart",configuration:[{id:"label",required:!0,multiple:!1},{id:"size",multiple:!0,required:!0},{id:"date",required:!1,multiple:!1}]},{chartID:"lineChart",configuration:[{id:"date",required:!0,multiple:!1},{id:"y",required:!0,multiple:!1}]},{chartID:"dualAxisLineChart",configuration:[{id:"date",required:!0,multiple:!1},{id:"y1",multiple:!1,required:!0},{id:"y2",multiple:!1,required:!0}]},{chartID:"differenceLineChart",configuration:[{id:"date",required:!0,multiple:!1},{id:"y1",multiple:!1,required:!0},{id:"y2",multiple:!1,required:!0}]},{chartID:"multiLineChart",configuration:[{id:"date",required:!0,multiple:!1},{id:"y",multiple:!0,required:!0}]},{chartID:"multiLineAltChart",configuration:[{id:"date",required:!0,multiple:!1},{id:"y",multiple:!1,required:!0},{id:"label",multiple:!1,required:!0},{id:"color",multiple:!1,required:!1}]},{chartID:"stackedAreaChart",configuration:[{id:"date",required:!0,multiple:!1},{id:"y",multiple:!0,required:!0}]},{chartID:"threeDGlobe",configuration:[{id:"id",required:!0,multiple:!1},{id:"x",required:!0,multiple:!1}]},{chartID:"choroplethMap",configuration:[{id:"id",required:!0,multiple:!1},{id:"x",required:!0,multiple:!1},{id:"date",required:!1,multiple:!1}]},{chartID:"biVariateChoroplethMap",configuration:[{id:"id",required:!0,multiple:!1},{id:"x",required:!0,multiple:!1},{id:"y",required:!0,multiple:!1},{id:"date",required:!1,multiple:!1}]},{chartID:"dotDensityMap",configuration:[{id:"lat",required:!0,multiple:!1},{id:"long",required:!0,multiple:!1},{id:"label",multiple:!1,required:!1},{id:"color",multiple:!1,required:!1},{id:"radius",required:!1,multiple:!1},{id:"date",required:!1,multiple:!1}]},{chartID:"donutChart",configuration:[{id:"label",required:!0,multiple:!1},{id:"size",required:!0,multiple:!1}]},{chartID:"slopeChart",configuration:[{id:"label",required:!0,multiple:!1},{id:"y1",required:!0,multiple:!1},{id:"y2",required:!0,multiple:!1},{id:"color",required:!1,multiple:!1}]},{chartID:"scatterPlot",configuration:[{id:"x",required:!0,multiple:!1},{id:"y",required:!0,multiple:!1},{id:"radius",required:!1,multiple:!1},{id:"color",required:!1,multiple:!1},{id:"label",required:!0,multiple:!1},{id:"date",required:!1,multiple:!1}]},{chartID:"dumbbellChart",configuration:[{id:"label",required:!0,multiple:!1},{id:"x",multiple:!0,required:!0},{id:"date",required:!1,multiple:!1}]},{chartID:"treeMap",configuration:[{id:"label",required:!0,multiple:!1},{id:"size",required:!0,multiple:!1},{id:"color",required:!1,multiple:!1}]},{chartID:"circlePacking",configuration:[{id:"label",required:!0,multiple:!1},{id:"size",required:!1,multiple:!1},{id:"color",required:!1,multiple:!1}]},{chartID:"sankeyChart",configuration:[{id:"source",required:!0,multiple:!1},{id:"target",required:!0,multiple:!1},{id:"value",required:!1,multiple:!1}]},{chartID:"heatMap",configuration:[{id:"row",required:!0,multiple:!1},{id:"column",required:!0,multiple:!1},{id:"value",required:!0,multiple:!1}]},{chartID:"stripChart",configuration:[{id:"label",required:!0,multiple:!1},{id:"position",required:!0,multiple:!1},{id:"color",required:!1,multiple:!1}]},{chartID:"statCard",configuration:[{id:"value",required:!0,multiple:!1}]},{chartID:"beeSwarmChart",configuration:[{id:"label",required:!0,multiple:!1},{id:"position",required:!0,multiple:!1},{id:"radius",required:!1,multiple:!1},{id:"color",required:!1,multiple:!1}]},{chartID:"butterflyChart",configuration:[{id:"label",required:!0,multiple:!1},{id:"leftBar",required:!0,multiple:!1},{id:"rightBar",required:!0,multiple:!1},{id:"date",required:!1,multiple:!1}]},{chartID:"lineChartWithConfidenceInterval",configuration:[{id:"date",required:!0,multiple:!1},{id:"y",required:!0,multiple:!1},{id:"yMin",required:!1,multiple:!1},{id:"yMax",required:!1,multiple:!1}]},{chartID:"histogram",configuration:[{id:"value",required:!0,multiple:!1}]},{chartID:"sparkLine",configuration:[{id:"dale",required:!0,multiple:!1},{id:"y",required:!0,multiple:!1}]},{chartID:"paretoChart",configuration:[{id:"label",required:!0,multiple:!1},{id:"bar",required:!0,multiple:!1},{id:"line",required:!0,multiple:!1}]},{chartID:"unitChart",configuration:[{id:"label",required:!0,multiple:!1},{id:"value",required:!0,multiple:!1}]}];function n0(t,e){return e.filter(n=>!t.includes(n))}function xE(t,e,n){const i=hn(t.map(c=>c.columnId)),r=n0(n,i);if(r.length!==0)return{isValid:!1,err:`Key(s) in configuration that don't match keys in the data: ${r.join(", ")}. Possible reason: If you are using 'dataTransform' then the allowed keys (columns) are only the one present in 'aggregationColumnsSetting' array in 'dataTransform' object plus n additional key called 'count'.`};const a=t.map(c=>c.chartConfigId),o=Cc[Cc.findIndex(c=>c.chartID===e)].configuration.filter(c=>c.required).map(c=>c.id),s=n0(a,o);return{isValid:s.length===0,err:s.length===0?void 0:`Missing required ID(s) in configuration: ${s.join(", ")}`}}const Fi=[{graphName:"Bar graph",graphID:"barChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!0},{graphName:"Stacked bar graph",graphID:"stackedBarChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Grouped bar graph",graphID:"groupedBarChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Animated bar chart",graphID:"animatedBarChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Animated stacked bar chart",graphID:"animatedStackedBarChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Animated grouped bar chart",graphID:"animatedGroupedBarChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Bee swarm chart",graphID:"beeSwarmChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Butterfly chart",graphID:"butterflyChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Animated butterfly chart",graphID:"animatedButterflyChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Bullet chart",graphID:"bulletChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Circle packing",graphID:"circlePacking",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!0},{graphName:"Data table",graphID:"dataTable",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Pie/donut chart",graphID:"donutChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!0},{graphName:"Dumbbell chart",graphID:"dumbbellChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Animated dumbbell chart",graphID:"animatedDumbbellChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Heat map",graphID:"heatMap",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Histogram",graphID:"histogram",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Line chart",graphID:"lineChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Multi-line chart",graphID:"multiLineChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Multi-line chart alternative",graphID:"multiLineAltChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Difference line chart",graphID:"differenceLineChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Dual-axes line chart",graphID:"dualAxisLineChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Line chart with interval",graphID:"lineChartWithConfidenceInterval",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Spark line",graphID:"sparkLine",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Choropleth map",graphID:"choroplethMap",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Three-D globe",graphID:"threeDGlobe",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Bi-variate choropleth map",graphID:"biVariateChoroplethMap",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Dot density map",graphID:"dotDensityMap",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Animated choropleth map",graphID:"animatedChoroplethMap",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Animated bi-variate choropleth map",graphID:"animatedBiVariateChoroplethMap",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Animated dot density map",graphID:"animatedDotDensityMap",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"GeoHub map with comparison",graphID:"geoHubCompareMap",availableInGriddedGraph:!1,geoHubMapPresentation:!0,availableInWideToLongFormat:!1},{graphName:"GeoHub map",graphID:"geoHubMap",availableInGriddedGraph:!1,geoHubMapPresentation:!0,availableInWideToLongFormat:!1},{graphName:"GeoHub map with layer selection",graphID:"geoHubMapWithLayerSelection",availableInGriddedGraph:!1,geoHubMapPresentation:!0,availableInWideToLongFormat:!1},{graphName:"Pareto chart",graphID:"paretoChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Scatter plot",graphID:"scatterPlot",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Animated scatter plot",graphID:"animatedScatterPlot",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Slope chart",graphID:"slopeChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Stacked area chart/area chart",graphID:"stackedAreaChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Statistic card",graphID:"statCard",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Strip chart",graphID:"stripChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Tree map",graphID:"treeMap",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!0},{graphName:"Unit chart",graphID:"unitChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!0},{graphName:"Sankey chart",graphID:"sankeyChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Data cards list",graphID:"dataCards",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1},{graphName:"Radar chart",graphID:"radarChart",availableInGriddedGraph:!0,geoHubMapPresentation:!1,availableInWideToLongFormat:!1}];function Vc(t,e,n){if(Fi.filter(r=>r.geoHubMapPresentation).map(r=>r.graphID).indexOf(e)!==-1)return t;if(!t)return"Cannot fetch data";if(e==="dataTable"||e==="dataCards"||t.length===0)return t;if(!n)return console.error("Your data configuration is not accurate"),"No graph configuration is provided";const i=xE(n,e,Object.keys(t[0]));if(i.isValid){const r=Cc[Cc.findIndex(o=>o.chartID===e)].configuration;return t.map(o=>{const s={};return n.filter(c=>c.columnId).forEach(c=>{r[r.findIndex(u=>u.id===c.chartConfigId)].multiple?(s[r[r.findIndex(u=>u.id===c.chartConfigId)].id]=[],c.columnId.forEach(u=>{s[r[r.findIndex(h=>h.id===c.chartConfigId)].id].push(je(o[u])?null:o[u])})):s[r[r.findIndex(u=>u.id===c.chartConfigId)].id]=je(o[c.columnId])?null:o[c.columnId],s[`${c.chartConfigId}Columns`]=c.columnId}),s.data=o,s})}return console.error(i.err),i.err}function Td(t,e,n){return t.length===0?[]:typeof t[0][e]!="object"?Xe(t,o=>o[e]).map(o=>{const s={};s[e]=o[e];const c=t.filter(u=>u[e]===o[e]);return s.count=c.length,s.rollUpData=c,n?.forEach(u=>{s[u.column]=u.aggregationMethod==="average"?parseFloat((rt(c.map(h=>h[u.column]))/c.length).toFixed(2)):u.aggregationMethod==="max"?Math.max(...c.map(h=>h[u.column])):u.aggregationMethod==="min"?Math.min(...c.map(h=>h[u.column])):rt(c.map(h=>h[u.column]))}),s}):Xe(hn(t.map(a=>a[e])),a=>a).map(a=>{const o={};o[e]=a;const s=t.filter(c=>c[e].indexOf(a)!==-1);return o.rollUpData=s,o.count=s.length,n?.forEach(c=>{o[c.column]=c.aggregationMethod==="average"?parseFloat((rt(s.map(u=>u[c.column]))/s.length).toFixed(2)):c.aggregationMethod==="max"?Math.max(...s.map(u=>u[c.column])):c.aggregationMethod==="min"?Math.min(...s.map(u=>u[c.column])):rt(s.map(u=>u[c.column]))}),o})}function xw(t,e){return e.findIndex(n=>n.chartConfigId===t)===-1?!1:typeof e[e.findIndex(n=>n.chartConfigId===t)].columnId!="string"}const vE=t=>{if(t.findIndex(n=>n.chartConfigId==="yMin")!==-1&&t.findIndex(n=>n.chartConfigId==="yMax")!==-1)return t;const e=[...t];return t.findIndex(n=>n.chartConfigId==="yMin")===-1&&e.push({chartConfigId:"yMin",columnId:`${t[t.findIndex(n=>n.chartConfigId==="y")].columnId}Min`}),t.findIndex(n=>n.chartConfigId==="yMax")===-1&&e.push({chartConfigId:"yMax",columnId:`${t[t.findIndex(n=>n.chartConfigId==="y")].columnId}Max`}),e},Fu=(t,e)=>{const n=e?.map(i=>{const r=t?.findIndex(o=>o.chartConfigId===i.chartConfigId);if(r===-1)return{};const a=t[r]?.allowedColumnIds?.findIndex(o=>o.value===i.columnId);return a===-1?{}:t[r].allowedColumnIds[a].graphSettings||{}})||[];return Object.assign({},...n)};function ol(t){const{graphSettings:e,dataSettings:n,filters:i,graphType:r,dataTransform:a,graphDataConfiguration:o,dataFilters:s,debugMode:c,dataSelectionOptions:u,advancedDataSelectionOptions:h,readableHeader:f,noOfFiltersPerRow:d=4,updateFilters:g,uiMode:p="normal",theme:y="light",highlightDataPointSettings:v}=t,[m,I]=k.useState(void 0),[j,w]=k.useState(void 0),[S,P]=k.useState(o),[W,D]=k.useState({}),[x,$]=k.useState(void 0),[V,q]=k.useState([]),ae=k.useRef(null),G=k.useRef(o),[_,b]=k.useState([]),B=k.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),X=k.useCallback(async()=>{if(r!=="geoHubMap"&&r!=="geoHubCompareMap"&&r!=="geoHubMapWithLayerSelection"&&n)try{const O=await(n.dataURL?typeof n.dataURL=="string"?n.fileType==="json"?en(n.dataURL,n.columnsToArray,n.dataTransformation,c):n.fileType==="api"?uo(n.dataURL,n.apiHeaders,n.columnsToArray,n.dataTransformation,c):co(n.dataURL,n.dataTransformation,n.columnsToArray,c,n.delimiter,!0):ts(n.dataURL,n.idColumnTitle):$r(n.data,n.columnsToArray));w(O);const K=(i||[]).map(Q=>({filter:Q.column,label:Q.label||`Filter by ${Q.column}`,singleSelect:Q.singleSelect,clearable:Q.clearable,defaultValue:Kr(Q.defaultValue),value:Kr(Q.defaultValue),availableValues:jr(O,Q.column).filter(se=>!Q.excludeValues?.includes(`${se}`)).map(se=>({value:se,label:se})),allowSelectAll:Q.allowSelectAll,width:Q.width}));b(K)}catch(M){console.error("Data fetching error:",M)}},[n,r,i,c]);k.useEffect(()=>{X()},[X]);const z=k.useMemo(()=>!j||_.length===0?j:j.filter(O=>_.every(K=>K.value&&hn([K.value]).length>0?Qa(hn([O[K.filter]]),hn([K.value]).map(Q=>Q.value)).length>0:!0)),[_,j]);k.useEffect(()=>{u&&D(Fu(u,o))},[u,o]),k.useEffect(()=>{r!=="geoHubMap"&&r!=="geoHubCompareMap"&&r!=="geoHubMapWithLayerSelection"&&j&&I(z)},[z,r,j]),k.useEffect(()=>{v?.column&&z&&q(jr(z,v.column).filter(M=>!v?.excludeValues?.includes(`${M}`)).map(M=>({value:M,label:M})))},[z,v]),k.useEffect(()=>{dt(G.current,o)||(P(o),G.current=o)},[o]);const C=k.useCallback((M,O)=>{b(K=>K.map(Q=>Q.filter===M?{...Q,value:O}:Q))},[]),A=k.useMemo(()=>{if(!m)return;const M=r==="lineChartWithConfidenceInterval"&&S?vE(S):S;return r!=="geoHubMap"&&r!=="geoHubCompareMap"&&r!=="geoHubMapWithLayerSelection"?Vc(a?Td(Ai(m,s||[]),a.keyColumn,a.aggregationColumnsSetting):Ai(m,s||[]),r,M):void 0},[r,S,m,s,a]);return!n&&r!=="geoHubMap"&&r!=="geoHubCompareMap"&&r!=="geoHubMapWithLayerSelection"?l.jsx(Ce.P,{size:"xs",className:"text-center text-accent-dark-red dark:text-accent-red p-2",children:"Please make sure either `dataSettings` props are present as they are required for data."}):l.jsx("div",{className:`${y||e?.theme||"light"} flex ${e?.width?"w-fit grow-0":"w-full grow"}${e?.height?"":" h-full"}`,dir:e?.language==="he"||e?.language==="ar"?"rtl":void 0,children:l.jsx("div",{className:Ce.cn(`${e?.backgroundColor?e?.backgroundColor===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${e?.language||"en"}`,e?.classNames?.graphContainer),style:{...e?.styles?.graphContainer||{},...e?.backgroundColor&&e?.backgroundColor!==!0?{backgroundColor:e?.backgroundColor}:{}},id:e?.graphID,ref:ae,children:l.jsx("div",{style:{padding:e?.backgroundColor?e?.padding||"1rem":e?.padding||0,flexGrow:1,display:"flex"},children:l.jsx("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:m||Fi.filter(M=>M.geoHubMapPresentation).map(M=>M.graphID).indexOf(r)!==-1?l.jsxs(l.Fragment,{children:[W?.graphTitle||W?.graphDescription||e?.graphTitle||e?.graphDescription||e?.graphDownload||e?.dataDownload?l.jsx(Qe,{styles:{title:W?.styles?.title||e?.styles?.title,description:W?.styles?.description||e?.styles?.description},classNames:{title:W?.classNames?.title||e?.classNames?.title,description:W?.classNames?.description||e?.classNames?.description},graphTitle:W?.graphTitle||e?.graphTitle,graphDescription:W?.graphDescription||e?.graphDescription,width:W?.width||e?.width,graphDownload:e?.graphDownload?ae.current:void 0,dataDownload:e?.dataDownload&&m&&m.length>0?m:null}):null,_.length!==0||(u||[]).length!==0||(h||[]).length!==0||v?l.jsxs("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap",alignItems:"flex-start",width:"100%"},children:[h?.map((M,O)=>l.jsxs("div",{style:{width:M.width||`calc(${100/d}% - ${(d-1)/d}rem)`,flexGrow:1,flexShrink:M.ui!=="radio"?0:1,minWidth:"240px"},children:[l.jsx(Ce.Label,{className:"mb-2",children:M.label||"Graph by"}),M.ui!=="radio"?l.jsx(Ce.DropdownSelect,{options:M.options.map(K=>({...K,value:K.label})),size:"sm",isClearable:!1,isSearchable:!0,variant:p,controlShouldRenderValue:!0,defaultValue:M.defaultValue?{...M.defaultValue,value:M.defaultValue?.label}:{...M.options[0],value:M.options[0].label},onChange:K=>{D(K?.graphSettings||{}),P(K?.dataConfiguration)}}):l.jsx(Ce.RadioGroup,{defaultValue:M.defaultValue?.label||M.options[0].label,variant:p,onValueChange:K=>{const Q=M.options[M.options.findIndex(se=>se.label===K)];D(Q.graphSettings||{}),P(Q.dataConfiguration)},children:M.options.map((K,Q)=>l.jsx(Ce.RadioGroupItem,{label:K.label,value:K.label},Q))})]},O)),u?.map((M,O)=>l.jsxs("div",{style:{width:M.width||`calc(${100/d}% - ${(d-1)/d}rem)`,flexGrow:1,flexShrink:M.ui!=="radio"?0:1,minWidth:"240px"},children:[l.jsx(Ce.Label,{className:"mb-2",children:M.label||`Visualize ${M.chartConfigId} by`}),xw(M.chartConfigId,S||[])?M.ui!=="radio"?l.jsx(Ce.DropdownSelect,{options:M.allowedColumnIds,size:"sm",isMulti:!0,isSearchable:!0,variant:p,controlShouldRenderValue:!0,defaultValue:o?o[o.findIndex(K=>K.chartConfigId===M.chartConfigId)].columnId.map(K=>M.allowedColumnIds[M.allowedColumnIds.findIndex(Q=>Q.value===K)]):void 0,filterOption:Ce.createFilter(B),onChange:K=>{const Q={columnId:(K||[]).map(T=>T.value),chartConfigId:M.chartConfigId},se=S?.map(T=>T.chartConfigId===Q.chartConfigId?Q:T);P(se)}}):l.jsx(Ce.CheckboxGroup,{variant:p,defaultValue:o?o[o.findIndex(K=>K.chartConfigId===M.chartConfigId)].columnId.map(K=>M.allowedColumnIds[M.allowedColumnIds.findIndex(Q=>Q.value===K)]).map(K=>K.value):[],onValueChange:K=>{const Q={columnId:K||[],chartConfigId:M.chartConfigId},se=S?.map(T=>T.chartConfigId===Q.chartConfigId?Q:T);P(se)},children:M.allowedColumnIds.map((K,Q)=>l.jsx(Ce.CheckboxGroupItem,{label:K.label,value:K.label},Q))}):M.ui!=="radio"?l.jsx(Ce.DropdownSelect,{options:M.allowedColumnIds,size:"sm",isClearable:!1,isSearchable:!0,variant:p,controlShouldRenderValue:!0,defaultValue:o?M.allowedColumnIds[M.allowedColumnIds.findIndex(K=>K.value===o[o.findIndex(Q=>Q.chartConfigId===M.chartConfigId)].columnId)]:void 0,onChange:K=>{const Q={columnId:K?.value,chartConfigId:M.chartConfigId},se=S?.map(T=>T.chartConfigId===Q.chartConfigId?Q:T);D(Fu(u,se)),P(se)}}):l.jsx(Ce.RadioGroup,{variant:p,defaultValue:o?M.allowedColumnIds[M.allowedColumnIds.findIndex(K=>K.value===o[o.findIndex(Q=>Q.chartConfigId===M.chartConfigId)].columnId)].label:"",onValueChange:K=>{const se={columnId:M.allowedColumnIds[M.allowedColumnIds.findIndex(Z=>Z.label===K)].value,chartConfigId:M.chartConfigId},T=S?.map(Z=>Z.chartConfigId===se.chartConfigId?se:Z);D(Fu(u,T)),P(T)},children:M.allowedColumnIds.map((K,Q)=>l.jsx(Ce.RadioGroupItem,{label:K.label,value:K.label},Q))})]},O)),_?.map((M,O)=>l.jsxs("div",{style:{width:M.width||`calc(${100/d}% - ${(d-1)/d}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[l.jsx(Ce.Label,{className:"mb-2",children:M.label}),M.singleSelect?l.jsx(Ce.DropdownSelect,{options:M.availableValues,variant:p,isClearable:M.clearable===void 0?!0:M.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:Ce.createFilter(B),onChange:K=>{C(M.filter,K)},value:M.value,defaultValue:M.defaultValue}):l.jsxs(l.Fragment,{children:[M.ui!=="radio"?l.jsx(Ce.DropdownSelect,{options:M.availableValues,variant:p,size:"sm",isMulti:!0,isClearable:M.clearable===void 0?!0:M.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:Ce.createFilter(B),onChange:K=>{C(M.filter,K)},value:M.value,defaultValue:M.defaultValue}):l.jsx(Ce.CheckboxGroup,{variant:p,defaultValue:M.defaultValue?M.defaultValue.map(K=>`${K.value}`):[],value:M.value?M.value.map(K=>`${K.value}`):void 0,onValueChange:K=>{C(M.filter,M.availableValues.filter(Q=>K.indexOf(`${Q.value}`)!==-1))},children:M.availableValues.map((K,Q)=>l.jsx(Ce.CheckboxGroupItem,{label:`${K.label}`,value:`${K.value}`},Q))}),M.allowSelectAll?l.jsx("button",{type:"button",className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",onClick:()=>{C(M.filter,M.availableValues)},children:"Select all options"}):null]})]},O)),v?l.jsxs("div",{style:{width:v.width||`calc(${100/d}% - ${(d-1)/d}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[l.jsx(Ce.Label,{className:"mb-2",children:v.label||"Highlight data"}),l.jsx(Ce.DropdownSelect,{options:V,variant:p,size:"sm",isMulti:!0,isClearable:!0,isSearchable:!0,controlShouldRenderValue:!0,filterOption:Ce.createFilter(B),onChange:M=>{$(M?.map(O=>O.value))},value:x?.map(M=>({label:M,value:M})),defaultValue:v.defaultValues?.map(M=>({label:M,value:M}))})]}):null]}):null,l.jsx(yw,{graph:r,graphData:A,graphDataConfiguration:S,debugMode:c,readableHeader:f||[],updateFilters:g,settings:{...e||{},...W,graphTitle:void 0,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,padding:"0",theme:e?.theme||y,...x?{highlightedDataPoints:x,highlightedIds:x?.map(M=>`${M}`),highlightedLines:x?.map(M=>M)}:{}}})]}):l.jsx("div",{className:"w-full flex justify-center p-4",children:l.jsx(Ce.Spinner,{})})})})})})}const Ru=t=>t.map(i=>i.columnWidth||1).reduce((i,r)=>i+r,0),wE=["barChart","choroplethMap","biVariateChoroplethMap","circlePacking","treeMap"];function vw(t){const{dashboardID:e,dashboardLayout:n,dataSettings:i,filters:r,debugMode:a,theme:o="light",readableHeader:s,dataFilters:c,noOfFiltersPerRow:u=4,filterPosition:h,uiMode:f="normal",graphStyles:d,graphClassNames:g}=t,[p,y]=k.useState(void 0),[v,m]=k.useState(void 0),[I,j]=k.useState([]),w=k.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),S=k.useMemo(()=>!v||I.length===0?v:v.filter(x=>I.every($=>$.value&&hn([$.value]).length>0?Qa(hn([x[$.filter]]),hn([$.value]).map(V=>V.value)).length>0:!0)),[I,v]);k.useEffect(()=>{y(S)},[S]);const P=k.useCallback(async()=>{if(i)try{const x=await(i.dataURL?typeof i.dataURL=="string"?i.fileType==="json"?en(i.dataURL,i.columnsToArray,i.dataTransformation,a):i.fileType==="api"?uo(i.dataURL,i.apiHeaders,i.columnsToArray,i.dataTransformation,a):co(i.dataURL,i.dataTransformation,i.columnsToArray,a,i.delimiter,!0):ts(i.dataURL,i.idColumnTitle):$r(i.data,i.columnsToArray));m(x);const $=(r||[]).map(V=>({filter:V.column,label:V.label||`Filter by ${V.column}`,singleSelect:V.singleSelect,clearable:V.clearable,defaultValue:Kr(V.defaultValue),value:Kr(V.defaultValue),availableValues:jr(x,V.column).filter(q=>!V.excludeValues?.includes(`${q}`)).map(q=>({value:q,label:q})),allowSelectAll:V.allowSelectAll,width:V.width}));j($)}catch(D){console.error("Data fetching error:",D)}},[i,r,a]);k.useEffect(()=>{P()},[P]);const W=k.useCallback((D,x)=>{j($=>$.map(V=>V.filter===D?{...V,value:x}:V))},[]);return l.jsx("div",{className:`${o||"light"} flex grow`,dir:n.language==="he"||n.language==="ar"?"rtl":void 0,children:l.jsx("div",{className:`${n.backgroundColor?n.backgroundColor===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto gap-4 flex flex-col w-full grow h-inherit ${n.language||"en"}`,style:{...n.backgroundColor&&n.backgroundColor!==!0?{backgroundColor:n.backgroundColor}:{}},id:e,children:l.jsx("div",{style:{padding:n.backgroundColor?n.padding||"1rem":n.padding||0,flexGrow:1,display:"flex"},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n.title||n.description?l.jsx(Qe,{graphTitle:n.title,graphDescription:n.description,isDashboard:!0}):null,l.jsxs("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap"},children:[I.length!==0?l.jsx("div",{style:{width:h==="side"?"280px":"100%",flexGrow:1,flexShrink:0},children:l.jsx("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap",alignItems:"flex-start",width:"100%",position:"sticky",top:"1rem"},children:I?.map((D,x)=>l.jsxs("div",{style:{width:D.width||`calc(${100/u}% - ${(u-1)/u}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[l.jsx(Ce.Label,{className:"mb-2",children:D.label}),D.singleSelect?l.jsx(Ce.DropdownSelect,{options:D.availableValues,isClearable:D.clearable===void 0?!0:D.clearable,size:"sm",variant:f,isMulti:!1,isSearchable:!0,filterOption:Ce.createFilter(w),onChange:$=>{W(D.filter,$)},defaultValue:D.defaultValue,value:D.value}):l.jsxs(l.Fragment,{children:[l.jsx(Ce.DropdownSelect,{options:D.availableValues,isMulti:!0,size:"sm",isClearable:D.clearable===void 0?!0:D.clearable,variant:f,isSearchable:!0,controlShouldRenderValue:!0,closeMenuOnSelect:!1,hideSelectedOptions:!1,filterOption:Ce.createFilter(w),onChange:$=>{W(D.filter,$)},value:D.value,defaultValue:D.defaultValue}),D.allowSelectAll?l.jsx("button",{type:"button",className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",onClick:()=>{W(D.filter,D.availableValues)},children:"Select all options"}):null]})]},x))})}):null,l.jsx("div",{style:{width:h==="side"?"calc(100% - 280px - 1rem)":"100%",minWidth:"280px",flexGrow:1,display:"flex",gap:"1rem",flexWrap:"wrap",flexShrink:"0"},children:n.rows.map((D,x)=>l.jsx("div",{style:{display:"flex",gap:"1rem",alignItems:"stretch",minHeight:`${D.height||0}px`,height:"auto",width:"100%",flexWrap:"wrap"},children:D.columns.map(($,V)=>l.jsx("div",{className:"flex bg-transparent h-inherit grow min-w-60",style:{width:`calc(${100*($.columnWidth||1)/Ru(D.columns)}% - ${(Ru(D.columns)-($.columnWidth||1))/Ru(D.columns)}rem)`,minHeight:"inherit"},children:l.jsx(ol,{graphType:$.graphType,dataFilters:$.dataFilters,uiMode:f,graphSettings:{...$.settings||{},width:void 0,height:void 0,resetSelectionOnDoubleClick:$.attachedFilter?!1:$.settings?.resetSelectionOnDoubleClick,styles:$.settings?.styles||d,classNames:$.settings?.classNames||g,radius:$.graphType==="donutChart"?void 0:$.settings?.radius,size:$.graphType==="unitChart"?$.settings?.size:void 0,language:$.settings?.language||n.language,theme:$.settings?.theme||o},dataSettings:{data:p?Ai(p,c||[]):void 0},updateFilters:$.attachedFilter&&wE.indexOf($.graphType)!==-1&&I.findIndex(q=>q.filter===$.attachedFilter)!==-1?q=>{const ae=I.findIndex(_=>_.filter===$.attachedFilter),G=q?I[ae].singleSelect?{value:q,label:q}:[{value:q,label:q}]:void 0;W($.attachedFilter,G)}:void 0,dataTransform:$.dataTransform,dataSelectionOptions:$.dataSelectionOptions,advancedDataSelectionOptions:$.advancedDataSelectionOptions,graphDataConfiguration:$.graphDataConfiguration,debugMode:a,readableHeader:s||[]})},V))},x))})]})]})})})})}function bE(t,e,n,i){const r=[];return t.forEach(a=>{Object.entries(a).forEach(([o,s])=>{if(o!==e){const c={indicator:n.findIndex(u=>u.value===o)!==-1?n[n.findIndex(u=>u.value===o)].label:o,value:s};c[e]=a[e],r.push(c)}})}),i&&console.log(r),r}const Bu=t=>t.map(i=>i.columnWidth||1).reduce((i,r)=>i+r,0);function ww(t){const{dashboardID:e,dashboardLayout:n,dataSettings:i,debugMode:r,theme:a="light",readableHeader:o,dataFilters:s,uiMode:c="normal",graphStyles:u,graphClassNames:h}=t,f=k.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),[d,g]=k.useState(void 0),[p,y]=k.useState([]),[v,m]=k.useState(void 0),[I,j]=k.useState(void 0);k.useEffect(()=>{if(I){const S=I.filter(P=>P[i.keyColumn]===v);g(S)}},[I,v,i.keyColumn]);const w=k.useCallback(async()=>{if(i)try{const P=await(i.dataURL?typeof i.dataURL=="string"?i.fileType==="json"?en(i.dataURL,void 0,i.dataTransformation,r):i.fileType==="api"?uo(i.dataURL,i.apiHeaders,void 0,i.dataTransformation,r):co(i.dataURL,i.dataTransformation,void 0,r,i.delimiter,!0):ts(i.dataURL,i.idColumnTitle):$r(i.data,void 0)),W=Ai(P,s||[]);y(W.map(x=>x[i.keyColumn])),m(W[0][i.keyColumn]);const D=bE(W,i.keyColumn,o||[],r);j(D)}catch(S){console.error("Data fetching error:",S)}},[i,r,s,o]);return k.useEffect(()=>{w()},[w]),l.jsx("div",{className:`${a||"light"} flex grow`,dir:n.language==="he"||n.language==="ar"?"rtl":void 0,children:l.jsx("div",{className:`${n?.backgroundColor?n?.backgroundColor===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}flex flex-col h-inherit w-full ml-auto mr-auto grow gap-4 ${n?.language||"en"}`,style:{...n?.backgroundColor&&n?.backgroundColor!==!0?{backgroundColor:n?.backgroundColor}:{}},id:e,children:l.jsx("div",{className:"flex grow",style:{padding:n.backgroundColor?n.padding||"1rem":n.padding||0},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n.title||n.description?l.jsx(Qe,{graphTitle:n.title,graphDescription:n.description,isDashboard:!0}):null,d?l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap",alignItems:"flex-start",width:"100%"},children:l.jsxs("div",{style:{width:"100%",flexGrow:1,flexShrink:0,minWidth:"240px"},children:[n.dropdownLabel?l.jsx(Ce.Label,{className:"mb-2",children:n.dropdownLabel}):null,l.jsx(Ce.DropdownSelect,{options:p.map(S=>({value:S,label:S})),size:"sm",variant:c,isClearable:!1,isSearchable:!0,controlShouldRenderValue:!0,filterOption:Ce.createFilter(f),onChange:S=>{m(S?.value)},defaultValue:{value:v,label:v}})]})}),n.rows.map((S,P)=>l.jsx("div",{style:{display:"flex",gap:"1rem",alignItems:"stretch",minHeight:`${S.height||0}px`,height:"auto",width:"100%",flexWrap:"wrap"},children:S.columns.map((W,D)=>l.jsx("div",{className:"flex bg-transparent h-inherit grow min-w-60",style:{width:`calc(${100*(W.columnWidth||1)/Bu(S.columns)}% - ${(Bu(S.columns)-(W.columnWidth||1))/Bu(S.columns)}rem)`,minHeight:"inherit"},children:l.jsx(ol,{graphType:W.graphType,dataFilters:W.dataFilters,uiMode:c,graphSettings:{...W.settings||{},width:void 0,height:void 0,radius:W.graphType==="donutChart"?void 0:W.settings?.radius,size:W.graphType==="unitChart"?W.settings.size:void 0,language:W.settings?.language||n.language,theme:W.settings?.theme||a,styles:W.settings?.styles||u,classNames:W.settings?.classNames||h},dataSettings:{data:d},graphDataConfiguration:W.graphDataConfiguration?W.graphDataConfiguration:W.graphType==="unitChart"?[{columnId:"indicator",chartConfigId:"label"},{columnId:"value",chartConfigId:"value"}]:[{columnId:"indicator",chartConfigId:"label"},{columnId:"value",chartConfigId:"size"}],debugMode:r,readableHeader:o||[]})},D))},P))]}):l.jsx("div",{className:"w-full flex justify-center p-4",children:l.jsx(Ce.Spinner,{})})]})})})})}function bw(t){const{graphSettings:e,dataSettings:n,filters:i,graphType:r,dataTransform:a,graphDataConfiguration:o,noOfColumns:s,columnGridBy:c,dataFilters:u,showCommonColorScale:h,minGraphHeight:f,minGraphWidth:d,debugMode:g,dataSelectionOptions:p,advancedDataSelectionOptions:y,readableHeader:v,noOfFiltersPerRow:m=4,uiMode:I="normal",theme:j="light"}=t,[w,S]=k.useState(void 0),[P,W]=k.useState(void 0),[D,x]=k.useState([]),$=k.useRef(null),[V,q]=k.useState(o),[ae,G]=k.useState([]),[_,b]=k.useState({}),B=k.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),X=k.useMemo(()=>!P||ae.length===0?P:P.filter(M=>ae.every(O=>O.value&&hn([O.value]).length>0?Qa(hn([M[O.filter]]),hn([O.value]).map(K=>K.value)).length>0:!0)),[ae,P]);k.useEffect(()=>{S(X)},[X]);const z=k.useCallback(async()=>{if(n)try{const M=await(n.dataURL?typeof n.dataURL=="string"?n.fileType==="json"?en(n.dataURL,n.columnsToArray,n.dataTransformation,g):n.fileType==="api"?uo(n.dataURL,n.apiHeaders,n.columnsToArray,n.dataTransformation,g):co(n.dataURL,n.dataTransformation,n.columnsToArray,g,n.delimiter,!0):ts(n.dataURL,n.idColumnTitle):$r(n.data,n.columnsToArray));W(M);const O=jr(M,c);x(O);const K=(i||[]).map(Q=>({filter:Q.column,label:Q.label||`Filter by ${Q.column}`,singleSelect:Q.singleSelect,clearable:Q.clearable,defaultValue:Kr(Q.defaultValue),value:Kr(Q.defaultValue),availableValues:jr(M,Q.column).filter(se=>!Q.excludeValues?.includes(`${se}`)).map(se=>({value:se,label:se})),allowSelectAll:Q.allowSelectAll,width:Q.width}));G(K)}catch(A){console.error("Data fetching error:",A)}},[n,g,c,i]);k.useEffect(()=>{z()},[z]),k.useEffect(()=>{q(o)},[o]);const C=k.useCallback((A,M)=>{G(O=>O.map(K=>K.filter===A?{...K,value:M}:K))},[]);return l.jsx("div",{className:`${j||e?.theme||"light"} flex ${e?.width?"w-fit grow-0":"w-full grow"}`,dir:e?.language==="he"||e?.language==="ar"?"rtl":void 0,children:l.jsx("div",{className:`${e?.backgroundColor?e?.backgroundColor===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${e?.language||"en"}`,style:{...e?.backgroundColor&&e?.backgroundColor!==!0?{backgroundColor:e?.backgroundColor}:{}},id:e?.graphID,ref:$,"aria-label":e?.ariaLabel||`${e?.graphTitle?`The graph shows ${e?.graphTitle}. `:""}This is a gridded chart.${e?.graphDescription?` ${e?.graphDescription}`:""}`,children:l.jsx("div",{style:{padding:e?.backgroundColor?e?.padding||"1rem":e?.padding||0,flexGrow:1,display:"flex"},children:l.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[_?.graphTitle||_?.graphDescription||e?.graphTitle||e?.graphDescription||e?.graphDownload||e?.dataDownload?l.jsx(Qe,{styles:{title:_?.styles?.title||e?.styles?.title,description:_?.styles?.description||e?.styles?.description},classNames:{title:_?.classNames?.title||e?.classNames?.title,description:_?.classNames?.description||e?.classNames?.description},graphTitle:_?.graphTitle||e?.graphTitle,graphDescription:_?.graphDescription||e?.graphDescription,width:_?.width||e?.width,graphDownload:e?.graphDownload?$.current:void 0,dataDownload:e?.dataDownload&&w&&w.length>0?w:null}):null,w&&D.length>0?l.jsxs(l.Fragment,{children:[ae.length!==0||(p||[]).length!==0||(y||[]).length!==0?l.jsxs("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap",alignItems:"flex-start",width:"100%"},children:[y?.map((A,M)=>l.jsxs("div",{style:{width:A.width||`calc(${100/m}% - ${(m-1)/m}rem)`,flexGrow:1,flexShrink:A.ui!=="radio"?0:1,minWidth:"240px"},children:[l.jsx(Ce.Label,{className:"mb-2",children:A.label||"Graph by"}),A.ui!=="radio"?l.jsx(Ce.DropdownSelect,{options:A.options.map(O=>({...O,value:O.label})),isClearable:!1,isSearchable:!0,variant:I,controlShouldRenderValue:!0,defaultValue:A.defaultValue?{...A.defaultValue,value:A.defaultValue?.label}:{...A.options[0],value:A.options[0].label},onChange:O=>{b(O?.graphSettings||{}),q(O?.dataConfiguration)}}):l.jsx(Ce.RadioGroup,{defaultValue:A.defaultValue?.label||A.options[0].label,variant:I,onValueChange:O=>{const K=A.options[A.options.findIndex(Q=>Q.label===O)];b(K.graphSettings||{}),q(K.dataConfiguration)},children:A.options.map((O,K)=>l.jsx(Ce.RadioGroupItem,{label:O.label,value:O.label},K))})]},M)),p?.map((A,M)=>l.jsxs("div",{style:{width:A.width||`calc(${100/m}% - ${(m-1)/m}rem)`,flexGrow:1,flexShrink:A.ui!=="radio"?0:1,minWidth:"240px"},children:[l.jsx(Ce.Label,{className:"mb-2",children:A.label||`Visualize ${A.chartConfigId} by`}),xw(A.chartConfigId,V||[])?A.ui!=="radio"?l.jsx(Ce.DropdownSelect,{options:A.allowedColumnIds,isMulti:!0,variant:I,isSearchable:!0,controlShouldRenderValue:!0,defaultValue:o?o[o.findIndex(O=>O.chartConfigId===A.chartConfigId)].columnId.map(O=>A.allowedColumnIds[A.allowedColumnIds.findIndex(K=>K.value===O)]):void 0,filterOption:Ce.createFilter(B),onChange:O=>{const K={columnId:O.map(se=>se.value),chartConfigId:A.chartConfigId},Q=V?.map(se=>se.chartConfigId===K.chartConfigId?K:se);q(Q)},isRtl:e?.language==="ar"||e?.language==="he"}):l.jsx(Ce.CheckboxGroup,{variant:I,defaultValue:o?o[o.findIndex(O=>O.chartConfigId===A.chartConfigId)].columnId.map(O=>A.allowedColumnIds[A.allowedColumnIds.findIndex(K=>K.value===O)]).map(O=>O.value):[],onValueChange:O=>{const K={columnId:O||[],chartConfigId:A.chartConfigId},Q=V?.map(se=>se.chartConfigId===K.chartConfigId?K:se);q(Q)},children:A.allowedColumnIds.map((O,K)=>l.jsx(Ce.CheckboxGroupItem,{label:O.label,value:O.label},K))}):A.ui!=="radio"?l.jsx(Ce.DropdownSelect,{options:A.allowedColumnIds,isClearable:!1,isSearchable:!0,variant:I,defaultValue:o?A.allowedColumnIds[A.allowedColumnIds.findIndex(O=>O.value===o[o.findIndex(K=>K.chartConfigId===A.chartConfigId)].columnId)]:void 0,controlShouldRenderValue:!0,onChange:O=>{const K={columnId:O?.value,chartConfigId:A.chartConfigId},Q=V?.map(se=>se.chartConfigId===K.chartConfigId?K:se);b(O?.graphSettings||{}),q(Q)}}):l.jsx(Ce.RadioGroup,{variant:I,defaultValue:o?A.allowedColumnIds[A.allowedColumnIds.findIndex(O=>O.value===o[o.findIndex(K=>K.chartConfigId===A.chartConfigId)].columnId)].label:"",onValueChange:O=>{const K=A.allowedColumnIds[A.allowedColumnIds.findIndex(T=>T.label===O)],Q={columnId:K.value,chartConfigId:A.chartConfigId},se=V?.map(T=>T.chartConfigId===Q.chartConfigId?Q:T);b(K.graphSettings||{}),q(se)},children:A.allowedColumnIds.map((O,K)=>l.jsx(Ce.RadioGroupItem,{label:O.label,value:O.label},K))})]},M)),ae?.map((A,M)=>l.jsxs("div",{style:{width:A.width||`calc(${100/m}% - ${(m-1)/m}rem)`,flexGrow:1,flexShrink:0,flexWrap:"wrap"},children:[l.jsx(Ce.Label,{className:"mb-2",children:A.label}),A.singleSelect?l.jsx(Ce.DropdownSelect,{variant:I,options:A.availableValues,isClearable:A.clearable===void 0?!0:A.clearable,isRtl:e?.language==="ar"||e?.language==="he",isSearchable:!0,controlShouldRenderValue:!0,filterOption:Ce.createFilter(B),onChange:O=>{C(A.filter,O)},defaultValue:A.defaultValue}):l.jsxs(l.Fragment,{children:[l.jsx(Ce.DropdownSelect,{variant:I,options:A.availableValues,isMulti:!0,isClearable:A.clearable===void 0?!0:A.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:Ce.createFilter(B),onChange:O=>{C(A.filter,O)},defaultValue:A.defaultValue,isRtl:e?.language==="ar"||e?.language==="he"}),A.allowSelectAll?l.jsx("button",{className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",type:"button",onClick:()=>{C(A.filter,A.availableValues)},children:"Select all options"}):null]})]},M))]}):null,h!==!1&&e?.showColorScale!==!1?l.jsx(Hi,{width:e?.width,colorLegendTitle:e?.colorLegendTitle,colors:e?.colors||e?.lineColors||Pe[e?.theme||"light"].categoricalColors.colors,colorDomain:e?.colorDomain||e?.labels||[],showNAColor:e?.showNAColor===void 0||e?.showNAColor===null?!0:e?.showNAColor}):null,l.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"1rem",flexDirection:e?.language==="ar"||e?.language==="he"?"row-reverse":"row",justifyContent:"center"},children:D.map((A,M)=>l.jsx("div",{style:{width:`calc(${100/(s||Math.min(4,D.length||0))}% - ${((s||Math.min(4,D.length||0))-1)/(s||Math.min(4,D.length||0))}rem)`,minWidth:je(d)?"280px":`${d}px`},children:l.jsx(yw,{graph:r,graphDataConfiguration:V,graphData:Vc(a?Td(Ai(w,u||[]).filter(O=>O[c]===A),a.keyColumn,a.aggregationColumnsSetting):Ai(w,u||[]).filter(O=>O[c]===A),r,V)||[],debugMode:g,settings:{...e||{},..._,theme:e?.theme||j,width:void 0,height:void 0,relativeHeight:e?.relativeHeight||.67,minHeight:f,graphTitle:`${A}`,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,padding:"0",footNote:void 0,sources:void 0,showColorScale:e?.showColorScale===!1?!1:h===!1},readableHeader:v||[]})},M))})]}):l.jsx("div",{className:"w-full flex justify-center p-4",children:l.jsx(Ce.Spinner,{})}),e?.sources||e?.footNote?l.jsx(et,{styles:{footnote:e?.styles?.footnote,source:e?.styles?.source},classNames:{footnote:e?.classNames?.footnote,source:e?.classNames?.source},sources:e?.sources,footNote:e?.footNote,width:e?.width}):null]})})})})}function CE(t){const{chapters:e,visibilityThreshold:n=.5,mode:i="overlay",infoWidth:r="320px",infoPosition:a="left",infoBackgroundColor:o="rgba(255,255,255,0.8)"}=t,[s,c]=k.useState(0),u=[];return e.forEach((h,f)=>{h.sections.forEach((d,g)=>{u.push({chapter:f,dataSettings:h.dataSettings,section:g,graphType:h.graphType,infoBox:d.infoBox,graphSettings:{...h.graphSettings,...d.graphSettings||{},animate:!0},graphDataConfiguration:d.graphDataConfiguration||h.graphDataConfiguration||[]})})}),l.jsxs("div",{className:"relative w-full h-full",children:[l.jsx($e.div,{className:"fixed top-0 h-full -z-10",initial:{opacity:0},animate:{opacity:1},transition:{duration:.5},style:{left:i==="overlay"||a==="right"?0:r,width:i==="overlay"?"100%":`calc(100% - ${r})`},children:l.jsx(ol,{graphType:u[s].graphType,dataSettings:u[s].dataSettings,graphSettings:u[s].graphSettings,graphDataConfiguration:u[s].graphDataConfiguration})},u[s].chapter),l.jsx("div",{children:u.map((h,f)=>l.jsx(SE,{width:r,index:f,infoBox:h.infoBox,setActiveIndex:c,position:a,mode:i,visibilityThreshold:n,backgroundColor:o},`${h.chapter}-${h.section}`))})]})}function SE({infoBox:t,index:e,setActiveIndex:n,position:i,mode:r,visibilityThreshold:a,backgroundColor:o,width:s}){const c=k.useRef(null);return ct(c,{once:!1,amount:a})&&n(e),l.jsx("section",{ref:c,className:`min-h-screen flex ${i==="center"?"justify-center":i==="right"?"justify-end":"justify-start"}`,children:l.jsxs("div",{className:`p-8 ${r==="overlay"?"h-fit mx-10 ":""}`,style:{backgroundColor:o,width:s},children:[t.title,t.description]})})}function DE(t){const{config:e}=t,[n,i]=k.useState(void 0);return k.useEffect(()=>{(async()=>{if(typeof e=="string"){const a=await en(e);i(a)}else i(e)})()},[e]),n?l.jsx(vw,{dashboardID:n.dashboardID,dashboardLayout:n.dashboardLayout,dataSettings:n.dataSettings,filters:n.filters,debugMode:n.debugMode,theme:n.theme,readableHeader:n.readableHeader,dataFilters:n.dataFilters,noOfFiltersPerRow:n.noOfFiltersPerRow,filterPosition:n.filterPosition,uiMode:n.uiMode,graphStyles:n.graphStyles,graphClassNames:n.graphClassNames}):l.jsx("div",{className:"w-full flex justify-center p-4",children:l.jsx(Ce.Spinner,{})})}function ME(t){const{config:e}=t,[n,i]=k.useState(void 0);return k.useEffect(()=>{typeof e=="string"?en(e).then(a=>{i(a)}):i(e)},[e]),n?l.jsx(ww,{dashboardID:n.dashboardID,dashboardLayout:n.dashboardLayout,dataSettings:n.dataSettings,debugMode:n.debugMode,theme:n.theme,readableHeader:n.readableHeader,dataFilters:n.dataFilters,uiMode:n.uiMode,graphStyles:n.graphStyles,graphClassNames:n.graphClassNames}):l.jsx("div",{className:"w-full flex justify-center p-4",children:l.jsx(Ce.Spinner,{})})}function TE(t){const{config:e}=t,[n,i]=k.useState(void 0);return k.useEffect(()=>{typeof e=="string"?en(e).then(a=>{i(a)}):i(e)},[e]),n?l.jsx(ol,{graphSettings:n.graphSettings,dataSettings:n.dataSettings,filters:n.filters,graphType:n.graphType,dataTransform:n.dataTransform,graphDataConfiguration:n.graphDataConfiguration,dataFilters:n.dataFilters,debugMode:n.debugMode,dataSelectionOptions:n.dataSelectionOptions,advancedDataSelectionOptions:n.advancedDataSelectionOptions,readableHeader:n.readableHeader,noOfFiltersPerRow:n.noOfFiltersPerRow,uiMode:n.uiMode,highlightDataPointSettings:n.highlightDataPointSettings}):l.jsx("div",{className:"w-full flex justify-center p-4",children:l.jsx(Ce.Spinner,{})})}function kE(t){const{config:e}=t,[n,i]=k.useState(void 0);return k.useEffect(()=>{(async()=>{if(typeof e=="string"){const a=await en(e);i(a)}else i(e)})()},[e]),n?l.jsx(bw,{noOfColumns:n.noOfColumns,columnGridBy:n.columnGridBy,graphSettings:n.graphSettings,dataSettings:n.dataSettings,filters:n.filters,graphType:n.graphType,minGraphHeight:n.minGraphHeight,minGraphWidth:n.minGraphWidth,dataTransform:n.dataTransform,graphDataConfiguration:n.graphDataConfiguration,dataFilters:n.dataFilters,showCommonColorScale:n.showCommonColorScale,debugMode:n.debugMode,dataSelectionOptions:n.dataSelectionOptions,advancedDataSelectionOptions:n.advancedDataSelectionOptions,readableHeader:n.readableHeader,noOfFiltersPerRow:n.noOfFiltersPerRow,theme:n.theme}):l.jsx("div",{className:"w-full flex justify-center p-4",children:l.jsx(Ce.Spinner,{})})}const Cw=(t,e,n,i,r)=>{const a="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8",o=Bc.utils.json_to_sheet([i],{header:n,skipHeader:!0});o["!cols"]=r,Bc.utils.sheet_add_json(o,t,{header:n,skipHeader:!0,origin:-1});const s={Sheets:{data:o},SheetNames:["data"]},c=Bc.write(s,{bookType:"xlsx",type:"array"}),u=new Blob([c],{type:a});Hw.saveAs(u,`${e}.xlsx`)};function jE(t){const{buttonContent:e,buttonType:n="tertiary",csvData:i,fileName:r="data",headers:a,xlsxHeader:o,wscols:s,buttonSmall:c,className:u=""}=t;return l.jsx(Ce.Button,{variant:n,className:`${c?"p-2":"py-4 px-6"} ${u}`,onClick:()=>Cw(i,r,a,o,s),"aria-label":"Click to download the data as xlsx",children:e||l.jsx(Bf,{})})}function Rh(t,e){const n=zw.elementToSVG(t),r=new XMLSerializer().serializeToString(n),a=new Blob([r],{type:"application/xml"}),o=document.createElement("a");o.href=window.URL.createObjectURL(a),o.download=`${e}.svg`,document.body.appendChild(o),o.click(),document.body.removeChild(o)}function AE(t){const{nodeID:e,filename:n="image",buttonContent:i,buttonType:r="tertiary",buttonSmall:a,className:o=""}=t;return l.jsx(Ce.Button,{variant:r,className:`undp-viz-download-button ${a?"p-2":"py-4 px-6"} ${o}`,onClick:()=>{typeof e=="string"?document.getElementById(e)?Rh(document.getElementById(e),n):console.error("Cannot find the html element"):Rh(e,n)},"aria-label":"Click to download the graph as svg",children:i||l.jsx(kx,{})})}function _E(t){const{text:e,successMessage:n="Text copied",buttonText:i,buttonSmall:r=!1,className:a=""}=t,{toast:o}=Ce.useToast();return l.jsxs(l.Fragment,{children:[l.jsxs(Ce.Button,{variant:"tertiary",className:`${r?"p-2":"py-4 px-6"} ${a}`,onClick:()=>{navigator.clipboard.writeText(e),o({variant:"success",description:n,duration:1e3})},"aria-label":"Click to copy the text",children:[l.jsx(XA,{}),i||null]}),l.jsx(Ce.Toaster,{})]})}const OE=t=>{let e="";return t.forEach(i=>{e+=`~${`${i}`.replace(/ /g,"+")}`}),e.substring(1)};function Sw(t,e){let n="";return e.forEach(i=>{let r="";switch(typeof i.value){case"number":r=`${i.value}`;break;case"boolean":r=`${i.value}`;break;case"object":r=OE(i.value);break;default:r=`${i.value}`}n+=`&${i.id}=${r.replace(/ /g,"+").replaceAll("'","_")}`}),`${t}?${n}`}function NE(t,e){return`<iframe src="${Sw(t,e)}" loading="lazy" style="width: 100%; border: 0px none"></iframe>`}function IE(t,e){const n=t.slice().sort((r,a)=>r-a),i=Math.ceil(e/100*n.length)-1;return n[i]}function $E(){const t=[];return new URL(window.location.href).searchParams.forEach((e,n)=>{t.push({param:n,value:e.replaceAll("+"," ").replaceAll("_","'").split("~").length>1?e.replaceAll("+"," ").replaceAll("_","'").split("~"):e.replaceAll("+"," ").replaceAll("_","'")})}),t}function LE(t,e=2){const n=t.reduce((o,s)=>o+s,0)/t.length,i=Math.sqrt(t.reduce((o,s)=>o+(s-n)**2,0)/t.length),r=e*i;return t.filter(o=>Math.abs(o-n)<=r)}async function PE(t,e,n,i,r,a,o,s,c){try{const u=await(typeof t=="string"?i==="json"?en(t,a,s,!1):i==="api"?uo(t,o,a,s,!1):co(t,s,a,!1,r,!0):ts(t,c));return Vc(u,n,e)}catch(u){return console.error("Error fetching or processing data",u),null}}const Dw="https://raw.githubusercontent.com/UNDP-Data/undp-viz-library-schemas/refs/heads/main/";function EE(t){if(Fi.filter(e=>e.geoHubMapPresentation).map(e=>e.graphID).indexOf(t)!==-1)return null;switch(t){case"dataTable":return"dataSchema/dataTableDataSchema.json";case"dataCards":return"dataSchema/dataTableDataSchema.json";case"barChart":return"dataSchema/barGraphDataSchema.json";case"stackedBarChart":return"dataSchema/stackedBarGraphDataSchema.json";case"groupedBarChart":return"dataSchema/groupedBarGraphDataSchema.json";case"lineChart":return"dataSchema/lineChartDataSchema.json";case"dualAxisLineChart":return"dataSchema/dualAxisLineChartDataSchema.json";case"differenceLineChart":return"dataSchema/differenceLineChartDataSchema.json";case"multiLineChart":return"dataSchema/multiLineChartDataSchema.json";case"multiLineAltChart":return"dataSchema/multiLineAltChartDataSchema.json";case"stackedAreaChart":return"dataSchema/areaChartDataSchema.json";case"choroplethMap":return"dataSchema/choroplethMapDataSchema.json";case"threeDGlobe":return"dataSchema/choroplethMapDataSchema.json";case"bulletChart":return"dataSchema/bulletChartDataSchema.json";case"biVariateChoroplethMap":return"dataSchema/biVariateChoroplethMapDataSchema.json";case"dotDensityMap":return"dataSchema/dotDensityMapDataSchema.json";case"donutChart":return"dataSchema/donutChartDataSchema.json";case"slopeChart":return"dataSchema/slopeChartDataSchema.json";case"scatterPlot":return"dataSchema/scatterPlotDataSchema.json";case"dumbbellChart":return"dataSchema/dumbbellChartDataSchema.json";case"treeMap":return"dataSchema/treeMapDataSchema.json";case"circlePacking":return"dataSchema/circlePackingDataSchema.json";case"heatMap":return"dataSchema/heatMapDataSchema.json";case"stripChart":return"dataSchema/stripChartDataSchema.json";case"beeSwarmChart":return"dataSchema/beeSwarmChartDataSchema.json";case"butterflyChart":return"dataSchema/butterflyChartDataSchema.json";case"histogram":return"dataSchema/histogramDataSchema.json";case"sparkLine":return"dataSchema/lineChartDataSchema.json";case"paretoChart":return"dataSchema/paretoChartDataSchema.json";case"statCard":return"dataSchema/statCardDataSchema.json";case"unitChart":return"dataSchema/unitChartDataSchema.json";case"sankeyChart":return"dataSchema/sankeyChartDataSchema.json";case"lineChartWithConfidenceInterval":return"dataSchema/lineChartWithConfidenceIntervalDataSchema.json";case"radarChart":return"dataSchema/radarChartDataSchema.json";default:return console.error("Unknown chart type:",t),null}}function VE(t){switch(t){case"barChart":return"settingsSchema/simpleBarChartSettingsSchema.json";case"stackedBarChart":return"settingsSchema/stackedBarChartSettingsSchema.json";case"groupedBarChart":return"settingsSchema/groupedBarChartSettingsSchema.json";case"lineChart":return"settingsSchema/lineChartSettingsSchema.json";case"dualAxisLineChart":return"settingsSchema/dualAxisLineChartSettingsSchema.json";case"multiLineChart":return"settingsSchema/multiLineChartSettingsSchema.json";case"multiLineAltChart":return"settingsSchema/multiLineAltChartSettingsSchema.json";case"differenceLineChart":return"settingsSchema/differenceLineChartSettingsSchema.json";case"stackedAreaChart":return"settingsSchema/stackedAreaChartSettingsSchema.json";case"choroplethMap":return"settingsSchema/choroplethMapSettingsSchema.json";case"threeDGlobe":return"settingsSchema/threeDGlobeSettingsSchema.json";case"bulletChart":return"settingsSchema/bulletChartSettingsSchema.json";case"biVariateChoroplethMap":return"settingsSchema/biVariateChoroplethMapSettingsSchema.json";case"dotDensityMap":return"settingsSchema/dotDensityMapSettingsSchema.json";case"donutChart":return"settingsSchema/donutChartSettingsSchema.json";case"slopeChart":return"settingsSchema/slopeChartSettingsSchema.json";case"scatterPlot":return"settingsSchema/scatterPlotSettingsSchema.json";case"dumbbellChart":return"settingsSchema/dumbbellChartSettingsSchema.json";case"treeMap":return"settingsSchema/treeMapSettingsSchema.json";case"circlePacking":return"settingsSchema/circlePackingSettingsSchema.json";case"heatMap":return"settingsSchema/heatMapSettingsSchema.json";case"stripChart":return"settingsSchema/stripChartSettingsSchema.json";case"beeSwarmChart":return"settingsSchema/beeSwarmChartSettingsSchema.json";case"butterflyChart":return"settingsSchema/butterflyChartSettingsSchema.json";case"histogram":return"settingsSchema/histogramSettingsSchema.json";case"sparkLine":return"settingsSchema/sparkLineSettingsSchema.json";case"paretoChart":return"settingsSchema/paretoChartSettingsSchema.json";case"dataTable":return"settingsSchema/dataTableSettingsSchema.json";case"statCard":return"settingsSchema/statCardSettingsSchema.json";case"geoHubCompareMap":return"settingsSchema/geoHubCompareMapSettingsSchema.json";case"geoHubMap":return"settingsSchema/geoHubMapSettingsSchema.json";case"geoHubMapWithLayerSelection":return"settingsSchema/geoHubMapWithLayerSelectionSettingsSchema.json";case"unitChart":return"settingsSchema/unitChartSettingsSchema.json";case"sankeyChart":return"settingsSchema/sankeyChartSettingsSchema.json";case"lineChartWithConfidenceInterval":return"settingsSchema/lineChartWithConfidenceIntervalSettingsSchema.json";case"dataCards":return"settingsSchema/dataCardListSettingsSchema.json";case"allGraphs":return"settingsSchema/SettingsSchema.json";case"radarChart":return"settingsSchema/radarChartSettingsSchema.json";default:return console.error("Unknown chart type:",t),null}}async function Mw(t){const e=await fetch(`${Dw}${EE(t)}`);if(!e.ok)throw new Error(`Response status: ${e.status}`);return await e.json()}async function ta(t){const e=await fetch(`${Dw}${VE(t)}`);if(!e.ok)throw new Error(`Response status: ${e.status}`);return await e.json()}function FE(t){switch(t){case"barChart":return["label","size","color","date"];case"bulletChart":return["label","size","target","qualitativeRange"];case"treeMap":return["label","size","color"];case"circlePacking":return["label","size","color"];case"butterflyChart":return["label","leftBar","rightBar","date"];case"groupedBarChart":return["label","size","date"];case"stackedBarChart":return["label","size","date"];case"dumbbellChart":return["x","label","date"];case"donutChart":return["size","label"];case"histogram":return["value"];case"choroplethMap":return["x","id","date"];case"threeDGlobe":return["x","id"];case"biVariateChoroplethMap":return["x","y","id","date"];case"lineChart":return["date","y"];case"multiLineChart":return["date","y"];case"multiLineAltChart":return["date","y","label","color"];case"radarChart":return["values","label","color"];case"stackedAreaChart":return["date","y"];case"scatterPlot":return["x","y","radius","color","label","date"];case"dualAxisLineChart":return["date","y1","y2"];case"paretoChart":return["label","bar","line"];case"dotDensityMap":return["lat","long","radius","color","label","date"];case"slopeChart":return["y1","y2","color","label"];case"heatMap":return["row","column","value"];case"beeSwarmChart":return["label","position","radius","color"];case"stripChart":return["label","position","color"];case"statCard":return["value"];case"sankeyChart":return["source","target","value"];case"differenceLineChart":return["date","y1","y2"];case"unitChart":return["label","value"];case"sparkLine":return["date","y"];case"lineChartWithConfidenceInterval":return["date","y","yMin","yMax"];case"dashboardWideToLong":return["label","size","color","value"];case"dashboard":return["label","radius","size","row","y1","y","rightBar","position","leftBar","x","bar","line","y2","column","date","value","color","long","lat","id","source","target","yMin","yMax"];default:return["label","radius","size","row","y1","y","rightBar","position","leftBar","x","bar","line","y2","column","date","value","color","long","lat","id","source","target","yMin","yMax"]}}function Ri(t){return!t||t.length===0?{}:{enum:t}}const i0=t=>({items:{properties:{column:{type:"string",...Ri(t)},delimiter:{type:"string"}},type:"object",required:["column"]},type:"array"}),Za=t=>({properties:{columnsToArray:i0(t),data:{},dataURL:{oneOf:[{type:"string"},{type:"array",items:{type:"object",properties:{fileType:{enum:["csv","json","api"],type:"string"},apiHeaders:{},dataTransformation:{type:"string"},idColumnName:{type:"string"},dataURL:{type:"string"},delimiter:{type:"string"},columnsToArray:i0()},required:["dataURL","idColumnName"]}}]},delimiter:{type:"string"},fileType:{enum:["csv","json","api"],type:"string"},apiHeaders:{},dataTransformation:{type:"string"},idColumnTitle:{type:"string"}},type:"object"}),Ja=t=>({type:"array",items:{type:"object",properties:{value:{type:"string",...Ri(t)},label:{type:"string"}},required:["value","label"]}}),Yo=t=>({items:{properties:{clearable:{type:"boolean"},allowSelectAll:{type:"boolean"},width:{type:"string"},excludeValues:{items:{type:"string"},type:"array"},column:{type:"string",...Ri(t)},defaultValue:{anyOf:[{items:{oneOf:[{type:"string"},{type:"number"}]},type:"array"},{type:"string"},{type:"number"}]},label:{type:"string"},ui:{type:"string",enum:["select","radio"]},singleSelect:{type:"boolean"}},required:["column"],type:"object"},type:"array"}),qo=async t=>{const e=await ta("allGraphs");return{type:"array",items:{type:"object",properties:{chartConfigId:{type:"string"},label:{type:"string"},width:{type:"string"},allowedColumnIds:{type:"array",items:{type:"object",properties:{value:{type:"string",...Ri(t)},label:{type:"string"},graphSettings:e},required:["value","label"]},minItems:1},ui:{type:"string",enum:["select","radio"]}},required:["chartConfigId","allowedColumnIds"]}}},Ar=t=>({type:"array",items:{type:"object",properties:{column:{type:"string",...Ri(t)},includeValues:{type:"array",items:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"null"}]}},excludeValues:{type:"array",items:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"null"}]}}},required:["column"]}}),Uo=t=>({type:"object",properties:{keyColumn:{type:"string",...Ri(t)},aggregationColumnsSetting:{type:"array",items:{type:"object",properties:{column:{type:"string",...Ri(t)},aggregationMethod:{type:"string",enum:["sum","average","min","max"]}},required:["column"]}}},required:["keyColumn"]}),eo=(t,e)=>({type:"array",items:{type:"object",properties:{columnId:{oneOf:[{type:"string",...Ri(t)},{type:"array",items:{type:"string",...Ri(t)}}]},chartConfigId:{type:"string",...Ri(FE(e))}},required:["columnId","chartConfigId"]}}),qs=async(t,e)=>{const n=await ta("allGraphs");return{type:"array",items:{type:"object",properties:{chartConfigId:{type:"string"},label:{type:"string"},width:{type:"string"},options:{type:"array",items:{type:"object",properties:{dataConfiguration:eo(t,e),label:{type:"string"},graphSettings:n},required:["dataConfiguration","label"]},minItems:1},defaultValue:{type:"array",items:{type:"object",properties:{dataConfiguration:eo(t,e),label:{type:"string"},graphSettings:n},required:["dataConfiguration","label"]},minItems:1},ui:{type:"string",enum:["select","radio"]}},required:["chartConfigId","options"]}}},Tw=async(t,e)=>{const n=await ta(e||"allGraphs");return e&&Fi.filter(i=>i.geoHubMapPresentation).map(i=>i.graphID).indexOf(e)!==-1?{type:"object",properties:{graphSettings:n,graphType:{type:"string",enum:Fi.filter(i=>i.geoHubMapPresentation).map(i=>i.graphID)},debugMode:{type:"boolean"},theme:{type:"string",enum:["dark","light"]},uiMode:{type:"string",enum:["light","normal"]},classNames:{type:"object"},highlightDataPointSettings:{type:"object",properties:{column:{type:"string"},label:{type:"string"},defaultValues:{oneOf:[{type:"array",items:{type:"string"}},{type:"array",items:{type:"number"}}]},excludeValues:{type:"array",items:{type:"string"}},allowSelectAll:{type:"boolean"},width:{type:"string"}},required:["column"]},styles:{type:"object"}},required:["graphType"]}:e==="dataTable"||e==="dataCards"?{type:"object",properties:{graphSettings:n,dataSettings:Za(t),filters:Yo(t),noOfFiltersPerRow:{type:"number"},graphType:{type:"string",enum:["dataTable","dataCards"]},dataTransform:Uo(t),dataFilters:Ar(t),readableHeader:Ja(t),dataSelectionOptions:qo(t),advancedDataSelectionOptions:qs(t,e),debugMode:{type:"boolean"},theme:{type:"string",enum:["dark","light"]},uiMode:{type:"string",enum:["light","normal"]},classNames:{type:"object"},highlightDataPointSettings:{type:"object",properties:{column:{type:"string"},label:{type:"string"},defaultValues:{oneOf:[{type:"array",items:{type:"string"}},{type:"array",items:{type:"number"}}]},excludeValues:{type:"array",items:{type:"string"}},allowSelectAll:{type:"boolean"},width:{type:"string"}},required:["column"]},styles:{type:"object"}},required:["dataSettings","graphType"]}:{type:"object",properties:{graphSettings:n,dataSettings:Za(t),filters:Yo(t),classNames:{type:"object"},styles:{type:"object"},graphType:{type:"string",enum:Fi.map(i=>i.graphID)},noOfFiltersPerRow:{type:"number"},dataTransform:Uo(t),dataFilters:Ar(t),graphDataConfiguration:eo(t,e),readableHeader:Ja(t),dataSelectionOptions:qo(t),advancedDataSelectionOptions:qs(t,e),debugMode:{type:"boolean"},theme:{type:"string",enum:["dark","light"]},highlightDataPointSettings:{type:"object",properties:{column:{type:"string"},label:{type:"string"},defaultValues:{oneOf:[{type:"array",items:{type:"string"}},{type:"array",items:{type:"number"}}]},excludeValues:{type:"array",items:{type:"string"}},allowSelectAll:{type:"boolean"},width:{type:"string"}},required:["column"]},uiMode:{type:"string",enum:["light","normal"]}},required:e?["dataSettings","graphType","graphDataConfiguration"]:["graphType"]}},kw=async(t,e)=>{const n=await ta(e||"allGraphs");return e==="dataTable"||e==="dataCards"?{type:"object",properties:{graphSettings:n,dataSettings:Za(t),filters:Yo(t),classNames:{type:"object"},styles:{type:"object"},noOfFiltersPerRow:{type:"number"},graphType:{type:"string",enum:["dataTable","dataCards"]},uiMode:{type:"string",enum:["light","normal"]},dataTransform:Uo(t),dataFilters:Ar(t),noOfColumns:{type:"number"},columnGridBy:{type:"string"},showCommonColorScale:{type:"boolean"},minGraphHeight:{type:"number"},minGraphWidth:{type:"number"},readableHeader:Ja(t),dataSelectionOptions:qo(t),advancedDataSelectionOptions:qs(t,e),debugMode:{type:"boolean"},theme:{type:"string",enum:["dark","light"]}},required:["columnGridBy","dataSettings","graphType"]}:{type:"object",properties:{graphSettings:n,dataSettings:Za(t),filters:Yo(t),classNames:{type:"object"},styles:{type:"object"},noOfFiltersPerRow:{type:"number"},graphType:{type:"string",enum:Fi.filter(i=>i.availableInGriddedGraph!==!1).map(i=>i.graphID)},uiMode:{type:"string",enum:["light","normal"]},dataTransform:Uo(t),dataFilters:Ar(t),graphDataConfiguration:eo(t,e),noOfColumns:{type:"number"},columnGridBy:{type:"string"},showCommonColorScale:{type:"boolean"},minGraphHeight:{type:"number"},minGraphWidth:{type:"number"},readableHeader:Ja(t),dataSelectionOptions:qo(t),advancedDataSelectionOptions:qs(t,e),debugMode:{type:"boolean"},theme:{type:"string",enum:["dark","light"]}},required:e?["columnGridBy","dataSettings","graphType","graphDataConfiguration"]:["columnGridBy","dataSettings","graphType"]}},jw=async t=>{const e=await ta("allGraphs");return{properties:{dashboardID:{type:"string"},graphClassNames:{type:"object"},graphStyles:{type:"object"},dashboardLayout:{properties:{backgroundColor:{type:["string","boolean"]},description:{type:"string"},language:{enum:["ar","en","he"],type:"string"},padding:{type:"string"},title:{type:"string"},rows:{items:{properties:{columns:{items:{properties:{columnWidth:{type:"number"},dataFilters:Ar(),dataTransform:Uo(),graphDataConfiguration:eo(void 0,"dashboard"),graphType:{enum:Fi.map(n=>n.graphID),type:"string"},settings:e,dataSelectionOptions:qo(),advancedDataSelectionOptions:qs(),attachedFilter:{type:"string",...Ri(t)}},type:"object",required:["graphType"]},type:"array"},height:{type:"number"}},type:"object",required:["columns"]},type:"array"}},type:"object",required:["rows"]},dataSettings:Za(t),filters:Yo(t),noOfFiltersPerRow:{type:"number"},uiMode:{type:"string",enum:["light","normal"]},filterPosition:{type:"string",enum:["top","side"]},readableHeader:Ja(t),dataFilters:Ar(t),debugMode:{type:"boolean"},theme:{type:"string",enum:["dark","light"]},graphBackgroundColor:{oneOf:[{type:"string"},{type:"boolean"}]}},type:"object",required:["dashboardLayout","dataSettings"]}},Aw=async()=>{const t=await ta("allGraphs");return{properties:{dashboardID:{type:"string"},graphClassNames:{type:"object"},graphStyles:{type:"object"},dashboardLayout:{properties:{backgroundColor:{type:["string","boolean"]},description:{type:"string"},language:{enum:["ar","en","he"],type:"string"},padding:{type:"string"},dropdownLabel:{type:"string"},title:{type:"string"},rows:{items:{properties:{columns:{items:{properties:{columnWidth:{type:"number"},dataFilters:Ar(),graphDataConfiguration:eo(void 0,"dashboardWideToLong"),graphType:{enum:Fi.filter(e=>e.availableInWideToLongFormat).map(e=>e.graphID),type:"string"},settings:t},type:"object",required:["graphType"]},type:"array"},height:{type:"number"}},type:"object",required:["columns"]},type:"array"}},type:"object",required:["rows"]},dataSettings:{properties:{...Za().properties,keyColumn:{type:"string"}},required:["keyColumn"],type:"object"},uiMode:{type:"string",enum:["light","normal"]},dataFilters:Ar(),readableHeader:Ja(),debugMode:{type:"boolean"},theme:{type:"string",enum:["dark","light"]},graphBackgroundColor:{oneOf:[{type:"string"},{type:"boolean"}]}},type:"object",required:["dashboardLayout","dataSettings"]}};async function RE(t,e){let n;try{n=(await import("ajv")).default}catch(s){throw console.error(s),new Error("AJV is not installed. Please install it to use runtime validation.")}const i=new n({allErrors:!0,allowUnionTypes:!0});if(Fi.filter(s=>s.geoHubMapPresentation).map(s=>s.graphID).indexOf(e)!==-1)return{isValid:!0,err:void 0};if(!t)return{isValid:!1,err:"No data provided"};if(e==="dataTable"||e==="dataCards"||t.length===0)return{isValid:!0,err:void 0};const r=await Mw(e);if(!r)return{isValid:!1,err:`Invalid chart type: ${e}`};const a=i.compile(r);return a(t)?{isValid:!0,err:void 0}:(console.error(a.errors),{isValid:!1,err:a.errors?.map(s=>`Error at ${s.instancePath}: ${s.message}`).join("; ")})}async function BE(t,e){let n;try{n=(await import("ajv")).default}catch(s){throw console.error(s),new Error("AJV is not installed. Please install it to use runtime validation.")}const i=new n({allErrors:!0,allowUnionTypes:!0}),r=await ta(e);if(!r)return{isValid:!1,err:`Invalid chart type: ${e}`};const a=i.compile(r);return a(t)?{isValid:!0,err:void 0}:(console.error(a.errors),{isValid:!1,err:a.errors?.map(s=>`Error at ${s.instancePath}: ${s.message}`).join("; ")})}async function HE(t,e){let n;try{n=(await import("ajv")).default}catch(s){throw console.error(s),new Error("AJV is not installed. Please install it to use runtime validation.")}const i=new n({allErrors:!0,allowUnionTypes:!0});let r;switch(e){case"griddedGraph":r=kw(void 0,t.graphType);break;case"multiGraphDashboard":r=jw();break;case"singleGraphDashboard":r=Tw(void 0,t.graphType);break;case"multiGraphDashboardWideToLongFormat":r=Aw();break}if(!r)return{isValid:!1,err:`Invalid chart type: ${e}`};const a=i.compile(r);return a(t)?{isValid:!0,err:void 0}:(console.error(a.errors),{isValid:!1,err:a.errors?.map(s=>`Error at ${s.instancePath}: ${s.message}`).join("; ")})}exports.AreaChart=Qv;exports.BasicStatCard=uP;exports.BeeSwarmChart=nv;exports.BiVariateChoroplethMap=Bv;exports.BulletChart=Kv;exports.ButterflyChart=hw;exports.ChoroplethMap=Hv;exports.CirclePackingGraph=td;exports.ColorLegend=Hi;exports.ColorLegendWithMouseOver=tn;exports.Colors=Pe;exports.CopyTextButton=_E;exports.CsvDownloadButton=Hf;exports.DataCards=sw;exports.DataTable=ow;exports.DifferenceLineChart=wv;exports.DonutChart=rd;exports.DotDensityMap=Wv;exports.DualAxisLineChart=pv;exports.DumbbellChart=tv;exports.ExcelDownloadButton=jE;exports.FootNote=yx;exports.GeoHubCompareMaps=Yv;exports.GeoHubMap=Gv;exports.GeoHubMapWithLayerSelection=qv;exports.GraphDescription=Vx;exports.GraphFooter=et;exports.GraphHeader=Qe;exports.GraphList=Fi;exports.GraphTitle=Fx;exports.GriddedGraphs=bw;exports.GriddedGraphsFromConfig=kE;exports.GroupedBarGraph=Rx;exports.HeatMap=aw;exports.Histogram=fw;exports.ImageDownloadButton=Ex;exports.LineChartWithConfidenceInterval=mv;exports.LinearColorLegend=iw;exports.MultiGraphDashboard=vw;exports.MultiGraphDashboardFromConfig=DE;exports.MultiGraphDashboardWideToLongFormat=ww;exports.MultiGraphDashboardWideToLongFormatFromConfig=ME;exports.MultiLineAltChart=vv;exports.MultiLineChart=xv;exports.ParetoChart=uw;exports.RadarChart=mw;exports.SVGDownloadButton=AE;exports.SankeyChart=pw;exports.ScatterPlot=Uv;exports.ScrollStory=CE;exports.SimpleBarGraph=Gf;exports.SimpleLineChart=yv;exports.SingleGraphDashboard=ol;exports.SingleGraphDashboardFromConfig=TE;exports.SlopeChart=Xv;exports.Source=xx;exports.SparkLine=bv;exports.StackedBarGraph=Bx;exports.StatCardFromData=Zv;exports.StripChart=cw;exports.ThreeDGlobe=zv;exports.ThresholdColorLegendWithMouseOver=rw;exports.TreeMapGraph=Md;exports.UnitChart=nw;exports.checkIfNullOrUndefined=je;exports.excelDownload=Cw;exports.fetchAndParseCSV=co;exports.fetchAndParseCSVFromTextBlob=HL;exports.fetchAndParseJSON=en;exports.fetchAndParseMultipleDataSources=ts;exports.fetchAndTransformDataFromAPI=uo;exports.generateEmbedLink=Sw;exports.generateIframeCode=NE;exports.getDashboardJSONSchema=jw;exports.getDashboardWideToLongFormatJSONSchema=Aw;exports.getDataFiltersSchema=Ar;exports.getDataSchema=Mw;exports.getDataSelectionSchema=qo;exports.getDataSettingsSchema=Za;exports.getDataTransformSchema=Uo;exports.getFiltersSchema=Yo;exports.getGraphDataConfigurationSchema=eo;exports.getGriddedGraphJSONSchema=kw;exports.getJenks=Gs;exports.getPercentileValue=IE;exports.getQueryParamsFromLink=$E;exports.getReadableHeaderSchema=Ja;exports.getSettingsSchema=ta;exports.getSingleGraphJSONSchema=Tw;exports.getTextColorBasedOnBgColor=yn;exports.getUniqValue=jr;exports.imageDownload=xh;exports.numberFormattingFunction=qe;exports.removeOutliers=LE;exports.svgDownload=Rh;exports.transformColumnsToArray=$r;exports.transformDataForAggregation=Td;exports.transformDataForGraph=Vc;exports.transformDataForGraphFromFile=PE;exports.validateConfigSchema=HE;exports.validateDataSchema=RE;exports.validateSettingsSchema=BE;
|
|
68
|
-
//# sourceMappingURL=index.cjs.map
|