@undp/data-viz 1.4.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/dist/AreaChart.cjs +1 -1
  2. package/dist/AreaChart.js +21 -21
  3. package/dist/BarGraph.cjs +1 -1
  4. package/dist/BarGraph.js +7 -7
  5. package/dist/BeeSwarmChart.cjs +1 -1
  6. package/dist/BeeSwarmChart.js +2 -2
  7. package/dist/BiVariateChoroplethMap.cjs +1 -1
  8. package/dist/BiVariateChoroplethMap.js +5 -5
  9. package/dist/BulletChart.cjs +1 -1
  10. package/dist/BulletChart.js +14 -14
  11. package/dist/ButterflyChart.cjs +1 -1
  12. package/dist/ButterflyChart.js +9 -9
  13. package/dist/ChoroplethMap.cjs +1 -1
  14. package/dist/ChoroplethMap.js +9 -9
  15. package/dist/CirclePackingGraph.cjs +1 -1
  16. package/dist/CirclePackingGraph.js +1 -1
  17. package/dist/CopyTextButton.cjs +7 -7
  18. package/dist/CopyTextButton.cjs.map +1 -1
  19. package/dist/CopyTextButton.js +4 -4
  20. package/dist/CopyTextButton.js.map +1 -1
  21. package/dist/DataCards.cjs +9 -9
  22. package/dist/DataCards.cjs.map +1 -1
  23. package/dist/DataCards.js +93 -93
  24. package/dist/DataCards.js.map +1 -1
  25. package/dist/DifferenceLineChart.cjs +1 -1
  26. package/dist/DifferenceLineChart.js +18 -18
  27. package/dist/DonutChart.cjs +1 -1
  28. package/dist/DonutChart.js +1 -1
  29. package/dist/DotDensityMap.cjs +1 -1
  30. package/dist/DotDensityMap.js +8 -8
  31. package/dist/{DropdownSelect-0I2QxaVy.cjs → DropdownSelect-BmE5JaeE.cjs} +6 -6
  32. package/dist/{DropdownSelect-0I2QxaVy.cjs.map → DropdownSelect-BmE5JaeE.cjs.map} +1 -1
  33. package/dist/{DropdownSelect-CDC9lEqU.js → DropdownSelect-CeHog_ih.js} +4 -4
  34. package/dist/{DropdownSelect-CDC9lEqU.js.map → DropdownSelect-CeHog_ih.js.map} +1 -1
  35. package/dist/DualAxisLineChart.cjs +1 -1
  36. package/dist/DualAxisLineChart.js +15 -15
  37. package/dist/DumbbellChart.cjs +1 -1
  38. package/dist/DumbbellChart.js +13 -13
  39. package/dist/GeoHubMap.cjs +1 -1
  40. package/dist/GeoHubMap.js +2 -2
  41. package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
  42. package/dist/GeoHubMapWithLayerSelection.js +2 -2
  43. package/dist/{GraphEl-B6SoGRFW.cjs → GraphEl-B5gAX1IQ.cjs} +2 -2
  44. package/dist/{GraphEl-B6SoGRFW.cjs.map → GraphEl-B5gAX1IQ.cjs.map} +1 -1
  45. package/dist/{GraphEl-Cw2tDUb3.js → GraphEl-BdIyscdt.js} +3 -3
  46. package/dist/{GraphEl-Cw2tDUb3.js.map → GraphEl-BdIyscdt.js.map} +1 -1
  47. package/dist/GriddedGraphs.cjs +1 -1
  48. package/dist/GriddedGraphs.js +4 -4
  49. package/dist/GriddedGraphsFromConfig.cjs +1 -1
  50. package/dist/GriddedGraphsFromConfig.js +1 -1
  51. package/dist/HeatMap.cjs +1 -1
  52. package/dist/HeatMap.js +10 -10
  53. package/dist/Histogram.cjs +1 -1
  54. package/dist/Histogram.js +1 -1
  55. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  56. package/dist/LineChartWithConfidenceInterval.js +21 -21
  57. package/dist/{Modal-CUU6ZK3U.js → Modal-DVVwpKhP.js} +2 -2
  58. package/dist/{Modal-CUU6ZK3U.js.map → Modal-DVVwpKhP.js.map} +1 -1
  59. package/dist/{Modal-C_dl0EtQ.cjs → Modal-tXZlLE5s.cjs} +4 -4
  60. package/dist/{Modal-C_dl0EtQ.cjs.map → Modal-tXZlLE5s.cjs.map} +1 -1
  61. package/dist/MultiGraphDashboard.cjs +1 -1
  62. package/dist/MultiGraphDashboard.js +3 -3
  63. package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
  64. package/dist/MultiGraphDashboardFromConfig.js +1 -1
  65. package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
  66. package/dist/MultiGraphDashboardWideToLongFormat.js +3 -3
  67. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
  68. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +1 -1
  69. package/dist/MultiLineAltChart.cjs +1 -1
  70. package/dist/MultiLineAltChart.js +21 -21
  71. package/dist/MultiLineChart.cjs +1 -1
  72. package/dist/MultiLineChart.js +19 -19
  73. package/dist/ParetoChart.cjs +1 -1
  74. package/dist/ParetoChart.js +12 -12
  75. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
  76. package/dist/PerformanceIntensiveMultiGraphDashboard.js +3 -3
  77. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
  78. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +1 -1
  79. package/dist/PerformanceIntensiveScrollStory.cjs +1 -1
  80. package/dist/PerformanceIntensiveScrollStory.js +2 -2
  81. package/dist/RadarChart.cjs +1 -1
  82. package/dist/RadarChart.js +8 -8
  83. package/dist/{ReferenceLine-CuFMk0cI.cjs → ReferenceLine-CFVBBN__.cjs} +2 -2
  84. package/dist/{ReferenceLine-CuFMk0cI.cjs.map → ReferenceLine-CFVBBN__.cjs.map} +1 -1
  85. package/dist/{ReferenceLine-C1GpoG9d.js → ReferenceLine-CfAW3vKJ.js} +2 -2
  86. package/dist/{ReferenceLine-C1GpoG9d.js.map → ReferenceLine-CfAW3vKJ.js.map} +1 -1
  87. package/dist/{RegressionLine-BFwDCTUU.js → RegressionLine-mH7UKOPi.js} +3 -3
  88. package/dist/{RegressionLine-BFwDCTUU.js.map → RegressionLine-mH7UKOPi.js.map} +1 -1
  89. package/dist/{RegressionLine-7_rKTHN_.cjs → RegressionLine-xKdiJ8sw.cjs} +2 -2
  90. package/dist/{RegressionLine-7_rKTHN_.cjs.map → RegressionLine-xKdiJ8sw.cjs.map} +1 -1
  91. package/dist/SankeyChart.cjs +1 -1
  92. package/dist/SankeyChart.js +4 -4
  93. package/dist/ScatterPlot.cjs +1 -1
  94. package/dist/ScatterPlot.js +13 -13
  95. package/dist/ScrollStory.cjs +1 -1
  96. package/dist/ScrollStory.js +2 -2
  97. package/dist/SimpleLineChart.cjs +1 -1
  98. package/dist/SimpleLineChart.js +20 -20
  99. package/dist/SingleGraphDashboard.cjs +1 -1
  100. package/dist/SingleGraphDashboard.js +4 -4
  101. package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
  102. package/dist/SingleGraphDashboardFromConfig.js +1 -1
  103. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
  104. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +1 -1
  105. package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
  106. package/dist/SingleGraphDashboardThreeDGraphs.js +3 -3
  107. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
  108. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +1 -1
  109. package/dist/SlopeChart.cjs +1 -1
  110. package/dist/SlopeChart.js +7 -7
  111. package/dist/StripChart.cjs +1 -1
  112. package/dist/StripChart.js +9 -9
  113. package/dist/ThreeDGlobe.cjs +1 -1
  114. package/dist/ThreeDGlobe.js +2 -2
  115. package/dist/TreeMapGraph.cjs +1 -1
  116. package/dist/TreeMapGraph.js +4 -4
  117. package/dist/UnitChart.cjs +1 -1
  118. package/dist/UnitChart.js +3 -3
  119. package/dist/{XAxesLabels-DQFo_z2R.js → XAxesLabels-CaV2q-6H.js} +2 -2
  120. package/dist/{XAxesLabels-DQFo_z2R.js.map → XAxesLabels-CaV2q-6H.js.map} +1 -1
  121. package/dist/{XAxesLabels-CJMQbfVy.cjs → XAxesLabels-OjBNl_lS.cjs} +2 -2
  122. package/dist/{XAxesLabels-CJMQbfVy.cjs.map → XAxesLabels-OjBNl_lS.cjs.map} +1 -1
  123. package/dist/{YAxesLabels-H5-002X5.js → YAxesLabels-CPGZjmZJ.js} +2 -2
  124. package/dist/{YAxesLabels-H5-002X5.js.map → YAxesLabels-CPGZjmZJ.js.map} +1 -1
  125. package/dist/{YAxesLabels-BXLTX7AI.cjs → YAxesLabels-D8IydyZj.cjs} +2 -2
  126. package/dist/{YAxesLabels-BXLTX7AI.cjs.map → YAxesLabels-D8IydyZj.cjs.map} +1 -1
  127. package/dist/{checkIfMultiple-Do4kADNr.cjs → checkIfMultiple-BXbHUCWM.cjs} +6 -6
  128. package/dist/{checkIfMultiple-Do4kADNr.cjs.map → checkIfMultiple-BXbHUCWM.cjs.map} +1 -1
  129. package/dist/{checkIfMultiple-CYp3vADF.js → checkIfMultiple-ChTJk2Tk.js} +5 -5
  130. package/dist/{checkIfMultiple-CYp3vADF.js.map → checkIfMultiple-ChTJk2Tk.js.map} +1 -1
  131. package/dist/{customArea-CaxScFmW.js → customArea-B-dWU0zZ.js} +2 -2
  132. package/dist/{customArea-CaxScFmW.js.map → customArea-B-dWU0zZ.js.map} +1 -1
  133. package/dist/{customArea-BYNyxAkm.cjs → customArea-CK768gCn.cjs} +2 -2
  134. package/dist/{customArea-BYNyxAkm.cjs.map → customArea-CK768gCn.cjs.map} +1 -1
  135. package/dist/{fetchAndParseData-Bcmr659B.js → fetchAndParseData-4gsYTy6_.js} +3 -3
  136. package/dist/fetchAndParseData-4gsYTy6_.js.map +1 -0
  137. package/dist/{fetchAndParseData-DmgQtB9n.cjs → fetchAndParseData-CQyVGCul.cjs} +6 -6
  138. package/dist/fetchAndParseData-CQyVGCul.cjs.map +1 -0
  139. package/dist/fetchAndParseData.cjs +1 -1
  140. package/dist/fetchAndParseData.js +1 -1
  141. package/dist/index-BW8iNx7E.cjs +10 -0
  142. package/dist/index-BW8iNx7E.cjs.map +1 -0
  143. package/dist/index-CNvov0eg.js +122 -0
  144. package/dist/index-CNvov0eg.js.map +1 -0
  145. package/dist/{index-D_n8aamX.cjs → index-CZLvTu6p.cjs} +2 -2
  146. package/dist/{index-D_n8aamX.cjs.map → index-CZLvTu6p.cjs.map} +1 -1
  147. package/dist/{index-n_RI8T0n.js → index-Cdcfp4nk.js} +2 -2
  148. package/dist/{index-n_RI8T0n.js.map → index-Cdcfp4nk.js.map} +1 -1
  149. package/dist/{index-BVnYktl4.js → index-DGAaLNu9.js} +2 -2
  150. package/dist/{index-BVnYktl4.js.map → index-DGAaLNu9.js.map} +1 -1
  151. package/dist/{index-CylX-pWB.cjs → index-DNj994Pv.cjs} +2 -2
  152. package/dist/{index-CylX-pWB.cjs.map → index-DNj994Pv.cjs.map} +1 -1
  153. package/dist/index.cjs +1 -1
  154. package/dist/index.js +3 -3
  155. package/dist/proxy-BHRoeZgd.cjs +2 -0
  156. package/dist/proxy-BHRoeZgd.cjs.map +1 -0
  157. package/dist/{proxy-DJxJg1kD.js → proxy-CkpFesk1.js} +4123 -4075
  158. package/dist/proxy-CkpFesk1.js.map +1 -0
  159. package/dist/style.css +1 -1
  160. package/dist/transformData.cjs +1 -1
  161. package/dist/transformData.js +2 -2
  162. package/dist/{transformDataForGraphFromFile-D9G3ToQf.cjs → transformDataForGraphFromFile-B1A0AS-Z.cjs} +2 -2
  163. package/dist/{transformDataForGraphFromFile-D9G3ToQf.cjs.map → transformDataForGraphFromFile-B1A0AS-Z.cjs.map} +1 -1
  164. package/dist/{transformDataForGraphFromFile-CA0rw80A.js → transformDataForGraphFromFile-BCjsizvb.js} +2 -2
  165. package/dist/{transformDataForGraphFromFile-CA0rw80A.js.map → transformDataForGraphFromFile-BCjsizvb.js.map} +1 -1
  166. package/dist/{use-in-view-BCmzDU2O.cjs → use-in-view-sQJZ_xDO.cjs} +2 -2
  167. package/dist/use-in-view-sQJZ_xDO.cjs.map +1 -0
  168. package/dist/{use-in-view-BAHrBy6b.js → use-in-view-yS6jzJAp.js} +2 -2
  169. package/dist/use-in-view-yS6jzJAp.js.map +1 -0
  170. package/dist/x-BBpi7a_7-Dz2vKSfu.cjs +27 -0
  171. package/dist/x-BBpi7a_7-Dz2vKSfu.cjs.map +1 -0
  172. package/dist/x-BBpi7a_7-WVdj1j6r.js +106 -0
  173. package/dist/x-BBpi7a_7-WVdj1j6r.js.map +1 -0
  174. package/package.json +50 -51
  175. package/dist/fetchAndParseData-Bcmr659B.js.map +0 -1
  176. package/dist/fetchAndParseData-DmgQtB9n.cjs.map +0 -1
  177. package/dist/index-BxAUvrua.js +0 -120
  178. package/dist/index-BxAUvrua.js.map +0 -1
  179. package/dist/index-DVOJ7vxH.cjs +0 -10
  180. package/dist/index-DVOJ7vxH.cjs.map +0 -1
  181. package/dist/proxy-DJxJg1kD.js.map +0 -1
  182. package/dist/proxy-PQd2AItT.cjs +0 -2
  183. package/dist/proxy-PQd2AItT.cjs.map +0 -1
  184. package/dist/use-in-view-BAHrBy6b.js.map +0 -1
  185. package/dist/use-in-view-BCmzDU2O.cjs.map +0 -1
  186. package/dist/x-CnsEH4Ox-CGGXQl4M.cjs +0 -27
  187. package/dist/x-CnsEH4Ox-CGGXQl4M.cjs.map +0 -1
  188. package/dist/x-CnsEH4Ox-DDvAJndW.js +0 -101
  189. package/dist/x-CnsEH4Ox-DDvAJndW.js.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CHPV5EwG-DDoeWRVt.cjs"),c=require("react"),le=require("./Spinner-DA6Z5E4n.cjs"),ce=require("react-globe.gl"),ue=require("./index-BXns0-ng.cjs"),de=require("three"),pe=require("./Modal-C_dl0EtQ.cjs"),ie=require("./Typography-k-kOjICQ.cjs"),ge=require("./Tooltip-n8z5bfav.cjs"),me=require("./numberFormattingFunction-02t-wJta.cjs"),he=require("./index-BW_-wD2k.cjs"),xe=require("./string2HTML-D2Avudmb.cjs"),fe=require("./ordinal-BOeNbyae.cjs"),ye=require("./threshold-DNsSUf8Q.cjs"),je=require("./GraphHeader.cjs"),ve=require("./GraphFooter.cjs"),be=require("./fetchAndParseData-DmgQtB9n.cjs"),N=require("./Colors.cjs"),Ee=require("./getUniqValue-CHqgSss5.cjs"),Re=require("./getJenks-TWQvbuOz.cjs");function Ce(f){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(f){for(const i in f)if(i!=="default"){const p=Object.getOwnPropertyDescriptor(f,i);Object.defineProperty(u,i,p.get?p:{enumerable:!0,get:()=>f[i]})}}return u.default=f,Object.freeze(u)}const we=Ce(de);function De(f){const{width:u,autoRotate:i,data:p,enableZoom:M,categorical:w,colorDomain:g,colors:o,globeMaterial:n,height:H,polygonData:_,mapProperty:m,mapBorderColor:q,atmosphereColor:$,tooltip:G,styles:v,classNames:J,mapNoDataColor:h,centerPoint:A,colorLegendTitle:O,showColorScale:X,hoverStrokeColor:F,detailsOnClick:x,onSeriesMouseClick:d,onSeriesMouseOver:D,resetSelectionOnDoubleClick:Z,highlightedIds:y,scale:j,globeOffset:P,polygonAltitude:Y,centerLng:z,centerLat:S}=f,a=c.useRef(void 0),[E,k]=c.useState(void 0),[K,B]=c.useState(!(u<680)),[I,Q]=c.useState({x:0,y:0}),[b,ee]=c.useState(void 0),U=w?fe.ordinal().domain(g).range(o):ye.threshold().domain(g).range(o);c.useEffect(()=>{a?.current&&(a.current.controls().autoRotate=i!==0,a.current.controls().enableZoom=M,a.current.controls().autoRotateSpeed=i)},[i,M]),c.useEffect(()=>{a.current&&(b?a.current.controls().autoRotate=!1:a.current.controls().autoRotate=i!==0)},[b,i]),c.useEffect(()=>{const r=a.current?.renderer().domElement;if(!r)return;const t=s=>{Q({x:s.clientX,y:s.clientY})};return r.addEventListener("mousemove",t),()=>r.removeEventListener("mousemove",t)},[]),c.useEffect(()=>{a.current&&a.current.pointOfView({lat:S,lng:z,altitude:j},1e3)},[j,z,S]);const W=new we.MeshLambertMaterial({color:"#fff",opacity:1,transparent:!1,...n||{}});return e.jsxRuntimeExports.jsxs("div",{className:"relative",children:[e.jsxRuntimeExports.jsx(ce,{ref:a,width:u,height:H,globeOffset:P,lineHoverPrecision:0,polygonsData:_,polygonAltitude:r=>y.includes(r?.properties?.[m])?.1:r?.properties?.[m]===b?.id?.01:Y,polygonCapColor:r=>{const t=r?.properties?.[m],s=p.find(R=>R.id===t)?.x;return s!=null?U(s):h},polygonSideColor:r=>{const t=r?.properties?.[m],s=p.find(V=>V.id===t)?.x,R=s!=null?U(s):h;return y.includes(r?.properties?.[m])?R:"rgba(100,100,100,0)"},polygonStrokeColor:r=>r?.properties?.[m]===b?.id?F:q,onPolygonClick:r=>{const t=r?.properties?.[m]?p.find(s=>s.id===r?.properties?.[m]):void 0;(d||x)&&(ue.isEqual(E,t)&&Z&&t?(k(void 0),d?.(void 0)):(k(t),d?.(t))),k(t),d?.(t)},onPolygonHover:r=>{const t=r?.properties?.[m]?p.find(s=>s.id===r?.properties?.[m]):void 0;ee(t),D?.(t)},atmosphereColor:$,globeMaterial:W,backgroundColor:"rgba(0, 0, 0, 0)",polygonsTransitionDuration:100,onGlobeReady:()=>{a.current&&a.current.pointOfView({lat:A[0],lng:A[1]})}}),X===!1?null:e.jsxRuntimeExports.jsx("div",{className:"absolute left-4 bottom-4",children:K?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{style:{backgroundColor:"rgba(240,240,240, 0.7)",border:"1px solid var(--gray-400)",borderRadius:"999px",width:"24px",height:"24px",padding:"3px",cursor:"pointer",zIndex:10,position:"absolute",right:"-0.75rem",top:"-0.75rem"},onClick:()=>{B(!1)},children:e.jsxRuntimeExports.jsx(he.X,{})}),e.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)",width:w?void 0:"340px"},children:[O&&O!==""?e.jsxRuntimeExports.jsx(ie.u,{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:O}):null,w?e.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:g.map((r,t)=>e.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:o[t%o.length]}}),e.jsxRuntimeExports.jsx(ie.u,{size:"sm",marginBottom:"none",leading:"none",children:r})]},t))}):e.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:e.jsxRuntimeExports.jsxs("g",{children:[g.map((r,t)=>e.jsxRuntimeExports.jsxs("g",{className:"cursor-pointer",children:[e.jsxRuntimeExports.jsx("rect",{x:t*320/o.length+1,y:1,width:320/o.length-2,height:8,style:{fill:o[t],stroke:o[t]}}),e.jsxRuntimeExports.jsx("text",{x:(t+1)*320/o.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:me.numberFormattingFunction(r,"NA")})]},t)),e.jsxRuntimeExports.jsx("g",{children:e.jsxRuntimeExports.jsx("rect",{x:g.length*320/o.length+1,y:1,width:320/o.length-2,height:8,style:{fill:o[g.length],stroke:o[g.length]}})})]})})]})]}):e.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{B(!0)},children:e.jsxRuntimeExports.jsx("div",{className:"items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-550 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),b&&G?e.jsxRuntimeExports.jsx(ge.Tooltip,{data:b,body:G,xPos:I.x,yPos:I.y,backgroundStyle:v?.tooltip,className:J?.tooltip}):null,x&&E!==void 0?e.jsxRuntimeExports.jsx(pe.X,{open:E!==void 0,onClose:()=>{k(void 0)},children:e.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof x=="string"?{__html:xe.string2HTML(x,E)}:void 0,children:typeof x=="function"?x(E):null})}):null]})}function Se(f){const{data:u,mapData:i="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json",graphTitle:p,colors:M,sources:w,graphDescription:g,height:o,width:n,footNote:H="The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.",colorDomain:_,colorLegendTitle:m,scaleType:q="threshold",padding:$,mapNoDataColor:G=N.Colors.light.graphNoData,backgroundColor:v=!1,mapBorderColor:J=N.Colors.light.grays["gray-500"],relativeHeight:h,tooltip:A,graphID:O,mapProperty:X="ISO3",dataDownload:F=!1,language:x="en",minHeight:d=0,theme:D="light",ariaLabel:Z,styles:y,classNames:j,autoRotate:P=!0,enableZoom:Y=!0,globeMaterial:z,centerPoint:S=[0,0],atmosphereColor:a="#999",showColorScale:E=!0,resetSelectionOnDoubleClick:k=!0,detailsOnClick:K,onSeriesMouseOver:B,onSeriesMouseClick:I,highlightedIds:Q=[],scale:b=1,globeOffset:ee=[0,0],polygonAltitude:U=.01}=f,[W,r]=c.useState(void 0),[t,s]=c.useState(0),[R,V]=c.useState(0),T=c.useRef(null);c.useEffect(()=>{const l=new ResizeObserver(L=>{s(n||L[0].target.clientWidth||760),V(o||L[0].target.clientHeight||480)});return T.current&&(V(T.current.clientHeight||480),s(T.current.clientWidth||760),n||l.observe(T.current)),()=>l.disconnect()},[n,o]),c.useEffect(()=>{typeof i=="string"?be.fetchAndParseJSON(i).then(L=>{if(i==="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json"){const ne=L.features.map(C=>{if(C.geometry.type==="Polygon"){const re=[...C.geometry.coordinates[0]].reverse(),oe={...C.geometry,coordinates:[re]};return{...C,geometry:oe}}const se=[];C.geometry.coordinates.forEach(re=>{const oe=[...re[0]].reverse();se.push([oe])});const ae={...C.geometry,coordinates:se};return{...C,geometry:ae}});r(ne)}else r(L.features)}):r(i.features)},[i]);const te=_||(q==="categorical"?Ee.getUniqValue(u,"x"):Re.getJenks(u.map(l=>l.x),M?.length||4));return e.jsxRuntimeExports.jsx("div",{className:`${D||"light"} flex ${n?"w-fit grow-0":"w-full grow"}`,dir:x==="he"||x==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:e.mo(`${v?v===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${x||"en"}`,j?.graphContainer),style:{...y?.graphContainer||{},...v&&v!==!0?{backgroundColor:v}:{}},id:O,"aria-label":Z||`${p?`The graph shows ${p}. `:""}This is a map.${g?` ${g}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:v?$||"1rem":$||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[p||g||F?e.jsxRuntimeExports.jsx(je.GraphHeader,{styles:{title:y?.title,description:y?.description},classNames:{title:j?.title,description:j?.description},graphTitle:p,graphDescription:g,width:n,graphDownload:void 0,dataDownload:F?u.map(l=>l.data).filter(l=>l!==void 0).length>0?u.map(l=>l.data).filter(l=>l!==void 0):u.filter(l=>l!==void 0):null}):null,e.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:T,"aria-label":"Map area",children:(n||t)&&(o||R)&&W?e.jsxRuntimeExports.jsx(De,{data:u,globeOffset:ee,polygonData:W,colorDomain:te,width:n||t,height:Math.max(d,o||(h?d?(n||t)*h>d?(n||t)*h:d:(n||t)*h:R)),colors:M||(q==="categorical"?N.Colors[D].sequentialColors[`neutralColorsx0${te.length}`]:N.Colors[D].sequentialColors[`neutralColorsx0${te.length+1}`]),mapNoDataColor:G,categorical:q==="categorical",mapBorderColor:J,tooltip:A,mapProperty:X,styles:y,classNames:j,autoRotate:P===!0?1.5:P===!1?0:P,enableZoom:Y,globeMaterial:z,atmosphereColor:a,centerPoint:S,colorLegendTitle:m,showColorScale:E,hoverStrokeColor:D==="light"?N.Colors.light.grays["gray-700"]:N.Colors.light.grays["gray-300"],highlightedIds:Q,resetSelectionOnDoubleClick:k,detailsOnClick:K,onSeriesMouseOver:B,onSeriesMouseClick:I,scale:b,polygonAltitude:U,centerLat:S[0],centerLng:S[1]}):e.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(d,o||(h?d?(n||t)*h>d?(n||t)*h:d:(n||t)*h:R))}px`},className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(le.y,{"aria-label":"Loading graph"})})}),w||H?e.jsxRuntimeExports.jsx(ve.GraphFooter,{styles:{footnote:y?.footnote,source:y?.source},classNames:{footnote:j?.footnote,source:j?.source},sources:w,footNote:H,width:n}):null]})})})})}exports.ThreeDGlobe=Se;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CHPV5EwG-DDoeWRVt.cjs"),c=require("react"),le=require("./Spinner-DA6Z5E4n.cjs"),ce=require("react-globe.gl"),ue=require("./index-BXns0-ng.cjs"),de=require("three"),pe=require("./Modal-tXZlLE5s.cjs"),ie=require("./Typography-k-kOjICQ.cjs"),ge=require("./Tooltip-n8z5bfav.cjs"),me=require("./numberFormattingFunction-02t-wJta.cjs"),he=require("./index-BW_-wD2k.cjs"),xe=require("./string2HTML-D2Avudmb.cjs"),fe=require("./ordinal-BOeNbyae.cjs"),ye=require("./threshold-DNsSUf8Q.cjs"),je=require("./GraphHeader.cjs"),ve=require("./GraphFooter.cjs"),be=require("./fetchAndParseData-CQyVGCul.cjs"),N=require("./Colors.cjs"),Ee=require("./getUniqValue-CHqgSss5.cjs"),Re=require("./getJenks-TWQvbuOz.cjs");function Ce(f){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(f){for(const i in f)if(i!=="default"){const p=Object.getOwnPropertyDescriptor(f,i);Object.defineProperty(u,i,p.get?p:{enumerable:!0,get:()=>f[i]})}}return u.default=f,Object.freeze(u)}const we=Ce(de);function De(f){const{width:u,autoRotate:i,data:p,enableZoom:M,categorical:w,colorDomain:g,colors:o,globeMaterial:n,height:H,polygonData:_,mapProperty:m,mapBorderColor:q,atmosphereColor:$,tooltip:G,styles:v,classNames:J,mapNoDataColor:h,centerPoint:A,colorLegendTitle:O,showColorScale:X,hoverStrokeColor:F,detailsOnClick:x,onSeriesMouseClick:d,onSeriesMouseOver:D,resetSelectionOnDoubleClick:Z,highlightedIds:y,scale:j,globeOffset:P,polygonAltitude:Y,centerLng:z,centerLat:S}=f,a=c.useRef(void 0),[E,k]=c.useState(void 0),[K,B]=c.useState(!(u<680)),[I,Q]=c.useState({x:0,y:0}),[b,ee]=c.useState(void 0),U=w?fe.ordinal().domain(g).range(o):ye.threshold().domain(g).range(o);c.useEffect(()=>{a?.current&&(a.current.controls().autoRotate=i!==0,a.current.controls().enableZoom=M,a.current.controls().autoRotateSpeed=i)},[i,M]),c.useEffect(()=>{a.current&&(b?a.current.controls().autoRotate=!1:a.current.controls().autoRotate=i!==0)},[b,i]),c.useEffect(()=>{const r=a.current?.renderer().domElement;if(!r)return;const t=s=>{Q({x:s.clientX,y:s.clientY})};return r.addEventListener("mousemove",t),()=>r.removeEventListener("mousemove",t)},[]),c.useEffect(()=>{a.current&&a.current.pointOfView({lat:S,lng:z,altitude:j},1e3)},[j,z,S]);const W=new we.MeshLambertMaterial({color:"#fff",opacity:1,transparent:!1,...n||{}});return e.jsxRuntimeExports.jsxs("div",{className:"relative",children:[e.jsxRuntimeExports.jsx(ce,{ref:a,width:u,height:H,globeOffset:P,lineHoverPrecision:0,polygonsData:_,polygonAltitude:r=>y.includes(r?.properties?.[m])?.1:r?.properties?.[m]===b?.id?.01:Y,polygonCapColor:r=>{const t=r?.properties?.[m],s=p.find(R=>R.id===t)?.x;return s!=null?U(s):h},polygonSideColor:r=>{const t=r?.properties?.[m],s=p.find(V=>V.id===t)?.x,R=s!=null?U(s):h;return y.includes(r?.properties?.[m])?R:"rgba(100,100,100,0)"},polygonStrokeColor:r=>r?.properties?.[m]===b?.id?F:q,onPolygonClick:r=>{const t=r?.properties?.[m]?p.find(s=>s.id===r?.properties?.[m]):void 0;(d||x)&&(ue.isEqual(E,t)&&Z&&t?(k(void 0),d?.(void 0)):(k(t),d?.(t))),k(t),d?.(t)},onPolygonHover:r=>{const t=r?.properties?.[m]?p.find(s=>s.id===r?.properties?.[m]):void 0;ee(t),D?.(t)},atmosphereColor:$,globeMaterial:W,backgroundColor:"rgba(0, 0, 0, 0)",polygonsTransitionDuration:100,onGlobeReady:()=>{a.current&&a.current.pointOfView({lat:A[0],lng:A[1]})}}),X===!1?null:e.jsxRuntimeExports.jsx("div",{className:"absolute left-4 bottom-4",children:K?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{style:{backgroundColor:"rgba(240,240,240, 0.7)",border:"1px solid var(--gray-400)",borderRadius:"999px",width:"24px",height:"24px",padding:"3px",cursor:"pointer",zIndex:10,position:"absolute",right:"-0.75rem",top:"-0.75rem"},onClick:()=>{B(!1)},children:e.jsxRuntimeExports.jsx(he.X,{})}),e.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)",width:w?void 0:"340px"},children:[O&&O!==""?e.jsxRuntimeExports.jsx(ie.u,{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:O}):null,w?e.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:g.map((r,t)=>e.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:o[t%o.length]}}),e.jsxRuntimeExports.jsx(ie.u,{size:"sm",marginBottom:"none",leading:"none",children:r})]},t))}):e.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:e.jsxRuntimeExports.jsxs("g",{children:[g.map((r,t)=>e.jsxRuntimeExports.jsxs("g",{className:"cursor-pointer",children:[e.jsxRuntimeExports.jsx("rect",{x:t*320/o.length+1,y:1,width:320/o.length-2,height:8,style:{fill:o[t],stroke:o[t]}}),e.jsxRuntimeExports.jsx("text",{x:(t+1)*320/o.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:me.numberFormattingFunction(r,"NA")})]},t)),e.jsxRuntimeExports.jsx("g",{children:e.jsxRuntimeExports.jsx("rect",{x:g.length*320/o.length+1,y:1,width:320/o.length-2,height:8,style:{fill:o[g.length],stroke:o[g.length]}})})]})})]})]}):e.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{B(!0)},children:e.jsxRuntimeExports.jsx("div",{className:"items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-550 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),b&&G?e.jsxRuntimeExports.jsx(ge.Tooltip,{data:b,body:G,xPos:I.x,yPos:I.y,backgroundStyle:v?.tooltip,className:J?.tooltip}):null,x&&E!==void 0?e.jsxRuntimeExports.jsx(pe.X,{open:E!==void 0,onClose:()=>{k(void 0)},children:e.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof x=="string"?{__html:xe.string2HTML(x,E)}:void 0,children:typeof x=="function"?x(E):null})}):null]})}function Se(f){const{data:u,mapData:i="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json",graphTitle:p,colors:M,sources:w,graphDescription:g,height:o,width:n,footNote:H="The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.",colorDomain:_,colorLegendTitle:m,scaleType:q="threshold",padding:$,mapNoDataColor:G=N.Colors.light.graphNoData,backgroundColor:v=!1,mapBorderColor:J=N.Colors.light.grays["gray-500"],relativeHeight:h,tooltip:A,graphID:O,mapProperty:X="ISO3",dataDownload:F=!1,language:x="en",minHeight:d=0,theme:D="light",ariaLabel:Z,styles:y,classNames:j,autoRotate:P=!0,enableZoom:Y=!0,globeMaterial:z,centerPoint:S=[0,0],atmosphereColor:a="#999",showColorScale:E=!0,resetSelectionOnDoubleClick:k=!0,detailsOnClick:K,onSeriesMouseOver:B,onSeriesMouseClick:I,highlightedIds:Q=[],scale:b=1,globeOffset:ee=[0,0],polygonAltitude:U=.01}=f,[W,r]=c.useState(void 0),[t,s]=c.useState(0),[R,V]=c.useState(0),T=c.useRef(null);c.useEffect(()=>{const l=new ResizeObserver(L=>{s(n||L[0].target.clientWidth||760),V(o||L[0].target.clientHeight||480)});return T.current&&(V(T.current.clientHeight||480),s(T.current.clientWidth||760),n||l.observe(T.current)),()=>l.disconnect()},[n,o]),c.useEffect(()=>{typeof i=="string"?be.fetchAndParseJSON(i).then(L=>{if(i==="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json"){const ne=L.features.map(C=>{if(C.geometry.type==="Polygon"){const re=[...C.geometry.coordinates[0]].reverse(),oe={...C.geometry,coordinates:[re]};return{...C,geometry:oe}}const se=[];C.geometry.coordinates.forEach(re=>{const oe=[...re[0]].reverse();se.push([oe])});const ae={...C.geometry,coordinates:se};return{...C,geometry:ae}});r(ne)}else r(L.features)}):r(i.features)},[i]);const te=_||(q==="categorical"?Ee.getUniqValue(u,"x"):Re.getJenks(u.map(l=>l.x),M?.length||4));return e.jsxRuntimeExports.jsx("div",{className:`${D||"light"} flex ${n?"w-fit grow-0":"w-full grow"}`,dir:x==="he"||x==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:e.mo(`${v?v===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${x||"en"}`,j?.graphContainer),style:{...y?.graphContainer||{},...v&&v!==!0?{backgroundColor:v}:{}},id:O,"aria-label":Z||`${p?`The graph shows ${p}. `:""}This is a map.${g?` ${g}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:v?$||"1rem":$||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[p||g||F?e.jsxRuntimeExports.jsx(je.GraphHeader,{styles:{title:y?.title,description:y?.description},classNames:{title:j?.title,description:j?.description},graphTitle:p,graphDescription:g,width:n,graphDownload:void 0,dataDownload:F?u.map(l=>l.data).filter(l=>l!==void 0).length>0?u.map(l=>l.data).filter(l=>l!==void 0):u.filter(l=>l!==void 0):null}):null,e.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:T,"aria-label":"Map area",children:(n||t)&&(o||R)&&W?e.jsxRuntimeExports.jsx(De,{data:u,globeOffset:ee,polygonData:W,colorDomain:te,width:n||t,height:Math.max(d,o||(h?d?(n||t)*h>d?(n||t)*h:d:(n||t)*h:R)),colors:M||(q==="categorical"?N.Colors[D].sequentialColors[`neutralColorsx0${te.length}`]:N.Colors[D].sequentialColors[`neutralColorsx0${te.length+1}`]),mapNoDataColor:G,categorical:q==="categorical",mapBorderColor:J,tooltip:A,mapProperty:X,styles:y,classNames:j,autoRotate:P===!0?1.5:P===!1?0:P,enableZoom:Y,globeMaterial:z,atmosphereColor:a,centerPoint:S,colorLegendTitle:m,showColorScale:E,hoverStrokeColor:D==="light"?N.Colors.light.grays["gray-700"]:N.Colors.light.grays["gray-300"],highlightedIds:Q,resetSelectionOnDoubleClick:k,detailsOnClick:K,onSeriesMouseOver:B,onSeriesMouseClick:I,scale:b,polygonAltitude:U,centerLat:S[0],centerLng:S[1]}):e.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(d,o||(h?d?(n||t)*h>d?(n||t)*h:d:(n||t)*h:R))}px`},className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(le.y,{"aria-label":"Loading graph"})})}),w||H?e.jsxRuntimeExports.jsx(ve.GraphFooter,{styles:{footnote:y?.footnote,source:y?.source},classNames:{footnote:j?.footnote,source:j?.source},sources:w,footNote:H,width:n}):null]})})})})}exports.ThreeDGlobe=Se;
2
2
  //# sourceMappingURL=ThreeDGlobe.cjs.map
@@ -4,7 +4,7 @@ import { y as ge } from "./Spinner-C85UF28E.js";
4
4
  import me from "react-globe.gl";
5
5
  import { i as pe } from "./index-27yTRcko.js";
6
6
  import * as he from "three";
7
- import { X as ue } from "./Modal-CUU6ZK3U.js";
7
+ import { X as ue } from "./Modal-DVVwpKhP.js";
8
8
  import { u as se } from "./Typography-Ctgfl1J5.js";
9
9
  import { T as fe } from "./Tooltip-DyM5snqx.js";
10
10
  import { n as ye } from "./numberFormattingFunction-14YCbkN2.js";
@@ -14,7 +14,7 @@ import { o as be } from "./ordinal-w9Lu4Stb.js";
14
14
  import { t as je } from "./threshold-DFfqcDMa.js";
15
15
  import { GraphHeader as we } from "./GraphHeader.js";
16
16
  import { GraphFooter as Ce } from "./GraphFooter.js";
17
- import { f as ke } from "./fetchAndParseData-Bcmr659B.js";
17
+ import { f as ke } from "./fetchAndParseData-4gsYTy6_.js";
18
18
  import { Colors as M } from "./Colors.js";
19
19
  import { g as De } from "./getUniqValue-BtUENB2H.js";
20
20
  import { g as Ne } from "./getJenks-VhM3GIoC.js";
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-CHPV5EwG-DDoeWRVt.cjs"),le=require("./index-CZbIGs8q.cjs"),O=require("react"),se=require("./Typography-k-kOjICQ.cjs"),me=require("./Modal-C_dl0EtQ.cjs"),xe=require("./Tooltip-n8z5bfav.cjs"),ve=require("./numberFormattingFunction-02t-wJta.cjs"),ee=require("./getTextColorBasedOnBgColor-nqY-bsM_.cjs"),N=require("./Colors.cjs"),ye=require("./string2HTML-D2Avudmb.cjs"),we=require("./use-in-view-BCmzDU2O.cjs"),Z=require("./proxy-PQd2AItT.cjs"),je=require("./index-DVOJ7vxH.cjs"),Ce=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),be=require("./GraphFooter.cjs"),Ee=require("./GraphHeader.cjs"),Me=require("./ColorLegendWithMouseOver.cjs"),Re=require("./EmptyState-d8_8SxeW.cjs");function Oe(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function ke(){return this.eachAfter(Oe)}function Be(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function Se(e,t){for(var n=this,r=[n],a,s,l=-1;n=r.pop();)if(e.call(t,n,++l,this),a=n.children)for(s=a.length-1;s>=0;--s)r.push(a[s]);return this}function Ie(e,t){for(var n=this,r=[n],a=[],s,l,h,m=-1;n=r.pop();)if(a.push(n),s=n.children)for(l=0,h=s.length;l<h;++l)r.push(s[l]);for(;n=a.pop();)e.call(t,n,++m,this);return this}function qe(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function Ne(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,a=r&&r.length;--a>=0;)n+=r[a].value;t.value=n})}function De(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Te(e){for(var t=this,n=Ve(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var a=r.length;e!==n;)r.splice(a,0,e),e=e.parent;return r}function Ve(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),a=null;for(e=n.pop(),t=r.pop();e===t;)a=e,e=n.pop(),t=r.pop();return a}function _e(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function $e(){return Array.from(this)}function He(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Le(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Ae(){var e=this,t,n=[e],r,a,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(a=0,s=r.length;a<s;++a)n.push(r[a]);while(n.length)}function he(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Ge)):t===void 0&&(t=Pe);for(var n=new F(e),r,a=[n],s,l,h,m;r=a.pop();)if((l=t(r.data))&&(m=(l=Array.from(l)).length))for(r.children=l,h=m-1;h>=0;--h)a.push(s=l[h]=new F(l[h])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(de)}function ze(){return he(this).eachBefore(We)}function Pe(e){return e.children}function Ge(e){return Array.isArray(e)?e[1]:null}function We(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function de(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function F(e){this.data=e,this.depth=this.height=0,this.parent=null}F.prototype=he.prototype={constructor:F,count:ke,each:Be,eachAfter:Ie,eachBefore:Se,find:qe,sum:Ne,sort:De,path:Te,ancestors:_e,descendants:$e,leaves:He,links:Le,copy:ze,[Symbol.iterator]:Ae};function te(e){return e==null?null:fe(e)}function fe(e){if(typeof e!="function")throw new Error;return e}function G(){return 0}function W(e){return function(){return e}}function Fe(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Xe(e,t,n,r,a){for(var s=e.children,l,h=-1,m=s.length,j=e.value&&(r-t)/e.value;++h<m;)l=s[h],l.y0=n,l.y1=a,l.x0=t,l.x1=t+=l.value*j}var Ye={depth:-1},ue={},ne={};function Ke(e){return e.id}function Ue(e){return e.parentId}function Ze(){var e=Ke,t=Ue,n;function r(a){var s=Array.from(a),l=e,h=t,m,j,c,v,i,u,f,y,p=new Map;if(n!=null){const d=s.map((w,E)=>Je(n(w,E,a))),C=d.map(ce),k=new Set(d).add("");for(const w of C)k.has(w)||(k.add(w),d.push(w),C.push(ce(w)),s.push(ne));l=(w,E)=>d[E],h=(w,E)=>C[E]}for(c=0,m=s.length;c<m;++c)j=s[c],u=s[c]=new F(j),(f=l(j,c,a))!=null&&(f+="")&&(y=u.id=f,p.set(y,p.has(y)?ue:u)),(f=h(j,c,a))!=null&&(f+="")&&(u.parent=f);for(c=0;c<m;++c)if(u=s[c],f=u.parent){if(i=p.get(f),!i)throw new Error("missing: "+f);if(i===ue)throw new Error("ambiguous: "+f);i.children?i.children.push(u):i.children=[u],u.parent=i}else{if(v)throw new Error("multiple roots");v=u}if(!v)throw new Error("no root");if(n!=null){for(;v.data===ne&&v.children.length===1;)v=v.children[0],--m;for(let d=s.length-1;d>=0&&(u=s[d],u.data===ne);--d)u.data=null}if(v.parent=Ye,v.eachBefore(function(d){d.depth=d.parent.depth+1,--m}).eachBefore(de),v.parent=null,m>0)throw new Error("cycle");return v}return r.id=function(a){return arguments.length?(e=te(a),r):e},r.parentId=function(a){return arguments.length?(t=te(a),r):t},r.path=function(a){return arguments.length?(n=te(a),r):n},r}function Je(e){e=`${e}`;let t=e.length;return ie(e,t-1)&&!ie(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function ce(e){let t=e.length;if(t<2)return"";for(;--t>1&&!ie(e,t););return e.slice(0,t)}function ie(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if((n&1)===0)return!0}return!1}function Qe(e,t,n,r,a){for(var s=e.children,l,h=-1,m=s.length,j=e.value&&(a-n)/e.value;++h<m;)l=s[h],l.x0=t,l.x1=r,l.y0=n,l.y1=n+=l.value*j}var et=(1+Math.sqrt(5))/2;function tt(e,t,n,r,a,s){for(var l=[],h=t.children,m,j,c=0,v=0,i=h.length,u,f,y=t.value,p,d,C,k,w,E,R;c<i;){u=a-n,f=s-r;do p=h[v++].value;while(!p&&v<i);for(d=C=p,E=Math.max(f/u,u/f)/(y*e),R=p*p*E,w=Math.max(C/R,R/d);v<i;++v){if(p+=j=h[v].value,j<d&&(d=j),j>C&&(C=j),R=p*p*E,k=Math.max(C/R,R/d),k>w){p-=j;break}w=k}l.push(m={value:p,dice:u<f,children:h.slice(c,v)}),m.dice?Xe(m,n,r,a,y?r+=f*p/y:s):Qe(m,n,r,y?n+=u*p/y:a,s),y-=p,c=v}return l}const nt=function e(t){function n(r,a,s,l,h){tt(t,r,a,s,l,h)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(et);function it(){var e=nt,t=!1,n=1,r=1,a=[0],s=G,l=G,h=G,m=G,j=G;function c(i){return i.x0=i.y0=0,i.x1=n,i.y1=r,i.eachBefore(v),a=[0],t&&i.eachBefore(Fe),i}function v(i){var u=a[i.depth],f=i.x0+u,y=i.y0+u,p=i.x1-u,d=i.y1-u;p<f&&(f=p=(f+p)/2),d<y&&(y=d=(y+d)/2),i.x0=f,i.y0=y,i.x1=p,i.y1=d,i.children&&(u=a[i.depth+1]=s(i)/2,f+=j(i)-u,y+=l(i)-u,p-=h(i)-u,d-=m(i)-u,p<f&&(f=p=(f+p)/2),d<y&&(y=d=(y+d)/2),e(i,f,y,p,d))}return c.round=function(i){return arguments.length?(t=!!i,c):t},c.size=function(i){return arguments.length?(n=+i[0],r=+i[1],c):[n,r]},c.tile=function(i){return arguments.length?(e=fe(i),c):e},c.padding=function(i){return arguments.length?c.paddingInner(i).paddingOuter(i):c.paddingInner()},c.paddingInner=function(i){return arguments.length?(s=typeof i=="function"?i:W(+i),c):s},c.paddingOuter=function(i){return arguments.length?c.paddingTop(i).paddingRight(i).paddingBottom(i).paddingLeft(i):c.paddingTop()},c.paddingTop=function(i){return arguments.length?(l=typeof i=="function"?i:W(+i),c):l},c.paddingRight=function(i){return arguments.length?(h=typeof i=="function"?i:W(+i),c):h},c.paddingBottom=function(i){return arguments.length?(m=typeof i=="function"?i:W(+i),c):m},c.paddingLeft=function(i){return arguments.length?(j=typeof i=="function"?i:W(+i),c):j},c}function rt(e){const{data:t,colors:n,leftMargin:r,width:a,height:s,colorDomain:l,rightMargin:h,topMargin:m,bottomMargin:j,showLabels:c,tooltip:v,onSeriesMouseOver:i,selectedColor:u,showValues:f,suffix:y,prefix:p,highlightedDataPoints:d,onSeriesMouseClick:C,resetSelectionOnDoubleClick:k,detailsOnClick:w,language:E,styles:R,classNames:$,animate:B,dimmedOpacity:H,precision:J}=e,X=O.useRef(null),V=we.useInView(X,{once:B.once,amount:B.amount}),[L,S]=O.useState(void 0),[D,I]=O.useState(void 0),[_,A]=O.useState(void 0),[Y,z]=O.useState(void 0),M={top:m,bottom:j,left:r,right:h},q=a-M.left-M.right,K=s-M.top-M.bottom,Q=[{id:"root",parent:void 0,value:void 0,data:void 0},...t.map(o=>({id:o.label,value:o.size,parent:"root",data:o}))],U=Ze().id(o=>o.id).parentId(o=>o.parent)(Q);U.sum(o=>o.value);const T=it().size([q,K]).padding(2)(U);return g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[g.jsxRuntimeExports.jsx(Z.motion.svg,{width:`${a}px`,height:`${s}px`,viewBox:`0 0 ${a} ${s}`,direction:"ltr",ref:X,children:g.jsxRuntimeExports.jsx("g",{transform:`translate(${M.left},${M.top})`,children:g.jsxRuntimeExports.jsx(je.AnimatePresence,{children:T.children?.map(o=>g.jsxRuntimeExports.jsxs(Z.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:o.x0,y:o.y0},whileInView:{opacity:u?o.data.data.color&&n[l.indexOf(o.data.data.color)]===u?1:H:d.length!==0?d.indexOf(o.data.id)!==-1?.85:H:.85,x:o.x0,y:o.y0,transition:{duration:B.duration}}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:B.duration}},onMouseEnter:b=>{S(o.data.data),z(b.clientY),A(b.clientX),i?.(o.data.data)},onClick:()=>{(C||w)&&(D===o.data.id&&k?(I(void 0),C?.(void 0)):(I(o.data.id),C?.(o.data.data)))},onMouseMove:b=>{S(o.data.data),z(b.clientY),A(b.clientX)},onMouseLeave:()=>{S(void 0),A(void 0),z(void 0),i?.(void 0)},children:[g.jsxRuntimeExports.jsx(Z.motion.rect,{x:0,y:0,exit:{width:0,height:0,opacity:0,transition:{duration:B.duration}},variants:{initial:{width:0,height:0,fill:t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray},whileInView:{width:o.x1-o.x0,height:o.y1-o.y0,fill:t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray,transition:{duration:B.duration}}},initial:"initial",animate:V?"whileInView":"initial"}),o.x1-o.x0>50&&o.y1-o.y0>25&&(c||f)?g.jsxRuntimeExports.jsx(Z.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:B.duration}}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:B.duration}},children:g.jsxRuntimeExports.jsx("foreignObject",{y:0,x:0,width:o.x1-o.x0,height:o.y1-o.y0,children:g.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 p-2 w-full",style:{color:ee.getTextColorBasedOnBgColor(t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray)},children:[c?g.jsxRuntimeExports.jsx(se.u,{marginBottom:"none",size:"sm",leading:"none",className:g.mo("w-full treemap-label",E==="ar"||E==="he"?"text-right":"text-left",$?.graphObjectValues),style:{WebkitLineClamp:o.y1-o.y0>50?o.y1-o.y0>100?o.y1-o.y0>150?void 0:3:2:1,display:"-webkit-box",WebkitBoxOrient:"vertical",overflow:"hidden",color:ee.getTextColorBasedOnBgColor(t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray),...R?.graphObjectValues||{}},children:o.data.id}):null,f?g.jsxRuntimeExports.jsx(se.u,{marginBottom:"none",size:"sm",leading:"none",className:g.mo("w-full font-bold treemap-value",E==="ar"||E==="he"?"text-right":"text-left",$?.graphObjectValues),style:{color:ee.getTextColorBasedOnBgColor(t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray),...R?.graphObjectValues||{}},children:ve.numberFormattingFunction(o.data.value,"NA",J,p,y)}):null]})})}):null]},o.data.id))})})}),L&&v&&_&&Y?g.jsxRuntimeExports.jsx(xe.Tooltip,{data:L,body:v,xPos:_,yPos:Y,backgroundStyle:R?.tooltip,className:$?.tooltip}):null,w&&D!==void 0?g.jsxRuntimeExports.jsx(me.X,{open:D!==void 0,onClose:()=>{I(void 0)},children:g.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof w=="string"?{__html:ye.string2HTML(w,D)}:void 0,children:typeof w=="function"?w(D):null})}):null]})}function ot(e){const{data:t,graphTitle:n,colors:r,suffix:a="",sources:s,prefix:l="",graphDescription:h,leftMargin:m=0,rightMargin:j=0,topMargin:c=0,bottomMargin:v=0,height:i,width:u,footNote:f,colorDomain:y,colorLegendTitle:p,padding:d,backgroundColor:C=!1,showLabels:k=!0,relativeHeight:w,tooltip:E,onSeriesMouseOver:R,showColorScale:$=!0,showValues:B=!0,graphID:H,highlightedDataPoints:J=[],onSeriesMouseClick:X,graphDownload:V=!1,dataDownload:L=!1,language:S="en",showNAColor:D=!0,minHeight:I=0,theme:_="light",ariaLabel:A,resetSelectionOnDoubleClick:Y=!0,detailsOnClick:z,styles:M,classNames:q,animate:K=!1,dimmedOpacity:Q=.3,precision:U=2}=e,[T,o]=O.useState(0),[b,re]=O.useState(0),[pe,ge]=O.useState(void 0),P=O.useRef(null),oe=O.useRef(null);return O.useEffect(()=>{const x=new ResizeObserver(ae=>{o(u||ae[0].target.clientWidth||620),re(i||ae[0].target.clientHeight||480)});return P.current&&(re(P.current.clientHeight||480),o(P.current.clientWidth||620),u||x.observe(P.current)),()=>x.disconnect()},[u,i]),g.jsxRuntimeExports.jsx("div",{className:`${_||"light"} flex ${u?"w-fit grow-0":"w-full grow"}`,dir:S==="he"||S==="ar"?"rtl":void 0,children:g.jsxRuntimeExports.jsx("div",{className:g.mo(`${C?C===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${S||"en"}`,q?.graphContainer),style:{...M?.graphContainer||{},...C&&C!==!0?{backgroundColor:C}:{}},id:H,ref:oe,"aria-label":A||`${n?`The graph shows ${n}. `:""}This is a chart where data points are represented by squares, and their sizes reflect their values. ${h?` ${h}`:""}`,children:g.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:C?d||"1rem":d||0},children:g.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||h||V||L?g.jsxRuntimeExports.jsx(Ee.GraphHeader,{styles:{title:M?.title,description:M?.description},classNames:{title:q?.title,description:q?.description},graphTitle:n,graphDescription:h,width:u,graphDownload:V?oe.current:void 0,dataDownload:L?t.map(x=>x.data).filter(x=>x!==void 0).length>0?t.map(x=>x.data).filter(x=>x!==void 0):t.filter(x=>x!==void 0):null}):null,g.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:t.length===0?g.jsxRuntimeExports.jsx(Re.EmptyState,{}):g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[$&&t.filter(x=>x.color).length!==0?g.jsxRuntimeExports.jsx(Me.ColorLegendWithMouseOver,{width:u,colorLegendTitle:p,colors:r||N.Colors[_].categoricalColors.colors,colorDomain:y||le.uniqBy(t.filter(x=>x.color),"color").map(x=>x.color),setSelectedColor:ge,showNAColor:D}):null,g.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:P,"aria-label":"Graph area",children:(u||T)&&(i||b)?g.jsxRuntimeExports.jsx(rt,{data:t.filter(x=>!Ce.checkIfNullOrUndefined(x.size)),colors:t.filter(x=>x.color).length===0?r?[r]:[N.Colors.primaryColors["blue-600"]]:r||N.Colors[_].categoricalColors.colors,colorDomain:t.filter(x=>x.color).length===0?[]:y||le.uniqBy(t.filter(x=>x.color),"color").map(x=>x.color),width:u||T,height:Math.max(I,i||(w?I?(u||T)*w>I?(u||T)*w:I:(u||T)*w:b)),leftMargin:m,rightMargin:j,topMargin:c,bottomMargin:v,showLabels:k,showValues:B,suffix:a,prefix:l,selectedColor:pe,tooltip:E,onSeriesMouseOver:R,onSeriesMouseClick:X,highlightedDataPoints:J,resetSelectionOnDoubleClick:Y,detailsOnClick:z,styles:M,classNames:q,language:S,animate:K===!0?{duration:.5,once:!0,amount:.5}:K||{duration:0,once:!0,amount:0},dimmedOpacity:Q,precision:U}):null})]})}),s||f?g.jsxRuntimeExports.jsx(be.GraphFooter,{styles:{footnote:M?.footnote,source:M?.source},classNames:{footnote:q?.footnote,source:q?.source},sources:s,footNote:f,width:u}):null]})})})})}exports.TreeMapGraph=ot;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-CHPV5EwG-DDoeWRVt.cjs"),le=require("./index-CZbIGs8q.cjs"),O=require("react"),se=require("./Typography-k-kOjICQ.cjs"),me=require("./Modal-tXZlLE5s.cjs"),xe=require("./Tooltip-n8z5bfav.cjs"),ve=require("./numberFormattingFunction-02t-wJta.cjs"),ee=require("./getTextColorBasedOnBgColor-nqY-bsM_.cjs"),N=require("./Colors.cjs"),ye=require("./string2HTML-D2Avudmb.cjs"),we=require("./use-in-view-sQJZ_xDO.cjs"),Z=require("./proxy-BHRoeZgd.cjs"),je=require("./index-BW8iNx7E.cjs"),Ce=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),be=require("./GraphFooter.cjs"),Ee=require("./GraphHeader.cjs"),Me=require("./ColorLegendWithMouseOver.cjs"),Re=require("./EmptyState-d8_8SxeW.cjs");function Oe(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function ke(){return this.eachAfter(Oe)}function Be(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function Se(e,t){for(var n=this,r=[n],a,s,l=-1;n=r.pop();)if(e.call(t,n,++l,this),a=n.children)for(s=a.length-1;s>=0;--s)r.push(a[s]);return this}function Ie(e,t){for(var n=this,r=[n],a=[],s,l,h,m=-1;n=r.pop();)if(a.push(n),s=n.children)for(l=0,h=s.length;l<h;++l)r.push(s[l]);for(;n=a.pop();)e.call(t,n,++m,this);return this}function qe(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function Ne(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,a=r&&r.length;--a>=0;)n+=r[a].value;t.value=n})}function De(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Te(e){for(var t=this,n=Ve(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var a=r.length;e!==n;)r.splice(a,0,e),e=e.parent;return r}function Ve(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),a=null;for(e=n.pop(),t=r.pop();e===t;)a=e,e=n.pop(),t=r.pop();return a}function _e(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function $e(){return Array.from(this)}function He(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Le(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Ae(){var e=this,t,n=[e],r,a,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(a=0,s=r.length;a<s;++a)n.push(r[a]);while(n.length)}function he(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Ge)):t===void 0&&(t=Pe);for(var n=new F(e),r,a=[n],s,l,h,m;r=a.pop();)if((l=t(r.data))&&(m=(l=Array.from(l)).length))for(r.children=l,h=m-1;h>=0;--h)a.push(s=l[h]=new F(l[h])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(de)}function ze(){return he(this).eachBefore(We)}function Pe(e){return e.children}function Ge(e){return Array.isArray(e)?e[1]:null}function We(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function de(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function F(e){this.data=e,this.depth=this.height=0,this.parent=null}F.prototype=he.prototype={constructor:F,count:ke,each:Be,eachAfter:Ie,eachBefore:Se,find:qe,sum:Ne,sort:De,path:Te,ancestors:_e,descendants:$e,leaves:He,links:Le,copy:ze,[Symbol.iterator]:Ae};function te(e){return e==null?null:fe(e)}function fe(e){if(typeof e!="function")throw new Error;return e}function G(){return 0}function W(e){return function(){return e}}function Fe(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Xe(e,t,n,r,a){for(var s=e.children,l,h=-1,m=s.length,j=e.value&&(r-t)/e.value;++h<m;)l=s[h],l.y0=n,l.y1=a,l.x0=t,l.x1=t+=l.value*j}var Ye={depth:-1},ue={},ne={};function Ke(e){return e.id}function Ue(e){return e.parentId}function Ze(){var e=Ke,t=Ue,n;function r(a){var s=Array.from(a),l=e,h=t,m,j,c,v,i,u,f,y,p=new Map;if(n!=null){const d=s.map((w,E)=>Je(n(w,E,a))),C=d.map(ce),k=new Set(d).add("");for(const w of C)k.has(w)||(k.add(w),d.push(w),C.push(ce(w)),s.push(ne));l=(w,E)=>d[E],h=(w,E)=>C[E]}for(c=0,m=s.length;c<m;++c)j=s[c],u=s[c]=new F(j),(f=l(j,c,a))!=null&&(f+="")&&(y=u.id=f,p.set(y,p.has(y)?ue:u)),(f=h(j,c,a))!=null&&(f+="")&&(u.parent=f);for(c=0;c<m;++c)if(u=s[c],f=u.parent){if(i=p.get(f),!i)throw new Error("missing: "+f);if(i===ue)throw new Error("ambiguous: "+f);i.children?i.children.push(u):i.children=[u],u.parent=i}else{if(v)throw new Error("multiple roots");v=u}if(!v)throw new Error("no root");if(n!=null){for(;v.data===ne&&v.children.length===1;)v=v.children[0],--m;for(let d=s.length-1;d>=0&&(u=s[d],u.data===ne);--d)u.data=null}if(v.parent=Ye,v.eachBefore(function(d){d.depth=d.parent.depth+1,--m}).eachBefore(de),v.parent=null,m>0)throw new Error("cycle");return v}return r.id=function(a){return arguments.length?(e=te(a),r):e},r.parentId=function(a){return arguments.length?(t=te(a),r):t},r.path=function(a){return arguments.length?(n=te(a),r):n},r}function Je(e){e=`${e}`;let t=e.length;return ie(e,t-1)&&!ie(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function ce(e){let t=e.length;if(t<2)return"";for(;--t>1&&!ie(e,t););return e.slice(0,t)}function ie(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if((n&1)===0)return!0}return!1}function Qe(e,t,n,r,a){for(var s=e.children,l,h=-1,m=s.length,j=e.value&&(a-n)/e.value;++h<m;)l=s[h],l.x0=t,l.x1=r,l.y0=n,l.y1=n+=l.value*j}var et=(1+Math.sqrt(5))/2;function tt(e,t,n,r,a,s){for(var l=[],h=t.children,m,j,c=0,v=0,i=h.length,u,f,y=t.value,p,d,C,k,w,E,R;c<i;){u=a-n,f=s-r;do p=h[v++].value;while(!p&&v<i);for(d=C=p,E=Math.max(f/u,u/f)/(y*e),R=p*p*E,w=Math.max(C/R,R/d);v<i;++v){if(p+=j=h[v].value,j<d&&(d=j),j>C&&(C=j),R=p*p*E,k=Math.max(C/R,R/d),k>w){p-=j;break}w=k}l.push(m={value:p,dice:u<f,children:h.slice(c,v)}),m.dice?Xe(m,n,r,a,y?r+=f*p/y:s):Qe(m,n,r,y?n+=u*p/y:a,s),y-=p,c=v}return l}const nt=function e(t){function n(r,a,s,l,h){tt(t,r,a,s,l,h)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(et);function it(){var e=nt,t=!1,n=1,r=1,a=[0],s=G,l=G,h=G,m=G,j=G;function c(i){return i.x0=i.y0=0,i.x1=n,i.y1=r,i.eachBefore(v),a=[0],t&&i.eachBefore(Fe),i}function v(i){var u=a[i.depth],f=i.x0+u,y=i.y0+u,p=i.x1-u,d=i.y1-u;p<f&&(f=p=(f+p)/2),d<y&&(y=d=(y+d)/2),i.x0=f,i.y0=y,i.x1=p,i.y1=d,i.children&&(u=a[i.depth+1]=s(i)/2,f+=j(i)-u,y+=l(i)-u,p-=h(i)-u,d-=m(i)-u,p<f&&(f=p=(f+p)/2),d<y&&(y=d=(y+d)/2),e(i,f,y,p,d))}return c.round=function(i){return arguments.length?(t=!!i,c):t},c.size=function(i){return arguments.length?(n=+i[0],r=+i[1],c):[n,r]},c.tile=function(i){return arguments.length?(e=fe(i),c):e},c.padding=function(i){return arguments.length?c.paddingInner(i).paddingOuter(i):c.paddingInner()},c.paddingInner=function(i){return arguments.length?(s=typeof i=="function"?i:W(+i),c):s},c.paddingOuter=function(i){return arguments.length?c.paddingTop(i).paddingRight(i).paddingBottom(i).paddingLeft(i):c.paddingTop()},c.paddingTop=function(i){return arguments.length?(l=typeof i=="function"?i:W(+i),c):l},c.paddingRight=function(i){return arguments.length?(h=typeof i=="function"?i:W(+i),c):h},c.paddingBottom=function(i){return arguments.length?(m=typeof i=="function"?i:W(+i),c):m},c.paddingLeft=function(i){return arguments.length?(j=typeof i=="function"?i:W(+i),c):j},c}function rt(e){const{data:t,colors:n,leftMargin:r,width:a,height:s,colorDomain:l,rightMargin:h,topMargin:m,bottomMargin:j,showLabels:c,tooltip:v,onSeriesMouseOver:i,selectedColor:u,showValues:f,suffix:y,prefix:p,highlightedDataPoints:d,onSeriesMouseClick:C,resetSelectionOnDoubleClick:k,detailsOnClick:w,language:E,styles:R,classNames:$,animate:B,dimmedOpacity:H,precision:J}=e,X=O.useRef(null),V=we.useInView(X,{once:B.once,amount:B.amount}),[L,S]=O.useState(void 0),[D,I]=O.useState(void 0),[_,A]=O.useState(void 0),[Y,z]=O.useState(void 0),M={top:m,bottom:j,left:r,right:h},q=a-M.left-M.right,K=s-M.top-M.bottom,Q=[{id:"root",parent:void 0,value:void 0,data:void 0},...t.map(o=>({id:o.label,value:o.size,parent:"root",data:o}))],U=Ze().id(o=>o.id).parentId(o=>o.parent)(Q);U.sum(o=>o.value);const T=it().size([q,K]).padding(2)(U);return g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[g.jsxRuntimeExports.jsx(Z.motion.svg,{width:`${a}px`,height:`${s}px`,viewBox:`0 0 ${a} ${s}`,direction:"ltr",ref:X,children:g.jsxRuntimeExports.jsx("g",{transform:`translate(${M.left},${M.top})`,children:g.jsxRuntimeExports.jsx(je.AnimatePresence,{children:T.children?.map(o=>g.jsxRuntimeExports.jsxs(Z.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:o.x0,y:o.y0},whileInView:{opacity:u?o.data.data.color&&n[l.indexOf(o.data.data.color)]===u?1:H:d.length!==0?d.indexOf(o.data.id)!==-1?.85:H:.85,x:o.x0,y:o.y0,transition:{duration:B.duration}}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:B.duration}},onMouseEnter:b=>{S(o.data.data),z(b.clientY),A(b.clientX),i?.(o.data.data)},onClick:()=>{(C||w)&&(D===o.data.id&&k?(I(void 0),C?.(void 0)):(I(o.data.id),C?.(o.data.data)))},onMouseMove:b=>{S(o.data.data),z(b.clientY),A(b.clientX)},onMouseLeave:()=>{S(void 0),A(void 0),z(void 0),i?.(void 0)},children:[g.jsxRuntimeExports.jsx(Z.motion.rect,{x:0,y:0,exit:{width:0,height:0,opacity:0,transition:{duration:B.duration}},variants:{initial:{width:0,height:0,fill:t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray},whileInView:{width:o.x1-o.x0,height:o.y1-o.y0,fill:t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray,transition:{duration:B.duration}}},initial:"initial",animate:V?"whileInView":"initial"}),o.x1-o.x0>50&&o.y1-o.y0>25&&(c||f)?g.jsxRuntimeExports.jsx(Z.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:B.duration}}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:B.duration}},children:g.jsxRuntimeExports.jsx("foreignObject",{y:0,x:0,width:o.x1-o.x0,height:o.y1-o.y0,children:g.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 p-2 w-full",style:{color:ee.getTextColorBasedOnBgColor(t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray)},children:[c?g.jsxRuntimeExports.jsx(se.u,{marginBottom:"none",size:"sm",leading:"none",className:g.mo("w-full treemap-label",E==="ar"||E==="he"?"text-right":"text-left",$?.graphObjectValues),style:{WebkitLineClamp:o.y1-o.y0>50?o.y1-o.y0>100?o.y1-o.y0>150?void 0:3:2:1,display:"-webkit-box",WebkitBoxOrient:"vertical",overflow:"hidden",color:ee.getTextColorBasedOnBgColor(t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray),...R?.graphObjectValues||{}},children:o.data.id}):null,f?g.jsxRuntimeExports.jsx(se.u,{marginBottom:"none",size:"sm",leading:"none",className:g.mo("w-full font-bold treemap-value",E==="ar"||E==="he"?"text-right":"text-left",$?.graphObjectValues),style:{color:ee.getTextColorBasedOnBgColor(t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray),...R?.graphObjectValues||{}},children:ve.numberFormattingFunction(o.data.value,"NA",J,p,y)}):null]})})}):null]},o.data.id))})})}),L&&v&&_&&Y?g.jsxRuntimeExports.jsx(xe.Tooltip,{data:L,body:v,xPos:_,yPos:Y,backgroundStyle:R?.tooltip,className:$?.tooltip}):null,w&&D!==void 0?g.jsxRuntimeExports.jsx(me.X,{open:D!==void 0,onClose:()=>{I(void 0)},children:g.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof w=="string"?{__html:ye.string2HTML(w,D)}:void 0,children:typeof w=="function"?w(D):null})}):null]})}function ot(e){const{data:t,graphTitle:n,colors:r,suffix:a="",sources:s,prefix:l="",graphDescription:h,leftMargin:m=0,rightMargin:j=0,topMargin:c=0,bottomMargin:v=0,height:i,width:u,footNote:f,colorDomain:y,colorLegendTitle:p,padding:d,backgroundColor:C=!1,showLabels:k=!0,relativeHeight:w,tooltip:E,onSeriesMouseOver:R,showColorScale:$=!0,showValues:B=!0,graphID:H,highlightedDataPoints:J=[],onSeriesMouseClick:X,graphDownload:V=!1,dataDownload:L=!1,language:S="en",showNAColor:D=!0,minHeight:I=0,theme:_="light",ariaLabel:A,resetSelectionOnDoubleClick:Y=!0,detailsOnClick:z,styles:M,classNames:q,animate:K=!1,dimmedOpacity:Q=.3,precision:U=2}=e,[T,o]=O.useState(0),[b,re]=O.useState(0),[pe,ge]=O.useState(void 0),P=O.useRef(null),oe=O.useRef(null);return O.useEffect(()=>{const x=new ResizeObserver(ae=>{o(u||ae[0].target.clientWidth||620),re(i||ae[0].target.clientHeight||480)});return P.current&&(re(P.current.clientHeight||480),o(P.current.clientWidth||620),u||x.observe(P.current)),()=>x.disconnect()},[u,i]),g.jsxRuntimeExports.jsx("div",{className:`${_||"light"} flex ${u?"w-fit grow-0":"w-full grow"}`,dir:S==="he"||S==="ar"?"rtl":void 0,children:g.jsxRuntimeExports.jsx("div",{className:g.mo(`${C?C===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${S||"en"}`,q?.graphContainer),style:{...M?.graphContainer||{},...C&&C!==!0?{backgroundColor:C}:{}},id:H,ref:oe,"aria-label":A||`${n?`The graph shows ${n}. `:""}This is a chart where data points are represented by squares, and their sizes reflect their values. ${h?` ${h}`:""}`,children:g.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:C?d||"1rem":d||0},children:g.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||h||V||L?g.jsxRuntimeExports.jsx(Ee.GraphHeader,{styles:{title:M?.title,description:M?.description},classNames:{title:q?.title,description:q?.description},graphTitle:n,graphDescription:h,width:u,graphDownload:V?oe.current:void 0,dataDownload:L?t.map(x=>x.data).filter(x=>x!==void 0).length>0?t.map(x=>x.data).filter(x=>x!==void 0):t.filter(x=>x!==void 0):null}):null,g.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:t.length===0?g.jsxRuntimeExports.jsx(Re.EmptyState,{}):g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[$&&t.filter(x=>x.color).length!==0?g.jsxRuntimeExports.jsx(Me.ColorLegendWithMouseOver,{width:u,colorLegendTitle:p,colors:r||N.Colors[_].categoricalColors.colors,colorDomain:y||le.uniqBy(t.filter(x=>x.color),"color").map(x=>x.color),setSelectedColor:ge,showNAColor:D}):null,g.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:P,"aria-label":"Graph area",children:(u||T)&&(i||b)?g.jsxRuntimeExports.jsx(rt,{data:t.filter(x=>!Ce.checkIfNullOrUndefined(x.size)),colors:t.filter(x=>x.color).length===0?r?[r]:[N.Colors.primaryColors["blue-600"]]:r||N.Colors[_].categoricalColors.colors,colorDomain:t.filter(x=>x.color).length===0?[]:y||le.uniqBy(t.filter(x=>x.color),"color").map(x=>x.color),width:u||T,height:Math.max(I,i||(w?I?(u||T)*w>I?(u||T)*w:I:(u||T)*w:b)),leftMargin:m,rightMargin:j,topMargin:c,bottomMargin:v,showLabels:k,showValues:B,suffix:a,prefix:l,selectedColor:pe,tooltip:E,onSeriesMouseOver:R,onSeriesMouseClick:X,highlightedDataPoints:J,resetSelectionOnDoubleClick:Y,detailsOnClick:z,styles:M,classNames:q,language:S,animate:K===!0?{duration:.5,once:!0,amount:.5}:K||{duration:0,once:!0,amount:0},dimmedOpacity:Q,precision:U}):null})]})}),s||f?g.jsxRuntimeExports.jsx(be.GraphFooter,{styles:{footnote:M?.footnote,source:M?.source},classNames:{footnote:q?.footnote,source:q?.source},sources:s,footNote:f,width:u}):null]})})})})}exports.TreeMapGraph=ot;
2
2
  //# sourceMappingURL=TreeMapGraph.cjs.map
@@ -2,15 +2,15 @@ import { j as v, m as ie } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
2
  import { u as ce } from "./index-CaAIPGZo.js";
3
3
  import { useRef as re, useState as A, useEffect as ye } from "react";
4
4
  import { u as ue } from "./Typography-Ctgfl1J5.js";
5
- import { X as we } from "./Modal-CUU6ZK3U.js";
5
+ import { X as we } from "./Modal-DVVwpKhP.js";
6
6
  import { T as xe } from "./Tooltip-DyM5snqx.js";
7
7
  import { n as be } from "./numberFormattingFunction-14YCbkN2.js";
8
8
  import { g as ee } from "./getTextColorBasedOnBgColor-B6Nk2WBf.js";
9
9
  import { Colors as V } from "./Colors.js";
10
10
  import { s as je } from "./string2HTML-CWHGfz_d.js";
11
- import { u as Me } from "./use-in-view-BAHrBy6b.js";
12
- import { m as Z } from "./proxy-DJxJg1kD.js";
13
- import { A as Oe } from "./index-BxAUvrua.js";
11
+ import { u as Me } from "./use-in-view-yS6jzJAp.js";
12
+ import { m as Z } from "./proxy-CkpFesk1.js";
13
+ import { A as Oe } from "./index-CNvov0eg.js";
14
14
  import { c as Ce } from "./checkIfNullOrUndefined-DmfiKkNw.js";
15
15
  import { GraphFooter as ke } from "./GraphFooter.js";
16
16
  import { GraphHeader as De } from "./GraphHeader.js";
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),F=require("react"),O=require("./index-C21TvELx.cjs"),M=require("./Typography-k-kOjICQ.cjs"),U=require("./GraphFooter.cjs"),J=require("./GraphHeader.cjs"),K=require("./Colors.cjs"),Q=require("./numberFormattingFunction-02t-wJta.cjs"),X=require("./use-in-view-BCmzDU2O.cjs"),Y=require("./index-DVOJ7vxH.cjs"),Z=require("./proxy-PQd2AItT.cjs");function _(z){const{data:n,size:g=200,graphTitle:x,sources:R,colors:E=K.Colors.light.categoricalColors.colors,graphDescription:d,totalNoOfDots:f=100,unitPadding:G=3,gridSize:c=10,footNote:b,padding:N,backgroundColor:l=!1,graphID:H,graphDownload:k=!1,language:j="en",showColorScale:I=!0,showStrokeForWhiteDots:m=!0,note:C,dataDownload:S=!1,theme:P="light",width:r,height:h,minHeight:s=0,relativeHeight:a,ariaLabel:T,styles:u,classNames:w,animate:$=!1,precision:L=2}=z,q=F.useRef(null),y=$===!0?{duration:.5,once:!0,amount:.5}:$||{duration:0,once:!0,amount:0},W=X.useInView(q,{once:y.once,amount:y.amount}),B=O.sum(n.map(e=>e.value)),D=F.useRef(null),o=g/c,p=(o-G*2)/2;if(p<=0)return console.error("The size of single unit is less than or equal to zero. Check values for ((dimension / gridSize) - (padding * 2)) / 2 is not less than or equal to 0."),null;const v=[];return n.forEach((e,i)=>{const A=Math.round(e.value/B*f);for(let V=0;V<A;V+=1)v.push({color:E[i]})}),t.jsxRuntimeExports.jsx("div",{className:`${P||"light"} flex ${r?"w-fit grow-0":"w-full grow"}`,dir:j==="he"||j==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${l?l===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${j||"en"}`,w?.graphContainer),style:{...u?.graphContainer||{},minHeight:"inherit",...l&&l!==!0?{backgroundColor:l}:{}},id:H,ref:D,"aria-label":T||`${x?`The graph shows ${x}. `:""}${d?` ${d}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:l?N||"1rem":N||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-3 w-full grow",children:[x||d||k?t.jsxRuntimeExports.jsx(J.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:w?.title,description:w?.description},graphTitle:x,graphDescription:d,width:r,graphDownload:k?D.current:void 0,dataDownload:S?n.map(e=>e.data).filter(e=>e!==void 0).length>0?n.map(e=>e.data).filter(e=>e!==void 0):n.filter(e=>e!==void 0):null}):null,C?t.jsxRuntimeExports.jsx(M.f,{marginBottom:"2xs",className:"text-primary-gray-700 dark:text-primary-gray-100 font-bold",style:{width:r?`${r}px`:"100%"},children:C}):null,t.jsxRuntimeExports.jsxs("div",{className:"flex grow flex-col gap-4 justify-between",children:[t.jsxRuntimeExports.jsxs("div",{children:[I?t.jsxRuntimeExports.jsx("div",{className:"mb-4 leading-0",style:{width:r?`${r}px`:"100%"},"aria-label":"Color legend",children:t.jsxRuntimeExports.jsx("div",{className:"flex mb-0 flex-wrap gap-x-4 gap-y-1",children:n.map((e,i)=>t.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",children:[t.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:E[i]}}),t.jsxRuntimeExports.jsxs(M.u,{marginBottom:"none",size:"sm",className:"text-primary-gray-700 dark:text-primary-gray-100",children:[e.label,":"," ",t.jsxRuntimeExports.jsx("span",{className:"font-bold",children:Q.numberFormattingFunction(e.value,"NA",L)})]})]},i))})}):null,t.jsxRuntimeExports.jsx("div",{"aria-label":"Graph area",children:t.jsxRuntimeExports.jsx("svg",{width:`${r||g}px`,height:`${Math.max(s,h?a&&r?s?r*a>s?r*a:s:r*a:h:Math.floor((f-1)/c)*o+o/2+p+5)}px`,ref:q,direction:"ltr",viewBox:`0 0 ${r||g} ${Math.max(s,h?a&&r?s?r*a>s?r*a:s:r*a:h:Math.floor((f-1)/c)*o+o/2+p+5)}`,children:t.jsxRuntimeExports.jsx(Y.AnimatePresence,{children:t.jsxRuntimeExports.jsx("g",{children:v.map((e,i)=>t.jsxRuntimeExports.jsx(Z.motion.circle,{cx:i%c*o+o/2,cy:Math.floor(i/c)*o+o/2,style:{...m?{}:{stroke:e.color},strokeWidth:1},variants:{initial:{fill:"#fff",opacity:0,...m?{}:{stroke:e.color},strokeWidth:1},whileInView:{fill:e.color,opacity:1,...m?{}:{stroke:e.color},strokeWidth:1,transition:{duration:0,delay:y.duration/v.length*i}}},initial:"initial",animate:W?"whileInView":"initial",className:(e.color.toLowerCase()==="#fff"||e.color.toLowerCase()==="#ffffff"||e.color.toLowerCase()==="white")&&m?"stroke-primary-gray-400 dark:stroke-primary-gray-500":"",r:p},i))})})})})]}),R||b?t.jsxRuntimeExports.jsx(U.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},sources:R,footNote:b,width:r}):null]})]})})})})}exports.UnitChart=_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),F=require("react"),O=require("./index-C21TvELx.cjs"),M=require("./Typography-k-kOjICQ.cjs"),U=require("./GraphFooter.cjs"),J=require("./GraphHeader.cjs"),K=require("./Colors.cjs"),Q=require("./numberFormattingFunction-02t-wJta.cjs"),X=require("./use-in-view-sQJZ_xDO.cjs"),Y=require("./index-BW8iNx7E.cjs"),Z=require("./proxy-BHRoeZgd.cjs");function _(z){const{data:n,size:g=200,graphTitle:x,sources:R,colors:E=K.Colors.light.categoricalColors.colors,graphDescription:d,totalNoOfDots:f=100,unitPadding:G=3,gridSize:c=10,footNote:b,padding:N,backgroundColor:l=!1,graphID:H,graphDownload:k=!1,language:j="en",showColorScale:I=!0,showStrokeForWhiteDots:m=!0,note:C,dataDownload:S=!1,theme:P="light",width:r,height:h,minHeight:s=0,relativeHeight:a,ariaLabel:T,styles:u,classNames:w,animate:$=!1,precision:L=2}=z,q=F.useRef(null),y=$===!0?{duration:.5,once:!0,amount:.5}:$||{duration:0,once:!0,amount:0},W=X.useInView(q,{once:y.once,amount:y.amount}),B=O.sum(n.map(e=>e.value)),D=F.useRef(null),o=g/c,p=(o-G*2)/2;if(p<=0)return console.error("The size of single unit is less than or equal to zero. Check values for ((dimension / gridSize) - (padding * 2)) / 2 is not less than or equal to 0."),null;const v=[];return n.forEach((e,i)=>{const A=Math.round(e.value/B*f);for(let V=0;V<A;V+=1)v.push({color:E[i]})}),t.jsxRuntimeExports.jsx("div",{className:`${P||"light"} flex ${r?"w-fit grow-0":"w-full grow"}`,dir:j==="he"||j==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${l?l===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${j||"en"}`,w?.graphContainer),style:{...u?.graphContainer||{},minHeight:"inherit",...l&&l!==!0?{backgroundColor:l}:{}},id:H,ref:D,"aria-label":T||`${x?`The graph shows ${x}. `:""}${d?` ${d}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:l?N||"1rem":N||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-3 w-full grow",children:[x||d||k?t.jsxRuntimeExports.jsx(J.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:w?.title,description:w?.description},graphTitle:x,graphDescription:d,width:r,graphDownload:k?D.current:void 0,dataDownload:S?n.map(e=>e.data).filter(e=>e!==void 0).length>0?n.map(e=>e.data).filter(e=>e!==void 0):n.filter(e=>e!==void 0):null}):null,C?t.jsxRuntimeExports.jsx(M.f,{marginBottom:"2xs",className:"text-primary-gray-700 dark:text-primary-gray-100 font-bold",style:{width:r?`${r}px`:"100%"},children:C}):null,t.jsxRuntimeExports.jsxs("div",{className:"flex grow flex-col gap-4 justify-between",children:[t.jsxRuntimeExports.jsxs("div",{children:[I?t.jsxRuntimeExports.jsx("div",{className:"mb-4 leading-0",style:{width:r?`${r}px`:"100%"},"aria-label":"Color legend",children:t.jsxRuntimeExports.jsx("div",{className:"flex mb-0 flex-wrap gap-x-4 gap-y-1",children:n.map((e,i)=>t.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",children:[t.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:E[i]}}),t.jsxRuntimeExports.jsxs(M.u,{marginBottom:"none",size:"sm",className:"text-primary-gray-700 dark:text-primary-gray-100",children:[e.label,":"," ",t.jsxRuntimeExports.jsx("span",{className:"font-bold",children:Q.numberFormattingFunction(e.value,"NA",L)})]})]},i))})}):null,t.jsxRuntimeExports.jsx("div",{"aria-label":"Graph area",children:t.jsxRuntimeExports.jsx("svg",{width:`${r||g}px`,height:`${Math.max(s,h?a&&r?s?r*a>s?r*a:s:r*a:h:Math.floor((f-1)/c)*o+o/2+p+5)}px`,ref:q,direction:"ltr",viewBox:`0 0 ${r||g} ${Math.max(s,h?a&&r?s?r*a>s?r*a:s:r*a:h:Math.floor((f-1)/c)*o+o/2+p+5)}`,children:t.jsxRuntimeExports.jsx(Y.AnimatePresence,{children:t.jsxRuntimeExports.jsx("g",{children:v.map((e,i)=>t.jsxRuntimeExports.jsx(Z.motion.circle,{cx:i%c*o+o/2,cy:Math.floor(i/c)*o+o/2,style:{...m?{}:{stroke:e.color},strokeWidth:1},variants:{initial:{fill:"#fff",opacity:0,...m?{}:{stroke:e.color},strokeWidth:1},whileInView:{fill:e.color,opacity:1,...m?{}:{stroke:e.color},strokeWidth:1,transition:{duration:0,delay:y.duration/v.length*i}}},initial:"initial",animate:W?"whileInView":"initial",className:(e.color.toLowerCase()==="#fff"||e.color.toLowerCase()==="#ffffff"||e.color.toLowerCase()==="white")&&m?"stroke-primary-gray-400 dark:stroke-primary-gray-500":"",r:p},i))})})})})]}),R||b?t.jsxRuntimeExports.jsx(U.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},sources:R,footNote:b,width:r}):null]})]})})})})}exports.UnitChart=_;
2
2
  //# sourceMappingURL=UnitChart.cjs.map
package/dist/UnitChart.js CHANGED
@@ -6,9 +6,9 @@ import { GraphFooter as K } from "./GraphFooter.js";
6
6
  import { GraphHeader as Q } from "./GraphHeader.js";
7
7
  import { Colors as X } from "./Colors.js";
8
8
  import { n as Y } from "./numberFormattingFunction-14YCbkN2.js";
9
- import { u as Z } from "./use-in-view-BAHrBy6b.js";
10
- import { A as _ } from "./index-BxAUvrua.js";
11
- import { m as ee } from "./proxy-DJxJg1kD.js";
9
+ import { u as Z } from "./use-in-view-yS6jzJAp.js";
10
+ import { A as _ } from "./index-CNvov0eg.js";
11
+ import { m as ee } from "./proxy-CkpFesk1.js";
12
12
  function he(H) {
13
13
  const {
14
14
  data: s,
@@ -1,5 +1,5 @@
1
1
  import { j as i, m as d } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
- import { m as p } from "./proxy-DJxJg1kD.js";
2
+ import { m as p } from "./proxy-CkpFesk1.js";
3
3
  function u(a) {
4
4
  const {
5
5
  value: n,
@@ -54,4 +54,4 @@ function u(a) {
54
54
  export {
55
55
  u as X
56
56
  };
57
- //# sourceMappingURL=XAxesLabels-DQFo_z2R.js.map
57
+ //# sourceMappingURL=XAxesLabels-CaV2q-6H.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"XAxesLabels-DQFo_z2R.js","sources":["../src/Components/Elements/Axes/XAxesLabels.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\n\r\ninterface Props {\r\n value: number | string;\r\n y: number;\r\n x: number;\r\n width: number;\r\n height: number;\r\n style?: React.CSSProperties;\r\n className?: string;\r\n alignment?: 'top' | 'bottom';\r\n animate: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function XAxesLabels(props: Props) {\r\n const {\r\n value,\r\n y,\r\n x,\r\n style,\r\n className,\r\n width,\r\n height,\r\n alignment = 'top',\r\n animate,\r\n isInView,\r\n } = props;\r\n return (\r\n <motion.foreignObject\r\n width={width}\r\n height={height}\r\n y={y}\r\n variants={{\r\n initial: {\r\n x,\r\n },\r\n whileInView: {\r\n x,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n >\r\n <div\r\n className={`flex flex-col items-center h-inherit ${\r\n alignment === 'top' ? 'justify-start' : 'justify-end'\r\n }`}\r\n >\r\n <p\r\n className={cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 text-center leading-none',\r\n className,\r\n )}\r\n style={style}\r\n >\r\n {value}\r\n </p>\r\n </div>\r\n </motion.foreignObject>\r\n );\r\n}\r\n"],"names":["XAxesLabels","props","value","y","x","style","className","width","height","alignment","animate","isInView","jsx","motion","cn"],"mappings":";;AAkBO,SAASA,EAAYC,GAAc;AACxC,QAAM;AAAA,IACJ,OAAAC;AAAA,IACA,GAAAC;AAAA,IACA,GAAAC;AAAA,IACA,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,SAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,IACEV;AACJ,SACEW,gBAAAA,EAAAA;AAAAA,IAACC,EAAO;AAAA,IAAP;AAAA,MACC,OAAAN;AAAA,MACA,QAAAC;AAAA,MACA,GAAAL;AAAA,MACA,UAAU;AAAA,QACR,SAAS;AAAA,UACP,GAAAC;AAAA,QAAA;AAAA,QAEF,aAAa;AAAA,UACX,GAAAA;AAAA,UACA,YAAY,EAAE,UAAUM,EAAQ,SAAA;AAAA,QAAS;AAAA,MAC3C;AAAA,MAEF,SAAQ;AAAA,MACR,SAASC,IAAW,gBAAgB;AAAA,MACpC,MAAM,EAAE,SAAS,GAAG,YAAY,EAAE,UAAUD,EAAQ,WAAS;AAAA,MAE7D,UAAAE,gBAAAA,EAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAW,wCACTH,MAAc,QAAQ,kBAAkB,aAC1C;AAAA,UAEA,UAAAG,gBAAAA,EAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWE;AAAAA,gBACT;AAAA,gBACAR;AAAA,cAAA;AAAA,cAEF,OAAAD;AAAA,cAEC,UAAAH;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"XAxesLabels-CaV2q-6H.js","sources":["../src/Components/Elements/Axes/XAxesLabels.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\n\r\ninterface Props {\r\n value: number | string;\r\n y: number;\r\n x: number;\r\n width: number;\r\n height: number;\r\n style?: React.CSSProperties;\r\n className?: string;\r\n alignment?: 'top' | 'bottom';\r\n animate: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function XAxesLabels(props: Props) {\r\n const {\r\n value,\r\n y,\r\n x,\r\n style,\r\n className,\r\n width,\r\n height,\r\n alignment = 'top',\r\n animate,\r\n isInView,\r\n } = props;\r\n return (\r\n <motion.foreignObject\r\n width={width}\r\n height={height}\r\n y={y}\r\n variants={{\r\n initial: {\r\n x,\r\n },\r\n whileInView: {\r\n x,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n >\r\n <div\r\n className={`flex flex-col items-center h-inherit ${\r\n alignment === 'top' ? 'justify-start' : 'justify-end'\r\n }`}\r\n >\r\n <p\r\n className={cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 text-center leading-none',\r\n className,\r\n )}\r\n style={style}\r\n >\r\n {value}\r\n </p>\r\n </div>\r\n </motion.foreignObject>\r\n );\r\n}\r\n"],"names":["XAxesLabels","props","value","y","x","style","className","width","height","alignment","animate","isInView","jsx","motion","cn"],"mappings":";;AAkBO,SAASA,EAAYC,GAAc;AACxC,QAAM;AAAA,IACJ,OAAAC;AAAA,IACA,GAAAC;AAAA,IACA,GAAAC;AAAA,IACA,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,SAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,IACEV;AACJ,SACEW,gBAAAA,EAAAA;AAAAA,IAACC,EAAO;AAAA,IAAP;AAAA,MACC,OAAAN;AAAA,MACA,QAAAC;AAAA,MACA,GAAAL;AAAA,MACA,UAAU;AAAA,QACR,SAAS;AAAA,UACP,GAAAC;AAAA,QAAA;AAAA,QAEF,aAAa;AAAA,UACX,GAAAA;AAAA,UACA,YAAY,EAAE,UAAUM,EAAQ,SAAA;AAAA,QAAS;AAAA,MAC3C;AAAA,MAEF,SAAQ;AAAA,MACR,SAASC,IAAW,gBAAgB;AAAA,MACpC,MAAM,EAAE,SAAS,GAAG,YAAY,EAAE,UAAUD,EAAQ,WAAS;AAAA,MAE7D,UAAAE,gBAAAA,EAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAW,wCACTH,MAAc,QAAQ,kBAAkB,aAC1C;AAAA,UAEA,UAAAG,gBAAAA,EAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWE;AAAAA,gBACT;AAAA,gBACAR;AAAA,cAAA;AAAA,cAEF,OAAAD;AAAA,cAEC,UAAAH;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
@@ -1,2 +1,2 @@
1
- "use strict";const i=require("./index-CHPV5EwG-DDoeWRVt.cjs"),u=require("./proxy-PQd2AItT.cjs");function d(n){const{value:a,y:s,x:t,style:r,className:l,width:o,height:x,alignment:c="top",animate:e,isInView:m}=n;return i.jsxRuntimeExports.jsx(u.motion.foreignObject,{width:o,height:x,y:s,variants:{initial:{x:t},whileInView:{x:t,transition:{duration:e.duration}}},initial:"initial",animate:m?"whileInView":"initial",exit:{opacity:0,transition:{duration:e.duration}},children:i.jsxRuntimeExports.jsx("div",{className:`flex flex-col items-center h-inherit ${c==="top"?"justify-start":"justify-end"}`,children:i.jsxRuntimeExports.jsx("p",{className:i.mo("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 text-center leading-none",l),style:r,children:a})})})}exports.XAxesLabels=d;
2
- //# sourceMappingURL=XAxesLabels-CJMQbfVy.cjs.map
1
+ "use strict";const i=require("./index-CHPV5EwG-DDoeWRVt.cjs"),u=require("./proxy-BHRoeZgd.cjs");function d(n){const{value:a,y:s,x:t,style:r,className:l,width:o,height:x,alignment:c="top",animate:e,isInView:m}=n;return i.jsxRuntimeExports.jsx(u.motion.foreignObject,{width:o,height:x,y:s,variants:{initial:{x:t},whileInView:{x:t,transition:{duration:e.duration}}},initial:"initial",animate:m?"whileInView":"initial",exit:{opacity:0,transition:{duration:e.duration}},children:i.jsxRuntimeExports.jsx("div",{className:`flex flex-col items-center h-inherit ${c==="top"?"justify-start":"justify-end"}`,children:i.jsxRuntimeExports.jsx("p",{className:i.mo("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 text-center leading-none",l),style:r,children:a})})})}exports.XAxesLabels=d;
2
+ //# sourceMappingURL=XAxesLabels-OjBNl_lS.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"XAxesLabels-CJMQbfVy.cjs","sources":["../src/Components/Elements/Axes/XAxesLabels.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\n\r\ninterface Props {\r\n value: number | string;\r\n y: number;\r\n x: number;\r\n width: number;\r\n height: number;\r\n style?: React.CSSProperties;\r\n className?: string;\r\n alignment?: 'top' | 'bottom';\r\n animate: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function XAxesLabels(props: Props) {\r\n const {\r\n value,\r\n y,\r\n x,\r\n style,\r\n className,\r\n width,\r\n height,\r\n alignment = 'top',\r\n animate,\r\n isInView,\r\n } = props;\r\n return (\r\n <motion.foreignObject\r\n width={width}\r\n height={height}\r\n y={y}\r\n variants={{\r\n initial: {\r\n x,\r\n },\r\n whileInView: {\r\n x,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n >\r\n <div\r\n className={`flex flex-col items-center h-inherit ${\r\n alignment === 'top' ? 'justify-start' : 'justify-end'\r\n }`}\r\n >\r\n <p\r\n className={cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 text-center leading-none',\r\n className,\r\n )}\r\n style={style}\r\n >\r\n {value}\r\n </p>\r\n </div>\r\n </motion.foreignObject>\r\n );\r\n}\r\n"],"names":["XAxesLabels","props","value","y","x","style","className","width","height","alignment","animate","isInView","jsx","motion","cn"],"mappings":"gGAkBO,SAASA,EAAYC,EAAc,CACxC,KAAM,CACJ,MAAAC,EACA,EAAAC,EACA,EAAAC,EACA,MAAAC,EACA,UAAAC,EACA,MAAAC,EACA,OAAAC,EACA,UAAAC,EAAY,MACZ,QAAAC,EACA,SAAAC,CAAA,EACEV,EACJ,OACEW,EAAAA,kBAAAA,IAACC,EAAAA,OAAO,cAAP,CACC,MAAAN,EACA,OAAAC,EACA,EAAAL,EACA,SAAU,CACR,QAAS,CACP,EAAAC,CAAA,EAEF,YAAa,CACX,EAAAA,EACA,WAAY,CAAE,SAAUM,EAAQ,QAAA,CAAS,CAC3C,EAEF,QAAQ,UACR,QAASC,EAAW,cAAgB,UACpC,KAAM,CAAE,QAAS,EAAG,WAAY,CAAE,SAAUD,EAAQ,SAAS,EAE7D,SAAAE,EAAAA,kBAAAA,IAAC,MAAA,CACC,UAAW,wCACTH,IAAc,MAAQ,gBAAkB,aAC1C,GAEA,SAAAG,EAAAA,kBAAAA,IAAC,IAAA,CACC,UAAWE,EAAAA,GACT,oGACAR,CAAA,EAEF,MAAAD,EAEC,SAAAH,CAAA,CAAA,CACH,CAAA,CACF,CAAA,CAGN"}
1
+ {"version":3,"file":"XAxesLabels-OjBNl_lS.cjs","sources":["../src/Components/Elements/Axes/XAxesLabels.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\n\r\ninterface Props {\r\n value: number | string;\r\n y: number;\r\n x: number;\r\n width: number;\r\n height: number;\r\n style?: React.CSSProperties;\r\n className?: string;\r\n alignment?: 'top' | 'bottom';\r\n animate: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function XAxesLabels(props: Props) {\r\n const {\r\n value,\r\n y,\r\n x,\r\n style,\r\n className,\r\n width,\r\n height,\r\n alignment = 'top',\r\n animate,\r\n isInView,\r\n } = props;\r\n return (\r\n <motion.foreignObject\r\n width={width}\r\n height={height}\r\n y={y}\r\n variants={{\r\n initial: {\r\n x,\r\n },\r\n whileInView: {\r\n x,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n >\r\n <div\r\n className={`flex flex-col items-center h-inherit ${\r\n alignment === 'top' ? 'justify-start' : 'justify-end'\r\n }`}\r\n >\r\n <p\r\n className={cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 text-center leading-none',\r\n className,\r\n )}\r\n style={style}\r\n >\r\n {value}\r\n </p>\r\n </div>\r\n </motion.foreignObject>\r\n );\r\n}\r\n"],"names":["XAxesLabels","props","value","y","x","style","className","width","height","alignment","animate","isInView","jsx","motion","cn"],"mappings":"gGAkBO,SAASA,EAAYC,EAAc,CACxC,KAAM,CACJ,MAAAC,EACA,EAAAC,EACA,EAAAC,EACA,MAAAC,EACA,UAAAC,EACA,MAAAC,EACA,OAAAC,EACA,UAAAC,EAAY,MACZ,QAAAC,EACA,SAAAC,CAAA,EACEV,EACJ,OACEW,EAAAA,kBAAAA,IAACC,EAAAA,OAAO,cAAP,CACC,MAAAN,EACA,OAAAC,EACA,EAAAL,EACA,SAAU,CACR,QAAS,CACP,EAAAC,CAAA,EAEF,YAAa,CACX,EAAAA,EACA,WAAY,CAAE,SAAUM,EAAQ,QAAA,CAAS,CAC3C,EAEF,QAAQ,UACR,QAASC,EAAW,cAAgB,UACpC,KAAM,CAAE,QAAS,EAAG,WAAY,CAAE,SAAUD,EAAQ,SAAS,EAE7D,SAAAE,EAAAA,kBAAAA,IAAC,MAAA,CACC,UAAW,wCACTH,IAAc,MAAQ,gBAAkB,aAC1C,GAEA,SAAAG,EAAAA,kBAAAA,IAAC,IAAA,CACC,UAAWE,EAAAA,GACT,oGACAR,CAAA,EAEF,MAAAD,EAEC,SAAAH,CAAA,CAAA,CACH,CAAA,CACF,CAAA,CAGN"}
@@ -1,5 +1,5 @@
1
1
  import { j as i, m as d } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
- import { m as h } from "./proxy-DJxJg1kD.js";
2
+ import { m as h } from "./proxy-CkpFesk1.js";
3
3
  function u(n) {
4
4
  const {
5
5
  value: e,
@@ -49,4 +49,4 @@ function u(n) {
49
49
  export {
50
50
  u as Y
51
51
  };
52
- //# sourceMappingURL=YAxesLabels-H5-002X5.js.map
52
+ //# sourceMappingURL=YAxesLabels-CPGZjmZJ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"YAxesLabels-H5-002X5.js","sources":["../src/Components/Elements/Axes/YAxesLabels.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\n\r\ninterface Props {\r\n value: number | string;\r\n y: number;\r\n x: number;\r\n width: number;\r\n height: number;\r\n style?: React.CSSProperties;\r\n className?: string;\r\n alignment?: 'left' | 'right' | 'center';\r\n animate: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function YAxesLabels(props: Props) {\r\n const {\r\n value,\r\n y,\r\n x,\r\n style,\r\n className,\r\n width,\r\n height,\r\n alignment = 'right',\r\n animate,\r\n isInView,\r\n } = props;\r\n return (\r\n <motion.foreignObject\r\n width={width}\r\n height={height}\r\n x={x}\r\n variants={{\r\n initial: {\r\n y,\r\n },\r\n whileInView: {\r\n y,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n >\r\n <div className='flex flex-col justify-center h-inherit'>\r\n <p\r\n className={cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 leading-none',\r\n `text-${alignment}`,\r\n className,\r\n )}\r\n style={style}\r\n >\r\n {value}\r\n </p>\r\n </div>\r\n </motion.foreignObject>\r\n );\r\n}\r\n"],"names":["YAxesLabels","props","value","y","x","style","className","width","height","alignment","animate","isInView","jsx","motion","cn"],"mappings":";;AAkBO,SAASA,EAAYC,GAAc;AACxC,QAAM;AAAA,IACJ,OAAAC;AAAA,IACA,GAAAC;AAAA,IACA,GAAAC;AAAA,IACA,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,SAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,IACEV;AACJ,SACEW,gBAAAA,EAAAA;AAAAA,IAACC,EAAO;AAAA,IAAP;AAAA,MACC,OAAAN;AAAA,MACA,QAAAC;AAAA,MACA,GAAAJ;AAAA,MACA,UAAU;AAAA,QACR,SAAS;AAAA,UACP,GAAAD;AAAA,QAAA;AAAA,QAEF,aAAa;AAAA,UACX,GAAAA;AAAA,UACA,YAAY,EAAE,UAAUO,EAAQ,SAAA;AAAA,QAAS;AAAA,MAC3C;AAAA,MAEF,SAAQ;AAAA,MACR,SAASC,IAAW,gBAAgB;AAAA,MACpC,MAAM,EAAE,SAAS,GAAG,YAAY,EAAE,UAAUD,EAAQ,WAAS;AAAA,MAE7D,UAAAE,gBAAAA,EAAAA,IAAC,OAAA,EAAI,WAAU,0CACb,UAAAA,gBAAAA,EAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWE;AAAAA,YACT;AAAA,YACA,QAAQL,CAAS;AAAA,YACjBH;AAAA,UAAA;AAAA,UAEF,OAAAD;AAAA,UAEC,UAAAH;AAAA,QAAA;AAAA,MAAA,EACH,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"YAxesLabels-CPGZjmZJ.js","sources":["../src/Components/Elements/Axes/YAxesLabels.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\n\r\ninterface Props {\r\n value: number | string;\r\n y: number;\r\n x: number;\r\n width: number;\r\n height: number;\r\n style?: React.CSSProperties;\r\n className?: string;\r\n alignment?: 'left' | 'right' | 'center';\r\n animate: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function YAxesLabels(props: Props) {\r\n const {\r\n value,\r\n y,\r\n x,\r\n style,\r\n className,\r\n width,\r\n height,\r\n alignment = 'right',\r\n animate,\r\n isInView,\r\n } = props;\r\n return (\r\n <motion.foreignObject\r\n width={width}\r\n height={height}\r\n x={x}\r\n variants={{\r\n initial: {\r\n y,\r\n },\r\n whileInView: {\r\n y,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n >\r\n <div className='flex flex-col justify-center h-inherit'>\r\n <p\r\n className={cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 leading-none',\r\n `text-${alignment}`,\r\n className,\r\n )}\r\n style={style}\r\n >\r\n {value}\r\n </p>\r\n </div>\r\n </motion.foreignObject>\r\n );\r\n}\r\n"],"names":["YAxesLabels","props","value","y","x","style","className","width","height","alignment","animate","isInView","jsx","motion","cn"],"mappings":";;AAkBO,SAASA,EAAYC,GAAc;AACxC,QAAM;AAAA,IACJ,OAAAC;AAAA,IACA,GAAAC;AAAA,IACA,GAAAC;AAAA,IACA,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,SAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,IACEV;AACJ,SACEW,gBAAAA,EAAAA;AAAAA,IAACC,EAAO;AAAA,IAAP;AAAA,MACC,OAAAN;AAAA,MACA,QAAAC;AAAA,MACA,GAAAJ;AAAA,MACA,UAAU;AAAA,QACR,SAAS;AAAA,UACP,GAAAD;AAAA,QAAA;AAAA,QAEF,aAAa;AAAA,UACX,GAAAA;AAAA,UACA,YAAY,EAAE,UAAUO,EAAQ,SAAA;AAAA,QAAS;AAAA,MAC3C;AAAA,MAEF,SAAQ;AAAA,MACR,SAASC,IAAW,gBAAgB;AAAA,MACpC,MAAM,EAAE,SAAS,GAAG,YAAY,EAAE,UAAUD,EAAQ,WAAS;AAAA,MAE7D,UAAAE,gBAAAA,EAAAA,IAAC,OAAA,EAAI,WAAU,0CACb,UAAAA,gBAAAA,EAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWE;AAAAA,YACT;AAAA,YACA,QAAQL,CAAS;AAAA,YACjBH;AAAA,UAAA;AAAA,UAEF,OAAAD;AAAA,UAEC,UAAAH;AAAA,QAAA;AAAA,MAAA,EACH,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,2 +1,2 @@
1
- "use strict";const i=require("./index-CHPV5EwG-DDoeWRVt.cjs"),u=require("./proxy-PQd2AItT.cjs");function d(n){const{value:a,y:t,x:r,style:s,className:l,width:o,height:x,alignment:c="right",animate:e,isInView:m}=n;return i.jsxRuntimeExports.jsx(u.motion.foreignObject,{width:o,height:x,x:r,variants:{initial:{y:t},whileInView:{y:t,transition:{duration:e.duration}}},initial:"initial",animate:m?"whileInView":"initial",exit:{opacity:0,transition:{duration:e.duration}},children:i.jsxRuntimeExports.jsx("div",{className:"flex flex-col justify-center h-inherit",children:i.jsxRuntimeExports.jsx("p",{className:i.mo("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 leading-none",`text-${c}`,l),style:s,children:a})})})}exports.YAxesLabels=d;
2
- //# sourceMappingURL=YAxesLabels-BXLTX7AI.cjs.map
1
+ "use strict";const i=require("./index-CHPV5EwG-DDoeWRVt.cjs"),u=require("./proxy-BHRoeZgd.cjs");function d(n){const{value:a,y:t,x:r,style:s,className:l,width:o,height:x,alignment:c="right",animate:e,isInView:m}=n;return i.jsxRuntimeExports.jsx(u.motion.foreignObject,{width:o,height:x,x:r,variants:{initial:{y:t},whileInView:{y:t,transition:{duration:e.duration}}},initial:"initial",animate:m?"whileInView":"initial",exit:{opacity:0,transition:{duration:e.duration}},children:i.jsxRuntimeExports.jsx("div",{className:"flex flex-col justify-center h-inherit",children:i.jsxRuntimeExports.jsx("p",{className:i.mo("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 leading-none",`text-${c}`,l),style:s,children:a})})})}exports.YAxesLabels=d;
2
+ //# sourceMappingURL=YAxesLabels-D8IydyZj.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"YAxesLabels-BXLTX7AI.cjs","sources":["../src/Components/Elements/Axes/YAxesLabels.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\n\r\ninterface Props {\r\n value: number | string;\r\n y: number;\r\n x: number;\r\n width: number;\r\n height: number;\r\n style?: React.CSSProperties;\r\n className?: string;\r\n alignment?: 'left' | 'right' | 'center';\r\n animate: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function YAxesLabels(props: Props) {\r\n const {\r\n value,\r\n y,\r\n x,\r\n style,\r\n className,\r\n width,\r\n height,\r\n alignment = 'right',\r\n animate,\r\n isInView,\r\n } = props;\r\n return (\r\n <motion.foreignObject\r\n width={width}\r\n height={height}\r\n x={x}\r\n variants={{\r\n initial: {\r\n y,\r\n },\r\n whileInView: {\r\n y,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n >\r\n <div className='flex flex-col justify-center h-inherit'>\r\n <p\r\n className={cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 leading-none',\r\n `text-${alignment}`,\r\n className,\r\n )}\r\n style={style}\r\n >\r\n {value}\r\n </p>\r\n </div>\r\n </motion.foreignObject>\r\n );\r\n}\r\n"],"names":["YAxesLabels","props","value","y","x","style","className","width","height","alignment","animate","isInView","jsx","motion","cn"],"mappings":"gGAkBO,SAASA,EAAYC,EAAc,CACxC,KAAM,CACJ,MAAAC,EACA,EAAAC,EACA,EAAAC,EACA,MAAAC,EACA,UAAAC,EACA,MAAAC,EACA,OAAAC,EACA,UAAAC,EAAY,QACZ,QAAAC,EACA,SAAAC,CAAA,EACEV,EACJ,OACEW,EAAAA,kBAAAA,IAACC,EAAAA,OAAO,cAAP,CACC,MAAAN,EACA,OAAAC,EACA,EAAAJ,EACA,SAAU,CACR,QAAS,CACP,EAAAD,CAAA,EAEF,YAAa,CACX,EAAAA,EACA,WAAY,CAAE,SAAUO,EAAQ,QAAA,CAAS,CAC3C,EAEF,QAAQ,UACR,QAASC,EAAW,cAAgB,UACpC,KAAM,CAAE,QAAS,EAAG,WAAY,CAAE,SAAUD,EAAQ,SAAS,EAE7D,SAAAE,EAAAA,kBAAAA,IAAC,MAAA,CAAI,UAAU,yCACb,SAAAA,EAAAA,kBAAAA,IAAC,IAAA,CACC,UAAWE,EAAAA,GACT,wFACA,QAAQL,CAAS,GACjBH,CAAA,EAEF,MAAAD,EAEC,SAAAH,CAAA,CAAA,CACH,CACF,CAAA,CAAA,CAGN"}
1
+ {"version":3,"file":"YAxesLabels-D8IydyZj.cjs","sources":["../src/Components/Elements/Axes/YAxesLabels.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\n\r\ninterface Props {\r\n value: number | string;\r\n y: number;\r\n x: number;\r\n width: number;\r\n height: number;\r\n style?: React.CSSProperties;\r\n className?: string;\r\n alignment?: 'left' | 'right' | 'center';\r\n animate: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function YAxesLabels(props: Props) {\r\n const {\r\n value,\r\n y,\r\n x,\r\n style,\r\n className,\r\n width,\r\n height,\r\n alignment = 'right',\r\n animate,\r\n isInView,\r\n } = props;\r\n return (\r\n <motion.foreignObject\r\n width={width}\r\n height={height}\r\n x={x}\r\n variants={{\r\n initial: {\r\n y,\r\n },\r\n whileInView: {\r\n y,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n >\r\n <div className='flex flex-col justify-center h-inherit'>\r\n <p\r\n className={cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 leading-none',\r\n `text-${alignment}`,\r\n className,\r\n )}\r\n style={style}\r\n >\r\n {value}\r\n </p>\r\n </div>\r\n </motion.foreignObject>\r\n );\r\n}\r\n"],"names":["YAxesLabels","props","value","y","x","style","className","width","height","alignment","animate","isInView","jsx","motion","cn"],"mappings":"gGAkBO,SAASA,EAAYC,EAAc,CACxC,KAAM,CACJ,MAAAC,EACA,EAAAC,EACA,EAAAC,EACA,MAAAC,EACA,UAAAC,EACA,MAAAC,EACA,OAAAC,EACA,UAAAC,EAAY,QACZ,QAAAC,EACA,SAAAC,CAAA,EACEV,EACJ,OACEW,EAAAA,kBAAAA,IAACC,EAAAA,OAAO,cAAP,CACC,MAAAN,EACA,OAAAC,EACA,EAAAJ,EACA,SAAU,CACR,QAAS,CACP,EAAAD,CAAA,EAEF,YAAa,CACX,EAAAA,EACA,WAAY,CAAE,SAAUO,EAAQ,QAAA,CAAS,CAC3C,EAEF,QAAQ,UACR,QAASC,EAAW,cAAgB,UACpC,KAAM,CAAE,QAAS,EAAG,WAAY,CAAE,SAAUD,EAAQ,SAAS,EAE7D,SAAAE,EAAAA,kBAAAA,IAAC,MAAA,CAAI,UAAU,yCACb,SAAAA,EAAAA,kBAAAA,IAAC,IAAA,CACC,UAAWE,EAAAA,GACT,wFACA,QAAQL,CAAS,GACjBH,CAAA,EAEF,MAAAD,EAEC,SAAAH,CAAA,CAAA,CACH,CACF,CAAA,CAAA,CAGN"}
@@ -1,12 +1,12 @@
1
- "use strict";const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),w=require("react"),d=require("./index-DG3YrCr5-v7rayV3N.cjs"),O=require("./x-CnsEH4Ox-CGGXQl4M.cjs"),Pe=require("./index-tvAyXPPW-DPOG-C2i.cjs"),$e=require("./Modal-C_dl0EtQ.cjs");function De(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const l=De(w);var Ae="Label",B=l.forwardRef((e,o)=>t.ae.jsx(d.w.label,{...e,ref:o,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));B.displayName=Ae;var K=B;const S=w.forwardRef(({className:e,...o},r)=>t.ae.jsx(K,{...o,ref:r,className:t.mo("text-sm m-0 p-0 block text-primary-gray-700 dark:text-primary-white peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e)}));S.displayName=K.displayName;function z(e){const o=l.useRef({value:e,previous:e});return l.useMemo(()=>(o.current.value!==e&&(o.current.previous=o.current.value,o.current.value=e),o.current.previous),[e])}function U(e){const[o,r]=l.useState(void 0);return d.E$1(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const a=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;const c=n[0];let s,i;if("borderBoxSize"in c){const u=c.borderBoxSize,f=Array.isArray(u)?u[0]:u;s=f.inlineSize,i=f.blockSize}else s=e.offsetWidth,i=e.offsetHeight;r({width:s,height:i})});return a.observe(e,{box:"border-box"}),()=>a.unobserve(e)}else r(void 0)},[e]),o}/**
2
- * @license lucide-react v0.488.0 - ISC
1
+ "use strict";const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),w=require("react"),i=require("./index-DG3YrCr5-v7rayV3N.cjs"),O=require("./x-BBpi7a_7-Dz2vKSfu.cjs"),Pe=require("./index-tvAyXPPW-DPOG-C2i.cjs"),$e=require("./Modal-tXZlLE5s.cjs");function De(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const l=De(w);var Ae="Label",B=l.forwardRef((e,o)=>t.ae.jsx(i.w.label,{...e,ref:o,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));B.displayName=Ae;var K=B;const S=w.forwardRef(({className:e,...o},r)=>t.ae.jsx(K,{...o,ref:r,className:t.mo("text-sm m-0 p-0 block text-primary-gray-700 dark:text-primary-white peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e)}));S.displayName=K.displayName;function z(e){const o=l.useRef({value:e,previous:e});return l.useMemo(()=>(o.current.value!==e&&(o.current.previous=o.current.value,o.current.value=e),o.current.previous),[e])}function U(e){const[o,r]=l.useState(void 0);return i.E$1(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const a=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;const c=n[0];let s,d;if("borderBoxSize"in c){const u=c.borderBoxSize,f=Array.isArray(u)?u[0]:u;s=f.inlineSize,d=f.blockSize}else s=e.offsetWidth,d=e.offsetHeight;r({width:s,height:d})});return a.observe(e,{box:"border-box"}),()=>a.unobserve(e)}else r(void 0)},[e]),o}/**
2
+ * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const Te=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],qe=O.b("check",Te);var F="Checkbox",[Me,yr]=d.g(F),[Ve,q]=Me(F);function Ge(e){const{__scopeCheckbox:o,checked:r,children:a,defaultChecked:n,disabled:c,form:s,name:i,onCheckedChange:u,required:f,value:b="on",internal_do_not_use_render:p}=e,[v,k]=d._({prop:r,defaultProp:n??!1,onChange:u,caller:F}),[h,g]=l.useState(null),[m,y]=l.useState(null),x=l.useRef(!1),C=h?!!s||!!h.closest("form"):!0,R={checked:v,disabled:c,setChecked:k,control:h,setControl:g,name:i,form:s,value:b,hasConsumerStoppedPropagationRef:x,required:f,defaultChecked:I(n)?!1:n,isFormControl:C,bubbleInput:m,setBubbleInput:y};return t.ae.jsx(Ve,{scope:o,...R,children:Le(p)?p(R):a})}var W="CheckboxTrigger",X=l.forwardRef(({__scopeCheckbox:e,onKeyDown:o,onClick:r,...a},n)=>{const{control:c,value:s,disabled:i,checked:u,required:f,setControl:b,setChecked:p,hasConsumerStoppedPropagationRef:v,isFormControl:k,bubbleInput:h}=q(W,e),g=d.P(n,b),m=l.useRef(u);return l.useEffect(()=>{const y=c?.form;if(y){const x=()=>p(m.current);return y.addEventListener("reset",x),()=>y.removeEventListener("reset",x)}},[c,p]),t.ae.jsx(d.w.button,{type:"button",role:"checkbox","aria-checked":I(u)?"mixed":u,"aria-required":f,"data-state":J(u),"data-disabled":i?"":void 0,disabled:i,value:s,...a,ref:g,onKeyDown:d.j(o,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:d.j(r,y=>{p(x=>I(x)?!0:!x),h&&k&&(v.current=y.isPropagationStopped(),v.current||y.stopPropagation())})})});X.displayName=W;var M=l.forwardRef((e,o)=>{const{__scopeCheckbox:r,name:a,checked:n,defaultChecked:c,required:s,disabled:i,value:u,onCheckedChange:f,form:b,...p}=e;return t.ae.jsx(Ge,{__scopeCheckbox:r,checked:n,defaultChecked:c,disabled:i,required:s,onCheckedChange:f,name:a,form:b,value:u,internal_do_not_use_render:({isFormControl:v})=>t.ae.jsxs(t.ae.Fragment,{children:[t.ae.jsx(X,{...p,ref:o,__scopeCheckbox:r}),v&&t.ae.jsx(Q,{__scopeCheckbox:r})]})})});M.displayName=F;var Y="CheckboxIndicator",H=l.forwardRef((e,o)=>{const{__scopeCheckbox:r,forceMount:a,...n}=e,c=q(Y,r);return t.ae.jsx(d.E,{present:a||I(c.checked)||c.checked===!0,children:t.ae.jsx(d.w.span,{"data-state":J(c.checked),"data-disabled":c.disabled?"":void 0,...n,ref:o,style:{pointerEvents:"none",...e.style}})})});H.displayName=Y;var Z="CheckboxBubbleInput",Q=l.forwardRef(({__scopeCheckbox:e,...o},r)=>{const{control:a,hasConsumerStoppedPropagationRef:n,checked:c,defaultChecked:s,required:i,disabled:u,name:f,value:b,form:p,bubbleInput:v,setBubbleInput:k}=q(Z,e),h=d.P(r,k),g=z(c),m=U(a);l.useEffect(()=>{const x=v;if(!x)return;const C=window.HTMLInputElement.prototype,R=Object.getOwnPropertyDescriptor(C,"checked").set,N=!n.current;if(g!==c&&R){const $=new Event("click",{bubbles:N});x.indeterminate=I(c),R.call(x,I(c)?!1:c),x.dispatchEvent($)}},[v,g,c,n]);const y=l.useRef(I(c)?!1:c);return t.ae.jsx(d.w.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??y.current,required:i,disabled:u,name:f,value:b,form:p,...o,tabIndex:-1,ref:h,style:{...o.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Q.displayName=Z;function Le(e){return typeof e=="function"}function I(e){return e==="indeterminate"}function J(e){return I(e)?"indeterminate":e?"checked":"unchecked"}const Oe=t.j("peer h-4 w-4 shrink-0 rounded-0 bg-primary-white dark:bg-primary-gray-650 focus-visible:outline-hidden focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50",{variants:{color:{blue:"border-primary-blue-600 hover:bg-primary-blue-100 dark:border-primary-blue-400 dark:hover:bg-primary-blue-200",red:"border-accent-dark-red hover:bg-accent-light-red dark:border-accent-red dark:hover:bg-accent-light-red",black:"border-primary-gray-700 hover:bg-primary-gray-400 dark:border-primary-gray-100 dark:hover:bg-primary-gray-550",custom:"border-custom-color-600 hover:bg-custom-color-100 dark:border-custom-color-400 dark:hover:bg-custom-color-200"},variant:{light:"border",normal:"border-2"}},defaultVariants:{color:"red",variant:"normal"}}),Be=t.j("h-4 w-4",{variants:{color:{blue:"stroke-primary-blue-600 dark:stroke-primary-blue-400",red:"stroke-accent-dark-red dark:stroke-accent-red",black:"stroke-primary-gray-700 dark:stroke-primary-gray-100",custom:"stroke-custom-color-600 dark:stroke-custom-color-400"},variant:{light:"-mt-px",normal:"-mt-0.5"}},defaultVariants:{color:"red",variant:"normal"}}),ee=w.forwardRef(({className:e,labelClassName:o,checkBoxClassName:r,checkIconClassName:a,label:n,color:c,variant:s,...i},u)=>{const f=i.id||t.po();return t.ae.jsxs("div",{className:t.mo("flex flex-row gap-2 items-center",e),children:[t.ae.jsx(M,{...i,ref:u,className:t.mo(Oe({color:c,variant:s}),r),id:f,children:t.ae.jsx(H,{className:t.mo("flex items-center justify-center text-current"),children:t.ae.jsx(qe,{className:t.mo(Be({color:c,variant:s}),a),strokeWidth:s==="light"?2:4})})}),n?t.ae.jsx(S,{className:t.mo("mt-0.5 text-base!",o),htmlFor:f,children:n}):null]})});ee.displayName=M.displayName;const re=w.createContext({selectedValues:[],onValueChange:()=>{},color:void 0,variant:void 0}),oe=w.forwardRef(({className:e,children:o,value:r,variant:a,color:n,onValueChange:c,defaultValue:s,...i},u)=>{const[f,b]=w.useState(s||[]),p=r!==void 0?r:f,v=w.useCallback((h,g)=>{const m=g?[...p,h]:p.filter(y=>y!==h);r===void 0&&b(m),c?.(m)},[p,r,c]),k=w.useMemo(()=>({selectedValues:p,color:n,variant:a,onValueChange:v}),[p,v,n,a]);return t.ae.jsx(re.Provider,{value:k,children:t.ae.jsx("div",{...i,className:t.mo("flex gap-x-4 gap-y-2 flex-row flex-wrap",e),ref:u,children:o})})});oe.displayName="CheckboxGroup";const ae=w.forwardRef(({value:e,...o},r)=>{const{selectedValues:a,onValueChange:n,color:c,variant:s}=w.useContext(re);return t.ae.jsx(ee,{ref:r,...o,value:e,color:c,variant:s,checked:a.includes(e),onCheckedChange:i=>n(e,i===!0)})});ae.displayName="CheckboxGroupItem";var Ke=l.createContext(void 0);function te(e){const o=l.useContext(Ke);return e||o||"ltr"}var A="rovingFocusGroup.onEntryFocus",ze={bubbles:!1,cancelable:!0},E="RovingFocusGroup",[T,ne,Ue]=Pe.h(E),[We,ce]=d.g(E,[Ue]),[Xe,Ye]=We(E),se=l.forwardRef((e,o)=>t.ae.jsx(T.Provider,{scope:e.__scopeRovingFocusGroup,children:t.ae.jsx(T.Slot,{scope:e.__scopeRovingFocusGroup,children:t.ae.jsx(He,{...e,ref:o})})}));se.displayName=E;var He=l.forwardRef((e,o)=>{const{__scopeRovingFocusGroup:r,orientation:a,loop:n=!1,dir:c,currentTabStopId:s,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:u,onEntryFocus:f,preventScrollOnEntryFocus:b=!1,...p}=e,v=l.useRef(null),k=d.P(o,v),h=te(c),[g,m]=d._({prop:s,defaultProp:i??null,onChange:u,caller:E}),[y,x]=l.useState(!1),C=d.c(f),R=ne(r),N=l.useRef(!1),[$,G]=l.useState(0);return l.useEffect(()=>{const j=v.current;if(j)return j.addEventListener(A,C),()=>j.removeEventListener(A,C)},[C]),t.ae.jsx(Xe,{scope:r,orientation:a,dir:h,loop:n,currentTabStopId:g,onItemFocus:l.useCallback(j=>m(j),[m]),onItemShiftTab:l.useCallback(()=>x(!0),[]),onFocusableItemAdd:l.useCallback(()=>G(j=>j+1),[]),onFocusableItemRemove:l.useCallback(()=>G(j=>j-1),[]),children:t.ae.jsx(d.w.div,{tabIndex:y||$===0?-1:0,"data-orientation":a,...p,ref:k,style:{outline:"none",...e.style},onMouseDown:d.j(e.onMouseDown,()=>{N.current=!0}),onFocus:d.j(e.onFocus,j=>{const Ne=!N.current;if(j.target===j.currentTarget&&Ne&&!y){const L=new CustomEvent(A,ze);if(j.currentTarget.dispatchEvent(L),!L.defaultPrevented){const D=R().filter(_=>_.focusable),Ee=D.find(_=>_.active),Se=D.find(_=>_.id===g),Fe=[Ee,Se,...D].filter(Boolean).map(_=>_.ref.current);ie(Fe,b)}}N.current=!1}),onBlur:d.j(e.onBlur,()=>x(!1))})})}),le="RovingFocusGroupItem",de=l.forwardRef((e,o)=>{const{__scopeRovingFocusGroup:r,focusable:a=!0,active:n=!1,tabStopId:c,children:s,...i}=e,u=$e.n(),f=c||u,b=Ye(le,r),p=b.currentTabStopId===f,v=ne(r),{onFocusableItemAdd:k,onFocusableItemRemove:h,currentTabStopId:g}=b;return l.useEffect(()=>{if(a)return k(),()=>h()},[a,k,h]),t.ae.jsx(T.ItemSlot,{scope:r,id:f,focusable:a,active:n,children:t.ae.jsx(d.w.span,{tabIndex:p?0:-1,"data-orientation":b.orientation,...i,ref:o,onMouseDown:d.j(e.onMouseDown,m=>{a?b.onItemFocus(f):m.preventDefault()}),onFocus:d.j(e.onFocus,()=>b.onItemFocus(f)),onKeyDown:d.j(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){b.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const y=Je(m,b.orientation,b.dir);if(y!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let x=v().filter(C=>C.focusable).map(C=>C.ref.current);if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const C=x.indexOf(m.currentTarget);x=b.loop?er(x,C+1):x.slice(C+1)}setTimeout(()=>ie(x))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:g!=null}):s})})});de.displayName=le;var Ze={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Qe(e,o){return o!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Je(e,o,r){const a=Qe(e.key,r);if(!(o==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(o==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return Ze[a]}function ie(e,o=!1){const r=document.activeElement;for(const a of e)if(a===r||(a.focus({preventScroll:o}),document.activeElement!==r))return}function er(e,o){return e.map((r,a)=>e[(o+a)%e.length])}var rr=se,or=de;/**
7
- * @license lucide-react v0.488.0 - ISC
6
+ */const Te=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],qe=O.k("check",Te);var F="Checkbox",[Me,yr]=i.g(F),[Ve,q]=Me(F);function Ge(e){const{__scopeCheckbox:o,checked:r,children:a,defaultChecked:n,disabled:c,form:s,name:d,onCheckedChange:u,required:f,value:b="on",internal_do_not_use_render:p}=e,[v,k]=i._({prop:r,defaultProp:n??!1,onChange:u,caller:F}),[h,g]=l.useState(null),[m,y]=l.useState(null),x=l.useRef(!1),C=h?!!s||!!h.closest("form"):!0,R={checked:v,disabled:c,setChecked:k,control:h,setControl:g,name:d,form:s,value:b,hasConsumerStoppedPropagationRef:x,required:f,defaultChecked:I(n)?!1:n,isFormControl:C,bubbleInput:m,setBubbleInput:y};return t.ae.jsx(Ve,{scope:o,...R,children:Le(p)?p(R):a})}var W="CheckboxTrigger",X=l.forwardRef(({__scopeCheckbox:e,onKeyDown:o,onClick:r,...a},n)=>{const{control:c,value:s,disabled:d,checked:u,required:f,setControl:b,setChecked:p,hasConsumerStoppedPropagationRef:v,isFormControl:k,bubbleInput:h}=q(W,e),g=i.P(n,b),m=l.useRef(u);return l.useEffect(()=>{const y=c?.form;if(y){const x=()=>p(m.current);return y.addEventListener("reset",x),()=>y.removeEventListener("reset",x)}},[c,p]),t.ae.jsx(i.w.button,{type:"button",role:"checkbox","aria-checked":I(u)?"mixed":u,"aria-required":f,"data-state":J(u),"data-disabled":d?"":void 0,disabled:d,value:s,...a,ref:g,onKeyDown:i.j(o,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:i.j(r,y=>{p(x=>I(x)?!0:!x),h&&k&&(v.current=y.isPropagationStopped(),v.current||y.stopPropagation())})})});X.displayName=W;var M=l.forwardRef((e,o)=>{const{__scopeCheckbox:r,name:a,checked:n,defaultChecked:c,required:s,disabled:d,value:u,onCheckedChange:f,form:b,...p}=e;return t.ae.jsx(Ge,{__scopeCheckbox:r,checked:n,defaultChecked:c,disabled:d,required:s,onCheckedChange:f,name:a,form:b,value:u,internal_do_not_use_render:({isFormControl:v})=>t.ae.jsxs(t.ae.Fragment,{children:[t.ae.jsx(X,{...p,ref:o,__scopeCheckbox:r}),v&&t.ae.jsx(Q,{__scopeCheckbox:r})]})})});M.displayName=F;var Y="CheckboxIndicator",Z=l.forwardRef((e,o)=>{const{__scopeCheckbox:r,forceMount:a,...n}=e,c=q(Y,r);return t.ae.jsx(i.E,{present:a||I(c.checked)||c.checked===!0,children:t.ae.jsx(i.w.span,{"data-state":J(c.checked),"data-disabled":c.disabled?"":void 0,...n,ref:o,style:{pointerEvents:"none",...e.style}})})});Z.displayName=Y;var H="CheckboxBubbleInput",Q=l.forwardRef(({__scopeCheckbox:e,...o},r)=>{const{control:a,hasConsumerStoppedPropagationRef:n,checked:c,defaultChecked:s,required:d,disabled:u,name:f,value:b,form:p,bubbleInput:v,setBubbleInput:k}=q(H,e),h=i.P(r,k),g=z(c),m=U(a);l.useEffect(()=>{const x=v;if(!x)return;const C=window.HTMLInputElement.prototype,R=Object.getOwnPropertyDescriptor(C,"checked").set,N=!n.current;if(g!==c&&R){const $=new Event("click",{bubbles:N});x.indeterminate=I(c),R.call(x,I(c)?!1:c),x.dispatchEvent($)}},[v,g,c,n]);const y=l.useRef(I(c)?!1:c);return t.ae.jsx(i.w.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??y.current,required:d,disabled:u,name:f,value:b,form:p,...o,tabIndex:-1,ref:h,style:{...o.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Q.displayName=H;function Le(e){return typeof e=="function"}function I(e){return e==="indeterminate"}function J(e){return I(e)?"indeterminate":e?"checked":"unchecked"}const Oe=t.j("peer h-4 w-4 shrink-0 rounded-0 bg-primary-white dark:bg-primary-gray-650 focus-visible:outline-hidden focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50",{variants:{color:{blue:"border-primary-blue-600 hover:bg-primary-blue-100 dark:border-primary-blue-400 dark:hover:bg-primary-blue-200",red:"border-accent-dark-red hover:bg-accent-light-red dark:border-accent-red dark:hover:bg-accent-light-red",black:"border-primary-gray-700 hover:bg-primary-gray-400 dark:border-primary-gray-100 dark:hover:bg-primary-gray-550",custom:"border-custom-color-600 hover:bg-custom-color-100 dark:border-custom-color-400 dark:hover:bg-custom-color-200"},variant:{light:"border",normal:"border-2"}},defaultVariants:{color:"red",variant:"normal"}}),Be=t.j("h-4 w-4",{variants:{color:{blue:"stroke-primary-blue-600 dark:stroke-primary-blue-400",red:"stroke-accent-dark-red dark:stroke-accent-red",black:"stroke-primary-gray-700 dark:stroke-primary-gray-100",custom:"stroke-custom-color-600 dark:stroke-custom-color-400"},variant:{light:"-mt-px",normal:"-mt-0.5"}},defaultVariants:{color:"red",variant:"normal"}}),ee=w.forwardRef(({className:e,labelClassName:o,checkBoxClassName:r,checkIconClassName:a,label:n,color:c,variant:s,...d},u)=>{const f=d.id||t.po();return t.ae.jsxs("div",{className:t.mo("flex flex-row gap-2 items-center",e),children:[t.ae.jsx(M,{...d,ref:u,className:t.mo(Oe({color:c,variant:s}),r),id:f,children:t.ae.jsx(Z,{className:t.mo("flex items-center justify-center text-current"),children:t.ae.jsx(qe,{className:t.mo(Be({color:c,variant:s}),a),strokeWidth:s==="light"?2:4})})}),n?t.ae.jsx(S,{className:t.mo("mt-0.5 text-base!",o),htmlFor:f,children:n}):null]})});ee.displayName=M.displayName;const re=w.createContext({selectedValues:[],onValueChange:()=>{},color:void 0,variant:void 0}),oe=w.forwardRef(({className:e,children:o,value:r,variant:a,color:n,onValueChange:c,defaultValue:s,...d},u)=>{const[f,b]=w.useState(s||[]),p=r!==void 0?r:f,v=w.useCallback((h,g)=>{const m=g?[...p,h]:p.filter(y=>y!==h);r===void 0&&b(m),c?.(m)},[p,r,c]),k=w.useMemo(()=>({selectedValues:p,color:n,variant:a,onValueChange:v}),[p,v,n,a]);return t.ae.jsx(re.Provider,{value:k,children:t.ae.jsx("div",{...d,className:t.mo("flex gap-x-4 gap-y-2 flex-row flex-wrap",e),ref:u,children:o})})});oe.displayName="CheckboxGroup";const ae=w.forwardRef(({value:e,...o},r)=>{const{selectedValues:a,onValueChange:n,color:c,variant:s}=w.useContext(re);return t.ae.jsx(ee,{ref:r,...o,value:e,color:c,variant:s,checked:a.includes(e),onCheckedChange:d=>n(e,d===!0)})});ae.displayName="CheckboxGroupItem";var Ke=l.createContext(void 0);function te(e){const o=l.useContext(Ke);return e||o||"ltr"}var A="rovingFocusGroup.onEntryFocus",ze={bubbles:!1,cancelable:!0},E="RovingFocusGroup",[T,ne,Ue]=Pe.h(E),[We,ce]=i.g(E,[Ue]),[Xe,Ye]=We(E),se=l.forwardRef((e,o)=>t.ae.jsx(T.Provider,{scope:e.__scopeRovingFocusGroup,children:t.ae.jsx(T.Slot,{scope:e.__scopeRovingFocusGroup,children:t.ae.jsx(Ze,{...e,ref:o})})}));se.displayName=E;var Ze=l.forwardRef((e,o)=>{const{__scopeRovingFocusGroup:r,orientation:a,loop:n=!1,dir:c,currentTabStopId:s,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:u,onEntryFocus:f,preventScrollOnEntryFocus:b=!1,...p}=e,v=l.useRef(null),k=i.P(o,v),h=te(c),[g,m]=i._({prop:s,defaultProp:d??null,onChange:u,caller:E}),[y,x]=l.useState(!1),C=i.c(f),R=ne(r),N=l.useRef(!1),[$,G]=l.useState(0);return l.useEffect(()=>{const j=v.current;if(j)return j.addEventListener(A,C),()=>j.removeEventListener(A,C)},[C]),t.ae.jsx(Xe,{scope:r,orientation:a,dir:h,loop:n,currentTabStopId:g,onItemFocus:l.useCallback(j=>m(j),[m]),onItemShiftTab:l.useCallback(()=>x(!0),[]),onFocusableItemAdd:l.useCallback(()=>G(j=>j+1),[]),onFocusableItemRemove:l.useCallback(()=>G(j=>j-1),[]),children:t.ae.jsx(i.w.div,{tabIndex:y||$===0?-1:0,"data-orientation":a,...p,ref:k,style:{outline:"none",...e.style},onMouseDown:i.j(e.onMouseDown,()=>{N.current=!0}),onFocus:i.j(e.onFocus,j=>{const Ne=!N.current;if(j.target===j.currentTarget&&Ne&&!y){const L=new CustomEvent(A,ze);if(j.currentTarget.dispatchEvent(L),!L.defaultPrevented){const D=R().filter(_=>_.focusable),Ee=D.find(_=>_.active),Se=D.find(_=>_.id===g),Fe=[Ee,Se,...D].filter(Boolean).map(_=>_.ref.current);de(Fe,b)}}N.current=!1}),onBlur:i.j(e.onBlur,()=>x(!1))})})}),le="RovingFocusGroupItem",ie=l.forwardRef((e,o)=>{const{__scopeRovingFocusGroup:r,focusable:a=!0,active:n=!1,tabStopId:c,children:s,...d}=e,u=$e.n(),f=c||u,b=Ye(le,r),p=b.currentTabStopId===f,v=ne(r),{onFocusableItemAdd:k,onFocusableItemRemove:h,currentTabStopId:g}=b;return l.useEffect(()=>{if(a)return k(),()=>h()},[a,k,h]),t.ae.jsx(T.ItemSlot,{scope:r,id:f,focusable:a,active:n,children:t.ae.jsx(i.w.span,{tabIndex:p?0:-1,"data-orientation":b.orientation,...d,ref:o,onMouseDown:i.j(e.onMouseDown,m=>{a?b.onItemFocus(f):m.preventDefault()}),onFocus:i.j(e.onFocus,()=>b.onItemFocus(f)),onKeyDown:i.j(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){b.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const y=Je(m,b.orientation,b.dir);if(y!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let x=v().filter(C=>C.focusable).map(C=>C.ref.current);if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const C=x.indexOf(m.currentTarget);x=b.loop?er(x,C+1):x.slice(C+1)}setTimeout(()=>de(x))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:g!=null}):s})})});ie.displayName=le;var He={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Qe(e,o){return o!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Je(e,o,r){const a=Qe(e.key,r);if(!(o==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(o==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return He[a]}function de(e,o=!1){const r=document.activeElement;for(const a of e)if(a===r||(a.focus({preventScroll:o}),document.activeElement!==r))return}function er(e,o){return e.map((r,a)=>e[(o+a)%e.length])}var rr=se,or=ie;/**
7
+ * @license lucide-react v0.542.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const ar=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],tr=O.b("circle",ar);var V="Radio",[nr,ue]=d.g(V),[cr,sr]=nr(V),fe=l.forwardRef((e,o)=>{const{__scopeRadio:r,name:a,checked:n=!1,required:c,disabled:s,value:i="on",onCheck:u,form:f,...b}=e,[p,v]=l.useState(null),k=d.P(o,m=>v(m)),h=l.useRef(!1),g=p?f||!!p.closest("form"):!0;return t.ae.jsxs(cr,{scope:r,checked:n,disabled:s,children:[t.ae.jsx(d.w.button,{type:"button",role:"radio","aria-checked":n,"data-state":ve(n),"data-disabled":s?"":void 0,disabled:s,value:i,...b,ref:k,onClick:d.j(e.onClick,m=>{n||u?.(),g&&(h.current=m.isPropagationStopped(),h.current||m.stopPropagation())})}),g&&t.ae.jsx(be,{control:p,bubbles:!h.current,name:a,value:i,checked:n,required:c,disabled:s,form:f,style:{transform:"translateX(-100%)"}})]})});fe.displayName=V;var pe="RadioIndicator",me=l.forwardRef((e,o)=>{const{__scopeRadio:r,forceMount:a,...n}=e,c=sr(pe,r);return t.ae.jsx(d.E,{present:a||c.checked,children:t.ae.jsx(d.w.span,{"data-state":ve(c.checked),"data-disabled":c.disabled?"":void 0,...n,ref:o})})});me.displayName=pe;var lr="RadioBubbleInput",be=l.forwardRef(({__scopeRadio:e,control:o,checked:r,bubbles:a=!0,...n},c)=>{const s=l.useRef(null),i=d.P(s,c),u=z(r),f=U(o);return l.useEffect(()=>{const b=s.current;if(!b)return;const p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"checked").set;if(u!==r&&v){const k=new Event("click",{bubbles:a});v.call(b,r),b.dispatchEvent(k)}},[u,r,a]),t.ae.jsx(d.w.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...n,tabIndex:-1,ref:i,style:{...n.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});be.displayName=lr;function ve(e){return e?"checked":"unchecked"}var dr=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],P="RadioGroup",[ir,xr]=d.g(P,[ce,ue]),he=ce(),ke=ue(),[ur,fr]=ir(P),ye=l.forwardRef((e,o)=>{const{__scopeRadioGroup:r,name:a,defaultValue:n,value:c,required:s=!1,disabled:i=!1,orientation:u,dir:f,loop:b=!0,onValueChange:p,...v}=e,k=he(r),h=te(f),[g,m]=d._({prop:c,defaultProp:n??null,onChange:p,caller:P});return t.ae.jsx(ur,{scope:r,name:a,required:s,disabled:i,value:g,onValueChange:m,children:t.ae.jsx(rr,{asChild:!0,...k,orientation:u,dir:h,loop:b,children:t.ae.jsx(d.w.div,{role:"radiogroup","aria-required":s,"aria-orientation":u,"data-disabled":i?"":void 0,dir:h,...v,ref:o})})})});ye.displayName=P;var xe="RadioGroupItem",ge=l.forwardRef((e,o)=>{const{__scopeRadioGroup:r,disabled:a,...n}=e,c=fr(xe,r),s=c.disabled||a,i=he(r),u=ke(r),f=l.useRef(null),b=d.P(o,f),p=c.value===n.value,v=l.useRef(!1);return l.useEffect(()=>{const k=g=>{dr.includes(g.key)&&(v.current=!0)},h=()=>v.current=!1;return document.addEventListener("keydown",k),document.addEventListener("keyup",h),()=>{document.removeEventListener("keydown",k),document.removeEventListener("keyup",h)}},[]),t.ae.jsx(or,{asChild:!0,...i,focusable:!s,active:p,children:t.ae.jsx(fe,{disabled:s,required:c.required,checked:p,...u,...n,name:c.name,ref:b,onCheck:()=>c.onValueChange(n.value),onKeyDown:d.j(k=>{k.key==="Enter"&&k.preventDefault()}),onFocus:d.j(n.onFocus,()=>{v.current&&f.current?.click()})})})});ge.displayName=xe;var pr="RadioGroupIndicator",we=l.forwardRef((e,o)=>{const{__scopeRadioGroup:r,...a}=e,n=ke(r);return t.ae.jsx(me,{...n,...a,ref:o})});we.displayName=pr;var Ce=ye,je=ge,mr=we;const br=t.j("aspect-square h-4 w-4 bg-primary-white dark:bg-primary-gray-650 rounded-full text-primary-gray-700 dark:text-primary-white shadow-sm focus:outline-hidden focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50",{variants:{color:{blue:"border-primary-blue-600 hover:bg-primary-blue-100 dark:border-primary-blue-400 dark:hover:bg-primary-blue-200",red:"border-accent-dark-red hover:bg-accent-light-red dark:border-accent-red dark:hover:bg-accent-light-red",black:"border-primary-gray-700 hover:bg-primary-gray-400 dark:border-primary-gray-100 dark:hover:bg-primary-gray-550",custom:"border-custom-color-600 hover:bg-custom-color-100 dark:border-custom-color-400 dark:hover:bg-custom-color-200"},variant:{light:"border",normal:"border-2"}},defaultVariants:{color:"red",variant:"normal"}}),vr=t.j("stroke-0",{variants:{color:{blue:"fill-primary-blue-600 dark:fill-primary-blue-400",red:"fill-accent-dark-red dark:fill-accent-red",black:"fill-primary-gray-700 dark:fill-primary-gray-100",custom:"fill-custom-color-600 dark:fill-custom-color-400"},variant:{light:"h-1.5 w-1.5",normal:"h-2.5 w-2.5"}},defaultVariants:{color:"red",variant:"normal"}}),Ie=w.createContext({color:null,variant:null}),Re=w.forwardRef(({className:e,color:o,variant:r,...a},n)=>{const c=w.useMemo(()=>({color:o,variant:r}),[o,r]);return t.ae.jsx(Ie.Provider,{value:c,children:t.ae.jsx(Ce,{...a,className:t.mo("flex gap-x-4 gap-y-2 flex-row flex-wrap rtl:[direction:rtl]",e),ref:n})})});Re.displayName=Ce.displayName;const _e=w.forwardRef(({className:e,radioClassName:o,labelClassName:r,label:a,...n},c)=>{const s=n.id||t.po(),{color:i,variant:u}=w.useContext(Ie);return t.ae.jsxs("div",{className:t.mo("flex flex-row gap-2 items-center",e),children:[t.ae.jsx(je,{...n,ref:c,className:t.mo(br({color:i,variant:u}),o),id:s,children:t.ae.jsx(mr,{className:"flex items-center justify-center",children:t.ae.jsx(tr,{className:vr({color:i,variant:u})})})}),t.ae.jsx(S,{className:t.mo("mt-0.5 text-base!",r),htmlFor:s,children:a})]})});_e.displayName=je.displayName;function hr(e,o,r){return o.findIndex(a=>a.chartConfigId===e)===-1?void 0:typeof o[o.findIndex(a=>a.chartConfigId===e)].columnId=="object"?o[o.findIndex(a=>a.chartConfigId===e)].columnId.map(a=>r.findIndex(n=>n.value===a)===-1?a:r[r.findIndex(n=>n.value===a)].label):r.findIndex(a=>a.value===o[o.findIndex(n=>n.chartConfigId===e)].columnId)===-1?o[o.findIndex(a=>a.chartConfigId===e)].columnId:r[r.findIndex(a=>a.value===o[o.findIndex(n=>n.chartConfigId===e)].columnId)].label}function kr(e,o){return o.findIndex(r=>r.chartConfigId===e)===-1?!1:typeof o[o.findIndex(r=>r.chartConfigId===e)].columnId!="string"}exports.G=ae;exports.checkIfMultiple=kr;exports.f=S;exports.fe=Re;exports.getValues=hr;exports.ve=_e;exports.w=oe;
12
- //# sourceMappingURL=checkIfMultiple-Do4kADNr.cjs.map
11
+ */const ar=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],tr=O.k("circle",ar);var V="Radio",[nr,ue]=i.g(V),[cr,sr]=nr(V),fe=l.forwardRef((e,o)=>{const{__scopeRadio:r,name:a,checked:n=!1,required:c,disabled:s,value:d="on",onCheck:u,form:f,...b}=e,[p,v]=l.useState(null),k=i.P(o,m=>v(m)),h=l.useRef(!1),g=p?f||!!p.closest("form"):!0;return t.ae.jsxs(cr,{scope:r,checked:n,disabled:s,children:[t.ae.jsx(i.w.button,{type:"button",role:"radio","aria-checked":n,"data-state":ve(n),"data-disabled":s?"":void 0,disabled:s,value:d,...b,ref:k,onClick:i.j(e.onClick,m=>{n||u?.(),g&&(h.current=m.isPropagationStopped(),h.current||m.stopPropagation())})}),g&&t.ae.jsx(be,{control:p,bubbles:!h.current,name:a,value:d,checked:n,required:c,disabled:s,form:f,style:{transform:"translateX(-100%)"}})]})});fe.displayName=V;var pe="RadioIndicator",me=l.forwardRef((e,o)=>{const{__scopeRadio:r,forceMount:a,...n}=e,c=sr(pe,r);return t.ae.jsx(i.E,{present:a||c.checked,children:t.ae.jsx(i.w.span,{"data-state":ve(c.checked),"data-disabled":c.disabled?"":void 0,...n,ref:o})})});me.displayName=pe;var lr="RadioBubbleInput",be=l.forwardRef(({__scopeRadio:e,control:o,checked:r,bubbles:a=!0,...n},c)=>{const s=l.useRef(null),d=i.P(s,c),u=z(r),f=U(o);return l.useEffect(()=>{const b=s.current;if(!b)return;const p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"checked").set;if(u!==r&&v){const k=new Event("click",{bubbles:a});v.call(b,r),b.dispatchEvent(k)}},[u,r,a]),t.ae.jsx(i.w.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...n,tabIndex:-1,ref:d,style:{...n.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});be.displayName=lr;function ve(e){return e?"checked":"unchecked"}var ir=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],P="RadioGroup",[dr,xr]=i.g(P,[ce,ue]),he=ce(),ke=ue(),[ur,fr]=dr(P),ye=l.forwardRef((e,o)=>{const{__scopeRadioGroup:r,name:a,defaultValue:n,value:c,required:s=!1,disabled:d=!1,orientation:u,dir:f,loop:b=!0,onValueChange:p,...v}=e,k=he(r),h=te(f),[g,m]=i._({prop:c,defaultProp:n??null,onChange:p,caller:P});return t.ae.jsx(ur,{scope:r,name:a,required:s,disabled:d,value:g,onValueChange:m,children:t.ae.jsx(rr,{asChild:!0,...k,orientation:u,dir:h,loop:b,children:t.ae.jsx(i.w.div,{role:"radiogroup","aria-required":s,"aria-orientation":u,"data-disabled":d?"":void 0,dir:h,...v,ref:o})})})});ye.displayName=P;var xe="RadioGroupItem",ge=l.forwardRef((e,o)=>{const{__scopeRadioGroup:r,disabled:a,...n}=e,c=fr(xe,r),s=c.disabled||a,d=he(r),u=ke(r),f=l.useRef(null),b=i.P(o,f),p=c.value===n.value,v=l.useRef(!1);return l.useEffect(()=>{const k=g=>{ir.includes(g.key)&&(v.current=!0)},h=()=>v.current=!1;return document.addEventListener("keydown",k),document.addEventListener("keyup",h),()=>{document.removeEventListener("keydown",k),document.removeEventListener("keyup",h)}},[]),t.ae.jsx(or,{asChild:!0,...d,focusable:!s,active:p,children:t.ae.jsx(fe,{disabled:s,required:c.required,checked:p,...u,...n,name:c.name,ref:b,onCheck:()=>c.onValueChange(n.value),onKeyDown:i.j(k=>{k.key==="Enter"&&k.preventDefault()}),onFocus:i.j(n.onFocus,()=>{v.current&&f.current?.click()})})})});ge.displayName=xe;var pr="RadioGroupIndicator",we=l.forwardRef((e,o)=>{const{__scopeRadioGroup:r,...a}=e,n=ke(r);return t.ae.jsx(me,{...n,...a,ref:o})});we.displayName=pr;var Ce=ye,je=ge,mr=we;const br=t.j("aspect-square h-4 w-4 bg-primary-white dark:bg-primary-gray-650 rounded-full text-primary-gray-700 dark:text-primary-white shadow-sm focus:outline-hidden focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50",{variants:{color:{blue:"border-primary-blue-600 hover:bg-primary-blue-100 dark:border-primary-blue-400 dark:hover:bg-primary-blue-200",red:"border-accent-dark-red hover:bg-accent-light-red dark:border-accent-red dark:hover:bg-accent-light-red",black:"border-primary-gray-700 hover:bg-primary-gray-400 dark:border-primary-gray-100 dark:hover:bg-primary-gray-550",custom:"border-custom-color-600 hover:bg-custom-color-100 dark:border-custom-color-400 dark:hover:bg-custom-color-200"},variant:{light:"border",normal:"border-2"}},defaultVariants:{color:"red",variant:"normal"}}),vr=t.j("stroke-0",{variants:{color:{blue:"fill-primary-blue-600 dark:fill-primary-blue-400",red:"fill-accent-dark-red dark:fill-accent-red",black:"fill-primary-gray-700 dark:fill-primary-gray-100",custom:"fill-custom-color-600 dark:fill-custom-color-400"},variant:{light:"h-1.5 w-1.5",normal:"h-2.5 w-2.5"}},defaultVariants:{color:"red",variant:"normal"}}),Ie=w.createContext({color:null,variant:null}),Re=w.forwardRef(({className:e,color:o,variant:r,...a},n)=>{const c=w.useMemo(()=>({color:o,variant:r}),[o,r]);return t.ae.jsx(Ie.Provider,{value:c,children:t.ae.jsx(Ce,{...a,className:t.mo("flex gap-x-4 gap-y-2 flex-row flex-wrap rtl:[direction:rtl]",e),ref:n})})});Re.displayName=Ce.displayName;const _e=w.forwardRef(({className:e,radioClassName:o,labelClassName:r,label:a,...n},c)=>{const s=n.id||t.po(),{color:d,variant:u}=w.useContext(Ie);return t.ae.jsxs("div",{className:t.mo("flex flex-row gap-2 items-center",e),children:[t.ae.jsx(je,{...n,ref:c,className:t.mo(br({color:d,variant:u}),o),id:s,children:t.ae.jsx(mr,{className:"flex items-center justify-center",children:t.ae.jsx(tr,{className:vr({color:d,variant:u})})})}),t.ae.jsx(S,{className:t.mo("mt-0.5 text-base!",r),htmlFor:s,children:a})]})});_e.displayName=je.displayName;function hr(e,o,r){return o.findIndex(a=>a.chartConfigId===e)===-1?void 0:typeof o[o.findIndex(a=>a.chartConfigId===e)].columnId=="object"?o[o.findIndex(a=>a.chartConfigId===e)].columnId.map(a=>r.findIndex(n=>n.value===a)===-1?a:r[r.findIndex(n=>n.value===a)].label):r.findIndex(a=>a.value===o[o.findIndex(n=>n.chartConfigId===e)].columnId)===-1?o[o.findIndex(a=>a.chartConfigId===e)].columnId:r[r.findIndex(a=>a.value===o[o.findIndex(n=>n.chartConfigId===e)].columnId)].label}function kr(e,o){return o.findIndex(r=>r.chartConfigId===e)===-1?!1:typeof o[o.findIndex(r=>r.chartConfigId===e)].columnId!="string"}exports.G=ae;exports.checkIfMultiple=kr;exports.f=S;exports.fe=Re;exports.getValues=hr;exports.ve=_e;exports.w=oe;
12
+ //# sourceMappingURL=checkIfMultiple-BXbHUCWM.cjs.map