@undp/data-viz 2.3.10 → 2.3.11
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.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.js +18 -18
- 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.js +12 -12
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.js +18 -18
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.js +15 -15
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.js +12 -12
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +4 -4
- package/dist/ColorLegend.js +2 -2
- 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.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.js +15 -15
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.js +10 -10
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.js +13 -13
- 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.js +12 -12
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.js +18 -18
- package/dist/{EmptyState-dScPFkLy.js → EmptyState-D807L58h.js} +4 -4
- package/dist/{EmptyState-dScPFkLy.js.map → EmptyState-D807L58h.js.map} +1 -1
- package/dist/ExcelDownloadButton.js +2 -2
- package/dist/FootNote.js +2 -2
- package/dist/GeoHubCompareMaps.js +3 -3
- package/dist/GeoHubMap.js +4 -4
- 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.js +2 -2
- package/dist/{GraphEl-Bw-9MUym.js → GraphEl-CT3xPv2P.js} +5 -5
- package/dist/{GraphEl-Bw-9MUym.js.map → GraphEl-CT3xPv2P.js.map} +1 -1
- package/dist/{GraphEl-DjElfY07.cjs → GraphEl-DvwOOhF1.cjs} +2 -2
- package/dist/{GraphEl-DjElfY07.cjs.map → GraphEl-DvwOOhF1.cjs.map} +1 -1
- package/dist/GraphFooter.js +2 -2
- package/dist/GraphHeader.js +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 +15 -15
- package/dist/ImageDownloadButton.js +2 -2
- package/dist/LineChartWithConfidenceInterval.js +15 -15
- 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.js +15 -15
- 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.js +20 -20
- package/dist/ScrollStory.js +3 -3
- 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.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-Cu9OHOBj.js → Source-eILIr4Ov.js} +5 -5
- package/dist/{Source-Cu9OHOBj.js.map → Source-eILIr4Ov.js.map} +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.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.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-CdMGooqp.js → Typography-HicNIA61.js} +2 -2
- package/dist/{Typography-CdMGooqp.js.map → Typography-HicNIA61.js.map} +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-B5ggV1vg.js} +9 -9
- package/dist/{index-BzNfurbO.js.map → index-B5ggV1vg.js.map} +1 -1
- package/dist/{index-CXobQn-E.cjs → index-BDR7MlMo.cjs} +2 -2
- package/dist/{index-CXobQn-E.cjs.map → index-BDR7MlMo.cjs.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.cjs +1 -1
- 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/index-Cw8sCyo_-CEcCMKUi.cjs +0 -2
- package/dist/index-Cw8sCyo_-CEcCMKUi.cjs.map +0 -1
package/dist/ButterflyChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-6v2a2njQ.cjs"),V=require("react"),pe=require("./getSliderMarks-CIuSoedo.cjs"),fe=require("./parse-xYI9yrvL.cjs"),ge=require("./index-DQA8q5sC.cjs"),ye=require("./numberFormattingFunction-02t-wJta.cjs"),Be=require("./Tooltip-BLa2EfMs.cjs"),be=require("./XTicksAndGridLines-CekrPykD.cjs"),ve=require("./Axis-Jt_tmhxS.cjs"),Le=require("./YAxesLabels-BQ2aCazV.cjs"),je=require("./ReferenceLine-M9aP3dj-.cjs"),Ce=require("./DetailsModal-DHttOA80.cjs"),ke=require("./band-VYfcZeJ2.cjs"),we=require("./linear-CgUCbw9F.cjs"),Nt=require("./proxy-C4-uo6nS.cjs"),Me=require("./use-in-view-C3o_ntMv.cjs"),de=require("./index-CoobIWNj.cjs"),Ve=require("./GraphFooter.cjs"),$e=require("./GraphHeader.cjs"),Oe=require("./ColorLegend.cjs"),Ae=require("./Colors.cjs"),Ne=require("./EmptyState-N1eHt3vq.cjs"),Re=require("./index-sbKVyHS2.cjs"),he=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Se=require("./ensureCompleteData-D9bQTiVS.cjs"),Ee=require("./GraphContainer-B1EDxJ0S.cjs");function De(s){const t=i.compilerRuntimeExports.c(141),{data:a,width:E,height:v,barColors:m,centerGap:j,refValues:h,maxValue:xt,minValue:Rt,showValues:mt,axisTitles:dt,rightMargin:Jt,leftMargin:Kt,topMargin:Y,bottomMargin:Qt,tooltip:St,onSeriesMouseOver:ht,barPadding:Dt,truncateBy:Et,onSeriesMouseClick:$,showTicks:Bt,suffix:pt,prefix:ft,resetSelectionOnDoubleClick:Lt,detailsOnClick:S,styles:r,classNames:n,noOfTicks:B,animate:x,precision:gt,customLayers:D,minValueLeftBar:q,minValueRightBar:T,naLabel:qt,hideAxisLine:Tt}=s,le=V.useRef(null);let Ct;t[0]!==x.amount||t[1]!==x.once?(Ct={once:x.once,amount:x.amount},t[0]=x.amount,t[1]=x.once,t[2]=Ct):Ct=t[2];const O=Me.useInView(le,Ct),[Ft,U]=V.useState(void 0),[F,yt]=V.useState(void 0),[d,l]=V.useState(void 0),[It,bt]=V.useState(void 0);let Gt;t[3]!==Qt||t[4]!==Kt||t[5]!==Jt||t[6]!==Y?(Gt={top:Y,bottom:Qt,left:Kt,right:Jt},t[3]=Qt,t[4]=Kt,t[5]=Jt,t[6]=Y,t[7]=Gt):Gt=t[7];const u=Gt,L=E-u.left-u.right,C=v-u.top-u.bottom;let vt,I,k,W,z,J,K,Q,M,w,Z,_,tt,et;if(t[8]!==x||t[9]!==m[0]||t[10]!==m[1]||t[11]!==Dt||t[12]!==j||t[13]!==n?.graphObjectValues||t[14]!==n?.xAxis?.gridLines||t[15]!==n?.xAxis?.labels||t[16]!==n?.yAxis?.axis||t[17]!==n?.yAxis?.labels||t[18]!==D||t[19]!==a||t[20]!==S||t[21]!==C||t[22]!==L||t[23]!==v||t[24]!==Tt||t[25]!==O||t[26]!==u.bottom||t[27]!==u.left||t[28]!==u.top||t[29]!==xt||t[30]!==Rt||t[31]!==q||t[32]!==T||t[33]!==F||t[34]!==qt||t[35]!==B||t[36]!==$||t[37]!==ht||t[38]!==gt||t[39]!==ft||t[40]!==h||t[41]!==Lt||t[42]!==Bt||t[43]!==mt||t[44]!==r?.graphObjectValues||t[45]!==r?.xAxis?.gridLines||t[46]!==r?.xAxis?.labels||t[47]!==r?.yAxis?.axis||t[48]!==r?.yAxis?.labels||t[49]!==pt||t[50]!==Y||t[51]!==Et||t[52]!==E){const Zt=a.map(Ue),A=ke.band().domain(Zt.map(Ye)).range([C,0]).paddingInner(Dt),p=we.linear().domain([Rt,xt]).range([0,(L-j)/2]).nice(),N=p.ticks(B),f=we.linear().domain([Rt,xt]).range([(L-j)/2,0]).nice(),Vt=f.ticks(B);k=Nt.motion.svg,tt=`${E}px`,et=`${v}px`,W=`0 0 ${E} ${v}`,z="ltr",J=le,M=`translate(${u.left},${u.top})`,t[67]!==D?(w=D.filter(He).map(Xe),t[67]=D,t[68]=w):w=t[68];const c=n?.yAxis?.axis;let R;t[69]!==c?(R={axis:c},t[69]=c,t[70]=R):R=t[70];const Wt=r?.yAxis?.axis;let $t;t[71]!==Wt?($t={axis:Wt},t[71]=Wt,t[72]=$t):$t=t[72],Z=i.jsxRuntimeExports.jsxs("g",{transform:"translate(0,0)",children:[Bt?i.jsxRuntimeExports.jsx(be.XTicksAndGridLines,{values:Vt.filter(Pe),x:Vt.filter(Ge).map(e=>f(e)),y1:0-Y,y2:C+u.bottom,styles:{gridLines:r?.xAxis?.gridLines,labels:r?.xAxis?.labels},classNames:{gridLines:n?.xAxis?.gridLines,labels:n?.xAxis?.labels},suffix:pt,prefix:ft,labelType:"secondary",showGridLines:!0,leftLabel:!0,precision:gt}):null,i.jsxRuntimeExports.jsxs(de.AnimatePresence,{children:[Zt.map((e,y)=>i.jsxRuntimeExports.jsxs(Nt.motion.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:b=>{U(e),bt(b.clientY),l(b.clientX),ht?.(e)},onClick:()=>{($||S)&&(ge.isEqual(F,e)&&Lt?(yt(void 0),$?.(void 0)):(yt(e),$?.(e)))},onMouseMove:b=>{U(e),bt(b.clientY),l(b.clientX)},onMouseLeave:()=>{U(void 0),l(void 0),bt(void 0),ht?.(void 0)},children:[e.leftBar?i.jsxRuntimeExports.jsx(Nt.motion.rect,{y:A(`${y}`),style:{fill:m[0]},height:A.bandwidth(),variants:{initial:{x:f(0),width:0},whileInView:{x:e.leftBar<0?f(0):f(e.leftBar),width:e.leftBar<0?f(e.leftBar)-f(0):f(0)-f(e.leftBar),transition:{duration:x.duration}}},initial:"initial",animate:O?"whileInView":"initial",exit:{x:f(0),width:0,transition:{duration:x.duration}}}):null,mt?i.jsxRuntimeExports.jsx(Nt.motion.text,{y:A(`${y}`)+A.bandwidth()/2,style:{textAnchor:e.rightBar&&e.rightBar>0?"end":"start",...r?.graphObjectValues||{}},dx:e.rightBar&&e.rightBar>0?-5:5,dy:"0.33em",className:i.mo("graph-value text-sm",n?.graphObjectValues),exit:{opacity:0,transition:{duration:x.duration}},variants:{initial:{x:f(0),opacity:0,fill:m[0]},whileInView:{x:e.leftBar?f(e.leftBar):f(q<0?0:q),opacity:1,fill:m[0],transition:{duration:x.duration}}},initial:"initial",animate:O?"whileInView":"initial",children:ye.numberFormattingFunction(e.rightBar,qt,gt,ft,pt)}):null]},e.label)),i.jsxRuntimeExports.jsx(ve.Axis,{hideAxisLine:Tt,y1:-2.5,y2:C+u.bottom,x1:f(q<0?0:q),x2:f(q<0?0:q),classNames:R,styles:$t}),h?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:h.map((e,y)=>i.jsxRuntimeExports.jsx(je.RefLineX,{text:e.text,color:e.color,x:f(e.value),y1:0-u.top,y2:C+u.bottom,textSide:"left",classNames:e.classNames,styles:e.styles,animate:x,isInView:O},y))}):null]})]});const _t=n?.yAxis?.axis;let wt;t[73]!==_t?(wt={axis:_t},t[73]=_t,t[74]=wt):wt=t[74];const Ot=r?.yAxis?.axis;let At;t[75]!==Ot?(At={axis:Ot},t[75]=Ot,t[76]=At):At=t[76],_=i.jsxRuntimeExports.jsxs("g",{transform:`translate(${(L+j)/2},0)`,children:[Bt?i.jsxRuntimeExports.jsx(be.XTicksAndGridLines,{values:N.filter(Ie),x:N.filter(Fe).map(e=>p(e)),y1:0-Y,y2:C+u.bottom,styles:{gridLines:r?.xAxis?.gridLines,labels:r?.xAxis?.labels},classNames:{gridLines:n?.xAxis?.gridLines,labels:n?.xAxis?.labels},suffix:pt,prefix:ft,labelType:"secondary",showGridLines:!0,precision:gt}):null,i.jsxRuntimeExports.jsxs(de.AnimatePresence,{children:[Zt.map((e,y)=>i.jsxRuntimeExports.jsxs(Nt.motion.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:b=>{U(e),bt(b.clientY),l(b.clientX),ht?.(e)},onClick:()=>{($||S)&&(ge.isEqual(F,e)&&Lt?(yt(void 0),$?.(void 0)):(yt(e),$?.(e)))},onMouseMove:b=>{U(e),bt(b.clientY),l(b.clientX)},onMouseLeave:()=>{U(void 0),l(void 0),bt(void 0),ht?.(void 0)},children:[e.rightBar?i.jsxRuntimeExports.jsx(Nt.motion.rect,{y:A(`${y}`),style:{fill:m[1]},height:A.bandwidth(),exit:{x:p(0),width:0,transition:{duration:x.duration}},variants:{initial:{x:p(0),width:0},whileInView:{x:e.rightBar>=0?p(0):p(e.rightBar),width:e.rightBar>=0?p(e.rightBar)-p(0):p(0)-p(e.rightBar),transition:{duration:x.duration}}},initial:"initial",animate:O?"whileInView":"initial"}):null,mt?i.jsxRuntimeExports.jsx(Nt.motion.text,{y:A(`${y}`)+A.bandwidth()/2,style:{textAnchor:e.rightBar&&e.rightBar<0?"end":"start",...r?.graphObjectValues||{}},className:i.mo("graph-value text-sm",n?.graphObjectValues),dx:e.rightBar&&e.rightBar<0?-5:5,dy:"0.33em",exit:{opacity:0,transition:{duration:x.duration}},variants:{initial:{x:p(0),opacity:0,fill:m[1]},whileInView:{x:e.rightBar?p(e.rightBar):p(T<0?0:T),opacity:1,fill:m[1],transition:{duration:x.duration}}},initial:"initial",animate:O?"whileInView":"initial",children:ye.numberFormattingFunction(e.rightBar,qt,gt,ft,pt)}):null]},y)),i.jsxRuntimeExports.jsx(ve.Axis,{hideAxisLine:Tt,y1:-2.5,y2:C+u.bottom,x1:p(T<0?0:T),x2:p(T<0?0:T),classNames:wt,styles:At}),h?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:h.map((e,y)=>i.jsxRuntimeExports.jsx(je.RefLineX,{text:e.text,color:e.color,x:p(e.value),y1:0-u.top,y2:C+u.bottom,textSide:"right",classNames:e.classNames,styles:e.styles,animate:x,isInView:O},y))}):null]})]}),I=de.AnimatePresence,vt=Nt.motion.g,K=`translate(${L/2},0)`,Q=Zt.map((e,y)=>i.jsxRuntimeExports.jsx(Le.YAxesLabels,{value:`${e.label}`.length<Et?`${e.label}`:`${`${e.label}`.substring(0,Et)}...`,y:A(`${e.id}`),x:0-j/2,width:j,height:A.bandwidth(),alignment:"center",style:r?.yAxis?.labels,className:n?.yAxis?.labels,animate:x,isInView:O},y)),t[8]=x,t[9]=m[0],t[10]=m[1],t[11]=Dt,t[12]=j,t[13]=n?.graphObjectValues,t[14]=n?.xAxis?.gridLines,t[15]=n?.xAxis?.labels,t[16]=n?.yAxis?.axis,t[17]=n?.yAxis?.labels,t[18]=D,t[19]=a,t[20]=S,t[21]=C,t[22]=L,t[23]=v,t[24]=Tt,t[25]=O,t[26]=u.bottom,t[27]=u.left,t[28]=u.top,t[29]=xt,t[30]=Rt,t[31]=q,t[32]=T,t[33]=F,t[34]=qt,t[35]=B,t[36]=$,t[37]=ht,t[38]=gt,t[39]=ft,t[40]=h,t[41]=Lt,t[42]=Bt,t[43]=mt,t[44]=r?.graphObjectValues,t[45]=r?.xAxis?.gridLines,t[46]=r?.xAxis?.labels,t[47]=r?.yAxis?.axis,t[48]=r?.yAxis?.labels,t[49]=pt,t[50]=Y,t[51]=Et,t[52]=E,t[53]=vt,t[54]=I,t[55]=k,t[56]=W,t[57]=z,t[58]=J,t[59]=K,t[60]=Q,t[61]=M,t[62]=w,t[63]=Z,t[64]=_,t[65]=tt,t[66]=et}else vt=t[53],I=t[54],k=t[55],W=t[56],z=t[57],J=t[58],K=t[59],Q=t[60],M=t[61],w=t[62],Z=t[63],_=t[64],tt=t[65],et=t[66];let G;t[77]!==vt||t[78]!==K||t[79]!==Q?(G=i.jsxRuntimeExports.jsx(vt,{transform:K,children:Q}),t[77]=vt,t[78]=K,t[79]=Q,t[80]=G):G=t[80];let it;t[81]!==I||t[82]!==G?(it=i.jsxRuntimeExports.jsx(I,{children:G}),t[81]=I,t[82]=G,t[83]=it):it=t[83];const Pt=`translate(0,${C})`,Xt=r?.yAxis?.title;let st;t[84]!==m[0]||t[85]!==Xt?(st={fill:m[0],textAnchor:"end",...Xt},t[84]=m[0],t[85]=Xt,t[86]=st):st=t[86];const Ht=n?.yAxis?.title;let P;t[87]!==Ht?(P=i.mo("text-base",Ht),t[87]=Ht,t[88]=P):P=t[88];const kt=L/2-j/2;let nt;t[89]!==dt[0]||t[90]!==st||t[91]!==P||t[92]!==kt?(nt=i.jsxRuntimeExports.jsx("text",{style:st,className:P,x:kt,y:0,dx:-5,dy:20,children:dt[0]}),t[89]=dt[0],t[90]=st,t[91]=P,t[92]=kt,t[93]=nt):nt=t[93];const Yt=r?.yAxis?.title;let ot;t[94]!==m[1]||t[95]!==Yt?(ot={fill:m[1],textAnchor:"start",...Yt},t[94]=m[1],t[95]=Yt,t[96]=ot):ot=t[96];const Ut=n?.yAxis?.title;let at;t[97]!==Ut?(at=i.mo("text-base",Ut),t[97]=Ut,t[98]=at):at=t[98];const Mt=L/2+j/2;let rt;t[99]!==dt[1]||t[100]!==ot||t[101]!==at||t[102]!==Mt?(rt=i.jsxRuntimeExports.jsx("text",{style:ot,className:at,x:Mt,y:0,dx:5,dy:20,children:dt[1]}),t[99]=dt[1],t[100]=ot,t[101]=at,t[102]=Mt,t[103]=rt):rt=t[103];let X;t[104]!==Pt||t[105]!==nt||t[106]!==rt?(X=i.jsxRuntimeExports.jsxs("g",{transform:Pt,children:[nt,rt]}),t[104]=Pt,t[105]=nt,t[106]=rt,t[107]=X):X=t[107];let lt;t[108]!==D?(lt=D.filter(Te).map(qe),t[108]=D,t[109]=lt):lt=t[109];let H;t[110]!==it||t[111]!==X||t[112]!==lt||t[113]!==M||t[114]!==w||t[115]!==Z||t[116]!==_?(H=i.jsxRuntimeExports.jsxs("g",{transform:M,children:[w,Z,_,it,X,lt]}),t[110]=it,t[111]=X,t[112]=lt,t[113]=M,t[114]=w,t[115]=Z,t[116]=_,t[117]=H):H=t[117];let o;t[118]!==k||t[119]!==W||t[120]!==z||t[121]!==J||t[122]!==H||t[123]!==tt||t[124]!==et?(o=i.jsxRuntimeExports.jsx(k,{width:tt,height:et,viewBox:W,direction:z,ref:J,children:H}),t[118]=k,t[119]=W,t[120]=z,t[121]=J,t[122]=H,t[123]=tt,t[124]=et,t[125]=o):o=t[125];let ct;t[126]!==n?.tooltip||t[127]!==d||t[128]!==It||t[129]!==Ft||t[130]!==r?.tooltip||t[131]!==St?(ct=Ft&&St&&d&&It?i.jsxRuntimeExports.jsx(Be.Tooltip,{data:Ft,body:St,xPos:d,yPos:It,backgroundStyle:r?.tooltip,className:n?.tooltip}):null,t[126]=n?.tooltip,t[127]=d,t[128]=It,t[129]=Ft,t[130]=r?.tooltip,t[131]=St,t[132]=ct):ct=t[132];let ut;t[133]!==n?.modal||t[134]!==S||t[135]!==F?(ut=S&&F!==void 0?i.jsxRuntimeExports.jsx(Ce.DetailsModal,{body:S,data:F,setData:yt,className:n?.modal}):null,t[133]=n?.modal,t[134]=S,t[135]=F,t[136]=ut):ut=t[136];let jt;return t[137]!==o||t[138]!==ct||t[139]!==ut?(jt=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[o,ct,ut]}),t[137]=o,t[138]=ct,t[139]=ut,t[140]=jt):jt=t[140],jt}function qe(s){return s.layer}function Te(s){return s.position==="after"}function Fe(s){return s!==0}function Ie(s){return s!==0}function Ge(s){return s!==0}function Pe(s){return s!==0}function Xe(s){return s.layer}function He(s){return s.position==="before"}function Ye(s){return`${s.id}`}function Ue(s,t){return{...s,id:`${t}`}}function re(s,t,a,E){const v=s.map(h=>h[t]).filter(h=>!he.checkIfNullOrUndefined(h)),m=he.checkIfNullOrUndefined(a)?Math.min(...v)>=0?0:Math.min(...v):a,j=he.checkIfNullOrUndefined(E)?Math.max(...v)<0?0:Math.max(...v):E;return{min:m,max:j}}function We(s){const t=i.compilerRuntimeExports.c(119),{data:a,graphTitle:E,sources:v,graphDescription:m,height:j,width:h,footNote:xt,padding:Rt,barColors:mt,backgroundColor:dt,leftMargin:Jt,rightMargin:Kt,topMargin:Y,bottomMargin:Qt,rightBarTitle:St,leftBarTitle:ht,tooltip:Dt,relativeHeight:Et,onSeriesMouseOver:$,graphID:Bt,barPadding:pt,truncateBy:ft,onSeriesMouseClick:Lt,centerGap:S,showValues:r,maxValue:n,minValue:B,refValues:x,suffix:gt,prefix:D,showTicks:q,showColorScale:T,graphDownload:qt,dataDownload:Tt,language:le,colorLegendTitle:Ct,minHeight:O,theme:Ft,ariaLabel:U,resetSelectionOnDoubleClick:F,detailsOnClick:yt,styles:d,classNames:l,noOfTicks:It,animate:bt,precision:Gt,customLayers:u,timeline:L,naLabel:C,hideAxisLine:vt}=s;let I;t[0]!==mt?(I=mt===void 0?[Ae.Colors.light.categoricalColors.colors[0],Ae.Colors.light.categoricalColors.colors[1]]:mt,t[0]=mt,t[1]=I):I=t[1];const k=I,W=dt===void 0?!1:dt,z=Jt===void 0?20:Jt,J=Kt===void 0?20:Kt,K=Y===void 0?25:Y,Q=Qt===void 0?30:Qt,M=St===void 0?"Right bar graph":St,w=ht===void 0?"Left bar graph":ht,Z=pt===void 0?.25:pt,_=ft===void 0?999:ft,tt=S===void 0?100:S,et=r===void 0?!0:r;let G;t[2]!==x?(G=x===void 0?[]:x,t[2]=x,t[3]=G):G=t[3];const it=G,Pt=gt===void 0?"":gt,Xt=D===void 0?"":D,st=q===void 0?!0:q,Ht=T===void 0?!1:T,P=qt===void 0?!1:qt,kt=Tt===void 0?!1:Tt,nt=le===void 0?"en":le,Yt=O===void 0?0:O,ot=Ft===void 0?"light":Ft,Ut=F===void 0?!0:F,at=It===void 0?5:It,Mt=bt===void 0?!1:bt,rt=Gt===void 0?2:Gt;let X;t[4]!==u?(X=u===void 0?[]:u,t[4]=u,t[5]=X):X=t[5];const lt=X;let H;t[6]!==L?(H=L===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:L,t[6]=L,t[7]=H):H=t[7];const o=H,ct=C===void 0?"NA":C,ut=vt===void 0?!1:vt,[jt,Zt]=V.useState(0),[A,p]=V.useState(0),[N,f]=V.useState(o.autoplay);let Vt;if(t[8]!==a||t[9]!==o.dateFormat){let g;t[11]!==o.dateFormat?(g=zt=>fe.parse(`${zt.date}`,o.dateFormat||"yyyy",new Date).getTime(),t[11]=o.dateFormat,t[12]=g):g=t[12],Vt=[...new Set(a.filter(ti).map(g))],Vt.sort(_e),t[8]=a,t[9]=o.dateFormat,t[10]=Vt}else Vt=t[10];const c=Vt,[R,Wt]=V.useState(o.autoplay?0:c.length-1),$t=V.useRef(null),_t=V.useRef(null);let wt,Ot;t[13]===Symbol.for("react.memo_cache_sentinel")?(wt=()=>{const g=new ResizeObserver(zt=>{Zt(zt[0].target.clientWidth||620),p(zt[0].target.clientHeight||480)});return $t.current&&g.observe($t.current),()=>g.disconnect()},Ot=[],t[13]=wt,t[14]=Ot):(wt=t[13],Ot=t[14]),V.useEffect(wt,Ot);let At,e;t[15]!==N||t[16]!==o.speed||t[17]!==c?(At=()=>{const g=setInterval(()=>{Wt(zt=>zt<c.length-1?zt+1:0)},(o.speed||2)*1e3);return N||clearInterval(g),()=>clearInterval(g)},e=[c,N,o.speed],t[15]=N,t[16]=o.speed,t[17]=c,t[18]=At,t[19]=e):(At=t[18],e=t[19]),V.useEffect(At,e);const y=o.dateFormat||"yyyy";let b;t[20]!==R||t[21]!==y||t[22]!==o.showOnlyActiveDate||t[23]!==c?(b=pe.getSliderMarks(c,R,o.showOnlyActiveDate,y),t[20]=R,t[21]=y,t[22]=o.showOnlyActiveDate,t[23]=c,t[24]=b):b=t[24];const ce=b,xe=l?.graphContainer,me=d?.graphContainer;let te;t[25]!==l?.description||t[26]!==l?.title||t[27]!==a||t[28]!==kt||t[29]!==m||t[30]!==P||t[31]!==E||t[32]!==d?.description||t[33]!==d?.title||t[34]!==h?(te=E||m||P||kt?i.jsxRuntimeExports.jsx($e.GraphHeader,{styles:{title:d?.title,description:d?.description},classNames:{title:l?.title,description:l?.description},graphTitle:E,graphDescription:m,width:h,graphDownload:P?_t:void 0,dataDownload:kt?a.map(Ze).filter(Qe).length>0?a.map(Ke).filter(Je):a.filter(ze):null}):null,t[25]=l?.description,t[26]=l?.title,t[27]=a,t[28]=kt,t[29]=m,t[30]=P,t[31]=E,t[32]=d?.description,t[33]=d?.title,t[34]=h,t[35]=te):te=t[35];let ee;t[36]!==R||t[37]!==ce||t[38]!==N||t[39]!==o.enabled||t[40]!==c?(ee=o.enabled&&c.length>0&&ce?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{f(!N)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":N?"Click to pause animation":"Click to play animation",children:N?i.jsxRuntimeExports.jsx(Re.Pause,{}):i.jsxRuntimeExports.jsx(Re.Play,{})}),i.jsxRuntimeExports.jsx(pe.Nr,{min:c[0],max:c[c.length-1],marks:ce,step:null,defaultValue:c[c.length-1],value:c[R],onChangeComplete:g=>{Wt(c.indexOf(g))},onChange:g=>{Wt(c.indexOf(g))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,t[36]=R,t[37]=ce,t[38]=N,t[39]=o.enabled,t[40]=c,t[41]=ee):ee=t[41];let ie;t[42]!==k||t[43]!==l?.colorLegend||t[44]!==Ct||t[45]!==a.length||t[46]!==w||t[47]!==M||t[48]!==Ht?(ie=Ht&&a.length>0?i.jsxRuntimeExports.jsx(Oe.ColorLegend,{colorLegendTitle:Ct,colorDomain:[w,M],colors:k,showNAColor:!1,className:l?.colorLegend}):null,t[42]=k,t[43]=l?.colorLegend,t[44]=Ct,t[45]=a.length,t[46]=w,t[47]=M,t[48]=Ht,t[49]=ie):ie=t[49];let se;t[50]!==a.length?(se=a.length===0&&i.jsxRuntimeExports.jsx(Ne.EmptyState,{}),t[50]=a.length,t[51]=se):se=t[51];let ne;t[52]!==Mt||t[53]!==k||t[54]!==Z||t[55]!==Q||t[56]!==tt||t[57]!==l||t[58]!==lt||t[59]!==a||t[60]!==yt||t[61]!==ut||t[62]!==R||t[63]!==w||t[64]!==z||t[65]!==n||t[66]!==B||t[67]!==ct||t[68]!==at||t[69]!==Lt||t[70]!==$||t[71]!==rt||t[72]!==Xt||t[73]!==it||t[74]!==Ut||t[75]!==M||t[76]!==J||t[77]!==st||t[78]!==et||t[79]!==d||t[80]!==Pt||t[81]!==A||t[82]!==jt||t[83]!==o.dateFormat||t[84]!==o.enabled||t[85]!==Dt||t[86]!==K||t[87]!==_||t[88]!==c?(ne=jt&&A&&a.length>0?i.jsxRuntimeExports.jsx(De,{hideAxisLine:ut,data:Se.ensureCompleteDataForButterFlyChart(a,o.dateFormat||"yyyy").filter(g=>o.enabled?g.date===fe.format(new Date(c[R]),o.dateFormat||"yyyy"):g),barColors:k,width:jt,centerGap:tt,height:A,truncateBy:_,leftMargin:z,rightMargin:J,topMargin:K,bottomMargin:Q,axisTitles:[w,M],tooltip:Dt,onSeriesMouseOver:$,barPadding:Z,refValues:it,maxValue:Math.max(re(a,"leftBar",B,n).max,re(a,"rightBar",B,n).max),minValue:Math.min(re(a,"leftBar",B,n).min,re(a,"rightBar",B,n).min),minValueLeftBar:re(a,"leftBar",B,n).min,minValueRightBar:re(a,"rightBar",B,n).min,showValues:et,onSeriesMouseClick:Lt,showTicks:st,suffix:Pt,prefix:Xt,resetSelectionOnDoubleClick:Ut,detailsOnClick:yt,styles:d,classNames:l,noOfTicks:at,animate:Mt===!0?{duration:.5,once:!0,amount:.5}:Mt||{duration:0,once:!0,amount:0},precision:rt,customLayers:lt,naLabel:ct}):null,t[52]=Mt,t[53]=k,t[54]=Z,t[55]=Q,t[56]=tt,t[57]=l,t[58]=lt,t[59]=a,t[60]=yt,t[61]=ut,t[62]=R,t[63]=w,t[64]=z,t[65]=n,t[66]=B,t[67]=ct,t[68]=at,t[69]=Lt,t[70]=$,t[71]=rt,t[72]=Xt,t[73]=it,t[74]=Ut,t[75]=M,t[76]=J,t[77]=st,t[78]=et,t[79]=d,t[80]=Pt,t[81]=A,t[82]=jt,t[83]=o.dateFormat,t[84]=o.enabled,t[85]=Dt,t[86]=K,t[87]=_,t[88]=c,t[89]=ne):ne=t[89];let oe;t[90]!==se||t[91]!==ne?(oe=i.jsxRuntimeExports.jsxs(Ee.GraphArea,{ref:$t,children:[se,ne]}),t[90]=se,t[91]=ne,t[92]=oe):oe=t[92];let ae;t[93]!==l?.footnote||t[94]!==l?.source||t[95]!==xt||t[96]!==v||t[97]!==d?.footnote||t[98]!==d?.source||t[99]!==h?(ae=v||xt?i.jsxRuntimeExports.jsx(Ve.GraphFooter,{styles:{footnote:d?.footnote,source:d?.source},classNames:{footnote:l?.footnote,source:l?.source},sources:v,footNote:xt,width:h}):null,t[93]=l?.footnote,t[94]=l?.source,t[95]=xt,t[96]=v,t[97]=d?.footnote,t[98]=d?.source,t[99]=h,t[100]=ae):ae=t[100];let ue;return t[101]!==U||t[102]!==W||t[103]!==Bt||t[104]!==j||t[105]!==nt||t[106]!==Yt||t[107]!==Rt||t[108]!==Et||t[109]!==xe||t[110]!==me||t[111]!==te||t[112]!==ee||t[113]!==ie||t[114]!==oe||t[115]!==ae||t[116]!==ot||t[117]!==h?(ue=i.jsxRuntimeExports.jsxs(Ee.GraphContainer,{className:xe,style:me,id:Bt,ref:_t,"aria-label":U,backgroundColor:W,theme:ot,language:nt,minHeight:Yt,width:h,height:j,relativeHeight:Et,padding:Rt,children:[te,ee,ie,oe,ae]}),t[101]=U,t[102]=W,t[103]=Bt,t[104]=j,t[105]=nt,t[106]=Yt,t[107]=Rt,t[108]=Et,t[109]=xe,t[110]=me,t[111]=te,t[112]=ee,t[113]=ie,t[114]=oe,t[115]=ae,t[116]=ot,t[117]=h,t[118]=ue):ue=t[118],ue}function ze(s){return s!==void 0}function Je(s){return s!==void 0}function Ke(s){return s.data}function Qe(s){return s!==void 0}function Ze(s){return s.data}function _e(s,t){return s-t}function ti(s){return s.date}exports.ButterflyChart=We;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-6v2a2njQ.cjs"),V=require("react"),pe=require("./getSliderMarks-CIuSoedo.cjs"),fe=require("./parse-xYI9yrvL.cjs"),ge=require("./index-DQA8q5sC.cjs"),ye=require("./numberFormattingFunction-02t-wJta.cjs"),Be=require("./Tooltip-BLa2EfMs.cjs"),be=require("./XTicksAndGridLines-CekrPykD.cjs"),ve=require("./Axis-Jt_tmhxS.cjs"),Le=require("./YAxesLabels-BQ2aCazV.cjs"),je=require("./ReferenceLine-M9aP3dj-.cjs"),Ce=require("./DetailsModal-DIRTulvr.cjs"),ke=require("./band-VYfcZeJ2.cjs"),we=require("./linear-CgUCbw9F.cjs"),Nt=require("./proxy-C4-uo6nS.cjs"),Me=require("./use-in-view-C3o_ntMv.cjs"),de=require("./index-CoobIWNj.cjs"),Ve=require("./GraphFooter.cjs"),$e=require("./GraphHeader.cjs"),Oe=require("./ColorLegend.cjs"),Ae=require("./Colors.cjs"),Ne=require("./EmptyState-N1eHt3vq.cjs"),Re=require("./index-sbKVyHS2.cjs"),he=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Se=require("./ensureCompleteData-D9bQTiVS.cjs"),Ee=require("./GraphContainer-B1EDxJ0S.cjs");function De(s){const t=i.compilerRuntimeExports.c(141),{data:a,width:E,height:v,barColors:m,centerGap:j,refValues:h,maxValue:xt,minValue:Rt,showValues:mt,axisTitles:dt,rightMargin:Jt,leftMargin:Kt,topMargin:Y,bottomMargin:Qt,tooltip:St,onSeriesMouseOver:ht,barPadding:Dt,truncateBy:Et,onSeriesMouseClick:$,showTicks:Bt,suffix:pt,prefix:ft,resetSelectionOnDoubleClick:Lt,detailsOnClick:S,styles:r,classNames:n,noOfTicks:B,animate:x,precision:gt,customLayers:D,minValueLeftBar:q,minValueRightBar:T,naLabel:qt,hideAxisLine:Tt}=s,le=V.useRef(null);let Ct;t[0]!==x.amount||t[1]!==x.once?(Ct={once:x.once,amount:x.amount},t[0]=x.amount,t[1]=x.once,t[2]=Ct):Ct=t[2];const O=Me.useInView(le,Ct),[Ft,U]=V.useState(void 0),[F,yt]=V.useState(void 0),[d,l]=V.useState(void 0),[It,bt]=V.useState(void 0);let Gt;t[3]!==Qt||t[4]!==Kt||t[5]!==Jt||t[6]!==Y?(Gt={top:Y,bottom:Qt,left:Kt,right:Jt},t[3]=Qt,t[4]=Kt,t[5]=Jt,t[6]=Y,t[7]=Gt):Gt=t[7];const u=Gt,L=E-u.left-u.right,C=v-u.top-u.bottom;let vt,I,k,W,z,J,K,Q,M,w,Z,_,tt,et;if(t[8]!==x||t[9]!==m[0]||t[10]!==m[1]||t[11]!==Dt||t[12]!==j||t[13]!==n?.graphObjectValues||t[14]!==n?.xAxis?.gridLines||t[15]!==n?.xAxis?.labels||t[16]!==n?.yAxis?.axis||t[17]!==n?.yAxis?.labels||t[18]!==D||t[19]!==a||t[20]!==S||t[21]!==C||t[22]!==L||t[23]!==v||t[24]!==Tt||t[25]!==O||t[26]!==u.bottom||t[27]!==u.left||t[28]!==u.top||t[29]!==xt||t[30]!==Rt||t[31]!==q||t[32]!==T||t[33]!==F||t[34]!==qt||t[35]!==B||t[36]!==$||t[37]!==ht||t[38]!==gt||t[39]!==ft||t[40]!==h||t[41]!==Lt||t[42]!==Bt||t[43]!==mt||t[44]!==r?.graphObjectValues||t[45]!==r?.xAxis?.gridLines||t[46]!==r?.xAxis?.labels||t[47]!==r?.yAxis?.axis||t[48]!==r?.yAxis?.labels||t[49]!==pt||t[50]!==Y||t[51]!==Et||t[52]!==E){const Zt=a.map(Ue),A=ke.band().domain(Zt.map(Ye)).range([C,0]).paddingInner(Dt),p=we.linear().domain([Rt,xt]).range([0,(L-j)/2]).nice(),N=p.ticks(B),f=we.linear().domain([Rt,xt]).range([(L-j)/2,0]).nice(),Vt=f.ticks(B);k=Nt.motion.svg,tt=`${E}px`,et=`${v}px`,W=`0 0 ${E} ${v}`,z="ltr",J=le,M=`translate(${u.left},${u.top})`,t[67]!==D?(w=D.filter(He).map(Xe),t[67]=D,t[68]=w):w=t[68];const c=n?.yAxis?.axis;let R;t[69]!==c?(R={axis:c},t[69]=c,t[70]=R):R=t[70];const Wt=r?.yAxis?.axis;let $t;t[71]!==Wt?($t={axis:Wt},t[71]=Wt,t[72]=$t):$t=t[72],Z=i.jsxRuntimeExports.jsxs("g",{transform:"translate(0,0)",children:[Bt?i.jsxRuntimeExports.jsx(be.XTicksAndGridLines,{values:Vt.filter(Pe),x:Vt.filter(Ge).map(e=>f(e)),y1:0-Y,y2:C+u.bottom,styles:{gridLines:r?.xAxis?.gridLines,labels:r?.xAxis?.labels},classNames:{gridLines:n?.xAxis?.gridLines,labels:n?.xAxis?.labels},suffix:pt,prefix:ft,labelType:"secondary",showGridLines:!0,leftLabel:!0,precision:gt}):null,i.jsxRuntimeExports.jsxs(de.AnimatePresence,{children:[Zt.map((e,y)=>i.jsxRuntimeExports.jsxs(Nt.motion.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:b=>{U(e),bt(b.clientY),l(b.clientX),ht?.(e)},onClick:()=>{($||S)&&(ge.isEqual(F,e)&&Lt?(yt(void 0),$?.(void 0)):(yt(e),$?.(e)))},onMouseMove:b=>{U(e),bt(b.clientY),l(b.clientX)},onMouseLeave:()=>{U(void 0),l(void 0),bt(void 0),ht?.(void 0)},children:[e.leftBar?i.jsxRuntimeExports.jsx(Nt.motion.rect,{y:A(`${y}`),style:{fill:m[0]},height:A.bandwidth(),variants:{initial:{x:f(0),width:0},whileInView:{x:e.leftBar<0?f(0):f(e.leftBar),width:e.leftBar<0?f(e.leftBar)-f(0):f(0)-f(e.leftBar),transition:{duration:x.duration}}},initial:"initial",animate:O?"whileInView":"initial",exit:{x:f(0),width:0,transition:{duration:x.duration}}}):null,mt?i.jsxRuntimeExports.jsx(Nt.motion.text,{y:A(`${y}`)+A.bandwidth()/2,style:{textAnchor:e.rightBar&&e.rightBar>0?"end":"start",...r?.graphObjectValues||{}},dx:e.rightBar&&e.rightBar>0?-5:5,dy:"0.33em",className:i.mo("graph-value text-sm",n?.graphObjectValues),exit:{opacity:0,transition:{duration:x.duration}},variants:{initial:{x:f(0),opacity:0,fill:m[0]},whileInView:{x:e.leftBar?f(e.leftBar):f(q<0?0:q),opacity:1,fill:m[0],transition:{duration:x.duration}}},initial:"initial",animate:O?"whileInView":"initial",children:ye.numberFormattingFunction(e.rightBar,qt,gt,ft,pt)}):null]},e.label)),i.jsxRuntimeExports.jsx(ve.Axis,{hideAxisLine:Tt,y1:-2.5,y2:C+u.bottom,x1:f(q<0?0:q),x2:f(q<0?0:q),classNames:R,styles:$t}),h?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:h.map((e,y)=>i.jsxRuntimeExports.jsx(je.RefLineX,{text:e.text,color:e.color,x:f(e.value),y1:0-u.top,y2:C+u.bottom,textSide:"left",classNames:e.classNames,styles:e.styles,animate:x,isInView:O},y))}):null]})]});const _t=n?.yAxis?.axis;let wt;t[73]!==_t?(wt={axis:_t},t[73]=_t,t[74]=wt):wt=t[74];const Ot=r?.yAxis?.axis;let At;t[75]!==Ot?(At={axis:Ot},t[75]=Ot,t[76]=At):At=t[76],_=i.jsxRuntimeExports.jsxs("g",{transform:`translate(${(L+j)/2},0)`,children:[Bt?i.jsxRuntimeExports.jsx(be.XTicksAndGridLines,{values:N.filter(Ie),x:N.filter(Fe).map(e=>p(e)),y1:0-Y,y2:C+u.bottom,styles:{gridLines:r?.xAxis?.gridLines,labels:r?.xAxis?.labels},classNames:{gridLines:n?.xAxis?.gridLines,labels:n?.xAxis?.labels},suffix:pt,prefix:ft,labelType:"secondary",showGridLines:!0,precision:gt}):null,i.jsxRuntimeExports.jsxs(de.AnimatePresence,{children:[Zt.map((e,y)=>i.jsxRuntimeExports.jsxs(Nt.motion.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:b=>{U(e),bt(b.clientY),l(b.clientX),ht?.(e)},onClick:()=>{($||S)&&(ge.isEqual(F,e)&&Lt?(yt(void 0),$?.(void 0)):(yt(e),$?.(e)))},onMouseMove:b=>{U(e),bt(b.clientY),l(b.clientX)},onMouseLeave:()=>{U(void 0),l(void 0),bt(void 0),ht?.(void 0)},children:[e.rightBar?i.jsxRuntimeExports.jsx(Nt.motion.rect,{y:A(`${y}`),style:{fill:m[1]},height:A.bandwidth(),exit:{x:p(0),width:0,transition:{duration:x.duration}},variants:{initial:{x:p(0),width:0},whileInView:{x:e.rightBar>=0?p(0):p(e.rightBar),width:e.rightBar>=0?p(e.rightBar)-p(0):p(0)-p(e.rightBar),transition:{duration:x.duration}}},initial:"initial",animate:O?"whileInView":"initial"}):null,mt?i.jsxRuntimeExports.jsx(Nt.motion.text,{y:A(`${y}`)+A.bandwidth()/2,style:{textAnchor:e.rightBar&&e.rightBar<0?"end":"start",...r?.graphObjectValues||{}},className:i.mo("graph-value text-sm",n?.graphObjectValues),dx:e.rightBar&&e.rightBar<0?-5:5,dy:"0.33em",exit:{opacity:0,transition:{duration:x.duration}},variants:{initial:{x:p(0),opacity:0,fill:m[1]},whileInView:{x:e.rightBar?p(e.rightBar):p(T<0?0:T),opacity:1,fill:m[1],transition:{duration:x.duration}}},initial:"initial",animate:O?"whileInView":"initial",children:ye.numberFormattingFunction(e.rightBar,qt,gt,ft,pt)}):null]},y)),i.jsxRuntimeExports.jsx(ve.Axis,{hideAxisLine:Tt,y1:-2.5,y2:C+u.bottom,x1:p(T<0?0:T),x2:p(T<0?0:T),classNames:wt,styles:At}),h?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:h.map((e,y)=>i.jsxRuntimeExports.jsx(je.RefLineX,{text:e.text,color:e.color,x:p(e.value),y1:0-u.top,y2:C+u.bottom,textSide:"right",classNames:e.classNames,styles:e.styles,animate:x,isInView:O},y))}):null]})]}),I=de.AnimatePresence,vt=Nt.motion.g,K=`translate(${L/2},0)`,Q=Zt.map((e,y)=>i.jsxRuntimeExports.jsx(Le.YAxesLabels,{value:`${e.label}`.length<Et?`${e.label}`:`${`${e.label}`.substring(0,Et)}...`,y:A(`${e.id}`),x:0-j/2,width:j,height:A.bandwidth(),alignment:"center",style:r?.yAxis?.labels,className:n?.yAxis?.labels,animate:x,isInView:O},y)),t[8]=x,t[9]=m[0],t[10]=m[1],t[11]=Dt,t[12]=j,t[13]=n?.graphObjectValues,t[14]=n?.xAxis?.gridLines,t[15]=n?.xAxis?.labels,t[16]=n?.yAxis?.axis,t[17]=n?.yAxis?.labels,t[18]=D,t[19]=a,t[20]=S,t[21]=C,t[22]=L,t[23]=v,t[24]=Tt,t[25]=O,t[26]=u.bottom,t[27]=u.left,t[28]=u.top,t[29]=xt,t[30]=Rt,t[31]=q,t[32]=T,t[33]=F,t[34]=qt,t[35]=B,t[36]=$,t[37]=ht,t[38]=gt,t[39]=ft,t[40]=h,t[41]=Lt,t[42]=Bt,t[43]=mt,t[44]=r?.graphObjectValues,t[45]=r?.xAxis?.gridLines,t[46]=r?.xAxis?.labels,t[47]=r?.yAxis?.axis,t[48]=r?.yAxis?.labels,t[49]=pt,t[50]=Y,t[51]=Et,t[52]=E,t[53]=vt,t[54]=I,t[55]=k,t[56]=W,t[57]=z,t[58]=J,t[59]=K,t[60]=Q,t[61]=M,t[62]=w,t[63]=Z,t[64]=_,t[65]=tt,t[66]=et}else vt=t[53],I=t[54],k=t[55],W=t[56],z=t[57],J=t[58],K=t[59],Q=t[60],M=t[61],w=t[62],Z=t[63],_=t[64],tt=t[65],et=t[66];let G;t[77]!==vt||t[78]!==K||t[79]!==Q?(G=i.jsxRuntimeExports.jsx(vt,{transform:K,children:Q}),t[77]=vt,t[78]=K,t[79]=Q,t[80]=G):G=t[80];let it;t[81]!==I||t[82]!==G?(it=i.jsxRuntimeExports.jsx(I,{children:G}),t[81]=I,t[82]=G,t[83]=it):it=t[83];const Pt=`translate(0,${C})`,Xt=r?.yAxis?.title;let st;t[84]!==m[0]||t[85]!==Xt?(st={fill:m[0],textAnchor:"end",...Xt},t[84]=m[0],t[85]=Xt,t[86]=st):st=t[86];const Ht=n?.yAxis?.title;let P;t[87]!==Ht?(P=i.mo("text-base",Ht),t[87]=Ht,t[88]=P):P=t[88];const kt=L/2-j/2;let nt;t[89]!==dt[0]||t[90]!==st||t[91]!==P||t[92]!==kt?(nt=i.jsxRuntimeExports.jsx("text",{style:st,className:P,x:kt,y:0,dx:-5,dy:20,children:dt[0]}),t[89]=dt[0],t[90]=st,t[91]=P,t[92]=kt,t[93]=nt):nt=t[93];const Yt=r?.yAxis?.title;let ot;t[94]!==m[1]||t[95]!==Yt?(ot={fill:m[1],textAnchor:"start",...Yt},t[94]=m[1],t[95]=Yt,t[96]=ot):ot=t[96];const Ut=n?.yAxis?.title;let at;t[97]!==Ut?(at=i.mo("text-base",Ut),t[97]=Ut,t[98]=at):at=t[98];const Mt=L/2+j/2;let rt;t[99]!==dt[1]||t[100]!==ot||t[101]!==at||t[102]!==Mt?(rt=i.jsxRuntimeExports.jsx("text",{style:ot,className:at,x:Mt,y:0,dx:5,dy:20,children:dt[1]}),t[99]=dt[1],t[100]=ot,t[101]=at,t[102]=Mt,t[103]=rt):rt=t[103];let X;t[104]!==Pt||t[105]!==nt||t[106]!==rt?(X=i.jsxRuntimeExports.jsxs("g",{transform:Pt,children:[nt,rt]}),t[104]=Pt,t[105]=nt,t[106]=rt,t[107]=X):X=t[107];let lt;t[108]!==D?(lt=D.filter(Te).map(qe),t[108]=D,t[109]=lt):lt=t[109];let H;t[110]!==it||t[111]!==X||t[112]!==lt||t[113]!==M||t[114]!==w||t[115]!==Z||t[116]!==_?(H=i.jsxRuntimeExports.jsxs("g",{transform:M,children:[w,Z,_,it,X,lt]}),t[110]=it,t[111]=X,t[112]=lt,t[113]=M,t[114]=w,t[115]=Z,t[116]=_,t[117]=H):H=t[117];let o;t[118]!==k||t[119]!==W||t[120]!==z||t[121]!==J||t[122]!==H||t[123]!==tt||t[124]!==et?(o=i.jsxRuntimeExports.jsx(k,{width:tt,height:et,viewBox:W,direction:z,ref:J,children:H}),t[118]=k,t[119]=W,t[120]=z,t[121]=J,t[122]=H,t[123]=tt,t[124]=et,t[125]=o):o=t[125];let ct;t[126]!==n?.tooltip||t[127]!==d||t[128]!==It||t[129]!==Ft||t[130]!==r?.tooltip||t[131]!==St?(ct=Ft&&St&&d&&It?i.jsxRuntimeExports.jsx(Be.Tooltip,{data:Ft,body:St,xPos:d,yPos:It,backgroundStyle:r?.tooltip,className:n?.tooltip}):null,t[126]=n?.tooltip,t[127]=d,t[128]=It,t[129]=Ft,t[130]=r?.tooltip,t[131]=St,t[132]=ct):ct=t[132];let ut;t[133]!==n?.modal||t[134]!==S||t[135]!==F?(ut=S&&F!==void 0?i.jsxRuntimeExports.jsx(Ce.DetailsModal,{body:S,data:F,setData:yt,className:n?.modal}):null,t[133]=n?.modal,t[134]=S,t[135]=F,t[136]=ut):ut=t[136];let jt;return t[137]!==o||t[138]!==ct||t[139]!==ut?(jt=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[o,ct,ut]}),t[137]=o,t[138]=ct,t[139]=ut,t[140]=jt):jt=t[140],jt}function qe(s){return s.layer}function Te(s){return s.position==="after"}function Fe(s){return s!==0}function Ie(s){return s!==0}function Ge(s){return s!==0}function Pe(s){return s!==0}function Xe(s){return s.layer}function He(s){return s.position==="before"}function Ye(s){return`${s.id}`}function Ue(s,t){return{...s,id:`${t}`}}function re(s,t,a,E){const v=s.map(h=>h[t]).filter(h=>!he.checkIfNullOrUndefined(h)),m=he.checkIfNullOrUndefined(a)?Math.min(...v)>=0?0:Math.min(...v):a,j=he.checkIfNullOrUndefined(E)?Math.max(...v)<0?0:Math.max(...v):E;return{min:m,max:j}}function We(s){const t=i.compilerRuntimeExports.c(119),{data:a,graphTitle:E,sources:v,graphDescription:m,height:j,width:h,footNote:xt,padding:Rt,barColors:mt,backgroundColor:dt,leftMargin:Jt,rightMargin:Kt,topMargin:Y,bottomMargin:Qt,rightBarTitle:St,leftBarTitle:ht,tooltip:Dt,relativeHeight:Et,onSeriesMouseOver:$,graphID:Bt,barPadding:pt,truncateBy:ft,onSeriesMouseClick:Lt,centerGap:S,showValues:r,maxValue:n,minValue:B,refValues:x,suffix:gt,prefix:D,showTicks:q,showColorScale:T,graphDownload:qt,dataDownload:Tt,language:le,colorLegendTitle:Ct,minHeight:O,theme:Ft,ariaLabel:U,resetSelectionOnDoubleClick:F,detailsOnClick:yt,styles:d,classNames:l,noOfTicks:It,animate:bt,precision:Gt,customLayers:u,timeline:L,naLabel:C,hideAxisLine:vt}=s;let I;t[0]!==mt?(I=mt===void 0?[Ae.Colors.light.categoricalColors.colors[0],Ae.Colors.light.categoricalColors.colors[1]]:mt,t[0]=mt,t[1]=I):I=t[1];const k=I,W=dt===void 0?!1:dt,z=Jt===void 0?20:Jt,J=Kt===void 0?20:Kt,K=Y===void 0?25:Y,Q=Qt===void 0?30:Qt,M=St===void 0?"Right bar graph":St,w=ht===void 0?"Left bar graph":ht,Z=pt===void 0?.25:pt,_=ft===void 0?999:ft,tt=S===void 0?100:S,et=r===void 0?!0:r;let G;t[2]!==x?(G=x===void 0?[]:x,t[2]=x,t[3]=G):G=t[3];const it=G,Pt=gt===void 0?"":gt,Xt=D===void 0?"":D,st=q===void 0?!0:q,Ht=T===void 0?!1:T,P=qt===void 0?!1:qt,kt=Tt===void 0?!1:Tt,nt=le===void 0?"en":le,Yt=O===void 0?0:O,ot=Ft===void 0?"light":Ft,Ut=F===void 0?!0:F,at=It===void 0?5:It,Mt=bt===void 0?!1:bt,rt=Gt===void 0?2:Gt;let X;t[4]!==u?(X=u===void 0?[]:u,t[4]=u,t[5]=X):X=t[5];const lt=X;let H;t[6]!==L?(H=L===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:L,t[6]=L,t[7]=H):H=t[7];const o=H,ct=C===void 0?"NA":C,ut=vt===void 0?!1:vt,[jt,Zt]=V.useState(0),[A,p]=V.useState(0),[N,f]=V.useState(o.autoplay);let Vt;if(t[8]!==a||t[9]!==o.dateFormat){let g;t[11]!==o.dateFormat?(g=zt=>fe.parse(`${zt.date}`,o.dateFormat||"yyyy",new Date).getTime(),t[11]=o.dateFormat,t[12]=g):g=t[12],Vt=[...new Set(a.filter(ti).map(g))],Vt.sort(_e),t[8]=a,t[9]=o.dateFormat,t[10]=Vt}else Vt=t[10];const c=Vt,[R,Wt]=V.useState(o.autoplay?0:c.length-1),$t=V.useRef(null),_t=V.useRef(null);let wt,Ot;t[13]===Symbol.for("react.memo_cache_sentinel")?(wt=()=>{const g=new ResizeObserver(zt=>{Zt(zt[0].target.clientWidth||620),p(zt[0].target.clientHeight||480)});return $t.current&&g.observe($t.current),()=>g.disconnect()},Ot=[],t[13]=wt,t[14]=Ot):(wt=t[13],Ot=t[14]),V.useEffect(wt,Ot);let At,e;t[15]!==N||t[16]!==o.speed||t[17]!==c?(At=()=>{const g=setInterval(()=>{Wt(zt=>zt<c.length-1?zt+1:0)},(o.speed||2)*1e3);return N||clearInterval(g),()=>clearInterval(g)},e=[c,N,o.speed],t[15]=N,t[16]=o.speed,t[17]=c,t[18]=At,t[19]=e):(At=t[18],e=t[19]),V.useEffect(At,e);const y=o.dateFormat||"yyyy";let b;t[20]!==R||t[21]!==y||t[22]!==o.showOnlyActiveDate||t[23]!==c?(b=pe.getSliderMarks(c,R,o.showOnlyActiveDate,y),t[20]=R,t[21]=y,t[22]=o.showOnlyActiveDate,t[23]=c,t[24]=b):b=t[24];const ce=b,xe=l?.graphContainer,me=d?.graphContainer;let te;t[25]!==l?.description||t[26]!==l?.title||t[27]!==a||t[28]!==kt||t[29]!==m||t[30]!==P||t[31]!==E||t[32]!==d?.description||t[33]!==d?.title||t[34]!==h?(te=E||m||P||kt?i.jsxRuntimeExports.jsx($e.GraphHeader,{styles:{title:d?.title,description:d?.description},classNames:{title:l?.title,description:l?.description},graphTitle:E,graphDescription:m,width:h,graphDownload:P?_t:void 0,dataDownload:kt?a.map(Ze).filter(Qe).length>0?a.map(Ke).filter(Je):a.filter(ze):null}):null,t[25]=l?.description,t[26]=l?.title,t[27]=a,t[28]=kt,t[29]=m,t[30]=P,t[31]=E,t[32]=d?.description,t[33]=d?.title,t[34]=h,t[35]=te):te=t[35];let ee;t[36]!==R||t[37]!==ce||t[38]!==N||t[39]!==o.enabled||t[40]!==c?(ee=o.enabled&&c.length>0&&ce?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{f(!N)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":N?"Click to pause animation":"Click to play animation",children:N?i.jsxRuntimeExports.jsx(Re.Pause,{}):i.jsxRuntimeExports.jsx(Re.Play,{})}),i.jsxRuntimeExports.jsx(pe.Nr,{min:c[0],max:c[c.length-1],marks:ce,step:null,defaultValue:c[c.length-1],value:c[R],onChangeComplete:g=>{Wt(c.indexOf(g))},onChange:g=>{Wt(c.indexOf(g))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,t[36]=R,t[37]=ce,t[38]=N,t[39]=o.enabled,t[40]=c,t[41]=ee):ee=t[41];let ie;t[42]!==k||t[43]!==l?.colorLegend||t[44]!==Ct||t[45]!==a.length||t[46]!==w||t[47]!==M||t[48]!==Ht?(ie=Ht&&a.length>0?i.jsxRuntimeExports.jsx(Oe.ColorLegend,{colorLegendTitle:Ct,colorDomain:[w,M],colors:k,showNAColor:!1,className:l?.colorLegend}):null,t[42]=k,t[43]=l?.colorLegend,t[44]=Ct,t[45]=a.length,t[46]=w,t[47]=M,t[48]=Ht,t[49]=ie):ie=t[49];let se;t[50]!==a.length?(se=a.length===0&&i.jsxRuntimeExports.jsx(Ne.EmptyState,{}),t[50]=a.length,t[51]=se):se=t[51];let ne;t[52]!==Mt||t[53]!==k||t[54]!==Z||t[55]!==Q||t[56]!==tt||t[57]!==l||t[58]!==lt||t[59]!==a||t[60]!==yt||t[61]!==ut||t[62]!==R||t[63]!==w||t[64]!==z||t[65]!==n||t[66]!==B||t[67]!==ct||t[68]!==at||t[69]!==Lt||t[70]!==$||t[71]!==rt||t[72]!==Xt||t[73]!==it||t[74]!==Ut||t[75]!==M||t[76]!==J||t[77]!==st||t[78]!==et||t[79]!==d||t[80]!==Pt||t[81]!==A||t[82]!==jt||t[83]!==o.dateFormat||t[84]!==o.enabled||t[85]!==Dt||t[86]!==K||t[87]!==_||t[88]!==c?(ne=jt&&A&&a.length>0?i.jsxRuntimeExports.jsx(De,{hideAxisLine:ut,data:Se.ensureCompleteDataForButterFlyChart(a,o.dateFormat||"yyyy").filter(g=>o.enabled?g.date===fe.format(new Date(c[R]),o.dateFormat||"yyyy"):g),barColors:k,width:jt,centerGap:tt,height:A,truncateBy:_,leftMargin:z,rightMargin:J,topMargin:K,bottomMargin:Q,axisTitles:[w,M],tooltip:Dt,onSeriesMouseOver:$,barPadding:Z,refValues:it,maxValue:Math.max(re(a,"leftBar",B,n).max,re(a,"rightBar",B,n).max),minValue:Math.min(re(a,"leftBar",B,n).min,re(a,"rightBar",B,n).min),minValueLeftBar:re(a,"leftBar",B,n).min,minValueRightBar:re(a,"rightBar",B,n).min,showValues:et,onSeriesMouseClick:Lt,showTicks:st,suffix:Pt,prefix:Xt,resetSelectionOnDoubleClick:Ut,detailsOnClick:yt,styles:d,classNames:l,noOfTicks:at,animate:Mt===!0?{duration:.5,once:!0,amount:.5}:Mt||{duration:0,once:!0,amount:0},precision:rt,customLayers:lt,naLabel:ct}):null,t[52]=Mt,t[53]=k,t[54]=Z,t[55]=Q,t[56]=tt,t[57]=l,t[58]=lt,t[59]=a,t[60]=yt,t[61]=ut,t[62]=R,t[63]=w,t[64]=z,t[65]=n,t[66]=B,t[67]=ct,t[68]=at,t[69]=Lt,t[70]=$,t[71]=rt,t[72]=Xt,t[73]=it,t[74]=Ut,t[75]=M,t[76]=J,t[77]=st,t[78]=et,t[79]=d,t[80]=Pt,t[81]=A,t[82]=jt,t[83]=o.dateFormat,t[84]=o.enabled,t[85]=Dt,t[86]=K,t[87]=_,t[88]=c,t[89]=ne):ne=t[89];let oe;t[90]!==se||t[91]!==ne?(oe=i.jsxRuntimeExports.jsxs(Ee.GraphArea,{ref:$t,children:[se,ne]}),t[90]=se,t[91]=ne,t[92]=oe):oe=t[92];let ae;t[93]!==l?.footnote||t[94]!==l?.source||t[95]!==xt||t[96]!==v||t[97]!==d?.footnote||t[98]!==d?.source||t[99]!==h?(ae=v||xt?i.jsxRuntimeExports.jsx(Ve.GraphFooter,{styles:{footnote:d?.footnote,source:d?.source},classNames:{footnote:l?.footnote,source:l?.source},sources:v,footNote:xt,width:h}):null,t[93]=l?.footnote,t[94]=l?.source,t[95]=xt,t[96]=v,t[97]=d?.footnote,t[98]=d?.source,t[99]=h,t[100]=ae):ae=t[100];let ue;return t[101]!==U||t[102]!==W||t[103]!==Bt||t[104]!==j||t[105]!==nt||t[106]!==Yt||t[107]!==Rt||t[108]!==Et||t[109]!==xe||t[110]!==me||t[111]!==te||t[112]!==ee||t[113]!==ie||t[114]!==oe||t[115]!==ae||t[116]!==ot||t[117]!==h?(ue=i.jsxRuntimeExports.jsxs(Ee.GraphContainer,{className:xe,style:me,id:Bt,ref:_t,"aria-label":U,backgroundColor:W,theme:ot,language:nt,minHeight:Yt,width:h,height:j,relativeHeight:Et,padding:Rt,children:[te,ee,ie,oe,ae]}),t[101]=U,t[102]=W,t[103]=Bt,t[104]=j,t[105]=nt,t[106]=Yt,t[107]=Rt,t[108]=Et,t[109]=xe,t[110]=me,t[111]=te,t[112]=ee,t[113]=ie,t[114]=oe,t[115]=ae,t[116]=ot,t[117]=h,t[118]=ue):ue=t[118],ue}function ze(s){return s!==void 0}function Je(s){return s!==void 0}function Ke(s){return s.data}function Qe(s){return s!==void 0}function Ze(s){return s.data}function _e(s,t){return s-t}function ti(s){return s.date}exports.ButterflyChart=We;
|
|
2
2
|
//# sourceMappingURL=ButterflyChart.cjs.map
|
package/dist/ButterflyChart.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { c as Le, j as i, m as de } from "./index-CHPV5EwG-
|
|
1
|
+
import { c as Le, j as i, m as de } from "./index-CHPV5EwG-BCLAYDCV.js";
|
|
2
2
|
import { useRef as pe, useState as Tt, useEffect as ge } from "react";
|
|
3
|
-
import { g as Me, N as Ce } from "./getSliderMarks-
|
|
3
|
+
import { g as Me, N as Ce } from "./getSliderMarks-vXsR8RrR.js";
|
|
4
4
|
import { f as ke, p as Ve } from "./parse-Dv4of-PN.js";
|
|
5
5
|
import { i as ye } from "./index-Bwrro8-q.js";
|
|
6
6
|
import { n as be } from "./numberFormattingFunction-14YCbkN2.js";
|
|
7
|
-
import { T as $e } from "./Tooltip-
|
|
8
|
-
import { X as ve } from "./XTicksAndGridLines-
|
|
9
|
-
import { A as we } from "./Axis-
|
|
10
|
-
import { Y as Ne } from "./YAxesLabels-
|
|
11
|
-
import { R as Ae } from "./ReferenceLine-
|
|
12
|
-
import { D as Oe } from "./DetailsModal-
|
|
7
|
+
import { T as $e } from "./Tooltip-CohiIbLZ.js";
|
|
8
|
+
import { X as ve } from "./XTicksAndGridLines-BDmF9etl.js";
|
|
9
|
+
import { A as we } from "./Axis-RyGdzLrG.js";
|
|
10
|
+
import { Y as Ne } from "./YAxesLabels-DoGvgHdw.js";
|
|
11
|
+
import { R as Ae } from "./ReferenceLine-CNEjAYvv.js";
|
|
12
|
+
import { D as Oe } from "./DetailsModal-C3qlUyFK.js";
|
|
13
13
|
import { b as De } from "./band-DYty33LD.js";
|
|
14
|
-
import { a as je } from "./linear-
|
|
15
|
-
import { m as Dt } from "./proxy
|
|
16
|
-
import { u as Te } from "./use-in-view-
|
|
17
|
-
import { A as he } from "./index-
|
|
14
|
+
import { a as je } from "./linear-DNXM5Pdl.js";
|
|
15
|
+
import { m as Dt } from "./proxy--_f6k3NR.js";
|
|
16
|
+
import { u as Te } from "./use-in-view-DqvKAveg.js";
|
|
17
|
+
import { A as he } from "./index-Co3YGYe1.js";
|
|
18
18
|
import { GraphFooter as Se } from "./GraphFooter.js";
|
|
19
19
|
import { GraphHeader as Fe } from "./GraphHeader.js";
|
|
20
20
|
import { ColorLegend as Ie } from "./ColorLegend.js";
|
|
21
21
|
import { Colors as Be } from "./Colors.js";
|
|
22
|
-
import { E as Ge } from "./EmptyState-
|
|
23
|
-
import { P as Re, e as Pe } from "./index-
|
|
22
|
+
import { E as Ge } from "./EmptyState-D807L58h.js";
|
|
23
|
+
import { P as Re, e as Pe } from "./index-CZ0elhKR.js";
|
|
24
24
|
import { c as xe } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
25
25
|
import { c as Ee } from "./ensureCompleteData-CDIukSG6.js";
|
|
26
|
-
import { a as Xe, G as He } from "./GraphContainer-
|
|
26
|
+
import { a as Xe, G as He } from "./GraphContainer-DwMxWRCi.js";
|
|
27
27
|
function Ye(a) {
|
|
28
28
|
const t = Le.c(141), {
|
|
29
29
|
data: l,
|
package/dist/ChoroplethMap.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-6v2a2njQ.cjs"),c=require("react"),yt=require("./getSliderMarks-CIuSoedo.cjs"),Ct=require("./Spinner-jTMOLuw_.cjs"),vt=require("./parse-xYI9yrvL.cjs"),Dt=require("./index-DQA8q5sC.cjs"),F=require("./index-DLFt97gy.cjs"),jt=require("./Typography-Cc_iHQB-.cjs"),St=require("./index-C5K--w8d.cjs"),Nt=require("./numberFormattingFunction-02t-wJta.cjs"),Mt=require("./Tooltip-BLa2EfMs.cjs"),Ot=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),gt=require("./index-sbKVyHS2.cjs"),qt=require("./DetailsModal-DHttOA80.cjs"),It=require("./ordinal-CrsysVE-.cjs"),Pt=require("./threshold-DNsSUf8Q.cjs"),xt=require("./select-Bnfk0lJx.cjs"),Qe=require("./proxy-C4-uo6nS.cjs"),zt=require("./use-in-view-C3o_ntMv.cjs"),At=require("./index-CoobIWNj.cjs"),Bt=require("./GraphFooter.cjs"),Ft=require("./GraphHeader.cjs"),et=require("./Colors.cjs"),_t=require("./fetchAndParseData-QTF6tjij.cjs"),Lt=require("./getUniqValue-NX8DgwND.cjs"),Tt=require("./getJenks-BzJvhy_H.cjs"),bt=require("./GraphContainer-B1EDxJ0S.cjs");function Wt(d){const{data:e,colorDomain:r,colors:n,mapData:_,colorLegendTitle:E,categorical:L,height:f,width:h,scale:x,centerPoint:T,tooltip:Z,mapBorderWidth:Q,mapBorderColor:xe,mapNoDataColor:ge,onSeriesMouseOver:ee,showColorScale:fe,zoomScaleExtend:Oe,zoomTranslateExtend:qe,highlightedIds:b,onSeriesMouseClick:te,mapProperty:g,resetSelectionOnDoubleClick:ye,detailsOnClick:H,styles:Ie,classNames:oe,mapProjection:D,zoomInteraction:S,animate:k,dimmedOpacity:N,customLayers:re,collapseColorScaleByDefault:ve,zoomAndCenterByHighlightedIds:je,projectionRotate:W,rewindCoordinatesInMapData:be}=d,y=c.useMemo(()=>be?F.index_default(_,{reverse:!0}):_,[_,be]),[w,M]=c.useState(void 0),V=c.useRef(null),[Pe,ae]=c.useState(ve===void 0?!(h<680):!ve),[u,p]=c.useState(void 0),[U,ne]=c.useState(void 0),[Ee,se]=c.useState(void 0),[X,$]=c.useState(void 0),O=c.useRef(null),Y=zt.useInView(O,{once:k.once,amount:k.amount}),ke=c.useRef(null),ze=L?It.ordinal().domain(r).range(n):Pt.threshold().domain(r).range(n);c.useEffect(()=>{const o=xt.select(ke.current),a=xt.select(O.current),j=i=>{if(S==="noZoom")return!1;if(S==="button")return!i.type.includes("wheel");const le=i.type==="wheel",ce=i.type.startsWith("touch"),Se=i.type==="mousedown"||i.type==="mousemove";return ce?!0:le?S==="scroll"?!0:i.ctrlKey:Se&&!i.button&&!i.ctrlKey},C=F.zoom().scaleExtent(Oe).translateExtent(qe||[[-20,-20],[h+20,f+20]]).filter(j).on("zoom",({transform:i})=>{o.attr("transform",i)});a.call(C),V.current=C},[f,h,S]);const v=F.index_default$1({...y,features:je?y.features.filter(o=>(b||[]).length===0||b.indexOf(o.properties[g])!==-1):y.features}),R=St.index_default({...y,features:je?y.features.filter(o=>(b||[]).length===0||b.indexOf(o.properties[g])!==-1):y.features}),q=(v[2]-v[0])*1.15,we=(v[3]-v[1])*1.15,Re=h*190/960*360/q,Ce=f*190/678*180/we,I=x*Math.min(Re,Ce),De=D==="mercator"?F.geoMercator().rotate(W).center(T||R.geometry.coordinates).translate([h/2,f/2]).scale(I):D==="equalEarth"?F.geoEqualEarth().rotate(W).center(T||R.geometry.coordinates).translate([h/2,f/2]).scale(I):D==="naturalEarth"?F.geoNaturalEarth1().rotate(W).center(T||R.geometry.coordinates).translate([h/2,f/2]).scale(I):D==="orthographic"?F.geoOrthographic().rotate(W).center(T||R.geometry.coordinates).translate([h/2,f/2]).scale(I):F.geoAlbersUsa().rotate(W).center(T||R.geometry.coordinates).translate([h/2,f/2]).scale(I),G=F.geoPath().projection(De),ie=o=>{if(!O.current||!V.current)return;xt.select(O.current).call(V.current.scaleBy,o==="in"?1.2:1/1.2)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:"relative",children:[t.jsxRuntimeExports.jsx(Qe.motion.svg,{width:`${h}px`,height:`${f}px`,viewBox:`0 0 ${h} ${f}`,ref:O,direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{ref:ke,children:[re.filter(o=>o.position==="before").map(o=>o.layer),y.features.map((o,a)=>{if(!o.properties?.[g])return null;const j=G(o);return j?t.jsxRuntimeExports.jsx(Qe.motion.g,{opacity:w?N:b.length!==0?b.indexOf(o.properties[g])!==-1?1:N:1,children:t.jsxRuntimeExports.jsx("path",{d:j,style:{stroke:xe,strokeWidth:Q,fill:ge}})},a):null}),t.jsxRuntimeExports.jsx(At.AnimatePresence,{children:e.map(o=>{const a=y.features.findIndex(i=>o.id===i.properties[g]);if(a===-1)return null;const j=G(y.features[a]);if(!j)return null;const C=Ot.checkIfNullOrUndefined(o.x)?ge:ze(o.x);return t.jsxRuntimeExports.jsx(Qe.motion.g,{className:"undp-map-shapes",variants:{initial:{opacity:0},whileInView:{opacity:w?w===C?1:N:b.length!==0?b.indexOf(o.id)!==-1?1:N:1,transition:{duration:k.duration}}},initial:"initial",animate:Y?"whileInView":"initial",exit:{opacity:0,transition:{duration:k.duration}},onMouseEnter:i=>{ne(o),$(i.clientY),se(i.clientX),ee?.(o)},onMouseMove:i=>{ne(o),$(i.clientY),se(i.clientX)},onMouseLeave:()=>{ne(void 0),se(void 0),$(void 0),ee?.(void 0)},onClick:()=>{(te||H)&&(Dt.isEqual(u,o)&&ye?(p(void 0),te?.(void 0)):(p(o),te?.(o)))},children:t.jsxRuntimeExports.jsx(Qe.motion.path,{d:j,variants:{initial:{fill:C,opacity:0},whileInView:{fill:C,opacity:1,transition:{duration:k.duration}}},initial:"initial",animate:Y?"whileInView":"initial",exit:{opacity:0,transition:{duration:k.duration}},style:{stroke:xe,strokeWidth:Q}},`${o.id}`)},o.id)})}),U?y.features.filter(o=>o.properties[g]===U.id).map((o,a)=>t.jsxRuntimeExports.jsx("path",{d:G(o)||"",className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},a)):null,re.filter(o=>o.position==="after").map(o=>o.layer)]})}),fe===!1?null:t.jsxRuntimeExports.jsx("div",{className:t.mo("absolute left-4 bottom-4 map-color-legend",oe?.colorLegend),children:Pe?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{ae(!1)},children:t.jsxRuntimeExports.jsx(gt.X,{})}),t.jsxRuntimeExports.jsxs("div",{className:"color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]",style:{width:L?void 0:"340px"},children:[E&&E!==""?t.jsxRuntimeExports.jsx(jt._,{size:"xs",marginBottom:"xs",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:E}):null,L?t.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:r.map((o,a)=>t.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{M(n[a%n.length])},onMouseLeave:()=>{M(void 0)},children:[t.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:n[a%n.length]}}),t.jsxRuntimeExports.jsx(jt._,{size:"sm",marginBottom:"none",leading:"none",children:o})]},a))}):t.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{children:[r.map((o,a)=>t.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{M(n[a])},onMouseLeave:()=>{M(void 0)},className:"cursor-pointer",children:[t.jsxRuntimeExports.jsx("rect",{x:a*320/n.length+1,y:1,width:320/n.length-2,height:8,className:w===n[a]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:n[a],...w===n[a]?{}:{stroke:n[a]}}}),t.jsxRuntimeExports.jsx("text",{x:(a+1)*320/n.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:Nt.numberFormattingFunction(o,"NA")})]},a)),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{M(n[r.length])},onMouseLeave:()=>{M(void 0)},x:r.length*320/n.length+1,y:1,width:320/n.length-2,height:8,className:`cursor-pointer ${w===n[r.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:n[r.length],...w===n[r.length]?{}:{stroke:n[r.length]}}})})]})})]})]}):t.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start map-legend-button",onClick:()=>{ae(!0)},children:t.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),S==="button"&&t.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[t.jsxRuntimeExports.jsx("button",{onClick:()=>ie("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),t.jsxRuntimeExports.jsx("button",{onClick:()=>ie("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),H&&u!==void 0?t.jsxRuntimeExports.jsx(qt.DetailsModal,{body:H,data:u,setData:p,className:oe?.modal}):null,U&&Z&&Ee&&X?t.jsxRuntimeExports.jsx(Mt.Tooltip,{data:U,body:Z,xPos:Ee,yPos:X,backgroundStyle:Ie?.tooltip,className:oe?.tooltip}):null]})}function $t(d){const e=t.compilerRuntimeExports.c(126),{data:r,mapData:n,graphTitle:_,colors:E,sources:L,graphDescription:f,height:h,width:x,footNote:T,colorDomain:Z,colorLegendTitle:Q,scaleType:xe,scale:ge,centerPoint:ee,padding:fe,mapBorderWidth:Oe,mapNoDataColor:qe,backgroundColor:b,mapBorderColor:te,relativeHeight:g,tooltip:ye,onSeriesMouseOver:H,isWorldMap:Ie,showColorScale:oe,zoomScaleExtend:D,zoomTranslateExtend:S,graphID:k,highlightedIds:N,onSeriesMouseClick:re,mapProperty:ve,graphDownload:je,dataDownload:W,showAntarctica:be,language:y,minHeight:w,theme:M,ariaLabel:V,resetSelectionOnDoubleClick:Pe,detailsOnClick:ae,styles:u,classNames:p,mapProjection:U,zoomInteraction:ne,animate:Ee,dimmedOpacity:se,customLayers:X,timeline:$,collapseColorScaleByDefault:O,projectionRotate:Y,zoomAndCenterByHighlightedIds:ke,rewindCoordinatesInMapData:ze}=d,v=n===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":n,R=T===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":T,q=xe===void 0?"threshold":xe,we=ge===void 0?.95:ge,Re=Oe===void 0?.5:Oe,Ce=qe===void 0?et.Colors.light.graphNoData:qe,I=b===void 0?!1:b,De=te===void 0?et.Colors.light.grays["gray-500"]:te,G=Ie===void 0?!0:Ie,ie=oe===void 0?!0:oe;let o;e[0]!==D?(o=D===void 0?[.8,6]:D,e[0]=D,e[1]=o):o=e[1];const a=o;let j;e[2]!==N?(j=N===void 0?[]:N,e[2]=N,e[3]=j):j=e[3];const C=j,i=ve===void 0?"ISO3":ve,le=je===void 0?!1:je,ce=W===void 0?!1:W,Se=be===void 0?!1:be,tt=y===void 0?"en":y,P=w===void 0?0:w,J=M===void 0?"light":M,ot=Pe===void 0?!0:Pe,rt=U===void 0?"naturalEarth":U,at=ne===void 0?"button":ne,Ae=Ee===void 0?!1:Ee,nt=se===void 0?.3:se;let Be;e[4]!==X?(Be=X===void 0?[]:X,e[4]=X,e[5]=Be):Be=e[5];const st=Be;let Fe;e[6]!==$?(Fe=$===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:$,e[6]=$,e[7]=Fe):Fe=e[7];const s=Fe;let _e;e[8]!==Y?(_e=Y===void 0?[0,0]:Y,e[8]=Y,e[9]=_e):_e=e[9];const it=_e,lt=ke===void 0?!1:ke,ct=ze===void 0?!0:ze,[K,Et]=c.useState(0),[Ne,kt]=c.useState(0),[z,wt]=c.useState(s.autoplay);let Me;if(e[10]!==r||e[11]!==s.dateFormat){let m;e[13]!==s.dateFormat?(m=B=>vt.parse(`${B.date}`,s.dateFormat||"yyyy",new Date).getTime(),e[13]=s.dateFormat,e[14]=m):m=e[14],Me=[...new Set(r.filter(Zt).map(m))],Me.sort(Kt),e[10]=r,e[11]=s.dateFormat,e[12]=Me}else Me=e[12];const l=Me,[A,dt]=c.useState(s.autoplay?0:l.length-1),[de,Rt]=c.useState(void 0),ut=c.useRef(null),ft=c.useRef(null);let Le,Te;e[15]===Symbol.for("react.memo_cache_sentinel")?(Le=()=>{const m=new ResizeObserver(B=>{Et(B[0].target.clientWidth||620),kt(B[0].target.clientHeight||480)});return ut.current&&m.observe(ut.current),()=>m.disconnect()},Te=[],e[15]=Le,e[16]=Te):(Le=e[15],Te=e[16]),c.useEffect(Le,Te);let We;e[17]===Symbol.for("react.memo_cache_sentinel")?(We=m=>{Rt(m)},e[17]=We):We=e[17];const $e=c.useEffectEvent(We);let Ge;e[18]!==v||e[19]!==$e?(Ge=()=>{typeof v=="string"?_t.fetchAndParseJSON(v).then(B=>{$e(B)}):$e(v)},e[18]=v,e[19]=$e,e[20]=Ge):Ge=e[20];let He;e[21]!==v?(He=[v],e[21]=v,e[22]=He):He=e[22],c.useEffect(Ge,He);let Ve;e[23]!==Z||e[24]!==E?.length||e[25]!==r||e[26]!==q?(Ve=Z||(q==="categorical"?Lt.getUniqValue(r,"x"):Tt.getJenks(r.map(Jt),E?.length||4)),e[23]=Z,e[24]=E?.length,e[25]=r,e[26]=q,e[27]=Ve):Ve=e[27];const Ue=Ve;let Xe,Ye;e[28]!==z||e[29]!==s.speed||e[30]!==l?(Xe=()=>{const m=setInterval(()=>{dt(B=>B<l.length-1?B+1:0)},(s.speed||2)*1e3);return z||clearInterval(m),()=>clearInterval(m)},Ye=[l,z,s.speed],e[28]=z,e[29]=s.speed,e[30]=l,e[31]=Xe,e[32]=Ye):(Xe=e[31],Ye=e[32]),c.useEffect(Xe,Ye);const pt=s.dateFormat||"yyyy";let Je;e[33]!==A||e[34]!==pt||e[35]!==s.showOnlyActiveDate||e[36]!==l?(Je=yt.getSliderMarks(l,A,s.showOnlyActiveDate,pt),e[33]=A,e[34]=pt,e[35]=s.showOnlyActiveDate,e[36]=l,e[37]=Je):Je=e[37];const Ke=Je,mt=p?.graphContainer,ht=u?.graphContainer;let ue;e[38]!==p?.description||e[39]!==p?.title||e[40]!==r||e[41]!==ce||e[42]!==f||e[43]!==le||e[44]!==_||e[45]!==u?.description||e[46]!==u?.title||e[47]!==x?(ue=_||f||le||ce?t.jsxRuntimeExports.jsx(Ft.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:p?.title,description:p?.description},graphTitle:_,graphDescription:f,width:x,graphDownload:le?ft:void 0,dataDownload:ce?r.map(Yt).filter(Xt).length>0?r.map(Ut).filter(Vt):r.filter(Ht):null}):null,e[38]=p?.description,e[39]=p?.title,e[40]=r,e[41]=ce,e[42]=f,e[43]=le,e[44]=_,e[45]=u?.description,e[46]=u?.title,e[47]=x,e[48]=ue):ue=e[48];let pe;e[49]!==A||e[50]!==Ke||e[51]!==z||e[52]!==s.enabled||e[53]!==l?(pe=s.enabled&&l.length>0&&Ke?t.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[t.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{wt(!z)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":z?"Click to pause animation":"Click to play animation",children:z?t.jsxRuntimeExports.jsx(gt.Pause,{}):t.jsxRuntimeExports.jsx(gt.Play,{})}),t.jsxRuntimeExports.jsx(yt.Nr,{min:l[0],max:l[l.length-1],marks:Ke,step:null,defaultValue:l[l.length-1],value:l[A],onChangeComplete:m=>{dt(l.indexOf(m))},onChange:m=>{dt(l.indexOf(m))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[49]=A,e[50]=Ke,e[51]=z,e[52]=s.enabled,e[53]=l,e[54]=pe):pe=e[54];let me;e[55]!==Ae||e[56]!==ee||e[57]!==p||e[58]!==O||e[59]!==Q||e[60]!==E||e[61]!==st||e[62]!==r||e[63]!==ae||e[64]!==nt||e[65]!==Ue||e[66]!==h||e[67]!==C||e[68]!==A||e[69]!==G||e[70]!==De||e[71]!==Re||e[72]!==Ce||e[73]!==rt||e[74]!==i||e[75]!==de||e[76]!==P||e[77]!==re||e[78]!==H||e[79]!==it||e[80]!==g||e[81]!==ot||e[82]!==ct||e[83]!==we||e[84]!==q||e[85]!==Se||e[86]!==ie||e[87]!==u||e[88]!==Ne||e[89]!==K||e[90]!==J||e[91]!==s.dateFormat||e[92]!==s.enabled||e[93]!==ye||e[94]!==l||e[95]!==x||e[96]!==lt||e[97]!==at||e[98]!==a||e[99]!==S?(me=t.jsxRuntimeExports.jsx(bt.GraphArea,{ref:ut,children:K&&Ne&&de?t.jsxRuntimeExports.jsx(Wt,{data:r.filter(m=>s.enabled?m.date===vt.format(new Date(l[A]),s.dateFormat||"yyyy"):m),mapData:Se?de:{...de,features:de.features.filter(Gt)},colorDomain:Ue,width:K,height:Ne,scale:we,centerPoint:ee,colors:E||(q==="categorical"?et.Colors[J].categoricalColors.colors:et.Colors[J].sequentialColors[`neutralColorsx0${Ue.length+1}`]),colorLegendTitle:Q,mapBorderWidth:Re,mapNoDataColor:Ce,categorical:q==="categorical",mapBorderColor:De,tooltip:ye,onSeriesMouseOver:H,isWorldMap:G,showColorScale:ie,zoomScaleExtend:a,zoomTranslateExtend:S,onSeriesMouseClick:re,mapProperty:i,highlightedIds:C,resetSelectionOnDoubleClick:ot,styles:u,classNames:p,detailsOnClick:ae,mapProjection:rt||(G?"naturalEarth":"mercator"),zoomInteraction:at,dimmedOpacity:nt,animate:Ae===!0?{duration:.5,once:!0,amount:.5}:Ae||{duration:0,once:!0,amount:0},customLayers:st,zoomAndCenterByHighlightedIds:lt,collapseColorScaleByDefault:O,projectionRotate:it,rewindCoordinatesInMapData:ct}):t.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(P,h||(g?P?(x||K)*g>P?(x||K)*g:P:(x||K)*g:Ne))}px`},className:"flex items-center justify-center",children:t.jsxRuntimeExports.jsx(Ct.w,{"aria-label":"Loading graph"})})}),e[55]=Ae,e[56]=ee,e[57]=p,e[58]=O,e[59]=Q,e[60]=E,e[61]=st,e[62]=r,e[63]=ae,e[64]=nt,e[65]=Ue,e[66]=h,e[67]=C,e[68]=A,e[69]=G,e[70]=De,e[71]=Re,e[72]=Ce,e[73]=rt,e[74]=i,e[75]=de,e[76]=P,e[77]=re,e[78]=H,e[79]=it,e[80]=g,e[81]=ot,e[82]=ct,e[83]=we,e[84]=q,e[85]=Se,e[86]=ie,e[87]=u,e[88]=Ne,e[89]=K,e[90]=J,e[91]=s.dateFormat,e[92]=s.enabled,e[93]=ye,e[94]=l,e[95]=x,e[96]=lt,e[97]=at,e[98]=a,e[99]=S,e[100]=me):me=e[100];let he;e[101]!==p?.footnote||e[102]!==p?.source||e[103]!==R||e[104]!==L||e[105]!==u?.footnote||e[106]!==u?.source||e[107]!==x?(he=L||R?t.jsxRuntimeExports.jsx(Bt.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},classNames:{footnote:p?.footnote,source:p?.source},sources:L,footNote:R,width:x}):null,e[101]=p?.footnote,e[102]=p?.source,e[103]=R,e[104]=L,e[105]=u?.footnote,e[106]=u?.source,e[107]=x,e[108]=he):he=e[108];let Ze;return e[109]!==V||e[110]!==I||e[111]!==k||e[112]!==h||e[113]!==tt||e[114]!==P||e[115]!==fe||e[116]!==g||e[117]!==mt||e[118]!==ht||e[119]!==ue||e[120]!==pe||e[121]!==me||e[122]!==he||e[123]!==J||e[124]!==x?(Ze=t.jsxRuntimeExports.jsxs(bt.GraphContainer,{className:mt,style:ht,id:k,ref:ft,"aria-label":V,backgroundColor:I,theme:J,language:tt,minHeight:P,width:x,height:h,relativeHeight:g,padding:fe,children:[ue,pe,me,he]}),e[109]=V,e[110]=I,e[111]=k,e[112]=h,e[113]=tt,e[114]=P,e[115]=fe,e[116]=g,e[117]=mt,e[118]=ht,e[119]=ue,e[120]=pe,e[121]=me,e[122]=he,e[123]=J,e[124]=x,e[125]=Ze):Ze=e[125],Ze}function Gt(d){return d.properties.NAME!=="Antarctica"}function Ht(d){return d!==void 0}function Vt(d){return d!==void 0}function Ut(d){return d.data}function Xt(d){return d!==void 0}function Yt(d){return d.data}function Jt(d){return d.x}function Kt(d,e){return d-e}function Zt(d){return d.date}exports.ChoroplethMap=$t;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-6v2a2njQ.cjs"),c=require("react"),yt=require("./getSliderMarks-CIuSoedo.cjs"),Ct=require("./Spinner-jTMOLuw_.cjs"),vt=require("./parse-xYI9yrvL.cjs"),Dt=require("./index-DQA8q5sC.cjs"),F=require("./index-DLFt97gy.cjs"),jt=require("./Typography-Cc_iHQB-.cjs"),St=require("./index-C5K--w8d.cjs"),Nt=require("./numberFormattingFunction-02t-wJta.cjs"),Mt=require("./Tooltip-BLa2EfMs.cjs"),Ot=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),gt=require("./index-sbKVyHS2.cjs"),qt=require("./DetailsModal-DIRTulvr.cjs"),It=require("./ordinal-CrsysVE-.cjs"),Pt=require("./threshold-DNsSUf8Q.cjs"),xt=require("./select-Bnfk0lJx.cjs"),Qe=require("./proxy-C4-uo6nS.cjs"),zt=require("./use-in-view-C3o_ntMv.cjs"),At=require("./index-CoobIWNj.cjs"),Bt=require("./GraphFooter.cjs"),Ft=require("./GraphHeader.cjs"),et=require("./Colors.cjs"),_t=require("./fetchAndParseData-QTF6tjij.cjs"),Lt=require("./getUniqValue-NX8DgwND.cjs"),Tt=require("./getJenks-BzJvhy_H.cjs"),bt=require("./GraphContainer-B1EDxJ0S.cjs");function Wt(d){const{data:e,colorDomain:r,colors:n,mapData:_,colorLegendTitle:E,categorical:L,height:f,width:h,scale:x,centerPoint:T,tooltip:Z,mapBorderWidth:Q,mapBorderColor:xe,mapNoDataColor:ge,onSeriesMouseOver:ee,showColorScale:fe,zoomScaleExtend:Oe,zoomTranslateExtend:qe,highlightedIds:b,onSeriesMouseClick:te,mapProperty:g,resetSelectionOnDoubleClick:ye,detailsOnClick:H,styles:Ie,classNames:oe,mapProjection:D,zoomInteraction:S,animate:k,dimmedOpacity:N,customLayers:re,collapseColorScaleByDefault:ve,zoomAndCenterByHighlightedIds:je,projectionRotate:W,rewindCoordinatesInMapData:be}=d,y=c.useMemo(()=>be?F.index_default(_,{reverse:!0}):_,[_,be]),[w,M]=c.useState(void 0),V=c.useRef(null),[Pe,ae]=c.useState(ve===void 0?!(h<680):!ve),[u,p]=c.useState(void 0),[U,ne]=c.useState(void 0),[Ee,se]=c.useState(void 0),[X,$]=c.useState(void 0),O=c.useRef(null),Y=zt.useInView(O,{once:k.once,amount:k.amount}),ke=c.useRef(null),ze=L?It.ordinal().domain(r).range(n):Pt.threshold().domain(r).range(n);c.useEffect(()=>{const o=xt.select(ke.current),a=xt.select(O.current),j=i=>{if(S==="noZoom")return!1;if(S==="button")return!i.type.includes("wheel");const le=i.type==="wheel",ce=i.type.startsWith("touch"),Se=i.type==="mousedown"||i.type==="mousemove";return ce?!0:le?S==="scroll"?!0:i.ctrlKey:Se&&!i.button&&!i.ctrlKey},C=F.zoom().scaleExtent(Oe).translateExtent(qe||[[-20,-20],[h+20,f+20]]).filter(j).on("zoom",({transform:i})=>{o.attr("transform",i)});a.call(C),V.current=C},[f,h,S]);const v=F.index_default$1({...y,features:je?y.features.filter(o=>(b||[]).length===0||b.indexOf(o.properties[g])!==-1):y.features}),R=St.index_default({...y,features:je?y.features.filter(o=>(b||[]).length===0||b.indexOf(o.properties[g])!==-1):y.features}),q=(v[2]-v[0])*1.15,we=(v[3]-v[1])*1.15,Re=h*190/960*360/q,Ce=f*190/678*180/we,I=x*Math.min(Re,Ce),De=D==="mercator"?F.geoMercator().rotate(W).center(T||R.geometry.coordinates).translate([h/2,f/2]).scale(I):D==="equalEarth"?F.geoEqualEarth().rotate(W).center(T||R.geometry.coordinates).translate([h/2,f/2]).scale(I):D==="naturalEarth"?F.geoNaturalEarth1().rotate(W).center(T||R.geometry.coordinates).translate([h/2,f/2]).scale(I):D==="orthographic"?F.geoOrthographic().rotate(W).center(T||R.geometry.coordinates).translate([h/2,f/2]).scale(I):F.geoAlbersUsa().rotate(W).center(T||R.geometry.coordinates).translate([h/2,f/2]).scale(I),G=F.geoPath().projection(De),ie=o=>{if(!O.current||!V.current)return;xt.select(O.current).call(V.current.scaleBy,o==="in"?1.2:1/1.2)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:"relative",children:[t.jsxRuntimeExports.jsx(Qe.motion.svg,{width:`${h}px`,height:`${f}px`,viewBox:`0 0 ${h} ${f}`,ref:O,direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{ref:ke,children:[re.filter(o=>o.position==="before").map(o=>o.layer),y.features.map((o,a)=>{if(!o.properties?.[g])return null;const j=G(o);return j?t.jsxRuntimeExports.jsx(Qe.motion.g,{opacity:w?N:b.length!==0?b.indexOf(o.properties[g])!==-1?1:N:1,children:t.jsxRuntimeExports.jsx("path",{d:j,style:{stroke:xe,strokeWidth:Q,fill:ge}})},a):null}),t.jsxRuntimeExports.jsx(At.AnimatePresence,{children:e.map(o=>{const a=y.features.findIndex(i=>o.id===i.properties[g]);if(a===-1)return null;const j=G(y.features[a]);if(!j)return null;const C=Ot.checkIfNullOrUndefined(o.x)?ge:ze(o.x);return t.jsxRuntimeExports.jsx(Qe.motion.g,{className:"undp-map-shapes",variants:{initial:{opacity:0},whileInView:{opacity:w?w===C?1:N:b.length!==0?b.indexOf(o.id)!==-1?1:N:1,transition:{duration:k.duration}}},initial:"initial",animate:Y?"whileInView":"initial",exit:{opacity:0,transition:{duration:k.duration}},onMouseEnter:i=>{ne(o),$(i.clientY),se(i.clientX),ee?.(o)},onMouseMove:i=>{ne(o),$(i.clientY),se(i.clientX)},onMouseLeave:()=>{ne(void 0),se(void 0),$(void 0),ee?.(void 0)},onClick:()=>{(te||H)&&(Dt.isEqual(u,o)&&ye?(p(void 0),te?.(void 0)):(p(o),te?.(o)))},children:t.jsxRuntimeExports.jsx(Qe.motion.path,{d:j,variants:{initial:{fill:C,opacity:0},whileInView:{fill:C,opacity:1,transition:{duration:k.duration}}},initial:"initial",animate:Y?"whileInView":"initial",exit:{opacity:0,transition:{duration:k.duration}},style:{stroke:xe,strokeWidth:Q}},`${o.id}`)},o.id)})}),U?y.features.filter(o=>o.properties[g]===U.id).map((o,a)=>t.jsxRuntimeExports.jsx("path",{d:G(o)||"",className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},a)):null,re.filter(o=>o.position==="after").map(o=>o.layer)]})}),fe===!1?null:t.jsxRuntimeExports.jsx("div",{className:t.mo("absolute left-4 bottom-4 map-color-legend",oe?.colorLegend),children:Pe?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{ae(!1)},children:t.jsxRuntimeExports.jsx(gt.X,{})}),t.jsxRuntimeExports.jsxs("div",{className:"color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]",style:{width:L?void 0:"340px"},children:[E&&E!==""?t.jsxRuntimeExports.jsx(jt._,{size:"xs",marginBottom:"xs",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:E}):null,L?t.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:r.map((o,a)=>t.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{M(n[a%n.length])},onMouseLeave:()=>{M(void 0)},children:[t.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:n[a%n.length]}}),t.jsxRuntimeExports.jsx(jt._,{size:"sm",marginBottom:"none",leading:"none",children:o})]},a))}):t.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{children:[r.map((o,a)=>t.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{M(n[a])},onMouseLeave:()=>{M(void 0)},className:"cursor-pointer",children:[t.jsxRuntimeExports.jsx("rect",{x:a*320/n.length+1,y:1,width:320/n.length-2,height:8,className:w===n[a]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:n[a],...w===n[a]?{}:{stroke:n[a]}}}),t.jsxRuntimeExports.jsx("text",{x:(a+1)*320/n.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:Nt.numberFormattingFunction(o,"NA")})]},a)),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{M(n[r.length])},onMouseLeave:()=>{M(void 0)},x:r.length*320/n.length+1,y:1,width:320/n.length-2,height:8,className:`cursor-pointer ${w===n[r.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:n[r.length],...w===n[r.length]?{}:{stroke:n[r.length]}}})})]})})]})]}):t.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start map-legend-button",onClick:()=>{ae(!0)},children:t.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),S==="button"&&t.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[t.jsxRuntimeExports.jsx("button",{onClick:()=>ie("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),t.jsxRuntimeExports.jsx("button",{onClick:()=>ie("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),H&&u!==void 0?t.jsxRuntimeExports.jsx(qt.DetailsModal,{body:H,data:u,setData:p,className:oe?.modal}):null,U&&Z&&Ee&&X?t.jsxRuntimeExports.jsx(Mt.Tooltip,{data:U,body:Z,xPos:Ee,yPos:X,backgroundStyle:Ie?.tooltip,className:oe?.tooltip}):null]})}function $t(d){const e=t.compilerRuntimeExports.c(126),{data:r,mapData:n,graphTitle:_,colors:E,sources:L,graphDescription:f,height:h,width:x,footNote:T,colorDomain:Z,colorLegendTitle:Q,scaleType:xe,scale:ge,centerPoint:ee,padding:fe,mapBorderWidth:Oe,mapNoDataColor:qe,backgroundColor:b,mapBorderColor:te,relativeHeight:g,tooltip:ye,onSeriesMouseOver:H,isWorldMap:Ie,showColorScale:oe,zoomScaleExtend:D,zoomTranslateExtend:S,graphID:k,highlightedIds:N,onSeriesMouseClick:re,mapProperty:ve,graphDownload:je,dataDownload:W,showAntarctica:be,language:y,minHeight:w,theme:M,ariaLabel:V,resetSelectionOnDoubleClick:Pe,detailsOnClick:ae,styles:u,classNames:p,mapProjection:U,zoomInteraction:ne,animate:Ee,dimmedOpacity:se,customLayers:X,timeline:$,collapseColorScaleByDefault:O,projectionRotate:Y,zoomAndCenterByHighlightedIds:ke,rewindCoordinatesInMapData:ze}=d,v=n===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":n,R=T===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":T,q=xe===void 0?"threshold":xe,we=ge===void 0?.95:ge,Re=Oe===void 0?.5:Oe,Ce=qe===void 0?et.Colors.light.graphNoData:qe,I=b===void 0?!1:b,De=te===void 0?et.Colors.light.grays["gray-500"]:te,G=Ie===void 0?!0:Ie,ie=oe===void 0?!0:oe;let o;e[0]!==D?(o=D===void 0?[.8,6]:D,e[0]=D,e[1]=o):o=e[1];const a=o;let j;e[2]!==N?(j=N===void 0?[]:N,e[2]=N,e[3]=j):j=e[3];const C=j,i=ve===void 0?"ISO3":ve,le=je===void 0?!1:je,ce=W===void 0?!1:W,Se=be===void 0?!1:be,tt=y===void 0?"en":y,P=w===void 0?0:w,J=M===void 0?"light":M,ot=Pe===void 0?!0:Pe,rt=U===void 0?"naturalEarth":U,at=ne===void 0?"button":ne,Ae=Ee===void 0?!1:Ee,nt=se===void 0?.3:se;let Be;e[4]!==X?(Be=X===void 0?[]:X,e[4]=X,e[5]=Be):Be=e[5];const st=Be;let Fe;e[6]!==$?(Fe=$===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:$,e[6]=$,e[7]=Fe):Fe=e[7];const s=Fe;let _e;e[8]!==Y?(_e=Y===void 0?[0,0]:Y,e[8]=Y,e[9]=_e):_e=e[9];const it=_e,lt=ke===void 0?!1:ke,ct=ze===void 0?!0:ze,[K,Et]=c.useState(0),[Ne,kt]=c.useState(0),[z,wt]=c.useState(s.autoplay);let Me;if(e[10]!==r||e[11]!==s.dateFormat){let m;e[13]!==s.dateFormat?(m=B=>vt.parse(`${B.date}`,s.dateFormat||"yyyy",new Date).getTime(),e[13]=s.dateFormat,e[14]=m):m=e[14],Me=[...new Set(r.filter(Zt).map(m))],Me.sort(Kt),e[10]=r,e[11]=s.dateFormat,e[12]=Me}else Me=e[12];const l=Me,[A,dt]=c.useState(s.autoplay?0:l.length-1),[de,Rt]=c.useState(void 0),ut=c.useRef(null),ft=c.useRef(null);let Le,Te;e[15]===Symbol.for("react.memo_cache_sentinel")?(Le=()=>{const m=new ResizeObserver(B=>{Et(B[0].target.clientWidth||620),kt(B[0].target.clientHeight||480)});return ut.current&&m.observe(ut.current),()=>m.disconnect()},Te=[],e[15]=Le,e[16]=Te):(Le=e[15],Te=e[16]),c.useEffect(Le,Te);let We;e[17]===Symbol.for("react.memo_cache_sentinel")?(We=m=>{Rt(m)},e[17]=We):We=e[17];const $e=c.useEffectEvent(We);let Ge;e[18]!==v||e[19]!==$e?(Ge=()=>{typeof v=="string"?_t.fetchAndParseJSON(v).then(B=>{$e(B)}):$e(v)},e[18]=v,e[19]=$e,e[20]=Ge):Ge=e[20];let He;e[21]!==v?(He=[v],e[21]=v,e[22]=He):He=e[22],c.useEffect(Ge,He);let Ve;e[23]!==Z||e[24]!==E?.length||e[25]!==r||e[26]!==q?(Ve=Z||(q==="categorical"?Lt.getUniqValue(r,"x"):Tt.getJenks(r.map(Jt),E?.length||4)),e[23]=Z,e[24]=E?.length,e[25]=r,e[26]=q,e[27]=Ve):Ve=e[27];const Ue=Ve;let Xe,Ye;e[28]!==z||e[29]!==s.speed||e[30]!==l?(Xe=()=>{const m=setInterval(()=>{dt(B=>B<l.length-1?B+1:0)},(s.speed||2)*1e3);return z||clearInterval(m),()=>clearInterval(m)},Ye=[l,z,s.speed],e[28]=z,e[29]=s.speed,e[30]=l,e[31]=Xe,e[32]=Ye):(Xe=e[31],Ye=e[32]),c.useEffect(Xe,Ye);const pt=s.dateFormat||"yyyy";let Je;e[33]!==A||e[34]!==pt||e[35]!==s.showOnlyActiveDate||e[36]!==l?(Je=yt.getSliderMarks(l,A,s.showOnlyActiveDate,pt),e[33]=A,e[34]=pt,e[35]=s.showOnlyActiveDate,e[36]=l,e[37]=Je):Je=e[37];const Ke=Je,mt=p?.graphContainer,ht=u?.graphContainer;let ue;e[38]!==p?.description||e[39]!==p?.title||e[40]!==r||e[41]!==ce||e[42]!==f||e[43]!==le||e[44]!==_||e[45]!==u?.description||e[46]!==u?.title||e[47]!==x?(ue=_||f||le||ce?t.jsxRuntimeExports.jsx(Ft.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:p?.title,description:p?.description},graphTitle:_,graphDescription:f,width:x,graphDownload:le?ft:void 0,dataDownload:ce?r.map(Yt).filter(Xt).length>0?r.map(Ut).filter(Vt):r.filter(Ht):null}):null,e[38]=p?.description,e[39]=p?.title,e[40]=r,e[41]=ce,e[42]=f,e[43]=le,e[44]=_,e[45]=u?.description,e[46]=u?.title,e[47]=x,e[48]=ue):ue=e[48];let pe;e[49]!==A||e[50]!==Ke||e[51]!==z||e[52]!==s.enabled||e[53]!==l?(pe=s.enabled&&l.length>0&&Ke?t.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[t.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{wt(!z)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":z?"Click to pause animation":"Click to play animation",children:z?t.jsxRuntimeExports.jsx(gt.Pause,{}):t.jsxRuntimeExports.jsx(gt.Play,{})}),t.jsxRuntimeExports.jsx(yt.Nr,{min:l[0],max:l[l.length-1],marks:Ke,step:null,defaultValue:l[l.length-1],value:l[A],onChangeComplete:m=>{dt(l.indexOf(m))},onChange:m=>{dt(l.indexOf(m))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[49]=A,e[50]=Ke,e[51]=z,e[52]=s.enabled,e[53]=l,e[54]=pe):pe=e[54];let me;e[55]!==Ae||e[56]!==ee||e[57]!==p||e[58]!==O||e[59]!==Q||e[60]!==E||e[61]!==st||e[62]!==r||e[63]!==ae||e[64]!==nt||e[65]!==Ue||e[66]!==h||e[67]!==C||e[68]!==A||e[69]!==G||e[70]!==De||e[71]!==Re||e[72]!==Ce||e[73]!==rt||e[74]!==i||e[75]!==de||e[76]!==P||e[77]!==re||e[78]!==H||e[79]!==it||e[80]!==g||e[81]!==ot||e[82]!==ct||e[83]!==we||e[84]!==q||e[85]!==Se||e[86]!==ie||e[87]!==u||e[88]!==Ne||e[89]!==K||e[90]!==J||e[91]!==s.dateFormat||e[92]!==s.enabled||e[93]!==ye||e[94]!==l||e[95]!==x||e[96]!==lt||e[97]!==at||e[98]!==a||e[99]!==S?(me=t.jsxRuntimeExports.jsx(bt.GraphArea,{ref:ut,children:K&&Ne&&de?t.jsxRuntimeExports.jsx(Wt,{data:r.filter(m=>s.enabled?m.date===vt.format(new Date(l[A]),s.dateFormat||"yyyy"):m),mapData:Se?de:{...de,features:de.features.filter(Gt)},colorDomain:Ue,width:K,height:Ne,scale:we,centerPoint:ee,colors:E||(q==="categorical"?et.Colors[J].categoricalColors.colors:et.Colors[J].sequentialColors[`neutralColorsx0${Ue.length+1}`]),colorLegendTitle:Q,mapBorderWidth:Re,mapNoDataColor:Ce,categorical:q==="categorical",mapBorderColor:De,tooltip:ye,onSeriesMouseOver:H,isWorldMap:G,showColorScale:ie,zoomScaleExtend:a,zoomTranslateExtend:S,onSeriesMouseClick:re,mapProperty:i,highlightedIds:C,resetSelectionOnDoubleClick:ot,styles:u,classNames:p,detailsOnClick:ae,mapProjection:rt||(G?"naturalEarth":"mercator"),zoomInteraction:at,dimmedOpacity:nt,animate:Ae===!0?{duration:.5,once:!0,amount:.5}:Ae||{duration:0,once:!0,amount:0},customLayers:st,zoomAndCenterByHighlightedIds:lt,collapseColorScaleByDefault:O,projectionRotate:it,rewindCoordinatesInMapData:ct}):t.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(P,h||(g?P?(x||K)*g>P?(x||K)*g:P:(x||K)*g:Ne))}px`},className:"flex items-center justify-center",children:t.jsxRuntimeExports.jsx(Ct.w,{"aria-label":"Loading graph"})})}),e[55]=Ae,e[56]=ee,e[57]=p,e[58]=O,e[59]=Q,e[60]=E,e[61]=st,e[62]=r,e[63]=ae,e[64]=nt,e[65]=Ue,e[66]=h,e[67]=C,e[68]=A,e[69]=G,e[70]=De,e[71]=Re,e[72]=Ce,e[73]=rt,e[74]=i,e[75]=de,e[76]=P,e[77]=re,e[78]=H,e[79]=it,e[80]=g,e[81]=ot,e[82]=ct,e[83]=we,e[84]=q,e[85]=Se,e[86]=ie,e[87]=u,e[88]=Ne,e[89]=K,e[90]=J,e[91]=s.dateFormat,e[92]=s.enabled,e[93]=ye,e[94]=l,e[95]=x,e[96]=lt,e[97]=at,e[98]=a,e[99]=S,e[100]=me):me=e[100];let he;e[101]!==p?.footnote||e[102]!==p?.source||e[103]!==R||e[104]!==L||e[105]!==u?.footnote||e[106]!==u?.source||e[107]!==x?(he=L||R?t.jsxRuntimeExports.jsx(Bt.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},classNames:{footnote:p?.footnote,source:p?.source},sources:L,footNote:R,width:x}):null,e[101]=p?.footnote,e[102]=p?.source,e[103]=R,e[104]=L,e[105]=u?.footnote,e[106]=u?.source,e[107]=x,e[108]=he):he=e[108];let Ze;return e[109]!==V||e[110]!==I||e[111]!==k||e[112]!==h||e[113]!==tt||e[114]!==P||e[115]!==fe||e[116]!==g||e[117]!==mt||e[118]!==ht||e[119]!==ue||e[120]!==pe||e[121]!==me||e[122]!==he||e[123]!==J||e[124]!==x?(Ze=t.jsxRuntimeExports.jsxs(bt.GraphContainer,{className:mt,style:ht,id:k,ref:ft,"aria-label":V,backgroundColor:I,theme:J,language:tt,minHeight:P,width:x,height:h,relativeHeight:g,padding:fe,children:[ue,pe,me,he]}),e[109]=V,e[110]=I,e[111]=k,e[112]=h,e[113]=tt,e[114]=P,e[115]=fe,e[116]=g,e[117]=mt,e[118]=ht,e[119]=ue,e[120]=pe,e[121]=me,e[122]=he,e[123]=J,e[124]=x,e[125]=Ze):Ze=e[125],Ze}function Gt(d){return d.properties.NAME!=="Antarctica"}function Ht(d){return d!==void 0}function Vt(d){return d!==void 0}function Ut(d){return d.data}function Xt(d){return d!==void 0}function Yt(d){return d.data}function Jt(d){return d.x}function Kt(d,e){return d-e}function Zt(d){return d.date}exports.ChoroplethMap=$t;
|
|
2
2
|
//# sourceMappingURL=ChoroplethMap.cjs.map
|
package/dist/ChoroplethMap.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { j as t, m as wt, c as Dt } from "./index-CHPV5EwG-
|
|
1
|
+
import { j as t, m as wt, c as Dt } from "./index-CHPV5EwG-BCLAYDCV.js";
|
|
2
2
|
import { useMemo as Ct, useState as j, useRef as Ie, useEffect as tt, useEffectEvent as Nt } from "react";
|
|
3
|
-
import { g as St, N as Ot } from "./getSliderMarks-
|
|
4
|
-
import { w as Mt } from "./Spinner
|
|
3
|
+
import { g as St, N as Ot } from "./getSliderMarks-vXsR8RrR.js";
|
|
4
|
+
import { w as Mt } from "./Spinner-CtJETd5V.js";
|
|
5
5
|
import { f as It, p as Et } from "./parse-Dv4of-PN.js";
|
|
6
6
|
import { i as zt } from "./index-Bwrro8-q.js";
|
|
7
|
-
import { i as Pt, z as At, a as Bt, g as Lt, b as _t, c as Ft, d as Wt, e as Tt, f as $t } from "./index-
|
|
8
|
-
import { _ as xt } from "./Typography-
|
|
7
|
+
import { i as Pt, z as At, a as Bt, g as Lt, b as _t, c as Ft, d as Wt, e as Tt, f as $t } from "./index-CKpKc9DR.js";
|
|
8
|
+
import { _ as xt } from "./Typography-HicNIA61.js";
|
|
9
9
|
import { i as Ht } from "./index-DCsFBfJ_.js";
|
|
10
10
|
import { n as Gt } from "./numberFormattingFunction-14YCbkN2.js";
|
|
11
|
-
import { T as Vt } from "./Tooltip-
|
|
11
|
+
import { T as Vt } from "./Tooltip-CohiIbLZ.js";
|
|
12
12
|
import { c as Rt } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
13
|
-
import { X as Ut, P as qt, e as Xt } from "./index-
|
|
14
|
-
import { D as Yt } from "./DetailsModal-
|
|
13
|
+
import { X as Ut, P as qt, e as Xt } from "./index-CZ0elhKR.js";
|
|
14
|
+
import { D as Yt } from "./DetailsModal-C3qlUyFK.js";
|
|
15
15
|
import { o as Jt } from "./ordinal-CHaxGJ_l.js";
|
|
16
16
|
import { t as Kt } from "./threshold-DFfqcDMa.js";
|
|
17
17
|
import { s as ft } from "./select-DKy99ogv.js";
|
|
18
|
-
import { m as Qe } from "./proxy
|
|
19
|
-
import { u as Zt } from "./use-in-view-
|
|
20
|
-
import { A as Qt } from "./index-
|
|
18
|
+
import { m as Qe } from "./proxy--_f6k3NR.js";
|
|
19
|
+
import { u as Zt } from "./use-in-view-DqvKAveg.js";
|
|
20
|
+
import { A as Qt } from "./index-Co3YGYe1.js";
|
|
21
21
|
import { GraphFooter as eo } from "./GraphFooter.js";
|
|
22
22
|
import { GraphHeader as to } from "./GraphHeader.js";
|
|
23
23
|
import { Colors as et } from "./Colors.js";
|
|
24
24
|
import { f as oo } from "./fetchAndParseData-BAXhgTDM.js";
|
|
25
25
|
import { g as ro } from "./getUniqValue-DsqSii6M.js";
|
|
26
26
|
import { g as ao } from "./getJenks-DTCcQSDi.js";
|
|
27
|
-
import { a as io, G as no } from "./GraphContainer-
|
|
27
|
+
import { a as io, G as no } from "./GraphContainer-DwMxWRCi.js";
|
|
28
28
|
function so(c) {
|
|
29
29
|
const {
|
|
30
30
|
data: e,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./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-BDR7MlMo.cjs");require("./GraphFooter.cjs");require("./GraphHeader.cjs");require("./ColorLegendWithMouseOver.cjs");require("./Colors.cjs");require("./EmptyState-N1eHt3vq.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-B5ggV1vg.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-D807L58h.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.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-HicNIA61.js";
|
|
3
3
|
import { Colors as A } from "./Colors.js";
|
|
4
4
|
function R(z) {
|
|
5
5
|
const e = T.c(29), {
|
|
@@ -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-HicNIA61.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
|