@undp/data-viz 2.3.10 → 2.3.12
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.cjs +1 -1
- package/dist/AreaChart.js +16 -16
- package/dist/{Axis-D56Gy0se.js → Axis-RyGdzLrG.js} +2 -2
- package/dist/{Axis-D56Gy0se.js.map → Axis-RyGdzLrG.js.map} +1 -1
- package/dist/{AxisTitle-VFq89Olw.js → AxisTitle-DGjX1_2v.js} +2 -2
- package/dist/{AxisTitle-VFq89Olw.js.map → AxisTitle-DGjX1_2v.js.map} +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.cjs.map +1 -1
- package/dist/BarGraph.js +21 -21
- package/dist/BarGraph.js.map +1 -1
- package/dist/BasicStatCard.cjs +1 -1
- package/dist/BasicStatCard.js +2 -2
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.js +13 -13
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.js +13 -13
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.cjs.map +1 -1
- package/dist/BulletChart.js +19 -19
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.cjs.map +1 -1
- package/dist/ButterflyChart.js +52 -52
- package/dist/ButterflyChart.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.js +13 -13
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +4 -4
- package/dist/ColorLegend.cjs +1 -1
- package/dist/ColorLegend.js +2 -2
- package/dist/ColorLegendWithMouseOver.cjs +1 -1
- package/dist/ColorLegendWithMouseOver.js +2 -2
- package/dist/CopyTextButton.cjs +1 -1
- package/dist/CopyTextButton.cjs.map +1 -1
- package/dist/CopyTextButton.js +4 -4
- package/dist/CopyTextButton.js.map +1 -1
- package/dist/CsvDownloadButton.js +2 -2
- package/dist/DataCards.cjs +1 -1
- package/dist/DataCards.js +7 -7
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.js +4 -4
- package/dist/{DetailsModal-BMCTgVsk.js → DetailsModal-C3qlUyFK.js} +3 -3
- package/dist/{DetailsModal-BMCTgVsk.js.map → DetailsModal-C3qlUyFK.js.map} +1 -1
- package/dist/{DetailsModal-DHttOA80.cjs → DetailsModal-DIRTulvr.cjs} +2 -2
- package/dist/{DetailsModal-DHttOA80.cjs.map → DetailsModal-DIRTulvr.cjs.map} +1 -1
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.js +15 -15
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.js +10 -10
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.js +30 -30
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/{DropdownSelect-D8rFbygC.js → DropdownSelect-B2WTeedJ.js} +2 -2
- package/dist/{DropdownSelect-D8rFbygC.js.map → DropdownSelect-B2WTeedJ.js.map} +1 -1
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.js +12 -12
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.cjs.map +1 -1
- package/dist/DumbbellChart.js +19 -19
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/{EmptyState-dScPFkLy.js → EmptyState-B3fPoH6L.js} +4 -4
- package/dist/{EmptyState-dScPFkLy.js.map → EmptyState-B3fPoH6L.js.map} +1 -1
- package/dist/{EmptyState-N1eHt3vq.cjs → EmptyState-B4c-CrXs.cjs} +2 -2
- package/dist/{EmptyState-N1eHt3vq.cjs.map → EmptyState-B4c-CrXs.cjs.map} +1 -1
- package/dist/ExcelDownloadButton.js +2 -2
- package/dist/FootNote.cjs +1 -1
- package/dist/FootNote.js +2 -2
- package/dist/GeoHubCompareMaps.js +3 -3
- package/dist/GeoHubMap.js +4 -4
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +5 -5
- package/dist/{GraphContainer-CF6ws3pd.js → GraphContainer-DwMxWRCi.js} +2 -2
- package/dist/{GraphContainer-CF6ws3pd.js.map → GraphContainer-DwMxWRCi.js.map} +1 -1
- package/dist/GraphDescription.cjs +1 -1
- package/dist/GraphDescription.js +2 -2
- package/dist/{GraphEl-DjElfY07.cjs → GraphEl-Bgf8w82K.cjs} +2 -2
- package/dist/{GraphEl-DjElfY07.cjs.map → GraphEl-Bgf8w82K.cjs.map} +1 -1
- package/dist/{GraphEl-Bw-9MUym.js → GraphEl-CXK-LPsj.js} +5 -5
- package/dist/{GraphEl-Bw-9MUym.js.map → GraphEl-CXK-LPsj.js.map} +1 -1
- package/dist/GraphFooter.cjs +1 -1
- package/dist/GraphFooter.js +2 -2
- package/dist/GraphHeader.js +1 -1
- package/dist/GraphTitle.cjs +1 -1
- package/dist/GraphTitle.js +2 -2
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.js +6 -6
- package/dist/GriddedGraphsFromConfig.js +2 -2
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.js +10 -10
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +4 -4
- package/dist/HybridMap.cjs +1 -1
- package/dist/HybridMap.cjs.map +1 -1
- package/dist/HybridMap.js +42 -42
- package/dist/HybridMap.js.map +1 -1
- package/dist/ImageDownloadButton.js +2 -2
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.js +15 -15
- package/dist/LinearColorLegend.cjs +1 -1
- package/dist/LinearColorLegend.js +2 -2
- package/dist/{Modal-Ch9wvKxF.js → Modal-BV4rkoLM.js} +5 -5
- package/dist/{Modal-Ch9wvKxF.js.map → Modal-BV4rkoLM.js.map} +1 -1
- package/dist/{Modal-CaYa_TLE.cjs → Modal-ZX55hLH-.cjs} +5 -5
- package/dist/{Modal-CaYa_TLE.cjs.map → Modal-ZX55hLH-.cjs.map} +1 -1
- package/dist/MultiGraphDashboard.cjs +1 -1
- package/dist/MultiGraphDashboard.js +4 -4
- package/dist/MultiGraphDashboardFromConfig.js +2 -2
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js +4 -4
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +2 -2
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.cjs.map +1 -1
- package/dist/MultiLineAltChart.d.ts +2 -0
- package/dist/MultiLineAltChart.js +393 -391
- package/dist/MultiLineAltChart.js.map +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.js +15 -15
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.js +12 -12
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +4 -4
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +2 -2
- package/dist/PerformanceIntensiveScrollStory.js +3 -3
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.js +9 -9
- package/dist/{ReferenceLine-DgtoRgw0.js → ReferenceLine-CNEjAYvv.js} +3 -3
- package/dist/{ReferenceLine-DgtoRgw0.js.map → ReferenceLine-CNEjAYvv.js.map} +1 -1
- package/dist/{RegressionLine-D2aqeBKp.js → RegressionLine-BDrndQxo.js} +4 -4
- package/dist/{RegressionLine-D2aqeBKp.js.map → RegressionLine-BDrndQxo.js.map} +1 -1
- package/dist/SVGDownloadButton.js +2 -2
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.js +9 -9
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.cjs.map +1 -1
- package/dist/ScatterPlot.d.ts +2 -0
- package/dist/ScatterPlot.js +442 -440
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/ScrollStory.js +3 -3
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.js +16 -16
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.js +6 -6
- package/dist/SingleGraphDashboardFromConfig.js +2 -2
- package/dist/SingleGraphDashboardGeoHubMaps.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.js +3 -3
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +2 -2
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.js +6 -6
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +2 -2
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.js +11 -11
- package/dist/{Source-24M277ZQ.cjs → Source-BOSAl3UX.cjs} +2 -2
- package/dist/{Source-24M277ZQ.cjs.map → Source-BOSAl3UX.cjs.map} +1 -1
- package/dist/{Source-Cu9OHOBj.js → Source-Djkz-7jX.js} +5 -5
- package/dist/{Source-Cu9OHOBj.js.map → Source-Djkz-7jX.js.map} +1 -1
- package/dist/Source.cjs +1 -1
- package/dist/Source.js +3 -3
- package/dist/SparkLine.js +5 -5
- package/dist/{Spinner--r2RrJV8.js → Spinner-CtJETd5V.js} +2 -2
- package/dist/{Spinner--r2RrJV8.js.map → Spinner-CtJETd5V.js.map} +1 -1
- package/dist/StatCardFromData.cjs +1 -1
- package/dist/StatCardFromData.js +2 -2
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.js +9 -9
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.js +7 -7
- package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.js +2 -2
- package/dist/{Tooltip-BRnAz2Gv.js → Tooltip-CohiIbLZ.js} +2 -2
- package/dist/{Tooltip-BRnAz2Gv.js.map → Tooltip-CohiIbLZ.js.map} +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.js +9 -9
- package/dist/Typography-CZZxlj1W.cjs +2 -0
- package/dist/Typography-CZZxlj1W.cjs.map +1 -0
- package/dist/{Typography-CdMGooqp.js → Typography-DMVW6JnV.js} +68 -61
- package/dist/Typography-DMVW6JnV.js.map +1 -0
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.js +6 -6
- package/dist/WaterfallChart.cjs +1 -1
- package/dist/WaterfallChart.js +14 -14
- package/dist/{XAxesLabels-rhK7lRjO.js → XAxesLabels-IwjMJkYS.js} +3 -3
- package/dist/{XAxesLabels-rhK7lRjO.js.map → XAxesLabels-IwjMJkYS.js.map} +1 -1
- package/dist/{XTicksAndGridLines-CVZkZkpS.js → XTicksAndGridLines-BDmF9etl.js} +2 -2
- package/dist/{XTicksAndGridLines-CVZkZkpS.js.map → XTicksAndGridLines-BDmF9etl.js.map} +1 -1
- package/dist/{YAxesLabels-QICWVsHf.js → YAxesLabels-DoGvgHdw.js} +3 -3
- package/dist/{YAxesLabels-QICWVsHf.js.map → YAxesLabels-DoGvgHdw.js.map} +1 -1
- package/dist/{YTicksAndGridLines-GnXnSRF2.js → YTicksAndGridLines-C3GW1xFG.js} +2 -2
- package/dist/{YTicksAndGridLines-GnXnSRF2.js.map → YTicksAndGridLines-C3GW1xFG.js.map} +1 -1
- package/dist/{checkIfMultiple-D9fVkeOq.js → checkIfMultiple-B97uOUVq.js} +5 -5
- package/dist/{checkIfMultiple-D9fVkeOq.js.map → checkIfMultiple-B97uOUVq.js.map} +1 -1
- package/dist/{checkIfMultiple-DxnGtm3t.cjs → checkIfMultiple-TOaaUwS7.cjs} +2 -2
- package/dist/{checkIfMultiple-DxnGtm3t.cjs.map → checkIfMultiple-TOaaUwS7.cjs.map} +1 -1
- package/dist/{customArea-ASDaSE4u.js → customArea-Cc2whe6P.js} +3 -3
- package/dist/{customArea-ASDaSE4u.js.map → customArea-Cc2whe6P.js.map} +1 -1
- package/dist/{getSliderMarks-Cvg8zHBU.js → getSliderMarks-vXsR8RrR.js} +2 -2
- package/dist/{getSliderMarks-Cvg8zHBU.js.map → getSliderMarks-vXsR8RrR.js.map} +1 -1
- package/dist/{index-BzNfurbO.js → index-C6VwVS8W.js} +9 -9
- package/dist/{index-BzNfurbO.js.map → index-C6VwVS8W.js.map} +1 -1
- package/dist/{index-CHPV5EwG-DecW7_qr.js → index-CHPV5EwG-BCLAYDCV.js} +3 -3
- package/dist/{index-CHPV5EwG-DecW7_qr.js.map → index-CHPV5EwG-BCLAYDCV.js.map} +1 -1
- package/dist/{index-Dp_SfsUA.js → index-CKpKc9DR.js} +3 -3
- package/dist/{index-Dp_SfsUA.js.map → index-CKpKc9DR.js.map} +1 -1
- package/dist/{index-B-4y_iGB.js → index-CZ0elhKR.js} +4 -4
- package/dist/{index-B-4y_iGB.js.map → index-CZ0elhKR.js.map} +1 -1
- package/dist/{index-CtMBjvtq.js → index-Co3YGYe1.js} +3 -3
- package/dist/{index-CtMBjvtq.js.map → index-Co3YGYe1.js.map} +1 -1
- package/dist/{index-Cw8sCyo_-n4AacHGk.js → index-D6CYcVc7-BOa7Dpvf.js} +5 -5
- package/dist/{index-Cw8sCyo_-n4AacHGk.js.map → index-D6CYcVc7-BOa7Dpvf.js.map} +1 -1
- package/dist/index-D6CYcVc7-CTEcAtiQ.cjs +2 -0
- package/dist/index-D6CYcVc7-CTEcAtiQ.cjs.map +1 -0
- package/dist/{index-CSiFiXPj.js → index-D_dtv_T9.js} +3 -3
- package/dist/{index-CSiFiXPj.js.map → index-D_dtv_T9.js.map} +1 -1
- package/dist/{index-Dzc_aaI9-CG2Ar7l1.js → index-DoS4bGNa-Bgab95kx.js} +2 -2
- package/dist/{index-Dzc_aaI9-CG2Ar7l1.js.map → index-DoS4bGNa-Bgab95kx.js.map} +1 -1
- package/dist/{index-Dzc_aaI9-C3DbPpy3.cjs → index-DoS4bGNa-C3DbPpy3.cjs} +1 -1
- package/dist/{index-Dzc_aaI9-C3DbPpy3.cjs.map → index-DoS4bGNa-C3DbPpy3.cjs.map} +1 -1
- package/dist/{index-CXobQn-E.cjs → index-_TlgeI_i.cjs} +2 -2
- package/dist/{index-CXobQn-E.cjs.map → index-_TlgeI_i.cjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -2
- package/dist/{linear-CalFSAaO.js → linear-DNXM5Pdl.js} +3 -3
- package/dist/{linear-CalFSAaO.js.map → linear-DNXM5Pdl.js.map} +1 -1
- package/dist/{pow-CaIrlM4J.js → pow-BXYLJHCq.js} +2 -2
- package/dist/{pow-CaIrlM4J.js.map → pow-BXYLJHCq.js.map} +1 -1
- package/dist/{proxy-DRuSUlPL.js → proxy--_f6k3NR.js} +2 -2
- package/dist/{proxy-DRuSUlPL.js.map → proxy--_f6k3NR.js.map} +1 -1
- package/dist/{string-C_xJ4Wg4.js → string-CbaFIsiV.js} +4 -4
- package/dist/{string-C_xJ4Wg4.js.map → string-CbaFIsiV.js.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{time-CAtex-RV.js → time-vyz6Y89P.js} +2 -2
- package/dist/{time-CAtex-RV.js.map → time-vyz6Y89P.js.map} +1 -1
- package/dist/{use-in-view-Dl5L8LtP.js → use-in-view-DqvKAveg.js} +2 -2
- package/dist/{use-in-view-Dl5L8LtP.js.map → use-in-view-DqvKAveg.js.map} +1 -1
- package/package.json +2 -2
- package/dist/Typography-Cc_iHQB-.cjs +0 -2
- package/dist/Typography-Cc_iHQB-.cjs.map +0 -1
- package/dist/Typography-CdMGooqp.js.map +0 -1
- package/dist/index-Cw8sCyo_-CEcCMKUi.cjs +0 -2
- package/dist/index-Cw8sCyo_-CEcCMKUi.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoroplethMap.js","sources":["../src/Components/Graphs/Maps/ChoroplethMap/Graph.tsx","../src/Components/Graphs/Maps/ChoroplethMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { useEffect, useMemo, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n geoPath,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleThreshold, scaleOrdinal } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport rewind from '@turf/rewind';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport {\r\n AnimateDataType,\r\n ChoroplethMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n colorDomain: (number | string)[];\r\n mapData: FeatureCollection;\r\n width: number;\r\n height: number;\r\n colors: string[];\r\n colorLegendTitle?: string;\r\n categorical: boolean;\r\n data: ChoroplethMapDataType[];\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n mapBorderColor: string;\r\n isWorldMap: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds: string[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n collapseColorScaleByDefault?: boolean;\r\n zoomAndCenterByHighlightedIds: boolean;\r\n projectionRotate: [number, number] | [number, number, number];\r\n rewindCoordinatesInMapData: boolean;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colorDomain,\r\n colors,\r\n mapData,\r\n colorLegendTitle,\r\n categorical,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n collapseColorScaleByDefault,\r\n zoomAndCenterByHighlightedIds,\r\n projectionRotate,\r\n rewindCoordinatesInMapData,\r\n } = props;\r\n const formattedMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData) return mapData;\r\n\r\n return rewind(mapData, { reverse: true }) as FeatureCollection;\r\n }, [mapData, rewindCoordinatesInMapData]);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const colorScale = categorical\r\n ? scaleOrdinal<number | string, string>().domain(colorDomain).range(colors)\r\n : scaleThreshold<number, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors);\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n const bounds = bbox({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n\r\n const center = centerOfMass({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n const lonDiff = (bounds[2] - bounds[0]) * 1.15;\r\n const latDiff = (bounds[3] - bounds[1]) * 1.15;\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n const pathGenerator = geoPath().projection(projection);\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {formattedMapData.features.map((d, i: number) => {\r\n if (!d.properties?.[mapProperty]) return null;\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <motion.g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n <path\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = formattedMapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n if (index === -1) return null;\r\n const path = pathGenerator(formattedMapData.features[index]);\r\n if (!path) return null;\r\n const color = !checkIfNullOrUndefined(d.x)\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n colorScale(d.x as any)\r\n : mapNoDataColor;\r\n return (\r\n <motion.g\r\n className='undp-map-shapes'\r\n key={d.id}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n >\r\n <motion.path\r\n key={`${d.id}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? formattedMapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n .map((d, i) => (\r\n <path\r\n key={i}\r\n d={pathGenerator(d) || ''}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n ))\r\n : null}\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{\r\n width: categorical ? undefined : '340px',\r\n }}\r\n >\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <P\r\n size='xs'\r\n marginBottom='xs'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </P>\r\n ) : null}\r\n {!categorical ? (\r\n <svg width='100%' viewBox='0 0 320 30' direction='ltr'>\r\n <g>\r\n {colorDomain.map((d, i) => (\r\n <g\r\n key={i}\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n className='cursor-pointer'\r\n >\r\n <rect\r\n x={(i * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={\r\n selectedColor === colors[i]\r\n ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }\r\n style={{\r\n fill: colors[i],\r\n ...(selectedColor === colors[i] ? {} : { stroke: colors[i] }),\r\n }}\r\n />\r\n <text\r\n x={((i + 1) * 320) / colors.length}\r\n y={25}\r\n className='fill-primary-gray-700 dark:fill-primary-gray-300 text-xs'\r\n style={{ textAnchor: 'middle' }}\r\n >\r\n {numberFormattingFunction(d as number, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n <g>\r\n <rect\r\n onMouseOver={() => {\r\n setSelectedColor(colors[colorDomain.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n x={(colorDomain.length * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={`cursor-pointer ${\r\n selectedColor === colors[colorDomain.length]\r\n ? 'stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }`}\r\n style={{\r\n fill: colors[colorDomain.length],\r\n ...(selectedColor === colors[colorDomain.length]\r\n ? {}\r\n : { stroke: colors[colorDomain.length] }),\r\n }}\r\n />\r\n </g>\r\n </g>\r\n </svg>\r\n ) : (\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start map-legend-button'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect, useEffectEvent, useMemo } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n ChoroplethMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ScaleDataType,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getUniqValue } from '@/Utils/getUniqValue';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: ChoroplethMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for the choropleth map */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: number[] | string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n /** Defines if the coordinates in the map data should be rewinded or not. Try to change this is the visualization shows countries as holes instead of shapes. */\r\n rewindCoordinatesInMapData?: boolean;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Toggle if the map is centered and zoomed to the highlighted ids. */\r\n zoomAndCenterByHighlightedIds?: boolean;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Controls the rotation of the map projection, in degrees, applied before rendering. Useful for shifting the antimeridian to focus the map on different regions */\r\n projectionRotate?: [number, number] | [number, number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Scale for the colors */\r\n scaleType?: Exclude<ScaleDataType, 'linear'>;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function ChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n colorDomain,\r\n colorLegendTitle,\r\n scaleType = 'threshold',\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n tooltip,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n highlightedIds = [],\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection = 'naturalEarth',\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n projectionRotate = [0, 0],\r\n zoomAndCenterByHighlightedIds = false,\r\n rewindCoordinatesInMapData = true,\r\n } = props;\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = useMemo(() => {\r\n const dates = [\r\n ...new Set(\r\n data\r\n .filter(d => d.date)\r\n .map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n ),\r\n ];\r\n dates.sort((a, b) => a - b);\r\n return dates;\r\n }, [data, timeline.dateFormat]);\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(entries[0].target.clientWidth || 620);\r\n setSvgHeight(entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, []);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const onUpdateShape = useEffectEvent((shape: any) => {\r\n setMapShape(shape);\r\n });\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n onUpdateShape(d);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n\r\n const domain =\r\n colorDomain ||\r\n (scaleType === 'categorical'\r\n ? getUniqValue(data, 'x')\r\n : getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors?.length || 4,\r\n ));\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? d.date === format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\r\n }\r\n }\r\n colorDomain={domain}\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n colors ||\r\n (scaleType === 'categorical'\r\n ? Colors[theme].categoricalColors.colors\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${(domain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ])\r\n }\r\n colorLegendTitle={colorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n categorical={scaleType === 'categorical'}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n classNames={classNames}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n zoomInteraction={zoomInteraction}\r\n dimmedOpacity={dimmedOpacity}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n customLayers={customLayers}\r\n zoomAndCenterByHighlightedIds={zoomAndCenterByHighlightedIds}\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n projectionRotate={projectionRotate}\r\n rewindCoordinatesInMapData={rewindCoordinatesInMapData}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </GraphArea>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["Graph","props","data","colorDomain","colors","mapData","colorLegendTitle","categorical","height","width","scale","centerPoint","tooltip","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","zoomAndCenterByHighlightedIds","projectionRotate","rewindCoordinatesInMapData","formattedMapData","useMemo","rewind","reverse","selectedColor","setSelectedColor","useState","undefined","zoomRef","useRef","showLegend","setShowLegend","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","once","amount","mapG","colorScale","scaleOrdinal","domain","range","scaleThreshold","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","filter","on","transform","attr","call","bounds","bbox","features","d","length","indexOf","properties","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","pathGenerator","geoPath","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","i","path","stroke","strokeWidth","fill","AnimatePresence","index","findIndex","el","id","color","checkIfNullOrUndefined","x","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","cn","colorLegend","X","P","display","WebkitLineClamp","WebkitBoxOrient","backgroundColor","textAnchor","numberFormattingFunction","DetailsModal","modal","Tooltip","ChoroplethMap","$","_c","t0","graphTitle","sources","graphDescription","footNote","t1","scaleType","t2","t3","padding","t4","t5","t6","t7","relativeHeight","isWorldMap","t8","t9","t10","graphID","t11","t12","graphDownload","t13","dataDownload","t14","showAntarctica","t15","language","t16","minHeight","t17","theme","t18","ariaLabel","t19","t20","t21","t22","t23","t24","timeline","t25","t26","t27","t28","Colors","light","graphNoData","grays","t29","t30","t31","t32","enabled","autoplay","showOnlyActiveDate","t33","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t34","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t35","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t36","shape","onUpdateShape","useEffectEvent","t37","fetchAndParseJSON","then","d_1","t38","t39","getUniqValue","getJenks","_temp3","t40","t41","speed","interval","setInterval","clearInterval","t42","t43","getSliderMarks","markObj","t44","graphContainer","t45","t46","description","title","GraphHeader","_temp4","_temp5","_temp6","_temp7","_temp8","t47","Pause","Play","SliderUI","nextValue","nextValue_0","t48","GraphArea","d_8","format","_temp9","categoricalColors","sequentialColors","max","Spinner","t49","footnote","source","GraphFooter","t50","GraphContainer","NAME","d_5","d_4","d_3","d_7","d_6","d_2","a","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA8EO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJC,MAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,kBAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA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,EAAEzC,WAAW6N,SAAU;AAAY;AAjN/D,SAAAtB,GAAAuB,GAAA;AAAA,SAgK4BjO,MAAMnD;AAAS;AAhK3C,SAAA4P,GAAAyB,GAAA;AAAA,SA+J6ClO,MAAMnD;AAAS;AA/J5D,SAAA2P,GAAA2B,GAAA;AAAA,SA+JyBnO,EAAC5F;AAAK;AA/J/B,SAAAmS,GAAA6B,GAAA;AAAA,SA8J2CpO,MAAMnD;AAAS;AA9J1D,SAAAyP,GAAA+B,GAAA;AAAA,SA8JuBrO,EAAC5F;AAAK;AA9J7B,SAAAgR,GAAAkD,GAAA;AAAA,SAyGiBtO,EAACgD;AAA+B;AAzGjD,SAAAsG,GAAAiF,GAAAC,GAAA;AAAA,SAiEkBD,IAAIC;AAAC;AAjEvB,SAAApF,GAAApJ,GAAA;AAAA,SA6DgBA,EAACgJ;AAAK;"}
|
|
1
|
+
{"version":3,"file":"ChoroplethMap.js","sources":["../src/Components/Graphs/Maps/ChoroplethMap/Graph.tsx","../src/Components/Graphs/Maps/ChoroplethMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { useEffect, useMemo, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n geoPath,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleThreshold, scaleOrdinal } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport rewind from '@turf/rewind';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport {\r\n AnimateDataType,\r\n ChoroplethMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n colorDomain: (number | string)[];\r\n mapData: FeatureCollection;\r\n width: number;\r\n height: number;\r\n colors: string[];\r\n colorLegendTitle?: string;\r\n categorical: boolean;\r\n data: ChoroplethMapDataType[];\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n mapBorderColor: string;\r\n isWorldMap: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds: string[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n collapseColorScaleByDefault?: boolean;\r\n zoomAndCenterByHighlightedIds: boolean;\r\n projectionRotate: [number, number] | [number, number, number];\r\n rewindCoordinatesInMapData: boolean;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colorDomain,\r\n colors,\r\n mapData,\r\n colorLegendTitle,\r\n categorical,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n collapseColorScaleByDefault,\r\n zoomAndCenterByHighlightedIds,\r\n projectionRotate,\r\n rewindCoordinatesInMapData,\r\n } = props;\r\n const formattedMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData) return mapData;\r\n\r\n return rewind(mapData, { reverse: true }) as FeatureCollection;\r\n }, [mapData, rewindCoordinatesInMapData]);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const colorScale = categorical\r\n ? scaleOrdinal<number | string, string>().domain(colorDomain).range(colors)\r\n : scaleThreshold<number, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors);\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n const bounds = bbox({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n\r\n const center = centerOfMass({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n const lonDiff = (bounds[2] - bounds[0]) * 1.15;\r\n const latDiff = (bounds[3] - bounds[1]) * 1.15;\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n const pathGenerator = geoPath().projection(projection);\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {formattedMapData.features.map((d, i: number) => {\r\n if (!d.properties?.[mapProperty]) return null;\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <motion.g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n <path\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = formattedMapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n if (index === -1) return null;\r\n const path = pathGenerator(formattedMapData.features[index]);\r\n if (!path) return null;\r\n const color = !checkIfNullOrUndefined(d.x)\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n colorScale(d.x as any)\r\n : mapNoDataColor;\r\n return (\r\n <motion.g\r\n className='undp-map-shapes'\r\n key={d.id}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n >\r\n <motion.path\r\n key={`${d.id}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? formattedMapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n .map((d, i) => (\r\n <path\r\n key={i}\r\n d={pathGenerator(d) || ''}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n ))\r\n : null}\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{\r\n width: categorical ? undefined : '340px',\r\n }}\r\n >\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <P\r\n size='xs'\r\n marginBottom='xs'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </P>\r\n ) : null}\r\n {!categorical ? (\r\n <svg width='100%' viewBox='0 0 320 30' direction='ltr'>\r\n <g>\r\n {colorDomain.map((d, i) => (\r\n <g\r\n key={i}\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n className='cursor-pointer'\r\n >\r\n <rect\r\n x={(i * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={\r\n selectedColor === colors[i]\r\n ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }\r\n style={{\r\n fill: colors[i],\r\n ...(selectedColor === colors[i] ? {} : { stroke: colors[i] }),\r\n }}\r\n />\r\n <text\r\n x={((i + 1) * 320) / colors.length}\r\n y={25}\r\n className='fill-primary-gray-700 dark:fill-primary-gray-300 text-xs'\r\n style={{ textAnchor: 'middle' }}\r\n >\r\n {numberFormattingFunction(d as number, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n <g>\r\n <rect\r\n onMouseOver={() => {\r\n setSelectedColor(colors[colorDomain.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n x={(colorDomain.length * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={`cursor-pointer ${\r\n selectedColor === colors[colorDomain.length]\r\n ? 'stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }`}\r\n style={{\r\n fill: colors[colorDomain.length],\r\n ...(selectedColor === colors[colorDomain.length]\r\n ? {}\r\n : { stroke: colors[colorDomain.length] }),\r\n }}\r\n />\r\n </g>\r\n </g>\r\n </svg>\r\n ) : (\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start map-legend-button'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect, useEffectEvent, useMemo } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n ChoroplethMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ScaleDataType,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getUniqValue } from '@/Utils/getUniqValue';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: ChoroplethMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for the choropleth map */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: number[] | string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n /** Defines if the coordinates in the map data should be rewinded or not. Try to change this is the visualization shows countries as holes instead of shapes. */\r\n rewindCoordinatesInMapData?: boolean;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Toggle if the map is centered and zoomed to the highlighted ids. */\r\n zoomAndCenterByHighlightedIds?: boolean;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Controls the rotation of the map projection, in degrees, applied before rendering. Useful for shifting the antimeridian to focus the map on different regions */\r\n projectionRotate?: [number, number] | [number, number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Scale for the colors */\r\n scaleType?: Exclude<ScaleDataType, 'linear'>;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function ChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n colorDomain,\r\n colorLegendTitle,\r\n scaleType = 'threshold',\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n tooltip,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n highlightedIds = [],\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection = 'naturalEarth',\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n projectionRotate = [0, 0],\r\n zoomAndCenterByHighlightedIds = false,\r\n rewindCoordinatesInMapData = true,\r\n } = props;\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = useMemo(() => {\r\n const dates = [\r\n ...new Set(\r\n data\r\n .filter(d => d.date)\r\n .map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n ),\r\n ];\r\n dates.sort((a, b) => a - b);\r\n return dates;\r\n }, [data, timeline.dateFormat]);\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(entries[0].target.clientWidth || 620);\r\n setSvgHeight(entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, []);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const onUpdateShape = useEffectEvent((shape: any) => {\r\n setMapShape(shape);\r\n });\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n onUpdateShape(d);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n\r\n const domain =\r\n colorDomain ||\r\n (scaleType === 'categorical'\r\n ? getUniqValue(data, 'x')\r\n : getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors?.length || 4,\r\n ));\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? `${d.date}` ===\r\n format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\r\n }\r\n }\r\n colorDomain={domain}\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n colors ||\r\n (scaleType === 'categorical'\r\n ? Colors[theme].categoricalColors.colors\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${(domain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ])\r\n }\r\n colorLegendTitle={colorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n categorical={scaleType === 'categorical'}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n classNames={classNames}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n zoomInteraction={zoomInteraction}\r\n dimmedOpacity={dimmedOpacity}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n customLayers={customLayers}\r\n zoomAndCenterByHighlightedIds={zoomAndCenterByHighlightedIds}\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n projectionRotate={projectionRotate}\r\n rewindCoordinatesInMapData={rewindCoordinatesInMapData}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </GraphArea>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["Graph","props","data","colorDomain","colors","mapData","colorLegendTitle","categorical","height","width","scale","centerPoint","tooltip","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","zoomAndCenterByHighlightedIds","projectionRotate","rewindCoordinatesInMapData","formattedMapData","useMemo","rewind","reverse","selectedColor","setSelectedColor","useState","undefined","zoomRef","useRef","showLegend","setShowLegend","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","once","amount","mapG","colorScale","scaleOrdinal","domain","range","scaleThreshold","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","filter","on","transform","attr","call","bounds","bbox","features","d","length","indexOf","properties","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","pathGenerator","geoPath","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","i","path","stroke","strokeWidth","fill","AnimatePresence","index","findIndex","el","id","color","checkIfNullOrUndefined","x","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","cn","colorLegend","X","P","display","WebkitLineClamp","WebkitBoxOrient","backgroundColor","textAnchor","numberFormattingFunction","DetailsModal","modal","Tooltip","ChoroplethMap","$","_c","t0","graphTitle","sources","graphDescription","footNote","t1","scaleType","t2","t3","padding","t4","t5","t6","t7","relativeHeight","isWorldMap","t8","t9","t10","graphID","t11","t12","graphDownload","t13","dataDownload","t14","showAntarctica","t15","language","t16","minHeight","t17","theme","t18","ariaLabel","t19","t20","t21","t22","t23","t24","timeline","t25","t26","t27","t28","Colors","light","graphNoData","grays","t29","t30","t31","t32","enabled","autoplay","showOnlyActiveDate","t33","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t34","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t35","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t36","shape","onUpdateShape","useEffectEvent","t37","fetchAndParseJSON","then","d_1","t38","t39","getUniqValue","getJenks","_temp3","t40","t41","speed","interval","setInterval","clearInterval","t42","t43","getSliderMarks","markObj","t44","graphContainer","t45","t46","description","title","GraphHeader","_temp4","_temp5","_temp6","_temp7","_temp8","t47","Pause","Play","SliderUI","nextValue","nextValue_0","t48","GraphArea","d_8","format","_temp9","categoricalColors","sequentialColors","max","Spinner","t49","footnote","source","GraphFooter","t50","GraphContainer","NAME","d_5","d_4","d_3","d_7","d_6","d_2","a","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA8EO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJC,MAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,kBAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,qBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,oBAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,6BAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,YAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,cAAAA;AAAAA,IACAC,6BAAAA;AAAAA,IACAC,+BAAAA;AAAAA,IACAC,kBAAAA;AAAAA,IACAC,4BAAAA;AAAAA,EAAAA,IACElC,GACEmC,IAAmBC,GAAQ,MAC1BF,KAEEG,GAAOjC,GAAS;AAAA,IAAEkC,SAAS;AAAA,EAAA,CAAM,IAFAlC,GAGvC,CAACA,GAAS8B,EAA0B,CAAC,GAClC,CAACK,GAAeC,CAAgB,IAAIC,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("./index-CHPV5EwG-6v2a2njQ.cjs");require("react");const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-CHPV5EwG-6v2a2njQ.cjs");require("react");const e=require("./index-_TlgeI_i.cjs");require("./GraphFooter.cjs");require("./GraphHeader.cjs");require("./ColorLegendWithMouseOver.cjs");require("./Colors.cjs");require("./EmptyState-B4c-CrXs.cjs");require("./uniqBy-O05lp2S5.cjs");require("./GraphContainer-B1EDxJ0S.cjs");exports.CirclePackingGraph=e.CirclePackingGraph;
|
|
2
2
|
//# sourceMappingURL=CirclePackingGraph.cjs.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "./index-CHPV5EwG-
|
|
1
|
+
import "./index-CHPV5EwG-BCLAYDCV.js";
|
|
2
2
|
import "react";
|
|
3
|
-
import { C as g } from "./index-
|
|
3
|
+
import { C as g } from "./index-C6VwVS8W.js";
|
|
4
4
|
import "./GraphFooter.js";
|
|
5
5
|
import "./GraphHeader.js";
|
|
6
6
|
import "./ColorLegendWithMouseOver.js";
|
|
7
7
|
import "./Colors.js";
|
|
8
|
-
import "./EmptyState-
|
|
8
|
+
import "./EmptyState-B3fPoH6L.js";
|
|
9
9
|
import "./uniqBy-BHy4I8PK.js";
|
|
10
|
-
import "./GraphContainer-
|
|
10
|
+
import "./GraphContainer-DwMxWRCi.js";
|
|
11
11
|
export {
|
|
12
12
|
g as CirclePackingGraph
|
|
13
13
|
};
|
package/dist/ColorLegend.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-6v2a2njQ.cjs"),b=require("./Typography-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-6v2a2njQ.cjs"),b=require("./Typography-CZZxlj1W.cjs"),B=require("./Colors.cjs");function T(w){const e=s.compilerRuntimeExports.c(29),{colorLegendTitle:a,colorDomain:g,colors:t,showNAColor:h,width:v,isCenter:d,className:E,labelsToBeHidden:u}=w;let j;e[0]!==u?(j=u===void 0?[]:u,e[0]=u,e[1]=j):j=e[1];const m=j,R=d&&"justify-center";let l;e[2]!==E||e[3]!==R?(l=s.mo("flex leading-0 pb-3",R,E),e[2]=E,e[3]=R,e[4]=l):l=e[4];const C=v?`${v}px`:"none";let o;e[5]!==C?(o={maxWidth:C},e[5]=C,e[6]=o):o=e[6];let n;e[7]!==a||e[8]!==d?(n=a&&a!==""?s.jsxRuntimeExports.jsx(b._,{size:"sm",marginBottom:"2xs",className:d?"text-center":"",children:a}):null,e[7]=a,e[8]=d,e[9]=n):n=e[9];let i;if(e[10]!==g||e[11]!==t||e[12]!==m){let f;e[14]!==t||e[15]!==m?(f=(N,y)=>m.includes(N)?null:s.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:t[y%t.length]}}),N===""?null:s.jsxRuntimeExports.jsx(b._,{size:"sm",marginBottom:"none",children:N})]},y),e[14]=t,e[15]=m,e[16]=f):f=e[16],i=g.map(f),e[10]=g,e[11]=t,e[12]=m,e[13]=i}else i=e[13];let r;e[17]!==h?(r=h?s.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:B.Colors.gray}}),s.jsxRuntimeExports.jsx(b._,{size:"sm",marginBottom:"none",children:"NA"})]}):null,e[17]=h,e[18]=r):r=e[18];let x;e[19]!==i||e[20]!==r?(x=s.jsxRuntimeExports.jsxs("div",{className:"flex flex-wrap mb-0 gap-3.5",children:[i,r]}),e[19]=i,e[20]=r,e[21]=x):x=e[21];let c;e[22]!==n||e[23]!==x?(c=s.jsxRuntimeExports.jsxs("div",{children:[n,x]}),e[22]=n,e[23]=x,e[24]=c):c=e[24];let p;return e[25]!==c||e[26]!==l||e[27]!==o?(p=s.jsxRuntimeExports.jsx("div",{className:l,style:o,"aria-label":"Color legend",children:c}),e[25]=c,e[26]=l,e[27]=o,e[28]=p):p=e[28],p}exports.ColorLegend=T;
|
|
2
2
|
//# sourceMappingURL=ColorLegend.cjs.map
|
package/dist/ColorLegend.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as T, m as k, j as l } from "./index-CHPV5EwG-
|
|
2
|
-
import { _ as w } from "./Typography-
|
|
1
|
+
import { c as T, m as k, j as l } from "./index-CHPV5EwG-BCLAYDCV.js";
|
|
2
|
+
import { _ as w } from "./Typography-DMVW6JnV.js";
|
|
3
3
|
import { Colors as A } from "./Colors.js";
|
|
4
4
|
function R(z) {
|
|
5
5
|
const e = T.c(29), {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-6v2a2njQ.cjs"),C=require("./Typography-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-6v2a2njQ.cjs"),C=require("./Typography-CZZxlj1W.cjs"),N=require("./Colors.cjs");function M(b){const e=s.compilerRuntimeExports.c(28),{colorLegendTitle:m,colorDomain:j,colors:o,setSelectedColor:t,showNAColor:g,width:R,isCenter:u,className:f}=b,h=u&&"justify-center";let l;e[0]!==f||e[1]!==h?(l=s.mo("flex leading-0 pb-3",h,f),e[0]=f,e[1]=h,e[2]=l):l=e[2];const v=R?`${R}px`:"none";let r;e[3]!==v?(r={maxWidth:v},e[3]=v,e[4]=r):r=e[4];let n;e[5]!==m||e[6]!==u?(n=m&&m!==""?s.jsxRuntimeExports.jsx(C._,{size:"sm",marginBottom:"2xs",className:u?"text-center":"",children:m}):null,e[5]=m,e[6]=u,e[7]=n):n=e[7];let i;if(e[8]!==j||e[9]!==o||e[10]!==t){let p;e[12]!==o||e[13]!==t?(p=(y,E)=>s.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-1 cursor-pointer",onMouseEnter:()=>{t(o[E%o.length])},onMouseLeave:()=>{t(void 0)},children:[s.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:o[E%o.length]}}),y===""?null:s.jsxRuntimeExports.jsx(C._,{size:"sm",marginBottom:"none",children:y})]},E),e[12]=o,e[13]=t,e[14]=p):p=e[14],i=j.map(p),e[8]=j,e[9]=o,e[10]=t,e[11]=i}else i=e[11];let x;e[15]!==t||e[16]!==g?(x=g?s.jsxRuntimeExports.jsxs("div",{onMouseEnter:()=>{t(N.Colors.gray)},onMouseLeave:()=>{t(void 0)},className:"flex items-center gap-1 cursor-pointer",children:[s.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:N.Colors.gray}}),s.jsxRuntimeExports.jsx(C._,{size:"sm",marginBottom:"none",children:"NA"})]}):null,e[15]=t,e[16]=g,e[17]=x):x=e[17];let c;e[18]!==i||e[19]!==x?(c=s.jsxRuntimeExports.jsxs("div",{className:"flex flex-wrap gap-3.5 mb-0",children:[i,x]}),e[18]=i,e[19]=x,e[20]=c):c=e[20];let a;e[21]!==n||e[22]!==c?(a=s.jsxRuntimeExports.jsxs("div",{children:[n,c]}),e[21]=n,e[22]=c,e[23]=a):a=e[23];let d;return e[24]!==l||e[25]!==r||e[26]!==a?(d=s.jsxRuntimeExports.jsx("div",{className:l,style:r,"aria-label":"Color legend",children:a}),e[24]=l,e[25]=r,e[26]=a,e[27]=d):d=e[27],d}exports.ColorLegendWithMouseOver=M;
|
|
2
2
|
//# sourceMappingURL=ColorLegendWithMouseOver.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as E, m as L, j as l } from "./index-CHPV5EwG-
|
|
2
|
-
import { _ as C } from "./Typography-
|
|
1
|
+
import { c as E, m as L, j as l } from "./index-CHPV5EwG-BCLAYDCV.js";
|
|
2
|
+
import { _ as C } from "./Typography-DMVW6JnV.js";
|
|
3
3
|
import { Colors as w } from "./Colors.js";
|
|
4
4
|
function A(M) {
|
|
5
5
|
const e = E.c(28), {
|
package/dist/CopyTextButton.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-6v2a2njQ.cjs"),ne=require("./index-sbKVyHS2.cjs"),k=require("react"),Fe=require("react-dom"),f=require("./index-Dzc_aaI9-C3DbPpy3.cjs"),Oe=require("./index-Cw8sCyo_-CEcCMKUi.cjs"),z=require("./x-BBpi7a_7-DXYIEFwN.cjs");function ce(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,a.get?a:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const l=ce(k),Ke=ce(Fe),$e=1,qe=1e6;let U=0;function Ve(){return U=(U+1)%Number.MAX_SAFE_INTEGER,U.toString()}const X=new Map,oe=t=>{if(X.has(t))return;const r=setTimeout(()=>{X.delete(t),M({type:"REMOVE_TOAST",toastId:t})},qe);X.set(t,r)},ze=(t,r)=>{switch(r.type){case"ADD_TOAST":return{...t,toasts:[r.toast,...t.toasts].slice(0,$e)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(e=>e.id===r.toast.id?{...e,...r.toast}:e)};case"DISMISS_TOAST":{const{toastId:e}=r;return e?oe(e):t.toasts.forEach(a=>{oe(a.id)}),{...t,toasts:t.toasts.map(a=>a.id===e||e===void 0?{...a,open:!1}:a)}}case"REMOVE_TOAST":return r.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(e=>e.id!==r.toastId)};default:return{...t}}},q=[];let V={toasts:[]};function M(t){V=ze(V,t),q.forEach(r=>{r(V)})}function We({...t}){const r=Ve(),e=s=>M({type:"UPDATE_TOAST",toast:{...s,id:r}}),a=()=>M({type:"DISMISS_TOAST",toastId:r});return M({type:"ADD_TOAST",toast:{...t,id:r,open:!0,onOpenChange:s=>{s||a()}}}),{id:r,dismiss:a,update:e}}function le(){const t=o._.c(5),[r,e]=k.useState(V);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>(q.push(e),()=>{const i=q.indexOf(e);i>-1&&q.splice(i,1)}),t[0]=a):a=t[0];let s;t[1]!==r?(s=[r],t[1]=r,t[2]=s):s=t[2],k.useEffect(a,s);let n;return t[3]!==r?(n={...r,toast:We,dismiss:Be},t[3]=r,t[4]=n):n=t[4],n}function Be(t){return M({type:"DISMISS_TOAST",toastId:t})}const Ue=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Xe=z.k("circle-check-big",Ue);const Ge=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],He=z.k("circle-x",Ge);const Ye=[["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",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ze=z.k("triangle-alert",Ye);var J="ToastProvider",[Q,Je,Qe]=Oe.h("Toast"),[de]=f.g("Toast",[Qe]),[et,W]=de(J),ue=t=>{const{__scopeToast:r,label:e="Notification",duration:a=5e3,swipeDirection:s="right",swipeThreshold:n=50,children:i}=t,[u,x]=l.useState(null),[c,w]=l.useState(0),m=l.useRef(!1),E=l.useRef(!1);return e.trim()||console.error(`Invalid prop \`label\` supplied to \`${J}\`. Expected non-empty \`string\`.`),o.ae.jsx(Q.Provider,{scope:r,children:o.ae.jsx(et,{scope:r,label:e,duration:a,swipeDirection:s,swipeThreshold:n,toastCount:c,viewport:u,onViewportChange:x,onToastAdd:l.useCallback(()=>w(g=>g+1),[]),onToastRemove:l.useCallback(()=>w(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:m,isClosePausedRef:E,children:i})})};ue.displayName=J;var pe="ToastViewport",tt=["F8"],H="toast.viewportPause",Y="toast.viewportResume",fe=l.forwardRef((t,r)=>{const{__scopeToast:e,hotkey:a=tt,label:s="Notifications ({hotkey})",...n}=t,i=W(pe,e),u=Je(e),x=l.useRef(null),c=l.useRef(null),w=l.useRef(null),m=l.useRef(null),E=f.P(r,m,i.onViewportChange),g=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=i.toastCount>0;l.useEffect(()=>{const d=h=>{a.length!==0&&a.every(v=>h[v]||h.code===v)&&m.current?.focus()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[a]),l.useEffect(()=>{const d=x.current,h=m.current;if(j&&d&&h){const v=()=>{if(!i.isClosePausedRef.current){const N=new CustomEvent(H);h.dispatchEvent(N),i.isClosePausedRef.current=!0}},b=()=>{if(i.isClosePausedRef.current){const N=new CustomEvent(Y);h.dispatchEvent(N),i.isClosePausedRef.current=!1}},T=N=>{!d.contains(N.relatedTarget)&&b()},_=()=>{d.contains(document.activeElement)||b()};return d.addEventListener("focusin",v),d.addEventListener("focusout",T),d.addEventListener("pointermove",v),d.addEventListener("pointerleave",_),window.addEventListener("blur",v),window.addEventListener("focus",b),()=>{d.removeEventListener("focusin",v),d.removeEventListener("focusout",T),d.removeEventListener("pointermove",v),d.removeEventListener("pointerleave",_),window.removeEventListener("blur",v),window.removeEventListener("focus",b)}}},[j,i.isClosePausedRef]);const y=l.useCallback(({tabbingDirection:d})=>{const h=u().map(v=>{const b=v.ref.current,T=[b,...mt(b)];return d==="forwards"?T:T.reverse()});return(d==="forwards"?h.reverse():h).flat()},[u]);return l.useEffect(()=>{const d=m.current;if(d){const h=v=>{const b=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!b){const T=document.activeElement,_=v.shiftKey;if(v.target===d&&_){c.current?.focus();return}const N=y({tabbingDirection:_?"backwards":"forwards"}),R=N.findIndex(P=>P===T);G(N.slice(R+1))?v.preventDefault():_?c.current?.focus():w.current?.focus()}};return d.addEventListener("keydown",h),()=>d.removeEventListener("keydown",h)}},[u,y]),o.ae.jsxs(f.$,{ref:x,role:"region","aria-label":s.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&o.ae.jsx(Z,{ref:c,onFocusFromOutsideViewport:()=>{const d=y({tabbingDirection:"forwards"});G(d)}}),o.ae.jsx(Q.Slot,{scope:e,children:o.ae.jsx(f.w.ol,{tabIndex:-1,...n,ref:E})}),j&&o.ae.jsx(Z,{ref:w,onFocusFromOutsideViewport:()=>{const d=y({tabbingDirection:"backwards"});G(d)}})]})});fe.displayName=pe;var me="ToastFocusProxy",Z=l.forwardRef((t,r)=>{const{__scopeToast:e,onFocusFromOutsideViewport:a,...s}=t,n=W(me,e);return o.ae.jsx(f.a,{tabIndex:0,...s,ref:r,style:{position:"fixed"},onFocus:i=>{const u=i.relatedTarget;!n.viewport?.contains(u)&&a()}})});Z.displayName=me;var L="Toast",rt="toast.swipeStart",at="toast.swipeMove",st="toast.swipeCancel",nt="toast.swipeEnd",ye=l.forwardRef((t,r)=>{const{forceMount:e,open:a,defaultOpen:s,onOpenChange:n,...i}=t,[u,x]=f._({prop:a,defaultProp:s??!0,onChange:n,caller:L});return o.ae.jsx(f.E,{present:e||u,children:o.ae.jsx(ct,{open:u,...i,ref:r,onClose:()=>x(!1),onPause:f.c(t.onPause),onResume:f.c(t.onResume),onSwipeStart:f.j(t.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:f.j(t.onSwipeMove,c=>{const{x:w,y:m}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${w}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${m}px`)}),onSwipeCancel:f.j(t.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:f.j(t.onSwipeEnd,c=>{const{x:w,y:m}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${w}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${m}px`),x(!1)})})})});ye.displayName=L;var[ot,it]=de(L,{onClose(){}}),ct=l.forwardRef((t,r)=>{const{__scopeToast:e,type:a="foreground",duration:s,open:n,onClose:i,onEscapeKeyDown:u,onPause:x,onResume:c,onSwipeStart:w,onSwipeMove:m,onSwipeCancel:E,onSwipeEnd:g,...j}=t,y=W(L,e),[d,h]=l.useState(null),v=f.P(r,p=>h(p)),b=l.useRef(null),T=l.useRef(null),_=s||y.duration,N=l.useRef(0),R=l.useRef(_),P=l.useRef(0),{onToastAdd:te,onToastRemove:re}=y,D=f.c(()=>{d?.contains(document.activeElement)&&y.viewport?.focus(),i()}),F=l.useCallback(p=>{!p||p===1/0||(window.clearTimeout(P.current),N.current=new Date().getTime(),P.current=window.setTimeout(D,p))},[D]);l.useEffect(()=>{const p=y.viewport;if(p){const S=()=>{F(R.current),c?.()},C=()=>{const A=new Date().getTime()-N.current;R.current=R.current-A,window.clearTimeout(P.current),x?.()};return p.addEventListener(H,C),p.addEventListener(Y,S),()=>{p.removeEventListener(H,C),p.removeEventListener(Y,S)}}},[y.viewport,_,x,c,F]),l.useEffect(()=>{n&&!y.isClosePausedRef.current&&F(_)},[n,_,y.isClosePausedRef,F]),l.useEffect(()=>(te(),()=>re()),[te,re]);const ae=l.useMemo(()=>d?Ee(d):null,[d]);return y.viewport?o.ae.jsxs(o.ae.Fragment,{children:[ae&&o.ae.jsx(lt,{__scopeToast:e,role:"status","aria-live":a==="foreground"?"assertive":"polite",children:ae}),o.ae.jsx(ot,{scope:e,onClose:D,children:Ke.createPortal(o.ae.jsx(Q.ItemSlot,{scope:e,children:o.ae.jsx(f.Z,{asChild:!0,onEscapeKeyDown:f.j(u,()=>{y.isFocusedToastEscapeKeyDownRef.current||D(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:o.ae.jsx(f.w.li,{tabIndex:0,"data-state":n?"open":"closed","data-swipe-direction":y.swipeDirection,...j,ref:v,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:f.j(t.onKeyDown,p=>{p.key==="Escape"&&(u?.(p.nativeEvent),p.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,D()))}),onPointerDown:f.j(t.onPointerDown,p=>{p.button===0&&(b.current={x:p.clientX,y:p.clientY})}),onPointerMove:f.j(t.onPointerMove,p=>{if(!b.current)return;const S=p.clientX-b.current.x,C=p.clientY-b.current.y,A=!!T.current,I=["left","right"].includes(y.swipeDirection),O=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,Me=I?O(0,S):0,Le=I?0:O(0,C),B=p.pointerType==="touch"?10:2,K={x:Me,y:Le},se={originalEvent:p,delta:K};A?(T.current=K,$(at,m,se,{discrete:!1})):ie(K,y.swipeDirection,B)?(T.current=K,$(rt,w,se,{discrete:!1}),p.target.setPointerCapture(p.pointerId)):(Math.abs(S)>B||Math.abs(C)>B)&&(b.current=null)}),onPointerUp:f.j(t.onPointerUp,p=>{const S=T.current,C=p.target;if(C.hasPointerCapture(p.pointerId)&&C.releasePointerCapture(p.pointerId),T.current=null,b.current=null,S){const A=p.currentTarget,I={originalEvent:p,delta:S};ie(S,y.swipeDirection,y.swipeThreshold)?$(nt,g,I,{discrete:!0}):$(st,E,I,{discrete:!0}),A.addEventListener("click",O=>O.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),lt=t=>{const{__scopeToast:r,children:e,...a}=t,s=W(L,r),[n,i]=l.useState(!1),[u,x]=l.useState(!1);return pt(()=>i(!0)),l.useEffect(()=>{const c=window.setTimeout(()=>x(!0),1e3);return()=>window.clearTimeout(c)},[]),u?null:o.ae.jsx(f.u,{asChild:!0,children:o.ae.jsx(f.a,{...a,children:n&&o.ae.jsxs(o.ae.Fragment,{children:[s.label," ",e]})})})},dt="ToastTitle",xe=l.forwardRef((t,r)=>{const{__scopeToast:e,...a}=t;return o.ae.jsx(f.w.div,{...a,ref:r})});xe.displayName=dt;var ut="ToastDescription",ve=l.forwardRef((t,r)=>{const{__scopeToast:e,...a}=t;return o.ae.jsx(f.w.div,{...a,ref:r})});ve.displayName=ut;var we="ToastAction",he=l.forwardRef((t,r)=>{const{altText:e,...a}=t;return e.trim()?o.ae.jsx(Te,{altText:e,asChild:!0,children:o.ae.jsx(ee,{...a,ref:r})}):(console.error(`Invalid prop \`altText\` supplied to \`${we}\`. Expected non-empty \`string\`.`),null)});he.displayName=we;var be="ToastClose",ee=l.forwardRef((t,r)=>{const{__scopeToast:e,...a}=t,s=it(be,e);return o.ae.jsx(Te,{asChild:!0,children:o.ae.jsx(f.w.button,{type:"button",...a,ref:r,onClick:f.j(t.onClick,s.onClose)})})});ee.displayName=be;var Te=l.forwardRef((t,r)=>{const{__scopeToast:e,altText:a,...s}=t;return o.ae.jsx(f.w.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":a||void 0,...s,ref:r})});function Ee(t){const r=[];return Array.from(t.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&r.push(e.textContent),ft(e)){const a=e.ariaHidden||e.hidden||e.style.display==="none",s=e.dataset.radixToastAnnounceExclude==="";if(!a)if(s){const n=e.dataset.radixToastAnnounceAlt;n&&r.push(n)}else r.push(...Ee(e))}}),r}function $(t,r,e,{discrete:a}){const s=e.originalEvent.currentTarget,n=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});r&&s.addEventListener(t,r,{once:!0}),a?f.N(s,n):s.dispatchEvent(n)}var ie=(t,r,e=0)=>{const a=Math.abs(t.x),s=Math.abs(t.y),n=a>s;return r==="left"||r==="right"?n&&a>e:!n&&s>e};function pt(t=()=>{}){const r=f.c(t);f.E$1(()=>{let e=0,a=0;return e=window.requestAnimationFrame(()=>a=window.requestAnimationFrame(r)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(a)}},[r])}function ft(t){return t.nodeType===t.ELEMENT_NODE}function mt(t){const r=[],e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const s=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||s?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;e.nextNode();)r.push(e.currentNode);return r}function G(t){const r=document.activeElement;return t.some(e=>e===r?!0:(e.focus(),document.activeElement!==r))}var yt=ue,ge=fe,ke=ye,je=xe,_e=ve,Ne=he,Se=ee;const xt=yt,Ce=k.createContext(null),Re=k.forwardRef((t,r)=>{const e=o._.c(9);let a,s;e[0]!==t?({className:a,...s}=t,e[0]=t,e[1]=a,e[2]=s):(a=e[1],s=e[2]);let n;e[3]!==a?(n=o.mo("fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",a),e[3]=a,e[4]=n):n=e[4];let i;return e[5]!==s||e[6]!==r||e[7]!==n?(i=o.ae.jsx(ge,{...s,ref:r,className:n}),e[5]=s,e[6]=r,e[7]=n,e[8]=i):i=e[8],i});Re.displayName=ge.displayName;const vt=o.j("group pointer-events-auto relative shadow-xs bg-primary-white dark:bg-primary-gray-650 flex w-full text-primary-black dark:text-primary-white items-center justify-between flex gap-2 overflow-hidden rounded-sm border border-primary-gray-400 p-2 pr-6 transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full sm:data-[state=open]:slide-in-from-bottom-full",{variants:{variant:{default:"border border-primary-gray-400 dark:border-0",success:"border-t-4 border-accent-dark-green dark:border-b-0 dark:border-l-0 dark:border-r-0",warning:"border-t-4 border-accent-dark-yellow dark:border-b-0 dark:border-l-0 dark:border-r-0",destructive:"border-t-4 border-accent-dark-red dark:border-b-0 dark:border-l-0 dark:border-r-0"}},defaultVariants:{variant:"default"}}),wt=o.j("",{variants:{variant:{default:"text-primary-black dark:text-primary-white",success:"text-accent-dark-green",warning:"text-accent-dark-yellow",destructive:"text-accent-dark-red"}},defaultVariants:{variant:"default"}}),Pe=k.forwardRef((t,r)=>{const e=o._.c(16);let a,s,n;e[0]!==t?({className:a,variant:n,...s}=t,e[0]=t,e[1]=a,e[2]=s,e[3]=n):(a=e[1],s=e[2],n=e[3]);let i;e[4]!==n?(i={variant:n},e[4]=n,e[5]=i):i=e[5];let u;e[6]!==a||e[7]!==n?(u=o.mo(vt({variant:n}),a),e[6]=a,e[7]=n,e[8]=u):u=e[8];let x;e[9]!==s||e[10]!==r||e[11]!==u?(x=o.ae.jsx(ke,{...s,ref:r,className:u}),e[9]=s,e[10]=r,e[11]=u,e[12]=x):x=e[12];let c;return e[13]!==i||e[14]!==x?(c=o.ae.jsx(Ce.Provider,{value:i,children:x}),e[13]=i,e[14]=x,e[15]=c):c=e[15],c});Pe.displayName=ke.displayName;const ht=k.forwardRef((t,r)=>{const e=o._.c(9);let a,s;e[0]!==t?({className:a,...s}=t,e[0]=t,e[1]=a,e[2]=s):(a=e[1],s=e[2]);let n;e[3]!==a?(n=o.mo("inline-flex h-8 shrink-0 items-center text-primary-gray-700 dark:text-primary-gray-100 justify-center rounded-none bg-transparent px-3 text-sm font-medium transition-colors hover:bg-primary-gray-200 dark:hover:bg-primary-gray-600 focus:outline-hidden focus:ring-1 disabled:pointer-events-none disabled:opacity-50",a),e[3]=a,e[4]=n):n=e[4];let i;return e[5]!==s||e[6]!==r||e[7]!==n?(i=o.ae.jsx(Ne,{...s,ref:r,className:n}),e[5]=s,e[6]=r,e[7]=n,e[8]=i):i=e[8],i});ht.displayName=Ne.displayName;const De=k.forwardRef((t,r)=>{const e=o._.c(10);let a,s;e[0]!==t?({className:a,...s}=t,e[0]=t,e[1]=a,e[2]=s):(a=e[1],s=e[2]);let n;e[3]!==a?(n=o.mo("absolute right-1 top-1 rounded-md p-1 text-primary-gray-700/50 dark:text-primary-gray-100/50 opacity-0 transition-opacity hover:text-primary-gray-700 dark:hover:text-primary-gray-100 focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100",a),e[3]=a,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=o.ae.jsx(z.t,{className:"h-4 w-4"}),e[5]=i):i=e[5];let u;return e[6]!==s||e[7]!==r||e[8]!==n?(u=o.ae.jsx(Se,{...s,ref:r,className:n,"toast-close":"",children:i}),e[6]=s,e[7]=r,e[8]=n,e[9]=u):u=e[9],u});De.displayName=Se.displayName;const Ae=k.forwardRef((t,r)=>{const e=o._.c(16);let a,s;e[0]!==t?({className:a,...s}=t,e[0]=t,e[1]=a,e[2]=s):(a=e[1],s=e[2]);const n=k.useContext(Ce);let i;e[3]!==a||e[4]!==n?.variant?(i=o.mo(wt({variant:n?.variant}),"text-lg font-bold [&+div]:text-xs",a),e[3]=a,e[4]=n?.variant,e[5]=i):i=e[5];const u=i;let x;e:switch(n?.variant){case"destructive":{let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=o.ae.jsx(He,{className:"h-4 w-4 stroke-accent-dark-red",strokeWidth:2}),e[6]=m):m=e[6],x=m;break e}case"success":{let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=o.ae.jsx(Xe,{className:"h-4 w-4 stroke-accent-dark-green",strokeWidth:2}),e[7]=m):m=e[7],x=m;break e}case"warning":{let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=o.ae.jsx(Ze,{className:"h-4 w-4 stroke-accent-dark-yellow",strokeWidth:2}),e[8]=m):m=e[8],x=m;break e}default:x=null}let c;e[9]!==u||e[10]!==s||e[11]!==r?(c=o.ae.jsx(je,{...s,ref:r,className:u}),e[9]=u,e[10]=s,e[11]=r,e[12]=c):c=e[12];let w;return e[13]!==x||e[14]!==c?(w=o.ae.jsxs("div",{className:"flex gap-x-1 items-center",children:[x,c]}),e[13]=x,e[14]=c,e[15]=w):w=e[15],w});Ae.displayName=je.displayName;const Ie=k.forwardRef((t,r)=>{const e=o._.c(9);let a,s;e[0]!==t?({className:a,...s}=t,e[0]=t,e[1]=a,e[2]=s):(a=e[1],s=e[2]);let n;e[3]!==a?(n=o.mo("text-base opacity-90 dark:text-primary-white",a),e[3]=a,e[4]=n):n=e[4];let i;return e[5]!==s||e[6]!==r||e[7]!==n?(i=o.ae.jsx(_e,{...s,ref:r,className:n}),e[5]=s,e[6]=r,e[7]=n,e[8]=i):i=e[8],i});Ie.displayName=_e.displayName;function bt(){const t=o._.c(5),{toasts:r}=le();let e;t[0]!==r?(e=r.map(Tt),t[0]=r,t[1]=e):e=t[1];let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=o.ae.jsx(Re,{}),t[2]=a):a=t[2];let s;return t[3]!==e?(s=o.ae.jsxs(xt,{children:[e,a]}),t[3]=e,t[4]=s):s=t[4],s}function Tt(t){const{id:r,title:e,description:a,action:s,...n}=t;return k.createElement(Pe,{...n,key:r},o.ae.jsxs("div",{className:"grid gap-1",children:[e&&o.ae.jsx(Ae,{children:e}),a&&o.ae.jsx(Ie,{children:a})]}),s,o.ae.jsx(De,{}))}function Et(t){const r=o.compilerRuntimeExports.c(12),{text:e,successMessage:a,buttonText:s,buttonSmall:n,className:i}=t,u=a===void 0?"Text copied":a,x=n===void 0?!1:n,c=i===void 0?"":i,{toast:w}=le(),m=`${x?"p-2":"py-4 px-6"} ${c}`;let E;r[0]!==u||r[1]!==e||r[2]!==w?(E=()=>{navigator.clipboard.writeText(e),w({variant:"success",description:u,duration:1e3})},r[0]=u,r[1]=e,r[2]=w,r[3]=E):E=r[3];let g;r[4]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsxRuntimeExports.jsx(ne.Copy,{}),r[4]=g):g=r[4];const j=s||null;let y;r[5]!==m||r[6]!==E||r[7]!==j?(y=o.jsxRuntimeExports.jsxs(ne.u,{variant:"tertiary",className:m,onClick:E,"aria-label":"Click to copy the text",children:[g,j]}),r[5]=m,r[6]=E,r[7]=j,r[8]=y):y=r[8];let d;r[9]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsxRuntimeExports.jsx(bt,{}),r[9]=d):d=r[9];let h;return r[10]!==y?(h=o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[y,d]}),r[10]=y,r[11]=h):h=r[11],h}exports.CopyTextButton=Et;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-6v2a2njQ.cjs"),se=require("./index-sbKVyHS2.cjs"),k=require("react"),Fe=require("react-dom"),f=require("./index-DoS4bGNa-C3DbPpy3.cjs"),Oe=require("./index-D6CYcVc7-CTEcAtiQ.cjs"),z=require("./x-BBpi7a_7-DXYIEFwN.cjs");function ce(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,a.get?a:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const l=ce(k),Ke=ce(Fe),$e=1,Ve=1e6;let G=0;function qe(){return G=(G+1)%Number.MAX_SAFE_INTEGER,G.toString()}const U=new Map,oe=t=>{if(U.has(t))return;const r=setTimeout(()=>{U.delete(t),M({type:"REMOVE_TOAST",toastId:t})},Ve);U.set(t,r)},ze=(t,r)=>{switch(r.type){case"ADD_TOAST":return{...t,toasts:[r.toast,...t.toasts].slice(0,$e)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(e=>e.id===r.toast.id?{...e,...r.toast}:e)};case"DISMISS_TOAST":{const{toastId:e}=r;return e?oe(e):t.toasts.forEach(a=>{oe(a.id)}),{...t,toasts:t.toasts.map(a=>a.id===e||e===void 0?{...a,open:!1}:a)}}case"REMOVE_TOAST":return r.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(e=>e.id!==r.toastId)};default:return{...t}}},V=[];let q={toasts:[]};function M(t){q=ze(q,t),V.forEach(r=>{r(q)})}function We({...t}){const r=qe(),e=n=>M({type:"UPDATE_TOAST",toast:{...n,id:r}}),a=()=>M({type:"DISMISS_TOAST",toastId:r});return M({type:"ADD_TOAST",toast:{...t,id:r,open:!0,onOpenChange:n=>{n||a()}}}),{id:r,dismiss:a,update:e}}function le(){const t=o._.c(5),[r,e]=k.useState(q);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>(V.push(e),()=>{const i=V.indexOf(e);i>-1&&V.splice(i,1)}),t[0]=a):a=t[0];let n;t[1]!==r?(n=[r],t[1]=r,t[2]=n):n=t[2],k.useEffect(a,n);let s;return t[3]!==r?(s={...r,toast:We,dismiss:Be},t[3]=r,t[4]=s):s=t[4],s}function Be(t){return M({type:"DISMISS_TOAST",toastId:t})}const Ge=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Ue=z.k("circle-check-big",Ge);const Xe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Ye=z.k("circle-x",Xe);const He=[["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",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ze=z.k("triangle-alert",He);var J="ToastProvider",[Q,Je,Qe]=Oe.h("Toast"),[de]=f.g("Toast",[Qe]),[et,W]=de(J),ue=t=>{const{__scopeToast:r,label:e="Notification",duration:a=5e3,swipeDirection:n="right",swipeThreshold:s=50,children:i}=t,[u,x]=l.useState(null),[c,w]=l.useState(0),m=l.useRef(!1),E=l.useRef(!1);return e.trim()||console.error(`Invalid prop \`label\` supplied to \`${J}\`. Expected non-empty \`string\`.`),o.ae.jsx(Q.Provider,{scope:r,children:o.ae.jsx(et,{scope:r,label:e,duration:a,swipeDirection:n,swipeThreshold:s,toastCount:c,viewport:u,onViewportChange:x,onToastAdd:l.useCallback(()=>w(g=>g+1),[]),onToastRemove:l.useCallback(()=>w(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:m,isClosePausedRef:E,children:i})})};ue.displayName=J;var pe="ToastViewport",tt=["F8"],Y="toast.viewportPause",H="toast.viewportResume",fe=l.forwardRef((t,r)=>{const{__scopeToast:e,hotkey:a=tt,label:n="Notifications ({hotkey})",...s}=t,i=W(pe,e),u=Je(e),x=l.useRef(null),c=l.useRef(null),w=l.useRef(null),m=l.useRef(null),E=f.P(r,m,i.onViewportChange),g=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=i.toastCount>0;l.useEffect(()=>{const d=h=>{a.length!==0&&a.every(v=>h[v]||h.code===v)&&m.current?.focus()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[a]),l.useEffect(()=>{const d=x.current,h=m.current;if(j&&d&&h){const v=()=>{if(!i.isClosePausedRef.current){const N=new CustomEvent(Y);h.dispatchEvent(N),i.isClosePausedRef.current=!0}},b=()=>{if(i.isClosePausedRef.current){const N=new CustomEvent(H);h.dispatchEvent(N),i.isClosePausedRef.current=!1}},T=N=>{!d.contains(N.relatedTarget)&&b()},_=()=>{d.contains(document.activeElement)||b()};return d.addEventListener("focusin",v),d.addEventListener("focusout",T),d.addEventListener("pointermove",v),d.addEventListener("pointerleave",_),window.addEventListener("blur",v),window.addEventListener("focus",b),()=>{d.removeEventListener("focusin",v),d.removeEventListener("focusout",T),d.removeEventListener("pointermove",v),d.removeEventListener("pointerleave",_),window.removeEventListener("blur",v),window.removeEventListener("focus",b)}}},[j,i.isClosePausedRef]);const y=l.useCallback(({tabbingDirection:d})=>{const h=u().map(v=>{const b=v.ref.current,T=[b,...mt(b)];return d==="forwards"?T:T.reverse()});return(d==="forwards"?h.reverse():h).flat()},[u]);return l.useEffect(()=>{const d=m.current;if(d){const h=v=>{const b=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!b){const T=document.activeElement,_=v.shiftKey;if(v.target===d&&_){c.current?.focus();return}const N=y({tabbingDirection:_?"backwards":"forwards"}),R=N.findIndex(P=>P===T);X(N.slice(R+1))?v.preventDefault():_?c.current?.focus():w.current?.focus()}};return d.addEventListener("keydown",h),()=>d.removeEventListener("keydown",h)}},[u,y]),o.ae.jsxs(f.$,{ref:x,role:"region","aria-label":n.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&o.ae.jsx(Z,{ref:c,onFocusFromOutsideViewport:()=>{const d=y({tabbingDirection:"forwards"});X(d)}}),o.ae.jsx(Q.Slot,{scope:e,children:o.ae.jsx(f.w.ol,{tabIndex:-1,...s,ref:E})}),j&&o.ae.jsx(Z,{ref:w,onFocusFromOutsideViewport:()=>{const d=y({tabbingDirection:"backwards"});X(d)}})]})});fe.displayName=pe;var me="ToastFocusProxy",Z=l.forwardRef((t,r)=>{const{__scopeToast:e,onFocusFromOutsideViewport:a,...n}=t,s=W(me,e);return o.ae.jsx(f.a,{tabIndex:0,...n,ref:r,style:{position:"fixed"},onFocus:i=>{const u=i.relatedTarget;!s.viewport?.contains(u)&&a()}})});Z.displayName=me;var L="Toast",rt="toast.swipeStart",at="toast.swipeMove",nt="toast.swipeCancel",st="toast.swipeEnd",ye=l.forwardRef((t,r)=>{const{forceMount:e,open:a,defaultOpen:n,onOpenChange:s,...i}=t,[u,x]=f._({prop:a,defaultProp:n??!0,onChange:s,caller:L});return o.ae.jsx(f.E,{present:e||u,children:o.ae.jsx(ct,{open:u,...i,ref:r,onClose:()=>x(!1),onPause:f.c(t.onPause),onResume:f.c(t.onResume),onSwipeStart:f.j(t.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:f.j(t.onSwipeMove,c=>{const{x:w,y:m}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${w}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${m}px`)}),onSwipeCancel:f.j(t.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:f.j(t.onSwipeEnd,c=>{const{x:w,y:m}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${w}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${m}px`),x(!1)})})})});ye.displayName=L;var[ot,it]=de(L,{onClose(){}}),ct=l.forwardRef((t,r)=>{const{__scopeToast:e,type:a="foreground",duration:n,open:s,onClose:i,onEscapeKeyDown:u,onPause:x,onResume:c,onSwipeStart:w,onSwipeMove:m,onSwipeCancel:E,onSwipeEnd:g,...j}=t,y=W(L,e),[d,h]=l.useState(null),v=f.P(r,p=>h(p)),b=l.useRef(null),T=l.useRef(null),_=n||y.duration,N=l.useRef(0),R=l.useRef(_),P=l.useRef(0),{onToastAdd:te,onToastRemove:re}=y,D=f.c(()=>{d?.contains(document.activeElement)&&y.viewport?.focus(),i()}),F=l.useCallback(p=>{!p||p===1/0||(window.clearTimeout(P.current),N.current=new Date().getTime(),P.current=window.setTimeout(D,p))},[D]);l.useEffect(()=>{const p=y.viewport;if(p){const S=()=>{F(R.current),c?.()},C=()=>{const A=new Date().getTime()-N.current;R.current=R.current-A,window.clearTimeout(P.current),x?.()};return p.addEventListener(Y,C),p.addEventListener(H,S),()=>{p.removeEventListener(Y,C),p.removeEventListener(H,S)}}},[y.viewport,_,x,c,F]),l.useEffect(()=>{s&&!y.isClosePausedRef.current&&F(_)},[s,_,y.isClosePausedRef,F]),l.useEffect(()=>(te(),()=>re()),[te,re]);const ae=l.useMemo(()=>d?Ee(d):null,[d]);return y.viewport?o.ae.jsxs(o.ae.Fragment,{children:[ae&&o.ae.jsx(lt,{__scopeToast:e,role:"status","aria-live":a==="foreground"?"assertive":"polite",children:ae}),o.ae.jsx(ot,{scope:e,onClose:D,children:Ke.createPortal(o.ae.jsx(Q.ItemSlot,{scope:e,children:o.ae.jsx(f.Z,{asChild:!0,onEscapeKeyDown:f.j(u,()=>{y.isFocusedToastEscapeKeyDownRef.current||D(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:o.ae.jsx(f.w.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":y.swipeDirection,...j,ref:v,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:f.j(t.onKeyDown,p=>{p.key==="Escape"&&(u?.(p.nativeEvent),p.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,D()))}),onPointerDown:f.j(t.onPointerDown,p=>{p.button===0&&(b.current={x:p.clientX,y:p.clientY})}),onPointerMove:f.j(t.onPointerMove,p=>{if(!b.current)return;const S=p.clientX-b.current.x,C=p.clientY-b.current.y,A=!!T.current,I=["left","right"].includes(y.swipeDirection),O=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,Me=I?O(0,S):0,Le=I?0:O(0,C),B=p.pointerType==="touch"?10:2,K={x:Me,y:Le},ne={originalEvent:p,delta:K};A?(T.current=K,$(at,m,ne,{discrete:!1})):ie(K,y.swipeDirection,B)?(T.current=K,$(rt,w,ne,{discrete:!1}),p.target.setPointerCapture(p.pointerId)):(Math.abs(S)>B||Math.abs(C)>B)&&(b.current=null)}),onPointerUp:f.j(t.onPointerUp,p=>{const S=T.current,C=p.target;if(C.hasPointerCapture(p.pointerId)&&C.releasePointerCapture(p.pointerId),T.current=null,b.current=null,S){const A=p.currentTarget,I={originalEvent:p,delta:S};ie(S,y.swipeDirection,y.swipeThreshold)?$(st,g,I,{discrete:!0}):$(nt,E,I,{discrete:!0}),A.addEventListener("click",O=>O.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),lt=t=>{const{__scopeToast:r,children:e,...a}=t,n=W(L,r),[s,i]=l.useState(!1),[u,x]=l.useState(!1);return pt(()=>i(!0)),l.useEffect(()=>{const c=window.setTimeout(()=>x(!0),1e3);return()=>window.clearTimeout(c)},[]),u?null:o.ae.jsx(f.u,{asChild:!0,children:o.ae.jsx(f.a,{...a,children:s&&o.ae.jsxs(o.ae.Fragment,{children:[n.label," ",e]})})})},dt="ToastTitle",xe=l.forwardRef((t,r)=>{const{__scopeToast:e,...a}=t;return o.ae.jsx(f.w.div,{...a,ref:r})});xe.displayName=dt;var ut="ToastDescription",ve=l.forwardRef((t,r)=>{const{__scopeToast:e,...a}=t;return o.ae.jsx(f.w.div,{...a,ref:r})});ve.displayName=ut;var we="ToastAction",he=l.forwardRef((t,r)=>{const{altText:e,...a}=t;return e.trim()?o.ae.jsx(Te,{altText:e,asChild:!0,children:o.ae.jsx(ee,{...a,ref:r})}):(console.error(`Invalid prop \`altText\` supplied to \`${we}\`. Expected non-empty \`string\`.`),null)});he.displayName=we;var be="ToastClose",ee=l.forwardRef((t,r)=>{const{__scopeToast:e,...a}=t,n=it(be,e);return o.ae.jsx(Te,{asChild:!0,children:o.ae.jsx(f.w.button,{type:"button",...a,ref:r,onClick:f.j(t.onClick,n.onClose)})})});ee.displayName=be;var Te=l.forwardRef((t,r)=>{const{__scopeToast:e,altText:a,...n}=t;return o.ae.jsx(f.w.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":a||void 0,...n,ref:r})});function Ee(t){const r=[];return Array.from(t.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&r.push(e.textContent),ft(e)){const a=e.ariaHidden||e.hidden||e.style.display==="none",n=e.dataset.radixToastAnnounceExclude==="";if(!a)if(n){const s=e.dataset.radixToastAnnounceAlt;s&&r.push(s)}else r.push(...Ee(e))}}),r}function $(t,r,e,{discrete:a}){const n=e.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});r&&n.addEventListener(t,r,{once:!0}),a?f.N(n,s):n.dispatchEvent(s)}var ie=(t,r,e=0)=>{const a=Math.abs(t.x),n=Math.abs(t.y),s=a>n;return r==="left"||r==="right"?s&&a>e:!s&&n>e};function pt(t=()=>{}){const r=f.c(t);f.E$1(()=>{let e=0,a=0;return e=window.requestAnimationFrame(()=>a=window.requestAnimationFrame(r)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(a)}},[r])}function ft(t){return t.nodeType===t.ELEMENT_NODE}function mt(t){const r=[],e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const n=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||n?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;e.nextNode();)r.push(e.currentNode);return r}function X(t){const r=document.activeElement;return t.some(e=>e===r?!0:(e.focus(),document.activeElement!==r))}var yt=ue,ge=fe,ke=ye,je=xe,_e=ve,Ne=he,Se=ee;const xt=yt,Ce=k.createContext(null),Re=k.forwardRef((t,r)=>{const e=o._.c(9);let a,n;e[0]!==t?({className:a,...n}=t,e[0]=t,e[1]=a,e[2]=n):(a=e[1],n=e[2]);let s;e[3]!==a?(s=o.mo("fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",a),e[3]=a,e[4]=s):s=e[4];let i;return e[5]!==n||e[6]!==r||e[7]!==s?(i=o.ae.jsx(ge,{...n,ref:r,className:s}),e[5]=n,e[6]=r,e[7]=s,e[8]=i):i=e[8],i});Re.displayName=ge.displayName;const vt=o.j("group pointer-events-auto relative shadow-xs bg-primary-white dark:bg-primary-gray-650 flex w-full text-primary-black dark:text-primary-white items-center justify-between flex gap-2 overflow-hidden rounded-sm border border-primary-gray-400 p-2 pr-6 transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full sm:data-[state=open]:slide-in-from-bottom-full",{variants:{variant:{default:"border border-primary-gray-400 dark:border-0",success:"border-t-4 border-accent-dark-green dark:border-b-0 dark:border-l-0 dark:border-r-0",warning:"border-t-4 border-accent-dark-yellow dark:border-b-0 dark:border-l-0 dark:border-r-0",destructive:"border-t-4 border-accent-dark-red dark:border-b-0 dark:border-l-0 dark:border-r-0"}},defaultVariants:{variant:"default"}}),wt=o.j("",{variants:{variant:{default:"text-primary-black dark:text-primary-white",success:"text-accent-dark-green",warning:"text-accent-dark-yellow",destructive:"text-accent-dark-red"}},defaultVariants:{variant:"default"}}),Pe=k.forwardRef((t,r)=>{const e=o._.c(16);let a,n,s;e[0]!==t?({className:a,variant:s,...n}=t,e[0]=t,e[1]=a,e[2]=n,e[3]=s):(a=e[1],n=e[2],s=e[3]);let i;e[4]!==s?(i={variant:s},e[4]=s,e[5]=i):i=e[5];let u;e[6]!==a||e[7]!==s?(u=o.mo(vt({variant:s}),a),e[6]=a,e[7]=s,e[8]=u):u=e[8];let x;e[9]!==n||e[10]!==r||e[11]!==u?(x=o.ae.jsx(ke,{...n,ref:r,className:u}),e[9]=n,e[10]=r,e[11]=u,e[12]=x):x=e[12];let c;return e[13]!==i||e[14]!==x?(c=o.ae.jsx(Ce.Provider,{value:i,children:x}),e[13]=i,e[14]=x,e[15]=c):c=e[15],c});Pe.displayName=ke.displayName;const ht=k.forwardRef((t,r)=>{const e=o._.c(9);let a,n;e[0]!==t?({className:a,...n}=t,e[0]=t,e[1]=a,e[2]=n):(a=e[1],n=e[2]);let s;e[3]!==a?(s=o.mo("inline-flex h-8 shrink-0 items-center text-primary-gray-700 dark:text-primary-gray-100 justify-center rounded-none bg-transparent px-3 text-sm font-medium transition-colors hover:bg-primary-gray-200 dark:hover:bg-primary-gray-600 focus:outline-hidden focus:ring-1 disabled:pointer-events-none disabled:opacity-50",a),e[3]=a,e[4]=s):s=e[4];let i;return e[5]!==n||e[6]!==r||e[7]!==s?(i=o.ae.jsx(Ne,{...n,ref:r,className:s}),e[5]=n,e[6]=r,e[7]=s,e[8]=i):i=e[8],i});ht.displayName=Ne.displayName;const De=k.forwardRef((t,r)=>{const e=o._.c(10);let a,n;e[0]!==t?({className:a,...n}=t,e[0]=t,e[1]=a,e[2]=n):(a=e[1],n=e[2]);let s;e[3]!==a?(s=o.mo("absolute right-1 top-1 rounded-md p-1 text-primary-gray-700/50 dark:text-primary-gray-100/50 opacity-0 transition-opacity hover:text-primary-gray-700 dark:hover:text-primary-gray-100 focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100",a),e[3]=a,e[4]=s):s=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=o.ae.jsx(z.t,{className:"h-4 w-4"}),e[5]=i):i=e[5];let u;return e[6]!==n||e[7]!==r||e[8]!==s?(u=o.ae.jsx(Se,{...n,ref:r,className:s,"toast-close":"",children:i}),e[6]=n,e[7]=r,e[8]=s,e[9]=u):u=e[9],u});De.displayName=Se.displayName;const Ae=k.forwardRef((t,r)=>{const e=o._.c(16);let a,n;e[0]!==t?({className:a,...n}=t,e[0]=t,e[1]=a,e[2]=n):(a=e[1],n=e[2]);const s=k.useContext(Ce);let i;e[3]!==a||e[4]!==s?.variant?(i=o.mo(wt({variant:s?.variant}),"text-lg font-bold [&+div]:text-xs",a),e[3]=a,e[4]=s?.variant,e[5]=i):i=e[5];const u=i;let x;e:switch(s?.variant){case"destructive":{let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=o.ae.jsx(Ye,{className:"h-4 w-4 stroke-accent-dark-red",strokeWidth:2}),e[6]=m):m=e[6],x=m;break e}case"success":{let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=o.ae.jsx(Ue,{className:"h-4 w-4 stroke-accent-dark-green",strokeWidth:2}),e[7]=m):m=e[7],x=m;break e}case"warning":{let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=o.ae.jsx(Ze,{className:"h-4 w-4 stroke-accent-dark-yellow",strokeWidth:2}),e[8]=m):m=e[8],x=m;break e}default:x=null}let c;e[9]!==u||e[10]!==n||e[11]!==r?(c=o.ae.jsx(je,{...n,ref:r,className:u}),e[9]=u,e[10]=n,e[11]=r,e[12]=c):c=e[12];let w;return e[13]!==x||e[14]!==c?(w=o.ae.jsxs("div",{className:"flex gap-x-1 items-center",children:[x,c]}),e[13]=x,e[14]=c,e[15]=w):w=e[15],w});Ae.displayName=je.displayName;const Ie=k.forwardRef((t,r)=>{const e=o._.c(9);let a,n;e[0]!==t?({className:a,...n}=t,e[0]=t,e[1]=a,e[2]=n):(a=e[1],n=e[2]);let s;e[3]!==a?(s=o.mo("text-base opacity-90 dark:text-primary-white",a),e[3]=a,e[4]=s):s=e[4];let i;return e[5]!==n||e[6]!==r||e[7]!==s?(i=o.ae.jsx(_e,{...n,ref:r,className:s}),e[5]=n,e[6]=r,e[7]=s,e[8]=i):i=e[8],i});Ie.displayName=_e.displayName;function bt(){const t=o._.c(5),{toasts:r}=le();let e;t[0]!==r?(e=r.map(Tt),t[0]=r,t[1]=e):e=t[1];let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=o.ae.jsx(Re,{}),t[2]=a):a=t[2];let n;return t[3]!==e?(n=o.ae.jsxs(xt,{children:[e,a]}),t[3]=e,t[4]=n):n=t[4],n}function Tt(t){const{id:r,title:e,description:a,action:n,...s}=t;return k.createElement(Pe,{...s,key:r},o.ae.jsxs("div",{className:"grid gap-1",children:[e&&o.ae.jsx(Ae,{children:e}),a&&o.ae.jsx(Ie,{children:a})]}),n,o.ae.jsx(De,{}))}function Et(t){const r=o.compilerRuntimeExports.c(12),{text:e,successMessage:a,buttonText:n,buttonSmall:s,className:i}=t,u=a===void 0?"Text copied":a,x=s===void 0?!1:s,c=i===void 0?"":i,{toast:w}=le(),m=`${x?"p-2":"py-4 px-6"} ${c}`;let E;r[0]!==u||r[1]!==e||r[2]!==w?(E=()=>{navigator.clipboard.writeText(e),w({variant:"success",description:u,duration:1e3})},r[0]=u,r[1]=e,r[2]=w,r[3]=E):E=r[3];let g;r[4]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsxRuntimeExports.jsx(se.Copy,{}),r[4]=g):g=r[4];const j=n||null;let y;r[5]!==m||r[6]!==E||r[7]!==j?(y=o.jsxRuntimeExports.jsxs(se.u,{variant:"tertiary",className:m,onClick:E,"aria-label":"Click to copy the text",children:[g,j]}),r[5]=m,r[6]=E,r[7]=j,r[8]=y):y=r[8];let d;r[9]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsxRuntimeExports.jsx(bt,{}),r[9]=d):d=r[9];let h;return r[10]!==y?(h=o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[y,d]}),r[10]=y,r[11]=h):h=r[11],h}exports.CopyTextButton=Et;
|
|
2
2
|
//# sourceMappingURL=CopyTextButton.cjs.map
|